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([[242,3,4,7,8],{"++UQ":function(We,ge,D){},"+NIl":function(We,ge,D){(function(q){q(D("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(z,P){"use strict";function Y(c,o){c.cmdState.push(o)}function N(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function O(c){var o=c.cmdState.pop();o&&o.closeBracket()}function H(c){for(var o=c.cmdState,d=o.length-1;d>=0;d--){var i=o[d];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function k(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=k("importmodule","tag",["string","builtin"]),n.documentclass=k("documentclass","tag",["","atom"]),n.usepackage=k("usepackage","tag",["atom"]),n.begin=k("begin","tag",["atom"]),n.end=k("end","tag",["atom"]),n.label=k("label","tag",["atom"]),n.ref=k("ref","tag",["atom"]),n.eqref=k("eqref","tag",["atom"]),n.cite=k("cite","tag",["atom"]),n.bibitem=k("bibitem","tag",["atom"]),n.Bibitem=k("Bibitem","tag",["atom"]),n.RBibitem=k("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,o){c.f=o}function g(c,o){var d;if(c.match(/^\\[a-zA-Z@]+/)){var i=c.current().slice(1);return d=n.hasOwnProperty(i)?n[i]:n.DEFAULT,d=new d,Y(o,d),I(o,h),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(o,function(r,s){return p(r,s,"\\]")}),"keyword";if(c.match("\\("))return I(o,function(r,s){return p(r,s,"\\)")}),"keyword";if(c.match("$$"))return I(o,function(r,s){return p(r,s,"$$")}),"keyword";if(c.match("$"))return I(o,function(r,s){return p(r,s,"$")}),"keyword";var a=c.next();if(a=="%")return c.skipToEnd(),"comment";if(a=="}"||a=="]"){if(d=N(o),d)d.closeBracket(a),I(o,h);else return"error";return"bracket"}else return a=="{"||a=="["?(d=n.DEFAULT,d=new d,Y(o,d),"bracket"):/\d/.test(a)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=H(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 I(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 i=c.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(c.skipToEnd(),"comment"):"error"}function h(c,o){var d=c.peek(),i;return d=="{"||d=="["?(i=N(o),i.openBracket(d),c.eat(d),I(o,g),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(I(o,g),O(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:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+QRC":function(We,ge,D){"use strict";var q=D("E9nw"),z={"text/plain":"Text","text/html":"Url",default:"Text"},P="Copy to clipboard: #{key}, Enter";function Y(O){var H=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return O.replace(/#{\s*key\s*}/g,H)}function N(O,H){var k,n,I,g,p,h,c=!1;H||(H={}),k=H.debug||!1;try{I=q(),g=document.createRange(),p=document.getSelection(),h=document.createElement("span"),h.textContent=O,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(),H.format)if(d.preventDefault(),typeof d.clipboardData=="undefined"){k&&console.warn("unable to use e.clipboardData"),k&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=z[H.format]||z.default;window.clipboardData.setData(i,O)}else d.clipboardData.clearData(),d.clipboardData.setData(H.format,O);H.onCopy&&(d.preventDefault(),H.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){k&&console.error("unable to copy using execCommand: ",d),k&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(H.format||"text",O),H.onCopy&&H.onCopy(window.clipboardData),c=!0}catch(i){k&&console.error("unable to copy using clipboardData: ",i),k&&console.error("falling back to prompt"),n=Y("message"in H?H.message:P),window.prompt(n,O)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(g):p.removeAllRanges()),h&&document.body.removeChild(h),I()}return c}We.exports=N},"+aKw":function(We,ge,D){"use strict";var q=D("tJVT"),z=D("q1tI"),P=D.n(z),Y=function(H){return String(H).length===1?"0".concat(H):H},N=function(H){var k=H.className,n=k===void 0?"":k,I=H.onChange,g=H.defaultValue,p=g===void 0?0:g,h=Object(z.useState)(p),c=Object(q.a)(h,2),o=c[0],d=c[1];Object(z.useEffect)(function(){var s=setTimeout(function(){d(o+1e3)},1e3);return I(o+1e3),function(){clearInterval(s)}},[o]);var i=parseInt(o/(60*6e4))||"00",a=parseInt(o%(60*6e4)/6e4)||"00",r=parseInt(o%6e4/1e3)||"00";return P.a.createElement("div",{className:n},Y(i),":",Y(a),":",Y(r))};ge.a=N},"+ua5":function(We,ge,D){},"/cxE":function(We,ge,D){"use strict";D.d(ge,"f",function(){return P}),D.d(ge,"g",function(){return Y}),D.d(ge,"h",function(){return N}),D.d(ge,"e",function(){return H}),D.d(ge,"b",function(){return k}),D.d(ge,"c",function(){return n}),D.d(ge,"d",function(){return I}),D.d(ge,"a",function(){return g});class q{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 q;function P(p){H(p)||z.onUnexpectedError(p);return}function Y(p){H(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 O="Canceled";function H(p){return p instanceof Error&&p.name===O&&p.message===O}function k(){const p=new Error(O);return p.name=p.message,p}function n(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function I(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class g extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"07cG":function(We,ge,D){We.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(We,ge){var D=arguments[3],q=arguments[4],z=arguments[5],P=JSON.stringify;We.exports=function(Y,N){for(var O,H=Object.keys(z),k=0,n=H.length;k<n;k++){var I=H[k],g=z[I].exports;if(g===Y||g&&g.default===Y){O=I;break}}if(!O){O=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var p={},k=0,n=H.length;k<n;k++){var I=H[k];p[I]=I}q[O]=["function(require,module,exports){"+Y+"(self); }",p]}var h=Math.floor(Math.pow(16,8)*Math.random()).toString(16),c={};c[O]=O,q[h]=["function(require,module,exports){var f = require("+P(O)+");(f.default ? f.default : f)(self);}",c];var o={};d(h);function d(x){o[x]=!0;for(var T in q[x][1]){var A=q[x][1][T];o[A]||d(A)}}var i="("+D+")({"+Object.keys(o).map(function(x){return P(x)+":["+q[x][0]+","+P(q[x][1])+"]"}).join(",")+"},{},["+P(h)+"])",a=window.URL||window.webkitURL||window.mozURL||window.msURL,r=new Blob([i],{type:"text/javascript"});if(N&&N.bare)return r;var s=a.createObjectURL(r),S=new Worker(s);return S.objectURL=s,S}},"19Vz":function(We,ge,D){(function(q){q(D("VrN/"))})(function(q){q.defineOption("placeholder","",function(k,n,I){var g=I&&I!=q.Init;if(n&&!g)k.on("blur",N),k.on("change",O),k.on("swapDoc",O),q.on(k.getInputField(),"compositionupdate",k.state.placeholderCompose=function(){Y(k)}),O(k);else if(!n&&g){k.off("blur",N),k.off("change",O),k.off("swapDoc",O),q.off(k.getInputField(),"compositionupdate",k.state.placeholderCompose),z(k);var p=k.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!k.hasFocus()&&N(k)});function z(k){k.state.placeholder&&(k.state.placeholder.parentNode.removeChild(k.state.placeholder),k.state.placeholder=null)}function P(k){z(k);var n=k.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=k.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var I=k.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),n.appendChild(I),k.display.lineSpace.insertBefore(n,k.display.lineSpace.firstChild)}function Y(k){setTimeout(function(){var n=!1,I=k.getInputField();I.nodeName=="TEXTAREA"?n=!I.value:k.lineCount()==1&&(n=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),n?P(k):z(k)},20)}function N(k){H(k)&&P(k)}function O(k){var n=k.getWrapperElement(),I=H(k);n.className=n.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?P(k):z(k)}function H(k){return k.lineCount()===1&&k.getLine(0)===""}})},"1FX+":function(We,ge,D){We.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(We,ge,D){(function(q){q(D("VrN/"))})(function(q){"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};q.defineMode("xml",function(Y,N){var O=Y.indentUnit,H={},k=N.htmlMode?z:P;for(var n in k)H[n]=k[n];for(var n in N)H[n]=N[n];var I,g;function p(f,C){function b(W){return C.tokenize=W,W(f,C)}var y=f.next();if(y=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?b(o("atom","]]>")):null:f.match("--")?b(o("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),b(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=o("meta","?>"),"meta"):(I=f.eat("/")?"closeTag":"openTag",C.tokenize=h,"tag bracket");if(y=="&"){var M;return f.eat("#")?f.eat("x")?M=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):M=f.eatWhile(/[\d]/)&&f.eat(";"):M=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),M?"atom":"error"}else return f.eatWhile(/[^&<]/),null}p.isInText=!0;function h(f,C){var b=f.next();if(b==">"||b=="/"&&f.eat(">"))return C.tokenize=p,I=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return I="equals",null;if(b=="<"){C.tokenize=p,C.state=s,C.tagName=C.tagStart=null;var y=C.tokenize(f,C);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(b)?(C.tokenize=c(b),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(f){var C=function(b,y){for(;!b.eol();)if(b.next()==f){y.tokenize=h;break}return"string"};return C.isInAttribute=!0,C}function o(f,C){return function(b,y){for(;!b.eol();){if(b.match(C)){y.tokenize=p;break}b.next()}return f}}function d(f){return function(C,b){for(var y;(y=C.next())!=null;){if(y=="<")return b.tokenize=d(f+1),b.tokenize(C,b);if(y==">")if(f==1){b.tokenize=p;break}else return b.tokenize=d(f-1),b.tokenize(C,b)}return"meta"}}function i(f,C,b){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=b,(H.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function a(f){f.context&&(f.context=f.context.prev)}function r(f,C){for(var b;;){if(!f.context)return;if(b=f.context.tagName,!H.contextGrabbers.hasOwnProperty(b)||!H.contextGrabbers[b].hasOwnProperty(C))return;a(f)}}function s(f,C,b){return f=="openTag"?(b.tagStart=C.column(),S):f=="closeTag"?x:s}function S(f,C,b){return f=="word"?(b.tagName=C.current(),g="tag",w):H.allowMissingTagName&&f=="endTag"?(g="tag bracket",w(f,C,b)):(g="error",S)}function x(f,C,b){if(f=="word"){var y=C.current();return b.context&&b.context.tagName!=y&&H.implicitlyClosed.hasOwnProperty(b.context.tagName)&&a(b),b.context&&b.context.tagName==y||H.matchClosing===!1?(g="tag",T):(g="tag error",A)}else return H.allowMissingTagName&&f=="endTag"?(g="tag bracket",T(f,C,b)):(g="error",A)}function T(f,C,b){return f!="endTag"?(g="error",T):(a(b),s)}function A(f,C,b){return g="error",T(f,C,b)}function w(f,C,b){if(f=="word")return g="attribute",v;if(f=="endTag"||f=="selfcloseTag"){var y=b.tagName,M=b.tagStart;return b.tagName=b.tagStart=null,f=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(y)?r(b,y):(r(b,y),b.context=new i(b,y,M==b.indented)),s}return g="error",w}function v(f,C,b){return f=="equals"?E:(H.allowMissing||(g="error"),w(f,C,b))}function E(f,C,b){return f=="string"?m:f=="word"&&H.allowUnquoted?(g="string",w):(g="error",w(f,C,b))}function m(f,C,b){return f=="string"?m:w(f,C,b)}return{startState:function(f){var C={tokenize:p,state:s,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;I=null;var b=C.tokenize(f,C);return(b||I)&&b!="comment"&&(g=null,C.state=C.state(I||b,f,C),g&&(b=g=="error"?b+" error":g)),b},indent:function(f,C,b){var y=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+O;if(y&&y.noIndent)return q.Pass;if(f.tokenize!=h&&f.tokenize!=p)return b?b.match(/^(\s*)/)[0].length:0;if(f.tagName)return H.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+O*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var M=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(M&&M[1])for(;y;)if(y.tagName==M[2]){y=y.prev;break}else if(H.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(M)for(;y;){var W=H.contextGrabbers[y.tagName];if(W&&W.hasOwnProperty(M[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+O:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(f){f.state==E&&(f.state=w)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],b=f.context;b;b=b.prev)b.tagName&&C.push(b.tagName);return C.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(We,ge,D){"use strict";D.d(ge,"a",function(){return z});class q{constructor(P){this.element=P,this.next=q.Undefined,this.prev=q.Undefined}}q.Undefined=new q(void 0);class z{constructor(){this._first=q.Undefined,this._last=q.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===q.Undefined}clear(){let P=this._first;for(;P!==q.Undefined;){const Y=P.next;P.prev=q.Undefined,P.next=q.Undefined,P=Y}this._first=q.Undefined,this._last=q.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,Y){const N=new q(P);if(this._first===q.Undefined)this._first=N,this._last=N;else if(Y){const H=this._last;this._last=N,N.prev=H,H.next=N}else{const H=this._first;this._first=N,N.next=H,H.prev=N}this._size+=1;let O=!1;return()=>{O||(O=!0,this._remove(N))}}shift(){if(this._first===q.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===q.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==q.Undefined&&P.next!==q.Undefined){const Y=P.prev;Y.next=P.next,P.next.prev=Y}else P.prev===q.Undefined&&P.next===q.Undefined?(this._first=q.Undefined,this._last=q.Undefined):P.next===q.Undefined?(this._last=this._last.prev,this._last.next=q.Undefined):P.prev===q.Undefined&&(this._first=this._first.next,this._first.prev=q.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==q.Undefined;)yield P.element,P=P.next}}},"3/fG":function(We,ge,D){"use strict";D.d(ge,"a",function(){return z});function q(P,Y){let N;return Y.length===0?N=P:N=P.replace(/\{(\d+)\}/g,function(O,H){const k=H[0];return typeof Y[k]!="undefined"?Y[k]:O}),N}function z(P,Y,...N){return q(Y,N)}},"3tLw":function(We,ge,D){We.exports=D.p+"static/a.39070d50.svg"},"4xil":function(We,ge,D){We.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(We,ge,D){"use strict";D.d(ge,"a",function(){return r});var q=D("Ty5D"),z=D("dI71"),P=D("q1tI"),Y=D.n(P),N=D("YS25"),O=D("17x9"),H=D.n(O),k=D("wx14"),n=D("zLVn"),I=D("9R94"),g=function(E){Object(z.a)(m,E);function m(){for(var C,b=arguments.length,y=new Array(b),M=0;M<b;M++)y[M]=arguments[M];return C=E.call.apply(E,[this].concat(y))||this,C.history=Object(N.a)(C.props),C}var f=m.prototype;return f.render=function(){return Y.a.createElement(q.c,{history:this.history,children:this.props.children})},m}(Y.a.Component),p=function(E){Object(z.a)(m,E);function m(){for(var C,b=arguments.length,y=new Array(b),M=0;M<b;M++)y[M]=arguments[M];return C=E.call.apply(E,[this].concat(y))||this,C.history=Object(N.b)(C.props),C}var f=m.prototype;return f.render=function(){return Y.a.createElement(q.c,{history:this.history,children:this.props.children})},m}(Y.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=Y.a.forwardRef;typeof d=="undefined"&&(d=o);function i(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var a=d(function(E,m){var f=E.innerRef,C=E.navigate,b=E.onClick,y=Object(n.a)(E,["innerRef","navigate","onClick"]),M=y.target,W=Object(k.a)({},y,{onClick:function(K){try{b&&b(K)}catch(F){throw K.preventDefault(),F}!K.defaultPrevented&&K.button===0&&(!M||M==="_self")&&!i(K)&&(K.preventDefault(),C())}});return o!==d?W.ref=m||f:W.ref=f,Y.a.createElement("a",W)}),r=d(function(E,m){var f=E.component,C=f===void 0?a:f,b=E.replace,y=E.to,M=E.innerRef,W=Object(n.a)(E,["component","replace","to","innerRef"]);return Y.a.createElement(q.e.Consumer,null,function(L){L||Object(I.a)(!1);var K=L.history,F=c(h(y,L.location),L.location),R=F?K.createHref(F):"",V=Object(k.a)({},W,{href:R,navigate:function(){var se=h(y,L.location),Se=b?K.replace:K.push;Se(se)}});return o!==d?V.ref=m||M:V.innerRef=M,Y.a.createElement(C,V)})});if(!1)var s,S;var x=function(m){return m},T=Y.a.forwardRef;typeof T=="undefined"&&(T=x);function A(){for(var E=arguments.length,m=new Array(E),f=0;f<E;f++)m[f]=arguments[f];return m.filter(function(C){return C}).join(" ")}var w=T(function(E,m){var f=E["aria-current"],C=f===void 0?"page":f,b=E.activeClassName,y=b===void 0?"active":b,M=E.activeStyle,W=E.className,L=E.exact,K=E.isActive,F=E.location,R=E.sensitive,V=E.strict,ne=E.style,se=E.to,Se=E.innerRef,Le=Object(n.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Y.a.createElement(q.e.Consumer,null,function(Ae){Ae||Object(I.a)(!1);var Pe=F||Ae.location,Fe=c(h(se,Pe),Pe),je=Fe.pathname,Te=je&&je.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Z=Te?Object(q.f)(Pe.pathname,{path:Te,exact:L,sensitive:R,strict:V}):null,U=!!(K?K(Z,Pe):Z),G=U?A(W,y):W,ee=U?Object(k.a)({},ne,{},M):ne,ue=Object(k.a)({"aria-current":U&&C||null,className:G,style:ee,to:Fe},Le);return x!==T?ue.ref=m||Se:ue.innerRef=Se,Y.a.createElement(r,ue)})});if(!1)var v},"5VLF":function(We,ge,D){"use strict";var q,z;function P(Y,N,O){var H=function(k,n){return Y.js_beautify(k,n)};return H.js=Y.js_beautify,H.css=N.css_beautify,H.html=O.html_beautify,H.js_beautify=Y.js_beautify,H.css_beautify=N.css_beautify,H.html_beautify=O.html_beautify,H}!(q=[D("6UM0"),D("TXwP"),D("psGv")],z=function(Y,N,O){return P(Y,N,O)}.apply(ge,q),z!==void 0&&(We.exports=z))},"5Y4S":function(We,ge,D){"use strict";D.d(ge,"a",function(){return P});var q=D("MNsG");const z=q.b.performance&&typeof q.b.performance.now=="function";class P{constructor(Y){this._highResolution=z&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new P(Y)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?q.b.performance.now():Date.now()}}},"5nXd":function(We,ge,D){var q=D("MFOe"),z=q.slice,P=q.pluck,Y=q.each,N=q.bind,O=q.create,H=q.isList,k=q.isFunction,n=q.isObject;We.exports={createStore:p};var I={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&&!H(h)&&(h=[h]),c&&!H(c)&&(c=[c]);var d=o?"__storejs_"+o+"_":"",i=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 r={_namespacePrefix:d,_namespaceRegexp:i,_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 E(){return T?(Y(arguments,function(f,C){w[C]=f}),T.apply(v,w)):void 0}var m=[E].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(H(S)){Y(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),!k(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");Y(A,function(w,v){if(!k(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=O(r,I,{plugins:[]});return s.raw={},Y(s,function(S,x){k(S)&&(s.raw[x]=N(s,S))}),Y(h,function(S){s._addStorage(S)}),Y(c,function(S){s._addPlugin(S)}),s}},"6+eU":function(We,ge,D){"use strict";D.d(ge,"a",function(){return T});var q=D("wx14"),z=D("rePB"),P=D("VTBJ"),Y=D("1OyB"),N=D("vuIU"),O=D("Ji7U"),H=D("LK+K"),k=D("q1tI"),n=D.n(k),I=D("TSYQ"),g=D.n(I),p=function(w){var v,E="".concat(w.rootPrefixCls,"-item"),m=g()(E,"".concat(E,"-").concat(w.page),(v={},Object(z.a)(v,"".concat(E,"-active"),w.active),Object(z.a)(v,w.className,!!w.className),Object(z.a)(v,"".concat(E,"-disabled"),!w.page),v)),f=function(){w.onClick(w.page)},C=function(y){w.onKeyPress(y,w.onClick,w.page)};return n.a.createElement("li",{title:w.showTitle?w.page:null,className:m,onClick:f,onKeyPress:C,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(O.a)(v,A);var w=Object(H.a)(v);function v(){var E;Object(Y.a)(this,v);for(var m=arguments.length,f=new Array(m),C=0;C<m;C++)f[C]=arguments[C];return E=w.call.apply(w,[this].concat(f)),E.state={goInputText:""},E.buildOptionText=function(b){return"".concat(b," ").concat(E.props.locale.items_per_page)},E.changeSize=function(b){E.props.changeSize(Number(b))},E.handleChange=function(b){E.setState({goInputText:b.target.value})},E.handleBlur=function(b){var y=E.props,M=y.goButton,W=y.quickGo,L=y.rootPrefixCls,K=E.state.goInputText;if(M||K==="")return;if(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(L,"-prev"))>=0||b.relatedTarget.className.indexOf("".concat(L,"-next"))>=0))return;E.setState({goInputText:""}),W(E.getValidValue())},E.go=function(b){var y=E.state.goInputText;if(y==="")return;(b.keyCode===c.ENTER||b.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(N.a)(v,[{key:"getValidValue",value:function(){var m=this.state,f=m.goInputText,C=m.current;return!f||isNaN(f)?C:Number(f)}},{key:"getPageSizeOptions",value:function(){var m=this.props,f=m.pageSize,C=m.pageSizeOptions;return C.some(function(b){return b.toString()===f.toString()})?C:C.concat([f.toString()]).sort(function(b,y){var M=isNaN(Number(b))?0:Number(b),W=isNaN(Number(y))?0:Number(y);return M-W})}},{key:"render",value:function(){var m=this,f=this.props,C=f.pageSize,b=f.locale,y=f.rootPrefixCls,M=f.changeSize,W=f.quickGo,L=f.goButton,K=f.selectComponentClass,F=f.buildOptionText,R=f.selectPrefixCls,V=f.disabled,ne=this.state.goInputText,se="".concat(y,"-options"),Se=K,Le=null,Ae=null,Pe=null;if(!M&&!W)return null;var Fe=this.getPageSizeOptions();if(M&&Se){var je=Fe.map(function(Te,Z){return n.a.createElement(Se.Option,{key:Z,value:Te.toString()},(F||m.buildOptionText)(Te))});Le=n.a.createElement(Se,{disabled:V,prefixCls:R,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||Fe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Z){return Z.parentNode}},je)}return W&&(L&&(Pe=typeof L=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(se,"-quick-jumper-button")},b.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},L)),Ae=n.a.createElement("div",{className:"".concat(se,"-quick-jumper")},b.jump_to,n.a.createElement("input",{disabled:V,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),b.page,Pe)),n.a.createElement("li",{className:"".concat(se)},Le,Ae)}}]),v}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=o,i=D("N2Kk");function a(){}function r(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function s(A,w,v){return v}function S(A,w,v){var E=typeof A=="undefined"?w.pageSize:A;return Math.floor((v.total-1)/E)+1}var x=function(A){Object(O.a)(v,A);var w=Object(H.a)(v);function v(E){var m;Object(Y.a)(this,v),m=w.call(this,E),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(M,W){var L=m.props.prefixCls,K=M||n.a.createElement("button",{type:"button","aria-label":W,className:"".concat(L,"-item-link")});return typeof M=="function"&&(K=n.a.createElement(M,Object(P.a)({},m.props))),K},m.savePaginationNode=function(M){m.paginationNode=M},m.isValid=function(M){return r(M)&&M!==m.state.current},m.shouldDisplayQuickJumper=function(){var M=m.props,W=M.showQuickJumper,L=M.pageSize,K=M.total;return K<=L?!1:W},m.handleKeyDown=function(M){(M.keyCode===c.ARROW_UP||M.keyCode===c.ARROW_DOWN)&&M.preventDefault()},m.handleKeyUp=function(M){var W=m.getValidValue(M),L=m.state.currentInputValue;W!==L&&m.setState({currentInputValue:W}),M.keyCode===c.ENTER?m.handleChange(W):M.keyCode===c.ARROW_UP?m.handleChange(W-1):M.keyCode===c.ARROW_DOWN&&m.handleChange(W+1)},m.changePageSize=function(M){var W=m.state.current,L=S(M,m.state,m.props);W=W>L?L:W,L===0&&(W=m.state.current),typeof M=="number"&&("pageSize"in m.props||m.setState({pageSize:M}),"current"in m.props||m.setState({current:W,currentInputValue:W})),m.props.onShowSizeChange(W,M),"onChange"in m.props&&m.props.onChange&&m.props.onChange(W,M)},m.handleChange=function(M){var W=m.props.disabled,L=M;if(m.isValid(L)&&!W){var K=S(void 0,m.state,m.props);L>K?L=K:L<1&&(L=1),"current"in m.props||m.setState({current:L,currentInputValue:L});var F=m.state.pageSize;return m.props.onChange(L,F),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(M,W){if(M.key==="Enter"||M.charCode===13){for(var L=arguments.length,K=new Array(L>2?L-2:0),F=2;F<L;F++)K[F-2]=arguments[F];W.apply(void 0,K)}},m.runIfEnterPrev=function(M){m.runIfEnter(M,m.prev)},m.runIfEnterNext=function(M){m.runIfEnter(M,m.next)},m.runIfEnterJumpPrev=function(M){m.runIfEnter(M,m.jumpPrev)},m.runIfEnterJumpNext=function(M){m.runIfEnter(M,m.jumpNext)},m.handleGoTO=function(M){(M.keyCode===c.ENTER||M.type==="click")&&m.handleChange(m.state.currentInputValue)};var f=E.onChange!==a,C="current"in E;C&&!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 b=E.defaultCurrent;"current"in E&&(b=E.current);var y=E.defaultPageSize;return"pageSize"in E&&(y=E.pageSize),b=Math.min(b,S(y,void 0,E)),m.state={current:b,currentInputValue:b,pageSize:y},m}return Object(N.a)(v,[{key:"componentDidUpdate",value:function(m,f){var C=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var b=this.paginationNode.querySelector(".".concat(C,"-item-").concat(f.current));b&&document.activeElement===b&&b.blur()}}},{key:"getValidValue",value:function(m){var f=m.target.value,C=S(void 0,this.state,this.props),b=this.state.currentInputValue,y;return f===""?y=f:isNaN(Number(f))?y=b:f>=C?y=C:y=Number(f),y}},{key:"getShowSizeChanger",value:function(){var m=this.props,f=m.showSizeChanger,C=m.total,b=m.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:C>b}},{key:"renderPrev",value:function(m){var f=this.props,C=f.prevIcon,b=f.itemRender,y=b(m,"prev",this.getItemIcon(C,"prev page")),M=!this.hasPrev();return Object(k.isValidElement)(y)?Object(k.cloneElement)(y,{disabled:M}):y}},{key:"renderNext",value:function(m){var f=this.props,C=f.nextIcon,b=f.itemRender,y=b(m,"next",this.getItemIcon(C,"next page")),M=!this.hasNext();return Object(k.isValidElement)(y)?Object(k.cloneElement)(y,{disabled:M}):y}},{key:"render",value:function(){var m=this,f=this.props,C=f.prefixCls,b=f.className,y=f.style,M=f.disabled,W=f.hideOnSinglePage,L=f.total,K=f.locale,F=f.showQuickJumper,R=f.showLessItems,V=f.showTitle,ne=f.showTotal,se=f.simple,Se=f.itemRender,Le=f.showPrevNextJumpers,Ae=f.jumpPrevIcon,Pe=f.jumpNextIcon,Fe=f.selectComponentClass,je=f.selectPrefixCls,Te=f.pageSizeOptions,Z=this.state,U=Z.current,G=Z.pageSize,ee=Z.currentInputValue;if(W===!0&&L<=G)return null;var ue=S(void 0,this.state,this.props),J=[],we=null,Ge=null,Je=null,be=null,Re=null,xe=F&&F.goButton,Ce=R?1:2,Be=U-1>0?U-1:0,Xe=U+1<ue?U+1:ue,qe=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 xe&&(typeof xe=="boolean"?Re=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},K.jump_to_confirm):Re=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},xe),Re=n.a.createElement("li",{title:V?"".concat(K.jump_to).concat(U,"/").concat(ue):null,className:"".concat(C,"-simple-pager")},Re)),n.a.createElement("ul",Object(q.a)({className:g()(C,"".concat(C,"-simple"),Object(z.a)({},"".concat(C,"-disabled"),M),b),style:y,ref:this.savePaginationNode},qe),n.a.createElement("li",{title:V?K.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(C,"-prev"),Object(z.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Be)),n.a.createElement("li",{title:V?"".concat(U,"/").concat(ue):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:ee,disabled:M,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),ue),n.a.createElement("li",{title:V?K.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(C,"-next"),Object(z.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Xe)),Re);if(ue<=3+Ce*2){var tt={locale:K,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:Se};ue||J.push(n.a.createElement(h,Object(q.a)({},tt,{key:"noPager",page:ue,className:"".concat(C,"-disabled")})));for(var ht=1;ht<=ue;ht+=1){var ft=U===ht;J.push(n.a.createElement(h,Object(q.a)({},tt,{key:ht,page:ht,active:ft})))}}else{var Ne=R?K.prev_3:K.prev_5,Ue=R?K.next_3:K.next_5;Le&&(we=n.a.createElement("li",{title:V?Ne:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(C,"-jump-prev"),Object(z.a)({},"".concat(C,"-jump-prev-custom-icon"),!!Ae))},Se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ae,"prev page"))),Ge=n.a.createElement("li",{title:V?Ue:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(C,"-jump-next"),Object(z.a)({},"".concat(C,"-jump-next-custom-icon"),!!Pe))},Se(this.getJumpNextPage(),"jump-next",this.getItemIcon(Pe,"next page")))),be=n.a.createElement(h,{locale:K,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ue,page:ue,active:!1,showTitle:V,itemRender:Se}),Je=n.a.createElement(h,{locale:K,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:Se});var Ze=Math.max(1,U-Ce),et=Math.min(U+Ce,ue);U-1<=Ce&&(et=1+Ce*2),ue-U<=Ce&&(Ze=ue-Ce*2);for(var fe=Ze;fe<=et;fe+=1){var re=U===fe;J.push(n.a.createElement(h,{locale:K,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:fe,page:fe,active:re,showTitle:V,itemRender:Se}))}U-1>=Ce*2&&U!==1+2&&(J[0]=Object(k.cloneElement)(J[0],{className:"".concat(C,"-item-after-jump-prev")}),J.unshift(we)),ue-U>=Ce*2&&U!==ue-2&&(J[J.length-1]=Object(k.cloneElement)(J[J.length-1],{className:"".concat(C,"-item-before-jump-next")}),J.push(Ge)),Ze!==1&&J.unshift(Je),et!==ue&&J.push(be)}var ie=null;ne&&(ie=n.a.createElement("li",{className:"".concat(C,"-total-text")},ne(L,[L===0?0:(U-1)*G+1,U*G>L?L:U*G])));var ce=!this.hasPrev()||!ue,pe=!this.hasNext()||!ue;return n.a.createElement("ul",Object(q.a)({className:g()(C,b,Object(z.a)({},"".concat(C,"-disabled"),M)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},qe),ie,n.a.createElement("li",{title:V?K.prev_page:null,onClick:this.prev,tabIndex:ce?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(C,"-prev"),Object(z.a)({},"".concat(C,"-disabled"),ce)),"aria-disabled":ce},this.renderPrev(Be)),J,n.a.createElement("li",{title:V?K.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(C,"-next"),Object(z.a)({},"".concat(C,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(Xe)),n.a.createElement(d,{disabled:M,locale:K,rootPrefixCls:C,selectComponentClass:Fe,selectPrefixCls:je,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:U,pageSize:G,pageSizeOptions:Te,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:xe}))}}],[{key:"getDerivedStateFromProps",value:function(m,f){var C={};if("current"in m&&(C.current=m.current,m.current!==f.current&&(C.currentInputValue=C.current)),"pageSize"in m&&m.pageSize!==f.pageSize){var b=f.current,y=S(m.pageSize,f,m);b=b>y?y:b,"current"in m||(C.current=b,C.currentInputValue=b),C.pageSize=m.pageSize}return C}}]),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:i.a,style:{},itemRender:s,totalBoundaryShowSizeChanger:50};var T=x},"6RRn":function(We,ge,D){"use strict";var q=D("wCXF"),z=D("n6Qo");D.d(ge,"b",function(){return z.a});var P=D("IBYe"),Y=D("6eGT"),N=D("hW8S");D.d(ge,"a",function(){return N.a}),ge.c=q.b},"6UM0":function(We,ge,D){var q,z;(function(){var P;(function(){"use strict";var N=[function(n,I,g){var p=g(1).Beautifier,h=g(5).Options;function c(o,d){var i=new p(o,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,I,g){var p=g(2).Output,h=g(3).Token,c=g(4),o=g(5).Options,d=g(7).Tokenizer,i=g(7).line_starters,a=g(7).positionable_operators,r=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===r.RESERVED&&R.text===V}function A(R,V){return R&&R.type===r.RESERVED&&s(R.text,V)}var w=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],E=x(v),m=[E.before_newline,E.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(R,V){if(V.multiline_frame||V.mode===f.ForInitializer||V.mode===f.Conditional)return;R.remove_indent(V.start_line_index)}function b(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 y(R){return R===f.ArrayLiteral}function M(R){return s(R,[f.Expression,f.ForInitializer,f.Conditional])}function W(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 K(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)}K.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(r.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},K.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},K.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},K.prototype.handle_token=function(R,V){R.type===r.START_EXPR?this.handle_start_expr(R):R.type===r.END_EXPR?this.handle_end_expr(R):R.type===r.START_BLOCK?this.handle_start_block(R):R.type===r.END_BLOCK?this.handle_end_block(R):R.type===r.WORD?this.handle_word(R):R.type===r.RESERVED?this.handle_word(R):R.type===r.SEMICOLON?this.handle_semicolon(R):R.type===r.STRING?this.handle_string(R):R.type===r.EQUALS?this.handle_equals(R):R.type===r.OPERATOR?this.handle_operator(R):R.type===r.COMMA?this.handle_comma(R):R.type===r.BLOCK_COMMENT?this.handle_block_comment(R,V):R.type===r.COMMENT?this.handle_comment(R,V):R.type===r.DOT?this.handle_dot(R):R.type===r.EOF?this.handle_eof(R):R.type===r.UNKNOWN?this.handle_unknown(R,V):this.handle_unknown(R,V)},K.prototype.handle_whitespace_and_comments=function(R,V){var ne=R.newlines,se=this._options.keep_array_indentation&&y(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 Le=0;Le<ne;Le+=1)this.print_newline(Le>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 F=["async","break","continue","return","throw","yield"];K.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,F))return;this._output.set_wrap_point()}},K.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!==r.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)},K.prototype.print_token_line_indentation=function(R){this._output.just_added_newline()&&(this._options.keep_array_indentation&&R.newlines&&(R.text==="["||y(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))},K.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===r.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)},K.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.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))},K.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)},K.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&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.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"]))},K.prototype.start_of_statement=function(R){var V=!1;return V=V||A(this._flags.last_token,["var","let","const"])&&R.type===r.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,F)&&!R.newlines,V=V||T(this._flags.last_token,"else")&&!(T(R,"if")&&!R.comments_before),V=V||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),V=V||this._flags.last_token.type===r.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==r.WORD&&R.type!==r.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},K.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===r.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,i)&&(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,y(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,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.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,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===r.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===r.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===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.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()},K.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==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.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(),C(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)},K.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===r.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,[r.STRING,r.WORD,r.RESERVED])||s(V.text,["get","set","..."])&&s(ne.type,[r.WORD,r.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===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):s(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.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===r.END_EXPR;if(this._options.brace_preserve_inline){var Le=0,Ae=null;this._flags.inline_frame=!0;do if(Le+=1,Ae=this._tokens.peek(Le-1),Ae.newlines){this._flags.inline_frame=!1;break}while(Ae.type!==r.EOF&&!(Ae.type===r.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!==r.OPERATOR&&(Se||this._flags.last_token.type===r.EQUALS||A(this._flags.last_token,w)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.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!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.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()},K.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===r.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(y(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)},K.prototype.handle_word=function(R){if(R.type===r.RESERVED){if(s(R.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)R.type=r.WORD;else if(R.text==="import"&&s(this._tokens.peek().text,["(","."]))R.type=r.WORD;else if(s(R.text,["as","from"])&&!this._flags.import_block)R.type=r.WORD;else if(this._flags.mode===f.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(R.type=r.WORD)}}if(this.start_of_statement(R)?A(this._flags.last_token,["var","let","const"])&&R.type===r.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!M(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.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===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.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===r.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,F)?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===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(M(this._flags.mode)||y(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===r.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===r.SEMICOLON&&this._flags.mode===f.BlockStatement?ne="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&M(this._flags.mode)?ne="SPACE":this._flags.last_token.type===r.STRING?ne="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.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===r.START_BLOCK?this._flags.inline_frame?ne="SPACE":ne="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,ne="NEWLINE"),A(R,i)&&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===r.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!==r.END_EXPR?(this._flags.last_token.type!==r.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,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(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===r.WORD||R.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===r.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))},K.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)},K.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},K.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},K.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?(M(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)},K.prototype.handle_operator=function(R){var V=R.text==="*"&&(A(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),ne=s(R.text,["-","+"])&&(s(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||s(this._flags.last_token.text,i)||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===r.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===r.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!==r.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,Le=!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 Pe=R.text===":",Fe=Pe&&Ae,je=Pe&&!Ae;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!je,this.print_token(R),(!Pe||Fe)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!Pe||Fe?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 E.preserve_newline:je||this.allow_wrap_or_preserved_newline(R),Se=!(this._output.just_added_newline()||je),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 Te=this._tokens.peek();Le=Te&&s(Te.type,[r.WORD,r.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),Se=this._flags.last_token.type===r.START_BLOCK,Le=!1;else if(s(R.text,["--","++","!","~"])||ne){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),Se=!1,Le=!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===";"&&M(this._flags.mode)&&(Se=!0),this._flags.last_token.type===r.RESERVED?Se=!0:this._flags.last_token.type===r.END_EXPR?Se=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===r.OPERATOR&&(Se=s(R.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(R.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Le=!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=Le},K.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)},K.prototype.print_block_commment=function(R,V){var ne=b(R.text),se,Se=!1,Le=!1,Ae=R.whitespace_before,Pe=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=W(ne,"*"),Le=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]))):Le&&ne[se]?(this.print_token_line_indentation(R),this._output.add_token(ne[se].substring(Pe))):(this._output.current_line.set_indent(-1),this._output.add_token(ne[se])),this.print_newline(!1,V);this._flags.alignment=0}},K.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)},K.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)},K.prototype.handle_unknown=function(R,V){this.print_token(R),R.text[R.text.length-1]===`
|
|
`&&this.print_newline(!1,V)},K.prototype.handle_eof=function(R){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},n.exports.Beautifier=K},function(n){function I(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=[]}I.prototype.clone_empty=function(){var h=new I(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},I.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},I.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},I.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))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var 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},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},I.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var 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 I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(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 I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},function(n){function I(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=I},function(n,I){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+"])*";I.identifier=new RegExp(o+d,"g"),I.identifierStart=new RegExp(o),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+h+c+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|
|
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(n,I,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 i=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<i.length;a++)i[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[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 I(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"])}I.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},I.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},I.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},I.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},I.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]},I.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},I.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=I,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},function(n,I,g){var p=g(8).InputScanner,h=g(9).Tokenizer,c=g(9).TOKEN,o=g(13).Directives,d=g(4),i=g(12).Pattern,a=g(14).TemplatablePattern;function r(W,L){return L.indexOf(W)!==-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 E=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"]),C=new RegExp("^(?:"+f.join("|")+")$"),b,y=function(W,L){h.call(this,W,L),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var K=new i(this._input),F=new a(this._input).read_options(this._options);this.__patterns={template:F,identifier:F.starting_with(d.identifier).matching(d.identifierMatch),number:K.matching(x),punct:K.matching(E),comment:K.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:K.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:K.matching(/<!--/),html_comment_end:K.matching(/-->/),include:K.starting_with(/#include/).until_after(d.lineBreak),shebang:K.starting_with(/#!/).until_after(d.lineBreak),xml:K.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:F.until(/['\\\n\r\u2028\u2029]/),double_quote:F.until(/["\\\n\r\u2028\u2029]/),template_text:F.until(/[`\\$]/),template_expression:F.until(/[`}\\]/)}};y.prototype=new h,y.prototype._is_comment=function(W){return W.type===s.COMMENT||W.type===s.BLOCK_COMMENT||W.type===s.UNKNOWN},y.prototype._is_opening=function(W){return W.type===s.START_BLOCK||W.type===s.START_EXPR},y.prototype._is_closing=function(W,L){return(W.type===s.END_BLOCK||W.type===s.END_EXPR)&&L&&(W.text==="]"&&L.text==="["||W.text===")"&&L.text==="("||W.text==="}"&&L.text==="{")},y.prototype._reset=function(){b=!1},y.prototype._get_next_token=function(W,L){var K=null;this._readWhitespace();var F=this._input.peek();return F===null?this._create_token(s.EOF,""):(K=K||this._read_non_javascript(F),K=K||this._read_string(F),K=K||this._read_word(W),K=K||this._read_singles(F),K=K||this._read_comment(F),K=K||this._read_regexp(F,W),K=K||this._read_xml(F,W),K=K||this._read_punctuation(),K=K||this._create_token(s.UNKNOWN,this._input.next()),K)},y.prototype._read_word=function(W){var L;if(L=this.__patterns.identifier.read(),L!=="")return L=L.replace(d.allLineBreaks,`
|
|
`),!(W.type===s.DOT||W.type===s.RESERVED&&(W.text==="set"||W.text==="get"))&&C.test(L)?(L==="in"||L==="of")&&(W.type===s.WORD||W.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)},y.prototype._read_singles=function(W){var L=null;return W==="("||W==="["?L=this._create_token(s.START_EXPR,W):W===")"||W==="]"?L=this._create_token(s.END_EXPR,W):W==="{"?L=this._create_token(s.START_BLOCK,W):W==="}"?L=this._create_token(s.END_BLOCK,W):W===";"?L=this._create_token(s.SEMICOLON,W):W==="."&&A.test(this._input.peek(1))?L=this._create_token(s.DOT,W):W===","&&(L=this._create_token(s.COMMA,W)),L&&this._input.next(),L},y.prototype._read_punctuation=function(){var W=this.__patterns.punct.read();if(W!=="")return W==="="?this._create_token(s.EQUALS,W):W==="?."?this._create_token(s.DOT,W):this._create_token(s.OPERATOR,W)},y.prototype._read_non_javascript=function(W){var L="";if(W==="#"){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()+`
|
|
`);W=this._input.next();var K="#";if(this._input.hasNext()&&this._input.testChar(T)){do W=this._input.next(),K+=W;while(this._input.hasNext()&&W!=="#"&&W!=="=");return W==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(K+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(K+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,K)}this._input.back()}else if(W==="<"&&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 b=!0,this._create_token(s.COMMENT,L)}}else if(b&&W==="-"&&(L=this.__patterns.html_comment_end.read(),L))return b=!1,this._create_token(s.COMMENT,L);return null},y.prototype._read_comment=function(W){var L=null;if(W==="/"){var K="";if(this._input.peek(1)==="*"){K=this.__patterns.block_comment.read();var F=S.get_directives(K);F&&F.ignore==="start"&&(K+=S.readIgnored(this._input)),K=K.replace(d.allLineBreaks,`
|
|
`),L=this._create_token(s.BLOCK_COMMENT,K),L.directives=F}else this._input.peek(1)==="/"&&(K=this.__patterns.comment.read(),L=this._create_token(s.COMMENT,K))}return L},y.prototype._read_string=function(W){if(W==="`"||W==="'"||W==='"'){var L=this._input.next();return this.has_char_escapes=!1,W==="`"?L+=this._read_string_recursive("`",!0,"${"):L+=this._read_string_recursive(W),this.has_char_escapes&&this._options.unescape_strings&&(L=M(L)),this._input.peek()===W&&(L+=this._input.next()),L=L.replace(d.allLineBreaks,`
|
|
`),this._create_token(s.STRING,L)}return null},y.prototype._allow_regexp_or_xml=function(W){return W.type===s.RESERVED&&r(W.text,["return","case","throw","else","do","typeof","yield"])||W.type===s.END_EXPR&&W.text===")"&&W.opened.previous.type===s.RESERVED&&r(W.opened.previous.text,["if","while","for"])||r(W.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(W,L){if(W==="/"&&this._allow_regexp_or_xml(L)){for(var K=this._input.next(),F=!1,R=!1;this._input.hasNext()&&(F||R||this._input.peek()!==W)&&!this._input.testChar(d.newline);)K+=this._input.peek(),F?F=!1:(F=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===W&&(K+=this._input.next(),K+=this._input.read(d.identifier)),this._create_token(s.STRING,K)}return null},y.prototype._read_xml=function(W,L){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(L)){var K="",F=this.__patterns.xml.read_match();if(F){for(var R=F[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=R.indexOf("{")===0,ne=0;F;){var se=!!F[1],Se=F[2],Le=!!F[F.length-1]||Se.slice(0,8)==="![CDATA[";if(!Le&&(Se===R||V&&Se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--ne:++ne),K+=F[0],ne<=0)break;F=this.__patterns.xml.read_match()}return F||(K+=this._input.match(/[\s\S]*/g)[0]),K=K.replace(d.allLineBreaks,`
|
|
`),this._create_token(s.STRING,K)}}return null};function M(W){for(var L="",K=0,F=new p(W),R=null;F.hasNext();)if(R=F.match(/([\s]|[^\\]|\\\\)+/g),R&&(L+=R[0]),F.peek()==="\\"){if(F.next(),F.peek()==="x")R=F.match(/x([0-9A-Fa-f]{2})/g);else if(F.peek()==="u")R=F.match(/u([0-9A-Fa-f]{4})/g);else{L+="\\",F.hasNext()&&(L+=F.next());continue}if(!R)return W;if(K=parseInt(R[1],16),K>126&&K<=255&&R[0].indexOf("x")===0)return W;if(K>=0&&K<32){L+="\\"+R[0];continue}else K===34||K===39||K===92?L+="\\"+String.fromCharCode(K):L+=String.fromCharCode(K)}return L}y.prototype._read_string_recursive=function(W,L,K){var F,R;W==="'"?R=this.__patterns.single_quote:W==='"'?R=this.__patterns.double_quote:W==="`"?R=this.__patterns.template_text:W==="}"&&(R=this.__patterns.template_expression);for(var V=R.read(),ne="";this._input.hasNext();){if(ne=this._input.next(),ne===W||!L&&d.newline.test(ne)){this._input.back();break}else ne==="\\"&&this._input.hasNext()?(F=this._input.peek(),F==="x"||F==="u"?this.has_char_escapes=!0:F==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ne+=this._input.next()):K&&(K==="${"&&ne==="$"&&this._input.peek()==="{"&&(ne+=this._input.next()),K===ne&&(W==="`"?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=y,n.exports.TOKEN=s,n.exports.positionable_operators=w.slice(),n.exports.line_starters=m.slice()},function(n){var I=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&&!(I&&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&&I&&(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,I,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"},i=function(a,r){this._input=new p(a),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,r=new h(d.START,""),s=null,S=[],x=new c;r.type!==d.EOF;){for(a=this._get_next_token(r,s);this._is_comment(a);)x.add(a),a=this._get_next_token(r,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=r,r.next=a,this.__tokens.add(a),r=a}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(a,r){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(d.RAW,s):this._create_token(d.EOF,"")},i.prototype._is_comment=function(a){return!1},i.prototype._is_opening=function(a){return!1},i.prototype._is_closing=function(a,r){return!1},i.prototype._create_token=function(a,r){var s=new h(a,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=i,n.exports.TOKEN=d},function(n){function I(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},I.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},I.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},n.exports.TokenStream=I},function(n,I,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,i=[],a=c.exec(o);a;)i.push(o.substring(d,a.index)),d=a.index+a[0].length,a=c.exec(o);return d<o.length?i.push(o.substring(d,o.length)):i.push(""),i},n.exports.WhitespacePattern=h},function(n){function I(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)}I.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},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.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},I.prototype.until=function(g){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(g),p._update(),p},I.prototype.starting_with=function(g){var p=this._create();return p._starting_pattern=this._input.get_regexp(g,!0),p._update(),p},I.prototype.matching=function(g){var p=this._create();return p._match_pattern=this._input.get_regexp(g,!0),p._update(),p},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},n.exports.Pattern=I},function(n){function I(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")}I.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},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},function(n,I,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 i=new p(o);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}/)}}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 i in h)d._disabled[i]=o.templating.indexOf(i)===-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 i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(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}],O={};function H(n){var I=O[n];if(I!==void 0)return I.exports;var g=O[n]={exports:{}};return N[n](g,g.exports,H),g.exports}var k=H(0);P=k})();var Y=P;!(q=[],z=function(){return{js_beautify:Y}}.apply(ge,q),z!==void 0&&(We.exports=z))})()},"6eGT":function(We,ge,D){"use strict";function q(z){return null}ge.a=q},"7+5b":function(We,ge,D){We.exports=D.p+"static/v.e7f297d6.svg"},"746U":function(We,ge,D){"use strict";D.d(ge,"f",function(){return q}),D.d(ge,"l",function(){return z}),D.d(ge,"k",function(){return P}),D.d(ge,"j",function(){return Y}),D.d(ge,"g",function(){return N}),D.d(ge,"m",function(){return O}),D.d(ge,"h",function(){return H}),D.d(ge,"n",function(){return k}),D.d(ge,"c",function(){return n}),D.d(ge,"a",function(){return I}),D.d(ge,"i",function(){return g}),D.d(ge,"o",function(){return p}),D.d(ge,"e",function(){return o}),D.d(ge,"d",function(){return d}),D.d(ge,"p",function(){return i}),D.d(ge,"b",function(){return a});function q(r){return Array.isArray(r)}function z(r){return typeof r=="string"}function P(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function Y(r){return typeof r=="number"&&!isNaN(r)}function N(r){return r===!0||r===!1}function O(r){return typeof r=="undefined"}function H(r){return!k(r)}function k(r){return O(r)||r===null}function n(r,s){if(!r)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function I(r){if(k(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function g(r){return typeof r=="function"}function p(r,s){const S=Math.min(r.length,s.length);for(let x=0;x<S;x++)h(r[x],s[x])}function h(r,s){if(z(s)){if(typeof r!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(g(s)){try{if(r instanceof s)return}catch(S){}if(!k(r)&&r.constructor===s)return;if(s.length===1&&s.call(void 0,r)===!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(r){let s=[],S=Object.getPrototypeOf(r);for(;Object.prototype!==S;)s=s.concat(Object.getOwnPropertyNames(S)),S=Object.getPrototypeOf(S);return s}function o(r){const s=[];for(const S of c(r))typeof r[S]=="function"&&s.push(S);return s}function d(r,s){const S=T=>function(){const A=Array.prototype.slice.call(arguments,0);return s(T,A)};let x={};for(const T of r)x[T]=S(T);return x}function i(r){return r===null?void 0:r}function a(r,s="Unreachable"){throw new Error(s)}},"7Cbv":function(We,ge,D){"use strict";var q=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(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(z)}var Y=/^(?:[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"&&Y.test(h)}for(var O=N,H=[],k=0;k<256;++k)H.push((k+256).toString(16).substr(1));function n(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(H[h[c+0]]+H[h[c+1]]+H[h[c+2]]+H[h[c+3]]+"-"+H[h[c+4]]+H[h[c+5]]+"-"+H[h[c+6]]+H[h[c+7]]+"-"+H[h[c+8]]+H[h[c+9]]+"-"+H[h[c+10]]+H[h[c+11]]+H[h[c+12]]+H[h[c+13]]+H[h[c+14]]+H[h[c+15]]).toLowerCase();if(!O(o))throw TypeError("Stringified UUID is invalid");return o}var I=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 i=0;i<16;++i)c[o+i]=d[i];return c}return I(d)}var p=ge.a=g},"7ahc":function(We,ge,D){"use strict";D.d(ge,"a",function(){return S});var q=D("k1fw"),z=D("0Owb"),P=D("+L6B"),Y=D("2/Rp"),N=D("y8nQ"),O=D("Vl3Y"),H=D("tJVT"),k=D("OaEy"),n=D("2fM7"),I=D("q1tI"),g=D.n(I),p=D("VrN/"),h=D.n(p),c=D("p77/"),o=D.n(c),d=D("c5Ni"),i=D.n(d),a=n.a.Option,r={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"]};ge.b=function(x){var T=x.callback,A=x.onCancel,w=Object(I.useState)("python"),v=Object(H.a)(w,2),E=v[0],m=v[1];function f(b){m(s[b][1])}function C(b){T(b)}return g.a.createElement(O.a,Object(z.a)({},r,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),g.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(n.a,{onChange:f},Object.keys(s).map(function(b){return g.a.createElement(a,{key:b,value:b},s[b][0])}))),g.a.createElement(O.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:E})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(Y.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function S(x){var T=x.value,A=x.onChange,w=x.mode,v=x.options,E=v===void 0?{}:v,m=Object(I.useRef)(),f=Object(I.useState)(),C=Object(H.a)(f,2),b=C[0],y=C[1];return Object(I.useEffect)(function(){if(b){function M(W){var L=W.getValue();A&&A(L)}return b.on("change",M),function(){b.off("change",M)}}},[b,A]),Object(I.useEffect)(function(){b&&b.setOption("mode",w)},[b,w]),Object(I.useEffect)(function(){b&&((T!==b.getValue()||T==="")&&setTimeout(function(){b.setValue(T||" ")},300))},[b,T]),Object(I.useEffect)(function(){if(m.current&&!b){var M=h.a.fromTextArea(m.current,Object(q.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));y(M)}},[m.current,b]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:m}))}},"7qur":function(We,ge,D){"use strict";D.d(ge,"m",function(){return z}),D.d(ge,"s",function(){return P}),D.d(ge,"h",function(){return Y}),D.d(ge,"o",function(){return N}),D.d(ge,"n",function(){return O}),D.d(ge,"l",function(){return H}),D.d(ge,"b",function(){return k}),D.d(ge,"q",function(){return n}),D.d(ge,"t",function(){return I}),D.d(ge,"v",function(){return g}),D.d(ge,"w",function(){return p}),D.d(ge,"u",function(){return h}),D.d(ge,"p",function(){return c}),D.d(ge,"f",function(){return o}),D.d(ge,"a",function(){return d}),D.d(ge,"j",function(){return i}),D.d(ge,"k",function(){return a}),D.d(ge,"d",function(){return r}),D.d(ge,"g",function(){return s}),D.d(ge,"c",function(){return S}),D.d(ge,"e",function(){return x}),D.d(ge,"i",function(){return T}),D.d(ge,"r",function(){return A});var q=D("ErOA");function z(w){return Object(q.c)("mypractices/".concat(w,".json"),{hidePopLogin:!0})}function P(w,v){return Object(q.f)("mypractices/".concat(w,"/code_submit.json"),v)}function Y(w,v){return Object(q.c)("mypractices/".concat(w,"/code_debug.json"),v)}function N(w,v){return Object(q.c)("mypractices/".concat(w,"/submit_records.json"),v)}function O(w){return Object(q.c)("mypractices/record_detail.json",{id:w})}function H(w,v){return Object(q.c)("mypractices/".concat(w,"/result.json"),{mode:v})}function k(w,v){return Object(q.f)("mypractices/".concat(w,"/add_notes.json"),v)}function n(w,v){return Object(q.f)("mypractices/".concat(w,"/restore_initial_code.json"),v)}function I(w,v){return Object(q.f)("mypractices/".concat(w,"/sync_code.json"),v)}function g(w,v){return Object(q.f)("mypractices/".concat(w,"/update_code.json"),v)}function p(w){return Object(q.f)("mypractices/".concat(w,"/initial_codes.json"))}function h(w,v){return Object(q.f)("discusses/".concat(w,"/plus.json"),v)}function c(w){return Object(q.c)("practices/practices_list.json",w)}function o(w,v){return Object(q.c)("practices/".concat(w,"/question_solution_articles"),v)}function d(w,v){return Object(q.f)("practices/".concat(w,"/question_solution_articles"),v)}function i(w,v){return Object(q.g)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function a(w,v){return Object(q.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/edit"),v)}function r(w,v){return Object(q.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function s(w,v){return Object(q.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(q.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/praise_or_treads"),v)}function x(w,v){return Object(q.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/hide"))}function T(w,v){return Object(q.b)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function A(w,v){return Object(q.f)("mypractices/".concat(w,"/update_practice_time_sum"),v)}},"815F":function(We,ge,D){"use strict";D.d(ge,"e",function(){return H}),D.d(ge,"c",function(){return n}),D.d(ge,"d",function(){return I}),D.d(ge,"a",function(){return p}),D.d(ge,"f",function(){return h}),D.d(ge,"b",function(){return c});var q=D("KQm4"),z=D("VTBJ"),P=D("Ff2n"),Y=D("Zm9Q"),N=D("Kwbf"),O=D("OZM5");function H(o,d){return o!=null?o:d}function k(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function i(a){var r=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(r).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),i(x,"".concat(r).concat(T," > "))})}i(o)}function n(o){function d(i){var a=Object(Y.a)(i);return a.map(function(r){if(!Object(O.i)(r))return Object(N.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var s=r.key,S=r.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(r){return r})}return d(o)}function I(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(d===!0?[]:d),a=[];function r(s){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return s.map(function(x,T){var A=Object(O.h)(S?S.pos:"0",T),w=H(x.key,A),v=Object(z.a)(Object(z.a)({},x),{},{parent:S,pos:A,children:null,data:x,isStart:[].concat(Object(q.a)(S?S.isStart:[]),[T===0]),isEnd:[].concat(Object(q.a)(S?S.isEnd:[]),[T===s.length-1])});return a.push(v),d===!0||i.has(w)?v.children=r(x.children||[],v):v.children=[],v})}return r(o),a}function g(o,d,i){var a;i?typeof i=="string"?a=function(S){return S[i]}:typeof i=="function"&&(a=function(S){return i(S)}):a=function(S,x){return H(S.key,x)};function r(s,S,x){var T=s?s.children:o,A=s?Object(O.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(E,m){r(E,m,{node:s,pos:A,level:x?x.level+1:-1})})}r(null)}function p(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=d.initWrapper,a=d.processEntity,r=d.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,S={},x={},T={posEntities:S,keyEntities:x};return i&&(T=i(T)||T),g(o,function(A){var w=A.node,v=A.index,E=A.pos,m=A.key,f=A.parentPos,C=A.level,b={node:w,index:v,key:m,pos:E,level:C},y=H(m,E);S[E]=b,x[y]=b,b.parent=S[f],b.parent&&(b.parent.children=b.parent.children||[],b.parent.children.push(b)),a&&a(b,T)},s),r&&r(T),T}function h(o,d){var i=d.expandedKeys,a=d.selectedKeys,r=d.loadedKeys,s=d.loadingKeys,S=d.checkedKeys,x=d.halfCheckedKeys,T=d.dragOverNodeKey,A=d.dropPosition,w=d.keyEntities,v=w[o],E={eventKey:o,expanded:i.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:r.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 E}function c(o){var d=o.data,i=o.expanded,a=o.selected,r=o.checked,s=o.loaded,S=o.loading,x=o.halfChecked,T=o.dragOver,A=o.dragOverGapTop,w=o.dragOverGapBottom,v=o.pos,E=o.active,m=Object(z.a)(Object(z.a)({},d),{},{expanded:i,selected:a,checked:r,loaded:s,loading:S,halfChecked:x,dragOver:T,dragOverGapTop:A,dragOverGapBottom:w,pos:v,active:E});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(We,ge,D){(function(q){q(D("VrN/"))})(function(q){"use strict";q.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<q.modeInfo.length;z++){var P=q.modeInfo[z];P.mimes&&(P.mime=P.mimes[0])}q.findModeByMIME=function(Y){Y=Y.toLowerCase();for(var N=0;N<q.modeInfo.length;N++){var O=q.modeInfo[N];if(O.mime==Y)return O;if(O.mimes){for(var H=0;H<O.mimes.length;H++)if(O.mimes[H]==Y)return O}}if(/\+xml$/.test(Y))return q.findModeByMIME("application/xml");if(/\+json$/.test(Y))return q.findModeByMIME("application/json")},q.findModeByExtension=function(Y){Y=Y.toLowerCase();for(var N=0;N<q.modeInfo.length;N++){var O=q.modeInfo[N];if(O.ext){for(var H=0;H<O.ext.length;H++)if(O.ext[H]==Y)return O}}},q.findModeByFileName=function(Y){for(var N=0;N<q.modeInfo.length;N++){var O=q.modeInfo[N];if(O.file&&O.file.test(Y))return O}var H=Y.lastIndexOf("."),k=H>-1&&Y.substring(H+1,Y.length);if(k)return q.findModeByExtension(k)},q.findModeByName=function(Y){Y=Y.toLowerCase();for(var N=0;N<q.modeInfo.length;N++){var O=q.modeInfo[N];if(O.name.toLowerCase()==Y)return O;if(O.alias){for(var H=0;H<O.alias.length;H++)if(O.alias[H].toLowerCase()==Y)return O}}}})},"8HAY":function(We,ge,D){"use strict";D.d(ge,"a",function(){return N}),D.d(ge,"b",function(){return O}),D.d(ge,"d",function(){return H}),D.d(ge,"e",function(){return k}),D.d(ge,"c",function(){return n});var q=D("MI8n"),z=D("pmY6"),P=D("3/fG"),Y=function(I,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 i(s){try{r(h.next(s))}catch(S){d(S)}}function a(s){try{r(h.throw(s))}catch(S){d(S)}}function r(s){s.done?o(s.value):c(s.value).then(i,a)}r((h=h.apply(I,g||[])).next())})};class N extends z.a{constructor(I,g="",p="",h=!0,c){super();this._onDidChange=this._register(new q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=g,this._cssClass=p,this._enabled=h,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(I){this._setLabel(I)}_setLabel(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))}get tooltip(){return this._tooltip||""}set tooltip(I){this._setTooltip(I)}_setTooltip(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))}get class(){return this._cssClass}set class(I){this._setClass(I)}_setClass(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))}get enabled(){return this._enabled}set enabled(I){this._setEnabled(I)}_setEnabled(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))}get checked(){return this._checked}set checked(I){this._setChecked(I)}_setChecked(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))}run(I,g){return Y(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(I))})}}class O extends z.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new q.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new q.b),this.onDidRun=this._onDidRun.event}run(I,g){return Y(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let p;try{yield this.runAction(I,g)}catch(h){p=h}this._onDidRun.fire({action:I,error:p})})}runAction(I,g){return Y(this,void 0,void 0,function*(){yield I.run(g)})}}class H extends N{constructor(I){super(H.ID,I,I?"separator text":"separator");this.checked=!1,this.enabled=!1}}H.ID="vs.actions.separator";class k{constructor(I,g,p,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=g,this.class=h,this._actions=p}get actions(){return this._actions}dispose(){}run(){return Y(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(We,ge,D){We.exports={button:"button___1wy9m"}},"9+Du":function(We,ge,D){"use strict";var q=D("k1fw"),z=D("9og8"),P=D("tJVT"),Y=D("WmNS"),N=D.n(Y),O=D("q1tI"),H=D.n(O),k=D("ErOA"),n=D("7Cbv"),I=D("TSYQ"),g=D.n(I),p=D("vef1"),h=D.n(p),c=function(d,i){var a=d.chunkSize,r=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,E=d.onBeginInitFile,m=d.children,f=d.accept,C=d.className,b=d.style,y=b===void 0?{}:b,M=d.concurrency,W=M===void 0?4:M,L=Object(O.useState)("ready"),K=Object(P.a)(L,2),F=K[0],R=K[1],V=Object(O.useState)(0),ne=Object(P.a)(V,2),se=ne[0],Se=ne[1],Le=Object(O.useState)(""),Ae=Object(P.a)(Le,2),Pe=Ae[0],Fe=Ae[1],je=Object(O.useState)(null),Te=Object(P.a)(je,2),Z=Te[0],U=Te[1],G=Object(O.useRef)(null),ee=Object(O.useRef)(Object(n.a)()),ue=Object(O.useRef)(!1);Object(O.useImperativeHandle)(i,function(){return{cancel:Ge,file:Z,uploadStatus:F}});var J=function(){var Re=document.getElementById(ee.current);Re&&(Re.value="")},we=function(){var be=Object(z.a)(N.a.mark(function Re(xe){var Ce,Be;return N.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(!(F==="uploading")){qe.next=2;break}return qe.abrupt("return");case 2:return E&&E(xe),Ce=xe.size,Be=Math.ceil(Ce/r),ue.current=!1,R("uploading"),Se(0),Fe(""),qe.prev=9,qe.delegateYield(N.a.mark(function tt(){var ht,ft,Ne,Ue,Ze,et,fe,re,ie,ce,pe,le;return N.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return ye.next=2,Object(k.a)("/api/attachments/multipart_upload_start",{method:"POST",body:Object(q.a)({fileName:xe.name,chunkCount:Be},S)});case 2:if(ht=ye.sent,!(ue.current||(ht==null?void 0:ht.status)!==0)){ye.next=5;break}throw new Error;case 5:for(ft=ht.upload_id,G.current=new AbortController,Ne=[],Ue=0,Ze=function(Oe){var ke=Oe*r,$e=Math.min(ke+r,Ce),ot=xe.slice(ke,$e),pt=new FormData;pt.append("chunk",ot),pt.append("fileName",xe.name),pt.append("chunkIndex",(Oe+1).toString()),pt.append("uploadId",ft);for(var mt in S)Object.prototype.hasOwnProperty.call(S,mt)&&pt.append(mt,S[mt]);Ne.push(function(){return Object(k.a)("/api/attachments/multipart_upload",{method:"POST",body:pt,signal:G.current.signal},!0).then(function(qt){Ue++;var xt=Math.round(Ue/Be*100);Se(xt),w&&w(Object(q.a)(Object(q.a)({},qt),{},{file:xe,percent:xt}))})})},et=0;et<Be;et++)Ze(et);fe=0,re=W;case 13:if(!(fe<Ne.length)){ye.next=22;break}if(ce=(ie=Ne.slice(fe,fe+re))===null||ie===void 0?void 0:ie.map(function(_e){return _e()}),!(ce.length>0)){ye.next=20;break}return ye.next=18,Promise.all(ce);case 18:pe=ye.sent,fe+=re;case 20:ye.next=13;break;case 22:return ye.next=24,Object(k.a)("/api/attachments/multipart_upload_end",{method:"POST",body:Object(q.a)({fileName:xe.name,chunkCount:Be,uploadId:ft},S)});case 24:le=ye.sent,le.object?(R("success"),J(),T&&T(Object(q.a)(Object(q.a)({},le),{},{file:xe,percent:100}))):(R("error"),Fe("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),J(),A&&A(xe.name));case 26:case"end":return ye.stop()}},tt)})(),"t0",11);case 11:qe.next=19;break;case 13:qe.prev=13,qe.t1=qe.catch(9),R("error"),Fe("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),J(),A&&A(xe.name);case 19:case"end":return qe.stop()}},Re,null,[[9,13]])}));return function(xe){return be.apply(this,arguments)}}(),Ge=Object(O.useCallback)(function(){ue.current=!0,G.current&&(G.current.abort(),x&&x())},[x]),Je=function(Re){var xe,Ce,Be=Re==null||((xe=Re.target)===null||xe===void 0||((Ce=xe.files)===null||Ce===void 0))?void 0:Ce[0];if(U(Be),F="ready",!Be)return;if(v){var Xe=v(Be);Xe||we(Be),J();return}we(Be)};return H.a.createElement(O.Fragment,null,H.a.createElement("input",{type:"file",id:ee.current,style:{display:"none"},onChange:Je,accept:f}),H.a.createElement("label",{className:g()(h.a.upload,C),htmlFor:ee.current,style:y},m))};ge.a=Object(O.forwardRef)(c)},"9Bee":function(We,ge,D){"use strict";var q=D("DYRE"),z=D("zeV3"),P=D("+L6B"),Y=D("2/Rp"),N=D("k1fw"),O=D("9og8"),H=D("tJVT"),k=D("WmNS"),n=D.n(k),I=D("q1tI"),g=D.n(I),p=D("vg9a"),h=D("DlQD"),c=D.n(h),o=D("rUJ1");function d(fe,re){var ie=fe.match(/^(\s+)(?:```)/);if(ie===null)return re;var ce=ie[1];return re.split(`
|
|
`).map(function(pe){var le=pe.match(/^\s+/);if(le===null)return pe;var he=Object(H.a)(le,1),ye=he[0];return ye.length>=ce.length?pe.slice(ce.length):pe}).join(`
|
|
`)}var i=[],a=["<ul>"],r=new c.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){i.length=0,a=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(fe,re,ie,ce){if(re>=fe.length||fe[re].level<=ie)return re;var pe=fe[re];ce.push("<li><a href='#"+pe.anchor+"'>"+pe.text+"</a>"),re++;var le=[];return re=T(fe,re,pe.level,le),le.length>0&&(ce.push("<ul>"),le.forEach(function(he){ce.push(he)}),ce.push("</ul>")),ce.push("</li>"),re=T(fe,re,ie,ce),re}function A(){return T(i,0,0,a),a.push("</ul>"),a.join("")}var w={heading:function(re){var ie=s.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},fences:function(re){var ie=this.rules.block.fences.exec(re);if(ie){var ce=ie[0],pe=d(ce,ie[3]||""),le=ie[2]?ie[2].trim():ie[2];if(["latex","katex","math"].indexOf(le)>=0){var he=m(),ye=pe;pe=he,f[he]={type:"block",expression:ye}}return{type:"code",raw:ce,lang:le,text:pe}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,m=function(){return"__special_katext_id_".concat(E++,"__")},f={};function C(){return f}function b(){E=0,f={}}function y(fe){return fe=fe.replace(v,function(re,ie){var ce=m();return f[ce]={type:"inline",expression:ie},ce}),fe}var M=r.listitem;r.listitem=function(fe){return M(y(fe))};var W=r.paragraph;r.paragraph=function(fe){return W(y(fe))};var L=r.tablecell;r.tablecell=function(fe,re){return L(y(fe),re)},r.code=function(fe,re,ie){var ce=(re||"").match(/\S*/)[0];return ce?["latex","katex","math"].indexOf(ce)>=0?"<p class='editormd-tex'>".concat(fe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(re,'">').concat(ie?fe:Object(o.escape)(fe,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(ie?fe:Object(o.escape)(fe,!0))+"</code></pre>"},r.heading=function(fe,re,ie){var ce=this.options.headerPrefix+ie.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ce,level:re,text:fe}),"<h"+re+' id="'+ce+'">'+fe+"</h"+re+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:w,renderer:r});var K=c.a,F=D("SJMd"),R=D("ulZh"),V=D.n(R),ne=D("m3rI"),se=D("Oy/b"),Se=D("p5ED"),Le=D("ErOA"),Ae=D("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 Pe=function(fe,re){return(Pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ie,ce){ie.__proto__=ce}||function(ie,ce){for(var pe in ce)Object.prototype.hasOwnProperty.call(ce,pe)&&(ie[pe]=ce[pe])})(fe,re)};function Fe(fe,re){if(typeof re!="function"&&re!==null)throw new TypeError("Class extends value "+String(re)+" is not a constructor or null");function ie(){this.constructor=fe}Pe(fe,re),fe.prototype=re===null?Object.create(re):(ie.prototype=re.prototype,new ie)}function je(fe,re,ie,ce){return new(ie||(ie=Promise))(function(pe,le){function he(Oe){try{_e(ce.next(Oe))}catch(ke){le(ke)}}function ye(Oe){try{_e(ce.throw(Oe))}catch(ke){le(ke)}}function _e(Oe){var ke;Oe.done?pe(Oe.value):(ke=Oe.value,ke instanceof ie?ke:new ie(function($e){$e(ke)})).then(he,ye)}_e((ce=ce.apply(fe,re||[])).next())})}function Te(fe,re){var ie,ce,pe,le,he={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return le={next:ye(0),throw:ye(1),return:ye(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function ye(_e){return function(Oe){return function(ke){if(ie)throw new TypeError("Generator is already executing.");for(;he;)try{if(ie=1,ce&&(pe=2&ke[0]?ce.return:ke[0]?ce.throw||((pe=ce.return)&&pe.call(ce),0):ce.next)&&!(pe=pe.call(ce,ke[1])).done)return pe;switch(ce=0,pe&&(ke=[2&ke[0],pe.value]),ke[0]){case 0:case 1:pe=ke;break;case 4:return he.label++,{value:ke[1],done:!1};case 5:he.label++,ce=ke[1],ke=[0];continue;case 7:ke=he.ops.pop(),he.trys.pop();continue;default:if(!(pe=he.trys,(pe=pe.length>0&&pe[pe.length-1])||ke[0]!==6&&ke[0]!==2)){he=0;continue}if(ke[0]===3&&(!pe||ke[1]>pe[0]&&ke[1]<pe[3])){he.label=ke[1];break}if(ke[0]===6&&he.label<pe[1]){he.label=pe[1],pe=ke;break}if(pe&&he.label<pe[2]){he.label=pe[2],he.ops.push(ke);break}pe[2]&&he.ops.pop(),he.trys.pop();continue}ke=re.call(fe,he)}catch($e){ke=[6,$e],ce=0}finally{ie=pe=0}if(5&ke[0])throw ke[1];return{value:ke[0]?ke[1]:void 0,done:!0}}([_e,Oe])}}}var Z=function(){function fe(){}return fe.addKey=function(re){fe.key=re},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(re,ie){for(var ce=0,pe=ie;ce<pe.length;ce++){var le=pe[ce],he=le[0],ye=le[1];re.setAttribute(he,ye)}},fe.createRect=function(re,ie,ce){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",re.toString()),pe.setAttribute("height",ie.toString()),ce&&fe.setAttributes(pe,ce),pe},fe.createLine=function(re,ie,ce,pe,le){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",re.toString()),he.setAttribute("y1",ie.toString()),he.setAttribute("x2",ce.toString()),he.setAttribute("y2",pe.toString()),le&&fe.setAttributes(he,le),he},fe.createPolygon=function(re,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ce.setAttribute("points",re),ie&&fe.setAttributes(ce,ie),ce},fe.createCircle=function(re,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","circle");return ce.setAttribute("cx",(re/2).toString()),ce.setAttribute("cy",(re/2).toString()),ce.setAttribute("r",re.toString()),ie&&fe.setAttributes(ce,ie),ce},fe.createEllipse=function(re,ie,ce){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(re/2).toString()),pe.setAttribute("cy",(ie/2).toString()),pe.setAttribute("rx",(re/2).toString()),pe.setAttribute("ry",(ie/2).toString()),ce&&fe.setAttributes(pe,ce),pe},fe.createGroup=function(re){var ie=document.createElementNS("http://www.w3.org/2000/svg","g");return re&&fe.setAttributes(ie,re),ie},fe.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},fe.createMarker=function(re,ie,ce,pe,le,he,ye){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return fe.setAttributes(_e,[["id",re],["orient",ie],["markerWidth",ce.toString()],["markerHeight",pe.toString()],["refX",le.toString()],["refY",he.toString()]]),_e.appendChild(ye),_e},fe.createText=function(re){var ie=document.createElementNS("http://www.w3.org/2000/svg","text");return ie.setAttribute("x","0"),ie.setAttribute("y","0"),re&&fe.setAttributes(ie,re),ie},fe.createTSpan=function(re,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ce.textContent=re,ie&&fe.setAttributes(ce,ie),ce},fe.createImage=function(re){var ie=document.createElementNS("http://www.w3.org/2000/svg","image");return re&&fe.setAttributes(ie,re),ie},fe.createPoint=function(re,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ce.x=re,ce.y=ie,ce},fe.createPath=function(re,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","path");return ce.setAttribute("d",re),ie&&fe.setAttributes(ce,ie),ce},fe.createElement=function(re,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg",re);return ie&&fe.setAttributes(ce,ie),ce},fe.getHollowRectanglePath=function(re,ie,ce,pe,le,he,ye,_e){return"M"+re+","+ie+"V"+(ie+pe)+"H"+(re+ce)+"V"+ie+"H"+le+"V"+he+"H"+(le+ye)+"V"+(he+_e)+"H"+le+"V"+ie+"Z"},fe}(),G=function(){function fe(re){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+re+"_"}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(re){return this.styleSheet===void 0&&this.addStyleSheet(),re.name=""+this.classNamePrefix+re.localName,this.classes.push(re),this.styleSheet.sheet.insertRule("."+re.name+" {"+re.style+"}",this.styleSheet.sheet.cssRules.length),re},fe.prototype.addRule=function(re){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(re),this.styleSheet.sheet.insertRule(re.selector+" {"+re.style+"}",this.styleSheet.sheet.cssRules.length)},fe.prototype.addStyleSheet=function(){var re;this.styleSheet=document.createElement("style"),((re=this.styleSheetRoot)!==null&&re!==void 0?re: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 ue("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ue("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},fe.prototype.removeStyleSheet=function(){var re;this.styleSheet&&(((re=this.styleSheetRoot)!==null&&re!==void 0?re:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},fe}(),ee=function(fe,re){this.selector=fe,this.style=re},ue=function(fe,re){this.localName=fe,this.style=re},J=function(){function fe(){this.blocks=[],this.display=""}return fe.prototype.addButtonBlock=function(re){re.className=this.blockClassName,re.buttonClassName=this.buttonClassName,re.buttonColorsClassName=this.buttonColorsClassName,re.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(re)},fe.prototype.addElementBlock=function(re){re.className===void 0&&(re.className=this.blockClassName),this.blocks.push(re)},fe.prototype.getUI=function(){var re=document.createElement("div");return re.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,re.style.display=this.display,this.blocks.forEach(function(ie){return re.appendChild(ie.getUI())}),re},fe}(),we=function(){function fe(){}return fe.prototype.getUI=function(){var re=document.createElement("div");if(re.className=this.className,this.minWidth!==void 0&&(re.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":re.style.justifyContent="flex-start";break;case"center":re.style.justifyContent="center";break;case"end":re.style.justifyContent="flex-end"}return re.style.whiteSpace="nowrap",re},fe}(),Ge=function(fe){function re(){var ie=fe!==null&&fe.apply(this,arguments)||this;return ie.buttons=[],ie}return Fe(re,fe),re.prototype.addButton=function(ie){ie.className=this.buttonClassName,ie.colorsClassName=this.buttonColorsClassName,ie.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(ie)},re.prototype.getUI=function(){var ie=fe.prototype.getUI.call(this);return this.buttons.forEach(function(ce){return ie.appendChild(ce.getUI())}),ie},re}(we),Je=function(){function fe(re,ie){this._isActive=!1,this._isHidden=!1,this._icon=re,this.title=ie,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(fe.prototype,"icon",{get:function(){return this._icon},set:function(re){this._icon=re,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"isActive",{get:function(){return this._isActive},set:function(re){this._isActive=re,this.adjustClassName()},enumerable:!1,configurable:!0}),fe.prototype.getUI=function(){var re=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 re.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}(),be=function(fe){function re(){var ie=fe!==null&&fe.apply(this,arguments)||this;return ie.elements=[],ie}return Fe(re,fe),re.prototype.addElement=function(ie){this.elements.push(ie)},re.prototype.getUI=function(){var ie=fe.prototype.getUI.call(this);return this.elements.forEach(function(ce){return ie.appendChild(ce)}),ie},re}(we),Re=function(){function fe(re,ie){this.horizontal=re,this.vertical=ie}return Object.defineProperty(fe.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),fe.prototype.getVerticalLength=function(re){return re/this.ratio},fe.prototype.getHorizontalLength=function(re){return re*this.ratio},fe}(),xe=function(){function fe(){}return fe.getIcon=function(re,ie){if(re>0&&ie>0){var ce=new Re(re,ie),pe=ce.ratio>=1?20:ce.getHorizontalLength(20),le=ce.ratio<1?20:ce.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 ye=U.createDefs();he.appendChild(ye);var _e=U.createElement("clipPath",[["id","text-bg-clip"]]);ye.appendChild(_e);var Oe=U.createPath(U.getHollowRectanglePath((24-pe)/2,(24-le)/2,pe,le,(24-pe)/2+2,(24-le)/2+2,pe-4,le-4));he.appendChild(Oe);var ke=U.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ke.appendChild(U.createTSpan(re+":"+ie)),he.appendChild(ke);var $e=ke.getBBox();U.setAttributes(ke,[["x",((24-$e.width)/2).toString()],["y",((24-$e.height)/2-$e.y).toString()]]);var ot=U.createPath(U.getHollowRectanglePath(0,0,24,24,(24-Math.ceil($e.width))/2,(24-Math.ceil($e.height))/2,Math.ceil($e.width),Math.ceil($e.height)));return _e.appendChild(ot),U.setAttributes(Oe,[["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}(),Ce=function(fe){function re(ie,ce,pe){var le=fe.call(this,ie,ce)||this;return le.isDropdownOpen=!1,le.onClick=le.dropdownButtonClicked,le.dropdownButtons=pe,le}return Fe(re,fe),re.prototype.setupDropdown=function(){var ie=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ce){ce.className=ie.className,ce.colorsClassName=ie.colorsClassName,ie.dropdownBlock.appendChild(ce.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},re.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},re.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},re.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},re.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},re.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},re}(Je),Be=function(){function fe(re,ie){this.GRIP_SIZE=10,this.color=re,this.fillColor=ie,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(re){return re===this.visual||re===this.visual.childNodes[0]||re===this.visual.childNodes[1]},fe.prototype.setCenter=function(re,ie){this.visual.childNodes.forEach(function(ce){return U.setAttributes(ce,[["cx",re.toString()],["cy",ie.toString()]])})},fe}(),Xe=function(){function fe(re,ie,ce,pe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=re,this.canvasHeight=ie,this.margin=ce,this.container=pe,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(fe.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(re){this._aspectRatio=re,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(re){this._isGridVisible=re,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(re){this._zoomFactor=re,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),fe.prototype.open=function(){var re=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 ie=0;ie<this.numberOfGridLines;ie++)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(ce){return re.gridContainer.appendChild(ce)}),this.verticalGridLines.forEach(function(ce){return re.gridContainer.appendChild(ce)}),this.cropRectElement=U.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},fe.prototype.setCropRectangle=function(re){this.cropRect=re;var ie=Object.assign({},this.cropRect);this.zoomFactor!==1&&(ie.width=this.cropRect.width*this.zoomFactor,ie.height=this.cropRect.height*this.zoomFactor,ie.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-ie.width/2,ie.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-ie.height/2),U.setAttributes(this.cropRectElement,[["x",ie.x.toString()],["y",ie.y.toString()],["width",ie.width.toString()],["height",ie.height.toString()]]);var ce=ie.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(le,he){var ye=ie.y+ce*(he+1);U.setAttributes(le,[["x1",""+ie.x],["y1",""+ye],["x2",""+(ie.x+ie.width)],["y2",""+ye]])});var pe=ie.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(le,he){var ye=ie.x+pe*(he+1);U.setAttributes(le,[["x1",""+ye],["y1",""+ie.y],["x2",""+ye],["y2",""+(ie.y+ie.height)]])}),U.setAttributes(this.cropShadeElement,[["d",U.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,ie.x,ie.y,ie.width,ie.height)]]),this.topLeftGrip.setCenter(ie.x,ie.y),this.topRightGrip.setCenter(ie.x+ie.width,ie.y),this.bottomLeftGrip.setCenter(ie.x,ie.y+ie.height),this.bottomRightGrip.setCenter(ie.x+ie.width,ie.y+ie.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(re,ie){var ce=this.container.getBoundingClientRect();return{x:re-ce.left+this.margin,y:ie-ce.top+this.margin}},fe.prototype.onPointerDown=function(re){this.container.setPointerCapture(re.pointerId),this.previousPoint=this.clientToLocalCoordinates(re.clientX,re.clientY),this.cropRectElement===re.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(re.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(re.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(re.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(re.target)&&(this.activeGrip=this.bottomRightGrip)},fe.prototype.onPointerMove=function(re){if(this.isMoving)this.move(this.clientToLocalCoordinates(re.clientX,re.clientY));else if(this.activeGrip){var ie=this.clientToLocalCoordinates(re.clientX,re.clientY);this.resize(ie)}re.preventDefault()},fe.prototype.onPointerUp=function(re){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(re.pointerId)},fe.prototype.move=function(re){var ie=re.x-this.previousPoint.x,ce=re.y-this.previousPoint.y;this.zoomFactor!==1&&(ie=-ie/this.zoomFactor,ce=-ce/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+ie),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ce),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=re},fe.prototype.resize=function(re){var ie=Object.assign({},this.cropRect),ce=re.x-this.previousPoint.x,pe=re.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:ie.x+ce<this.margin&&(ce=this.margin-ie.x),ie.x+=ce,ie.width=this.cropRect.x+this.cropRect.width-ie.x;break;case this.bottomRightGrip:case this.topRightGrip:ie.width+ce>this.canvasWidth*this.zoomFactor&&(ce=this.canvasWidth*this.zoomFactor-ie.width),ie.width+=ce}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(ie.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ce),ie.height=this.aspectRatio.getVerticalLength(ie.width)):(ie.y+=pe,ie.height=this.cropRect.y+this.cropRect.height-ie.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?ie.height=this.aspectRatio.getVerticalLength(ie.width):ie.height+=pe}ie.width<10&&(ie.x=this.cropRect.x,ie.width=10),ie.height<10&&(ie.y=this.cropRect.y,ie.height=10),this.previousPoint=re,ie.x>=this.margin&&ie.y>=this.margin&&ie.x-this.margin+ie.width<=this.canvasWidth&&ie.y-this.margin+ie.height<=this.canvasHeight&&(this.cropRect=ie,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 re=this.cropRect.x+this.cropRect.width/2,ie=this.cropRect.y+this.cropRect.height/2,ce=this.aspectRatio.getHorizontalLength(this.cropRect.height),pe=this.aspectRatio.getVerticalLength(this.cropRect.width);ce/this.canvasWidth<pe/this.canvasHeight?this.cropRect.width=ce:this.cropRect.height=pe,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=re-this.cropRect.width/2,this.cropRect.y=ie-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(re,ie,ce,pe,le,he){var ye=ce/re,_e=pe/ie;return{x:(le.x-he)*ye+he,y:(le.y-he)*_e+he,width:le.width*ye,height:le.height*_e}},fe.prototype.scaleCanvas=function(re,ie){var ce=this.getRescaledRect(this.canvasWidth,this.canvasHeight,re,ie,this.cropRect,this.margin);this.canvasWidth=re,this.canvasHeight=ie,this.onCropChange&&this.onCropChange(ce),this.setCropRectangle(ce)},fe}(),qe=function(){function fe(re){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=re,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(re){this._angle=re,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(re){this.controlContainer.setPointerCapture(re.pointerId),this.isDragging=!0,this.previousPoint={x:re.clientX,y:re.clientY}},fe.prototype.onPointerMove=function(re){this.isDragging&&(this.onAngleChange&&this.onAngleChange((re.clientX-this.previousPoint.x)/5),this.previousPoint.x=re.clientX)},fe.prototype.onPointerUp=function(re){this.isDragging&&this.onAngleChange&&this.onAngleChange((re.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(re.pointerId)},fe.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var re=this.angleLabelText.getBBox();U.setAttributes(this.angleLabelElement,[["x",((this.width-re.width)/2).toString()],["y",(this.height/2).toString()]])}},fe.prototype.positionScaleShape=function(){if(this.scaleShape){var re=this.scaleShape.transform.baseVal.getItem(0);re.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(re,0)}},fe.prototype.getVisual=function(){var re=document.createElementNS("http://www.w3.org/2000/svg","svg");re.setAttribute("xmlns","http://www.w3.org/2000/svg"),re.setAttribute("width",this.width+"px"),re.setAttribute("height",this.height+"px"),re.setAttribute("viewBox","0 0 "+this.width+" "+this.height),re.style.flexShrink="0",document.body.appendChild(re);for(var ie="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ce=1;ce<=this.width/5+10;ce++){var pe=ce%5==0?this.height/3:this.height/6;ie+="h4v"+-pe+"h1v"+pe}ie+="v1H0Z",this.scaleShape=U.createPath(ie);var le=U.createTransform();this.scaleShape.transform.baseVal.appendItem(le),re.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),re.appendChild(this.angleLabelElement),document.body.removeChild(re),re},fe}(),tt=function(){function fe(){this.naturalSize=!1,this.imageType="image/png"}return fe.prototype.rasterize=function(re,ie,ce,pe,le,he,ye){var _e=this;return new Promise(function(Oe){var ke=document.createElement("canvas");ke.width=re.width.baseVal.value-2*pe,ke.height=re.height.baseVal.value-2*pe;var $e=1,ot=1;_e.naturalSize===!0?($e=ie.naturalWidth/(re.width.baseVal.value-2*pe)/he,ot=ie.naturalHeight/(re.height.baseVal.value-2*pe)/ye,ke.width=ie.naturalWidth/he,ke.height=ie.naturalHeight/ye):_e.width!==void 0&&_e.height!==void 0&&($e=_e.width/ce.width,ot=_e.height/ce.height,ke.width*=$e,ke.height*=ot);var pt=ke.getContext("2d");pt.translate(ke.width/2,ke.height/2),pt.rotate(le*Math.PI/180),pt.scale(he,ye),pt.translate(-ke.width/2,-ke.height/2),pt.drawImage(ie,0,0,ke.width,ke.height);var mt=document.createElement("canvas");mt.width=ce.width*$e,mt.height=ce.height*ot,mt.getContext("2d").putImageData(pt.getImageData((ce.x-pe)*$e,(ce.y-pe)*ot,ce.width*$e,ce.height*ot),0,0),Oe(mt.toDataURL(_e.imageType,_e.imageQuality))})},fe}(),ht=function(){function fe(re){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 G(this.instanceNo),this.target=re,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(re){this._zoomToCropEnabled=re,re?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(re){this._isGridVisible=re,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"gridLines",{get:function(){return this._gridLines},set:function(re){this._gridLines=re,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(re){this._rotationAngle=re,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 re;return(re=this._aspectRatio)!==null&&re!==void 0?re:this.aspectRatios[0]},set:function(re){this._aspectRatio=re},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(re){re===void 0&&(re=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),re||this.closeEventListeners.forEach(function(ie){return ie()}),this._isOpen=!1)},fe.prototype.addRenderEventListener=function(re){this.renderEventListeners.push(re)},fe.prototype.removeRenderEventListener=function(re){this.renderEventListeners.indexOf(re)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(re),1)},fe.prototype.addCloseEventListener=function(re){this.closeEventListeners.push(re)},fe.prototype.removeCloseEventListener=function(re){this.closeEventListeners.indexOf(re)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(re),1)},fe.prototype.setupResizeObserver=function(){var re=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){re.resize(re.target.clientWidth,re.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 re=1*this.target.clientWidth/this.target.clientHeight,ie=this.contentDiv.clientWidth/re>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*re:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ce=ie+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/re;this.resize(ie,ce)}},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(re,ie){this.imageWidth=Math.round(re),this.imageHeight=Math.round(ie),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 re=document.createElement("canvas");re.width=this.target.naturalWidth,re.height=this.target.naturalHeight,re.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var ie=re.toDataURL();U.setAttributes(this.editingTarget,[["href",ie]]),this.setEditingTargetSize()},fe.prototype.setTopLeft=function(){var re=this.target.getBoundingClientRect(),ie=this.editorCanvas.getBoundingClientRect();this.left=re.left-ie.left-this.CANVAS_MARGIN,this.top=re.top-ie.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 re=U.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(re);var ie=U.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(ie),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 Xe(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 re=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,ie=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=re+"px "+ie+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-re+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-ie+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(re){this.cropRect=re,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 re=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,ie=this.target.offsetTop>re+this.CANVAS_MARGIN?this.target.offsetTop-(re+this.CANVAS_MARGIN):0;this.coverDiv.style.top=ie+"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 re=this;this.topToolbar=new J,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 ie=new Ge;ie.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(ie);var ce=[];this.aspectRatios.forEach(function(ot){var pt=new Je(xe.getIcon(ot.horizontal,ot.vertical),ot.horizontal===0&&ot.vertical===0?"FREE":ot.horizontal+":"+ot.vertical);pt.onClick=function(){return re.ratioButtonClicked(ot)},ce.push(pt)}),this.aspectRatioButton=new Ce(xe.getIcon(0,0),"Aspect ratio",ce),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,ie.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var pe=new Je('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");pe.isActive=this.isGridVisible,pe.onClick=function(){re.isGridVisible=!re.isGridVisible,pe.isActive=re.isGridVisible},ie.addButton(pe);var le=new Je('<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(){re.zoomToCropEnabled=!re.zoomToCropEnabled,le.isActive=re.zoomToCropEnabled},ie.addButton(le),!Z.isLicensed){var he=new be;this.topToolbar.addElementBlock(he);var ye=document.createElement("div");ye.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var _e=document.createElement("a");_e.style.color="currentColor",_e.href="https://markerjs.com/products/cropro",_e.target="_blank",_e.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ye.appendChild(_e),he.addElement(ye)}var Oe=new Ge;Oe.minWidth=3*this.toolbarHeight+"px",Oe.contentAlign="end",this.topToolbar.addButtonBlock(Oe);var ke=new Je('<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");ke.onClick=this.startRenderAndClose,Oe.addButton(ke),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ke.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var $e=new Je('<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");$e.onClick=this.close,Oe.addButton($e),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&($e.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},fe.prototype.addBottomToolbar=function(){var re=this;this.bottomToolbar=new J,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 ie=new Ge;ie.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(ie);var ce=new Je('<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");ce.onClick=this.rotateLeftButtonClicked,ie.addButton(ce);var pe=new Je('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");pe.onClick=this.rotateRightButtonClicked,ie.addButton(pe);var le=new be;le.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(le),this.straightener=new qe("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(Oe){re.rotateBy(Oe),re.straightener.angle=re.rotationAngle},le.addElement(this.straightener.getUI());var he=new Ge;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var ye=new Je('<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");ye.onClick=this.flipHorizontallyButtonClicked,he.addButton(ye);var _e=new Je('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");_e.onClick=this.flipVerticallyButtonClicked,he.addButton(_e)},fe.prototype.ratioButtonClicked=function(re){this.aspectRatio=re,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},fe.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=xe.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(re){if(re){var ie=this.cropLayer.getRescaledRect(re.width,re.height,this.imageWidth,this.imageHeight,re.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(ie),this.cropRectChanged(ie),this.flippedHorizontally=re.flippedHorizontally,this.flippedVertically=re.flippedVertically,this.applyFlip(),this.rotationAngle=re.rotationAngle,this.applyRotation()}},fe.prototype.clientToLocalCoordinates=function(re,ie){var ce=this.cropImage.getBoundingClientRect();return{x:re-ce.left,y:ie-ce.top}},fe.prototype.onWindowResize=function(){this.positionUI()},fe.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var re=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=re+"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 re=this.rotationAngle-90;this.rotationAngle%90!=0&&(re+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(re)},fe.prototype.rotateRightButtonClicked=function(){var re=this.rotationAngle+90;this.rotationAngle%90!=0&&(re-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(re)},fe.prototype.rotateTo=function(re){re=(re=re>180?re-360:re)<=-180?re+360:re,this.rotationAngle=re,this.applyRotation()},fe.prototype.rotateBy=function(re){this.rotateTo((this.rotationAngle+re)%360)},fe.prototype.applyRotation=function(){var re=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var ie=this.editingTargetRotationContainer.transform.baseVal.getItem(0);ie.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(ie,0);var ce=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ce.width,this.imageHeight/ce.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=re},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 je(this,void 0,void 0,function(){var re,ie;return Te(this,function(ce){switch(ce.label){case 0:return[4,this.render()];case 1:return re=ce.sent(),ie=this.getState(),this.renderEventListeners.forEach(function(pe){return pe(re,ie)}),this.close(!0),[2]}})})},fe.prototype.render=function(){return je(this,void 0,void 0,function(){var re;return Te(this,function(ie){switch(ie.label){case 0:return(re=new tt).naturalSize=this.renderAtNaturalSize,re.imageType=this.renderImageType,re.imageQuality=this.renderImageQuality,re.width=this.renderWidth,re.height=this.renderHeight,this.unzoomFromCrop(),U.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,re.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 ie.sent(),[4,re.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,ie.sent()]}})})},fe.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ue("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 ue("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ue("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var re=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ue("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*re)+`px;
|
|
height: `+(this.toolbarHeight-2*re)+`px;
|
|
padding: `+re+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ue("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ue("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 ue("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 ue("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ue("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 ue("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*re)+`px;
|
|
padding: `+re+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ue("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},fe.instanceCounter=0,fe}(),ft=D("8hTe"),Ne=D.n(ft),Ue=/<pre[^>]*>/g;function Ze(fe){var re=document.createElement("div");return re.innerHTML=fe,re.childNodes.length===0?"":re.childNodes[0].nodeValue}var et=ge.a=function(fe){var re=fe.value,ie=re===void 0?"":re,ce=fe.edit,pe=ce===void 0?!1:ce,le=fe.className,he=fe.showTextOnly,ye=fe.showLines,_e=fe.replaces,Oe=fe.zoomImg,ke=fe.hasMask,$e=fe.style,ot=$e===void 0?{}:$e,pt=fe.stylesPrev,mt=pt===void 0?{}:pt,qt=String(ie),xt=Object(I.useRef)(),Ct=Object(I.useRef)(),Pt=Object(I.useState)(""),Rt=Object(H.a)(Pt,2),Gt=Rt[0],On=Rt[1],kt=Object(I.useState)("office"),Un=Object(H.a)(kt,2),An=Un[0],en=Un[1],wn=function(){var $=new ht(Ct.current);$.displayMode="popup",$.addRenderEventListener(function(){var te=Object(O.a)(n.a.mark(function ve(Ie){var He;return n.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return xt.current.style.display="none",ut.next=3,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ie}});case 3:He=ut.sent,He!=null&&He.id&&_e(Ct.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(He==null?void 0:He.id,"?type=").concat(He.content_type));case 5:case"end":return ut.stop()}},ve)}));return function(ve){return te.apply(this,arguments)}}()),$.show()},Wt=function(){var $=new Ae.a(Ct.current);$.settings.displayMode="popup",$.addEventListener("render",function(){var te=Object(O.a)(n.a.mark(function ve(Ie){var He;return n.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(xt.current.style.display="none",!Ct.current){ut.next=6;break}return ut.next=4,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ie.dataUrl}});case 4:He=ut.sent,He!=null&&He.id&&_e(Ct.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(He==null?void 0:He.id,"?type=").concat(He.content_type));case 6:case"end":return ut.stop()}},ve)}));return function(ve){return te.apply(this,arguments)}}()),$.show(),window.markerArea=$},At=Object(I.useMemo)(function(){xt.current&&(xt.current.style.zIndex=-1);try{var X=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,$=/\"\/api\/attachments\/|\"\/attachments\/download\//g,te=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;qt=qt.replace(X,"("+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(ct){}var ve=K(qt),Ie=C();if(qt.match(/\[TOC\]/)&&(ve=ve.replace("<p>[TOC]</p>",A()),S()),ve=ve.replace(/(__special_katext_id_\d+__)/g,function(ct,ut){var ze=Ie[ut],gt=ze.type,Kt=ze.expression;return Object(se.renderToString)(Ze(Kt)||"",{displayMode:gt==="block",throwOnError:!1,output:"html"})}),ve=ve.replace(/▁/g,"\u2581\u2581\u2581"),b(),he){var He=document.createElement("div");return He.innerHTML=ve,He.innerText}return setTimeout(function(){return de()},500),ve},[qt]),Zt=Object(I.useRef)();x.WebkitLineClamp=ye,ye&&(ot=Object(N.a)(Object(N.a)({},ot),x));function Ee(X){var $=X.target;if($.tagName.toUpperCase()==="IMG"){if(Oe){var te=$.getAttribute("src");On(te),en("image")}}else if($.tagName.toUpperCase()==="A"){var ve=$.getAttribute("href");if(ve.indexOf("office")>-1)X.preventDefault(),On(ve),en("office");else if(ve.indexOf("application/pdf")>-1)X.preventDefault(),On(ve),en("pdf");else if(ve.indexOf("text/html")>-1)X.preventDefault(),On(ve),en("html");else if(ve.startsWith("#")){X.preventDefault();var Ie=document.getElementById(ve.replace("#",""));Ie&&Ie.scrollIntoView(!0)}}}var de=function(){var $,te=($=Zt.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 Ie=new V.a;Ie.loadSource(ve.src),Ie.attachMedia(ve)}}})};Object(I.useEffect)(function(){if(Zt.current&&At&&(At.match(Ue)&&window.PR.prettyPrint()),Zt.current)return Zt.current.addEventListener("click",Ee),function(){Zt.current.removeEventListener("click",Ee),b(),S()}},[At,Zt.current,Ee]);var j=function($){if(!pe)return;$.target.nodeName==="IMG"?(xt.current.style.zIndex=1,xt.current.style.display="flex",xt.current.style.width=$.target.clientWidth+"px",xt.current.style.height=$.target.clientHeight+"px",xt.current.style.top=$.target.offsetTop+"px",xt.current.style.left=$.target.offsetLeft+"px",Ct.current.src=$.target.getAttribute("src")):xt.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:Zt,style:Object(N.a)({},ot),className:"".concat(le||""," markdown-body ").concat(Ne.a.mdBody),onMouseOver:j,dangerouslySetInnerHTML:{__html:At}}),g.a.createElement("div",{ref:xt,className:Ne.a.button},g.a.createElement(z.a,null,g.a.createElement(Y.a,{onClick:function(){return wn()}},"\u88C1\u526A"),g.a.createElement(Y.a,{onClick:function(){return Wt()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Ct,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(Se.a,{close:!0,data:Gt,type:Gt!=null&&Gt.length?An:"",style:Object(N.a)({},mt),onClose:function(){return On("")}}))}},"9VGf":function(We,ge,D){"use strict";D.d(ge,"a",function(){return P});var q=D("q1tI"),z=D.n(q);function P(Y,N){var O=Object(q.useRef)();Object(q.useEffect)(function(){O.current=Y}),Object(q.useEffect)(function(){function H(){O.current()}if(N!==null){var k=setInterval(H,N);return function(){return clearInterval(k)}}},[N])}},AMnG:function(We,ge,D){"use strict";var q=D("miYZ"),z=D("tsqr"),P=D("tJVT"),Y=D("q1tI"),N=D.n(Y),O=D("nWbc"),H=D.n(O),k=D("Ot1p");ge.a=function(n){var I=n.id,g=n.activeDiscussIndex,p=n.onReplyDiscuss,h=Object(Y.useState)(""),c=Object(P.a)(h,2),o=c[0],d=c[1];function i(r){d(r)}function a(){if(!o){z.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}p(I,o),d("")}return N.a.createElement("div",{key:I,className:"discuss-item-editor",style:{display:g===I?"block":"none",width:"100%"}},N.a.createElement(k.a,{miniToolbar:!0,startInit:g===I,defaultValue:o,id:I,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),N.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(We,ge,D){"use strict";D.d(ge,"a",function(){return O});var q=D("MNnm"),z="rc-util-key";function P(H){if(H.attachTo)return H.attachTo;var k=document.querySelector("head");return k||document.body}function Y(H){var k,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(q.a)())return null;var I=document.createElement("style");if((k=n.csp)===null||k===void 0?void 0:k.nonce){var g;I.nonce=(g=n.csp)===null||g===void 0?void 0:g.nonce}I.innerHTML=H;var p=P(n),h=p.firstChild;return n.prepend&&p.prepend?p.prepend(I):n.prepend&&h?p.insertBefore(I,h):p.appendChild(I),I}var N=new Map;function O(H,k){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=P(n);if(!N.has(I)){var g=Y("",n),p=g.parentNode;N.set(I,p),p.removeChild(g)}var h=Array.from(N.get(I).children).find(function(a){return a.tagName==="STYLE"&&a[z]===k});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!==H&&(h.innerHTML=H),h}var i=Y(H,n);return i[z]=k,i}},Bd2K:function(We,ge,D){(function(q){q(D("VrN/"),D("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(n,I,g){if(g!=q.Init&&g&&n.removeKeyMap("autoCloseTags"),!I)return;var p={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(p["'/'"]=function(h){return O(h)}),(typeof I!="object"||I.whenOpening!==!1)&&(p["'>'"]=function(h){return Y(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 Y(n){if(n.getOption("disableInput"))return q.Pass;for(var I=n.listSelections(),g=[],p=n.getOption("autoCloseTags"),h=0;h<I.length;h++){if(!I[h].empty())return q.Pass;var c=I[h].head,o=n.getTokenAt(c),d=q.innerMode(n.getMode(),o.state),i=d.state,a=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(i),r=a&&a.name;if(!r)return q.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&&(r=r.slice(0,r.length-o.end+c.ch));var T=r.toLowerCase();if(!r||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&&H(S,T)>-1||k(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(i)||[],r,c,!0))return q.Pass;var A=typeof p=="object"&&p.emptyTags;if(A&&H(A,r)>-1){g[h]={text:"/>",newPos:q.Pos(c.line,c.ch+2)};continue}var w=x&&H(x,T)>-1;g[h]={indent:w,text:">"+(w?`
|
|
|
|
`:"")+"</"+r+">",newPos:w?q.Pos(c.line+1,0):q.Pos(c.line,c.ch+1)}}for(var v=typeof p=="object"&&p.dontIndentOnAutoClose,h=I.length-1;h>=0;h--){var E=g[h];n.replaceRange(E.text,I[h].head,I[h].anchor,"+insert");var m=n.listSelections().slice(0);m[h]={head:E.newPos,anchor:E.newPos},n.setSelections(m),!v&&E.indent&&(n.indentLine(E.newPos.line,null,!0),n.indentLine(E.newPos.line+1,null,!0))}}function N(n,I){for(var g=n.listSelections(),p=[],h=I?"/":"</",c=n.getOption("autoCloseTags"),o=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<g.length;d++){if(!g[d].empty())return q.Pass;var i=g[d].head,a=n.getTokenAt(i),r=q.innerMode(n.getMode(),a.state),s=r.state;if(I&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=i.ch-1))return q.Pass;var S,x=r.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(x&&r.mode.name=="javascript")S=h+"script";else if(x&&r.mode.name=="css")S=h+"style";else{var T=r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(s);if(!T||T.length&&k(n,T,T[T.length-1],i))return q.Pass;S=h+T[T.length-1]}n.getLine(i.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 O(n){return n.getOption("disableInput")?q.Pass:N(n,!0)}q.commands.closeTag=function(n){return N(n)};function H(n,I){if(n.indexOf)return n.indexOf(I);for(var g=0,p=n.length;g<p;++g)if(n[g]==I)return g;return-1}function k(n,I,g,p,h){if(!q.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,p.line+500),o=q.scanForClosingTag(n,p,null,c);if(!o||o.tag!=g)return!1;for(var d=h?1:0,i=I.length-1;i>=0&&I[i]==g;i--)++d;p=o.to;for(var i=1;i<d;i++){var a=q.scanForClosingTag(n,p,null,c);if(!a||a.tag!=g)return!1;p=a.to}return!0}})},BdwD:function(We,ge,D){"use strict";var q=D("+L6B"),z=D("2/Rp"),P=D("0Owb"),Y=D("k1fw"),N=D("q1tI"),O=D.n(N),H=D("FOrL"),k=D.n(H),n=function(g){var p=g.buttonProps,h=p===void 0?{}:p,c=g.styles,o=c===void 0?{}:c,d=g.imgStyles,i=d===void 0?{}:d,a=g.customText,r=g.ButtonText,s=g.ButtonClick,S=g.Buttonclass,x=g.ButtonTwo;return O.a.createElement("section",{className:"tc animated fadeIn",style:Object(Y.a)(Object(Y.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),o)},O.a.createElement("img",{src:k.a,style:Object(Y.a)(Object(Y.a)({},{width:"200px",height:"150px"}),i)}),O.a.createElement("p",{className:"mt10 font14"},a||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),r&&O.a.createElement(z.a,Object(P.a)({className:S,onClick:s},h),r),x&&x)};ge.a=n},BjJ7:function(We,ge,D){"use strict";D.d(ge,"d",function(){return z}),D.d(ge,"c",function(){return P}),D.d(ge,"e",function(){return Y}),D.d(ge,"b",function(){return N}),D.d(ge,"a",function(){return H});var q=D("m3rI");function z(k){var n=!0;if(k.length>0){for(var I=0;I<k.length;I++)if(k[I].compile_success==0||!k[I].compile_success){n=!1;break}}else n=!1;return n}function P(k){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],g=0;g<k.length;g++){var p=k[g],h=n?"".concat(n,"/").concat(p.name):"".concat(p.name);I.push({title:p.name,isLeaf:!(p.type==="tree"),key:h})}return I}function Y(k,n,I){for(var g=0;g<k.length;g++){var p=k[g];if(p.key===n){p.children=I;break}p.children&&Y(p.children,n,I)}return k}function N(k,n,I){var g;return function(){var p=this,h=arguments,c=function(){g=null,I||k.apply(p,h)},o=I&&!g;clearTimeout(g),g=setTimeout(c,n),o&&k.apply(p,h)}}var O=!0,H=q.a.API_SERVER},"C+DQ":function(We,ge,D){},"C/vA":function(We,ge,D){"use strict";D.d(ge,"a",function(){return q});function q(z){const P=this;let Y=!1,N;return function(){return Y||(Y=!0,N=z.apply(P,arguments)),N}}},CNDd:function(We,ge,D){We.exports=D.p+"static/c1.7850f139.svg"},CaVn:function(We,ge,D){We.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(We,ge,D){"use strict";D.d(ge,"b",function(){return q}),D.d(ge,"a",function(){return z}),D.d(ge,"c",function(){return Y}),D.d(ge,"d",function(){return N});var q;(function(O){O.serviceIds=new Map,O.DI_TARGET="$di$target",O.DI_DEPENDENCIES="$di$dependencies";function H(k){return k[O.DI_DEPENDENCIES]||[]}O.getServiceDependencies=H})(q||(q={}));const z=Y("instantiationService");function P(O,H,k,n){H[q.DI_TARGET]===H?H[q.DI_DEPENDENCIES].push({id:O,index:k,optional:n}):(H[q.DI_DEPENDENCIES]=[{id:O,index:k,optional:n}],H[q.DI_TARGET]=H)}function Y(O){if(q.serviceIds.has(O))return q.serviceIds.get(O);const H=function(k,n,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(H,k,I,!1)};return H.toString=()=>O,q.serviceIds.set(O,H),H}function N(O){return function(H,k,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(O,H,n,!0)}}},CrYA:function(We,ge,D){var q=D("MFOe"),z=q.Global;We.exports={name:"sessionStorage",read:Y,write:N,each:O,remove:H,clearAll:k};function P(){return z.sessionStorage}function Y(n){return P().getItem(n)}function N(n,I){return P().setItem(n,I)}function O(n){for(var I=P().length-1;I>=0;I--){var g=P().key(I);n(Y(g),g)}}function H(n){return P().removeItem(n)}function k(){return P().clear()}},DlQD:function(We,ge,D){(function(q,z){We.exports=z()})(this,function(){"use strict";function q(ie,ce){for(var pe=0;pe<ce.length;pe++){var le=ce[pe];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(ie,le.key,le)}}function z(ie,ce,pe){return ce&&q(ie.prototype,ce),pe&&q(ie,pe),ie}function P(ie,ce){if(!ie)return;if(typeof ie=="string")return Y(ie,ce);var pe=Object.prototype.toString.call(ie).slice(8,-1);if(pe==="Object"&&ie.constructor&&(pe=ie.constructor.name),pe==="Map"||pe==="Set")return Array.from(ie);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return Y(ie,ce)}function Y(ie,ce){(ce==null||ce>ie.length)&&(ce=ie.length);for(var pe=0,le=new Array(ce);pe<ce;pe++)le[pe]=ie[pe];return le}function N(ie,ce){var pe;if(typeof Symbol=="undefined"||ie[Symbol.iterator]==null){if(Array.isArray(ie)||(pe=P(ie))||ce&&ie&&typeof ie.length=="number"){pe&&(ie=pe);var le=0;return function(){return le>=ie.length?{done:!0}:{done:!1,value:ie[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 pe=ie[Symbol.iterator](),pe.next.bind(pe)}function O(ie,ce){return ce={exports:{}},ie(ce,ce.exports),ce.exports}var H=O(function(ie){function ce(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function pe(le){ie.exports.defaults=le}ie.exports={defaults:ce(),getDefaults:ce,changeDefaults:pe}}),k=H.defaults,n=H.getDefaults,I=H.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(ce){return o[ce]};function i(ie,ce){if(ce){if(g.test(ie))return ie.replace(p,d)}else if(h.test(ie))return ie.replace(c,d);return ie}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(ie){return ie.replace(a,function(ce,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var s=/(^|[^\[])\^/g;function S(ie,ce){ie=ie.source||ie,ce=ce||"";var pe={replace:function(he,ye){return ye=ye.source||ye,ye=ye.replace(s,"$1"),ie=ie.replace(he,ye),pe},getRegex:function(){return new RegExp(ie,ce)}};return pe}var x=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(ie,ce,pe){if(ie){var le;try{le=decodeURIComponent(r(pe)).replace(x,"").toLowerCase()}catch(he){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}ce&&!T.test(pe)&&(pe=f(ce,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(he){return null}return pe}var w={},v=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(ie,ce){w[" "+ie]||(v.test(ie)?w[" "+ie]=ie+"/":w[" "+ie]=M(ie,"/",!0)),ie=w[" "+ie];var pe=ie.indexOf(":")===-1;return ce.substring(0,2)==="//"?pe?ce:ie.replace(E,"$1")+ce:ce.charAt(0)==="/"?pe?ce:ie.replace(m,"$1")+ce:ie+ce}var C={exec:function(){}};function b(ie){for(var ce=1,pe,le;ce<arguments.length;ce++){pe=arguments[ce];for(le in pe)Object.prototype.hasOwnProperty.call(pe,le)&&(ie[le]=pe[le])}return ie}function y(ie,ce){var pe=ie.replace(/\|/g,function(ye,_e,Oe){for(var ke=!1,$e=_e;--$e>=0&&Oe[$e]==="\\";)ke=!ke;return ke?"|":" |"}),le=pe.split(/ \|/),he=0;if(le.length>ce)le.splice(ce);else for(;le.length<ce;)le.push("");for(;he<le.length;he++)le[he]=le[he].trim().replace(/\\\|/g,"|");return le}function M(ie,ce,pe){var le=ie.length;if(le===0)return"";for(var he=0;he<le;){var ye=ie.charAt(le-he-1);if(ye===ce&&!pe)he++;else if(ye!==ce&&pe)he++;else break}return ie.substr(0,le-he)}function W(ie,ce){if(ie.indexOf(ce[1])===-1)return-1;for(var pe=ie.length,le=0,he=0;he<pe;he++)if(ie[he]==="\\")he++;else if(ie[he]===ce[0])le++;else if(ie[he]===ce[1]&&(le--,le<0))return he;return-1}function L(ie){ie&&ie.sanitize&&!ie.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 K={escape:i,unescape:r,edit:S,cleanUrl:A,resolveUrl:f,noopTest:C,merge:b,splitCells:y,rtrim:M,findClosingBracket:W,checkSanitizeDeprecation:L},F=H.defaults,R=K.rtrim,V=K.splitCells,ne=K.escape,se=K.findClosingBracket;function Se(ie,ce,pe){var le=ce.href,he=ce.title?ne(ce.title):null,ye=ie[1].replace(/\\([\[\]])/g,"$1");return ie[0].charAt(0)!=="!"?{type:"link",raw:pe,href:le,title:he,text:ye}:{type:"image",raw:pe,href:le,title:he,text:ne(ye)}}function Le(ie,ce){var pe=ie.match(/^(\s+)(?:```)/);if(pe===null)return ce;var le=pe[1];return ce.split(`
|
|
`).map(function(he){var ye=he.match(/^\s+/);if(ye===null)return he;var _e=ye[0];return _e.length>=le.length?he.slice(le.length):he}).join(`
|
|
`)}var Ae=function(){function ie(pe){this.options=pe||F}var ce=ie.prototype;return ce.space=function(le){var he=this.rules.block.newline.exec(le);if(he)return he[0].length>1?{type:"space",raw:he[0]}:{raw:`
|
|
`}},ce.code=function(le,he){var ye=this.rules.block.code.exec(le);if(ye){var _e=he[he.length-1];if(_e&&_e.type==="paragraph")return{raw:ye[0],text:ye[0].trimRight()};var Oe=ye[0].replace(/^ {4}/gm,"");return{type:"code",raw:ye[0],codeBlockStyle:"indented",text:this.options.pedantic?Oe:R(Oe,`
|
|
`)}}},ce.fences=function(le){var he=this.rules.block.fences.exec(le);if(he){var ye=he[0],_e=Le(ye,he[3]||"");return{type:"code",raw:ye,lang:he[2]?he[2].trim():he[2],text:_e}}},ce.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]}},ce.nptable=function(le){var he=this.rules.block.nptable.exec(le);if(he){var ye={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(ye.header.length===ye.align.length){var _e=ye.align.length,Oe;for(Oe=0;Oe<_e;Oe++)/^ *-+: *$/.test(ye.align[Oe])?ye.align[Oe]="right":/^ *:-+: *$/.test(ye.align[Oe])?ye.align[Oe]="center":/^ *:-+ *$/.test(ye.align[Oe])?ye.align[Oe]="left":ye.align[Oe]=null;for(_e=ye.cells.length,Oe=0;Oe<_e;Oe++)ye.cells[Oe]=V(ye.cells[Oe],ye.header.length);return ye}}},ce.hr=function(le){var he=this.rules.block.hr.exec(le);if(he)return{type:"hr",raw:he[0]}},ce.blockquote=function(le){var he=this.rules.block.blockquote.exec(le);if(he){var ye=he[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:he[0],text:ye}}},ce.list=function(le){var he=this.rules.block.list.exec(le);if(he){for(var ye=he[0],_e=he[2],Oe=_e.length>1,ke=_e[_e.length-1]===")",$e={type:"list",raw:ye,ordered:Oe,start:Oe?+_e.slice(0,-1):"",loose:!1,items:[]},ot=he[0].match(this.rules.block.item),pt=!1,mt,qt,xt,Ct,Pt,Rt,Gt,On=ot.length,kt=0;kt<On;kt++)mt=ot[kt],ye=mt,qt=mt.length,mt=mt.replace(/^ *([*+-]|\d+[.)]) */,""),~mt.indexOf(`
|
|
`)&&(qt-=mt.length,mt=this.options.pedantic?mt.replace(/^ {1,4}/gm,""):mt.replace(new RegExp("^ {1,"+qt+"}","gm"),"")),kt!==On-1&&(xt=this.rules.block.bullet.exec(ot[kt+1])[0],(Oe?xt.length===1||!ke&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==_e)&&(Ct=ot.slice(kt+1).join(`
|
|
`),$e.raw=$e.raw.substring(0,$e.raw.length-Ct.length),kt=On-1)),Pt=pt||/\n\n(?!\s*$)/.test(mt),kt!==On-1&&(pt=mt.charAt(mt.length-1)===`
|
|
`,Pt||(Pt=pt)),Pt&&($e.loose=!0),Rt=/^\[[ xX]\] /.test(mt),Gt=void 0,Rt&&(Gt=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),$e.items.push({type:"list_item",raw:ye,task:Rt,checked:Gt,loose:Pt,text:mt});return $e}},ce.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]}},ce.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 ye=he[1].toLowerCase().replace(/\s+/g," ");return{tag:ye,raw:he[0],href:he[2],title:he[3]}}},ce.table=function(le){var he=this.rules.block.table.exec(le);if(he){var ye={type:"table",header:V(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ye.header.length===ye.align.length){ye.raw=he[0];var _e=ye.align.length,Oe;for(Oe=0;Oe<_e;Oe++)/^ *-+: *$/.test(ye.align[Oe])?ye.align[Oe]="right":/^ *:-+: *$/.test(ye.align[Oe])?ye.align[Oe]="center":/^ *:-+ *$/.test(ye.align[Oe])?ye.align[Oe]="left":ye.align[Oe]=null;for(_e=ye.cells.length,Oe=0;Oe<_e;Oe++)ye.cells[Oe]=V(ye.cells[Oe].replace(/^ *\| *| *\| *$/g,""),ye.header.length);return ye}}},ce.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]}},ce.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]}},ce.text=function(le,he){var ye=this.rules.block.text.exec(le);if(ye){var _e=he[he.length-1];return _e&&_e.type==="text"?{raw:ye[0],text:ye[0]}:{type:"text",raw:ye[0],text:ye[0]}}},ce.escape=function(le){var he=this.rules.inline.escape.exec(le);if(he)return{type:"escape",raw:he[0],text:ne(he[1])}},ce.tag=function(le,he,ye){var _e=this.rules.inline.tag.exec(le);if(_e)return!he&&/^<a /i.test(_e[0])?he=!0:he&&/^<\/a>/i.test(_e[0])&&(he=!1),!ye&&/^<(pre|code|kbd|script)(\s|>)/i.test(_e[0])?ye=!0:ye&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(_e[0])&&(ye=!1),{type:this.options.sanitize?"text":"html",raw:_e[0],inLink:he,inRawBlock:ye,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):ne(_e[0]):_e[0]}},ce.link=function(le){var he=this.rules.inline.link.exec(le);if(he){var ye=se(he[2],"()");if(ye>-1){var _e=he[0].indexOf("!")===0?5:4,Oe=_e+he[1].length+ye;he[2]=he[2].substring(0,ye),he[0]=he[0].substring(0,Oe).trim(),he[3]=""}var ke=he[2],$e="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ke);ot?(ke=ot[1],$e=ot[3]):$e=""}else $e=he[3]?he[3].slice(1,-1):"";ke=ke.trim().replace(/^<([\s\S]*)>$/,"$1");var pt=Se(he,{href:ke&&ke.replace(this.rules.inline._escapes,"$1"),title:$e&&$e.replace(this.rules.inline._escapes,"$1")},he[0]);return pt}},ce.reflink=function(le,he){var ye;if((ye=this.rules.inline.reflink.exec(le))||(ye=this.rules.inline.nolink.exec(le))){var _e=(ye[2]||ye[1]).replace(/\s+/g," ");if(_e=he[_e.toLowerCase()],!_e||!_e.href){var Oe=ye[0].charAt(0);return{type:"text",raw:Oe,text:Oe}}var ke=Se(ye,_e,ye[0]);return ke}},ce.strong=function(le,he,ye){ye===void 0&&(ye="");var _e=this.rules.inline.strong.start.exec(le);if(_e&&(!_e[1]||_e[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){he=he.slice(-1*le.length);var Oe=_e[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Oe.lastIndex=0;for(var ke;(_e=Oe.exec(he))!=null;)if(ke=this.rules.inline.strong.middle.exec(he.slice(0,_e.index+3)),ke)return{type:"strong",raw:le.slice(0,ke[0].length),text:le.slice(2,ke[0].length-2)}}},ce.em=function(le,he,ye){ye===void 0&&(ye="");var _e=this.rules.inline.em.start.exec(le);if(_e&&(!_e[1]||_e[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){he=he.slice(-1*le.length);var Oe=_e[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Oe.lastIndex=0;for(var ke;(_e=Oe.exec(he))!=null;)if(ke=this.rules.inline.em.middle.exec(he.slice(0,_e.index+2)),ke)return{type:"em",raw:le.slice(0,ke[0].length),text:le.slice(1,ke[0].length-1)}}},ce.codespan=function(le){var he=this.rules.inline.code.exec(le);if(he){var ye=he[2].replace(/\n/g," "),_e=/[^ ]/.test(ye),Oe=ye.startsWith(" ")&&ye.endsWith(" ");return _e&&Oe&&(ye=ye.substring(1,ye.length-1)),ye=ne(ye,!0),{type:"codespan",raw:he[0],text:ye}}},ce.br=function(le){var he=this.rules.inline.br.exec(le);if(he)return{type:"br",raw:he[0]}},ce.del=function(le){var he=this.rules.inline.del.exec(le);if(he)return{type:"del",raw:he[0],text:he[1]}},ce.autolink=function(le,he){var ye=this.rules.inline.autolink.exec(le);if(ye){var _e,Oe;return ye[2]==="@"?(_e=ne(this.options.mangle?he(ye[1]):ye[1]),Oe="mailto:"+_e):(_e=ne(ye[1]),Oe=_e),{type:"link",raw:ye[0],text:_e,href:Oe,tokens:[{type:"text",raw:_e,text:_e}]}}},ce.url=function(le,he){var ye;if(ye=this.rules.inline.url.exec(le)){var _e,Oe;if(ye[2]==="@")_e=ne(this.options.mangle?he(ye[0]):ye[0]),Oe="mailto:"+_e;else{var ke;do ke=ye[0],ye[0]=this.rules.inline._backpedal.exec(ye[0])[0];while(ke!==ye[0]);_e=ne(ye[0]),ye[1]==="www."?Oe="http://"+_e:Oe=_e}return{type:"link",raw:ye[0],text:_e,href:Oe,tokens:[{type:"text",raw:_e,text:_e}]}}},ce.inlineText=function(le,he,ye){var _e=this.rules.inline.text.exec(le);if(_e){var Oe;return he?Oe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):ne(_e[0]):_e[0]:Oe=ne(this.options.smartypants?ye(_e[0]):_e[0]),{type:"text",raw:_e[0],text:Oe}}},ie}(),Pe=K.noopTest,Fe=K.edit,je=K.merge,Te={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Pe,table:Pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Te.def=Fe(Te.def).replace("label",Te._label).replace("title",Te._title).getRegex(),Te.bullet=/(?:[*+-]|\d{1,9}[.)])/,Te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Te.item=Fe(Te.item,"gm").replace(/bull/g,Te.bullet).getRegex(),Te.list=Fe(Te.list).replace(/bull/g,Te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Te.def.source+")").getRegex(),Te._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",Te._comment=/<!--(?!-?>)[\s\S]*?-->/,Te.html=Fe(Te.html,"i").replace("comment",Te._comment).replace("tag",Te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Te.paragraph=Fe(Te._paragraph).replace("hr",Te.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",Te._tag).getRegex(),Te.blockquote=Fe(Te.blockquote).replace("paragraph",Te.paragraph).getRegex(),Te.normal=je({},Te),Te.gfm=je({},Te.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*|$)"}),Te.gfm.nptable=Fe(Te.gfm.nptable).replace("hr",Te.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",Te._tag).getRegex(),Te.gfm.table=Fe(Te.gfm.table).replace("hr",Te.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",Te._tag).getRegex(),Te.pedantic=je({},Te.normal,{html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Te._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Pe,paragraph:Fe(Te.normal._paragraph).replace("hr",Te.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Z.punctuation=Fe(Z.punctuation).replace(/punctuation/g,Z._punctuation).getRegex(),Z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Z.em.start=Fe(Z.em.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.middle=Fe(Z.em.middle).replace(/punctuation/g,Z._punctuation).replace(/overlapSkip/g,Z._overlapSkip).getRegex(),Z.em.endAst=Fe(Z.em.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.endUnd=Fe(Z.em.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.start=Fe(Z.strong.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.middle=Fe(Z.strong.middle).replace(/punctuation/g,Z._punctuation).replace(/blockSkip/g,Z._blockSkip).getRegex(),Z.strong.endAst=Fe(Z.strong.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.endUnd=Fe(Z.strong.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.blockSkip=Fe(Z._blockSkip,"g").getRegex(),Z.overlapSkip=Fe(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=Fe(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=Fe(Z.tag).replace("comment",Te._comment).replace("attribute",Z._attribute).getRegex(),Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Z.link=Fe(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex(),Z.reflink=Fe(Z.reflink).replace("label",Z._label).getRegex(),Z.reflinkSearch=Fe(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex(),Z.normal=je({},Z),Z.pedantic=je({},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:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()}),Z.gfm=je({},Z.normal,{escape:Fe(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=Fe(Z.gfm.url,"i").replace("email",Z.gfm._extended_email).getRegex(),Z.breaks=je({},Z.gfm,{br:Fe(Z.br).replace("{2,}","*").getRegex(),text:Fe(Z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var U={block:Te,inline:Z},G=H.defaults,ee=U.block,ue=U.inline;function J(ie){return ie.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function we(ie){var ce="",pe,le,he=ie.length;for(pe=0;pe<he;pe++)le=ie.charCodeAt(pe),Math.random()>.5&&(le="x"+le.toString(16)),ce+="&#"+le+";";return ce}var Ge=function(){function ie(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||G,this.options.tokenizer=this.options.tokenizer||new Ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:ee.normal,inline:ue.normal};this.options.pedantic?(le.block=ee.pedantic,le.inline=ue.pedantic):this.options.gfm&&(le.block=ee.gfm,this.options.breaks?le.inline=ue.breaks:le.inline=ue.gfm),this.tokenizer.rules=le}ie.lex=function(le,he){var ye=new ie(he);return ye.lex(le)};var ce=ie.prototype;return ce.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},ce.blockTokens=function(le,he,ye){he===void 0&&(he=[]),ye===void 0&&(ye=!0),le=le.replace(/^ +$/gm,"");for(var _e,Oe,ke,$e;le;){if(_e=this.tokenizer.space(le)){le=le.substring(_e.raw.length),_e.type&&he.push(_e);continue}if(_e=this.tokenizer.code(le,he)){le=le.substring(_e.raw.length),_e.type?he.push(_e):($e=he[he.length-1],$e.raw+=`
|
|
`+_e.raw,$e.text+=`
|
|
`+_e.text);continue}if(_e=this.tokenizer.fences(le)){le=le.substring(_e.raw.length),he.push(_e);continue}if(_e=this.tokenizer.heading(le)){le=le.substring(_e.raw.length),he.push(_e);continue}if(_e=this.tokenizer.nptable(le)){le=le.substring(_e.raw.length),he.push(_e);continue}if(_e=this.tokenizer.hr(le)){le=le.substring(_e.raw.length),he.push(_e);continue}if(_e=this.tokenizer.blockquote(le)){le=le.substring(_e.raw.length),_e.tokens=this.blockTokens(_e.text,[],ye),he.push(_e);continue}if(_e=this.tokenizer.list(le)){for(le=le.substring(_e.raw.length),ke=_e.items.length,Oe=0;Oe<ke;Oe++)_e.items[Oe].tokens=this.blockTokens(_e.items[Oe].text,[],!1);he.push(_e);continue}if(_e=this.tokenizer.html(le)){le=le.substring(_e.raw.length),he.push(_e);continue}if(ye&&(_e=this.tokenizer.def(le))){le=le.substring(_e.raw.length),this.tokens.links[_e.tag]||(this.tokens.links[_e.tag]={href:_e.href,title:_e.title});continue}if(_e=this.tokenizer.table(le)){le=le.substring(_e.raw.length),he.push(_e);continue}if(_e=this.tokenizer.lheading(le)){le=le.substring(_e.raw.length),he.push(_e);continue}if(ye&&(_e=this.tokenizer.paragraph(le))){le=le.substring(_e.raw.length),he.push(_e);continue}if(_e=this.tokenizer.text(le,he)){le=le.substring(_e.raw.length),_e.type?he.push(_e):($e=he[he.length-1],$e.raw+=`
|
|
`+_e.raw,$e.text+=`
|
|
`+_e.text);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},ce.inline=function(le){var he,ye,_e,Oe,ke,$e,ot=le.length;for(he=0;he<ot;he++){$e=le[he];switch($e.type){case"paragraph":case"text":case"heading":{$e.tokens=[],this.inlineTokens($e.text,$e.tokens);break}case"table":{for($e.tokens={header:[],cells:[]},Oe=$e.header.length,ye=0;ye<Oe;ye++)$e.tokens.header[ye]=[],this.inlineTokens($e.header[ye],$e.tokens.header[ye]);for(Oe=$e.cells.length,ye=0;ye<Oe;ye++)for(ke=$e.cells[ye],$e.tokens.cells[ye]=[],_e=0;_e<ke.length;_e++)$e.tokens.cells[ye][_e]=[],this.inlineTokens(ke[_e],$e.tokens.cells[ye][_e]);break}case"blockquote":{this.inline($e.tokens);break}case"list":{for(Oe=$e.items.length,ye=0;ye<Oe;ye++)this.inline($e.items[ye].tokens);break}}}return le},ce.inlineTokens=function(le,he,ye,_e,Oe){he===void 0&&(he=[]),ye===void 0&&(ye=!1),_e===void 0&&(_e=!1),Oe===void 0&&(Oe="");var ke,$e=le,ot;if(this.tokens.links){var pt=Object.keys(this.tokens.links);if(pt.length>0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec($e))!=null;)pt.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&($e=$e.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec($e))!=null;)$e=$e.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;le;){if(ke=this.tokenizer.escape(le)){le=le.substring(ke.raw.length),he.push(ke);continue}if(ke=this.tokenizer.tag(le,ye,_e)){le=le.substring(ke.raw.length),ye=ke.inLink,_e=ke.inRawBlock,he.push(ke);continue}if(ke=this.tokenizer.link(le)){le=le.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,_e)),he.push(ke);continue}if(ke=this.tokenizer.reflink(le,this.tokens.links)){le=le.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,_e)),he.push(ke);continue}if(ke=this.tokenizer.strong(le,$e,Oe)){le=le.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],ye,_e),he.push(ke);continue}if(ke=this.tokenizer.em(le,$e,Oe)){le=le.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],ye,_e),he.push(ke);continue}if(ke=this.tokenizer.codespan(le)){le=le.substring(ke.raw.length),he.push(ke);continue}if(ke=this.tokenizer.br(le)){le=le.substring(ke.raw.length),he.push(ke);continue}if(ke=this.tokenizer.del(le)){le=le.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],ye,_e),he.push(ke);continue}if(ke=this.tokenizer.autolink(le,we)){le=le.substring(ke.raw.length),he.push(ke);continue}if(!ye&&(ke=this.tokenizer.url(le,we))){le=le.substring(ke.raw.length),he.push(ke);continue}if(ke=this.tokenizer.inlineText(le,_e,J)){le=le.substring(ke.raw.length),Oe=ke.raw.slice(-1),he.push(ke);continue}if(le){var mt="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return he},z(ie,null,[{key:"rules",get:function(){return{block:ee,inline:ue}}}]),ie}(),Je=H.defaults,be=K.cleanUrl,Re=K.escape,xe=function(){function ie(pe){this.options=pe||Je}var ce=ie.prototype;return ce.code=function(le,he,ye){var _e=(he||"").match(/\S*/)[0];if(this.options.highlight){var Oe=this.options.highlight(le,_e);Oe!=null&&Oe!==le&&(ye=!0,le=Oe)}return _e?'<pre><code class="'+this.options.langPrefix+Re(_e,!0)+'">'+(ye?le:Re(le,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ye?le:Re(le,!0))+`</code></pre>
|
|
`},ce.blockquote=function(le){return`<blockquote>
|
|
`+le+`</blockquote>
|
|
`},ce.html=function(le){return le},ce.heading=function(le,he,ye,_e){return this.options.headerIds?"<h"+he+' id="'+this.options.headerPrefix+_e.slug(ye)+'">'+le+"</h"+he+`>
|
|
`:"<h"+he+">"+le+"</h"+he+`>
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ce.list=function(le,he,ye){var _e=he?"ol":"ul",Oe=he&&ye!==1?' start="'+ye+'"':"";return"<"+_e+Oe+`>
|
|
`+le+"</"+_e+`>
|
|
`},ce.listitem=function(le){return"<li>"+le+`</li>
|
|
`},ce.checkbox=function(le){return"<input "+(le?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(le){return"<p>"+le+`</p>
|
|
`},ce.table=function(le,he){return he&&(he="<tbody>"+he+"</tbody>"),`<table>
|
|
<thead>
|
|
`+le+`</thead>
|
|
`+he+`</table>
|
|
`},ce.tablerow=function(le){return`<tr>
|
|
`+le+`</tr>
|
|
`},ce.tablecell=function(le,he){var ye=he.header?"th":"td",_e=he.align?"<"+ye+' align="'+he.align+'">':"<"+ye+">";return _e+le+"</"+ye+`>
|
|
`},ce.strong=function(le){return"<strong>"+le+"</strong>"},ce.em=function(le){return"<em>"+le+"</em>"},ce.codespan=function(le){return"<code>"+le+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(le){return"<del>"+le+"</del>"},ce.link=function(le,he,ye){if(le=be(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var _e='<a href="'+Re(le)+'"';return he&&(_e+=' title="'+he+'"'),_e+=">"+ye+"</a>",_e},ce.image=function(le,he,ye){if(le=be(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var _e='<img src="'+le+'" alt="'+ye+'"';return he&&(_e+=' title="'+he+'"'),_e+=this.options.xhtml?"/>":">",_e},ce.text=function(le){return le},ie}(),Ce=function(){function ie(){}var ce=ie.prototype;return ce.strong=function(le){return le},ce.em=function(le){return le},ce.codespan=function(le){return le},ce.del=function(le){return le},ce.html=function(le){return le},ce.text=function(le){return le},ce.link=function(le,he,ye){return""+ye},ce.image=function(le,he,ye){return""+ye},ce.br=function(){return""},ie}(),Be=function(){function ie(){this.seen={}}var ce=ie.prototype;return ce.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 ye=he;do this.seen[ye]++,he=ye+"-"+this.seen[ye];while(this.seen.hasOwnProperty(he))}return this.seen[he]=0,he},ie}(),Xe=H.defaults,qe=K.unescape,tt=function(){function ie(pe){this.options=pe||Xe,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ce,this.slugger=new Be}ie.parse=function(le,he){var ye=new ie(he);return ye.parse(le)};var ce=ie.prototype;return ce.parse=function(le,he){he===void 0&&(he=!0);var ye="",_e,Oe,ke,$e,ot,pt,mt,qt,xt,Ct,Pt,Rt,Gt,On,kt,Un,An,en,wn=le.length;for(_e=0;_e<wn;_e++){Ct=le[_e];switch(Ct.type){case"space":continue;case"hr":{ye+=this.renderer.hr();continue}case"heading":{ye+=this.renderer.heading(this.parseInline(Ct.tokens),Ct.depth,qe(this.parseInline(Ct.tokens,this.textRenderer)),this.slugger);continue}case"code":{ye+=this.renderer.code(Ct.text,Ct.lang,Ct.escaped);continue}case"table":{for(qt="",mt="",$e=Ct.header.length,Oe=0;Oe<$e;Oe++)mt+=this.renderer.tablecell(this.parseInline(Ct.tokens.header[Oe]),{header:!0,align:Ct.align[Oe]});for(qt+=this.renderer.tablerow(mt),xt="",$e=Ct.cells.length,Oe=0;Oe<$e;Oe++){for(pt=Ct.tokens.cells[Oe],mt="",ot=pt.length,ke=0;ke<ot;ke++)mt+=this.renderer.tablecell(this.parseInline(pt[ke]),{header:!1,align:Ct.align[ke]});xt+=this.renderer.tablerow(mt)}ye+=this.renderer.table(qt,xt);continue}case"blockquote":{xt=this.parse(Ct.tokens),ye+=this.renderer.blockquote(xt);continue}case"list":{for(Pt=Ct.ordered,Rt=Ct.start,Gt=Ct.loose,$e=Ct.items.length,xt="",Oe=0;Oe<$e;Oe++)kt=Ct.items[Oe],Un=kt.checked,An=kt.task,On="",kt.task&&(en=this.renderer.checkbox(Un),Gt?kt.tokens.length>0&&kt.tokens[0].type==="text"?(kt.tokens[0].text=en+" "+kt.tokens[0].text,kt.tokens[0].tokens&&kt.tokens[0].tokens.length>0&&kt.tokens[0].tokens[0].type==="text"&&(kt.tokens[0].tokens[0].text=en+" "+kt.tokens[0].tokens[0].text)):kt.tokens.unshift({type:"text",text:en}):On+=en),On+=this.parse(kt.tokens,Gt),xt+=this.renderer.listitem(On,An,Un);ye+=this.renderer.list(xt,Pt,Rt);continue}case"html":{ye+=this.renderer.html(Ct.text);continue}case"paragraph":{ye+=this.renderer.paragraph(this.parseInline(Ct.tokens));continue}case"text":{for(xt=Ct.tokens?this.parseInline(Ct.tokens):Ct.text;_e+1<wn&&le[_e+1].type==="text";)Ct=le[++_e],xt+=`
|
|
`+(Ct.tokens?this.parseInline(Ct.tokens):Ct.text);ye+=he?this.renderer.paragraph(xt):xt;continue}default:{var Wt='Token with "'+Ct.type+'" type was not found.';if(this.options.silent){console.error(Wt);return}else throw new Error(Wt)}}}return ye},ce.parseInline=function(le,he){he=he||this.renderer;var ye="",_e,Oe,ke=le.length;for(_e=0;_e<ke;_e++){Oe=le[_e];switch(Oe.type){case"escape":{ye+=he.text(Oe.text);break}case"html":{ye+=he.html(Oe.text);break}case"link":{ye+=he.link(Oe.href,Oe.title,this.parseInline(Oe.tokens,he));break}case"image":{ye+=he.image(Oe.href,Oe.title,Oe.text);break}case"strong":{ye+=he.strong(this.parseInline(Oe.tokens,he));break}case"em":{ye+=he.em(this.parseInline(Oe.tokens,he));break}case"codespan":{ye+=he.codespan(Oe.text);break}case"br":{ye+=he.br();break}case"del":{ye+=he.del(this.parseInline(Oe.tokens,he));break}case"text":{ye+=he.text(Oe.text);break}default:{var $e='Token with "'+Oe.type+'" type was not found.';if(this.options.silent){console.error($e);return}else throw new Error($e)}}}return ye},ie}(),ht=K.merge,ft=K.checkSanitizeDeprecation,Ne=K.escape,Ue=H.getDefaults,Ze=H.changeDefaults,et=H.defaults;function fe(ie,ce,pe){if(typeof ie=="undefined"||ie===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ie!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ie)+", string expected");if(typeof ce=="function"&&(pe=ce,ce=null),ce=ht({},fe.defaults,ce||{}),ft(ce),pe){var le=ce.highlight,he;try{he=Ge.lex(ie,ce)}catch(ke){return pe(ke)}var ye=function($e){var ot;if(!$e)try{ot=tt.parse(he,ce)}catch(pt){$e=pt}return ce.highlight=le,$e?pe($e):pe(null,ot)};if(!le||le.length<3)return ye();if(delete ce.highlight,!he.length)return ye();var _e=0;fe.walkTokens(he,function(ke){ke.type==="code"&&(_e++,setTimeout(function(){le(ke.text,ke.lang,function($e,ot){if($e)return ye($e);ot!=null&&ot!==ke.text&&(ke.text=ot,ke.escaped=!0),_e--,_e===0&&ye()})},0))}),_e===0&&ye();return}try{var Oe=Ge.lex(ie,ce);return ce.walkTokens&&fe.walkTokens(Oe,ce.walkTokens),tt.parse(Oe,ce)}catch(ke){if(ke.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Ne(ke.message+"",!0)+"</pre>";throw ke}}fe.options=fe.setOptions=function(ie){return ht(fe.defaults,ie),Ze(fe.defaults),fe},fe.getDefaults=Ue,fe.defaults=et,fe.use=function(ie){var ce=ht({},ie);if(ie.renderer&&function(){var le=fe.defaults.renderer||new xe,he=function(Oe){var ke=le[Oe];le[Oe]=function(){for(var $e=arguments.length,ot=new Array($e),pt=0;pt<$e;pt++)ot[pt]=arguments[pt];var mt=ie.renderer[Oe].apply(le,ot);return mt===!1&&(mt=ke.apply(le,ot)),mt}};for(var ye in ie.renderer)he(ye);ce.renderer=le}(),ie.tokenizer&&function(){var le=fe.defaults.tokenizer||new Ae,he=function(Oe){var ke=le[Oe];le[Oe]=function(){for(var $e=arguments.length,ot=new Array($e),pt=0;pt<$e;pt++)ot[pt]=arguments[pt];var mt=ie.tokenizer[Oe].apply(le,ot);return mt===!1&&(mt=ke.apply(le,ot)),mt}};for(var ye in ie.tokenizer)he(ye);ce.tokenizer=le}(),ie.walkTokens){var pe=fe.defaults.walkTokens;ce.walkTokens=function(le){ie.walkTokens(le),pe&&pe(le)}}fe.setOptions(ce)},fe.walkTokens=function(ie,ce){for(var pe=N(ie),le;!(le=pe()).done;){var he=le.value;ce(he);switch(he.type){case"table":{for(var ye=N(he.tokens.header),_e;!(_e=ye()).done;){var Oe=_e.value;fe.walkTokens(Oe,ce)}for(var ke=N(he.tokens.cells),$e;!($e=ke()).done;)for(var ot=$e.value,pt=N(ot),mt;!(mt=pt()).done;){var qt=mt.value;fe.walkTokens(qt,ce)}break}case"list":{fe.walkTokens(he.items,ce);break}default:he.tokens&&fe.walkTokens(he.tokens,ce)}}},fe.Parser=tt,fe.parser=tt.parse,fe.Renderer=xe,fe.TextRenderer=Ce,fe.Lexer=Ge,fe.lexer=Ge.lex,fe.Tokenizer=Ae,fe.Slugger=Be,fe.parse=fe;var re=fe;return re})},"DlR+":function(We,ge,D){var q=D("MFOe"),z=q.Global,P=q.trim;We.exports={name:"cookieStorage",read:N,write:H,each:O,remove:k,clearAll:n};var Y=z.document;function N(g){if(!g||!I(g))return null;var p="(?:^|.*;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(Y.cookie.replace(new RegExp(p),"$1"))}function O(g){for(var p=Y.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 H(g,p){if(!g)return;Y.cookie=escape(g)+"="+escape(p)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function k(g){if(!g||!I(g))return;Y.cookie=escape(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){O(function(g,p){k(p)})}function I(g){return new RegExp("(?:^|;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(Y.cookie)}},E2g8:function(We,ge,D){(function(q,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,Y){We.exports=Y()})(this,function(){"use strict";function P(xe){var Ce=typeof xe;return xe!==null&&(Ce==="object"||Ce==="function")}function Y(xe){return typeof xe=="function"}var N=void 0;Array.isArray?N=Array.isArray:N=function(xe){return Object.prototype.toString.call(xe)==="[object Array]"};var O=N,H=0,k=void 0,n=void 0,I=function(Ce,Be){T[H]=Ce,T[H+1]=Be,H+=2,H===2&&(n?n(A):v())};function g(xe){n=xe}function p(xe){I=xe}var h=typeof window!="undefined"?window:void 0,c=h||{},o=c.MutationObserver||c.WebKitMutationObserver,d=typeof self=="undefined"&&typeof q!="undefined"&&{}.toString.call(q)==="[object process]",i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function a(){return function(){return q.nextTick(A)}}function r(){return typeof k!="undefined"?function(){k(A)}:x()}function s(){var xe=0,Ce=new o(A),Be=document.createTextNode("");return Ce.observe(Be,{characterData:!0}),function(){Be.data=xe=++xe%2}}function S(){var xe=new MessageChannel;return xe.port1.onmessage=A,function(){return xe.port2.postMessage(0)}}function x(){var xe=setTimeout;return function(){return xe(A,1)}}var T=new Array(1e3);function A(){for(var xe=0;xe<H;xe+=2){var Ce=T[xe],Be=T[xe+1];Ce(Be),T[xe]=void 0,T[xe+1]=void 0}H=0}function w(){try{var xe=Function("return this")().require("vertx");return k=xe.runOnLoop||xe.runOnContext,r()}catch(Ce){return x()}}var v=void 0;d?v=a():o?v=s():i?v=S():h===void 0&&!0?v=w():v=x();function E(xe,Ce){var Be=this,Xe=new this.constructor(C);Xe[f]===void 0&&U(Xe);var qe=Be._state;if(qe){var tt=arguments[qe-1];I(function(){return Fe(qe,Xe,tt,Be._result)})}else Ae(Be,Xe,xe,Ce);return Xe}function m(xe){var Ce=this;if(xe&&typeof xe=="object"&&xe.constructor===Ce)return xe;var Be=new Ce(C);return ne(Be,xe),Be}var f=Math.random().toString(36).substring(2);function C(){}var b=void 0,y=1,M=2;function W(){return new TypeError("You cannot resolve a promise with itself")}function L(){return new TypeError("A promises callback cannot return that same promise.")}function K(xe,Ce,Be,Xe){try{xe.call(Ce,Be,Xe)}catch(qe){return qe}}function F(xe,Ce,Be){I(function(Xe){var qe=!1,tt=K(Be,Ce,function(ht){if(qe)return;qe=!0,Ce!==ht?ne(Xe,ht):Se(Xe,ht)},function(ht){if(qe)return;qe=!0,Le(Xe,ht)},"Settle: "+(Xe._label||" unknown promise"));!qe&&tt&&(qe=!0,Le(Xe,tt))},xe)}function R(xe,Ce){Ce._state===y?Se(xe,Ce._result):Ce._state===M?Le(xe,Ce._result):Ae(Ce,void 0,function(Be){return ne(xe,Be)},function(Be){return Le(xe,Be)})}function V(xe,Ce,Be){Ce.constructor===xe.constructor&&Be===E&&Ce.constructor.resolve===m?R(xe,Ce):Be===void 0?Se(xe,Ce):Y(Be)?F(xe,Ce,Be):Se(xe,Ce)}function ne(xe,Ce){if(xe===Ce)Le(xe,W());else if(P(Ce)){var Be=void 0;try{Be=Ce.then}catch(Xe){Le(xe,Xe);return}V(xe,Ce,Be)}else Se(xe,Ce)}function se(xe){xe._onerror&&xe._onerror(xe._result),Pe(xe)}function Se(xe,Ce){if(xe._state!==b)return;xe._result=Ce,xe._state=y,xe._subscribers.length!==0&&I(Pe,xe)}function Le(xe,Ce){if(xe._state!==b)return;xe._state=M,xe._result=Ce,I(se,xe)}function Ae(xe,Ce,Be,Xe){var qe=xe._subscribers,tt=qe.length;xe._onerror=null,qe[tt]=Ce,qe[tt+y]=Be,qe[tt+M]=Xe,tt===0&&xe._state&&I(Pe,xe)}function Pe(xe){var Ce=xe._subscribers,Be=xe._state;if(Ce.length===0)return;for(var Xe=void 0,qe=void 0,tt=xe._result,ht=0;ht<Ce.length;ht+=3)Xe=Ce[ht],qe=Ce[ht+Be],Xe?Fe(Be,Xe,qe,tt):qe(tt);xe._subscribers.length=0}function Fe(xe,Ce,Be,Xe){var qe=Y(Be),tt=void 0,ht=void 0,ft=!0;if(qe){try{tt=Be(Xe)}catch(Ne){ft=!1,ht=Ne}if(Ce===tt){Le(Ce,L());return}}else tt=Xe;Ce._state!==b||(qe&&ft?ne(Ce,tt):ft===!1?Le(Ce,ht):xe===y?Se(Ce,tt):xe===M&&Le(Ce,tt))}function je(xe,Ce){try{Ce(function(Xe){ne(xe,Xe)},function(Xe){Le(xe,Xe)})}catch(Be){Le(xe,Be)}}var Te=0;function Z(){return Te++}function U(xe){xe[f]=Te++,xe._state=void 0,xe._result=void 0,xe._subscribers=[]}function G(){return new Error("Array Methods must be provided an Array")}var ee=function(){function xe(Ce,Be){this._instanceConstructor=Ce,this.promise=new Ce(C),this.promise[f]||U(this.promise),O(Be)?(this.length=Be.length,this._remaining=Be.length,this._result=new Array(this.length),this.length===0?Se(this.promise,this._result):(this.length=this.length||0,this._enumerate(Be),this._remaining===0&&Se(this.promise,this._result))):Le(this.promise,G())}return xe.prototype._enumerate=function(Be){for(var Xe=0;this._state===b&&Xe<Be.length;Xe++)this._eachEntry(Be[Xe],Xe)},xe.prototype._eachEntry=function(Be,Xe){var qe=this._instanceConstructor,tt=qe.resolve;if(tt===m){var ht=void 0,ft=void 0,Ne=!1;try{ht=Be.then}catch(Ze){Ne=!0,ft=Ze}if(ht===E&&Be._state!==b)this._settledAt(Be._state,Xe,Be._result);else if(typeof ht!="function")this._remaining--,this._result[Xe]=Be;else if(qe===be){var Ue=new qe(C);Ne?Le(Ue,ft):V(Ue,Be,ht),this._willSettleAt(Ue,Xe)}else this._willSettleAt(new qe(function(Ze){return Ze(Be)}),Xe)}else this._willSettleAt(tt(Be),Xe)},xe.prototype._settledAt=function(Be,Xe,qe){var tt=this.promise;tt._state===b&&(this._remaining--,Be===M?Le(tt,qe):this._result[Xe]=qe),this._remaining===0&&Se(tt,this._result)},xe.prototype._willSettleAt=function(Be,Xe){var qe=this;Ae(Be,void 0,function(tt){return qe._settledAt(y,Xe,tt)},function(tt){return qe._settledAt(M,Xe,tt)})},xe}();function ue(xe){return new ee(this,xe).promise}function J(xe){var Ce=this;return O(xe)?new Ce(function(Be,Xe){for(var qe=xe.length,tt=0;tt<qe;tt++)Ce.resolve(xe[tt]).then(Be,Xe)}):new Ce(function(Be,Xe){return Xe(new TypeError("You must pass an array to race."))})}function we(xe){var Ce=this,Be=new Ce(C);return Le(Be,xe),Be}function Ge(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Je(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var be=function(){function xe(Ce){this[f]=Z(),this._result=this._state=void 0,this._subscribers=[],C!==Ce&&(typeof Ce!="function"&&Ge(),this instanceof xe?je(this,Ce):Je())}return xe.prototype.catch=function(Be){return this.then(null,Be)},xe.prototype.finally=function(Be){var Xe=this,qe=Xe.constructor;return Y(Be)?Xe.then(function(tt){return qe.resolve(Be()).then(function(){return tt})},function(tt){return qe.resolve(Be()).then(function(){throw tt})}):Xe.then(Be,Be)},xe}();be.prototype.then=E,be.all=ue,be.race=J,be.resolve=m,be.reject=we,be._setScheduler=g,be._setAsap=p,be._asap=I;function Re(){var xe=void 0;if(typeof z!="undefined")xe=z;else if(typeof self!="undefined")xe=self;else try{xe=Function("return this")()}catch(Xe){throw new Error("polyfill failed because global object is unavailable in this environment")}var Ce=xe.Promise;if(Ce){var Be=null;try{Be=Object.prototype.toString.call(Ce.resolve())}catch(Xe){}if(Be==="[object Promise]"&&!Ce.cast)return}xe.Promise=be}return be.polyfill=Re,be.Promise=be,be})}).call(this,D("Q2Ig"),D("IyRk"))},E9nw:function(We,ge){We.exports=function(){var D=document.getSelection();if(!D.rangeCount)return function(){};for(var q=document.activeElement,z=[],P=0;P<D.rangeCount;P++)z.push(D.getRangeAt(P));switch(q.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":q.blur();break;default:q=null;break}return D.removeAllRanges(),function(){D.type==="Caret"&&D.removeAllRanges(),D.rangeCount||z.forEach(function(Y){D.addRange(Y)}),q&&q.focus()}}},EHPI:function(We,ge,D){"use strict";var q=D("bbsP"),z=D("/wGt"),P=D("tJVT"),Y=D("k1fw"),N=D("q1tI"),O=D.n(N),H=D("ZW9T"),k=D("ZD9Y"),n=D("M8RZ"),I=D("bCnd"),g=D("fcyK"),p=D.n(g),h={theme:Object(I.a)("cmCodeMode","vs-dark"),fontSize:Object(I.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(I.a)("cmTabToSpace",!0)},c;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(c||(c={}));function o(i,a){switch(a.type){case c.set_show_editor_setting:return Object(Y.a)(Object(Y.a)({},i),{},{showEditorSetting:a.payload});case c.set_theme:return Object(Y.a)(Object(Y.a)({},i),{},{theme:a.payload});case c.set_font_size:return Object(Y.a)(Object(Y.a)({},i),{},{fontSize:a.payload});case c.on_tab_to_space:return Object(Y.a)(Object(Y.a)({},i),{},{tabToSpace:a.payload});default:throw new Error}}ge.a=function(i){var a=i.isLoading,r=i.value,s=i.onChange,S=i.language,x=i.ActionBarRender,T=x===void 0?function(K){return O.a.createElement(d,{onShowCodeSetting:K})}:x,A=Object(N.useReducer)(o,h),w=Object(P.a)(A,2),v=w[0],E=w[1],m=v.theme,f=v.fontSize,C=v.showEditorSetting,b=v.tabToSpace,y={onFontSizeChange:function(F){E({type:c.set_font_size,payload:F}),Object(I.b)("cmFontSize",F)},tabToSpace:b,cmFontSize:f,className:"oj",cmCodeMode:m,onTabToSpace:function(F){E({type:c.on_tab_to_space,payload:F}),Object(I.b)("cmTabToSpace",F)},onCodeModeChange:function(F){E({type:c.set_theme,payload:F}),Object(I.b)("cmCodeMode",F)}};function M(){E({type:c.set_show_editor_setting,payload:!1})}function W(){E({type:c.set_show_editor_setting,payload:!0})}var L={value:r,language:S,onChange:s,theme:m,height:"calc(100% - 56px)",options:{fontSize:f,insertSpaces:b}};return O.a.createElement(N.Fragment,null,O.a.createElement("div",{className:"code-panel-container"},T(W),!a&&O.a.createElement(H.b,L)),O.a.createElement(n.a,null,O.a.createElement(z.a,{className:"oj",title:null,placement:"right",closable:!1,visible:C,onClose:M},O.a.createElement(k.a,y))))};function d(i){var a=i.onShowCodeSetting;return O.a.createElement("div",{className:"action-bar"},O.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),O.a.createElement("a",{onClick:a},O.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(We,ge,D){(function(q){q(D("VrN/"))})(function(q){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=q.Pos;q.defineOption("autoCloseBrackets",!1,function(o,d,i){i&&i!=q.Init&&(o.removeKeyMap(N),o.state.closeBrackets=null),d&&(O(Y(d,"pairs")),o.state.closeBrackets=d,o.addKeyMap(N))});function Y(o,d){return d=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[d]!=null?o[d]:z[d]}var N={Backspace:n,Enter:I};function O(o){for(var d=0;d<o.length;d++){var i=o.charAt(d),a="'"+i+"'";N[a]||(N[a]=H(i))}}O(z.pairs+"`");function H(o){return function(d){return p(d,o)}}function k(o){var d=o.state.closeBrackets;if(!d||d.override)return d;var i=o.getModeAt(o.getCursor());return i.closeBrackets||d}function n(o){var d=k(o);if(!d||o.getOption("disableInput"))return q.Pass;for(var i=Y(d,"pairs"),a=o.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return q.Pass;var s=h(o,a[r].head);if(!s||i.indexOf(s)%2!=0)return q.Pass}for(var r=a.length-1;r>=0;r--){var S=a[r].head;o.replaceRange("",P(S.line,S.ch-1),P(S.line,S.ch+1),"+delete")}}function I(o){var d=k(o),i=d&&Y(d,"explode");if(!i||o.getOption("disableInput"))return q.Pass;for(var a=o.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return q.Pass;var s=h(o,a[r].head);if(!s||i.indexOf(s)%2!=0)return q.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=q.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 i=k(o);if(!i||o.getOption("disableInput"))return q.Pass;var a=Y(i,"pairs"),r=a.indexOf(d);if(r==-1)return q.Pass;for(var s=Y(i,"closeBefore"),S=Y(i,"triples"),x=a.charAt(r+1)==d,T=o.listSelections(),A=r%2==0,w,v=0;v<T.length;v++){var E=T[v],m=E.head,f,C=o.getRange(m,P(m.line,m.ch+1));if(A&&!E.empty())f="surround";else if((x||!A)&&C==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 q.Pass;f="addFour"}else if(x){var b=m.ch==0?" ":o.getRange(P(m.line,m.ch-1),m);if(!q.isWordChar(C)&&b!=d&&!q.isWordChar(b))f="both";else return q.Pass}else if(A&&(C.length===0||/\s/.test(C)||s.indexOf(C)>-1))f="both";else return q.Pass;if(!w)w=f;else if(w!=f)return q.Pass}var y=r%2?a.charAt(r-1):d,M=r%2?d:a.charAt(r+1);o.operation(function(){if(w=="skip")o.execCommand("goCharRight");else if(w=="skipThree")for(var W=0;W<3;W++)o.execCommand("goCharRight");else if(w=="surround"){for(var L=o.getSelections(),W=0;W<L.length;W++)L[W]=y+L[W]+M;o.replaceSelections(L,"around"),L=o.listSelections().slice();for(var W=0;W<L.length;W++)L[W]=g(L[W]);o.setSelections(L)}else w=="both"?(o.replaceSelection(y+M,null),o.triggerElectric(y+M),o.execCommand("goCharLeft")):w=="addFour"&&(o.replaceSelection(y+y+y+y,"before"),o.execCommand("goCharRight"))})}function h(o,d){var i=o.getRange(P(d.line,d.ch-1),P(d.line,d.ch+1));return i.length==2?i:null}function c(o,d){var i=o.getTokenAt(P(d.line,d.ch+1));return/\bstring/.test(i.type)&&i.start==d.ch&&(d.ch==0||!/\bstring/.test(o.getTokenTypeAt(d)))}})},FOrL:function(We,ge,D){We.exports=D.p+"static/nodata.a6b3f948.png"},FWmy:function(We,ge,D){"use strict";D.d(ge,"a",function(){return q});function q(z,P){if(!z)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GUcZ:function(We,ge,D){"use strict";var q=D("fWQN"),z=D("mtLc"),P=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(j,X){return j.__proto__=X,j},Object.assign=Object.assign||function(j){if(j==null)throw new TypeError("Cannot convert undefined or null to object");for(var X=Object(j),$=1;$<arguments.length;$++){var te=arguments[$];if(te!=null)for(var ve in te)te.hasOwnProperty(ve)&&(X[ve]=te[ve])}return X},typeof self.Promise!="function"&&D("E2g8").polyfill()}}]),Ee}();P.install();var Y=P,N=D("+qE3"),O=D.n(N),H=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"e",value:function(j,X){(!j||Ee.FORCE_GLOBAL_TAG)&&(j=Ee.GLOBAL_TAG);var $="[".concat(j,"] > ").concat(X);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","error",$),!Ee.ENABLE_ERROR)return;console.error?console.error($):console.warn?console.warn($):console.log($)}},{key:"i",value:function(j,X){(!j||Ee.FORCE_GLOBAL_TAG)&&(j=Ee.GLOBAL_TAG);var $="[".concat(j,"] > ").concat(X);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","info",$),!Ee.ENABLE_INFO)return;console.info?console.info($):console.log($)}},{key:"w",value:function(j,X){(!j||Ee.FORCE_GLOBAL_TAG)&&(j=Ee.GLOBAL_TAG);var $="[".concat(j,"] > ").concat(X);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","warn",$),!Ee.ENABLE_WARN)return;console.warn?console.warn($):console.log($)}},{key:"d",value:function(j,X){(!j||Ee.FORCE_GLOBAL_TAG)&&(j=Ee.GLOBAL_TAG);var $="[".concat(j,"] > ").concat(X);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","debug",$),!Ee.ENABLE_DEBUG)return;console.debug?console.debug($):console.log($)}},{key:"v",value:function(j,X){(!j||Ee.FORCE_GLOBAL_TAG)&&(j=Ee.GLOBAL_TAG);var $="[".concat(j,"] > ").concat(X);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","verbose",$),!Ee.ENABLE_VERBOSE)return;console.log($)}}]),Ee}();H.GLOBAL_TAG="flv.js",H.FORCE_GLOBAL_TAG=!1,H.ENABLE_ERROR=!0,H.ENABLE_INFO=!0,H.ENABLE_WARN=!0,H.ENABLE_DEBUG=!0,H.ENABLE_VERBOSE=!0,H.ENABLE_CALLBACK=!1,H.emitter=new O.a;var k=H,n=function(){function Ee(){Object(q.a)(this,Ee),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)(Ee,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(j){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=j,this._totalBytes+=j):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=j,this._totalBytes+=j):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=j,this._totalBytes+=j,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var j=(this._now()-this._lastCheckpoint)/1e3;return j==0&&(j=1),this._intervalBytes/j/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 j=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/j/1024}}]),Ee}(),I=n,g=D("yKVA"),p=D("879j"),h=function(){function Ee(de){Object(q.a)(this,Ee),this._message=de}return Object(z.a)(Ee,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Ee}(),c=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(X){return Object(q.a)(this,j),de.call(this,X)}return Object(z.a)(j,[{key:"name",get:function(){return"IllegalStateException"}}]),j}(h),o=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(X){return Object(q.a)(this,j),de.call(this,X)}return Object(z.a)(j,[{key:"name",get:function(){return"InvalidArgumentException"}}]),j}(h),d=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(X){return Object(q.a)(this,j),de.call(this,X)}return Object(z.a)(j,[{key:"name",get:function(){return"NotImplementedException"}}]),j}(h),i={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"},r=function(){function Ee(de){Object(q.a)(this,Ee),this._type=de||"undefined",this._status=i.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(z.a)(Ee,[{key:"destroy",value:function(){this._status=i.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===i.kConnecting||this._status===i.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(j){this._onContentLengthKnown=j}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(j){this._onURLRedirect=j}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(j){this._onDataArrival=j}},{key:"onError",get:function(){return this._onError},set:function(j){this._onError=j}},{key:"onComplete",get:function(){return this._onComplete},set:function(j){this._onComplete=j}},{key:"open",value:function(j,X){throw new d("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new d("Unimplemented abstract function!")}}]),Ee}(),s=D("oZsa");function S(Ee,de){for(;!Object.prototype.hasOwnProperty.call(Ee,de)&&!(Ee=Object(s.a)(Ee),Ee===null););return Ee}function x(Ee,de,j){return typeof Reflect!="undefined"&&Reflect.get?x=Reflect.get:x=function($,te,ve){var Ie=S($,te);if(!Ie)return;var He=Object.getOwnPropertyDescriptor(Ie,te);return He.get?He.get.call(ve):He.value},x(Ee,de,j||Ee)}var T={};function A(){var Ee=self.navigator.userAgent.toLowerCase(),de=/(edge)\/([\w.]+)/.exec(Ee)||/(opr)[\/]([\w.]+)/.exec(Ee)||/(chrome)[ \/]([\w.]+)/.exec(Ee)||/(iemobile)[\/]([\w.]+)/.exec(Ee)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ee)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ee)||/(webkit)[ \/]([\w.]+)/.exec(Ee)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Ee)||/(msie) ([\w.]+)/.exec(Ee)||Ee.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Ee)||Ee.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Ee)||[],j=/(ipad)/.exec(Ee)||/(ipod)/.exec(Ee)||/(windows phone)/.exec(Ee)||/(iphone)/.exec(Ee)||/(kindle)/.exec(Ee)||/(android)/.exec(Ee)||/(windows)/.exec(Ee)||/(mac)/.exec(Ee)||/(linux)/.exec(Ee)||/(cros)/.exec(Ee)||[],X={browser:de[5]||de[3]||de[1]||"",version:de[2]||de[4]||"0",majorVersion:de[4]||de[2]||"0",platform:j[0]||""},$={};if(X.browser){$[X.browser]=!0;var te=X.majorVersion.split(".");$.version={major:parseInt(X.majorVersion,10),string:X.version},te.length>1&&($.version.minor=parseInt(te[1],10)),te.length>2&&($.version.build=parseInt(te[2],10))}if(X.platform&&($[X.platform]=!0),($.chrome||$.opr||$.safari)&&($.webkit=!0),$.rv||$.iemobile){$.rv&&delete $.rv;var ve="msie";X.browser=ve,$[ve]=!0}if($.edge){delete $.edge;var Ie="msedge";X.browser=Ie,$[Ie]=!0}if($.opr){var He="opera";X.browser=He,$[He]=!0}if($.safari&&$.android){var ct="android";X.browser=ct,$[ct]=!0}$.name=X.browser,$.platform=X.platform;for(var ut in T)T.hasOwnProperty(ut)&&delete T[ut];Object.assign(T,$)}A();var w=T,v=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(X,$){var te;return Object(q.a)(this,j),te=de.call(this,"fetch-stream-loader"),te.TAG="FetchStreamLoader",te._seekHandler=X,te._config=$,te._needStash=!0,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(z.a)(j,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),x(Object(s.a)(j.prototype),"destroy",this).call(this)}},{key:"open",value:function($,te){var ve=this;this._dataSource=$,this._range=te;var Ie=$.url;this._config.reuseRedirectedURL&&$.redirectedURL!=null&&(Ie=$.redirectedURL);var He=this._seekHandler.getConfig(Ie,te),ct=new self.Headers;if(typeof He.headers=="object"){var ut=He.headers;for(var ze in ut)ut.hasOwnProperty(ze)&&ct.append(ze,ut[ze])}var gt={method:"GET",headers:ct,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var Kt in this._config.headers)ct.append(Kt,this._config.headers[Kt]);$.cors===!1&&(gt.mode="same-origin"),$.withCredentials&&(gt.credentials="include"),$.referrerPolicy&&(gt.referrerPolicy=$.referrerPolicy),this._status=i.kConnecting,self.fetch(He.url,gt).then(function(dt){if(ve._requestAbort){ve._requestAbort=!1,ve._status=i.kIdle;return}if(dt.ok&&dt.status>=200&&dt.status<=299){if(dt.url!==He.url&&ve._onURLRedirect){var sn=ve._seekHandler.removeURLParameters(dt.url);ve._onURLRedirect(sn)}var jt=dt.headers.get("Content-Length");return jt!=null&&(ve._contentLength=parseInt(jt),ve._contentLength!==0&&(ve._onContentLengthKnown&&ve._onContentLengthKnown(ve._contentLength))),ve._pump.call(ve,dt.body.getReader())}else if(ve._status=i.kError,ve._onError)ve._onError(a.HTTP_STATUS_CODE_INVALID,{code:dt.status,msg:dt.statusText});else throw new h("FetchStreamLoader: Http code invalid, "+dt.status+" "+dt.statusText)}).catch(function(dt){if(ve._status=i.kError,ve._onError)ve._onError(a.EXCEPTION,{code:-1,msg:dt.message});else throw dt})}},{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=i.kError;var Ie=a.EARLY_EOF,He={code:-1,msg:"Fetch stream meet Early-EOF"};if(te._onError)te._onError(Ie,He);else throw new h(He.msg)}else te._status=i.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=i.kComplete,$.cancel();te._status=i.kBuffering;var ct=ve.value.buffer,ut=te._range.from+te._receivedLength;te._receivedLength+=ct.byteLength,te._onDataArrival&&te._onDataArrival(ct,ut,te._receivedLength),te._pump($)}}).catch(function(ve){if(ve.code===11&&w.msedge)return;te._status=i.kError;var Ie=0,He=null;if((ve.code===19||ve.message==="network error")&&(te._contentLength===null||te._contentLength!==null&&te._receivedLength<te._contentLength)?(Ie=a.EARLY_EOF,He={code:ve.code,msg:"Fetch stream meet Early-EOF"}):(Ie=a.EXCEPTION,He={code:ve.code,msg:ve.message}),te._onError)te._onError(Ie,He);else throw new h(He.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}}}]),j}(r),E=v,m=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(X,$){var te;return Object(q.a)(this,j),te=de.call(this,"xhr-moz-chunked-loader"),te.TAG="MozChunkedLoader",te._seekHandler=X,te._config=$,te._needStash=!0,te._xhr=null,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(z.a)(j,[{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)(j.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 Ie=this._seekHandler.getConfig(ve,te);this._requestURL=Ie.url;var He=this._xhr=new XMLHttpRequest;if(He.open("GET",Ie.url,!0),He.responseType="moz-chunked-arraybuffer",He.onreadystatechange=this._onReadyStateChange.bind(this),He.onprogress=this._onProgress.bind(this),He.onloadend=this._onLoadEnd.bind(this),He.onerror=this._onXhrError.bind(this),$.withCredentials&&(He.withCredentials=!0),typeof Ie.headers=="object"){var ct=Ie.headers;for(var ut in ct)ct.hasOwnProperty(ut)&&He.setRequestHeader(ut,ct[ut])}if(typeof this._config.headers=="object"){var ze=this._config.headers;for(var gt in ze)ze.hasOwnProperty(gt)&&He.setRequestHeader(gt,ze[gt])}this._status=i.kConnecting,He.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=i.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=i.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=i.kBuffering}}},{key:"_onProgress",value:function($){if(this._status===i.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===i.kError)return;this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function($){this._status=i.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 k.w("MozChunkedLoader",te.message),!1}}}]),j}(r),f=m,C=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(X,$){var te;return Object(q.a)(this,j),te=de.call(this,"xhr-msstream-loader"),te.TAG="MSStreamLoader",te._seekHandler=X,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)(j,[{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)(j.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 Ie=$.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ie=this._currentRedirectedURL:$.redirectedURL!=null&&(Ie=$.redirectedURL));var He=this._seekHandler.getConfig(Ie,te);this._currentRequestURL=He.url;var ct=this._reader=new self.MSStreamReader;ct.onprogress=this._msrOnProgress.bind(this),ct.onload=this._msrOnLoad.bind(this),ct.onerror=this._msrOnError.bind(this);var ut=this._xhr=new XMLHttpRequest;if(ut.open("GET",He.url,!0),ut.responseType="ms-stream",ut.onreadystatechange=this._xhrOnReadyStateChange.bind(this),ut.onerror=this._xhrOnError.bind(this),$.withCredentials&&(ut.withCredentials=!0),typeof He.headers=="object"){var ze=He.headers;for(var gt in ze)ze.hasOwnProperty(gt)&&ut.setRequestHeader(gt,ze[gt])}if(typeof this._config.headers=="object"){var Kt=this._config.headers;for(var dt in Kt)Kt.hasOwnProperty(dt)&&ut.setRequestHeader(dt,Kt[dt])}this._isReconnecting?this._isReconnecting=!1:this._status=i.kConnecting,ut.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=i.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=i.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 Ie=te.getResponseHeader("Content-Length");if(Ie!=null&&this._contentLength==null){var He=parseInt(Ie);He>0&&(this._contentLength=He,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=i.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=i.kBuffering;var ct=te.response;this._reader.readAsArrayBuffer(ct)}}},{key:"_xhrOnError",value:function($){this._status=i.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 Ie=ve.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=ve.byteLength;var He=this._totalRange.from+this._receivedLength;this._receivedLength+=Ie.byteLength,this._onDataArrival&&this._onDataArrival(Ie,He,this._receivedLength),ve.byteLength>=this._bufferLimit&&(k.v(this.TAG,"MSStream buffer exceeded max size near ".concat(He+Ie.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=i.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function($){this._status=i.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 k.w("MSStreamLoader",te.message),!1}}}]),j}(r),b=C,y=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(X,$){var te;return Object(q.a)(this,j),te=de.call(this,"xhr-range-loader"),te.TAG="RangeLoader",te._seekHandler=X,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 I,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)(j,[{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)(j.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=i.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 Ie=this._seekHandler.getConfig(ve,te);this._currentRequestURL=Ie.url;var He=this._xhr=new XMLHttpRequest;if(He.open("GET",Ie.url,!0),He.responseType="arraybuffer",He.onreadystatechange=this._onReadyStateChange.bind(this),He.onprogress=this._onProgress.bind(this),He.onload=this._onLoad.bind(this),He.onerror=this._onXhrError.bind(this),$.withCredentials&&(He.withCredentials=!0),typeof Ie.headers=="object"){var ct=Ie.headers;for(var ut in ct)ct.hasOwnProperty(ut)&&He.setRequestHeader(ut,ct[ut])}if(typeof this._config.headers=="object"){var ze=this._config.headers;for(var gt in ze)ze.hasOwnProperty(gt)&&He.setRequestHeader(gt,ze[gt])}He.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=i.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=i.kBuffering}else if(this._status=i.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===i.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 Ie=$.loaded-this._lastTimeLoaded;this._lastTimeLoaded=$.loaded,this._speedSampler.addBytes(Ie)}},{key:"_normalizeSpeed",value:function($){var te=this._chunkSizeKBList,ve=te.length-1,Ie=0,He=0,ct=ve;if($<te[0])return te[0];for(;He<=ct;){if(Ie=He+Math.floor((ct-He)/2),Ie===ve||$>=te[Ie]&&$<te[Ie+1])return te[Ie];te[Ie]<$?He=Ie+1:ct=Ie-1}}},{key:"_onLoad",value:function($){if(this._status===i.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 Ie=$.target.response,He=this._range.from+this._receivedLength;this._receivedLength+=Ie.byteLength;var ct=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():ct=!0,this._onDataArrival&&this._onDataArrival(Ie,He,this._receivedLength),ct&&(this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function($){this._status=i.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 k.w("RangeLoader",te.message),!1}}}]),j}(r),M=y,W=function(Ee){Object(g.a)(j,Ee);var de=Object(p.a)(j);function j(){var X;return Object(q.a)(this,j),X=de.call(this,"websocket-loader"),X.TAG="WebSocketLoader",X._needStash=!0,X._ws=null,X._requestAbort=!1,X._receivedLength=0,X}return Object(z.a)(j,[{key:"destroy",value:function(){this._ws&&this.abort(),x(Object(s.a)(j.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=i.kConnecting}catch(Ie){this._status=i.kError;var ve={code:Ie.code,msg:Ie.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=i.kComplete}},{key:"_onWebSocketOpen",value:function($){this._status=i.kBuffering}},{key:"_onWebSocketClose",value:function($){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=i.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=i.kError;var Ie={code:-1,msg:"Unsupported WebSocket message type: "+$.data.constructor.name};if(this._onError)this._onError(a.EXCEPTION,Ie);else throw new h(Ie.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=i.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}}}]),j}(r),L=W,K=function(){function Ee(de){Object(q.a)(this,Ee),this._zeroStart=de||!1}return Object(z.a)(Ee,[{key:"getConfig",value:function(j,X){var $={};if(X.from!==0||X.to!==-1){var te;X.to!==-1?te="bytes=".concat(X.from.toString(),"-").concat(X.to.toString()):te="bytes=".concat(X.from.toString(),"-"),$.Range=te}else this._zeroStart&&($.Range="bytes=0-");return{url:j,headers:$}}},{key:"removeURLParameters",value:function(j){return j}}]),Ee}(),F=K,R=function(){function Ee(de,j){Object(q.a)(this,Ee),this._startName=de,this._endName=j}return Object(z.a)(Ee,[{key:"getConfig",value:function(j,X){var $=j;if(X.from!==0||X.to!==-1){var te=!0;$.indexOf("?")===-1&&($+="?",te=!1),te&&($+="&"),$+="".concat(this._startName,"=").concat(X.from.toString()),X.to!==-1&&($+="&".concat(this._endName,"=").concat(X.to.toString()))}return{url:$,headers:{}}}},{key:"removeURLParameters",value:function(j){var X=j.split("?")[0],$=void 0,te=j.indexOf("?");te!==-1&&($=j.substring(te+1));var ve="";if($!=null&&$.length>0)for(var Ie=$.split("&"),He=0;He<Ie.length;He++){var ct=Ie[He].split("="),ut=He>0;ct[0]!==this._startName&&ct[0]!==this._endName&&(ut&&(ve+="&"),ve+=Ie[He])}return ve.length===0?X:X+"?"+ve}}]),Ee}(),V=R,ne=function(){function Ee(de,j,X){Object(q.a)(this,Ee),this.TAG="IOController",this._config=j,this._extraData=X,this._stashInitialSize=1024*384,j.stashInitialSize!=null&&j.stashInitialSize>0&&(this._stashInitialSize=j.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,j.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=de,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(de.url),this._refTotalLength=de.filesize?de.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new I,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)(Ee,[{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(j){this._extraData=j}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(j){this._onDataArrival=j}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(j){this._onSeeked=j}},{key:"onError",get:function(){return this._onError},set:function(j){this._onError=j}},{key:"onComplete",get:function(){return this._onComplete},set:function(j){this._onComplete=j}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(j){this._onRedirect=j}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(j){this._onRecoveredEarlyEof=j}},{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===M?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var j=this._config;if(j.seekType==="range")this._seekHandler=new F(this._config.rangeLoadZeroStart);else if(j.seekType==="param"){var X=j.seekParamStart||"bstart",$=j.seekParamEnd||"bend";this._seekHandler=new V(X,$)}else if(j.seekType==="custom"){if(typeof j.customSeekHandler!="function")throw new o("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new j.customSeekHandler}else throw new o("Invalid seekType in config: ".concat(j.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=L;else if(E.isSupported())this._loaderClass=E;else if(f.isSupported())this._loaderClass=f;else if(M.isSupported())this._loaderClass=M;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(j){this._currentRange={from:0,to:-1},j&&(this._currentRange.from=j),this._speedSampler.reset(),j||(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 j=this._resumeFrom;this._resumeFrom=0,this._internalSeek(j,!0)}}},{key:"seek",value:function(j){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(j,!0)}},{key:"_internalSeek",value:function(j,X){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(X),this._loader.destroy(),this._loader=null;var $={from:j,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(j){if(!j||typeof j!="string"||j.length===0)throw new o("Url must be a non-empty string!");this._dataSource.url=j}},{key:"_expandBuffer",value:function(j){for(var X=this._stashSize;X+1024*1024*1<j;)X*=2;if(X+=1024*1024*1,X===this._bufferSize)return;var $=new ArrayBuffer(X);if(this._stashUsed>0){var te=new Uint8Array(this._stashBuffer,0,this._stashUsed),ve=new Uint8Array($,0,X);ve.set(te,0)}this._stashBuffer=$,this._bufferSize=X}},{key:"_normalizeSpeed",value:function(j){var X=this._speedNormalizeList,$=X.length-1,te=0,ve=0,Ie=$;if(j<X[0])return X[0];for(;ve<=Ie;){if(te=ve+Math.floor((Ie-ve)/2),te===$||j>=X[te]&&j<X[te+1])return X[te];X[te]<j?ve=te+1:Ie=te-1}}},{key:"_adjustStashSize",value:function(j){var X=0;this._config.isLive||j<512?X=j:j>=512&&j<=1024?X=Math.floor(j*1.5):X=j*2,X>8192&&(X=8192);var $=X*1024+1024*1024*1;this._bufferSize<$&&this._expandBuffer($),this._stashSize=X*1024}},{key:"_dispatchChunks",value:function(j,X){return this._currentRange.to=X+j.byteLength-1,this._onDataArrival(j,X)}},{key:"_onURLRedirect",value:function(j){this._redirectedURL=j,this._onRedirect&&this._onRedirect(j)}},{key:"_onContentLengthKnown",value:function(j){j&&this._fullRequestFlag&&(this._totalLength=j,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(j,X,$){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(j.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=X),this._stashUsed+j.byteLength<=this._stashSize){var Kt=new Uint8Array(this._stashBuffer,0,this._stashSize);Kt.set(new Uint8Array(j),this._stashUsed),this._stashUsed+=j.byteLength}else{var dt=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var sn=this._stashBuffer.slice(0,this._stashUsed),jt=this._dispatchChunks(sn,this._stashByteStart);if(jt<sn.byteLength){if(jt>0){var St=new Uint8Array(sn,jt);dt.set(St,0),this._stashUsed=St.byteLength,this._stashByteStart+=jt}}else this._stashUsed=0,this._stashByteStart+=jt;this._stashUsed+j.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+j.byteLength),dt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),dt.set(new Uint8Array(j),this._stashUsed),this._stashUsed+=j.byteLength}else{var at=this._dispatchChunks(j,X);if(at<j.byteLength){var xn=j.byteLength-at;xn>this._bufferSize&&(this._expandBuffer(xn),dt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),dt.set(new Uint8Array(j,at),0),this._stashUsed+=xn,this._stashByteStart=X+at}}}else if(this._stashUsed===0){var Ie=this._dispatchChunks(j,X);if(Ie<j.byteLength){var He=j.byteLength-Ie;He>this._bufferSize&&this._expandBuffer(He);var ct=new Uint8Array(this._stashBuffer,0,this._bufferSize);ct.set(new Uint8Array(j,Ie),0),this._stashUsed+=He,this._stashByteStart=X+Ie}}else{this._stashUsed+j.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+j.byteLength);var ut=new Uint8Array(this._stashBuffer,0,this._bufferSize);ut.set(new Uint8Array(j),this._stashUsed),this._stashUsed+=j.byteLength;var ze=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ze<this._stashUsed&&ze>0){var gt=new Uint8Array(this._stashBuffer,ze);ut.set(gt,0)}this._stashUsed-=ze,this._stashByteStart+=ze}}},{key:"_flushStashBuffer",value:function(j){if(this._stashUsed>0){var X=this._stashBuffer.slice(0,this._stashUsed),$=this._dispatchChunks(X,this._stashByteStart),te=X.byteLength-$;if($<X.byteLength)if(j)k.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),Ie=new Uint8Array(X,$);ve.set(Ie,0),this._stashUsed=Ie.byteLength,this._stashByteStart+=$}return 0}return this._stashUsed=0,this._stashByteStart=0,te}return 0}},{key:"_onLoaderComplete",value:function(j,X){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(j,X){k.e(this.TAG,"Loader error, code = ".concat(X.code,", msg = ").concat(X.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,j=a.UNRECOVERABLE_EARLY_EOF);switch(j){case a.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var $=this._currentRange.to+1;$<this._totalLength&&(k.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek($,!1));return}j=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(j,X);else throw new h("IOException: "+X.msg)}}]),Ee}(),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 Le(){return Object.assign({},Se)}var Ae=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var j=new se({},Le()),X=j.loaderType;return j.destroy(),X=="fetch-stream-loader"||X=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var j=new se({},Le()),X=j.loaderType;return j.destroy(),X}},{key:"supportNativeMediaPlayback",value:function(j){Ee.videoElement==null&&(Ee.videoElement=window.document.createElement("video"));var X=Ee.videoElement.canPlayType(j);return X==="probably"||X=="maybe"}},{key:"getFeatureList",value:function(){var j={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return j.mseFlvPlayback=Ee.supportMSEH264Playback(),j.networkStreamIO=Ee.supportNetworkStreamIO(),j.networkLoaderName=Ee.getNetworkLoaderTypeName(),j.mseLiveFlvPlayback=j.mseFlvPlayback&&j.networkStreamIO,j.nativeMP4H264Playback=Ee.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),j.nativeWebmVP8Playback=Ee.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),j.nativeWebmVP9Playback=Ee.supportNativeMediaPlayback('video/webm; codecs="vp9"'),j}}]),Ee}(),Pe=Ae,Fe={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"},je=Fe,Te=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"forceGlobalTag",get:function(){return k.FORCE_GLOBAL_TAG},set:function(j){k.FORCE_GLOBAL_TAG=j,Ee._notifyChange()}},{key:"globalTag",get:function(){return k.GLOBAL_TAG},set:function(j){k.GLOBAL_TAG=j,Ee._notifyChange()}},{key:"enableAll",get:function(){return k.ENABLE_VERBOSE&&k.ENABLE_DEBUG&&k.ENABLE_INFO&&k.ENABLE_WARN&&k.ENABLE_ERROR},set:function(j){k.ENABLE_VERBOSE=j,k.ENABLE_DEBUG=j,k.ENABLE_INFO=j,k.ENABLE_WARN=j,k.ENABLE_ERROR=j,Ee._notifyChange()}},{key:"enableDebug",get:function(){return k.ENABLE_DEBUG},set:function(j){k.ENABLE_DEBUG=j,Ee._notifyChange()}},{key:"enableVerbose",get:function(){return k.ENABLE_VERBOSE},set:function(j){k.ENABLE_VERBOSE=j,Ee._notifyChange()}},{key:"enableInfo",get:function(){return k.ENABLE_INFO},set:function(j){k.ENABLE_INFO=j,Ee._notifyChange()}},{key:"enableWarn",get:function(){return k.ENABLE_WARN},set:function(j){k.ENABLE_WARN=j,Ee._notifyChange()}},{key:"enableError",get:function(){return k.ENABLE_ERROR},set:function(j){k.ENABLE_ERROR=j,Ee._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:k.GLOBAL_TAG,forceGlobalTag:k.FORCE_GLOBAL_TAG,enableVerbose:k.ENABLE_VERBOSE,enableDebug:k.ENABLE_DEBUG,enableInfo:k.ENABLE_INFO,enableWarn:k.ENABLE_WARN,enableError:k.ENABLE_ERROR,enableCallback:k.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(j){k.GLOBAL_TAG=j.globalTag,k.FORCE_GLOBAL_TAG=j.forceGlobalTag,k.ENABLE_VERBOSE=j.enableVerbose,k.ENABLE_DEBUG=j.enableDebug,k.ENABLE_INFO=j.enableInfo,k.ENABLE_WARN=j.enableWarn,k.ENABLE_ERROR=j.enableError,k.ENABLE_CALLBACK=j.enableCallback}},{key:"_notifyChange",value:function(){var j=Ee.emitter;if(j.listenerCount("change")>0){var X=Ee.getConfig();j.emit("change",X)}}},{key:"registerListener",value:function(j){Ee.emitter.addListener("change",j)}},{key:"removeListener",value:function(j){Ee.emitter.removeListener("change",j)}},{key:"addLogListener",value:function(j){k.emitter.addListener("log",j),k.emitter.listenerCount("log")>0&&(k.ENABLE_CALLBACK=!0,Ee._notifyChange())}},{key:"removeLogListener",value:function(j){k.emitter.removeListener("log",j),k.emitter.listenerCount("log")===0&&(k.ENABLE_CALLBACK=!1,Ee._notifyChange())}}]),Ee}();Te.emitter=new O.a;var Z=Te,U=function(){function Ee(){Object(q.a)(this,Ee),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)(Ee,[{key:"isComplete",value:function(){var j=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,X=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&&j&&X}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(j){if(this.keyframesIndex==null)return null;var X=this.keyframesIndex,$=this._search(X.times,j);return{index:$,milliseconds:X.times[$],fileposition:X.filepositions[$]}}},{key:"_search",value:function(j,X){var $=0,te=j.length-1,ve=0,Ie=0,He=te;for(X<j[0]&&($=0,Ie=He+1);Ie<=He;)if(ve=Ie+Math.floor((He-Ie)/2),ve===te||X>=j[ve]&&X<j[ve+1]){$=ve;break}else j[ve]<X?Ie=ve+1:He=ve-1;return $}}]),Ee}(),G=U;function ee(Ee,de,j){var X=Ee;if(de+j<X.length){for(;j--;)if((X[++de]&192)!==128)return!1;return!0}else return!1}function ue(Ee){for(var de=[],j=Ee,X=0,$=Ee.length;X<$;){if(j[X]<128){de.push(String.fromCharCode(j[X])),++X;continue}else if(!(j[X]<192)){if(j[X]<224){if(ee(j,X,1)){var te=(j[X]&31)<<6|j[X+1]&63;if(te>=128){de.push(String.fromCharCode(te&65535)),X+=2;continue}}}else if(j[X]<240){if(ee(j,X,2)){var ve=(j[X]&15)<<12|(j[X+1]&63)<<6|j[X+2]&63;if(ve>=2048&&(ve&63488)!==55296){de.push(String.fromCharCode(ve&65535)),X+=3;continue}}}else if(j[X]<248&&ee(j,X,3)){var Ie=(j[X]&7)<<18|(j[X+1]&63)<<12|(j[X+2]&63)<<6|j[X+3]&63;if(Ie>65536&&Ie<1114112){Ie-=65536,de.push(String.fromCharCode(Ie>>>10|55296)),de.push(String.fromCharCode(Ie&1023|56320)),X+=4;continue}}}de.push(String.fromCharCode(65533)),++X}return de.join("")}var J=ue,we=function(){var Ee=new ArrayBuffer(2);return new DataView(Ee).setInt16(0,256,!0),new Int16Array(Ee)[0]===256}(),Ge=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"parseScriptData",value:function(j,X,$){var te={};try{var ve=Ee.parseValue(j,X,$),Ie=Ee.parseValue(j,X+ve.size,$-ve.size);te[ve.data]=Ie.data}catch(He){k.e("AMF",He.toString())}return te}},{key:"parseObject",value:function(j,X,$){if($<3)throw new c("Data not enough when parse ScriptDataObject");var te=Ee.parseString(j,X,$),ve=Ee.parseValue(j,X+te.size,$-te.size),Ie=ve.objectEnd;return{data:{name:te.data,value:ve.data},size:te.size+ve.size,objectEnd:Ie}}},{key:"parseVariable",value:function(j,X,$){return Ee.parseObject(j,X,$)}},{key:"parseString",value:function(j,X,$){if($<2)throw new c("Data not enough when parse String");var te=new DataView(j,X,$),ve=te.getUint16(0,!we),Ie;return ve>0?Ie=J(new Uint8Array(j,X+2,ve)):Ie="",{data:Ie,size:2+ve}}},{key:"parseLongString",value:function(j,X,$){if($<4)throw new c("Data not enough when parse LongString");var te=new DataView(j,X,$),ve=te.getUint32(0,!we),Ie;return ve>0?Ie=J(new Uint8Array(j,X+4,ve)):Ie="",{data:Ie,size:4+ve}}},{key:"parseDate",value:function(j,X,$){if($<10)throw new c("Data size invalid when parse Date");var te=new DataView(j,X,$),ve=te.getFloat64(0,!we),Ie=te.getInt16(8,!we);return ve+=Ie*60*1e3,{data:new Date(ve),size:8+2}}},{key:"parseValue",value:function(j,X,$){if($<1)throw new c("Data not enough when parse Value");var te=new DataView(j,X,$),ve=1,Ie=te.getUint8(0),He,ct=!1;try{switch(Ie){case 0:He=te.getFloat64(1,!we),ve+=8;break;case 1:{var ut=te.getUint8(1);He=!!ut,ve+=1;break}case 2:{var ze=Ee.parseString(j,X+1,$-1);He=ze.data,ve+=ze.size;break}case 3:{He={};var gt=0;for((te.getUint32($-4,!we)&16777215)===9&&(gt=3);ve<$-4;){var Kt=Ee.parseObject(j,X+ve,$-ve-gt);if(Kt.objectEnd)break;He[Kt.data.name]=Kt.data.value,ve+=Kt.size}if(ve<=$-3){var dt=te.getUint32(ve-1,!we)&16777215;dt===9&&(ve+=3)}break}case 8:{He={},ve+=4;var sn=0;for((te.getUint32($-4,!we)&16777215)===9&&(sn=3);ve<$-8;){var jt=Ee.parseVariable(j,X+ve,$-ve-sn);if(jt.objectEnd)break;He[jt.data.name]=jt.data.value,ve+=jt.size}if(ve<=$-3){var St=te.getUint32(ve-1,!we)&16777215;St===9&&(ve+=3)}break}case 9:He=void 0,ve=1,ct=!0;break;case 10:{He=[];var at=te.getUint32(1,!we);ve+=4;for(var xn=0;xn<at;xn++){var it=Ee.parseValue(j,X+ve,$-ve);He.push(it.data),ve+=it.size}break}case 11:{var ln=Ee.parseDate(j,X+1,$-1);He=ln.data,ve+=ln.size;break}case 12:{var cn=Ee.parseString(j,X+1,$-1);He=cn.data,ve+=cn.size;break}default:ve=$,k.w("AMF","Unsupported AMF value type "+Ie)}}catch(Yn){k.e("AMF",Yn.toString())}return{data:He,size:ve,objectEnd:ct}}}]),Ee}(),Je=Ge,be=function(){function Ee(de){Object(q.a)(this,Ee),this.TAG="ExpGolomb",this._buffer=de,this._buffer_index=0,this._total_bytes=de.byteLength,this._total_bits=de.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(z.a)(Ee,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var j=this._total_bytes-this._buffer_index;if(j<=0)throw new c("ExpGolomb: _fillCurrentWord() but no bytes available");var X=Math.min(4,j),$=new Uint8Array(4);$.set(this._buffer.subarray(this._buffer_index,this._buffer_index+X)),this._current_word=new DataView($.buffer).getUint32(0,!1),this._buffer_index+=X,this._current_word_bits_left=X*8}},{key:"readBits",value:function(j){if(j>32)throw new o("ExpGolomb: readBits() bits exceeded max 32bits!");if(j<=this._current_word_bits_left){var X=this._current_word>>>32-j;return this._current_word<<=j,this._current_word_bits_left-=j,X}var $=this._current_word_bits_left?this._current_word:0;$=$>>>32-this._current_word_bits_left;var te=j-this._current_word_bits_left;this._fillCurrentWord();var ve=Math.min(te,this._current_word_bits_left),Ie=this._current_word>>>32-ve;return this._current_word<<=ve,this._current_word_bits_left-=ve,$=$<<ve|Ie,$}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var j;for(j=0;j<this._current_word_bits_left;j++)if((this._current_word&2147483648>>>j)!==0)return this._current_word<<=j,this._current_word_bits_left-=j,j;return this._fillCurrentWord(),j+this._skipLeadingZero()}},{key:"readUEG",value:function(){var j=this._skipLeadingZero();return this.readBits(j+1)-1}},{key:"readSEG",value:function(){var j=this.readUEG();return j&1?j+1>>>1:-1*(j>>>1)}}]),Ee}(),Re=be,xe=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"_ebsp2rbsp",value:function(j){for(var X=j,$=X.byteLength,te=new Uint8Array($),ve=0,Ie=0;Ie<$;Ie++){if(Ie>=2&&(X[Ie]===3&&X[Ie-1]===0&&X[Ie-2]===0))continue;te[ve]=X[Ie],ve++}return new Uint8Array(te.buffer,0,ve)}},{key:"parseSPS",value:function(j){var X=Ee._ebsp2rbsp(j),$=new Re(X);$.readByte();var te=$.readByte();$.readByte();var ve=$.readByte();$.readUEG();var Ie=Ee.getProfileString(te),He=Ee.getLevelString(ve),ct=1,ut=420,ze=[0,420,422,444],gt=8;if((te===100||te===110||te===122||te===244||te===44||te===83||te===86||te===118||te===128||te===138||te===144)&&(ct=$.readUEG(),ct===3&&$.readBits(1),ct<=3&&(ut=ze[ct]),gt=$.readUEG()+8,$.readUEG(),$.readBits(1),$.readBool()))for(var Kt=ct!==3?8:12,dt=0;dt<Kt;dt++)$.readBool()&&(dt<6?Ee._skipScalingList($,16):Ee._skipScalingList($,64));$.readUEG();var sn=$.readUEG();if(sn===0)$.readUEG();else if(sn===1){$.readBits(1),$.readSEG(),$.readSEG();for(var jt=$.readUEG(),St=0;St<jt;St++)$.readSEG()}var at=$.readUEG();$.readBits(1);var xn=$.readUEG(),it=$.readUEG(),ln=$.readBits(1);ln===0&&$.readBits(1),$.readBits(1);var cn=0,Yn=0,nr=0,vn=0,gr=$.readBool();gr&&(cn=$.readUEG(),Yn=$.readUEG(),nr=$.readUEG(),vn=$.readUEG());var Jn=1,Cn=1,Dn=0,Dr=!0,Hr=0,vr=0,rr=$.readBool();if(rr){if($.readBool()){var yr=$.readByte(),Qr=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],_r=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];yr>0&&yr<16?(Jn=Qr[yr-1],Cn=_r[yr-1]):yr===255&&(Jn=$.readByte()<<8|$.readByte(),Cn=$.readByte()<<8|$.readByte())}if($.readBool()&&$.readBool(),$.readBool()&&($.readBits(4),$.readBool()&&$.readBits(24)),$.readBool()&&($.readUEG(),$.readUEG()),$.readBool()){var ir=$.readBits(32),Pr=$.readBits(32);Dr=$.readBool(),Hr=Pr,vr=ir*2,Dn=Hr/vr}}var Lr=1;(Jn!==1||Cn!==1)&&(Lr=Jn/Cn);var Or=0,Sr=0;if(ct===0)Or=1,Sr=2-ln;else{var ci=ct===3?1:2,yi=ct===1?2:1;Or=ci,Sr=yi*(2-ln)}var ii=(xn+1)*16,Zr=(2-ln)*((it+1)*16);ii-=(cn+Yn)*Or,Zr-=(nr+vn)*Sr;var Ai=Math.ceil(ii*Lr);return $.destroy(),$=null,{profile_string:Ie,level_string:He,bit_depth:gt,ref_frames:at,chroma_format:ut,chroma_format_string:Ee.getChromaFormatString(ut),frame_rate:{fixed:Dr,fps:Dn,fps_den:vr,fps_num:Hr},sar_ratio:{width:Jn,height:Cn},codec_size:{width:ii,height:Zr},present_size:{width:Ai,height:Zr}}}},{key:"_skipScalingList",value:function(j,X){for(var $=8,te=8,ve=0,Ie=0;Ie<X;Ie++)te!==0&&(ve=j.readSEG(),te=($+ve+256)%256),$=te===0?$:te}},{key:"getProfileString",value:function(j){switch(j){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(j){return(j/10).toFixed(1)}},{key:"getChromaFormatString",value:function(j){switch(j){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),Ee}(),Ce=xe,Be={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},Xe=Be;function qe(Ee){return Ee>>>8&255|(Ee&255)<<8}function tt(Ee){return(Ee&4278190080)>>>24|(Ee&16711680)>>>8|(Ee&65280)<<8|(Ee&255)<<24}function ht(Ee,de){return Ee[de]<<24|Ee[de+1]<<16|Ee[de+2]<<8|Ee[de+3]}var ft=function(){function Ee(de,j){Object(q.a)(this,Ee),this.TAG="FLVDemuxer",this._config=j,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=de.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=de.hasAudioTrack,this._hasVideo=de.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new G,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 X=new ArrayBuffer(2);return new DataView(X).setInt16(0,256,!0),new Int16Array(X)[0]===256}()}return Object(z.a)(Ee,[{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(j){return j.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(j){this._onTrackMetadata=j}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(j){this._onMediaInfo=j}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(j){this._onMetaDataArrived=j}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(j){this._onScriptDataArrived=j}},{key:"onError",get:function(){return this._onError},set:function(j){this._onError=j}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(j){this._onDataAvailable=j}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(j){this._timestampBase=j}},{key:"overridedDuration",get:function(){return this._duration},set:function(j){this._durationOverrided=!0,this._duration=j,this._mediaInfo.duration=j}},{key:"overridedHasAudio",set:function(j){this._hasAudioFlagOverrided=!0,this._hasAudio=j,this._mediaInfo.hasAudio=j}},{key:"overridedHasVideo",set:function(j){this._hasVideoFlagOverrided=!0,this._hasVideo=j,this._mediaInfo.hasVideo=j}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new G}},{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(j,X){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(X===0)if(j.byteLength>13){var ve=Ee.probe(j);$=ve.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,X+$!==this._dataOffset&&k.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Ie=new DataView(j,$),He=Ie.getUint32(0,!te);He!==0&&k.w(this.TAG,"PrevTagSize0 !== 0 !!!"),$+=4}for(;$<j.byteLength;){this._dispatch=!0;var ct=new DataView(j,$);if($+11+4>j.byteLength)break;var ut=ct.getUint8(0),ze=ct.getUint32(0,!te)&16777215;if($+11+ze+4>j.byteLength)break;if(ut!==8&&ut!==9&&ut!==18){k.w(this.TAG,"Unsupported tag type ".concat(ut,", skipped")),$+=11+ze+4;continue}var gt=ct.getUint8(4),Kt=ct.getUint8(5),dt=ct.getUint8(6),sn=ct.getUint8(7),jt=dt|Kt<<8|gt<<16|sn<<24,St=ct.getUint32(7,!te)&16777215;St!==0&&k.w(this.TAG,"Meet tag which has StreamID != 0!");var at=$+11;switch(ut){case 8:this._parseAudioData(j,at,ze,jt);break;case 9:this._parseVideoData(j,at,ze,jt,X+$);break;case 18:this._parseScriptData(j,at,ze);break}var xn=ct.getUint32(11+ze,!te);xn!==11+ze&&k.w(this.TAG,"Invalid PrevTagSize ".concat(xn)),$+=11+ze+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),$}},{key:"_parseScriptData",value:function(j,X,$){var te=Je.parseScriptData(j,X,$);if(te.hasOwnProperty("onMetaData")){if(te.onMetaData==null||typeof te.onMetaData!="object"){k.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&k.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 Ie=Math.floor(ve.duration*this._timescale);this._duration=Ie,this._mediaInfo.duration=Ie}}else this._mediaInfo.duration=0;if(typeof ve.framerate=="number"){var He=Math.floor(ve.framerate*1e3);if(He>0){var ct=He/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=ct,this._referenceFrameRate.fps_num=He,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=ct}}if(typeof ve.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var ut=ve.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(ut),ve.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=ve,k.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(j){for(var X=[],$=[],te=1;te<j.times.length;te++){var ve=this._timestampBase+Math.floor(j.times[te]*1e3);X.push(ve),$.push(j.filepositions[te])}return{times:X,filepositions:$}}},{key:"_parseAudioData",value:function(j,X,$,te){if($<=1){k.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var ve=this._littleEndian,Ie=new DataView(j,X,$),He=Ie.getUint8(0),ct=He>>>4;if(ct!==2&&ct!==10){this._onError(Xe.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+ct);return}var ut=0,ze=(He&12)>>>2;if(ze>=0&&ze<=4)ut=this._flvSoundRateTable[ze];else{this._onError(Xe.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ze);return}var gt=(He&2)>>>1,Kt=He&1,dt=this._audioMetadata,sn=this._audioTrack;if(dt||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),dt=this._audioMetadata={},dt.type="audio",dt.id=sn.id,dt.timescale=this._timescale,dt.duration=this._duration,dt.audioSampleRate=ut,dt.channelCount=Kt===0?1:2),ct===10){var jt=this._parseAACAudioData(j,X+1,$-1);if(jt==null)return;if(jt.packetType===0){dt.config&&k.w(this.TAG,"Found another AudioSpecificConfig!");var St=jt.data;dt.audioSampleRate=St.samplingRate,dt.channelCount=St.channelCount,dt.codec=St.codec,dt.originalCodec=St.originalCodec,dt.config=St.config,dt.refSampleDuration=1024/dt.audioSampleRate*dt.timescale,k.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",dt);var at=this._mediaInfo;at.audioCodec=dt.originalCodec,at.audioSampleRate=dt.audioSampleRate,at.audioChannelCount=dt.channelCount,at.hasVideo?at.videoCodec!=null&&(at.mimeType='video/x-flv; codecs="'+at.videoCodec+","+at.audioCodec+'"'):at.mimeType='video/x-flv; codecs="'+at.audioCodec+'"',at.isComplete()&&this._onMediaInfo(at)}else if(jt.packetType===1){var xn=this._timestampBase+te,it={unit:jt.data,length:jt.data.byteLength,dts:xn,pts:xn};sn.samples.push(it),sn.length+=jt.data.length}else k.e(this.TAG,"Flv: Unsupported AAC data type ".concat(jt.packetType))}else if(ct===2){if(!dt.codec){var ln=this._parseMP3AudioData(j,X+1,$-1,!0);if(ln==null)return;dt.audioSampleRate=ln.samplingRate,dt.channelCount=ln.channelCount,dt.codec=ln.codec,dt.originalCodec=ln.originalCodec,dt.refSampleDuration=1152/dt.audioSampleRate*dt.timescale,k.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",dt);var cn=this._mediaInfo;cn.audioCodec=dt.codec,cn.audioSampleRate=dt.audioSampleRate,cn.audioChannelCount=dt.channelCount,cn.audioDataRate=ln.bitRate,cn.hasVideo?cn.videoCodec!=null&&(cn.mimeType='video/x-flv; codecs="'+cn.videoCodec+","+cn.audioCodec+'"'):cn.mimeType='video/x-flv; codecs="'+cn.audioCodec+'"',cn.isComplete()&&this._onMediaInfo(cn)}var Yn=this._parseMP3AudioData(j,X+1,$-1,!1);if(Yn==null)return;var nr=this._timestampBase+te,vn={unit:Yn,length:Yn.byteLength,dts:nr,pts:nr};sn.samples.push(vn),sn.length+=Yn.length}}},{key:"_parseAACAudioData",value:function(j,X,$){if($<=1){k.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var te={},ve=new Uint8Array(j,X,$);return te.packetType=ve[0],ve[0]===0?te.data=this._parseAACAudioSpecificConfig(j,X+1,$-1):te.data=ve.subarray(1),te}},{key:"_parseAACAudioSpecificConfig",value:function(j,X,$){var te=new Uint8Array(j,X,$),ve=null,Ie=0,He=0,ct=null,ut=0,ze=null;if(Ie=He=te[0]>>>3,ut=(te[0]&7)<<1|te[1]>>>7,ut<0||ut>=this._mpegSamplingRates.length){this._onError(Xe.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var gt=this._mpegSamplingRates[ut],Kt=(te[1]&120)>>>3;if(Kt<0||Kt>=8){this._onError(Xe.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Ie===5&&(ze=(te[1]&7)<<1|te[2]>>>7,ct=(te[2]&124)>>>2);var dt=self.navigator.userAgent.toLowerCase();return dt.indexOf("firefox")!==-1?ut>=6?(Ie=5,ve=new Array(4),ze=ut-3):(Ie=2,ve=new Array(2),ze=ut):dt.indexOf("android")!==-1?(Ie=2,ve=new Array(2),ze=ut):(Ie=5,ze=ut,ve=new Array(4),ut>=6?ze=ut-3:Kt===1&&(Ie=2,ve=new Array(2),ze=ut)),ve[0]=Ie<<3,ve[0]|=(ut&15)>>>1,ve[1]=(ut&15)<<7,ve[1]|=(Kt&15)<<3,Ie===5&&(ve[1]|=(ze&15)>>>1,ve[2]=(ze&1)<<7,ve[2]|=2<<2,ve[3]=0),{config:ve,samplingRate:gt,channelCount:Kt,codec:"mp4a.40."+Ie,originalCodec:"mp4a.40."+He}}},{key:"_parseMP3AudioData",value:function(j,X,$,te){if($<4){k.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var ve=this._littleEndian,Ie=new Uint8Array(j,X,$),He=null;if(te){if(Ie[0]!==255)return;var ct=Ie[1]>>>3&3,ut=(Ie[1]&6)>>1,ze=(Ie[2]&240)>>>4,gt=(Ie[2]&12)>>>2,Kt=Ie[3]>>>6&3,dt=Kt!==3?2:1,sn=0,jt=0,St=34,at="mp3";switch(ct){case 0:sn=this._mpegAudioV25SampleRateTable[gt];break;case 2:sn=this._mpegAudioV20SampleRateTable[gt];break;case 3:sn=this._mpegAudioV10SampleRateTable[gt];break}switch(ut){case 1:St=34,ze<this._mpegAudioL3BitRateTable.length&&(jt=this._mpegAudioL3BitRateTable[ze]);break;case 2:St=33,ze<this._mpegAudioL2BitRateTable.length&&(jt=this._mpegAudioL2BitRateTable[ze]);break;case 3:St=32,ze<this._mpegAudioL1BitRateTable.length&&(jt=this._mpegAudioL1BitRateTable[ze]);break}He={bitRate:jt,samplingRate:sn,channelCount:dt,codec:at,originalCodec:at}}else He=Ie;return He}},{key:"_parseVideoData",value:function(j,X,$,te,ve){if($<=1){k.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Ie=new Uint8Array(j,X,$)[0],He=(Ie&240)>>>4,ct=Ie&15;if(ct!==7){this._onError(Xe.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(ct));return}this._parseAVCVideoPacket(j,X+1,$-1,te,ve,He)}},{key:"_parseAVCVideoPacket",value:function(j,X,$,te,ve,Ie){if($<4){k.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var He=this._littleEndian,ct=new DataView(j,X,$),ut=ct.getUint8(0),ze=ct.getUint32(0,!He)&16777215,gt=ze<<8>>8;if(ut===0)this._parseAVCDecoderConfigurationRecord(j,X+4,$-4);else if(ut===1)this._parseAVCVideoData(j,X+4,$-4,te,ve,Ie,gt);else if(!(ut===2)){this._onError(Xe.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(ut));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(j,X,$){if($<7){k.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var te=this._videoMetadata,ve=this._videoTrack,Ie=this._littleEndian,He=new DataView(j,X,$);te?typeof te.avcc!="undefined"&&k.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 ct=He.getUint8(0),ut=He.getUint8(1),ze=He.getUint8(2),gt=He.getUint8(3);if(ct!==1||ut===0){this._onError(Xe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(He.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Xe.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var Kt=He.getUint8(5)&31;if(Kt===0){this._onError(Xe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Kt>1&&k.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(Kt));for(var dt=6,sn=0;sn<Kt;sn++){var jt=He.getUint16(dt,!Ie);if(dt+=2,jt===0)continue;var St=new Uint8Array(j,X+dt,jt);dt+=jt;var at=Ce.parseSPS(St);if(sn!==0)continue;te.codecWidth=at.codec_size.width,te.codecHeight=at.codec_size.height,te.presentWidth=at.present_size.width,te.presentHeight=at.present_size.height,te.profile=at.profile_string,te.level=at.level_string,te.bitDepth=at.bit_depth,te.chromaFormat=at.chroma_format,te.sarRatio=at.sar_ratio,te.frameRate=at.frame_rate,(at.frame_rate.fixed===!1||at.frame_rate.fps_num===0||at.frame_rate.fps_den===0)&&(te.frameRate=this._referenceFrameRate);var xn=te.frameRate.fps_den,it=te.frameRate.fps_num;te.refSampleDuration=te.timescale*(xn/it);for(var ln=St.subarray(1,4),cn="avc1.",Yn=0;Yn<3;Yn++){var nr=ln[Yn].toString(16);nr.length<2&&(nr="0"+nr),cn+=nr}te.codec=cn;var vn=this._mediaInfo;vn.width=te.codecWidth,vn.height=te.codecHeight,vn.fps=te.frameRate.fps,vn.profile=te.profile,vn.level=te.level,vn.refFrames=at.ref_frames,vn.chromaFormat=at.chroma_format_string,vn.sarNum=te.sarRatio.width,vn.sarDen=te.sarRatio.height,vn.videoCodec=cn,vn.hasAudio?vn.audioCodec!=null&&(vn.mimeType='video/x-flv; codecs="'+vn.videoCodec+","+vn.audioCodec+'"'):vn.mimeType='video/x-flv; codecs="'+vn.videoCodec+'"',vn.isComplete()&&this._onMediaInfo(vn)}var gr=He.getUint8(dt);if(gr===0){this._onError(Xe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else gr>1&&k.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(gr));dt++;for(var Jn=0;Jn<gr;Jn++){var Cn=He.getUint16(dt,!Ie);if(dt+=2,Cn===0)continue;dt+=Cn}te.avcc=new Uint8Array($),te.avcc.set(new Uint8Array(j,X,$),0),k.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(j,X,$,te,ve,Ie,He){for(var ct=this._littleEndian,ut=new DataView(j,X,$),ze=[],gt=0,Kt=0,dt=this._naluLengthSize,sn=this._timestampBase+te,jt=Ie===1;Kt<$;){if(Kt+4>=$){k.w(this.TAG,"Malformed Nalu near timestamp ".concat(sn,", offset = ").concat(Kt,", dataSize = ").concat($));break}var St=ut.getUint32(Kt,!ct);if(dt===3&&(St>>>=8),St>$-dt){k.w(this.TAG,"Malformed Nalus near timestamp ".concat(sn,", NaluSize > DataSize!"));return}var at=ut.getUint8(Kt+dt)&31;at===5&&(jt=!0);var xn=new Uint8Array(j,X+Kt,dt+St),it={type:at,data:xn};ze.push(it),gt+=xn.byteLength,Kt+=dt+St}if(ze.length){var ln=this._videoTrack,cn={units:ze,length:gt,isKeyframe:jt,dts:sn,cts:He,pts:sn+He};jt&&(cn.fileposition=ve),ln.samples.push(cn),ln.length+=gt}}}],[{key:"probe",value:function(j){var X=new Uint8Array(j),$={match:!1};if(X[0]!==70||X[1]!==76||X[2]!==86||X[3]!==1)return $;var te=(X[4]&4)>>>2!==0,ve=(X[4]&1)!==0,Ie=ht(X,5);return Ie<9?$:{match:!0,consumed:Ie,dataOffset:Ie,hasAudioTrack:te,hasVideoTrack:ve}}}]),Ee}(),Ne=ft,Ue=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"init",value:function(){Ee.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 j in Ee.types)Ee.types.hasOwnProperty(j)&&(Ee.types[j]=[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]);var X=Ee.constants={};X.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),X.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),X.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),X.STSC=X.STCO=X.STTS,X.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),X.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]),X.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]),X.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),X.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),X.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(j){for(var X=8,$=null,te=Array.prototype.slice.call(arguments,1),ve=te.length,Ie=0;Ie<ve;Ie++)X+=te[Ie].byteLength;$=new Uint8Array(X),$[0]=X>>>24&255,$[1]=X>>>16&255,$[2]=X>>>8&255,$[3]=X&255,$.set(j,4);for(var He=8,ct=0;ct<ve;ct++)$.set(te[ct],He),He+=te[ct].byteLength;return $}},{key:"generateInitSegment",value:function(j){var X=Ee.box(Ee.types.ftyp,Ee.constants.FTYP),$=Ee.moov(j),te=new Uint8Array(X.byteLength+$.byteLength);return te.set(X,0),te.set($,X.byteLength),te}},{key:"moov",value:function(j){var X=Ee.mvhd(j.timescale,j.duration),$=Ee.trak(j),te=Ee.mvex(j);return Ee.box(Ee.types.moov,X,$,te)}},{key:"mvhd",value:function(j,X){return Ee.box(Ee.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,j&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(j){return Ee.box(Ee.types.trak,Ee.tkhd(j),Ee.mdia(j))}},{key:"tkhd",value:function(j){var X=j.id,$=j.duration,te=j.presentWidth,ve=j.presentHeight;return Ee.box(Ee.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,X>>>24&255,X>>>16&255,X>>>8&255,X&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(j){return Ee.box(Ee.types.mdia,Ee.mdhd(j),Ee.hdlr(j),Ee.minf(j))}},{key:"mdhd",value:function(j){var X=j.timescale,$=j.duration;return Ee.box(Ee.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,X>>>24&255,X>>>16&255,X>>>8&255,X&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255,85,196,0,0]))}},{key:"hdlr",value:function(j){var X=null;return j.type==="audio"?X=Ee.constants.HDLR_AUDIO:X=Ee.constants.HDLR_VIDEO,Ee.box(Ee.types.hdlr,X)}},{key:"minf",value:function(j){var X=null;return j.type==="audio"?X=Ee.box(Ee.types.smhd,Ee.constants.SMHD):X=Ee.box(Ee.types.vmhd,Ee.constants.VMHD),Ee.box(Ee.types.minf,X,Ee.dinf(),Ee.stbl(j))}},{key:"dinf",value:function(){var j=Ee.box(Ee.types.dinf,Ee.box(Ee.types.dref,Ee.constants.DREF));return j}},{key:"stbl",value:function(j){var X=Ee.box(Ee.types.stbl,Ee.stsd(j),Ee.box(Ee.types.stts,Ee.constants.STTS),Ee.box(Ee.types.stsc,Ee.constants.STSC),Ee.box(Ee.types.stsz,Ee.constants.STSZ),Ee.box(Ee.types.stco,Ee.constants.STCO));return X}},{key:"stsd",value:function(j){return j.type==="audio"?j.codec==="mp3"?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.mp3(j)):Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.mp4a(j)):Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.avc1(j))}},{key:"mp3",value:function(j){var X=j.channelCount,$=j.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,X,0,16,0,0,0,0,$>>>8&255,$&255,0,0]);return Ee.box(Ee.types[".mp3"],te)}},{key:"mp4a",value:function(j){var X=j.channelCount,$=j.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,X,0,16,0,0,0,0,$>>>8&255,$&255,0,0]);return Ee.box(Ee.types.mp4a,te,Ee.esds(j))}},{key:"esds",value:function(j){var X=j.config||[],$=X.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(X).concat([6,1,2]));return Ee.box(Ee.types.esds,te)}},{key:"avc1",value:function(j){var X=j.avcc,$=j.codecWidth,te=j.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 Ee.box(Ee.types.avc1,ve,Ee.box(Ee.types.avcC,X))}},{key:"mvex",value:function(j){return Ee.box(Ee.types.mvex,Ee.trex(j))}},{key:"trex",value:function(j){var X=j.id,$=new Uint8Array([0,0,0,0,X>>>24&255,X>>>16&255,X>>>8&255,X&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Ee.box(Ee.types.trex,$)}},{key:"moof",value:function(j,X){return Ee.box(Ee.types.moof,Ee.mfhd(j.sequenceNumber),Ee.traf(j,X))}},{key:"mfhd",value:function(j){var X=new Uint8Array([0,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,j&255]);return Ee.box(Ee.types.mfhd,X)}},{key:"traf",value:function(j,X){var $=j.id,te=Ee.box(Ee.types.tfhd,new Uint8Array([0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255])),ve=Ee.box(Ee.types.tfdt,new Uint8Array([0,0,0,0,X>>>24&255,X>>>16&255,X>>>8&255,X&255])),Ie=Ee.sdtp(j),He=Ee.trun(j,Ie.byteLength+16+16+8+16+8+8);return Ee.box(Ee.types.traf,te,ve,He,Ie)}},{key:"sdtp",value:function(j){for(var X=j.samples||[],$=X.length,te=new Uint8Array(4+$),ve=0;ve<$;ve++){var Ie=X[ve].flags;te[ve+4]=Ie.isLeading<<6|Ie.dependsOn<<4|Ie.isDependedOn<<2|Ie.hasRedundancy}return Ee.box(Ee.types.sdtp,te)}},{key:"trun",value:function(j,X){var $=j.samples||[],te=$.length,ve=12+16*te,Ie=new Uint8Array(ve);X+=8+ve,Ie.set([0,0,15,1,te>>>24&255,te>>>16&255,te>>>8&255,te&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255],0);for(var He=0;He<te;He++){var ct=$[He].duration,ut=$[He].size,ze=$[He].flags,gt=$[He].cts;Ie.set([ct>>>24&255,ct>>>16&255,ct>>>8&255,ct&255,ut>>>24&255,ut>>>16&255,ut>>>8&255,ut&255,ze.isLeading<<2|ze.dependsOn,ze.isDependedOn<<6|ze.hasRedundancy<<4|ze.isNonSync,0,0,gt>>>24&255,gt>>>16&255,gt>>>8&255,gt&255],12+16*He)}return Ee.box(Ee.types.trun,Ie)}},{key:"mdat",value:function(j){return Ee.box(Ee.types.mdat,j)}}]),Ee}();Ue.init();var Ze=Ue,et=function(){function Ee(){Object(q.a)(this,Ee)}return Object(z.a)(Ee,null,[{key:"getSilentFrame",value:function(j,X){if(j==="mp4a.40.2"){if(X===1)return new Uint8Array([0,200,0,128,35,128]);if(X===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(X===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(X===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(X===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(X===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(X===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(X===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(X===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}}]),Ee}(),fe=et,re=function Ee(de,j,X,$,te){Object(q.a)(this,Ee),this.dts=de,this.pts=j,this.duration=X,this.originalDts=$,this.isSyncPoint=te,this.fileposition=null},ie=function(){function Ee(){Object(q.a)(this,Ee),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)(Ee,[{key:"appendSyncPoint",value:function(j){j.isSyncPoint=!0,this.syncPoints.push(j)}}]),Ee}(),ce=function(){function Ee(){Object(q.a)(this,Ee),this._list=[]}return Object(z.a)(Ee,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(j){var X=this._list;if(j.length===0)return;X.length>0&&j[0].originalDts<X[X.length-1].originalDts&&this.clear(),Array.prototype.push.apply(X,j)}},{key:"getLastSyncPointBeforeDts",value:function(j){if(this._list.length==0)return null;var X=this._list,$=0,te=X.length-1,ve=0,Ie=0,He=te;for(j<X[0].dts&&($=0,Ie=He+1);Ie<=He;)if(ve=Ie+Math.floor((He-Ie)/2),ve===te||j>=X[ve].dts&&j<X[ve+1].dts){$=ve;break}else X[ve].dts<j?Ie=ve+1:He=ve-1;return this._list[$]}}]),Ee}(),pe=function(){function Ee(de){Object(q.a)(this,Ee),this._type=de,this._list=[],this._lastAppendLocation=-1}return Object(z.a)(Ee,[{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(j){var X=this._list;if(X.length===0)return-2;var $=X.length-1,te=0,ve=0,Ie=$,He=0;if(j<X[0].originalBeginDts)return He=-1,He;for(;ve<=Ie;)if(te=ve+Math.floor((Ie-ve)/2),te===$||j>X[te].lastSample.originalDts&&j<X[te+1].originalBeginDts){He=te;break}else X[te].originalBeginDts<j?ve=te+1:Ie=te-1;return He}},{key:"_searchNearestSegmentAfter",value:function(j){return this._searchNearestSegmentBefore(j)+1}},{key:"append",value:function(j){var X=this._list,$=j,te=this._lastAppendLocation,ve=0;te!==-1&&te<X.length&&$.originalBeginDts>=X[te].lastSample.originalDts&&(te===X.length-1||te<X.length-1&&$.originalBeginDts<X[te+1].originalBeginDts)?ve=te+1:X.length>0&&(ve=this._searchNearestSegmentBefore($.originalBeginDts)+1),this._lastAppendLocation=ve,this._list.splice(ve,0,$)}},{key:"getLastSegmentBefore",value:function(j){var X=this._searchNearestSegmentBefore(j);return X>=0?this._list[X]:null}},{key:"getLastSampleBefore",value:function(j){var X=this.getLastSegmentBefore(j);return X!=null?X.lastSample:null}},{key:"getLastSyncPointBefore",value:function(j){for(var X=this._searchNearestSegmentBefore(j),$=this._list[X].syncPoints;$.length===0&&X>0;)X--,$=this._list[X].syncPoints;return $.length>0?$[$.length-1]:null}}]),Ee}(),le=function(){function Ee(de){Object(q.a)(this,Ee),this.TAG="MP4Remuxer",this._config=de,this._isLive=de.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 pe("audio"),this._videoSegmentInfoList=new pe("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)(Ee,[{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(j){return j.onDataAvailable=this.remux.bind(this),j.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(j){this._onInitSegment=j}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(j){this._onMediaSegment=j}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(j){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(j,X){if(!this._onMediaSegment)throw new c("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(j,X),this._remuxVideo(X),this._remuxAudio(j)}},{key:"_onTrackMetadataReceived",value:function(j,X){var $=null,te="mp4",ve=X.codec;if(j==="audio")this._audioMeta=X,X.codec==="mp3"&&this._mp3UseMpegAudio?(te="mpeg",ve="",$=new Uint8Array):$=Ze.generateInitSegment(X);else if(j==="video")this._videoMeta=X,$=Ze.generateInitSegment(X);else return;if(!this._onInitSegment)throw new c("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(j,{type:j,data:$.buffer,codec:ve,container:"".concat(j,"/").concat(te),mediaDuration:X.duration})}},{key:"_calculateDtsBase",value:function(j,X){if(this._dtsBaseInited)return;j.samples&&j.samples.length&&(this._audioDtsBase=j.samples[0].dts),X.samples&&X.samples.length&&(this._videoDtsBase=X.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var j=this._videoStashedLastSample,X=this._audioStashedLastSample,$={type:"video",id:1,sequenceNumber:0,samples:[],length:0};j!=null&&($.samples.push(j),$.length=j.length);var te={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};X!=null&&(te.samples.push(X),te.length=X.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo($,!0),this._remuxAudio(te,!0)}},{key:"_remuxAudio",value:function(j,X){if(this._audioMeta==null)return;var $=j,te=$.samples,ve=void 0,Ie=-1,He=-1,ct=-1,ut=this._audioMeta.refSampleDuration,ze=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,gt=this._dtsBaseInited&&this._audioNextDts===void 0,Kt=!1;if(!te||te.length===0)return;if(te.length===1&&!X)return;var dt=0,sn=null,jt=0;ze?(dt=0,jt=$.length):(dt=8,jt=8+$.length);var St=null;if(te.length>1&&(St=te.pop(),jt-=St.length),this._audioStashedLastSample!=null){var at=this._audioStashedLastSample;this._audioStashedLastSample=null,te.unshift(at),jt+=at.length}St!=null&&(this._audioStashedLastSample=St);var xn=te[0].dts-this._dtsBase;if(this._audioNextDts)ve=xn-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())ve=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(Kt=!0));else{var it=this._audioSegmentInfoList.getLastSampleBefore(xn);if(it!=null){var ln=xn-(it.originalDts+it.duration);ln<=3&&(ln=0);var cn=it.dts+it.duration+ln;ve=xn-cn}else ve=0}if(Kt){var Yn=xn-ve,nr=this._videoSegmentInfoList.getLastSegmentBefore(xn);if(nr!=null&&nr.beginDts<Yn){var vn=fe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(vn){var gr=nr.beginDts,Jn=Yn-nr.beginDts;k.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(gr,", duration: ").concat(Jn)),te.unshift({unit:vn,dts:gr,pts:gr}),jt+=vn.byteLength}}else Kt=!1}for(var Cn=[],Dn=0;Dn<te.length;Dn++){var Dr=te[Dn],Hr=Dr.unit,vr=Dr.dts-this._dtsBase,rr=vr-ve;Ie===-1&&(Ie=rr);var yr=0;if(Dn!==te.length-1){var Qr=te[Dn+1].dts-this._dtsBase-ve;yr=Qr-rr}else if(St!=null){var _r=St.dts-this._dtsBase-ve;yr=_r-rr}else Cn.length>=1?yr=Cn[Cn.length-1].duration:yr=Math.floor(ut);var ir=!1,Pr=null;if(yr>ut*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!w.safari){ir=!0;var Lr=Math.abs(yr-ut),Or=Math.ceil(Lr/ut),Sr=rr+ut;k.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
`+"dts: ".concat(rr+yr," ms, expected: ").concat(rr+Math.round(ut)," ms, ")+"delta: ".concat(Math.round(Lr)," ms, generate: ").concat(Or," frames"));var ci=fe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);ci==null&&(k.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),ci=Hr),Pr=[];for(var yi=0;yi<Or;yi++){var ii=Math.round(Sr);if(Pr.length>0){var Zr=Pr[Pr.length-1];Zr.duration=ii-Zr.dts}var Ai={dts:ii,pts:ii,cts:0,unit:ci,size:ci.byteLength,duration:0,originalDts:vr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Pr.push(Ai),jt+=Ai.size,Sr+=ut}var Ni=Pr[Pr.length-1];Ni.duration=rr+yr-Ni.dts,yr=Math.round(ut)}Cn.push({dts:rr,pts:rr,cts:0,unit:Dr.unit,size:Dr.unit.byteLength,duration:yr,originalDts:vr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ir&&Cn.push.apply(Cn,Pr)}ze?sn=new Uint8Array(jt):(sn=new Uint8Array(jt),sn[0]=jt>>>24&255,sn[1]=jt>>>16&255,sn[2]=jt>>>8&255,sn[3]=jt&255,sn.set(Ze.types.mdat,4));for(var Ui=0;Ui<Cn.length;Ui++){var ai=Cn[Ui].unit;sn.set(ai,dt),dt+=ai.byteLength}var pr=Cn[Cn.length-1];He=pr.dts+pr.duration,this._audioNextDts=He;var cr=new ie;cr.beginDts=Ie,cr.endDts=He,cr.beginPts=Ie,cr.endPts=He,cr.originalBeginDts=Cn[0].originalDts,cr.originalEndDts=pr.originalDts+pr.duration,cr.firstSample=new re(Cn[0].dts,Cn[0].pts,Cn[0].duration,Cn[0].originalDts,!1),cr.lastSample=new re(pr.dts,pr.pts,pr.duration,pr.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(cr),$.samples=Cn,$.sequenceNumber++;var Yr=null;ze?Yr=new Uint8Array:Yr=Ze.moof($,Ie),$.samples=[],$.length=0;var qr={type:"audio",data:this._mergeBoxes(Yr,sn).buffer,sampleCount:Cn.length,info:cr};ze&>&&(qr.timestampOffset=Ie),this._onMediaSegment("audio",qr)}},{key:"_remuxVideo",value:function(j,X){if(this._videoMeta==null)return;var $=j,te=$.samples,ve=void 0,Ie=-1,He=-1,ct=-1,ut=-1;if(!te||te.length===0)return;if(te.length===1&&!X)return;var ze=8,gt=null,Kt=8+j.length,dt=null;if(te.length>1&&(dt=te.pop(),Kt-=dt.length),this._videoStashedLastSample!=null){var sn=this._videoStashedLastSample;this._videoStashedLastSample=null,te.unshift(sn),Kt+=sn.length}dt!=null&&(this._videoStashedLastSample=dt);var jt=te[0].dts-this._dtsBase;if(this._videoNextDts)ve=jt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())ve=0;else{var St=this._videoSegmentInfoList.getLastSampleBefore(jt);if(St!=null){var at=jt-(St.originalDts+St.duration);at<=3&&(at=0);var xn=St.dts+St.duration+at;ve=jt-xn}else ve=0}for(var it=new ie,ln=[],cn=0;cn<te.length;cn++){var Yn=te[cn],nr=Yn.dts-this._dtsBase,vn=Yn.isKeyframe,gr=nr-ve,Jn=Yn.cts,Cn=gr+Jn;Ie===-1&&(Ie=gr,ct=Cn);var Dn=0;if(cn!==te.length-1){var Dr=te[cn+1].dts-this._dtsBase-ve;Dn=Dr-gr}else if(dt!=null){var Hr=dt.dts-this._dtsBase-ve;Dn=Hr-gr}else ln.length>=1?Dn=ln[ln.length-1].duration:Dn=Math.floor(this._videoMeta.refSampleDuration);if(vn){var vr=new re(gr,Cn,Dn,Yn.dts,!0);vr.fileposition=Yn.fileposition,it.appendSyncPoint(vr)}ln.push({dts:gr,pts:Cn,cts:Jn,units:Yn.units,size:Yn.length,isKeyframe:vn,duration:Dn,originalDts:nr,flags:{isLeading:0,dependsOn:vn?2:1,isDependedOn:vn?1:0,hasRedundancy:0,isNonSync:vn?0:1}})}gt=new Uint8Array(Kt),gt[0]=Kt>>>24&255,gt[1]=Kt>>>16&255,gt[2]=Kt>>>8&255,gt[3]=Kt&255,gt.set(Ze.types.mdat,4);for(var rr=0;rr<ln.length;rr++)for(var yr=ln[rr].units;yr.length;){var Qr=yr.shift(),_r=Qr.data;gt.set(_r,ze),ze+=_r.byteLength}var ir=ln[ln.length-1];if(He=ir.dts+ir.duration,ut=ir.pts+ir.duration,this._videoNextDts=He,it.beginDts=Ie,it.endDts=He,it.beginPts=ct,it.endPts=ut,it.originalBeginDts=ln[0].originalDts,it.originalEndDts=ir.originalDts+ir.duration,it.firstSample=new re(ln[0].dts,ln[0].pts,ln[0].duration,ln[0].originalDts,ln[0].isKeyframe),it.lastSample=new re(ir.dts,ir.pts,ir.duration,ir.originalDts,ir.isKeyframe),this._isLive||this._videoSegmentInfoList.append(it),$.samples=ln,$.sequenceNumber++,this._forceFirstIDR){var Pr=ln[0].flags;Pr.dependsOn=2,Pr.isNonSync=0}var Lr=Ze.moof($,Ie);$.samples=[],$.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Lr,gt).buffer,sampleCount:ln.length,info:it})}},{key:"_mergeBoxes",value:function(j,X){var $=new Uint8Array(j.byteLength+X.byteLength);return $.set(j,0),$.set(X,j.byteLength),$}}]),Ee}(),he=le,ye={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"},_e=ye,Oe=function(){function Ee(de,j){Object(q.a)(this,Ee),this.TAG="TransmuxingController",this._emitter=new O.a,this._config=j,de.segments||(de.segments=[{duration:de.duration,filesize:de.filesize,url:de.url}]),typeof de.cors!="boolean"&&(de.cors=!0),typeof de.withCredentials!="boolean"&&(de.withCredentials=!1),this._mediaDataSource=de,this._currentSegmentIndex=0;var X=0;this._mediaDataSource.segments.forEach(function($){$.timestampBase=X,X+=$.duration,$.cors=de.cors,$.withCredentials=de.withCredentials,j.referrerPolicy&&($.referrerPolicy=j.referrerPolicy)}),!isNaN(X)&&this._mediaDataSource.duration!==X&&(this._mediaDataSource.duration=X),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)(Ee,[{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(j,X){this._emitter.addListener(j,X)}},{key:"off",value:function(j,X){this._emitter.removeListener(j,X)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(j,X){this._currentSegmentIndex=j;var $=this._mediaDataSource.segments[j],te=this._ioctl=new se($,this._config,j);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),X?this._demuxer.bindDataSource(this._ioctl):te.onDataArrival=this._onInitChunkArrival.bind(this),te.open(X)}},{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(j){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var X=this._searchSegmentIndexContains(j);if(X===this._currentSegmentIndex){var $=this._mediaInfo.segments[X];if($==null)this._pendingSeekTime=j;else{var te=$.getNearestKeyframe(j);this._remuxer.seek(te.milliseconds),this._ioctl.seek(te.fileposition),this._pendingResolveSeekPoint=te.milliseconds}}else{var ve=this._mediaInfo.segments[X];if(ve==null)this._pendingSeekTime=j,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(X);else{var Ie=ve.getNearestKeyframe(j);this._internalAbort(),this._remuxer.seek(j),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[X].timestampBase,this._loadSegment(X,Ie.fileposition),this._pendingResolveSeekPoint=Ie.milliseconds,this._reportSegmentMediaInfo(X)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(j){for(var X=this._mediaDataSource.segments,$=X.length-1,te=0;te<X.length;te++)if(j<X[te].timestampBase){$=te-1;break}return $}},{key:"_onInitChunkArrival",value:function(j,X){var $=this,te=null,ve=0;if(X>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,ve=this._demuxer.parseChunks(j,X);else if((te=Ne.probe(j)).match){this._demuxer=new Ne(te,this._config),this._remuxer||(this._remuxer=new he(this._config));var Ie=this._mediaDataSource;Ie.duration!=null&&!isNaN(Ie.duration)&&(this._demuxer.overridedDuration=Ie.duration),typeof Ie.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Ie.hasAudio),typeof Ie.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Ie.hasVideo),this._demuxer.timestampBase=Ie.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(j,X)}else te=null,k.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){$._internalAbort()}),this._emitter.emit(_e.DEMUX_ERROR,Xe.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),ve=0;return ve}},{key:"_onMediaInfo",value:function(j){var X=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},j),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,G.prototype));var $=Object.assign({},j);Object.setPrototypeOf($,G.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=$,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var te=X._pendingSeekTime;X._pendingSeekTime=null,X.seek(te)})}},{key:"_onMetaDataArrived",value:function(j){this._emitter.emit(_e.METADATA_ARRIVED,j)}},{key:"_onScriptDataArrived",value:function(j){this._emitter.emit(_e.SCRIPTDATA_ARRIVED,j)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(j){var X=j,$=X+1;$<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment($)):(this._remuxer.flushStashedSamples(),this._emitter.emit(_e.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(j){var X=this._ioctl.extraData;this._mediaDataSource.segments[X].redirectedURL=j}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(_e.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(j,X){k.e(this.TAG,"IOException: type = ".concat(j,", code = ").concat(X.code,", msg = ").concat(X.msg)),this._emitter.emit(_e.IO_ERROR,j,X),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(j,X){k.e(this.TAG,"DemuxException: type = ".concat(j,", info = ").concat(X)),this._emitter.emit(_e.DEMUX_ERROR,j,X)}},{key:"_onRemuxerInitSegmentArrival",value:function(j,X){this._emitter.emit(_e.INIT_SEGMENT,j,X)}},{key:"_onRemuxerMediaSegmentArrival",value:function(j,X){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(_e.MEDIA_SEGMENT,j,X),this._pendingResolveSeekPoint!=null&&j==="video"){var $=X.info.syncPoints,te=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,w.safari&&$.length>0&&$[0].originalDts===te&&(te=$[0].pts),this._emitter.emit(_e.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(j){var X=this._mediaInfo.segments[j],$=Object.assign({},X);$.duration=this._mediaInfo.duration,$.segmentCount=this._mediaInfo.segmentCount,delete $.segments,delete $.keyframesIndex,this._emitter.emit(_e.MEDIA_INFO,$)}},{key:"_reportStatisticsInfo",value:function(){var j={};j.url=this._ioctl.currentURL,j.hasRedirect=this._ioctl.hasRedirect,j.hasRedirect&&(j.redirectedURL=this._ioctl.currentRedirectedURL),j.speed=this._ioctl.currentSpeed,j.loaderType=this._ioctl.loaderType,j.currentSegmentIndex=this._currentSegmentIndex,j.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(_e.STATISTICS_INFO,j)}}]),Ee}(),ke=Oe,$e=function(de){var j="TransmuxingWorker",X=null,$=jt.bind(this);Y.install(),de.addEventListener("message",function(St){switch(St.data.cmd){case"init":X=new ke(St.data.param[0],St.data.param[1]),X.on(_e.IO_ERROR,Kt.bind(this)),X.on(_e.DEMUX_ERROR,dt.bind(this)),X.on(_e.INIT_SEGMENT,te.bind(this)),X.on(_e.MEDIA_SEGMENT,ve.bind(this)),X.on(_e.LOADING_COMPLETE,Ie.bind(this)),X.on(_e.RECOVERED_EARLY_EOF,He.bind(this)),X.on(_e.MEDIA_INFO,ct.bind(this)),X.on(_e.METADATA_ARRIVED,ut.bind(this)),X.on(_e.SCRIPTDATA_ARRIVED,ze.bind(this)),X.on(_e.STATISTICS_INFO,gt.bind(this)),X.on(_e.RECOMMEND_SEEKPOINT,sn.bind(this));break;case"destroy":X&&(X.destroy(),X=null),de.postMessage({msg:"destroyed"});break;case"start":X.start();break;case"stop":X.stop();break;case"seek":X.seek(St.data.param);break;case"pause":X.pause();break;case"resume":X.resume();break;case"logging_config":{var at=St.data.param;Z.applyConfig(at),at.enableCallback===!0?Z.addLogListener($):Z.removeLogListener($);break}}});function te(St,at){var xn={msg:_e.INIT_SEGMENT,data:{type:St,data:at}};de.postMessage(xn,[at.data])}function ve(St,at){var xn={msg:_e.MEDIA_SEGMENT,data:{type:St,data:at}};de.postMessage(xn,[at.data])}function Ie(){var St={msg:_e.LOADING_COMPLETE};de.postMessage(St)}function He(){var St={msg:_e.RECOVERED_EARLY_EOF};de.postMessage(St)}function ct(St){var at={msg:_e.MEDIA_INFO,data:St};de.postMessage(at)}function ut(St){var at={msg:_e.METADATA_ARRIVED,data:St};de.postMessage(at)}function ze(St){var at={msg:_e.SCRIPTDATA_ARRIVED,data:St};de.postMessage(at)}function gt(St){var at={msg:_e.STATISTICS_INFO,data:St};de.postMessage(at)}function Kt(St,at){de.postMessage({msg:_e.IO_ERROR,data:{type:St,info:at}})}function dt(St,at){de.postMessage({msg:_e.DEMUX_ERROR,data:{type:St,info:at}})}function sn(St){de.postMessage({msg:_e.RECOMMEND_SEEKPOINT,data:St})}function jt(St,at){de.postMessage({msg:"logcat_callback",data:{type:St,logcat:at}})}},ot=$e,pt=function(){function Ee(de,j){if(Object(q.a)(this,Ee),this.TAG="Transmuxer",this._emitter=new O.a,j.enableWorker&&typeof Worker!="undefined")try{var X=D("0r65");this._worker=X(ot),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[de,j]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Z.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Z.getConfig()})}catch(te){k.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ke(de,j)}else this._controller=new ke(de,j);if(this._controller){var $=this._controller;$.on(_e.IO_ERROR,this._onIOError.bind(this)),$.on(_e.DEMUX_ERROR,this._onDemuxError.bind(this)),$.on(_e.INIT_SEGMENT,this._onInitSegment.bind(this)),$.on(_e.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),$.on(_e.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),$.on(_e.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),$.on(_e.MEDIA_INFO,this._onMediaInfo.bind(this)),$.on(_e.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),$.on(_e.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),$.on(_e.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),$.on(_e.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(z.a)(Ee,[{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(j,X){this._emitter.addListener(j,X)}},{key:"off",value:function(j,X){this._emitter.removeListener(j,X)}},{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(j){this._worker?this._worker.postMessage({cmd:"seek",param:j}):this._controller.seek(j)}},{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(j,X){var $=this;Promise.resolve().then(function(){$._emitter.emit(_e.INIT_SEGMENT,j,X)})}},{key:"_onMediaSegment",value:function(j,X){var $=this;Promise.resolve().then(function(){$._emitter.emit(_e.MEDIA_SEGMENT,j,X)})}},{key:"_onLoadingComplete",value:function(){var j=this;Promise.resolve().then(function(){j._emitter.emit(_e.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var j=this;Promise.resolve().then(function(){j._emitter.emit(_e.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(j){var X=this;Promise.resolve().then(function(){X._emitter.emit(_e.MEDIA_INFO,j)})}},{key:"_onMetaDataArrived",value:function(j){var X=this;Promise.resolve().then(function(){X._emitter.emit(_e.METADATA_ARRIVED,j)})}},{key:"_onScriptDataArrived",value:function(j){var X=this;Promise.resolve().then(function(){X._emitter.emit(_e.SCRIPTDATA_ARRIVED,j)})}},{key:"_onStatisticsInfo",value:function(j){var X=this;Promise.resolve().then(function(){X._emitter.emit(_e.STATISTICS_INFO,j)})}},{key:"_onIOError",value:function(j,X){var $=this;Promise.resolve().then(function(){$._emitter.emit(_e.IO_ERROR,j,X)})}},{key:"_onDemuxError",value:function(j,X){var $=this;Promise.resolve().then(function(){$._emitter.emit(_e.DEMUX_ERROR,j,X)})}},{key:"_onRecommendSeekpoint",value:function(j){var X=this;Promise.resolve().then(function(){X._emitter.emit(_e.RECOMMEND_SEEKPOINT,j)})}},{key:"_onLoggingConfigChanged",value:function(j){this._worker&&this._worker.postMessage({cmd:"logging_config",param:j})}},{key:"_onWorkerMessage",value:function(j){var X=j.data,$=X.data;if(X.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(X.msg){case _e.INIT_SEGMENT:case _e.MEDIA_SEGMENT:this._emitter.emit(X.msg,$.type,$.data);break;case _e.LOADING_COMPLETE:case _e.RECOVERED_EARLY_EOF:this._emitter.emit(X.msg);break;case _e.MEDIA_INFO:Object.setPrototypeOf($,G.prototype),this._emitter.emit(X.msg,$);break;case _e.METADATA_ARRIVED:case _e.SCRIPTDATA_ARRIVED:case _e.STATISTICS_INFO:this._emitter.emit(X.msg,$);break;case _e.IO_ERROR:case _e.DEMUX_ERROR:this._emitter.emit(X.msg,$.type,$.info);break;case _e.RECOMMEND_SEEKPOINT:this._emitter.emit(X.msg,$);break;case"logcat_callback":k.emitter.emit("log",$.type,$.logcat);break;default:break}}}]),Ee}(),mt=pt,qt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},xt=qt,Ct=function(){function Ee(de){Object(q.a)(this,Ee),this.TAG="MSEController",this._config=de,this._emitter=new O.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 ce}return Object(z.a)(Ee,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(j,X){this._emitter.addListener(j,X)}},{key:"off",value:function(j,X){this._emitter.removeListener(j,X)}},{key:"attachMediaElement",value:function(j){if(this._mediaSource)throw new c("MediaSource has been attached to an HTMLMediaElement!");var X=this._mediaSource=new window.MediaSource;X.addEventListener("sourceopen",this.e.onSourceOpen),X.addEventListener("sourceended",this.e.onSourceEnded),X.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=j,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),j.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var j=this._mediaSource;for(var X in this._sourceBuffers){var $=this._pendingSegments[X];$.splice(0,$.length),this._pendingSegments[X]=null,this._pendingRemoveRanges[X]=null,this._lastInitSegments[X]=null;var te=this._sourceBuffers[X];if(te){if(j.readyState!=="closed"){try{j.removeSourceBuffer(te)}catch(ve){k.e(this.TAG,ve.message)}te.removeEventListener("error",this.e.onSourceBufferError),te.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[X]=null,this._sourceBuffers[X]=null}}if(j.readyState==="open")try{j.endOfStream()}catch(ve){k.e(this.TAG,ve.message)}j.removeEventListener("sourceopen",this.e.onSourceOpen),j.removeEventListener("sourceended",this.e.onSourceEnded),j.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(j,X){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(j),this._pendingSegments[j.type].push(j);return}var $=j,te="".concat($.container);$.codec&&$.codec.length>0&&(te+=";codecs=".concat($.codec));var ve=!1;if(k.v(this.TAG,"Received Initialization Segment, mimeType: "+te),this._lastInitSegments[$.type]=$,te!==this._mimeTypes[$.type]){if(this._mimeTypes[$.type])k.v(this.TAG,"Notice: ".concat($.type," mimeType changed, origin: ").concat(this._mimeTypes[$.type],", target: ").concat(te));else{ve=!0;try{var Ie=this._sourceBuffers[$.type]=this._mediaSource.addSourceBuffer(te);Ie.addEventListener("error",this.e.onSourceBufferError),Ie.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(He){k.e(this.TAG,He.message),this._emitter.emit(xt.ERROR,{code:He.code,msg:He.message});return}}this._mimeTypes[$.type]=te}X||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(j){var X=j;this._pendingSegments[X.type].push(X),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var $=this._sourceBuffers[X.type];$&&!$.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(j){for(var X in this._sourceBuffers){if(!this._sourceBuffers[X])continue;var $=this._sourceBuffers[X];if(this._mediaSource.readyState==="open")try{$.abort()}catch(ut){k.e(this.TAG,ut.message)}this._idrList.clear();var te=this._pendingSegments[X];if(te.splice(0,te.length),this._mediaSource.readyState==="closed")continue;for(var ve=0;ve<$.buffered.length;ve++){var Ie=$.buffered.start(ve),He=$.buffered.end(ve);this._pendingRemoveRanges[X].push({start:Ie,end:He})}if($.updating||this._doRemoveRanges(),w.safari){var ct=this._lastInitSegments[X];ct&&(this._pendingSegments[X].push(ct),$.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var j=this._mediaSource,X=this._sourceBuffers;if(!j||j.readyState!=="open"){j&&j.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}X.video&&X.video.updating||X.audio&&X.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,j.endOfStream())}},{key:"getNearestKeyframe",value:function(j){return this._idrList.getLastSyncPointBeforeDts(j)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var j=this._mediaElement.currentTime;for(var X in this._sourceBuffers){var $=this._sourceBuffers[X];if($){var te=$.buffered;if(te.length>=1&&j-te.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var j=this._mediaElement.currentTime;for(var X in this._sourceBuffers){var $=this._sourceBuffers[X];if($){for(var te=$.buffered,ve=!1,Ie=0;Ie<te.length;Ie++){var He=te.start(Ie),ct=te.end(Ie);if(He<=j&&j<ct+3){if(j-He>=this._config.autoCleanupMaxBackwardDuration){ve=!0;var ut=j-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[X].push({start:He,end:ut})}}else ct<j&&(ve=!0,this._pendingRemoveRanges[X].push({start:He,end:ct}))}ve&&!$.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var j=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(j.video&&j.video.updating||j.audio&&j.audio.updating)return;var X=this._mediaSource.duration,$=this._pendingMediaDuration;$>0&&(isNaN(X)||$>X)&&(k.v(this.TAG,"Update MediaSource duration from ".concat(X," to ").concat($)),this._mediaSource.duration=$),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var j in this._pendingRemoveRanges){if(!this._sourceBuffers[j]||this._sourceBuffers[j].updating)continue;for(var X=this._sourceBuffers[j],$=this._pendingRemoveRanges[j];$.length&&!X.updating;){var te=$.shift();X.remove(te.start,te.end)}}}},{key:"_doAppendSegments",value:function(){var j=this._pendingSegments;for(var X in j){if(!this._sourceBuffers[X]||this._sourceBuffers[X].updating)continue;if(j[X].length>0){var $=j[X].shift();if($.timestampOffset){var te=this._sourceBuffers[X].timestampOffset,ve=$.timestampOffset/1e3,Ie=Math.abs(te-ve);Ie>.1&&(k.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(te," to ").concat(ve)),this._sourceBuffers[X].timestampOffset=ve),delete $.timestampOffset}if(!$.data||$.data.byteLength===0)continue;try{this._sourceBuffers[X].appendBuffer($.data),this._isBufferFull=!1,X==="video"&&$.hasOwnProperty("info")&&this._idrList.appendArray($.info.syncPoints)}catch(He){this._pendingSegments[X].unshift($),He.code===22?(this._isBufferFull||this._emitter.emit(xt.BUFFER_FULL),this._isBufferFull=!0):(k.e(this.TAG,He.message),this._emitter.emit(xt.ERROR,{code:He.code,msg:He.message}))}}}}},{key:"_onSourceOpen",value:function(){if(k.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var j=this._pendingSourceBufferInit;j.length;){var X=j.shift();this.appendInitSegment(X,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(xt.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){k.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){k.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 j=this._pendingSegments;return j.video.length>0||j.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var j=this._pendingRemoveRanges;return j.video.length>0||j.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(xt.UPDATE_END)}},{key:"_onSourceBufferError",value:function(j){k.e(this.TAG,"SourceBuffer Error: ".concat(j))}}]),Ee}(),Pt=Ct,Rt={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Gt={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:Xe.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Xe.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Xe.CODEC_UNSUPPORTED},On=function(){function Ee(de,j){if(Object(q.a)(this,Ee),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new O.a,this._config=Le(),typeof j=="object"&&Object.assign(this._config,j),de.type.toLowerCase()!=="flv")throw new o("FlvPlayer requires an flv MediaDataSource input!");de.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=de,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 X=w.chrome&&(w.version.major<50||w.version.major===50&&w.version.build<2661);this._alwaysSeekKeyframe=!!(X||w.msedge||w.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(z.a)(Ee,[{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(j,X){var $=this;j===je.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){$._emitter.emit(je.MEDIA_INFO,$.mediaInfo)}):j===je.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){$._emitter.emit(je.STATISTICS_INFO,$.statisticsInfo)})),this._emitter.addListener(j,X)}},{key:"off",value:function(j,X){this._emitter.removeListener(j,X)}},{key:"attachMediaElement",value:function(j){var X=this;if(this._mediaElement=j,j.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),j.addEventListener("seeking",this.e.onvSeeking),j.addEventListener("canplay",this.e.onvCanPlay),j.addEventListener("stalled",this.e.onvStalled),j.addEventListener("progress",this.e.onvProgress),this._msectl=new Pt(this._config),this._msectl.on(xt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(xt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(xt.SOURCE_OPEN,function(){X._mseSourceOpened=!0,X._hasPendingLoad&&(X._hasPendingLoad=!1,X.load())}),this._msectl.on(xt.ERROR,function($){X._emitter.emit(je.ERROR,Rt.MEDIA_ERROR,Gt.MEDIA_MSE_ERROR,$)}),this._msectl.attachMediaElement(j),this._pendingSeekTime!=null)try{j.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 j=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 mt(this._mediaDataSource,this._config),this._transmuxer.on(_e.INIT_SEGMENT,function(X,$){j._msectl.appendInitSegment($)}),this._transmuxer.on(_e.MEDIA_SEGMENT,function(X,$){if(j._msectl.appendMediaSegment($),j._config.lazyLoad&&!j._config.isLive){var te=j._mediaElement.currentTime;$.info.endDts>=(te+j._config.lazyLoadMaxDuration)*1e3&&(j._progressChecker==null&&(k.v(j.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),j._suspendTransmuxer()))}}),this._transmuxer.on(_e.LOADING_COMPLETE,function(){j._msectl.endOfStream(),j._emitter.emit(je.LOADING_COMPLETE)}),this._transmuxer.on(_e.RECOVERED_EARLY_EOF,function(){j._emitter.emit(je.RECOVERED_EARLY_EOF)}),this._transmuxer.on(_e.IO_ERROR,function(X,$){j._emitter.emit(je.ERROR,Rt.NETWORK_ERROR,X,$)}),this._transmuxer.on(_e.DEMUX_ERROR,function(X,$){j._emitter.emit(je.ERROR,Rt.MEDIA_ERROR,X,{code:-1,msg:$})}),this._transmuxer.on(_e.MEDIA_INFO,function(X){j._mediaInfo=X,j._emitter.emit(je.MEDIA_INFO,Object.assign({},X))}),this._transmuxer.on(_e.METADATA_ARRIVED,function(X){j._emitter.emit(je.METADATA_ARRIVED,X)}),this._transmuxer.on(_e.SCRIPTDATA_ARRIVED,function(X){j._emitter.emit(je.SCRIPTDATA_ARRIVED,X)}),this._transmuxer.on(_e.STATISTICS_INFO,function(X){j._statisticsInfo=j._fillStatisticsInfo(X),j._emitter.emit(je.STATISTICS_INFO,Object.assign({},j._statisticsInfo))}),this._transmuxer.on(_e.RECOMMEND_SEEKPOINT,function(X){j._mediaElement&&!j._config.accurateSeek&&(j._requestSetTime=!0,j._mediaElement.currentTime=X/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(j){this._mediaElement.volume=j}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(j){this._mediaElement.muted=j}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(j){this._mediaElement?this._internalSeek(j):this._pendingSeekTime=j}},{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(j){if(j.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return j;var X=!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):X=!1;return X&&(j.decodedFrames=$,j.droppedFrames=te),j}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var j=this._mediaElement.buffered,X=this._mediaElement.currentTime,$=0,te=0,ve=0;ve<j.length;ve++){var Ie=j.start(ve),He=j.end(ve);if(Ie<=X&&X<He){$=Ie,te=He;break}}te>=X+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(k.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){k.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 j=this._mediaElement.currentTime,X=this._mediaElement.buffered,$=!1,te=0;te<X.length;te++){var ve=X.start(te),Ie=X.end(te);if(j>=ve&&j<Ie){j>=Ie-this._config.lazyLoadRecoverDuration&&($=!0);break}}$&&(window.clearInterval(this._progressChecker),this._progressChecker=null,$&&(k.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(j){for(var X=this._mediaElement.buffered,$=0;$<X.length;$++){var te=X.start($),ve=X.end($);if(j>=te&&j<ve)return!0}return!1}},{key:"_internalSeek",value:function(j){var X=this._isTimepointBuffered(j),$=!1,te=0;if(j<1&&this._mediaElement.buffered.length>0){var ve=this._mediaElement.buffered.start(0);(ve<1&&j<ve||w.safari)&&($=!0,te=w.safari?.1:ve)}if($)this._requestSetTime=!0,this._mediaElement.currentTime=te;else if(X){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=j;else{var Ie=this._msectl.getNearestKeyframe(Math.floor(j*1e3));this._requestSetTime=!0,Ie!=null?this._mediaElement.currentTime=Ie.dts/1e3:this._mediaElement.currentTime=j}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(j),this._transmuxer.seek(Math.floor(j*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=j)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var j=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(j)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(j),this._transmuxer.seek(Math.floor(j*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=j))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(j){var X=this._mediaElement;if(j||!this._receivedCanPlay||X.readyState<2){var $=X.buffered;$.length>0&&X.currentTime<$.start(0)&&(k.w(this.TAG,"Playback seems stuck at ".concat(X.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(j){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(j){var X=this._mediaElement.currentTime,$=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(X<1&&$.length>0){var te=$.start(0);if(te<1&&X<te||w.safari){this._requestSetTime=!0,this._mediaElement.currentTime=w.safari?.1:te;return}}if(this._isTimepointBuffered(X)){if(this._alwaysSeekKeyframe){var ve=this._msectl.getNearestKeyframe(Math.floor(X*1e3));ve!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=ve.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:X,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(j){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(j){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(j){this._checkAndResumeStuckPlayback()}}]),Ee}(),kt=On,Un=function(){function Ee(de,j){if(Object(q.a)(this,Ee),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new O.a,this._config=Le(),typeof j=="object"&&Object.assign(this._config,j),de.type.toLowerCase()==="flv")throw new o("NativePlayer does't support flv MediaDataSource input!");if(de.hasOwnProperty("segments"))throw new o("NativePlayer(".concat(de.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=de,this._mediaElement=null}return Object(z.a)(Ee,[{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(j,X){var $=this;j===je.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){$._emitter.emit(je.MEDIA_INFO,$.mediaInfo)}):j===je.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){$._emitter.emit(je.STATISTICS_INFO,$.statisticsInfo)})),this._emitter.addListener(j,X)}},{key:"off",value:function(j,X){this._emitter.removeListener(j,X)}},{key:"attachMediaElement",value:function(j){if(this._mediaElement=j,j.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{j.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(X){}}},{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(j){this._mediaElement.volume=j}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(j){this._mediaElement.muted=j}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(j){this._mediaElement?this._mediaElement.currentTime=j:this._pendingSeekTime=j}},{key:"mediaInfo",get:function(){var j=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",X={mimeType:j+this._mediaDataSource.type};return this._mediaElement&&(X.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(X.width=this._mediaElement.videoWidth,X.height=this._mediaElement.videoHeight)),X}},{key:"statisticsInfo",get:function(){var j={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return j;var X=!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):X=!1;return X&&(j.decodedFrames=$,j.droppedFrames=te),j}},{key:"_onvLoadedMetadata",value:function(j){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(je.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(je.STATISTICS_INFO,this.statisticsInfo)}}]),Ee}(),An=Un;Y.install();function en(Ee,de){var j=Ee;if(j==null||typeof j!="object")throw new o("MediaDataSource must be an javascript object!");if(!j.hasOwnProperty("type"))throw new o("MediaDataSource must has type field to indicate video file type!");switch(j.type){case"flv":return new kt(j,de);default:return new An(j,de)}}function wn(){return Pe.supportMSEH264Playback()}function Wt(){return Pe.getFeatureList()}var At={};At.createPlayer=en,At.isSupported=wn,At.getFeatureList=Wt,At.BaseLoader=r,At.LoaderStatus=i,At.LoaderErrors=a,At.Events=je,At.ErrorTypes=Rt,At.ErrorDetails=Gt,At.FlvPlayer=kt,At.NativePlayer=An,At.LoggingControl=Z,Object.defineProperty(At,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Zt=ge.a=At},GgEA:function(We,ge,D){},HmJG:function(We,ge,D){},Hw79:function(We,ge,D){We.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},IBYe:function(We,ge,D){"use strict";function q(z){return null}ge.a=q},IxHN:function(We,ge,D){"use strict";var q=D("q1tI"),z=D.n(q),P=D("07cG"),Y=D.n(P);ge.a=function(N){var O=N.message,H=N.className,k=N.children,n=N.style,I=n===void 0?{}:n;return z.a.createElement("div",{className:"".concat(Y.a.idsRingWrapper," ").concat(H)},z.a.createElement("div",{className:Y.a.ldsRing},z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null)),O?z.a.createElement("p",{style:I},O):null,k)}},J66h:function(We,ge,D){(function(q){var z,P;(function(Y,N){We.exports=N(Y)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof q!="undefined"?q:this,function(Y){"use strict";Y=Y||{};var N=Y.Base64,O="2.6.4",H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=function(y){for(var M={},W=0,L=y.length;W<L;W++)M[y.charAt(W)]=W;return M}(H),n=String.fromCharCode,I=function(y){if(y.length<2){var M=y.charCodeAt(0);return M<128?y:M<2048?n(192|M>>>6)+n(128|M&63):n(224|M>>>12&15)+n(128|M>>>6&63)+n(128|M&63)}else{var M=65536+(y.charCodeAt(0)-55296)*1024+(y.charCodeAt(1)-56320);return n(240|M>>>18&7)+n(128|M>>>12&63)+n(128|M>>>6&63)+n(128|M&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(y){return y.replace(g,I)},h=function(y){var M=[0,2,1][y.length%3],W=y.charCodeAt(0)<<16|(y.length>1?y.charCodeAt(1):0)<<8|(y.length>2?y.charCodeAt(2):0),L=[H.charAt(W>>>18),H.charAt(W>>>12&63),M>=2?"=":H.charAt(W>>>6&63),M>=1?"=":H.charAt(W&63)];return L.join("")},c=Y.btoa&&typeof Y.btoa=="function"?function(y){return Y.btoa(y)}:function(y){if(y.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return y.replace(/[\s\S]{1,3}/g,h)},o=function(y){return c(p(String(y)))},d=function(y){return y.replace(/[+\/]/g,function(M){return M=="+"?"-":"_"}).replace(/=/g,"")},i=function(y,M){return M?d(o(y)):o(y)},a=function(y){return i(y,!0)},r;Y.Uint8Array&&(r=function(y,M){for(var W="",L=0,K=y.length;L<K;L+=3){var F=y[L],R=y[L+1],V=y[L+2],ne=F<<16|R<<8|V;W+=H.charAt(ne>>>18)+H.charAt(ne>>>12&63)+(typeof R!="undefined"?H.charAt(ne>>>6&63):"=")+(typeof V!="undefined"?H.charAt(ne&63):"=")}return M?d(W):W});var s=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(y){switch(y.length){case 4:var M=(7&y.charCodeAt(0))<<18|(63&y.charCodeAt(1))<<12|(63&y.charCodeAt(2))<<6|63&y.charCodeAt(3),W=M-65536;return n((W>>>10)+55296)+n((W&1023)+56320);case 3:return n((15&y.charCodeAt(0))<<12|(63&y.charCodeAt(1))<<6|63&y.charCodeAt(2));default:return n((31&y.charCodeAt(0))<<6|63&y.charCodeAt(1))}},x=function(y){return y.replace(s,S)},T=function(y){var M=y.length,W=M%4,L=(M>0?k[y.charAt(0)]<<18:0)|(M>1?k[y.charAt(1)]<<12:0)|(M>2?k[y.charAt(2)]<<6:0)|(M>3?k[y.charAt(3)]:0),K=[n(L>>>16),n(L>>>8&255),n(L&255)];return K.length-=[0,0,2,1][W],K.join("")},A=Y.atob&&typeof Y.atob=="function"?function(y){return Y.atob(y)}:function(y){return y.replace(/\S{1,4}/g,T)},w=function(y){return A(String(y).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(y){return x(A(y))},E=function(y){return String(y).replace(/[-_]/g,function(M){return M=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},m=function(y){return v(E(y))},f;Y.Uint8Array&&(f=function(y){return Uint8Array.from(w(E(y)),function(M){return M.charCodeAt(0)})});var C=function(){var y=Y.Base64;return Y.Base64=N,y};if(Y.Base64={VERSION:O,atob:w,btoa:c,fromBase64:m,toBase64:i,utob:p,encode:i,encodeURI:a,btou:x,decode:m,noConflict:C,fromUint8Array:r,toUint8Array:f},typeof Object.defineProperty=="function"){var b=function(y){return{value:y,enumerable:!1,writable:!0,configurable:!0}};Y.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",b(function(){return m(this)})),Object.defineProperty(String.prototype,"toBase64",b(function(y){return i(this,y)})),Object.defineProperty(String.prototype,"toBase64URI",b(function(){return i(this,!0)}))}}return Y.Meteor&&(Base64=Y.Base64),We.exports?We.exports.Base64=Y.Base64:!(z=[],P=function(){return Y.Base64}.apply(ge,z),P!==void 0&&(We.exports=P)),{Base64:Y.Base64}})}).call(this,D("IyRk"))},JOrW:function(We,ge,D){We.exports=D.p+"static/gf.09d89ab3.svg"},JYp7:function(We,ge,D){"use strict";D.d(ge,"a",function(){return q});var q;(function(z){function P(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}z.is=P;const Y=Object.freeze([]);function N(){return Y}z.empty=N;function*O(s){yield s}z.single=O;function H(s){return s||Y}z.from=H;function k(s){return!s||s[Symbol.iterator]().next().done===!0}z.isEmpty=k;function n(s){return s[Symbol.iterator]().next().value}z.first=n;function I(s,S){for(const x of s)if(S(x))return!0;return!1}z.some=I;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*i(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=i;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 r(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=r})(q||(q={}))},LdHM:function(We,ge,D){"use strict";D.d(ge,"b",function(){return s}),D.d(ge,"a",function(){return x});var q=D("1OyB"),z=D("vuIU"),P=D("Ji7U"),Y=D("LK+K"),N=D("q1tI"),O=D("rePB"),H=D("Ff2n"),k=D("ODXe"),n=D("4IlW"),I=D("bX4T"),g=D("YrtM"),p=D("TSYQ"),h=D.n(p),c=D("+nKL"),o=D("8OUc"),d=function(V,ne){var se=V.prefixCls,Se=V.id,Le=V.flattenOptions,Ae=V.childrenAsData,Pe=V.values,Fe=V.searchValue,je=V.multiple,Te=V.defaultActiveFirstOption,Z=V.height,U=V.itemHeight,G=V.notFoundContent,ee=V.open,ue=V.menuItemSelectedIcon,J=V.virtual,we=V.onSelect,Ge=V.onToggleOpen,Je=V.onActiveValue,be=V.onScroll,Re=V.onMouseEnter,xe="".concat(se,"-item"),Ce=Object(g.a)(function(){return Le},[ee,Le],function(re,ie){return ie[0]&&re[1]!==ie[1]}),Be=N.useRef(null),Xe=function(ie){ie.preventDefault()},qe=function(ie){Be.current&&Be.current.scrollTo({index:ie})},tt=function(ie){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=Ce.length,le=0;le<pe;le+=1){var he=(ie+le*ce+pe)%pe,ye=Ce[he],_e=ye.group,Oe=ye.data;if(!_e&&!Oe.disabled)return he}return-1},ht=N.useState(function(){return tt(0)}),ft=Object(k.a)(ht,2),Ne=ft[0],Ue=ft[1],Ze=function(ie){Ue(ie);var ce=Ce[ie];if(!ce){Je(null,-1);return}Je(ce.data.value,ie)};N.useEffect(function(){Ze(Te!==!1?tt(0):-1)},[Ce.length,Fe]),N.useEffect(function(){var re=setTimeout(function(){if(!je&&ee&&Pe.size===1){var ie=Array.from(Pe)[0],ce=Ce.findIndex(function(pe){var le=pe.data;return le.value===ie});Ze(ce),qe(ce)}});return function(){return clearTimeout(re)}},[ee]);var et=function(ie){ie!==void 0&&we(ie,{selected:!Pe.has(ie)}),je||Ge(!1)};if(N.useImperativeHandle(ne,function(){return{onKeyDown:function(ie){var ce=ie.which;switch(ce){case n.a.UP:case n.a.DOWN:{var pe=0;if(ce===n.a.UP?pe=-1:ce===n.a.DOWN&&(pe=1),pe!==0){var le=tt(Ne+pe,pe);qe(le),Ze(le)}break}case n.a.ENTER:{var he=Ce[Ne];he&&!he.data.disabled?et(he.data.value):et(void 0),ee&&ie.preventDefault();break}case n.a.ESC:Ge(!1)}},onKeyUp:function(){},scrollTo:function(ie){qe(ie)}}}),Ce.length===0)return N.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),className:"".concat(xe,"-empty"),onMouseDown:Xe},G);function fe(re){var ie=Ce[re];if(!ie)return null;var ce=ie.data||{},pe=ce.value,le=ce.label,he=ce.children,ye=Object(I.a)(ce,!0),_e=Ae?he:le;return ie?N.createElement("div",Object.assign({"aria-label":typeof _e=="string"?_e:null},ye,{key:re,role:"option",id:"".concat(Se,"_list_").concat(re),"aria-selected":Pe.has(pe)}),pe):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),style:{height:0,width:0,overflow:"hidden"}},fe(Ne-1),fe(Ne),fe(Ne+1)),N.createElement(c.a,{itemKey:"key",ref:Be,data:Ce,height:Z,itemHeight:U,fullHeight:!1,onMouseDown:Xe,onScroll:be,virtual:J,onMouseEnter:Re},function(re,ie){var ce,pe=re.group,le=re.groupOption,he=re.data,ye=he.label,_e=he.key;if(pe)return N.createElement("div",{className:h()(xe,"".concat(xe,"-group"))},ye!==void 0?ye:_e);var Oe=he.disabled,ke=he.value,$e=he.title,ot=he.children,pt=he.style,mt=he.className,qt=Object(H.a)(he,["disabled","value","title","children","style","className"]),xt=Pe.has(ke),Ct="".concat(xe,"-option"),Pt=h()(xe,Ct,mt,(ce={},Object(O.a)(ce,"".concat(Ct,"-grouped"),le),Object(O.a)(ce,"".concat(Ct,"-active"),Ne===ie&&!Oe),Object(O.a)(ce,"".concat(Ct,"-disabled"),Oe),Object(O.a)(ce,"".concat(Ct,"-selected"),xt),ce)),Rt=Ae?ot:ye,Gt=!ue||typeof ue=="function"||xt;return N.createElement("div",Object.assign({},qt,{"aria-selected":xt,className:Pt,title:$e,onMouseMove:function(){if(Ne===ie||Oe)return;Ze(ie)},onClick:function(){Oe||et(ke)},style:pt}),N.createElement("div",{className:"".concat(Ct,"-content")},Rt||ke),N.isValidElement(ue)||xt,Gt&&N.createElement(o.a,{className:"".concat(xe,"-option-state"),customizeIcon:ue,customizeIconProps:{isSelected:xt}},xt?"\u2713":null))}))},i=N.forwardRef(d);i.displayName="OptionList";var a=i,r=function(){return null};r.isSelectOption=!0;var s=r,S=function(){return null};S.isSelectOptGroup=!0;var x=S,T=D("VTBJ"),A=D("Zm9Q");function w(R){var V=R.key,ne=R.props,se=ne.children,Se=ne.value,Le=Object(H.a)(ne,["children","value"]);return Object(T.a)({key:V,value:Se!==void 0?Se:V,children:se},Le)}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,Le=ne.key,Ae=ne.props,Pe=Ae.children,Fe=Object(H.a)(Ae,["children"]);return V||!Se?w(ne):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Le===null?se:Le,"__"),label:Le},Fe),{},{options:v(Pe)})}).filter(function(ne){return ne})}var E=D("2Qr1"),m=D("qNPg"),f=D("U8pU"),C=D("Kwbf"),b=D("WKfj");function y(R){var V=R.mode,ne=R.options,se=R.children,Se=R.backfill,Le=R.allowClear,Ae=R.placeholder,Pe=R.getInputElement,Fe=R.showSearch,je=R.onSearch,Te=R.defaultOpen,Z=R.autoFocus,U=R.labelInValue,G=R.value,ee=R.inputValue,ue=R.optionLabelProp,J=V==="multiple"||V==="tags",we=Fe!==void 0?Fe:J||V==="combobox",Ge=ne||v(se);if(Object(C.a)(V!=="tags"||Ge.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Je=Ge.some(function(xe){return xe.options?xe.options.some(function(Ce){return typeof("value"in Ce?Ce.value:Ce.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(C.a)(!Je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(V!=="combobox"||!ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(V==="combobox"||!Se,"`backfill` only works with `combobox` mode."),Object(C.a)(V==="combobox"||!Pe,"`getInputElement` only work with `combobox` mode."),Object(C.b)(V!=="combobox"||!Pe||!Le||!Ae,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),je&&!we&&V!=="combobox"&&V!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!Te||Z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),G!=null){var be=Object(b.d)(G);Object(C.a)(!U||be.every(function(xe){return Object(f.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!J||Array.isArray(G),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var Re=null;Object(A.a)(se).some(function(xe){if(!N.isValidElement(xe)||!xe.type)return!1;var Ce=xe.type;if(Ce.isSelectOption)return!1;if(Ce.isSelectOptGroup){var Be=Object(A.a)(xe.props.children).every(function(Xe){return!N.isValidElement(Xe)||!xe.type||Xe.type.isSelectOption?!0:(Re=Xe.type,!1)});return!Be}return Re=Ce,!0}),Re&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Re.displayName||Re.name||Re,"`.")),Object(C.a)(ee===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=y,W=Object(m.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:v,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:M,fillOptionsWithMissingValue:E.a}),L=function(R){Object(P.a)(ne,R);var V=Object(Y.a)(ne);function ne(){var se;return Object(q.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(W,Object.assign({ref:this.selectRef},this.props))}}]),ne}(N.Component);L.Option=s,L.OptGroup=x;var K=L,F=ge.c=K},M8RZ:function(We,ge,D){"use strict";D.d(ge,"a",function(){return n});var q=D("fWQN"),z=D("mtLc"),P=D("yKVA"),Y=D("879j"),N=D("q1tI"),O=D.n(N),H=D("i8i4"),k=D.n(H),n=function(I){Object(P.a)(p,I);var g=Object(Y.a)(p);function p(h){var c;Object(q.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(H.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(O.a.Component)},MFOe:function(We,ge,D){(function(q){var z=O(),P=H(),Y=k(),N=typeof window!="undefined"?window:q;We.exports={assign:z,create:P,trim:Y,bind:n,slice:I,each:g,map:p,pluck:h,isList:c,isFunction:o,isObject:d,Global:N};function O(){return Object.assign?Object.assign:function(a,r,s,S){for(var x=1;x<arguments.length;x++)g(Object(arguments[x]),function(T,A){a[A]=T});return a}}function H(){if(Object.create)return function(r,s,S,x){var T=I(arguments,1);return z.apply(this,[Object.create(r)].concat(T))};{function i(){}return function(r,s,S,x){var T=I(arguments,1);return i.prototype=r,z.apply(this,[new i].concat(T))}}}function k(){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(i,a){return function(){return a.apply(i,Array.prototype.slice.call(arguments,0))}}function I(i,a){return Array.prototype.slice.call(i,a||0)}function g(i,a){h(i,function(r,s){return a(r,s),!1})}function p(i,a){var r=c(i)?[]:{};return h(i,function(s,S){return r[S]=a(s,S),!1}),r}function h(i,a){if(c(i)){for(var r=0;r<i.length;r++)if(a(i[r],r))return i[r]}else for(var s in i)if(i.hasOwnProperty(s)&&a(i[s],s))return i[s]}function c(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function o(i){return i&&{}.toString.call(i)==="[object Function]"}function d(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,D("IyRk"))},MI8n:function(We,ge,D){"use strict";D.d(ge,"c",function(){return N}),D.d(ge,"b",function(){return n}),D.d(ge,"e",function(){return I}),D.d(ge,"a",function(){return g}),D.d(ge,"d",function(){return p}),D.d(ge,"f",function(){return h});var q=D("/cxE"),z=D("pmY6"),P=D("24hK"),Y=D("5Y4S"),N;(function(c){c.None=()=>z.a.None;function o(y){return(M,W=null,L)=>{let K=!1,F;return F=y(R=>K?void 0:(F?F.dispose():K=!0,M.call(W,R)),null,L),K&&F.dispose(),F}}c.once=o;function d(y,M){return x((W,L=null,K)=>y(F=>W.call(L,M(F)),null,K))}c.map=d;function i(y,M){return x((W,L=null,K)=>y(F=>{M(F),W.call(L,F)},null,K))}c.forEach=i;function a(y,M){return x((W,L=null,K)=>y(F=>M(F)&&W.call(L,F),null,K))}c.filter=a;function r(y){return y}c.signal=r;function s(...y){return(M,W=null,L)=>Object(z.e)(...y.map(K=>K(F=>M.call(W,F),null,L)))}c.any=s;function S(y,M,W){let L=W;return d(y,K=>(L=M(L,K),L))}c.reduce=S;function x(y){let M;const W=new n({onFirstListenerAdd(){M=y(W.fire,W)},onLastListenerRemove(){M.dispose()}});return W.event}function T(y,M,W=100,L=!1,K){let F,R,V,ne=0;const se=new n({leakWarningThreshold:K,onFirstListenerAdd(){F=y(Se=>{ne++,R=M(R,Se),L&&!V&&(se.fire(R),R=void 0),clearTimeout(V),V=setTimeout(()=>{const Le=R;R=void 0,V=void 0,(!L||ne>1)&&se.fire(Le),ne=0},W)})},onLastListenerRemove(){F.dispose()}});return se.event}c.debounce=T;function A(y,M=(W,L)=>W===L){let W=!0,L;return a(y,K=>{const F=W||!M(K,L);return W=!1,L=K,F})}c.latch=A;function w(y,M){return[c.filter(y,M),c.filter(y,W=>!M(W))]}c.split=w;function v(y,M=!1,W=[]){let L=W.slice(),K=y(V=>{L?L.push(V):R.fire(V)});const F=()=>{L&&L.forEach(V=>R.fire(V)),L=null},R=new n({onFirstListenerAdd(){K||(K=y(V=>R.fire(V)))},onFirstListenerDidAdd(){L&&(M?setTimeout(F):F())},onLastListenerRemove(){K&&K.dispose(),K=null}});return R.event}c.buffer=v;class E{constructor(y){this.event=y}map(y){return new E(d(this.event,y))}forEach(y){return new E(i(this.event,y))}filter(y){return new E(a(this.event,y))}reduce(y,M){return new E(S(this.event,y,M))}latch(){return new E(A(this.event))}debounce(y,M=100,W=!1,L){return new E(T(this.event,y,M,W,L))}on(y,M,W){return this.event(y,M,W)}once(y,M,W){return o(this.event)(y,M,W)}}function m(y){return new E(y)}c.chain=m;function f(y,M,W=L=>L){const L=(...V)=>R.fire(W(...V)),K=()=>y.on(M,L),F=()=>y.removeListener(M,L),R=new n({onFirstListenerAdd:K,onLastListenerRemove:F});return R.event}c.fromNodeEventEmitter=f;function C(y,M,W=L=>L){const L=(...V)=>R.fire(W(...V)),K=()=>y.addEventListener(M,L),F=()=>y.removeEventListener(M,L),R=new n({onFirstListenerAdd:K,onLastListenerRemove:F});return R.event}c.fromDOMEventEmitter=C;function b(y){return new Promise(M=>o(y)(M))}c.toPromise=b})(N||(N={}));class O{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${O._idPool++}`}start(c){this._stopWatch=new Y.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}}}O._idPool=0;let H=-1;class k{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=H;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(`
|
|
`),i=this._stacks.get(d)||0;if(this._stacks.set(d,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let a,r=0;for(const[s,S]of this._stacks)(!a||r<S)&&(a=s,r=S);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${r}):`),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=H>0?new k(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new O(this._options._profName):void 0}get event(){return this._event||(this._event=(c,o,d)=>{var i;this._listeners||(this._listeners=new P.a);const a=this._listeners.isEmpty();a&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=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=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),S=Object(z.i)(()=>{if(s&&s(),!this._disposed&&(r(),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 i of this._listeners)this._deliveryQueue.push([i,c]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,a]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,a):i[0].call(i[1],a)}catch(r){Object(q.f)(r)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,o,d,i,a;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(i=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||i===void 0||i.call(d),(a=this._leakageMon)===null||a===void 0||a.dispose())}}class I 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 I{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,i)=>c(a=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>o.call(d,a)):o.call(d,a)},void 0,i)}bufferEvents(c){const o=[];this.buffers.push(o);const d=c();return this.buffers.pop(),o.forEach(i=>i()),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(We,ge,D){"use strict";(function(q,z){D.d(ge,"b",function(){return d}),D.d(ge,"i",function(){return s}),D.d(ge,"f",function(){return S}),D.d(ge,"d",function(){return x}),D.d(ge,"g",function(){return T}),D.d(ge,"h",function(){return A}),D.d(ge,"c",function(){return w}),D.d(ge,"k",function(){return v}),D.d(ge,"j",function(){return E}),D.d(ge,"a",function(){return m}),D.d(ge,"e",function(){return b});var P;const Y="en";let N=!1,O=!1,H=!1,k=!1,n=!1,I=!1,g=!1,p,h=Y,c,o;const d=typeof self=="object"?self:typeof q=="object"?q:{};let i;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?i=d.vscode.process:typeof z!="undefined"&&(i=z);const a=typeof((P=i==null?void 0:i.versions)===null||P===void 0?void 0:P.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!a)o=navigator.userAgent,N=o.indexOf("Windows")>=0,O=o.indexOf("Macintosh")>=0,g=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,H=o.indexOf("Linux")>=0,I=!0,p=navigator.language,h=p;else if(typeof i=="object"){N=i.platform==="win32",O=i.platform==="darwin",H=i.platform==="linux",k=H&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,p=Y,h=Y;const y=i.env.VSCODE_NLS_CONFIG;if(y)try{const M=JSON.parse(y),W=M.availableLanguages["*"];p=M.locale,h=W||Y,c=M._translationsConfigFile}catch(M){}n=!0}else console.error("Unable to resolve platform.");let r=0;O?r=1:N?r=3:H&&(r=2);const s=N,S=O,x=H,T=n,A=I,w=g,v=o,E=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let W=[];d.addEventListener("message",K=>{if(K.data&&K.data.vscodeSetImmediateId)for(let F=0,R=W.length;F<R;F++){const V=W[F];if(V.id===K.data.vscodeSetImmediateId){W.splice(F,1),V.callback();return}}});let L=0;return K=>{const F=++L;W.push({id:F,callback:K}),d.postMessage({vscodeSetImmediateId:F},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const M=Promise.resolve();return W=>M.then(W)}(),m=O||g?2:N?1:3;let f=!0,C=!1;function b(){if(!C){C=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const M=new Uint16Array(y.buffer);f=M[0]===(2<<8)+1}return f}}).call(this,D("IyRk"),D("Q2Ig"))},MVJL:function(We,ge,D){We.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(We,ge,D){"use strict";D.d(ge,"C",function(){return q}),D.d(ge,"v",function(){return P}),D.d(ge,"s",function(){return Y}),D.d(ge,"t",function(){return N}),D.d(ge,"U",function(){return O}),D.d(ge,"J",function(){return H}),D.d(ge,"O",function(){return k}),D.d(ge,"p",function(){return n}),D.d(ge,"T",function(){return I}),D.d(ge,"q",function(){return g}),D.d(ge,"N",function(){return p}),D.d(ge,"M",function(){return h}),D.d(ge,"Q",function(){return c}),D.d(ge,"u",function(){return o}),D.d(ge,"x",function(){return d}),D.d(ge,"I",function(){return i}),D.d(ge,"f",function(){return a}),D.d(ge,"h",function(){return r}),D.d(ge,"g",function(){return s}),D.d(ge,"i",function(){return S}),D.d(ge,"G",function(){return x}),D.d(ge,"H",function(){return T}),D.d(ge,"r",function(){return A}),D.d(ge,"R",function(){return w}),D.d(ge,"d",function(){return v}),D.d(ge,"e",function(){return E}),D.d(ge,"E",function(){return m}),D.d(ge,"F",function(){return f}),D.d(ge,"j",function(){return C}),D.d(ge,"z",function(){return b}),D.d(ge,"K",function(){return M}),D.d(ge,"L",function(){return W}),D.d(ge,"m",function(){return K}),D.d(ge,"k",function(){return R}),D.d(ge,"A",function(){return ne}),D.d(ge,"a",function(){return se}),D.d(ge,"n",function(){return Se}),D.d(ge,"l",function(){return Le}),D.d(ge,"D",function(){return Ae}),D.d(ge,"B",function(){return Pe}),D.d(ge,"b",function(){return Fe}),D.d(ge,"S",function(){return je}),D.d(ge,"o",function(){return Te}),D.d(ge,"P",function(){return Z}),D.d(ge,"w",function(){return U}),D.d(ge,"c",function(){return G}),D.d(ge,"y",function(){return J});function q(be){return!be||typeof be!="string"?!0:be.trim().length===0}const z=/{(\d+)}/g;function P(be,...Re){return Re.length===0?be:be.replace(z,function(xe,Ce){const Be=parseInt(Ce,10);return isNaN(Be)||Be<0||Be>=Re.length?xe:Re[Be]})}function Y(be){return be.replace(/[<>&]/g,function(Re){switch(Re){case"<":return"<";case">":return">";case"&":return"&";default:return Re}})}function N(be){return be.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function O(be,Re=" "){const xe=H(be,Re);return k(xe,Re)}function H(be,Re){if(!be||!Re)return be;const xe=Re.length;if(xe===0||be.length===0)return be;let Ce=0;for(;be.indexOf(Re,Ce)===Ce;)Ce=Ce+xe;return be.substring(Ce)}function k(be,Re){if(!be||!Re)return be;const xe=Re.length,Ce=be.length;if(xe===0||Ce===0)return be;let Be=Ce,Xe=-1;for(;!(Xe=be.lastIndexOf(Re,Be-1),Xe===-1||Xe+xe!==Be);){if(Xe===0)return"";Be=Xe}return be.substring(0,Be)}function n(be){return be.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(be){return be.replace(/\*/g,"")}function g(be,Re,xe={}){if(!be)throw new Error("Cannot create regex from empty string");Re||(be=N(be)),xe.wholeWord&&(/\B/.test(be.charAt(0))||(be="\\b"+be),/\B/.test(be.charAt(be.length-1))||(be=be+"\\b"));let Ce="";return xe.global&&(Ce+="g"),xe.matchCase||(Ce+="i"),xe.multiline&&(Ce+="m"),xe.unicode&&(Ce+="u"),new RegExp(be,Ce)}function p(be){if(be.source==="^"||be.source==="^$"||be.source==="$"||be.source==="^\\s*$")return!1;const Re=be.exec("");return!!(Re&&be.lastIndex===0)}function h(be){return(be.global?"g":"")+(be.ignoreCase?"i":"")+(be.multiline?"m":"")+(be.unicode?"u":"")}function c(be){return be.split(/\r\n|\r|\n/)}function o(be){for(let Re=0,xe=be.length;Re<xe;Re++){const Ce=be.charCodeAt(Re);if(Ce!==32&&Ce!==9)return Re}return-1}function d(be,Re=0,xe=be.length){for(let Ce=Re;Ce<xe;Ce++){const Be=be.charCodeAt(Ce);if(Be!==32&&Be!==9)return be.substring(Re,Ce)}return be.substring(Re,xe)}function i(be,Re=be.length-1){for(let xe=Re;xe>=0;xe--){const Ce=be.charCodeAt(xe);if(Ce!==32&&Ce!==9)return xe}return-1}function a(be,Re){return be<Re?-1:be>Re?1:0}function r(be,Re,xe=0,Ce=be.length,Be=0,Xe=Re.length){for(;xe<Ce&&Be<Xe;xe++,Be++){let ht=be.charCodeAt(xe),ft=Re.charCodeAt(Be);if(ht<ft)return-1;if(ht>ft)return 1}const qe=Ce-xe,tt=Xe-Be;return qe<tt?-1:qe>tt?1:0}function s(be,Re){return S(be,Re,0,be.length,0,Re.length)}function S(be,Re,xe=0,Ce=be.length,Be=0,Xe=Re.length){for(;xe<Ce&&Be<Xe;xe++,Be++){let ht=be.charCodeAt(xe),ft=Re.charCodeAt(Be);if(ht===ft)continue;if(ht>=128||ft>=128)return r(be.toLowerCase(),Re.toLowerCase(),xe,Ce,Be,Xe);x(ht)&&(ht-=32),x(ft)&&(ft-=32);const Ne=ht-ft;if(Ne===0)continue;return Ne}const qe=Ce-xe,tt=Xe-Be;return qe<tt?-1:qe>tt?1:0}function x(be){return be>=97&&be<=122}function T(be){return be>=65&&be<=90}function A(be,Re){return be.length===Re.length&&S(be,Re)===0}function w(be,Re){const xe=Re.length;return Re.length>be.length?!1:S(be,Re,0,xe)===0}function v(be,Re){let xe,Ce=Math.min(be.length,Re.length);for(xe=0;xe<Ce;xe++)if(be.charCodeAt(xe)!==Re.charCodeAt(xe))return xe;return Ce}function E(be,Re){let xe,Ce=Math.min(be.length,Re.length);const Be=be.length-1,Xe=Re.length-1;for(xe=0;xe<Ce;xe++)if(be.charCodeAt(Be-xe)!==Re.charCodeAt(Xe-xe))return xe;return Ce}function m(be){return 55296<=be&&be<=56319}function f(be){return 56320<=be&&be<=57343}function C(be,Re){return(be-55296<<10)+(Re-56320)+65536}function b(be,Re,xe){const Ce=be.charCodeAt(xe);if(m(Ce)&&xe+1<Re){const Be=be.charCodeAt(xe+1);if(f(Be))return C(Ce,Be)}return Ce}function y(be,Re){const xe=be.charCodeAt(Re-1);if(f(xe)&&Re>1){const Ce=be.charCodeAt(Re-2);if(m(Ce))return C(Ce,xe)}return xe}function M(be,Re){const xe=ee.getInstance(),Ce=Re,Be=be.length,Xe=b(be,Be,Re);Re+=Xe>=65536?2:1;let qe=xe.getGraphemeBreakType(Xe);for(;Re<Be;){const tt=b(be,Be,Re),ht=xe.getGraphemeBreakType(tt);if(G(qe,ht))break;Re+=tt>=65536?2:1,qe=ht}return Re-Ce}function W(be,Re){const xe=ee.getInstance(),Ce=Re,Be=y(be,Re);Re-=Be>=65536?2:1;let Xe=xe.getGraphemeBreakType(Be);for(;Re>0;){const qe=y(be,Re),tt=xe.getGraphemeBreakType(qe);if(G(tt,Xe))break;Re-=qe>=65536?2:1,Xe=tt}return Ce-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 K(be){return L.test(be)}const F=/(?:[\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(be){return F.test(be)}const V=/^[\t\n\r\x20-\x7E]*$/;function ne(be){return V.test(be)}const se=/[\u2028\u2029]/;function Se(be){return se.test(be)}function Le(be){for(let Re=0,xe=be.length;Re<xe;Re++)if(Ae(be.charCodeAt(Re)))return!0;return!1}function Ae(be){return be=+be,be>=11904&&be<=55215||be>=63744&&be<=64255||be>=65281&&be<=65374}function Pe(be){return be>=127462&&be<=127487||be===8986||be===8987||be===9200||be===9203||be>=9728&&be<=10175||be===11088||be===11093||be>=127744&&be<=128591||be>=128640&&be<=128764||be>=128992&&be<=129003||be>=129280&&be<=129535||be>=129648&&be<=129750}const Fe=String.fromCharCode(65279);function je(be){return!!(be&&be.length>0&&be.charCodeAt(0)===65279)}function Te(be,Re=!1){return be?(Re&&(be=be.replace(/\\./g,"")),be.toLowerCase()!==be):!1}function Z(be){const Re=90-65+1;return be=be%(2*Re),be<Re?String.fromCharCode(97+be):String.fromCharCode(65+be-Re)}function U(be){const Re=ee.getInstance();return Re.getGraphemeBreakType(be)}function G(be,Re){return be===0?Re!==5&&Re!==7:be===2&&Re===3?!1:be===4||be===2||be===3||(Re===4||Re===2||Re===3)?!0:be===8&&(Re===8||Re===9||Re===11||Re===12)||((be===11||be===9)&&(Re===9||Re===10)||((be===12||be===10)&&Re===10||(Re===5||Re===13||(Re===7||(be===1||be===13&&Re===14)))))?!1:!(be===6&&Re===6)}class ee{constructor(){this._data=ue()}static getInstance(){return ee._INSTANCE||(ee._INSTANCE=new ee),ee._INSTANCE}getGraphemeBreakType(be){if(be<32)return be===10?3:be===13?2:4;if(be<127)return 0;const Re=this._data,xe=Re.length/3;let Ce=1;for(;Ce<=xe;)if(be<Re[3*Ce])Ce=2*Ce;else if(be>Re[3*Ce+1])Ce=2*Ce+1;else return Re[3*Ce+2];return 0}}ee._INSTANCE=null;function ue(){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 J(be,Re){if(be===0)return 0;const xe=we(be,Re);if(xe!==void 0)return xe;const Ce=y(Re,be);return be-=Ge(Ce),be}function we(be,Re){let xe=y(Re,be);for(be-=Ge(xe);Je(xe)||xe===65039||xe===8419;){if(be===0)return;xe=y(Re,be),be-=Ge(xe)}if(!Pe(xe))return;if(be>=0){const Ce=y(Re,be);Ce===8205&&(be-=Ge(Ce))}return be}function Ge(be){return be>=65536?2:1}function Je(be){return 127995<=be&&be<=127999}},NvD2:function(We,ge,D){"use strict";D.d(ge,"a",function(){return O});var q=D("Kwbf");function z(H,k){var n=new Set;return H.forEach(function(I){k.has(I)||n.add(I)}),n}function P(H){var k=H||{},n=k.disabled,I=k.disableCheckbox,g=k.checkable;return!!(n||I)||g===!1}function Y(H,k,n,I){for(var g=new Set(H),p=new Set,h=0;h<=n;h+=1){var c=k.get(h)||new Set;c.forEach(function(a){var r=a.key,s=a.node,S=a.children,x=S===void 0?[]:S;g.has(r)&&!I(s)&&x.filter(function(T){return!I(T.node)}).forEach(function(T){g.add(T.key)})})}for(var o=new Set,d=n;d>=0;d-=1){var i=k.get(d)||new Set;i.forEach(function(a){var r=a.parent,s=a.node;if(I(s)||!a.parent||o.has(a.parent.key))return;if(I(a.parent.node)){o.add(r.key);return}var S=!0,x=!1;(r.children||[]).filter(function(T){return!I(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(r.key),x&&p.add(r.key),o.add(r.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(z(p,g))}}function N(H,k,n,I,g){for(var p=new Set(H),h=new Set(k),c=0;c<=I;c+=1){var o=n.get(c)||new Set;o.forEach(function(r){var s=r.key,S=r.node,x=r.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,i=I;i>=0;i-=1){var a=n.get(i)||new Set;a.forEach(function(r){var s=r.parent,S=r.node;if(g(S)||!r.parent||d.has(r.parent.key))return;if(g(r.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 O(H,k,n,I){var g=[],p;I?p=I:p=P;var h=new Set(H.filter(function(i){var a=!!n[i];return a||g.push(i),a})),c=new Map,o=0;Object.keys(n).forEach(function(i){var a=n[i],r=a.level,s=c.get(r);s||(s=new Set,c.set(r,s)),s.add(a),o=Math.max(o,r)}),Object(q.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var d;return k===!0?d=Y(h,c,o,p):d=N(h,k.halfCheckedKeys,c,o,p),d}},OZM5:function(We,ge,D){"use strict";D.d(ge,"b",function(){return I}),D.d(ge,"a",function(){return g}),D.d(ge,"k",function(){return p}),D.d(ge,"h",function(){return h}),D.d(ge,"i",function(){return c}),D.d(ge,"g",function(){return o}),D.d(ge,"c",function(){return d}),D.d(ge,"d",function(){return i}),D.d(ge,"j",function(){return s}),D.d(ge,"e",function(){return S}),D.d(ge,"f",function(){return x});var q=D("KQm4"),z=D("U8pU"),P=D("Ff2n"),Y=D("q1tI"),N=D.n(Y),O=D("Kwbf"),H=D("WaYH"),k=.25,n=2;function I(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 E(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach(function(f){var C=f.key,b=f.children;w.push(C),E(b)})}return E(v.children),w}function d(T,A){var w=T.clientY,v=A.selectHandle.getBoundingClientRect(),E=v.top,m=v.bottom,f=v.height,C=Math.max(f*k,n);return w<=E+C?-1:w>=m-C?1:0}function i(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 r(T,A){if(!T)return[];var w=A||{},v=w.processProps,E=v===void 0?a:v,m=Array.isArray(T)?T:[T];return m.map(function(f){var C=f.children,b=Object(P.a)(f,["children"]),y=r(C,A);return N.a.createElement(H.a,Object.assign({},E(b)),y)})}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(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function S(T,A){var w=new Set;function v(E){if(w.has(E))return;var m=A[E];if(!m)return;w.add(E);var f=m.parent,C=m.node;if(C.disabled)return;f&&v(f.key)}return(T||[]).forEach(function(E){v(E)}),Object(q.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(We,ge,D){},Ot1p:function(We,ge,D){"use strict";var q=D("2qtc"),z=D("kLXV"),P=D("rAM+"),Y=D("miYZ"),N=D("tsqr"),O=D("9og8"),H=D("tJVT"),k=D("jrin"),n=D("WmNS"),I=D.n(n),g=D("q1tI"),p=D.n(g),h=D("VrN/"),c=D.n(h),o=D("bdgK"),d=D("p77/"),i=D("Bd2K"),a=D("ELLl"),r=D("19Vz"),s=D("lZu9"),S=D("+NIl"),x=D("kSUc"),T=D("9Bee"),A=function(Oe){var ke=Oe.value,$e=ke===void 0?"":ke,ot=Oe.className,pt=Oe.showTextOnly,mt=Oe.showLines,qt=Oe.style,xt=qt===void 0?{}:qt,Ct=Object(g.useMemo)(function(){return""},[$e]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ct}}))},w=D("0Owb"),v=D("dejd"),E=D("C+DQ"),m=D("1vsH"),f=D("m3rI"),C=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function b(Oe){var ke=Oe.onActionCallback,$e=Oe.title,ot=Oe.icon,pt=Oe.actionName,mt=Oe.className,qt=mt===void 0?"":mt,xt=Oe.children;function Ct(){ke(pt)}return p.a.createElement("a",{title:$e,className:qt,onClick:Ct},p.a.createElement("i",{className:"md-iconfont ".concat(ot)}),xt)}var y=function(Oe){var ke=Oe.watch,$e=Oe.showNullButton,ot=Oe.onActionCallback,pt=Oe.fullScreen,mt=Oe.insertTemp,qt=Oe.hidetoolBar,xt=Oe.uuid,Ct=Oe.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(xt,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Pt=[].concat(C,[{title:"".concat(ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!qt&&Pt.map(function(Rt,Gt){return p.a.createElement("li",{key:Gt},Rt.actionName?p.a.createElement(b,Object(w.a)({},Rt,{onActionCallback:ot})):p.a.createElement("span",{className:"v-line"}))}),$e?p.a.createElement("li",null,p.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,mt&&p.a.createElement("li",null,p.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(mt),onActionCallback:ot},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(b,{icon:"".concat(pt?"icon-shrink":"icon-enlarge"),title:pt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},M=D("M8RZ"),W=D("+L6B"),L=D("2/Rp"),K=D("y8nQ"),F=D("Vl3Y"),R=D("5NDa"),V=D("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},se=function(Oe){var ke=Oe.callback,$e=Oe.onCancel;function ot(pt){ke(pt)}return p.a.createElement(F.a,Object(w.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),p.a.createElement(F.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(F.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:$e},"\u53D6\u6D88")))},Se=D("7ahc"),Le=D("HmJG"),Ae=D("BjJ7"),Pe=F.a.useForm,Fe={width:280,marginRight:10},je={labelCol:{span:5},wrapperCol:{span:19}},Te=function(Oe){var ke=Oe.callback,$e=Oe.onCancel,ot=Pe(),pt=Object(H.a)(ot,1),mt=pt[0];function qt(Pt){ke(Pt)}function xt(Pt,Rt){if(Pt.status===-1){N.b.error(Pt.message);return}mt.setFieldsValue({src:"/api/attachments/".concat(Pt.id),type:Rt.type})}function Ct(Pt){var Rt=Pt.target.files[0];U(Rt,xt)}return p.a.createElement(F.a,Object(w.a)({form:mt},je,{className:"upload-image-panel",onFinish:qt}),p.a.createElement(F.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(F.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(V.a,{style:Fe})),p.a.createElement(Z,{onFileChange:Ct}))),p.a.createElement(F.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(V.a,{style:{width:264}})),p.a.createElement(F.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:$e},"\u53D6\u6D88")))};function Z(Oe){var ke=Oe.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:ke}))}function U(Oe,ke){if(!Oe)throw new String("\u6CA1\u6709\u6587\u4EF6");var $e=new FormData;$e.append("editormd-image-file",Oe),$e.append("file_param_name","editormd-image-file"),$e.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(pt){ke(JSON.parse(pt.target.responseText),Oe)},!1),ot.addEventListener("error",function(pt){console.error(pt)},!1),ot.open("POST","".concat(Ae.a,"/api/attachments.json")),ot.send($e)}var G=D("giR+"),ee=D("fyUT"),ue=D("7Kak"),J=D("9yH6"),we=J.a.Group,Ge={margin:"0 8px"},Je=function(Oe){var ke=Oe.callback,$e=Oe.onCancel;function ot(pt){ke(pt)}return p.a.createElement(F.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Ge},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Ge},"\u884C\u6570"),p.a.createElement(F.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(ee.a,null)),p.a.createElement("span",{style:Ge},"\u5217\u6570"),p.a.createElement(F.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:Ge},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(F.a.Item,{name:"align"},p.a.createElement(we,null,p.a.createElement(J.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(J.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(J.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(J.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:$e},"\u53D6\u6D88")))},be=D("ErOA"),Re=D("7Cbv"),xe="link",Ce="upload-image",Be="code-block",Xe="add-table",qe="------------",tt={default:qe,left:":".concat(qe),center:":".concat(qe,":"),right:"".concat(qe,":")},ht=D("9VGf"),ft,Ne;function Ue(){}var Ze=0,et=1e4,fe="\u2581",re=`
|
|
**\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 ie(Oe){return/^\d+$/.test(Oe)?"".concat(Oe,"px"):Oe}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=ce?"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=(ft={},Object(k.a)(ft,pe+"-B","bold"),Object(k.a)(ft,pe+"-I","italic"),ft),ye=(Ne={},Object(k.a)(Ne,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(k.a)(Ne,Be,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(k.a)(Ne,Ce,"\u6DFB\u52A0\u6587\u4EF6"),Object(k.a)(Ne,Xe,"\u6DFB\u52A0\u8868\u683C"),Ne),_e=ge.a=function(Oe){var ke=Oe.defaultValue,$e=ke===void 0?"":ke,ot=Oe.onChange,pt=Oe.width,mt=pt===void 0?"100%":pt,qt=Oe.height,xt=qt===void 0?400:qt,Ct=Oe.miniToolbar,Pt=Ct===void 0?!1:Ct,Rt=Oe.isFocus,Gt=Rt===void 0?!1:Rt,On=Oe.watch,kt=Oe.insertTemp,Un=Oe.mode,An=Un===void 0?"markdown":Un,en=Oe.id,wn=en===void 0?"markdown-editor-id":en,Wt=Oe.showResizeBar,At=Wt===void 0?!1:Wt,Zt=Oe.noStorage,Ee=Zt===void 0?!1:Zt,de=Oe.showNullButton,j=de===void 0?!1:de,X=Oe.hidetoolBar,$=X===void 0?!1:X,te=Oe.fullScreen,ve=te===void 0?!1:te,Ie=Oe.onBlur,He=Oe.onCMBeforeChange,ct=Oe.onFullScreen,ut=Oe.className,ze=ut===void 0?"":ut,gt=Oe.disablePaste,Kt=gt===void 0?!1:gt,dt=Oe.placeholder,sn=dt===void 0?"":dt,jt=Oe.values,St=jt===void 0?"":jt,at=Object(g.useState)(null),xn=Object(H.a)(at,2),it=xn[0],ln=xn[1],cn=Object(g.useState)($e),Yn=Object(H.a)(cn,2),nr=Yn[0],vn=Yn[1],gr=Object(g.useState)(On),Jn=Object(H.a)(gr,2),Cn=Jn[0],Dn=Jn[1],Dr=Object(g.useState)(ve),Hr=Object(H.a)(Dr,2),vr=Hr[0],rr=Hr[1],yr=Object(g.useState)(""),Qr=Object(H.a)(yr,2),_r=Qr[0],ir=Qr[1],Pr=Object(g.useState)(0),Lr=Object(H.a)(Pr,2),Or=Lr[0],Sr=Lr[1],ci=Object(g.useState)(xt),yi=Object(H.a)(ci,2),ii=yi[0],Zr=yi[1],Ai=Object(g.useState)(!1),Ni=Object(H.a)(Ai,2),Ui=Ni[0],ai=Ni[1],pr=Object(g.useRef)(Object(Re.a)()),cr=Object(g.useRef)(!1),Yr=Object(g.useRef)(),qr=Object(g.useRef)(),si=Object(g.useRef)(),ei=Object(g.useRef)(),zi=Object(g.useRef)(),ea=function(){var Jt=Object(O.a)(I.a.mark(function pn(){var nn,Ln;return I.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(be.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:pr.current}});case 2:Ln=zt.sent,Ln!=null&&(nn=Ln.attachments)!==null&&nn!==void 0&&nn.length&&(console.log("cm:",it,qr),Ln.attachments.map(function(In){In.content_type.indexOf("image")>-1?it.replaceSelection(".concat(In.content_type,")")):In.content_type.indexOf("video")>-1?it.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):In.content_type.indexOf("pdf")>-1?it.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(In.id,"?type=").concat(In.content_type,'&disposition=inline" target="_blank">').concat(In.name,"</a>")):it.replaceSelection("[".concat(In.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(In.id,"?type=").concat(In.content_type,")"))}));case 4:case"end":return zt.stop()}},pn)}));return function(){return Jt.apply(this,arguments)}}();Object(g.useEffect)(function(){vn(St),it==null||it.setValue(St)},[St]),Object(g.useEffect)(function(){ct==null||ct(vr)},[vr]),Object(g.useEffect)(function(){if(qr.current){var Jt=c.a.fromTextArea(qr.current,{mode:An,lineNumbers:!Pt,lineWrapping:!0,value:$e,autoCloseTags:!0,autoCloseBrackets:!0});Gt&&Jt.focus();function pn(nn,Ln){if(Kt){Ln.preventDefault();return}var Hn=Ln.clipboardData;if(Hn){var zt=Hn.types.toString(),In=Hn.items;if(zt==="Files"||Hn.types.indexOf("Files")>-1){if(Ln.preventDefault(),An=="stex")return;try{var br,Fr=In[1];((br=In[0])===null||br===void 0?void 0:br.kind)==="file"&&(Fr=In[0]);var Fn=Fr.getAsFile(),fi=Fn.name.split(".").pop();U(Fn,function(Qn){if(Qn.id){var Ve,rt,Et;(Fn==null||((Ve=Fn.type)===null||Ve===void 0)?void 0:Ve.indexOf("image"))>-1?Jt.replaceSelection(".concat(Qn.content_type,")")):(Fn==null||((rt=Fn.type)===null||rt===void 0)?void 0:rt.indexOf("video"))>-1?Jt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'"></video>')):(Fn==null||((Et=Fn.type)===null||Et===void 0)?void 0:Et.indexOf("pdf"))>-1?Jt.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(fi)?Jt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'?type=office&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):Jt.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 Jt.on("paste",pn),Jt.on("dragleave",function(nn,Ln){si.current.classList.remove("mouse-hover-md")}),Jt.on("dragover",function(nn,Ln){si.current.classList.add("mouse-hover-md")}),Jt.on("drop",function(nn,Ln){si.current.classList.add("mouse-hover-md");var Hn;if(Hn=Ln.dataTransfer.files,Hn.length>0){Ln.preventDefault(),Ln.stopPropagation();for(var zt=function(Fr){var Fn=Hn[Fr],fi=Fn.name.split(".").pop();U(Fn,function(Qn){if(Qn.id){var Ve,rt,Et;(Fn==null||((Ve=Fn.type)===null||Ve===void 0)?void 0:Ve.indexOf("image"))>-1?Jt.replaceSelection(".concat(Qn.content_type,")")):(Fn==null||((rt=Fn.type)===null||rt===void 0)?void 0:rt.indexOf("video"))>-1?Jt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'"></video>')):(Fn==null||((Et=Fn.type)===null||Et===void 0)?void 0:Et.indexOf("pdf"))>-1?Jt.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(fi)?Jt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Qn.id,'?type=office&disposition=inline" target="_blank">').concat(Fn.name,"</a>")):Jt.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")})},In=0;In<Hn.length;In++)zt(In)}}),ln(Jt),function(){Jt.off("paste",pn)}}},[]);var ti=Object(g.useCallback)(function(){if(si.current)try{}catch(Jt){console.log(Jt,"---- to set md editor body height")}},[ii,si,vr]);Object(g.useEffect)(function(){function Jt(){var nn=new o.default(function(Ln){var Hn=Object(P.a)(Ln),zt;try{for(Hn.s();!(zt=Hn.n()).done;){var In=zt.value;(In.target.offsetHeight>0||In.target.offsetWidth>0)&&(ti(),it.setSize("100%","100%"),it.refresh())}}catch(br){Hn.e(br)}finally{Hn.f()}});return nn.observe(qr.current.parentElement),nn}if(it){var pn=Jt();return function(){pn.unobserve(qr.current.parentElement)}}},[it,ti]),Object(g.useEffect)(function(){if(it){for(var Jt=[],pn=function(){var In=Ln[nn];Hn=Object(H.a)(In,2);var br=Hn[0],Fr=Hn[1],Fn=Object(k.a)({},br,function(){di(Fr)});Jt.push(Fn),it.addKeyMap(Fn)},nn=0,Ln=Object.entries(he);nn<Ln.length;nn++){var Hn;pn()}return Yr.current=setInterval(function(){cr.current&&ea()},4e3),function(){clearInterval(Yr.current);var zt=Object(P.a)(Jt),In;try{for(zt.s();!(In=zt.n()).done;){var br=In.value;it.removeKeyMap(br)}}catch(Fr){zt.e(Fr)}finally{zt.f()}}}},[it]),Object(g.useEffect)(function(){ve!==vr&&rr(ve)},[ve]),Object(ht.a)(function(){if(!Ee&&Or>0){var Jt=new Date().getTime(),pn=window.sessionStorage.getItem(wn);Jt>=Or+et&&(!pn||pn!==nr)&&(window.sessionStorage.setItem(wn,nr),ai(!0))}},et),Object(g.useEffect)(function(){Dn(On)},[it,On]),Object(g.useEffect)(function(){it&&(Gt&&it.focus())},[it,Gt]),Object(g.useEffect)(function(){if(Cn&&it){var Jt=it.getScrollerElement();function pn(nn){var Ln=nn.target;if(zi.current){var Hn=Ln.scrollTop/Ln.scrollHeight;zi.current.scrollTop=zi.current.scrollHeight*Hn}}return Jt.addEventListener("scroll",pn),function(){Jt.removeEventListener("scroll",pn)}}},[it,Cn]),Object(g.useEffect)(function(){if(it&&He){function Jt(pn,nn){He(pn,nn)}return it.on("beforeChange",Jt),function(){it.off("beforeChange",Jt)}}},[it,He]),Object(g.useEffect)(function(){if(it&&Ie){function Jt(){Ie(it.getValue())}return it.on("blur",Jt),function(){it.off("blur",Jt)}}},[it,Ie]),Object(g.useEffect)(function(){if(it){function Jt(pn){var nn=pn.getValue();vn(nn),Sr(new Date().getTime()),pn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(nn)}return it.on("change",Jt),function(){it.off("change",Jt)}}},[it,ot]),Object(g.useEffect)(function(){it&&($e==null?(it.setValue(""),vn("")):$e!==it.getValue()&&(it.setValue($e),vn($e),it.setCursor(it.lineCount(),0)))},[it,$e]);var di=Object(g.useCallback)(function(Jt){var pn=it.getCursor(),nn=it.getSelection(),Ln=nn.split(`
|
|
`);switch(Jt){case"bold":return it.replaceSelection("**"+nn+"**"),nn===""&&it.setCursor(pn.line,pn.ch+2),it.focus();case"italic":return it.replaceSelection("*"+nn+"*"),nn===""&&it.setCursor(pn.line,pn.ch+1),it.focus();case"code":return it.replaceSelection("`"+nn+"`"),nn===""&&it.setCursor(pn.line,pn.ch+1),it.focus();case"inline-latex":return it.replaceSelection("`$$"+nn+"$$`"),nn===""&&it.setCursor(pn.line,pn.ch+3),it.focus();case"latex":return it.replaceSelection("```latex\n"+nn+"\n```"),it.setCursor(pn.line+1,nn.length+1),it.focus();case"line-break":return it.replaceSelection(`<br/>
|
|
`),it.focus();case"list-ul":return nn===""?it.replaceSelection("- "+nn):it.replaceSelection(Ln.map(function(Hn){return Hn===""?"":"- ".concat(Hn)}).join(`
|
|
`)),it.focus();case"list-ol":return nn===""?it.replaceSelection("1. "+nn):it.replaceSelection(Ln.map(function(Hn,zt){return Hn===""?"":"".concat(zt+1,". ").concat(Hn)}).join(`
|
|
`)),it.focus();case"add-null-ch":return nn===""&&it.setCursor(pn.line,pn.ch+1),it.replaceSelection(fe),it.focus();case"inster-template-1":return nn===""&&it.setCursor(pn.line,pn.ch),it.replaceSelection(re),it.focus();case"eraser":return it.setValue(""),it.focus();case"trigger-watch":return Dn(!Cn),it.focus();case"trigger-full-screen":return rr(!vr),it.focus();case xe:ir(xe);return;case Be:ir(Be);return;case Ce:ir(Ce);return;case Xe:ir(Xe);return;default:throw new Error}},[it,Cn,vr]),Li=Object(g.useCallback)(function(Jt){ir("");switch(_r){case xe:var pn=Jt.title,nn=Jt.link;return it.replaceSelection("[".concat(pn,"](").concat(nn,")")),it.focus();case Be:var Ln=Jt.language,Hn=Jt.content;return it.replaceSelection(["```"+Ln,Hn,"```"].join(`
|
|
`)),it.focus();case Ce:var zt=Jt.src,In=Jt.alt;return In?it.replaceSelection(".concat(zt,' "').concat(In,'" )')):it.replaceSelection("")),it.focus();case Xe:for(var br=Jt.row,Fr=Jt.col,Fn=Jt.align,fi=`
|
|
`,Qn=0;Qn<br;Qn++){for(var Ve=[],rt=[],Et=0;Et<Fr;Et++)Qn===1&&rt.push(tt[Fn]),Ve.push(" ");Qn===1&&(fi+="| ".concat(rt.join(" | "),` |
|
|
`)),fi+="| ".concat(Ve.join(Fr===1?"":" | "),` |
|
|
`)}return it.replaceSelection(fi+`
|
|
`),it.focus();default:throw new Error}},[it,_r]),Bi=Object(g.useMemo)(function(){switch(_r){case xe:return p.a.createElement(se,{callback:Li,onCancel:Ii});case Be:return p.a.createElement(Se.b,{callback:Li,onCancel:Ii});case Ce:return p.a.createElement(Te,{callback:Li,onCancel:Ii});case Xe:return p.a.createElement(Je,{callback:Li,onCancel:Ii});default:return null}},[_r]);function Ii(){ir("")}Object(g.useEffect)(function(){if(ei.current){var Jt=ei.current,pn=!1,nn=0;function Ln(In){pn=!0,nn=In.pageY}function Hn(){pn=!1}function zt(In){if(pn){var br=In.pageY-nn;br<0&&(br=0),br>300&&(br=300);var Fr=xt+br+"px";Zr(Fr)}}return Jt.addEventListener("mousedown",Ln),document.addEventListener("mousemove",zt),document.addEventListener("mouseup",Hn),function(){Jt.removeEventListener("mousedown",Ln),document.removeEventListener("mousemove",zt),document.removeEventListener("mouseup",Hn)}}},[it,ei]),Object(g.useEffect)(function(){Zr(xt)},[xt]);var bi=ie(mt),Vi=ie(ii),hi={width:bi,height:Vi},Xi=Object(g.useMemo)(function(){if(Or){var Jt=new Date(Or),pn=Jt.getHours(),nn=Jt.getMinutes(),Ln=Jt.getSeconds();return pn=pn<10?"0"+pn:pn,nn=nn<10?"0"+nn:nn,Ln=Ln<10?"0"+Ln:Ln,"".concat(pn,":").concat(nn,":").concat(Ln)}return 0},[Or]);function Yi(){window.sessionStorage.removeItem(wn),ai(!1),Sr(0)}function oi(){ai(!1),Sr(0),it.setValue(window.sessionStorage.getItem(wn))}function Ji(Jt,pn){var nn=it.getValue();nn=nn.replace(Jt,pn),vn(nn),it==null||it.setValue(nn)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:si},p.a.createElement("div",{className:"markdown-editor-container ".concat(ze," ").concat(Cn?"on-preview":""," ").concat(Pt?"mini":""," ").concat(vr?"full-screen":""),style:hi},p.a.createElement(y,{insertTemp:kt,watch:Cn,fullScreen:vr,showNullButton:j,onActionCallback:di,hidetoolBar:$,uuid:pr.current,setOpenPhones:function(){cr.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:qr,placeholder:sn})),Cn?p.a.createElement("div",{ref:zi,className:"preview-container"},An==="stex"&&p.a.createElement(A,{value:nr}),An!=="stex"&&p.a.createElement(T.a,{edit:!0,value:nr,replaces:Ji})):null))),At?p.a.createElement("a",{ref:ei,className:"editor-resize"}):null,p.a.createElement(M.a,null,ye[_r]?p.a.createElement(z.a,{centered:!0,title:ye[_r],visible:!0,onCancel:Ii,footer:null,className:"markdown-popup-form"},Bi):null))}},P5Jw:function(We,ge,D){"use strict";var q=D("rHrb"),z=q.CopyToClipboard;z.CopyToClipboard=z,We.exports=z},PD8m:function(We,ge){We.exports={name:"memoryStorage",read:q,write:z,each:P,remove:Y,clearAll:N};var D={};function q(O){return D[O]}function z(O,H){D[O]=H}function P(O){for(var H in D)D.hasOwnProperty(H)&&O(D[H],H)}function Y(O){delete D[O]}function N(O){D={}}},RELg:function(We,ge,D){var q=D("MFOe"),z=q.Global;We.exports={name:"oldIE-userDataStorage",write:H,read:k,each:n,remove:I,clearAll:g};var P="storejs",Y=z.document,N=c(),O=(z.navigator?z.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function H(o,d){if(O)return;var i=h(o);N(function(a){a.setAttribute(i,d),a.save(P)})}function k(o){if(O)return;var d=h(o),i=null;return N(function(a){i=a.getAttribute(d)}),i}function n(o){N(function(d){for(var i=d.XMLDocument.documentElement.attributes,a=i.length-1;a>=0;a--){var r=i[a];o(d.getAttribute(r.name),r.name)}})}function I(o){var d=h(o);N(function(i){i.removeAttribute(d),i.save(P)})}function g(){N(function(o){var d=o.XMLDocument.documentElement.attributes;o.load(P);for(var i=d.length-1;i>=0;i--)o.removeAttribute(d[i].name);o.save(P)})}var p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function h(o){return o.replace(/^\d/,"___$&").replace(p,"___")}function c(){if(!Y||!Y.documentElement||!Y.documentElement.addBehavior)return null;var o="script",d,i,a;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+o+">document.w=window</"+o+'><iframe src="/favicon.ico"></iframe>'),i.close(),d=i.w.frames[0].document,a=d.createElement("div")}catch(r){a=Y.createElement("div"),d=Y.body}return function(r){var s=[].slice.call(arguments,0);s.unshift(a),d.appendChild(a),a.addBehavior("#default#userData"),a.load(P),r.apply(this,s),d.removeChild(a);return}}},RpDr:function(We,ge,D){"use strict";D.d(ge,"a",function(){return T}),D.d(ge,"c",function(){return v});var q=D("+L6B"),z=D("2/Rp"),P=D("tJVT"),Y=D("k1fw"),N=D("jrin"),O=D("5NDa"),H=D("5rEg"),k=D("q1tI"),n=D.n(k),I=D("8Skl"),g=D("y3Kf"),p=D("bdLU"),h=D("J66h"),c=D.n(h),o=D("++UQ"),d=D.n(o),i=D("IxHN"),a=D("9Bee"),r=D("1vsH"),s,S=H.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(Y.a)(Object(Y.a)({},m),{},{visible:f.payload});case A.SET_TABINDEX:return Object(Y.a)(Object(Y.a)({},m),{},{tabIndex:f.payload});default:throw new Error}}function v(m){var f=m.status,C=m.error_msg,b=m.output,y=m.input,M=m.expected_output,W=m.is_file,L=m.input_file_url,K=m.output_file_url,F=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"),!W&&n.a.createElement(a.a,{value:y,style:V}),W&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(r.y)(L,y)}},y)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!W&&n.a.createElement(a.a,{value:b&&h.Base64.decode(b)||"",style:V}),W&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(r.y)(K,b)}},b)),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!W&&n.a.createElement(a.a,{value:M&&h.Base64.decode(M)||"",style:V}),W&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(r.y)(F,M)}},M)));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"),!W&&n.a.createElement(a.a,{value:y,style:V}),W&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(r.y)(L,y)}},y)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(C)));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"),!W&&n.a.createElement(a.a,{value:y,style:V}),W&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(r.y)(L,y)}},y)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(C)));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 E(m){var f=m.status,C=m.error_msg,b=m.execute_time,y=m.output,M=m.input,W=m.expected_output,L=m.is_file,K=m.input_file_url,F=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",b),n.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),n.a.createElement("pre",null,h.Base64.decode(y)));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,M)),n.a.createElement("p",null,"\u8F93\u51FA\uFF1A",y&&h.Base64.decode(y)),n.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",W&&h.Base64.decode(W)));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,M)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(C)));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,M)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},h.Base64.decode(C)));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," ")}ge.b=function(m){var f=m.id,C=m.input,b=m.debuging,y=m.submitting,M=m.executingMessage,W=m.debugResult,L=m.onChangeInput,K=m.onDebugCode,F=m.onSubmitCode,R=Object(k.useReducer)(w,x),V=Object(P.a)(R,2),ne=V[0],se=V[1],Se=ne.visible,Le=ne.tabIndex;Object(k.useEffect)(function(){se({type:A.SET_VISIBLE,payload:!1})},[f]);function Ae(Te){var Z=Te.target.id;se({type:A.SET_TABINDEX,payload:Z})}function Pe(){se({type:A.SET_VISIBLE,payload:!Se})}var Fe=Object(k.useMemo)(function(){if(W){var Te=W.status;return n.a.createElement(n.a.Fragment,null,E(W))}return null},[W]);function je(){se({type:A.SET_VISIBLE,payload:!0}),se({type:A.SET_TABINDEX,payload:"1"}),K()}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:Le==="0"?"active":"",id:"0",onClick:Ae},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),n.a.createElement("li",null,n.a.createElement("a",{className:Le==="1"?"active":"",id:"1",onClick:Ae},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),n.a.createElement("div",{className:"tab-panel-body ".concat(Le==="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:C,onChange:L})),n.a.createElement("div",{className:"tab-panel-body ".concat(Le==="1"?"":"hide")},b?n.a.createElement(i.a,{message:M}):W?n.a.createElement("section",{style:{height:200}}," ",Fe," "):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:Pe},Se?n.a.createElement(I.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:b,onClick:je},"\u8C03\u8BD5\u4EE3\u7801"),n.a.createElement(z.a,{type:"primary",loading:y,disabled:y,onClick:function(){se({type:A.SET_VISIBLE,payload:!1}),F()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(We,ge,D){We.exports=D.p+"static/time.a3dc82f3.svg"},"SA+Z":function(We,ge,D){var q=D("wTVA"),z=D("EbDI"),P=D("ZhPi"),Y=D("wkBT");function N(O){return q(O)||z(O)||P(O)||Y()}We.exports=N,We.exports.__esModule=!0,We.exports.default=We.exports},SJMd:function(We,ge){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var D,q,z,P=!1,Y,N;window.PR_SHOULD_USE_CONTINUATION=!0;var O,H;(function(){var k=window,n=["break,continue,do,else,for,if,return,while"],I=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[I,"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"],i="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"],r=[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,i,a,r,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",E="lit",m="pun",f="pln",C="tag",b="dec",y="src",M="atn",W="atv",L="nocode",K="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(we){for(var Ge=0,Je=!1,be=!1,Re=0,xe=we.length;Re<xe;++Re){var Ce=we[Re];if(Ce.ignoreCase)be=!0;else if(/[a-z]/i.test(Ce.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Je=!0,be=!1;break}}var Be={b:8,t:9,n:10,v:11,f:12,r:13};function Xe(Ne){var Ue=Ne.charCodeAt(0);if(Ue!==92)return Ue;var Ze=Ne.charAt(1);return Ue=Be[Ze],Ue||("0"<=Ze&&Ze<="7"?parseInt(Ne.substring(1),8):Ze==="u"||Ze==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function qe(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var Ue=String.fromCharCode(Ne);return Ue==="\\"||Ue==="-"||Ue==="]"||Ue==="^"?"\\"+Ue:Ue}function tt(Ne){var Ue=Ne.substring(1,Ne.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")),Ze=[],et=Ue[0]==="^",fe=["["];et&&fe.push("^");for(var re=et?1:0,ie=Ue.length;re<ie;++re){var ce=Ue[re];if(/\\[bdsw]/i.test(ce))fe.push(ce);else{var pe=Xe(ce),le;re+2<ie&&Ue[re+1]==="-"?(le=Xe(Ue[re+2]),re+=2):le=pe,Ze.push([pe,le]),le<65||pe>122||(le<65||pe>90||Ze.push([Math.max(65,pe)|32,Math.min(le,90)|32]),le<97||pe>122||Ze.push([Math.max(97,pe)&~32,Math.min(le,122)&~32]))}}Ze.sort(function(Oe,ke){return Oe[0]-ke[0]||ke[1]-Oe[1]});for(var he=[],ye=[],re=0;re<Ze.length;++re){var _e=Ze[re];_e[0]<=ye[1]+1?ye[1]=Math.max(ye[1],_e[1]):he.push(ye=_e)}for(var re=0;re<he.length;++re){var _e=he[re];fe.push(qe(_e[0])),_e[1]>_e[0]&&(_e[1]+1>_e[0]&&fe.push("-"),fe.push(qe(_e[1])))}return fe.push("]"),fe.join("")}function ht(Ne){for(var Ue=Ne.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")),Ze=Ue.length,et=[],fe=0,re=0;fe<Ze;++fe){var ie=Ue[fe];if(ie==="(")++re;else if(ie.charAt(0)==="\\"){var ce=+ie.substring(1);ce&&(ce<=re?et[ce]=-1:Ue[fe]=qe(ce))}}for(var fe=1;fe<et.length;++fe)et[fe]===-1&&(et[fe]=++Ge);for(var fe=0,re=0;fe<Ze;++fe){var ie=Ue[fe];if(ie==="(")++re,et[re]||(Ue[fe]="(?:");else if(ie.charAt(0)==="\\"){var ce=+ie.substring(1);ce&&ce<=re&&(Ue[fe]="\\"+et[ce])}}for(var fe=0;fe<Ze;++fe)Ue[fe]==="^"&&Ue[fe+1]!=="^"&&(Ue[fe]="");if(Ne.ignoreCase&&Je)for(var fe=0;fe<Ze;++fe){var ie=Ue[fe],pe=ie.charAt(0);ie.length>=2&&pe==="["?Ue[fe]=tt(ie):pe!=="\\"&&(Ue[fe]=ie.replace(/[a-zA-Z]/g,function(ye){var _e=ye.charCodeAt(0);return"["+String.fromCharCode(_e&~32,_e|32)+"]"}))}return Ue.join("")}for(var ft=[],Re=0,xe=we.length;Re<xe;++Re){var Ce=we[Re];if(Ce.global||Ce.multiline)throw new Error(""+Ce);ft.push("(?:"+ht(Ce)+")")}return new RegExp(ft.join("|"),be?"gi":"g")}function R(we,Ge){var Je=/(?:^|\s)nocode(?:\s|$)/,be=[],Re=0,xe=[],Ce=0;function Be(Xe){var qe=Xe.nodeType;if(qe==1){if(Je.test(Xe.className))return;for(var tt=Xe.firstChild;tt;tt=tt.nextSibling)Be(tt);var ht=Xe.nodeName.toLowerCase();(ht==="br"||ht==="li")&&(be[Ce]=`
|
|
`,xe[Ce<<1]=Re++,xe[Ce++<<1|1]=Xe)}else if(qe==3||qe==4){var ft=Xe.nodeValue;ft.length&&(Ge?ft=ft.replace(/\r\n?/g,`
|
|
`):ft=ft.replace(/[ \t\r\n]+/g," "),be[Ce]=ft,xe[Ce<<1]=Re,Re+=ft.length,xe[Ce++<<1|1]=Xe)}}return Be(we),{sourceCode:be.join("").replace(/\n$/,""),spans:xe}}function V(we,Ge,Je,be,Re){if(!Je)return;var xe={sourceNode:we,pre:1,langExtension:null,numberLines:null,sourceCode:Je,spans:null,basePos:Ge,decorations:null};be(xe),Re.push.apply(Re,xe.decorations)}var ne=/\S/;function se(we){for(var Ge=void 0,Je=we.firstChild;Je;Je=Je.nextSibling){var be=Je.nodeType;Ge=be===1?Ge?we:Je:be===3&&ne.test(Je.nodeValue)?we:Ge}return Ge===we?void 0:Ge}function Se(we,Ge){var Je={},be;(function(){for(var Ce=we.concat(Ge),Be=[],Xe={},qe=0,tt=Ce.length;qe<tt;++qe){var ht=Ce[qe],ft=ht[3];if(ft)for(var Ne=ft.length;--Ne>=0;)Je[ft.charAt(Ne)]=ht;var Ue=ht[1],Ze=""+Ue;Xe.hasOwnProperty(Ze)||(Be.push(Ue),Xe[Ze]=null)}Be.push(/[\0-\uffff]/),be=F(Be)})();var Re=Ge.length,xe=function(Ce){for(var Be=Ce.sourceCode,Xe=Ce.basePos,qe=Ce.sourceNode,tt=[Xe,f],ht=0,ft=Be.match(be)||[],Ne={},Ue=0,Ze=ft.length;Ue<Ze;++Ue){var et=ft[Ue],fe=Ne[et],re=void 0,ie;if(typeof fe=="string")ie=!1;else{var ce=Je[et.charAt(0)];if(ce)re=et.match(ce[1]),fe=ce[0];else{for(var pe=0;pe<Re;++pe)if(ce=Ge[pe],re=et.match(ce[1]),re){fe=ce[0];break}re||(fe=f)}ie=fe.length>=5&&fe.substring(0,5)==="lang-",ie&&!(re&&typeof re[1]=="string")&&(ie=!1,fe=y),ie||(Ne[et]=fe)}var le=ht;if(ht+=et.length,!ie)tt.push(Xe+le,fe);else{var he=re[1],ye=et.indexOf(he),_e=ye+he.length;re[2]&&(_e=et.length-re[2].length,ye=_e-he.length);var Oe=fe.substring(5);V(qe,Xe+le,et.substring(0,ye),xe,tt),V(qe,Xe+le+ye,he,Z(Oe,he),tt),V(qe,Xe+le+_e,et.substring(_e),xe,tt)}}Ce.decorations=tt};return xe}function Le(we){var Ge=[],Je=[];we.tripleQuotedStrings?Ge.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):we.multiLineStrings?Ge.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ge.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),we.verbatimStrings&&Je.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var be=we.hashComments;be&&(we.cStyleComments?(be>1?Ge.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ge.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Je.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ge.push([w,/^#[^\r\n]*/,null,"#"])),we.cStyleComments&&(Je.push([w,/^\/\/[^\r\n]*/,null]),Je.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Re=we.regexLiterals;if(Re){var xe=Re>1?"":`
|
|
\r`,Ce=xe?".":"[\\S\\s]",Be="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+Ce+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+Ce+")*(?:\\x5D|$))+/";Je.push(["lang-regex",RegExp("^"+K+"("+Be+")")])}var Xe=we.types;Xe&&Je.push([v,Xe]);var qe=(""+we.keywords).replace(/^ | $/g,"");qe.length&&Je.push([A,new RegExp("^(?:"+qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Ge.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return we.regexLiterals&&(tt+="(?!s*/)"),Je.push([E,/^@[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],[E,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(tt),null]),Se(Ge,Je)}var Ae=Le({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Pe(we,Ge,Je){for(var be=/(?:^|\s)nocode(?:\s|$)/,Re=/\r\n?|\n/,xe=we.ownerDocument,Ce=xe.createElement("li");we.firstChild;)Ce.appendChild(we.firstChild);var Be=[Ce];function Xe(Ue){var Ze=Ue.nodeType;if(Ze==1&&!be.test(Ue.className))if(Ue.nodeName==="br")qe(Ue),Ue.parentNode&&Ue.parentNode.removeChild(Ue);else for(var et=Ue.firstChild;et;et=et.nextSibling)Xe(et);else if((Ze==3||Ze==4)&&Je){var fe=Ue.nodeValue,re=fe.match(Re);if(re){var ie=fe.substring(0,re.index);Ue.nodeValue=ie;var ce=fe.substring(re.index+re[0].length);if(ce){var pe=Ue.parentNode;pe.insertBefore(xe.createTextNode(ce),Ue.nextSibling)}qe(Ue),ie||Ue.parentNode.removeChild(Ue)}}}function qe(Ue){for(;!Ue.nextSibling;)if(Ue=Ue.parentNode,!Ue)return;function Ze(re,ie){var ce=ie?re.cloneNode(!1):re,pe=re.parentNode;if(pe){var le=Ze(pe,1),he=re.nextSibling;le.appendChild(ce);for(var ye=he;ye;ye=he)he=ye.nextSibling,le.appendChild(ye)}return ce}for(var et=Ze(Ue.nextSibling,0),fe;(fe=et.parentNode)&&fe.nodeType===1;)et=fe;Be.push(et)}for(var tt=0;tt<Be.length;++tt)Xe(Be[tt]);Ge===(Ge|0)&&Be[0].setAttribute("value",Ge);var ht=xe.createElement("ol");ht.className="linenums";for(var ft=Math.max(0,Ge-1|0)||0,tt=0,Ne=Be.length;tt<Ne;++tt)Ce=Be[tt],Ce.className="L"+(tt+ft)%10,Ce.firstChild||Ce.appendChild(xe.createTextNode("\xA0")),ht.appendChild(Ce);we.appendChild(ht)}function Fe(we){var Ge=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ge=Ge&&+Ge[1]<=8;var Je=/\n/g,be=we.sourceCode,Re=be.length,xe=0,Ce=we.spans,Be=Ce.length,Xe=0,qe=we.decorations,tt=qe.length,ht=0;qe[tt]=Re;var ft,Ne;for(Ne=ft=0;Ne<tt;)qe[Ne]!==qe[Ne+2]?(qe[ft++]=qe[Ne++],qe[ft++]=qe[Ne++]):Ne+=2;for(tt=ft,Ne=ft=0;Ne<tt;){for(var Ue=qe[Ne],Ze=qe[Ne+1],et=Ne+2;et+2<=tt&&qe[et+1]===Ze;)et+=2;qe[ft++]=Ue,qe[ft++]=Ze,Ne=et}tt=qe.length=ft;var fe=we.sourceNode,re="";fe&&(re=fe.style.display,fe.style.display="none");try{for(var ie=null;Xe<Be;){var ce=Ce[Xe],pe=Ce[Xe+2]||Re,le=qe[ht+2]||Re,et=Math.min(pe,le),he=Ce[Xe+1],ye;if(he.nodeType!==1&&(ye=be.substring(xe,et))){Ge&&(ye=ye.replace(Je,"\r")),he.nodeValue=ye;var _e=he.ownerDocument,Oe=_e.createElement("span");Oe.className=qe[ht+1];var ke=he.parentNode;ke.replaceChild(Oe,he),Oe.appendChild(he),xe<pe&&(Ce[Xe+1]=he=_e.createTextNode(be.substring(et,pe)),ke.insertBefore(he,Oe.nextSibling))}xe=et,xe>=pe&&(Xe+=2),xe>=le&&(ht+=2)}}finally{fe&&(fe.style.display=re)}}var je={};function Te(we,Ge){for(var Je=Ge.length;--Je>=0;){var be=Ge[Je];je.hasOwnProperty(be)?k.console&&console.warn("cannot override language handler %s",be):je[be]=we}}function Z(we,Ge){return we&&je.hasOwnProperty(we)||(we=/^\s*</.test(Ge)?"default-markup":"default-code"),je[we]}Te(Ae,["default-code"]),Te(Se([],[[f,/^[^<?]+/],[b,/^<!\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"]),Te(Se([[f,/^[\s]+/,null,` \r
|
|
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!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"]),Te(Se([],[[W,/^[\s\S]+/]]),["uq.val"]),Te(Le({keywords:p,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),Te(Le({keywords:"null,true,false"}),["json"]),Te(Le({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),Te(Le({keywords:h,cStyleComments:!0}),["java"]),Te(Le({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Te(Le({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Te(Le({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Te(Le({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Te(Le({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Te(Le({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Te(Se([],[[T,/^[\s\S]+/]]),["regex"]);function U(we){var Ge=we.langExtension;try{var Je=R(we.sourceNode,we.pre),be=Je.sourceCode;we.sourceCode=be,we.spans=Je.spans,we.basePos=0,Z(Ge,be)(we),Fe(we)}catch(Re){k.console&&console.log(Re&&Re.stack||Re)}}function G(we,Ge,Je){var be=Je||!1,Re=Ge||null,xe=document.createElement("div");xe.innerHTML="<pre>"+we+"</pre>",xe=xe.firstChild,be&&Pe(xe,be,!0);var Ce={langExtension:Re,numberLines:be,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return U(Ce),xe.innerHTML}function ee(we,Ge){var Je=Ge||document.body,be=Je.ownerDocument||document;function Re(ce){return Je.getElementsByTagName(ce)}for(var xe=[Re("pre"),Re("code"),Re("xmp")],Ce=[],Be=0;Be<xe.length;++Be)for(var Xe=0,qe=xe[Be].length;Xe<qe;++Xe)Ce.push(xe[Be][Xe]);xe=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var ht=0,ft=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,Ue=/\bprettyprinted\b/,Ze=/pre|xmp/i,et=/^code$/i,fe=/^(?:pre|code|xmp)$/i,re={};function ie(){for(var ce=k.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;ht<Ce.length&&tt.now()<ce;ht++){for(var pe=Ce[ht],le=re,he=pe;he=he.previousSibling;){var ye=he.nodeType,_e=(ye===7||ye===8)&&he.nodeValue;if(_e?!/^\??prettify\b/.test(_e):ye!==3||/\S/.test(he.nodeValue))break;if(_e){le={},_e.replace(/\b(\w+)=([\w:.%+-]+)/g,function(On,kt,Un){le[kt]=Un});break}}var Oe=pe.className;if((le!==re||Ne.test(Oe))&&!Ue.test(Oe)){for(var ke=!1,$e=pe.parentNode;$e;$e=$e.parentNode){var ot=$e.tagName;if(fe.test(ot)&&$e.className&&Ne.test($e.className)){ke=!0;break}}if(!ke){pe.className+=" prettyprinted";var pt=le.lang;if(!pt){pt=Oe.match(ft);var mt;!pt&&(mt=se(pe))&&et.test(mt.tagName)&&(pt=mt.className.match(ft)),pt&&(pt=pt[1])}var qt;if(Ze.test(pe.tagName))qt=1;else{var xt=pe.currentStyle,Ct=be.defaultView,Pt=xt?xt.whiteSpace:Ct&&Ct.getComputedStyle?Ct.getComputedStyle(pe,null).getPropertyValue("white-space"):0;qt=Pt&&Pt.substring(0,3)==="pre"}var Rt=le.linenums;(Rt=Rt==="true"||+Rt)||(Rt=Oe.match(/\blinenums\b(?::(\d+))?/),Rt=Rt?Rt[1]&&Rt[1].length?+Rt[1]:!0:!1),Rt&&Pe(pe,Rt,qt);var Gt={langExtension:pt,sourceNode:pe,numberLines:Rt,pre:qt,sourceCode:null,basePos:null,spans:null,decorations:null};U(Gt)}}}ht<Ce.length?k.setTimeout(ie,250):typeof we=="function"&&we()}ie()}var ue=k.PR={createSimpleLexer:Se,registerLangHandler:Te,sourceDecorator:Le,PR_ATTRIB_NAME:M,PR_ATTRIB_VALUE:W,PR_COMMENT:w,PR_DECLARATION:b,PR_KEYWORD:A,PR_LITERAL:E,PR_NOCODE:L,PR_PLAIN:f,PR_PUNCTUATION:m,PR_SOURCE:y,PR_STRING:T,PR_TAG:C,PR_TYPE:v,prettyPrintOne:P?k.prettyPrintOne=G:O=G,prettyPrint:H=P?k.prettyPrint=ee:H=ee},J=k.define;typeof J=="function"&&J.amd&&J("google-code-prettify",[],function(){return ue})})()},STEk:function(We,ge,D){"use strict";D.d(ge,"a",function(){return Te});/*! *****************************************************************************
|
|
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 q=function(Z,U){return(q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,ee){G.__proto__=ee}||function(G,ee){for(var ue in ee)Object.prototype.hasOwnProperty.call(ee,ue)&&(G[ue]=ee[ue])})(Z,U)};function z(Z,U){function G(){this.constructor=Z}q(Z,U),Z.prototype=U===null?Object.create(U):(G.prototype=U.prototype,new G)}function P(Z,U,G,ee){return new(G||(G=Promise))(function(ue,J){function we(be){try{Je(ee.next(be))}catch(Re){J(Re)}}function Ge(be){try{Je(ee.throw(be))}catch(Re){J(Re)}}function Je(be){var Re;be.done?ue(be.value):(Re=be.value,Re instanceof G?Re:new G(function(xe){xe(Re)})).then(we,Ge)}Je((ee=ee.apply(Z,U||[])).next())})}function Y(Z,U){var G,ee,ue,J,we={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return J={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function Ge(Je){return function(be){return function(Re){if(G)throw new TypeError("Generator is already executing.");for(;we;)try{if(G=1,ee&&(ue=2&Re[0]?ee.return:Re[0]?ee.throw||((ue=ee.return)&&ue.call(ee),0):ee.next)&&!(ue=ue.call(ee,Re[1])).done)return ue;switch(ee=0,ue&&(Re=[2&Re[0],ue.value]),Re[0]){case 0:case 1:ue=Re;break;case 4:return we.label++,{value:Re[1],done:!1};case 5:we.label++,ee=Re[1],Re=[0];continue;case 7:Re=we.ops.pop(),we.trys.pop();continue;default:if(!(ue=we.trys,(ue=ue.length>0&&ue[ue.length-1])||Re[0]!==6&&Re[0]!==2)){we=0;continue}if(Re[0]===3&&(!ue||Re[1]>ue[0]&&Re[1]<ue[3])){we.label=Re[1];break}if(Re[0]===6&&we.label<ue[1]){we.label=ue[1],ue=Re;break}if(ue&&we.label<ue[2]){we.label=ue[2],we.ops.push(Re);break}ue[2]&&we.ops.pop(),we.trys.pop();continue}Re=U.call(Z,we)}catch(xe){Re=[6,xe],ee=0}finally{G=ue=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([Je,be])}}}function N(){for(var Z=0,U=0,G=arguments.length;U<G;U++)Z+=arguments[U].length;var ee=Array(Z),ue=0;for(U=0;U<G;U++)for(var J=arguments[U],we=0,Ge=J.length;we<Ge;we++,ue++)ee[ue]=J[we];return ee}var O=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(U,G){for(var ee=0,ue=G;ee<ue.length;ee++){var J=ue[ee],we=J[0],Ge=J[1];U.setAttribute(we,Ge)}},Z.createRect=function(U,G,ee){var ue=document.createElementNS("http://www.w3.org/2000/svg","rect");return ue.setAttribute("width",U.toString()),ue.setAttribute("height",G.toString()),ee&&Z.setAttributes(ue,ee),ue},Z.createLine=function(U,G,ee,ue,J){var we=document.createElementNS("http://www.w3.org/2000/svg","line");return we.setAttribute("x1",U.toString()),we.setAttribute("y1",G.toString()),we.setAttribute("x2",ee.toString()),we.setAttribute("y2",ue.toString()),J&&Z.setAttributes(we,J),we},Z.createPolygon=function(U,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ee.setAttribute("points",U),G&&Z.setAttributes(ee,G),ee},Z.createCircle=function(U,G){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()),G&&Z.setAttributes(ee,G),ee},Z.createEllipse=function(U,G,ee){var ue=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ue.setAttribute("cx",(U/2).toString()),ue.setAttribute("cy",(G/2).toString()),ue.setAttribute("rx",(U/2).toString()),ue.setAttribute("ry",(G/2).toString()),ee&&Z.setAttributes(ue,ee),ue},Z.createGroup=function(U){var G=document.createElementNS("http://www.w3.org/2000/svg","g");return U&&Z.setAttributes(G,U),G},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(U,G,ee,ue,J,we,Ge){var Je=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(Je,[["id",U],["orient",G],["markerWidth",ee.toString()],["markerHeight",ue.toString()],["refX",J.toString()],["refY",we.toString()]]),Je.appendChild(Ge),Je},Z.createText=function(U){var G=document.createElementNS("http://www.w3.org/2000/svg","text");return G.setAttribute("x","0"),G.setAttribute("y","0"),U&&Z.setAttributes(G,U),G},Z.createTSpan=function(U,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ee.textContent=U,G&&Z.setAttributes(ee,G),ee},Z.createImage=function(U){var G=document.createElementNS("http://www.w3.org/2000/svg","image");return U&&Z.setAttributes(G,U),G},Z.createPoint=function(U,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ee.x=U,ee.y=G,ee},Z.createPath=function(U,G){var ee=document.createElementNS("http://www.w3.org/2000/svg","path");return ee.setAttribute("d",U),G&&Z.setAttributes(ee,G),ee},Z}(),H=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}(),k=function(){function Z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Z.prototype.rasterize=function(U,G,ee){var ue=this;return new Promise(function(J){var we=ee!==void 0?ee:document.createElement("canvas");U===null&&(ue.markersOnly=!0,ue.naturalSize=!1);var Ge=document.createElementNS("http://www.w3.org/2000/svg","svg");Ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ge.setAttribute("width",G.width.baseVal.valueAsString),Ge.setAttribute("height",G.height.baseVal.valueAsString),Ge.setAttribute("viewBox","0 0 "+G.viewBox.baseVal.width.toString()+" "+G.viewBox.baseVal.height.toString()),Ge.innerHTML=G.innerHTML,ue.naturalSize===!0?(Ge.width.baseVal.value=U.naturalWidth,Ge.height.baseVal.value=U.naturalHeight):ue.width!==void 0&&ue.height!==void 0&&(Ge.width.baseVal.value=ue.width,Ge.height.baseVal.value=ue.height),we.width=Ge.width.baseVal.value,we.height=Ge.height.baseVal.value;var Je=Ge.outerHTML,be=we.getContext("2d");ue.markersOnly!==!0&&be.drawImage(U,0,0,we.width,we.height);var Re=window.URL,xe=new Image(we.width,we.height);xe.setAttribute("crossOrigin","anonymous");var Ce=new Blob([Je],{type:"image/svg+xml"}),Be=Re.createObjectURL(Ce);xe.onload=function(){be.drawImage(xe,0,0),Re.revokeObjectURL(Be);var Xe=we.toDataURL(ue.imageType,ue.imageQuality);J(Xe)},xe.src=Be})},Z}(),n=function(){},I=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,G,ee,ue,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=U,this.displayMode=G,this.markerItems=ee,this.uiStyleSettings=ue,this.styles=J,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 G=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(J){var we=document.createElement("div");we.className=""+G.toolbarButtonStyleClass.name,we.setAttribute("data-type-name",J.typeName),we.innerHTML=J.icon,we.addEventListener("click",function(){G.markerToolbarButtonClicked(we,J)}),G.buttons.push(we),G.markerButtons.push(we)}),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 ue=document.createElement("div");ue.className=this.toolbarBlockStyleClass.name,ue.style.whiteSpace="nowrap",ue.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ue),this.addActionButton(ue,'<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(ue,'<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 G=0;G<this.markerButtons.length;G++)G<U||G===U&&this.markerButtons.length-1===U?this.markerButtonBlock.appendChild(this.markerButtons[G]):(G===U&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[G]))}},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(G){G.className=G.className.replace(U.uiStyleSettings.toolbarButtonStyleColorsClassName?U.uiStyleSettings.toolbarButtonStyleColorsClassName:U.toolbarButtonStyleColorsClass.name,"").trim(),G.className=G.className.replace(U.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?U.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:U.toolbarActiveButtonStyleColorsClass.name,"").trim(),G.className+=" "+(U.uiStyleSettings.toolbarButtonStyleColorsClassName?U.uiStyleSettings.toolbarButtonStyleColorsClassName:U.toolbarButtonStyleColorsClass.name)})},Z.prototype.addActionButton=function(U,G,ee){var ue=this,J=document.createElement("div");switch(J.className=""+this.toolbarButtonStyleClass.name,J.innerHTML=G,J.setAttribute("data-action",ee),J.addEventListener("click",function(){ue.actionToolbarButtonClicked(J,ee)}),ee){case"select":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":J.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":J.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":J.style.fill=this.uiStyleSettings.closeButtonColor}U.appendChild(J),this.buttons.push(J)},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,G){this.setActiveButton(U),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("marker",G)}),this.markerButtonOverflowBlock.style.display="none"},Z.prototype.actionToolbarButtonClicked=function(U,G){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("action",G)}),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 G=this.markerButtons.find(function(ee){return ee.getAttribute("data-type-name")===U});G&&this.setActiveButton(G)},Z.prototype.setCurrentMarker=function(U){var G=this;this.currentMarker=U,this.buttons.filter(function(ee){return/delete|notes/.test(ee.getAttribute("data-action"))}).forEach(function(ee){G.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,G,ee,ue){this.panels=[],this.panelButtons=[],this.markerjsContainer=U,this.displayMode=G,this.uiStyleSettings=ee,this.styles=ue,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 G=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*G)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*G)+`px;
|
|
padding: `+G+`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 G;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=U,this.uiContainer.className=this.toolboxStyleClass.name+" "+((G=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Z.prototype.setPanelButtons=function(U){var G,ee,ue=this;this.panels=U,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&G!==void 0?G: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(J){var we;J.uiStyleSettings=ue.uiStyleSettings;var Ge=document.createElement("div");Ge.className=ue.toolboxButtonStyleClass.name+" "+((we=ue.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&we!==void 0?we:ue.toolboxButtonStyleColorsClass.name),Ge.innerHTML=J.icon,Ge.title=J.title,Ge.addEventListener("click",function(){ue.panelButtonClick(J)}),ue.panelButtons.push(Ge),ue.buttonRow.appendChild(Ge)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Z.prototype.panelButtonClick=function(U){var G=this,ee=-1;if(U!==this.activePanel){ee=this.panels.indexOf(U),this.panelRow.innerHTML="";var ue=U.getUi();ue.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ue),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(){G.displayMode==="inline"?G.panelRow.style.display="none":G.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,we){var Ge,Je;J.className=G.toolboxButtonStyleClass.name+" "+(we===ee?""+((Ge=G.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:G.toolboxActiveButtonStyleColorsClass.name):""+((Je=G.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Je!==void 0?Je:G.toolboxButtonStyleColorsClass.name))})},Z}(),o=function(Z,U){this.title=Z,this.icon=U},d=function(Z){function U(G,ee,ue,J){var we=Z.call(this,G,J||'<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 we.colors=[],we.addTransparent=!1,we.colorBoxes=[],we.colors=ee,we.currentColor=ue,we.setCurrentColor=we.setCurrentColor.bind(we),we.getColorBox=we.getColorBox.bind(we),we}return z(U,Z),U.prototype.getUi=function(){var G=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.whiteSpace="nowrap",this.colors.forEach(function(ue){var J=G.getColorBox(ue);ee.appendChild(J),G.colorBoxes.push(J)}),ee},U.prototype.getColorBox=function(G){var ee=this,ue=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-ue,we=document.createElement("div");we.style.display="inline-block",we.style.boxSizing="content-box",we.style.width=J-2+"px",we.style.height=J-2+"px",we.style.padding="1px",we.style.marginRight="2px",we.style.marginBottom="2px",we.style.borderWidth="2px",we.style.borderStyle="solid",we.style.borderRadius=(J+2)/2+"px",we.style.borderColor=G===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",we.addEventListener("click",function(){ee.setCurrentColor(G,we)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=J-2+"px",Ge.style.height=J-2+"px",Ge.style.backgroundColor=G,Ge.style.borderRadius=J/2+"px",G==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.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>`),we.appendChild(Ge),we},U.prototype.setCurrentColor=function(G,ee){var ue=this;this.currentColor=G,this.colorBoxes.forEach(function(J){J.style.borderColor=J===ee?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(G)},U}(o),i=function(){function Z(U,G,ee){this._state="new",this._isSelected=!1,this._container=U,this._overlayContainer=G,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,G){},Z.prototype.dblClick=function(U,G){},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,G){},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}(),r=function(){function Z(){this.GRIP_SIZE=10,this.visual=O.createGroup(),this.visual.appendChild(O.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(O.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,G){return U.a=G.a,U.b=G.b,U.c=G.c,U.d=G.d,U.e=G.e,U.f=G.f,U},Z}(),S=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(O.createTransform()),J.setupControlBox(),J}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(G){this._visual=G;var ee=O.createTransform();this._visual.transform.baseVal.appendItem(ee)},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(G){return!!Z.prototype.ownsTarget.call(this,G)||!!(this.controlGrips.findGripByVisual(G)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G))},U.prototype.pointerDown=function(G,ee){Z.prototype.pointerDown.call(this,G,ee),this.state==="new"&&(this.left=G.x,this.top=G.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ue=this.unrotatePoint(G);if(this.manipulationStartX=ue.x,this.manipulationStartY=ue.y,this.offsetX=ue.x-this.left,this.offsetY=ue.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 J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var we=this.container.transform.baseVal.getItem(0);we.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(we,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},U.prototype.pointerUp=function(G){var ee=this.state;Z.prototype.pointerUp.call(this,G),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(G),this._state="select",ee==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},U.prototype.moveVisual=function(G){this.visual.style.transform="translate("+G.x+"px, "+G.y+"px)"},U.prototype.manipulate=function(G){var ee=this.unrotatePoint(G);this.state==="creating"?this.resize(G):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(G)},U.prototype.resize=function(G){var ee=this.manipulationStartLeft,ue=this.manipulationStartWidth,J=this.manipulationStartTop,we=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ee=this.manipulationStartLeft+G.x-this.manipulationStartX,ue=this.manipulationStartWidth+this.manipulationStartLeft-ee;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ue=this.manipulationStartWidth+G.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+G.y-this.manipulationStartY,we=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:we=this.manipulationStartHeight+G.y-this.manipulationStartY}ue>=0?(this.left=ee,this.width=ue):(this.left=ee+ue,this.width=-ue),we>=0?(this.top=J,this.height=we):(this.top=J+we,this.height=-we),this.setSize()},U.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},U.prototype.rotate=function(G){if(Math.abs(G.x-this.centerX)>.1){var ee=Math.sign(G.x-this.centerX);this.rotationAngle=180*Math.atan((G.y-this.centerY)/(G.x-this.centerX))/Math.PI+90*ee,this.applyRotation()}},U.prototype.applyRotation=function(){var G=this.container.transform.baseVal.getItem(0);G.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(G,0)},U.prototype.rotatePoint=function(G){if(this.rotationAngle===0)return G;var ee=this.container.getCTM(),ue=O.createPoint(G.x,G.y);return{x:(ue=ue.matrixTransform(ee)).x,y:ue.y}},U.prototype.unrotatePoint=function(G){if(this.rotationAngle===0)return G;var ee=this.container.getCTM();ee=ee.inverse();var ue=O.createPoint(G.x,G.y);return{x:(ue=ue.matrixTransform(ee)).x,y:ue.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=O.createGroup();var G=O.createTransform();G.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(G),this.container.appendChild(this.controlBox),this.controlRect=O.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=O.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 G=this.controlBox.transform.baseVal.getItem(0);G.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(G,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 G=new r;return G.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(G.visual),G},U.prototype.positionGrips=function(){var G=this.controlGrips.topLeft.GRIP_SIZE,ee=-G/2,ue=ee,J=(this.width+this.CB_DISTANCE)/2-G/2,we=(this.height+this.CB_DISTANCE)/2-G/2,Ge=this.height+this.CB_DISTANCE-G/2,Je=this.width+this.CB_DISTANCE-G/2;this.positionGrip(this.controlGrips.topLeft.visual,ee,ue),this.positionGrip(this.controlGrips.topCenter.visual,J,ue),this.positionGrip(this.controlGrips.topRight.visual,Je,ue),this.positionGrip(this.controlGrips.centerLeft.visual,ee,we),this.positionGrip(this.controlGrips.centerRight.visual,Je,we),this.positionGrip(this.controlGrips.bottomLeft.visual,ee,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,J,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,Je,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,ue-3*this.CB_DISTANCE)},U.prototype.positionGrip=function(G,ee,ue){var J=G.transform.baseVal.getItem(0);J.setTranslate(ee,ue),G.transform.baseVal.replaceItem(J,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(G){Z.prototype.restoreState.call(this,G);var ee=G;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(G,ee){Z.prototype.scale.call(this,G,ee);var ue=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:ue.x*G,y:ue.y*ee});this.left=J.x,this.top=J.y,this.width=this.width*G,this.height=this.height*ee,this.adjustControlBox()},U}(i),x=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return z(U,Z),U.prototype.ownsTarget=function(G){return!(!Z.prototype.ownsTarget.call(this,G)&&G!==this.visual)},U.prototype.createVisual=function(){this.visual=O.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(G,ee){Z.prototype.pointerDown.call(this,G,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(G),this._state="creating")},U.prototype.manipulate=function(G){Z.prototype.manipulate.call(this,G)},U.prototype.resize=function(G){Z.prototype.resize.call(this,G),this.setSize()},U.prototype.setSize=function(){Z.prototype.setSize.call(this),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(G){Z.prototype.pointerUp.call(this,G),this.setSize()},U.prototype.setStrokeColor=function(G){this.strokeColor=G,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(G),this.stateChanged()},U.prototype.setFillColor=function(G){this.fillColor=G,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},U.prototype.setStrokeWidth=function(G){this.strokeWidth=G,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},U.prototype.setStrokeDasharray=function(G){this.strokeDasharray=G,this.visual&&O.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(G){var ee=G;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,G),this.setSize()},U.prototype.scale=function(G,ee){Z.prototype.scale.call(this,G,ee),this.setSize()},U.title="Rectangle marker",U}(S),T=function(Z){function U(G,ee,ue,J){var we=Z.call(this,G,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return we.widths=[],we.widthBoxes=[],we.widths=ee,we.currentWidth=ue,we.setCurrentWidth=we.setCurrentWidth.bind(we),we}return z(U,Z),U.prototype.getUi=function(){var G=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.widths.forEach(function(ue){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ue===G.currentWidth?G.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){G.setCurrentWidth(ue,J)}),ee.appendChild(J);var we=document.createElement("div");we.innerText=ue.toString(),we.style.marginRight="5px",J.appendChild(we);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var Je=document.createElement("hr");Je.style.minWidth="20px",Je.style.border="0px",Je.style.borderTop=ue+"px solid "+G.uiStyleSettings.toolboxColor,Je.style.flexGrow="2",Ge.appendChild(Je),J.appendChild(Ge),G.widthBoxes.push(J)}),ee},U.prototype.setCurrentWidth=function(G,ee){var ue=this;this.currentWidth=G,this.widthBoxes.forEach(function(J){J.style.borderColor=J===ee?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},U}(o),A=function(Z){function U(G,ee,ue,J){var we=Z.call(this,G,J||'<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 we.styles=[],we.styleBoxes=[],we.styles=ee,we.currentStyle=ue,we.setCurrentStyle=we.setCurrentStyle.bind(we),we}return z(U,Z),U.prototype.getUi=function(){var G=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.styles.forEach(function(ue){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/G.styles.length-5+"%",J.style.borderColor=ue===G.currentStyle?G.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){G.setCurrentStyle(ue,J)}),ee.appendChild(J);var we=document.createElement("div");we.style.minHeight="20px",we.style.flexGrow="2",we.style.overflow="hidden";var Ge=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+G.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ue!==""?'stroke-dasharray="'+ue+'"':"")+` />
|
|
</svg>`;we.innerHTML=Ge,J.appendChild(we),G.styleBoxes.push(J)}),ee},U.prototype.setCurrentStyle=function(G,ee){var ue=this;this.currentStyle=G,this.styleBoxes.forEach(function(J){J.style.borderColor=J===ee?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},U}(o),w=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.strokeColor=ue.defaultColor,J.strokeWidth=ue.defaultStrokeWidth,J.strokeDasharray=ue.defaultStrokeDasharray,J.strokePanel=new d("Line color",ue.defaultColorSet,ue.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new T("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new A("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}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 G=Z.prototype.getState.call(this);return G.typeName=U.typeName,G},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},E=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return z(U,Z),U.prototype.ownsTarget=function(G){return!!Z.prototype.ownsTarget.call(this,G)||!(!this.grip1.ownsTarget(G)&&!this.grip2.ownsTarget(G))},U.prototype.pointerDown=function(G,ee){Z.prototype.pointerDown.call(this,G,ee),this.manipulationStartX=G.x,this.manipulationStartY=G.y,this.state==="new"&&(this.x1=G.x,this.y1=G.y,this.x2=G.x,this.y2=G.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(G){var ee=this.state;Z.prototype.pointerUp.call(this,G),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(G),this._state="select",ee==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},U.prototype.adjustVisual=function(){},U.prototype.manipulate=function(G){this.state==="creating"?this.resize(G):this.state==="move"?(this.x1=this.manipulationStartX1+G.x-this.manipulationStartX,this.y1=this.manipulationStartY1+G.y-this.manipulationStartY,this.x2=this.manipulationStartX2+G.x-this.manipulationStartX,this.y2=this.manipulationStartY2+G.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(G)},U.prototype.resize=function(G){switch(this.activeGrip){case this.grip1:this.x1=G.x,this.y1=G.y;break;case this.grip2:case void 0:this.x2=G.x,this.y2=G.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=O.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 G=new r;return G.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(G.visual),G},U.prototype.positionGrips=function(){var G=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-G/2,this.y1-G/2),this.positionGrip(this.grip2.visual,this.x2-G/2,this.y2-G/2)},U.prototype.positionGrip=function(G,ee,ue){var J=G.transform.baseVal.getItem(0);J.setTranslate(ee,ue),G.transform.baseVal.replaceItem(J,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(G){Z.prototype.restoreState.call(this,G);var ee=G;this.x1=ee.x1,this.y1=ee.y1,this.x2=ee.x2,this.y2=ee.y2},U.prototype.scale=function(G,ee){Z.prototype.scale.call(this,G,ee),this.x1=this.x1*G,this.y1=this.y1*ee,this.x2=this.x2*G,this.y2=this.y2*ee,this.adjustVisual(),this.adjustControlBox()},U}(i),m=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=ue.defaultColor,J.strokeWidth=ue.defaultStrokeWidth,J.strokeDasharray=ue.defaultStrokeDasharray,J.strokePanel=new d("Line color",ue.defaultColorSet,ue.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new T("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new A("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return z(U,Z),U.prototype.ownsTarget=function(G){return!(!Z.prototype.ownsTarget.call(this,G)&&G!==this.visual&&G!==this.selectorLine&&G!==this.visibleLine)},U.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorLine=O.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=O.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(G,ee){Z.prototype.pointerDown.call(this,G,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()),O.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setStrokeColor=function(G){this.strokeColor=G,this.adjustVisual(),this.colorChanged(G)},U.prototype.setStrokeWidth=function(G){this.strokeWidth=G,this.adjustVisual()},U.prototype.setStrokeDasharray=function(G){this.strokeDasharray=G,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 G=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Z.prototype.getState.call(this));return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){Z.prototype.restoreState.call(this,G);var ee=G;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}(E),f=function(Z){function U(G,ee,ue,J){var we=Z.call(this,G,J||'<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 we.fonts=[],we.fontBoxes=[],we.fonts=ee,we.currentFont=ue,we.setCurrentFont=we.setCurrentFont.bind(we),we}return z(U,Z),U.prototype.getUi=function(){var G=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.flexGrow="2",this.fonts.forEach(function(ue){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/G.fonts.length-5+"%",J.style.borderColor=ue===G.currentFont?G.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){G.setCurrentFont(ue,J)}),ee.appendChild(J);var we=document.createElement("div");we.style.display="flex",we.style.minHeight="20px",we.style.flexGrow="2",we.style.fontFamily=ue,we.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",we.appendChild(Ge),J.appendChild(we),G.fontBoxes.push(J)}),ee},U.prototype.setCurrentFont=function(G,ee){var ue=this;this.currentFont=G,this.fontBoxes.forEach(function(J){J.style.borderColor=J===ee?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},U}(o),C=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=ue.defaultColor,J.fontFamily=ue.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new d("Color",ue.defaultColorSet,ue.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new f("Font",ue.defaultFontFamilies,ue.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return z(U,Z),U.prototype.ownsTarget=function(G){if(Z.prototype.ownsTarget.call(this,G)||G===this.visual||G===this.textElement||G===this.bgRectangle)return!0;var ee=!1;return this.textElement.childNodes.forEach(function(ue){ue===G&&(ee=!0)}),ee},U.prototype.createVisual=function(){this.visual=O.createGroup(),this.bgRectangle=O.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=O.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},U.prototype.pointerDown=function(G,ee){Z.prototype.pointerDown.call(this,G,ee),this.isMoved=!1,this.pointerDownPoint=G,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(G),this._state="creating")},U.prototype.renderText=function(){var G=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){G.textElement.appendChild(O.createTSpan(ee.trim()===""?" ":ee.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},U.prototype.getTextScale=function(){var G=this.textElement.getBBox(),ee=1;if(G.width>0&&G.height>0){var ue=(1*this.width-this.width*this.padding*2/100)/G.width,J=(1*this.height-this.height*this.padding*2/100)/G.height;ee=Math.min(ue,J)}return ee},U.prototype.getTextPosition=function(G){var ee=this.textElement.getBBox(),ue=0,J=0;return ee.width>0&&ee.height>0&&(ue=(this.width-ee.width*G)/2,J=this.height/2-ee.height*G/2),{x:ue,y:J}},U.prototype.sizeText=function(){var G=this.textElement.getBBox(),ee=this.getTextScale(),ue=this.getTextPosition(ee);ue.y-=G.y*ee,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ue.x+"px, "+ue.y+"px) scale("+ee+", "+ee+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ue.x,ue.y),this.textElement.transform.baseVal.getItem(1).setScale(ee,ee))},U.prototype.manipulate=function(G){Z.prototype.manipulate.call(this,G),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(G.x-this.pointerDownPoint.x)>5||Math.abs(G.y-this.pointerDownPoint.y)>5)},U.prototype.resize=function(G){Z.prototype.resize.call(this,G),this.isMoved=!0,this.setSize(),this.sizeText()},U.prototype.setSize=function(){Z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},U.prototype.pointerUp=function(G){var ee=this.state;ee==="creating"&&(this._suppressMarkerCreateEvent=!0),Z.prototype.pointerUp.call(this,G),this.setSize(),(ee==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},U.prototype.showTextEditor=function(){var G=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(G.textEditor.style.fontSize);G.textEditor.clientWidth>=Number.parseInt(G.textEditor.style.maxWidth)&&ee>.9;)ee-=.1,G.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 ue=ee.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(ue)),ee.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){G.textEditDivClicked(G.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 G=this.getTextScale(),ee=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ue=this.textElement.getBBox(),J={x:ue.width*G,y:ue.height*G};ee.x-=J.x/2,ee.y-=J.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*G,12)+"px",this.textElement.style.display="none"}},U.prototype.textEditDivClicked=function(G){this.text=G.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(G,ee){Z.prototype.dblClick.call(this,G,ee),this.showTextEditor()},U.prototype.setColor=function(G){this.textElement&&O.setAttributes(this.textElement,[["fill",G]]),this.color=G,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(G)},U.prototype.setFont=function(G){this.textElement&&O.setAttributes(this.textElement,[["font-family",G]]),this.fontFamily=G,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 G=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Z.prototype.getState.call(this));return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){var ee=G;this.color=ee.color,this.fontFamily=ee.fontFamily,this.padding=ee.padding,this.text=ee.text,this.createVisual(),Z.prototype.restoreState.call(this,G),this.setSize()},U.prototype.scale=function(G,ee){Z.prototype.scale.call(this,G,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),b=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=ue.defaultColor,J.lineWidth=ue.defaultStrokeWidth,J.pixelRatio=ue.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new d("Color",ue.defaultColorSet,ue.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new T("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return z(U,Z),U.prototype.ownsTarget=function(G){return!(!Z.prototype.ownsTarget.call(this,G)&&G!==this.visual&&G!==this.drawingImage)},U.prototype.createVisual=function(){this.visual=O.createGroup(),this.drawingImage=O.createImage(),this.visual.appendChild(this.drawingImage);var G=O.createTransform();this.visual.transform.baseVal.appendItem(G),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(G,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(G.x,G.y),this.drawing=!0):Z.prototype.pointerDown.call(this,G,ee)},U.prototype.manipulate=function(G){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(G.x,G.y),this.canvasContext.stroke()):Z.prototype.manipulate.call(this,G)},U.prototype.resize=function(G){Z.prototype.resize.call(this,G),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(G){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Z.prototype.pointerUp.call(this,G)},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 G=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ee=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ue=ee[0],J=ee[1],we=ee[2],Ge=ee[3],Je=!1,be=0;be<this.canvasElement.height;be++)for(var Re=0;Re<this.canvasElement.width;Re++)G.data[be*this.canvasElement.width*4+4*Re+3]>0&&(Je=!0,be<J&&(J=be),Re<ue&&(ue=Re),be>Ge&&(Ge=be),Re>we&&(we=Re));if(Je){this.left=ue/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(we-ue)/this.pixelRatio,this.height=(Ge-J)/this.pixelRatio;var xe=document.createElement("canvas");xe.width=we-ue,xe.height=Ge-J,xe.getContext("2d").putImageData(this.canvasContext.getImageData(ue,J,we-ue,Ge-J),0,0),this.drawingImgUrl=xe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},U.prototype.setDrawingImage=function(){O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},U.prototype.setColor=function(G){this.color=G,this.colorChanged(G)},U.prototype.setLineWidth=function(G){this.lineWidth=G},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 G=Object.assign({drawingImgUrl:this.drawingImgUrl},Z.prototype.getState.call(this));return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){this.createVisual(),Z.prototype.restoreState.call(this,G),this.drawingImgUrl=G.drawingImgUrl,this.setDrawingImage()},U.prototype.scale=function(G,ee){Z.prototype.scale.call(this,G,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),y=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ue||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return J.typeBoxes=[],J.currentType=ee,J.setCurrentType=J.setCurrentType.bind(J),J}return z(U,Z),U.prototype.getUi=function(){var G=this,ee=document.createElement("div");ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2";for(var ue=function(Ge){var Je="both";switch(Ge){case 0:Je="both";break;case 1:Je="start";break;case 2:Je="end";break;case 3:Je="none"}var be=document.createElement("div");if(be.style.display="flex",be.style.flexGrow="2",be.style.alignItems="center",be.style.justifyContent="space-between",be.style.padding="5px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderColor=Je===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){G.setCurrentType(Je,be)}),ee.appendChild(be),Je==="both"||Je==="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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Re.style.marginLeft="5px",be.appendChild(Re)}var xe=document.createElement("div");xe.style.display="flex",xe.style.alignItems="center",xe.style.minHeight="20px",xe.style.flexGrow="2";var Ce=document.createElement("hr");if(Ce.style.minWidth="20px",Ce.style.border="0px",Ce.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),Ce.style.flexGrow="2",xe.appendChild(Ce),be.appendChild(xe),Je==="both"||Je==="end"){var Be=document.createElement("div");Be.style.display="flex",Be.style.alignItems="center",Be.style.minHeight="20px",Be.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Be.style.marginRight="5px",be.appendChild(Be)}J.typeBoxes.push(be)},J=this,we=0;we<4;we++)ue(we);return ee},U.prototype.setCurrentType=function(G,ee){var ue=this;this.currentType=G,this.typeBoxes.forEach(function(J){J.style.borderColor=J===ee?ue.uiStyleSettings!==void 0?ue.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},U}(o),M=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new y("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return z(U,Z),U.prototype.ownsTarget=function(G){return!(!Z.prototype.ownsTarget.call(this,G)&&G!==this.arrow1&&G!==this.arrow2)},U.prototype.getArrowPoints=function(G,ee){var ue=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return G-ue/2+","+(ee+J/2)+" "+G+","+(ee-J/2)+" "+(G+ue/2)+","+(ee+J/2)},U.prototype.createTips=function(){this.arrow1=O.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=O.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow2)},U.prototype.pointerDown=function(G,ee){Z.prototype.pointerDown.call(this,G,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",O.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),O.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var G=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(G,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ee,0);var ue=this.arrow2.transform.baseVal.getItem(0);ue.setRotate(G+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ue,0)}},U.prototype.setArrowType=function(G){this.arrowType=G,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 G=Object.assign({arrowType:this.arrowType},Z.prototype.getState.call(this));return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){Z.prototype.restoreState.call(this,G);var ee=G;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),W=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.fillColor=ue.defaultFillColor,J.strokeWidth=0,J.fillPanel=new d("Color",ue.defaultColorSet,ue.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return z(U,Z),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var G=Z.prototype.getState.call(this);return G.typeName=U.typeName,G},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(G,ee,ue,J){var we=Z.call(this,G,J||'<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 we.opacities=[],we.opacityBoxes=[],we.opacities=ee,we.currentOpacity=ue,we.setCurrentOpacity=we.setCurrentOpacity.bind(we),we}return z(U,Z),U.prototype.getUi=function(){var G=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(ue){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ue===G.currentOpacity?G.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){G.setCurrentOpacity(ue,J)}),ee.appendChild(J);var we=document.createElement("div");we.innerText=100*ue+"%",J.appendChild(we),G.opacityBoxes.push(J)}),ee},U.prototype.setCurrentOpacity=function(G,ee){var ue=this;this.currentOpacity=G,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===ee?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},U}(o),K=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=ue.defaultHighlightColor,J.strokeWidth=0,J.opacity=ue.defaultHighlightOpacity,J.fillPanel=new d("Color",ue.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new L("Opacity",ue.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return z(U,Z),U.prototype.setOpacity=function(G){this.opacity=G,this.visual&&O.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 G=Z.prototype.getState.call(this);return G.typeName=U.typeName,G},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}(W),F='<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(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=ue.defaultStrokeColor,J.bgColor=ue.defaultFillColor,J.fontFamily=ue.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new d("Text color",ue.defaultColorSet,J.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>'),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new d("Fill color",ue.defaultColorSet,J.bgColor,F),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new f("Font",ue.defaultFontFamilies,ue.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new r,J.tipGrip.visual.transform.baseVal.appendItem(O.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return z(U,Z),U.prototype.ownsTarget=function(G){return Z.prototype.ownsTarget.call(this,G)||this.tipGrip.ownsTarget(G)||this.tip===G},U.prototype.createTip=function(){O.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=O.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},U.prototype.pointerDown=function(G,ee){this.state==="new"&&Z.prototype.pointerDown.call(this,G,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,G,ee)},U.prototype.pointerUp=function(G){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Z.prototype.pointerUp.call(this,G);else{var ee=this.state==="creating";Z.prototype.pointerUp.call(this,G),this.setTipPoints(ee),this.positionTip()}},U.prototype.manipulate=function(G){if(this.tipMoving){var ee=this.unrotatePoint(G);this.tipPosition={x:ee.x-this.manipulationStartLeft,y:ee.y-this.manipulationStartTop},this.positionTip()}else Z.prototype.manipulate.call(this,G)},U.prototype.setBgColor=function(G){this.bgRectangle&&this.tip&&(O.setAttributes(this.bgRectangle,[["fill",G]]),O.setAttributes(this.tip,[["fill",G]])),this.bgColor=G,this.fillColorChanged(G)},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(G){G===void 0&&(G=!1);var ee=Math.min(this.height/2,15),ue=this.height/5;G&&(this.tipPosition={x:ee+ue/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ue=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:0},this.tipBase2Position={x:ee+ue,y:0}):(this.tipBase1Position={x:0,y:ee},this.tipBase2Position={x:0,y:ee+ue}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ue=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-ue,y:0},this.tipBase2Position={x:this.width-ee,y:0}):(this.tipBase1Position={x:this.width,y:ee},this.tipBase2Position={x:this.width,y:ee+ue}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ue=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-ue,y:this.height},this.tipBase2Position={x:this.width-ee,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ee-ue},this.tipBase2Position={x:this.width,y:this.height-ee}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ue=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:this.height},this.tipBase2Position={x:ee+ue,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ee},this.tipBase2Position={x:0,y:this.height-ee-ue})},U.prototype.resize=function(G){Z.prototype.resize.call(this,G),this.positionTip()},U.prototype.positionTip=function(){O.setAttributes(this.tip,[["points",this.getTipPoints()]]);var G=this.tipGrip.visual.transform.baseVal.getItem(0);G.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(G,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 G=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Z.prototype.getState.call(this));return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){var ee=G;this.bgColor=ee.bgColor,this.tipPosition=ee.tipPosition,Z.prototype.restoreState.call(this,G),this.createTip(),this.setTipPoints()},U.prototype.scale=function(G,ee){Z.prototype.scale.call(this,G,ee),this.tipPosition={x:this.tipPosition.x*G,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}(C),V=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=ue.defaultColor,J.strokeWidth=ue.defaultStrokeWidth,J.strokeDasharray=ue.defaultStrokeDasharray,J.fillColor=ue.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new d("Line color",N(ue.defaultColorSet,["transparent"]),ue.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new d("Fill color",N(ue.defaultColorSet,["transparent"]),J.fillColor,F),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new T("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new A("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new L("Opacity",ue.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return z(U,Z),U.prototype.ownsTarget=function(G){return!(!Z.prototype.ownsTarget.call(this,G)&&G!==this.visual)},U.prototype.createVisual=function(){this.visual=O.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(G,ee){Z.prototype.pointerDown.call(this,G,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(G),this._state="creating")},U.prototype.manipulate=function(G){Z.prototype.manipulate.call(this,G)},U.prototype.resize=function(G){Z.prototype.resize.call(this,G),this.setSize()},U.prototype.setSize=function(){Z.prototype.setSize.call(this),O.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(G){Z.prototype.pointerUp.call(this,G),this.setSize()},U.prototype.setStrokeColor=function(G){this.strokeColor=G,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(G),this.stateChanged()},U.prototype.setFillColor=function(G){this.fillColor=G,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(G),this.stateChanged()},U.prototype.setStrokeWidth=function(G){this.strokeWidth=G,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},U.prototype.setStrokeDasharray=function(G){this.strokeDasharray=G,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},U.prototype.setOpacity=function(G){this.opacity=G,this.visual&&O.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 G=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this));return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){var ee=G;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,G),this.setSize()},U.prototype.scale=function(G,ee){Z.prototype.scale.call(this,G,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(G,ee,ue){return Z.call(this,G,ee,ue)||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(G){return!(!Z.prototype.ownsTarget.call(this,G)&&G!==this.tip1&&G!==this.tip2)},U.prototype.createTips=function(){this.tip1=O.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(O.createTransform()),this.visual.appendChild(this.tip1),this.tip2=O.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(O.createTransform()),this.visual.appendChild(this.tip2)},U.prototype.pointerDown=function(G,ee){Z.prototype.pointerDown.call(this,G,ee),this.state==="creating"&&this.createTips()},U.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(O.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()]]),O.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 G=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(G,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ee,0);var ue=this.tip2.transform.baseVal.getItem(0);ue.setRotate(G+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ue,0)}},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var G=Z.prototype.getState.call(this);return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){Z.prototype.restoreState.call(this,G),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(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.strokePanel.colors=ue.defaultColorSet,J.fillColor="transparent",J}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 G=Z.prototype.getState.call(this);return G.typeName=U.typeName,G},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}(),Le=function(Z){function U(G,ee,ue){var J=Z.call(this,G,ee,ue)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=ue.defaultColor,J.strokeWidth=ue.defaultStrokeWidth,J.strokeDasharray=ue.defaultStrokeDasharray,J.strokePanel=new d("Line color",ue.defaultColorSet,ue.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new T("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new A("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return z(U,Z),U.prototype.ownsTarget=function(G){return!(!Z.prototype.ownsTarget.call(this,G)&&G!==this.visual&&G!==this.selectorCurve&&G!==this.visibleCurve&&!this.curveGrip.ownsTarget(G))},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=O.createGroup(),this.selectorCurve=O.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=O.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(G,ee){Z.prototype.pointerDown.call(this,G,ee),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=G.x,this.curveY=G.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()),O.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setupControlBox=function(){Z.prototype.setupControlBox.call(this),this.curveControlLine1=O.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=O.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 G=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-G/2,this.curveY-G/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(G){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+G.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+G.y-this.manipulationStartY),Z.prototype.manipulate.call(this,G)},U.prototype.resize=function(G){this.activeGrip===this.curveGrip&&(this.curveX=G.x,this.curveY=G.y),Z.prototype.resize.call(this,G),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(G){this.strokeColor=G,this.adjustVisual(),this.colorChanged(G)},U.prototype.setStrokeWidth=function(G){this.strokeWidth=G,this.adjustVisual()},U.prototype.setStrokeDasharray=function(G){this.strokeDasharray=G,this.adjustVisual()},U.prototype.scale=function(G,ee){this.curveX=this.curveX*G,this.curveY=this.curveY*ee,Z.prototype.scale.call(this,G,ee)},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var G=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Z.prototype.getState.call(this));return G.typeName=U.typeName,G},U.prototype.restoreState=function(G){Z.prototype.restoreState.call(this,G);var ee=G;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}(E),Ae=function(){function Z(U,G){G===void 0&&(G=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=U,this.cancelable=G}return Object.defineProperty(Z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Z.prototype.preventDefault=function(){this._defaultPrevented=!0},Z}(),Pe=function(Z){function U(G,ee,ue){var J=Z.call(this,G,!1)||this;return J.dataUrl=ee,J.state=ue,J}return z(U,Z),U}(Ae),Fe=function(Z){function U(G,ee,ue){ue===void 0&&(ue=!1);var J=Z.call(this,G,ue)||this;return J.marker=ee,J}return z(U,Z),U}(Ae),je=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,G){this[U].push(G)},Z.prototype.removeEventListener=function(U,G){var ee=this[U].indexOf(G);ee>-1&&this[U].splice(ee,1)},Z}(),Te=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 je,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Z.instanceCounter++,this.styles=new I(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,b,M,C,se,V,K,R,ne,W,m,Le]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[w,b,M,C,V,K,R]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[w,b,M,C,K]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(U){var G=this;this._availableMarkerTypes.splice(0),U.forEach(function(ee){if(typeof ee=="string"){var ue=G.ALL_MARKER_TYPES.find(function(J){return J.typeName===ee});ue!==void 0&&G._availableMarkerTypes.push(ue)}else G._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(),H.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(G){return G(new Ae(U))})},Z.prototype.render=function(){return P(this,void 0,void 0,function(){var U;return Y(this,function(G){switch(G.label){case 0:return this.setCurrentMarker(),(U=new k).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 G.sent(),[4,U.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,G.sent()]}})})},Z.prototype.close=function(U){var G=this;if(U===void 0&&(U=!1),this.isOpen){var ee=!1;U||this.eventListeners.beforeclose.forEach(function(ue){var J=new Ae(G,!0);ue(J),J.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(ue){return ue(new Ae(G))}),this.detachEvents(),this._isOpen=!1)}},Z.prototype.addMarkersToToolbar=function(){for(var U,G=[],ee=0;ee<arguments.length;ee++)G[ee]=arguments[ee];(U=this._availableMarkerTypes).push.apply(U,G)},Z.prototype.addRenderEventListener=function(U){this.addEventListener("render",function(G){U(G.dataUrl,G.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,G=this.editorCanvas.clientWidth/U>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*U:this.editorCanvas.clientWidth,ee=G<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/U;this.resize(G,ee)},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.prototype.resize=function(U,G){this._isResizing=!0;var ee=U/this.imageWidth,ue=G/this.imageHeight;this.imageWidth=Math.round(U),this.imageHeight=Math.round(G),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,ue),this._isResizing=!1},Z.prototype.scaleMarkers=function(U,G){var ee,ue=this;this._currentMarker&&this._currentMarker instanceof C?this._currentMarker.scale(U,G):(ee=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==ue._currentMarker&&J.scale(U,G)}),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(),G=this.editorCanvas.getBoundingClientRect();this.left=U.left-G.left,this.top=U.top-G.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,G=[],ee=0;ee<arguments.length;ee++)G[ee]=arguments[ee];this.defs=O.createDefs(),this.addDefsToImage(),(U=this.defs).append.apply(U,G)},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,G){if(U==="marker"&&G!==void 0)this.createNewMarker(G);else if(U==="action")switch(G){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 G=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ue){var J=new Fe(U,U._currentMarker,!0);ue(J),J.defaultPrevented&&(G=!0)}),!G){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(ue){return ue(new Fe(U,ee))})}}},Z.prototype.clear=function(){var U=this,G=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(we){var Ge=new Fe(U,void 0,!0);we(Ge),Ge.defaultPrevented&&(G=!0)}),!G)){this.setCurrentMarker();for(var ee=function(we){var Ge=ue.markers[we];ue.setCurrentMarker(ue.markers[we]),ue._currentMarker.dispose(),ue.markerImage.removeChild(ue._currentMarker.container),ue.markers.splice(ue.markers.indexOf(ue._currentMarker),1),ue.eventListeners.markerdelete.forEach(function(Je){return Je(new Fe(U,Ge))})},ue=this,J=this.markers.length-1;J>=0;J--)ee(J);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 G=this.getState(),ee=this.undoRedoManager.getLastUndoStep();if(!ee||ee.width===G.width&&ee.height===G.height){var ue=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(G),ue<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new Ae(U))})}else this.undoRedoManager.replaceLastUndoStep(G),this.eventListeners.statechange.forEach(function(J){return J(new Ae(U))})}},Z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Z.prototype.undoStep=function(){var U=this,G=this.undoRedoManager.undo();G!==void 0&&(this.restoreState(G),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,G=this.undoRedoManager.redo();G!==void 0&&(this.restoreState(G),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,G,ee=this;return Y(this,function(ue){switch(ue.label){case 0:return[4,this.render()];case 1:return U=ue.sent(),G=this.getState(),this.eventListeners.render.forEach(function(J){return J(new Pe(ee,U,G))}),this.close(!0),[2]}})})},Z.prototype.getState=function(U){U===!0&&this.setCurrentMarker();var G={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ee){return G.markers.push(ee.getState())}),G},Z.prototype.restoreState=function(U){var G=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);U.markers.forEach(function(ee){var ue=G._availableMarkerTypes.find(function(we){return we.typeName===ee.typeName});if(ue!==void 0){var J=G.addNewMarker(ue);J.restoreState(ee),G.markers.push(J)}}),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(G))})},Z.prototype.addNewMarker=function(U){var G=O.createGroup();return this.markerImage.appendChild(G),new U(G,this.overlayContainer,this.settings)},Z.prototype.createNewMarker=function(U){var G,ee=this;(G=typeof U=="string"?this._availableMarkerTypes.find(function(ue){return ue.typeName===U}):U)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(G),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(G.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ue){return ue(new Fe(ee,ee._currentMarker))}))},Z.prototype.markerCreated=function(U){var G=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(U),this.setCurrentMarker(U),U instanceof b&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(b):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ee){return ee(new Fe(G,G._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 G=this;this.eventListeners.markerchange.forEach(function(ee){return ee(new Fe(G,U))})},Z.prototype.setCurrentMarker=function(U){var G=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 Fe(G,G._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 Fe(G,G._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 G=this.markers.find(function(ee){return ee.ownsTarget(U.target)});G!==void 0?(this.setCurrentMarker(G),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 G=this.markers.find(function(ee){return ee.ownsTarget(U.target)});G!==void 0&&G!==this._currentMarker&&this.setCurrentMarker(G),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,G){var ee=this.markerImage.getBoundingClientRect();return{x:(U-ee.left)/this.zoomLevel,y:(G-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){H.addKey(U)},Z.prototype.addEventListener=function(U,G){this.eventListeners.addEventListener(U,G)},Z.prototype.removeEventListener=function(U,G){this.eventListeners.removeEventListener(U,G)},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(G){return G(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(G){return G(new Ae(U))}))},Z.instanceCounter=0,Z}()},T8No:function(We,ge,D){"use strict";D.d(ge,"a",function(){return H}),D.d(ge,"e",function(){return k}),D.d(ge,"c",function(){return m}),D.d(ge,"b",function(){return f}),D.d(ge,"d",function(){return C}),D.d(ge,"f",function(){return M});var q=D("MNsG"),z=D("N0LK"),P=D("Cg/j");let Y=q.k||"";const N=new Map;N.set("false",!1),N.set("true",!0),N.set("isMac",q.f),N.set("isLinux",q.d),N.set("isWindows",q.i),N.set("isWeb",q.h),N.set("isMacNative",q.f&&!q.h),N.set("isEdge",Y.indexOf("Edg/")>=0),N.set("isFirefox",Y.indexOf("Firefox")>=0),N.set("isChrome",Y.indexOf("Chrome")>=0),N.set("isSafari",Y.indexOf("Safari")>=0);const O=Object.prototype.hasOwnProperty;class H{static has(L){return p.create(L)}static equals(L,K){return h.create(L,K)}static regex(L,K){return T.create(L,K)}static not(L){return i.create(L)}static and(...L){return v.create(L,null)}static or(...L){return E.create(L,null,!0)}static deserialize(L,K=!1){return L?this._deserializeOrExpression(L,K):void 0}static _deserializeOrExpression(L,K){let F=L.split("||");return E.create(F.map(R=>this._deserializeAndExpression(R,K)),null,!0)}static _deserializeAndExpression(L,K){let F=L.split("&&");return v.create(F.map(R=>this._deserializeOne(R,K)),null)}static _deserializeOne(L,K){if(L=L.trim(),L.indexOf("!=")>=0){let F=L.split("!=");return d.create(F[0].trim(),this._deserializeValue(F[1],K))}if(L.indexOf("==")>=0){let F=L.split("==");return h.create(F[0].trim(),this._deserializeValue(F[1],K))}if(L.indexOf("=~")>=0){let F=L.split("=~");return T.create(F[0].trim(),this._deserializeRegexValue(F[1],K))}if(L.indexOf(" in ")>=0){let F=L.split(" in ");return c.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(L)){const F=L.split(">=");return s.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(L)){const F=L.split(">");return r.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(L)){const F=L.split("<=");return x.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(L)){const F=L.split("<");return S.create(F[0].trim(),F[1].trim())}return/^\!\s*/.test(L)?i.create(L.substr(1).trim()):p.create(L)}static _deserializeValue(L,K){if(L=L.trim(),L==="true")return!0;if(L==="false")return!1;let F=/^'([^']*)'$/.exec(L);return F?F[1].trim():L}static _deserializeRegexValue(L,K){if(Object(z.C)(L)){if(K)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let F=L.indexOf("/"),R=L.lastIndexOf("/");if(F===R||F<0){if(K)throw new Error(`bad regexp-value '${L}', missing /-enclosure`);return console.warn(`bad regexp-value '${L}', missing /-enclosure`),null}let V=L.slice(F+1,R),ne=L[R+1]==="i"?"i":"";try{return new RegExp(V,ne)}catch(se){if(K)throw new Error(`bad regexp-value '${L}', parse error: ${se}`);return console.warn(`bad regexp-value '${L}', parse error: ${se}`),null}}}function k(L,K){const F=L?L.substituteConstants():void 0,R=K?K.substituteConstants():void 0;return!F&&!R?!0:!F||!R?!1:F.equals(R)}function n(L,K){return L.cmp(K)}class I{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}}I.INSTANCE=new I;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 I.INSTANCE}}g.INSTANCE=new g;class p{constructor(L,K){this.key=L,this.negated=K,this.type=2}static create(L,K=null){const F=N.get(L);return typeof F=="boolean"?F?g.INSTANCE:I.INSTANCE:new p(L,K)}cmp(L){return L.type!==this.type?this.type-L.type:b(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:I.INSTANCE:this}evaluate(L){return!!L.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this)),this.negated}}class h{constructor(L,K,F){this.key=L,this.value=K,this.negated=F,this.type=4}static create(L,K,F=null){if(typeof K=="boolean")return K?p.create(L,F):i.create(L,F);const R=N.get(L);if(typeof R=="boolean"){const V=R?"true":"false";return K===V?g.INSTANCE:I.INSTANCE}return new h(L,K,F)}cmp(L){return L.type!==this.type?this.type-L.type:y(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 K=L?"true":"false";return this.value===K?g.INSTANCE:I.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,K){this.key=L,this.valueKey=K,this.type=10,this.negated=null}static create(L,K){return new c(L,K)}cmp(L){return L.type!==this.type?this.type-L.type:y(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 K=L.getValue(this.valueKey),F=L.getValue(this.key);return Array.isArray(K)?K.indexOf(F)>=0:typeof F=="string"&&typeof K=="object"&&K!==null?O.call(K,F):!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,K,F){this.key=L,this.value=K,this.negated=F,this.type=5}static create(L,K,F=null){if(typeof K=="boolean")return K?i.create(L,F):p.create(L,F);const R=N.get(L);if(typeof R=="boolean"){const V=R?"true":"false";return K===V?I.INSTANCE:g.INSTANCE}return new d(L,K,F)}cmp(L){return L.type!==this.type?this.type-L.type:y(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 K=L?"true":"false";return this.value===K?I.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 i{constructor(L,K){this.key=L,this.negated=K,this.type=3}static create(L,K=null){const F=N.get(L);return typeof F=="boolean"?F?I.INSTANCE:g.INSTANCE:new i(L,K)}cmp(L){return L.type!==this.type?this.type-L.type:b(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?I.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,K){if(typeof L=="string"){const F=parseFloat(L);isNaN(F)||(L=F)}return typeof L=="string"||typeof L=="number"?K(L):I.INSTANCE}class r{constructor(L,K,F){this.key=L,this.value=K,this.negated=F,this.type=12}static create(L,K,F=null){return a(K,R=>new r(L,R,F))}cmp(L){return L.type!==this.type?this.type-L.type:y(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,K,F){this.key=L,this.value=K,this.negated=F,this.type=13}static create(L,K,F=null){return a(K,R=>new s(L,R,F))}cmp(L){return L.type!==this.type?this.type-L.type:y(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,K,F){this.key=L,this.value=K,this.negated=F,this.type=14}static create(L,K,F=null){return a(K,R=>new S(L,R,F))}cmp(L){return L.type!==this.type?this.type-L.type:y(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,K,F){this.key=L,this.value=K,this.negated=F,this.type=15}static create(L,K,F=null){return a(K,R=>new x(L,R,F))}cmp(L){return L.type!==this.type?this.type-L.type:y(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=r.create(this.key,this.value,this)),this.negated}}class T{constructor(L,K){this.key=L,this.regexp=K,this.type=7,this.negated=null}static create(L,K){return new T(L,K)}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 K=this.regexp?this.regexp.source:"",F=L.regexp?L.regexp.source:"";return K<F?-1:K>F?1:0}equals(L){if(L.type===this.type){const K=this.regexp?this.regexp.source:"",F=L.regexp?L.regexp.source:"";return this.key===L.key&&K===F}return!1}substituteConstants(){return this}evaluate(L){let K=L.getValue(this.key);return this.regexp?this.regexp.test(K):!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 K=null;for(let F=0,R=L.length;F<R;F++){const V=L[F].substituteConstants();if(L[F]!==V&&K===null){K=[];for(let ne=0;ne<F;ne++)K[ne]=L[ne]}K!==null&&(K[F]=V)}return K===null?L:K}class v{constructor(L,K){this.expr=L,this.negated=K,this.type=6}static create(L,K){return v._normalizeArr(L,K)}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 K=0,F=this.expr.length;K<F;K++){const R=n(this.expr[K],L.expr[K]);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 K=0,F=this.expr.length;K<F;K++)if(!this.expr[K].equals(L.expr[K]))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 K=0,F=this.expr.length;K<F;K++)if(!this.expr[K].evaluate(L))return!1;return!0}static _normalizeArr(L,K){const F=[];let R=!1;for(const V of L){if(!V)continue;if(V.type===1){R=!0;continue}if(V.type===0)return I.INSTANCE;if(V.type===6){F.push(...V.expr);continue}F.push(V)}if(F.length===0&&R)return g.INSTANCE;if(F.length===0)return;if(F.length===1)return F[0];F.sort(n);for(let V=1;V<F.length;V++)F[V-1].equals(F[V])&&(F.splice(V,1),V--);if(F.length===1)return F[0];for(;F.length>1;){const V=F[F.length-1];if(V.type!==9)break;F.pop();const ne=F.pop(),se=F.length===0,Se=E.create(V.expr.map(Le=>v.create([Le,ne],null)),null,se);Se&&(F.push(Se),F.sort(n))}return F.length===1?F[0]:new v(F,K)}serialize(){return this.expr.map(L=>L.serialize()).join(" && ")}keys(){const L=[];for(let K of this.expr)L.push(...K.keys());return L}negate(){if(!this.negated){const L=[];for(let K of this.expr)L.push(K.negate());this.negated=E.create(L,this,!0)}return this.negated}}class E{constructor(L,K){this.expr=L,this.negated=K,this.type=9}static create(L,K,F){return E._normalizeArr(L,K,F)}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 K=0,F=this.expr.length;K<F;K++){const R=n(this.expr[K],L.expr[K]);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 K=0,F=this.expr.length;K<F;K++)if(!this.expr[K].equals(L.expr[K]))return!1;return!0}return!1}substituteConstants(){const L=w(this.expr);return L===this.expr?this:E.create(L,this.negated,!1)}evaluate(L){for(let K=0,F=this.expr.length;K<F;K++)if(this.expr[K].evaluate(L))return!0;return!1}static _normalizeArr(L,K,F){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 I.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(F){for(let ne=0;ne<R.length;ne++)for(let se=ne+1;se<R.length;se++)M(R[ne],R[se])&&(R.splice(se,1),se--);if(R.length===1)return R[0]}return new E(R,K)}serialize(){return this.expr.map(L=>L.serialize()).join(" || ")}keys(){const L=[];for(let K of this.expr)L.push(...K.keys());return L}negate(){if(!this.negated){let L=[];for(let K of this.expr)L.push(K.negate());for(;L.length>1;){const K=L.shift(),F=L.shift(),R=[];for(const ne of W(K))for(const se of W(F))R.push(v.create([ne,se],null));const V=L.length===0;L.unshift(E.create(R,null,V))}this.negated=L[0]}return this.negated}}class m extends p{constructor(L,K,F){super(L,null);this._defaultValue=K,typeof F=="object"?m._info.push(Object.assign(Object.assign({},F),{key:L})):F!==!0&&m._info.push({key:L,description:F,type:K!=null?typeof K: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"),C="setContext";function b(L,K){return L<K?-1:L>K?1:0}function y(L,K,F,R){return L<F?-1:L>F?1:K<R?-1:K>R?1:0}function M(L,K){if(K.type===6&&L.type!==9&&L.type!==6){for(const V of K.expr)if(L.equals(V))return!0}const F=L.negate(),R=W(F).concat(W(K));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 Le=R[Se];if(se.equals(Le))return!0}}return!1}function W(L){return L.type===9?L.expr:[L]}},TXwP:function(We,ge,D){var q,z;(function(){var P;(function(){"use strict";var N=[,,function(n){function I(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=[]}I.prototype.clone_empty=function(){var h=new I(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},I.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},I.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},I.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))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var 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},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},I.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var 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 I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(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 I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},,,,function(n){function I(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"])}I.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},I.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},I.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},I.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},I.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]},I.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},I.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=I,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},,function(n){var I=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&&!(I&&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&&I&&(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 I(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")}I.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},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},,function(n,I,g){var p=g(16).Beautifier,h=g(17).Options;function c(o,d){var i=new p(o,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,I,g){var p=g(17).Options,h=g(2).Output,c=g(8).InputScanner,o=g(13).Directives,d=new o(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=/\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=r.test(this._input.peek()),v=0;r.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&&i.test(A||"")&&(w=A.match(i)[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 E=0,m=!1,f=!1,C=!1,b=!1,y=!1,M=!1,W=this._ch,L=!1,K,F,R;K=this._input.read(s),F=K!=="",R=W,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),W=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var 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(F),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"?b=!0:se==="import"&&(y=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!m&&E===0&&se.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(F),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),C?(C=!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),y=!1,b=!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||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!b&&E===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 Le=R==='"'||R==="'";this.preserveSingleSpace(Le||F),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")L=!1,E===0?(f&&(this.outdent(),f=!1),b=!1,y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),E++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),E&&(E--,this.outdent()));else{var Ae=!1;this._input.lookBack("with")&&(Ae=!0),this.preserveSingleSpace(F||Ae),this.print_string(this._ch),f&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),M=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),M&&this._input.peek()===";"&&this._options.selector_separator_newline&&(M=!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||M)&&E===0&&!y&&!b?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&E===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(F),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.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 Pe=R==='"'||R==="'";this.preserveSingleSpace(Pe||F),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&L&&this._output.add_new_line()}var Fe=this._output.get_code(w);return Fe},n.exports.Beautifier=T},function(n,I,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 i=0;i<d.length;i++)d[i]!=="expand"?this.brace_style="collapse":this.brace_style=d[i]}h.prototype=new p,n.exports.Options=h}],O={};function H(n){var I=O[n];if(I!==void 0)return I.exports;var g=O[n]={exports:{}};return N[n](g,g.exports,H),g.exports}var k=H(15);P=k})();var Y=P;!(q=[],z=function(){return{css_beautify:Y}}.apply(ge,q),z!==void 0&&(We.exports=z))})()},TcMa:function(We,ge,D){We.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:function(We,ge,D){},VEzc:function(We,ge,D){We.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(We,ge,D){"use strict";D.d(ge,"d",function(){return Y}),D.d(ge,"e",function(){return N}),D.d(ge,"c",function(){return O}),D.d(ge,"b",function(){return H}),D.d(ge,"a",function(){return k});var q=D("MI8n");class z{constructor(){this._icons=new Map,this._onDidRegister=new q.b}add(n){const I=this._icons.get(n.id);I?n.description?I.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new z,Y=P;function N(n,I){return new H(n,I)}function O(n){return n?n.replace(/\$\((.*?)\)/g,(I,g)=>` ${g} `).trim():""}class H{constructor(n,I,g){this.id=n,this.definition=I,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 k;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function g(c){if(c instanceof H)return["codicon","codicon-"+c.id];const o=I.exec(c.id);if(!o)return g(H.error);let[,d,i]=o;const a=["codicon","codicon-"+d];return i&&a.push("codicon-modifier-"+i.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})(k||(k={})),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"})}(H||(H={}))},"VrN/":function(We,ge,D){(function(q,z){We.exports=z()})(this,function(){"use strict";var q=navigator.userAgent,z=navigator.platform,P=/gecko\/\d/i.test(q),Y=/MSIE \d/.test(q),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),O=/Edge\/(\d+)/.exec(q),H=Y||N||O,k=H&&(Y?document.documentMode||6:+(O||N)[1]),n=!O&&/WebKit\//.test(q),I=n&&/Qt\/\d+\.\d+/.test(q),g=!O&&/Chrome\//.test(q),p=/Opera\//.test(q),h=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),o=/PhantomJS/.test(q),d=!O&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),i=/Android/.test(q),a=d||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),r=d||/Mac/.test(z),s=/\bCrOS\b/.test(q),S=/win/i.test(z),x=p&&q.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(p=!1,n=!0);var T=r&&(I||p&&(x==null||x<12.11)),A=P||H&&k>=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 _=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(_?l[1]+_:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function m(e,t){return E(e).appendChild(t)}function f(e,t,u,l){var _=document.createElement(e);if(u&&(_.className=u),l&&(_.style.cssText=l),typeof t=="string")_.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)_.appendChild(t[B]);return _}function C(e,t,u,l){var _=f(e,t,u,l);return _.setAttribute("role","presentation"),_}var b;document.createRange?b=function(e,t,u,l){var _=document.createRange();return _.setEnd(l||e,u),_.setStart(e,t),_}:b=function(e,t,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(_){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",t),l};function y(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 M(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function W(e,t){var 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 K=function(e){e.select()};d?K=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(K=function(e){try{e.select()}catch(t){}});function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function 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,_){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=l||0,Q=_||0;;){var ae=e.indexOf(" ",B);if(ae<0||ae>=t)return Q+(t-B);Q+=ae-B,Q+=u-Q%u,B=ae+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=F(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,Le={toString:function(){return"CodeMirror.Pass"}},Ae={scroll:!1},Pe={origin:"*mouse"},Fe={origin:"+move"};function je(e,t,u){for(var l=0,_=0;;){var B=e.indexOf(" ",l);B==-1&&(B=e.length);var Q=B-l;if(B==e.length||_+Q>=t)return l+Math.min(Q,t-_);if(_+=B-l,_+=u-_%u,l=B+1,_>=t)return l}}var Te=[""];function Z(e){for(;Te.length<=e;)Te.push(U(Te)+" ");return Te[e]}function U(e){return e[e.length-1]}function G(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,_=u(t);l<e.length&&u(e[l])<=_;)l++;e.splice(l,0,t)}function ue(){}function J(e,t){var u;return Object.create?u=Object.create(e):(ue.prototype=e,u=new ue),t&&R(t,u),u}var we=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ge(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||we.test(e))}function Je(e,t){return t?t.source.indexOf("\\w")>-1&&Ge(e)?!0:t.test(e):Ge(e)}function be(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 xe(e){return e.charCodeAt(0)>=768&&Re.test(e)}function Ce(e,t,u){for(;(u<0?t>0:t<e.length)&&xe(e.charAt(t));)t+=u;return t}function Be(e,t,u){for(var l=t>u?-1:1;;){if(t==u)return t;var _=(t+u)/2,B=l<0?Math.ceil(_):Math.floor(_);if(B==t)return e(B)?t:u;e(B)?u=B:t=B+l}}function Xe(e,t,u,l){if(!e)return l(t,u,"ltr",0);for(var _=!1,B=0;B<e.length;++B){var Q=e[B];(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",B),_=!0)}_||l(t,u,"ltr")}var qe=null;function tt(e,t,u){var l;qe=null;for(var _=0;_<e.length;++_){var B=e[_];if(B.from<t&&B.to>t)return _;B.to==t&&(B.from!=B.to&&u=="before"?l=_:qe=_),B.from==t&&(B.from!=B.to&&u!="before"?l=_:qe=_)}return l!=null?l:qe}var ht=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(me){return me<=247?e.charAt(me):1424<=me&&me<=1524?"R":1536<=me&&me<=1785?t.charAt(me-1536):1774<=me&&me<=2220?"r":8192<=me&&me<=8203?"w":me==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,_=/[stwN]/,B=/[LRr]/,Q=/[Lb1n]/,ae=/[1n]/;function oe(me,De,Me){this.level=me,this.from=De,this.to=Me}return function(me,De){var Me=De=="ltr"?"L":"R";if(me.length==0||De=="ltr"&&!l.test(me))return!1;for(var Ye=me.length,Ke=[],lt=0;lt<Ye;++lt)Ke.push(u(me.charCodeAt(lt)));for(var vt=0,bt=Me;vt<Ye;++vt){var It=Ke[vt];It=="m"?Ke[vt]=bt:bt=It}for(var Ft=0,Dt=Me;Ft<Ye;++Ft){var Vt=Ke[Ft];Vt=="1"&&Dt=="r"?Ke[Ft]="n":B.test(Vt)&&(Dt=Vt,Vt=="r"&&(Ke[Ft]="R"))}for(var gn=1,on=Ke[0];gn<Ye-1;++gn){var Wn=Ke[gn];Wn=="+"&&on=="1"&&Ke[gn+1]=="1"?Ke[gn]="1":Wn==","&&on==Ke[gn+1]&&(on=="1"||on=="n")&&(Ke[gn]=on),on=Wn}for(var mr=0;mr<Ye;++mr){var Vr=Ke[mr];if(Vr==",")Ke[mr]="N";else if(Vr=="%"){var Cr=void 0;for(Cr=mr+1;Cr<Ye&&Ke[Cr]=="%";++Cr);for(var Ri=mr&&Ke[mr-1]=="!"||Cr<Ye&&Ke[Cr]=="1"?"1":"N",gi=mr;gi<Cr;++gi)Ke[gi]=Ri;mr=Cr-1}}for(var Nr=0,vi=Me;Nr<Ye;++Nr){var Jr=Ke[Nr];vi=="L"&&Jr=="1"?Ke[Nr]="L":B.test(Jr)&&(vi=Jr)}for(var Wr=0;Wr<Ye;++Wr)if(_.test(Ke[Wr])){var Ur=void 0;for(Ur=Wr+1;Ur<Ye&&_.test(Ke[Ur]);++Ur);for(var Ar=(Wr?Ke[Wr-1]:Me)=="L",_i=(Ur<Ye?Ke[Ur]:Me)=="L",La=Ar==_i?Ar?"L":"R":Me,ua=Wr;ua<Ur;++ua)Ke[ua]=La;Wr=Ur-1}for(var ri=[],$i,Xr=0;Xr<Ye;)if(Q.test(Ke[Xr])){var Fs=Xr;for(++Xr;Xr<Ye&&Q.test(Ke[Xr]);++Xr);ri.push(new oe(0,Fs,Xr))}else{var qi=Xr,ma=ri.length,ga=De=="rtl"?1:0;for(++Xr;Xr<Ye&&Ke[Xr]!="L";++Xr);for(var ui=qi;ui<Xr;)if(ae.test(Ke[ui])){qi<ui&&(ri.splice(ma,0,new oe(1,qi,ui)),ma+=ga);var Ia=ui;for(++ui;ui<Xr&&ae.test(Ke[ui]);++ui);ri.splice(ma,0,new oe(2,Ia,ui)),ma+=ga,qi=ui}else++ui;qi<Xr&&ri.splice(ma,0,new oe(1,qi,Xr))}return De=="ltr"&&(ri[0].level==1&&($i=me.match(/^\s+/))&&(ri[0].from=$i[0].length,ri.unshift(new oe(0,0,$i[0].length))),U(ri).level==1&&($i=me.match(/\s+$/))&&(U(ri).to-=$i[0].length,ri.push(new oe(0,Ye-$i[0].length,Ye)))),De=="rtl"?ri.reverse():ri}}();function ft(e,t){var u=e.order;return u==null&&(u=e.order=ht(e.text,t)),u}var Ne=[],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]||Ne).concat(u)}};function Ze(e,t){return e._handlers&&e._handlers[t]||Ne}function et(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,_=l&&l[t];if(_){var B=se(_,u);B>-1&&(l[t]=_.slice(0,B).concat(_.slice(B+1)))}}}function fe(e,t){var u=Ze(e,t);if(!u.length)return;for(var l=Array.prototype.slice.call(arguments,2),_=0;_<u.length;++_)u[_].apply(null,l)}function re(e,t,u){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),fe(e,u||t.type,e,t),ye(t)||t.codemirrorIgnore}function ie(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 ce(e,t){return Ze(e,t).length>0}function pe(e){e.prototype.on=function(t,u){Ue(this,t,u)},e.prototype.off=function(t,u){et(this,t,u)}}function le(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function he(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ye(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function _e(e){le(e),he(e)}function Oe(e){return e.target||e.srcElement}function ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),r&&e.ctrlKey&&t==1&&(t=3),t}var $e=function(){if(H&&k<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),ot;function pt(e){if(ot==null){var t=f("span","\u200B");m(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ot=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&k<8))}var u=ot?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var mt;function qt(e){if(mt!=null)return mt;var t=m(e,document.createTextNode("A\u062EA")),u=b(t,0,1).getBoundingClientRect(),l=b(t,1,2).getBoundingClientRect();return E(e),!u||u.left==u.right?!1:mt=l.right-u.right<3}var xt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,u=[],l=e.length;t<=l;){var _=e.indexOf(`
|
|
`,t);_==-1&&(_=e.length);var B=e.slice(t,e.charAt(_-1)=="\r"?_-1:_),Q=B.indexOf("\r");Q!=-1?(u.push(B.slice(0,Q)),t+=Q+1):(u.push(B),t=_+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Ct=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},Pt=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Rt=null;function Gt(e){if(Rt!=null)return Rt;var t=m(e,f("span","x")),u=t.getBoundingClientRect(),l=b(t,0,1).getBoundingClientRect();return Rt=Math.abs(u.left-l.left)>1}var On={},kt={};function Un(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),On[e]=t}function An(e,t){kt[e]=t}function en(e){if(typeof e=="string"&&kt.hasOwnProperty(e))e=kt[e];else if(e&&typeof e.name=="string"&&kt.hasOwnProperty(e.name)){var t=kt[e.name];typeof t=="string"&&(t={name:t}),e=J(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return en("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return en("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wn(e,t){t=en(t);var u=On[t.name];if(!u)return wn(e,"text/plain");var l=u(e,t);if(Wt.hasOwnProperty(t.name)){var _=Wt[t.name];for(var B in _){if(!_.hasOwnProperty(B))continue;l.hasOwnProperty(B)&&(l["_"+B]=l[B]),l[B]=_[B]}}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 Wt={};function At(e,t){var u=Wt.hasOwnProperty(e)?Wt[e]:Wt[e]={};R(t,u)}function Zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var u={};for(var l in t){var _=t[l];_ instanceof Array&&(_=_.concat([])),u[l]=_}return u}function Ee(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 de(e,t,u){return e.startState?e.startState(t,u):!0}var j=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};j.prototype.eol=function(){return this.pos>=this.string.length},j.prototype.sol=function(){return this.pos==this.lineStart},j.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},j.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},j.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},j.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},j.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},j.prototype.skipToEnd=function(){this.pos=this.string.length},j.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},j.prototype.backUp=function(e){this.pos-=e},j.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)},j.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},j.prototype.match=function(e,t,u){if(typeof e=="string"){var l=function(Q){return u?Q.toLowerCase():Q},_=this.string.substr(this.pos,e.length);if(l(_)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},j.prototype.current=function(){return this.string.slice(this.start,this.pos)},j.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},j.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},j.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function X(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 _=u.children[l],B=_.chunkSize();if(t<B){u=_;break}t-=B}return u.lines[t]}function $(e,t,u){var l=[],_=t.line;return e.iter(t.line,u.line+1,function(B){var Q=B.text;_==u.line&&(Q=Q.slice(0,u.ch)),_==t.line&&(Q=Q.slice(t.ch)),l.push(Q),++_}),l}function te(e,t,u){var l=[];return e.iter(t,u,function(_){l.push(_.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 Ie(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 _=0;!(l.children[_]==t);++_)u+=l.children[_].chunkSize();return u+t.first}function He(e,t){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var _=e.children[l],B=_.height;if(t<B){e=_;continue e}t-=B,u+=_.chunkSize()}return u}while(!e.lines);for(var Q=0;Q<e.lines.length;++Q){var ae=e.lines[Q],oe=ae.height;if(t<oe)break;t-=oe}return u+Q}function ct(e,t){return t>=e.first&&t<e.first+e.size}function ut(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ze(e,t,u){if(u===void 0&&(u=null),!(this instanceof ze))return new ze(e,t,u);this.line=e,this.ch=t,this.sticky=u}function gt(e,t){return e.line-t.line||e.ch-t.ch}function Kt(e,t){return e.sticky==t.sticky&>(e,t)==0}function dt(e){return ze(e.line,e.ch)}function sn(e,t){return gt(e,t)<0?t:e}function jt(e,t){return gt(e,t)<0?e:t}function St(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function at(e,t){if(t.line<e.first)return ze(e.first,0);var u=e.first+e.size-1;return t.line>u?ze(u,X(e,u).text.length):xn(t,X(e,t.line).text.length)}function xn(e,t){var u=e.ch;return u==null||u>t?ze(e.line,t):u<0?ze(e.line,0):e}function it(e,t){for(var u=[],l=0;l<t.length;l++)u[l]=at(e,t[l]);return u}var ln=function(e,t){this.state=e,this.lookAhead=t},cn=function(e,t,u,l){this.state=t,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};cn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},cn.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}},cn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},cn.fromSaved=function(e,t,u){return t instanceof ln?new cn(e,Zt(e.mode,t.state),u,t.lookAhead):new cn(e,Zt(e.mode,t),u)},cn.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ln(t,this.maxLookAhead):t};function Yn(e,t,u,l){var _=[e.state.modeGen],B={};vr(e,t.text,e.doc.mode,u,function(me,De){return _.push(me,De)},B,l);for(var Q=u.state,ae=function(me){u.baseTokens=_;var De=e.state.overlays[me],Me=1,Ye=0;u.state=!0,vr(e,t.text,De.mode,u,function(Ke,lt){for(var vt=Me;Ye<Ke;){var bt=_[Me];bt>Ke&&_.splice(Me,1,Ke,_[Me+1],bt),Me+=2,Ye=Math.min(Ke,bt)}if(!lt)return;if(De.opaque)_.splice(vt,Me-vt,Ke,"overlay "+lt),Me=vt+2;else for(;vt<Me;vt+=2){var It=_[vt+1];_[vt+1]=(It?It+" ":"")+"overlay "+lt}},B),u.state=Q,u.baseTokens=null,u.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ae(oe);return{styles:_,classes:B.bgClass||B.textClass?B:null}}function nr(e,t,u){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=vn(e,Ie(t)),_=t.text.length>e.options.maxHighlightLength&&Zt(e.doc.mode,l.state),B=Yn(e,t,l);_&&(l.state=_),t.stateAfter=l.save(!_),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function vn(e,t,u){var l=e.doc,_=e.display;if(!l.mode.startState)return new cn(l,!0,t);var B=rr(e,t,u),Q=B>l.first&&X(l,B-1).stateAfter,ae=Q?cn.fromSaved(l,Q,B):new cn(l,de(l.mode),B);return l.iter(B,t,function(oe){gr(e,oe.text,ae);var me=ae.line;oe.stateAfter=me==t-1||me%5==0||me>=_.viewFrom&&me<_.viewTo?ae.save():null,ae.nextLine()}),u&&(l.modeFrontier=ae.line),ae}function gr(e,t,u,l){var _=e.doc.mode,B=new j(t,e.options.tabSize,u);for(B.start=B.pos=l||0,t==""&&Jn(_,u.state);!B.eol();)Cn(_,B,u.state),B.start=B.pos}function Jn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var u=Ee(e,t);if(u.mode.blankLine)return u.mode.blankLine(u.state)}function Cn(e,t,u,l){for(var _=0;_<10;_++){l&&(l[0]=Ee(e,u).mode);var B=e.token(t,u);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var Dn=function(e,t,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=u};function Dr(e,t,u,l){var _=e.doc,B=_.mode,Q;t=at(_,t);var ae=X(_,t.line),oe=vn(e,t.line,u),me=new j(ae.text,e.options.tabSize,oe),De;for(l&&(De=[]);(l||me.pos<t.ch)&&!me.eol();)me.start=me.pos,Q=Cn(B,me,oe.state),l&&De.push(new Dn(me,Q,Zt(_.mode,oe.state)));return l?De:new Dn(me,Q,oe.state)}function Hr(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 vr(e,t,u,l,_,B,Q){var ae=u.flattenSpans;ae==null&&(ae=e.options.flattenSpans);var oe=0,me=null,De=new j(t,e.options.tabSize,l),Me,Ye=e.options.addModeClass&&[null];for(t==""&&Hr(Jn(u,l.state),B);!De.eol();){if(De.pos>e.options.maxHighlightLength?(ae=!1,Q&&gr(e,t,l,De.pos),De.pos=t.length,Me=null):Me=Hr(Cn(u,De,l.state,Ye),B),Ye){var Ke=Ye[0].name;Ke&&(Me="m-"+(Me?Ke+" "+Me:Ke))}if(!ae||me!=Me){for(;oe<De.start;)oe=Math.min(De.start,oe+5e3),_(oe,me);me=Me}De.start=De.pos}for(;oe<De.pos;){var lt=Math.min(De.pos,oe+5e3);_(lt,me),oe=lt}}function rr(e,t,u){for(var l,_,B=e.doc,Q=u?-1:t-(e.doc.mode.innerMode?1e3:100),ae=t;ae>Q;--ae){if(ae<=B.first)return B.first;var oe=X(B,ae-1),me=oe.stateAfter;if(me&&(!u||ae+(me instanceof ln?me.lookAhead:0)<=B.modeFrontier))return ae;var De=V(oe.text,null,e.options.tabSize);(_==null||l>De)&&(_=ae-1,l=De)}return _}function yr(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 _=X(e,l).stateAfter;if(_&&(!(_ instanceof ln)||l+_.lookAhead<t)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}var Qr=!1,_r=!1;function ir(){Qr=!0}function Pr(){_r=!0}function Lr(e,t,u){this.marker=e,this.from=t,this.to=u}function Or(e,t){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==t)return l}}function Sr(e,t){for(var u,l=0;l<e.length;++l)e[l]!=t&&(u||(u=[])).push(e[l]);return u}function ci(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function yi(e,t,u){var l;if(e)for(var _=0;_<e.length;++_){var B=e[_],Q=B.marker,ae=B.from==null||(Q.inclusiveLeft?B.from<=t:B.from<t);if(ae||B.from==t&&Q.type=="bookmark"&&(!u||!B.marker.insertLeft)){var oe=B.to==null||(Q.inclusiveRight?B.to>=t:B.to>t);(l||(l=[])).push(new Lr(Q,B.from,oe?null:B.to))}}return l}function ii(e,t,u){var l;if(e)for(var _=0;_<e.length;++_){var B=e[_],Q=B.marker,ae=B.to==null||(Q.inclusiveRight?B.to>=t:B.to>t);if(ae||B.from==t&&Q.type=="bookmark"&&(!u||B.marker.insertLeft)){var oe=B.from==null||(Q.inclusiveLeft?B.from<=t:B.from<t);(l||(l=[])).push(new Lr(Q,oe?null:B.from-t,B.to==null?null:B.to-t))}}return l}function Zr(e,t){if(t.full)return null;var u=ct(e,t.from.line)&&X(e,t.from.line).markedSpans,l=ct(e,t.to.line)&&X(e,t.to.line).markedSpans;if(!u&&!l)return null;var _=t.from.ch,B=t.to.ch,Q=gt(t.from,t.to)==0,ae=yi(u,_,Q),oe=ii(l,B,Q),me=t.text.length==1,De=U(t.text).length+(me?_:0);if(ae)for(var Me=0;Me<ae.length;++Me){var Ye=ae[Me];if(Ye.to==null){var Ke=Or(oe,Ye.marker);Ke?me&&(Ye.to=Ke.to==null?null:Ke.to+De):Ye.to=_}}if(oe)for(var lt=0;lt<oe.length;++lt){var vt=oe[lt];if(vt.to!=null&&(vt.to+=De),vt.from==null){var bt=Or(ae,vt.marker);bt||(vt.from=De,me&&(ae||(ae=[])).push(vt))}else vt.from+=De,me&&(ae||(ae=[])).push(vt)}ae&&(ae=Ai(ae)),oe&&oe!=ae&&(oe=Ai(oe));var It=[ae];if(!me){var Ft=t.text.length-2,Dt;if(Ft>0&&ae)for(var Vt=0;Vt<ae.length;++Vt)ae[Vt].to==null&&(Dt||(Dt=[])).push(new Lr(ae[Vt].marker,null,null));for(var gn=0;gn<Ft;++gn)It.push(Dt);It.push(oe)}return It}function Ai(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 Ni(e,t,u){var l=null;if(e.iter(t.line,u.line+1,function(Ke){if(Ke.markedSpans)for(var lt=0;lt<Ke.markedSpans.length;++lt){var vt=Ke.markedSpans[lt].marker;vt.readOnly&&(!l||se(l,vt)==-1)&&(l||(l=[])).push(vt)}}),!l)return null;for(var _=[{from:t,to:u}],B=0;B<l.length;++B)for(var Q=l[B],ae=Q.find(0),oe=0;oe<_.length;++oe){var me=_[oe];if(gt(me.to,ae.from)<0||gt(me.from,ae.to)>0)continue;var De=[oe,1],Me=gt(me.from,ae.from),Ye=gt(me.to,ae.to);(Me<0||!Q.inclusiveLeft&&!Me)&&De.push({from:me.from,to:ae.from}),(Ye>0||!Q.inclusiveRight&&!Ye)&&De.push({from:ae.to,to:me.to}),_.splice.apply(_,De),oe+=De.length-3}return _}function Ui(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 ai(e,t){if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.attachLine(e);e.markedSpans=t}function pr(e){return e.inclusiveLeft?-1:0}function cr(e){return e.inclusiveRight?1:0}function Yr(e,t){var u=e.lines.length-t.lines.length;if(u!=0)return u;var l=e.find(),_=t.find(),B=gt(l.from,_.from)||pr(e)-pr(t);if(B)return-B;var Q=gt(l.to,_.to)||cr(e)-cr(t);return Q||t.id-e.id}function qr(e,t){var u=_r&&e.markedSpans,l;if(u)for(var _=void 0,B=0;B<u.length;++B)_=u[B],_.marker.collapsed&&(t?_.from:_.to)==null&&(!l||Yr(l,_.marker)<0)&&(l=_.marker);return l}function si(e){return qr(e,!0)}function ei(e){return qr(e,!1)}function zi(e,t){var u=_r&&e.markedSpans,l;if(u)for(var _=0;_<u.length;++_){var B=u[_];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!l||Yr(l,B.marker)<0)&&(l=B.marker)}return l}function ea(e,t,u,l,_){var B=X(e,t),Q=_r&&B.markedSpans;if(Q)for(var ae=0;ae<Q.length;++ae){var oe=Q[ae];if(!oe.marker.collapsed)continue;var me=oe.marker.find(0),De=gt(me.from,u)||pr(oe.marker)-pr(_),Me=gt(me.to,l)||cr(oe.marker)-cr(_);if(De>=0&&Me<=0||De<=0&&Me>=0)continue;if(De<=0&&(oe.marker.inclusiveRight&&_.inclusiveLeft?gt(me.to,u)>=0:gt(me.to,u)>0)||De>=0&&(oe.marker.inclusiveRight&&_.inclusiveLeft?gt(me.from,l)<=0:gt(me.from,l)<0))return!0}}function ti(e){for(var t;t=si(e);)e=t.find(-1,!0).line;return e}function di(e){for(var t;t=ei(e);)e=t.find(1,!0).line;return e}function Li(e){for(var t,u;t=ei(e);)e=t.find(1,!0).line,(u||(u=[])).push(e);return u}function Bi(e,t){var u=X(e,t),l=ti(u);return u==l?t:Ie(l)}function Ii(e,t){if(t>e.lastLine())return t;var u=X(e,t),l;if(!bi(e,u))return t;for(;l=ei(u);)u=l.find(1,!0).line;return Ie(u)+1}function bi(e,t){var u=_r&&t.markedSpans;if(u)for(var l=void 0,_=0;_<u.length;++_){if(l=u[_],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&Vi(e,t,l))return!0}}function Vi(e,t,u){if(u.to==null){var l=u.marker.find(1,!0);return Vi(e,l.line,Or(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==t.text.length)return!0;for(var _=void 0,B=0;B<t.markedSpans.length;++B)if(_=t.markedSpans[B],_.marker.collapsed&&!_.marker.widgetNode&&_.from==u.to&&(_.to==null||_.to!=u.from)&&(_.marker.inclusiveLeft||u.marker.inclusiveRight)&&Vi(e,t,_))return!0}function hi(e){e=ti(e);for(var t=0,u=e.parent,l=0;l<u.lines.length;++l){var _=u.lines[l];if(_==e)break;t+=_.height}for(var B=u.parent;B;u=B,B=u.parent)for(var Q=0;Q<B.children.length;++Q){var ae=B.children[Q];if(ae==u)break;t+=ae.height}return t}function Xi(e){if(e.height==0)return 0;for(var t=e.text.length,u,l=e;u=si(l);){var _=u.find(0,!0);l=_.from.line,t+=_.from.ch-_.to.ch}for(l=e;u=ei(l);){var B=u.find(0,!0);t-=l.text.length-B.from.ch,l=B.to.line,t+=l.text.length-B.to.ch}return t}function Yi(e){var t=e.display,u=e.doc;t.maxLine=X(u,u.first),t.maxLineLength=Xi(t.maxLine),t.maxLineChanged=!0,u.iter(function(l){var _=Xi(l);_>t.maxLineLength&&(t.maxLineLength=_,t.maxLine=l)})}var oi=function(e,t,u){this.text=e,ai(this,t),this.height=u?u(this):1};oi.prototype.lineNo=function(){return Ie(this)},pe(oi);function Ji(e,t,u,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ui(e),ai(e,u);var _=l?l(e):1;_!=e.height&&ve(e,_)}function Jt(e){e.parent=null,Ui(e)}var pn={},nn={};function Ln(e,t){if(!e||/^\s*$/.test(e))return null;var u=t.addModeClass?nn:pn;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function Hn(e,t){var u=C("span",null,null,n?"padding-right: .1px":null),l={pre:C("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var _=0;_<=(t.rest?t.rest.length:0);_++){var B=_?t.rest[_-1]:t.line,Q=void 0;l.pos=0,l.addToken=In,qt(e.display.measure)&&(Q=ft(B,e.doc.direction))&&(l.addToken=Fr(l.addToken,Q)),l.map=[];var ae=t!=e.display.externalMeasured&&Ie(B);fi(B,l,nr(e,B,ae)),B.styleClasses&&(B.styleClasses.bgClass&&(l.bgClass=L(B.styleClasses.bgClass,l.bgClass||"")),B.styleClasses.textClass&&(l.textClass=L(B.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(pt(e.display.measure))),_==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 oe=l.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.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 In(e,t,u,l,_,B,Q){if(!t)return;var ae=e.splitSpaces?br(t,e.trailingSpace):t,oe=e.cm.state.specialChars,me=!1,De;if(!oe.test(t))e.col+=t.length,De=document.createTextNode(ae),e.map.push(e.pos,e.pos+t.length,De),H&&k<9&&(me=!0),e.pos+=t.length;else{De=document.createDocumentFragment();for(var Me=0;;){oe.lastIndex=Me;var Ye=oe.exec(t),Ke=Ye?Ye.index-Me:t.length-Me;if(Ke){var lt=document.createTextNode(ae.slice(Me,Me+Ke));H&&k<9?De.appendChild(f("span",[lt])):De.appendChild(lt),e.map.push(e.pos,e.pos+Ke,lt),e.col+=Ke,e.pos+=Ke}if(!Ye)break;Me+=Ke+1;var vt=void 0;if(Ye[0]==" "){var bt=e.cm.options.tabSize,It=bt-e.col%bt;vt=De.appendChild(f("span",Z(It),"cm-tab")),vt.setAttribute("role","presentation"),vt.setAttribute("cm-text"," "),e.col+=It}else Ye[0]=="\r"||Ye[0]==`
|
|
`?(vt=De.appendChild(f("span",Ye[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),vt.setAttribute("cm-text",Ye[0]),e.col+=1):(vt=e.cm.options.specialCharPlaceholder(Ye[0]),vt.setAttribute("cm-text",Ye[0]),H&&k<9?De.appendChild(f("span",[vt])):De.appendChild(vt),e.col+=1);e.map.push(e.pos,e.pos+1,vt),e.pos++}}if(e.trailingSpace=ae.charCodeAt(t.length-1)==32,u||l||_||me||B||Q){var Ft=u||"";l&&(Ft+=l),_&&(Ft+=_);var Dt=f("span",[De],Ft,B);if(Q)for(var Vt in Q)Q.hasOwnProperty(Vt)&&Vt!="style"&&Vt!="class"&&Dt.setAttribute(Vt,Q[Vt]);return e.content.appendChild(Dt)}e.content.appendChild(De)}function br(e,t){if(e.length>1&&!/ /.test(e))return e;for(var u=t,l="",_=0;_<e.length;_++){var B=e.charAt(_);B==" "&&u&&(_==e.length-1||e.charCodeAt(_+1)==32)&&(B="\xA0"),l+=B,u=B==" "}return l}function Fr(e,t){return function(u,l,_,B,Q,ae,oe){_=_?_+" cm-force-border":"cm-force-border";for(var me=u.pos,De=me+l.length;;){for(var Me=void 0,Ye=0;Ye<t.length&&!(Me=t[Ye],Me.to>me&&Me.from<=me);Ye++);if(Me.to>=De)return e(u,l,_,B,Q,ae,oe);e(u,l.slice(0,Me.to-me),_,B,null,ae,oe),B=null,l=l.slice(Me.to-me),me=Me.to}}}function Fn(e,t,u,l){var _=!l&&u.widgetNode;_&&e.map.push(e.pos,e.pos+t,_),!l&&e.cm.display.input.needsContentAttribute&&(_||(_=e.content.appendChild(document.createElement("span"))),_.setAttribute("cm-marker",u.id)),_&&(e.cm.display.input.setUneditable(_),e.content.appendChild(_)),e.pos+=t,e.trailingSpace=!1}function fi(e,t,u){var l=e.markedSpans,_=e.text,B=0;if(!l){for(var Q=1;Q<u.length;Q+=2)t.addToken(t,_.slice(B,B=u[Q]),Ln(u[Q+1],t.cm.options));return}for(var ae=_.length,oe=0,me=1,De="",Me,Ye,Ke=0,lt,vt,bt,It,Ft;;){if(Ke==oe){lt=vt=bt=Ye="",Ft=null,It=null,Ke=Infinity;for(var Dt=[],Vt=void 0,gn=0;gn<l.length;++gn){var on=l[gn],Wn=on.marker;if(Wn.type=="bookmark"&&on.from==oe&&Wn.widgetNode)Dt.push(Wn);else if(on.from<=oe&&(on.to==null||on.to>oe||Wn.collapsed&&on.to==oe&&on.from==oe)){if(on.to!=null&&on.to!=oe&&Ke>on.to&&(Ke=on.to,vt=""),Wn.className&&(lt+=" "+Wn.className),Wn.css&&(Ye=(Ye?Ye+";":"")+Wn.css),Wn.startStyle&&on.from==oe&&(bt+=" "+Wn.startStyle),Wn.endStyle&&on.to==Ke&&(Vt||(Vt=[])).push(Wn.endStyle,on.to),Wn.title&&((Ft||(Ft={})).title=Wn.title),Wn.attributes)for(var mr in Wn.attributes)(Ft||(Ft={}))[mr]=Wn.attributes[mr];Wn.collapsed&&(!It||Yr(It.marker,Wn)<0)&&(It=on)}else on.from>oe&&Ke>on.from&&(Ke=on.from)}if(Vt)for(var Vr=0;Vr<Vt.length;Vr+=2)Vt[Vr+1]==Ke&&(vt+=" "+Vt[Vr]);if(!It||It.from==oe)for(var Cr=0;Cr<Dt.length;++Cr)Fn(t,0,Dt[Cr]);if(It&&(It.from||0)==oe){if(Fn(t,(It.to==null?ae+1:It.to)-oe,It.marker,It.from==null),It.to==null)return;It.to==oe&&(It=!1)}}if(oe>=ae)break;for(var Ri=Math.min(ae,Ke);;){if(De){var gi=oe+De.length;if(!It){var Nr=gi>Ri?De.slice(0,Ri-oe):De;t.addToken(t,Nr,Me?Me+lt:lt,bt,oe+Nr.length==Ke?vt:"",Ye,Ft)}if(gi>=Ri){De=De.slice(Ri-oe),oe=Ri;break}oe=gi,bt=""}De=_.slice(B,B=u[me++]),Me=Ln(u[me++],t.cm.options)}}}function Qn(e,t,u){this.line=t,this.rest=Li(t),this.size=this.rest?Ie(U(this.rest))-u+1:1,this.node=this.text=null,this.hidden=bi(e,t)}function Ve(e,t,u){for(var l=[],_,B=t;B<u;B=_){var Q=new Qn(e.doc,X(e.doc,B),B);_=B+Q.size,l.push(Q)}return l}var rt=null;function Et(e){rt?rt.ops.push(e):e.ownsGroup=rt={ops:[e],delayedCallbacks:[]}}function $t(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 _=e.ops[l];if(_.cursorActivityHandlers)for(;_.cursorActivityCalled<_.cursorActivityHandlers.length;)_.cursorActivityHandlers[_.cursorActivityCalled++].call(null,_.cm)}}while(u<t.length)}function Ut(e,t){var u=e.ownsGroup;if(!u)return;try{$t(u)}finally{rt=null,t(u)}}var Ot=null;function Qe(e,t){var u=Ze(e,t);if(!u.length)return;var l=Array.prototype.slice.call(arguments,2),_;rt?_=rt.delayedCallbacks:Ot?_=Ot:(_=Ot=[],setTimeout(st,0));for(var B=function(ae){_.push(function(){return u[ae].apply(null,l)})},Q=0;Q<u.length;++Q)B(Q)}function st(){var e=Ot;Ot=null;for(var t=0;t<e.length;++t)e[t]()}function Xt(e,t,u,l){for(var _=0;_<t.changes.length;_++){var B=t.changes[_];B=="text"?tn(e,t):B=="gutter"?Sn(e,t,u,l):B=="class"?Pn(e,t):B=="widget"&&dn(e,t,l)}t.changes=null}function nt(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),H&&k<8&&(e.node.style.zIndex=2)),e.node}function Yt(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=nt(t);t.background=l.insertBefore(f("div",null,u),l.firstChild),e.display.input.setUneditable(t.background)}}function _t(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 tn(e,t){var u=t.text.className,l=_t(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,Pn(e,t)):u&&(t.text.className=u)}function Pn(e,t){Yt(e,t),t.line.wrapClass?nt(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 Sn(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 _=nt(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),_.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var Q=nt(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&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=ae.appendChild(f("div",ut(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var me=e.display.gutterSpecs[oe].className,De=B.hasOwnProperty(me)&&B[me];De&&ae.appendChild(f("div",[De],"CodeMirror-gutter-elt","left: "+l.gutterLeft[me]+"px; width: "+l.gutterWidth[me]+"px"))}}}function dn(e,t,u){t.alignable&&(t.alignable=null);for(var l=w("CodeMirror-linewidget"),_=t.node.firstChild,B=void 0;_;_=B)B=_.nextSibling,l.test(_.className)&&t.node.removeChild(_);_n(e,t,u)}function Xn(e,t,u,l){var _=_t(e,t);return t.text=t.node=_.pre,_.bgClass&&(t.bgClass=_.bgClass),_.textClass&&(t.textClass=_.textClass),Pn(e,t),Sn(e,t,u,l),_n(e,t,l),t.node}function _n(e,t,u){if(Gn(e,t.line,t,u,!0),t.rest)for(var l=0;l<t.rest.length;l++)Gn(e,t.rest[l],t,u,!1)}function Gn(e,t,u,l,_){if(!t.widgets)return;for(var B=nt(u),Q=0,ae=t.widgets;Q<ae.length;++Q){var oe=ae[Q],me=f("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||me.setAttribute("cm-ignore-events","true"),Kn(oe,me,u,l),e.display.input.setUneditable(me),_&&oe.above?B.insertBefore(me,u.gutter||u.text):B.appendChild(me),Qe(oe,"redraw")}}function Kn(e,t,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(t);var _=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(_-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=_+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function dr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(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 Rn(e,t){for(var u=Oe(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 or(e){return e.lineSpace.offsetTop}function lr(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 Tn(e){return Se-e.display.nativeBarWidth}function zn(e){return e.display.scroller.clientWidth-Tn(e)-e.display.barWidth}function kn(e){return e.display.scroller.clientHeight-Tn(e)-e.display.barHeight}function wt(e,t,u){var l=e.options.lineWrapping,_=l&&zn(e);if(!t.measure.heights||l&&t.measure.width!=_){var B=t.measure.heights=[];if(l){t.measure.width=_;for(var Q=t.text.firstChild.getClientRects(),ae=0;ae<Q.length-1;ae++){var oe=Q[ae],me=Q[ae+1];Math.abs(oe.bottom-me.bottom)>2&&B.push((oe.bottom+me.top)/2-u.top)}}B.push(u.bottom-u.top)}}function hn(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 _=0;_<e.rest.length;_++)if(Ie(e.rest[_])>u)return{map:e.measure.maps[_],cache:e.measure.caches[_],before:!0}}function Zn(e,t){t=ti(t);var u=Ie(t),l=e.display.externalMeasured=new Qn(e.doc,t,u);l.lineN=u;var _=l.built=Hn(e,l);return l.text=_.pre,m(e.display.lineMeasure,_.pre),l}function ur(e,t,u,l){return bn(e,Vn(e,t),u,l)}function er(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ti(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=Ie(t),l=er(e,u);l&&!l.text?l=null:l&&l.changes&&(Xt(e,l,u,Rr(e)),e.curOp.forceUpdate=!0),l||(l=Zn(e,t));var _=hn(l,t,u);return{line:t,view:l,rect:null,map:_.map,cache:_.cache,before:_.before,hasHeights:!1}}function bn(e,t,u,l,_){t.before&&(u=-1);var B=u+(l||""),Q;return t.cache.hasOwnProperty(B)?Q=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(wt(e,t.view,t.rect),t.hasHeights=!0),Q=Lt(e,t,u,l),Q.bogus||(t.cache[B]=Q)),{left:Q.left,right:Q.right,top:_?Q.rtop:Q.top,bottom:_?Q.rbottom:Q.bottom}}var rn={left:0,right:0,top:0,bottom:0};function mn(e,t,u){for(var l,_,B,Q,ae,oe,me=0;me<e.length;me+=3)if(ae=e[me],oe=e[me+1],t<ae?(_=0,B=1,Q="left"):t<oe?(_=t-ae,B=_+1):(me==e.length-3||t==oe&&e[me+3]>t)&&(B=oe-ae,_=B-1,t>=oe&&(Q="right")),_!=null){if(l=e[me+2],ae==oe&&u==(l.insertLeft?"left":"right")&&(Q=u),u=="left"&&_==0)for(;me&&e[me-2]==e[me-3]&&e[me-1].insertLeft;)l=e[(me-=3)+2],Q="left";if(u=="right"&&_==oe-ae)for(;me<e.length-3&&e[me+3]==e[me+4]&&!e[me+5].insertLeft;)l=e[(me+=3)+2],Q="right";break}return{node:l,start:_,end:B,collapse:Q,coverStart:ae,coverEnd:oe}}function Tt(e,t){var u=rn;if(t=="left")for(var l=0;l<e.length&&!((u=e[l]).left!=u.right);l++);else for(var _=e.length-1;_>=0&&!((u=e[_]).left!=u.right);_--);return u}function Lt(e,t,u,l){var _=mn(t.map,u,l),B=_.node,Q=_.start,ae=_.end,oe=_.collapse,me;if(B.nodeType==3){for(var De=0;De<4;De++){for(;Q&&xe(t.line.text.charAt(_.coverStart+Q));)--Q;for(;_.coverStart+ae<_.coverEnd&&xe(t.line.text.charAt(_.coverStart+ae));)++ae;if(H&&k<9&&Q==0&&ae==_.coverEnd-_.coverStart?me=B.parentNode.getBoundingClientRect():me=Tt(b(B,Q,ae).getClientRects(),l),me.left||me.right||Q==0)break;ae=Q,Q=Q-1,oe="right"}H&&k<11&&(me=Bt(e.display.measure,me))}else{Q>0&&(oe=l="right");var Me;e.options.lineWrapping&&(Me=B.getClientRects()).length>1?me=Me[l=="right"?Me.length-1:0]:me=B.getBoundingClientRect()}if(H&&k<9&&!Q&&(!me||!me.left&&!me.right)){var Ye=B.parentNode.getClientRects()[0];Ye?me={left:Ye.left,right:Ye.left+jn(e.display),top:Ye.top,bottom:Ye.bottom}:me=rn}for(var Ke=me.top-t.rect.top,lt=me.bottom-t.rect.top,vt=(Ke+lt)/2,bt=t.view.measure.heights,It=0;It<bt.length-1&&!(vt<bt[It]);It++);var Ft=It?bt[It-1]:0,Dt=bt[It],Vt={left:(oe=="right"?me.right:me.left)-t.rect.left,right:(oe=="left"?me.left:me.right)-t.rect.left,top:Ft,bottom:Dt};return!me.left&&!me.right&&(Vt.bogus=!0),e.options.singleCursorHeightPerLine||(Vt.rtop=Ke,Vt.rbottom=lt),Vt}function Bt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Gt(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 Ht(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 yt(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ht(e.display.view[t])}function Mt(e){yt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Qt(){return g&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function tr(){return g&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Er(e){var t=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(t+=dr(e.widgets[u]));return t}function Gr(e,t,u,l,_){if(!_){var B=Er(t);u.top+=B,u.bottom+=B}if(l=="line")return u;l||(l="local");var Q=hi(t);if(l=="local"?Q+=or(e.display):Q-=e.display.viewOffset,l=="page"||l=="window"){var ae=e.display.lineSpace.getBoundingClientRect();Q+=ae.top+(l=="window"?0:tr());var oe=ae.left+(l=="window"?0:Qt());u.left+=oe,u.right+=oe}return u.top+=Q,u.bottom+=Q,u}function kr(e,t,u){if(u=="div")return t;var l=t.left,_=t.top;if(u=="page")l-=Qt(),_-=tr();else if(u=="local"||!u){var B=e.display.sizer.getBoundingClientRect();l+=B.left,_+=B.top}var Q=e.display.lineSpace.getBoundingClientRect();return{left:l-Q.left,top:_-Q.top}}function Ei(e,t,u,l,_){return l||(l=X(e.doc,t.line)),Gr(e,l,ur(e,l,t.ch,_),u)}function qn(e,t,u,l,_,B){l=l||X(e.doc,t.line),_||(_=Vn(e,l));function Q(lt,vt){var bt=bn(e,_,lt,vt?"right":"left",B);return vt?bt.left=bt.right:bt.right=bt.left,Gr(e,l,bt,u)}var ae=ft(l,e.doc.direction),oe=t.ch,me=t.sticky;if(oe>=l.text.length?(oe=l.text.length,me="before"):oe<=0&&(oe=0,me="after"),!ae)return Q(me=="before"?oe-1:oe,me=="before");function De(lt,vt,bt){var It=ae[vt],Ft=It.level==1;return Q(bt?lt-1:lt,Ft!=bt)}var Me=tt(ae,oe,me),Ye=qe,Ke=De(oe,Me,me=="before");return Ye!=null&&(Ke.other=De(oe,Ye,me!="before")),Ke}function xi(e,t){var u=0;t=at(e.doc,t),e.options.lineWrapping||(u=jn(e.display)*t.ch);var l=X(e.doc,t.line),_=hi(l)+or(e.display);return{left:u,right:u,top:_,bottom:_+l.height}}function Di(e,t,u,l,_){var B=ze(e,t,u);return B.xRel=_,l&&(B.outside=l),B}function Wi(e,t,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Di(l.first,0,null,-1,-1);var _=He(l,u),B=l.first+l.size-1;if(_>B)return Di(l.first+l.size-1,X(l,B).text.length,null,1,1);t<0&&(t=0);for(var Q=X(l,_);;){var ae=ta(e,Q,_,t,u),oe=zi(Q,ae.ch+(ae.xRel>0||ae.outside>0?1:0));if(!oe)return ae;var me=oe.find(1);if(me.line==_)return me;Q=X(l,_=me.line)}}function Pi(e,t,u,l){l-=Er(t);var _=t.text.length,B=Be(function(Q){return bn(e,u,Q-1).bottom<=l},_,0);return _=Be(function(Q){return bn(e,u,Q).top>l},B,_),{begin:B,end:_}}function ca(e,t,u,l){u||(u=Vn(e,t));var _=Gr(e,t,bn(e,u,l),"line").top;return Pi(e,t,u,_)}function pi(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,_){_-=hi(t);var B=Vn(e,t),Q=Er(t),ae=0,oe=t.text.length,me=!0,De=ft(t,e.doc.direction);if(De){var Me=(e.options.lineWrapping?ar:Da)(e,t,u,B,De,l,_);me=Me.level!=1,ae=me?Me.from:Me.to-1,oe=me?Me.to:Me.from-1}var Ye=null,Ke=null,lt=Be(function(gn){var on=bn(e,B,gn);return on.top+=Q,on.bottom+=Q,pi(on,l,_,!1)?(on.top<=_&&on.left<=l&&(Ye=gn,Ke=on),!0):!1},ae,oe),vt,bt,It=!1;if(Ke){var Ft=l-Ke.left<Ke.right-l,Dt=Ft==me;lt=Ye+(Dt?0:1),bt=Dt?"after":"before",vt=Ft?Ke.left:Ke.right}else{!me&&(lt==oe||lt==ae)&<++,bt=lt==0?"after":lt==t.text.length?"before":bn(e,B,lt-(me?1:0)).bottom+Q<=_==me?"after":"before";var Vt=qn(e,ze(u,lt,bt),"line",t,B);vt=Vt.left,It=_<Vt.top?-1:_>=Vt.bottom?1:0}return lt=Ce(t.text,lt,1),Di(u,lt,bt,It,l-vt)}function Da(e,t,u,l,_,B,Q){var ae=Be(function(Me){var Ye=_[Me],Ke=Ye.level!=1;return pi(qn(e,ze(u,Ke?Ye.to:Ye.from,Ke?"before":"after"),"line",t,l),B,Q,!0)},0,_.length-1),oe=_[ae];if(ae>0){var me=oe.level!=1,De=qn(e,ze(u,me?oe.from:oe.to,me?"after":"before"),"line",t,l);pi(De,B,Q,!0)&&De.top>Q&&(oe=_[ae-1])}return oe}function ar(e,t,u,l,_,B,Q){var ae=Pi(e,t,l,Q),oe=ae.begin,me=ae.end;/\s/.test(t.text.charAt(me-1))&&me--;for(var De=null,Me=null,Ye=0;Ye<_.length;Ye++){var Ke=_[Ye];if(Ke.from>=me||Ke.to<=oe)continue;var lt=Ke.level!=1,vt=bn(e,l,lt?Math.min(me,Ke.to)-1:Math.max(oe,Ke.from)).right,bt=vt<B?B-vt+1e9:vt-B;(!De||Me>bt)&&(De=Ke,Me=bt)}return De||(De=_[_.length-1]),De.from<oe&&(De={from:oe,to:De.to,level:De.level}),De.to>me&&(De={from:De.from,to:me,level:De.level}),De}var un;function Mn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(un==null){un=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)un.appendChild(document.createTextNode("x")),un.appendChild(f("br"));un.appendChild(document.createTextNode("x"))}m(e.measure,un);var u=un.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),E(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(),_=(l.right-l.left)/10;return _>2&&(e.cachedCharWidth=_),_||10}function Rr(e){for(var t=e.display,u={},l={},_=t.gutters.clientLeft,B=t.gutters.firstChild,Q=0;B;B=B.nextSibling,++Q){var ae=e.display.gutterSpecs[Q].className;u[ae]=B.offsetLeft+B.clientLeft+_,l[ae]=B.clientWidth}return{fixedPos:Nn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function Nn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Si(e){var t=Mn(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/jn(e.display)-3);return function(_){if(bi(e.doc,_))return 0;var B=0;if(_.widgets)for(var Q=0;Q<_.widgets.length;Q++)_.widgets[Q].height&&(B+=_.widgets[Q].height);return u?B+(Math.ceil(_.text.length/l)||1)*t:B+t}}function Fi(e){var t=e.doc,u=Si(e);t.iter(function(l){var _=u(l);_!=l.height&&ve(l,_)})}function jr(e,t,u,l){var _=e.display;if(!u&&Oe(t).getAttribute("cm-not-content")=="true")return null;var B,Q,ae=_.lineSpace.getBoundingClientRect();try{B=t.clientX-ae.left,Q=t.clientY-ae.top}catch(Me){return null}var oe=Wi(e,B,Q),me;if(l&&oe.xRel>0&&(me=X(e.doc,oe.line).text).length==oe.ch){var De=V(me,me.length,e.options.tabSize)-me.length;oe=ze(oe.line,Math.max(0,Math.round((B-$n(e.display).left)/jn(e.display))-De))}return oe}function Ti(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 Tr(e,t,u,l){t==null&&(t=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var _=e.display;if(l&&u<_.viewTo&&(_.updateLineNumbers==null||_.updateLineNumbers>t)&&(_.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=_.viewTo)_r&&Bi(e.doc,t)<_.viewTo&&En(e);else if(u<=_.viewFrom)_r&&Ii(e.doc,u+l)>_.viewFrom?En(e):(_.viewFrom+=l,_.viewTo+=l);else if(t<=_.viewFrom&&u>=_.viewTo)En(e);else if(t<=_.viewFrom){var B=fn(e,u,u+l,1);B?(_.view=_.view.slice(B.index),_.viewFrom=B.lineN,_.viewTo+=l):En(e)}else if(u>=_.viewTo){var Q=fn(e,t,t,-1);Q?(_.view=_.view.slice(0,Q.index),_.viewTo=Q.lineN):En(e)}else{var ae=fn(e,t,t,-1),oe=fn(e,u,u+l,1);ae&&oe?(_.view=_.view.slice(0,ae.index).concat(Ve(e,ae.lineN,oe.lineN)).concat(_.view.slice(oe.index)),_.viewTo+=l):En(e)}var me=_.externalMeasured;me&&(u<me.lineN?me.lineN+=l:t<me.lineN+me.size&&(_.externalMeasured=null))}function $r(e,t,u){e.curOp.viewChanged=!0;var l=e.display,_=e.display.externalMeasured;if(_&&t>=_.lineN&&t<_.lineN+_.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var B=l.view[Ti(e,t)];if(B.node==null)return;var Q=B.changes||(B.changes=[]);se(Q,u)==-1&&Q.push(u)}function En(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fn(e,t,u,l){var _=Ti(e,t),B,Q=e.display.view;if(!_r||u==e.doc.first+e.doc.size)return{index:_,lineN:u};for(var ae=e.display.viewFrom,oe=0;oe<_;oe++)ae+=Q[oe].size;if(ae!=t){if(l>0){if(_==Q.length-1)return null;B=ae+Q[_].size-t,_++}else B=ae-t;t+=B,u+=B}for(;Bi(e.doc,u)!=u;){if(_==(l<0?0:Q.length-1))return null;u+=l*Q[_-(l<0?1:0)].size,_+=l}return{index:_,lineN:u}}function Bn(e,t,u){var l=e.display,_=l.view;_.length==0||t>=l.viewTo||u<=l.viewFrom?(l.view=Ve(e,t,u),l.viewFrom=t):(l.viewFrom>t?l.view=Ve(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(Ti(e,t))),l.viewFrom=t,l.viewTo<u?l.view=l.view.concat(Ve(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,Ti(e,u)))),l.viewTo=u}function Nt(e){for(var t=e.display.view,u=0,l=0;l<t.length;l++){var _=t[l];!_.hidden&&(!_.node||_.changes)&&++u}return u}function yn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function hr(e,t){t===void 0&&(t=!0);for(var u=e.doc,l={},_=l.cursors=document.createDocumentFragment(),B=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 oe=ae.empty();(oe||e.options.showCursorWhenSelecting)&&Mr(e,ae.head,_),oe||va(e,ae,B)}return l}function Mr(e,t,u){var l=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),_=u.appendChild(f("div","\xA0","CodeMirror-cursor"));if(_.style.left=l.left+"px",_.style.top=l.top+"px",_.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var B=u.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=l.other.left+"px",B.style.top=l.other.top+"px",B.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function wr(e,t){return e.top-t.top||e.left-t.left}function va(e,t,u){var l=e.display,_=e.doc,B=document.createDocumentFragment(),Q=$n(e.display),ae=Q.left,oe=Math.max(l.sizerWidth,zn(e)-l.sizer.offsetLeft)-Q.right,me=_.direction=="ltr";function De(Dt,Vt,gn,on){Vt<0&&(Vt=0),Vt=Math.round(Vt),on=Math.round(on),B.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Dt+`px;
|
|
top: `+Vt+"px; width: "+(gn==null?oe-Dt:gn)+`px;
|
|
height: `+(on-Vt)+"px"))}function Me(Dt,Vt,gn){var on=X(_,Dt),Wn=on.text.length,mr,Vr;function Cr(Nr,vi){return Ei(e,ze(Dt,Nr),"div",on,vi)}function Ri(Nr,vi,Jr){var Wr=ca(e,on,null,Nr),Ur=vi=="ltr"==(Jr=="after")?"left":"right",Ar=Jr=="after"?Wr.begin:Wr.end-(/\s/.test(on.text.charAt(Wr.end-1))?2:1);return Cr(Ar,Ur)[Ur]}var gi=ft(on,_.direction);return Xe(gi,Vt||0,gn==null?Wn:gn,function(Nr,vi,Jr,Wr){var Ur=Jr=="ltr",Ar=Cr(Nr,Ur?"left":"right"),_i=Cr(vi-1,Ur?"right":"left"),La=Vt==null&&Nr==0,ua=gn==null&&vi==Wn,ri=Wr==0,$i=!gi||Wr==gi.length-1;if(_i.top-Ar.top<=3){var Xr=(me?La:ua)&&ri,Fs=(me?ua:La)&&$i,qi=Xr?ae:(Ur?Ar:_i).left,ma=Fs?oe:(Ur?_i:Ar).right;De(qi,Ar.top,ma-qi,Ar.bottom)}else{var ga,ui,Ia,js;Ur?(ga=me&&La&&ri?ae:Ar.left,ui=me?oe:Ri(Nr,Jr,"before"),Ia=me?ae:Ri(vi,Jr,"after"),js=me&&ua&&$i?oe:_i.right):(ga=me?Ri(Nr,Jr,"before"):ae,ui=!me&&La&&ri?oe:Ar.right,Ia=!me&&ua&&$i?ae:_i.left,js=me?Ri(vi,Jr,"after"):oe),De(ga,Ar.top,ui-ga,Ar.bottom),Ar.bottom<_i.top&&De(ae,Ar.bottom,null,_i.top),De(Ia,_i.top,js-Ia,_i.bottom)}(!mr||wr(Ar,mr)<0)&&(mr=Ar),wr(_i,mr)<0&&(mr=_i),(!Vr||wr(Ar,Vr)<0)&&(Vr=Ar),wr(_i,Vr)<0&&(Vr=_i)}),{start:mr,end:Vr}}var Ye=t.from(),Ke=t.to();if(Ye.line==Ke.line)Me(Ye.line,Ye.ch,Ke.ch);else{var lt=X(_,Ye.line),vt=X(_,Ke.line),bt=ti(lt)==ti(vt),It=Me(Ye.line,Ye.ch,bt?lt.text.length+1:null).end,Ft=Me(Ke.line,bt?0:null,Ke.ch).start;bt&&(It.top<Ft.top-2?(De(It.right,It.top,null,It.bottom),De(ae,Ft.top,Ft.left,Ft.bottom)):De(It.right,It.top,Ft.left-It.right,It.bottom)),It.bottom<Ft.top&&De(ae,It.bottom,null,Ft.top)}u.appendChild(B)}function an(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()||wi(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(),ji(e))}function _a(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,wi(e))},100)}function ji(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,W(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),an(e)}function wi(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 Ci(e){for(var t=e.display,u=t.lineDiv.offsetTop,l=0;l<t.view.length;l++){var _=t.view[l],B=e.options.lineWrapping,Q=void 0,ae=0;if(_.hidden)continue;if(H&&k<8){var oe=_.node.offsetTop+_.node.offsetHeight;Q=oe-u,u=oe}else{var me=_.node.getBoundingClientRect();Q=me.bottom-me.top,!B&&_.text.firstChild&&(ae=_.text.firstChild.getBoundingClientRect().right-me.left-1)}var De=_.line.height-Q;if((De>.005||De<-.005)&&(ve(_.line,Q),Qi(_.line),_.rest))for(var Me=0;Me<_.rest.length;Me++)Qi(_.rest[Me]);if(ae>e.display.sizerWidth){var Ye=Math.ceil(ae/jn(e.display));Ye>e.display.maxLineLength&&(e.display.maxLineLength=Ye,e.display.maxLine=_.line,e.display.maxLineChanged=!0)}}}function Qi(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 Hi(e,t,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-or(e));var _=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,B=He(t,l),Q=He(t,_);if(u&&u.ensure){var ae=u.ensure.from.line,oe=u.ensure.to.line;ae<B?(B=ae,Q=He(t,hi(X(t,ae))+e.wrapper.clientHeight)):Math.min(oe,t.lastLine())>=Q&&(B=He(t,hi(X(t,oe))-e.wrapper.clientHeight),Q=oe)}return{from:B,to:Math.max(Q,B+1)}}function ra(e,t){if(re(e,"scrollCursorIntoView"))return;var u=e.display,l=u.sizer.getBoundingClientRect(),_=null;if(t.top+l.top<0?_=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(_=!1),_!=null&&!o){var B=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-u.viewOffset-or(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Tn(e)+u.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(_),e.display.lineSpace.removeChild(B)}}function ms(e,t,u,l){l==null&&(l=0);var _;!e.options.lineWrapping&&t==u&&(t=t.ch?ze(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,u=t.sticky=="before"?ze(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var Q=!1,ae=qn(e,t),oe=!u||u==t?ae:qn(e,u);_={left:Math.min(ae.left,oe.left),top:Math.min(ae.top,oe.top)-l,right:Math.max(ae.left,oe.left),bottom:Math.max(ae.bottom,oe.bottom)+l};var me=gs(e,_),De=e.doc.scrollTop,Me=e.doc.scrollLeft;if(me.scrollTop!=null&&(ka(e,me.scrollTop),Math.abs(e.doc.scrollTop-De)>1&&(Q=!0)),me.scrollLeft!=null&&(da(e,me.scrollLeft),Math.abs(e.doc.scrollLeft-Me)>1&&(Q=!0)),!Q)break}return _}function Br(e,t){var u=gs(e,t);u.scrollTop!=null&&ka(e,u.scrollTop),u.scrollLeft!=null&&da(e,u.scrollLeft)}function gs(e,t){var u=e.display,l=Mn(e.display);t.top<0&&(t.top=0);var _=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,B=kn(e),Q={};t.bottom-t.top>B&&(t.bottom=t.top+B);var ae=e.doc.height+lr(u),oe=t.top<l,me=t.bottom>ae-l;if(t.top<_)Q.scrollTop=oe?0:t.top;else if(t.bottom>_+B){var De=Math.min(t.top,(me?ae:t.bottom)-B);De!=_&&(Q.scrollTop=De)}var Me=e.options.fixedGutter?0:u.gutters.offsetWidth,Ye=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Me,Ke=zn(e)-u.gutters.offsetWidth,lt=t.right-t.left>Ke;return lt&&(t.right=t.left+Ke),t.left<10?Q.scrollLeft=0:t.left<Ye?Q.scrollLeft=Math.max(0,t.left+Me-(lt?0:10)):t.right>Ke+Ye-3&&(Q.scrollLeft=t.right+(lt?0:10)-Ke),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 ya(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=xi(e,t.from),l=xi(e,t.to);Bs(e,u,l,t.margin)}}function Bs(e,t,u,l){var _=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,_.scrollLeft,_.scrollTop)}function ka(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||ys(e,{top:t}),Ws(e,t,!0),P&&ys(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 Ma(e){var t=e.display,u=t.gutters.offsetWidth,l=Math.round(e.doc.height+lr(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+Tn(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"),_=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=_.tabIndex=-1,e(l),e(_),Ue(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),Ue(_,"scroll",function(){_.clientWidth&&t(_.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&k<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 _=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+_)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(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=r&&!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 _=e.getBoundingClientRect(),B=u=="vert"?document.elementFromPoint(_.right-1,(_.top+_.bottom)/2):document.elementFromPoint((_.right+_.left)/2,_.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,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=Ma(e));var u=e.display.barWidth,l=e.display.barHeight;Hs(e,t);for(var _=0;_<4&&u!=e.display.barWidth||l!=e.display.barHeight;_++)u!=e.display.barWidth&&e.options.lineWrapping&&Ci(e),Hs(e,Ma(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 Gs={native:ha,null:Na};function Ks(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Gs[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):ka(e,t)},e),e.display.scrollbars.addClass&&W(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},Et(e.curOp)}function pa(e){var t=e.curOp;t&&Ut(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 _=0;_<t.length;_++)nl(t[_]);for(var B=0;B<t.length;B++)rl(t[B]);for(var Q=0;Q<t.length;Q++)il(t[Q])}function el(e){var t=e.cm,u=t.display;sl(t),e.updateMaxLine&&Yi(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&&_s(e.cm,e.update)}function nl(e){var t=e.cm,u=t.display;e.updatedDisplay&&Ci(t),e.barMeasure=Ma(t),u.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ur(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+Tn(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 rl(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==M();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&&an(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),u&&na(e.cm)}function il(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 _=ms(t,at(l,e.scrollToPos.from),at(l,e.scrollToPos.to),e.scrollToPos.margin);ra(t,_)}var B=e.maybeHiddenMarkers,Q=e.maybeUnhiddenMarkers;if(B)for(var ae=0;ae<B.length;++ae)B[ae].lines.length||fe(B[ae],"hide");if(Q)for(var oe=0;oe<Q.length;++oe)Q[oe].lines.length&&fe(Q[oe],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Oi(e,t){if(e.curOp)return t();fa(e);try{return t()}finally{pa(e)}}function Kr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fa(e);try{return t.apply(e,arguments)}finally{pa(e)}}}function li(e){return function(){if(this.curOp)return e.apply(this,arguments);fa(this);try{return e.apply(this,arguments)}finally{pa(this)}}}function zr(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,F(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var u=+new Date+e.options.workTime,l=vn(e,t.highlightFrontier),_=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(l.line>=e.display.viewFrom){var Q=B.styles,ae=B.text.length>e.options.maxHighlightLength?Zt(t.mode,l.state):null,oe=Yn(e,B,l,!0);ae&&(l.state=ae),B.styles=oe.styles;var me=B.styleClasses,De=oe.classes;De?B.styleClasses=De:me&&(B.styleClasses=null);for(var Me=!Q||Q.length!=B.styles.length||me!=De&&(!me||!De||me.bgClass!=De.bgClass||me.textClass!=De.textClass),Ye=0;!Me&&Ye<Q.length;++Ye)Me=Q[Ye]!=B.styles[Ye];Me&&_.push(l.line),B.stateAfter=l.save(),l.nextLine()}else B.text.length<=e.options.maxHighlightLength&&gr(e,B.text,l),B.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),_.length&&Oi(e,function(){for(var B=0;B<_.length;B++)$r(e,_[B],"text")})}var es=function(e,t,u){var l=e.display;this.viewport=t,this.visible=Hi(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=Rr(e),this.events=[]};es.prototype.signal=function(e,t){ce(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=Tn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Tn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=M();if(!t||!y(e.display.lineDiv,t))return null;var u={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&y(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==M())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(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 _s(e,t){var u=e.display,l=e.doc;if(t.editorIsHidden)return En(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&&Nt(e)==0)return!1;Xs(e)&&(En(e),t.dims=Rr(e));var _=l.first+l.size,B=Math.max(t.visible.from-e.options.viewportMargin,l.first),Q=Math.min(_,t.visible.to+e.options.viewportMargin);u.viewFrom<B&&B-u.viewFrom<20&&(B=Math.max(l.first,u.viewFrom)),u.viewTo>Q&&u.viewTo-Q<20&&(Q=Math.min(_,u.viewTo)),_r&&(B=Bi(e.doc,B),Q=Ii(e.doc,Q));var ae=B!=u.viewFrom||Q!=u.viewTo||u.lastWrapHeight!=t.wrapperHeight||u.lastWrapWidth!=t.wrapperWidth;Bn(e,B,Q),u.viewOffset=hi(X(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var oe=Nt(e);if(!ae&&oe==0&&!t.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var me=ol(e);return oe>4&&(u.lineDiv.style.display="none"),ul(e,u.updateLineNumbers,t.dims),oe>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,ll(me),E(u.cursorDiv),E(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+lr(e.display)-kn(e),u.top)}),t.visible=Hi(e.display,e.doc,u),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=Hi(e.display,e.doc,u));if(!_s(e,t))break;Ci(e);var _=Ma(e);yn(e),ba(e,_),Es(e,_),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ys(e,t){var u=new es(e,t);if(_s(e,u)){Ci(e),zs(e,u);var l=Ma(e);yn(e),ba(e,l),Es(e,l),u.finish()}}function ul(e,t,u){var l=e.display,_=e.options.lineNumbers,B=l.lineDiv,Q=B.firstChild;function ae(lt){var vt=lt.nextSibling;return n&&r&&e.display.currentWheelTarget==lt?lt.style.display="none":lt.parentNode.removeChild(lt),vt}for(var oe=l.view,me=l.viewFrom,De=0;De<oe.length;De++){var Me=oe[De];if(!Me.hidden)if(!Me.node||Me.node.parentNode!=B){var Ye=Xn(e,Me,me,u);B.insertBefore(Ye,Q)}else{for(;Q!=Me.node;)Q=ae(Q);var Ke=_&&t!=null&&t<=me&&Me.lineNumber;Me.changes&&(se(Me.changes,"gutter")>-1&&(Ke=!1),Xt(e,Me,me,u)),Ke&&(E(Me.lineNumber),Me.lineNumber.appendChild(document.createTextNode(ut(e.options,me)))),Q=Me.node.nextSibling}me+=Me.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+Tn(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=Nn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,_=t.gutters.offsetWidth,B=l+"px",Q=0;Q<u.length;Q++)if(!u[Q].hidden){e.options.fixedGutter&&(u[Q].gutter&&(u[Q].gutter.style.left=B),u[Q].gutterBackground&&(u[Q].gutterBackground.style.left=B));var ae=u[Q].alignable;if(ae)for(var oe=0;oe<ae.length;oe++)ae[oe].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=l+_+"px")}function Xs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,u=ut(e.options,t.first+t.size-1),l=e.display;if(u.length!=l.lineNumChars){var _=l.measure.appendChild(f("div",[f("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=_.firstChild.offsetWidth,Q=_.offsetWidth-B;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(B,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,_=0;_<e.length;_++){var B=e[_],Q=null;if(typeof B!="string"&&(Q=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)l=!0;else continue;u.push({className:B,style:Q})}return t&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Ys(e){var t=e.gutters,u=e.gutterSpecs;E(t),e.lineGutter=null;for(var l=0;l<u.length;++l){var _=u[l],B=_.className,Q=_.style,ae=t.appendChild(f("div",null,"CodeMirror-gutter "+B));Q&&(ae.style.cssText=Q),B=="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),Tr(e),Vs(e)}function cl(e,t,u,l){var _=this;this.input=u,_.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),_.scrollbarFiller.setAttribute("cm-not-content","true"),_.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),_.gutterFiller.setAttribute("cm-not-content","true"),_.lineDiv=C("div",null,"CodeMirror-code"),_.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),_.cursorDiv=f("div",null,"CodeMirror-cursors"),_.measure=f("div",null,"CodeMirror-measure"),_.lineMeasure=f("div",null,"CodeMirror-measure"),_.lineSpace=C("div",[_.measure,_.lineMeasure,_.selectionDiv,_.cursorDiv,_.lineDiv],null,"position: relative; outline: none");var B=C("div",[_.lineSpace],"CodeMirror-lines");_.mover=f("div",[B],null,"position: relative"),_.sizer=f("div",[_.mover],"CodeMirror-sizer"),_.sizerWidth=null,_.heightForcer=f("div",null,null,"position: absolute; height: "+Se+"px; width: 1px;"),_.gutters=f("div",null,"CodeMirror-gutters"),_.lineGutter=null,_.scroller=f("div",[_.sizer,_.heightForcer,_.gutters],"CodeMirror-scroll"),_.scroller.setAttribute("tabIndex","-1"),_.wrapper=f("div",[_.scrollbarFiller,_.gutterFiller,_.scroller],"CodeMirror"),H&&k<8&&(_.gutters.style.zIndex=-1,_.scroller.style.paddingRight=0),!n&&!(P&&a)&&(_.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(_.wrapper):e(_.wrapper)),_.viewFrom=_.viewTo=t.first,_.reportedViewFrom=_.reportedViewTo=t.first,_.view=[],_.renderedView=null,_.externalMeasured=null,_.viewOffset=0,_.lastWrapHeight=_.lastWrapWidth=0,_.updateLineNumbers=null,_.nativeBarWidth=_.barHeight=_.barWidth=0,_.scrollbarsClipped=!1,_.lineNumWidth=_.lineNumInnerWidth=_.lineNumChars=null,_.alignWidgets=!1,_.cachedCharWidth=_.cachedTextHeight=_.cachedPaddingH=null,_.maxLine=null,_.maxLineLength=0,_.maxLineChanged=!1,_.wheelDX=_.wheelDY=_.wheelStartX=_.wheelStartY=null,_.shift=!1,_.selForContextMenu=null,_.activeTouch=null,_.gutterSpecs=xs(l.gutters,l.lineNumbers),Ys(_),u.init(_)}var ts=0,ki=null;H?ki=-.53:P?ki=15:g?ki=-.7:h&&(ki=-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*=ki,t.y*=ki,t}function Js(e,t){var u=$s(t),l=u.x,_=u.y,B=e.display,Q=B.scroller,ae=Q.scrollWidth>Q.clientWidth,oe=Q.scrollHeight>Q.clientHeight;if(!(l&&ae||_&&oe))return;if(_&&r&&n){e:for(var me=t.target,De=B.view;me!=Q;me=me.parentNode)for(var Me=0;Me<De.length;Me++)if(De[Me].node==me){e.display.currentWheelTarget=me;break e}}if(l&&!P&&!p&&ki!=null){_&&oe&&ka(e,Math.max(0,Q.scrollTop+_*ki)),da(e,Math.max(0,Q.scrollLeft+l*ki)),(!_||_&&oe)&&le(t),B.wheelStartX=null;return}if(_&&ki!=null){var Ye=_*ki,Ke=e.doc.scrollTop,lt=Ke+B.wrapper.clientHeight;Ye<0?Ke=Math.max(0,Ke+Ye-50):lt=Math.min(e.doc.height,lt+Ye+50),ys(e,{top:Ke,bottom:lt})}ts<20&&(B.wheelStartX==null?(B.wheelStartX=Q.scrollLeft,B.wheelStartY=Q.scrollTop,B.wheelDX=l,B.wheelDY=_,setTimeout(function(){if(B.wheelStartX==null)return;var vt=Q.scrollLeft-B.wheelStartX,bt=Q.scrollTop-B.wheelStartY,It=bt&&B.wheelDY&&bt/B.wheelDY||vt&&B.wheelDX&&vt/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!It)return;ki=(ki*ts+It)/(ts+1),++ts},200)):(B.wheelDX+=l,B.wheelDY+=_))}var Mi=function(e,t){this.ranges=e,this.primIndex=t};Mi.prototype.primary=function(){return this.ranges[this.primIndex]},Mi.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(!Kt(u.anchor,l.anchor)||!Kt(u.head,l.head))return!1}return!0},Mi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new sr(dt(this.ranges[t].anchor),dt(this.ranges[t].head));return new Mi(e,this.primIndex)},Mi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Mi.prototype.contains=function(e,t){t||(t=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(gt(t,l.from())>=0&>(e,l.to())<=0)return u}return-1};var sr=function(e,t){this.anchor=e,this.head=t};sr.prototype.from=function(){return jt(this.anchor,this.head)},sr.prototype.to=function(){return sn(this.anchor,this.head)},sr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Gi(e,t,u){var l=e&&e.options.selectionsMayTouch,_=t[u];t.sort(function(Ye,Ke){return gt(Ye.from(),Ke.from())}),u=se(t,_);for(var B=1;B<t.length;B++){var Q=t[B],ae=t[B-1],oe=gt(ae.to(),Q.from());if(l&&!Q.empty()?oe>0:oe>=0){var me=jt(ae.from(),Q.from()),De=sn(ae.to(),Q.to()),Me=ae.empty()?Q.from()==Q.head:ae.from()==ae.head;B<=u&&--u,t.splice(--B,2,new sr(Me?De:me,Me?me:De))}}return new Mi(t,u)}function ia(e,t){return new Mi([new sr(e,t||e)],0)}function aa(e){return e.text?ze(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(gt(e,t.from)<0)return e;if(gt(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),ze(u,l)}function Ss(e,t){for(var u=[],l=0;l<e.sel.ranges.length;l++){var _=e.sel.ranges[l];u.push(new sr(Qs(_.anchor,t),Qs(_.head,t)))}return Gi(e.cm,u,e.sel.primIndex)}function Zs(e,t,u){return e.line==t.line?ze(u.line,e.ch-t.ch+u.ch):ze(u.line+(e.line-t.line),e.ch)}function hl(e,t,u){for(var l=[],_=ze(e.first,0),B=_,Q=0;Q<t.length;Q++){var ae=t[Q],oe=Zs(ae.from,_,B),me=Zs(aa(ae),_,B);if(_=ae.to,B=me,u=="around"){var De=e.sel.ranges[Q],Me=gt(De.head,De.anchor)<0;l[Q]=new sr(Me?me:oe,Me?oe:me)}else l[Q]=new sr(oe,oe)}return new Mi(l,e.sel.primIndex)}function Ts(e){e.doc.mode=wn(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&&Tr(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 _(Ft){return u?u[Ft]:null}function B(Ft,Dt,Vt){Ji(Ft,Dt,Vt,l),Qe(Ft,"change",Ft,t)}function Q(Ft,Dt){for(var Vt=[],gn=Ft;gn<Dt;++gn)Vt.push(new oi(me[gn],_(gn),l));return Vt}var ae=t.from,oe=t.to,me=t.text,De=X(e,ae.line),Me=X(e,oe.line),Ye=U(me),Ke=_(me.length-1),lt=oe.line-ae.line;if(t.full)e.insert(0,Q(0,me.length)),e.remove(me.length,e.size-me.length);else if(qs(e,t)){var vt=Q(0,me.length-1);B(Me,Me.text,Ke),lt&&e.remove(ae.line,lt),vt.length&&e.insert(ae.line,vt)}else if(De==Me)if(me.length==1)B(De,De.text.slice(0,ae.ch)+Ye+De.text.slice(oe.ch),Ke);else{var bt=Q(1,me.length-1);bt.push(new oi(Ye+De.text.slice(oe.ch),Ke,l)),B(De,De.text.slice(0,ae.ch)+me[0],_(0)),e.insert(ae.line+1,bt)}else if(me.length==1)B(De,De.text.slice(0,ae.ch)+me[0]+Me.text.slice(oe.ch),_(0)),e.remove(ae.line+1,lt);else{B(De,De.text.slice(0,ae.ch)+me[0],_(0)),B(Me,Ye+Me.text.slice(oe.ch),Ke);var It=Q(1,me.length-1);lt>1&&e.remove(ae.line+1,lt-1),e.insert(ae.line+1,It)}Qe(e,"change",e,t)}function sa(e,t,u){function l(_,B,Q){if(_.linked)for(var ae=0;ae<_.linked.length;++ae){var oe=_.linked[ae];if(oe.doc==B)continue;var me=Q&&oe.sharedHist;if(u&&!me)continue;t(oe.doc,me),l(oe.doc,_,me)}}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,Fi(e),Ts(e),to(e),e.options.lineWrapping||Yi(e),e.options.mode=t.modeOption,Tr(e)}function to(e){(e.doc.direction=="rtl"?W:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Oi(e,function(){to(e),Tr(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:dt(t.from),to:aa(t),text:$(e,t.from,t.to)};return io(e,u,t.from.line,t.to.line+1),sa(e,function(l){return io(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 ro(e,t,u,l){var _=e.history;_.undone.length=0;var B=+new Date,Q,ae;if((_.lastOp==l||_.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&_.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(Q=pl(_,_.lastOp==l)))ae=U(Q.changes),gt(t.from,t.to)==0&>(t.from,ae.to)==0?ae.to=aa(t):Q.changes.push(Cs(e,t));else{var oe=U(_.done);for((!oe||!oe.ranges)&&rs(e.sel,_.done),Q={changes:[Cs(e,t)],generation:_.generation},_.done.push(Q);_.done.length>_.undoDepth;)_.done.shift(),_.done[0].ranges||_.done.shift()}_.done.push(u),_.generation=++_.maxGeneration,_.lastModTime=_.lastSelTime=B,_.lastOp=_.lastSelOp=l,_.lastOrigin=_.lastSelOrigin=t.origin,ae||fe(e,"historyAdded")}function ml(e,t,u,l){var _=t.charAt(0);return _=="*"||_=="+"&&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 _=e.history,B=l&&l.origin;u==_.lastSelOp||B&&_.lastSelOrigin==B&&(_.lastModTime==_.lastSelTime&&_.lastOrigin==B||ml(e,B,U(_.done),t))?_.done[_.done.length-1]=t:rs(t,_.done),_.lastSelTime=+new Date,_.lastSelOrigin=B,_.lastSelOp=u,l&&l.clearRedo!==!1&&no(_.undone)}function rs(e,t){var u=U(t);u&&u.ranges&&u.equals(e)||t.push(e)}function io(e,t,u,l){var _=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(Q){Q.markedSpans&&((_||(_=t["spans_"+e.id]={}))[B]=Q.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?t||(t=e.slice(0,u)):t&&t.push(e[u]);return t?t.length?t:null:e}function _l(e,t){var u=t["spans_"+e.id];if(!u)return null;for(var l=[],_=0;_<t.text.length;++_)l.push(vl(u[_]));return l}function ao(e,t){var u=_l(e,t),l=Zr(e,t);if(!u)return l;if(!l)return u;for(var _=0;_<u.length;++_){var B=u[_],Q=l[_];if(B&&Q){e:for(var ae=0;ae<Q.length;++ae){for(var oe=Q[ae],me=0;me<B.length;++me)if(B[me].marker==oe.marker)continue e;B.push(oe)}}else Q&&(u[_]=Q)}return u}function Ea(e,t,u){for(var l=[],_=0;_<e.length;++_){var B=e[_];if(B.ranges){l.push(u?Mi.prototype.deepCopy.call(B):B);continue}var Q=B.changes,ae=[];l.push({changes:ae});for(var oe=0;oe<Q.length;++oe){var me=Q[oe],De=void 0;if(ae.push({from:me.from,to:me.to,text:me.text}),t)for(var Me in me)(De=Me.match(/^spans_(\d+)$/))&&(se(t,Number(De[1]))>-1&&(U(ae)[Me]=me[Me],delete me[Me]))}}return l}function Os(e,t,u,l){if(l){var _=e.anchor;if(u){var B=gt(t,_)<0;B!=gt(u,_)<0?(_=t,t=u):B!=gt(t,u)<0&&(t=u)}return new sr(_,t)}else return new sr(u||t,t)}function is(e,t,u,l,_){_==null&&(_=e.cm&&(e.cm.display.shift||e.extend)),ni(e,new Mi([Os(e.sel.primary(),t,u,_)],0),l)}function so(e,t,u){for(var l=[],_=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)l[B]=Os(e.sel.ranges[B],t[B],null,_);var Q=Gi(e.cm,l,e.sel.primIndex);ni(e,Q,u)}function Rs(e,t,u,l){var _=e.sel.ranges.slice(0);_[t]=u,ni(e,Gi(e.cm,_,e.sel.primIndex),l)}function oo(e,t,u,l){ni(e,ia(t,u),l)}function yl(e,t,u){var l={ranges:t.ranges,update:function(_){this.ranges=[];for(var B=0;B<_.length;B++)this.ranges[B]=new sr(at(e,_[B].anchor),at(e,_[B].head))},origin:u&&u.origin};return fe(e,"beforeSelectionChange",e,l),e.cm&&fe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?Gi(e.cm,l.ranges,l.ranges.length-1):t}function lo(e,t,u){var l=e.history.done,_=U(l);_&&_.ranges?(l[l.length-1]=t,as(e,t,u)):ni(e,t,u)}function ni(e,t,u){as(e,t,u),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function as(e,t,u){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,u));var l=u&&u.bias||(gt(t.primary().head,e.sel.primary().head)<0?-1:1);uo(e,ho(e,t,l,!0)),!(u&&u.scroll===!1)&&e.cm&&ya(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,ie(e.cm)),Qe(e,"cursorActivity",e)}function co(e){uo(e,ho(e,e.sel,null,!1))}function ho(e,t,u,l){for(var _,B=0;B<t.ranges.length;B++){var Q=t.ranges[B],ae=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],oe=ss(e,Q.anchor,ae&&ae.anchor,u,l),me=ss(e,Q.head,ae&&ae.head,u,l);(_||oe!=Q.anchor||me!=Q.head)&&(_||(_=t.ranges.slice(0,B)),_[B]=new sr(oe,me))}return _?Gi(e.cm,_,t.primIndex):t}function xa(e,t,u,l,_){var B=X(e,t.line);if(B.markedSpans)for(var Q=0;Q<B.markedSpans.length;++Q){var ae=B.markedSpans[Q],oe=ae.marker,me="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,De="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ae.from==null||(me?ae.from<=t.ch:ae.from<t.ch))&&(ae.to==null||(De?ae.to>=t.ch:ae.to>t.ch))){if(_&&(fe(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(B.markedSpans){--Q;continue}else break;if(!oe.atomic)continue;if(u){var Me=oe.find(l<0?1:-1),Ye=void 0;if((l<0?De:me)&&(Me=fo(e,Me,-l,Me&&Me.line==t.line?B:null)),Me&&Me.line==t.line&&(Ye=gt(Me,u))&&(l<0?Ye<0:Ye>0))return xa(e,Me,t,l,_)}var Ke=oe.find(l<0?-1:1);return(l<0?me:De)&&(Ke=fo(e,Ke,l,Ke.line==t.line?B:null)),Ke?xa(e,Ke,t,l,_):null}}return t}function ss(e,t,u,l,_){var B=l||1,Q=xa(e,t,u,B,_)||!_&&xa(e,t,u,B,!0)||xa(e,t,u,-B,_)||!_&&xa(e,t,u,-B,!0);return Q||(e.cantEdit=!0,ze(e.first,0))}function fo(e,t,u,l){return u<0&&t.ch==0?t.line>e.first?at(e,ze(t.line-1)):null:u>0&&t.ch==(l||X(e,t.line)).text.length?t.line<e.first+e.size-1?ze(t.line+1,0):null:new ze(t.line,t.ch+u)}function po(e){e.setSelection(ze(e.firstLine(),0),ze(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(_,B,Q,ae){_&&(l.from=at(e,_)),B&&(l.to=at(e,B)),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 Kr(e.cm,Sa)(e,t,u);if(e.cm.state.suppressEdits)return}if((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(t=mo(e,t,!0),!t))return;var l=Qr&&!u&&Ni(e,t.from,t.to);if(l)for(var _=l.length-1;_>=0;--_)go(e,{from:l[_].from,to:l[_].to,text:_?[""]:t.text,origin:t.origin});else go(e,t)}function go(e,t){if(t.text.length==1&&t.text[0]==""&>(t.from,t.to)==0)return;var u=Ss(e,t);ro(e,t,u,e.cm?e.cm.curOp.id:NaN),Ba(e,t,u,Zr(e,t));var l=[];sa(e,function(_,B){!B&&se(l,_.history)==-1&&(bo(_.history,t),l.push(_.history)),Ba(_,t,null,Zr(_,t))})}function os(e,t,u){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!u)return;for(var _=e.history,B,Q=e.sel,ae=t=="undo"?_.done:_.undone,oe=t=="undo"?_.undone:_.done,me=0;me<ae.length&&!(B=ae[me],u?B.ranges&&!B.equals(e.sel):!B.ranges);me++);if(me==ae.length)return;for(_.lastOrigin=_.lastSelOrigin=null;;)if(B=ae.pop(),B.ranges){if(rs(B,oe),u&&!B.equals(e.sel)){ni(e,B,{clearRedo:!1});return}Q=B}else if(l){ae.push(B);return}else break;var De=[];rs(Q,oe),oe.push({changes:De,generation:_.generation}),_.generation=B.generation||++_.maxGeneration;for(var Me=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),Ye=function(vt){var bt=B.changes[vt];if(bt.origin=t,Me&&!mo(e,bt,!1))return ae.length=0,{};De.push(Cs(e,bt));var It=vt?Ss(e,bt):U(ae);Ba(e,bt,It,ao(e,bt)),!vt&&e.cm&&e.cm.scrollIntoView({from:bt.from,to:aa(bt)});var Ft=[];sa(e,function(Dt,Vt){!Vt&&se(Ft,Dt.history)==-1&&(bo(Dt.history,bt),Ft.push(Dt.history)),Ba(Dt,bt,null,ao(Dt,bt))})},Ke=B.changes.length-1;Ke>=0;--Ke){var lt=Ye(Ke);if(lt)return lt.v}}function vo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Mi(G(e.sel.ranges,function(_){return new sr(ze(_.anchor.line+t,_.anchor.ch),ze(_.head.line+t,_.head.ch))}),e.sel.primIndex),e.cm){Tr(e.cm,e.first,e.first-t,t);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)$r(e.cm,l,"gutter")}}function Ba(e,t,u,l){if(e.cm&&!e.cm.curOp)return Kr(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 _=t.text.length-1-(e.first-t.from.line);vo(e,_),t={from:ze(e.first,0),to:ze(t.to.line+_,t.to.ch),text:[U(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:ze(B,X(e,B).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,ze(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,u){var l=e.doc,_=e.display,B=t.from,Q=t.to,ae=!1,oe=B.line;e.options.lineWrapping||(oe=Ie(ti(X(l,B.line))),l.iter(oe,Q.line+1,function(Ke){if(Ke==_.maxLine)return ae=!0,!0})),l.sel.contains(t.from,t.to)>-1&&ie(e),ws(l,t,u,Si(e)),e.options.lineWrapping||(l.iter(oe,B.line+t.text.length,function(Ke){var lt=Xi(Ke);lt>_.maxLineLength&&(_.maxLine=Ke,_.maxLineLength=lt,_.maxLineChanged=!0,ae=!1)}),ae&&(e.curOp.updateMaxLine=!0)),yr(l,B.line),Ua(e,400);var me=t.text.length-(Q.line-B.line)-1;t.full?Tr(e):B.line==Q.line&&t.text.length==1&&!qs(e.doc,t)?$r(e,B.line,"text"):Tr(e,B.line,Q.line+1,me);var De=ce(e,"changes"),Me=ce(e,"change");if(Me||De){var Ye={from:B,to:Q,text:t.text,removed:t.removed,origin:t.origin};Me&&Qe(e,"change",e,Ye),De&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ye)}e.display.selForContextMenu=null}function Ta(e,t,u,l,_){var B;l||(l=u),gt(l,u)<0&&(B=[l,u],u=B[0],l=B[1]),typeof t=="string"&&(t=e.splitLines(t)),Sa(e,{from:u,to:l,text:t,origin:_})}function _o(e,t,u,l){u<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function yo(e,t,u,l){for(var _=0;_<e.length;++_){var B=e[_],Q=!0;if(B.ranges){B.copied||(B=e[_]=B.deepCopy(),B.copied=!0);for(var ae=0;ae<B.ranges.length;ae++)_o(B.ranges[ae].anchor,t,u,l),_o(B.ranges[ae].head,t,u,l);continue}for(var oe=0;oe<B.changes.length;++oe){var me=B.changes[oe];if(u<me.from.line)me.from=ze(me.from.line+l,me.from.ch),me.to=ze(me.to.line+l,me.to.ch);else if(t<=me.to.line){Q=!1;break}}Q||(e.splice(0,_+1),_=0)}}function bo(e,t){var u=t.from.line,l=t.to.line,_=t.text.length-(l-u)-1;yo(e.done,u,l,_),yo(e.undone,u,l,_)}function Wa(e,t,u,l){var _=t,B=t;return typeof t=="number"?B=X(e,St(e,t)):_=Ie(t),_==null?null:(l(B,_)&&e.cm&&$r(e.cm,_,u),B)}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 _=this.lines[u];this.height-=_.height,Jt(_),Qe(_,"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 Ga(e){this.children=e;for(var t=0,u=0,l=0;l<e.length;++l){var _=e[l];t+=_.chunkSize(),u+=_.height,_.parent=this}this.size=t,this.height=u,this.parent=null}Ga.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],_=l.chunkSize();if(e<_){var B=Math.min(t,_-e),Q=l.height;if(l.removeInner(e,B),this.height-=Q-l.height,_==B&&(this.children.splice(u--,1),l.parent=null),(t-=B)==0)break;e=0}else e-=_}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 _=this.children[l],B=_.chunkSize();if(e<=B){if(_.insertInner(e,t,u),_.lines&&_.lines.length>50){for(var Q=_.lines.length%25+25,ae=Q;ae<_.lines.length;){var oe=new Ha(_.lines.slice(ae,ae+=25));_.height-=oe.height,this.children.splice(++l,0,oe),oe.parent=this}_.lines=_.lines.slice(0,Q),this.maybeSpill()}break}e-=B}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),u=new Ga(t);if(e.parent){e.size-=u.size,e.height-=u.height;var _=se(e.parent.children,e);e.parent.children.splice(_+1,0,u)}else{var l=new Ga(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 _=this.children[l],B=_.chunkSize();if(e<B){var Q=Math.min(t,B-e);if(_.iterN(e,Q,u))return!0;if((t-=Q)==0)break;e=0}else e-=B}}};var Ka=function(e,t,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=t};Ka.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,u=this.line,l=Ie(u);if(l==null||!t)return;for(var _=0;_<t.length;++_)t[_]==this&&t.splice(_--,1);t.length||(u.widgets=null);var B=dr(this);ve(u,Math.max(0,u.height-B)),e&&(Oi(e,function(){Eo(e,u,-B),$r(e,l,"widget")}),Qe(e,"lineWidgetCleared",e,this,l))},Ka.prototype.changed=function(){var e=this,t=this.height,u=this.doc.cm,l=this.line;this.height=null;var _=dr(this)-t;if(!_)return;bi(this.doc,l)||ve(l,l.height+_),u&&Oi(u,function(){u.curOp.forceUpdate=!0,Eo(u,l,_),Qe(u,"lineWidgetChanged",u,e,Ie(l))})},pe(Ka);function Eo(e,t,u){hi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&vs(e,u)}function El(e,t,u,l){var _=new Ka(e,u,l),B=e.cm;return B&&_.noHScroll&&(B.display.alignWidgets=!0),Wa(e,t,"widget",function(Q){var ae=Q.widgets||(Q.widgets=[]);if(_.insertAt==null?ae.push(_):ae.splice(Math.min(ae.length-1,Math.max(0,_.insertAt)),0,_),_.line=Q,B&&!bi(e,Q)){var oe=hi(Q)<e.scrollTop;ve(Q,Q.height+dr(_)),oe&&vs(B,_.height),B.curOp.forceUpdate=!0}return!0}),B&&Qe(B,"lineWidgetAdded",B,_,typeof t=="number"?t:Ie(t)),_}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),ce(this,"clear")){var u=this.find();u&&Qe(this,"clear",u.from,u.to)}for(var l=null,_=null,B=0;B<this.lines.length;++B){var Q=this.lines[B],ae=Or(Q.markedSpans,this);e&&!this.collapsed?$r(e,Ie(Q),"text"):e&&(ae.to!=null&&(_=Ie(Q)),ae.from!=null&&(l=Ie(Q))),Q.markedSpans=Sr(Q.markedSpans,ae),ae.from==null&&this.collapsed&&!bi(this.doc,Q)&&e&&ve(Q,Mn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var me=ti(this.lines[oe]),De=Xi(me);De>e.display.maxLineLength&&(e.display.maxLine=me,e.display.maxLineLength=De,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Tr(e,l,_+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&co(e.doc)),e&&Qe(e,"markerCleared",e,this,l,_),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,_=0;_<this.lines.length;++_){var B=this.lines[_],Q=Or(B.markedSpans,this);if(Q.from!=null&&(u=ze(t?B:Ie(B),Q.from),e==-1))return u;if(Q.to!=null&&(l=ze(t?B:Ie(B),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;Oi(l,function(){var _=t.line,B=Ie(t.line),Q=er(l,B);if(Q&&(Ht(Q),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!bi(u.doc,_)&&u.height!=null){var ae=u.height;u.height=null;var oe=dr(u)-ae;oe&&ve(_,_.height+oe)}Qe(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)}},pe(oa);function wa(e,t,u,l,_){if(l&&l.shared)return xl(e,t,u,l,_);if(e.cm&&!e.cm.curOp)return Kr(e.cm,wa)(e,t,u,l,_);var B=new oa(e,_),Q=gt(t,u);if(l&&R(l,B,!1),Q>0||Q==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=C("span",[B.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(ea(e,t.line,t,u,B)||t.line!=u.line&&ea(e,u.line,t,u,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");Pr()}B.addToHistory&&ro(e,{from:t,to:u,origin:"markText"},e.sel,NaN);var ae=t.line,oe=e.cm,me;if(e.iter(ae,u.line+1,function(Me){oe&&B.collapsed&&!oe.options.lineWrapping&&ti(Me)==oe.display.maxLine&&(me=!0),B.collapsed&&ae!=t.line&&ve(Me,0),ci(Me,new Lr(B,ae==t.line?t.ch:null,ae==u.line?u.ch:null)),++ae}),B.collapsed&&e.iter(t.line,u.line+1,function(Me){bi(e,Me)&&ve(Me,0)}),B.clearOnEnter&&Ue(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(ir(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++xo,B.atomic=!0),oe){if(me&&(oe.curOp.updateMaxLine=!0),B.collapsed)Tr(oe,t.line,u.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var De=t.line;De<=u.line;De++)$r(oe,De,"text");B.atomic&&co(oe.doc),Qe(oe,"markerAdded",oe,B)}return B}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();Qe(this,"clear")},za.prototype.find=function(e,t){return this.primary.find(e,t)},pe(za);function xl(e,t,u,l,_){l=R(l),l.shared=!1;var B=[wa(e,t,u,l,_)],Q=B[0],ae=l.widgetNode;return sa(e,function(oe){ae&&(l.widgetNode=ae.cloneNode(!0)),B.push(wa(oe,at(oe,t),at(oe,u),l,_));for(var me=0;me<oe.linked.length;++me)if(oe.linked[me].isParent)return;Q=U(B)}),new za(B,Q)}function So(e){return e.findMarks(ze(e.first,0),e.clipPos(ze(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var u=0;u<t.length;u++){var l=t[u],_=l.find(),B=e.clipPos(_.from),Q=e.clipPos(_.to);if(gt(B,Q)){var ae=wa(e,B,Q,l.primary,l.primary.type);l.markers.push(ae),ae.parent=l}}}function Tl(e){for(var t=function(l){var _=e[l],B=[_.primary.doc];sa(_.primary.doc,function(oe){return B.push(oe)});for(var Q=0;Q<_.markers.length;Q++){var ae=_.markers[Q];se(B,ae.doc)==-1&&(ae.parent=null,_.markers.splice(Q--,1))}},u=0;u<e.length;u++)t(u)}var wl=0,mi=function(e,t,u,l,_){if(!(this instanceof mi))return new mi(e,t,u,l,_);u==null&&(u=0),Ga.call(this,[new Ha([new oi("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var B=ze(u,0);this.sel=ia(B),this.history=new ns(null),this.id=++wl,this.modeOption=t,this.lineSep=l,this.direction=_=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ws(this,{from:B,to:B,text:e}),ni(this,ia(B),Ae)};mi.prototype=J(Ga.prototype,{constructor:mi,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:zr(function(e){var t=ze(this.first,0),u=this.first+this.size-1;Sa(this,{from:t,to:ze(u,X(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pa(this.cm,0,0),ni(this,ia(t),Ae)}),replaceRange:function(e,t,u,l){t=at(this,t),u=u?at(this,u):t,Ta(this,e,t,u,l)},getRange:function(e,t,u){var l=$(this,at(this,e),at(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(ct(this,e))return X(this,e)},getLineNumber:function(e){return Ie(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=X(this,e)),ti(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return at(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:zr(function(e,t,u){oo(this,at(this,typeof e=="number"?ze(e,t||0):e),null,u)}),setSelection:zr(function(e,t,u){oo(this,at(this,e),at(this,t||e),u)}),extendSelection:zr(function(e,t,u){is(this,at(this,e),t&&at(this,t),u)}),extendSelections:zr(function(e,t){so(this,it(this,e),t)}),extendSelectionsBy:zr(function(e,t){var u=G(this.sel.ranges,e);so(this,it(this,u),t)}),setSelections:zr(function(e,t,u){if(!e.length)return;for(var l=[],_=0;_<e.length;_++)l[_]=new sr(at(this,e[_].anchor),at(this,e[_].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ni(this,Gi(this.cm,l,t),u)}),addSelection:zr(function(e,t,u){var l=this.sel.ranges.slice(0);l.push(new sr(at(this,e),at(this,t||e))),ni(this,Gi(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var t=this.sel.ranges,u,l=0;l<t.length;l++){var _=$(this,t[l].from(),t[l].to());u=u?u.concat(_):_}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 _=$(this,u[l].from(),u[l].to());e!==!1&&(_=_.join(e||this.lineSeparator())),t[l]=_}return t},replaceSelection:function(e,t,u){for(var l=[],_=0;_<this.sel.ranges.length;_++)l[_]=e;this.replaceSelections(l,t,u||"+input")},replaceSelections:zr(function(e,t,u){for(var l=[],_=this.sel,B=0;B<_.ranges.length;B++){var Q=_.ranges[B];l[B]={from:Q.from(),to:Q.to(),text:this.splitLines(e[B]),origin:u}}for(var ae=t&&t!="end"&&hl(this,l,t),oe=l.length-1;oe>=0;oe--)Sa(this,l[oe]);ae?lo(this,ae):this.cm&&ya(this.cm)}),undo:zr(function(){os(this,"undo")}),redo:zr(function(){os(this,"redo")}),undoSelection:zr(function(){os(this,"undo",!0)}),redoSelection:zr(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 _=0;_<e.undone.length;_++)e.undone[_].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:zr(function(e,t,u){return Wa(this,e,"gutter",function(l){var _=l.gutterMarkers||(l.gutterMarkers={});return _[t]=u,!u&&be(_)&&(l.gutterMarkers=null),!0})}),clearGutter:zr(function(e){var t=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Wa(t,u,"gutter",function(){return u.gutterMarkers[e]=null,be(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ct(this,e))return null;if(t=e,e=X(this,e),!e)return null}else if(t=Ie(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:zr(function(e,t,u){return Wa(this,e,t=="gutter"?"gutter":"class",function(l){var _=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[_])l[_]=u;else{if(w(u).test(l[_]))return!1;l[_]+=" "+u}return!0})}),removeLineClass:zr(function(e,t,u){return Wa(this,e,t=="gutter"?"gutter":"class",function(l){var _=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=l[_];if(B)if(u==null)l[_]=null;else{var Q=B.match(w(u));if(!Q)return!1;var ae=Q.index+Q[0].length;l[_]=B.slice(0,Q.index)+(!Q.index||ae==B.length?"":" ")+B.slice(ae)||null}else return!1;return!0})}),addLineWidget:zr(function(e,t,u){return El(this,e,t,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,u){return wa(this,at(this,e),at(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=at(this,e),wa(this,e,e,u,"bookmark")},findMarksAt:function(e){e=at(this,e);var t=[],u=X(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var _=u[l];(_.from==null||_.from<=e.ch)&&(_.to==null||_.to>=e.ch)&&t.push(_.marker.parent||_.marker)}return t},findMarks:function(e,t,u){e=at(this,e),t=at(this,t);var l=[],_=e.line;return this.iter(e.line,t.line+1,function(B){var Q=B.markedSpans;if(Q)for(var ae=0;ae<Q.length;ae++){var oe=Q[ae];!(oe.to!=null&&_==e.line&&e.ch>=oe.to||oe.from==null&&_!=e.line||oe.from!=null&&_==t.line&&oe.from>=t.ch)&&(!u||u(oe.marker))&&l.push(oe.marker.parent||oe.marker)}++_}),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(_){var B=_.text.length+l;if(B>e)return t=e,!0;e-=B,++u}),at(this,ze(u,t))},indexFromPos:function(e){e=at(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 mi(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 mi(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 xr&&(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(_){return l.push(_.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):xt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:zr(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)})}),mi.prototype.eachLine=mi.prototype.iter;var To=0;function Cl(e){var t=this;if(wo(t),re(t,e)||Rn(t.display,e))return;le(e),H&&(To=+new Date);var u=jr(t,e,!0),l=e.dataTransfer.files;if(!u||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var _=l.length,B=Array(_),Q=0,ae=function(){++Q==_&&Kr(t,function(){u=at(t.doc,u);var Ke={from:u,to:u,text:t.doc.splitLines(B.filter(function(lt){return lt!=null}).join(t.doc.lineSeparator())),origin:"paste"};Sa(t.doc,Ke),lo(t.doc,ia(at(t.doc,u),at(t.doc,aa(Ke))))})()},oe=function(Ke,lt){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,Ke.type)==-1){ae();return}var vt=new FileReader;vt.onerror=function(){return ae()},vt.onload=function(){var bt=vt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(bt)){ae();return}B[lt]=bt,ae()},vt.readAsText(Ke)},me=0;me<l.length;me++)oe(l[me],me);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 De=e.dataTransfer.getData("Text");if(De){var Me;if(t.state.draggingText&&!t.state.draggingText.copy&&(Me=t.listSelections()),as(t.doc,ia(u,u)),Me)for(var Ye=0;Ye<Me.length;++Ye)Ta(t.doc,"",Me[Ye].anchor,Me[Ye].head,"drag");t.replaceSelection(De,"around","paste"),t.display.input.focus()}}catch(Ke){}}}function Ol(e,t){if(H&&(!e.state.draggingText||+new Date-To<100)){_e(t);return}if(re(e,t)||Rn(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=jr(e,t);if(!u)return;var l=document.createDocumentFragment();Mr(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 _=t[l].CodeMirror;_&&u.push(_)}u.length&&u[0].operation(function(){for(var B=0;B<u.length;B++)e(u[B])})}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(wi)})}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 Zi={};Zi.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"},Zi.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"},Zi.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"},Zi.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"]},Zi.default=r?Zi.macDefault:Zi.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var u,l,_,B,Q=0;Q<t.length-1;Q++){var ae=t[Q];if(/^(cmd|meta|m)$/i.test(ae))B=!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))_=!0;else throw new Error("Unrecognized modifier name: "+ae)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),_&&(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 _=G(u.split(" "),Dl),B=0;B<_.length;B++){var Q=void 0,ae=void 0;B==_.length-1?(ae=_.join(" "),Q=l):(ae=_.slice(0,B+1).join(" "),Q="...");var oe=t[ae];if(!oe)t[ae]=Q;else if(oe!=Q)throw new Error("Inconsistent bindings for "+ae)}delete e[u]}for(var me in t)e[me]=t[me];return e}function Ca(e,t,u,l){t=us(t);var _=t.call?t.call(e,l):t[e];if(_===!1)return"nothing";if(_==="...")return"multi";if(_!=null&&u(_))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ca(e,t.fallthrough,u,l);for(var B=0;B<t.fallthrough.length;B++){var Q=Ca(e,t.fallthrough[B],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"?Zi[e]:e}function Oa(e,t){for(var u=e.doc.sel.ranges,l=[],_=0;_<u.length;_++){for(var B=t(u[_]);l.length&>(B.from,U(l).to)<=0;){var Q=l.pop();if(gt(Q.from,B.from)<0){B.from=Q.from;break}}l.push(B)}Oi(e,function(){for(var ae=l.length-1;ae>=0;ae--)Ta(e.doc,"",l[ae].from,l[ae].to,"+delete");ya(e)})}function As(e,t,u){var l=Ce(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 ze(t.line,l,u<0?"after":"before")}function Is(e,t,u,l,_){if(e){t.doc.direction=="rtl"&&(_=-_);var B=ft(u,t.doc.direction);if(B){var Q=_<0?U(B):B[0],ae=_<0==(Q.level==1),oe=ae?"after":"before",me;if(Q.level>0||t.doc.direction=="rtl"){var De=Vn(t,u);me=_<0?u.text.length-1:0;var Me=bn(t,De,me).top;me=Be(function(Ye){return bn(t,De,Ye).top==Me},_<0==(Q.level==1)?Q.from:Q.to-1,me),oe=="before"&&(me=As(u,me,1))}else me=_<0?Q.to:Q.from;return new ze(l,me,oe)}}return new ze(l,_<0?u.text.length:0,_<0?"before":"after")}function kl(e,t,u,l){var _=ft(t,e.doc.direction);if(!_)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 B=tt(_,u.ch,u.sticky),Q=_[B];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(It,Ft){return As(t,It instanceof ze?It.ch:It,Ft)},oe,me=function(It){return e.options.lineWrapping?(oe=oe||Vn(e,t),ca(e,t,oe,It)):{begin:0,end:t.text.length}},De=me(u.sticky=="before"?ae(u,-1):u.ch);if(e.doc.direction=="rtl"||Q.level==1){var Me=Q.level==1==l<0,Ye=ae(u,Me?1:-1);if(Ye!=null&&(Me?Ye<=Q.to&&Ye<=De.end:Ye>=Q.from&&Ye>=De.begin)){var Ke=Me?"before":"after";return new ze(u.line,Ye,Ke)}}var lt=function(It,Ft,Dt){for(var Vt=function(mr,Vr){return Vr?new ze(u.line,ae(mr,1),"before"):new ze(u.line,mr,"after")};It>=0&&It<_.length;It+=Ft){var gn=_[It],on=Ft>0==(gn.level!=1),Wn=on?Dt.begin:ae(Dt.end,-1);if(gn.from<=Wn&&Wn<gn.to)return Vt(Wn,on);if(Wn=on?gn.from:ae(gn.to,-1),Dt.begin<=Wn&&Wn<Dt.end)return Vt(Wn,on)}},vt=lt(B+l,l,De);if(vt)return vt;var bt=l>0?De.end:ae(De.begin,-1);return bt!=null&&!(l>0&&bt==t.text.length)&&(vt=lt(l>0?0:_.length-1,l,me(bt)),vt)?vt: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=X(e.doc,t.head.line).text.length;return t.head.ch==u&&t.head.line<e.lastLine()?{from:t.head,to:ze(t.head.line+1,0)}:{from:t.head,to:ze(t.head.line,u)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Oa(e,function(t){return{from:ze(t.from().line,0),to:at(e.doc,ze(t.to().line+1,0))}})},delLineLeft:function(e){return Oa(e,function(t){return{from:ze(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(ze(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ze(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 Ml(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")},Fe)},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")},Fe)},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},Fe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],u=e.listSelections(),l=e.options.tabSize,_=0;_<u.length;_++){var B=u[_].from(),Q=V(e.getLine(B.line),B.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 Oi(e,function(){for(var t=e.listSelections(),u=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var _=t[l].head,B=X(e.doc,_.line).text;if(B){if(_.ch==B.length&&(_=new ze(_.line,_.ch-1)),_.ch>0)_=new ze(_.line,_.ch+1),e.replaceRange(B.charAt(_.ch-1)+B.charAt(_.ch-2),ze(_.line,_.ch-2),_,"+transpose");else if(_.line>e.doc.first){var Q=X(e.doc,_.line-1).text;Q&&(_=new ze(_.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+Q.charAt(Q.length-1),ze(_.line-1,Q.length-1),_,"+transpose"))}}u.push(new sr(_,_))}e.setSelections(u)})},newlineAndIndent:function(e){return Oi(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);ya(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Io(e,t){var u=X(e.doc,t),l=ti(u);return l!=u&&(t=Ie(l)),Is(!0,e,l,t,1)}function Ml(e,t){var u=X(e.doc,t),l=di(u);return l!=u&&(t=Ie(l)),Is(!0,e,u,t,-1)}function Do(e,t){var u=Io(e,t.line),l=X(e.doc,u.line),_=ft(l,e.doc.direction);if(!_||_[0].level==0){var B=Math.max(u.ch,l.text.search(/\S/)),Q=t.line==u.line&&t.ch<=B&&t.ch;return ze(u.line,Q?0:B,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,_=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),_=t(e)!=Le}finally{e.display.shift=l,e.state.suppressEdits=!1}return _}function Nl(e,t,u){for(var l=0;l<e.state.keyMaps.length;l++){var _=Ca(t,e.state.keyMaps[l],u,e);if(_)return _}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 _=e.state.keySeq;if(_){if(Ro(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==_&&(e.state.keySeq=null,e.display.input.reset())}),Po(e,_+" "+t,u,l))return!0}return Po(e,t,u,l)}function Po(e,t,u,l){var _=Nl(e,t,l);return _=="multi"&&(e.state.keySeq=t),_=="handled"&&Qe(e,"keyHandled",e,t,u),(_=="handled"||_=="multi")&&(le(u),an(e)),!!_}function ko(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 Mo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=M(),re(t,e))return;H&&k<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;t.display.shift=u==16||e.shiftKey;var l=ko(t,e);p&&(Ds=l?u:null,!l&&u==88&&!Pt&&(r?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!r&&!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;W(t,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(v(t,"CodeMirror-crosshair"),et(document,"keyup",u),et(document,"mouseover",u))}Ue(document,"keyup",u),Ue(document,"mouseover",u)}function No(e){e.keyCode==16&&(this.doc.sel.shift=!1),re(this,e)}function Uo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Rn(t.display,e)||re(t,e)||e.ctrlKey&&!e.altKey||r&&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)&&ko(t,e))return;var _=String.fromCharCode(l==null?u:l);if(_=="\b")return;if(Fl(t,e,_))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&>(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(re(t,e)||u.activeTouch&&u.input.supportsTouch())return;if(u.input.ensurePolled(),u.shift=e.shiftKey,Rn(u,e)){n||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(ks(t,e))return;var l=jr(t,e),_=ke(e),B=l?Wl(l,_):"single";if(window.focus(),_==1&&t.state.selectingText&&t.state.selectingText(e),l&&Hl(t,_,l,B,e))return;_==1?l?Kl(t,l,B,e):Oe(e)==u.scroller&&le(e):_==2?(l&&is(t.doc,l),setTimeout(function(){return u.input.focus()},20)):_==3&&(A?t.display.input.onContextMenu(e):_a(t))}function Hl(e,t,u,l,_){var B="Click";return l=="double"?B="Double"+B:l=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,$a(e,Ao(B,_),_,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)!=Le}finally{e.state.suppressEdits=!1}return ae})}function Gl(e,t,u){var l=e.getOption("configureMouse"),_=l?l(e,t,u):{};if(_.unit==null){var B=s?u.shiftKey&&u.metaKey:u.altKey;_.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(_.extend==null||e.doc.extend)&&(_.extend=e.doc.extend||u.shiftKey),_.addNew==null&&(_.addNew=r?u.metaKey:u.ctrlKey),_.moveOnDrag==null&&(_.moveOnDrag=!(r?u.altKey:u.ctrlKey)),_}function Kl(e,t,u,l){H?setTimeout(F(na,e),0):e.curOp.focus=M();var _=Gl(e,u,l),B=e.doc.sel,Q;e.options.dragDrop&&$e&&!e.isReadOnly()&&u=="single"&&(Q=B.contains(t))>-1&&(gt((Q=B.ranges[Q]).from(),t)<0||t.xRel>0)&&(gt(Q.to(),t)>0||t.xRel<0)?zl(e,l,t,_):Vl(e,l,t,_)}function zl(e,t,u,l){var _=e.display,B=!1,Q=Kr(e,function(me){n&&(_.scroller.draggable=!1),e.state.draggingText=!1,et(_.wrapper.ownerDocument,"mouseup",Q),et(_.wrapper.ownerDocument,"mousemove",ae),et(_.scroller,"dragstart",oe),et(_.scroller,"drop",Q),B||(le(me),l.addNew||is(e.doc,u,null,null,l.extend),n&&!h||H&&k==9?setTimeout(function(){_.wrapper.ownerDocument.body.focus({preventScroll:!0}),_.input.focus()},20):_.input.focus())}),ae=function(me){B=B||Math.abs(t.clientX-me.clientX)+Math.abs(t.clientY-me.clientY)>=10},oe=function(){return B=!0};n&&(_.scroller.draggable=!0),e.state.draggingText=Q,Q.copy=!l.moveOnDrag,_.scroller.dragDrop&&_.scroller.dragDrop(),Ue(_.wrapper.ownerDocument,"mouseup",Q),Ue(_.wrapper.ownerDocument,"mousemove",ae),Ue(_.scroller,"dragstart",oe),Ue(_.scroller,"drop",Q),_a(e),setTimeout(function(){return _.input.focus()},20)}function jo(e,t,u){if(u=="char")return new sr(t,t);if(u=="word")return e.findWordAt(t);if(u=="line")return new sr(ze(t.line,0),at(e.doc,ze(t.line+1,0)));var l=u(e,t);return new sr(l.from,l.to)}function Vl(e,t,u,l){var _=e.display,B=e.doc;le(t);var Q,ae,oe=B.sel,me=oe.ranges;if(l.addNew&&!l.extend?(ae=B.sel.contains(u),ae>-1?Q=me[ae]:Q=new sr(u,u)):(Q=B.sel.primary(),ae=B.sel.primIndex),l.unit=="rectangle")l.addNew||(Q=new sr(u,u)),u=jr(e,t,!0,!0),ae=-1;else{var De=jo(e,u,l.unit);l.extend?Q=Os(Q,De.anchor,De.head,l.extend):Q=De}l.addNew?ae==-1?(ae=me.length,ni(B,Gi(e,me.concat([Q]),ae),{scroll:!1,origin:"*mouse"})):me.length>1&&me[ae].empty()&&l.unit=="char"&&!l.extend?(ni(B,Gi(e,me.slice(0,ae).concat(me.slice(ae+1)),0),{scroll:!1,origin:"*mouse"}),oe=B.sel):Rs(B,ae,Q,Pe):(ae=0,ni(B,new Mi([Q],0),Pe),oe=B.sel);var Me=u;function Ye(Dt){if(gt(Me,Dt)==0)return;if(Me=Dt,l.unit=="rectangle"){for(var Vt=[],gn=e.options.tabSize,on=V(X(B,u.line).text,u.ch,gn),Wn=V(X(B,Dt.line).text,Dt.ch,gn),mr=Math.min(on,Wn),Vr=Math.max(on,Wn),Cr=Math.min(u.line,Dt.line),Ri=Math.min(e.lastLine(),Math.max(u.line,Dt.line));Cr<=Ri;Cr++){var gi=X(B,Cr).text,Nr=je(gi,mr,gn);mr==Vr?Vt.push(new sr(ze(Cr,Nr),ze(Cr,Nr))):gi.length>Nr&&Vt.push(new sr(ze(Cr,Nr),ze(Cr,je(gi,Vr,gn))))}Vt.length||Vt.push(new sr(u,u)),ni(B,Gi(e,oe.ranges.slice(0,ae).concat(Vt),ae),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Dt)}else{var vi=Q,Jr=jo(e,Dt,l.unit),Wr=vi.anchor,Ur;gt(Jr.anchor,Wr)>0?(Ur=Jr.head,Wr=jt(vi.from(),Jr.anchor)):(Ur=Jr.anchor,Wr=sn(vi.to(),Jr.head));var Ar=oe.ranges.slice(0);Ar[ae]=Xl(e,new sr(at(B,Wr),Ur)),ni(B,Gi(e,Ar,ae),Pe)}}var Ke=_.wrapper.getBoundingClientRect(),lt=0;function vt(Dt){var Vt=++lt,gn=jr(e,Dt,!0,l.unit=="rectangle");if(!gn)return;if(gt(gn,Me)!=0){e.curOp.focus=M(),Ye(gn);var on=Hi(_,B);(gn.line>=on.to||gn.line<on.from)&&setTimeout(Kr(e,function(){lt==Vt&&vt(Dt)}),150)}else{var Wn=Dt.clientY<Ke.top?-20:Dt.clientY>Ke.bottom?20:0;Wn&&setTimeout(Kr(e,function(){if(lt!=Vt)return;_.scroller.scrollTop+=Wn,vt(Dt)}),50)}}function bt(Dt){e.state.selectingText=!1,lt=Infinity,Dt&&(le(Dt),_.input.focus()),et(_.wrapper.ownerDocument,"mousemove",It),et(_.wrapper.ownerDocument,"mouseup",Ft),B.history.lastSelOrigin=null}var It=Kr(e,function(Dt){Dt.buttons===0||!ke(Dt)?bt(Dt):vt(Dt)}),Ft=Kr(e,bt);e.state.selectingText=Ft,Ue(_.wrapper.ownerDocument,"mousemove",It),Ue(_.wrapper.ownerDocument,"mouseup",Ft)}function Xl(e,t){var u=t.anchor,l=t.head,_=X(e.doc,u.line);if(gt(u,l)==0&&u.sticky==l.sticky)return t;var B=ft(_);if(!B)return t;var Q=tt(B,u.ch,u.sticky),ae=B[Q];if(ae.from!=u.ch&&ae.to!=u.ch)return t;var oe=Q+(ae.from==u.ch==(ae.level!=1)?0:1);if(oe==0||oe==B.length)return t;var me;if(l.line!=u.line)me=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var De=tt(B,l.ch,l.sticky),Me=De-Q||(l.ch-u.ch)*(ae.level==1?-1:1);De==oe-1||De==oe?me=Me<0:me=Me>0}var Ye=B[oe+(me?-1:0)],Ke=me==(Ye.level==1),lt=Ke?Ye.from:Ye.to,vt=Ke?"after":"before";return u.ch==lt&&u.sticky==vt?t:new sr(new ze(u.line,lt,vt),l)}function Bo(e,t,u,l){var _,B;if(t.touches)_=t.touches[0].clientX,B=t.touches[0].clientY;else try{_=t.clientX,B=t.clientY}catch(Ye){return!1}if(_>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&le(t);var Q=e.display,ae=Q.lineDiv.getBoundingClientRect();if(B>ae.bottom||!ce(e,u))return ye(t);B-=ae.top-Q.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var me=Q.gutters.childNodes[oe];if(me&&me.getBoundingClientRect().right>=_){var De=He(e.doc,B),Me=e.display.gutterSpecs[oe];return fe(e,u,e,De,Me.className,t),ye(t)}}}function ks(e,t){return Bo(e,t,"gutterClick",!0)}function Wo(e,t){if(Rn(e.display,t)||Yl(e,t))return;if(re(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return ce(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-"),Mt(e)}var Ra={toString:function(){return"CodeMirror.Init"}},Go={},ds={};function $l(e){var t=e.optionHandlers;function u(l,_,B,Q){e.defaults[l]=_,B&&(t[l]=Q?function(ae,oe,me){me!=Ra&&B(ae,oe,me)}:B)}e.defineOption=u,e.Init=Ra,u("value","",function(l,_){return l.setValue(_)},!0),u("mode",null,function(l,_){l.doc.modeOption=_,Ts(l)},!0),u("indentUnit",2,Ts,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){ja(l),Mt(l),Tr(l)},!0),u("lineSeparator",null,function(l,_){if(l.doc.lineSep=_,!_)return;var B=[],Q=l.doc.first;l.doc.iter(function(oe){for(var me=0;;){var De=oe.text.indexOf(_,me);if(De==-1)break;me=De+_.length,B.push(ze(Q,De))}Q++});for(var ae=B.length-1;ae>=0;ae--)Ta(l.doc,_,B[ae],ze(B[ae].line,B[ae].ch+_.length))}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,_,B){l.state.specialChars=new RegExp(_.source+(_.test(" ")?"":"| "),"g"),B!=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,_){return l.getInputField().spellcheck=_},!0),u("autocorrect",!1,function(l,_){return l.getInputField().autocorrect=_},!0),u("autocapitalize",!1,function(l,_){return l.getInputField().autocapitalize=_},!0),u("rtlMoveVisually",!S),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Ho(l),Fa(l)},!0),u("keyMap","default",function(l,_,B){var Q=us(_),ae=B!=Ra&&us(B);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,_){l.display.gutterSpecs=xs(_,l.options.lineNumbers),Fa(l)},!0),u("fixedGutter",!0,function(l,_){l.display.gutters.style.left=_?Nn(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return ba(l)},!0),u("scrollbarStyle","native",function(l){Ks(l),ba(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,_){l.display.gutterSpecs=xs(l.options.gutters,_),Fa(l)},!0),u("firstLineNumber",1,Fa,!0),u("lineNumberFormatter",function(l){return l},Fa,!0),u("showCursorWhenSelecting",!1,yn,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,_){_=="nocursor"&&(wi(l),l.display.input.blur()),l.display.input.readOnlyChanged(_)}),u("screenReaderLabel",null,function(l,_){_=_===""?null:_,l.display.input.screenReaderLabelChanged(_)}),u("disableInput",!1,function(l,_){_||l.display.input.reset()},!0),u("dragDrop",!0,Jl),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,yn,!0),u("singleCursorHeightPerLine",!0,yn,!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,_){return l.doc.history.undoDepth=_}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,ja,!0),u("moveInputWithCursor",!0,function(l,_){_||l.display.input.resetPosition()}),u("tabindex",null,function(l,_){return l.display.input.getField().tabIndex=_||""}),u("autofocus",null),u("direction","ltr",function(l,_){return l.doc.setDirection(_)},!0),u("phrases",null)}function Jl(e,t,u){var l=u&&u!=Ra;if(!t!=!l){var _=e.display.dragFunctions,B=t?Ue:et;B(e.display.scroller,"dragstart",_.start),B(e.display.scroller,"dragenter",_.enter),B(e.display.scroller,"dragover",_.over),B(e.display.scroller,"dragleave",_.leave),B(e.display.scroller,"drop",_.drop)}}function Ql(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),Yi(e)),Fi(e),Tr(e),Mt(e),setTimeout(function(){return ba(e)},100)}function xr(e,t){var u=this;if(!(this instanceof xr))return new xr(e,t);this.options=t=t?R(t):{},R(Go,t,!1);var l=t.value;typeof l=="string"?l=new mi(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var _=new xr.inputStyles[t.inputStyle](this),B=this.display=new cl(e,l,_,t);B.wrapper.CodeMirror=this,Ho(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ks(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&&B.input.focus(),H&&k<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&&ji(u)},20):wi(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<Ms.length;++ae)Ms[ae](this);pa(this),n&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}xr.defaults=Go,xr.optionHandlers=ds;function Zl(e){var t=e.display;Ue(t.scroller,"mousedown",Kr(e,Fo)),H&&k<11?Ue(t.scroller,"dblclick",Kr(e,function(oe){if(re(e,oe))return;var me=jr(e,oe);if(!me||ks(e,oe)||Rn(e.display,oe))return;le(oe);var De=e.findWordAt(me);is(e.doc,De.anchor,De.head)})):Ue(t.scroller,"dblclick",function(oe){return re(e,oe)||le(oe)}),Ue(t.scroller,"contextmenu",function(oe){return Wo(e,oe)}),Ue(t.input.getField(),"contextmenu",function(oe){t.scroller.contains(oe.target)||Wo(e,oe)});var u,l={end:0};function _(){t.activeTouch&&(u=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function B(oe){if(oe.touches.length!=1)return!1;var me=oe.touches[0];return me.radiusX<=1&&me.radiusY<=1}function Q(oe,me){if(me.left==null)return!0;var De=me.left-oe.left,Me=me.top-oe.top;return De*De+Me*Me>20*20}Ue(t.scroller,"touchstart",function(oe){if(!re(e,oe)&&!B(oe)&&!ks(e,oe)){t.input.ensurePolled(),clearTimeout(u);var me=+new Date;t.activeTouch={start:me,moved:!1,prev:me-l.end<=300?l:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),Ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ue(t.scroller,"touchend",function(oe){var me=t.activeTouch;if(me&&!Rn(t,oe)&&me.left!=null&&!me.moved&&new Date-me.start<300){var De=e.coordsChar(t.activeTouch,"page"),Me;!me.prev||Q(me,me.prev)?Me=new sr(De,De):!me.prev.prev||Q(me,me.prev.prev)?Me=e.findWordAt(De):Me=new sr(ze(De.line,0),at(e.doc,ze(De.line+1,0))),e.setSelection(Me.anchor,Me.head),e.focus(),le(oe)}_()}),Ue(t.scroller,"touchcancel",_),Ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ka(e,t.scroller.scrollTop),da(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))}),Ue(t.scroller,"mousewheel",function(oe){return Js(e,oe)}),Ue(t.scroller,"DOMMouseScroll",function(oe){return Js(e,oe)}),Ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){re(e,oe)||_e(oe)},over:function(oe){re(e,oe)||(Rl(e,oe),_e(oe))},start:function(oe){return Ol(e,oe)},drop:Kr(e,Cl),leave:function(oe){re(e,oe)||wo(e)}};var ae=t.input.getField();Ue(ae,"keyup",function(oe){return No.call(e,oe)}),Ue(ae,"keydown",Kr(e,Mo)),Ue(ae,"keypress",Kr(e,Uo)),Ue(ae,"focus",function(oe){return ji(e,oe)}),Ue(ae,"blur",function(oe){return wi(e,oe)})}var Ms=[];xr.defineInitHook=function(e){return Ms.push(e)};function Za(e,t,u,l){var _=e.doc,B;u==null&&(u="add"),u=="smart"&&(_.mode.indent?B=vn(e,t).state:u="prev");var Q=e.options.tabSize,ae=X(_,t),oe=V(ae.text,null,Q);ae.stateAfter&&(ae.stateAfter=null);var me=ae.text.match(/^\s*/)[0],De;if(!l&&!/\S/.test(ae.text))De=0,u="not";else if(u=="smart"&&(De=_.mode.indent(B,ae.text.slice(me.length),ae.text),De==Le||De>150)){if(!l)return;u="prev"}u=="prev"?t>_.first?De=V(X(_,t-1).text,null,Q):De=0:u=="add"?De=oe+e.options.indentUnit:u=="subtract"?De=oe-e.options.indentUnit:typeof u=="number"&&(De=oe+u),De=Math.max(0,De);var Me="",Ye=0;if(e.options.indentWithTabs)for(var Ke=Math.floor(De/Q);Ke;--Ke)Ye+=Q,Me+=" ";if(Ye<De&&(Me+=Z(De-Ye)),Me!=me)return Ta(_,Me,ze(t,0),ze(t,me.length),"+input"),ae.stateAfter=null,!0;for(var lt=0;lt<_.sel.ranges.length;lt++){var vt=_.sel.ranges[lt];if(vt.head.line==t&&vt.head.ch<me.length){var bt=ze(t,me.length);Rs(_,lt,new sr(bt,bt));break}}}var Ki=null;function hs(e){Ki=e}function Ns(e,t,u,l,_){var B=e.doc;e.display.shift=!1,l||(l=B.sel);var Q=+new Date-200,ae=_=="paste"||e.state.pasteIncoming>Q,oe=xt(t),me=null;if(ae&&l.ranges.length>1)if(Ki&&Ki.text.join(`
|
|
`)==t){if(l.ranges.length%Ki.text.length==0){me=[];for(var De=0;De<Ki.text.length;De++)me.push(B.splitLines(Ki.text[De]))}}else oe.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(me=G(oe,function(It){return[It]}));for(var Me=e.curOp.updateInput,Ye=l.ranges.length-1;Ye>=0;Ye--){var Ke=l.ranges[Ye],lt=Ke.from(),vt=Ke.to();Ke.empty()&&(u&&u>0?lt=ze(lt.line,lt.ch-u):e.state.overwrite&&!ae?vt=ze(vt.line,Math.min(X(B,vt.line).text.length,vt.ch+U(oe).length)):ae&&Ki&&Ki.lineWise&&Ki.text.join(`
|
|
`)==oe.join(`
|
|
`)&&(lt=vt=ze(lt.line,0)));var bt={from:lt,to:vt,text:me?me[Ye%me.length]:oe,origin:_||(ae?"paste":e.state.cutIncoming>Q?"cut":"+input")};Sa(e.doc,bt),Qe(e,"inputRead",e,bt)}t&&!ae&&zo(e,t),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Me),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ko(e,t){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Oi(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 _=u.ranges[l];if(_.head.ch>100||l&&u.ranges[l-1].head.line==_.head.line)continue;var B=e.getModeAt(_.head),Q=!1;if(B.electricChars){for(var ae=0;ae<B.electricChars.length;ae++)if(t.indexOf(B.electricChars.charAt(ae))>-1){Q=Za(e,_.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(X(e.doc,_.head.line).text.slice(0,_.head.ch))&&(Q=Za(e,_.head.line,"smart")));Q&&Qe(e,"electricInput",e,_.head.line)}}function Vo(e){for(var t=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var _=e.doc.sel.ranges[l].head.line,B={anchor:ze(_,0),head:ze(_+1,0)};u.push(B),t.push(e.getRange(B.anchor,B.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,_){var B=this.options,Q=B[l];if(B[l]==_&&l!="mode")return;B[l]=_,t.hasOwnProperty(l)&&Kr(this,t[l])(this,_,Q),fe(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,_){this.state.keyMaps[_?"push":"unshift"](us(l))},removeKeyMap:function(l){for(var _=this.state.keyMaps,B=0;B<_.length;++B)if(_[B]==l||_[B].name==l)return _.splice(B,1),!0},addOverlay:li(function(l,_){var B=l.token?l:e.getMode(this.options,l);if(B.startState)throw new Error("Overlays may not be stateful.");ee(this.state.overlays,{mode:B,modeSpec:l,opaque:_&&_.opaque,priority:_&&_.priority||0},function(Q){return Q.priority}),this.state.modeGen++,Tr(this)}),removeOverlay:li(function(l){for(var _=this.state.overlays,B=0;B<_.length;++B){var Q=_[B].modeSpec;if(Q==l||typeof l=="string"&&Q.name==l){_.splice(B,1),this.state.modeGen++,Tr(this);return}}}),indentLine:li(function(l,_,B){typeof _!="string"&&typeof _!="number"&&(_==null?_=this.options.smartIndent?"smart":"prev":_=_?"add":"subtract"),ct(this.doc,l)&&Za(this,l,_,B)}),indentSelection:li(function(l){for(var _=this.doc.sel.ranges,B=-1,Q=0;Q<_.length;Q++){var ae=_[Q];if(ae.empty())ae.head.line>B&&(Za(this,ae.head.line,l,!0),B=ae.head.line,Q==this.doc.sel.primIndex&&ya(this));else{var oe=ae.from(),me=ae.to(),De=Math.max(B,oe.line);B=Math.min(this.lastLine(),me.line-(me.ch?0:1))+1;for(var Me=De;Me<B;++Me)Za(this,Me,l);var Ye=this.doc.sel.ranges;oe.ch==0&&_.length==Ye.length&&Ye[Q].from().ch>0&&Rs(this.doc,Q,new sr(oe,Ye[Q].to()),Ae)}}}),getTokenAt:function(l,_){return Dr(this,l,_)},getLineTokens:function(l,_){return Dr(this,ze(l),_,!0)},getTokenTypeAt:function(l){l=at(this.doc,l);var _=nr(this,X(this.doc,l.line)),B=0,Q=(_.length-1)/2,ae=l.ch,oe;if(ae==0)oe=_[2];else for(;;){var me=B+Q>>1;if((me?_[me*2-1]:0)>=ae)Q=me;else if(_[me*2+1]<ae)B=me+1;else{oe=_[me*2+2];break}}var De=oe?oe.indexOf("overlay "):-1;return De<0?oe:De==0?null:oe.slice(0,De-1)},getModeAt:function(l){var _=this.doc.mode;return _.innerMode?e.innerMode(_,this.getTokenAt(l).state).mode:_},getHelper:function(l,_){return this.getHelpers(l,_)[0]},getHelpers:function(l,_){var B=[];if(!u.hasOwnProperty(_))return B;var Q=u[_],ae=this.getModeAt(l);if(typeof ae[_]=="string")Q[ae[_]]&&B.push(Q[ae[_]]);else if(ae[_])for(var oe=0;oe<ae[_].length;oe++){var me=Q[ae[_][oe]];me&&B.push(me)}else ae.helperType&&Q[ae.helperType]?B.push(Q[ae.helperType]):Q[ae.name]&&B.push(Q[ae.name]);for(var De=0;De<Q._global.length;De++){var Me=Q._global[De];Me.pred(ae,this)&&se(B,Me.val)==-1&&B.push(Me.val)}return B},getStateAfter:function(l,_){var B=this.doc;return l=St(B,l==null?B.first+B.size-1:l),vn(this,l+1,_).state},cursorCoords:function(l,_){var B,Q=this.doc.sel.primary();return l==null?B=Q.head:typeof l=="object"?B=at(this.doc,l):B=l?Q.from():Q.to(),qn(this,B,_||"page")},charCoords:function(l,_){return Ei(this,at(this.doc,l),_||"page")},coordsChar:function(l,_){return l=kr(this,l,_||"page"),Wi(this,l.left,l.top)},lineAtHeight:function(l,_){return l=kr(this,{top:l,left:0},_||"page").top,He(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,_,B){var Q=!1,ae;if(typeof l=="number"){var oe=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>oe&&(l=oe,Q=!0),ae=X(this.doc,l)}else ae=l;return Gr(this,ae,{top:0,left:0},_||"page",B||Q).top+(Q?this.doc.height-hi(ae):0)},defaultTextHeight:function(){return Mn(this.display)},defaultCharWidth:function(){return jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,_,B,Q,ae){var oe=this.display;l=qn(this,at(this.doc,l));var me=l.bottom,De=l.left;if(_.style.position="absolute",_.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(_),oe.sizer.appendChild(_),Q=="over")me=l.top;else if(Q=="above"||Q=="near"){var Me=Math.max(oe.wrapper.clientHeight,this.doc.height),Ye=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(Q=="above"||l.bottom+_.offsetHeight>Me)&&l.top>_.offsetHeight?me=l.top-_.offsetHeight:l.bottom+_.offsetHeight<=Me&&(me=l.bottom),De+_.offsetWidth>Ye&&(De=Ye-_.offsetWidth)}_.style.top=me+"px",_.style.left=_.style.right="",ae=="right"?(De=oe.sizer.clientWidth-_.offsetWidth,_.style.right="0px"):(ae=="left"?De=0:ae=="middle"&&(De=(oe.sizer.clientWidth-_.offsetWidth)/2),_.style.left=De+"px"),B&&Br(this,{left:De,top:me,right:De+_.offsetWidth,bottom:me+_.offsetHeight})},triggerOnKeyDown:li(Mo),triggerOnKeyPress:li(Uo),triggerOnKeyUp:No,triggerOnMouseDown:li(Fo),execCommand:function(l){if(Ya.hasOwnProperty(l))return Ya[l].call(null,this)},triggerElectric:li(function(l){zo(this,l)}),findPosH:function(l,_,B,Q){var ae=1;_<0&&(ae=-1,_=-_);for(var oe=at(this.doc,l),me=0;me<_&&!(oe=Us(this.doc,oe,ae,B,Q),oe.hitSide);++me);return oe},moveH:li(function(l,_){var B=this;this.extendSelectionsBy(function(Q){return B.display.shift||B.doc.extend||Q.empty()?Us(B.doc,Q.head,l,_,B.options.rtlMoveVisually):l<0?Q.from():Q.to()},Fe)}),deleteH:li(function(l,_){var B=this.doc.sel,Q=this.doc;B.somethingSelected()?Q.replaceSelection("",null,"+delete"):Oa(this,function(ae){var oe=Us(Q,ae.head,l,_,!1);return l<0?{from:oe,to:ae.head}:{from:ae.head,to:oe}})}),findPosV:function(l,_,B,Q){var ae=1,oe=Q;_<0&&(ae=-1,_=-_);for(var me=at(this.doc,l),De=0;De<_;++De){var Me=qn(this,me,"div");if(oe==null?oe=Me.left:Me.left=oe,me=$o(this,Me,ae,B),me.hitSide)break}return me},moveV:li(function(l,_){var B=this,Q=this.doc,ae=[],oe=!this.display.shift&&!Q.extend&&Q.sel.somethingSelected();if(Q.extendSelectionsBy(function(De){if(oe)return l<0?De.from():De.to();var Me=qn(B,De.head,"div");De.goalColumn!=null&&(Me.left=De.goalColumn),ae.push(Me.left);var Ye=$o(B,Me,l,_);return _=="page"&&De==Q.sel.primary()&&vs(B,Ei(B,Ye,"div").top-Me.top),Ye},Fe),ae.length)for(var me=0;me<Q.sel.ranges.length;me++)Q.sel.ranges[me].goalColumn=ae[me]}),findWordAt:function(l){var _=this.doc,B=X(_,l.line).text,Q=l.ch,ae=l.ch;if(B){var oe=this.getHelper(l,"wordChars");(l.sticky=="before"||ae==B.length)&&Q?--Q:++ae;for(var me=B.charAt(Q),De=Je(me,oe)?function(Me){return Je(Me,oe)}:/\s/.test(me)?function(Me){return/\s/.test(Me)}:function(Me){return!/\s/.test(Me)&&!Je(Me)};Q>0&&De(B.charAt(Q-1));)--Q;for(;ae<B.length&&De(B.charAt(ae));)++ae}return new sr(ze(l.line,Q),ze(l.line,ae))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?W(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()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:li(function(l,_){Pa(this,l,_)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Tn(this)-this.display.barHeight,width:l.scrollWidth-Tn(this)-this.display.barWidth,clientHeight:kn(this),clientWidth:zn(this)}},scrollIntoView:li(function(l,_){l==null?(l={from:this.doc.sel.primary().head,to:null},_==null&&(_=this.options.cursorScrollMargin)):typeof l=="number"?l={from:ze(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=_||0,l.from.line!=null?Qo(this,l):Bs(this,l.from,l.to,l.margin)}),setSize:li(function(l,_){var B=this,Q=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};l!=null&&(this.display.wrapper.style.width=Q(l)),_!=null&&(this.display.wrapper.style.height=Q(_)),this.options.lineWrapping&&yt(this);var ae=this.display.viewFrom;this.doc.iter(ae,this.display.viewTo,function(oe){if(oe.widgets){for(var me=0;me<oe.widgets.length;me++)if(oe.widgets[me].noHScroll){$r(B,ae,"widget");break}}++ae}),this.curOp.forceUpdate=!0,fe(this,"refresh",this)}),operation:function(l){return Oi(this,l)},startOperation:function(){return fa(this)},endOperation:function(){return pa(this)},refresh:li(function(){var l=this.display.cachedTextHeight;Tr(this),this.curOp.forceUpdate=!0,Mt(this),Pa(this,this.doc.scrollLeft,this.doc.scrollTop),bs(this.display),(l==null||Math.abs(l-Mn(this.display))>.5||this.options.lineWrapping)&&Fi(this),fe(this,"refresh",this)}),swapDoc:li(function(l){var _=this.doc;return _.cm=null,this.state.selectingText&&this.state.selectingText(),eo(this,l),Mt(this),this.display.input.reset(),Pa(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Qe(this,"swapDoc",this,_),_}),phrase:function(l){var _=this.options.phrases;return _&&Object.prototype.hasOwnProperty.call(_,l)?_[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}},pe(e),e.registerHelper=function(l,_,B){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][_]=B},e.registerGlobalHelper=function(l,_,B,Q){e.registerHelper(l,_,Q),u[l]._global.push({pred:B,val:Q})}}function Us(e,t,u,l,_){var B=t,Q=u,ae=X(e,t.line),oe=_&&e.direction=="rtl"?-u:u;function me(){var Ft=t.line+oe;return Ft<e.first||Ft>=e.first+e.size?!1:(t=new ze(Ft,t.ch,t.sticky),ae=X(e,Ft))}function De(Ft){var Dt;if(l=="codepoint"){var Vt=ae.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(Vt)?Dt=null:Dt=new ze(t.line,Math.max(0,Math.min(ae.text.length,t.ch+u*(Vt>=55296&&Vt<56320?2:1))),-u)}else _?Dt=kl(e.cm,ae,t,u):Dt=Ls(ae,t,u);if(Dt==null)if(!Ft&&me())t=Is(_,e.cm,ae,t.line,oe);else return!1;else t=Dt;return!0}if(l=="char"||l=="codepoint")De();else if(l=="column")De(!0);else if(l=="word"||l=="group")for(var Me=null,Ye=l=="group",Ke=e.cm&&e.cm.getHelper(t,"wordChars"),lt=!0;!(u<0&&!De(!lt));lt=!1){var vt=ae.text.charAt(t.ch)||`
|
|
`,bt=Je(vt,Ke)?"w":Ye&&vt==`
|
|
`?"n":!Ye||/\s/.test(vt)?null:"p";if(Ye&&!lt&&!bt&&(bt="s"),Me&&Me!=bt){u<0&&(u=1,De(),t.sticky="after");break}if(bt&&(Me=bt),u>0&&!De(!lt))break}var It=ss(e,t,B,Q,!0);return Kt(B,It)&&(It.hitSide=!0),It}function $o(e,t,u,l){var _=e.doc,B=t.left,Q;if(l=="page"){var ae=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ae-.5*Mn(e.display),3);Q=(u>0?t.bottom:t.top)+u*oe}else l=="line"&&(Q=u>0?t.bottom+3:t.top-3);for(var me;!(me=Wi(e,B,Q),!me.outside);){if(u<0?Q<=0:Q>=_.height){me.hitSide=!0;break}Q+=u*5}return me}var fr=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};fr.prototype.init=function(e){var t=this,u=this,l=u.cm,_=u.div=e.lineDiv;Xo(_,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function B(ae){for(var oe=ae.target;oe;oe=oe.parentNode){if(oe==_)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}Ue(_,"paste",function(ae){if(!B(ae)||re(l,ae)||Ko(ae,l))return;k<=11&&setTimeout(Kr(l,function(){return t.updateFromDOM()}),20)}),Ue(_,"compositionstart",function(ae){t.composing={data:ae.data,done:!1}}),Ue(_,"compositionupdate",function(ae){t.composing||(t.composing={data:ae.data,done:!1})}),Ue(_,"compositionend",function(ae){t.composing&&(ae.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ue(_,"touchstart",function(){return u.forceCompositionEnd()}),Ue(_,"input",function(){t.composing||t.readFromDOMSoon()});function Q(ae){if(!B(ae)||re(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 oe=Vo(l);hs({lineWise:!0,text:oe.text}),ae.type=="cut"&&l.operation(function(){l.setSelections(oe.ranges,0,Ae),l.replaceSelection("",null,"cut")})}else return;if(ae.clipboardData){ae.clipboardData.clearData();var me=Ki.text.join(`
|
|
`);if(ae.clipboardData.setData("Text",me),ae.clipboardData.getData("Text")==me){ae.preventDefault();return}}var De=Yo(),Me=De.firstChild;l.display.lineSpace.insertBefore(De,l.display.lineSpace.firstChild),Me.value=Ki.text.join(`
|
|
`);var Ye=document.activeElement;K(Me),setTimeout(function(){l.display.lineSpace.removeChild(De),Ye.focus(),Ye==_&&u.showPrimarySelection()},50)}Ue(_,"copy",Q),Ue(_,"cut",Q)},fr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},fr.prototype.prepareSelection=function(){var e=hr(this.cm,!1);return e.focus=document.activeElement==this.div,e},fr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},fr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},fr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,u=t.doc.sel.primary(),l=u.from(),_=u.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||_.line<t.display.viewFrom){e.removeAllRanges();return}var B=fs(t,e.anchorNode,e.anchorOffset),Q=fs(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&Q&&!Q.bad&>(jt(B,Q),l)==0&>(sn(B,Q),_)==0)return;var ae=t.display.view,oe=l.line>=t.display.viewFrom&&Jo(t,l)||{node:ae[0].measure.map[2],offset:0},me=_.line<t.display.viewTo&&Jo(t,_);if(!me){var De=ae[ae.length-1].measure,Me=De.maps?De.maps[De.maps.length-1]:De.map;me={node:Me[Me.length-1],offset:Me[Me.length-2]-Me[Me.length-3]}}if(!oe||!me){e.removeAllRanges();return}var Ye=e.rangeCount&&e.getRangeAt(0),Ke;try{Ke=b(oe.node,oe.offset,me.offset,me.node)}catch(lt){}Ke&&(!P&&t.state.focused?(e.collapse(oe.node,oe.offset),Ke.collapsed||(e.removeAllRanges(),e.addRange(Ke))):(e.removeAllRanges(),e.addRange(Ke)),Ye&&e.anchorNode==null?e.addRange(Ye):P&&this.startGracePeriod()),this.rememberSelection()},fr.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)},fr.prototype.showMultipleSelections=function(e){m(this.cm.display.cursorDiv,e.cursors),m(this.cm.display.selectionDiv,e.selection)},fr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},fr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},fr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},fr.prototype.blur=function(){this.div.blur()},fr.prototype.getField=function(){return this.div},fr.prototype.supportsTouch=function(){return!0},fr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Oi(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)},fr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},fr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(i&&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&&Oi(t,function(){ni(t.doc,ia(u,l),Ae),(u.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},fr.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(),_=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=ze(l.line-1,X(e.doc,l.line-1).length)),_.ch==X(e.doc,_.line).text.length&&_.line<e.lastLine()&&(_=ze(_.line+1,0)),l.line<t.viewFrom||_.line>t.viewTo-1)return!1;var B,Q,ae;l.line==t.viewFrom||(B=Ti(e,l.line))==0?(Q=Ie(t.view[0].line),ae=t.view[0].node):(Q=Ie(t.view[B].line),ae=t.view[B-1].node.nextSibling);var oe=Ti(e,_.line),me,De;if(oe==t.view.length-1?(me=t.viewTo-1,De=t.lineDiv.lastChild):(me=Ie(t.view[oe+1].line)-1,De=t.view[oe+1].node.previousSibling),!ae)return!1;for(var Me=e.doc.splitLines(tu(e,ae,De,Q,me)),Ye=$(e.doc,ze(Q,0),ze(me,X(e.doc,me).text.length));Me.length>1&&Ye.length>1;)if(U(Me)==U(Ye))Me.pop(),Ye.pop(),me--;else if(Me[0]==Ye[0])Me.shift(),Ye.shift(),Q++;else break;for(var Ke=0,lt=0,vt=Me[0],bt=Ye[0],It=Math.min(vt.length,bt.length);Ke<It&&vt.charCodeAt(Ke)==bt.charCodeAt(Ke);)++Ke;for(var Ft=U(Me),Dt=U(Ye),Vt=Math.min(Ft.length-(Me.length==1?Ke:0),Dt.length-(Ye.length==1?Ke:0));lt<Vt&&Ft.charCodeAt(Ft.length-lt-1)==Dt.charCodeAt(Dt.length-lt-1);)++lt;if(Me.length==1&&Ye.length==1&&Q==l.line)for(;Ke&&Ke>l.ch&&Ft.charCodeAt(Ft.length-lt-1)==Dt.charCodeAt(Dt.length-lt-1);)Ke--,lt++;Me[Me.length-1]=Ft.slice(0,Ft.length-lt).replace(/^\u200b+/,""),Me[0]=Me[0].slice(Ke).replace(/\u200b+$/,"");var gn=ze(Q,Ke),on=ze(me,Ye.length?U(Ye).length-lt:0);if(Me.length>1||Me[0]||gt(gn,on))return Ta(e.doc,Me,gn,on,"+input"),!0},fr.prototype.ensurePolled=function(){this.forceCompositionEnd()},fr.prototype.reset=function(){this.forceCompositionEnd()},fr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},fr.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)},fr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Oi(this.cm,function(){return Tr(e.cm)})},fr.prototype.setUneditable=function(e){e.contentEditable="false"},fr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Kr(this.cm,Ns)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},fr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},fr.prototype.onContextMenu=function(){},fr.prototype.resetPosition=function(){},fr.prototype.needsContentAttribute=!0;function Jo(e,t){var u=er(e,t.line);if(!u||u.hidden)return null;var l=X(e.doc,t.line),_=hn(u,l,t.line),B=ft(l,e.doc.direction),Q="left";if(B){var ae=tt(B,t.ch);Q=ae%2?"right":"left"}var oe=mn(_.map,t.ch,Q);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Aa(e,t){return t&&(e.bad=!0),e}function tu(e,t,u,l,_){var B="",Q=!1,ae=e.doc.lineSeparator(),oe=!1;function me(Ke){return function(lt){return lt.id==Ke}}function De(){Q&&(B+=ae,oe&&(B+=ae),Q=oe=!1)}function Me(Ke){Ke&&(De(),B+=Ke)}function Ye(Ke){if(Ke.nodeType==1){var lt=Ke.getAttribute("cm-text");if(lt){Me(lt);return}var vt=Ke.getAttribute("cm-marker"),bt;if(vt){var It=e.findMarks(ze(l,0),ze(_+1,0),me(+vt));It.length&&(bt=It[0].find(0))&&Me($(e.doc,bt.from,bt.to).join(ae));return}if(Ke.getAttribute("contenteditable")=="false")return;var Ft=/^(pre|div|p|li|table|br)$/i.test(Ke.nodeName);if(!/^br$/i.test(Ke.nodeName)&&Ke.textContent.length==0)return;Ft&&De();for(var Dt=0;Dt<Ke.childNodes.length;Dt++)Ye(Ke.childNodes[Dt]);/^(pre|p)$/i.test(Ke.nodeName)&&(oe=!0),Ft&&(Q=!0)}else Ke.nodeType==3&&Me(Ke.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ye(t),t==u);)t=t.nextSibling,oe=!1;return B}function fs(e,t,u){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return Aa(e.clipPos(ze(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 _=0;_<e.display.view.length;_++){var B=e.display.view[_];if(B.node==l)return nu(B,t,u)}}function nu(e,t,u){var l=e.text.firstChild,_=!1;if(!t||!y(l,t))return Aa(ze(Ie(e.line),0),!0);if(t==l&&(_=!0,t=l.childNodes[u],u=0,!t)){var B=e.rest?U(e.rest):e.line;return Aa(ze(Ie(B),B.text.length),_)}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 oe=e.measure,me=oe.maps;function De(bt,It,Ft){for(var Dt=-1;Dt<(me?me.length:0);Dt++)for(var Vt=Dt<0?oe.map:me[Dt],gn=0;gn<Vt.length;gn+=3){var on=Vt[gn+2];if(on==bt||on==It){var Wn=Ie(Dt<0?e.line:e.rest[Dt]),mr=Vt[gn]+Ft;return(Ft<0||on!=bt)&&(mr=Vt[gn+(Ft?1:0)]),ze(Wn,mr)}}}var Me=De(Q,ae,u);if(Me)return Aa(Me,_);for(var Ye=ae.nextSibling,Ke=Q?Q.nodeValue.length-u:0;Ye;Ye=Ye.nextSibling){if(Me=De(Ye,Ye.firstChild,0),Me)return Aa(ze(Me.line,Me.ch-Ke),_);Ke+=Ye.textContent.length}for(var lt=ae.previousSibling,vt=u;lt;lt=lt.previousSibling){if(Me=De(lt,lt.firstChild,-1),Me)return Aa(ze(Me.line,Me.ch+vt),_);vt+=lt.textContent.length}}var Ir=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};Ir.prototype.init=function(e){var t=this,u=this,l=this.cm;this.createField(e);var _=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(_.style.width="0px"),Ue(_,"input",function(){H&&k>=9&&t.hasSelection&&(t.hasSelection=null),u.poll()}),Ue(_,"paste",function(Q){if(re(l,Q)||Ko(Q,l))return;l.state.pasteIncoming=+new Date,u.fastPoll()});function B(Q){if(re(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="",_.value=ae.text.join(`
|
|
`),K(_))}else return;Q.type=="cut"&&(l.state.cutIncoming=+new Date)}Ue(_,"cut",B),Ue(_,"copy",B),Ue(e.scroller,"paste",function(Q){if(Rn(e,Q)||re(l,Q))return;if(!_.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var ae=new Event("paste");ae.clipboardData=Q.clipboardData,_.dispatchEvent(ae)}),Ue(e.lineSpace,"selectstart",function(Q){Rn(e,Q)||le(Q)}),Ue(_,"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(_,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Ir.prototype.createField=function(e){this.wrapper=Yo(),this.textarea=this.wrapper.firstChild},Ir.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ir.prototype.prepareSelection=function(){var e=this.cm,t=e.display,u=e.doc,l=hr(e);if(e.options.moveInputWithCursor){var _=qn(e,u.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),Q=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,_.top+Q.top-B.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,_.left+Q.left-B.left))}return l},Ir.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")},Ir.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&&K(this.textarea),H&&k>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",H&&k>=9&&(this.hasSelection=null))},Ir.prototype.getField=function(){return this.textarea},Ir.prototype.supportsTouch=function(){return!1},Ir.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ir.prototype.blur=function(){this.textarea.blur()},Ir.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ir.prototype.receivedFocus=function(){this.slowPoll()},Ir.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()})},Ir.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)},Ir.prototype.poll=function(){var e=this,t=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ct(u)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var _=u.value;if(_==l&&!t.somethingSelected())return!1;if(H&&k>=9&&this.hasSelection===_||r&&/[\uf700-\uf7ff]/.test(_))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=_.charCodeAt(0);if(B==8203&&!l&&(l="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var Q=0,ae=Math.min(l.length,_.length);Q<ae&&l.charCodeAt(Q)==_.charCodeAt(Q);)++Q;return Oi(t,function(){Ns(t,_.slice(Q),l.length-Q,null,e.composing?"*compose":null),_.length>1e3||_.indexOf(`
|
|
`)>-1?u.value=e.prevInput="":e.prevInput=_,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ir.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ir.prototype.onKeyPress=function(){H&&k>=9&&(this.hasSelection=null),this.fastPoll()},Ir.prototype.onContextMenu=function(e){var t=this,u=t.cm,l=u.display,_=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=jr(u,e),Q=l.scroller.scrollTop;if(!B||p)return;var ae=u.options.resetSelectionOnContextMenu;ae&&u.doc.sel.contains(B)==-1&&Kr(u,ni)(u.doc,ia(B),Ae);var oe=_.style.cssText,me=t.wrapper.style.cssText,De=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",_.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-De.top-5)+"px; left: "+(e.clientX-De.left-5)+`px;
|
|
z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Me;n&&(Me=window.scrollY),l.input.focus(),n&&window.scrollTo(null,Me),l.input.reset(),u.somethingSelected()||(_.value=t.prevInput=" "),t.contextMenuPending=Ke,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Ye(){if(_.selectionStart!=null){var vt=u.somethingSelected(),bt="\u200B"+(vt?_.value:"");_.value="\u21DA",_.value=bt,t.prevInput=vt?"":"\u200B",_.selectionStart=1,_.selectionEnd=bt.length,l.selForContextMenu=u.doc.sel}}function Ke(){if(t.contextMenuPending!=Ke)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=me,_.style.cssText=oe,H&&k<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=Q),_.selectionStart!=null){(!H||H&&k<9)&&Ye();var vt=0,bt=function(){l.selForContextMenu==u.doc.sel&&_.selectionStart==0&&_.selectionEnd>0&&t.prevInput=="\u200B"?Kr(u,po)(u):vt++<10?l.detectingSelectAll=setTimeout(bt,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(bt,200)}}if(H&&k>=9&&Ye(),A){_e(e);var lt=function(){et(window,"mouseup",lt),setTimeout(Ke,20)};Ue(window,"mouseup",lt)}else setTimeout(Ke,50)},Ir.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ir.prototype.setUneditable=function(){},Ir.prototype.needsContentAttribute=!1;function ru(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=M();t.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=ae.getValue()}var _;if(e.form&&(Ue(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var B=e.form;_=B.submit;try{var Q=B.submit=function(){l(),B.submit=_,B.submit(),B.submit=Q}}catch(oe){}}t.finishInit=function(oe){oe.save=l,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,l(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(et(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=_))}},e.style.display="none";var ae=xr(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return ae}function iu(e){e.off=et,e.on=Ue,e.wheelEventPixels=dl,e.Doc=mi,e.splitLines=xt,e.countColumn=V,e.findColumn=je,e.isWordChar=Ge,e.Pass=Le,e.signal=fe,e.Line=oi,e.changeEnd=aa,e.scrollbarModel=Gs,e.Pos=ze,e.cmpPos=gt,e.modes=On,e.mimeModes=kt,e.resolveMode=en,e.getMode=wn,e.modeExtensions=Wt,e.extendMode=At,e.copyState=Zt,e.startState=de,e.innerMode=Ee,e.commands=Ya,e.keyMap=Zi,e.keyName=Lo,e.isModifierKey=Ro,e.lookupKey=Ca,e.normalizeKeyMap=Pl,e.StringStream=j,e.SharedTextMarker=za,e.TextMarker=oa,e.LineWidget=Ka,e.e_preventDefault=le,e.e_stopPropagation=he,e.e_stop=_e,e.addClass=W,e.contains=y,e.rmClass=v,e.keyNames=la}$l(xr),ql(xr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ps in mi.prototype)mi.prototype.hasOwnProperty(ps)&&se(au,ps)<0&&(xr.prototype[ps]=function(e){return function(){return e.apply(this.doc,arguments)}}(mi.prototype[ps]));return pe(mi),xr.inputStyles={textarea:Ir,contenteditable:fr},xr.defineMode=function(e){!xr.defaults.mode&&e!="null"&&(xr.defaults.mode=e),Un.apply(this,arguments)},xr.defineMIME=An,xr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xr.defineMIME("text/plain","null"),xr.defineExtension=function(e,t){xr.prototype[e]=t},xr.defineDocExtension=function(e,t){mi.prototype[e]=t},xr.fromTextArea=ru,iu(xr),xr.version="5.58.2",xr})},W7jJ:function(We,ge,D){"use strict";D.r(ge);var q=D("0Owb"),z=D("PpiC"),P=D("OaEy"),Y=D("2fM7"),N=D("T2oS"),O=D("W9HT"),H=D("miYZ"),k=D("tsqr"),n=D("2qtc"),I=D("kLXV"),g=D("9og8"),p=D("tJVT"),h=D("k1fw"),c=D("aHsQ"),o=D("sGsY"),d=D("WmNS"),i=D.n(d),a=D("q1tI"),r=D.n(a),s=D("Fvcw"),S=D("GIiI"),x=D("Ty5D"),T=D("9kvl"),A=D("55Ip"),w=D("7qur"),v=D("cDPC"),E=D("m3rI"),m=D("RCxd"),f=D("EHPI"),C=D("J66h"),b=D("uMZB"),y=D.n(b),M=D("sNtx"),W=D("RpDr"),L=D("+L6B"),K=D("2/Rp"),F=D("y8nQ"),R=D("Vl3Y"),V=D("5NDa"),ne=D("5rEg"),se=ne.a.TextArea,Se=5e3,Le=function(Ve){var rt=Ve.callback,Et=Ve.onCancel,$t=Ve.notes;function Ut(Ot){rt(Ot)}return r.a.createElement(R.a,{className:"note-form-panel",onFinish:Ut,initialValues:{notes:$t}},r.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)}]},r.a.createElement(se,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),r.a.createElement(R.a.Item,{style:{textAlign:"right"}},r.a.createElement(K.a,{type:"ghost",onClick:Et,style:{marginRight:10}}," ","\u53D6\u6D88"," "),r.a.createElement(K.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Ae=D("ZsLC"),Pe=D.n(Ae),Fe=D("DjyN"),je=D("NUBc"),Te=D("g9YV"),Z=D("wCAj"),U=D("Hw79"),G=D.n(U),ee=D("ye1Q"),ue=D("lfch"),J=D("bdLU"),we=D("1vsH"),Ge=D("wd/R"),Je=D.n(Ge),be=Z.a.Column,Re=function(Ve){var rt=Ve.submitResult,Et=Ve.submitting,$t=Ve.submitRecords,Ut=Ve.page,Ot=Ve.onPageChange,Qe=Ve.topicId,st=rt||{},Xt=st.status,nt=st.id,Yt=st.input,_t=st.output,tn=st.expected_output,Pn=st.is_file,Sn=st.input_file_url,dn=st.output_file_url,Xn=st.expected_output_file_url,_n=st.error_msg,Gn=$t||{},Kn=Gn.records,dr=Gn.records_count,Rn=Object(x.i)();function or(){Pn?navigator.clipboard.writeText(C.Base64.decode(_n)).then(function(){k.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(C.Base64.decode(_t)).then(function(){k.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return r.a.createElement(O.a,{spinning:Et,tip:"\u8BC4\u6D4B\u4E2D...",indicator:r.a.createElement(ee.a,{style:{fontSize:24},spin:!0})},nt?r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:G.a.info},r.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",r.a.createElement("span",{className:Xt===J.a.OK?"c-green":"c-red"},W.a[Xt])),r.a.createElement("li",{className:G.a.error},r.a.createElement("a",{onClick:or},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",r.a.createElement(ue.a,null)," ")),r.a.createElement("li",null,r.a.createElement(A.a,{to:"/problems/".concat(Qe,"/record-detail/").concat(nt,"?backId=").concat(Rn==null?void 0:Rn.save_identifier)},"\u663E\u793A\u8BE6\u60C5 >"," "))),Xt!==J.a.OK?r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),r.a.createElement("pre",null,!Pn&&Yt,Pn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(we.y)(Sn,Yt)}},Yt)),r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,(Xt===4||Xt===5)&&C.Base64.decode(_n),Xt!=4&&Xt!=5&&(Pn?r.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(we.y)(dn,_t)}},_t):C.Base64.decode(_t))),r.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,!Pn&&C.Base64.decode(tn),Pn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(we.y)(Xn,tn)}},tn))):null):null,(Kn==null?void 0:Kn.length)>0?r.a.createElement(Z.a,{dataSource:Kn,rowKey:"id",pagination:!1},r.a.createElement(be,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function($n,Tn){return r.a.createElement("span",null," ",Je()($n).format("YYYY-MM-DD HH:mm:ss"))}}),r.a.createElement(be,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function($n,Tn){var zn;return r.a.createElement(A.a,{className:$n===0?"c-green":"c-red",to:"/problems/".concat(Qe,"/record-detail/").concat(Tn.id,"?backId=").concat(Rn==null?void 0:Rn.save_identifier)},(zn=W.a[$n])===null||zn===void 0?void 0:zn.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),r.a.createElement(be,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),r.a.createElement(be,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),r.a.createElement(be,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,dr>15?r.a.createElement(je.a,{className:G.a.pagination,current:Ut,pageSize:15,total:dr,onChange:Ot}):null)},xe=D("BdwD"),Ce=D("DYRE"),Be=D("zeV3"),Xe=D("+BJd"),qe=D("mr32"),tt=D("TcMa"),ht=D.n(tt),ft=D("9Bee"),Ne={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Ue=function(Ve){var rt=Ve.hack,Et=Ve.onTriggerPraise,$t=Ve.toDiscuss,Ut=rt.language,Ot=rt.difficulty,Qe=rt.time_limit,st=rt.username,Xt=rt.user_path,nt=rt.user_praise,Yt=rt.comments_count,_t=rt.praises_count,tn=rt.description,Pn=rt.pass_count,Sn=rt.submit_count,dn=Object(x.h)();console.log(rt.language,"language");var Xn=Ne[Ot];return r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:ht.a.info},r.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",r.a.createElement(qe.a,{color:Xn.color},Xn.name)),r.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",r.a.createElement("b",null,Qe,"\u79D2"))),r.a.createElement(ft.a,{value:tn,className:ht.a.desc}),r.a.createElement("ul",{className:ht.a["commit-info"]},r.a.createElement("li",null,r.a.createElement(Be.a,{size:4},r.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",r.a.createElement("b",null,Pn))),r.a.createElement("li",null,r.a.createElement(Be.a,{size:4},r.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",r.a.createElement("b",null,Sn))," "),r.a.createElement("li",{style:{flex:"1 0 0"}}),r.a.createElement("li",null,r.a.createElement(Be.a,{size:4},r.a.createElement("i",{className:"iconfont icon-huifu1",onClick:$t})," ",r.a.createElement("b",null,Yt))," ")))},Ze=D("dhSg"),et=D("ps8w"),fe=D.n(et),re=D("oBTY"),ie=D("M8RZ"),ce=D("OkW/"),pe=D("ErOA");function le(Ve){return Object(pe.c)("comments.json",Ve)}function he(Ve){return Object(pe.f)("/discusses/".concat(Ve,"/plus.json"),{container_type:"Discuss",type:1})}function ye(Ve){return Object(pe.f)("comments/reply.json",Ve)}function _e(Ve){return Object(pe.f)("comments.json",Ve)}function Oe(Ve){return Object(pe.f)("comments/".concat(Ve==null?void 0:Ve.id,"/hidden.json"),Ve)}function ke(Ve){return Object(pe.b)("comments/".concat(Ve==null?void 0:Ve.id,".json"))}var $e=D("GgEA"),ot=D("AMnG"),pt=D("xKgJ");function mt(Ve){var rt=Ve.author;return r.a.createElement("a",{href:"/users/".concat(rt.login),target:"_blank"},r.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(E.a.IMG_SERVER,"/images/").concat(rt.image_url),width:"50"}))}function qt(Ve){var rt=Ve.data,Et=Ve.index,$t=Ve.parentDiscussIndex,Ut=Ve.user,Ot=Ve.onSetActionType,Qe=rt.author,st=rt.can_delete,Xt=rt.content,nt=rt.id,Yt=rt.time;function _t(){Ot({id:nt,index:Et,type:"delete-discuss",parentDiscussIndex:$t,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var tn=Ut.admin||st||Qe.user_id===Ut.user_id;return r.a.createElement("div",{className:"discuss-item-container second-discuss "},r.a.createElement(mt,{author:Qe}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(Qe.login),target:"_blank"},Qe.name),r.a.createElement("span",{className:"grey"},Yt),r.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},tn?r.a.createElement("a",{onClick:_t,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),r.a.createElement(ft.a,{className:"discuss-content",value:Xt})))}var xt=function(Ve){var rt=Ve.user,Et=Ve.data,$t=Ve.index,Ut=Ve.onPlusDiscuss,Ot=Ve.onSetActionType,Qe=Ve.activeDiscussIndex,st=Ve.onReplyDiscuss,Xt=Ve.onSetActiveDiscussIndex,nt=Et.content,Yt=Et.children,_t=Et.hidden,tn=Et.id,Pn=Et.praise_count,Sn=Et.time,dn=Et.user_praise,Xn=Et.can_delete,_n=Et.author;console.log(Xn&&(!Yt||Yt.length==0),"children22");function Gn(){Xt(tn)}function Kn(){Ut(tn,!dn,$t)}function dr(){Ot({id:tn,index:$t,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Rn(){Ot({id:tn,index:$t,params:{hidden:_t?"0":"1"},type:"hidden-discuss",message:_t?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var or=rt.admin||rt.user_id===_n.user_id;return r.a.createElement("div",{className:"discuss-item-container",key:tn},r.a.createElement(mt,{author:_n}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(_n.login),target:"_blank"}," ",_n.name," "),r.a.createElement("span",{className:"grey"},Sn)),r.a.createElement(ft.a,{className:"discuss-content",value:nt}),Yt&&Yt.length>0?r.a.createElement("div",{className:"reply-discuss-container"},Yt.map(function(lr,$n){return r.a.createElement(qt,{key:lr.id,data:lr,index:$n,user:rt,onSetActionType:Ot,parentDiscussIndex:$t})})):null,r.a.createElement("div",{className:"btn-group"},Object(pt.w)()?r.a.createElement("a",{onClick:Rn,title:_t?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},r.a.createElement("i",{className:_t?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Xn&&(!Yt||Yt.length==0)?r.a.createElement("a",{onClick:dr,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null,r.a.createElement("a",{onClick:Gn,title:"\u56DE\u590D"}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," "),r.a.createElement("a",{onClick:Kn,className:dn?"c-orange":""},r.a.createElement("i",{className:dn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),r.a.createElement("span",null,Pn||""))),r.a.createElement(ot.a,{id:tn,activeDiscussIndex:Qe,onReplyDiscuss:st})))},Ct=D("kaH+"),Pt=D("Wx9E"),Rt=D("Ot1p"),Gt=function(Ve){var rt=Ve.user_praise,Et=Ve.praise_count,$t=Ve.praisePlus,Ut=Ve.onCreateDiscuss,Ot=Ve.discuss_count,Qe=Object(a.useState)(!1),st=Object(p.a)(Qe,2),Xt=st[0],nt=st[1],Yt=Object(a.useState)(""),_t=Object(p.a)(Yt,2),tn=_t[0],Pn=_t[1];function Sn(Kn){Pn(Kn)}function dn(){nt(!0)}function Xn(){nt(!1)}function _n(){return Gn.apply(this,arguments)}function Gn(){return Gn=Object(g.a)(i.a.mark(function Kn(){return i.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:Ut(tn),Pn(""),nt(!1);case 3:case"end":return Rn.stop()}},Kn)})),Gn.apply(this,arguments)}return r.a.createElement("div",{className:"dis-input-editor-container ".concat(Xt?"active":""," ")},r.a.createElement("div",{className:Xt?"text-area hide":"text-area"},r.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:dn}),r.a.createElement("a",{style:{alignItems:"center"}}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Ot," "),r.a.createElement("a",{className:"c-light-black",onClick:$t,style:{alignItems:"center"},title:rt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},r.a.createElement("i",{className:"mr3 ".concat(rt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Et?r.a.createElement("span",null,Et):"")),Xt?r.a.createElement("div",{className:"input-mask",onClick:Xn}):null,r.a.createElement("div",{className:Xt?"md-container":"md-container hide"},r.a.createElement(Rt.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:tn,height:240,onChange:Sn}),r.a.createElement("div",{className:"tip-container",onClick:Xn},r.a.createElement("a",{className:"btn-send",onClick:_n}," ","\u53D1\u9001"," "))))},On={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},kt;(function(Ve){Ve[Ve.GET_DISCUSSES=0]="GET_DISCUSSES",Ve[Ve.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Ve[Ve.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Ve[Ve.PLUS_DISCUSS=3]="PLUS_DISCUSS",Ve[Ve.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Ve[Ve.SET_PAGE=5]="SET_PAGE",Ve[Ve.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(kt||(kt={}));function Un(Ve,rt){switch(rt.type){case kt.SHOW_DISCUSSES_LOADING:return Object(h.a)(Object(h.a)({},Ve),{},{loading:!0});case kt.GET_DISCUSSES:return Object(h.a)(Object(h.a)({},Ve),rt.payload);case kt.TOP_OR_DOWN_DISCUSS:return Object(h.a)(Object(h.a)({},Ve),rt.payload);case kt.SET_ACTION_TYPE:return Object(h.a)(Object(h.a)({},Ve),rt.payload);case kt.PLUS_DISCUSS:return Object(h.a)(Object(h.a)({},Ve),rt.payload);case kt.SET_PAGE:return Object(h.a)(Object(h.a)({},Ve),{},{page:rt.payload});case kt.ACTIVE_DISCUSS_INDEX:return Object(h.a)(Object(h.a)({},Ve),rt.payload);default:throw new Error}}var An=function(Ve){var rt=Ve.user,Et=Ve.identifier,$t=Ve.hack,Ut=Ve.onTriggerPraise,Ot=Ve.setDiscussTotal,Qe=Object(a.useReducer)(Un,On),st=Object(p.a)(Qe,2),Xt=st[0],nt=st[1],Yt=Xt.loading,_t=Xt.page,tn=Xt.data,Pn=Xt.count,Sn=Xt.actionType,dn=Xt.activeDiscussIndex,Xn=Object(a.useCallback)(Object(g.a)(i.a.mark(function hn(){var Zn,ur,er;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return nt({type:kt.SHOW_DISCUSSES_LOADING}),bn.next=3,le({container_type:"Practice",container_identifier:Et,limit:10,page:_t});case 3:Zn=bn.sent,ur=Zn.comments,er=Zn.disscuss_count,nt({type:kt.GET_DISCUSSES,payload:{data:ur,count:er,loading:!1}}),Ot(er);case 7:case"end":return bn.stop()}},hn)})),[_t,Et]);Object(a.useEffect)(function(){Xn()},[Et,_t]);function _n(hn){nt({type:kt.SET_PAGE,page:hn})}function Gn(hn){nt({type:kt.SET_ACTION_TYPE,payload:{actionType:hn}})}function Kn(hn){dn===hn?nt({type:kt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):nt({type:kt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:hn}})}function dr(hn,Zn,ur){return Rn.apply(this,arguments)}function Rn(){return Rn=Object(g.a)(i.a.mark(function hn(Zn,ur,er){var Vn;return i.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.prev=0,rn.next=3,he(Zn);case 3:Vn=rn.sent,tn[er].user_praise=ur,tn[er].praise_count=Vn.praise_count,nt({type:kt.PLUS_DISCUSS,payload:{data:Object(re.a)(tn)}}),rn.next=12;break;case 9:rn.prev=9,rn.t0=rn.catch(0),console.log(rn.t0);case 12:case"end":return rn.stop()}},hn,null,[[0,9]])})),Rn.apply(this,arguments)}function or(){return lr.apply(this,arguments)}function lr(){return lr=Object(g.a)(i.a.mark(function hn(){var Zn,ur,er,Vn,bn;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:if(Zn=Sn.id,ur=Sn.params,er=Sn.type,Vn=Sn.index,bn=Sn.parentDiscussIndex,!(er==="hidden-discuss")){mn.next=7;break}return console.log(ur,"params"),mn.next=5,Oe(Object(h.a)({id:Zn,container_type:"Practice",container_identifier:Et},ur));case 5:bn?tn[bn].children[Vn].hidden=ur.hidden==1:tn[Vn].hidden=ur.hidden==1,nt({type:kt.SET_ACTION_TYPE,payload:{actionType:null,data:Object(re.a)(tn)}});case 7:if(!(er==="delete-discuss")){mn.next=13;break}return mn.next=10,ke({id:Zn,container_type:"Practice",container_identifier:Et});case 10:return nt({type:kt.SET_ACTION_TYPE,payload:{actionType:null}}),mn.next=13,Xn();case 13:case"end":return mn.stop()}},hn)})),lr.apply(this,arguments)}function $n(){nt({type:kt.SET_ACTION_TYPE,payload:{actionType:null}})}function Tn(hn,Zn){return zn.apply(this,arguments)}function zn(){return zn=Object(g.a)(i.a.mark(function hn(Zn,ur){return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.prev=0,Vn.next=3,ye({container_type:"Practice",container_identifier:Et,comments:{content:ur,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()}},hn,null,[[0,6]])})),zn.apply(this,arguments)}function kn(hn){return wt.apply(this,arguments)}function wt(){return wt=Object(g.a)(i.a.mark(function hn(Zn){return i.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:return nt({type:kt.SHOW_DISCUSSES_LOADING}),er.next=3,_e({comments:{content:Zn},container_type:"Practice",container_identifier:Et});case 3:Xn();case 4:case"end":return er.stop()}},hn)})),wt.apply(this,arguments)}return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"discuss-panel"},tn.length===0?r.a.createElement(xe.a,null):tn.map(function(hn,Zn){return r.a.createElement(xt,{onReplyDiscuss:Tn,onPlusDiscuss:dr,onSetActiveDiscussIndex:Kn,onSetActionType:Gn,data:hn,index:Zn,user:rt,activeDiscussIndex:dn})}),Pn>10?r.a.createElement("div",{className:"pagination-container"},r.a.createElement(je.a,{showQuickJumper:!0,onChange:_n,current:_t,total:Pn})):null),r.a.createElement(Gt,{user_praise:$t.user_praise,praise_count:$t.praises_count,praisePlus:Ut,discuss_count:$t.comments_count,onCreateDiscuss:kn}),r.a.createElement(ie.a,null,r.a.createElement(I.a,{centered:!0,title:"\u63D0\u793A",visible:!!Sn,onOk:or,onCancel:$n},r.a.createElement("p",null,Sn?Sn.message:"")),r.a.createElement(Ct.a,null)))},en=D("1FX+"),wn=D.n(en),Wt=D("pYxM"),At=D.n(Wt),Zt=D("sB/4"),Ee=D.n(Zt),de=D("Wtmd"),j=D.n(de),X=D("CNDd"),$=D.n(X),te=D("nCk5"),ve=D.n(te),Ie=D("kovY"),He=D.n(Ie),ct=function(rt){var Et=rt.style,$t=Et===void 0?{}:Et,Ut=rt.onClick,Ot=rt.onAssist,Qe=rt.onHide,st=rt.data,Xt=rt.active,nt=rt.showLine;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:Xt===(st==null?void 0:st.id)?"".concat(At.a.list," ").concat(At.a.active):At.a.list,style:$t,onClick:function(){return Ut(st)}},(st==null?void 0:st.video)&&r.a.createElement("div",{className:At.a.left},r.a.createElement("img",{src:st==null?void 0:st.video_cover}),r.a.createElement("div",null,r.a.createElement("img",{src:Ee.a}),r.a.createElement("span",null,st==null?void 0:st.video_duration)),r.a.createElement("div",{className:At.a.mask})),r.a.createElement("div",{className:At.a.right},r.a.createElement("div",{className:At.a.name},r.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(st==null?void 0:st.image_url),width:30,height:30}),r.a.createElement("div",{title:st==null?void 0:st.name,className:At.a.title},st==null?void 0:st.name),(st==null?void 0:st.is_authority)&&r.a.createElement("div",{className:At.a.b},"\u5B98\u65B9"),(st==null?void 0:st.is_excellent)&&r.a.createElement("div",{className:At.a.a},"\u7CBE\u9009")),r.a.createElement("div",{className:At.a.des},r.a.createElement(ft.a,{showLines:2,showTextOnly:!0,value:(st==null?void 0:st.content)||"\u6682\u65E0\u5185\u5BB9"})),r.a.createElement("div",{className:At.a.tag},r.a.createElement("span",{className:"current",onClick:function(_t){_t.stopPropagation(),Ot(st)}},r.a.createElement("img",{src:st!=null&&st.user_liker?$.a:j.a}),r.a.createElement("span",{style:{color:st!=null&&st.user_liker?"#0152d9":"#656f87"}},st==null?void 0:st.praises_count)),r.a.createElement("span",null,r.a.createElement("img",{src:ve.a}),r.a.createElement("span",null,st==null?void 0:st.discusses_count)),r.a.createElement("span",null,r.a.createElement("img",{src:He.a}),r.a.createElement("span",null,st==null?void 0:st.viewed_count)),Object(pt.w)()&&r.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(_t){_t.stopPropagation(),Qe(st)}},st!=null&&st.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),nt&&r.a.createElement("div",{className:At.a.line}))},ut=ct,ze=D("5Dmo"),gt=D("3S7+"),Kt=D("Z8dc"),dt=D.n(Kt),sn=D("7+5b"),jt=D.n(sn),St=D("twBr"),at=D.n(St),xn=D("oE5q"),it=D.n(xn),ln=D("9+Du"),cn=function(rt){var Et,$t=rt.onClose,Ut=rt.onOk,Ot=rt.identifier,Qe=rt.active,st=R.a.useForm(),Xt=Object(p.a)(st,1),nt=Xt[0],Yt=Object(a.useState)({}),_t=Object(p.a)(Yt,2),tn=_t[0],Pn=_t[1],Sn=Object(a.useState)(!1),dn=Object(p.a)(Sn,2),Xn=dn[0],_n=dn[1],Gn=Object(a.useState)(!1),Kn=Object(p.a)(Gn,2),dr=Kn[0],Rn=Kn[1],or=Object(a.useState)([]),lr=Object(p.a)(or,2),$n=lr[0],Tn=lr[1],zn=Object(pt.y)(),kn=Object(x.i)();Object(a.useEffect)(function(){Qe&&wt()},[Qe]);var wt=function(){var Ht=Object(g.a)(i.a.mark(function yt(){var Mt,Qt,tr,Er,Gr,kr,Ei,qn,xi,Di,Wi,Pi;return i.a.wrap(function(pi){for(;;)switch(pi.prev=pi.next){case 0:return pi.next=2,Object(w.k)(Ot,{active:Qe});case 2:Mt=pi.sent,(Mt==null?void 0:Mt.status)===0&&(kr={name:Mt==null||((Qt=Mt.data)===null||Qt===void 0)?void 0:Qt.name,content:Mt==null||((tr=Mt.data)===null||tr===void 0)?void 0:tr.content},nt.setFieldsValue(kr),Pn(kr),Mt!=null&&(Er=Mt.data)!==null&&Er!==void 0&&(Gr=Er.videos)!==null&&Gr!==void 0&&Gr[0]&&Tn([{video_id:Mt==null||((Ei=Mt.data)===null||Ei===void 0||((qn=Ei.videos)===null||qn===void 0||((xi=qn[0])===null||xi===void 0)))?void 0:xi.video_id,name:Mt==null||((Di=Mt.data)===null||Di===void 0||((Wi=Di.videos)===null||Wi===void 0||((Pi=Wi[0])===null||Pi===void 0)))?void 0:Pi.title,loaded:100}]));case 4:case"end":return pi.stop()}},yt)}));return function(){return Ht.apply(this,arguments)}}(),hn=function(yt,Mt){Pn(Object(h.a)({},Mt))},Zn=function(){var Ht=Object(g.a)(i.a.mark(function yt(Mt){var Qt,tr,Er,Gr,kr;return i.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(tr={videos:$n,articles:Mt},Rn(!0),!Qe){qn.next=9;break}return tr.active=Qe,qn.next=6,Object(w.j)(Ot,tr);case 6:Er=qn.sent,qn.next=12;break;case 9:return qn.next=11,Object(w.a)(Ot,tr);case 11:Er=qn.sent;case 12:((Qt=Er)===null||Qt===void 0?void 0:Qt.status)===0&&(console.log(Qe||((Gr=Er)===null||Gr===void 0?void 0:Gr.id),44),Ut(Qe||((kr=Er)===null||kr===void 0?void 0:kr.id))),Rn(!1);case 14:case"end":return qn.stop()}},yt)}));return function(Mt){return Ht.apply(this,arguments)}}(),ur=function(yt){var Mt=1024,Qt=yt.name.toLowerCase();return Qt&&Qt.indexOf(".avi")==-1&&Qt.indexOf(".flv")==-1&&Qt.indexOf(".f4v")==-1&&Qt.indexOf(".m4v")==-1&&Qt.indexOf(".mov")==-1&&Qt.indexOf(".mp4")==-1&&Qt.indexOf(".rmvb")==-1&&Qt.indexOf(".swf")==-1&&Qt.indexOf(".webm")==-1&&Qt.indexOf(".wmv")==-1?(k.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),!0):yt.size>Mt*1024*1024?(k.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Mt,"M")),!0):$n!=null&&$n.find(function(tr){return tr.name===yt.name})?(k.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},er=function(yt,Mt){I.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:r.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Mt?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Tn([])}})},Vn={accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*",onBefore:ur,onBeginInitFile:function(yt){_n(!0),Tn([{name:yt.filename,loaded:0}])},onComplete:function(yt){Tn([{name:yt.filename,loaded:yt.percent,video_id:yt.id}]),_n(!1)},onError:function(){Tn([]),_n(!1)},onProgress:function(yt){Tn([{name:yt.filename,loaded:yt.percent}])},chunkSize:1024*1024*2,options:{user_id:zn==null?void 0:zn.user_id}},bn=function(){return r.a.createElement(ln.a,Vn,r.a.createElement("div",{className:dt.a.main},r.a.createElement("img",{src:jt.a,alt:""}),r.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891")))},rn=function(yt){return r.a.createElement("div",{className:dt.a.mainLoading},r.a.createElement("div",{className:dt.a.proWarp},r.a.createElement("div",{className:dt.a.pro},r.a.createElement("div",{style:{width:yt}})),r.a.createElement("span",null,yt||0,"%")),r.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),r.a.createElement("div",{className:dt.a.tip},r.a.createElement(gt.a,{getPopupContainer:function(Qt){return Qt.parentNode},title:r.a.createElement("div",null,r.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",r.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"),r.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),r.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},r.a.createElement("img",{src:it.a,alt:""}))))},mn=function(yt){return r.a.createElement("div",{className:dt.a.mainSucceed},r.a.createElement("img",{src:at.a,alt:""}),r.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),r.a.createElement("div",{className:dt.a.tip},r.a.createElement(gt.a,{getPopupContainer:function(Qt){return Qt.parentNode},title:r.a.createElement("div",null,r.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",r.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"),r.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),r.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},r.a.createElement("img",{src:it.a,alt:""}))),r.a.createElement("div",{className:dt.a.del,onClick:function(){return er(yt.name,yt.loaded==100)}},r.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},Tt=function(){return r.a.createElement(r.a.Fragment,null,$n==null?void 0:$n.map(function(yt,Mt){return r.a.createElement(r.a.Fragment,{key:Mt},yt.loaded==100?mn(yt):rn(yt.loaded))}))},Lt=function(){I.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:$t})},Bt=$n==null?void 0:$n.length;return r.a.createElement("div",{className:dt.a.listForm},r.a.createElement("header",null,Qe?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),r.a.createElement("section",{className:dt.a.scroll,id:"sss"},r.a.createElement("div",{className:dt.a.formWrap}," ",r.a.createElement(R.a,{form:nt,scrollToFirstError:!0,layout:"vertical",onValuesChange:hn,onFinish:Zn},r.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"}]},r.a.createElement(ne.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Et=tn.name)===null||Et===void 0?void 0:Et.length)||0,"/60")})),r.a.createElement(R.a.Item,{name:"content",label:"\u5185\u5BB9:"},r.a.createElement(Rt.a,{defaultValue:tn.content||"",watch:!0})))),r.a.createElement("div",{className:dt.a.upload},Bt?Tt():bn())),r.a.createElement("div",{className:dt.a.btns},r.a.createElement(K.a,{onClick:Lt,type:"primary",ghost:!0},"\u5173\u95ED"),r.a.createElement(K.a,{loading:dr,disabled:Xn,onClick:function(){return nt.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},Yn=cn,nr=D("cWXX"),vn=D("/ezw"),gr=D("CaVn"),Jn=D.n(gr),Cn=D("s8/Y"),Dn=D.n(Cn),Dr=D("JOrW"),Hr=D.n(Dr),vr=D("gqXR"),rr=D.n(vr),yr=D("14J3"),Qr=D("BMrR"),_r=D("jCWc"),ir=D("kPKH"),Pr=D("wW8i"),Lr=D.n(Pr),Or=D("MVJL"),Sr=D.n(Or),ci=function(rt){var Et=rt.id,$t=rt.cb,Ut=Object(a.useState)(""),Ot=Object(p.a)(Ut,2),Qe=Ot[0],st=Ot[1];return r.a.createElement("aside",{className:"mt10"},r.a.createElement(Rt.a,{defaultValue:Qe,id:"writeForumsReviewId",onChange:function(nt){st(nt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),r.a.createElement(Qr.a,null,r.a.createElement(ir.a,{flex:"1"}),r.a.createElement(ir.a,null,r.a.createElement(K.a,{type:"primary",size:"large",onClick:Object(g.a)(i.a.mark(function Xt(){return i.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:Qe===""?k.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):$t(Et,Qe);case 1:case"end":return Yt.stop()}},Xt)}))},"\u53D1\u9001"))))},yi=function(rt){var Et,$t=rt.data;return r.a.createElement("div",{className:Sr.a.thirdlyLevelDiscuss},r.a.createElement("span",{className:"c-grey-333"},r.a.createElement("span",{className:"font 14 c-light-primary"},$t==null||((Et=$t.author)===null||Et===void 0)?void 0:Et.name),"@",r.a.createElement("span",{className:"font 14 c-light-primary"},$t==null?void 0:$t.parent_name),":"),r.a.createElement(ft.a,{value:$t==null?void 0:$t.content}))},ii=function(rt){var Et,$t,Ut,Ot,Qe=rt.data,st=rt.onReplyDiscuss,Xt=rt.thirdlyReply,nt=rt.setThirdlyReply,Yt=Object(pt.y)();return console.log(Yt,"user"),r.a.createElement("div",{className:Sr.a.list},r.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(Qe==null||((Et=Qe.author)===null||Et===void 0)?void 0:Et.image_url)}),r.a.createElement("div",{className:Sr.a.wrap},r.a.createElement("div",{className:"font14",style:{marginBottom:6}},r.a.createElement("span",{className:"c-grey-333"},Qe==null||(($t=Qe.author)===null||$t===void 0)?void 0:$t.name),(Yt==null?void 0:Yt.login)!==(Qe==null||((Ut=Qe.author)===null||Ut===void 0)?void 0:Ut.login)&&r.a.createElement("span",{onClick:function(){return nt(Qe==null?void 0:Qe.id)},className:"c-grey-999 current",style:{float:"right"}},r.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),r.a.createElement("span",null,"\u56DE\u590D"))),r.a.createElement(ft.a,{value:Qe==null?void 0:Qe.content}),Qe==null||((Ot=Qe.children)===null||Ot===void 0)?void 0:Ot.map(function(_t){return r.a.createElement(yi,{key:_t.id,data:_t})}),Xt===(Qe==null?void 0:Qe.id)&&r.a.createElement("div",null,r.a.createElement(ci,{id:Qe==null?void 0:Qe.id,cb:st}),r.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return nt(null)},className:"c-light-primary current"},r.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),r.a.createElement("div",{className:Sr.a.line})))},Zr=function(rt){var Et,$t,Ut,Ot,Qe=rt.data,st=rt.onReplyDiscuss,Xt=rt.secondReply,nt=rt.setSecondReply,Yt=rt.thirdlyReply,_t=rt.setThirdlyReply,tn=rt.onPlusDiscuss,Pn=Object(a.useState)(!1),Sn=Object(p.a)(Pn,2),dn=Sn[0],Xn=Sn[1];return console.log(Qe,"data"),r.a.createElement("div",{className:Sr.a.discussItem},r.a.createElement("div",{className:Sr.a.list},r.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(Qe==null||((Et=Qe.author)===null||Et===void 0)?void 0:Et.image_url)}),r.a.createElement("div",{className:Sr.a.wrap},r.a.createElement("div",{className:"font14",style:{marginBottom:6}},r.a.createElement("span",{className:"c-grey-333 mr30"},Qe==null||(($t=Qe.author)===null||$t===void 0)?void 0:$t.name),r.a.createElement("span",{className:"c-grey-999"},Qe==null?void 0:Qe.time)),r.a.createElement(ft.a,{value:Qe==null?void 0:Qe.content}),r.a.createElement("div",{className:Sr.a.btns},r.a.createElement("div",{onClick:function(){return tn(Qe==null?void 0:Qe.id)},className:Qe!=null&&Qe.user_praise?"c-light-primary":"c-grey-999"},r.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),r.a.createElement("span",null,Qe==null?void 0:Qe.praise_count)),r.a.createElement("div",{onClick:function(){var Gn;if((Qe==null||((Gn=Qe.children)===null||Gn===void 0)?void 0:Gn.length)===0)return;nt(null),Xn(!dn)},style:{color:dn?"#0152d9":"#999999"}},r.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),r.a.createElement("span",null,dn?"\u6536\u8D77\u8BC4\u8BBA":Qe==null||((Ut=Qe.children)===null||Ut===void 0)?void 0:Ut.length)),r.a.createElement("div",{onClick:function(){Xn(!1),nt(Xt===(Qe==null?void 0:Qe.id)?null:Qe==null?void 0:Qe.id)},style:{color:Xt===(Qe==null?void 0:Qe.id)?"#0152d9":"#999999"}},r.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),r.a.createElement("span",null,Xt===(Qe==null?void 0:Qe.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),Xt===(Qe==null?void 0:Qe.id)&&r.a.createElement(ci,{id:Qe==null?void 0:Qe.id,cb:function(Gn,Kn){st(Gn,Kn),Xn(!0)}}),dn&&r.a.createElement("div",{className:Sr.a.secondLevelDiscuss},Qe==null||((Ot=Qe.children)===null||Ot===void 0)?void 0:Ot.map(function(_n){return r.a.createElement(ii,{thirdlyReply:Yt,setThirdlyReply:_t,key:_n.id,data:_n,onReplyDiscuss:st})})))))},Ai=Zr,Ni=function(rt){var Et=rt.identifier,$t=rt.active,Ut=rt.onOk,Ot=Object(a.useState)(""),Qe=Object(p.a)(Ot,2),st=Qe[0],Xt=Qe[1],nt=Object(a.useState)(1),Yt=Object(p.a)(nt,2),_t=Yt[0],tn=Yt[1],Pn=Object(a.useState)([]),Sn=Object(p.a)(Pn,2),dn=Sn[0],Xn=Sn[1],_n=Object(a.useState)(0),Gn=Object(p.a)(_n,2),Kn=Gn[0],dr=Gn[1],Rn=Object(a.useState)(null),or=Object(p.a)(Rn,2),lr=or[0],$n=or[1],Tn=Object(a.useState)(null),zn=Object(p.a)(Tn,2),kn=zn[0],wt=zn[1];Object(a.useEffect)(function(){hn(1),tn(1)},[$t]);var hn=function(){var bn=Object(g.a)(i.a.mark(function rn(mn){var Tt;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,le({container_type:"QuestionSolutionArticle",container_identifier:$t,limit:5,page:mn});case 2:Tt=Bt.sent,Tt!=null&&Tt.comments&&(Xn((Tt==null?void 0:Tt.comments)||[]),tn(mn),dr(Tt==null?void 0:Tt.disscuss_count));case 4:case"end":return Bt.stop()}},rn)}));return function(mn){return bn.apply(this,arguments)}}(),Zn=function(){var bn=Object(g.a)(i.a.mark(function rn(){var mn;return i.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:if(!(st==="")){Lt.next=3;break}return k.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Lt.abrupt("return");case 3:return Lt.next=5,_e({comments:{content:st},container_type:"QuestionSolutionArticle",container_identifier:$t});case 5:mn=Lt.sent,mn!=null&&mn.discuss&&(Xt(""),hn(_t),Ut());case 7:case"end":return Lt.stop()}},rn)}));return function(){return bn.apply(this,arguments)}}(),ur=function(){var bn=Object(g.a)(i.a.mark(function rn(mn,Tt,Lt){var Bt;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,ye({container_type:"QuestionSolutionArticle",container_identifier:$t,comments:{content:Tt,parent_id:mn}});case 2:Bt=yt.sent,$n(null),wt(null),hn(_t);case 6:case"end":return yt.stop()}},rn)}));return function(mn,Tt,Lt){return bn.apply(this,arguments)}}(),er=function(){var bn=Object(g.a)(i.a.mark(function rn(mn){var Tt;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,he(mn);case 2:Tt=Bt.sent,hn(_t);case 4:case"end":return Bt.stop()}},rn)}));return function(mn){return bn.apply(this,arguments)}}(),Vn=function(rn){tn(rn),hn(rn)};return r.a.createElement("div",{className:Lr.a.discuss},r.a.createElement("aside",{className:Lr.a.reply,style:{borderWidth:Kn?1:0}},r.a.createElement(Rt.a,{defaultValue:st,id:"writeForumsReviewId",onChange:function(rn){Xt(rn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),r.a.createElement(Qr.a,null,r.a.createElement(ir.a,{flex:"1"}),r.a.createElement(ir.a,null,r.a.createElement(K.a,{type:"primary",size:"large",onClick:function(){return Zn()}},"\u53D1\u9001")))),dn==null?void 0:dn.map(function(bn){return r.a.createElement(Ai,{secondReply:lr,setSecondReply:$n,thirdlyReply:kn,setThirdlyReply:wt,key:bn.id,data:bn,onReplyDiscuss:ur,onPlusDiscuss:er})}),r.a.createElement(je.a,{className:Lr.a.pagination,showTotal:function(rn){return r.a.createElement("span",{style:{color:"#656F87"}},"\u5171",r.a.createElement("span",{className:"c-light-primary"},rn),"\u6761\u6570\u636E")},current:_t,onChange:Vn,total:Kn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Ui=Ni,ai=D("hgre"),pr=function(rt){var Et,$t,Ut,Ot,Qe,st,Xt,nt,Yt,_t,tn=rt.active,Pn=rt.identifier,Sn=rt.onAssist,dn=rt.onEdit,Xn=rt.onArticlesSkip,_n=rt.onClose,Gn=rt.onOk,Kn=rt.onDelete,dr=rt.detailsIndex,Rn=rt.btnShowStatus,or=Object(a.useState)(!0),lr=Object(p.a)(or,2),$n=lr[0],Tn=lr[1],zn=Object(a.useState)({}),kn=Object(p.a)(zn,2),wt=kn[0],hn=kn[1];Object(a.useEffect)(function(){tn&&Zn()},[tn,dr]);var Zn=function(){var rn=Object(g.a)(i.a.mark(function mn(){var Tt,Lt,Bt=arguments;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return Tt=Bt.length>0&&Bt[0]!==void 0?Bt[0]:!0,Tt&&Tn(!0),yt.next=4,Object(w.d)(Pn,{active:tn});case 4:Lt=yt.sent,(Lt==null?void 0:Lt.status)===0&&hn((Lt==null?void 0:Lt.data)||{}),Tn(!1);case 7:case"end":return yt.stop()}},mn)}));return function(){return rn.apply(this,arguments)}}(),ur=function(){var rn=Object(g.a)(i.a.mark(function mn(Tt){var Lt;return i.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(w.g)(Pn,Object(h.a)({active:tn},Tt));case 2:Lt=Ht.sent,(Lt==null?void 0:Lt.status)===0&&(Zn(!1),Gn());case 4:case"end":return Ht.stop()}},mn)}));return function(Tt){return rn.apply(this,arguments)}}(),er=function(){var rn=Object(g.a)(i.a.mark(function mn(Tt){var Lt;return i.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(w.c)(Pn,{active:Tt==null?void 0:Tt.id});case 2:Lt=Ht.sent,Lt.status===0&&(Zn(!1),Gn());case 4:case"end":return Ht.stop()}},mn)}));return function(Tt){return rn.apply(this,arguments)}}(),Vn=function(mn){I.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 Kn(mn)}})},bn=function(){Zn(!1),Gn()};return r.a.createElement("div",{className:Jn.a.listDetails},r.a.createElement(vn.a,{className:"pt20 pl20 pr20",loading:$n,active:!0,paragraph:{rows:5}},r.a.createElement("div",{className:Jn.a.head},r.a.createElement("div",{className:Jn.a.name},r.a.createElement("div",{title:wt==null?void 0:wt.name,className:Jn.a.title},wt==null?void 0:wt.name),(wt==null?void 0:wt.is_authority)&&r.a.createElement("div",{className:Jn.a.b},"\u5B98\u65B9"),(wt==null?void 0:wt.is_excellent)&&r.a.createElement("div",{className:Jn.a.a},"\u7CBE\u9009")),r.a.createElement("div",{className:Jn.a.tag},r.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(wt==null?void 0:wt.image_url)}),r.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},wt==null?void 0:wt.username),r.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",Je()(wt==null?void 0:wt.created_at).format("YYYY-MM-DD")),r.a.createElement("span",null,r.a.createElement("img",{src:j.a}),r.a.createElement("span",null,wt==null?void 0:wt.praises_count)),r.a.createElement("span",null,r.a.createElement("img",{src:ve.a}),r.a.createElement("span",null,wt==null?void 0:wt.discusses_count)),r.a.createElement("span",null,r.a.createElement("img",{src:He.a}),r.a.createElement("span",null,wt==null?void 0:wt.viewed_count)),r.a.createElement("div",{className:Jn.a.btn},(Object(pt.w)()||(wt==null?void 0:wt.is_self))&&r.a.createElement(r.a.Fragment,null,r.a.createElement(K.a,{onClick:function(){return Vn(wt)},type:"primary",ghost:!0},"\u5220\u9664"),r.a.createElement(K.a,{onClick:function(){return dn(wt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(pt.w)()&&r.a.createElement(K.a,{onClick:function(){return ur({is_authority:!(wt!=null&&wt.is_authority)})},type:"primary"},r.a.createElement("img",{src:Hr.a}),wt!=null&&wt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(pt.w)()&&r.a.createElement(K.a,{onClick:function(){return ur({is_excellent:!(wt!=null&&wt.is_excellent)})},type:"primary"},r.a.createElement("img",{src:Dn.a}),wt!=null&&wt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),r.a.createElement("div",{className:Jn.a.scroll},(wt==null||((Et=wt.videos)===null||Et===void 0||(($t=Et[0])===null||$t===void 0))?void 0:$t.id)&&r.a.createElement("div",{className:Jn.a.video},r.a.createElement(O.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(wt!=null&&(Ut=wt.videos)!==null&&Ut!==void 0&&(Ot=Ut[0])!==null&&Ot!==void 0&&Ot.transcoded)},r.a.createElement(ai.a,{poster:wt==null||((Qe=wt.videos)===null||Qe===void 0||((st=Qe[0])===null||st===void 0))?void 0:st.cover_url,src:(wt==null||((Xt=wt.videos)===null||Xt===void 0||((nt=Xt[0])===null||nt===void 0))?void 0:nt.play_url)||"",videoId:wt==null||((Yt=wt.videos)===null||Yt===void 0||((_t=Yt[0])===null||_t===void 0))?void 0:_t.id,logWatchHistory:function(){}}))),r.a.createElement(ft.a,{className:Jn.a.html,value:(wt==null?void 0:wt.content)||""}),r.a.createElement("div",{onClick:function(){return er(wt)},className:Jn.a.g},r.a.createElement("img",{className:"mr10",src:(wt!=null&&wt.user_liker,rr.a)}),r.a.createElement("span",null,wt==null?void 0:wt.praises_count)),r.a.createElement(Ui,{onOk:bn,active:tn,identifier:Pn})),r.a.createElement("div",{className:Jn.a.btns},r.a.createElement(K.a,{onClick:function(){return _n()},type:"primary",ghost:!0},"\u5173\u95ED"),Rn[0]&&r.a.createElement(K.a,{onClick:function(mn){return Xn(mn,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Rn[1]&&r.a.createElement(K.a,{onClick:function(mn){return Xn(mn,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},cr=pr,Yr=D("3tLw"),qr=D.n(Yr),si=D("ek7X"),ei=D("0NbB"),zi=function(rt){var Et=rt.identifier,$t=rt.tabStatus,Ut=rt.setFilterListTotal,Ot=rt.setListStatus,Qe={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},st=Object(a.useState)(Object(h.a)({},Qe)),Xt=Object(p.a)(st,2),nt=Xt[0],Yt=Xt[1],_t=Object(a.useState)(!1),tn=Object(p.a)(_t,2),Pn=tn[0],Sn=tn[1],dn=Object(a.useState)(0),Xn=Object(p.a)(dn,2),_n=Xn[0],Gn=Xn[1],Kn=Object(a.useState)(1),dr=Object(p.a)(Kn,2),Rn=dr[0],or=dr[1],lr=Object(a.useState)(null),$n=Object(p.a)(lr,2),Tn=$n[0],zn=$n[1],kn=Object(a.useState)([]),wt=Object(p.a)(kn,2),hn=wt[0],Zn=wt[1],ur=Object(a.useState)([!0,!0]),er=Object(p.a)(ur,2),Vn=er[0],bn=er[1],rn=Object(a.useState)(0),mn=Object(p.a)(rn,2),Tt=mn[0],Lt=mn[1],Bt=Object(a.useRef)(null);Object(a.useEffect)(function(){qn()},[$t]),Object(a.useEffect)(function(){Ht()},[Tn]),Object(a.useEffect)(function(){Mt(Object(h.a)({},Qe)),qn()},[Et]),Object(a.useEffect)(function(){return window.addEventListener("resize",yt),Ot(Tt),function(){window.removeEventListener("resize",yt)}},[Tt]);var Ht=function(){var ar=Object(g.a)(i.a.mark(function un(){var Mn,jn;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:if(Tn){Nn.next=3;break}return bn([!0,!0]),Nn.abrupt("return");case 3:Mn=[!0,!0],jn=hn==null?void 0:hn.findIndex(function(Si){return Si.id===Tn}),jn===0&&nt.page===1&&(Mn[0]=!1),(nt.page-1)*nt.limit+(jn+1)===nt.total&&(Mn[1]=!1),bn(Mn);case 8:case"end":return Nn.stop()}},un)}));return function(){return ar.apply(this,arguments)}}(),yt=function(){if(Tt){var un,Mn=window.innerWidth-((un=Bt.current)===null||un===void 0?void 0:un.clientWidth);Gn(Mn)}},Mt=function(){var ar=Object(g.a)(i.a.mark(function un(Mn){var jn,Rr,Nn,Si;return i.a.wrap(function(jr){for(;;)switch(jr.prev=jr.next){case 0:return Sn(!0),jr.next=3,Object(w.f)(Et,Mn);case 3:return jn=jr.sent,(jn==null?void 0:jn.status)===0&&(Zn((jn==null||((Rr=jn.data)===null||Rr===void 0)?void 0:Rr.articles)||[]),Yt(Object(h.a)(Object(h.a)({},Mn),{},{total:jn==null||((Nn=jn.data)===null||Nn===void 0)?void 0:Nn.articles_count})),Ut(jn==null||((Si=jn.data)===null||Si===void 0)?void 0:Si.articles_count)),Sn(!1),jr.abrupt("return",jn);case 7:case"end":return jr.stop()}},un)}));return function(Mn){return ar.apply(this,arguments)}}(),Qt=function(){(nt==null?void 0:nt.sort_direction)===null?nt.sort_direction="asc":(nt==null?void 0:nt.sort_direction)==="asc"?nt.sort_direction="desc":(nt==null?void 0:nt.sort_direction)==="desc"&&(nt.sort_direction=null),nt.page=1,qn(),Yt(Object(h.a)({},nt)),Mt(nt)},tr=function(){nt.page=1,nt.search=nt==null?void 0:nt.save_search,qn(),Yt(Object(h.a)({},nt)),Mt(nt)},Er=function(){var un,Mn=document.getElementsByClassName("btn-resize");Mn[0].style.visibility="hidden";var jn=window.innerWidth-((un=Bt.current)===null||un===void 0?void 0:un.clientWidth);Gn(jn)},Gr=function(){Er(),Lt(1)},kr=function(un){Er(),zn(un==null?void 0:un.id),Lt(3)},Ei=function(un){Er(),zn(un==null?void 0:un.id),Lt(2)},qn=function(){var un=document.getElementsByClassName("btn-resize");un[0].style.visibility="visible",Gn(0),Lt(0),zn(null)},xi=function(un){Lt(3),zn(un),nt.page=1,Yt(Object(h.a)({},nt)),Mt(nt)},Di=function(un){Lt(3),zn(un),Yt(Object(h.a)({},nt)),Mt(nt)},Wi=function(un){Yt(Object(h.a)({},nt)),Mt(nt)},Pi=function(){var ar=Object(g.a)(i.a.mark(function un(Mn){var jn;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(w.c)(Et,{active:Mn==null?void 0:Mn.id});case 2:jn=Nn.sent,jn.status===0&&(Mt(nt),or(Rn+1));case 4:case"end":return Nn.stop()}},un)}));return function(Mn){return ar.apply(this,arguments)}}(),ca=function(){var ar=Object(g.a)(i.a.mark(function un(Mn){var jn;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(w.e)(Et,{active:Mn==null?void 0:Mn.id});case 2:jn=Nn.sent,jn.status===0&&(Mt(nt),or(Rn+1));case 4:case"end":return Nn.stop()}},un)}));return function(Mn){return ar.apply(this,arguments)}}(),pi=function(){var ar=Object(g.a)(i.a.mark(function un(Mn){var jn;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(w.i)(Et,{active:Mn==null?void 0:Mn.id});case 2:jn=Nn.sent,jn.status===0&&(qn(),Mt(nt));case 4:case"end":return Nn.stop()}},un)}));return function(Mn){return ar.apply(this,arguments)}}(),ta=function(un){nt.page=un,Yt(Object(h.a)({},nt)),Mt(nt)},Da=function(){var ar=Object(g.a)(i.a.mark(function un(Mn,jn){var Rr,Nn,Si,Fi,jr,Ti,Tr,$r,En,fn,Bn;return i.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:if(Rr=hn==null?void 0:hn.findIndex(function(hr){return hr.id===Tn}),console.log(Rr,jn,22),!(jn==="prev")){yn.next=21;break}if(!(Rr===void 0)){yn.next=6;break}return k.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),yn.abrupt("return");case 6:if(!(Rr===0)){yn.next=19;break}if(!(nt.page===1)){yn.next=10;break}return k.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),yn.abrupt("return");case 10:if(!(nt.page!==1)){yn.next=17;break}return nt.page=nt.page-1,Yt(Object(h.a)({},nt)),yn.next=15,Mt(nt);case 15:Nn=yn.sent,(Nn==null?void 0:Nn.status)===0&&(Ti=Nn==null||((Si=Nn.data)===null||Si===void 0)?void 0:Si.articles[(Nn==null||((Fi=Nn.data)===null||Fi===void 0||((jr=Fi.articles)===null||jr===void 0))?void 0:jr.length)-1],zn(Ti==null?void 0:Ti.id),console.log(Mn.target,555));case 17:yn.next=21;break;case 19:Tr=hn[Rr-1],zn(Tr==null?void 0:Tr.id);case 21:if(!(jn==="next")){yn.next=39;break}if(!(Rr===void 0)){yn.next=25;break}return k.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),yn.abrupt("return");case 25:if(!((nt.page-1)*nt.limit+(Rr+1)===nt.total)){yn.next=28;break}return k.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),yn.abrupt("return");case 28:if(!(Rr+1===nt.limit)){yn.next=37;break}return nt.page=nt.page+1,Yt(Object(h.a)({},nt)),yn.next=33,Mt(nt);case 33:$r=yn.sent,($r==null?void 0:$r.status)===0&&(fn=$r==null||((En=$r.data)===null||En===void 0)?void 0:En.articles[0],zn(fn==null?void 0:fn.id)),yn.next=39;break;case 37:Bn=hn[Rr+1],zn(Bn==null?void 0:Bn.id);case 39:case"end":return yn.stop()}},un)}));return function(Mn,jn){return ar.apply(this,arguments)}}();return r.a.createElement("div",{className:wn.a.wrap,ref:Bt},r.a.createElement("div",{className:wn.a.head},r.a.createElement("div",{className:wn.a.sort,onClick:Qt},r.a.createElement("span",null,"\u6700\u65B0"),r.a.createElement("aside",null,r.a.createElement(si.a,{style:{color:(nt==null?void 0:nt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),r.a.createElement(ei.a,{style:{color:(nt==null?void 0:nt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),r.a.createElement(ne.a.Search,{value:nt.save_search,className:wn.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(un){nt.save_search=un.target.value,Yt(Object(h.a)({},nt))},onSearch:tr}),r.a.createElement("div",{onClick:Gr,className:wn.a.btn},r.a.createElement("img",{src:qr.a}),"\u5199\u9898\u89E3")),r.a.createElement("div",{className:wn.a.listWarp},r.a.createElement(O.a,{spinning:Pn,className:"mt20"},hn==null?void 0:hn.map(function(ar,un){var Mn=!0;return un+1===hn.length&&un!==0&&(Mn=!1),r.a.createElement(ut,{active:Tn,key:ar.id,data:ar,showLine:Mn,onClick:kr,onAssist:Pi,onHide:ca})}),(hn==null?void 0:hn.length)===0&&r.a.createElement(xe.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),r.a.createElement(je.a,{className:wn.a.pagination,showTotal:function(un){return r.a.createElement("span",{style:{color:"#656F87"}},"\u5171",r.a.createElement("span",{className:"c-light-primary"},un),"\u6761\u6570\u636E")},total:nt.total,showSizeChanger:!1,current:nt==null?void 0:nt.page,onChange:ta,hideOnSinglePage:!0,showQuickJumper:!0}),Tt>0&&r.a.createElement("div",{className:wn.a.fixedRight,style:{width:_n}},Tt===1&&r.a.createElement(Yn,{identifier:Et,onClose:qn,onOk:xi}),Tt===2&&r.a.createElement(Yn,{active:Tn,identifier:Et,onClose:qn,onOk:Di}),Tt===3&&r.a.createElement(cr,{btnShowStatus:Vn,onArticlesSkip:Da,detailsIndex:Rn,active:Tn,identifier:Et,onClose:qn,onOk:Wi,onEdit:Ei,onAssist:Pi,onDelete:pi})))},ea=zi,ti=D("VEzc"),di=D.n(ti),Li=function(rt){var Et,$t=rt.visible,Ut=rt.onVisible,Ot=rt.value,Qe=rt.onChange,st=rt.setIndex,Xt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},nt=Object(a.useState)(Xt),Yt=Object(p.a)(nt,2),_t=Yt[0],tn=Yt[1],Pn=Object(a.useState)([]),Sn=Object(p.a)(Pn,2),dn=Sn[0],Xn=Sn[1],_n=Object(a.useState)([]),Gn=Object(p.a)(_n,2),Kn=Gn[0],dr=Gn[1],Rn=Object(a.useState)(!1),or=Object(p.a)(Rn,2),lr=or[0],$n=or[1],Tn=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(){wt(30)},3e4)),function(){clearInterval(zn.current)}},[]);var wt=function(){var Tt=Object(g.a)(i.a.mark(function Lt(Bt){var Ht;return i.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Object(w.r)(kn==null?void 0:kn.id,{practice_time:Bt});case 2:Ht=Mt.sent;case 3:case"end":return Mt.stop()}},Lt)}));return function(Bt){return Tt.apply(this,arguments)}}();Object(a.useEffect)(function(){bn(_t),er()},[]),Object(a.useEffect)(function(){return window.addEventListener("click",Zn),function(){window.removeEventListener("click",Zn)}},[kn==null?void 0:kn.save_identifier,$t]),Object(a.useEffect)(function(){var Tt=Tn.current.findIndex(function(Mt){return Mt.identifier===(kn==null?void 0:kn.save_identifier)}),Lt=Tn.current[Tt-1],Bt=Tn.current[Tt+1],Ht=document.getElementById("oj-prev"),yt=document.getElementById("oj-next");Lt?Ht.style.display="block":Ht.style.display="none",Bt?yt.style.display="block":yt.style.display="none"},[kn==null?void 0:kn.save_identifier,Tn.current]);var hn=function(Lt,Bt){if(Lt.id===Bt)return Lt;for(var Ht=0,yt=Lt;yt=yt.parentNode;Ht++){if(yt.id===Bt)return yt;if(yt==document.documentElement)return!1}},Zn=function(){var Tt=Object(g.a)(i.a.mark(function Lt(Bt){var Ht,yt,Mt;return i.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:if(!hn(Bt.target,"oj-drawer")&&$t&&Ut(!1),Ht=Tn.current.findIndex(function(Er){return Er.identifier===(kn==null?void 0:kn.save_identifier)}),yt=Tn.current[Ht-1],Mt=Tn.current[Ht+1],!(Bt.target.id==="oj-prev")){tr.next=14;break}if(!(!yt||Ht===-1)){tr.next=8;break}return k.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),tr.abrupt("return");case 8:return Bt.target.style.pointerEvents="none",Bt.target.style.cursor="not-allowed",tr.next=12,rn(yt==null?void 0:yt.identifier);case 12:st("0"),setTimeout(function(){Bt.target.style.pointerEvents="auto",Bt.target.style.cursor="pointer"},400);case 14:if(!(Bt.target.id==="oj-next"||Bt.target.id==="oj-modal-next")){tr.next=24;break}if(!(!Mt||Ht===-1)){tr.next=18;break}return k.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),tr.abrupt("return");case 18:return Bt.target.style.pointerEvents="none",Bt.target.style.cursor="not-allowed",tr.next=22,rn(Mt==null?void 0:Mt.identifier);case 22:st("0"),setTimeout(function(){Bt.target.style.pointerEvents="auto",Bt.target.style.cursor="pointer"},400);case 24:case"end":return tr.stop()}},Lt)}));return function(Bt){return Tt.apply(this,arguments)}}();Object(a.useEffect)(function(){Qe(kn==null?void 0:kn.save_identifier);var Tt=Kn.findIndex(function(Lt){return Lt.some(function(Bt){return Bt.identifier===(kn==null?void 0:kn.save_identifier)})});Tt===-1?tn(Object(h.a)(Object(h.a)({},_t),{},{page:1})):tn(Object(h.a)(Object(h.a)({},_t),{},{page:Tt+1}))},[kn==null?void 0:kn.save_identifier,Kn]);var ur=function(Lt){_t.page=1,_t.tag_discipline_id=Lt,tn(Object(h.a)({},_t)),bn(_t)},er=function(){var Tt=Object(g.a)(i.a.mark(function Lt(){var Bt;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(pe.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:Bt=yt.sent,Xn(Bt.tag_disciplines||[]);case 4:case"end":return yt.stop()}},Lt)}));return function(){return Tt.apply(this,arguments)}}(),Vn=function(Lt){_t.page=1,_t.difficulty=typeof Lt=="number"?Lt:null,tn(Object(h.a)({},_t)),bn(_t)},bn=function(){var Tt=Object(g.a)(i.a.mark(function Lt(Bt){var Ht,yt,Mt,Qt,tr,Er;return i.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return $n(!0),kr.next=3,Object(w.p)(Bt);case 3:if(Ht=kr.sent,Ht!=null&&Ht.practices_list){for(Mt=Ht==null||((yt=Ht.practices_list)===null||yt===void 0)?void 0:yt.length,Qt=[],tr=0;tr<Mt;tr+=_t==null?void 0:_t.per_page)Qt.push(Ht==null||((Er=Ht.practices_list)===null||Er===void 0)?void 0:Er.slice(tr,tr+(_t==null?void 0:_t.per_page)));tn(Object(h.a)(Object(h.a)({},_t),{},{total:Ht==null?void 0:Ht.practices_count})),Tn.current=(Ht==null?void 0:Ht.practices_list)||[],dr(Qt)}$n(!1);case 6:case"end":return kr.stop()}},Lt)}));return function(Bt){return Tt.apply(this,arguments)}}(),rn=function(){var Tt=Object(g.a)(i.a.mark(function Lt(Bt,Ht){var yt;return i.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(pe.a)("/api/practices/".concat(Bt,"/start"),{method:"get"});case 2:yt=Qt.sent,(yt==null?void 0:yt.status)===0&&T.d.push("/problems/".concat(yt==null?void 0:yt.identifier,"/oj/").concat(Bt));case 4:case"end":return Qt.stop()}},Lt)}));return function(Bt,Ht){return Tt.apply(this,arguments)}}(),mn=function(Lt){_t.page=Lt,tn(Object(h.a)({},_t))};return r.a.createElement("div",{className:di.a.wrap,id:"oj-drawer",style:{left:$t?0:-700}},r.a.createElement("div",{className:di.a.head},r.a.createElement("div",{className:di.a.title},"\u9898\u76EE\u5217\u8868"),r.a.createElement(ne.a.Search,{value:_t==null?void 0:_t.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Lt){_t.save_search=Lt.target.value,tn(Object(h.a)({},_t))},onSearch:function(){_t.page=1,_t.search=_t.save_search,tn(Object(h.a)({},_t)),bn(_t)}}),r.a.createElement(Y.a,{value:_t==null?void 0:_t.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Lt){return Lt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:ur},dn.map(function(Tt){return r.a.createElement(Y.a.Option,{key:Tt.id,value:Tt.id},Tt.name)})),r.a.createElement(Y.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Lt){return Lt.parentNode},value:_t==null?void 0:_t.difficulty,onChange:Vn},r.a.createElement(Y.a.Option,{value:1},"\u7B80\u5355"),r.a.createElement(Y.a.Option,{value:2},"\u9002\u4E2D"),r.a.createElement(Y.a.Option,{value:3},"\u56F0\u96BE"))),r.a.createElement("div",{className:di.a.content},r.a.createElement(O.a,{spinning:lr},Kn==null||((Et=Kn[_t.page-1])===null||Et===void 0)?void 0:Et.map(function(Tt){return r.a.createElement("div",{key:Tt.identifier,className:di.a.list,onClick:function(Bt){return rn(Tt.identifier,Bt)}},r.a.createElement("i",{style:{visibility:Ot===Tt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),r.a.createElement("span",{style:{fontWeight:Ot===Tt.identifier?"bold":400,color:Ot===Tt.identifier?"#ffffff":"#bac4cd"},title:Tt==null?void 0:Tt.name},Tt.name),(Tt==null?void 0:Tt.difficulty)===1&&r.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(Tt==null?void 0:Tt.difficulty)===2&&r.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(Tt==null?void 0:Tt.difficulty)===3&&r.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),r.a.createElement("div",{className:di.a.footer},r.a.createElement(je.a,{showTotal:function(Lt){return r.a.createElement("span",{style:{color:"#656F87"}},"\u5171",r.a.createElement("span",{className:"c-light-primary"},Lt),"\u6761\u6570\u636E")},total:_t.total,pageSize:_t==null?void 0:_t.per_page,current:_t==null?void 0:_t.page,showSizeChanger:!1,onChange:mn,showQuickJumper:!0,hideOnSinglePage:!0})))},Bi=Li,Ii=function(Ve){var rt,Et=Ve.hack,$t=Ve.onTriggerPraise,Ut=Ve.topicId,Ot=Ve.page,Qe=Ve.onPageChange,st=Ve.user,Xt=Ve.submitRecords,nt=Ve.submitting,Yt=Ve.submitResult,_t=Object(x.h)(),tn=Object(a.useState)((_t==null||((rt=_t.query)===null||rt===void 0)?void 0:rt.tab)||"0"),Pn=Object(p.a)(tn,2),Sn=Pn[0],dn=Pn[1],Xn=Object(a.useState)(0),_n=Object(p.a)(Xn,2),Gn=_n[0],Kn=_n[1],dr=Object(a.useState)(0),Rn=Object(p.a)(dr,2),or=Rn[0],lr=Rn[1],$n=Object(a.useState)(0),Tn=Object(p.a)($n,2),zn=Tn[0],kn=Tn[1],wt=Object(a.useState)(),hn=Object(p.a)(wt,2),Zn=hn[0],ur=hn[1],er=Object(a.useState)(!1),Vn=Object(p.a)(er,2),bn=Vn[0],rn=Vn[1];function mn(Lt){var Bt=Lt.target.id;if(Sn==="3"&&Bt!==Sn&&(or===1||or===2)){I.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(){dn(Bt)}});return}dn(Bt)}Object(a.useEffect)(function(){var Lt=Ze.a.subscribe("to-commit-info",function(){dn("1")});return Lt},[]);function Tt(){dn("2")}return r.a.createElement("div",{className:Pe.a["left-panel"]},r.a.createElement("ul",{className:"".concat(Pe.a["s-navs"]," ").concat(Pe.a["bg-white"]," ").concat(Pe.a.b1)},r.a.createElement("li",{className:"mr40 current"},r.a.createElement("img",{onClick:function(){return rn(!0)},src:fe.a})),r.a.createElement("li",{className:Pe.a["oj-mr"]},r.a.createElement("a",{className:Sn==="0"?Pe.a.active:"",id:"0",onClick:mn},"\u4EFB\u52A1\u63CF\u8FF0")),r.a.createElement("li",{className:Pe.a["oj-mr"]},r.a.createElement("a",{className:Sn==="3"?Pe.a.active:"",id:"3",onClick:mn},"\u9898\u89E3",zn?"(".concat(zn,")"):"")),r.a.createElement("li",{className:Pe.a["oj-mr"]},r.a.createElement("a",{className:Sn==="2"?Pe.a.active:"",id:"2",onClick:mn},"\u8BC4\u8BBA",Gn?"(".concat(Gn,")"):"")),r.a.createElement("li",null,r.a.createElement("a",{className:Sn==="1"?Pe.a.active:"",id:"1",onClick:mn},"\u63D0\u4EA4\u8BB0\u5F55"))),r.a.createElement("div",{className:"".concat(Pe.a["tab-panel-body"]," ").concat(Sn==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},r.a.createElement(Ue,{hack:Et,onTriggerPraise:$t,toDiscuss:Tt})),r.a.createElement("div",{className:"".concat(Pe.a["tab-panel-body"]," ").concat(Sn==="1"?"":"hide")},Xt!=null&&Xt.records_count?r.a.createElement(Re,{page:Ot,onPageChange:Qe,topicId:Ut,submitting:nt,submitRecords:Xt,submitResult:Yt}):r.a.createElement(xe.a,null)),r.a.createElement("div",{className:"".concat(Pe.a["tab-panel-body"]," ").concat(Sn==="2"?"":"hide"),style:{padding:0}},r.a.createElement(An,{setDiscussTotal:Kn,user:st,identifier:Et.identifier,hack:Et,onTriggerPraise:$t})),r.a.createElement("div",{className:"".concat(Pe.a["tab-panel-body"]," ").concat(Sn==="3"?"":"hide"),style:{padding:0}},r.a.createElement(ea,{setListStatus:lr,setFilterListTotal:kn,tabStatus:Sn,identifier:Et.identifier})),r.a.createElement(Bi,{visible:bn,setIndex:dn,onVisible:function(Bt){return rn(Bt)},value:Zn,onChange:function(Bt){return ur(Bt)}}))},bi=D("+aKw"),Vi=D("oFv4"),hi=D.n(Vi),Xi=D("S/kP"),Yi=D.n(Xi),oi=D("t/PP"),Ji=D.n(oi),Jt=D("LvDl"),pn=D.n(Jt),nn=D("P5Jw"),Ln=o.a.Countdown,Hn={Java:"java",C:"c",Python:"py","C++":"c"},zt;(function(Ve){Ve[Ve.SET_LOADING=0]="SET_LOADING",Ve[Ve.GET_DATA=1]="GET_DATA",Ve[Ve.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",Ve[Ve.SET_DATA=3]="SET_DATA",Ve[Ve.SET_DEBUGING=4]="SET_DEBUGING",Ve[Ve.SET_SUBMITING=5]="SET_SUBMITING",Ve[Ve.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",Ve[Ve.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",Ve[Ve.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",Ve[Ve.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",Ve[Ve.SET_PAGE=10]="SET_PAGE",Ve[Ve.GET_LANGUAGE=11]="GET_LANGUAGE",Ve[Ve.GET_DRAWER=12]="GET_DRAWER"})(zt||(zt={}));function In(){return new Date().getTime()}var br={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 Fr(Ve,rt){switch(rt.type){case zt.GET_DATA:return Object(h.a)(Object(h.a)({},Ve),rt.payload);case zt.SET_DATA:return Object(h.a)(Object(h.a)({},Ve),{},{data:rt.payload});case zt.SET_LOADING:return Object(h.a)(Object(h.a)({},Ve),{},{loading:rt.payload});case zt.GET_LANGUAGE:return Object(h.a)(Object(h.a)({},Ve),{},{languageList:rt.payload});case zt.GET_DRAWER:return Object(h.a)(Object(h.a)({},Ve),{},{drawerData:rt.payload});case zt.SET_SHOW_NOTE:return Object(h.a)(Object(h.a)({},Ve),{},{showNote:rt.payload});case zt.SET_DEBUGING:return Object(h.a)(Object(h.a)({},Ve),{},{debuging:rt.payload});case zt.SET_SUBMITING:return Object(h.a)(Object(h.a)({},Ve),{},{submitting:rt.payload});case zt.GET_SUBMIT_RECORDS:return Object(h.a)(Object(h.a)({},Ve),{},{submitRecords:rt.payload});case zt.SET_PAGE:return Object(h.a)(Object(h.a)({},Ve),{},{submitRecordPage:rt.payload});case zt.SET_EXECUTE_MESSAGE:return Object(h.a)(Object(h.a)({},Ve),{},{executingMessage:rt.payload});case zt.SET_EXECUTE_RESULT:return Object(h.a)(Object(h.a)({},Ve),rt.payload);case zt.SET_SUBMIT_RESULT:return Object(h.a)(Object(h.a)({},Ve),rt.payload);default:throw new Error}}var Fn=ge.default=function(Ve){var rt,Et,$t=Ve.children,Ut=Object(a.useReducer)(Fr,br),Ot=Object(p.a)(Ut,2),Qe=Ot[0],st=Ot[1],Xt=Object(x.i)(),nt=Xt.id,Yt=Object(x.g)(),_t=Object(x.h)(),tn=Qe.languageValue,Pn=Qe.languageList,Sn=Qe.loading,dn=Qe.data,Xn=Qe.debugResult,_n=Qe.submitResult,Gn=Qe.submitRecords,Kn=Qe.submitRecordPage,dr=Qe.showNote,Rn=Qe.debuging,or=Qe.submitting,lr=Qe.executingMessage,$n=Object(a.useState)("#FFF"),Tn=Object(p.a)($n,2),zn=Tn[0],kn=Tn[1],wt=Object(a.useState)(null),hn=Object(p.a)(wt,2),Zn=hn[0],ur=hn[1],er=Object(a.useState)({}),Vn=Object(p.a)(er,2),bn=Vn[0],rn=Vn[1],mn=Object(a.useState)(!1),Tt=Object(p.a)(mn,2),Lt=Tt[0],Bt=Tt[1],Ht=Object(a.useRef)(null),yt=Object(a.useRef)(null),Mt=dn==null?void 0:dn.user,Qt=dn==null?void 0:dn.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(Lt){var En,fn=document.getElementById("oj-next"),Bn=document.getElementById("oj-modal-next");(fn==null||((En=fn.style)===null||En===void 0)?void 0:En.display)==="none"?Bn.style.display="none":Bn.style.display="block"}},[Lt]),Object(a.useEffect)(function(){function En(){return fn.apply(this,arguments)}function fn(){return fn=Object(g.a)(i.a.mark(function Bn(){var Nt,yn,hr,Mr,wr;return i.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(w.m)(nt);case 2:Nt=an.sent,Nt.status===401?document.location.href="/user/login":(Nt.hack=Nt.practice,Nt.hack.code=C.Base64.decode(Nt==null||((yn=Nt.hack)===null||yn===void 0)?void 0:yn.code),wr="".concat(Mt==null?void 0:Mt.login,"-language"),localStorage.getItem(wr)&&(Nt.hack.language=localStorage.getItem(wr)),yt.current=pn.a.cloneDeep(Nt),yt.current.language=Nt==null||((hr=Nt.hack)===null||hr===void 0)?void 0:hr.language,st({type:zt.GET_DATA,payload:{loading:!1,data:Nt}}),st({type:zt.SET_SUBMIT_RESULT,payload:{languageValue:Nt==null||((Mr=Nt.hack)===null||Mr===void 0)?void 0:Mr.language}}));case 4:case"end":return an.stop()}},Bn)})),fn.apply(this,arguments)}nt&&En()},[nt]),Object(a.useEffect)(function(){st({type:zt.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),kr(),Bt(!1)},[nt]),Object(a.useEffect)(function(){clearTimeout(Ht.current)},[nt]),Object(a.useEffect)(function(){Er()},[nt,Kn]);var tr=function(){window.parent.postMessage("backExercise","*")};function Er(){return Gr.apply(this,arguments)}function Gr(){return Gr=Object(g.a)(i.a.mark(function En(){var fn;return i.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.prev=0,Nt.next=3,Object(w.o)(nt,{limit:15,page:Kn});case 3:fn=Nt.sent,st({type:zt.GET_SUBMIT_RECORDS,payload:fn}),Nt.next=10;break;case 7:Nt.prev=7,Nt.t0=Nt.catch(0),console.log(Nt.t0);case 10:case"end":return Nt.stop()}},En,null,[[0,7]])})),Gr.apply(this,arguments)}function kr(){return Ei.apply(this,arguments)}function Ei(){return Ei=Object(g.a)(i.a.mark(function En(){var fn;return i.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.prev=0,Nt.next=3,Object(w.w)(nt);case 3:fn=Nt.sent,st({type:zt.GET_LANGUAGE,payload:fn==null?void 0:fn.data}),Nt.next=10;break;case 7:Nt.prev=7,Nt.t0=Nt.catch(0),console.log(Nt.t0);case 10:case"end":return Nt.stop()}},En,null,[[0,7]])})),Ei.apply(this,arguments)}function qn(En){st({type:zt.SET_PAGE,payload:En})}function xi(En){return Di.apply(this,arguments)}function Di(){return Di=Object(g.a)(i.a.mark(function En(fn){var Bn,Nt,yn,hr,Mr,wr;return i.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return Mr=((Bn=window)===null||Bn===void 0||((Nt=Bn.location)===null||Nt===void 0||((yn=Nt.pathname)===null||yn===void 0||((hr=yn.split("/"))===null||hr===void 0)))?void 0:hr[2])||nt,an.next=3,Object(w.v)(Mr,fn||{code:C.Base64.encode(Qt.code),language:tn});case 3:return wr=an.sent,an.abrupt("return",wr);case 5:case"end":return an.stop()}},En)})),Di.apply(this,arguments)}function Wi(){return Pi.apply(this,arguments)}function Pi(){return Pi=Object(g.a)(i.a.mark(function En(){var fn,Bn,Nt,yn,hr,Mr,wr;return i.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(!or){an.next=2;break}return an.abrupt("return");case 2:return st({type:zt.SET_SUBMITING,payload:!0}),an.prev=3,Ze.a.publish("to-commit-info"),an.next=7,xi();case 7:if(fn=an.sent,!(fn.status===0)){an.next=21;break}return wr=function(){return wr=Object(g.a)(i.a.mark(function _a(){var ji,wi,Ci,Qi,Hi,ra;return i.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:return Br.next=2,Object(w.l)(nt,"submit");case 2:if(ji=Br.sent,wi=ji.status,Ci=ji.data,Qi=In(),Hi=Qi-hr>(yn+3)*1e3,wi!==0&&!Hi&&setTimeout(Mr,1e3),!Hi){Br.next=12;break}return I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),st({type:zt.SET_SUBMITING,payload:!1}),Br.abrupt("return");case 12:if(!(wi===0)){Br.next=19;break}return Ci.status===2&&I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Br.next=16,Object(w.o)(nt,{limit:15,page:Kn});case 16:ra=Br.sent,st({type:zt.SET_SUBMIT_RESULT,payload:Object(h.a)(Object(h.a)({},Qe),{},{submitResult:Ci,submitting:!1,submitRecords:ra})}),(Ci==null?void 0:Ci.status)===0&&Bt(!0);case 19:case"end":return Br.stop()}},_a)})),wr.apply(this,arguments)},Mr=function(){return wr.apply(this,arguments)},Bn={},an.next=14,Object(w.s)(nt,Bn);case 14:if(Nt=an.sent,!(Nt.status===-1)){an.next=18;break}return window.parent.location.href="/classrooms/".concat(_t.query.coursesId,"/exercise/").concat(_t.query.exercisesId,"/detail"),an.abrupt("return");case 18:yn=Qt.time_limit,hr=In(),Mr();case 21:an.next=26;break;case 23:an.prev=23,an.t0=an.catch(3),st({type:zt.SET_SUBMITING,payload:!1});case 26:case"end":return an.stop()}},En,null,[[3,23]])})),Pi.apply(this,arguments)}function ca(){return pi.apply(this,arguments)}function pi(){return pi=Object(g.a)(i.a.mark(function En(){var fn,Bn,Nt,yn,hr,Mr,wr;return i.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return Qe.debuging=!0,st({type:zt.SET_DEBUGING,payload:!0}),an.prev=2,an.next=5,xi();case 5:if(fn=an.sent,!(fn.status===0)){an.next=21;break}return wr=function(){return wr=Object(g.a)(i.a.mark(function _a(){var ji,wi,Ci,Qi,Hi,ra;return i.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:return Br.next=2,Object(w.l)(nt,"debug");case 2:if(ji=Br.sent,wi=ji.status,Ci=ji.message,Qi=ji.data,Hi=In(),ra=Hi-hr>(Bn+3)*1e3,wi!==0&&!ra&&(st({type:zt.SET_EXECUTE_MESSAGE,payload:Ci}),setTimeout(Mr,1e3)),!ra){Br.next=13;break}return I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),st({type:zt.SET_DEBUGING,payload:!1}),Br.abrupt("return");case 13:wi===0&&(st({type:zt.SET_DEBUGING,payload:!1}),Qi.status===2&&I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),st({type:zt.SET_EXECUTE_RESULT,payload:Object(h.a)(Object(h.a)({},Qe),{},{debugResult:Qi,debuging:!1})}));case 14:case"end":return Br.stop()}},_a)})),wr.apply(this,arguments)},Mr=function(){return wr.apply(this,arguments)},Bn=Qt.time_limit,Nt={input:encodeURIComponent(dn.test_case.input)},an.next=13,Object(w.h)(nt,Nt);case 13:if(yn=an.sent,!(yn.status===-1)){an.next=17;break}return window.parent.location.href="/classrooms/".concat(_t.query.coursesId,"/exercise/").concat(_t.query.exercisesId,"/detail"),an.abrupt("return");case 17:hr=In(),Mr(),an.next=22;break;case 21:st({type:zt.SET_DEBUGING,payload:!1});case 22:an.next=27;break;case 24:an.prev=24,an.t0=an.catch(2),console.log(an.t0);case 27:return an.prev=27,an.finish(27);case 29:case"end":return an.stop()}},En,null,[[2,24,27,29]])})),pi.apply(this,arguments)}function ta(En){var fn;clearTimeout(Ht.current),Ht.current=setTimeout(function(){var Bn;xi({code:C.Base64.encode(En),language:yt==null||((Bn=yt.current)===null||Bn===void 0)?void 0:Bn.language})},2e3),st({type:zt.SET_DATA,payload:Object(h.a)(Object(h.a)({},yt==null?void 0:yt.current),{},{hack:Object(h.a)(Object(h.a)({},yt==null||((fn=yt.current)===null||fn===void 0)?void 0:fn.hack),{},{code:En})})})}function Da(En){var fn=En.target.value;st({type:zt.SET_DATA,payload:Object(h.a)(Object(h.a)({},dn),{},{test_case:{input:fn}})})}var ar=function(){var En=Object(g.a)(i.a.mark(function fn(Bn){var Nt,yn,hr,Mr,wr;return i.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return st({type:zt.SET_LOADING,payload:!0}),an.next=3,xi();case 3:if(Nt=an.sent,!(Nt.status===0)){an.next=14;break}return st({type:zt.SET_SUBMIT_RESULT,payload:{languageValue:Bn}}),yt.current.language=Bn,yn="".concat(Mt==null?void 0:Mt.login,"-language"),localStorage.setItem(yn,Bn),an.next=11,Object(w.w)(nt);case 11:hr=an.sent,hr.status===0&&(wr=hr==null||((Mr=hr.data)===null||Mr===void 0)?void 0:Mr.find(function(na){return na.language===Bn}),ta(C.Base64.decode(wr.code))),setTimeout(function(){st({type:zt.SET_LOADING,payload:!1})},300);case 14:case"end":return an.stop()}},fn)}));return function(Bn){return En.apply(this,arguments)}}();function un(){return Mn.apply(this,arguments)}function Mn(){return Mn=Object(g.a)(i.a.mark(function En(){var fn;return i.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.prev=0,Nt.next=3,Object(w.q)(nt,{language:tn});case 3:fn=Nt.sent,fn.status===401?Yt.replace("/login",{from:_t.pathname}):(ta(C.Base64.decode(fn.code)),kr()),Nt.next=10;break;case 7:Nt.prev=7,Nt.t0=Nt.catch(0),console.log(Nt.t0);case 10:case"end":return Nt.stop()}},En,null,[[0,7]])})),Mn.apply(this,arguments)}function jn(){I.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",r.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)(i.a.mark(function fn(){var Bn;return i.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.next=2,Object(w.t)(nt,{language:tn});case 2:Bn=yn.sent,Bn.status===401?Yt.replace("/login",{from:_t.pathname}):ta(C.Base64.decode(Bn.code));case 4:case"end":return yn.stop()}},fn)}))()}})}function Rr(){st({type:zt.SET_SHOW_NOTE,payload:!0})}function Nn(){st({type:zt.SET_SHOW_NOTE,payload:!1})}function Si(En){return Fi.apply(this,arguments)}function Fi(){return Fi=Object(g.a)(i.a.mark(function En(fn){return i.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(w.b)(nt,fn);case 2:st({type:zt.GET_DATA,payload:{showNote:!1,data:Object(h.a)(Object(h.a)({},dn),{},{hack:Object(h.a)(Object(h.a)({},Qt),{},{notes:fn.notes})})}});case 3:case"end":return Nt.stop()}},En)})),Fi.apply(this,arguments)}var jr={input:dn==null||((rt=dn.test_case)===null||rt===void 0)?void 0:rt.input,language:Qt==null?void 0:Qt.language,code:Qt==null?void 0:Qt.code,title:"main."+Hn[Qt==null?void 0:Qt.language],modify_code:Qt==null?void 0:Qt.modify_code,notes:Qt==null?void 0:Qt.notes,debugResult:Xn,debuging:Rn,submitting:or,executingMessage:lr,id:nt,languageValue:tn,languageList:Pn,onChangeLanguage:ar,onCancelNote:Nn,onAddNote:Si,showNote:dr,onShowNote:Rr,onSubmitCode:Wi,onChangeCode:ta,onChangeInput:Da,onDebugCode:ca,onResetCode:un,onSyncCode:jn,onUpdateCode:xi};function Ti(){return Tr.apply(this,arguments)}function Tr(){return Tr=Object(g.a)(i.a.mark(function En(){var fn,Bn,Nt;return i.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:return hr.next=2,Object(w.u)(Qt.id,{container_type:"Hack",type:1});case 2:fn=hr.sent,Bn=fn.praise_count,Nt=Object(h.a)(Object(h.a)({},dn),{},{hack:Object(h.a)(Object(h.a)({},Qt),{},{praises_count:Bn,user_praise:!Qt.user_praise})}),st({type:zt.SET_DATA,payload:Nt});case 6:case"end":return hr.stop()}},En)})),Tr.apply(this,arguments)}var $r={topicId:nt,submitResult:_n,submitRecords:Gn,submitting:or,page:Kn,onPageChange:qn,hack:Qt,user:dn==null?void 0:dn.user,onTriggerPraise:Ti};return console.log(dn,yt==null?void 0:yt.current,"data--------"),r.a.createElement(r.a.Fragment,null,r.a.createElement(O.a,{className:"oj-custom-large-spin",size:"large",spinning:Sn},dn?r.a.createElement("div",{className:"oj-custom-warp"},r.a.createElement("header",{className:y.a.header,style:{minWidth:1200}},r.a.createElement("div",null,r.a.createElement("img",{src:"".concat(E.a.IMG_SERVER,"/images/").concat(Mt.image_url),alt:"user",width:30}),r.a.createElement("span",null,Mt.name)),r.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},r.a.createElement("div",null,Qt.name),r.a.createElement(bi.a,{onChange:function(fn){},className:"font12 c-grey-999"})),r.a.createElement(nn.CopyToClipboard,{text:"".concat((Et=window.location)===null||Et===void 0?void 0:Et.origin,"/problems/").concat(Qt.identifier,"/share"),onCopy:function(){return k.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},r.a.createElement("span",{className:y.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",r.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),Qt.edit_privilege?r.a.createElement(A.a,{className:y.a.btn_back,to:"/problems/".concat(Qt.identifier,"/ojedit"),style:{marginRight:10}}," ",r.a.createElement(s.a,null)," \u7F16\u8F91"):null,r.a.createElement(A.a,{className:y.a.btn_back,onClick:function(){},to:"/problems"}," ",r.a.createElement(S.a,null),"\u9000\u51FA")),r.a.createElement(v.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:r.a.createElement(Ii,$r),rightChild:r.a.createElement(Qn,jr)})):null),r.a.createElement(I.a,{centered:!0,closable:!1,width:680,footer:null,visible:Lt,className:"oj-modal"},r.a.createElement("section",{className:"oj-modal-content"},r.a.createElement("div",{className:"oj-modal-head"},r.a.createElement("img",{src:hi.a,alt:""}),r.a.createElement("i",{onClick:function(){return Bt(!1)},className:"iconfont icon-guanbi1"})),r.a.createElement("aside",null,r.a.createElement("img",{className:"mr30",src:Ji.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",r.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},_n==null?void 0:_n.execute_time,"s"),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(_n==null?void 0:_n.time_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("aside",{className:"mb50"},r.a.createElement("img",{src:Yi.a,className:"mr30"}),r.a.createElement("span",{className:"oj-modal-tt"},r.a.createElement("span",null,r.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),r.a.createElement("span",{className:"c-light-primary"},_n==null?void 0:_n.execute_memory,"mb")),r.a.createElement("span",null,r.a.createElement("span",null))),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(_n==null?void 0:_n.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function fi(Ve){var rt=Ve.languageValue,Et=Ve.languageList,$t=Ve.onChangeLanguage,Ut=Ve.title,Ot=Ve.modify_code,Qe=Ve.onSyncCode,st=Ve.onShowCodeSetting,Xt=Ve.onResetCode,nt=Object(x.h)(),Yt=function(){I.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:r.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:Xt})};return r.a.createElement("div",{className:"action-bar"},r.a.createElement(Y.a,{className:"oj-select",value:rt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:$t},Et==null?void 0:Et.map(function(_t){return r.a.createElement(Y.a.Option,{key:_t.language,value:_t.language},_t.language)})),r.a.createElement("span",null),r.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:Yt},r.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),r.a.createElement("a",{onClick:st},r.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Qn(Ve){var rt=Ve.id,Et=Ve.input,$t=Ve.showNote,Ut=Ve.onShowNote,Ot=Ve.notes,Qe=Ve.onCancelNote,st=Ve.onAddNote,Xt=Ve.debugResult,nt=Ve.language,Yt=Ve.debuging,_t=Ve.submitting,tn=Ve.executingMessage,Pn=Ve.code,Sn=Ve.onSubmitCode,dn=Ve.onDebugCode,Xn=Ve.onChangeCode,_n=Ve.onChangeInput,Gn=Ve.onUpdateCode,Kn=Object(z.a)(Ve,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function dr(or){return r.a.createElement(fi,Object(q.a)({},Kn,{onShowCodeSetting:or}))}var Rn={id:rt,input:Et,debugResult:Xt,debuging:Yt,submitting:_t,executingMessage:tn,onDebugCode:dn,onChangeCode:Xn,onSubmitCode:Sn,onChangeInput:_n};return r.a.createElement("div",{className:"right-panel"},r.a.createElement(f.a,{language:nt,value:Pn,onChange:Xn,ActionBarRender:dr}),r.a.createElement("div",{className:"note-form-area ".concat($t?"active":"")},r.a.createElement(Le,{onCancel:Qe,notes:Ot,callback:st})),r.a.createElement(W.b,Rn))}},WaYH:function(We,ge,D){"use strict";var q=D("rePB"),z=D("Ff2n"),P=D("VTBJ"),Y=D("1OyB"),N=D("vuIU"),O=D("JX7q"),H=D("Ji7U"),k=D("LK+K"),n=D("q1tI"),I=D("TSYQ"),g=D.n(I),p=D("sboe"),h=D("OZM5"),c=function(A){var w=A.prefixCls,v=A.level,E=A.isStart,m=A.isEnd;if(!v)return null;for(var f="".concat(w,"-indent-unit"),C=[],b=0;b<v;b+=1){var y;C.push(n.createElement("span",{key:b,className:g()(f,(y={},Object(q.a)(y,"".concat(f,"-start"),E[b+1]),Object(q.a)(y,"".concat(f,"-end"),m[b+1]),Object(q.a)(y,"".concat(f,"-end-first-level"),!b&&m[0]),y))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(w,"-indent")},C)},o=c,d=D("815F"),i="open",a="close",r="---",s=function(T){Object(H.a)(w,T);var A=Object(k.a)(w);function w(){var v;return Object(Y.a)(this,w),v=A.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(E){var m=v.props.context.onNodeClick;m(E,Object(d.b)(v.props)),v.isSelectable()?v.onSelect(E):v.onCheck(E)},v.onSelectorDoubleClick=function(E){var m=v.props.context.onNodeDoubleClick;m(E,Object(d.b)(v.props))},v.onSelect=function(E){if(v.isDisabled())return;var m=v.props.context.onNodeSelect;E.preventDefault(),m(E,Object(d.b)(v.props))},v.onCheck=function(E){if(v.isDisabled())return;var m=v.props,f=m.disableCheckbox,C=m.checked,b=v.props.context.onNodeCheck;if(!v.isCheckable()||f)return;E.preventDefault();var y=!C;b(E,Object(d.b)(v.props),y)},v.onMouseEnter=function(E){var m=v.props.context.onNodeMouseEnter;m(E,Object(d.b)(v.props))},v.onMouseLeave=function(E){var m=v.props.context.onNodeMouseLeave;m(E,Object(d.b)(v.props))},v.onContextMenu=function(E){var m=v.props.context.onNodeContextMenu;m(E,Object(d.b)(v.props))},v.onDragStart=function(E){var m=v.props.context.onNodeDragStart;E.stopPropagation(),v.setState({dragNodeHighlight:!0}),m(E,Object(O.a)(v));try{E.dataTransfer.setData("text/plain","")}catch(f){}},v.onDragEnter=function(E){var m=v.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),m(E,Object(O.a)(v))},v.onDragOver=function(E){var m=v.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),m(E,Object(O.a)(v))},v.onDragLeave=function(E){var m=v.props.context.onNodeDragLeave;E.stopPropagation(),m(E,Object(O.a)(v))},v.onDragEnd=function(E){var m=v.props.context.onNodeDragEnd;E.stopPropagation(),v.setState({dragNodeHighlight:!1}),m(E,Object(O.a)(v))},v.onDrop=function(E){var m=v.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),v.setState({dragNodeHighlight:!1}),m(E,Object(O.a)(v))},v.onExpand=function(E){var m=v.props.context.onNodeExpand;m(E,Object(d.b)(v.props))},v.setSelectHandle=function(E){v.selectHandle=E},v.getNodeState=function(){var E=v.props.expanded;return v.isLeaf()?null:E?i:a},v.hasChildren=function(){var E=v.props.eventKey,m=v.props.context.keyEntities,f=m[E]||{},C=f.children;return!!(C||[]).length},v.isLeaf=function(){var E=v.props,m=E.isLeaf,f=E.loaded,C=v.props.context.loadData,b=v.hasChildren();return m===!1?!1:m||!C&&!b||C&&f&&!b},v.isDisabled=function(){var E=v.props.disabled,m=v.props.context.disabled;return!!(m||E)},v.isCheckable=function(){var E=v.props.checkable,m=v.props.context.checkable;return!m||E===!1?!1:m},v.syncLoadData=function(E){var m=E.expanded,f=E.loading,C=E.loaded,b=v.props.context,y=b.loadData,M=b.onNodeLoad;if(f)return;y&&m&&!v.isLeaf()&&(!v.hasChildren()&&!C&&M(Object(d.b)(v.props)))},v.renderSwitcher=function(){var E=v.props,m=E.expanded,f=E.switcherIcon,C=v.props.context,b=C.prefixCls,y=C.switcherIcon,M=f||y;if(v.isLeaf())return n.createElement("span",{className:g()("".concat(b,"-switcher"),"".concat(b,"-switcher-noop"))},typeof M=="function"?M(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!0})):M);var W=g()("".concat(b,"-switcher"),"".concat(b,"-switcher_").concat(m?i:a));return n.createElement("span",{onClick:v.onExpand,className:W},typeof M=="function"?M(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!1})):M)},v.renderCheckbox=function(){var E=v.props,m=E.checked,f=E.halfChecked,C=E.disableCheckbox,b=v.props.context.prefixCls,y=v.isDisabled(),M=v.isCheckable();if(!M)return null;var W=typeof M!="boolean"?M:null;return n.createElement("span",{className:g()("".concat(b,"-checkbox"),m&&"".concat(b,"-checkbox-checked"),!m&&f&&"".concat(b,"-checkbox-indeterminate"),(y||C)&&"".concat(b,"-checkbox-disabled")),onClick:v.onCheck},W)},v.renderIcon=function(){var E=v.props.loading,m=v.props.context.prefixCls;return n.createElement("span",{className:g()("".concat(m,"-iconEle"),"".concat(m,"-icon__").concat(v.getNodeState()||"docu"),E&&"".concat(m,"-icon_loading"))})},v.renderSelector=function(){var E=v.state.dragNodeHighlight,m=v.props,f=m.title,C=m.selected,b=m.icon,y=m.loading,M=m.data,W=v.props.context,L=W.prefixCls,K=W.showIcon,F=W.icon,R=W.draggable,V=W.loadData,ne=W.titleRender,se=v.isDisabled(),Se="".concat(L,"-node-content-wrapper"),Le;if(K){var Ae=b||F;Le=Ae?n.createElement("span",{className:g()("".concat(L,"-iconEle"),"".concat(L,"-icon__customize"))},typeof Ae=="function"?Ae(v.props):Ae):v.renderIcon()}else V&&y&&(Le=v.renderIcon());var Pe;typeof f=="function"?Pe=f(M):ne?Pe=ne(M):Pe=f;var Fe=n.createElement("span",{className:"".concat(L,"-title")},Pe);return n.createElement("span",{ref:v.setSelectHandle,title:typeof f=="string"?f:"",className:g()("".concat(Se),"".concat(Se,"-").concat(v.getNodeState()||"normal"),!se&&(C||E)&&"".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},Le,Fe)},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 E=this.props.selectable,m=this.props.context.selectable;return typeof E=="boolean"?E:m}},{key:"render",value:function(){var E,m=this.props,f=m.eventKey,C=m.className,b=m.style,y=m.dragOver,M=m.dragOverGapTop,W=m.dragOverGapBottom,L=m.isLeaf,K=m.isStart,F=m.isEnd,R=m.expanded,V=m.selected,ne=m.checked,se=m.halfChecked,Se=m.loading,Le=m.domRef,Ae=m.active,Pe=m.onMouseMove,Fe=Object(z.a)(m,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),je=this.props.context,Te=je.prefixCls,Z=je.filterTreeNode,U=je.draggable,G=je.keyEntities,ee=this.isDisabled(),ue=Object(h.f)(Fe),J=G[f]||{},we=J.level,Ge=F[F.length-1];return n.createElement("div",Object.assign({ref:Le,className:g()(C,"".concat(Te,"-treenode"),(E={},Object(q.a)(E,"".concat(Te,"-treenode-disabled"),ee),Object(q.a)(E,"".concat(Te,"-treenode-switcher-").concat(R?"open":"close"),!L),Object(q.a)(E,"".concat(Te,"-treenode-checkbox-checked"),ne),Object(q.a)(E,"".concat(Te,"-treenode-checkbox-indeterminate"),se),Object(q.a)(E,"".concat(Te,"-treenode-selected"),V),Object(q.a)(E,"".concat(Te,"-treenode-loading"),Se),Object(q.a)(E,"".concat(Te,"-treenode-active"),Ae),Object(q.a)(E,"".concat(Te,"-treenode-leaf-last"),Ge),Object(q.a)(E,"drag-over",!ee&&y),Object(q.a)(E,"drag-over-gap-top",!ee&&M),Object(q.a)(E,"drag-over-gap-bottom",!ee&&W),Object(q.a)(E,"filter-node",Z&&Z(Object(d.b)(this.props))),E)),style:b,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:Pe},ue),n.createElement(o,{prefixCls:Te,level:we,isStart:K,isEnd:F}),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:r},S.isTreeNode=1;var x=ge.a=S},Wtmd:function(We,ge,D){We.exports=D.p+"static/c.03ba6fd6.svg"},Wx9E:function(We,ge,D){},XIdC:function(We,ge,D){"use strict";var q=D("rePB"),z=D("ODXe"),P=D("Ff2n"),Y=D("q1tI"),N=D.n(Y),O=D("TSYQ"),H=D.n(O),k=D("6cGi"),n=D("4IlW"),I=Y.forwardRef(function(g,p){var h,c=g.prefixCls,o=c===void 0?"rc-switch":c,d=g.className,i=g.checked,a=g.defaultChecked,r=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"]),E=Object(k.a)(!1,{value:i,defaultValue:a}),m=Object(z.a)(E,2),f=m[0],C=m[1];function b(L,K){var F=f;return r||(F=L,C(F),A==null||A(F,K)),F}function y(L){L.which===n.a.LEFT?b(!1,L):L.which===n.a.RIGHT&&b(!0,L),w==null||w(L)}function M(L){var K=b(!f,L);T==null||T(K,L)}var W=H()(o,d,(h={},Object(q.a)(h,"".concat(o,"-checked"),f),Object(q.a)(h,"".concat(o,"-disabled"),r),h));return Y.createElement("button",Object.assign({},v,{type:"button",role:"switch","aria-checked":f,disabled:r,className:W,ref:p,onKeyDown:y,onClick:M}),s,Y.createElement("span",{className:"".concat(o,"-inner")},f?S:x))});I.displayName="Switch",ge.a=I},Y1PL:function(We,ge,D){"use strict";D.r(ge),D.d(ge,"ResizableTextArea",function(){return se});var q=D("wx14"),z=D("1OyB"),P=D("vuIU"),Y=D("Ji7U"),N=D("LK+K"),O=D("q1tI"),H=D("VTBJ"),k=D("rePB"),n=D("Zm9Q"),I=D("Kwbf"),g=D("c+Xe"),p=D("m+aA"),h=D("bdgK"),c=new Map;function o(Ae){Ae.forEach(function(Pe){var Fe,je=Pe.target;(Fe=c.get(je))===null||Fe===void 0||Fe.forEach(function(Te){return Te(je)})})}var d=new h.default(o),i=null,a=null;function r(Ae,Pe){c.has(Ae)||(c.set(Ae,new Set),d.observe(Ae)),c.get(Ae).add(Pe)}function s(Ae,Pe){c.has(Ae)&&(c.get(Ae).delete(Pe),c.get(Ae).size||(d.unobserve(Ae),c.delete(Ae)))}var S=function(Ae){Object(Y.a)(Fe,Ae);var Pe=Object(N.a)(Fe);function Fe(){return Object(z.a)(this,Fe),Pe.apply(this,arguments)}return Object(P.a)(Fe,[{key:"render",value:function(){return this.props.children}}]),Fe}(O.Component),x=O.createContext(null);function T(Ae){var Pe=Ae.children,Fe=Ae.onBatchResize,je=O.useRef(0),Te=O.useRef([]),Z=O.useContext(x),U=O.useCallback(function(G,ee,ue){je.current+=1;var J=je.current;Te.current.push({size:G,element:ee,data:ue}),Promise.resolve().then(function(){J===je.current&&(Fe==null||Fe(Te.current),Te.current=[])}),Z==null||Z(G,ee,ue)},[Fe,Z]);return O.createElement(x.Provider,{value:U},Pe)}function A(Ae){var Pe=Ae.children,Fe=Ae.disabled,je=O.useRef(null),Te=O.useRef(null),Z=O.useContext(x),U=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),G=O.isValidElement(Pe)&&Object(g.c)(Pe),ee=G?Pe.ref:null,ue=O.useMemo(function(){return Object(g.a)(ee,je)},[ee,je]),J=O.useRef(Ae);J.current=Ae;var we=O.useCallback(function(Ge){var Je=J.current,be=Je.onResize,Re=Je.data,xe=Ge.getBoundingClientRect(),Ce=xe.width,Be=xe.height,Xe=Ge.offsetWidth,qe=Ge.offsetHeight,tt=Math.floor(Ce),ht=Math.floor(Be);if(U.current.width!==tt||U.current.height!==ht||U.current.offsetWidth!==Xe||U.current.offsetHeight!==qe){var ft={width:tt,height:ht,offsetWidth:Xe,offsetHeight:qe};U.current=ft;var Ne=Xe===Math.round(Ce)?Ce:Xe,Ue=qe===Math.round(Be)?Be:qe,Ze=Object(H.a)(Object(H.a)({},ft),{},{offsetWidth:Ne,offsetHeight:Ue});Z==null||Z(Ze,Ge,Re),be&&Promise.resolve().then(function(){be(Ze,Ge)})}},[]);return O.useEffect(function(){var Ge=Object(p.a)(je.current)||Object(p.a)(Te.current);return Ge&&!Fe&&r(Ge,we),function(){return s(Ge,we)}},[je.current,Fe]),O.createElement(S,{ref:Te},G?O.cloneElement(Pe,{ref:ue}):Pe)}var w="rc-observer-key";function v(Ae){var Pe=Ae.children,Fe=Object(n.a)(Pe);return Fe.map(function(je,Te){var Z=(je==null?void 0:je.key)||"".concat(w,"-").concat(Te);return O.createElement(A,Object(q.a)({},Ae,{key:Z}),je)})}v.Collection=T;var E=v,m=D("bT9E"),f=D("TSYQ"),C=D.n(f),b=`
|
|
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
|
|
`,y=["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"],M={},W;function L(Ae){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=Ae.getAttribute("id")||Ae.getAttribute("data-reactid")||Ae.getAttribute("name");if(Pe&&M[Fe])return M[Fe];var je=window.getComputedStyle(Ae),Te=je.getPropertyValue("box-sizing")||je.getPropertyValue("-moz-box-sizing")||je.getPropertyValue("-webkit-box-sizing"),Z=parseFloat(je.getPropertyValue("padding-bottom"))+parseFloat(je.getPropertyValue("padding-top")),U=parseFloat(je.getPropertyValue("border-bottom-width"))+parseFloat(je.getPropertyValue("border-top-width")),G=y.map(function(ue){return"".concat(ue,":").concat(je.getPropertyValue(ue))}).join(";"),ee={sizingStyle:G,paddingSize:Z,borderSize:U,boxSizing:Te};return Pe&&Fe&&(M[Fe]=ee),ee}function K(Ae){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,je=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),Ae.getAttribute("wrap")?W.setAttribute("wrap",Ae.getAttribute("wrap")):W.removeAttribute("wrap");var Te=L(Ae,Pe),Z=Te.paddingSize,U=Te.borderSize,G=Te.boxSizing,ee=Te.sizingStyle;W.setAttribute("style","".concat(ee,";").concat(b)),W.value=Ae.value||Ae.placeholder||"";var ue=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER,we=W.scrollHeight,Ge;if(G==="border-box"?we+=U:G==="content-box"&&(we-=Z),Fe!==null||je!==null){W.value=" ";var Je=W.scrollHeight-Z;Fe!==null&&(ue=Je*Fe,G==="border-box"&&(ue=ue+Z+U),we=Math.max(ue,we)),je!==null&&(J=Je*je,G==="border-box"&&(J=J+Z+U),Ge=we>J?"":"hidden",we=Math.min(J,we))}return{height:we,minHeight:ue,maxHeight:J,overflowY:Ge,resize:"none"}}var F=D("Gytx"),R=D.n(F),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(Y.a)(Fe,Ae);var Pe=Object(N.a)(Fe);function Fe(je){var Te;return Object(z.a)(this,Fe),Te=Pe.call(this,je),Te.nextFrameActionId=void 0,Te.resizeFrameId=void 0,Te.textArea=void 0,Te.saveTextArea=function(Z){Te.textArea=Z},Te.handleResize=function(Z){var U=Te.state.resizeStatus,G=Te.props,ee=G.autoSize,ue=G.onResize;if(U!==V.NONE)return;typeof ue=="function"&&ue(Z),ee&&Te.resizeOnNextFrame()},Te.resizeOnNextFrame=function(){cancelAnimationFrame(Te.nextFrameActionId),Te.nextFrameActionId=requestAnimationFrame(Te.resizeTextarea)},Te.resizeTextarea=function(){var Z=Te.props.autoSize;if(!Z||!Te.textArea)return;var U=Z.minRows,G=Z.maxRows,ee=K(Te.textArea,!1,U,G);Te.setState({textareaStyles:ee,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(Te.resizeFrameId),Te.resizeFrameId=requestAnimationFrame(function(){Te.setState({resizeStatus:V.RESIZED},function(){Te.resizeFrameId=requestAnimationFrame(function(){Te.setState({resizeStatus:V.NONE}),Te.fixFirefoxAutoScroll()})})})})},Te.renderTextArea=function(){var Z=Te.props,U=Z.prefixCls,G=U===void 0?"rc-textarea":U,ee=Z.autoSize,ue=Z.onResize,J=Z.className,we=Z.disabled,Ge=Te.state,Je=Ge.textareaStyles,be=Ge.resizeStatus,Re=Object(m.a)(Te.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=C()(G,J,Object(k.a)({},"".concat(G,"-disabled"),we));"value"in Re&&(Re.value=Re.value||"");var Ce=Object(H.a)(Object(H.a)(Object(H.a)({},Te.props.style),Je),be===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(E,{onResize:Te.handleResize,disabled:!(ee||ue)},O.createElement("textarea",Object(q.a)({},Re,{className:xe,style:Ce,ref:Te.saveTextArea})))},Te.state={textareaStyles:{},resizeStatus:V.NONE},Te}return Object(P.a)(Fe,[{key:"componentDidUpdate",value:function(Te){(Te.value!==this.props.value||!R()(Te.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 Te=this.textArea.selectionStart,Z=this.textArea.selectionEnd;this.textArea.setSelectionRange(Te,Z)}}catch(U){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Fe}(O.Component),se=ne,Se=function(Ae){Object(Y.a)(Fe,Ae);var Pe=Object(N.a)(Fe);function Fe(je){var Te;Object(z.a)(this,Fe),Te=Pe.call(this,je),Te.resizableTextArea=void 0,Te.focus=function(){Te.resizableTextArea.textArea.focus()},Te.saveTextArea=function(U){Te.resizableTextArea=U},Te.handleChange=function(U){var G=Te.props.onChange;Te.setValue(U.target.value,function(){Te.resizableTextArea.resizeTextarea()}),G&&G(U)},Te.handleKeyDown=function(U){var G=Te.props,ee=G.onPressEnter,ue=G.onKeyDown;U.keyCode===13&&ee&&ee(U),ue&&ue(U)};var Z=typeof je.value=="undefined"||je.value===null?je.defaultValue:je.value;return Te.state={value:Z},Te}return Object(P.a)(Fe,[{key:"setValue",value:function(Te,Z){"value"in this.props||this.setState({value:Te},Z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(se,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Te){return"value"in Te?{value:Te.value}:null}}]),Fe}(O.Component),Le=ge.default=Se},Z8dc:function(We,ge,D){We.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(We,ge,D){"use strict";var q=D("BoS7"),z=D("Sdc0"),P=D("OaEy"),Y=D("2fM7"),N=D("q1tI"),O=D.n(N),H=D("lOMy"),k=D.n(H),n=Y.a.Option;ge.a=function(I){var g=I.onFontSizeChange,p=I.cmFontSize,h=I.cmCodeMode,c=I.onCodeModeChange,o=I.onTabToSpace,d=I.className,i=d===void 0?"":d,a=I.tabToSpace,r=I.children;return O.a.createElement("div",{className:"tpi-code-setting ".concat(i)},O.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),O.a.createElement("section",null,O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),O.a.createElement(Y.a,{bordered:!1,size:"small",value:h,onChange:c},O.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),O.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),O.a.createElement(Y.a,{bordered:!1,size:"small",value:p,onChange:g},O.a.createElement(n,{value:12},"12px"),O.a.createElement(n,{value:14},"14px"),O.a.createElement(n,{value:16},"16px"),O.a.createElement(n,{value:18},"18px"),O.a.createElement(n,{value:20},"20px"),O.a.createElement(n,{value:22},"22px"))),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"Tab\u8F6C\u6362"),O.a.createElement(z.a,{checked:a,onChange:o}))),O.a.createElement("h3",null,"\u5FEB\u6377\u952E"),O.a.createElement("section",null,O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),O.a.createElement("span",null,"Ctrl + S")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),O.a.createElement("span",null,"F1 / Alt + F1")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),O.a.createElement("span",null,"Ctrl + ]/[")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),O.a.createElement("span",null,"Ctrl + Shift + \\")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),O.a.createElement("span",null,"Home")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),O.a.createElement("span",null,"End"))),r)}},ZW9T:function(We,ge,D){"use strict";D.d(ge,"a",function(){return F});var q=D("k1fw"),z=D("oBTY"),P=D("miYZ"),Y=D("tsqr"),N=D("rAM+"),O=D("tJVT"),H=D("PpiC"),k=D("q1tI"),n=D.n(k),I=D("bdgK"),g=D("9og8"),p=D("WmNS"),h=D.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(`
|
|
`)}]},i={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=D("5VLF"),r=D.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 Le=V.getWordUntilPosition(ne),Ae={startLineNumber:ne.lineNumber,endLineNumber:ne.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Pe=se.map(function(Fe){return{label:Fe,kind:R.languages.CompletionItemKind.Keyword,insertText:Fe,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}});return Se.map(function(Fe){Pe.push(Object(q.a)(Object(q.a)({},Fe),{},{range:Ae}))}),Pe}var w=function(R){s.languages.map(function(Se){return R.languages.registerDocumentFormattingEditProvider(Se,{provideDocumentFormattingEdits:function(Ae,Pe,Fe){return Object(g.a)(h.a.mark(function je(){var Te;return h.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return Te=r()(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:Te}]);case 2:case"end":return U.stop()}},je)}))()}}),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=i.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(Le,Ae){var Pe=Le.getWordUntilPosition(Ae),Fe={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},je=Le.getLineContent(Ae.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[].concat(Object(z.a)(d.keywords.map(function(Te){return{label:Te,kind:R.languages.CompletionItemKind.Function,documentation:Te,insertText:Te,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})),Object(z.a)(d.quickKey.map(function(Te){return{label:Te.label,kind:R.languages.CompletionItemKind.Function,documentation:Te.content,insertText:je.startsWith("#")?Te.content.replace(/#/,""):Te.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})))}}}),R.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Le,Ae){var Pe=Le.getWordUntilPosition(Ae),Fe={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn};return{suggestions:Object(z.a)(c.keywords.map(function(je){return{label:je,kind:R.languages.CompletionItemKind.Function,documentation:je,insertText:je,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}}))}}}),R.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Le,Ae){var Pe=Le.getWordUntilPosition(Ae),Fe={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},je=Le.getLineContent(Ae.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[].concat(Object(z.a)(o.keywords.map(function(Te){return{label:Te,kind:R.languages.CompletionItemKind.Function,documentation:Te,insertText:Te,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})),Object(z.a)(o.quickKey.map(function(Te){return{label:Te.label,kind:R.languages.CompletionItemKind.Function,documentation:Te.content,insertText:je.startsWith("#")?Te.content.replace(/#/,""):Te.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})))}}}),R.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Le,Ae){var Pe=Le.getWordUntilPosition(Ae),Fe={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},je=Le.getLineContent(Ae.lineNumber).substring(Pe.startColumn-2,Pe.endColumn);return{suggestions:[].concat(Object(z.a)(i.keywords.map(function(Te){return{label:Te,kind:R.languages.CompletionItemKind.Function,documentation:Te,insertText:Te,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})),Object(z.a)(i.quickKey.map(function(Te){return{label:Te.label,kind:R.languages.CompletionItemKind.Function,documentation:Te.content,insertText:je.startsWith("#")?Te.content.replace(/#/,""):Te.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=D("fjLI"),m=D("LvDl"),f=D("+ua5");function C(R){return/^\d+$/.test(R)?"".concat(R,"px"):R}function b(){}var y=!1,M={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function W(){var 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=M[R[ne]];if(se)return se}return V[0]}return M[V]||V}var L=null,K=ge.b=function(R){var V=R.width,ne=V===void 0?"100%":V,se=R.height,Se=se===void 0?"100%":se,Le=R.value,Ae=R.language,Pe=Ae===void 0?"javascript":Ae,Fe=R.style,je=Fe===void 0?{}:Fe,Te=R.options,Z=Te===void 0?{}:Te,U=R.overrideServices,G=U===void 0?{}:U,ee=R.theme,ue=ee===void 0?"vs-dark":ee,J=R.onEditBlur,we=R.onSave,Ge=R.autoHeight,Je=Ge===void 0?!1:Ge,be=R.forbidCopy,Re=be===void 0?!1:be,xe=R.onChange,Ce=xe===void 0?b:xe,Be=R.editorDidMount,Xe=Be===void 0?b:Be,qe=R.onFocus,tt=qe===void 0?b:qe,ht=R.filename,ft=ht===void 0?"educoder.txt":ht,Ne=R.errorLine,Ue=R.errorContent,Ze=Ue===void 0?"":Ue,et=Object(H.a)(R,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),fe=Object(k.useRef)(),re=Object(k.useRef)({}),ie=Object(k.useRef)(),ce=Object(k.useRef)(),pe=Object(k.useRef)(!1),le=Object(k.useRef)(),he=Object(k.useState)(!1),ye=Object(O.a)(he,2),_e=ye[0],Oe=ye[1];function ke(){var Wt;return fe.current&&(Wt=new I.default(function(At){var Zt=Object(N.a)(At),Ee;try{for(Zt.s();!(Ee=Zt.n()).done;){var de=Ee.value;(de.target.offsetHeight>0||de.target.offsetWidth>0)&&re.current.instance.layout()}}catch(j){Zt.e(j)}finally{Zt.f()}}),Wt.observe(fe.current)),Wt}function $e(){Y.b.warn(decodeURIComponent(v))}var ot=function(){var At=re.current.instance;if(Le!=null&&At&&_e){var Zt=At.getModel();Zt&&Le!==Zt.getValue()&&(y=!0,Zt.setValue(Le),At.layout(),y=!1)}};Object(k.useEffect)(function(){ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){ot()},500)},[Le,_e,re.current]),Object(k.useEffect)(function(){if(Ne&&re.current&&re.current.instance){var Wt=re.current.instance;Wt.changeViewZones(function(Zt){var Ee=document.createElement("div");Ee.style.padding="10px 20px",Ee.style.width="calc(100% - 20px)",Ee.className="my-error-line-wrp",Ee.innerHTML=Ze,Zt.addZone({afterLineNumber:Ne||11,heightInLines:3,domNode:Ee})});var At={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}};Wt.addOverlayWidget(At),Wt.revealPositionInCenter({lineNumber:20,column:1})}},[Ne,re.current,_e]);function pt(){var Wt=re.current.instance;if(Wt){var At=Wt.getSelection(),Zt=re.current.pastePos||{},Ee=new L.Range(Zt.startLineNumber||At.endLineNumber,Zt.startColumn||At.endColumn,Zt.endLineNumber||At.endLineNumber,Zt.endColumn||At.endColumn);setTimeout(function(){Wt.executeEdits("",[{range:Ee,text:""}])},300)}}function mt(Wt){(window.navigator.platform.match("Mac")?Wt.metaKey:Wt.ctrlKey)&&Wt.keyCode==83&&(Wt.preventDefault(),we())}var qt=function(){if(Je&&re.current.instance){var At=re.current.instance.getContentHeight();en(At<Se?Se:At)}else en(Se)};function xt(Wt){var At=document.createEvent("MouseEvents");At.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Wt.dispatchEvent(At)}function Ct(Wt,At){var Zt=window.URL||window.webkitURL||window,Ee=new Blob([At]),de=document.createElementNS("http://www.w3.org/1999/xhtml","a");de.href=Zt.createObjectURL(Ee),de.download=Wt,xt(de)}Object(k.useEffect)(function(){qt()},[qt]),Object(k.useEffect)(function(){fe.current&&!_e&&Promise.all([D.e(17),D.e(29)]).then(D.t.bind(null,"M/lh",7)).then(function(Wt){try{L=Wt,re.current.instance=L.editor.create(fe.current,{value:Le,language:W(Pe),theme:ue,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},G);var At=re.current.instance,Zt=E.d._menuItems,Ee=Object(z.a)(Zt).find(function(te){return te[0]._debugName=="EditorContext"}),de=Ee[1],j=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],X=function(ve,Ie){var He=ve._first;do{var ct,ut,ze=Ie.includes((ct=He.element)===null||ct===void 0||((ut=ct.command)===null||ut===void 0)?void 0:ut.id);ze&&ve._remove(He)}while(He=He.next)};if(Xe(At,L),setTimeout(function(){qt(),re.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ct(ft||"educoder.txt",At.getValue())}}),At.getDomNode().addEventListener("input",function(){ie.current.autoFormat&&At.getAction("editor.action.formatDocument").run()})},500),re.current.subscription=At.onDidChangeModelContent(function(te){pe.current?clearTimeout(le.current):(qt(),Ce(At.getValue(),te)),le.current=setTimeout(function(){pe.current=!1},500)}),window.Monaco||w(L,W(Pe)),Re&&(X(de,j),fe.current.classList.add("noCopyPaste"),At.onKeyDown(function(te){var ve=te.keyCode,Ie=te.ctrlKey,He=te.metaKey;(ve===33||ve===52)&&(He||Ie)&&($e(),te.preventDefault())})),window.Monaco=L,J&&At.onDidBlurEditorWidget(function(){J(At.getValue())}),tt&&At.onDidFocusEditorText(function(){tt(At.getValue())}),Re){At.addCommand(L.KeyMod.CtrlCmd|L.KeyCode.KEY_V,function(){return $e(),null}),At.onDidPaste(function(te){re.current.pastePos=te});try{window.addEventListener("paste",pt)}catch(te){}}var $=ke();return Oe(!0),function(){var te=re.current.instance;te.dispose();var ve=te.getModel();ve&&ve.dispose(),re.current.subscription&&re.current.subscription.dispose(),Re&&window.removeEventListener("paste",pt),$.unobserve(fe.current)}}catch(te){}})},[]),Object(k.useEffect)(function(){var Wt=re.current.instance;if(Wt&&_e)return document.addEventListener("keydown",mt,!1),function(){document.removeEventListener("keydown",mt)}},[we,_e]),Object(k.useEffect)(function(){var Wt=re.current.instance;if(Wt&&_e){var At=W(Pe);L.editor.setModelLanguage(Wt.getModel(),At),console.log("language:",Pe,Wt.getModel(),At)}},[Pe,_e]),Object(k.useEffect)(function(){var Wt=re.current.instance;Wt&&_e&&L.editor.setTheme(ue)},[ue,_e]),Object(k.useEffect)(function(){var Wt=re.current.instance;ie.current=Z,Wt&&_e&&(Wt.updateOptions(Object(q.a)({},Z)),setTimeout(function(){Wt.getModel().updateOptions(Object(q.a)({},Z))},200))},[JSON.stringify(Z),_e]),Object(k.useEffect)(function(){var Wt=re.current.instance;Wt&&_e&&Wt.layout()},[ne,Se,_e]);var Pt=Object(k.useState)(C(ne)),Rt=Object(O.a)(Pt,2),Gt=Rt[0],On=Rt[1],kt=Object(k.useState)(C(Se)),Un=Object(O.a)(kt,2),An=Un[0],en=Un[1],wn=Object(q.a)(Object(q.a)({},je),{},{width:Gt,height:An});return n.a.createElement("div",{className:"my-monaco-editor",ref:fe,style:wn})};function F(R){var V=R.width,ne=V===void 0?"100%":V,se=R.height,Se=se===void 0?"100%":se,Le=R.original,Ae=R.modified,Pe=R.language,Fe=R.options,je=Fe===void 0?{}:Fe,Te=Object(k.useRef)(),Z=Object(k.useState)(null),U=Object(O.a)(Z,2),G=U[0],ee=U[1];function ue(Je){var be;return Te.current&&(be=new I.default(function(Re){var xe=Object(N.a)(Re),Ce;try{for(xe.s();!(Ce=xe.n()).done;){var Be=Ce.value;(Be.target.offsetHeight>0||Be.target.offsetWidth>0)&&Je.layout()}}catch(Xe){xe.e(Xe)}finally{xe.f()}}),be.observe(Te.current)),be}Object(k.useEffect)(function(){Te.current&&Promise.all([D.e(17),D.e(29)]).then(D.t.bind(null,"M/lh",7)).then(function(Je){L=Je;var be=L.editor.createDiffEditor(Te.current,Object(q.a)(Object(q.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},je),{},{wordWrap:!0}));ee(be);var Re=ue(be);return function(){be.dispose();var xe=be.getModel();xe&&xe.dispose(),Re.unobserve(Te.current)}})},[]),Object(k.useEffect)(function(){G&&G.setModel({original:L.editor.createModel(Le,Pe),modified:L.editor.createModel(Ae,Pe)})},[Le,Ae,Pe,G]);var J=C(ne),we=C(Se),Ge={width:J,height:we};return n.a.createElement("div",{className:"my-diff-editor",ref:Te,style:Ge})}},ZsLC:function(We,ge,D){We.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(We,ge,D){"use strict";D.d(ge,"b",function(){return Y}),D.d(ge,"a",function(){return N});var q=D("je13"),z=D.n(q),P=!1;function Y(O,H){var k=z.a.get("__ec");k||(k={}),k[O]=H,z.a.set("__ec",k)}function N(O,H){var k=z.a.get("__ec");return k?k[O]===void 0?H:k[O]:H}},bT9E:function(We,ge,D){"use strict";D.d(ge,"a",function(){return z});var q=D("VTBJ");function z(P,Y){var N=Object(q.a)({},P);return Array.isArray(Y)&&Y.forEach(function(O){delete N[O]}),N}},bdLU:function(We,ge,D){"use strict";D.d(ge,"a",function(){return q});var q;(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"})(q||(q={}))},biw7:function(We,ge,D){"use strict";var q=D("q1tI"),z=D.n(q),P=q.createContext(null);ge.a=P},c5Ni:function(We,ge,D){},cDPC:function(We,ge,D){"use strict";var q=D("tJVT"),z=D("q1tI"),P=D.n(z),Y=D("i3hx"),N=D.n(Y);ge.a=function(O){var H=O.defaultX,k=H===void 0?"40%":H,n=O.leftChild,I=O.rightChild,g=O.className,p=O.hideResize,h=p===void 0?!1:p,c=Object(z.useState)(k),o=Object(q.a)(c,2),d=o[0],i=o[1],a=Object(z.useRef)();function r(){a.current=!0}Object(z.useEffect)(function(){function x(A){a.current&&i(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"):k,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:r},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}},I))}},dejd:function(We,ge,D){},dmUQ:function(We,ge,D){"use strict";var q=D("Ff2n"),z=D("rePB"),P=D("1OyB"),Y=D("vuIU"),N=D("Ji7U"),O=D("md7G"),H=D("foSv"),k=D("q1tI"),n=D.n(k),I=D("TSYQ"),g=D.n(I),p=D("4IlW");function h(m,f){var C=Object.keys(m);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(m);f&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(m,y).enumerable})),C.push.apply(C,b)}return C}function c(m){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?h(Object(C),!0).forEach(function(b){Object(z.a)(m,b,C[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(C)):h(Object(C)).forEach(function(b){Object.defineProperty(m,b,Object.getOwnPropertyDescriptor(C,b))})}return m}function o(m){var f=d();return function(){var b=Object(H.a)(m),y;if(f){var M=Object(H.a)(this).constructor;y=Reflect.construct(b,arguments,M)}else y=b.apply(this,arguments);return Object(O.a)(this,y)}}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 i(){}function a(m){m.preventDefault()}var r=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,C){return C===f||typeof C=="number"&&typeof f=="number"&&isNaN(C)&&isNaN(f)},w=function(m){Object(N.a)(C,m);var f=o(C);function C(b){var y;Object(P.a)(this,C),y=f.call(this,b),y.onKeyDown=function(L){var K=y.props,F=K.onKeyDown,R=K.onPressEnter;if(L.keyCode===p.a.UP){var V=y.getRatio(L);y.up(L,V,null),y.stop()}else if(L.keyCode===p.a.DOWN){var ne=y.getRatio(L);y.down(L,ne,null),y.stop()}else L.keyCode===p.a.ENTER&&R&&R(L);if(y.recordCursorPosition(),y.lastKeyCode=L.keyCode,F){for(var se=arguments.length,Se=new Array(se>1?se-1:0),Le=1;Le<se;Le++)Se[Le-1]=arguments[Le];F.apply(void 0,[L].concat(Se))}},y.onKeyUp=function(L){var K=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),K){for(var F=arguments.length,R=new Array(F>1?F-1:0),V=1;V<F;V++)R[V-1]=arguments[V];K.apply(void 0,[L].concat(R))}},y.onChange=function(L){var K=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(L)),y.setState({inputValue:y.rawInput}),K(y.toNumber(y.rawInput))},y.onMouseUp=function(){var L=y.props.onMouseUp;y.recordCursorPosition(),L&&L.apply(void 0,arguments)},y.onFocus=function(){var L;y.setState({focused:!0}),(L=y.props).onFocus.apply(L,arguments)},y.onBlur=function(){var L=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var K=y.getCurrentValidValue(y.state.inputValue),F=y.setValue(K,i);if(L){var R=y.input.value,V=y.getInputDisplayValue({focus:!1,value:F});y.input.value=V&&Number(V),L.apply(void 0,arguments),y.input.value=R}},y.getRatio=function(L){var K=1;return L.metaKey||L.ctrlKey?K=.1:L.shiftKey&&(K=10),K},y.getFullNum=function(L){return isNaN(L)?L:/e/i.test(String(L))?Number(L).toFixed(18).replace(/\.?0+$/,""):L},y.getPrecision=function(L){if(T(y.props.precision))return y.props.precision;var K=String(L);if(K.indexOf("e-")>=0)return parseInt(K.slice(K.indexOf("e-")+2),10);var F=0;return K.indexOf(".")>=0&&(F=K.length-K.indexOf(".")-1),F},y.getInputDisplayValue=function(L){var K=L||y.state,F=K.focused,R=K.inputValue,V=K.value,ne;F?ne=R:ne=y.toPrecisionAsStep(V),ne==null&&(ne="");var se=y.formatWrapper(ne);return T(y.props.decimalSeparator)&&(se=se.toString().replace(".",y.props.decimalSeparator)),se},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(L){}},y.restoreByAfter=function(L){if(L===void 0)return!1;var K=y.input.value,F=K.lastIndexOf(L);if(F===-1)return!1;var R=y.cursorBefore.length;return y.lastKeyCode===p.a.DELETE&&y.cursorBefore.charAt(R-1)===L[0]?(y.fixCaret(R,R),!0):F+L.length===K.length?(y.fixCaret(F,F),!0):!1},y.partRestoreByAfter=function(L){return L===void 0?!1:Array.prototype.some.call(L,function(K,F){var R=L.substring(F);return y.restoreByAfter(R)})},y.isNotCompleteNumber=function(L){return isNaN(L)||L===""||L===null||L&&L.toString().indexOf(".")===L.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(L,K,F){y.pressingUpOrDown=!0,y.step("down",L,K,F)},y.up=function(L,K,F){y.pressingUpOrDown=!0,y.step("up",L,K,F)},y.saveInput=function(L){y.input=L};var M=b.value;M===void 0&&(M=b.defaultValue),y.state={focused:b.autoFocus};var W=y.getValidValue(y.toNumber(M));return y.state=c(c({},y.state),{},{inputValue:y.toPrecisionAsStep(W),value:W}),y}return Object(Y.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var M=this.props,W=M.value,L=M.onChange,K=M.max,F=M.min,R=this.state.focused;if(y){if(!A(y.value,W)||!A(y.max,K)||!A(y.min,F)){var V=R?W:this.getValidValue(W),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?W:this.state.value;"max"in this.props&&y.max!==K&&typeof se=="number"&&se>K&&L&&L(K),"min"in this.props&&y.min!==F&&typeof se=="number"&&se<F&&L&&L(F)}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(Le){}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(y){var M=y;return M===""?M="":this.isNotCompleteNumber(parseFloat(M))?M=this.state.value:M=this.getValidValue(M),this.toNumber(M)}},{key:"getValueFromEvent",value:function(y){var M=y.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(M=M.replace(this.props.decimalSeparator,".")),M}},{key:"getValidValue",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,L=parseFloat(y);return isNaN(L)?y:(L<M&&(L=M),L>W&&(L=W),L)}},{key:"setValue",value:function(y,M){var W=this.props.precision,L=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),K=this.state.value,F=K===void 0?null:K,R=this.state.inputValue,V=R===void 0?null:R,ne=typeof L=="number"?L.toFixed(W):"".concat(L),se=L!==F||ne!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},M)):this.setState({value:L,inputValue:this.toPrecisionAsStep(y)},M),se&&this.props.onChange(L),L}},{key:"getMaxPrecision",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,L=W.precision,K=W.step;if(T(L))return L;var F=this.getPrecision(M),R=this.getPrecision(K),V=this.getPrecision(y);return y?Math.max(V,F+R):F+R}},{key:"getPrecisionFactor",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(y,M);return Math.pow(10,W)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var M=Math.abs(this.getMaxPrecision(y));return isNaN(M)?y.toString():Number(y).toFixed(M)}},{key:"toNumber",value:function(y){var M=this.props.precision,W=this.state.focused,L=y&&y.length>16&&W;return this.isNotCompleteNumber(y)||L?y:T(M)?Math.round(y*Math.pow(10,M))/Math.pow(10,M):Number(y)}},{key:"upStep",value:function(y,M){var W=this.props.step,L=this.getPrecisionFactor(y,M),K=Math.abs(this.getMaxPrecision(y,M)),F=((L*y+L*W*M)/L).toFixed(K);return this.toNumber(F)}},{key:"downStep",value:function(y,M){var W=this.props.step,L=this.getPrecisionFactor(y,M),K=Math.abs(this.getMaxPrecision(y,M)),F=((L*y-L*W*M)/L).toFixed(K);return this.toNumber(F)}},{key:"step",value:function(y,M){var W=this,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,K=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var F=this.props;if(F.disabled)return;var R=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(R))return;var V=this["".concat(y,"Step")](R,L),ne=V>F.max||V<F.min;if(V>F.max?V=F.max:V<F.min&&(V=F.min),this.setValue(V,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){W[y](M,L,!0)},K?s:S)}},{key:"fixCaret",value:function(y,M){if(y===void 0||M===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,L=this.input.selectionEnd;(y!==W||M!==L)&&this.input.setSelectionRange(y,M)}catch(K){}}},{key:"render",value:function(){var y,M=this.props,W=M.prefixCls,L=M.disabled,K=M.readOnly,F=M.useTouch,R=M.autoComplete,V=M.upHandler,ne=M.downHandler,se=M.className,Se=M.max,Le=M.min,Ae=M.style,Pe=M.title,Fe=M.onMouseEnter,je=M.onMouseLeave,Te=M.onMouseOver,Z=M.onMouseOut,U=M.required,G=M.onClick,ee=M.tabIndex,ue=M.type,J=M.placeholder,we=M.id,Ge=M.inputMode,Je=M.pattern,be=M.step,Re=M.maxLength,xe=M.autoFocus,Ce=M.name,Be=M.onPaste,Xe=M.onInput,qe=Object(q.a)(M,["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"]),tt=this.state,ht=tt.value,ft=tt.focused,Ne=g()(W,(y={},Object(z.a)(y,se,!!se),Object(z.a)(y,"".concat(W,"-disabled"),L),Object(z.a)(y,"".concat(W,"-focused"),ft),y)),Ue={};Object.keys(qe).forEach(function(_e){(_e.substr(0,5)==="data-"||_e.substr(0,5)==="aria-"||_e==="role")&&(Ue[_e]=qe[_e])});var Ze=!K&&!L,et=this.getInputDisplayValue(null),fe=(ht||ht===0)&&(isNaN(ht)||Number(ht)>=Se),re=(ht||ht===0)&&(isNaN(ht)||Number(ht)<=Le),ie=fe||L||K,ce=re||L||K,pe=g()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(z.a)({},"".concat(W,"-handler-up-disabled"),ie)),le=g()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(z.a)({},"".concat(W,"-handler-down-disabled"),ce)),he=F?{onTouchStart:ie?i:this.up,onTouchEnd:this.stop}:{onMouseDown:ie?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ye=F?{onTouchStart:ce?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ne,style:Ae,title:Pe,onMouseEnter:Fe,onMouseLeave:je,onMouseOver:Te,onMouseOut:Z,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(W,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Increase Value","aria-disabled":ie,className:pe}),V||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:a})),n.a.createElement("span",Object.assign({unselectable:"on"},ye,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:le}),ne||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:a}))),n.a.createElement("div",{className:"".concat(W,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Le,"aria-valuemax":Se,"aria-valuenow":ht,required:U,type:ue,placeholder:J,onPaste:Be,onClick:G,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:ee,autoComplete:R,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ze?this.onKeyDown:i,onKeyUp:Ze?this.onKeyUp:i,autoFocus:xe,maxLength:Re,readOnly:K,disabled:L,max:Se,min:Le,step:be,name:Ce,title:Pe,id:we,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(et),pattern:Je,inputMode:Ge,onInput:Xe},Ue))))}}]),C}(n.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:r,required:!1,autoComplete:"off"};var v=w,E=ge.a=v},fcSX:function(We,ge,D){"use strict";var q=D("Ff2n"),z=D("1OyB"),P=D("vuIU"),Y=D("Ji7U"),N=D("md7G"),O=D("foSv"),H=D("1W/9"),k=D("q1tI"),n=D("rePB"),I=D("JX7q"),g=D("TSYQ"),p=D.n(g),h=D("qx4F"),c=D("4IlW");function o(L){return Array.isArray(L)?L:[L]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(d).filter(function(L){if(typeof document=="undefined")return!1;var K=document.getElementsByTagName("html")[0];return L in(K?K.style:{})})[0],a=d[i];function r(L,K,F,R){L.addEventListener?L.addEventListener(K,F,R):L.attachEvent&&L.attachEvent("on".concat(K),F)}function s(L,K,F,R){L.removeEventListener?L.removeEventListener(K,F,R):L.attachEvent&&L.detachEvent("on".concat(K),F)}function S(L,K){var F=typeof L=="function"?L(K):L;return Array.isArray(F)?F.length===2?F:[F[0],F[1]]:[F]}var x=function(K){return!isNaN(parseFloat(K))&&isFinite(K)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function L(K,F,R,V){if(!F||F===document||F instanceof Document)return!1;if(F===K.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=F.scrollHeight-F.clientHeight,Le=F.scrollWidth-F.clientWidth,Ae=document.defaultView.getComputedStyle(F),Pe=Ae.overflowY==="auto"||Ae.overflowY==="scroll",Fe=Ae.overflowX==="auto"||Ae.overflowX==="scroll",je=Se&&Pe,Te=Le&&Fe;return ne&&(!je||je&&(F.scrollTop>=Se&&V<0||F.scrollTop<=0&&V>0))||se&&(!Te||Te&&(F.scrollLeft>=Le&&R<0||F.scrollLeft<=0&&R>0))?L(K,F.parentNode,R,V):!1};function w(L){var K=v();return function(){var R=Object(O.a)(L),V;if(K){var ne=Object(O.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 E={},m=function(L){Object(Y.a)(F,L);var K=w(F);function F(R){var V;return Object(z.a)(this,F),V=K.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,Le=ne.changedTouches[0].clientY-V.startPos.y;(se===V.maskDom||se===V.handlerDom||se===V.contentDom&&A(se,ne.target,Se,Le))&&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,Le=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="")),Le&&Le(!!Se))},V.openLevelTransition=function(){var ne=V.props,se=ne.open,Se=ne.width,Le=ne.height,Ae=V.getHorizontalBoolAndPlacementName(),Pe=Ae.isHorizontal,Fe=Ae.placementName,je=V.contentDom?V.contentDom.getBoundingClientRect()[Pe?"width":"height"]:0,Te=(Pe?Se:Le)||je;V.setLevelAndScrolling(se,Fe,Te)},V.setLevelTransform=function(ne,se,Se,Le){var Ae=V.props,Pe=Ae.placement,Fe=Ae.levelMove,je=Ae.duration,Te=Ae.ease,Z=Ae.showMask;V.levelDom.forEach(function(U){U.style.transition="transform ".concat(je," ").concat(Te),r(U,a,V.transitionEnd);var G=ne?Se:0;if(Fe){var ee=S(Fe,{target:U,open:ne});G=ne?ee[0]:ee[1]||0}var ue=typeof G=="number"?"".concat(G,"px"):G,J=Pe==="left"||Pe==="top"?ue:"-".concat(ue);J=Z&&Pe==="right"&&Le?"calc(".concat(J," + ").concat(Le,"px)"):J,U.style.transform=G?"".concat(se,"(").concat(J,")"):""})},V.setLevelAndScrolling=function(ne,se,Se){var Le=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)}Le&&Le(ne)},V.toggleScrollingToDrawerAndBody=function(ne){var se=V.props,Se=se.getOpenCount,Le=se.getContainer,Ae=se.showMask,Pe=se.open,Fe=Le&&Le(),je=Se&&Se();if(Fe&&Fe.parentNode===document.body&&Ae){var Te=["touchstart"],Z=[document.body,V.maskDom,V.handlerDom,V.contentDom];Pe&&document.body.style.overflow!=="hidden"?(ne&&V.addScrollingEffect(ne),je===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Z.forEach(function(U,G){if(!U)return;r(U,Te[G]||"touchmove",G?V.removeMoveHandler:V.removeStartHandler,V.passive)})):V.getCurrentDrawerSome()&&(je||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&V.remScrollingEffect(ne),Z.forEach(function(U,G){if(!U)return;s(U,Te[G]||"touchmove",G?V.removeMoveHandler:V.removeStartHandler,V.passive)}))}},V.addScrollingEffect=function(ne){var se=V.props,Se=se.placement,Le=se.duration,Ae=se.ease,Pe=se.getOpenCount,Fe=se.switchScrollingEffect,je=Pe&&Pe();je===1&&Fe();var Te="width ".concat(Le," ").concat(Ae),Z="transform ".concat(Le," ").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(Te),V.dom.style.width="",V.dom.style.transform="")})},V.remScrollingEffect=function(ne){var se=V.props,Se=se.placement,Le=se.duration,Ae=se.ease,Pe=se.getOpenCount,Fe=se.switchScrollingEffect,je=Pe&&Pe();je||Fe(!0),i&&(document.body.style.overflowX="hidden"),V.dom.style.transition="none";var Te,Z="width ".concat(Le," ").concat(Ae),U="transform ".concat(Le," ").concat(Ae);switch(Se){case"left":{V.dom.style.width="100%",Z="width 0s ".concat(Ae," ").concat(Le);break}case"right":{V.dom.style.transform="translateX(".concat(ne,"px)"),V.dom.style.width="100%",Z="width 0s ".concat(Ae," ").concat(Le),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)",Te="height 0s ".concat(Ae," ").concat(Le);break}default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(U,",").concat(Te?"".concat(Te,","):"").concat(Z),V.dom.style.transform="",V.dom.style.width="",V.dom.style.height="")})},V.getCurrentDrawerSome=function(){return!Object.keys(E).some(function(ne){return E[ne]})},V.getLevelDom=function(ne){var se=ne.level,Se=ne.getContainer;if(T)return;var Le=Se&&Se(),Ae=Le?Le.parentNode:null;if(V.levelDom=[],se==="all"){var Pe=Ae?Array.prototype.slice.call(Ae.children):[];Pe.forEach(function(Fe){Fe.nodeName!=="SCRIPT"&&Fe.nodeName!=="STYLE"&&Fe.nodeName!=="LINK"&&Fe!==Le&&V.levelDom.push(Fe)})}else se&&o(se).forEach(function(Fe){document.querySelectorAll(Fe).forEach(function(je){V.levelDom.push(je)})})},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(I.a)(V)},V}return Object(P.a)(F,[{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(Pe){}this.passive=ne?{passive:!1}:!1}var se=this.props,Se=se.open,Le=se.getContainer,Ae=Le&&Le();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&&(E[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,Le=Se&&Se();se!==V.open&&(se&&this.domFocus(),Le&&Le.parentNode===document.body&&(E[this.drawerId]=!!se),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var V=this.props,ne=V.getOpenCount,se=V.open,Se=V.switchScrollingEffect,Le=typeof ne=="function"&&ne();delete E[this.drawerId],se&&(this.setLevelTransform(!1),document.body.style.touchAction=""),Le||(document.body.style.overflow="",Se(!0))}},{key:"render",value:function(){var V,ne=this,se=this.props,Se=se.className,Le=se.children,Ae=se.style,Pe=se.width,Fe=se.height,je=se.defaultOpen,Te=se.open,Z=se.prefixCls,U=se.placement,G=se.level,ee=se.levelMove,ue=se.ease,J=se.duration,we=se.getContainer,Ge=se.handler,Je=se.onChange,be=se.afterVisibleChange,Re=se.showMask,xe=se.maskClosable,Ce=se.maskStyle,Be=se.onClose,Xe=se.onHandleClick,qe=se.keyboard,tt=se.getOpenCount,ht=se.switchScrollingEffect,ft=Object(q.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"]),Ne=this.dom?Te:!1,Ue=p()(Z,(V={},Object(n.a)(V,"".concat(Z,"-").concat(U),!0),Object(n.a)(V,"".concat(Z,"-open"),Ne),Object(n.a)(V,Se||"",!!Se),Object(n.a)(V,"no-mask",!Re),V)),Ze=this.getHorizontalBoolAndPlacementName(),et=Ze.placementName,fe=U==="left"||U==="top"?"-100%":"100%",re=Ne?"":"".concat(et,"(").concat(fe,")"),ie=Ge&&k.cloneElement(Ge,{onClick:function(pe){Ge.props.onClick&&Ge.props.onClick(),Xe&&Xe(pe)},ref:function(pe){ne.handlerDom=pe}});return k.createElement("div",Object.assign({},ft,{tabIndex:-1,className:Ue,style:Ae,ref:function(pe){ne.dom=pe},onKeyDown:Ne&&qe?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Re&&k.createElement("div",{className:"".concat(Z,"-mask"),onClick:xe?Be:void 0,style:Ce,ref:function(pe){ne.maskDom=pe}}),k.createElement("div",{className:"".concat(Z,"-content-wrapper"),style:{transform:re,msTransform:re,width:x(Pe)?"".concat(Pe,"px"):Pe,height:x(Fe)?"".concat(Fe,"px"):Fe},ref:function(pe){ne.contentWrapper=pe}},k.createElement("div",{className:"".concat(Z,"-content"),ref:function(pe){ne.contentDom=pe},onTouchStart:Ne&&Re?this.removeStartHandler:void 0,onTouchMove:Ne&&Re?this.removeMoveHandler:void 0},Le),ie))}}],[{key:"getDerivedStateFromProps",value:function(V,ne){var se=ne.prevProps,Se=ne._self,Le={prevProps:V};if(se!==void 0){var Ae=V.placement,Pe=V.level;Ae!==se.placement&&(Se.contentDom=null),Pe!==se.level&&Se.getLevelDom(V)}return Le}}]),F}(k.Component);m.defaultProps={switchScrollingEffect:function(){}};var f=m;function C(L){var K=b();return function(){var R=Object(O.a)(L),V;if(K){var ne=Object(O.a)(this).constructor;V=Reflect.construct(R,arguments,ne)}else V=R.apply(this,arguments);return Object(N.a)(this,V)}}function b(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(L){return!1}}var y=function(L){Object(Y.a)(F,L);var K=C(F);function F(R){var V;Object(z.a)(this,F),V=K.call(this,R),V.onHandleClick=function(se){var Se=V.props,Le=Se.onHandleClick,Ae=Se.open;if(Le&&Le(se),typeof Ae=="undefined"){var Pe=V.state.open;V.setState({open:!Pe})}},V.onClose=function(se){var Se=V.props,Le=Se.onClose,Ae=Se.open;Le&&Le(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)(F,[{key:"render",value:function(){var V=this,ne=this.props,se=ne.defaultOpen,Se=ne.getContainer,Le=ne.wrapperClassName,Ae=ne.forceRender,Pe=ne.handler,Fe=Object(q.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),je=this.state.open;if(!Se)return k.createElement("div",{className:Le,ref:function(U){V.dom=U}},k.createElement(f,Object.assign({},Fe,{open:je,handler:Pe,getContainer:function(){return V.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var Te=!!Pe||Ae;return k.createElement(H.a,{visible:je,forceRender:Te,getContainer:Se,wrapperClassName:Le},function(Z){var U=Z.visible,G=Z.afterClose,ee=Object(q.a)(Z,["visible","afterClose"]);return k.createElement(f,Object.assign({},Fe,ee,{open:U!==void 0?U:je,afterVisibleChange:G!==void 0?G:Fe.afterVisibleChange,handler:Pe,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}}]),F}(k.Component);y.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:k.createElement("div",{className:"drawer-handle"},k.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var M=y,W=ge.a=M},fcyK:function(We,ge,D){},fjLI:function(We,ge,D){"use strict";D.d(ge,"f",function(){return h}),D.d(ge,"b",function(){return c}),D.d(ge,"a",function(){return o}),D.d(ge,"d",function(){return d}),D.d(ge,"e",function(){return i}),D.d(ge,"c",function(){return a});var q=D("8HAY"),z=D("Vhoy"),P=D("MI8n"),Y=D("JYp7"),N=D("pmY6"),O=D("24hK"),H=D("nnTU"),k=D("T8No"),n=D("Cg/j"),I=D("t9D7"),g=function(r,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(r,s,S,x);else for(var v=r.length-1;v>=0;v--)(w=r[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(r,s){return function(S,x){s(S,x,r)}};function h(r){return r.command!==void 0}class c{constructor(r){this.id=c._idPool++,this._debugName=r}}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:r=>r===c.CommandPalette}}addCommand(r){return this.addCommands(Y.a.single(r))}addCommands(r){for(const s of r)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(N.i)(()=>{let s=!1;for(const S of r)s=this._commands.delete(S.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((s,S)=>r.set(S,s)),r}appendMenuItem(r,s){return this.appendMenuItems(Y.a.single({id:r,item:s}))}appendMenuItems(r){const s=new Set,S=new O.a;for(const{id:x,item:T}of r){let A=this._menuItems.get(x);A||(A=new O.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(r){let s;return this._menuItems.has(r)?s=[...this._menuItems.get(r)]:s=[],r===c.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(r){const s=new Set;for(const S of r)h(S)&&(s.add(S.command.id),S.alt&&s.add(S.alt.id));this._commands.forEach((S,x)=>{s.has(x)||r.push({command:S})})}};class i extends q.e{constructor(r,s,S,x){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=s,this._contextKeyService=S,this._options=x}get actions(){const r=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),S=s.getActions(this._options);s.dispose();for(const[,x]of S)x.length>0&&(r.push(...x),r.push(new q.d));return r.length&&r.pop(),r}}let a=class r{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 E=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=T.contextMatchesRules(E.condition),this.checked&&E.tooltip&&(this.tooltip=typeof E.tooltip=="string"?E.tooltip:E.tooltip.value),E.title&&(this.label=typeof E.title=="string"?E.title:E.title.value)}this.item=s,this.alt=S?new r(S,void 0,x,T,A):void 0,this._options=x,I.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,k.b),p(4,H.b)],a)},fyJ8:function(We,ge,D){"use strict";var q=D("rePB"),z=D("VTBJ"),P=D("Ff2n"),Y=D("U8pU"),N=D("q1tI"),O=D.n(N),H=D("TSYQ"),k=D.n(H),n=D("c+Xe"),I=D("sR1s");function g(d){return d&&Object(Y.a)(d)==="object"&&!Array.isArray(d)&&!N.isValidElement(d)}function p(d){return typeof d=="string"?!0:Object(n.c)(d)}function h(d,i){var a,r=d.prefixCls,s=d.className,S=d.record,x=d.index,T=d.dataIndex,A=d.render,w=d.children,v=d.component,E=v===void 0?"td":v,m=d.colSpan,f=d.rowSpan,C=d.fixLeft,b=d.fixRight,y=d.firstFixLeft,M=d.lastFixLeft,W=d.firstFixRight,L=d.lastFixRight,K=d.appendNode,F=d.additionalProps,R=F===void 0?{}:F,V=d.ellipsis,ne=d.align,se=d.rowType,Se=d.isSticky,Le="".concat(r,"-cell"),Ae,Pe;if(w)Pe=w;else{var Fe=Object(I.b)(S,T);if(Pe=Fe,A){var je=A(Fe,S,x);g(je)?(Pe=je.children,Ae=je.props):Pe=je}}Object(Y.a)(Pe)==="object"&&!Array.isArray(Pe)&&!N.isValidElement(Pe)&&(Pe=null),V&&(M||W)&&(Pe=N.createElement("span",{className:"".concat(Le,"-content")},Pe));var Te=Ae||{},Z=Te.colSpan,U=Te.rowSpan,G=Te.style,ee=Te.className,ue=Object(P.a)(Te,["colSpan","rowSpan","style","className"]),J=Z!==void 0?Z:m,we=U!==void 0?U:f;if(J===0||we===0)return null;var Ge={},Je=typeof C=="number",be=typeof b=="number";Je&&(Ge.position="sticky",Ge.left=C),be&&(Ge.position="sticky",Ge.right=b);var Re={};ne&&(Re.textAlign=ne);var xe,Ce=V===!0?{showTitle:!0}:V;Ce&&(Ce.showTitle||se==="header")&&(typeof Pe=="string"||typeof Pe=="number"?xe=Pe.toString():N.isValidElement(Pe)&&typeof Pe.props.children=="string"&&(xe=Pe.props.children));var Be=Object(z.a)(Object(z.a)(Object(z.a)({title:xe},ue),R),{},{colSpan:J&&J!==1?J:null,rowSpan:we&&we!==1?we:null,className:k()(Le,s,(a={},Object(q.a)(a,"".concat(Le,"-fix-left"),Je),Object(q.a)(a,"".concat(Le,"-fix-left-first"),y),Object(q.a)(a,"".concat(Le,"-fix-left-last"),M),Object(q.a)(a,"".concat(Le,"-fix-right"),be),Object(q.a)(a,"".concat(Le,"-fix-right-first"),W),Object(q.a)(a,"".concat(Le,"-fix-right-last"),L),Object(q.a)(a,"".concat(Le,"-ellipsis"),V),Object(q.a)(a,"".concat(Le,"-with-append"),K),Object(q.a)(a,"".concat(Le,"-fix-sticky"),(Je||be)&&Se),a),R.className,ee),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},R.style),Re),Ge),G),ref:p(E)?i:null});return N.createElement(E,Object.assign({},Be),K,Pe)}var c=N.forwardRef(h);c.displayName="Cell";var o=N.memo(c,function(d,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,d.record):!1});ge.a=o},gRFJ:function(We,ge,D){We.exports=[D("rdUC"),D("ynwM"),D("RELg"),D("DlR+"),D("CrYA"),D("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(We){return We<10?"0"+We:We}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(We){return rx_escapable.lastIndex=0,rx_escapable.test(We)?'"'+We.replace(rx_escapable,function(ge){var D=meta[ge];return typeof D=="string"?D:"\\u"+("0000"+ge.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+We+'"'}function str(We,ge){var D,q,z,P,Y=gap,N,O=ge[We];O&&typeof O=="object"&&typeof O.toJSON=="function"&&(O=O.toJSON(We)),typeof rep=="function"&&(O=rep.call(ge,We,O));switch(typeof O){case"string":return quote(O);case"number":return isFinite(O)?String(O):"null";case"boolean":case"null":return String(O);case"object":if(!O)return"null";if(gap+=indent,N=[],Object.prototype.toString.apply(O)==="[object Array]"){for(P=O.length,D=0;D<P;D+=1)N[D]=str(D,O)||"null";return z=N.length===0?"[]":gap?`[
|
|
`+gap+N.join(`,
|
|
`+gap)+`
|
|
`+Y+"]":"["+N.join(",")+"]",gap=Y,z}if(rep&&typeof rep=="object")for(P=rep.length,D=0;D<P;D+=1)typeof rep[D]=="string"&&(q=rep[D],z=str(q,O),z&&N.push(quote(q)+(gap?": ":":")+z));else for(q in O)Object.prototype.hasOwnProperty.call(O,q)&&(z=str(q,O),z&&N.push(quote(q)+(gap?": ":":")+z));return z=N.length===0?"{}":gap?`{
|
|
`+gap+N.join(`,
|
|
`+gap)+`
|
|
`+Y+"}":"{"+N.join(",")+"}",gap=Y,z}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(We,ge,D){var q;if(gap="",indent="",typeof D=="number")for(q=0;q<D;q+=1)indent+=" ";else typeof D=="string"&&(indent=D);if(rep=ge,ge&&typeof ge!="function"&&(typeof ge!="object"||typeof ge.length!="number"))throw new Error("JSON.stringify");return str("",{"":We})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(We,ge){var D,q,z=We[ge];if(z&&typeof z=="object")for(D in z)Object.prototype.hasOwnProperty.call(z,D)&&(q=walk(z,D),q!==void 0?z[D]=q:delete z[D]);return reviver.call(We,ge,z)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(We){return"\\u"+("0000"+We.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(We,ge,D){We.exports=D.p+"static/g.a5bcde87.svg"},hW8S:function(We,ge,D){"use strict";D.d(ge,"a",function(){return Y}),D.d(ge,"c",function(){return N}),D.d(ge,"b",function(){return O});var q=D("VTBJ"),z=D("Ff2n"),P=D("Kwbf"),Y="RC_TABLE_INTERNAL_COL_DEFINE";function N(H){var k=H.expandable,n=Object(z.a)(H,["expandable"]);return"expandable"in H?Object(q.a)(Object(q.a)({},n),k):n}function O(H){return Object.keys(H).reduce(function(k,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(k[n]=H[n]),k},{})}},hgre:function(We,ge,D){"use strict";var q=D("miYZ"),z=D("tsqr"),P=D("9og8"),Y=D("WmNS"),N=D.n(Y),O=D("q1tI"),H=D.n(O),k=D("GUcZ"),n=D("ulZh"),I=D.n(n),g=D("xKgJ"),p=D("P5Jw"),h=D.n(p),c=D("bntm"),o=D("4xil"),d=D.n(o);function i(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 r(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;ge.a=Object(O.forwardRef)(function(S,x){var T,A=S.src,w=S.toLog,v=S.videoId,E=S.logWatchHistory,m=S.courseId,f=m===void 0?null:m,C=S.startTime,b=S.handlePause,y=b===void 0?function(){}:b,M=S.handlePlay,W=M===void 0?function(){}:M,L=S.handlePlayEnded,K=L===void 0?function(){}:L,F=S.videoSpeed,R=F===void 0?1:F,V=A==null||((T=A.split("."))===null||T===void 0)?void 0:T.pop(),ne=V==="flv",se=Object(O.useRef)(),Se=Object(O.useRef)(),Le=Object(O.useRef)(),Ae=Object(O.useRef)(),Pe=Object(O.useRef)(),Fe=Object(O.useRef)(),je=Object(O.useRef)(),Te=Object(O.useRef)(),Z=Object(O.useRef)(),U=Object(O.useRef)(),G=Object(O.useRef)(),ee=Object(O.useRef)(),ue=Object(O.useRef)(),J=Object(O.useRef)(),we=navigator.userAgent.toLowerCase().match(s),Ge=we?we[0]:"pc",Je=Object(O.useRef)(!1),be=Object(g.y)(),Re=0,xe=0,Ce=0,Be=null,Xe=!1,qe=20,tt=1,ht=!1,ft=!1,Ne=[];Object(O.useImperativeHandle)(x,function(){return{getLastUpdatedTime:function(){return se.current.currentTime},getDuration:function(){return se.current.duration}}});var Ue=Object(O.useCallback)(function(ie){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe={point:se.current.currentTime};Be?(pe.log_id=Be,pe.watch_duration=r(Ne),pe.total_duration=xe):(f?(pe.video_id=parseInt(v,10),pe.course_id=f):pe.video_id=v,pe.duration=Re,pe.device=Ge),ce&&(pe.ed="1");function le(){return he.apply(this,arguments)}function he(){return he=Object(P.a)(N.a.mark(function ye(){var _e;return N.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return ht=!0,ke.next=3,E(pe);case 3:_e=ke.sent,Be=_e,ht=!1,ie&&ie();case 7:case"end":return ke.stop()}},ye)})),he.apply(this,arguments)}le()},[v,f]);Object(O.useEffect)(function(){z.b.destroy();var ie=null;return k.a.isSupported&&ne&&A&&(A==null?void 0:A.indexOf(".m3u8"))<0?(ie=k.a.createPlayer({type:"flv",volume:.8,cors:!0,url:A,muted:!1}),se.current&&(ie.attachMediaElement(se.current),ie.load())):se.current.setAttribute("src",A),et(),function(){ie&&(ie.unload(),ie.pause(),ie.destroy(),ie=null)}},[se,ne,A]);function Ze(){se.current.paused?(Ae.current.style.display="none",Pe.current.style.display="block"):(Ae.current.style.display="block",Pe.current.style.display="none")}function et(){G.current.style.display="none",ue.current.style.display="none",ee.current.style.display="none",se.current.muted||se.current.volume===0?G.current.style.display="block":se.current.volume>0&&se.current.volume<=.5?ue.current.style.display="block":ee.current.style.display="block"}Object(O.useEffect)(function(){var ie=document.getElementById("play"),ce=document.querySelectorAll(".playback-icons use");function pe(){W(),C&&!Je.current&&(se.current.currentTime=C),Je.current=!0,Ne.push(se.current.currentTime),Xe||(Xe=!0,w&&Ue())}function le(){return he.apply(this,arguments)}function he(){return he=Object(P.a)(N.a.mark(function Pt(){return N.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:Ze(),Ne.push(se.current.currentTime),w&&Ue(function(){Be=null,Ce=0,Xe=!1,ht=!1,ft=!1,Ne=[],xe=0,tt=1},!0);case 3:case"end":return Gt.stop()}},Pt)})),he.apply(this,arguments)}function ye(){Fe.current.value=Math.round(se.current.currentTime),je.current.value=Math.round(se.current.currentTime)}function _e(){var Pt=i(Math.round(se.current.currentTime));Z.current.innerText="".concat(Pt.hour>0?Pt.hour+":":"").concat(Pt.minutes,":").concat(Pt.seconds),Z.current.setAttribute("datetime","".concat(Pt.hour>0?" "+Pt.hour+" ":"").concat(Pt.minutes,"m ").concat(Pt.seconds,"s"))}function Oe(){var Pt=Math.round(se.current.duration);Fe.current.setAttribute("max",Pt),je.current.setAttribute("max",Pt);var Rt=i(Pt);Te.current.innerText="".concat(Rt.hour>0?Rt.hour+":":"").concat(Rt.minutes,":").concat(Rt.seconds),Te.current.setAttribute("datetime","".concat(Rt.hour>0?" "+Rt.hour+" ":"").concat(Rt.minutes,"m ").concat(Rt.seconds,"s"))}function ke(){var Pt=Math.round(se.current.duration);Fe.current.setAttribute("max",Pt),je.current.setAttribute("max",Pt);var Rt=i(Pt);Te.current.innerText="".concat(Rt.hour>0?Rt.hour+":":"").concat(Rt.minutes,":").concat(Rt.seconds),Te.current.setAttribute("datetime","".concat(Rt.hour>0?" "+Rt.hour+" ":"").concat(Rt.minutes,"m ").concat(Rt.seconds,"s")),ye(),_e();var Gt=Se.current.getBoundingClientRect(),On=Gt.width,kt=Gt.height,Un=Gt.x,An=Gt.y;if(Un<0||An<0||!On)return;if(!ft){var en=se.current.currentTime,wn=en-Ce;Math.abs(wn)<10?(xe+=Math.abs(wn),Ce=en,ht||xe-tt*qe>=0&&(tt++,Ne.push(Ce),w&&Ue())):(Ce=en,w&&Ue())}}function $e(){ft=!0}function ot(){se.current.playing&&Ne.push(se.current.currentTime,Ce),Ce=se.current.currentTime,ft=!1}function pt(){Re=se.current.duration,Re<=20&&(qe=Re/3),se.current.addEventListener("play",pe)}function mt(Pt){Pt.preventDefault(),Object(c.a)()?(se.current.style.width="100%",se.current.style.height="100%"):se.current.style.cssText=""}function qt(){y()}function xt(Pt){var Rt=Pt.target.dataset.seek?Pt.target.dataset.seek:Pt.target.value;se.current.currentTime=Rt,je.current.value=Rt,Fe.current.value=Rt}function Ct(Pt){var Rt=Math.round(Pt.offsetX/Pt.target.clientWidth*parseInt(Pt.target.getAttribute("max"),10));Fe.current.setAttribute("data-seek",Rt);var Gt=i(Rt);U.current.textContent="".concat(Gt.hour>0?Gt.hour+":":"").concat(Gt.minutes,":").concat(Gt.seconds);var On=se.current.getBoundingClientRect();U.current.style.left="".concat(Pt.pageX-On.left,"px")}return Le.current.addEventListener(Object(c.c)(),mt),se.current.addEventListener("canplay",pt),se.current.addEventListener("ended",le),se.current.addEventListener("seeking",$e),se.current.addEventListener("seeked",ot),se.current.addEventListener("loadedmetadata",Oe),Fe.current.addEventListener("mousemove",Ct),Fe.current.addEventListener("input",xt),se.current.addEventListener("timeupdate",ke),se.current.addEventListener("pause",qt),se.current.addEventListener("volumechange",et),function(){se.current.removeEventListener("canplay",pt),se.current.removeEventListener("play",pe),se.current.removeEventListener("ended",le),se.current.removeEventListener("seeking",$e),se.current.removeEventListener("seeked",ot),Fe.current.removeEventListener("mousemove",Ct),Fe.current.removeEventListener("input",xt),se.current.removeEventListener("timeupdate",ke),se.current.removeEventListener("pause",qt),se.current.removeEventListener("loadedmetadata",Oe),se.current.removeEventListener("volumechange",et),se.current.playing&&(Ne.push(Ce,se.current.currentTime),w&&Ue())}},[se,A]),Object(O.useEffect)(function(){if(se.current.onended=function(){K(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(I.a.isSupported()){var ie=new I.a;ie.loadSource(A),ie.attachMedia(se.current)}}},[A]),Object(O.useEffect)(function(){se.current.playbackRate=R},[R]);var fe=function(){se.current.paused||se.current.ended?se.current.play():se.current.pause(),Ze()};function re(){se.current.muted=!se.current.muted,se.current.muted?(J.current.setAttribute("data-volume",volume.value),J.current.value=0):J.current.value=J.current.dataset.volume}return H.a.createElement("div",{style:{position:"relative"},ref:Le},H.a.createElement("div",{ref:Se,className:"".concat(d.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(d.a.animate__loop)},be?be.login:" "),H.a.createElement("div",{className:d.a.container},H.a.createElement("div",{className:d.a["video-container"],id:"video-container"},H.a.createElement("div",{className:d.a["playback-animation"],id:"playback-animation"},H.a.createElement("svg",{className:d.a["playback-icons"]},H.a.createElement("use",{className:"hidden",href:"#play-icon"}),H.a.createElement("use",{href:"#pause"}))),H.a.createElement("video",{className:d.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:se,autoPlay:!1}),H.a.createElement("div",{className:"".concat(d.a["video-controls"]," "),id:"video-controls"},H.a.createElement("div",{className:d.a["bottom-controls"]},H.a.createElement("div",{className:d.a["left-controls"]},H.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:fe},H.a.createElement("svg",{className:d.a["playback-icons"]},H.a.createElement("use",{ref:Pe,href:"#play-icon"}),H.a.createElement("use",{ref:Ae,style:{display:"none"},href:"#pause"}))),H.a.createElement("div",{className:d.a.time},H.a.createElement("time",{id:"time-elapsed",ref:Z},"00:00"),H.a.createElement("span",null," / "),H.a.createElement("time",{id:"duration",ref:Te},"00:00"))),H.a.createElement("div",{className:d.a["right-controls"]},H.a.createElement(p.CopyToClipboard,{text:A,onCopy:function(){return z.b.success("\u590D\u5236\u6210\u529F")}},H.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},H.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),H.a.createElement("div",{className:d.a["volume-controls"]},H.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:d.a["volume-button"],id:"volume-button",onClick:re},H.a.createElement("i",{ref:G,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),H.a.createElement("i",{ref:ue,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),H.a.createElement("i",{ref:ee,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),H.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:J,style:{display:"none"},onClick:et})),H.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)(Le.current)}},H.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),H.a.createElement("div",{className:d.a["video-progress"]},H.a.createElement("progress",{ref:je,value:"0",min:"0"}),H.a.createElement("input",{className:d.a.seek,ref:Fe,value:"0",min:"0",type:"range",step:"1"}),H.a.createElement("div",{className:d.a["seek-tooltip"],ref:U,id:"seek-tooltip"},"00:00"))))),H.a.createElement("svg",{style:{display:"none"}},H.a.createElement("defs",null,H.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),H.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),H.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},H.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"})),H.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},H.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"})),H.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},H.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"})),H.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},H.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"})),H.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},H.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"})),H.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},H.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(We,ge,D){},ic2d:function(We,ge,D){"use strict";D.d(ge,"a",function(){return Y});var q=D("FWmy"),z=D("746U");class P{constructor(){this.data=new Map}add(N,O){q.a(z.l(N)),q.a(z.k(O)),q.a(!this.data.has(N),"There is already an extension with this id"),this.data.set(N,O)}as(N){return this.data.get(N)||null}}const Y=new P},je13:function(We,ge,D){var q=D("5nXd"),z=D("gRFJ"),P=[D("uQRt")];We.exports=q.createStore(z,P)},kSUc:function(We,ge,D){},"kaH+":function(We,ge,D){"use strict";var q=D("+L6B"),z=D("2/Rp"),P=D("tJVT"),Y=D("q1tI"),N=D.n(Y),O=D("UZu5"),H=D.n(O),k=D("dhSg"),n=D("rLCj"),I=D("dF/Y"),g=D("4i/N");ge.a=function(){var p=Object(Y.useState)(""),h=Object(P.a)(p,2),c=h[0],o=h[1],d=Object(Y.useState)(0),i=Object(P.a)(d,2),a=i[0],r=i[1],s=Object(Y.useRef)("");Object(Y.useEffect)(function(){var E=k.a.subscribe("preview-image",function(m){o(m),document.body.style.overflow="hidden"});return E},[]),Object(Y.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(Y.useEffect)(function(){s.current=c},[c]);function S(E){E.keyCode==27&&s.current&&x()}function x(){document.body.style.overflow="auto",o("")}function T(){r(a+90)}var A=Object(Y.useRef)(),w=Object(Y.useRef)(),v=function(m){(m.nativeEvent.target===A.current||m.nativeEvent.target===w.current)&&x()};return N.a.createElement(Y.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(I.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(We,ge,D){We.exports=D.p+"static/e.eabfa286.svg"},lOMy:function(We,ge,D){},lZu9:function(We,ge,D){(function(q){q(D("VrN/"),D("1eCo"),D("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(z,P){var Y=q.getMode(z,"text/html"),N=Y.name=="null";function O(F){if(q.findModeByName){var R=q.findModeByName(F);R&&(F=R.mime||R.mimes[0])}var V=q.getMode(z,F);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 H={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 k in H)H.hasOwnProperty(k)&&P.tokenTypeOverrides[k]&&(H[k]=P.tokenTypeOverrides[k]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,p=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 r(F,R,V){return R.f=R.inline=V,V(F,R)}function s(F,R,V){return R.f=R.block=V,V(F,R)}function S(F){return!F||!/\S/.test(F.string)}function x(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==A){var R=N;if(!R){var V=q.innerMode(Y,F.htmlState);R=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}R&&(F.f=m,F.block=T,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function T(F,R){var V=F.column()===R.indentation,ne=S(R.prevLine.stream),se=R.indentedCode,Se=R.prevLine.hr,Le=R.list!==!1,Ae=(R.listStack[R.listStack.length-1]||0)+3;R.indentedCode=!1;var Pe=R.indentation;if(R.indentationDiff===null&&(R.indentationDiff=R.indentation,Le)){for(R.list=null;Pe<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=Pe-R.listStack[R.listStack.length-1])}var Fe=!ne&&!Se&&!R.prevLine.header&&(!Le||!se)&&!R.prevLine.fencedCodeEnd,je=(R.list===!1||Se||ne)&&R.indentation<=Ae&&F.match(n),Te=null;if(R.indentationDiff>=4&&(se||R.prevLine.fencedCodeEnd||R.prevLine.header||ne))return F.skipToEnd(),R.indentedCode=!0,H.code;if(F.eatSpace())return null;if(V&&R.indentation<=Ae&&(Te=F.match(p))&&Te[1].length<=6)return R.quote=0,R.header=Te[1].length,R.thisLine.header=!0,P.highlightFormatting&&(R.formatting="header"),R.f=R.inline,v(R);if(R.indentation<=Ae&&F.eat(">"))return R.quote=V?1:R.quote+1,P.highlightFormatting&&(R.formatting="quote"),F.eatSpace(),v(R);if(!je&&!R.setext&&V&&R.indentation<=Ae&&(Te=F.match(I))){var Z=Te[1]?"ol":"ul";return R.indentation=Pe+F.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&&F.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&&(Te=F.match(o,!0)))return R.quote=0,R.fencedEndRE=new RegExp(Te[1]+"+ *$"),R.localMode=P.fencedCodeBlockHighlighting&&O(Te[2]||P.fencedCodeBlockDefaultMode),R.localMode&&(R.localState=q.startState(R.localMode)),R.f=R.block=w,P.highlightFormatting&&(R.formatting="code-block"),R.code=-1,v(R);if(R.setext||(!Fe||!Le)&&!R.quote&&R.list===!1&&!R.code&&!je&&!d.test(F.string)&&(Te=F.lookAhead(1))&&(Te=Te.match(h)))return R.setext?(R.header=R.setext,R.setext=0,F.skipToEnd(),P.highlightFormatting&&(R.formatting="header")):(R.header=Te[0].charAt(0)=="="?1:2,R.setext=R.header),R.thisLine.header=!0,R.f=R.inline,v(R);if(je)return F.skipToEnd(),R.hr=!0,R.thisLine.hr=!0,H.hr;if(F.peek()==="[")return r(F,R,M)}return r(F,R,R.inline)}function A(F,R){var V=Y.token(F,R.htmlState);if(!N){var ne=q.innerMode(Y,R.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||R.md_inside&&F.current().indexOf(">")>-1)&&(R.f=m,R.block=T,R.htmlState=null)}return V}function w(F,R){var V=R.listStack[R.listStack.length-1]||0,ne=R.indentation<V,se=V+3;if(R.fencedEndRE&&R.indentation<=se&&(ne||F.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(F,R,R.block):Se}else return R.localMode?R.localMode.token(F,R.localState):(F.skipToEnd(),H.code)}function v(F){var R=[];if(F.formatting){R.push(H.formatting),typeof F.formatting=="string"&&(F.formatting=[F.formatting]);for(var V=0;V<F.formatting.length;V++)R.push(H.formatting+"-"+F.formatting[V]),F.formatting[V]==="header"&&R.push(H.formatting+"-"+F.formatting[V]+"-"+F.header),F.formatting[V]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=F.quote?R.push(H.formatting+"-"+F.formatting[V]+"-"+F.quote):R.push("error"))}if(F.taskOpen)return R.push("meta"),R.length?R.join(" "):null;if(F.taskClosed)return R.push("property"),R.length?R.join(" "):null;if(F.linkHref?R.push(H.linkHref,"url"):(F.strong&&R.push(H.strong),F.em&&R.push(H.em),F.strikethrough&&R.push(H.strikethrough),F.emoji&&R.push(H.emoji),F.linkText&&R.push(H.linkText),F.code&&R.push(H.code),F.image&&R.push(H.image),F.imageAltText&&R.push(H.imageAltText,"link"),F.imageMarker&&R.push(H.imageMarker)),F.header&&R.push(H.header,H.header+"-"+F.header),F.quote&&(R.push(H.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=F.quote?R.push(H.quote+"-"+F.quote):R.push(H.quote+"-"+P.maxBlockquoteDepth)),F.list!==!1){var ne=(F.listStack.length-1)%3;ne?ne===1?R.push(H.list2):R.push(H.list3):R.push(H.list1)}return F.trailingSpaceNewLine?R.push("trailing-space-new-line"):F.trailingSpace&&R.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),R.length?R.join(" "):null}function E(F,R){return F.match(c,!0)?v(R):void 0}function m(F,R){var V=R.text(F,R);if(typeof V!="undefined")return V;if(R.list)return R.list=null,v(R);if(R.taskList){var ne=F.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&&F.match(/^#+$/,!0))return P.highlightFormatting&&(R.formatting="header"),v(R);var se=F.next();if(R.linkTitle){R.linkTitle=!1;var Se=se;se==="("&&(Se=")"),Se=(Se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Le="^\\s*(?:[^"+Se+"\\\\]+|\\\\\\\\|\\\\.)"+Se;if(F.match(new RegExp(Le),!0))return H.linkHref}if(se==="`"){var Ae=R.formatting;P.highlightFormatting&&(R.formatting="code"),F.eatWhile("`");var Pe=F.current().length;if(R.code==0&&(!R.quote||Pe==1))return R.code=Pe,v(R);if(Pe==R.code){var Fe=v(R);return R.code=0,Fe}else return R.formatting=Ae,v(R)}else if(R.code)return v(R);if(se==="\\"&&(F.next(),P.highlightFormatting)){var je=v(R),Te=H.formatting+"-escape";return je?je+" "+Te:Te}if(se==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return R.imageMarker=!0,R.image=!0,P.highlightFormatting&&(R.formatting="image"),v(R);if(se==="["&&R.imageMarker&&F.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 je=v(R);return R.imageAltText=!1,R.image=!1,R.inline=R.f=C,je}if(se==="["&&!R.image)return R.linkText&&F.match(/^.*?\]/)||(R.linkText=!0,P.highlightFormatting&&(R.formatting="link")),v(R);if(se==="]"&&R.linkText){P.highlightFormatting&&(R.formatting="link");var je=v(R);return R.linkText=!1,R.inline=R.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?C:m,je}if(se==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=f,P.highlightFormatting&&(R.formatting="link");var je=v(R);return je?je+=" ":je="",je+H.linkInline}if(se==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=f,P.highlightFormatting&&(R.formatting="link");var je=v(R);return je?je+=" ":je="",je+H.linkEmail}if(P.xml&&se==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Z=F.string.indexOf(">",F.pos);if(Z!=-1){var U=F.string.substring(F.start,Z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(U)&&(R.md_inside=!0)}return F.backUp(1),R.htmlState=q.startState(Y),s(F,R,A)}if(P.xml&&se==="<"&&F.match(/^\/\w*?>/))return R.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var G=1,ee=F.pos==1?" ":F.string.charAt(F.pos-2);G<3&&F.eat(se);)G++;var ue=F.peek()||" ",J=!/\s/.test(ue)&&(!i.test(ue)||/\s/.test(ee)||i.test(ee)),we=!/\s/.test(ee)&&(!i.test(ee)||/\s/.test(ue)||i.test(ue)),Ge=null,Je=null;if(G%2&&(!R.em&&J&&(se==="*"||!we||i.test(ee))?Ge=!0:R.em==se&&we&&(se==="*"||!J||i.test(ue))&&(Ge=!1)),G>1&&(!R.strong&&J&&(se==="*"||!we||i.test(ee))?Je=!0:R.strong==se&&we&&(se==="*"||!J||i.test(ue))&&(Je=!1)),Je!=null||Ge!=null){P.highlightFormatting&&(R.formatting=Ge==null?"strong":Je==null?"em":"strong em"),Ge===!0&&(R.em=se),Je===!0&&(R.strong=se);var Fe=v(R);return Ge===!1&&(R.em=!1),Je===!1&&(R.strong=!1),Fe}}else if(se===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return v(R);F.backUp(1)}if(P.strikethrough){if(se==="~"&&F.eatWhile(se)){if(R.strikethrough){P.highlightFormatting&&(R.formatting="strikethrough");var Fe=v(R);return R.strikethrough=!1,Fe}else if(F.match(/^[^\s]/,!1))return R.strikethrough=!0,P.highlightFormatting&&(R.formatting="strikethrough"),v(R)}else if(se===" "&&F.match(/^~~/,!0)){if(F.peek()===" ")return v(R);F.backUp(2)}}if(P.emoji&&se===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){R.emoji=!0,P.highlightFormatting&&(R.formatting="emoji");var be=v(R);return R.emoji=!1,be}return se===" "&&(F.match(/^ +$/,!1)?R.trailingSpace++:R.trailingSpace&&(R.trailingSpaceNewLine=!0)),v(R)}function f(F,R){var V=F.next();if(V===">"){R.f=R.inline=m,P.highlightFormatting&&(R.formatting="link");var ne=v(R);return ne?ne+=" ":ne="",ne+H.linkInline}return F.match(/^[^>]+/,!0),H.linkInline}function C(F,R){if(F.eatSpace())return null;var V=F.next();return V==="("||V==="["?(R.f=R.inline=y(V==="("?")":"]"),P.highlightFormatting&&(R.formatting="link-string"),R.linkHref=!0,v(R)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(F){return function(R,V){var ne=R.next();if(ne===F){V.f=V.inline=m,P.highlightFormatting&&(V.formatting="link-string");var se=v(V);return V.linkHref=!1,se}return R.match(b[F]),V.linkHref=!0,v(V)}}function M(F,R){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(R.f=W,F.next(),P.highlightFormatting&&(R.formatting="link"),R.linkText=!0,v(R)):r(F,R,m)}function W(F,R){if(F.match(/^\]:/,!0)){R.f=R.inline=L,P.highlightFormatting&&(R.formatting="link");var V=v(R);return R.linkText=!1,V}return F.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function L(F,R){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?R.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),R.f=R.inline=m,H.linkHref+" url")}var K={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:m,text:E,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&q.copyState(Y,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?q.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,R){if(R.formatting=!1,F!=R.thisLine.stream){if(R.header=0,R.hr=!1,F.match(/^\s*$/,!0))return x(R),null;if(R.prevLine=R.thisLine,R.thisLine={stream:F},R.taskList=!1,R.trailingSpace=0,R.trailingSpaceNewLine=!1,!R.localState&&(R.f=R.block,R.f!=A)){var V=F.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(R.indentation=V,R.indentationDiff=null,V>0)return null}}return R.f(F,R)},innerMode:function(F){return F.block==A?{state:F.htmlState,mode:Y}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:K}},indent:function(F,R,V){return F.block==A&&Y.indent?Y.indent(F.htmlState,R,V):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,R,V):q.Pass},blankLine:x,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return K},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},n6Qo:function(We,ge,D){"use strict";D.d(ge,"a",function(){return k});var q=D("q1tI"),z=D("biw7"),P=D("fyJ8");function Y(n){var I=n.className,g=n.index,p=n.children,h=n.colSpan,c=n.rowSpan,o=q.useContext(z.a),d=o.prefixCls,i=o.fixedInfoList,a=i[g];return q.createElement(P.a,Object.assign({className:I,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 q.createElement("tr",Object.assign({},n))}function O(n){var I=n.children,g=q.useContext(z.a),p=g.prefixCls;return q.createElement("tfoot",{className:"".concat(p,"-summary")},I)}var H=ge.b=O,k={Cell:Y,Row:N}},nCk5:function(We,ge,D){We.exports=D.p+"static/d.53bf6ae3.svg"},nEHx:function(We,ge,D){"use strict";D.d(ge,"a",function(){return q});var q;(function(z){z.DARK="dark",z.LIGHT="light",z.HIGH_CONTRAST="hc"})(q||(q={}))},nWbc:function(We,ge,D){},nnTU:function(We,ge,D){"use strict";D.d(ge,"b",function(){return H}),D.d(ge,"a",function(){return k});var q=D("MI8n"),z=D("JYp7"),P=D("pmY6"),Y=D("24hK"),N=D("746U"),O=D("Cg/j");const H=Object(O.c)("commandService"),k=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,I){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:n,handler:I})}if(n.description){const o=[];for(let i of n.description.args)o.push(i.constraint);const d=n.handler;n.handler=function(i,...a){return Object(N.o)(a,o),d(i,...a)}}const{id:g}=n;let p=this._commands.get(g);p||(p=new Y.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,I){return k.registerCommand(n,(g,...p)=>g.get(H).executeCommand(I,...p))}getCommand(n){const I=this._commands.get(n);return!I||I.isEmpty()?void 0:z.a.first(I)}getCommands(){const n=new Map;for(const I of this._commands.keys()){const g=this.getCommand(I);g&&n.set(I,g)}return n}};k.registerCommand("noop",()=>{})},oE5q:function(We,ge,D){We.exports=D.p+"static/t.0b94c5c3.svg"},oFv4:function(We,ge,D){We.exports=D.p+"static/internal.da228387.png"},osHv:function(We,ge,D){(function(q){q(D("VrN/"))})(function(q){"use strict";var z=q.Pos;function P(i,a){return i.line-a.line||i.ch-a.ch}var Y="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=Y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=new RegExp("<(/?)(["+Y+"]["+N+"]*)","g");function H(i,a,r,s){this.line=a,this.ch=r,this.cm=i,this.text=i.getLine(a),this.min=s?Math.max(s.from,i.firstLine()):i.firstLine(),this.max=s?Math.min(s.to-1,i.lastLine()):i.lastLine()}function k(i,a){var r=i.cm.getTokenTypeAt(z(i.line,a));return r&&/\btag\b/.test(r)}function n(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function I(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function g(i){for(;;){var a=i.text.indexOf(">",i.ch);if(a==-1){if(n(i))continue;return}if(!k(i,a+1)){i.ch=a+1;continue}var r=i.text.lastIndexOf("/",a),s=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,s?"selfClose":"regular"}}function p(i){for(;;){var a=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(a==-1){if(I(i))continue;return}if(!k(i,a+1)){i.ch=a;continue}O.lastIndex=a,i.ch=a;var r=O.exec(i.text);if(r&&r.index==a)return r}}function h(i){for(;;){O.lastIndex=i.ch;var a=O.exec(i.text);if(!a){if(n(i))continue;return}if(!k(i,a.index+1)){i.ch=a.index+1;continue}return i.ch=a.index+a[0].length,a}}function c(i){for(;;){var a=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(a==-1){if(I(i))continue;return}if(!k(i,a+1)){i.ch=a;continue}var r=i.text.lastIndexOf("/",a),s=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,s?"selfClose":"regular"}}function o(i,a){for(var r=[];;){var s=h(i),S,x=i.line,T=i.ch-(s?s[0].length:0);if(!s||!(S=g(i)))return;if(S=="selfClose")continue;if(s[1]){for(var A=r.length-1;A>=0;--A)if(r[A]==s[2]){r.length=A;break}if(A<0&&(!a||a==s[2]))return{tag:s[2],from:z(x,T),to:z(i.line,i.ch)}}else r.push(s[2])}}function d(i,a){for(var r=[];;){var s=c(i);if(!s)return;if(s=="selfClose"){p(i);continue}var S=i.line,x=i.ch,T=p(i);if(!T)return;if(T[1])r.push(T[2]);else{for(var A=r.length-1;A>=0;--A)if(r[A]==T[2]){r.length=A;break}if(A<0&&(!a||a==T[2]))return{tag:T[2],from:z(i.line,i.ch),to:z(S,x)}}}}q.registerHelper("fold","xml",function(i,a){for(var r=new H(i,a.line,0);;){var s=h(r);if(!s||r.line!=a.line)return;var S=g(r);if(!S)return;if(!s[1]&&S!="selfClose"){var x=z(r.line,r.ch),T=o(r,s[2]);return T&&P(T.from,x)>0?{from:x,to:T.from}:null}}}),q.findMatchingTag=function(i,a,r){var s=new H(i,a.line,a.ch,r);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 H(i,x.line,x.ch,r),{open:A,close:o(s,T[2]),at:"open"})},q.findEnclosingTag=function(i,a,r,s){for(var S=new H(i,a.line,a.ch,r);;){var x=d(S,s);if(!x)break;var T=new H(i,a.line,a.ch,r),A=o(T,x.tag);if(A)return{open:x,close:A}}},q.scanForClosingTag=function(i,a,r,s){var S=new H(i,a.line,a.ch,s?{from:0,to:s}:null);return o(S,r)}})},p5ED:function(We,ge,D){"use strict";var q=D("+L6B"),z=D("2/Rp"),P=D("5Dmo"),Y=D("3S7+"),N=D("k1fw"),O=D("9og8"),H=D("tJVT"),k=D("WmNS"),n=D.n(k),I=D("q1tI"),g=D.n(I),p=D("vHTk"),h=D.n(p),c=D("yEEn"),o=D("ZW9T"),d=D("1vsH"),i=D("V0Rq"),a=D("m3rI");ge.a=function(r){var s,S,x,T,A,w,v,E=r.editOffice,m=E===void 0?"view":E,f=r.data,C=r.theme,b=r.type,y=r.filename,M=r.monacoEditor,W=r.className,L=r.style,K=r.close,F=r.onClose,R=r.hasMask,V=r.disabledDownload,ne=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),se=Object(H.a)(ne,2),Se=se[0],Le=se[1],Ae=Object(I.useState)(""),Pe=Object(H.a)(Ae,2),Fe=Pe[0],je=Pe[1],Te=Object(I.useState)(),Z=Object(H.a)(Te,2),U=Z[0],G=Z[1],ee=window.ENV==="build"?"/react/build":"",ue=a.a.PROXY_SERVER||location.origin,J,we=1024*1024,Ge=10*we,Je=Object(I.useRef)();(s=f)!==null&&s!==void 0&&s.startsWith("/api")&&b!=="txt"&&(f=(a.a.API_SERVER||location.origin)+f),b==="office"&&(J=Object(d.T)(f).filesize,J>Ge&&(b="other")),y&&M&&(M.filename=y),Object(I.useEffect)(function(){var Ce,Be,Xe=(Ce=document.cookie)===null||Ce===void 0||((Be=Ce.replace(/\s/g,""))===null||Be===void 0)?void 0:Be.split(";");Xe==null||Xe.map(function(qe){var tt=qe.split("=");tt[0]==="_educoder_session"&&je(tt[1])})},[]),Object(I.useEffect)(function(){b==="office"&&be()},[b,f]);var be=function(){var Ce=Object(O.a)(n.a.mark(function Be(){var Xe,qe,tt;return n.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return console.log("data:",f),Xe=f,f.startsWith("http")||(Xe=location.origin+Xe),qe=new URL(Xe).pathname.split("/").pop(),ft.next=6,Object(i.V)({attachment_id:qe});case 6:tt=ft.sent,G(tt);case 8:case"end":return ft.stop()}},Be)}));return function(){return Ce.apply(this,arguments)}}(),Re=function(){if(f.startsWith("http")||f.startsWith("blob:")){xe();return}Object(d.z)(y||"educoder",f,y)},xe=function(){Object(d.x)(y||"educoder",decodeURIComponent(f))};return g.a.createElement("div",{style:Object(N.a)({},L||{}),className:"".concat(R&&h.a.bgBlack," ").concat(b?h.a.wrp:"hide")},K&&g.a.createElement("div",{className:h.a.close,ref:Je},!V&&g.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Je.current}},g.a.createElement("span",{onClick:xe},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Je.current}},g.a.createElement("span",{className:"",onClick:F},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(h.a[W]," ").concat(W," ").concat(h.a.monaco," ").concat(b==="txt"?"show":"hide")},b==="txt"&&g.a.createElement(o.b,M)),b==="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}),b==="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})),b==="office"&&U&&g.a.createElement("iframe",{src:"".concat(ee,"/office.html?key=").concat(U.key,"&url=").concat(ue+U.url,"&callbackUrl=").concat(ue+U.callbackUrl,"&fileType=").concat(U.fileType,"&title=").concat(U.title,"&model=").concat(m,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),b==="html"&&g.a.createElement("iframe",{src:f+"&disposition=inline"}),b==="pdf"&&g.a.createElement("iframe",{src:"".concat(ee,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!V)}),b==="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)}),b==="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")),b==="download"&&g.a.createElement(z.a,{type:"primary",size:"large",onClick:Re},g.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(We,ge,D){},pYxM:function(We,ge,D){We.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(We,ge,D){"use strict";D.d(ge,"h",function(){return I}),D.d(ge,"g",function(){return p}),D.d(ge,"f",function(){return h}),D.d(ge,"e",function(){return c}),D.d(ge,"i",function(){return o}),D.d(ge,"b",function(){return d}),D.d(ge,"a",function(){return i}),D.d(ge,"d",function(){return a}),D.d(ge,"c",function(){return r});var q=D("C/vA"),z=D("JYp7");const P=!1;let Y=null;function N(s){Y=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!==i.None)try{S[s]=!0}catch(T){}}markAsDisposed(S){if(S&&S!==i.None)try{S[s]=!0}catch(x){}}markAsSingleton(S){}})}function O(s){return Y==null||Y.trackDisposable(s),s}function H(s){Y==null||Y.markAsDisposed(s)}function k(s,S){Y==null||Y.setParent(s,S)}function n(s,S){if(!Y)return;for(const x of s)Y.setParent(x,S)}function I(s){return Y==null||Y.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=O({dispose:Object(q.a)(()=>{H(S),s()})});return S}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,O(this)}dispose(){if(this._isDisposed)return;H(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 k(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 i{constructor(){this._store=new d,O(this),k(this._store,this)}dispose(){H(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}i.None=Object.freeze({dispose(){}});class a{constructor(){this._isDisposed=!1,O(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&&k(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,H(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&&k(s,null),s}}class r{constructor(s){this.object=s}dispose(){}}},ps8w:function(We,ge,D){We.exports=D.p+"static/show.6268a056.svg"},psGv:function(We,ge,D){var q,z;(function(){var P;(function(){"use strict";var H=[,,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 i=this.__base_string_length;return d=d||0,o<0&&(i=0),i+=o*this.__indent_size,i+=d,i},h.prototype.get_indent_string=function(o,d){var i=this.__base_string;return d=d||0,o<0&&(o=0,i=""),d+=o*this.__indent_size,this.__ensure_cache(d),i+=this.__cache[d],i},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,i="";this.__indent_size&&o>=this.__indent_size&&(d=Math.floor(o/this.__indent_size),o-=d*this.__indent_size,i=new Array(d+1).join(this.__indent_string)),o&&(i+=new Array(o+1).join(" ")),this.__cache.push(i)};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 i=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(i=i.replace(/[\n]/g,o)),i},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 i=this.__lines.length-2;i>=0;){var a=this.__lines[i];if(a.is_empty())break;if(a.item(0).indexOf(o)!==0&&a.item(-1)!==d){this.__lines.splice(i+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},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 i=this.raw_options[o],a=d||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(a=i.concat()):typeof i=="string"&&(a=i.split(/[^a-zA-Z0-9_\/\-]+/)),a},p.prototype._get_boolean=function(o,d){var i=this.raw_options[o],a=i===void 0?!!d:!!i;return a},p.prototype._get_characters=function(o,d){var i=this.raw_options[o],a=d||"";return typeof i=="string"&&(a=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),a},p.prototype._get_number=function(o,d){var i=this.raw_options[o];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(i,10);return isNaN(a)&&(a=d),a},p.prototype._get_selection=function(o,d,i){var a=this._get_selection_list(o,d,i);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,i){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[d[0]],!this._is_valid_selection(i,d))throw new Error("Invalid Default Value!");var a=this._get_array(o,i);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(i){return d.indexOf(i)===-1})};function h(o,d){var i={};o=c(o);var a;for(a in o)a!==d&&(i[a]=o[a]);if(d&&o[d])for(a in o[d])i[a]=o[d][a];return i}function c(o){var d={},i;for(i in o){var a=i.replace(/-/g,"_");d[a]=o[i]}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 i="",a;return c&&(a=this.match(c),a&&(i+=a[0])),o&&(a||!c)&&(i+=this.readUntil(o,d)),i},h.prototype.readUntil=function(c,o){var d="",i=this.__position;c.lastIndex=this.__position;var a=c.exec(this.__input);return a?(i=a.index,o&&(i+=a[0].length)):i=this.__input_length,d=this.__input.substring(this.__position,i),this.__position=i,d},h.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},h.prototype.get_regexp=function(c,o){var d=null,i="g";return o&&p&&(i="y"),typeof c=="string"&&c!==""?d=new RegExp(c,i):c&&(d=new RegExp(c.source,i)),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,i=h(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(s,S){this._input=new c(s),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};r.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},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.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,"")},r.prototype._is_comment=function(s){return!1},r.prototype._is_opening=function(s){return!1},r.prototype._is_closing=function(s,S){return!1},r.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},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=r,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,i){c.call(this,d,i),i?this._line_regexp=this._input.get_regexp(i._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,i){d+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},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 i=this.__split(this._newline_regexp,d);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return d},o.prototype.matching=function(d,i){var a=this._create();return a.__set_whitespace_patterns(d,i),a._update(),a},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(d,i){d.lastIndex=0;for(var a=0,r=[],s=d.exec(i);s;)r.push(i.substring(a,s.index)),a=s.index+s[0].length,s=d.exec(i);return a<i.length?r.push(i.substring(a,i.length)):r.push(""),r},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(i,a){c.call(this,i,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 r=new c(i);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}/)}}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(i){var a=this._create();return a._disabled[i]=!0,a._update(),a},d.prototype.read_options=function(i){var a=this._create();for(var r in o)a._disabled[r]=i.templating.indexOf(r)===-1;return a._update(),a},d.prototype.exclude=function(i){var a=this._create();return a._excluded[i]=!0,a._update(),a},d.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=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),i+=a,a=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},d.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},d.prototype._read_template=function(){var i="",a=this._input.peek();if(a==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(i=i||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},g.exports.TemplatablePattern=d},,,,function(g,p,h){var c=h(19).Beautifier,o=h(20).Options;function d(i,a,r,s){var S=new c(i,a,r,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,i=h(21).TOKEN,a=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,s=function(C,b){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new o(C,b)};s.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},s.prototype.set_space_before_token=function(C,b){this._output.space_before_token=C,this._output.non_breaking_space=b},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(C){this._output.add_raw_token(C)},s.prototype.print_preserved_newlines=function(C){var b=0;C.type!==i.TEXT&&C.previous.type!==i.TEXT&&(b=C.newlines?1:0),this.preserve_newlines&&(b=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var y=0;y<b;y++)this.print_newline(y>0);return b!==0},s.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(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(C){this._output.add_new_line(C)},s.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var S=function(C){for(var b=null,y=C.next;y.type!==i.EOF&&C.closed!==y;){if(y.type===i.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===i.EQUALS&&y.next.next&&y.next.next.type===i.VALUE&&(b=y.next.next.text);break}y=y.next}return b},x=function(C,b){var y=null,M=null;return b.closed?(C==="script"?y="text/javascript":C==="style"&&(y="text/css"),y=S(b)||y,y.search("text/css")>-1?M="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?M="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?M="html":y.search(/test\/null/)>-1&&(M="null"),M):null};function T(C,b){return b.indexOf(C)!==-1}function A(C,b,y){this.parent=C||null,this.tag=b?b.tag_name:"",this.indent_level=y||0,this.parser_token=b||null}function w(C){this._printer=C,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(C){var b=new A(this._current_frame,C,this._printer.indent_level);this._current_frame=b},w.prototype._try_pop_frame=function(C){var b=null;return C&&(b=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),b},w.prototype._get_frame=function(C,b){for(var y=this._current_frame;y&&!(C.indexOf(y.tag)!==-1);){if(b&&b.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},w.prototype.try_pop=function(C,b){var y=this._get_frame([C],b);return this._try_pop_frame(y)},w.prototype.indent_to_tag=function(C){var b=this._get_frame(C);b&&(this._printer.indent_level=b.indent_level)};function v(C,b,y,M){this._source_text=C||"",b=b||{},this._js_beautify=y,this._css_beautify=M,this._tag_stack=null;var W=new c(b,"html");this._options=W,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,b=this._options.eol;this._options.eol==="auto"&&(b=`
|
|
`,C&&a.test(C)&&(b=C.match(a)[0])),C=C.replace(r,`
|
|
`);var y=C.match(/^[\t ]*/)[0],M={text:"",type:""},W=new E,L=new s(this._options,y),K=new d(C,this._options).tokenize();this._tag_stack=new w(L);for(var F=null,R=K.next();R.type!==i.EOF;)R.type===i.TAG_OPEN||R.type===i.COMMENT?(F=this._handle_tag_open(L,R,W,M),W=F):R.type===i.ATTRIBUTE||R.type===i.EQUALS||R.type===i.VALUE||R.type===i.TEXT&&!W.tag_complete?F=this._handle_inside_tag(L,R,W,K):R.type===i.TAG_CLOSE?F=this._handle_tag_close(L,R,W):R.type===i.TEXT?F=this._handle_text(L,R,W):L.add_raw_token(R),M=F,R=K.next();var V=L._output.get_code(b);return V},v.prototype._handle_tag_close=function(C,b,y){var M={text:b.text,type:b.type};return C.alignment_size=0,y.tag_complete=!0,C.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted?C.add_raw_token(b):(y.tag_start_char==="<"&&(C.set_space_before_token(b.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(b)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(C.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&C.set_wrap_point(),M},v.prototype._handle_inside_tag=function(C,b,y,M){var W=y.has_wrapped_attrs,L={text:b.text,type:b.type};if(C.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted)C.add_raw_token(b);else if(y.tag_start_char==="{"&&b.type===i.TEXT)C.print_preserved_newlines(b)?(b.newlines=0,C.add_raw_token(b)):C.print_token(b);else{if(b.type===i.ATTRIBUTE?(C.set_space_before_token(!0),y.attr_count+=1):(b.type===i.EQUALS||b.type===i.VALUE&&b.previous.type===i.EQUALS)&&C.set_space_before_token(!1),b.type===i.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(b),W=W||b.newlines!==0),this._is_wrap_attributes_force)){var K=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var F=!0,R=0,V;do{if(V=M.peek(R),V.type===i.ATTRIBUTE){F=!1;break}R+=1}while(R<4&&V.type!==i.EOF&&V.type!==i.TAG_CLOSE);K=!F}K&&(C.print_newline(!1),W=!0)}C.print_token(b),W=W||C.previous_token_wrapped(),y.has_wrapped_attrs=W}return L},v.prototype._handle_text=function(C,b,y){var M={text:b.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(C,b,y):y.is_unformatted||y.is_content_unformatted?C.add_raw_token(b):(C.traverse_whitespace(b),C.print_token(b)),M},v.prototype._print_custom_beatifier_text=function(C,b,y){var M=this;if(b.text!==""){var W=b.text,L,K=1,F="",R="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?L=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?L=this._css_beautify:y.custom_beautifier_name==="html"&&(L=function(Ae,Pe){var Fe=new v(Ae,Pe,M._js_beautify,M._css_beautify);return Fe.beautify()}),this._options.indent_scripts==="keep"?K=0:this._options.indent_scripts==="separate"&&(K=-C.indent_level);var V=C.get_full_indent(K);if(W=W.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(<!--|<!\[CDATA\[)/)){var ne=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(W);if(!ne){C.add_raw_token(b);return}F=V+ne[1]+`
|
|
`,W=ne[4],ne[5]&&(R=V+ne[5]),W=W.replace(/\n[ \t]*$/,""),(ne[2]||ne[3].indexOf(`
|
|
`)!==-1)&&(ne=ne[3].match(/[ \t]+$/),ne&&(b.whitespace_before=ne[0]))}if(W)if(L){var se=function(){this.eol=`
|
|
`};se.prototype=this._options.raw_options;var Se=new se;W=L(V+W,Se)}else{var Le=b.whitespace_before;Le&&(W=W.replace(new RegExp(`
|
|
(`+Le+")?","g"),`
|
|
`)),W=V+W.replace(/\n/g,`
|
|
`+V)}F&&(W?W=F+W+`
|
|
`+R:W=F+R),C.print_newline(!1),W&&(b.text=W,b.whitespace_before="",b.newlines=0,C.add_raw_token(b),C.print_newline(!0))}},v.prototype._handle_tag_open=function(C,b,y,M){var W=this._get_tag_open_token(b);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&b.type===i.TAG_OPEN&&b.text.indexOf("</")===0?(C.add_raw_token(b),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(C.traverse_whitespace(b),this._set_tag_position(C,b,W,y,M),W.is_inline_element||C.set_wrap_point(),C.print_token(b)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=b.text.length+1),!W.tag_complete&&!W.is_unformatted&&(C.alignment_size=W.alignment_size),W};var E=function(C,b){if(this.parent=C||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!b)this.tag_complete=!0;else{var y;this.tag_start_char=b.text[0],this.text=b.text,this.tag_start_char==="<"?(y=b.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=b.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(b.text.startsWith("{{#>")||b.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&b.next!==null?this.tag_check=b.next.text.split(" ")[0]:this.tag_check=b.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),b.type===i.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||b.closed&&b.closed.text==="/>";var M=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(M=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(M)))}};v.prototype._get_tag_open_token=function(C){var b=new E(this._tag_stack.get_parser_token(),C);return b.alignment_size=this._options.wrap_attributes_indent_size,b.is_end_tag=b.is_end_tag||T(b.tag_check,this._options.void_elements),b.is_empty_element=b.tag_complete||b.is_start_tag&&b.is_end_tag,b.is_unformatted=!b.tag_complete&&T(b.tag_check,this._options.unformatted),b.is_content_unformatted=!b.is_empty_element&&T(b.tag_check,this._options.content_unformatted),b.is_inline_element=T(b.tag_name,this._options.inline)||b.tag_name.includes("-")||b.tag_start_char==="{",b},v.prototype._set_tag_position=function(C,b,y,M,W){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=x(y.tag_check,b)))),T(y.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var L=C.current_line_has_match(/{{#if/);L||C.print_newline(!1)}y.tag_name==="!--"&&W.type===i.TAG_CLOSE&&M.is_end_tag&&y.text.indexOf(`
|
|
`)===-1||(y.is_inline_element||y.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,y))}else if(y.is_end_tag){var K=!1;K=y.start_tag_token&&y.start_tag_token.multiline_content,K=K||!y.is_inline_element&&!(M.is_inline_element||M.is_unformatted)&&!(W.type===i.TAG_CLOSE&&y.start_tag_token===M)&&W.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(K=!1),K&&C.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(W.type!=="TK_CONTENT"||y.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,y)},v.prototype._calcluate_parent_multiline=function(C,b){b.parent&&C._output.just_added_newline()&&!((b.is_inline_element||b.is_unformatted)&&b.parent.is_inline_element)&&(b.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(C){var b=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")b=b||this._tag_stack.try_pop("head");else if(C.tag_name==="li")b=b||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")b=b||this._tag_stack.try_pop("dt",["dl"]),b=b||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&m.indexOf(C.tag_name)!==-1){var y=C.parent.parent;(!y||f.indexOf(y.tag_name)===-1)&&(b=b||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(b=b||this._tag_stack.try_pop("rt",["ruby","rtc"]),b=b||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?b=b||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?b=b||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?b=b||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("thead",["table"]),b=b||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(b=b||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),b=b||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),b},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,i=h(14).TemplatablePattern,a=h(12).Pattern,r={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 i(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===r.TAG_OPEN},S.prototype._is_closing=function(x,T){return x.type===r.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(r.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(r.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(r.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(r.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(r.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(r.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),w=this._create_token(r.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(r.TAG_CLOSE,A)):T.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),w=this._create_token(r.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(r.EQUALS,this._input.next());else if(x==='"'||x==="'"){var E=this._input.next();x==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),w=this._create_token(r.VALUE,E)}else v=this.__patterns.attribute.read(),v&&(T.type===r.EQUALS?w=this._create_token(r.VALUE,v):w=this._create_token(r.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===r.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var v=T.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var E=this._read_comment_or_cdata(x);if(E)return E.type=r.TEXT,E;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(r.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(r.TEXT,T)},g.exports.Tokenizer=S,g.exports.TOKEN=r}],k={};function n(g){var p=k[g];if(p!==void 0)return p.exports;var h=k[g]={exports:{}};return H[g](h,h.exports,n),h.exports}var I=n(18);P=I})();var Y=P;if(!0)!(q=[D,D("6UM0"),D("TXwP")],z=function(H){var k=D("6UM0"),n=D("TXwP");return{html_beautify:function(I,g){return Y(I,g,k.js_beautify,n.css_beautify)}}}.apply(ge,q),z!==void 0&&(We.exports=z));else var N,O})()},"rAM+":function(We,ge,D){"use strict";D.d(ge,"a",function(){return z});var q=D("Qw5x");function z(P,Y){var N;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(N=Object(q.a)(P))||Y&&P&&typeof P.length=="number"){N&&(P=N);var O=0,H=function(){};return{s:H,n:function(){return O>=P.length?{done:!0}:{done:!1,value:P[O++]}},e:function(p){throw p},f:H}}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 k=!0,n=!1,I;return{s:function(){N=P[Symbol.iterator]()},n:function(){var p=N.next();return k=p.done,p},e:function(p){n=!0,I=p},f:function(){try{!k&&N.return!=null&&N.return()}finally{if(n)throw I}}}}},rHrb:function(We,ge,D){"use strict";Object.defineProperty(ge,"__esModule",{value:!0}),ge.CopyToClipboard=void 0;var q=P(D("q1tI")),z=P(D("+QRC"));function P(r){return r&&r.__esModule?r:{default:r}}function Y(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Y=function(S){return typeof S}:Y=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},Y(r)}function N(r,s){var S=Object.keys(r);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(r);s&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(r,T).enumerable})),S.push.apply(S,x)}return S}function O(r){for(var s=1;s<arguments.length;s++){var S=arguments[s]!=null?arguments[s]:{};s%2?N(S,!0).forEach(function(x){i(r,x,S[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(S)):N(S).forEach(function(x){Object.defineProperty(r,x,Object.getOwnPropertyDescriptor(S,x))})}return r}function H(r,s){if(r==null)return{};var S=k(r,s),x,T;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(r);for(T=0;T<A.length;T++){if(x=A[T],s.indexOf(x)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(r,x))continue;S[x]=r[x]}}return S}function k(r,s){if(r==null)return{};var S={},x=Object.keys(r),T,A;for(A=0;A<x.length;A++){if(T=x[A],s.indexOf(T)>=0)continue;S[T]=r[T]}return S}function n(r,s){if(!(r instanceof s))throw new TypeError("Cannot call a class as a function")}function I(r,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(r,x.key,x)}}function g(r,s,S){return s&&I(r.prototype,s),S&&I(r,S),r}function p(r,s){return s&&(Y(s)==="object"||typeof s=="function")?s:c(r)}function h(r){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},h(r)}function c(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function o(r,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(s&&s.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),s&&d(r,s)}function d(r,s){return d=Object.setPrototypeOf||function(x,T){return x.__proto__=T,x},d(r,s)}function i(r,s,S){return s in r?Object.defineProperty(r,s,{value:S,enumerable:!0,configurable:!0,writable:!0}):r[s]=S,r}var a=function(r){o(s,r);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))),i(c(x),"onClick",function(v){var E=x.props,m=E.text,f=E.onCopy,C=E.children,b=E.options,y=q.default.Children.only(C),M=(0,z.default)(m,b);f&&f(m,M),y&&y.props&&typeof y.props.onClick=="function"&&y.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,E=H(x,["text","onCopy","options","children"]),m=q.default.Children.only(v);return q.default.cloneElement(m,O({},E,{onClick:this.onClick}))}}]),s}(q.default.PureComponent);ge.CopyToClipboard=a,i(a,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(We,ge){const D=/[&<>"']/,q=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&","<":"<",">":">",'"':""","'":"'"},N=w=>Y[w];function O(w,v){if(v){if(D.test(w))return w.replace(q,N)}else if(z.test(w))return w.replace(P,N);return w}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function k(w){return w.replace(H,(v,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const n=/(^|[^\[])\^/g;function I(w,v){w=w.source||w,v=v||"";const E={replace:(m,f)=>(f=f.source||f,f=f.replace(n,"$1"),w=w.replace(m,f),E),getRegex:()=>new RegExp(w,v)};return E}const g=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(w,v,E){if(w){let m;try{m=decodeURIComponent(k(E)).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(E)&&(E=a(v,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(m){return null}return E}const c={},o=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(w,v){c[" "+w]||(o.test(w)?c[" "+w]=w+"/":c[" "+w]=x(w,"/",!0)),w=c[" "+w];const E=w.indexOf(":")===-1;return v.substring(0,2)==="//"?E?v:w.replace(d,"$1")+v:v.charAt(0)==="/"?E?v:w.replace(i,"$1")+v:w+v}const r={exec:function(){}};function s(w){let v=1,E,m;for(;v<arguments.length;v++){E=arguments[v];for(m in E)Object.prototype.hasOwnProperty.call(E,m)&&(w[m]=E[m])}return w}function S(w,v){const E=w.replace(/\|/g,(C,b,y)=>{let M=!1,W=b;for(;--W>=0&&y[W]==="\\";)M=!M;return M?"|":" |"}),m=E.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,E){const m=w.length;if(m===0)return"";let f=0;for(;f<m;){const C=w.charAt(m-f-1);if(C===v&&!E)f++;else if(C!==v&&E)f++;else break}return w.substr(0,m-f)}function T(w,v){if(w.indexOf(v[1])===-1)return-1;const E=w.length;let m=0,f=0;for(;f<E;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")}We.exports={escape:O,unescape:k,edit:I,cleanUrl:h,resolveUrl:a,noopTest:r,merge:s,splitCells:S,rtrim:x,findClosingBracket:T,checkSanitizeDeprecation:A}},rdUC:function(We,ge,D){var q=D("MFOe"),z=q.Global;We.exports={name:"localStorage",read:Y,write:N,each:O,remove:H,clearAll:k};function P(){return z.localStorage}function Y(n){return P().getItem(n)}function N(n,I){return P().setItem(n,I)}function O(n){for(var I=P().length-1;I>=0;I--){var g=P().key(I);n(Y(g),g)}}function H(n){return P().removeItem(n)}function k(){return P().clear()}},"s8/Y":function(We,ge,D){We.exports=D.p+"static/jx.6713fc81.svg"},"sB/4":function(We,ge,D){We.exports=D.p+"static/b.7405990c.svg"},sNtx:function(We,ge,D){},sR1s:function(We,ge,D){"use strict";D.d(ge,"b",function(){return Y}),D.d(ge,"a",function(){return N}),D.d(ge,"c",function(){return O}),D.d(ge,"d",function(){return H});var q=D("U8pU"),z="RC_TABLE_KEY";function P(k){return k==null?[]:Array.isArray(k)?k:[k]}function Y(k,n){if(!n&&typeof n!="number")return k;for(var I=P(n),g=k,p=0;p<I.length;p+=1){if(!g)return null;var h=I[p];g=g[h]}return g}function N(k){var n=[],I={};return k.forEach(function(g){for(var p=g||{},h=p.key,c=p.dataIndex,o=h||P(c).join("-")||z;I[o];)o="".concat(o,"_next");I[o]=!0,n.push(o)}),n}function O(){var k={};function n(h,c){c&&Object.keys(c).forEach(function(o){var d=c[o];d&&Object(q.a)(d)==="object"?(h[o]=h[o]||{},n(h[o],d)):h[o]=d})}for(var I=arguments.length,g=new Array(I),p=0;p<I;p++)g[p]=arguments[p];return g.forEach(function(h){n(k,h)}),k}function H(k){return k!=null}},sboe:function(We,ge,D){"use strict";D.d(ge,"a",function(){return P});var q=D("q1tI"),z=D.n(q),P=q.createContext(null)},"t/PP":function(We,ge,D){We.exports=D.p+"static/title.dd3b799f.svg"},t23M:function(We,ge,D){"use strict";var q=D("VTBJ"),z=D("1OyB"),P=D("vuIU"),Y=D("Ji7U"),N=D("LK+K"),O=D("q1tI"),H=D.n(O),k=D("m+aA"),n=D("Zm9Q"),I=D("Kwbf"),g=D("c+Xe"),p=D("bdgK"),h="rc-observer-key",c=function(o){Object(Y.a)(i,o);var d=Object(N.a)(i);function i(){var a;return Object(z.a)(this,i),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(r){var s=a.props.onResize,S=r[0].target,x=S.getBoundingClientRect(),T=x.width,A=x.height,w=S.offsetWidth,v=S.offsetHeight,E=Math.floor(T),m=Math.floor(A);if(a.state.width!==E||a.state.height!==m||a.state.offsetWidth!==w||a.state.offsetHeight!==v){var f={width:E,height:m,offsetWidth:w,offsetHeight:v};a.setState(f),s&&Promise.resolve().then(function(){s(Object(q.a)(Object(q.a)({},f),{},{offsetWidth:w,offsetHeight:v}))})}},a.setChildNode=function(r){a.childNode=r},a}return Object(P.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var r=this.props.disabled;if(r){this.destroyObserver();return}var s=Object(k.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 r=this.props.children,s=Object(n.a)(r);if(s.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=s[0];if(O.isValidElement(S)&&Object(g.c)(S)){var x=S.ref;s[0]=O.cloneElement(S,{ref:Object(g.a)(x,this.setChildNode)})}return s.length===1?s[0]:s.map(function(T,A){return!O.isValidElement(T)||"key"in T&&T.key!==null?T:O.cloneElement(T,{key:"".concat(h,"-").concat(A)})})}}]),i}(O.Component);c.displayName="ResizeObserver",ge.a=c},t9D7:function(We,ge,D){"use strict";D.d(ge,"b",function(){return H}),D.d(ge,"g",function(){return n}),D.d(ge,"d",function(){return I}),D.d(ge,"e",function(){return g}),D.d(ge,"a",function(){return p}),D.d(ge,"f",function(){return o}),D.d(ge,"c",function(){return d});var q=D("Vhoy"),z=D("MI8n"),P=D("pmY6"),Y=D("Cg/j"),N=D("ic2d"),O=D("nEHx");const H=Object(Y.c)("themeService");var k;(function(i){function a(r){return r&&typeof r=="object"&&typeof r.id=="string"}i.isThemeColor=a})(k||(k={}));function n(i){return{id:i}}var I;(function(i){function a(A){return A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color=="undefined"||k.isThemeColor(A.color))}i.isThemeIcon=a;const r=new RegExp(`^\\$\\((${q.a.iconNameExpression}(?:${q.a.iconModifierExpression})?)\\)$`);function s(A){const w=r.exec(A);if(!w)return;let[,v]=w;return{id:v}}i.fromString=s;function S(A,w){let v=A.id;const E=v.lastIndexOf("~");return E!==-1&&(v=v.substring(0,E)),w&&(v=`${v}~${w}`),{id:v}}i.modify=S;function x(A,w){var v,E;return A.id===w.id&&((v=A.color)===null||v===void 0?void 0:v.id)===((E=w.color)===null||E===void 0?void 0:E.id)}i.isEqual=x;function T(A,w){return{id:A.id,color:w?n(w):void 0}}i.asThemeIcon=T,i.asClassNameArray=q.a.asClassNameArray,i.asClassName=q.a.asClassName,i.asCSSSelector=q.a.asCSSSelector})(I||(I={}));function g(i){switch(i){case O.a.DARK:return"vs-dark";case O.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(i){return this.themingParticipants.push(i),this.onThemingParticipantAddedEmitter.fire(i),Object(P.i)(()=>{const a=this.themingParticipants.indexOf(i);this.themingParticipants.splice(a,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new h;N.a.add(p.ThemingContribution,c);function o(i){return c.onColorThemeChange(i)}class d extends P.a{constructor(i){super();this.themeService=i,this.theme=i.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(a=>this.onThemeChange(a)))}onThemeChange(i){this.theme=i,this.updateStyles()}updateStyles(){}}},twBr:function(We,ge,D){We.exports=D.p+"static/s.1f286590.svg"},uMZB:function(We,ge,D){We.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(We,ge,D){We.exports=q;function q(){return D("gaXo"),{}}},ulZh:function(We,ge,D){typeof window!="undefined"&&function(z,P){We.exports=P()}(this,function(){return function(q){var z={};function P(Y){if(z[Y])return z[Y].exports;var N=z[Y]={i:Y,l:!1,exports:{}};return q[Y].call(N.exports,N,N.exports,P),N.l=!0,N.exports}return P.m=q,P.c=z,P.d=function(Y,N,O){P.o(Y,N)||Object.defineProperty(Y,N,{enumerable:!0,get:O})},P.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},P.t=function(Y,N){if(N&1&&(Y=P(Y)),N&8)return Y;if(N&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var O=Object.create(null);if(P.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:Y}),N&2&&typeof Y!="string")for(var H in Y)P.d(O,H,function(k){return Y[k]}.bind(null,H));return O},P.n=function(Y){var N=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return P.d(N,"a",N),N},P.o=function(Y,N){return Object.prototype.hasOwnProperty.call(Y,N)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,z,P){"use strict";var Y=Object.prototype.hasOwnProperty,N="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(N=!1));function H(g,p,h){this.fn=g,this.context=p,this.once=h||!1}function k(g,p,h,c,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new H(h,c||g,o),i=N?N+p:p;return g._events[i]?g._events[i].fn?g._events[i]=[g._events[i],d]:g._events[i].push(d):(g._events[i]=d,g._eventsCount++),g}function n(g,p){--g._eventsCount===0?g._events=new O:delete g._events[p]}function I(){this._events=new O,this._eventsCount=0}I.prototype.eventNames=function(){var p=[],h,c;if(this._eventsCount===0)return p;for(c in h=this._events)Y.call(h,c)&&p.push(N?c.slice(1):c);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(h)):p},I.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,i=new Array(d);o<d;o++)i[o]=c[o].fn;return i},I.prototype.listenerCount=function(p){var h=N?N+p:p,c=this._events[h];return c?c.fn?1:c.length:0},I.prototype.emit=function(p,h,c,o,d,i){var a=N?N+p:p;if(!this._events[a])return!1;var r=this._events[a],s=arguments.length,S,x;if(r.fn){r.once&&this.removeListener(p,r.fn,void 0,!0);switch(s){case 1:return r.fn.call(r.context),!0;case 2:return r.fn.call(r.context,h),!0;case 3:return r.fn.call(r.context,h,c),!0;case 4:return r.fn.call(r.context,h,c,o),!0;case 5:return r.fn.call(r.context,h,c,o,d),!0;case 6:return r.fn.call(r.context,h,c,o,d,i),!0}for(x=1,S=new Array(s-1);x<s;x++)S[x-1]=arguments[x];r.fn.apply(r.context,S)}else{var T=r.length,A;for(x=0;x<T;x++){r[x].once&&this.removeListener(p,r[x].fn,void 0,!0);switch(s){case 1:r[x].fn.call(r[x].context);break;case 2:r[x].fn.call(r[x].context,h);break;case 3:r[x].fn.call(r[x].context,h,c);break;case 4:r[x].fn.call(r[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];r[x].fn.apply(r[x].context,S)}}}return!0},I.prototype.on=function(p,h,c){return k(this,p,h,c,!1)},I.prototype.once=function(p,h,c){return k(this,p,h,c,!0)},I.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 i=this._events[d];if(i.fn)i.fn===h&&(!o||i.once)&&(!c||i.context===c)&&n(this,d);else{for(var a=0,r=[],s=i.length;a<s;a++)(i[a].fn!==h||o&&!i[a].once||c&&i[a].context!==c)&&r.push(i[a]);r.length?this._events[d]=r.length===1?r[0]:r:n(this,d)}return this},I.prototype.removeAllListeners=function(p){var h;return p?(h=N?N+p:p,this._events[h]&&n(this,h)):(this._events=new O,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=N,I.EventEmitter=I,q.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,z,P){(function(Y){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,k=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(I,g,p){if(p=p||{},I=I.trim(),g=g.trim(),!g){if(!p.alwaysNormalize)return I;var h=n.parseURL(I);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(I);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var d=O.exec(o.path);o.netLoc=d[1],o.path=d[2]}o.netLoc&&!o.path&&(o.path="/");var i={scheme:o.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(i.netLoc=o.netLoc,c.path[0]!=="/"))if(!c.path)i.path=o.path,c.params||(i.params=o.params,c.query||(i.query=o.query));else{var a=o.path,r=a.substring(0,a.lastIndexOf("/")+1)+c.path;i.path=n.normalizePath(r)}return i.path===null&&(i.path=p.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(i)},parseURL:function(I){var g=N.exec(I);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(H,"");I.length!==(I=I.replace(k,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};q.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(q,z,P){function Y(p){var h={};function c(d){if(h[d])return h[d].exports;var i=h[d]={i:d,l:!1,exports:{}};return p[d].call(i.exports,i,i.exports,c),i.l=!0,i.exports}c.m=p,c.c=h,c.i=function(d){return d},c.d=function(d,i,a){c.o(d,i)||Object.defineProperty(d,i,{configurable:!1,enumerable:!0,get:a})},c.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},c.n=function(d){var i=d&&d.__esModule?function(){return d.default}:function(){return d};return c.d(i,"a",i),i},c.o=function(d,i){return Object.prototype.hasOwnProperty.call(d,i)},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|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function H(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function k(p){return!isNaN(1*p)}function n(p,h,c){var o={};o[c]=[];var d=h.toString(),i=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return o;for(var a=i[1],r=new RegExp("(\\\\n|\\W)"+H(a)+O,"g"),s;s=r.exec(d);){if(s[3]==="dll-reference")continue;o[c].push(s[3])}for(r=new RegExp("\\("+H(a)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+O,"g");s=r.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++)k(o[S[x]][T])&&(o[S[x]][T]=1*o[S[x]][T]);return o}function I(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:{}};I(c);)for(var i=Object.keys(c),a=0;a<i.length;a++){var r=i[a],s=c[r],S=s.pop();if(d[r]=d[r]||{},d[r][S]||!p[r][S])continue;d[r][S]=!0,o[r]=o[r]||[],o[r].push(S);for(var x=n(p,p[r][S],r),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}q.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+" = ("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+o[S].map(function(T){return""+JSON.stringify(T)+": "+c[S][T].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+o.main.map(function(S){return""+JSON.stringify(S)+": "+c.main[S].toString()}).join(",")+"}))(self);";var i=new window.Blob([d],{type:"text/javascript"});if(h.bare)return i;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,r=a.createObjectURL(i),s=new window.Worker(r);return s.objectURL=r,s}},"./src/config.ts":function(q,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 E});var Y=P("./src/controller/abr-controller.ts"),N=P("./src/controller/audio-stream-controller.ts"),O=P("./src/controller/audio-track-controller.ts"),H=P("./src/controller/subtitle-stream-controller.ts"),k=P("./src/controller/subtitle-track-controller.ts"),n=P("./src/controller/buffer-controller.ts"),I=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"),i=P("./src/utils/cues.ts"),a=P("./src/utils/mediakeys-helper.ts"),r=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(m){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var b in C)Object.prototype.hasOwnProperty.call(C,b)&&(m[b]=C[b])}return m},s.apply(this,arguments)}function S(m,f){var C=Object.keys(m);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(m);f&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(m,y).enumerable})),C.push.apply(C,b)}return C}function x(m){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?S(Object(C),!0).forEach(function(b){T(m,b,C[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(C)):S(Object(C)).forEach(function(b){Object.defineProperty(m,b,Object.getOwnPropertyDescriptor(C,b))})}return m}function T(m,f,C){return f in m?Object.defineProperty(m,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):m[f]=C,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:Y.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:H.SubtitleStreamController,subtitleTrackController:k.default,timelineController:I.TimelineController,audioStreamController:N.default,audioTrackController:O.default,emeController:h.default,cmcdController:c.default});function w(){return{cueHandler:i.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 E(m){var f=m.loader;if(f!==d.default&&f!==o.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),m.progressive=!1;else{var C=Object(d.fetchSupported)();C&&(m.loader=d.default,m.progressive=!0,m.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/polyfills/number.ts"),N=P("./src/utils/ewma-bandwidth-estimator.ts"),O=P("./src/events.ts"),H=P("./src/utils/buffer-helper.ts"),k=P("./src/errors.ts"),n=P("./src/types/loader.ts"),I=P("./src/utils/logger.ts");function g(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}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 i=d.config;this.bwEstimator=new N.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var o=c.prototype;return o.registerListeners=function(){var i=this.hls;i.on(O.Events.FRAG_LOADING,this.onFragLoading,this),i.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(O.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var i=this.hls;i.off(O.Events.FRAG_LOADING,this.onFragLoading,this),i.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(O.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(i,a){var r=a.frag;if(r.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=r,this.partCurrent=(s=a.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(i,a){var r=this.hls.config;a.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,s=r.autoLevelEnabled,S=r.config,x=r.media;if(!i||!x)return;var T=a?a.stats:i.stats,A=a?a.duration:i.duration;if(T.aborted){I.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 E=r.levels,m=r.minAutoLevel,f=E[i.level],C=T.total||Math.max(T.loaded,Math.round(A*f.maxBitrate/8)),b=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/w),y=(C-T.loaded)/b,M=x.currentTime,W=(H.BufferHelper.bufferInfo(x,M,S.maxBufferHole).end-M)/v;if(W>=2*A/v||y<=W)return;var L=Number.POSITIVE_INFINITY,K;for(K=i.level-1;K>m;K--){var F=E[K].maxBitrate;if(L=A*F/(8*.8*b),L<W)break}if(L>=y)return;var R=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+i.sn+(a?" part "+a.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+K+`
|
|
Current BW estimate: `+(Object(Y.isFiniteNumber)(R)?(R/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+y.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+L.toFixed(3)+` s
|
|
Time to underbuffer: `+W.toFixed(3)+" s"),r.nextLoadLevel=K,this.bwEstimator.sample(w,T.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),r.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:a,stats:T})},o.onFragLoaded=function(i,a){var r=a.frag,s=a.part;if(r.type===n.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(r.sn)){var S=s?s.stats:r.stats,x=s?s.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[r.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(r.bitrateTest){var v={stats:S,frag:r,part:s,id:r.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,v),r.bitrateTest=!1}}},o.onFragBuffered=function(i,a){var r=a.frag,s=a.part,S=s?s.stats:r.stats;if(S.aborted)return;if(r.type!==n.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var x=S.parsing.end-S.loading.start;this.bwEstimator.sample(x,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},o.onError=function(i,a){switch(a.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,s=r.maxAutoLevel,S=r.config,x=r.minAutoLevel,T=r.media,A=a?a.duration:i?i.duration:0,w=T?T.currentTime:0,v=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,m=(H.BufferHelper.bufferInfo(T,w,S.maxBufferHole).end-w)/v,f=this.findBestLevel(E,x,s,m,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(f>=0)return f;I.logger.trace((m?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=A?Math.min(A,S.maxStarvationDelay):S.maxStarvationDelay,b=S.abrBandWidthFactor,y=S.abrBandWidthUpFactor;if(!m){var M=this.bitrateTestDelay;if(M){var W=A?Math.min(A,S.maxLoadingDelay):S.maxLoadingDelay;C=W-M,I.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),b=y=1}}return f=this.findBestLevel(E,x,s,m+C,b,y),Math.max(f,0)},o.findBestLevel=function(i,a,r,s,S,x){for(var T,A=this.fragCurrent,w=this.partCurrent,v=this.lastLoadedFragLevel,E=this.hls.levels,m=E[v],f=!!(m!=null&&(T=m.details)!==null&&T!==void 0&&T.live),C=m==null?void 0:m.codecSet,b=w?w.duration:A?A.duration:0,y=r;y>=a;y--){var M=E[y];if(!M||C&&M.codecSet!==C)continue;var W=M.details,L=(w?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||b,K=void 0;y<=v?K=S*i:K=x*i;var F=E[y].maxBitrate,R=F*L/K;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(K)+"/"+F+"/"+L+"/"+s+"/"+R),K>F&&(!R||f&&!this.bitrateTestDelay||R<s))return y}return-1},p(c,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,a=this.bwEstimator;if(i!==-1&&(!a||!a.canEstimate()))return i;var r=this.getNextABRAutoLevel();return i!==-1&&(r=Math.min(i,r)),r},set:function(i){this._nextAutoLevel=i}}]),c}();z.default=h},"./src/controller/audio-stream-controller.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/polyfills/number.ts"),N=P("./src/controller/base-stream-controller.ts"),O=P("./src/events.ts"),H=P("./src/utils/buffer-helper.ts"),k=P("./src/controller/fragment-tracker.ts"),n=P("./src/types/level.ts"),I=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"),i=P("./src/errors.ts"),a=P("./src/utils/logger.ts");function r(){return r=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(A[E]=v[E])}return A},r.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(E,m){return E.__proto__=m,E},S(A,w)}var x=100,T=function(A){s(w,A);function w(E,m){var f;return f=A.call(this,E,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(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.on(O.Events.ERROR,this.onError,this),m.on(O.Events.BUFFER_RESET,this.onBufferReset,this),m.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var m=this.hls;m.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.off(O.Events.ERROR,this.onError,this),m.off(O.Events.BUFFER_RESET,this.onBufferReset,this),m.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(m,f){var C=f.frag,b=f.id,y=f.initPTS;if(b==="main"){var M=C.cc;this.initPTS[C.cc]=y,this.log("InitPTS for cc: "+M+" found from main: "+y),this.videoTrackCC=M,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,C=this.trackId,b=f==null||((m=f[C])===null||m===void 0)?void 0:m.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var y,M=performance.now(),W=this.retryDate;(!W||M>=W||(y=this.media)!==null&&y!==void 0&&y.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 K=L.frag,F=L.part,R=L.cache,V=L.complete;if(this.initPTS[K.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var ne=R.flush(),se={frag:K,part:F,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 ("+K.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Se=this.getLoadPosition(),Le=H.BufferHelper.bufferInfo(this.mediaBuffer,Se,this.config.maxBufferHole),Ae=Object(o.fragmentWithinToleranceTest)(Le.end,this.config.maxFragLookUpTolerance,K);Ae<0&&(a.logger.log("Waiting fragment cc ("+K.cc+") @ "+K.start+" cancelled because another fragment at "+Le.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,C=f.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=m.currentTime},v.doTickIdle=function(){var m,f,C=this.hls,b=this.levels,y=this.media,M=this.trackId,W=C.config;if(!b||!b[M])return;if(!y&&(this.startFragRequested||!W.startFragPrefetch))return;var L=b[M],K=L.details;if(!K||K.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(K)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(F===null)return;var R=F.len,V=this.getMaxBufferLength(),ne=this.audioSwitch;if(R>=V&&!ne)return;if(!ne&&this._streamEnded(F,K)){C.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var se=K.fragments,Se=se[0].start,Le=F.end;if(ne){var Ae=this.getLoadPosition();Le=Ae,K.PTSKnown&&Ae<Se&&((F.end>Se||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=Se+.05))}var Pe=this.getNextFragment(Le,K);if(!Pe){this.bufferFlushed=!0;return}((m=Pe.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((f=Pe.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Pe,K):this.loadFragment(Pe,K,Le)},v.getMaxBufferLength=function(){var m=A.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.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 C=f.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(b){return new n.Level(b)})},v.onAudioTrackSwitching=function(m,f){var C=!!f.url;this.trackId=f.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(x):this.resetTransmuxer(),C?(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 C,b=this.levels,y=f.details,M=f.id;if(!b){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var W=b[M],L=0;if(y.live||(C=W.details)!==null&&C!==void 0&&C.live){var K=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!K)return;!W.details&&y.hasProgramDateTime&&K.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(y,K),L=y.fragments[0].start):L=this.alignPlaylists(y,W.details)}W.details=y,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(W.details,L),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=N.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(m){var f,C=m.frag,b=m.part,y=m.payload,M=this.config,W=this.trackId,L=this.levels;if(!L){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var K=L[W];console.assert(K,"Audio track is defined on fragment load progress");var F=K.details;console.assert(F,"Audio track details are defined on fragment load progress");var R=M.defaultAudioCodec||K.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new h.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[C.cc],se=(f=C.initSegment)===null||f===void 0?void 0:f.data;if(ne!==void 0){var Se=!1,Le=b?b.index:-1,Ae=Le!==-1,Pe=new c.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,y.byteLength,Le,Ae);V.push(y,se,R,"",C,b,F.totalduration,Se,Pe,ne)}else{a.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+W);var Fe=this.waitingData=this.waitingData||{frag:C,part:b,cache:new p.default,complete:!1},je=Fe.cache;je.push(new Uint8Array(y)),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 C=f.tracks.audio;C&&(this.mediaBuffer=C.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},v.onFragBuffered=function(m,f){var C=f.frag,b=f.part;if(C.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(b?" p: "+b.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,b)},v.onError=function(m,f){switch(f.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,f);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.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 i.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var C=!0,b=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);b&&b.len>.5&&(C=!this.reduceMaxBufferLength(b.len)),C&&(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 C=f.type;C===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(m){var f,C="audio",b=this.hls,y=m.remuxResult,M=m.chunkMeta,W=this.getCurrentContext(M);if(!W){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var L=W.frag,K=W.part,F=y.audio,R=y.text,V=y.id3,ne=y.initSegment;if(this.fragContextChanged(L))return;if(this.state=N.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,L,M),b.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:C,tracks:ne.tracks})),F){var se=F.startPTS,Se=F.endPTS,Le=F.startDTS,Ae=F.endDTS;K&&(K.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:Se,startDTS:Le,endDTS:Ae}),L.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,se,Se,Le,Ae),this.bufferFragmentData(F,L,K,M)}if(V!=null&&(f=V.samples)!==null&&f!==void 0&&f.length){var Pe=r({frag:L,id:C},V);b.trigger(O.Events.FRAG_PARSING_METADATA,Pe)}if(R){var Fe=r({frag:L,id:C},R);b.trigger(O.Events.FRAG_PARSING_USERDATA,Fe)}},v._bufferInitSegment=function(m,f,C){if(this.state!==N.State.PARSING)return;m.video&&delete m.video;var b=m.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(O.Events.BUFFER_CODECS,m);var y=b.initSegment;if(y!=null&&y.byteLength){var M={type:"audio",frag:f,part:null,chunkMeta:C,parent:f.type,data:y};this.hls.trigger(O.Events.BUFFER_APPENDING,M)}this.tick()},v.loadFragment=function(m,f,C){var b=this.fragmentTracker.getState(m);this.fragCurrent=m,(this.audioSwitch||b===k.FragmentState.NOT_LOADED||b===k.FragmentState.PARTIAL)&&(m.sn==="initSegment"?this._loadInitSegment(m):f.live&&!Object(Y.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,C)))},v.completeAudioSwitch=function(){var m=this.hls,f=this.media,C=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(O.Events.AUDIO_TRACK_SWITCHED,{id:C})},w}(N.default);z.default=T},"./src/controller/audio-track-controller.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/events.ts"),N=P("./src/errors.ts"),O=P("./src/controller/base-playlist-controller.ts"),H=P("./src/types/loader.ts");function k(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&&k(h.prototype,c),o&&k(h,o),h}function I(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,i){return d.__proto__=i,d},g(h,c)}var p=function(h){I(c,h);function c(d){var i;return i=h.call(this,d,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var o=c.prototype;return o.registerListeners=function(){var i=this.hls;i.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(Y.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var i=this.hls;i.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(Y.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(i,a){this.tracks=a.audioTracks||[]},o.onAudioTrackLoaded=function(i,a){var r=a.id,s=a.details,S=this.tracksInGroup[r];if(!S){this.warn("Invalid audio track id "+r);return}var x=S.details;S.details=a.details,this.log("audioTrack "+r+" loaded ["+s.startSN+"-"+s.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,a,x))},o.onLevelLoading=function(i,a){this.switchLevel(a.level)},o.onLevelSwitching=function(i,a){this.switchLevel(a.level)},o.switchLevel=function(i){var a=this.hls.levels[i];if(!(a!=null&&a.audioGroupIds))return;var r=a.audioGroupIds[a.urlId];if(this.groupId!==r){this.groupId=r;var s=this.tracks.filter(function(x){return!r||x.groupId===r});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 "'+r+'" group-id'),this.hls.trigger(Y.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},o.onError=function(i,a){if(h.prototype.onError.call(this,i,a),a.fatal||!a.context)return;a.context.type===H.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},o.setAudioTrack=function(i){var a=this.tracksInGroup;if(i<0||i>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=a[this.trackId];this.log("Now switching to audio-track index "+i);var s=a[i],S=s.id,x=s.groupId,T=x===void 0?"":x,A=s.name,w=s.type,v=s.url;if(this.trackId=i,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:T,name:A,type:w,url:v}),s.details&&!s.details.live)return;var E=this.switchParams(s.url,r==null?void 0:r.details);this.loadPlaylist(E)},o.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,r=this.findTrackId(a)||this.findTrackId();r!==-1?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(i){for(var a=this.tracksInGroup,r=0;r<a.length;r++){var s=a[r];if((!this.selectDefaultTrack||s.default)&&(!i||i===s.name))return s.id}return-1},o.loadPlaylist=function(i){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var r=a.id,s=a.groupId,S=a.url;if(i)try{S=i.addDirectives(S)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(Y.Events.AUDIO_TRACK_LOADING,{url:S,id:r,groupId:s,deliveryDirectives:i||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),c}(O.default);z.default=p},"./src/controller/base-playlist-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return n});var Y=P("./src/polyfills/number.ts"),N=P("./src/types/level.ts"),O=P("./src/controller/level-helper.ts"),H=P("./src/utils/logger.ts"),k=P("./src/errors.ts"),n=function(){function I(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=H.logger.log.bind(H.logger,h+":"),this.warn=H.logger.warn.bind(H.logger,h+":"),this.hls=p}var g=I.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(h,c){c.fatal&&c.type===k.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 i=o[d],a=""+i.URI;if(a===h.substr(-a.length)){var r=parseInt(i["LAST-MSN"]),s=parseInt(i["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(Y.isFiniteNumber)(r))return new N.HlsUrlParameters(r,Object(Y.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,i=c.details,a=c.stats,r=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(i.advancedDateTime=Date.now()-r,i.live||o!=null&&o.live){if(i.reloaded(o),o&&this.log("live playlist "+h+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),o&&i.fragments.length>0&&Object(O.mergeDetails)(o,i),!this.canLoad||!i.live)return;var s,S=void 0,x=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var T=this.hls.config.lowLatencyMode,A=i.lastPartSn,w=i.endSN,v=i.lastPartIndex,E=v!==-1,m=A===w,f=T?0:v;E?(S=m?w+1:A,x=m?f:v+1):S=w+1;var C=i.age,b=C+i.ageHeader,y=Math.min(b-i.partTarget,i.targetduration*1.5);if(y>0){if(o&&y>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var M=Math.floor(y/i.targetduration);if(S+=M,x!==void 0){var W=Math.round(y%i.targetduration/i.partTarget);x+=W}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+y+" skip sn "+M+" to part "+x)}i.tuneInGoal=y}if(s=this.getDeliveryDirectives(i,c.deliveryDirectives,S,x),T||!m){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(i,c.deliveryDirectives,S,x);var L=Object(O.computeReloadInterval)(i,a);S!==void 0&&i.canBlockReload&&(L-=i.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 i=Object(N.getSkipValue)(h,o);return c!=null&&c.skip&&h.deltaUpdateFailed&&(o=c.msn,d=c.part,i=N.HlsSkip.No),new N.HlsUrlParameters(o,d,i)},g.retryLoadingOrFail=function(h){var c=this,o=this.hls.config,d=this.retryCount<o.levelLoadingMaxRetry;if(d){var i;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(i=h.context)!==null&&i!==void 0&&i.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},I}()},"./src/controller/base-stream-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"State",function(){return w}),P.d(z,"default",function(){return v});var Y=P("./src/polyfills/number.ts"),N=P("./src/task-loop.ts"),O=P("./src/controller/fragment-tracker.ts"),H=P("./src/utils/buffer-helper.ts"),k=P("./src/utils/logger.ts"),n=P("./src/events.ts"),I=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"),i=P("./src/crypt/decrypter.ts"),a=P("./src/utils/time-ranges.ts"),r=P("./src/types/loader.ts");function s(E,m){for(var f=0;f<m.length;f++){var C=m[f];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(E,C.key,C)}}function S(E,m,f){return m&&s(E.prototype,m),f&&s(E,f),E}function x(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function T(E,m){E.prototype=Object.create(m.prototype),E.prototype.constructor=E,A(E,m)}function A(E,m){return A=Object.setPrototypeOf||function(C,b){return C.__proto__=b,C},A(E,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(E){T(m,E);function m(C,b,y){var M;return M=E.call(this)||this,M.hls=void 0,M.fragPrevious=null,M.fragCurrent=null,M.fragmentTracker=void 0,M.transmuxer=null,M._state=w.STOPPED,M.media=void 0,M.mediaBuffer=void 0,M.config=void 0,M.bitrateTest=!1,M.lastCurrentTime=0,M.nextLoadPosition=0,M.startPosition=0,M.loadedmetadata=!1,M.fragLoadError=0,M.retryDate=0,M.levels=null,M.fragmentLoader=void 0,M.levelLastLoaded=null,M.startFragRequested=!1,M.decrypter=void 0,M.initPTS=[],M.onvseeking=null,M.onvended=null,M.logPrefix="",M.log=void 0,M.warn=void 0,M.logPrefix=y,M.log=k.logger.log.bind(k.logger,y+":"),M.warn=k.logger.warn.bind(k.logger,y+":"),M.hls=C,M.fragmentLoader=new d.default(C.config),M.fragmentTracker=b,M.config=C.config,M.decrypter=new i.default(C,C.config),C.on(n.Events.KEY_LOADED,M.onKeyLoaded,x(M)),M}var f=m.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(b){},f.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=w.STOPPED},f._streamEnded=function(b,y){var M=this.fragCurrent,W=this.fragmentTracker;if(!y.live&&M&&M.sn===y.endSN&&!b.nextStart){var L=W.getState(M);return L===O.FragmentState.PARTIAL||L===O.FragmentState.OK}return!1},f.onMediaAttached=function(b,y){var M=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),M.addEventListener("seeking",this.onvseeking),M.addEventListener("ended",this.onvended);var W=this.config;this.levels&&W.autoStartLoad&&this.state===w.STOPPED&&this.startLoad(W.startPosition)},f.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.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 b=this.config,y=this.fragCurrent,M=this.media,W=this.mediaBuffer,L=this.state,K=M?M.currentTime:0,F=H.BufferHelper.bufferInfo(W||M,K,b.maxBufferHole);if(this.log("media seeking to "+(Object(Y.isFiniteNumber)(K)?K.toFixed(3):K)+", state: "+L),L===w.ENDED)this.resetLoadingState();else if(y&&!F.len){var R=b.maxFragLookUpTolerance,V=y.start-R,ne=y.start+y.duration+R,se=K>ne;(K<V||se)&&(se&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}M&&(this.lastCurrentTime=K),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=K),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(b,y){if(this.state!==w.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=w.IDLE;var M=this.levels[y.frag.level].details;M&&this.loadFragment(y.frag,M,y.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),E.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,E.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(b,y){this.log("Loading key for "+b.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=w.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(n.Events.KEY_LOADING,{frag:b})},f.loadFragment=function(b,y,M){this._loadFragForPlayback(b,y,M)},f._loadFragForPlayback=function(b,y,M){var W=this,L=function(F){if(W.fragContextChanged(b)){W.warn("Fragment "+b.sn+(F.part?" p: "+F.part.index:"")+" of level "+b.level+" was dropped during download."),W.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,W._handleFragmentLoadProgress(F)};this._doFragLoad(b,y,M,L).then(function(K){if(!K)return;W.fragLoadError=0;var F=W.state;if(W.fragContextChanged(b)){(F===w.FRAG_LOADING||F===w.BACKTRACKING||!W.fragCurrent&&F===w.PARSING)&&(W.fragmentTracker.removeFragment(b),W.state=w.IDLE);return}if("payload"in K&&(W.log("Loaded fragment "+b.sn+" of level "+b.level),W.hls.trigger(n.Events.FRAG_LOADED,K),W.state===w.BACKTRACKING)){W.fragmentTracker.backtrack(b,K),W.resetFragmentLoading(b);return}W._handleFragmentLoadComplete(K)}).catch(function(K){W.warn(K),W.resetFragmentLoading(b)})},f.flushMainBuffer=function(b,y,M){if(M===void 0&&(M=null),!(b-y))return;var W={startOffset:b,endOffset:y,type:M};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,W)},f._loadInitSegment=function(b){var y=this;this._doFragLoad(b).then(function(M){if(!M||y.fragContextChanged(b)||!y.levels)throw new Error("init load aborted");return M}).then(function(M){var W=y.hls,L=M.payload,K=b.decryptdata;if(L&&L.byteLength>0&&K&&K.key&&K.iv&&K.method==="AES-128"){var F=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(L),K.key.buffer,K.iv.buffer).then(function(R){var V=self.performance.now();return W.trigger(n.Events.FRAG_DECRYPTED,{frag:b,payload:R,stats:{tstart:F,tdecrypt:V}}),M.payload=R,M})}return M}).then(function(M){var W=y.fragCurrent,L=y.hls,K=y.levels;if(!K)throw new Error("init load aborted, missing levels");var F=K[b.level].details;console.assert(F,"Level details are defined when init segment is loaded");var R=b.stats;y.state=w.IDLE,y.fragLoadError=0,b.data=new Uint8Array(M.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),M.frag===W&&L.trigger(n.Events.FRAG_BUFFERED,{stats:R,frag:W,part:null,id:b.type}),y.tick()}).catch(function(M){y.warn(M),y.resetFragmentLoading(b)})},f.fragContextChanged=function(b){var y=this.fragCurrent;return!b||!y||b.level!==y.level||b.sn!==y.sn||b.urlId!==y.urlId},f.fragBufferedComplete=function(b,y){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+a.default.toString(H.BufferHelper.getBuffered(M))),this.state=w.IDLE,this.tick()},f._handleFragmentLoadComplete=function(b){var y=this.transmuxer;if(!y)return;var M=b.frag,W=b.part,L=b.partsLoaded,K=!L||L.length===0||L.some(function(R){return!R}),F=new g.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,W?W.index:-1,!K);y.flush(F)},f._handleFragmentLoadProgress=function(b){},f._doFragLoad=function(b,y,M,W){var L=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(b.start,M||0),this.config.lowLatencyMode&&y){var K=y.partList;if(K&&W){M>b.end&&y.fragmentHint&&(b=y.fragmentHint);var F=this.getNextPart(K,b,M);if(F>-1){var R=K[F];return this.log("Loading part sn: "+b.sn+" p: "+R.index+" cc: "+b.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+F+"-"+(K.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:b,part:K[F],targetBufferTime:M}),this.doFragPartsLoad(b,K,F,W).catch(function(V){return L.handleFragLoadError(V)})}else if(!b.url||this.loadedEndOfParts(K,M))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(M.toFixed(3))),Object(Y.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:b,targetBufferTime:M}),this.fragmentLoader.load(b,W).catch(function(V){return L.handleFragLoadError(V)})},f.doFragPartsLoad=function(b,y,M,W){var L=this;return new Promise(function(K,F){var R=[],V=function ne(se){var Se=y[se];L.fragmentLoader.loadPart(b,Se,W).then(function(Le){R[Se.index]=Le;var Ae=Le.part;L.hls.trigger(n.Events.FRAG_LOADED,Le);var Pe=y[se+1];if(Pe&&Pe.fragment===b)ne(se+1);else return K({frag:b,part:Ae,partsLoaded:R})}).catch(F)};V(M)})},f.handleFragLoadError=function(b){var y=b.data;return y&&y.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(n.Events.ERROR,y),null},f._handleTransmuxerFlush=function(b){var y=this.getCurrentContext(b);if(!y||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var M=y.frag,W=y.part,L=y.level,K=self.performance.now();M.stats.parsing.end=K,W&&(W.stats.parsing.end=K),this.updateLevelTiming(M,W,L,b.partial)},f.getCurrentContext=function(b){var y=this.levels,M=b.level,W=b.sn,L=b.part;if(!y||!y[M])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+M+". The current chunk will not be buffered."),null;var K=y[M],F=L>-1?Object(o.getPartWith)(K,W,L):null,R=F?F.fragment:Object(o.getFragmentWithSN)(K,W,this.fragCurrent);return R?{frag:R,part:F,level:K}:null},f.bufferFragmentData=function(b,y,M,W){if(!b||this.state!==w.PARSING)return;var L=b.data1,K=b.data2,F=L;if(L&&K&&(F=Object(p.appendUint8Array)(L,K)),!F||!F.length)return;var R={type:b.type,frag:y,part:M,chunkMeta:W,parent:y.type,data:F};this.hls.trigger(n.Events.BUFFER_APPENDING,R),b.dropped&&b.independent&&!M&&this.flushBufferGap(y)},f.flushBufferGap=function(b){var y=this.media;if(!y)return;if(!H.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,b.start);return}var M=y.currentTime,W=H.BufferHelper.bufferInfo(y,M,0),L=b.duration,K=Math.min(this.config.maxFragLookUpTolerance*2,L*.25),F=Math.max(Math.min(b.start-K,W.end-K),M+K);b.start-F>K&&this.flushMainBuffer(F,b.start)},f.getFwdBufferInfo=function(b,y){var M=this.config,W=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(W))return null;var L=H.BufferHelper.bufferInfo(b,W,M.maxBufferHole);if(L.len===0&&L.nextStart!==void 0){var K=this.fragmentTracker.getBufferedFrag(W,y);if(K&&L.nextStart<K.end)return H.BufferHelper.bufferInfo(b,W,Math.max(L.nextStart,M.maxBufferHole))}return L},f.getMaxBufferLength=function(b){var y=this.config,M;return b?M=Math.max(8*y.maxBufferSize/b,y.maxBufferLength):M=y.maxBufferLength,Math.min(M,y.maxMaxBufferLength)},f.reduceMaxBufferLength=function(b){var y=this.config,M=b||y.maxBufferLength;return y.maxMaxBufferLength>=M?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(b,y){var M,W,L=y.fragments,K=L.length;if(!K)return null;var F=this.config,R=L[0].start,V;if(y.live){var ne=F.initialLiveManifestSize;if(K<ne)return this.warn("Not enough fragments to start playback (have: "+K+", need: "+ne+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(y,L),this.startPosition=V?this.hls.liveSyncPosition||V.start:b)}else b<=R&&(V=L[0]);if(!V){var se=F.lowLatencyMode?y.partEnd:y.fragmentEnd;V=this.getFragmentAtPosition(b,se,y)}return(M=V)!==null&&M!==void 0&&M.initSegment&&!((W=V)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},f.getNextPart=function(b,y,M){for(var W=-1,L=!1,K=!0,F=0,R=b.length;F<R;F++){var V=b[F];if(K=K&&!V.independent,W>-1&&M<V.start)break;var ne=V.loaded;!ne&&(L||V.independent||K)&&V.fragment===y&&(W=F),L=ne}return W},f.loadedEndOfParts=function(b,y){var M=b[b.length-1];return M&&y>M.start&&M.loaded},f.getInitialLiveFragment=function(b,y){var M=this.fragPrevious,W=null;if(M){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),W=Object(c.findFragmentByPDT)(y,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var L=M.sn+1;if(L>=b.startSN&&L<=b.endSN){var K=y[L-b.startSN];M.cc===K.cc&&(W=K,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(c.findFragWithCC)(y,M.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(W=this.getFragmentAtPosition(F,this.bitrateTest?b.fragmentEnd:b.edge,b))}return W},f.getFragmentAtPosition=function(b,y,M){var W=this.config,L=this.fragPrevious,K=M.fragments,F=M.endSN,R=M.fragmentHint,V=W.maxFragLookUpTolerance,ne=!!(W.lowLatencyMode&&M.partList&&R);ne&&R&&!this.bitrateTest&&(K=K.concat(R),F=R.sn);var se;if(b<y){var Se=b>y-V?0:V;se=Object(c.findFragmentByPTS)(L,K,b,Se)}else se=K[K.length-1];if(se){var Le=se.sn-M.startSN,Ae=L&&se.level===L.level,Pe=K[Le+1],Fe=this.fragmentTracker.getState(se);if(Fe===O.FragmentState.BACKTRACKED){se=null;for(var je=Le;K[je]&&this.fragmentTracker.getState(K[je])===O.FragmentState.BACKTRACKED;)L?se=K[je--]:se=K[--je];se||(se=Pe)}else L&&se.sn===L.sn&&!ne&&(Ae&&(se.sn<F&&this.fragmentTracker.getState(Pe)!==O.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+Pe.sn),se=Pe):se=null))}return se},f.synchronizeToLiveEdge=function(b){var y=this.config,M=this.media;if(!M)return;var W=this.hls.liveSyncPosition,L=M.currentTime,K=b.fragments[0].start,F=b.edge,R=L>=K-y.maxFragLookUpTolerance&&L<=F;if(W!==null&&M.duration>W&&(L<W||!R)){var V=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*b.targetduration;(!R&&M.readyState<4||L<F-V)&&(this.loadedmetadata||(this.nextLoadPosition=W),M.readyState&&(this.warn("Playback: "+L.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+W.toFixed(3)),M.currentTime=W))}},f.alignPlaylists=function(b,y){var M=this.levels,W=this.levelLastLoaded,L=this.fragPrevious,K=W!==null?M[W]:null,F=b.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var R=b.fragments[0].start,V=!y,ne=b.alignedSliding&&Object(Y.isFiniteNumber)(R);if(V||!ne&&!R){Object(h.alignStream)(L,K,b);var se=b.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+b.startSN+" prev-sn: "+(L?L.sn:"na")+" fragments: "+F),se}return R},f.waitForCdnTuneIn=function(b){var y=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*y)},f.setStartPosition=function(b,y){var M=this.startPosition;if(M<y&&(M=-1),M===-1||this.lastCurrentTime===-1){var W=b.startTimeOffset;Object(Y.isFiniteNumber)(W)?(M=y+W,W<0&&(M+=b.totalduration),M=Math.min(Math.max(y,M),y+b.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+M),this.startPosition=M):b.live?M=this.hls.liveSyncPosition||y:this.startPosition=M=0,this.lastCurrentTime=M}this.nextLoadPosition=M},f.getLoadPosition=function(){var b=this.media,y=0;return this.loadedmetadata&&b?y=b.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},f.handleFragLoadAborted=function(b,y){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(y?" part"+y.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},f.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=w.IDLE)},f.onFragmentOrKeyLoadError=function(b,y){if(y.fatal)return;var M=y.frag;if(!M||M.type!==b)return;var W=this.fragCurrent;console.assert(W&&M.sn===W.sn&&M.level===W.level&&M.urlId===W.urlId,"Frag load error must match current frag to retry");var L=this.config;if(this.fragLoadError+1<=L.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(M.level))return;var K=Math.min(Math.pow(2,this.fragLoadError)*L.fragLoadingRetryDelay,L.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+b+" "+M.level+" failed to load, retrying in "+K+"ms"),this.retryDate=self.performance.now()+K,this.fragLoadError++,this.state=w.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(b===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=w.IDLE):(k.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=w.ERROR)},f.afterBufferFlushed=function(b,y,M){if(!b)return;var W=H.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(y,W,M),this.state===w.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=w.IDLE},f.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[b].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(b,y,M,W){var L=this,K=M.details;console.assert(!!K,"level.details must be defined");var F=Object.keys(b.elementaryStreams).reduce(function(R,V){var ne=b.elementaryStreams[V];if(ne){var se=ne.endPTS-ne.startPTS;if(se<=0)return L.warn("Could not parse fragment "+b.sn+" "+V+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),L.resetTransmuxer(),R||!1;var Se=W?0:Object(o.updateFragPTSDTS)(K,b,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return L.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:K,level:M,drift:Se,type:V,frag:b,start:ne.startPTS,end:ne.endPTS}),!0}return R},!1);F?(this.state=w.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:b,part:y})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(m,[{key:"state",get:function(){return this._state},set:function(b){var y=this._state;y!==b&&(this._state=b,this.log(y+"->"+b))}}]),m}(N.default)},"./src/controller/buffer-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c});var Y=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),O=P("./src/utils/logger.ts"),H=P("./src/errors.ts"),k=P("./src/utils/buffer-helper.ts"),n=P("./src/utils/mediasource-helper.ts"),I=P("./src/loader/fragment.ts"),g=P("./src/controller/buffer-operation-queue.ts"),p=Object(n.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function o(i){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 r=a.hls,s=a.media,S=a.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),r.trigger(N.Events.MEDIA_ATTACHED,{media:s})),S&&S.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=i,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,r){var s=2;(r.audio&&!r.video||!r.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(a,r){var s=this.media=r.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,r=this.mediaSource,s=this._objectUrl;if(r){if(O.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(S){O.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):O.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(r){var s=a.sourceBuffer[r];try{s&&(a.removeBufferListeners(r),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[r]=void 0)}catch(S){O.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",S)}}),this._initSourceBuffer()},d.onBufferCodecs=function(a,r){var s=this,S=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(x){if(S){var T=s.tracks[x];if(T&&typeof T.buffer.changeType=="function"){var A=r[x],w=A.codec,v=A.levelCodec,E=A.container,m=(T.levelCodec||T.codec).replace(h,"$1"),f=(v||w).replace(h,"$1");if(m!==f){var C=E+";codecs="+(v||w);s.appendChangeType(x,C)}}}else s.pendingTracks[x]=r[x]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(a,r){var s=this,S=this.operationQueue,x={execute:function(){var A=s.sourceBuffer[a];A&&(O.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+r),A.changeType(r)),S.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(A){O.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",A)}};S.append(x,a)},d.onBufferAppending=function(a,r){var s=this,S=this.hls,x=this.operationQueue,T=this.tracks,A=r.data,w=r.type,v=r.frag,E=r.part,m=r.chunkMeta,f=m.buffering[w],C=self.performance.now();f.start=C;var b=v.stats.buffering,y=E?E.stats.buffering:null;b.start===0&&(b.start=C),y&&y.start===0&&(y.start=C);var M=T.audio,W=w==="audio"&&m.id===1&&(M==null?void 0:M.container)==="audio/mpeg",L={execute:function(){if(f.executeStart=self.performance.now(),W){var F=s.sourceBuffer[w];if(F){var R=v.start-F.timestampOffset;Math.abs(R)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+R+") sn: "+v.sn+")"),F.timestampOffset=v.start)}}s.appendExecutor(A,w)},onStart:function(){},onComplete:function(){var F=self.performance.now();f.executeEnd=f.end=F,b.first===0&&(b.first=F),y&&y.first===0&&(y.first=F);var R=s.sourceBuffer,V={};for(var ne in R)V[ne]=k.BufferHelper.getBuffered(R[ne]);s.appendError=0,s.hls.trigger(N.Events.BUFFER_APPENDED,{type:w,frag:v,part:E,chunkMeta:m,parent:v.type,timeRanges:V})},onError:function(F){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",F);var R={type:H.ErrorTypes.MEDIA_ERROR,parent:v.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=H.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,R.details=H.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>S.config.appendErrorMaxRetry&&(O.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,r){var s=this,S=this.operationQueue,x=function(A){return{execute:s.removeExecutor.bind(s,A,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(N.Events.BUFFER_FLUSHED,{type:A})},onError:function(v){O.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",v)}}};r.type?S.append(x(r.type),r.type):this.getSourceBufferTypes().forEach(function(T){S.append(x(T),T)})},d.onFragParsed=function(a,r){var s=this,S=r.frag,x=r.part,T=[],A=x?x.elementaryStreams:S.elementaryStreams;A[I.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(A[I.ElementaryStreamTypes.AUDIO]&&T.push("audio"),A[I.ElementaryStreamTypes.VIDEO]&&T.push("video"));var w=function(){var E=self.performance.now();S.stats.buffering.end=E,x&&(x.stats.buffering.end=E);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&&O.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,r){this.flushBackBuffer()},d.onBufferEos=function(a,r){var s=this,S=this.getSourceBufferTypes().reduce(function(x,T){var A=s.sourceBuffer[T];return(!r.type||r.type===T)&&(A&&!A.ended&&(A.ended=!0,O.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,r){var s=r.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,r=this.details,s=this.media,S=this.sourceBuffer;if(!s||r===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var T=r.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(Y.isFiniteNumber)(T)||T<0)return;var A=s.currentTime,w=r.levelTargetDuration,v=Math.max(T,w),E=Math.floor(A/w)*w-v;x.forEach(function(m){var f=S[m];if(f){var C=k.BufferHelper.getBuffered(f);C.length>0&&E>C.start(0)&&(a.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),r.live&&a.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),a.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:m}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,r=this.hls,s=this.media,S=this.mediaSource,x=a.fragments[0].start+a.totalduration,T=s.duration,A=Object(Y.isFiniteNumber)(S.duration)?S.duration:0;a.live&&r.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(a)):(x>A&&x>T||!Object(Y.isFiniteNumber)(T))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),S.duration=x)},d.updateSeekableRange=function(a){var r=this.mediaSource,s=a.fragments,S=s.length;if(S&&a.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var x=Math.max(0,s[0].start),T=Math.max(x,x+a.totalduration);r.setLiveSeekableRange(x,T)}},d.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,r=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:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(T){r.executeNext(T)})}},d.createSourceBuffers=function(a){var r=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var x in a)if(!r[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;O.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var v=r[x]=s.addSourceBuffer(w),E=x;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[x]={buffer:v,codec:A,container:T.container,levelCodec:T.levelCodec,id:T.id},S++}catch(m){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+m.message),this.hls.trigger(N.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.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 r=this.operationQueue,s=r.current(a);s.onStart()},d._onSBUpdateEnd=function(a){var r=this.operationQueue,s=r.current(a);s.onComplete(),r.shiftAndExecuteNext(a)},d._onSBUpdateError=function(a,r){O.logger.error("[buffer-controller]: "+a+" SourceBuffer error",r),this.hls.trigger(N.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(r)},d.removeExecutor=function(a,r,s){var S=this.media,x=this.mediaSource,T=this.operationQueue,A=this.sourceBuffer,w=A[a];if(!S||!x||!w){O.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(a);return}var v=Object(Y.isFiniteNumber)(S.duration)?S.duration:Infinity,E=Object(Y.isFiniteNumber)(x.duration)?x.duration:Infinity,m=Math.max(0,r),f=Math.min(s,v,E);f>m?(O.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,r){var s=this.operationQueue,S=this.sourceBuffer,x=S[r];if(!x){O.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(r);return}x.ended=!1,console.assert(!x.updating,r+" sourceBuffer must not be updating"),x.appendBuffer(a)},d.blockBuffers=function(a,r){var s=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var S=this.operationQueue,x=r.map(function(T){return S.appendBlocker(T)});Promise.all(x).then(function(){a(),r.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,r,s){var S=this.sourceBuffer[a];if(!S)return;var x=s.bind(this,a);this.listeners[a].push({event:r,listener:x}),S.addEventListener(r,x)},d.removeBufferListeners=function(a){var r=this.sourceBuffer[a];if(!r)return;this.listeners[a].forEach(function(s){r.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return N});var Y=P("./src/utils/logger.ts"),N=function(){function O(k){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=k}var H=O.prototype;return H.append=function(n,I){var g=this.queues[I];g.push(n),g.length===1&&this.buffers[I]&&this.executeNext(I)},H.insertAbort=function(n,I){var g=this.queues[I];g.unshift(n),this.executeNext(I)},H.appendBlocker=function(n){var I,g=new Promise(function(h){I=h}),p={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,n),g},H.executeNext=function(n){var I=this.buffers,g=this.queues,p=I[n],h=g[n];if(h.length){var c=h[0];try{c.execute()}catch(o){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(o),(!p||!p.updating)&&(h.shift(),this.executeNext(n))}}},H.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},H.current=function(n){return this.queues[n][0]},O}()},"./src/controller/cap-level-controller.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/events.ts");function N(k,n){for(var I=0;I<n.length;I++){var g=n[I];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(k,g.key,g)}}function O(k,n,I){return n&&N(k.prototype,n),I&&N(k,I),k}var H=function(){function k(I){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=k.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(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var g=this.hls;g.off(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(g,p){k.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 k.isLevelAllowed(d,p.restrictedLevels)&&d<=g});return this.clientRect=null,k.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},k.isLevelAllowed=function(g,p){return p===void 0&&(p=[]),p.indexOf(g)===-1},k.getMaxLevelByMediaSize=function(g,p,h){if(!g||!g.length)return-1;for(var c=function(r,s){return s?r.width!==s.width||r.height!==s.height:!0},o=g.length-1,d=0;d<g.length;d+=1){var i=g[d];if((i.width>=p||i.height>=h)&&c(i,g[d+1])){o=d;break}}return o},O(k,[{key:"mediaWidth",get:function(){return this.getDimensions().width*k.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*k.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(p){}return g}}]),k}();z.default=H},"./src/controller/cmcd-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c});var Y=P("./src/events.ts"),N=P("./src/types/cmcd.ts"),O=P("./src/utils/buffer-helper.ts"),H=P("./src/utils/logger.ts");function k(o,d){for(var i=0;i<d.length;i++){var a=d[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function n(o,d,i){return d&&k(o.prototype,d),i&&k(o,i),o}function I(o,d){var i=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(i)return(i=i.call(o)).next.bind(i);if(Array.isArray(o)||(i=g(o))||d&&o&&typeof o.length=="number"){i&&(o=i);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 i=Object.prototype.toString.call(o).slice(8,-1);if(i==="Object"&&o.constructor&&(i=o.constructor.name),i==="Map"||i==="Set")return Array.from(o);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(o,d)}function p(o,d){(d==null||d>o.length)&&(d=o.length);for(var i=0,a=new Array(d);i<d;i++)a[i]=o[i];return a}function h(){return h=Object.assign||function(o){for(var d=1;d<arguments.length;d++){var i=arguments[d];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])}return o},h.apply(this,arguments)}var c=function(){function o(i){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){H.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){H.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=i;var r=this.config=i.config,s=r.cmcd;s!=null&&(r.pLoader=this.createPlaylistLoader(),r.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(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var a=this.hls;a.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(Y.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,r){this.media=r.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,r){var s,S;this.audioBuffer=(s=r.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(S=r.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,r){r===void 0&&(r={}),h(r,this.createData());var s=r.ot===N.CMCDObjectType.INIT||r.ot===N.CMCDObjectType.VIDEO||r.ot===N.CMCDObjectType.MUXED;if(this.starved&&s&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var S=o.toHeaders(r);if(!Object.keys(S).length)return;a.headers||(a.headers={}),h(a.headers,S)}else{var x=o.toQuery(r);if(!x)return;a.url=o.appendQueryToUri(a.url,x)}},d.getObjectType=function(a){var r=a.type;return r==="subtitle"?N.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?N.CMCDObjectType.INIT:r==="audio"?N.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(a){for(var r=0,s=a===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=I(s),x;!(x=S()).done;){var T=x.value;T.bitrate>r&&(r=T.bitrate)}return r>0?r:NaN},d.getBufferLength=function(a){var r=this.hls.media,s=a===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!r)return NaN;var S=O.BufferHelper.bufferInfo(s,r.currentTime,this.config.maxBufferHole);return S.len*1e3},d.createPlaylistLoader=function(){var a=this.config.pLoader,r=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){r(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,r=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){r(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),r=a.toString();return URL.revokeObjectURL(a),r.substr(r.lastIndexOf("/")+1)},o.serialize=function(a){for(var r=[],s=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},S=function(W){return Math.round(W)},x=function(W){return S(W/100)*100},T=function(W){return encodeURIComponent(W)},A={br:S,d:S,bl:x,dl:x,mtp:x,nor:T,rtp:x,tb:S},w=Object.keys(a||{}).sort(),v=I(w),E;!(E=v()).done;){var m=E.value,f=a[m];if(!s(f))continue;if(m==="v"&&f===1)continue;if(m=="pr"&&f===1)continue;var C=A[m];C&&(f=C(f));var b=typeof f,y=void 0;m==="ot"||m==="sf"||m==="st"?y=m+"="+f:b==="boolean"?y=m:b==="number"?y=m+"="+f:y=m+"="+JSON.stringify(f),r.push(y)}return r.join(",")},o.toHeaders=function(a){for(var r=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=r;A<w.length;A++){var v=w[A],E=T[v]!=null?T[v]:1;x[E][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,r){if(!r)return a;var s=a.includes("?")?"&":"?";return""+a+s+r},o}()},"./src/controller/eme-controller.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/events.ts"),N=P("./src/errors.ts"),O=P("./src/utils/logger.ts"),H=P("./src/utils/mediakeys-helper.ts");function k(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,o,d){return o&&k(c.prototype,o),d&&k(c,d),c}var I=3,g=function(o,d,i){var a={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(r){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+r+'"',robustness:i.audioRobustness||""})}),d.forEach(function(r){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+r+'"',robustness:i.videoRobustness||""})}),[a]},p=function(o,d,i,a){switch(o){case H.KeySystems.WIDEVINE:return g(d,i,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(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(i){switch(i){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},o._attemptKeySystemAccess=function(i,a,r){var s=this,S=p(i,a,r,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(i,S);this.mediaKeysPromise=x.then(function(T){return s._onMediaKeySystemAccessObtained(i,T)}),x.catch(function(T){O.logger.error('Failed to obtain key-system "'+i+'" access:',T)})},o._onMediaKeySystemAccessObtained=function(i,a){var r=this;O.logger.log('Access for key-system "'+i+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:i};this._mediaKeysList.push(s);var S=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(x){return s.mediaKeys=x,O.logger.log('Media-keys created for key-system "'+i+'"'),r._onMediaKeysCreated(),x});return S.catch(function(x){O.logger.error("Failed to create media-keys:",x)}),S},o._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),i._onNewMediaKeySession(a.mediaKeysSession))})},o._onNewMediaKeySession=function(i){var a=this;O.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(r){a._onKeySessionMessage(i,r.message)},!1)},o._onKeySessionMessage=function(i,a){O.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(r){O.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),i.update(r)})},o.onMediaEncrypted=function(i){var a=this;if(O.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(S){if(!a._media)return;a._attemptSetMediaKeys(S),a._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(r).catch(r)},o._attemptSetMediaKeys=function(i){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){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(i,a){var r=this,s=this._mediaKeysList[0];if(!s){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var S=s.mediaKeysSession;if(!S){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+i+'" init data type'),s.mediaKeysSessionInitialized=!0,S.generateRequest(i,a).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(x){O.logger.error("Error generating key-session request:",x),r.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(i,a,r){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,i,a,r);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,s,i),S=void 0}catch(x){O.logger.error(x)}try{s.readyState||s.open("POST",i,!0),S&&S.call(this.hls,s,i)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return s},o._onLicenseRequestReadyStageChange=function(i,a,r,s){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var S=i.response,x=this._licenseResponseCallback;if(x)try{S=x.call(this.hls,i,a)}catch(A){O.logger.error(A)}s(S)}else{if(O.logger.error("License Request XHR failed ("+a+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=I-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(r,s)}break}},o._generateLicenseRequestChallenge=function(i,a){switch(i.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},o._requestLicense=function(i,a){O.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(r.mediaKeySystemDomain),S=this._createLicenseXhr(s,i,a);O.logger.log("Sending license request to URL: "+s);var x=this._generateLicenseRequestChallenge(r,i);S.send(x)}catch(T){O.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(Y.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(i,a){if(!this._emeEnabled)return;var r=a.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var i=this._media,a=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(r){if(r.mediaKeysSession)return r.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(i,a){if(!this._emeEnabled)return;var r=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(H.KeySystems.WIDEVINE,r,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(q,z,P){"use strict";P.r(z);var Y=P("./src/events.ts"),N=P("./src/utils/logger.ts"),O=function(){function H(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 k=H.prototype;return k.setStreamController=function(I){this.streamController=I},k.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},k.unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching)},k.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},k.onMediaAttaching=function(I,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)}},k.checkFPS=function(I,g,p){var h=performance.now();if(g){if(this.lastTime){var c=h-this.lastTime,o=p-this.lastDroppedFrames,d=g-this.lastDecodedFrames,i=1e3*o/c,a=this.hls;if(a.trigger(Y.Events.FPS_DROP,{currentDropped:o,currentDecoded:d,totalDroppedFrames:p}),i>0&&o>a.config.fpsDroppedMonitoringThreshold*d){var r=a.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=r)&&(r=r-1,a.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:a.currentLevel}),a.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=p,this.lastDecodedFrames=g}},k.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var g=I.getVideoPlaybackQuality();this.checkFPS(I,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},H}();z.default=O},"./src/controller/fragment-finders.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"findFragmentByPDT",function(){return O}),P.d(z,"findFragmentByPTS",function(){return H}),P.d(z,"fragmentWithinToleranceTest",function(){return k}),P.d(z,"pdtWithinToleranceTest",function(){return n}),P.d(z,"findFragWithCC",function(){return I});var Y=P("./src/polyfills/number.ts"),N=P("./src/utils/binary-search.ts");function O(g,p,h){if(p===null||!Array.isArray(g)||!g.length||!Object(Y.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 i=g[d];if(n(p,h,i))return i}return null}function H(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&&k(h,c,o)===0)return o;var d=N.default.search(p,k.bind(null,h,c));return d||o}function k(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 I(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(q,z,P){"use strict";P.r(z),P.d(z,"FragmentState",function(){return O}),P.d(z,"FragmentTracker",function(){return H});var Y=P("./src/events.ts"),N=P("./src/types/loader.ts"),O;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(O||(O={}));var H=function(){function I(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var g=I.prototype;return g._registerListeners=function(){var h=this.hls;h.on(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var h=this.hls;h.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(Y.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 i=d.length;i--;){var a=d[i],r=a?a.end:o.appendedPTS;if(a.start<=h&&r!==void 0&&h<=r)return i>9&&(this.activeParts=d.slice(i-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),i=d.length;i--;){var a=o[d[i]];if((a==null?void 0:a.body.type)===c&&a.buffered){var r=a.body;if(r.start<=h&&h<=r.end)return r}}return null},g.detectEvictedFragments=function(h,c,o){var d=this;Object.keys(this.fragments).forEach(function(i){var a=d.fragments[i];if(!a)return;if(!a.buffered){a.body.type===o&&d.removeFragment(a.body);return}var r=a.range[h];if(!r)return;r.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,i=h.part;if(!o||d.sn==="initSegment")return;var a=n(d),r=this.fragments[a];if(!r)return;Object.keys(o).forEach(function(s){var S=d.elementaryStreams[s];if(!S)return;var x=o[s],T=i!==null||S.partial===!0;r.range[s]=c.getBufferedTimes(d,i,T,x)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.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 i={time:[],partial:o},a=c?c.start:h.start,r=c?c.end:h.end,s=h.minEndPTS||r,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){i.time.push({startPTS:Math.max(a,d.start(x)),endPTS:Math.min(r,d.end(x))});break}else if(a<A&&r>T)i.partial=!0,i.time.push({startPTS:Math.max(a,d.start(x)),endPTS:Math.min(r,d.end(x))});else if(r<=T)break}return i},g.getPartialFragment=function(h){var c=null,o,d,i,a=0,r=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(S){var x=s[S];if(!x)return;k(x)&&(d=x.body.start-r,i=x.body.end+r,h>=d&&h<=i&&(o=Math.min(h-d,i-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?k(o)?O.PARTIAL:O.OK:o.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},g.backtrack=function(h,c){var o=n(h),d=this.fragments[o];if(!d||d.backtrack)return null;var i=d.backtrack=c||d.loaded;return d.loaded=null,i},g.getBacktrackData=function(h){var c=n(h),o=this.fragments[c];if(o){var d,i=o.backtrack;if(i!=null&&(d=i.payload)!==null&&d!==void 0&&d.byteLength)return i;this.removeFragment(h)}return null},g.isTimeBuffered=function(h,c,o){for(var d,i,a=0;a<o.length;a++){if(d=o.start(a)-this.bufferPadding,i=o.end(a)+this.bufferPadding,h>=d&&c<=i)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 i=n(o);this.fragments[i]={body:o,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(h,c){var o=this,d=c.frag,i=c.part,a=c.timeRanges;if(d.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=d,i){var r=this.activeParts;r||(this.activeParts=r=[]),r.push(i)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var S=a[s];if(o.detectEvictedFragments(s,S),!i)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(i){var a=d.fragments[i];if(!a)return;if(a.buffered){var r=a.body;r.type===o&&r.start<c&&r.end>h&&d.removeFragment(r)}})},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},I}();function k(I){var g,p;return I.buffered&&(((g=I.range.video)===null||g===void 0?void 0:g.partial)||((p=I.range.audio)===null||p===void 0?void 0:p.partial))}function n(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"STALL_MINIMUM_DURATION_MS",function(){return k}),P.d(z,"MAX_START_GAP_JUMP",function(){return n}),P.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),P.d(z,"SKIP_BUFFER_RANGE_START",function(){return g}),P.d(z,"default",function(){return p});var Y=P("./src/utils/buffer-helper.ts"),N=P("./src/errors.ts"),O=P("./src/events.ts"),H=P("./src/utils/logger.ts"),k=250,n=2,I=.1,g=.05,p=function(){function h(o,d,i,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=i,this.hls=a}var c=h.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(d){var i=this.config,a=this.media,r=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,r!==null){if(this.stallReported){var A=self.performance.now()-r;H.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||!Y.BufferHelper.getBuffered(a).length)return;var w=Y.BufferHelper.bufferInfo(a,s,0),v=w.len>0,E=w.nextStart||0;if(!v&&!E)return;if(S){var m=w.len>n,f=!E||E-s>n&&!this.fragmentTracker.getPartialFragment(s);if(m||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,b=Math.max(E,w.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=y==null||((C=y.details)===null||C===void 0)?void 0:C.live,W=M?y.details.targetduration*2:n;if(b>0&&b<=W){this._trySkipBufferHole(null);return}}var L=self.performance.now();if(r===null){this.stalled=L;return}var K=L-r;!S&&K>=k&&this._reportStall(w.len);var F=Y.BufferHelper.bufferInfo(a,s,i.maxBufferHole);this._tryFixBufferStall(F,K)},c._tryFixBufferStall=function(d,i){var a=this.config,r=this.fragmentTracker,s=this.media,S=s.currentTime,x=r.getPartialFragment(S);if(x){var T=this._trySkipBufferHole(x);if(T)return}d.len>a.maxBufferHole&&i>a.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(d){var i=this.hls,a=this.media,r=this.stallReported;r||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+d+")"),i.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var i=this.config,a=this.hls,r=this.media,s=r.currentTime,S=0,x=Y.BufferHelper.getBuffered(r),T=0;T<x.length;T++){var A=x.start(T);if(s+i.maxBufferHole>=S&&s<A){var w=Math.max(A+g,r.currentTime+I);return H.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+w),this.moved=!0,this.stalled=null,r.currentTime=w,d&&a.trigger(O.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,i=this.hls,a=this.media,r=a.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<d.nudgeMaxRetry){var S=r+s*d.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+r+" to "+S),a.currentTime=S,i.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+d.nudgeMaxRetry+" nudges"),i.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/events.ts"),N=P("./src/utils/texttrack-utils.ts"),O=P("./src/demux/id3.ts"),H=.25,k=function(){function n(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var I=n.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var p=this.hls;p.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var p=this.hls;p.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(p,h){this.media=h.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.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")},I.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,i=0;i<o.length;i++){var a=O.getID3Frames(o[i].data);if(a){var r=o[i].pts,s=i<o.length-1?o[i+1].pts:c.end,S=s-r;S<=0&&(s=r+H);for(var x=0;x<a.length;x++){var T=a[x];if(!O.isTimeStampFrame(T)){var A=new d(r,s,"");A.value=T,this.id3Track.addCue(A)}}}}},I.onBufferFlushing=function(p,h){var c=h.startOffset,o=h.endOffset,d=h.type;if(!d||d==="audio"){var i=this.id3Track;i&&Object(N.removeCuesInRange)(i,c,o)}},n}();z.default=k},"./src/controller/latency-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return n});var Y=P("./src/errors.ts"),N=P("./src/events.ts"),O=P("./src/utils/logger.ts");function H(I,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(I,h.key,h)}}function k(I,g,p){return g&&H(I.prototype,g),p&&H(I,p),I}var n=function(){function I(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=I.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!==Y.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.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,i=d.lowLatencyMode,a=d.maxLiveSyncPlaybackRate;if(!i||a===1)return;var r=this.targetLatency;if(r===null)return;var s=o-r,S=Math.min(this.maxLatency,r+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},k(I,[{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,i=this.config,a=i.liveSyncDuration,r=i.liveSyncDurationCount,s=i.lowLatencyMode,S=this.hls.userConfig,x=s&&o||c;(S.liveSyncDuration||S.liveSyncDurationCount||x===0)&&(x=a!==void 0?a:r*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,i=h-c-this.edgeStalled,a=d-o.totalduration,r=d-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(a,i),r)}},{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}}]),I}()},"./src/controller/level-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return i});var Y=P("./src/types/level.ts"),N=P("./src/events.ts"),O=P("./src/errors.ts"),H=P("./src/utils/codecs.ts"),k=P("./src/controller/level-helper.ts"),n=P("./src/controller/base-playlist-controller.ts"),I=P("./src/types/loader.ts");function g(){return g=Object.assign||function(a){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var S in s)Object.prototype.hasOwnProperty.call(s,S)&&(a[S]=s[S])}return a},g.apply(this,arguments)}function p(a,r){for(var s=0;s<r.length;s++){var S=r[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,r,s){return r&&p(a.prototype,r),s&&p(a,s),a}function c(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,o(a,r)}function o(a,r){return o=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S},o(a,r)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(a){c(r,a);function r(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=r.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=[],E,m={},f,C=!1,b=!1,y=!1;if(T.levels.forEach(function(K){var F=K.attrs;C=C||!!(K.width&&K.height),b=b||!!K.videoCodec,y=y||!!K.audioCodec,d&&K.audioCodec&&K.audioCodec.indexOf("mp4a.40.34")!==-1&&(K.audioCodec=void 0);var R=K.bitrate+"-"+K.attrs.RESOLUTION+"-"+K.attrs.CODECS;f=m[R],f?f.url.push(K.url):(f=new Y.Level(K),m[R]=f,A.push(f)),F&&(F.AUDIO&&Object(k.addGroupId)(f,"audio",F.AUDIO),F.SUBTITLES&&Object(k.addGroupId)(f,"text",F.SUBTITLES))}),(C||b)&&y&&(A=A.filter(function(K){var F=K.videoCodec,R=K.width,V=K.height;return!!F||!!(R&&V)})),A=A.filter(function(K){var F=K.audioCodec,R=K.videoCodec;return(!F||Object(H.isCodecSupportedInMp4)(F,"audio"))&&(!R||Object(H.isCodecSupportedInMp4)(R,"video"))}),T.audioTracks&&(w=T.audioTracks.filter(function(K){return!K.audioCodec||Object(H.isCodecSupportedInMp4)(K.audioCodec,"audio")}),Object(k.assignTrackIdsByGroup)(w)),T.subtitles&&(v=T.subtitles,Object(k.assignTrackIdsByGroup)(v)),A.length>0){E=A[0].bitrate,A.sort(function(K,F){return K.bitrate-F.bitrate}),this._levels=A;for(var M=0;M<A.length;M++)if(A[M].bitrate===E){this._firstLevel=M,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+E);break}var W=y&&!b,L={levels:A,audioTracks:w,subtitleTracks:v,firstLevel:this._firstLevel,stats:T.stats,audio:y,video:b,altAudio:!W&&w.some(function(K){return!!K.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:O.ErrorTypes.MEDIA_ERROR,details:O.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===I.PlaylistContextType.AUDIO_TRACK&&w.audioGroupIds&&A.groupId===w.audioGroupIds[w.urlId]||A.type===I.PlaylistContextType.SUBTITLE_TRACK&&w.textGroupIds&&A.groupId===w.textGroupIds[w.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,E=!0,m;switch(T.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: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 O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(E=!1),m=A.level),v=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:m=T.level,v=!0;break}m!==void 0&&this.recoverLevel(T,m,v,E)},s.recoverLevel=function(x,T,A,w){var v=x.details,E=this._levels[T];if(E.loadError++,A){var m=this.retryLoadingOrFail(x);if(m)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var f=E.url.length;if(f>1&&E.loadError<f)x.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var C=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(v+": switch to "+C),x.levelRetry=!0,this.hls.nextAutoLevel=C)}}},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===I.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,E=this._levels[w];if(!E){var m;this.warn("Invalid level index "+w),(m=T.deliveryDirectives)!==null&&m!==void 0&&m.skip&&(v.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(w,T,E.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,E=0;E<A.audioGroupIds.length;E++)if(A.audioGroupIds[E]===v){w=E;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(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}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(E,m){return m!==T},w=this._levels.filter(function(v,E){return E!==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,E){var m=v.details;return m!=null&&m.fragments&&m.fragments.forEach(function(f){f.level=E}),v});this._levels=w,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:w})},h(r,[{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:O.ErrorTypes.OTHER_ERROR,details:O.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,E=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 C=m.details;if(!C||C.live){var b=this.switchParams(m.uri,E==null?void 0:E.details);this.loadPlaylist(b)}}},{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)}}]),r}(n.default)},"./src/controller/level-helper.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"addGroupId",function(){return O}),P.d(z,"assignTrackIdsByGroup",function(){return H}),P.d(z,"updatePTS",function(){return k}),P.d(z,"updateFragPTSDTS",function(){return I}),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 i}),P.d(z,"getPartWith",function(){return a});var Y=P("./src/polyfills/number.ts"),N=P("./src/utils/logger.ts");function O(r,s,S){switch(s){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(S);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(S);break}}function H(r){var s={};r.forEach(function(S){var x=S.groupId||"";S.id=s[x]=s[x]||0,s[x]++})}function k(r,s,S){var x=r[s],T=r[S];n(x,T)}function n(r,s){var S=s.startPTS;if(Object(Y.isFiniteNumber)(S)){var x=0,T;s.sn>r.sn?(x=S-r.start,T=r):(x=r.start-S,T=s),T.duration!==x&&(T.duration=x)}else if(s.sn>r.sn){var A=r.cc===s.cc;A&&r.minEndPTS?s.start=r.start+(r.minEndPTS-r.start):s.start=r.start+r.duration}else s.start=Math.max(r.start-s.duration,0)}function I(r,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,E=x,m=s.startPTS,f=s.endPTS;if(Object(Y.isFiniteNumber)(m)){var C=Math.abs(m-S);Object(Y.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(C,s.deltaPTS):s.deltaPTS=C,v=Math.max(S,m),S=Math.min(S,m),T=Math.min(T,s.startDTS),E=Math.min(x,f),x=Math.max(x,f),A=Math.max(A,s.endDTS)}s.duration=x-S;var b=S-s.start;s.appendedPTS=x,s.start=s.startPTS=S,s.maxStartPTS=v,s.startDTS=T,s.endPTS=x,s.minEndPTS=E,s.endDTS=A;var y=s.sn;if(!r||y<r.startSN||y>r.endSN)return 0;var M,W=y-r.startSN,L=r.fragments;for(L[W]=s,M=W;M>0;M--)n(L[M],L[M-1]);for(M=W;M<L.length-1;M++)n(L[M],L[M+1]);return r.fragmentHint&&n(L[L.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,b}function g(r,s){for(var S=null,x=r.fragments,T=x.length-1;T>=0;T--){var A=x[T].initSegment;if(A){S=A;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var w=0,v;if(h(r,s,function(M,W){M.relurl&&(w=M.cc-W.cc),Object(Y.isFiniteNumber)(M.startPTS)&&Object(Y.isFiniteNumber)(M.endPTS)&&(W.start=W.startPTS=M.startPTS,W.startDTS=M.startDTS,W.appendedPTS=M.appendedPTS,W.maxStartPTS=M.maxStartPTS,W.endPTS=M.endPTS,W.endDTS=M.endDTS,W.minEndPTS=M.minEndPTS,W.duration=M.endPTS-M.startPTS,W.duration&&(v=W),s.PTSKnown=s.alignedSliding=!0),W.elementaryStreams=M.elementaryStreams,W.loader=M.loader,W.stats=M.stats,W.urlId=M.urlId,M.initSegment&&(W.initSegment=M.initSegment,S=M.initSegment)}),S){var E=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;E.forEach(function(M){var W;(!M.initSegment||M.initSegment.relurl===((W=S)===null||W===void 0?void 0:W.relurl))&&(M.initSegment=S)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(M){return!M}),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 C=0;C<f.length;C++)f[C].cc+=w}s.skippedSegments&&(s.startCC=s.fragments[0].cc),p(r.partList,s.partList,function(M,W){W.elementaryStreams=M.elementaryStreams,W.stats=M.stats}),v?I(s,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):c(r,s),f.length&&(s.totalduration=s.edge-f[0].start),s.driftStartTime=r.driftStartTime,s.driftStart=r.driftStart;var b=s.advancedDateTime;if(s.advanced&&b){var y=s.edge;s.driftStart||(s.driftStartTime=b,s.driftStart=y),s.driftEndTime=b,s.driftEnd=y}else s.driftEndTime=r.driftEndTime,s.driftEnd=r.driftEnd,s.advancedDateTime=r.advancedDateTime}function p(r,s,S){if(r&&s)for(var x=0,T=0,A=r.length;T<=A;T++){var w=r[T],v=s[T+x];w&&v&&w.index===v.index&&w.fragment.sn===v.fragment.sn?S(w,v):x--}}function h(r,s,S){for(var x=s.skippedSegments,T=Math.max(r.startSN,s.startSN)-s.startSN,A=(r.fragmentHint?1:0)+(x?s.endSN:Math.min(r.endSN,s.endSN))-s.startSN,w=s.startSN-r.startSN,v=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,E=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,m=T;m<=A;m++){var f=E[w+m],C=v[m];x&&!C&&m<x&&(C=s.fragments[m]=f),f&&C&&S(f,C)}}function c(r,s){var S=s.startSN+s.skippedSegments-r.startSN,x=r.fragments;if(S<0||S>=x.length)return;o(s,x[S].start)}function o(r,s){if(s){for(var S=r.fragments,x=r.skippedSegments;x<S.length;x++)S[x].start+=s;r.fragmentHint&&(r.fragmentHint.start+=s)}}function d(r,s){var S=1e3*r.levelTargetDuration,x=S/2,T=r.age,A=T>0&&T<S*3,w=s.loading.end-s.loading.start,v,E=r.availabilityDelay;if(r.updated===!1)if(A){var m=333*r.misses;v=Math.max(Math.min(x,w*2),m),r.availabilityDelay=(r.availabilityDelay||0)+v}else v=x;else A?(E=Math.min(E||S/2,T),r.availabilityDelay=E,v=E+S-T):v=S-w;return Math.round(v)}function i(r,s,S){if(!r||!r.details)return null;var x=r.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(r,s,S){if(!r||!r.details)return null;var x=r.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(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return x});var Y=P("./src/polyfills/number.ts"),N=P("./src/controller/base-stream-controller.ts"),O=P("./src/is-supported.ts"),H=P("./src/events.ts"),k=P("./src/utils/buffer-helper.ts"),n=P("./src/controller/fragment-tracker.ts"),I=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 i(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&&i(T.prototype,A),w&&i(T,w),T}function r(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,E){return v.__proto__=E,v},s(T,A)}var S=100,x=function(T){r(A,T);function A(v,E){var m;return m=T.call(this,v,E,"[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 E=this.hls;E.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(H.Events.ERROR,this.onError,this),E.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var E=this.hls;E.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(H.Events.ERROR,this.onError,this),E.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},w.startLoad=function(E){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 C=f.startLevel;C===-1&&(f.config.testBandwidth?(C=0,this.bitrateTest=!0):C=f.nextAutoLevel),this.level=f.nextLoadLevel=C,this.loadedmetadata=!1}m>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),E=m),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,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 E,m=this.levels,f=this.level,C=m==null||((E=m[f])===null||E===void 0)?void 0:E.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var b,y=self.performance.now(),M=this.retryDate;(!M||y>=M||(b=this.media)!==null&&b!==void 0&&b.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 E,m,f=this.hls,C=this.levelLastLoaded,b=this.levels,y=this.media,M=f.config,W=f.nextLoadLevel;if(C===null||!y&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[W])return;var L=b[W];this.level=f.nextLoadLevel=W;var K=L.details;if(!K||this.state===N.State.WAITING_LEVEL||K.live&&this.levelLastLoaded!==W){this.state=N.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,I.PlaylistLevelType.MAIN);if(F===null)return;var R=F.len,V=this.getMaxBufferLength(L.maxBitrate);if(R>=V)return;if(this._streamEnded(F,K)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,ne),this.state=N.State.ENDED;return}var se=F.end,Se=this.getNextFragment(se,K);if(this.couldBacktrack&&!this.fragPrevious&&Se&&Se.sn!=="initSegment"){var Le=Se.sn-K.startSN;Le>1&&(Se=K.fragments[Le-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(y,Ae,I.PlaylistLevelType.MAIN),Se=this.getNextFragment(this.nextLoadPosition,K)}if(!Se)return;Se.initSegment&&!Se.initSegment.data&&!this.bitrateTest&&(Se=Se.initSegment),((E=Se.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((m=Se.decryptdata)!==null&&m!==void 0&&m.key)?this.loadKey(Se,K):this.loadFragment(Se,K,se)},w.loadFragment=function(E,m,f){var C,b=this.fragmentTracker.getState(E);if(this.fragCurrent=E,b===n.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(E);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else b=n.FragmentState.NOT_LOADED}b===n.FragmentState.NOT_LOADED||b===n.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,E,m,f)):b===n.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(E){var m=this.fragmentTracker.getAppendedFrag(E,I.PlaylistLevelType.MAIN);return m&&"fragment"in m?m.fragment:m},w.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,I.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var E=this.levels,m=this.media;if(m!=null&&m.readyState){var f,C=this.getAppendedFrag(m.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!m.paused&&E){var b=this.hls.nextLoadLevel,y=E[b],M=this.fragLastKbps;M&&this.fragCurrent?f=this.fragCurrent.duration*y.maxBitrate/(1e3*M)+1:f=0}else f=0;var W=this.getBufferedFrag(m.currentTime+f);if(W){var L=this.followingBufferedFrag(W);if(L){this.abortCurrentFrag();var K=L.maxStartPTS?L.maxStartPTS:L.start,F=L.duration,R=Math.max(W.end,K+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(R,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(E,m){T.prototype.flushMainBuffer.call(this,E,m,this.altAudio?"video":null)},w.onMediaAttached=function(E,m){T.prototype.onMediaAttached.call(this,E,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 E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var E=this.media,m=E?E.currentTime:null;Object(Y.isFiniteNumber)(m)&&this.log("Media seeked to "+m.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(E,m){var f=!1,C=!1,b;m.levels.forEach(function(y){b=y.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(f=!0),b.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=f&&C&&!Object(O.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(E,m){var f=this.levels;if(!f||this.state!==N.State.IDLE)return;var C=f[m.level];(!C.details||C.details.live&&this.levelLastLoaded!==m.level||this.waitForCdnTuneIn(C.details))&&(this.state=N.State.WAITING_LEVEL)},w.onLevelLoaded=function(E,m){var f,C=this.levels,b=m.level,y=m.details,M=y.totalduration;if(!C){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+M);var W=this.fragCurrent;W&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==m.level&&W.loader&&(this.state=N.State.IDLE,W.loader.abort()));var L=C[b],K=0;if(y.live||(f=L.details)!==null&&f!==void 0&&f.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;K=this.alignPlaylists(y,L.details)}if(L.details=y,this.levelLastLoaded=b,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:y,level:b}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=N.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,K),this.tick()},w._handleFragmentLoadProgress=function(E){var m,f=E.frag,C=E.part,b=E.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var M=y[f.level],W=M.details;if(!W){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var L=M.videoCodec,K=W.PTSKnown||!W.live,F=(m=f.initSegment)===null||m===void 0?void 0:m.data,R=this._getAudioCodec(M),V=this.transmuxer=this.transmuxer||new p.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=C?C.index:-1,se=ne!==-1,Se=new h.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,b.byteLength,ne,se),Le=this.initPTS[f.cc];V.push(b,F,R,L,f,C,W.totalduration,K,Se,Le)},w.onAudioTrackSwitching=function(E,m){var f=this.altAudio,C=!!m.url,b=m.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;f&&M.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:b})}},w.onAudioTrackSwitched=function(E,m){var f=m.id,C=!!this.hls.audioTracks[f].url;if(C){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=C,this.tick()},w.onBufferCreated=function(E,m){var f=m.tracks,C,b,y=!1;for(var M in f){var W=f[M];if(W.id==="main"){if(b=M,C=W,M==="video"){var L=f[M];L&&(this.videoBuffer=L.buffer)}}else y=!0}y&&C?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(E,m){var f=m.frag,C=m.part;if(f&&f.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(C?" p: "+C.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 b=C?C.stats:f.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,C)},w.onError=function(E,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(I.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,C=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);C&&C.len>.5&&(f=!this.reduceMaxBufferLength(C.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 E=this.media,m=this.gapController;if(!E||!m||!E.readyState)return;var f=k.BufferHelper.getBuffered(E);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):m.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(E,m){var f=m.type;if(f!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(f===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,f,I.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(E,m){this.levels=m.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var E=this.media,m=E.currentTime,f=this.startPosition;if(f>=0&&m<f){if(E.seeking){d.logger.log("could not seek to "+f+", already seeking at "+m);return}var C=k.BufferHelper.getBuffered(E),b=C.length?C.start(0):0,y=b-f;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+y+" to match buffer start"),f+=y,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+m),E.currentTime=f}},w._getAudioCodec=function(E){var m=this.config.defaultAudioCodec||E.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(E){var m=this;this._doFragLoad(E).then(function(f){var C=m.hls;if(!f||C.nextLoadLevel||m.fragContextChanged(E))return;m.fragLoadError=0,m.state=N.State.IDLE,m.startFragRequested=!1,m.bitrateTest=!1;var b=E.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),C.trigger(H.Events.FRAG_LOADED,f)})},w._handleTransmuxComplete=function(E){var m,f="main",C=this.hls,b=E.remuxResult,y=E.chunkMeta,M=this.getCurrentContext(y);if(!M){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var W=M.frag,L=M.part,K=M.level,F=b.video,R=b.text,V=b.id3,ne=b.initSegment,se=this.altAudio?void 0:b.audio;if(this.fragContextChanged(W))return;if(this.state=N.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(K,ne.tracks,W,y),C.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:f,tracks:ne.tracks}));var Se=ne.initPTS,Le=ne.timescale;Object(Y.isFiniteNumber)(Se)&&(this.initPTS[W.cc]=Se,C.trigger(H.Events.INIT_PTS_FOUND,{frag:W,id:f,initPTS:Se,timescale:Le}))}if(F&&b.independent!==!1){if(K.details){var Ae=F.startPTS,Pe=F.endPTS,Fe=F.startDTS,je=F.endDTS;if(L)L.elementaryStreams[F.type]={startPTS:Ae,endPTS:Pe,startDTS:Fe,endDTS:je};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var Te=this.getLoadPosition()+this.config.maxBufferHole;if(Te<Ae){this.backtrack(W);return}W.setElementaryStreamInfo(F.type,W.start,Pe,W.start,je,!0)}W.setElementaryStreamInfo(F.type,Ae,Pe,Fe,je),this.bufferFragmentData(F,W,L,y)}}else if(b.independent===!1){this.backtrack(W);return}if(se){var Z=se.startPTS,U=se.endPTS,G=se.startDTS,ee=se.endDTS;L&&(L.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:Z,endPTS:U,startDTS:G,endDTS:ee}),W.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,Z,U,G,ee),this.bufferFragmentData(se,W,L,y)}if(V!=null&&(m=V.samples)!==null&&m!==void 0&&m.length){var ue={frag:W,id:f,samples:V.samples};C.trigger(H.Events.FRAG_PARSING_METADATA,ue)}if(R){var J={frag:W,id:f,samples:R.samples};C.trigger(H.Events.FRAG_PARSING_USERDATA,J)}},w._bufferInitSegment=function(E,m,f,C){var b=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!m.audio&&!m.video,this.altAudio&&!this.audioOnly&&delete m.audio;var y=m.audio,M=m.video,W=m.audiovideo;if(y){var L=E.audioCodec,K=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(L&&(L.indexOf("mp4a.40.5")!==-1?L="mp4a.40.2":L="mp4a.40.5"),y.metadata.channelCount!==1&&K.indexOf("firefox")===-1&&(L="mp4a.40.5")),K.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(L="mp4a.40.2",this.log("Android: force audio codec to "+L)),E.audioCodec&&E.audioCodec!==L&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+L+'"'),y.levelCodec=L,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(L||"")+"/"+(E.audioCodec||"")+"/"+y.codec+"]")}M&&(M.levelCodec=E.videoCodec,M.id="main",this.log("Init video buffer, container:"+M.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+M.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,m),Object.keys(m).forEach(function(F){var R=m[F],V=R.initSegment;V!=null&&V.byteLength&&b.hls.trigger(H.Events.BUFFER_APPENDING,{type:F,data:V,frag:f,part:null,chunkMeta:C,parent:f.type})}),this.tick()},w.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var m=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,m?this.resetFragmentLoading(E):this.state=N.State.BACKTRACKING},w.checkFragmentChanged=function(){var E=this.media,m=null;if(E&&E.readyState>1&&E.seeking===!1){var f=E.currentTime;if(k.BufferHelper.isBuffered(E,f)?m=this.getAppendedFrag(f):k.BufferHelper.isBuffered(E,f+.1)&&(m=this.getAppendedFrag(f+.1)),m){var C=this.fragPlaying,b=m.level;(!C||m.sn!==C.sn||C.level!==b||m.urlId!==C.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:m}),(!C||C.level!==b)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=m)}}},a(A,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var m=this.getAppendedFrag(E.currentTime);if(m)return m.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var m=this.getAppendedFrag(E.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(q,z,P){"use strict";P.r(z),P.d(z,"SubtitleStreamController",function(){return r});var Y=P("./src/events.ts"),N=P("./src/utils/logger.ts"),O=P("./src/utils/buffer-helper.ts"),H=P("./src/controller/fragment-finders.ts"),k=P("./src/utils/discontinuities.ts"),n=P("./src/controller/level-helper.ts"),I=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,i(s,S)}function i(s,S){return i=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},i(s,S)}var a=500,r=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(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(Y.Events.ERROR,this.onError,this),A.on(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var A=this.hls;A.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(Y.Events.ERROR,this.onError,this),A.off(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(Y.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,E=w.success;if(this.fragPrevious=v,this.state=g.State.IDLE,!E)return;var m=this.tracksBuffered[this.currentTrackId];if(!m)return;for(var f,C=v.start,b=0;b<m.length;b++)if(C>=m[b].start&&C<=m[b].end){f=m[b];break}var y=v.start+v.duration;f?f.end=y:(f={start:C,end:y},m.push(f)),this.fragmentTracker.fragBuffered(v)},x.onBufferFlushing=function(A,w){var v=w.startOffset,E=w.endOffset;if(v===0&&E!==Number.POSITIVE_INFINITY){var m=this.currentTrackId,f=this.levels;if(!f.length||!f[m]||!f[m].details)return;var C=f[m].details,b=C.targetduration,y=E-b;if(y<=0)return;w.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(M){for(var W=0;W<M.length;){if(M[W].end<=y){M.shift();continue}else if(M[W].start<y)M[W].start=y;else break;W++}}),this.fragmentTracker.removeFragmentsInRange(v,y,p.PlaylistLevelType.SUBTITLE)}},x.onError=function(A,w){var v,E=w.frag;if(!E||E.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,E=w.subtitleTracks;this.tracksBuffered=[],this.levels=E.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,E=w.details,m=w.id,f=this.currentTrackId,C=this.levels;if(!C.length)return;var b=C[f];if(m>=C.length||m!==f||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(v=b.details)!==null&&v!==void 0&&v.live){var y=this.mainDetails;if(E.deltaUpdateFailed||!y)return;var M=y.fragments[0];if(!b.details)E.hasProgramDateTime&&y.hasProgramDateTime?Object(k.alignMediaPlaylistByPDT)(E,y):M&&Object(n.addSliding)(E,M.start);else{var W=this.alignPlaylists(E,b.details);W===0&&M&&Object(n.addSliding)(E,M.start)}}if(b.details=E,this.levelLastLoaded=m,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var L=Object(H.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);L||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},x._handleFragmentLoadComplete=function(A){var w=A.frag,v=A.payload,E=w.decryptdata,m=this.hls;if(this.fragContextChanged(w))return;if(v&&v.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),E.key.buffer,E.iv.buffer).then(function(C){var b=performance.now();m.trigger(Y.Events.FRAG_DECRYPTED,{frag:w,payload:C,stats:{tstart:f,tdecrypt:b}})})}},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 E=v[w].details,m=E.targetduration,f=this.config,C=this.media,b=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-m,f.maxBufferHole),y=b.end,M=b.len,W=this.getMaxBufferLength()+m;if(M>W)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var L=E.fragments,K=L.length,F=E.edge,R,V=this.fragPrevious;if(y<F){var ne=f.maxFragLookUpTolerance;V&&E.hasProgramDateTime&&(R=Object(H.findFragmentByPDT)(L,V.endProgramDateTime,ne)),R||(R=Object(H.findFragmentByPTS)(V,L,y,ne),!R&&V&&V.start<L[0].start&&(R=L[0]))}else R=L[K-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(Y.Events.KEY_LOADING,{frag:R})):R&&this.fragmentTracker.getState(R)===I.FragmentState.NOT_LOADED&&this.loadFragment(R,E,y)}},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(q,z,P){"use strict";P.r(z);var Y=P("./src/events.ts"),N=P("./src/utils/texttrack-utils.ts"),O=P("./src/controller/base-playlist-controller.ts"),H=P("./src/types/loader.ts");function k(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,o,d){return o&&k(c.prototype,o),d&&k(c,d),c}function I(c,o){c.prototype=Object.create(o.prototype),c.prototype.constructor=c,g(c,o)}function g(c,o){return g=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},g(c,o)}var p=function(c){I(o,c);function o(i){var a;return a=c.call(this,i,"[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(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(Y.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var a=this.hls;a.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(Y.Events.ERROR,this.onError,this)},d.onMediaAttached=function(a,r){if(this.media=r.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(r){Object(N.clearCurrentCues)(r)}),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,r){this.tracks=r.subtitleTracks},d.onSubtitleTrackLoaded=function(a,r){var s=r.id,S=r.details,x=this.trackId,T=this.tracksInGroup[x];if(!T){this.warn("Invalid subtitle track id "+s);return}var A=T.details;T.details=r.details,this.log("subtitle track "+s+" loaded ["+S.startSN+"-"+S.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,r,A))},d.onLevelLoading=function(a,r){this.switchLevel(r.level)},d.onLevelSwitching=function(a,r){this.switchLevel(r.level)},d.switchLevel=function(a){var r=this.hls.levels[a];if(!(r!=null&&r.textGroupIds))return;var s=r.textGroupIds[r.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(Y.Events.SUBTITLE_TRACKS_UPDATED,A),T!==-1&&this.setSubtitleTrack(T,S)}},d.findTrackId=function(a){for(var r=this.tracksInGroup,s=0;s<r.length;s++){var S=r[s];if((!this.selectDefaultTrack||S.default)&&(!a||a===S.name))return S.id}return-1},d.onError=function(a,r){if(c.prototype.onError.call(this,a,r),r.fatal||!r.context)return;r.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},d.loadPlaylist=function(a){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var s=r.id,S=r.groupId,x=r.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(Y.Events.SUBTITLE_TRACK_LOADING,{url:x,id:s,groupId:S,deliveryDirectives:a||null})}},d.toggleTrackModes=function(a){var r=this,s=this.media,S=this.subtitleDisplay,x=this.trackId;if(!s)return;var T=h(s.textTracks),A=T.filter(function(E){return E.groupId===r.groupId});if(a===-1)[].slice.call(T).forEach(function(E){E.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,r){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,E=x.type,m=x.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:w,name:v,type:E,url:m});var f=this.switchParams(x.url,r==null?void 0:r.details);this.loadPlaylist(f)}else this.hls.trigger(Y.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,r=h(this.media.textTracks),s=0;s<r.length;s++)if(r[s].mode==="hidden")a=s;else if(r[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 r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,r)}}]),o}(O.default);function h(c){for(var o=[],d=0;d<c.length;d++){var i=c[d];i.kind==="subtitles"&&i.label&&o.push(c[d])}return o}z.default=p},"./src/controller/timeline-controller.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"TimelineController",function(){return h});var Y=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),O=P("./src/utils/cea-608-parser.ts"),H=P("./src/utils/output-filter.ts"),k=P("./src/utils/webvtt-parser.ts"),n=P("./src/utils/texttrack-utils.ts"),I=P("./src/utils/imsc1-ttml-parser.ts"),g=P("./src/types/loader.ts"),p=P("./src/utils/logger.ts"),h=function(){function i(r){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=r,this.config=r.config,this.Cues=r.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 H.default(this,"textTrack1"),S=new H.default(this,"textTrack2"),x=new H.default(this,"textTrack3"),T=new H.default(this,"textTrack4");this.cea608Parser1=new O.default(1,s,S),this.cea608Parser2=new O.default(3,x,T)}r.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(N.Events.FRAG_LOADING,this.onFragLoading,this),r.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=i.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 E=A[v],m=o(E[0],E[1],S,x);if(m>=0&&(E[0]=Math.min(E[0],S),E[1]=Math.max(E[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 C=this.Cues.newCue(null,S,x,T);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:C,track:s})}},a.onInitPtsFound=function(s,S){var x=this,T=S.frag,A=S.id,w=S.initPTS,v=S.timescale,E=this.unparsedVttFrags;A==="main"&&(this.initPTS[T.cc]=w,this.timescale[T.cc]=v),E.length&&(this.unparsedVttFrags=[],E.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,E=this.getExistingTrack(s);if(E)x[s]=E,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===I.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 C;if(f<v.length){for(var b=null,y=0;y<v.length;y++)if(c(v[y],m)){b=v[y];break}b&&(C=b)}C?Object(n.clearCurrentCues)(C):(C=x.createTextTrack("subtitles",m.name,m.lang),C&&(C.mode="disabled")),C&&(C.groupId=m.groupId,x.textTracks.push(C))})}else if(!w&&this.tracks&&this.tracks.length){var E=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:E})}}},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,E,m=S.frag.sn,f=(v=S==null||((E=S.part)===null||E===void 0)?void 0:E.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(Y.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 E=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),E&&E.textCodec===I.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(I.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(k.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(I.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(){T.textCodec=I.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(Y.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 E=this.captionsTracks;Object.keys(E).forEach(function(f){return Object(n.removeCuesInRange)(E[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++],E=127&s[x++],m=(4&w)!==0,f=3&w;if(v===0&&E===0)continue;m&&((f===0||f===1)&&(T[f].push(v),T[f].push(E)))}return T},i}();function c(i,a){return i&&i.label===a.name&&!(i.textTrack1||i.textTrack2)}function o(i,a,r,s){return Math.min(a,s)-Math.max(i,r)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return Y});var Y=function(){function N(H,k){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=k}var O=N.prototype;return O.decrypt=function(k,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,k)},N}()},"./src/crypt/aes-decryptor.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"removePadding",function(){return N}),P.d(z,"default",function(){return O});var Y=P("./src/utils/typed-array.ts");function N(H){var k=H.byteLength,n=k&&new DataView(H.buffer).getUint8(k-1);return n?Object(Y.sliceUint8)(H,0,k-n):H}var O=function(){function H(){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 k=H.prototype;return k.uint8ArrayToUint32Array_=function(I){for(var g=new DataView(I),p=new Uint32Array(4),h=0;h<4;h++)p[h]=g.getUint32(h*4);return p},k.initTable=function(){var I=this.sBox,g=this.invSBox,p=this.subMix,h=p[0],c=p[1],o=p[2],d=p[3],i=this.invSubMix,a=i[0],r=i[1],s=i[2],S=i[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,I[T]=v,g[v]=T;var E=x[T],m=x[E],f=x[m],C=x[v]*257^v*16843008;h[T]=C<<24|C>>>8,c[T]=C<<16|C>>>16,o[T]=C<<8|C>>>24,d[T]=C,C=f*16843009^m*65537^E*257^T*16843008,a[v]=C<<24|C>>>8,r[v]=C<<16|C>>>16,s[v]=C<<8|C>>>24,S[v]=C,T?(T=E^x[x[x[f^E]]],A^=x[x[A]]):T=A=1}},k.expandKey=function(I){for(var g=this.uint8ArrayToUint32Array_(I),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,i,a=this.keySchedule=new Uint32Array(o),r=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],E,m;for(d=0;d<o;d++){if(d<c){E=a[d]=g[d];continue}m=E,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]=E=(a[d-c]^m)>>>0}for(i=0;i<o;i++)d=o-i,i&3?m=a[d]:m=a[d-4],i<4||d<=4?r[i]=m:r[i]=T[s[m>>>24]]^A[s[m>>>16&255]]^w[s[m>>>8&255]]^v[s[m&255]],r[i]=r[i]>>>0},k.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},k.decrypt=function(I,g,p){for(var h=this.keySize+6,c=this.invKeySchedule,o=this.invSBox,d=this.invSubMix,i=d[0],a=d[1],r=d[2],s=d[3],S=this.uint8ArrayToUint32Array_(p),x=S[0],T=S[1],A=S[2],w=S[3],v=new Int32Array(I),E=new Int32Array(v.length),m,f,C,b,y,M,W,L,K,F,R,V,ne,se,Se=this.networkToHostOrderSwap;g<v.length;){for(K=Se(v[g]),F=Se(v[g+1]),R=Se(v[g+2]),V=Se(v[g+3]),y=K^c[0],M=V^c[1],W=R^c[2],L=F^c[3],ne=4,se=1;se<h;se++)m=i[y>>>24]^a[M>>16&255]^r[W>>8&255]^s[L&255]^c[ne],f=i[M>>>24]^a[W>>16&255]^r[L>>8&255]^s[y&255]^c[ne+1],C=i[W>>>24]^a[L>>16&255]^r[y>>8&255]^s[M&255]^c[ne+2],b=i[L>>>24]^a[y>>16&255]^r[M>>8&255]^s[W&255]^c[ne+3],y=m,M=f,W=C,L=b,ne=ne+4;m=o[y>>>24]<<24^o[M>>16&255]<<16^o[W>>8&255]<<8^o[L&255]^c[ne],f=o[M>>>24]<<24^o[W>>16&255]<<16^o[L>>8&255]<<8^o[y&255]^c[ne+1],C=o[W>>>24]<<24^o[L>>16&255]<<16^o[y>>8&255]<<8^o[M&255]^c[ne+2],b=o[L>>>24]<<24^o[y>>16&255]<<16^o[M>>8&255]<<8^o[W&255]^c[ne+3],E[g]=Se(m^x),E[g+1]=Se(b^T),E[g+2]=Se(C^A),E[g+3]=Se(f^w),x=K,T=F,A=R,w=V,g=g+4}return E.buffer},H}()},"./src/crypt/decrypter.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return g});var Y=P("./src/crypt/aes-crypto.ts"),N=P("./src/crypt/fast-aes-key.ts"),O=P("./src/crypt/aes-decryptor.ts"),H=P("./src/utils/logger.ts"),k=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),I=16,g=function(){function p(c,o,d){var i=d===void 0?{}:d,a=i.removePKCS7Padding,r=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=r,r)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(O.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,i,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),d,i);var r=this.flush();r&&a(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),d,i).then(a)},h.softwareDecrypt=function(o,d,i){var a=this.currentIV,r=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(o=Object(k.appendUint8Array)(s,o),this.remainderData=null);var S=this.getValidChunk(o);if(!S.length)return null;a&&(i=a);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new O.default),x.expandKey(d);var T=r;return this.currentResult=x.decrypt(S.buffer,0,i),this.currentIV=Object(n.sliceUint8)(S,-16).buffer,T||null},h.webCryptoDecrypt=function(o,d,i){var a=this,r=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new N.default(r,d)),this.fastAesKey.expandKey().then(function(s){if(!r)return Promise.reject(new Error("web crypto not initialized"));var S=new Y.default(r,i);return S.decrypt(o.buffer,s)}).catch(function(s){return a.onWebCryptoError(s,o,d,i)})},h.onWebCryptoError=function(o,d,i,a){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,i,a)},h.getValidChunk=function(o){var d=o,i=o.length-o.length%I;return i!==o.length&&(d=Object(n.sliceUint8)(o,0,i),this.remainderData=Object(n.sliceUint8)(o,i)),d},h.logOnce=function(o){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return Y});var Y=function(){function N(H,k){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=k}var O=N.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/demux/base-audio-demuxer.ts"),N=P("./src/demux/adts.ts"),O=P("./src/utils/logger.ts"),H=P("./src/demux/id3.ts");function k(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 I=function(g){k(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,i){g.prototype.resetInitSegment.call(this,o,d,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var d=H.getID3Data(o,0)||[],i=d.length,a=o.length;i<a;i++)if(N.probe(o,i))return O.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(o,d){return N.canParse(o,d)},h.appendFrame=function(o,d,i){N.initTrackConfig(o,this.observer,d,i,o.manifestCodec);var a=N.appendFrame(o,d,i,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},p}(Y.default);I.minProbeByteLength=9,z.default=I},"./src/demux/adts.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"getAudioConfig",function(){return H}),P.d(z,"isHeaderPattern",function(){return k}),P.d(z,"getHeaderLength",function(){return n}),P.d(z,"getFullFrameLength",function(){return I}),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 i}),P.d(z,"appendFrame",function(){return a});var Y=P("./src/utils/logger.ts"),N=P("./src/errors.ts"),O=P("./src/events.ts");function H(r,s,S,x){var T,A,w,v,E=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 C=(s[S+2]&60)>>>2;if(C>f.length-1){r.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return w=(s[S+2]&1)<<2,w|=(s[S+3]&192)>>>6,Y.logger.log("manifest codec:"+x+", ADTS type:"+T+", samplingIndex:"+C),/firefox/i.test(E)?C>=6?(T=5,v=new Array(4),A=C-3):(T=2,v=new Array(2),A=C):E.indexOf("android")!==-1?(T=2,v=new Array(2),A=C):(T=5,v=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&C>=6?A=C-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(C>=6&&w===1||/vivaldi/i.test(E))||!x&&w===1)&&(T=2,v=new Array(2)),A=C)),v[0]=T<<3,v[0]|=(C&14)>>1,v[1]|=(C&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[C],channelCount:w,codec:"mp4a.40."+T,manifestCodec:m}}function k(r,s){return r[s]===255&&(r[s+1]&246)===240}function n(r,s){return r[s+1]&1?7:9}function I(r,s){return(r[s+3]&3)<<11|r[s+4]<<3|(r[s+5]&224)>>>5}function g(r,s){return s+5<r.length}function p(r,s){return s+1<r.length&&k(r,s)}function h(r,s){return g(r,s)&&k(r,s)&&I(r,s)<=r.length-s}function c(r,s){if(p(r,s)){var S=n(r,s);if(s+S>=r.length)return!1;var x=I(r,s);if(x<=S)return!1;var T=s+x;return T===r.length||p(r,T)}return!1}function o(r,s,S,x,T){if(!r.samplerate){var A=H(s,S,x,T);if(!A)return;r.config=A.config,r.samplerate=A.samplerate,r.channelCount=A.channelCount,r.codec=A.codec,r.manifestCodec=A.manifestCodec,Y.logger.log("parsed codec:"+r.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function d(r){return 1024*9e4/r}function i(r,s,S,x,T){var A=n(r,s),w=I(r,s);if(w-=A,w>0){var v=S+x*T;return{headerLength:A,frameLength:w,stamp:v}}}function a(r,s,S,x,T){var A=d(r.samplerate),w=i(s,S,x,T,A);if(w){var v=w.frameLength,E=w.headerLength,m=w.stamp,f=E+v,C=Math.max(0,S+f-s.length),b;C?(b=new Uint8Array(f-E),b.set(s.subarray(S+E,s.length),0)):b=s.subarray(S+E,S+f);var y={unit:b,pts:m};return C||r.samples.push(y),{sample:y,length:f,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"initPTSFn",function(){return I});var Y=P("./src/polyfills/number.ts"),N=P("./src/demux/id3.ts"),O=P("./src/demux/dummy-demuxed-track.ts"),H=P("./src/utils/mp4-tools.ts"),k=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(H.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=N.getID3Data(c,0),i=d?d.length:0,a,r,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=I(x,o)),d&&d.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),r=this.initPTS;i<T;){if(this.canParse(c,i)){var A=this.appendFrame(s,c,i);A?(this.frameIndex++,r=A.sample.pts,i+=A.length,a=i):i=T}else N.canParse(c,i)?(d=N.getID3Data(c,i),S.samples.push({pts:r,dts:r,data:d}),i+=d.length,a=i):i++;if(i===T&&a!==T){var w=Object(k.sliceUint8)(c,a);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,w):this.cachedData=w}}return{audioTrack:s,avcTrack:Object(O.dummyTrack)(),id3Track:S,textTrack:Object(O.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(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},p.destroy=function(){},g}(),I=function(p,h){return Object(Y.isFiniteNumber)(p)?p*90:h*9e4};z.default=n},"./src/demux/chunk-cache.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return Y});var Y=function(){function O(){this.chunks=[],this.dataLength=0}var H=O.prototype;return H.push=function(n){this.chunks.push(n),this.dataLength+=n.length},H.flush=function(){var n=this.chunks,I=this.dataLength,g;if(n.length)n.length===1?g=n[0]:g=N(n,I);else return new Uint8Array(0);return this.reset(),g},H.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function N(O,H){for(var k=new Uint8Array(H),n=0,I=0;I<O.length;I++){var g=O[I];k.set(g,n),n+=g.length}return k}},"./src/demux/dummy-demuxed-track.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"dummyTrack",function(){return Y});function Y(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/utils/logger.ts"),N=function(){function O(k){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=k,this.bytesAvailable=k.byteLength,this.word=0,this.bitsAvailable=0}var H=O.prototype;return H.loadWord=function(){var n=this.data,I=this.bytesAvailable,g=n.byteLength-I,p=new Uint8Array(4),h=Math.min(4,I);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},H.skipBits=function(n){var I;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,I=n>>3,n-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},H.readBits=function(n){var I=Math.min(this.bitsAvailable,n),g=this.word>>>32-I;return n>32&&Y.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=n-I,I>0&&this.bitsAvailable?g<<I|this.readBits(I):g},H.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()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},H.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(n){for(var I=8,g=8,p,h=0;h<n;h++)g!==0&&(p=this.readEG(),g=(I+p+256)%256),I=g===0?I:g},H.readSPS=function(){var n=0,I=0,g=0,p=0,h,c,o,d=this.readUByte.bind(this),i=this.readBits.bind(this),a=this.readUEG.bind(this),r=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(i(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),r())for(c=w!==3?8:12,o=0;o<c;o++)r()&&(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 E=a(),m=a(),f=i(1);f===0&&s(1),s(1),r()&&(n=a(),I=a(),g=a(),p=a());var C=[1,1];if(r()&&r()){var b=d();switch(b){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((E+1)*16-n*2-I*2),height:(2-f)*(m+1)*16-(f?2:4)*(g+p),pixelRatio:C}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();z.default=N},"./src/demux/id3.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"isHeader",function(){return Y}),P.d(z,"isFooter",function(){return N}),P.d(z,"getID3Data",function(){return O}),P.d(z,"canParse",function(){return k}),P.d(z,"getTimeStamp",function(){return n}),P.d(z,"isTimeStampFrame",function(){return I}),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 r});var Y=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)))},O=function(T,A){for(var w=A,v=0;Y(T,A);){v+=10;var E=H(T,A+6);v+=E,N(T,A+10)&&(v+=10),A+=v}return v>0?T.subarray(w,w+v):void 0},H=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},k=function(T,A){return Y(T,A)&&H(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(I(v))return i(v)}return},I=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=H(T,4),v=10;return{type:A,size:w,data:T.subarray(v,v+w)}},p=function(T){for(var A=0,w=[];Y(T,A);){var v=H(T,A+6);A+=10;for(var E=A+v;A+8<E;){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 E=a(T.data.subarray(1));return{key:T.type,data:E}},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 E=a(T.data);return{key:T.type,data:E}},i=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 E=v.indexOf("\0");return E!==-1?v.substring(0,E):v}return v.replace(/\0/g,"")}for(var m=T.length,f,C,b,y="",M=0;M<m;){if(f=T[M++],f===0&&A)return y;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:y+=String.fromCharCode(f);break;case 12:case 13:C=T[M++],y+=String.fromCharCode((f&31)<<6|C&63);break;case 14:C=T[M++],b=T[M++],y+=String.fromCharCode((f&15)<<12|(C&63)<<6|(b&63)<<0);break;default:}}return y},r={decodeTextFrame:o},s;function S(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/demux/base-audio-demuxer.ts"),N=P("./src/demux/id3.ts"),O=P("./src/utils/logger.ts"),H=P("./src/demux/mpegaudio.ts");function k(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 I=function(g){k(p,g);function p(){return g.apply(this,arguments)||this}var h=p.prototype;return h.resetInitSegment=function(o,d,i){g.prototype.resetInitSegment.call(this,o,d,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var d=N.getID3Data(o,0)||[],i=d.length,a=o.length;i<a;i++)if(H.probe(o,i))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(o,d){return H.canParse(o,d)},h.appendFrame=function(o,d,i){return this.initPTS===null?void 0:H.appendFrame(o,d,i,this.initPTS,this.frameIndex)},p}(Y.default);I.minProbeByteLength=4,z.default=I},"./src/demux/mp4demuxer.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/utils/mp4-tools.ts"),N=P("./src/demux/dummy-demuxed-track.ts"),O=function(){function H(n,I){this.remainderData=null,this.config=void 0,this.config=I}var k=H.prototype;return k.resetTimeStamp=function(){},k.resetInitSegment=function(){},k.resetContiguity=function(){},H.probe=function(I){return Object(Y.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},k.demux=function(I){var g=I,p=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(Y.appendUint8Array)(this.remainderData,I));var h=Object(Y.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)()}},k.flush=function(){var I=Object(N.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:I,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},k.demuxSampleAes=function(I,g,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},k.destroy=function(){},H}();O.minProbeByteLength=1024,z.default=O},"./src/demux/mpegaudio.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"appendFrame",function(){return n}),P.d(z,"parseHeader",function(){return I}),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 Y=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],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],k=[0,1,1,4];function n(o,d,i,a,r){if(i+24>d.length)return;var s=I(d,i);if(s&&i+s.frameLength<=d.length){var S=s.samplesPerFrame*9e4/s.sampleRate,x=a+r*S,T={unit:d.subarray(i,i+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 I(o,d){var i=o[d+1]>>3&3,a=o[d+1]>>1&3,r=o[d+2]>>4&15,s=o[d+2]>>2&3;if(i!==1&&r!==0&&r!==15&&s!==3){var S=o[d+2]>>1&1,x=o[d+3]>>6,T=i===3?3-a:a===3?3:4,A=N[T*14+r-1]*1e3,w=i===3?0:i===2?1:2,v=O[w*3+s],E=x===3?1:2,m=H[i][a],f=k[a],C=m*8*f,b=Math.floor(m*A/v+S)*f;if(Y===null){var y=navigator.userAgent||"",M=y.match(/Chrome\/(\d+)/i);Y=M?parseInt(M[1]):0}var W=!!Y&&Y<=87;return W&&a===2&&A>=224e3&&x===0&&(o[d+3]=o[d+3]|128),{sampleRate:v,channelCount:E,frameLength:b,samplesPerFrame:C}}}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 i=4;return g(o,d)&&i<=o.length-d}function c(o,d){if(d+1<o.length&&g(o,d)){var i=4,a=I(o,d),r=i;a!=null&&a.frameLength&&(r=a.frameLength);var s=d+r;return s===o.length||p(o,s)}return!1}},"./src/demux/sample-aes.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/crypt/decrypter.ts"),N=P("./src/demux/tsdemuxer.ts"),O=function(){function H(n,I,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new Y.default(n,I,{removePKCS7Padding:!1})}var k=H.prototype;return k.decryptBuffer=function(I,g){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,g)},k.decryptAacSample=function(I,g,p,h){var c=I[g].unit,o=c.subarray(16,c.length-c.length%16),d=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),i=this;this.decryptBuffer(d,function(a){var r=new Uint8Array(a);c.set(r,16),h||i.decryptAacSamples(I,g+1,p)})},k.decryptAacSamples=function(I,g,p){for(;;g++){if(g>=I.length){p();return}if(I[g].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(I,g,p,h),!h)return}},k.getAvcEncryptedData=function(I){for(var g=Math.floor((I.length-48)/160)*16+16,p=new Int8Array(g),h=0,c=32;c<=I.length-16;c+=160,h+=16)p.set(I.subarray(c,c+16),h);return p},k.getAvcDecryptedUnit=function(I,g){for(var p=new Uint8Array(g),h=0,c=32;c<=I.length-16;c+=160,h+=16)I.set(p.subarray(h,h+16),c);return I},k.decryptAvcSample=function(I,g,p,h,c,o){var d=Object(N.discardEPB)(c.data),i=this.getAvcEncryptedData(d),a=this;this.decryptBuffer(i.buffer,function(r){c.data=a.getAvcDecryptedUnit(d,r),o||a.decryptAvcSamples(I,g,p+1,h)})},k.decryptAvcSamples=function(I,g,p,h){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,p=0){if(g>=I.length){h();return}for(var c=I[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(I,g,p,h,o,d),!d)return}}},H}();z.default=O},"./src/demux/transmuxer-interface.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c});var Y=P("./node_modules/webworkify-webpack/index.js"),N=P.n(Y),O=P("./src/events.ts"),H=P("./src/demux/transmuxer.ts"),k=P("./src/utils/logger.ts"),n=P("./src/errors.ts"),I=P("./src/utils/mediasource-helper.ts"),g=P("./node_modules/eventemitter3/index.js"),p=P.n(g),h=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function o(i,a,r,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=i,this.id=a,this.onTransmuxComplete=r,this.onFlush=s;var x=i.config,T=function(m,f){f=f||{},f.frag=S.frag,f.id=S.id,i.trigger(m,f)};this.observer=new g.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,T),this.observer.on(O.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"){k.logger.log("demuxing in webworker");var v;try{v=this.worker=Y("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(E){i.trigger(O.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},v.postMessage({cmd:"init",typeSupported:A,vendor:w,id:a,config:JSON.stringify(x)})}catch(E){k.logger.warn("Error in worker:",E),k.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new H.default(this.observer,A,x,w,a),this.worker=null}}else this.transmuxer=new H.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 r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},d.push=function(a,r,s,S,x,T,A,w,v,E){var m=this;v.transmuxing.start=self.performance.now();var f=this.transmuxer,C=this.worker,b=T?T.start:x.start,y=x.decryptdata,M=this.frag,W=!(M&&x.cc===M.cc),L=!(M&&v.level===M.level),K=M?v.sn-M.sn:-1,F=this.part?v.part-this.part.index:1,R=!L&&(K===1||K===0&&F===1),V=self.performance.now();(L||K||x.stats.parsing.start===0)&&(x.stats.parsing.start=V),T&&(F||!R)&&(T.stats.parsing.start=V);var ne=new H.TransmuxState(W,R,w,L,b);if(!R||W){k.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
|
|
discontinuity: `+W+`
|
|
trackSwitch: `+L+`
|
|
contiguous: `+R+`
|
|
accurateTimeOffset: `+w+`
|
|
timeOffset: `+b);var se=new H.TransmuxConfig(s,S,r,A,E);this.configureTransmuxer(se)}if(this.frag=x,this.part=T,C)C.postMessage({cmd:"demux",data:a,decryptdata:y,chunkMeta:v,state:ne},a instanceof ArrayBuffer?[a]:[]);else if(f){var Se=f.push(a,y,v,ne);Object(H.isPromise)(Se)?Se.then(function(Le){m.handleTransmuxComplete(Le)}):this.handleTransmuxComplete(Se)}},d.flush=function(a){var r=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(H.isPromise)(x)?x.then(function(T){r.handleFlushResult(T,a)}):this.handleFlushResult(x,a)}},d.handleFlushResult=function(a,r){var s=this;a.forEach(function(S){s.handleTransmuxComplete(S)}),this.onFlush(r)},d.onWorkerMessage=function(a){var r=a.data,s=this.hls;switch(r.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,s.trigger(r.event,r.data);break}}},d.configureTransmuxer=function(a){var r=this.worker,s=this.transmuxer;r?r.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(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return n});var Y=P("./src/demux/transmuxer.ts"),N=P("./src/events.ts"),O=P("./src/utils/logger.ts"),H=P("./node_modules/eventemitter3/index.js"),k=P.n(H);function n(c){var o=new H.EventEmitter,d=function(a,r){c.postMessage({event:a,data:r})};o.on(N.Events.FRAG_DECRYPTED,d),o.on(N.Events.ERROR,d),c.addEventListener("message",function(i){var a=i.data;switch(a.cmd){case"init":{var r=JSON.parse(a.config);c.transmuxer=new Y.default(o,a.typeSupported,r,a.vendor,a.id),Object(O.enableLogs)(r.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(Y.isPromise)(s)?s.then(function(T){I(c,T)}):I(c,s);break}case"flush":{var S=a.chunkMeta,x=c.transmuxer.flush(S);Object(Y.isPromise)(x)?x.then(function(T){p(c,T,S)}):p(c,x,S);break}default:break}})}function I(c,o){if(h(o.remuxResult))return;var d=[],i=o.remuxResult,a=i.audio,r=i.video;a&&g(d,a),r&&g(d,r),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(i){I(c,i)}),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(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return r}),P.d(z,"isPromise",function(){return x}),P.d(z,"TransmuxConfig",function(){return T}),P.d(z,"TransmuxState",function(){return A});var Y=P("./src/events.ts"),N=P("./src/errors.ts"),O=P("./src/crypt/decrypter.ts"),H=P("./src/demux/aacdemuxer.ts"),k=P("./src/demux/mp4demuxer.ts"),n=P("./src/demux/tsdemuxer.ts"),I=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 i=[{demux:n.default,remux:g.default},{demux:k.default,remux:p.default},{demux:H.default,remux:g.default},{demux:I.default,remux:g.default}],a=1024;i.forEach(function(w){var v=w.demux;a=Math.max(a,v.minProbeByteLength)});var r=function(){function w(E,m,f,C,b){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=E,this.typeSupported=m,this.config=f,this.vendor=C,this.id=b}var v=w.prototype;return v.configure=function(m){this.transmuxConfig=m,this.decrypter&&this.decrypter.reset()},v.push=function(m,f,C,b){var y=this,M=C.transmuxing;M.executeStart=d();var W=new Uint8Array(m),L=this.cache,K=this.config,F=this.currentTransmuxState,R=this.transmuxConfig;b&&(this.currentTransmuxState=b);var V=s(W,f);if(V&&V.method==="AES-128"){var ne=this.getDecrypter();if(K.enableSoftwareAES){var se=ne.softwareDecrypt(W,V.key.buffer,V.iv.buffer);if(!se)return M.executeEnd=d(),S(C);W=new Uint8Array(se)}else return this.decryptionPromise=ne.webCryptoDecrypt(W,V.key.buffer,V.iv.buffer).then(function(Ge){var Je=y.push(Ge,null,C);return y.decryptionPromise=null,Je}),this.decryptionPromise}var Se=b||F,Le=Se.contiguous,Ae=Se.discontinuity,Pe=Se.trackSwitch,Fe=Se.accurateTimeOffset,je=Se.timeOffset,Te=R.audioCodec,Z=R.videoCodec,U=R.defaultInitPts,G=R.duration,ee=R.initSegmentData;if((Ae||Pe)&&this.resetInitSegment(ee,Te,Z,G),Ae&&this.resetInitialTimestamp(U),Le||this.resetContiguity(),this.needsProbing(W,Ae,Pe)){if(L.dataLength){var ue=L.flush();W=Object(c.appendUint8Array)(ue,W)}this.configureTransmuxer(W,R)}var J=this.transmux(W,V,je,Fe,C),we=this.currentTransmuxState;return we.contiguous=!0,we.discontinuity=!1,we.trackSwitch=!1,M.executeEnd=d(),J},v.flush=function(m){var f=this,C=m.transmuxing;C.executeStart=d();var b=this.decrypter,y=this.cache,M=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return f.flush(m)});var L=[],K=M.timeOffset;if(b){var F=b.flush();F&&L.push(this.push(F,null,m))}var R=y.dataLength;y.reset();var V=this.demuxer,ne=this.remuxer;if(!V||!ne)return R>=a&&this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=d(),[S(m)];var se=V.flush(K);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,C){var b=f.audioTrack,y=f.avcTrack,M=f.id3Track,W=f.textTrack,L=this.currentTransmuxState,K=L.accurateTimeOffset,F=L.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var R=this.remuxer.remux(b,y,M,W,F,K,!0,this.id);m.push({remuxResult:R,chunkMeta:C}),C.transmuxing.executeEnd=d()},v.resetInitialTimestamp=function(m){var f=this.demuxer,C=this.remuxer;if(!f||!C)return;f.resetTimeStamp(m),C.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,C,b){var y=this.demuxer,M=this.remuxer;if(!y||!M)return;y.resetInitSegment(f,C,b),M.resetInitSegment(m,f,C)},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,C,b,y){var M;return f&&f.method==="SAMPLE-AES"?M=this.transmuxSampleAes(m,f,C,b,y):M=this.transmuxUnencrypted(m,C,b,y),M},v.transmuxUnencrypted=function(m,f,C,b){var y=this.demuxer.demux(m,f,!1,!this.config.progressive),M=y.audioTrack,W=y.avcTrack,L=y.id3Track,K=y.textTrack,F=this.remuxer.remux(M,W,L,K,f,C,!1,this.id);return{remuxResult:F,chunkMeta:b}},v.transmuxSampleAes=function(m,f,C,b,y){var M=this;return this.demuxer.demuxSampleAes(m,f,C).then(function(W){var L=M.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,C,b,!1,M.id);return{remuxResult:L,chunkMeta:y}})},v.configureTransmuxer=function(m,f){for(var C=this.config,b=this.observer,y=this.typeSupported,M=this.vendor,W=f.audioCodec,L=f.defaultInitPts,K=f.duration,F=f.initSegmentData,R=f.videoCodec,V,ne=0,se=i.length;ne<se;ne++)if(i[ne].demux.probe(m)){V=i[ne];break}V||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:k.default,remux:p.default});var Se=this.demuxer,Le=this.remuxer,Ae=V.remux,Pe=V.demux;(!Le||!(Le instanceof Ae))&&(this.remuxer=new Ae(b,C,y,M)),(!Se||!(Se instanceof Pe))&&(this.demuxer=new Pe(b,C,y),this.probe=Pe.probe),this.resetInitSegment(F,W,R,K),this.resetInitialTimestamp(L)},v.needsProbing=function(m,f,C){return!this.demuxer||!this.remuxer||f||C},v.getDecrypter=function(){var m=this.decrypter;return m||(m=this.decrypter=new O.default(this.observer,this.config)),m},w}();function s(w,v){var E=null;return w.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(E=v),E}var S=function(v){return{remuxResult:{},chunkMeta:v}};function x(w){return"then"in w&&w.then instanceof Function}var T=function(v,E,m,f,C){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=E,this.initSegmentData=m,this.duration=f,this.defaultInitPts=C},A=function(v,E,m,f,C){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=E,this.accurateTimeOffset=m,this.trackSwitch=f,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"discardEPB",function(){return S});var Y=P("./src/demux/adts.ts"),N=P("./src/demux/mpegaudio.ts"),O=P("./src/demux/exp-golomb.ts"),H=P("./src/demux/id3.ts"),k=P("./src/demux/sample-aes.ts"),n=P("./src/events.ts"),I=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),E=0;E<v;){if(w[E]===71&&w[E+188]===71&&w[E+2*188]===71)return E;E++}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,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",E),this._audioTrack=x.createTrack("audio",E),this._id3Track=x.createTrack("id3",E),this._txtTrack=x.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=w,this.videoCodec=v,this._duration=E},T.resetTimeStamp=function(){},T.resetContiguity=function(){var w=this._audioTrack,v=this._avcTrack,E=this._id3Track;w&&(w.pesData=null),v&&(v.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(w,v,E,m){E===void 0&&(E=!1),m===void 0&&(m=!1),E||(this.sampleAes=null);var f,C=this._avcTrack,b=this._audioTrack,y=this._id3Track,M=C.pid,W=C.pesData,L=b.pid,K=y.pid,F=b.pesData,R=y.pesData,V=!1,ne=this.pmtParsed,se=this._pmtId,Se=w.length;if(this.remainderData&&(w=Object(I.appendUint8Array)(this.remainderData,w),Se=w.length,this.remainderData=null),Se<188&&!m)return this.remainderData=w,{audioTrack:b,avcTrack:C,id3Track:y,textTrack:this._txtTrack};var Le=Math.max(0,x.syncOffset(w));Se-=(Se+Le)%188,Se<w.byteLength&&!m&&(this.remainderData=new Uint8Array(w.buffer,Se,w.buffer.byteLength-Se));for(var Ae=Le;Ae<Se;Ae+=188)if(w[Ae]===71){var Pe=!!(w[Ae+1]&64),Fe=((w[Ae+1]&31)<<8)+w[Ae+2],je=(w[Ae+3]&48)>>4,Te=void 0;if(je>1){if(Te=Ae+5+w[Ae+4],Te===Ae+188)continue}else Te=Ae+4;switch(Fe){case M:Pe&&(W&&(f=a(W))&&this.parseAVCPES(f,!1),W={data:[],size:0}),W&&(W.data.push(w.subarray(Te,Ae+188)),W.size+=Ae+188-Te);break;case L:Pe&&(F&&(f=a(F))&&(b.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),F={data:[],size:0}),F&&(F.data.push(w.subarray(Te,Ae+188)),F.size+=Ae+188-Te);break;case K:Pe&&(R&&(f=a(R))&&this.parseID3PES(f),R={data:[],size:0}),R&&(R.data.push(w.subarray(Te,Ae+188)),R.size+=Ae+188-Te);break;case 0:Pe&&(Te+=w[Te]+1),se=this._pmtId=d(w,Te);break;case se:{Pe&&(Te+=w[Te]+1);var Z=i(w,Te,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);M=Z.avc,M>0&&(C.pid=M),L=Z.audio,L>0&&(b.pid=L,b.isAAC=Z.isAAC),K=Z.id3,K>0&&(y.pid=K),V&&!ne&&(g.logger.log("reparse from beginning"),V=!1,Ae=Le-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"});C.pesData=W,b.pesData=F,y.pesData=R;var U={audioTrack:b,avcTrack:C,id3Track:y,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,E=w.avcTrack,m=w.id3Track,f=E.pesData,C=v.pesData,b=m.pesData,y;f&&(y=a(f))?(this.parseAVCPES(y,!0),E.pesData=null):E.pesData=f,C&&(y=a(C))?(v.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),v.pesData=null):(C!=null&&C.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=C),b&&(y=a(b))?(this.parseID3PES(y),m.pesData=null):m.pesData=b},T.demuxSampleAes=function(w,v,E){var m=this.demux(w,E,!0,!this.config.progressive),f=this.sampleAes=new k.default(this.observer,this.config,v);return this.decrypt(m,f)},T.decrypt=function(w,v){return new Promise(function(E){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(){E(w)}):E(w)}):f.samples&&v.decryptAvcSamples(f.samples,0,0,function(){E(w)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(w,v){var E=this,m=this._avcTrack,f=this.parseAVCNALu(w.data),C=!1,b=this.avcSample,y,M=!1;w.data=null,b&&f.length&&!m.audFound&&(r(b,m),b=this.avcSample=o(!1,w.pts,w.dts,"")),f.forEach(function(W){switch(W.type){case 1:{y=!0,b||(b=E.avcSample=o(!0,w.pts,w.dts,"")),C&&(b.debug+="NDR "),b.frame=!0;var L=W.data;if(M&&L.length>4){var K=new O.default(L).readSliceType();(K===2||K===4||K===7||K===9)&&(b.key=!0)}break}case 5:y=!0,b||(b=E.avcSample=o(!0,w.pts,w.dts,"")),C&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{y=!0,C&&b&&(b.debug+="SEI ");var F=new O.default(S(W.data));F.readUByte();for(var R=0,V=0,ne=!1,se=0;!ne&&F.bytesAvailable>1;){R=0;do se=F.readUByte(),R+=se;while(se===255);V=0;do se=F.readUByte(),V+=se;while(se===255);if(R===4&&F.bytesAvailable!==0){ne=!0;var Se=F.readUByte();if(Se===181){var Le=F.readUShort();if(Le===49){var Ae=F.readUInt();if(Ae===1195456820){var Pe=F.readUByte();if(Pe===3){for(var Fe=F.readUByte(),je=F.readUByte(),Te=31&Fe,Z=[Fe,je],U=0;U<Te;U++)Z.push(F.readUByte()),Z.push(F.readUByte()),Z.push(F.readUByte());s(E._txtTrack.samples,{type:3,pts:w.pts,bytes:Z})}}}}}else if(R===5&&F.bytesAvailable!==0){if(ne=!0,V>16){for(var G=[],ee=0;ee<16;ee++)G.push(F.readUByte().toString(16)),(ee===3||ee===5||ee===7||ee===9)&&G.push("-");for(var ue=V-16,J=new Uint8Array(ue),we=0;we<ue;we++)J[we]=F.readUByte();s(E._txtTrack.samples,{pts:w.pts,payloadType:R,uuid:G.join(""),userData:Object(H.utf8ArrayToStr)(J),userDataBytes:J})}}else if(V<F.bytesAvailable)for(var Ge=0;Ge<V;Ge++)F.readUByte()}break}case 7:if(y=!0,M=!0,C&&b&&(b.debug+="SPS "),!m.sps){var Je=new O.default(W.data),be=Je.readSPS();m.width=be.width,m.height=be.height,m.pixelRatio=be.pixelRatio,m.sps=[W.data],m.duration=E._duration;for(var Re=W.data.subarray(1,4),xe="avc1.",Ce=0;Ce<3;Ce++){var Be=Re[Ce].toString(16);Be.length<2&&(Be="0"+Be),xe+=Be}m.codec=xe}break;case 8:y=!0,C&&b&&(b.debug+="PPS "),m.pps||(m.pps=[W.data]);break;case 9:y=!1,m.audFound=!0,b&&r(b,m),b=E.avcSample=o(!1,w.pts,w.dts,C?"AUD ":"");break;case 12:y=!1;break;default:y=!1,b&&(b.debug+="unknown NAL "+W.type+" ");break}if(b&&y){var Xe=b.units;Xe.push(W)}}),v&&b&&(r(b,m),this.avcSample=null)},T.getLastNalUnit=function(){var w,v=this.avcSample,E;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;E=f[f.length-1]}return E},T.parseAVCNALu=function(w){var v=w.byteLength,E=this._avcTrack,m=E.naluState||0,f=m,C=[],b=0,y,M,W,L=-1,K=0;for(m===-1&&(L=0,K=w[0]&31,m=0,b=1);b<v;){if(y=w[b++],!m){m=y?0:1;continue}if(m===1){m=y?0:2;continue}if(!y)m=3;else if(y===1){if(L>=0){var F={data:w.subarray(L,b-m-1),type:K};C.push(F)}else{var R=this.getLastNalUnit();if(R&&(f&&b<=4-f&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-f))),M=b-m-1,M>0)){var V=new Uint8Array(R.data.byteLength+M);V.set(R.data,0),V.set(w.subarray(0,M),R.data.byteLength),R.data=V,R.state=0}}b<v?(W=w[b]&31,L=b,K=W,m=0):m=-1}else m=0}if(L>=0&&m>=0){var ne={data:w.subarray(L,v),type:K,state:m};C.push(ne)}if(C.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 E.naluState=m,C},T.parseAACPES=function(w){var v=0,E=this._audioTrack,m=this.aacOverFlow,f=w.data;if(m){this.aacOverFlow=null;var C=m.sample.unit.byteLength,b=Math.min(m.missing,C),y=C-b;m.sample.unit.set(f.subarray(0,b),y),E.samples.push(m.sample),v=m.missing}var M,W;for(M=v,W=f.length;M<W-1&&!Y.isHeader(f,M);M++);if(M!==v){var L,K;if(M<W-1?(L="AAC PES did not start with ADTS header,offset:"+M,K=!1):(L="no ADTS header found in AAC PES",K=!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:K,reason:L}),K)return}Y.initTrackConfig(E,this.observer,f,M,this.audioCodec);var F;if(w.pts!==void 0)F=w.pts;else if(m){var R=Y.getFrameDuration(E.samplerate);F=m.sample.pts+R}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;M<W;)if(Y.isHeader(f,M)){if(M+5<W){var ne=Y.appendFrame(E,f,M,F,V);if(ne)if(ne.missing)this.aacOverFlow=ne;else{M+=ne.length,V++;continue}}break}else M++},T.parseMPEGPES=function(w){var v=w.data,E=v.length,m=0,f=0,C=w.pts;if(C===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<E;)if(N.isHeader(v,f)){var b=N.appendFrame(this._audioTrack,v,f,C,m);if(b)f+=b.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 i(x,T,A,w){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(x[T+1]&15)<<8|x[T+2],m=T+3+E-4,f=(x[T+10]&15)<<8|x[T+11];for(T+=12+f;T<m;){var C=(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=C);break;case 21:v.id3===-1&&(v.id3=C);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=C);break;case 3:case 4:A?v.audio===-1&&(v.audio=C,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,E,m,f=x.data;if(!x||x.size===0)return null;for(;f[0].length<19&&f.length>1;){var C=new Uint8Array(f[0].length+f[1].length);C.set(f[0]),C.set(f[1],f[0].length),f[0]=C,f.splice(1,1)}A=f[0];var b=(A[0]<<16)+(A[1]<<8)+A[2];if(b===1){if(w=(A[4]<<8)+A[5],w&&w>x.size-6)return null;var y=A[7];y&192&&(E=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,y&64?(m=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,E-m>60*9e4&&(g.logger.warn(Math.round((E-m)/9e4)+"s delta between PTS and DTS, align them"),E=m)):m=E),v=A[8];var M=v+9;if(x.size<=M)return null;x.size-=M;for(var W=new Uint8Array(x.size),L=0,K=f.length;L<K;L++){A=f[L];var F=A.byteLength;if(M)if(M>F){M-=F;continue}else A=A.subarray(M),F-=M,M=0;W.set(A,T),T+=F}return w&&(w-=v+3),{data:W,pts:E,dts:m,len:w}}return null}function r(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,E=new Uint8Array(v),m=0;for(w=0;w<v;m++,w++)m===A[0]&&(m++,A.shift()),E[w]=x[m];return E}z.default=c},"./src/errors.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"ErrorTypes",function(){return Y}),P.d(z,"ErrorDetails",function(){return N});var Y;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(Y||(Y={}));var N;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"Events",function(){return Y});var Y;(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"})(Y||(Y={}))},"./src/hls.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return x});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),N=P.n(Y),O=P("./src/loader/playlist-loader.ts"),H=P("./src/loader/key-loader.ts"),k=P("./src/controller/id3-track-controller.ts"),n=P("./src/controller/latency-controller.ts"),I=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"),i=P.n(d),a=P("./src/events.ts"),r=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 E=v.abrController,m=v.bufferController,f=v.capLevelController,C=v.fpsController,b=this.abrController=new E(this),y=this.bufferController=new m(this),M=this.capLevelController=new f(this),W=new C(this),L=new O.default(this),K=new H.default(this),F=new k.default(this),R=this.levelController=new I.default(this),V=new g.FragmentTracker(this),ne=this.streamController=new p.default(this,V);M.setStreamController(ne),W.setStreamController(ne);var se=[R,ne];this.networkControllers=se;var Se=[L,K,b,y,M,W,F,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,E,m){if(v){var f=E?new v(this,E):new v(this);return m&&m.push(f),f}return null},A.on=function(v,E,m){m===void 0&&(m=this),this._emitter.on(v,E,m)},A.once=function(v,E,m){m===void 0&&(m=this),this._emitter.once(v,E,m)},A.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},A.off=function(v,E,m,f){m===void 0&&(m=this),this._emitter.off(v,E,m,f)},A.listeners=function(v){return this._emitter.listeners(v)},A.emit=function(v,E,m){return this._emitter.emit(v,E,m)},A.trigger=function(v,E){if(this.config.debug)return this.emit(v,v,E);try{return this.emit(v,v,E)}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:r.ErrorTypes.OTHER_ERROR,details:r.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 E=this.media,m=this.url,f=this.url=Y.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});c.logger.log("loadSource:"+f),E&&m&&m!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),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(E){E.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,E){E===void 0&&(E=0),this.levelController.removeLevel(v,E)},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 E=!!v;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(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,E=this.config.minAutoBitrate;if(!v)return 0;for(var m=v.length,f=0;f<m;f++)if(v[f].maxBitrate>E)return f;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,E=this.autoLevelCapping,m;return E===-1&&v&&v.length?m=v.length-1:m=E,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 E=this.audioTrackController;E&&(E.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 E=this.subtitleTrackController;E&&(E.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 E=this.subtitleTrackController;E&&(E.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 r.ErrorTypes}},{key:"ErrorDetails",get:function(){return r.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(q,z,P){"use strict";P.r(z),P.d(z,"isSupported",function(){return O}),P.d(z,"changeTypeSupported",function(){return H});var Y=P("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var k=Object(Y.getMediaSource)();if(!k)return!1;var n=N(),I=k&&typeof k.isTypeSupported=="function"&&k.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!I&&!!g}function H(){var k,n=N();return typeof(n==null||((k=n.prototype)===null||k===void 0)?void 0:k.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return c}),P.d(z,"LoadError",function(){return d});var Y=P("./src/polyfills/number.ts"),N=P("./src/errors.ts");function O(i,a){i.prototype=Object.create(a.prototype),i.prototype.constructor=i,g(i,a)}function H(i){var a=typeof Map=="function"?new Map:void 0;return H=function(s){if(s===null||!I(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 k(s,arguments,p(this).constructor)}return S.prototype=Object.create(s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),g(S,s)},H(i)}function k(i,a,r){return n()?k=Reflect.construct:k=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},k.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(i){return!1}}function I(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function g(i,a){return g=Object.setPrototypeOf||function(s,S){return s.__proto__=S,s},g(i,a)}function p(i){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},p(i)}var h=Math.pow(2,17),c=function(){function i(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}var a=i.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(E,m){x.loader&&x.loader.destroy();var f=x.loader=s.loader=w?new w(A):new v(A),C=o(s),b={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:h};s.stats=f.stats,f.load(C,b,{onSuccess:function(M,W,L,K){x.resetLoader(s,f),E({frag:s,part:null,payload:M.data,networkDetails:K})},onError:function(M,W,L){x.resetLoader(s,f),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:M,networkDetails:L}))},onAbort:function(M,W,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(M,W,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(M,W,L,K){S&&S({frag:s,part:null,payload:L,networkDetails:K})}})})},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(E,m){T.loader&&T.loader.destroy();var f=T.loader=s.loader=w?new w(A):new v(A),C=o(s,S),b={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:h};S.stats=f.stats,f.load(C,b,{onSuccess:function(M,W,L,K){T.resetLoader(s,f),T.updateStatsFromPart(s,S);var F={frag:s,part:S,payload:M.data,networkDetails:K};x(F),E(F)},onError:function(M,W,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:M,networkDetails:L}))},onAbort:function(M,W,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(M,W,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),E=w-v,m=E*Math.round(x.loaded/v);x.total=x.loaded+m}else x.total=Math.max(x.loaded,x.total);var f=x.loading,C=T.loading;f.start?f.first+=C.first-C.start:(f.start=C.start,f.first=C.first),f.end=C.end},a.resetLoader=function(s,S){s.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},i}();function o(i,a){a===void 0&&(a=null);var r=a||i,s={frag:i,part:a,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},S=r.byteRangeStartOffset,x=r.byteRangeEndOffset;return Object(Y.isFiniteNumber)(S)&&Object(Y.isFiniteNumber)(x)&&(s.rangeStart=S,s.rangeEnd=x),s}var d=function(i){O(a,i);function a(r){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=i.call.apply(i,[this].concat(x))||this,s.data=void 0,s.data=r,s}return a}(H(Error))},"./src/loader/fragment.ts":function(q,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 i});var Y=P("./src/polyfills/number.ts"),N=P("./node_modules/url-toolkit/src/url-toolkit.js"),O=P.n(N),H=P("./src/utils/logger.ts"),k=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function I(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,g(a,r)}function g(a,r){return g=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S},g(a,r)}function p(a,r){for(var s=0;s<r.length;s++){var S=r[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,r,s){return r&&p(a.prototype,r),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 r=a.prototype;return r.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){I(r,a);function r(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=r.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=k.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,E){E===void 0&&(E=!1);var m=this.elementaryStreams,f=m[x];if(!f){m[x]={startPTS:T,endPTS:A,startDTS:w,endDTS:v,partial:E};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(r,[{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&&H.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(Y.isFiniteNumber)(this.programDateTime))return null;var x=Object(Y.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)}}]),r}(o),i=function(a){I(r,a);function r(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(r,[{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)}}]),r}(o)},"./src/loader/key-loader.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return H});var Y=P("./src/events.ts"),N=P("./src/errors.ts"),O=P("./src/utils/logger.ts"),H=function(){function k(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var n=k.prototype;return n._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(Y.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){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=h.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(o&&(O.logger.warn("abort previous key loader for type:"+c),o.abort()),!d){O.logger.warn("key uri is falsy");return}var a=i.loader,r=h.loader=this.loaders[c]=new a(i);this.decrypturl=d,this.decryptkey=null;var s={url:d,frag:h,responseType:"arraybuffer"},S={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.load(s,S,x)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:h}))},n.loadsuccess=function(g,p,h){var c=h.frag;if(!c.decryptdata){O.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(Y.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(Y.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(Y.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},k}()},"./src/loader/level-details.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"LevelDetails",function(){return k});var Y=P("./src/polyfills/number.ts");function N(n,I){for(var g=0;g<I.length;g++){var p=I[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function O(n,I,g){return I&&N(n.prototype,I),g&&N(n,g),n}var H=10,k=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 I=n.prototype;return I.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},O(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Y.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{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(q,z,P){"use strict";P.r(z),P.d(z,"LevelKey",function(){return k});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),N=P.n(Y);function O(n,I){for(var g=0;g<I.length;g++){var p=I[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function H(n,I,g){return I&&O(n.prototype,I),g&&O(n,g),n}var k=function(){n.fromURL=function(g,p){return new n(g,p)},n.fromURI=function(g){return new n(g)};function n(I,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(Y.buildAbsoluteURL)(I,g,{alwaysNormalize:!0}):this._uri=I}return H(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"LoadStats",function(){return Y});var Y=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(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return r});var Y=P("./src/polyfills/number.ts"),N=P("./node_modules/url-toolkit/src/url-toolkit.js"),O=P.n(N),H=P("./src/loader/fragment.ts"),k=P("./src/loader/level-details.ts"),n=P("./src/loader/level-key.ts"),I=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("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function a(A){var w,v;return i.test((w=(v=N.parseURL(A))===null||v===void 0?void 0:v.path)!=null?w:"")}var r=function(){function A(){}return A.findGroup=function(v,E){for(var m=0;m<v.length;m++){var f=v[m];if(f.id===E)return f}},A.convertAVC1ToAVCOTI=function(v){var E=v.split(".");if(E.length>2){var m=E.shift()+".";return m+=parseInt(E.shift()).toString(16),m+=("000"+parseInt(E.shift()).toString(16)).substr(-4),m}return v},A.resolve=function(v,E){return N.buildAbsoluteURL(E,v,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(v,E){var m=[],f={},C=!1;h.lastIndex=0;for(var b;(b=h.exec(v))!=null;)if(b[1]){var y=new I.AttrList(b[1]),M={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:A.resolve(b[2],E)},W=y.decimalResolution("RESOLUTION");W&&(M.width=W.width,M.height=W.height),s((y.CODECS||"").split(/[ ,]+/).filter(function(K){return K}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=A.convertAVC1ToAVCOTI(M.videoCodec)),m.push(M)}else if(b[3]){var L=new I.AttrList(b[3]);L["DATA-ID"]&&(C=!0,f[L["DATA-ID"]]=L)}return{levels:m,sessionData:C?f:null}},A.parseMasterPlaylistMedia=function(v,E,m,f){f===void 0&&(f=[]);var C,b=[],y=0;for(c.lastIndex=0;(C=c.exec(v))!==null;){var M=new I.AttrList(C[1]);if(M.TYPE===m){var W={attrs:M,bitrate:0,id:y++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:m,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?A.resolve(M.URI,E):""};if(f.length){var L=A.findGroup(f,W.groupId)||f[0];S(W,L,"audioCodec"),S(W,L,"textCodec")}b.push(W)}}return b},A.parseLevelPlaylist=function(v,E,m,f,C){var b=new k.LevelDetails(E),y=b.fragments,M=null,W=0,L=0,K=0,F=0,R=null,V=new H.Fragment(f,E),ne,se,Se,Le=-1,Ae=!1;for(o.lastIndex=0,b.m3u8=v;(ne=o.exec(v))!==null;){Ae&&(Ae=!1,V=new H.Fragment(f,E),V.start=K,V.sn=W,V.cc=F,V.level=m,M&&(V.initSegment=M,V.rawProgramDateTime=M.rawProgramDateTime));var Pe=ne[1];if(Pe){V.duration=parseFloat(Pe);var Fe=(" "+ne[2]).slice(1);V.title=Fe||null,V.tagList.push(Fe?["INF",Pe,Fe]:["INF",Pe])}else if(ne[3])Object(Y.isFiniteNumber)(V.duration)&&(V.start=K,Se&&(V.levelkey=Se),V.sn=W,V.level=m,V.cc=F,V.urlId=C,y.push(V),V.relurl=(" "+ne[3]).slice(1),T(V,R),R=V,K+=V.duration,W++,L=0,Ae=!0);else if(ne[4]){var je=(" "+ne[4]).slice(1);R?V.setByteRange(je,R):V.setByteRange(je)}else if(ne[5])V.rawProgramDateTime=(" "+ne[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),Le===-1&&(Le=y.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 Te=(" "+ne[se]).slice(1),Z=(" "+ne[se+1]).slice(1),U=ne[se+2]?(" "+ne[se+2]).slice(1):"";switch(Te){case"PLAYLIST-TYPE":b.type=Z.toUpperCase();break;case"MEDIA-SEQUENCE":W=b.startSN=parseInt(Z);break;case"SKIP":{var G=new I.AttrList(Z),ee=G.decimalInteger("SKIPPED-SEGMENTS");if(Object(Y.isFiniteNumber)(ee)){b.skippedSegments=ee;for(var ue=ee;ue--;)y.unshift(null);W+=ee}var J=G.enumeratedString("RECENTLY-REMOVED-DATERANGES");J&&(b.recentlyRemovedDateranges=J.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(Z);break;case"VERSION":b.version=parseInt(Z);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(Z||U)&&V.tagList.push(U?[Z,U]:[Z]);break;case"DIS":F++;case"GAP":V.tagList.push([Te]);break;case"BITRATE":V.tagList.push([Te,Z]);break;case"DISCONTINUITY-SEQ":F=parseInt(Z);break;case"KEY":{var we,Ge=new I.AttrList(Z),Je=Ge.enumeratedString("METHOD"),be=Ge.URI,Re=Ge.hexadecimalInteger("IV"),xe=Ge.enumeratedString("KEYFORMATVERSIONS"),Ce=Ge.enumeratedString("KEYID"),Be=(we=Ge.enumeratedString("KEYFORMAT"))!=null?we:"identity",Xe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Xe.indexOf(Be)>-1){g.logger.warn("Keyformat "+Be+" is not supported from the manifest");continue}else if(Be!=="identity")continue;Je&&(Se=n.LevelKey.fromURL(E,be),be&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Je)>=0&&(Se.method=Je,Se.keyFormat=Be,Ce&&(Se.keyID=Ce),xe&&(Se.keyFormatVersions=xe),Se.iv=Re));break}case"START":{var qe=new I.AttrList(Z),tt=qe.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(tt)&&(b.startTimeOffset=tt);break}case"MAP":{var ht=new I.AttrList(Z);V.relurl=ht.URI,ht.BYTERANGE&&V.setByteRange(ht.BYTERANGE),V.level=m,V.sn="initSegment",Se&&(V.levelkey=Se),V.initSegment=null,M=V,Ae=!0;break}case"SERVER-CONTROL":{var ft=new I.AttrList(Z);b.canBlockReload=ft.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=ft.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&ft.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=ft.optionalFloat("PART-HOLD-BACK",0),b.holdBack=ft.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new I.AttrList(Z);b.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ue=b.partList;Ue||(Ue=b.partList=[]);var Ze=L>0?Ue[Ue.length-1]:void 0,et=L++,fe=new H.Part(new I.AttrList(Z),V,E,et,Ze);Ue.push(fe),V.duration+=fe.duration;break}case"PRELOAD-HINT":{var re=new I.AttrList(Z);b.preloadHint=re;break}case"RENDITION-REPORT":{var ie=new I.AttrList(Z);b.renditionReports=b.renditionReports||[],b.renditionReports.push(ie);break}default:g.logger.warn("line parsed but not handled: "+ne);break}}}R&&!R.relurl?(y.pop(),K-=R.duration,b.partList&&(b.fragmentHint=R)):b.partList&&(T(V,R),V.cc=F,b.fragmentHint=V);var ce=y.length,pe=y[0],le=y[ce-1];if(K+=b.skippedSegments*b.targetduration,K>0&&ce&&le){b.averagetargetduration=K/ce;var he=le.sn;b.endSN=he!=="initSegment"?he:0,pe&&(b.startCC=pe.cc,pe.initSegment||b.fragments.every(function(ye){return ye.relurl&&a(ye.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new H.Fragment(f,E),V.relurl=le.relurl,V.level=m,V.sn="initSegment",pe.initSegment=V,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(K+=b.fragmentHint.duration),b.totalduration=K,b.endCC=F,Le>0&&x(y,Le),b},A}();function s(A,w){["video","audio","text"].forEach(function(v){var E=A.filter(function(f){return Object(p.isCodecType)(f,v)});if(E.length){var m=E.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});w[v+"Codec"]=m.length>0?m[0]:E[0],A=A.filter(function(f){return E.indexOf(f)===-1})}}),w.unknownCodecs=A}function S(A,w,v){var E=w[v];E&&(A[v]=E)}function x(A,w){for(var v=A[w],E=w;E--;){var m=A[E];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(Y.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/polyfills/number.ts"),N=P("./src/events.ts"),O=P("./src/errors.ts"),H=P("./src/utils/logger.ts"),k=P("./src/utils/mp4-tools.ts"),n=P("./src/loader/m3u8-parser.ts"),I=P("./src/types/loader.ts"),g=P("./src/utils/attr-list.ts");function p(o){var d=o.type;switch(d){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function h(o,d){var i=o.url;return(i===void 0||i.indexOf("data:")===0)&&(i=d.url),i}var c=function(){function o(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,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 r=this.hls.config,s=r.pLoader,S=r.loader,x=s||S,T=new x(r);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 r=this.loaders[a];r&&r.destroy(),this.resetInternalLoader(a)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(a,r){var s=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},d.onLevelLoading=function(a,r){var s=r.id,S=r.level,x=r.url,T=r.deliveryDirectives;this.load({id:s,groupId:null,level:S,responseType:"text",type:I.PlaylistContextType.LEVEL,url:x,deliveryDirectives:T})},d.onAudioTrackLoading=function(a,r){var s=r.id,S=r.groupId,x=r.url,T=r.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(a,r){var s=r.id,S=r.groupId,x=r.url,T=r.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:T})},d.load=function(a){var r,s=this.hls.config,S=this.getInternalLoader(a);if(S){var x=S.context;if(x&&x.url===a.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),S.abort()}var T,A,w,v;switch(a.type){case I.PlaylistContextType.MANIFEST:T=s.manifestLoadingMaxRetry,A=s.manifestLoadingTimeOut,w=s.manifestLoadingRetryDelay,v=s.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.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),(r=a.deliveryDirectives)!==null&&r!==void 0&&r.part){var E;if(a.type===I.PlaylistContextType.LEVEL&&a.level!==null?E=this.hls.levels[a.level].details:a.type===I.PlaylistContextType.AUDIO_TRACK&&a.id!==null?E=this.hls.audioTracks[a.id].details:a.type===I.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(E=this.hls.subtitleTracks[a.id].details),E){var m=E.partTarget,f=E.targetduration;m&&f&&(A=Math.min(Math.max(m*3,f*.8)*1e3,A))}}var C={timeout:A,maxRetry:T,retryDelay:w,maxRetryDelay:v,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(a,C,b)},d.loadsuccess=function(a,r,s,S){if(S===void 0&&(S=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,r,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}r.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,r,s,S):this.handleMasterPlaylist(a,r,s,S)},d.loaderror=function(a,r,s){s===void 0&&(s=null),this.handleNetworkError(r,s,!1,a)},d.loadtimeout=function(a,r,s){s===void 0&&(s=null),this.handleNetworkError(r,s,!0)},d.handleMasterPlaylist=function(a,r,s,S){var x=this.hls,T=a.data,A=h(a,s),w=n.default.parseMasterPlaylist(T,A),v=w.levels,E=w.sessionData;if(!v.length){this.handleManifestParsingError(a,s,"no level found in manifest",S);return}var m=v.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),f=v.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),C=n.default.parseMasterPlaylistMedia(T,A,"AUDIO",m),b=n.default.parseMasterPlaylistMedia(T,A,"SUBTITLES",f),y=n.default.parseMasterPlaylistMedia(T,A,"CLOSED-CAPTIONS");if(C.length){var M=C.some(function(W){return!W.url});!M&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}x.trigger(N.Events.MANIFEST_LOADED,{levels:v,audioTracks:C,subtitles:b,captions:y,url:A,stats:r,networkDetails:S,sessionData:E})},d.handleTrackOrLevelPlaylist=function(a,r,s,S){var x=this.hls,T=s.id,A=s.level,w=s.type,v=h(a,s),E=Object(Y.isFiniteNumber)(T)?T:0,m=Object(Y.isFiniteNumber)(A)?A:E,f=p(s),C=n.default.parseLevelPlaylist(a.data,v,m,f,E);if(!C.fragments.length){x.trigger(N.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.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===I.PlaylistContextType.MANIFEST){var b={attrs:new g.AttrList({}),bitrate:0,details:C,name:"",url:v};x.trigger(N.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:v,stats:r,networkDetails:S,sessionData:null})}if(r.parsing.end=performance.now(),C.needSidxRanges){var y,M=(y=C.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:M,isSidxRequest:!0,type:w,level:A,levelDetails:C,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=C,this.handlePlaylistLoaded(a,r,s,S)},d.handleSidxRequest=function(a,r){var s=Object(k.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var S=s.references,x=r.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,r,s,S){this.hls.trigger(N.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===I.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:r,networkDetails:S})},d.handleNetworkError=function(a,r,s,S){s===void 0&&(s=!1),H.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=O.ErrorDetails.UNKNOWN,T=!1,A=this.getInternalLoader(a);switch(a.type){case I.PlaylistContextType.MANIFEST:x=s?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case I.PlaylistContextType.LEVEL:x=s?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case I.PlaylistContextType.AUDIO_TRACK:x=s?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:x=s?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}A&&this.resetInternalLoader(a.type);var w={type:O.ErrorTypes.NETWORK_ERROR,details:x,fatal:T,url:a.url,loader:A,context:a,networkDetails:r};S&&(w.response=S),this.hls.trigger(N.Events.ERROR,w)},d.handlePlaylistLoaded=function(a,r,s,S){var x=s.type,T=s.level,A=s.id,w=s.groupId,v=s.loader,E=s.levelDetails,m=s.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",S);return}if(!v)return;E.live&&(v.getCacheAge&&(E.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(x){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:E,level:T||0,id:A||0,stats:r,networkDetails:S,deliveryDirectives:m});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:E,id:A||0,groupId:w||"",stats:r,networkDetails:S,deliveryDirectives:m});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:E,id:A||0,groupId:w||"",stats:r,networkDetails:S,deliveryDirectives:m});break}},o}();z.default=c},"./src/polyfills/number.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"isFiniteNumber",function(){return Y}),P.d(z,"MAX_SAFE_INTEGER",function(){return N});var Y=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,z,P){"use strict";P.r(z);var Y=function(){function N(){}return N.getSilentFrame=function(H,k){switch(H){case"mp4a.40.2":if(k===1)return new Uint8Array([0,200,0,128,35,128]);if(k===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(k===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(k===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(k===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(k===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(k===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(k===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(k===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=Y},"./src/remux/mp4-generator.ts":function(q,z,P){"use strict";P.r(z);var Y=Math.pow(2,32)-1,N=function(){function O(){}return O.init=function(){O.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 k;for(k in O.types)O.types.hasOwnProperty(k)&&(O.types[k]=[k.charCodeAt(0),k.charCodeAt(1),k.charCodeAt(2),k.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);O.HDLR_TYPES={video:n,audio:I};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]);O.STTS=O.STSC=O.STCO=p,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.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]);O.FTYP=O.box(O.types.ftyp,h,o,h,c),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,g))},O.box=function(k){for(var n=8,I=arguments.length,g=new Array(I>1?I-1:0),p=1;p<I;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(k,4),h=0,n=8;h<c;h++)o.set(g[h],n),n+=g[h].byteLength;return o},O.hdlr=function(k){return O.box(O.types.hdlr,O.HDLR_TYPES[k])},O.mdat=function(k){return O.box(O.types.mdat,k)},O.mdhd=function(k,n){n*=k;var I=Math.floor(n/(Y+1)),g=Math.floor(n%(Y+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,I>>24,I>>16&255,I>>8&255,I&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},O.mdia=function(k){return O.box(O.types.mdia,O.mdhd(k.timescale,k.duration),O.hdlr(k.type),O.minf(k))},O.mfhd=function(k){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255]))},O.minf=function(k){return k.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(k)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(k))},O.moof=function(k,n,I){return O.box(O.types.moof,O.mfhd(k),O.traf(I,n))},O.moov=function(k){for(var n=k.length,I=[];n--;)I[n]=O.trak(k[n]);return O.box.apply(null,[O.types.moov,O.mvhd(k[0].timescale,k[0].duration)].concat(I).concat(O.mvex(k)))},O.mvex=function(k){for(var n=k.length,I=[];n--;)I[n]=O.trex(k[n]);return O.box.apply(null,[O.types.mvex].concat(I))},O.mvhd=function(k,n){n*=k;var I=Math.floor(n/(Y+1)),g=Math.floor(n%(Y+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,I>>24,I>>16&255,I>>8&255,I&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 O.box(O.types.mvhd,p)},O.sdtp=function(k){var n=k.samples||[],I=new Uint8Array(4+n.length),g,p;for(g=0;g<n.length;g++)p=n[g].flags,I[g+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return O.box(O.types.sdtp,I)},O.stbl=function(k){return O.box(O.types.stbl,O.stsd(k),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(k){var n=[],I=[],g,p,h;for(g=0;g<k.sps.length;g++)p=k.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<k.pps.length;g++)p=k.pps[g],h=p.byteLength,I.push(h>>>8&255),I.push(h&255),I=I.concat(Array.prototype.slice.call(p));var c=O.box(O.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|k.sps.length].concat(n).concat([k.pps.length]).concat(I))),o=k.width,d=k.height,i=k.pixelRatio[0],a=k.pixelRatio[1];return O.box(O.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,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,a>>24,a>>16&255,a>>8&255,a&255])))},O.esds=function(k){var n=k.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(k.config).concat([6,1,2]))},O.mp4a=function(k){var n=k.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),O.box(O.types.esds,O.esds(k)))},O.mp3=function(k){var n=k.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},O.stsd=function(k){return k.type==="audio"?!k.isAAC&&k.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(k)):O.box(O.types.stsd,O.STSD,O.mp4a(k)):O.box(O.types.stsd,O.STSD,O.avc1(k))},O.tkhd=function(k){var n=k.id,I=k.duration*k.timescale,g=k.width,p=k.height,h=Math.floor(I/(Y+1)),c=Math.floor(I%(Y+1));return O.box(O.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]))},O.traf=function(k,n){var I=O.sdtp(k),g=k.id,p=Math.floor(n/(Y+1)),h=Math.floor(n%(Y+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),O.box(O.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])),O.trun(k,I.length+16+20+8+16+8+8),I)},O.trak=function(k){return k.duration=k.duration||4294967295,O.box(O.types.trak,O.tkhd(k),O.mdia(k))},O.trex=function(k){var n=k.id;return O.box(O.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]))},O.trun=function(k,n){var I=k.samples||[],g=I.length,p=12+16*g,h=new Uint8Array(p),c,o,d,i,a,r;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=I[c],d=o.duration,i=o.size,a=o.flags,r=o.cts,h.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*c);return O.box(O.types.trun,h)},O.initSegment=function(k){O.types||O.init();var n=O.moov(k),I=new Uint8Array(O.FTYP.byteLength+n.byteLength);return I.set(O.FTYP),I.set(n,O.FTYP.byteLength),I},O}();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(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return r}),P.d(z,"normalizePts",function(){return s});var Y=P("./src/polyfills/number.ts"),N=P("./src/remux/aac-helper.ts"),O=P("./src/remux/mp4-generator.ts"),H=P("./src/events.ts"),k=P("./src/errors.ts"),n=P("./src/utils/logger.ts"),I=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 E in v)Object.prototype.hasOwnProperty.call(v,E)&&(A[E]=v[E])}return A},p.apply(this,arguments)}var h=10*1e3,c=1024,o=1152,d=null,i=null,a=!1,r=function(){function A(v,E,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=E,this.typeSupported=m,this.ISGenerated=!1,d===null){var C=navigator.userAgent||"",b=C.match(/Chrome\/(\d+)/i);d=b?parseInt(b[1]):0}if(i===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);i=y?parseInt(y[1]):0}a=!!d&&d<75||!!i&&i<600}var w=A.prototype;return w.destroy=function(){},w.resetTimeStamp=function(E){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},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(E){var m=!1,f=E.reduce(function(C,b){var y=b.pts-C;return y<-4294967296?(m=!0,s(C,b.pts)):y>0?C:b.pts},E[0].pts);return m&&n.logger.debug("PTS rollover detected"),f},w.remux=function(E,m,f,C,b,y,M,W){var L,K,F,R,V,ne,se=b,Se=b,Le=E.pid>-1,Ae=m.pid>-1,Pe=m.samples.length,Fe=E.samples.length>0,je=Pe>1,Te=(!Le||Fe)&&(!Ae||je)||this.ISGenerated||M;if(Te){this.ISGenerated||(F=this.generateIS(E,m,b));var Z=this.isVideoContiguous,U=-1;if(je&&(U=S(m.samples),!Z&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,U>0){n.logger.warn("[mp4-remuxer]: Dropped "+U+" out of "+Pe+" video samples due to a missing keyframe");var G=this.getVideoStartPts(m.samples);m.samples=m.samples.slice(U),m.dropped+=U,Se+=(m.samples[0].pts-G)/(m.timescale||9e4)}else U===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Pe+" video samples"),ne=!1);if(this.ISGenerated){if(Fe&&je){var ee=this.getVideoStartPts(m.samples),ue=s(E.samples[0].pts,ee)-ee,J=ue/m.inputTimeScale;se+=Math.max(0,J),Se+=Math.max(0,-J)}if(Fe){if(E.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(E,m,b)),K=this.remuxAudio(E,se,this.isAudioContiguous,y,Ae||je||W===I.PlaylistLevelType.AUDIO?Se:void 0),je){var we=K?K.endPTS-K.startPTS:0;m.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(E,m,b)),L=this.remuxVideo(m,Se,Z,we)}}else je&&(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,b)),C.samples.length&&(R=this.remuxText(C,b))),{audio:K,video:L,initSegment:F,independent:ne,text:R,id3:V}},w.generateIS=function(E,m,f){var C=E.samples,b=m.samples,y=this.typeSupported,M={},W=!Object(Y.isFiniteNumber)(this._initPTS),L="audio/mp4",K,F,R;if(W&&(K=F=Infinity),E.config&&C.length&&(E.timescale=E.samplerate,E.isAAC||(y.mpeg?(L="audio/mpeg",E.codec=""):y.mp3&&(E.codec="mp3")),M.audio={id:"audio",container:L,codec:E.codec,initSegment:!E.isAAC&&y.mpeg?new Uint8Array(0):O.default.initSegment([E]),metadata:{channelCount:E.channelCount}},W&&(R=E.inputTimeScale,K=F=C[0].pts-Math.round(R*f))),m.sps&&m.pps&&b.length&&(m.timescale=m.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:m.codec,initSegment:O.default.initSegment([m]),metadata:{width:m.width,height:m.height}},W)){R=m.inputTimeScale;var V=this.getVideoStartPts(b),ne=Math.round(R*f);F=Math.min(F,s(b[0].dts,V)-ne),K=Math.min(K,V-ne)}if(Object.keys(M).length)return this.ISGenerated=!0,W&&(this._initPTS=K,this._initDTS=F),{tracks:M,initPTS:K,timescale:R}},w.remuxVideo=function(E,m,f,C){var b=E.inputTimeScale,y=E.samples,M=[],W=y.length,L=this._initPTS,K=this.nextAvcDts,F=8,R,V,ne,se=Number.POSITIVE_INFINITY,Se=Number.NEGATIVE_INFINITY,Le=0,Ae=!1;if(!f||K===null){var Pe=m*b,Fe=y[0].pts-s(y[0].dts,y[0].pts);K=Pe-Fe}for(var je=0;je<W;je++){var Te=y[je];if(Te.pts=s(Te.pts-L,K),Te.dts=s(Te.dts-L,K),Te.dts>Te.pts){var Z=9e4*.2;Le=Math.max(Math.min(Le,Te.pts-Te.dts),-1*Z)}Te.dts<y[je>0?je-1:je].dts&&(Ae=!0)}Ae&&y.sort(function(qt,xt){var Ct=qt.dts-xt.dts,Pt=qt.pts-xt.pts;return Ct||Pt}),V=y[0].dts,ne=y[y.length-1].dts;var U=Math.round((ne-V)/(W-1));if(Le<0){if(Le<U*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-U,!0)+" ms");for(var G=Le,ee=0;ee<W;ee++)y[ee].dts=G=Math.max(G,y[ee].pts-U),y[ee].pts=Math.max(G,y[ee].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(Le,!0)+" ms to overcome this issue");for(var ue=0;ue<W;ue++)y[ue].dts=y[ue].dts+Le}V=y[0].dts}if(f){var J=V-K,we=J>U,Ge=J<-1;if(we||Ge){we?n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(J,!0)+" ms ("+J+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-J,!0)+" ms ("+J+"dts) overlapping between fragments detected"),V=K;var Je=y[0].pts-J;y[0].dts=V,y[0].pts=Je,n.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Je,!0)+"/"+Object(g.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(J,!0)+" ms")}}a&&(V=Math.max(0,V));for(var be=0,Re=0,xe=0;xe<W;xe++){for(var Ce=y[xe],Be=Ce.units,Xe=Be.length,qe=0,tt=0;tt<Xe;tt++)qe+=Be[tt].data.length;Re+=qe,be+=Xe,Ce.length=qe,Ce.dts=Math.max(Ce.dts,V),Ce.pts=Math.max(Ce.pts,Ce.dts,0),se=Math.min(Ce.pts,se),Se=Math.max(Ce.pts,Se)}ne=y[W-1].dts;var ht=Re+4*be+8,ft;try{ft=new Uint8Array(ht)}catch(qt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ht,reason:"fail allocating video mdat "+ht});return}var Ne=new DataView(ft.buffer);Ne.setUint32(0,ht),ft.set(O.default.types.mdat,4);for(var Ue=0;Ue<W;Ue++){for(var Ze=y[Ue],et=Ze.units,fe=0,re=0,ie=et.length;re<ie;re++){var ce=et[re],pe=ce.data,le=ce.data.byteLength;Ne.setUint32(F,le),F+=4,ft.set(pe,F),F+=le,fe+=4+le}if(Ue<W-1)R=y[Ue+1].dts-Ze.dts;else{var he=this.config,ye=Ze.dts-y[Ue>0?Ue-1:Ue].dts;if(he.stretchShortVideoTrack&&this.nextAudioPts!==null){var _e=Math.floor(he.maxBufferHole*b),Oe=(C?se+C*b:this.nextAudioPts)-Ze.pts;Oe>_e?(R=Oe-ye,R<0&&(R=ye),n.logger.log("[mp4-remuxer]: It is approximately "+Oe/90+" ms to the next segment; using duration "+R/90+" ms for the last video frame.")):R=ye}else R=ye}var ke=Math.round(Ze.pts-Ze.dts);M.push(new x(Ze.key,R,fe,ke))}if(M.length&&d&&d<70){var $e=M[0].flags;$e.dependsOn=2,$e.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=K=ne+R,this.isVideoContiguous=!0;var ot=O.default.moof(E.sequenceNumber++,V,p({},E,{samples:M})),pt="video",mt={data1:ot,data2:ft,startPTS:se/b,endPTS:(Se+R)/b,startDTS:V/b,endDTS:K/b,type:pt,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(ft.length,"MDAT length must not be zero"),mt},w.remuxAudio=function(E,m,f,C,b){var y=E.inputTimeScale,M=E.samplerate?E.samplerate:y,W=y/M,L=E.isAAC?c:o,K=L*W,F=this._initPTS,R=!E.isAAC&&this.typeSupported.mpeg,V=[],ne=E.samples,se=R?0:8,Se=this.nextAudioPts||-1,Le=m*y;if(this.isAudioContiguous=f=f||ne.length&&Se>0&&(C&&Math.abs(Le-Se)<9e3||Math.abs(s(ne[0].pts-F,Le)-Se)<20*K),ne.forEach(function(pe){pe.pts=s(pe.pts-F,Le)}),!f||Se<0){if(ne=ne.filter(function(pe){return pe.pts>=0}),!ne.length)return;b===0?Se=0:C?Se=Math.max(0,Le):Se=ne[0].pts}if(E.isAAC)for(var Ae=b!==void 0,Pe=this.config.maxAudioFramesDrift,Fe=0,je=Se;Fe<ne.length;Fe++){var Te=ne[Fe],Z=Te.pts,U=Z-je,G=Math.abs(1e3*U/y);if(U<=-Pe*K&&Ae)Fe===0&&(n.logger.warn("Audio frame @ "+(Z/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*U/y)+" ms."),this.nextAudioPts=Se=je=Z);else if(U>=Pe*K&&G<h&&Ae){var ee=Math.round(U/K);je=Z-ee*K,je<0&&(ee--,je+=K),Fe===0&&(this.nextAudioPts=Se=je),n.logger.warn("[mp4-remuxer]: Injecting "+ee+" audio frame @ "+(je/y).toFixed(3)+"s due to "+Math.round(1e3*U/y)+" ms gap.");for(var ue=0;ue<ee;ue++){var J=Math.max(je,0),we=N.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);we||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),we=Te.unit.subarray()),ne.splice(Fe,0,{unit:we,pts:J}),je+=K,Fe++}}Te.pts=je,je+=K}for(var Ge=null,Je=null,be,Re=0,xe=ne.length;xe--;)Re+=ne[xe].unit.byteLength;for(var Ce=0,Be=ne.length;Ce<Be;Ce++){var Xe=ne[Ce],qe=Xe.unit,tt=Xe.pts;if(Je!==null){var ht=V[Ce-1];ht.duration=Math.round((tt-Je)/W)}else if(f&&E.isAAC&&(tt=Se),Ge=tt,Re>0){Re+=se;try{be=new Uint8Array(Re)}catch(pe){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Re,reason:"fail allocating audio mdat "+Re});return}if(!R){var ft=new DataView(be.buffer);ft.setUint32(0,Re),be.set(O.default.types.mdat,4)}}else return;be.set(qe,se);var Ne=qe.byteLength;se+=Ne,V.push(new x(!0,L,Ne,0)),Je=tt}var Ue=V.length;if(!Ue)return;var Ze=V[V.length-1];this.nextAudioPts=Se=Je+W*Ze.duration;var et=R?new Uint8Array(0):O.default.moof(E.sequenceNumber++,Ge/W,p({},E,{samples:V}));E.samples=[];var fe=Ge/y,re=Se/y,ie="audio",ce={data1:et,data2:be,startPTS:fe,endPTS:re,startDTS:fe,endDTS:re,type:ie,hasAudio:!0,hasVideo:!1,nb:Ue};return this.isAudioContiguous=!0,console.assert(be.length,"MDAT length must not be zero"),ce},w.remuxEmptyAudio=function(E,m,f,C){var b=E.inputTimeScale,y=E.samplerate?E.samplerate:b,M=b/y,W=this.nextAudioPts,L=(W!==null?W:C.startDTS*b)+this._initDTS,K=C.endDTS*b+this._initDTS,F=M*c,R=Math.ceil((K-L)/F),V=N.default.getSilentFrame(E.manifestCodec||E.codec,E.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*F;ne.push({unit:V,pts:Se,dts:Se})}return E.samples=ne,this.remuxAudio(E,m,f,!1)},w.remuxID3=function(E,m){var f=E.samples.length;if(!f)return;for(var C=E.inputTimeScale,b=this._initPTS,y=this._initDTS,M=0;M<f;M++){var W=E.samples[M];W.pts=s(W.pts-b,m*C)/C,W.dts=s(W.dts-y,m*C)/C}var L=E.samples;return E.samples=[],{samples:L}},w.remuxText=function(E,m){var f=E.samples.length;if(!f)return;for(var C=E.inputTimeScale,b=this._initPTS,y=0;y<f;y++){var M=E.samples[y];M.pts=s(M.pts-b,m*C)/C}E.samples.sort(function(L,K){return L.pts-K.pts});var W=E.samples;return E.samples=[],{samples:W}},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,E,m){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=E,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(q,z,P){"use strict";P.r(z);var Y=P("./src/polyfills/number.ts"),N=P("./src/utils/mp4-tools.ts"),O=P("./src/loader/fragment.ts"),H=P("./src/utils/logger.ts"),k=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 i=this.initData=Object(N.parseInitSegment)(c);o||(o=I(i.audio,O.ElementaryStreamTypes.AUDIO)),d||(d=I(i.video,O.ElementaryStreamTypes.VIDEO));var a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:o+","+d,initSegment:c,id:"main"}:i.audio?a.audio={container:"audio/mp4",codec:o,initSegment:c,id:"audio"}:i.video?a.video={container:"video/mp4",codec:d,initSegment:c,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},p.remux=function(c,o,d,i,a){var r=this.initPTS,s=this.lastEndDTS,S={audio:void 0,video:void 0,text:i,id3:d,initSegment:void 0};Object(Y.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 H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(Y.isFiniteNumber)(r)||(this.initPTS=T.initPTS=r=n(A,x,s));var w=Object(N.getDuration)(x,A),v=s,E=w+v;Object(N.offsetStartDTS)(A,x,r),w>0?this.lastEndDTS=E:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var m=!!A.audio,f=!!A.video,C="";m&&(C+="audio"),f&&(C+="video");var b={data1:x,startPTS:v,startDTS:v,endPTS:E,endDTS:E,type:C,hasAudio:m,hasVideo:f,nb:1,dropped:0};return S.audio=b.type==="audio"?b:void 0,S.video=b.type!=="audio"?b:void 0,S.text=i,S.id3=d,S.initSegment=T,S},g}(),n=function(p,h,c){return Object(N.getStartDTS)(p,h)-c};function I(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===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=k},"./src/task-loop.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return Y});var Y=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=N.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(k){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,k),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},N}()},"./src/types/cmcd.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"CMCDVersion",function(){return Y}),P.d(z,"CMCDObjectType",function(){return N}),P.d(z,"CMCDStreamingFormat",function(){return O}),P.d(z,"CMCDStreamType",function(){return H});var Y=1,N;(function(k){k.MANIFEST="m",k.AUDIO="a",k.VIDEO="v",k.MUXED="av",k.INIT="i",k.CAPTION="c",k.TIMED_TEXT="tt",k.KEY="k",k.OTHER="o"})(N||(N={}));var O;(function(k){k.DASH="d",k.HLS="h",k.SMOOTH="s",k.OTHER="o"})(O||(O={}));var H;(function(k){k.VOD="v",k.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"HlsSkip",function(){return O}),P.d(z,"getSkipValue",function(){return H}),P.d(z,"HlsUrlParameters",function(){return k}),P.d(z,"Level",function(){return n});function Y(I,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(I,h.key,h)}}function N(I,g,p){return g&&Y(I.prototype,g),p&&Y(I,p),I}var O;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(O||(O={}));function H(I,g){var p=I.canSkipUntil,h=I.canSkipDateRanges,c=I.endSN,o=g!==void 0?g-c:0;return p&&o<p?h?O.v2:O.Yes:O.No}var k=function(){function I(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=I.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()},I}(),n=function(){function I(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(I,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(p){var h=p%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),I}()},"./src/types/loader.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"PlaylistContextType",function(){return Y}),P.d(z,"PlaylistLevelType",function(){return N});var Y;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(Y||(Y={}));var N;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"ChunkMetadata",function(){return Y});var Y=function(H,k,n,I,g,p){I===void 0&&(I=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=H,this.sn=k,this.id=n,this.size=I,this.part=g,this.partial=p};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"AttrList",function(){return O});var Y=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function H(n){typeof n=="string"&&(n=H.parseAttrList(n));for(var I in n)n.hasOwnProperty(I)&&(this[I]=n[I])}var k=H.prototype;return k.decimalInteger=function(I){var g=parseInt(this[I],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},k.hexadecimalInteger=function(I){if(this[I]){var g=(this[I]||"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},k.hexadecimalIntegerAsNumber=function(I){var g=parseInt(this[I],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},k.decimalFloatingPoint=function(I){return parseFloat(this[I])},k.optionalFloat=function(I,g){var p=this[I];return p?parseFloat(p):g},k.enumeratedString=function(I){return this[I]},k.bool=function(I){return this[I]==="YES"},k.decimalResolution=function(I){var g=Y.exec(this[I]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},H.parseAttrList=function(I){var g,p={},h='"';for(N.lastIndex=0;(g=N.exec(I))!==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},H}()},"./src/utils/binary-search.ts":function(q,z,P){"use strict";P.r(z);var Y={search:function(O,H){for(var k=0,n=O.length-1,I=null,g=null;k<=n;){I=(k+n)/2|0,g=O[I];var p=H(g);if(p>0)k=I+1;else if(p<0)n=I-1;else return g}return null}};z.default=Y},"./src/utils/buffer-helper.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"BufferHelper",function(){return O});var Y=P("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function H(){}return H.isBuffered=function(n,I){try{if(n){for(var g=H.getBuffered(n),p=0;p<g.length;p++)if(I>=g.start(p)&&I<=g.end(p))return!0}}catch(h){}return!1},H.bufferInfo=function(n,I,g){try{if(n){var p=H.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,I,g)}}catch(o){}return{len:0,start:I,end:I,nextStart:void 0}},H.bufferedInfo=function(n,I,g){I=Math.max(0,I),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,i,a=I,r=I,s=0;s<p.length;s++){var S=p[s].start,x=p[s].end;if(I+g>=S&&I<x)a=S,r=x,d=r-I;else if(I+g<S){i=S;break}}return{len:d,start:a||0,end:r||0,nextStart:i}},H.getBuffered=function(n){try{return n.buffered}catch(I){return Y.logger.log("failed to get media.buffered",I),N}},H}()},"./src/utils/cea-608-parser.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"Row",function(){return r}),P.d(z,"CaptionScreen",function(){return s});var Y=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},O=function(E){var m=E;return N.hasOwnProperty(E)&&(m=N[E]),String.fromCharCode(m)},H=15,k=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},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 E=v.prototype;return E.log=function(f,C){this.verboseLevel>=f&&Y.logger.log(this.time+" ["+f+"] "+C)},v}(),d=function(E){for(var m=[],f=0;f<E.length;f++)m.push(E[f].toString(16));return m},i=function(){function v(m,f,C,b,y){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=C||!1,this.background=b||"black",this.flash=y||!1}var E=v.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(f){for(var C=["foreground","underline","italics","background","flash"],b=0;b<C.length;b++){var y=C[b];f.hasOwnProperty(y)&&(this[y]=f[y])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},E.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},E.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,C,b,y,M){this.uchar=void 0,this.penState=void 0,this.uchar=m||" ",this.penState=new i(f,C,b,y,M)}var E=v.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(f,C){this.uchar=f,this.penState.copy(C)},E.setPenState=function(f){this.penState.copy(f)},E.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},E.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),r=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<k;f++)this.chars.push(new a);this.logger=m,this.pos=0,this.currPenState=new i}var E=v.prototype;return E.equals=function(f){for(var C=!0,b=0;b<k;b++)if(!this.chars[b].equals(f.chars[b])){C=!1;break}return C},E.copy=function(f){for(var C=0;C<k;C++)this.chars[C].copy(f.chars[C])},E.isEmpty=function(){for(var f=!0,C=0;C<k;C++)if(!this.chars[C].isEmpty()){f=!1;break}return f},E.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>k&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=k)},E.moveCursor=function(f){var C=this.pos+f;if(f>1)for(var b=this.pos+1;b<C+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(C)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(f){f>=144&&this.backSpace();var C=O(f);if(this.pos>=k){this.logger.log(c.ERROR,"Cannot insert "+f.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(f){var C;for(C=f;C<k;C++)this.chars[C].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var f=[],C=!0,b=0;b<k;b++){var y=this.chars[b].uchar;y!==" "&&(C=!1),f.push(y)}return C?"":f.join("")},E.setPenStyles=function(f){this.currPenState.setStyles(f);var C=this.chars[this.pos];C.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<H;f++)this.rows.push(new r(m));this.logger=m,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=v.prototype;return E.reset=function(){for(var f=0;f<H;f++)this.rows[f].clear();this.currRow=H-1},E.equals=function(f){for(var C=!0,b=0;b<H;b++)if(!this.rows[b].equals(f.rows[b])){C=!1;break}return C},E.copy=function(f){for(var C=0;C<H;C++)this.rows[C].copy(f.rows[C])},E.isEmpty=function(){for(var f=!0,C=0;C<H;C++)if(!this.rows[C].isEmpty()){f=!1;break}return f},E.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},E.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},E.insertChar=function(f){var C=this.rows[this.currRow];C.insertChar(f)},E.setPen=function(f){var C=this.rows[this.currRow];C.setPenStyles(f)},E.moveCursor=function(f){var C=this.rows[this.currRow];C.moveCursor(f)},E.setCursor=function(f){this.logger.log(c.INFO,"setCursor: "+f);var C=this.rows[this.currRow];C.setCursor(f)},E.setPAC=function(f){this.logger.log(c.INFO,"pacData = "+JSON.stringify(f));var C=f.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var b=0;b<H;b++)this.rows[b].clear();var y=this.currRow+1-this.nrRollUpRows,M=this.lastOutputScreen;if(M){var W=M.rows[y].cueStartTime,L=this.logger.time;if(W&&L!==null&&W<L)for(var K=0;K<this.nrRollUpRows;K++)this.rows[C-this.nrRollUpRows+K+1].copy(M.rows[y+K])}}this.currRow=C;var F=this.rows[this.currRow];if(f.indent!==null){var R=f.indent,V=Math.max(R-1,0);F.setCursor(f.indent),f.color=F.chars[V].penState.foreground}var ne={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(ne)},E.setBkgData=function(f){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},E.setRollUpRows=function(f){this.nrRollUpRows=f},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(f,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(c.INFO,"Rolling up")},E.getDisplayText=function(f){f=f||!1;for(var C=[],b="",y=-1,M=0;M<H;M++){var W=this.rows[M].getTextString();W&&(y=M+1,f?C.push("Row "+y+": '"+W+"'"):C.push(W.trim()))}return C.length>0&&(f?b="["+C.join(" | ")+"]":b=C.join(`
|
|
`)),b},E.getTextAndFormat=function(){return this.rows},v}(),S=function(){function v(m,f,C){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=m,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new s(C),this.nonDisplayedMemory=new s(C),this.lastOutputScreen=new s(C),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var E=v.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(f){this.outputFilter=f},E.setPAC=function(f){this.writeScreen.setPAC(f)},E.setBkgData=function(f){this.writeScreen.setBkgData(f)},E.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},E.insertChars=function(f){for(var C=0;C<f.length;C++)this.writeScreen.insertChar(f[C]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(f){this.logger.log(c.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},E.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var 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)},E.ccTO=function(f){this.logger.log(c.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},E.ccMIDROW=function(f){var C={flash:!1};if(C.underline=f%2===1,C.italics=f>=46,C.italics)C.foreground="white";else{var b=Math.floor(f/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=y[b]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},E.outputDataUpdate=function(f){f===void 0&&(f=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},E.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,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new o;this.channels=[null,new S(m,f,b),new S(m+1,C,b)],this.cmdHistory=w(),this.logger=b}var E=v.prototype;return E.getHandler=function(f){return this.channels[f].getHandler()},E.setHandler=function(f,C){this.channels[f].setHandler(C)},E.addData=function(f,C){var b,y,M,W=!1;this.logger.time=f;for(var L=0;L<C.length;L+=2){if(y=C[L]&127,M=C[L+1]&127,y===0&&M===0)continue;if(this.logger.log(c.DATA,"["+d([C[L],C[L+1]])+"] -> ("+d([y,M])+")"),b=this.parseCmd(y,M),b||(b=this.parseMidrow(y,M)),b||(b=this.parsePAC(y,M)),b||(b=this.parseBackgroundAttributes(y,M)),!b&&(W=this.parseChars(y,M),W)){var K=this.currentChannel;if(K&&K>0){var F=this.channels[K];F.insertChars(W)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!W&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+d([y,M])+" orig: "+d([C[L],C[L+1]]))}},E.parseCmd=function(f,C){var b=this.cmdHistory,y=(f===20||f===28||f===21||f===29)&&C>=32&&C<=47,M=(f===23||f===31)&&C>=33&&C<=35;if(!(y||M))return!1;if(A(f,C,b))return T(null,null,b),this.logger.log(c.DEBUG,"Repeated command ("+d([f,C])+") is dropped"),!0;var W=f===20||f===21||f===23?1:2,L=this.channels[W];return f===20||f===21||f===28||f===29?C===32?L.ccRCL():C===33?L.ccBS():C===34?L.ccAOF():C===35?L.ccAON():C===36?L.ccDER():C===37?L.ccRU(2):C===38?L.ccRU(3):C===39?L.ccRU(4):C===40?L.ccFON():C===41?L.ccRDC():C===42?L.ccTR():C===43?L.ccRTD():C===44?L.ccEDM():C===45?L.ccCR():C===46?L.ccENM():C===47&&L.ccEOC():L.ccTO(C-32),T(f,C,b),this.currentChannel=W,!0},E.parseMidrow=function(f,C){var b=0;if((f===17||f===25)&&C>=32&&C<=47){if(f===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[b];return y?(y.ccMIDROW(C),this.logger.log(c.DEBUG,"MIDROW ("+d([f,C])+")"),!0):!1}return!1},E.parsePAC=function(f,C){var b,y=this.cmdHistory,M=(f>=17&&f<=23||f>=25&&f<=31)&&C>=64&&C<=127,W=(f===16||f===24)&&C>=64&&C<=95;if(!(M||W))return!1;if(A(f,C,y))return T(null,null,y),!0;var L=f<=23?1:2;C>=64&&C<=95?b=L===1?n[f]:g[f]:b=L===1?I[f]:p[f];var K=this.channels[L];return K?(K.setPAC(this.interpretPAC(b,C)),T(f,C,y),this.currentChannel=L,!0):!1},E.interpretPAC=function(f,C){var b,y={color:null,italics:!1,indent:null,underline:!1,row:f};return C>95?b=C-96:b=C-64,y.underline=(b&1)===1,b<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((b-16)/2)*4,y},E.parseChars=function(f,C){var b,y=null,M=null;if(f>=25?(b=2,M=f-8):(b=1,M=f),M>=17&&M<=19){var W;M===17?W=C+80:M===18?W=C+112:W=C+144,this.logger.log(c.INFO,"Special char '"+O(W)+"' in channel "+b),y=[W]}else f>=32&&f<=127&&(y=C===0?[f]:[f,C]);if(y){var L=d(y);this.logger.log(c.DEBUG,"Char codes = "+L.join(",")),T(f,C,this.cmdHistory)}return y},E.parseBackgroundAttributes=function(f,C){var b=(f===16||f===24)&&C>=32&&C<=47,y=(f===23||f===31)&&C>=45&&C<=47;if(!(b||y))return!1;var M,W={};f===16||f===24?(M=Math.floor((C-32)/2),W.background=h[M],C%2===1&&(W.background=W.background+"_semi")):C===45?W.background="transparent":(W.foreground="black",C===47&&(W.underline=!0));var L=f<=23?1:2,K=this.channels[L];return K.setBkgData(W),T(f,C,this.cmdHistory),!0},E.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var C=this.channels[f];C&&C.reset()}this.cmdHistory=w()},E.cueSplitAtTime=function(f){for(var C=0;C<this.channels.length;C++){var b=this.channels[C];b&&b.cueSplitAtTime(f)}},v}();function T(v,E,m){m.a=v,m.b=E}function A(v,E,m){return m.a===v&&m.b===E}function w(){return{a:null,b:null}}z.default=x},"./src/utils/codecs.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"isCodecType",function(){return N}),P.d(z,"isCodecSupportedInMp4",function(){return O});var Y={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(H,k){var n=Y[k];return!!n&&n[H.slice(0,4)]===!0}function O(H,k){return MediaSource.isTypeSupported((k||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/utils/vttparser.ts"),N=P("./src/utils/webvtt-parser.ts"),O=P("./src/utils/texttrack-utils.ts"),H=/\s/,k={newCue:function(I,g,p,h){for(var c=[],o,d,i,a,r,s=self.VTTCue||self.TextTrackCue,S=0;S<h.rows.length;S++)if(o=h.rows[S],i=!0,a=0,r="",!o.isEmpty()){for(var x=0;x<o.chars.length;x++)H.test(o.chars[x].uchar)&&i?a++:(r+=o.chars[x].uchar,i=!1);o.cueStartTime=g,g===p&&(p+=1e-4),a>=16?a--:a++;var T=Object(Y.fixLineBreaks)(r.trim()),A=Object(N.generateCueId)(g,p,T);(!I||!I.cues||!I.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 I&&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(O.addCueToTrack)(I,w)})),c}};z.default=k},"./src/utils/discontinuities.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"findFirstFragWithCC",function(){return H}),P.d(z,"shouldAlignOnDiscontinuities",function(){return k}),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 Y=P("./src/polyfills/number.ts"),N=P("./src/utils/logger.ts"),O=P("./src/controller/level-helper.ts");function H(i,a){for(var r=null,s=0,S=i.length;s<S;s++){var x=i[s];if(x&&x.cc===a){r=x;break}}return r}function k(i,a,r){return!!(a.details&&(r.endCC>r.startCC||i&&i.cc<r.startCC))}function n(i,a){var r=i.fragments,s=a.fragments;if(!s.length||!r.length){N.logger.log("No fragments to align");return}var S=H(r,s[0].cc);if(!S||S&&!S.startPTS){N.logger.log("No frag in previous level to align on");return}return S}function I(i,a){if(i){var r=i.start+a;i.start=i.startPTS=r,i.endPTS=r+i.duration}}function g(i,a){for(var r=a.fragments,s=0,S=r.length;s<S;s++)I(r[s],i);a.fragmentHint&&I(a.fragmentHint,i),a.alignedSliding=!0}function p(i,a,r){if(!a)return;h(i,r,a),!r.alignedSliding&&a.details&&c(r,a.details),!r.alignedSliding&&a.details&&!r.skippedSegments&&Object(O.adjustSliding)(a.details,r)}function h(i,a,r){if(k(i,r,a)){var s=n(r.details,a);s&&Object(Y.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(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,s=i.fragments[0].programDateTime,S=(s-r)/1e3+a.fragments[0].start;S&&Object(Y.isFiniteNumber)(S)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(s-r)+"ms, sliding:"+S.toFixed(3)+" "+i.url+" "),g(S,i))}function o(i,a){var r=i.programDateTime;if(!r)return;var s=(r-a)/1e3;i.start=i.startPTS=s,i.endPTS=s+i.duration}function d(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,s=a.fragments[0].start,S=r-s*1e3;i.fragments.forEach(function(x){o(x,S)}),i.fragmentHint&&o(i.fragmentHint,S),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/utils/ewma.ts"),N=function(){function O(k,n,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Y.default(k),this.fast_=new Y.default(n)}var H=O.prototype;return H.update=function(n,I){var g=this.slow_,p=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new Y.default(n,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new Y.default(I,p.getEstimate(),p.getTotalWeight()))},H.sample=function(n,I){n=Math.max(n,this.minDelayMs_);var g=8*I,p=n/1e3,h=g/p;this.fast_.sample(p,h),this.slow_.sample(p,h)},H.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},O}();z.default=N},"./src/utils/ewma.ts":function(q,z,P){"use strict";P.r(z);var Y=function(){function N(H,k,n){k===void 0&&(k=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=k,this.totalWeight_=n}var O=N.prototype;return O.sample=function(k,n){var I=Math.pow(this.alpha_,k);this.estimate_=n*(1-I)+I*this.estimate_,this.totalWeight_+=k},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var k=1-Math.pow(this.alpha_,this.totalWeight_);if(k)return this.estimate_/k}return this.estimate_},N}();z.default=Y},"./src/utils/fetch-loader.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"fetchSupported",function(){return o});var Y=P("./src/polyfills/number.ts"),N=P("./src/loader/load-stats.ts"),O=P("./src/demux/chunk-cache.ts");function H(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,p(s,S)}function k(s){var S=typeof Map=="function"?new Map:void 0;return k=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)},k(s)}function n(s,S,x){return I()?n=Reflect.construct:n=function(A,w,v){var E=[null];E.push.apply(E,w);var m=Function.bind.apply(A,E),f=new m;return v&&p(f,v.prototype),f},n.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(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,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var m=i(T,this.controller.signal),f=w.onProgress,C=T.responseType==="arraybuffer",b=C?"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(E,T,v.response)},A.timeout),self.fetch(this.request).then(function(y){if(v.response=v.loader=y,!y.ok){var M=y.status,W=y.statusText;throw new r(W||"fetch, bad network response",M,y)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(y.headers.get("Content-Length")||"0"),f&&Object(Y.isFiniteNumber)(A.highWaterMark)?v.loadProgressively(y,E,T,A.highWaterMark,f):C?y.arrayBuffer():y.text()}).then(function(y){var M=v.response;self.clearTimeout(v.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=y[b];var W={url:M.url,data:y};f&&!Object(Y.isFiniteNumber)(A.highWaterMark)&&f(E,T,y,M),w.onSuccess(W,E,T,M)}).catch(function(y){if(self.clearTimeout(v.requestTimeout),E.aborted)return;var M=y.code||0;w.onError({code:M,text:y.message},T,y.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,E){v===void 0&&(v=0);var m=new O.default,f=T.body.getReader(),C=function b(){return f.read().then(function(y){if(y.done)return m.dataLength&&E(A,w,m.flush(),T),Promise.resolve(new ArrayBuffer(0));var M=y.value,W=M.length;return A.loaded+=W,W<v||m.dataLength?(m.push(M),m.dataLength>=v&&E(A,w,m.flush(),T)):E(A,w,M,T),b()}).catch(function(){return Promise.reject()})};return C()},s}();function i(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 r=function(s){H(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}(k(Error));z.default=d},"./src/utils/imsc1-ttml-parser.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"IMSC1_CODEC",function(){return g}),P.d(z,"parseIMSC1",function(){return o});var Y=P("./src/utils/mp4-tools.ts"),N=P("./src/utils/vttparser.ts"),O=P("./src/utils/vttcue.ts"),H=P("./src/demux/id3.ts"),k=P("./src/utils/timescale-conversion.ts"),n=P("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(v){for(var E=1;E<arguments.length;E++){var m=arguments[E];for(var f in m)Object.prototype.hasOwnProperty.call(m,f)&&(v[f]=m[f])}return v},I.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,E,m,f,C){var b=Object(Y.findBox)(new Uint8Array(v),["mdat"]);if(b.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var y=b[0],M=Object(H.utf8ArrayToStr)(new Uint8Array(v,y.start,y.end-y.start)),W=Object(k.toTimescaleFromScale)(E,1,m);try{f(d(M,W))}catch(L){C(L)}}function d(v,E){var m=new DOMParser,f=m.parseFromString(v,"text/xml"),C=f.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(b).reduce(function(F,R){return F[R]=C.getAttribute("ttp:"+R)||b[R],F},{}),M=C.getAttribute("xml:space")!=="preserve",W=a(i(C,"styling","style")),L=a(i(C,"layout","region")),K=i(C,"body","[begin]");return[].map.call(K,function(F){var R=r(F,M);if(!R||!F.hasAttribute("begin"))return null;var V=T(F.getAttribute("begin"),y),ne=T(F.getAttribute("dur"),y),se=T(F.getAttribute("end"),y);if(V===null)throw x(F);if(se===null){if(ne===null)throw x(F);se=V+ne}var Se=new O.default(V-E,se-E,R);Se.id=Object(n.generateCueId)(Se.startTime,Se.endTime,Se.text);var Le=L[F.getAttribute("region")],Ae=W[F.getAttribute("style")];Se.position=10,Se.size=80;var Pe=s(Le,Ae),Fe=Pe.textAlign;if(Fe){var je=c[Fe];je&&(Se.lineAlign=je),Se.align=Fe}return I(Se,Pe),Se}).filter(function(F){return F!==null})}function i(v,E,m){var f=v.getElementsByTagName(E)[0];return f?[].slice.call(f.querySelectorAll(m)):[]}function a(v){return v.reduce(function(E,m){var f=m.getAttribute("xml:id");return f&&(E[f]=m),E},{})}function r(v,E){return[].slice.call(v.childNodes).reduce(function(m,f,C){var b;return f.nodeName==="br"&&C?m+`
|
|
`:(b=f.childNodes)!==null&&b!==void 0&&b.length?r(f,E):E?m+f.textContent.trim().replace(/\s+/g," "):m+f.textContent},"")}function s(v,E){var m="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(C,b){var y=S(E,m,b)||S(v,m,b);return y&&(C[b]=y),C},{})}function S(v,E,m){return v.hasAttributeNS(E,m)?v.getAttributeNS(E,m):null}function x(v){return new Error("Could not parse ttml timestamp "+v)}function T(v,E){if(!v)return null;var m=Object(N.parseTimeStamp)(v);return m===null&&(p.test(v)?m=A(v,E):h.test(v)&&(m=w(v,E))),m}function A(v,E){var m=p.exec(v),f=(m[4]|0)+(m[5]|0)/E.subFrameRate;return(m[1]|0)*3600+(m[2]|0)*60+(m[3]|0)+f/E.frameRate}function w(v,E){var m=h.exec(v),f=Number(m[1]),C=m[2];switch(C){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/E.frameRate;case"t":return f/E.tickRate}return f}},"./src/utils/logger.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"enableLogs",function(){return n}),P.d(z,"logger",function(){return I});var Y=function(){},N={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y},O=N;function H(g){var p=self.console[g];return p?p.bind(self.console,"["+g+"] >"):Y}function k(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){O[o]=g[o]?g[o].bind(g):H(o)})}function n(g){if(self.console&&g===!0||typeof g=="object"){k(g,"debug","log","info","warn","error");try{O.log()}catch(p){O=N}}else O=N}var I=O},"./src/utils/mediakeys-helper.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"KeySystems",function(){return Y}),P.d(z,"requestMediaKeySystemAccess",function(){return N});var Y;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(Y||(Y={}));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(q,z,P){"use strict";P.r(z),P.d(z,"getMediaSource",function(){return Y});function Y(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"bin2str",function(){return k}),P.d(z,"readUint16",function(){return n}),P.d(z,"readUint32",function(){return I}),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 i}),P.d(z,"offsetStartDTS",function(){return a}),P.d(z,"segmentValidRange",function(){return r}),P.d(z,"appendUint8Array",function(){return s});var Y=P("./src/utils/typed-array.ts"),N=P("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,H=[].push;function k(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 I(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 E=w;E<v;){var m=I(A,E),f=k(A.subarray(E+4,E+8)),C=m>1?E+m:v;if(f===x[0])if(x.length===1)T.push({data:A,start:E+8,end:C});else{var b=p({data:A,start:E+8,end:C},x.slice(1));b.length&&H.apply(T,b)}E=C}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=[],E=w[0],m=E.data[0],f=m===0?8:16,C=I(E,f);f+=4;var b=0,y=0;m===0?f+=8:f+=16,f+=2;var M=E.end+y,W=n(E,f);f+=2;for(var L=0;L<W;L++){var K=f,F=I(E,K);K+=4;var R=F&2147483647,V=(F&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=I(E,K);K+=4,v.push({referenceSize:R,subsegmentDuration:ne,info:{duration:ne/C,start:M,end:M+R-1}}),M+=R,K+=4,f=K}return{earliestPresentationTime:b,timescale:C,version:m,referencesCount:W,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 E=v.data[v.start],m=E===0?12:20,f=I(v,m),C=p(w,["mdia","mdhd"])[0];if(C){E=C.data[C.start],m=E===0?12:20;var b=I(C,m),y=p(w,["mdia","hdlr"])[0];if(y){var M=k(y.data.subarray(y.start+8,y.start+12)),W={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[M];if(W){var L=p(w,["mdia","minf","stbl","stsd"])[0],K=void 0;L&&(K=k(L.data.subarray(L.start+12,L.start+16))),x[f]={timescale:b,type:W},x[W]={timescale:b,id:f,codec:K}}}}}}var F=p(S,["moov","mvex","trex"]);return F.forEach(function(R){var V=I(R,4),ne=x[V];ne&&(ne.default={duration:I(R,12),flags:I(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],E=p(A,["tfhd"]).reduce(function(m,f){var C=I(f,4),b=S[C];if(b){var y=I(w,4);v===1&&(y*=Math.pow(2,32),y+=I(w,8));var M=b.timescale||9e4,W=y/M;if(isFinite(W)&&(m===null||W<m))return W}return m},null);return E!==null&&isFinite(E)&&(T===null||E<T)?E:T},null)||0}function d(S,x){for(var T=0,A=0,w=0,v=p(S,["moof","traf"]),E=0;E<v.length;E++){var m=v[E],f=p(m,["tfhd"])[0],C=I(f,4),b=x[C];if(!b)continue;var y=b.default,M=I(f,0)|(y==null?void 0:y.flags),W=y==null?void 0:y.duration;M&8&&(M&2?W=I(f,12):W=I(f,8));for(var L=b.timescale||9e4,K=p(m,["trun"]),F=0;F<K.length;F++){if(W){var R=I(K[F],4);T=W*R}else T=i(K[F]);b.type===N.ElementaryStreamTypes.VIDEO?A+=T/L:b.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 i(S){var x=I(S,0),T=8;x&1&&(T+=4),x&4&&(T+=4);for(var A=0,w=I(S,4),v=0;v<w;v++){if(x&256){var E=I(S,T);A+=E,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=I(w,4),E=S[v];if(!E)return;var m=E.timescale||9e4;p(A,["tfdt"]).forEach(function(f){var C=f.data[f.start],b=I(f,4);if(C===0)g(f,4,b-T*m);else{b*=Math.pow(2,32),b+=I(f,8),b-=T*m,b=Math.max(b,0);var y=Math.floor(b/(O+1)),M=Math.floor(b%(O+1));g(f,4,y),g(f,8,M)}})})})}function r(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(Y.sliceUint8)(S,0,A.start-8),x.remainder=Object(Y.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(q,z,P){"use strict";P.r(z),P.d(z,"default",function(){return Y});var Y=function(){function N(H,k){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=k}var O=N.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(k,n,I){(this.startTime===null||this.startTime>k)&&(this.startTime=k),this.endTime=n,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"sendAddTrackEvent",function(){return N}),P.d(z,"addCueToTrack",function(){return O}),P.d(z,"clearCurrentCues",function(){return H}),P.d(z,"removeCuesInRange",function(){return k}),P.d(z,"getCuesInRange",function(){return I});var Y=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 O(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){Y.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 H(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 k(g,p,h){var c=g.mode;if(c==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var o=I(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 I(g,p,h){var c=[],o=n(g,p);if(o>-1)for(var d=o,i=g.length;d<i;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(q,z,P){"use strict";P.r(z);var Y={toString:function(O){for(var H="",k=O.length,n=0;n<k;n++)H+="["+O.start(n).toFixed(3)+","+O.end(n).toFixed(3)+"]";return H}};z.default=Y},"./src/utils/timescale-conversion.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"toTimescaleFromBase",function(){return N}),P.d(z,"toTimescaleFromScale",function(){return O}),P.d(z,"toMsFromMpegTsClock",function(){return H}),P.d(z,"toMpegTsClockFromTimescale",function(){return k});var Y=9e4;function N(n,I,g,p){g===void 0&&(g=1),p===void 0&&(p=!1);var h=n*I*g;return p?Math.round(h):h}function O(n,I,g,p){return g===void 0&&(g=1),p===void 0&&(p=!1),N(n,I,1/g,p)}function H(n,I){return I===void 0&&(I=!1),N(n,1e3,1/Y,I)}function k(n,I){return I===void 0&&(I=1),N(n,Y,1/I)}},"./src/utils/typed-array.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"sliceUint8",function(){return Y});function Y(N,O,H){return Uint8Array.prototype.slice?N.slice(O,H):new Uint8Array(Array.prototype.slice.call(N,O,H))}},"./src/utils/vttcue.ts":function(q,z,P){"use strict";P.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Y=["","lr","rl"],N=["start","middle","end","left","right"];function O(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 H(g){return O(Y,g)}function k(g){return O(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 i in d)g[i]=d[i]}return g}function I(g,p,h){var c=this,o={enumerable:!0};c.hasBeenReset=!1;var d="",i=!1,a=g,r=p,s=h,S=null,x="",T=!0,A="auto",w="start",v=50,E="middle",m=50,f="middle";Object.defineProperty(c,"id",n({},o,{get:function(){return d},set:function(b){d=""+b}})),Object.defineProperty(c,"pauseOnExit",n({},o,{get:function(){return i},set:function(b){i=!!b}})),Object.defineProperty(c,"startTime",n({},o,{get:function(){return a},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");a=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},o,{get:function(){return r},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");r=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},o,{get:function(){return s},set:function(b){s=""+b,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},o,{get:function(){return S},set:function(b){S=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},o,{get:function(){return x},set:function(b){var y=H(b);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},o,{get:function(){return T},set:function(b){T=!!b,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},o,{get:function(){return A},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},o,{get:function(){return w},set:function(b){var y=k(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");w=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},o,{get:function(){return v},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},o,{get:function(){return E},set:function(b){var y=k(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");E=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},o,{get:function(){return m},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");m=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},o,{get:function(){return f},set:function(b){var y=k(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");f=y,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"parseTimeStamp",function(){return O}),P.d(z,"fixLineBreaks",function(){return p}),P.d(z,"VTTParser",function(){return h});var Y=P("./src/utils/vttcue.ts"),N=function(){function c(){}var o=c.prototype;return o.decode=function(i,a){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},c}();function O(c){function o(i,a,r,s){return(i|0)*3600+(a|0)*60+(r|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 H=function(){function c(){this.values=Object.create(null)}var o=c.prototype;return o.set=function(i,a){!this.get(i)&&a!==""&&(this.values[i]=a)},o.get=function(i,a,r){return r?this.has(i)?this.values[i]:a[r]:this.has(i)?this.values[i]:a},o.has=function(i){return i in this.values},o.alt=function(i,a,r){for(var s=0;s<r.length;++s)if(a===r[s]){this.set(i,a);break}},o.integer=function(i,a){/^-?\d+$/.test(a)&&this.set(i,parseInt(a,10))},o.percent=function(i,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var r=parseFloat(a);if(r>=0&&r<=100)return this.set(i,r),!0}return!1},c}();function k(c,o,d,i){var a=i?c.split(i):[c];for(var r in a){if(typeof a[r]!="string")continue;var s=a[r].split(d);if(s.length!==2)continue;var S=s[0],x=s[1];o(S,x)}}var n=new Y.default(0,0,""),I=n.align==="middle"?"middle":"center";function g(c,o,d){var i=c;function a(){var S=O(c);if(S===null)throw new Error("Malformed timestamp: "+i);return c=c.replace(/^[^\sa-zA-Z-]+/,""),S}function r(S,x){var T=new H;k(S,function(v,E){var m;switch(v){case"region":for(var f=d.length-1;f>=0;f--)if(d[f].id===E){T.set(v,d[f].region);break}break;case"vertical":T.alt(v,E,["rl","lr"]);break;case"line":m=E.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",I,"end"]);break;case"position":m=E.split(","),T.percent(v,m[0]),m.length===2&&T.alt("positionAlign",m[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":T.percent(v,E);break;case"align":T.alt(v,E,["start",I,"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",I);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 '-->'): "+i);c=c.substr(3),s(),o.endTime=a(),s(),r(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(i){var a=this;i&&(a.buffer+=a.decoder.decode(i,{stream:!0}));function r(){var w=a.buffer,v=0;for(w=p(w);v<w.length&&w[v]!=="\r"&&w[v]!==`
|
|
`;)++v;var E=w.substr(0,v);return w[v]==="\r"&&++v,w[v]===`
|
|
`&&++v,a.buffer=w.substr(v),E}function s(w){k(w,function(v,E){},/:/)}try{var S="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;S=r();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=r();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 Y.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 i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
|
|
|
|
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){i.onparsingerror&&i.onparsingerror(a)}return i.onflush&&i.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(q,z,P){"use strict";P.r(z),P.d(z,"generateCueId",function(){return h}),P.d(z,"parseWebVTT",function(){return o});var Y=P("./src/polyfills/number.ts"),N=P("./src/utils/vttparser.ts"),O=P("./src/demux/id3.ts"),H=P("./src/utils/timescale-conversion.ts"),k=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,I=function(i,a,r){return r===void 0&&(r=0),i.substr(r,a.length)===a},g=function(i){var a=parseInt(i.substr(-3)),r=parseInt(i.substr(-6,2)),s=parseInt(i.substr(-9,2)),S=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(a)||!Object(Y.isFiniteNumber)(r)||!Object(Y.isFiniteNumber)(s)||!Object(Y.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return a+=1e3*r,a+=60*1e3*s,a+=60*60*1e3*S,a},p=function(i){for(var a=5381,r=i.length;r;)a=a*33^i.charCodeAt(--r);return(a>>>0).toString()};function h(d,i,a){return p(d.toString())+p(i.toString())+p(a)}var c=function(i,a,r){var s=i[a],S=i[s.prevCC];if(!S||!S.new&&s.new){i.ccOffset=i.presentationOffset=s.start,s.new=!1;return}for(;(x=S)!==null&&x!==void 0&&x.new;){var x;i.ccOffset+=s.start-S.start,s.new=!1,s=S,S=i[s.prevCC]}i.presentationOffset=r};function o(d,i,a,r,s,S,x,T){var A=new N.VTTParser,w=Object(O.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),v=[],E=Object(H.toMpegTsClockFromTimescale)(i,a),m="00:00.000",f=0,C=0,b,y=!0,M=!1;A.oncue=function(W){var L=r[s],K=r.ccOffset,F=(f-E)/9e4;if(L!=null&&L.new&&(C!==void 0?K=r.ccOffset=L.start:c(r,s,F)),F&&(K=F-r.presentationOffset),M){var R=W.endTime-W.startTime,V=Object(k.normalizePts)((W.startTime+K-C)*9e4,S*9e4)/9e4;W.startTime=V,W.endTime=V+R}var ne=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(ne)),W.id||(W.id=h(W.startTime,W.endTime,ne)),W.endTime>0&&v.push(W)},A.onparsingerror=function(W){b=W},A.onflush=function(){if(b){T(b);return}x(v)},w.forEach(function(W){if(y)if(I(W,"X-TIMESTAMP-MAP=")){y=!1,M=!0,W.substr(16).split(",").forEach(function(L){I(L,"LOCAL:")?m=L.substr(6):I(L,"MPEGTS:")&&(f=parseInt(L.substr(7)))});try{C=g(m)/1e3}catch(L){M=!1,b=L}return}else W===""&&(y=!1);A.parse(W+`
|
|
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(q,z,P){"use strict";P.r(z);var Y=P("./src/utils/logger.ts"),N=P("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,H=function(){function k(I){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=I?I.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var n=k.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 i in d)h.setRequestHeader(i,d[i])}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 i,a;if(g.responseType==="arraybuffer"?(i=p.response,a=i.byteLength):(i=p.responseText,a=i.length),h.loaded=h.total=a,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(h,g,i,p),!this.callbacks)return;var s={url:p.responseURL,data:i};this.callbacks.onSuccess(s,h,g,p)}else h.retry>=o.maxRetry||d>=400&&d<499?(Y.logger.error(d+" while loading "+g.url),this.callbacks.onError({code:d,text:p.statusText},g,p)):(Y.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(){Y.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&&O.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");g=p?parseFloat(p):null}return g},k}();z.default=H}}).default})},vHTk:function(We,ge,D){We.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vef1:function(We,ge,D){We.exports={upload:"upload___3GNI5"}},wCXF:function(We,ge,D){"use strict";D.d(ge,"a",function(){return qe});var q=D("rePB"),z=D("VTBJ"),P=D("KQm4"),Y=D("U8pU"),N=D("ODXe"),O=D("q1tI"),H=D("TSYQ"),k=D.n(H),n=D("Gytx"),I=D.n(n),g=D("Kwbf"),p=D("t23M"),h=D("qx4F"),c=D("6eGT"),o=D("IBYe"),d=D("Ff2n"),i=D("c+Xe"),a=D("fyJ8"),r=D("biw7");function s(Ne,Ue,Ze,et,fe){var re=Ze[Ne]||{},ie=Ze[Ue]||{},ce,pe;re.fixed==="left"?ce=et.left[Ne]:ie.fixed==="right"&&(pe=et.right[Ue]);var le=!1,he=!1,ye=!1,_e=!1,Oe=Ze[Ue+1],ke=Ze[Ne-1];if(fe==="rtl"){if(ce!==void 0){var $e=ke&&ke.fixed==="left";_e=!$e}else if(pe!==void 0){var ot=Oe&&Oe.fixed==="right";ye=!ot}}else if(ce!==void 0){var pt=Oe&&Oe.fixed==="left";le=!pt}else if(pe!==void 0){var mt=ke&&ke.fixed==="right";he=!mt}return{fixLeft:ce,fixRight:pe,lastFixLeft:le,firstFixRight:he,lastFixRight:ye,firstFixLeft:_e,isSticky:et.isSticky}}var S=D("sR1s");function x(Ne){var Ue=Ne.cells,Ze=Ne.stickyOffsets,et=Ne.flattenColumns,fe=Ne.rowComponent,re=Ne.cellComponent,ie=Ne.onHeaderRow,ce=Ne.index,pe=O.useContext(r.a),le=pe.prefixCls,he=pe.direction,ye;ie&&(ye=ie(Ue.map(function(Oe){return Oe.column}),ce));var _e=Object(S.a)(Ue.map(function(Oe){return Oe.column}));return O.createElement(fe,Object.assign({},ye),Ue.map(function(Oe,ke){var $e=Oe.column,ot=s(Oe.colStart,Oe.colEnd,et,Ze,he),pt;return $e&&$e.onHeaderCell&&(pt=Oe.column.onHeaderCell($e)),O.createElement(a.a,Object.assign({},Oe,{ellipsis:$e.ellipsis,align:$e.align,component:re,prefixCls:le,key:_e[ke]},ot,{additionalProps:pt,rowType:"header"}))}))}x.displayName="HeaderRow";var T=x;function A(Ne){var Ue=[];function Ze(ie,ce){var pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ue[pe]=Ue[pe]||[];var le=ce,he=ie.filter(Boolean).map(function(ye){var _e={key:ye.key,className:ye.className||"",children:ye.title,column:ye,colStart:le},Oe=1,ke=ye.children;return ke&&ke.length>0&&(Oe=Ze(ke,le,pe+1).reduce(function($e,ot){return $e+ot},0),_e.hasSubColumns=!0),"colSpan"in ye&&(Oe=ye.colSpan),"rowSpan"in ye&&(_e.rowSpan=ye.rowSpan),_e.colSpan=Oe,_e.colEnd=_e.colStart+Oe-1,Ue[pe].push(_e),le+=Oe,Oe});return he}Ze(Ne,0);for(var et=Ue.length,fe=function(ce){Ue[ce].forEach(function(pe){!("rowSpan"in pe)&&!pe.hasSubColumns&&(pe.rowSpan=et-ce)})},re=0;re<et;re+=1)fe(re);return Ue}function w(Ne){var Ue=Ne.stickyOffsets,Ze=Ne.columns,et=Ne.flattenColumns,fe=Ne.onHeaderRow,re=O.useContext(r.a),ie=re.prefixCls,ce=re.getComponent,pe=O.useMemo(function(){return A(Ze)},[Ze]),le=ce(["header","wrapper"],"thead"),he=ce(["header","row"],"tr"),ye=ce(["header","cell"],"th");return O.createElement(le,{className:"".concat(ie,"-thead")},pe.map(function(_e,Oe){var ke=O.createElement(T,{key:Oe,flattenColumns:et,cells:_e,stickyOffsets:Ue,rowComponent:he,cellComponent:ye,onHeaderRow:fe,index:Oe});return ke}))}var v=w,E=D("hW8S");function m(Ne){for(var Ue=Ne.colWidths,Ze=Ne.columns,et=Ne.columCount,fe=[],re=et||Ze.length,ie=!1,ce=re-1;ce>=0;ce-=1){var pe=Ue[ce],le=Ze&&Ze[ce],he=le&&le[E.a];(pe||he||ie)&&(fe.unshift(O.createElement("col",Object.assign({key:ce,style:{width:pe,minWidth:pe}},he))),ie=!0)}return O.createElement("colgroup",null,fe)}var f=m;function C(Ne,Ue){return Object(O.useMemo)(function(){for(var Ze=[],et=0;et<Ue;et+=1){var fe=Ne[et];if(fe!==void 0)Ze[et]=fe;else return null}return Ze},[Ne.join("_"),Ue])}var b=O.forwardRef(function(Ne,Ue){var Ze=Ne.noData,et=Ne.columns,fe=Ne.flattenColumns,re=Ne.colWidths,ie=Ne.columCount,ce=Ne.stickyOffsets,pe=Ne.direction,le=Ne.fixHeader,he=Ne.offsetHeader,ye=Ne.stickyClassName,_e=Ne.onScroll,Oe=Object(d.a)(Ne,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),ke=O.useContext(r.a),$e=ke.prefixCls,ot=ke.scrollbarSize,pt=ke.isSticky,mt=pt&&!le?0:ot,qt=O.useRef(null),xt=O.useCallback(function(Un){Object(i.b)(Ue,Un),Object(i.b)(qt,Un)},[]);O.useEffect(function(){var Un;function An(en){var wn=en.currentTarget,Wt=en.deltaX;Wt&&(_e({currentTarget:wn,scrollLeft:wn.scrollLeft+Wt}),en.preventDefault())}return(Un=qt.current)===null||Un===void 0||Un.addEventListener("wheel",An),function(){var en;(en=qt.current)===null||en===void 0||en.removeEventListener("wheel",An)}},[]);var Ct=fe[fe.length-1],Pt={fixed:Ct?Ct.fixed:null,onHeaderCell:function(){return{className:"".concat($e,"-cell-scrollbar")}}},Rt=Object(O.useMemo)(function(){return mt?[].concat(Object(P.a)(et),[Pt]):et},[mt,et]),Gt=Object(O.useMemo)(function(){return mt?[].concat(Object(P.a)(fe),[Pt]):fe},[mt,fe]),On=Object(O.useMemo)(function(){var Un=ce.right,An=ce.left;return Object(z.a)(Object(z.a)({},ce),{},{left:pe==="rtl"?[].concat(Object(P.a)(An.map(function(en){return en+mt})),[0]):An,right:pe==="rtl"?Un:[].concat(Object(P.a)(Un.map(function(en){return en+mt})),[0]),isSticky:pt})},[mt,ce,pt]),kt=C(re,ie);return O.createElement("div",{style:Object(z.a)({overflow:"hidden"},pt?{top:he}:{}),ref:xt,className:k()("".concat($e,"-header"),Object(q.a)({},ye,!!ye))},O.createElement("table",{style:{tableLayout:"fixed",visibility:Ze||kt?null:"hidden"}},O.createElement(f,{colWidths:kt?[].concat(Object(P.a)(kt),[mt]):[],columCount:ie+1,columns:Gt}),O.createElement(v,Object.assign({},Oe,{stickyOffsets:On,columns:Rt,flattenColumns:Gt}))))});b.displayName="FixedHeader";var y=b,M=O.createContext(null),W=M;function L(Ne){var Ue=Ne.prefixCls,Ze=Ne.children,et=Ne.component,fe=Ne.cellComponent,re=Ne.fixHeader,ie=Ne.fixColumn,ce=Ne.horizonScroll,pe=Ne.className,le=Ne.expanded,he=Ne.componentWidth,ye=Ne.colSpan,_e=O.useContext(r.a),Oe=_e.scrollbarSize;return O.useMemo(function(){var ke=Ze;return ie&&(ke=O.createElement("div",{style:{width:he-(re?Oe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ue,"-expanded-row-fixed")},ke)),O.createElement(et,{className:pe,style:{display:le?null:"none"}},O.createElement(a.a,{component:fe,prefixCls:Ue,colSpan:ye},ke))},[Ze,et,re,ce,pe,le,he,ye,Oe])}var K=L;function F(Ne){var Ue=Ne.className,Ze=Ne.style,et=Ne.record,fe=Ne.index,re=Ne.rowKey,ie=Ne.getRowKey,ce=Ne.rowExpandable,pe=Ne.expandedKeys,le=Ne.onRow,he=Ne.indent,ye=he===void 0?0:he,_e=Ne.rowComponent,Oe=Ne.cellComponent,ke=Ne.childrenColumnName,$e=O.useContext(r.a),ot=$e.prefixCls,pt=$e.fixedInfoList,mt=O.useContext(W),qt=mt.fixHeader,xt=mt.fixColumn,Ct=mt.horizonScroll,Pt=mt.componentWidth,Rt=mt.flattenColumns,Gt=mt.expandableType,On=mt.expandRowByClick,kt=mt.onTriggerExpand,Un=mt.rowClassName,An=mt.expandedRowClassName,en=mt.indentSize,wn=mt.expandIcon,Wt=mt.expandedRowRender,At=mt.expandIconColumnIndex,Zt=O.useState(!1),Ee=Object(N.a)(Zt,2),de=Ee[0],j=Ee[1],X=pe&&pe.has(Ne.recordKey);O.useEffect(function(){X&&j(!0)},[X]);var $=Gt==="row"&&(!ce||ce(et)),te=Gt==="nest",ve=ke&&et&&et[ke],Ie=$||te,He;le&&(He=le(et,fe));var ct=function(at){if(On&&Ie&&kt(et,at),He&&He.onClick){for(var xn,it=arguments.length,ln=new Array(it>1?it-1:0),cn=1;cn<it;cn++)ln[cn-1]=arguments[cn];(xn=He).onClick.apply(xn,[at].concat(ln))}},ut;typeof Un=="string"?ut=Un:typeof Un=="function"&&(ut=Un(et,fe,ye));var ze=Object(S.a)(Rt),gt=O.createElement(_e,Object.assign({},He,{"data-row-key":re,className:k()(Ue,"".concat(ot,"-row"),"".concat(ot,"-row-level-").concat(ye),ut,He&&He.className),style:Object(z.a)(Object(z.a)({},Ze),He?He.style:null),onClick:ct}),Rt.map(function(St,at){var xn=St.render,it=St.dataIndex,ln=St.className,cn=ze[at],Yn=pt[at],nr;at===(At||0)&&te&&(nr=O.createElement(O.Fragment,null,O.createElement("span",{style:{paddingLeft:"".concat(en*ye,"px")},className:"".concat(ot,"-row-indent indent-level-").concat(ye)}),wn({prefixCls:ot,expanded:X,expandable:ve,record:et,onExpand:kt})));var vn;return St.onCell&&(vn=St.onCell(et,fe)),O.createElement(a.a,Object.assign({className:ln,ellipsis:St.ellipsis,align:St.align,component:Oe,prefixCls:ot,key:cn,record:et,index:fe,dataIndex:it,render:xn,shouldCellUpdate:St.shouldCellUpdate},Yn,{appendNode:nr,additionalProps:vn}))})),Kt;if($&&(de||X)){var dt=Wt(et,fe,ye+1,X),sn=An&&An(et,fe,ye);Kt=O.createElement(K,{expanded:X,className:k()("".concat(ot,"-expanded-row"),"".concat(ot,"-expanded-row-level-").concat(ye+1),sn),prefixCls:ot,fixHeader:qt,fixColumn:xt,horizonScroll:Ct,component:_e,componentWidth:Pt,cellComponent:Oe,colSpan:Rt.length},dt)}var jt;return ve&&X&&(jt=(et[ke]||[]).map(function(St,at){var xn=ie(St,at);return O.createElement(F,Object.assign({},Ne,{key:xn,rowKey:xn,record:St,recordKey:xn,index:at,indent:ye+1}))})),O.createElement(O.Fragment,null,gt,Kt,jt)}F.displayName="BodyRow";var R=F,V=O.createContext(null),ne=V;function se(Ne){var Ue=Ne.columnKey,Ze=Ne.onColumnResize,et=O.useRef();return O.useEffect(function(){et.current&&Ze(Ue,et.current.offsetWidth)},[]),O.createElement(p.a,{onResize:function(re){var ie=re.offsetWidth;Ze(Ue,ie)}},O.createElement("td",{ref:et,style:{padding:0,border:0,height:0}},O.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Se(Ne){var Ue=Ne.data,Ze=Ne.getRowKey,et=Ne.measureColumnWidth,fe=Ne.expandedKeys,re=Ne.onRow,ie=Ne.rowExpandable,ce=Ne.emptyNode,pe=Ne.childrenColumnName,le=O.useContext(ne),he=le.onColumnResize,ye=O.useContext(r.a),_e=ye.prefixCls,Oe=ye.getComponent,ke=O.useContext(W),$e=ke.fixHeader,ot=ke.horizonScroll,pt=ke.flattenColumns,mt=ke.componentWidth;return O.useMemo(function(){var qt=Oe(["body","wrapper"],"tbody"),xt=Oe(["body","row"],"tr"),Ct=Oe(["body","cell"],"td"),Pt;Ue.length?Pt=Ue.map(function(Gt,On){var kt=Ze(Gt,On);return O.createElement(R,{key:kt,rowKey:kt,record:Gt,recordKey:kt,index:On,rowComponent:xt,cellComponent:Ct,expandedKeys:fe,onRow:re,getRowKey:Ze,rowExpandable:ie,childrenColumnName:pe})}):Pt=O.createElement(K,{expanded:!0,className:"".concat(_e,"-placeholder"),prefixCls:_e,fixHeader:$e,fixColumn:ot,horizonScroll:ot,component:xt,componentWidth:mt,cellComponent:Ct,colSpan:pt.length},ce);var Rt=Object(S.a)(pt);return O.createElement(qt,{className:"".concat(_e,"-tbody")},et&&O.createElement("tr",{"aria-hidden":"true",className:"".concat(_e,"-measure-row"),style:{height:0}},Rt.map(function(Gt){return O.createElement(se,{key:Gt,columnKey:Gt,onColumnResize:he})})),Pt)},[Ue,_e,re,et,fe,Ze,Oe,mt,ce,pt])}var Le=O.memo(Se);Le.displayName="Body";var Ae=Le,Pe=D("wRmb"),Fe=D("xEkU"),je=D.n(Fe);function Te(Ne){var Ue=Object(O.useRef)(Ne),Ze=Object(O.useState)({}),et=Object(N.a)(Ze,2),fe=et[1],re=Object(O.useRef)(null),ie=Object(O.useRef)([]);function ce(pe){re.current===null&&(ie.current=[],re.current=je()(function(){ie.current.forEach(function(le){Ue.current=le(Ue.current)}),re.current=null,fe({})})),ie.current.push(pe)}return Object(O.useEffect)(function(){return function(){je.a.cancel(re.current)}},[]),[Ue.current,ce]}function Z(Ne){var Ue=Object(O.useRef)(Ne),Ze=Object(O.useRef)(null);function et(){window.clearTimeout(Ze.current)}function fe(ie){Ue.current=ie,et(),Ze.current=window.setTimeout(function(){Ue.current=null,Ze.current=null},100)}function re(){return Ue.current}return Object(O.useEffect)(function(){return et},[]),[fe,re]}function U(Ne,Ue,Ze){var et=Object(O.useMemo)(function(){for(var fe=[],re=[],ie=0,ce=0,pe=0;pe<Ue;pe+=1)if(Ze==="rtl"){re[pe]=ce,ce+=Ne[pe]||0;var le=Ue-pe-1;fe[le]=ie,ie+=Ne[le]||0}else{fe[pe]=ie,ie+=Ne[pe]||0;var he=Ue-pe-1;re[he]=ce,ce+=Ne[he]||0}return{left:fe,right:re}},[Ne,Ue,Ze]);return et}var G=U;function ee(Ne){var Ue=Ne.className,Ze=Ne.children;return O.createElement("div",{className:Ue},Ze)}var ue=ee,J=D("n6Qo");function we(Ne){var Ue,Ze=Ne.prefixCls,et=Ne.record,fe=Ne.onExpand,re=Ne.expanded,ie=Ne.expandable,ce="".concat(Ze,"-row-expand-icon");if(!ie)return O.createElement("span",{className:k()(ce,"".concat(Ze,"-row-spaced"))});var pe=function(he){fe(et,he),he.stopPropagation()};return O.createElement("span",{className:k()(ce,(Ue={},Object(q.a)(Ue,"".concat(Ze,"-row-expanded"),re),Object(q.a)(Ue,"".concat(Ze,"-row-collapsed"),!re),Ue)),onClick:pe})}function Ge(Ne,Ue,Ze){var et=[];function fe(re){(re||[]).forEach(function(ie,ce){et.push(Ue(ie,ce)),fe(ie[Ze])})}return fe(Ne),et}var Je=D("zT1h"),be=D("y0+3"),Re=function(Ue,Ze){var et,fe,re=Ue.scrollBodyRef,ie=Ue.onScroll,ce=Ue.offsetScroll,pe=O.useContext(r.a),le=pe.prefixCls,he=((et=re.current)===null||et===void 0?void 0:et.scrollWidth)||0,ye=((fe=re.current)===null||fe===void 0?void 0:fe.clientWidth)||0,_e=he&&ye*(ye/he),Oe=O.useRef(),ke=Te({scrollLeft:0,isHiddenScrollBar:!1}),$e=Object(N.a)(ke,2),ot=$e[0],pt=$e[1],mt=O.useRef({delta:0,x:0}),qt=O.useState(!1),xt=Object(N.a)(qt,2),Ct=xt[0],Pt=xt[1],Rt=function(){Pt(!1)},Gt=function(en){en.persist(),mt.current.delta=en.pageX-ot.scrollLeft,mt.current.x=0,Pt(!0),en.preventDefault()},On=function(en){var wn,Wt=en||((wn=window)===null||wn===void 0?void 0:wn.event),At=Wt.buttons;if(!Ct||At===0){Ct&&Pt(!1);return}var Zt=mt.current.x+en.pageX-mt.current.x-mt.current.delta;Zt<=0&&(Zt=0),Zt+_e>=ye&&(Zt=ye-_e),ie({scrollLeft:Zt/ye*(he+2)}),mt.current.x=en.pageX},kt=function(){var en=Object(be.b)(re.current).top,wn=en+re.current.offsetHeight,Wt=document.documentElement.scrollTop+window.innerHeight;wn-Object(h.a)()<=Wt||en>=Wt-ce?pt(function(At){return Object(z.a)(Object(z.a)({},At),{},{isHiddenScrollBar:!0})}):pt(function(At){return Object(z.a)(Object(z.a)({},At),{},{isHiddenScrollBar:!1})})},Un=function(en){pt(function(wn){return Object(z.a)(Object(z.a)({},wn),{},{scrollLeft:en/he*ye||0})})};return O.useImperativeHandle(Ze,function(){return{setScrollLeft:Un}}),O.useEffect(function(){var An=Object(Je.a)(document.body,"mouseup",Rt,!1),en=Object(Je.a)(document.body,"mousemove",On,!1);return kt(),function(){An.remove(),en.remove()}},[_e,Ct]),O.useEffect(function(){var An=Object(Je.a)(window,"scroll",kt,!1),en=Object(Je.a)(window,"resize",kt,!1);return function(){An.remove(),en.remove()}},[]),O.useEffect(function(){ot.isHiddenScrollBar||pt(function(An){var en,wn;return Object(z.a)(Object(z.a)({},An),{},{scrollLeft:re.current.scrollLeft/((en=re.current)===null||en===void 0?void 0:en.scrollWidth)*((wn=re.current)===null||wn===void 0?void 0:wn.clientWidth)})})},[ot.isHiddenScrollBar]),he<=ye||!_e||ot.isHiddenScrollBar?null:O.createElement("div",{style:{height:Object(h.a)(),width:ye,bottom:ce},className:"".concat(le,"-sticky-scroll")},O.createElement("div",{onMouseDown:Gt,ref:Oe,className:k()("".concat(le,"-sticky-scroll-bar"),Object(q.a)({},"".concat(le,"-sticky-scroll-bar-active"),Ct)),style:{width:"".concat(_e,"px"),transform:"translate3d(".concat(ot.scrollLeft,"px, 0, 0)")}}))},xe=O.forwardRef(Re);function Ce(Ne,Ue){return O.useMemo(function(){var Ze=!!Ne;return{isSticky:Ze,stickyClassName:Ze?"".concat(Ue,"-sticky-header"):"",offsetHeader:Object(Y.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object(Y.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,Ue])}var Be=[],Xe={},qe="rc-table-internal-hook",tt=O.memo(function(Ne){var Ue=Ne.children;return Ue},function(Ne,Ue){return I()(Ne.props,Ue.props)?Ne.pingLeft!==Ue.pingLeft||Ne.pingRight!==Ue.pingRight:!1});function ht(Ne){var Ue,Ze=Ne.prefixCls,et=Ne.className,fe=Ne.rowClassName,re=Ne.style,ie=Ne.data,ce=Ne.rowKey,pe=Ne.scroll,le=Ne.tableLayout,he=Ne.direction,ye=Ne.title,_e=Ne.footer,Oe=Ne.summary,ke=Ne.id,$e=Ne.showHeader,ot=Ne.components,pt=Ne.emptyText,mt=Ne.onRow,qt=Ne.onHeaderRow,xt=Ne.internalHooks,Ct=Ne.transformColumns,Pt=Ne.internalRefs,Rt=Ne.sticky,Gt=ie||Be,On=!!Gt.length,kt=O.useState(0),Un=Object(N.a)(kt,2),An=Un[0],en=Un[1];O.useEffect(function(){en(Object(h.a)())});var wn=O.useMemo(function(){return Object(S.c)(ot,{})},[ot]),Wt=O.useCallback(function(Ut,Ot){return Object(S.b)(wn,Ut)||Ot},[wn]),At=O.useMemo(function(){return typeof ce=="function"?ce:function(Ut){var Ot=Ut&&Ut[ce];return Ot}},[ce]),Zt=Object(E.c)(Ne),Ee=Zt.expandIcon,de=Zt.expandedRowKeys,j=Zt.defaultExpandedRowKeys,X=Zt.defaultExpandAllRows,$=Zt.expandedRowRender,te=Zt.onExpand,ve=Zt.onExpandedRowsChange,Ie=Zt.expandRowByClick,He=Zt.rowExpandable,ct=Zt.expandIconColumnIndex,ut=Zt.expandedRowClassName,ze=Zt.childrenColumnName,gt=Zt.indentSize,Kt=Ee||we,dt=ze||"children",sn=O.useMemo(function(){return $?"row":Ne.expandable&&xt===qe&&Ne.expandable.__PARENT_RENDER_ICON__||Gt.some(function(Ut){return Ut&&Object(Y.a)(Ut)==="object"&&Ut[dt]})?"nest":!1},[!!$,Gt]),jt=O.useState(function(){return j||(X?Ge(Gt,At,dt):[])}),St=Object(N.a)(jt,2),at=St[0],xn=St[1],it=O.useMemo(function(){return new Set(de||at||[])},[de,at]),ln=O.useCallback(function(Ut){var Ot=At(Ut,Gt.indexOf(Ut)),Qe,st=it.has(Ot);st?(it.delete(Ot),Qe=Object(P.a)(it)):Qe=[].concat(Object(P.a)(it),[Ot]),xn(Qe),te&&te(!st,Ut),ve&&ve(Qe)},[At,it,Gt,te,ve]),cn=O.useState(0),Yn=Object(N.a)(cn,2),nr=Yn[0],vn=Yn[1],gr=Object(Pe.b)(Object(z.a)(Object(z.a)(Object(z.a)({},Ne),Zt),{},{expandable:!!$,expandedKeys:it,getRowKey:At,onTriggerExpand:ln,expandIcon:Kt,expandIconColumnIndex:ct,direction:he}),xt===qe?Ct:null),Jn=Object(N.a)(gr,2),Cn=Jn[0],Dn=Jn[1],Dr=O.useMemo(function(){return{columns:Cn,flattenColumns:Dn}},[Cn,Dn]),Hr=O.useRef(),vr=O.useRef(),rr=O.useRef(),yr=O.useState(!1),Qr=Object(N.a)(yr,2),_r=Qr[0],ir=Qr[1],Pr=O.useState(!1),Lr=Object(N.a)(Pr,2),Or=Lr[0],Sr=Lr[1],ci=Te(new Map),yi=Object(N.a)(ci,2),ii=yi[0],Zr=yi[1],Ai=Object(S.a)(Dn),Ni=Ai.map(function(Ut){return ii.get(Ut)}),Ui=O.useMemo(function(){return Ni},[Ni.join("_")]),ai=G(Ui,Dn.length,he),pr=pe&&Object(S.d)(pe.y),cr=pe&&Object(S.d)(pe.x),Yr=cr&&Dn.some(function(Ut){var Ot=Ut.fixed;return Ot}),qr=O.useRef(),si=Ce(Rt,Ze),ei=si.isSticky,zi=si.offsetHeader,ea=si.offsetScroll,ti=si.stickyClassName,di,Li,Bi;pr&&(Li={overflowY:"scroll",maxHeight:pe.y}),cr&&(di={overflowX:"auto"},pr||(Li={overflowY:"hidden"}),Bi={width:pe.x===!0?"auto":pe.x,minWidth:"100%"});var Ii=O.useCallback(function(Ut,Ot){Zr(function(Qe){var st=new Map(Qe);return st.set(Ut,Ot),st})},[]),bi=Z(null),Vi=Object(N.a)(bi,2),hi=Vi[0],Xi=Vi[1];function Yi(Ut,Ot){if(!Ot)return;typeof Ot=="function"?Ot(Ut):Ot.scrollLeft!==Ut&&(Ot.scrollLeft=Ut)}var oi=function(Ot){var Qe=Ot.currentTarget,st=Ot.scrollLeft,Xt=typeof st=="number"?st:Qe.scrollLeft,nt=Qe||Xe;if(!Xi()||Xi()===nt){var Yt;hi(nt),Yi(Xt,vr.current),Yi(Xt,rr.current),Yi(Xt,(Yt=qr.current)===null||Yt===void 0?void 0:Yt.setScrollLeft)}if(Qe){var _t=Qe.scrollWidth,tn=Qe.clientWidth;ir(Xt>0),Sr(Xt<_t-tn)}},Ji=function(){rr.current&&oi({currentTarget:rr.current})},Jt=function(Ot){var Qe=Ot.width;Ji(),vn(Hr.current?Hr.current.offsetWidth:Qe)};O.useEffect(function(){return Ji},[]),O.useEffect(function(){cr&&Ji()},[cr]),O.useEffect(function(){xt===qe&&Pt&&(Pt.body.current=rr.current)});var pn=Wt(["table"],"table"),nn=O.useMemo(function(){return le||(Yr?pe.x==="max-content"?"auto":"fixed":pr||Dn.some(function(Ut){var Ot=Ut.ellipsis;return Ot})?"fixed":"auto")},[pr,Yr,Dn,le]),Ln,Hn={colWidths:Ui,columCount:Dn.length,stickyOffsets:ai,onHeaderRow:qt,fixHeader:pr},zt=O.useMemo(function(){return On?null:typeof pt=="function"?pt():pt},[On,pt]),In=O.createElement(Ae,{data:Gt,measureColumnWidth:pr||cr||ei,expandedKeys:it,rowExpandable:He,getRowKey:At,onRow:mt,emptyNode:zt,childrenColumnName:dt}),br=O.createElement(f,{colWidths:Dn.map(function(Ut){var Ot=Ut.width;return Ot}),columns:Dn}),Fr=Oe&&O.createElement(J.b,null,Oe(Gt)),Fn=Wt(["body"]);if(pr||ei){var fi;typeof Fn=="function"?(fi=Fn(Gt,{scrollbarSize:An,ref:rr,onScroll:oi}),Hn.colWidths=Dn.map(function(Ut,Ot){var Qe=Ut.width,st=Ot===Cn.length-1?Qe-An:Qe;return typeof st=="number"&&!Number.isNaN(st)?st:(Object(g.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):fi=O.createElement("div",{style:Object(z.a)(Object(z.a)({},di),Li),onScroll:oi,ref:rr,className:k()("".concat(Ze,"-body"))},O.createElement(pn,{style:Object(z.a)(Object(z.a)({},Bi),{},{tableLayout:nn})},br,In,Fr),ei&&O.createElement(xe,{ref:qr,offsetScroll:ea,scrollBodyRef:rr,onScroll:oi})),Ln=O.createElement(O.Fragment,null,$e!==!1&&O.createElement(y,Object.assign({noData:!Gt.length},Hn,Dr,{direction:he,offsetHeader:zi,stickyClassName:ti,ref:vr,onScroll:oi})),fi)}else Ln=O.createElement("div",{style:Object(z.a)(Object(z.a)({},di),Li),className:k()("".concat(Ze,"-content")),onScroll:oi,ref:rr},O.createElement(pn,{style:Object(z.a)(Object(z.a)({},Bi),{},{tableLayout:nn})},br,$e!==!1&&O.createElement(v,Object.assign({},Hn,Dr)),In,Fr));var Qn=Object(E.b)(Ne),Ve=O.createElement("div",Object.assign({className:k()(Ze,et,(Ue={},Object(q.a)(Ue,"".concat(Ze,"-rtl"),he==="rtl"),Object(q.a)(Ue,"".concat(Ze,"-ping-left"),_r),Object(q.a)(Ue,"".concat(Ze,"-ping-right"),Or),Object(q.a)(Ue,"".concat(Ze,"-layout-fixed"),le==="fixed"),Object(q.a)(Ue,"".concat(Ze,"-fixed-header"),pr),Object(q.a)(Ue,"".concat(Ze,"-fixed-column"),Yr),Object(q.a)(Ue,"".concat(Ze,"-scroll-horizontal"),cr),Object(q.a)(Ue,"".concat(Ze,"-has-fix-left"),Dn[0]&&Dn[0].fixed),Object(q.a)(Ue,"".concat(Ze,"-has-fix-right"),Dn[Dn.length-1]&&Dn[Dn.length-1].fixed==="right"),Ue)),style:re,id:ke,ref:Hr},Qn),O.createElement(tt,{pingLeft:_r,pingRight:Or,props:Object(z.a)(Object(z.a)({},Ne),{},{stickyOffsets:ai,mergedExpandedKeys:it})},ye&&O.createElement(ue,{className:"".concat(Ze,"-title")},ye(Gt)),O.createElement("div",{className:"".concat(Ze,"-container")},Ln),_e&&O.createElement(ue,{className:"".concat(Ze,"-footer")},_e(Gt))));cr&&(Ve=O.createElement(p.a,{onResize:Jt},Ve));var rt=O.useMemo(function(){return{prefixCls:Ze,getComponent:Wt,scrollbarSize:An,direction:he,fixedInfoList:Dn.map(function(Ut,Ot){return s(Ot,Ot,Dn,ai,he)}),isSticky:ei}},[Ze,Wt,An,he,Dn,ai,he,ei]),Et=O.useMemo(function(){return Object(z.a)(Object(z.a)({},Dr),{},{tableLayout:nn,rowClassName:fe,expandedRowClassName:ut,componentWidth:nr,fixHeader:pr,fixColumn:Yr,horizonScroll:cr,expandIcon:Kt,expandableType:sn,expandRowByClick:Ie,expandedRowRender:$,onTriggerExpand:ln,expandIconColumnIndex:ct,indentSize:gt})},[Dr,nn,fe,ut,nr,pr,Yr,cr,Kt,sn,Ie,$,ln,ct,gt]),$t=O.useMemo(function(){return{onColumnResize:Ii}},[Ii]);return O.createElement(r.a.Provider,{value:rt},O.createElement(W.Provider,{value:Et},O.createElement(ne.Provider,{value:$t},Ve)))}ht.Column=o.a,ht.ColumnGroup=c.a,ht.Summary=J.a,ht.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ft=ge.b=ht},wRmb:function(We,ge,D){"use strict";D.d(ge,"a",function(){return I});var q=D("rePB"),z=D("KQm4"),P=D("VTBJ"),Y=D("Ff2n"),N=D("q1tI"),O=D.n(N),H=D("Kwbf"),k=D("Zm9Q"),n=D("hW8S");function I(o){return Object(k.a)(o).filter(function(d){return N.isValidElement(d)}).map(function(d){var i=d.key,a=d.props,r=a.children,s=Object(Y.a)(a,["children"]),S=Object(P.a)({key:i},s);return r&&(S.children=I(r)),S})}function g(o){return o.reduce(function(d,i){var a=i.fixed,r=a===!0?"left":a,s=i.children;return s&&s.length>0?[].concat(Object(z.a)(d),Object(z.a)(g(s).map(function(S){return Object(P.a)({fixed:r},S)}))):[].concat(Object(z.a)(d),[Object(P.a)(Object(P.a)({},i),{},{fixed:r})])},[])}function p(o){for(var d=!0,i=0;i<o.length;i+=1){var a=o[i];if(d&&a.fixed!=="left")d=!1;else if(!d&&a.fixed==="left"){Object(H.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var r=!0,s=o.length-1;s>=0;s-=1){var S=o[s];if(r&&S.fixed!=="right")r=!1;else if(!r&&S.fixed==="right"){Object(H.a)(!1,"Index ".concat(s+1," of `columns` missing `fixed='right'` prop."));break}}}function h(o){return o.map(function(d){var i=d.fixed,a=Object(Y.a)(d,["fixed"]),r=i;return i==="left"?r="right":i==="right"&&(r="left"),Object(P.a)({fixed:r},a)})}function c(o,d){var i=o.prefixCls,a=o.columns,r=o.children,s=o.expandable,S=o.expandedKeys,x=o.getRowKey,T=o.onTriggerExpand,A=o.expandIcon,w=o.rowExpandable,v=o.expandIconColumnIndex,E=o.direction,m=o.expandRowByClick,f=N.useMemo(function(){return a||I(r)},[a,r]),C=N.useMemo(function(){if(s){var M,W=v||0,L=f[W],K=(M={},Object(q.a)(M,n.a,{className:"".concat(i,"-expand-icon-col")}),Object(q.a)(M,"title",""),Object(q.a)(M,"fixed",L?L.fixed:null),Object(q.a)(M,"className","".concat(i,"-row-expand-icon-cell")),Object(q.a)(M,"render",function(V,ne,se){var Se=x(ne,se),Le=S.has(Se),Ae=w?w(ne):!0,Pe=A({prefixCls:i,expanded:Le,expandable:Ae,record:ne,onExpand:T});return m?N.createElement("span",{onClick:function(je){return je.stopPropagation()}},Pe):Pe}),M),F=f.slice();return W>=0&&F.splice(W,0,K),F}return f},[s,f,x,S,A,E]),b=N.useMemo(function(){var M=C;return d&&(M=d(M)),M.length||(M=[{render:function(){return null}}]),M},[d,C,E]),y=N.useMemo(function(){return E==="rtl"?h(g(b)):g(b)},[b,E]);return[b,y]}ge.b=c},wW8i:function(We,ge,D){We.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(We,ge,D){"use strict";D.d(ge,"a",function(){return g}),D.d(ge,"b",function(){return h});var q=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function Y(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]=q.test(o)),z[o]?parseFloat(d)||0:d}function O(c,o){var d=arguments.length,i=Y(c);return o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,d===1?i:N(c,o,i[o]||c.style[o])}function H(c,o,d){var i=arguments.length;if(o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,i===3)return typeof d=="number"&&q.test(o)&&(d="".concat(d,"px")),c.style[o]=d,d;for(var a in o)o.hasOwnProperty(a)&&H(c,a,o[a]);return Y(c)}function k(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 I(){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(We,ge,D){var q=D("MFOe"),z=q.Global;We.exports={name:"oldFF-globalStorage",read:Y,write:N,each:O,remove:H,clearAll:k};var P=z.globalStorage;function Y(n){return P[n]}function N(n,I){P[n]=I}function O(n){for(var I=P.length-1;I>=0;I--){var g=P.key(I);n(P[g],g)}}function H(n){return P.removeItem(n)}function k(){O(function(n,I){delete P[n]})}}}]);
|