(window.webpackJsonp=window.webpackJsonp||[]).push([[252,5,6,7,18],{"+NIl":function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){"use strict";V.defineMode("stex",function(L,I){"use strict";function k(n,t){n.cmdState.push(t)}function M(n){return n.cmdState.length>0?n.cmdState[n.cmdState.length-1]:null}function f(n){var t=n.cmdState.pop();t&&t.closeBracket()}function E(n){for(var t=n.cmdState,i=t.length-1;i>=0;i--){var s=t[i];if(s.name=="DEFAULT")continue;return s}return{styleIdentifier:function(){return null}}}function x(n,t,i){return function(){this.name=n,this.bracketNo=0,this.style=t,this.styles=i,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var g={};g.importmodule=x("importmodule","tag",["string","builtin"]),g.documentclass=x("documentclass","tag",["","atom"]),g.usepackage=x("usepackage","tag",["atom"]),g.begin=x("begin","tag",["atom"]),g.end=x("end","tag",["atom"]),g.label=x("label","tag",["atom"]),g.ref=x("ref","tag",["atom"]),g.eqref=x("eqref","tag",["atom"]),g.cite=x("cite","tag",["atom"]),g.bibitem=x("bibitem","tag",["atom"]),g.Bibitem=x("Bibitem","tag",["atom"]),g.RBibitem=x("RBibitem","tag",["atom"]),g.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function h(n,t){n.f=t}function o(n,t){var i;if(n.match(/^\\[a-zA-Z@]+/)){var s=n.current().slice(1);return i=g.hasOwnProperty(s)?g[s]:g.DEFAULT,i=new i,k(t,i),h(t,r),i.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return h(t,function(c,d){return u(c,d,"\\]")}),"keyword";if(n.match("\\("))return h(t,function(c,d){return u(c,d,"\\)")}),"keyword";if(n.match("$$"))return h(t,function(c,d){return u(c,d,"$$")}),"keyword";if(n.match("$"))return h(t,function(c,d){return u(c,d,"$")}),"keyword";var l=n.next();if(l=="%")return n.skipToEnd(),"comment";if(l=="}"||l=="]"){if(i=M(t),i)i.closeBracket(l),h(t,r);else return"error";return"bracket"}else return l=="{"||l=="["?(i=g.DEFAULT,i=new i,k(t,i),"bracket"):/\d/.test(l)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),i=E(t),i.name=="begin"&&(i.argument=n.current()),i.styleIdentifier())}function u(n,t,i){if(n.eatSpace())return null;if(i&&n.match(i))return h(t,o),"keyword";if(n.match(/^\\[a-zA-Z@]+/))return"tag";if(n.match(/^[a-zA-Z]+/))return"variable-2";if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/]/))return"tag";if(n.match(/^[\^_&]/))return"tag";if(n.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(n.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var s=n.next();return s=="{"||s=="}"||s=="["||s=="]"||s=="("||s==")"?"bracket":s=="%"?(n.skipToEnd(),"comment"):"error"}function r(n,t){var i=n.peek(),s;return i=="{"||i=="["?(s=M(t),s.openBracket(i),n.eat(i),h(t,o),"bracket"):/[ \t\r]/.test(i)?(n.eat(i),null):(h(t,o),f(t),o(n,t))}return{startState:function(){var n=I.inMathMode?function(t,i){return u(t,i)}:o;return{cmdState:[],f:n}},copyState:function(n){return{cmdState:n.cmdState.slice(),f:n.f}},token:function(n,t){return t.f(n,t)},blankLine:function(n){n.f=o,n.cmdState.length=0},lineComment:"%"}}),V.defineMIME("text/x-stex","stex"),V.defineMIME("text/x-latex","stex")})},"+ua5":function(at,fe,oe){},"/POA":function(at,fe,oe){!function(V,L){if(!0)at.exports=L();else var I,k}(window,function(){return function(V){var L={};function I(k){if(L[k])return L[k].exports;var M=L[k]={i:k,l:!1,exports:{}};return V[k].call(M.exports,M,M.exports,I),M.l=!0,M.exports}return I.m=V,I.c=L,I.d=function(k,M,f){I.o(k,M)||Object.defineProperty(k,M,{enumerable:!0,get:f})},I.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},I.t=function(k,M){if(1&M&&(k=I(k)),8&M)return k;if(4&M&&typeof k=="object"&&k&&k.__esModule)return k;var f=Object.create(null);if(I.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:k}),2&M&&typeof k!="string")for(var E in k)I.d(f,E,function(x){return k[x]}.bind(null,E));return f},I.n=function(k){var M=k&&k.__esModule?function(){return k.default}:function(){return k};return I.d(M,"a",M),M},I.o=function(k,M){return Object.prototype.hasOwnProperty.call(k,M)},I.p="",I(I.s=34)}([function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.forwardEvent=L.EventEmitter=void 0;var k=function(){function M(){this._listeners=[],this._disposed=!1}return Object.defineProperty(M.prototype,"event",{get:function(){var f=this;return this._event||(this._event=function(E){return f._listeners.push(E),{dispose:function(){if(!f._disposed){for(var x=0;x>22},o.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?f.stringFromCodePoint(2097151&this.content):""},o.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},o.prototype.setFromCharData=function(u){this.fg=u[E.CHAR_DATA_ATTR_INDEX],this.bg=0;var r=!1;if(u[E.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(u[E.CHAR_DATA_CHAR_INDEX].length===2){var n=u[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){var t=u[E.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=t&&t<=57343?this.content=1024*(n-55296)+t-56320+65536|u[E.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=u[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[E.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=u[E.CHAR_DATA_CHAR_INDEX],this.content=2097152|u[E.CHAR_DATA_WIDTH_INDEX]<<22)},o.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},o}(x.AttributeData);L.CellData=g},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ISoundService=L.ISelectionService=L.IRenderService=L.IMouseService=L.ICoreBrowserService=L.ICharSizeService=void 0;var k=I(14);L.ICharSizeService=k.createDecorator("CharSizeService"),L.ICoreBrowserService=k.createDecorator("CoreBrowserService"),L.IMouseService=k.createDecorator("MouseService"),L.IRenderService=k.createDecorator("RenderService"),L.ISelectionService=k.createDecorator("SelectionService"),L.ISoundService=k.createDecorator("SoundService")},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ExtendedAttrs=L.AttributeData=void 0;var k=function(){function f(){this.fg=0,this.bg=0,this.extended=new M}return f.toColorRGB=function(E){return[E>>>16&255,E>>>8&255,255&E]},f.fromColorRGB=function(E){return(255&E[0])<<16|(255&E[1])<<8|255&E[2]},f.prototype.clone=function(){var E=new f;return E.fg=this.fg,E.bg=this.bg,E.extended=this.extended.clone(),E},f.prototype.isInverse=function(){return 67108864&this.fg},f.prototype.isBold=function(){return 134217728&this.fg},f.prototype.isUnderline=function(){return 268435456&this.fg},f.prototype.isBlink=function(){return 536870912&this.fg},f.prototype.isInvisible=function(){return 1073741824&this.fg},f.prototype.isItalic=function(){return 67108864&this.bg},f.prototype.isDim=function(){return 134217728&this.bg},f.prototype.getFgColorMode=function(){return 50331648&this.fg},f.prototype.getBgColorMode=function(){return 50331648&this.bg},f.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},f.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},f.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},f.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},f.prototype.isFgDefault=function(){return(50331648&this.fg)==0},f.prototype.isBgDefault=function(){return(50331648&this.bg)==0},f.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},f.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},f.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},f.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},f.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},f.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},f.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},f.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},f.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},f.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},f.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},f}();L.AttributeData=k;var M=function(){function f(E,x){E===void 0&&(E=0),x===void 0&&(x=-1),this.underlineStyle=E,this.underlineColor=x}return f.prototype.clone=function(){return new f(this.underlineStyle,this.underlineColor)},f.prototype.isEmpty=function(){return this.underlineStyle===0},f}();L.ExtendedAttrs=M},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.addDisposableDomListener=void 0,L.addDisposableDomListener=function(k,M,f,E){k.addEventListener(M,f,E);var x=!1;return{dispose:function(){x||(x=!0,k.removeEventListener(M,f,E))}}}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.Utf8ToUtf32=L.StringToUtf32=L.utf32ToString=L.stringFromCodePoint=void 0,L.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},L.utf32ToString=function(f,E,x){E===void 0&&(E=0),x===void 0&&(x=f.length);for(var g="",h=E;h65535?(o-=65536,g+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):g+=String.fromCharCode(o)}return g};var k=function(){function f(){this._interim=0}return f.prototype.clear=function(){this._interim=0},f.prototype.decode=function(E,x){var g=E.length;if(!g)return 0;var h=0,o=0;this._interim&&(56320<=(n=E.charCodeAt(o++))&&n<=57343?x[h++]=1024*(this._interim-55296)+n-56320+65536:(x[h++]=this._interim,x[h++]=n),this._interim=0);for(var u=o;u=g)return this._interim=r,h;var n;56320<=(n=E.charCodeAt(u))&&n<=57343?x[h++]=1024*(r-55296)+n-56320+65536:(x[h++]=r,x[h++]=n)}else x[h++]=r}return h},f}();L.StringToUtf32=k;var M=function(){function f(){this.interim=new Uint8Array(3)}return f.prototype.clear=function(){this.interim.fill(0)},f.prototype.decode=function(E,x){var g=E.length;if(!g)return 0;var h,o,u,r,n=0,t=0,i=0;if(this.interim[0]){var s=!1,l=this.interim[0];l&=(224&l)==192?31:(240&l)==224?15:7;for(var c=0,d=void 0;(d=63&this.interim[++c])&&c<4;)l<<=6,l|=d;for(var w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=w-c;i=g)return 0;if((192&(d=E[i++]))!=128){i--,s=!0;break}this.interim[c++]=d,l<<=6,l|=63&d}s||(w===2?l<128?i--:x[n++]=l:w===3?l<2048||l>=55296&&l<=57343||(x[n++]=l):l<65536||l>1114111||(x[n++]=l)),this.interim.fill(0)}for(var S=g-4,C=i;C=g)return this.interim[0]=h,n;if((192&(o=E[C++]))!=128){C--;continue}if((t=(31&h)<<6|63&o)<128){C--;continue}x[n++]=t}else if((240&h)==224){if(C>=g)return this.interim[0]=h,n;if((192&(o=E[C++]))!=128){C--;continue}if(C>=g)return this.interim[0]=h,this.interim[1]=o,n;if((192&(u=E[C++]))!=128){C--;continue}if((t=(15&h)<<12|(63&o)<<6|63&u)<2048||t>=55296&&t<=57343)continue;x[n++]=t}else if((248&h)==240){if(C>=g)return this.interim[0]=h,n;if((192&(o=E[C++]))!=128){C--;continue}if(C>=g)return this.interim[0]=h,this.interim[1]=o,n;if((192&(u=E[C++]))!=128){C--;continue}if(C>=g)return this.interim[0]=h,this.interim[1]=o,this.interim[2]=u,n;if((192&(r=E[C++]))!=128){C--;continue}if((t=(7&h)<<18|(63&o)<<12|(63&u)<<6|63&r)<65536||t>1114111)continue;x[n++]=t}}return n},f}();L.Utf8ToUtf32=M},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CHAR_ATLAS_CELL_SPACING=L.DIM_OPACITY=L.INVERTED_DEFAULT_COLOR=void 0,L.INVERTED_DEFAULT_COLOR=257,L.DIM_OPACITY=.5,L.CHAR_ATLAS_CELL_SPACING=1},function(V,L,I){"use strict";var k,M,f,E;function x(h){var o=h.toString(16);return o.length<2?"0"+o:o}function g(h,o){return h>>0}}(k=L.channels||(L.channels={})),(M=L.color||(L.color={})).blend=function(h,o){var u=(255&o.rgba)/255;if(u===1)return{css:o.css,rgba:o.rgba};var r=o.rgba>>24&255,n=o.rgba>>16&255,t=o.rgba>>8&255,i=h.rgba>>24&255,s=h.rgba>>16&255,l=h.rgba>>8&255,c=i+Math.round((r-i)*u),d=s+Math.round((n-s)*u),w=l+Math.round((t-l)*u);return{css:k.toCss(c,d,w),rgba:k.toRgba(c,d,w)}},M.isOpaque=function(h){return(255&h.rgba)==255},M.ensureContrastRatio=function(h,o,u){var r=E.ensureContrastRatio(h.rgba,o.rgba,u);if(r)return E.toColor(r>>24&255,r>>16&255,r>>8&255)},M.opaque=function(h){var o=(255|h.rgba)>>>0,u=E.toChannels(o),r=u[0],n=u[1],t=u[2];return{css:k.toCss(r,n,t),rgba:o}},M.opacity=function(h,o){var u=Math.round(255*o),r=E.toChannels(h.rgba),n=r[0],t=r[1],i=r[2];return{css:k.toCss(n,t,i,u),rgba:k.toRgba(n,t,i,u)}},(L.css||(L.css={})).toColor=function(h){switch(h.length){case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(h){function o(u,r,n){var t=u/255,i=r/255,s=n/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))}h.relativeLuminance=function(u){return o(u>>16&255,u>>8&255,255&u)},h.relativeLuminance2=o}(f=L.rgb||(L.rgb={})),function(h){function o(r,n,t){for(var i=r>>24&255,s=r>>16&255,l=r>>8&255,c=n>>24&255,d=n>>16&255,w=n>>8&255,m=g(f.relativeLuminance2(c,w,d),f.relativeLuminance2(i,s,l));m0||d>0||w>0);)c-=Math.max(0,Math.ceil(.1*c)),d-=Math.max(0,Math.ceil(.1*d)),w-=Math.max(0,Math.ceil(.1*w)),m=g(f.relativeLuminance2(c,w,d),f.relativeLuminance2(i,s,l));return(c<<24|d<<16|w<<8|255)>>>0}function u(r,n,t){for(var i=r>>24&255,s=r>>16&255,l=r>>8&255,c=n>>24&255,d=n>>16&255,w=n>>8&255,m=g(f.relativeLuminance2(c,w,d),f.relativeLuminance2(i,s,l));m>>0}h.ensureContrastRatio=function(r,n,t){var i=f.relativeLuminance(r>>8),s=f.relativeLuminance(n>>8);if(g(i,s)>24&255,r>>16&255,r>>8&255,255&r]},h.toColor=function(r,n,t){return{css:k.toCss(r,n,t),rgba:k.toRgba(r,n,t)}}}(E=L.rgba||(L.rgba={})),L.toPaddedHex=x,L.contrastRatio=g},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.isLinux=L.isWindows=L.isIphone=L.isIpad=L.isMac=L.isSafari=L.isFirefox=void 0;var k=typeof navigator=="undefined",M=k?"node":navigator.userAgent,f=k?"node":navigator.platform;function E(x,g){return x.indexOf(g)>=0}L.isFirefox=!!~M.indexOf("Firefox"),L.isSafari=/^((?!chrome|android).)*safari/i.test(M),L.isMac=E(["Macintosh","MacIntel","MacPPC","Mac68K"],f),L.isIpad=f==="iPad",L.isIphone=f==="iPhone",L.isWindows=E(["Windows","Win16","Win32","WinCE"],f),L.isLinux=f.indexOf("Linux")>=0},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.C1=L.C0=void 0,function(k){k.NUL="\0",k.SOH="",k.STX="",k.ETX="",k.EOT="",k.ENQ="",k.ACK="",k.BEL="\x07",k.BS="\b",k.HT=" ",k.LF=` `,k.VT="\v",k.FF="\f",k.CR="\r",k.SO="",k.SI="",k.DLE="",k.DC1="",k.DC2="",k.DC3="",k.DC4="",k.NAK="",k.SYN="",k.ETB="",k.CAN="",k.EM="",k.SUB="",k.ESC="",k.FS="",k.GS="",k.RS="",k.US="",k.SP=" ",k.DEL="\x7F"}(L.C0||(L.C0={})),function(k){k.PAD="\x80",k.HOP="\x81",k.BPH="\x82",k.NBH="\x83",k.IND="\x84",k.NEL="\x85",k.SSA="\x86",k.ESA="\x87",k.HTS="\x88",k.HTJ="\x89",k.VTS="\x8A",k.PLD="\x8B",k.PLU="\x8C",k.RI="\x8D",k.SS2="\x8E",k.SS3="\x8F",k.DCS="\x90",k.PU1="\x91",k.PU2="\x92",k.STS="\x93",k.CCH="\x94",k.MW="\x95",k.SPA="\x96",k.EPA="\x97",k.SOS="\x98",k.SGCI="\x99",k.SCI="\x9A",k.CSI="\x9B",k.ST="\x9C",k.OSC="\x9D",k.PM="\x9E",k.APC="\x9F"}(L.C1||(L.C1={}))},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BaseRenderLayer=void 0;var k=I(3),M=I(9),f=I(25),E=I(6),x=I(28),g=I(10),h=I(17),o=function(){function u(r,n,t,i,s,l,c,d){this._container=r,this._alpha=i,this._colors=s,this._rendererId=l,this._bufferService=c,this._optionsService=d,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+n+"-layer"),this._canvas.style.zIndex=t.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return u.prototype.dispose=function(){var r;h.removeElementFromParent(this._canvas),(r=this._charAtlas)===null||r===void 0||r.dispose()},u.prototype._initCanvas=function(){this._ctx=x.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},u.prototype.onOptionsChanged=function(){},u.prototype.onBlur=function(){},u.prototype.onFocus=function(){},u.prototype.onCursorMove=function(){},u.prototype.onGridChanged=function(r,n){},u.prototype.onSelectionChanged=function(r,n,t){t===void 0&&(t=!1)},u.prototype.setColors=function(r){this._refreshCharAtlas(r)},u.prototype._setTransparency=function(r){if(r!==this._alpha){var n=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},u.prototype._refreshCharAtlas=function(r){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=f.acquireCharAtlas(this._optionsService.options,this._rendererId,r,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},u.prototype.resize=function(r){this._scaledCellWidth=r.scaledCellWidth,this._scaledCellHeight=r.scaledCellHeight,this._scaledCharWidth=r.scaledCharWidth,this._scaledCharHeight=r.scaledCharHeight,this._scaledCharLeft=r.scaledCharLeft,this._scaledCharTop=r.scaledCharTop,this._canvas.width=r.scaledCanvasWidth,this._canvas.height=r.scaledCanvasHeight,this._canvas.style.width=r.canvasWidth+"px",this._canvas.style.height=r.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},u.prototype._fillCells=function(r,n,t,i){this._ctx.fillRect(r*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,i*this._scaledCellHeight)},u.prototype._fillBottomLineAtCells=function(r,n,t){t===void 0&&(t=1),this._ctx.fillRect(r*this._scaledCellWidth,(n+1)*this._scaledCellHeight-window.devicePixelRatio-1,t*this._scaledCellWidth,window.devicePixelRatio)},u.prototype._fillLeftLineAtCell=function(r,n,t){this._ctx.fillRect(r*this._scaledCellWidth,n*this._scaledCellHeight,window.devicePixelRatio*t,this._scaledCellHeight)},u.prototype._strokeRectAtCell=function(r,n,t,i){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(r*this._scaledCellWidth+window.devicePixelRatio/2,n*this._scaledCellHeight+window.devicePixelRatio/2,t*this._scaledCellWidth-window.devicePixelRatio,i*this._scaledCellHeight-window.devicePixelRatio)},u.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},u.prototype._clearCells=function(r,n,t,i){this._alpha?this._ctx.clearRect(r*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(r*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,i*this._scaledCellHeight))},u.prototype._fillCharTrueColor=function(r,n,t){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(t),this._ctx.fillText(r.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},u.prototype._drawChars=function(r,n,t){var i,s,l=this._getContrastColor(r);l||r.isFgRGB()||r.isBgRGB()?this._drawUncachedChars(r,n,t,l):(r.isInverse()?(i=r.isBgDefault()?M.INVERTED_DEFAULT_COLOR:r.getBgColor(),s=r.isFgDefault()?M.INVERTED_DEFAULT_COLOR:r.getFgColor()):(s=r.isBgDefault()?k.DEFAULT_COLOR:r.getBgColor(),i=r.isFgDefault()?k.DEFAULT_COLOR:r.getFgColor()),i+=this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&i<8?8:0,this._currentGlyphIdentifier.chars=r.getChars()||k.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=r.getCode()||k.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=i,this._currentGlyphIdentifier.bold=!!r.isBold(),this._currentGlyphIdentifier.dim=!!r.isDim(),this._currentGlyphIdentifier.italic=!!r.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(r,n,t))},u.prototype._drawUncachedChars=function(r,n,t,i){if(this._ctx.save(),this._ctx.font=this._getFont(!!r.isBold(),!!r.isItalic()),this._ctx.textBaseline="middle",r.isInverse())if(i)this._ctx.fillStyle=i.css;else if(r.isBgDefault())this._ctx.fillStyle=g.color.opaque(this._colors.background).css;else if(r.isBgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(r.getBgColor()).join(",")+")";else{var s=r.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}else if(i)this._ctx.fillStyle=i.css;else if(r.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(r.isFgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(r.getFgColor()).join(",")+")";else{var l=r.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&l<8&&(l+=8),this._ctx.fillStyle=this._colors.ansi[l].css}this._clipRow(t),r.isDim()&&(this._ctx.globalAlpha=M.DIM_OPACITY),this._ctx.fillText(r.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},u.prototype._clipRow=function(r){this._ctx.beginPath(),this._ctx.rect(0,r*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},u.prototype._getFont=function(r,n){return(n?"italic":"")+" "+(r?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},u.prototype._getContrastColor=function(r){if(this._optionsService.options.minimumContrastRatio!==1){var n=this._colors.contrastCache.getColor(r.bg,r.fg);if(n!==void 0)return n||void 0;var t=r.getFgColor(),i=r.getFgColorMode(),s=r.getBgColor(),l=r.getBgColorMode(),c=!!r.isInverse(),d=!!r.isInverse();if(c){var w=t;t=s,s=w;var m=i;i=l,l=m}var S=this._resolveBackgroundRgba(l,s,c),C=this._resolveForegroundRgba(i,t,c,d),v=g.rgba.ensureContrastRatio(S,C,this._optionsService.options.minimumContrastRatio);if(v){var y={css:g.channels.toCss(v>>24&255,v>>16&255,v>>8&255),rgba:v};return this._colors.contrastCache.setColor(r.bg,r.fg,y),y}this._colors.contrastCache.setColor(r.bg,r.fg,null)}},u.prototype._resolveBackgroundRgba=function(r,n,t){switch(r){case 16777216:case 33554432:return this._colors.ansi[n].rgba;case 50331648:return n<<8;case 0:default:return t?this._colors.foreground.rgba:this._colors.background.rgba}},u.prototype._resolveForegroundRgba=function(r,n,t,i){switch(r){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&i&&n<8&&(n+=8),this._colors.ansi[n].rgba;case 50331648:return n<<8;case 0:default:return t?this._colors.background.rgba:this._colors.foreground.rgba}},u}();L.BaseRenderLayer=o},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.createDecorator=L.getServiceDependencies=L.serviceRegistry=void 0;function k(M,f,E){f.di$target===f?f.di$dependencies.push({id:M,index:E}):(f.di$dependencies=[{id:M,index:E}],f.di$target=f)}L.serviceRegistry=new Map,L.getServiceDependencies=function(M){return M.di$dependencies||[]},L.createDecorator=function(M){if(L.serviceRegistry.has(M))return L.serviceRegistry.get(M);var f=function(E,x,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");k(f,E,g)};return f.toString=function(){return M},L.serviceRegistry.set(M,f),f}},function(V,L,I){"use strict";function k(M,f,E,x){if(E===void 0&&(E=0),x===void 0&&(x=M.length),E>=M.length)return M;E=(M.length+E)%M.length,x=x>=M.length?M.length:(M.length+x)%M.length;for(var g=E;g>22,2097152&o?this._combined[h].charCodeAt(this._combined[h].length-1):u]},g.prototype.set=function(h,o){this._data[3*h+1]=o[M.CHAR_DATA_ATTR_INDEX],o[M.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=o[1],this._data[3*h+0]=2097152|h|o[M.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=o[M.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[M.CHAR_DATA_WIDTH_INDEX]<<22},g.prototype.getWidth=function(h){return this._data[3*h+0]>>22},g.prototype.hasWidth=function(h){return 12582912&this._data[3*h+0]},g.prototype.getFg=function(h){return this._data[3*h+1]},g.prototype.getBg=function(h){return this._data[3*h+2]},g.prototype.hasContent=function(h){return 4194303&this._data[3*h+0]},g.prototype.getCodePoint=function(h){var o=this._data[3*h+0];return 2097152&o?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&o},g.prototype.isCombined=function(h){return 2097152&this._data[3*h+0]},g.prototype.getString=function(h){var o=this._data[3*h+0];return 2097152&o?this._combined[h]:2097151&o?k.stringFromCodePoint(2097151&o):""},g.prototype.loadCell=function(h,o){var u=3*h;return o.content=this._data[u+0],o.fg=this._data[u+1],o.bg=this._data[u+2],2097152&o.content&&(o.combinedData=this._combined[h]),268435456&o.bg&&(o.extended=this._extendedAttrs[h]),o},g.prototype.setCell=function(h,o){2097152&o.content&&(this._combined[h]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[h]=o.extended),this._data[3*h+0]=o.content,this._data[3*h+1]=o.fg,this._data[3*h+2]=o.bg},g.prototype.setCellFromCodePoint=function(h,o,u,r,n,t){268435456&n&&(this._extendedAttrs[h]=t),this._data[3*h+0]=o|u<<22,this._data[3*h+1]=r,this._data[3*h+2]=n},g.prototype.addCodepointToCell=function(h,o){var u=this._data[3*h+0];2097152&u?this._combined[h]+=k.stringFromCodePoint(o):(2097151&u?(this._combined[h]=k.stringFromCodePoint(2097151&u)+k.stringFromCodePoint(o),u&=-2097152,u|=2097152):u=o|1<<22,this._data[3*h+0]=u)},g.prototype.insertCells=function(h,o,u,r){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new E.ExtendedAttrs),o=0;--t)this.setCell(h+o+t,this.loadCell(h+t,n));for(t=0;tthis.length){var u=new Uint32Array(3*h);this.length&&(3*h=h&&delete this._combined[t]}}else this._data=new Uint32Array(0),this._combined={};this.length=h}},g.prototype.fill=function(h){this._combined={},this._extendedAttrs={};for(var o=0;o=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0},g.prototype.copyCellsFrom=function(h,o,u,r,n){var t=h._data;if(n)for(var i=r-1;i>=0;i--)for(var s=0;s<3;s++)this._data[3*(u+i)+s]=t[3*(o+i)+s];else for(i=0;i=o&&(this._combined[c-o+u]=h._combined[c])}},g.prototype.translateToString=function(h,o,u){h===void 0&&(h=!1),o===void 0&&(o=0),u===void 0&&(u=this.length),h&&(u=Math.min(u,this.getTrimmedLength()));for(var r="";o>22||1}return r},g}();L.BufferLine=x},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.removeElementFromParent=void 0,L.removeElementFromParent=function(){for(var k,M=[],f=0;f24)return v.setWinLines||!1;switch(C){case 1:return!!v.restoreWin;case 2:return!!v.minimizeWin;case 3:return!!v.setWinPosition;case 4:return!!v.setWinSizePixels;case 5:return!!v.raiseWin;case 6:return!!v.lowerWin;case 7:return!!v.refreshWin;case 8:return!!v.setWinSizeChars;case 9:return!!v.maximizeWin;case 10:return!!v.fullscreenWin;case 11:return!!v.getWinState;case 13:return!!v.getWinPosition;case 14:return!!v.getWinSizePixels;case 15:return!!v.getScreenSizePixels;case 16:return!!v.getCellSizePixels;case 18:return!!v.getWinSizeChars;case 19:return!!v.getScreenSizeChars;case 20:return!!v.getIconTitle;case 21:return!!v.getWinTitle;case 22:return!!v.pushTitle;case 23:return!!v.popTitle;case 24:return!!v.setWinLines}return!1}!function(C){C[C.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",C[C.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(f=L.WindowsOptionsReportType||(L.WindowsOptionsReportType={}));var m=function(){function C(v,y,T,A){this._bufferService=v,this._coreService=y,this._logService=T,this._optionsService=A,this._data=new Uint32Array(0)}return C.prototype.hook=function(v){this._data=new Uint32Array(0)},C.prototype.put=function(v,y,T){this._data=o.concat(this._data,v.subarray(y,T))},C.prototype.unhook=function(v){if(v){var y=u.utf32ToString(this._data);switch(this._data=new Uint32Array(0),y){case'"q':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r0"q'+E.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r61;1"p'+E.C0.ESC+"\\");case"r":var T=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+T+E.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r0m"+E.C0.ESC+"\\");case" q":var A={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return A-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+A+" q"+E.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",y),this._coreService.triggerDataEvent(E.C0.ESC+"P0$r"+E.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},C}(),S=function(C){function v(y,T,A,p,D,O,P,j,K){K===void 0&&(K=new g.EscapeSequenceParser);var U=C.call(this)||this;U._bufferService=y,U._charsetService=T,U._coreService=A,U._dirtyRowService=p,U._logService=D,U._optionsService=O,U._coreMouseService=P,U._unicodeService=j,U._parser=K,U._parseBuffer=new Uint32Array(4096),U._stringDecoder=new u.StringToUtf32,U._utf8Decoder=new u.Utf8ToUtf32,U._workCell=new i.CellData,U._windowTitle="",U._iconName="",U._windowTitleStack=[],U._iconNameStack=[],U._curAttrData=r.DEFAULT_ATTR_DATA.clone(),U._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),U._onRequestBell=new n.EventEmitter,U._onRequestRefreshRows=new n.EventEmitter,U._onRequestReset=new n.EventEmitter,U._onRequestScroll=new n.EventEmitter,U._onRequestSyncScrollBar=new n.EventEmitter,U._onRequestWindowsOptionsReport=new n.EventEmitter,U._onA11yChar=new n.EventEmitter,U._onA11yTab=new n.EventEmitter,U._onCursorMove=new n.EventEmitter,U._onLineFeed=new n.EventEmitter,U._onScroll=new n.EventEmitter,U._onTitleChange=new n.EventEmitter,U.register(U._parser),U._parser.setCsiHandlerFallback(function(z,te){U._logService.debug("Unknown CSI code: ",{identifier:U._parser.identToString(z),params:te.toArray()})}),U._parser.setEscHandlerFallback(function(z){U._logService.debug("Unknown ESC code: ",{identifier:U._parser.identToString(z)})}),U._parser.setExecuteHandlerFallback(function(z){U._logService.debug("Unknown EXECUTE code: ",{code:z})}),U._parser.setOscHandlerFallback(function(z,te,ce){U._logService.debug("Unknown OSC code: ",{identifier:z,action:te,data:ce})}),U._parser.setDcsHandlerFallback(function(z,te,ce){te==="HOOK"&&(ce=ce.toArray()),U._logService.debug("Unknown DCS code: ",{identifier:U._parser.identToString(z),action:te,payload:ce})}),U._parser.setPrintHandler(function(z,te,ce){return U.print(z,te,ce)}),U._parser.setCsiHandler({final:"@"},function(z){return U.insertChars(z)}),U._parser.setCsiHandler({intermediates:" ",final:"@"},function(z){return U.scrollLeft(z)}),U._parser.setCsiHandler({final:"A"},function(z){return U.cursorUp(z)}),U._parser.setCsiHandler({intermediates:" ",final:"A"},function(z){return U.scrollRight(z)}),U._parser.setCsiHandler({final:"B"},function(z){return U.cursorDown(z)}),U._parser.setCsiHandler({final:"C"},function(z){return U.cursorForward(z)}),U._parser.setCsiHandler({final:"D"},function(z){return U.cursorBackward(z)}),U._parser.setCsiHandler({final:"E"},function(z){return U.cursorNextLine(z)}),U._parser.setCsiHandler({final:"F"},function(z){return U.cursorPrecedingLine(z)}),U._parser.setCsiHandler({final:"G"},function(z){return U.cursorCharAbsolute(z)}),U._parser.setCsiHandler({final:"H"},function(z){return U.cursorPosition(z)}),U._parser.setCsiHandler({final:"I"},function(z){return U.cursorForwardTab(z)}),U._parser.setCsiHandler({final:"J"},function(z){return U.eraseInDisplay(z)}),U._parser.setCsiHandler({prefix:"?",final:"J"},function(z){return U.eraseInDisplay(z)}),U._parser.setCsiHandler({final:"K"},function(z){return U.eraseInLine(z)}),U._parser.setCsiHandler({prefix:"?",final:"K"},function(z){return U.eraseInLine(z)}),U._parser.setCsiHandler({final:"L"},function(z){return U.insertLines(z)}),U._parser.setCsiHandler({final:"M"},function(z){return U.deleteLines(z)}),U._parser.setCsiHandler({final:"P"},function(z){return U.deleteChars(z)}),U._parser.setCsiHandler({final:"S"},function(z){return U.scrollUp(z)}),U._parser.setCsiHandler({final:"T"},function(z){return U.scrollDown(z)}),U._parser.setCsiHandler({final:"X"},function(z){return U.eraseChars(z)}),U._parser.setCsiHandler({final:"Z"},function(z){return U.cursorBackwardTab(z)}),U._parser.setCsiHandler({final:"`"},function(z){return U.charPosAbsolute(z)}),U._parser.setCsiHandler({final:"a"},function(z){return U.hPositionRelative(z)}),U._parser.setCsiHandler({final:"b"},function(z){return U.repeatPrecedingCharacter(z)}),U._parser.setCsiHandler({final:"c"},function(z){return U.sendDeviceAttributesPrimary(z)}),U._parser.setCsiHandler({prefix:">",final:"c"},function(z){return U.sendDeviceAttributesSecondary(z)}),U._parser.setCsiHandler({final:"d"},function(z){return U.linePosAbsolute(z)}),U._parser.setCsiHandler({final:"e"},function(z){return U.vPositionRelative(z)}),U._parser.setCsiHandler({final:"f"},function(z){return U.hVPosition(z)}),U._parser.setCsiHandler({final:"g"},function(z){return U.tabClear(z)}),U._parser.setCsiHandler({final:"h"},function(z){return U.setMode(z)}),U._parser.setCsiHandler({prefix:"?",final:"h"},function(z){return U.setModePrivate(z)}),U._parser.setCsiHandler({final:"l"},function(z){return U.resetMode(z)}),U._parser.setCsiHandler({prefix:"?",final:"l"},function(z){return U.resetModePrivate(z)}),U._parser.setCsiHandler({final:"m"},function(z){return U.charAttributes(z)}),U._parser.setCsiHandler({final:"n"},function(z){return U.deviceStatus(z)}),U._parser.setCsiHandler({prefix:"?",final:"n"},function(z){return U.deviceStatusPrivate(z)}),U._parser.setCsiHandler({intermediates:"!",final:"p"},function(z){return U.softReset(z)}),U._parser.setCsiHandler({intermediates:" ",final:"q"},function(z){return U.setCursorStyle(z)}),U._parser.setCsiHandler({final:"r"},function(z){return U.setScrollRegion(z)}),U._parser.setCsiHandler({final:"s"},function(z){return U.saveCursor(z)}),U._parser.setCsiHandler({final:"t"},function(z){return U.windowOptions(z)}),U._parser.setCsiHandler({final:"u"},function(z){return U.restoreCursor(z)}),U._parser.setCsiHandler({intermediates:"'",final:"}"},function(z){return U.insertColumns(z)}),U._parser.setCsiHandler({intermediates:"'",final:"~"},function(z){return U.deleteColumns(z)}),U._parser.setExecuteHandler(E.C0.BEL,function(){return U.bell()}),U._parser.setExecuteHandler(E.C0.LF,function(){return U.lineFeed()}),U._parser.setExecuteHandler(E.C0.VT,function(){return U.lineFeed()}),U._parser.setExecuteHandler(E.C0.FF,function(){return U.lineFeed()}),U._parser.setExecuteHandler(E.C0.CR,function(){return U.carriageReturn()}),U._parser.setExecuteHandler(E.C0.BS,function(){return U.backspace()}),U._parser.setExecuteHandler(E.C0.HT,function(){return U.tab()}),U._parser.setExecuteHandler(E.C0.SO,function(){return U.shiftOut()}),U._parser.setExecuteHandler(E.C0.SI,function(){return U.shiftIn()}),U._parser.setExecuteHandler(E.C1.IND,function(){return U.index()}),U._parser.setExecuteHandler(E.C1.NEL,function(){return U.nextLine()}),U._parser.setExecuteHandler(E.C1.HTS,function(){return U.tabSet()}),U._parser.setOscHandler(0,new l.OscHandler(function(z){U.setTitle(z),U.setIconName(z)})),U._parser.setOscHandler(1,new l.OscHandler(function(z){return U.setIconName(z)})),U._parser.setOscHandler(2,new l.OscHandler(function(z){return U.setTitle(z)})),U._parser.setEscHandler({final:"7"},function(){return U.saveCursor()}),U._parser.setEscHandler({final:"8"},function(){return U.restoreCursor()}),U._parser.setEscHandler({final:"D"},function(){return U.index()}),U._parser.setEscHandler({final:"E"},function(){return U.nextLine()}),U._parser.setEscHandler({final:"H"},function(){return U.tabSet()}),U._parser.setEscHandler({final:"M"},function(){return U.reverseIndex()}),U._parser.setEscHandler({final:"="},function(){return U.keypadApplicationMode()}),U._parser.setEscHandler({final:">"},function(){return U.keypadNumericMode()}),U._parser.setEscHandler({final:"c"},function(){return U.fullReset()}),U._parser.setEscHandler({final:"n"},function(){return U.setgLevel(2)}),U._parser.setEscHandler({final:"o"},function(){return U.setgLevel(3)}),U._parser.setEscHandler({final:"|"},function(){return U.setgLevel(3)}),U._parser.setEscHandler({final:"}"},function(){return U.setgLevel(2)}),U._parser.setEscHandler({final:"~"},function(){return U.setgLevel(1)}),U._parser.setEscHandler({intermediates:"%",final:"@"},function(){return U.selectDefaultCharset()}),U._parser.setEscHandler({intermediates:"%",final:"G"},function(){return U.selectDefaultCharset()});var X=function(z){B._parser.setEscHandler({intermediates:"(",final:z},function(){return U.selectCharset("("+z)}),B._parser.setEscHandler({intermediates:")",final:z},function(){return U.selectCharset(")"+z)}),B._parser.setEscHandler({intermediates:"*",final:z},function(){return U.selectCharset("*"+z)}),B._parser.setEscHandler({intermediates:"+",final:z},function(){return U.selectCharset("+"+z)}),B._parser.setEscHandler({intermediates:"-",final:z},function(){return U.selectCharset("-"+z)}),B._parser.setEscHandler({intermediates:".",final:z},function(){return U.selectCharset("."+z)}),B._parser.setEscHandler({intermediates:"/",final:z},function(){return U.selectCharset("/"+z)})},B=this;for(var N in x.CHARSETS)X(N);return U._parser.setEscHandler({intermediates:"#",final:"8"},function(){return U.screenAlignmentPattern()}),U._parser.setErrorHandler(function(z){return U._logService.error("Parsing error: ",z),z}),U._parser.setDcsHandler({intermediates:"$",final:"q"},new m(U._bufferService,U._coreService,U._logService,U._optionsService)),U}return M(v,C),Object.defineProperty(v.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){C.prototype.dispose.call(this)},v.prototype.parse=function(y){var T=this._bufferService.buffer,A=T.x,p=T.y;if(this._logService.debug("parsing data",y),this._parseBuffer.length131072)for(var D=0;D0&&N.getWidth(O.x-1)===2&&N.setCellFromCodePoint(O.x-1,0,1,B.fg,B.bg,B.extended);for(var z=T;z=K){if(U){for(;O.x=this._bufferService.rows&&(O.y=this._bufferService.rows-1),O.lines.get(O.ybase+O.y).isWrapped=!0),N=O.lines.get(O.ybase+O.y)}else if(O.x=K-1,D===2)continue}if(X&&(N.insertCells(O.x,D,O.getNullCell(B),B),N.getWidth(K-1)===2&&N.setCellFromCodePoint(K-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,B.fg,B.bg,B.extended)),N.setCellFromCodePoint(O.x++,p,D,B.fg,B.bg,B.extended),D>0)for(;--D;)N.setCellFromCodePoint(O.x++,0,0,B.fg,B.bg,B.extended)}else N.getWidth(O.x-1)?N.addCodepointToCell(O.x-1,p):N.addCodepointToCell(O.x-2,p)}A-T>0&&(N.loadCell(O.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),O.x0&&N.getWidth(O.x)===0&&!N.hasContent(O.x)&&N.setCellFromCodePoint(O.x,0,1,B.fg,B.bg,B.extended),this._dirtyRowService.markDirty(O.y)},v.prototype.addCsiHandler=function(y,T){var A=this;return y.final!=="t"||y.prefix||y.intermediates?this._parser.addCsiHandler(y,T):this._parser.addCsiHandler(y,function(p){return!w(p.params[0],A._optionsService.options.windowOptions)||T(p)})},v.prototype.addDcsHandler=function(y,T){return this._parser.addDcsHandler(y,new c.DcsHandler(T))},v.prototype.addEscHandler=function(y,T){return this._parser.addEscHandler(y,T)},v.prototype.addOscHandler=function(y,T){return this._parser.addOscHandler(y,new l.OscHandler(T))},v.prototype.bell=function(){this._onRequestBell.fire()},v.prototype.lineFeed=function(){var y=this._bufferService.buffer;this._dirtyRowService.markDirty(y.y),this._optionsService.options.convertEol&&(y.x=0),y.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),y.x>=this._bufferService.cols&&y.x--,this._dirtyRowService.markDirty(y.y),this._onLineFeed.fire()},v.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},v.prototype.backspace=function(){var y,T=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(T.x>0&&T.x--);if(this._restrictCursor(this._bufferService.cols),T.x>0)T.x--;else if(T.x===0&&T.y>T.scrollTop&&T.y<=T.scrollBottom&&((y=T.lines.get(T.ybase+T.y))===null||y===void 0?void 0:y.isWrapped)){T.lines.get(T.ybase+T.y).isWrapped=!1,T.y--,T.x=this._bufferService.cols-1;var A=T.lines.get(T.ybase+T.y);A.hasWidth(T.x)&&!A.hasContent(T.x)&&T.x--}this._restrictCursor()},v.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var y=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-y)}},v.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},v.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},v.prototype._restrictCursor=function(y){y===void 0&&(y=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(y,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},v.prototype._setCursor=function(y,T){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=y,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+T):(this._bufferService.buffer.x=y,this._bufferService.buffer.y=T),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},v.prototype._moveCursor=function(y,T){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+y,this._bufferService.buffer.y+T)},v.prototype.cursorUp=function(y){var T=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;T>=0?this._moveCursor(0,-Math.min(T,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1))},v.prototype.cursorDown=function(y){var T=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;T>=0?this._moveCursor(0,Math.min(T,y.params[0]||1)):this._moveCursor(0,y.params[0]||1)},v.prototype.cursorForward=function(y){this._moveCursor(y.params[0]||1,0)},v.prototype.cursorBackward=function(y){this._moveCursor(-(y.params[0]||1),0)},v.prototype.cursorNextLine=function(y){this.cursorDown(y),this._bufferService.buffer.x=0},v.prototype.cursorPrecedingLine=function(y){this.cursorUp(y),this._bufferService.buffer.x=0},v.prototype.cursorCharAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},v.prototype.cursorPosition=function(y){this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1)},v.prototype.charPosAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},v.prototype.hPositionRelative=function(y){this._moveCursor(y.params[0]||1,0)},v.prototype.linePosAbsolute=function(y){this._setCursor(this._bufferService.buffer.x,(y.params[0]||1)-1)},v.prototype.vPositionRelative=function(y){this._moveCursor(0,y.params[0]||1)},v.prototype.hVPosition=function(y){this.cursorPosition(y)},v.prototype.tabClear=function(y){var T=y.params[0];T===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:T===3&&(this._bufferService.buffer.tabs={})},v.prototype.cursorForwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var T=y.params[0]||1;T--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},v.prototype.cursorBackwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var T=y.params[0]||1,A=this._bufferService.buffer;T--;)A.x=A.prevStop()},v.prototype._eraseInBufferLine=function(y,T,A,p){p===void 0&&(p=!1);var D=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);D.replaceCells(T,A,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),p&&(D.isWrapped=!1)},v.prototype._resetBufferLine=function(y){var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);T.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),T.isWrapped=!1},v.prototype.eraseInDisplay=function(y){var T;switch(this._restrictCursor(),y.params[0]){case 0:for(T=this._bufferService.buffer.y,this._dirtyRowService.markDirty(T),this._eraseInBufferLine(T++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);T=this._bufferService.cols&&(this._bufferService.buffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T);this._dirtyRowService.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowService.markDirty(T-1);T--;)this._resetBufferLine(T);this._dirtyRowService.markDirty(0);break;case 3:var A=this._bufferService.buffer.lines.length-this._bufferService.rows;A>0&&(this._bufferService.buffer.lines.trimStart(A),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-A,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-A,0),this._onScroll.fire(0))}},v.prototype.eraseInLine=function(y){switch(this._restrictCursor(),y.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},v.prototype.insertLines=function(y){this._restrictCursor();var T=y.params[0]||1,A=this._bufferService.buffer;if(!(A.y>A.scrollBottom||A.yA.scrollBottom||A.yT.scrollBottom||T.yT.scrollBottom||T.yT.scrollBottom||T.yT.scrollBottom||T.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(E.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(E.C0.ESC+"[?6c"))},v.prototype.sendDeviceAttributesSecondary=function(y){y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(E.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(E.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(E.C0.ESC+"[>83;40003;0c"))},v.prototype._is=function(y){return(this._optionsService.options.termName+"").indexOf(y)===0},v.prototype.setMode=function(y){for(var T=0;T=2||p[1]===2&&O+D>=5)break;p[1]&&(D=1)}while(++O+T5)&&(y=1),T.extended.underlineStyle=y,T.fg|=268435456,y===0&&(T.fg&=-268435457),T.updateExtended()},v.prototype.charAttributes=function(y){if(y.length===1&&y.params[0]===0)return this._curAttrData.fg=r.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=r.DEFAULT_ATTR_DATA.bg);for(var T,A=y.length,p=this._curAttrData,D=0;D=30&&T<=37?(p.fg&=-50331904,p.fg|=16777216|T-30):T>=40&&T<=47?(p.bg&=-50331904,p.bg|=16777216|T-40):T>=90&&T<=97?(p.fg&=-50331904,p.fg|=16777224|T-90):T>=100&&T<=107?(p.bg&=-50331904,p.bg|=16777224|T-100):T===0?(p.fg=r.DEFAULT_ATTR_DATA.fg,p.bg=r.DEFAULT_ATTR_DATA.bg):T===1?p.fg|=134217728:T===3?p.bg|=67108864:T===4?(p.fg|=268435456,this._processUnderline(y.hasSubParams(D)?y.getSubParams(D)[0]:1,p)):T===5?p.fg|=536870912:T===7?p.fg|=67108864:T===8?p.fg|=1073741824:T===2?p.bg|=134217728:T===21?this._processUnderline(2,p):T===22?(p.fg&=-134217729,p.bg&=-134217729):T===23?p.bg&=-67108865:T===24?p.fg&=-268435457:T===25?p.fg&=-536870913:T===27?p.fg&=-67108865:T===28?p.fg&=-1073741825:T===39?(p.fg&=-67108864,p.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):T===49?(p.bg&=-67108864,p.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?D+=this._extractColor(y,D,p):T===59?(p.extended=p.extended.clone(),p.extended.underlineColor=-1,p.updateExtended()):T===100?(p.fg&=-67108864,p.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,p.bg&=-67108864,p.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T)},v.prototype.deviceStatus=function(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(E.C0.ESC+"[0n");break;case 6:var T=this._bufferService.buffer.y+1,A=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"["+T+";"+A+"R")}},v.prototype.deviceStatusPrivate=function(y){switch(y.params[0]){case 6:var T=this._bufferService.buffer.y+1,A=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"[?"+T+";"+A+"R")}},v.prototype.softReset=function(y){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},v.prototype.setCursorStyle=function(y){var T=y.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var A=T%2==1;this._optionsService.options.cursorBlink=A},v.prototype.setScrollRegion=function(y){var T,A=y.params[0]||1;(y.length<2||(T=y.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>A&&(this._bufferService.buffer.scrollTop=A-1,this._bufferService.buffer.scrollBottom=T-1,this._setCursor(0,0))},v.prototype.windowOptions=function(y){if(w(y.params[0],this._optionsService.options.windowOptions)){var T=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(f.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(f.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(E.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},v.prototype.saveCursor=function(y){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},v.prototype.restoreCursor=function(y){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},v.prototype.setTitle=function(y){this._windowTitle=y,this._onTitleChange.fire(y)},v.prototype.setIconName=function(y){this._iconName=y},v.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},v.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},v.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},v.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,x.DEFAULT_CHARSET)},v.prototype.selectCharset=function(y){y.length===2?y[0]!=="/"&&this._charsetService.setgCharset(d[y[0]],x.CHARSETS[y[1]]||x.DEFAULT_CHARSET):this.selectDefaultCharset()},v.prototype.index=function(){this._restrictCursor();var y=this._bufferService.buffer;this._bufferService.buffer.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),this._restrictCursor()},v.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},v.prototype.reverseIndex=function(){this._restrictCursor();var y=this._bufferService.buffer;if(y.y===y.scrollTop){var T=y.scrollBottom-y.scrollTop;y.lines.shiftElements(y.ybase+y.y,T,1),y.lines.set(y.ybase+y.y,y.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(y.scrollTop,y.scrollBottom)}else y.y--,this._restrictCursor()},v.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},v.prototype.reset=function(){this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()},v.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},v.prototype.setgLevel=function(y){this._charsetService.setgLevel(y)},v.prototype.screenAlignmentPattern=function(){var y=new i.CellData;y.content=1<<22|"E".charCodeAt(0),y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg;var T=this._bufferService.buffer;this._setCursor(0,0);for(var A=0;A256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(E),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return M.fromArray=function(f){var E=new M;if(!f.length)return E;for(var x=f[0]instanceof Array?1:0;x>8,g=255&this._subParamsIdx[E];g-x>0&&f.push(Array.prototype.slice.call(this._subParams,x,g))}return f},M.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},M.prototype.addParam=function(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>2147483647?2147483647:f}},M.prototype.addSubParam=function(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>2147483647?2147483647:f,this._subParamsIdx[this.length-1]++}},M.prototype.hasSubParams=function(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0},M.prototype.getSubParams=function(f){var E=this._subParamsIdx[f]>>8,x=255&this._subParamsIdx[f];return x-E>0?this._subParams.subarray(E,x):null},M.prototype.getSubParamsAll=function(){for(var f={},E=0;E>8,g=255&this._subParamsIdx[E];g-x>0&&(f[E]=this._subParams.slice(x,g))}return f},M.prototype.addDigit=function(f){var E;if(!(this._rejectDigits||!(E=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var x=this._digitIsSub?this._subParams:this.params,g=x[E-1];x[E-1]=~g?Math.min(10*g+f,2147483647):f}},M}();L.Params=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.OscHandler=L.OscParser=void 0;var k=I(23),M=I(8),f=function(){function x(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return x.prototype.addHandler=function(g,h){this._handlers[g]===void 0&&(this._handlers[g]=[]);var o=this._handlers[g];return o.push(h),{dispose:function(){var u=o.indexOf(h);u!==-1&&o.splice(u,1)}}},x.prototype.setHandler=function(g,h){this._handlers[g]=[h]},x.prototype.clearHandler=function(g){this._handlers[g]&&delete this._handlers[g]},x.prototype.setHandlerFallback=function(g){this._handlerFb=g},x.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},x.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},x.prototype._start=function(){var g=this._handlers[this._id];if(g)for(var h=g.length-1;h>=0;h--)g[h].start();else this._handlerFb(this._id,"START")},x.prototype._put=function(g,h,o){var u=this._handlers[this._id];if(u)for(var r=u.length-1;r>=0;r--)u[r].put(g,h,o);else this._handlerFb(this._id,"PUT",M.utf32ToString(g,h,o))},x.prototype._end=function(g){var h=this._handlers[this._id];if(h){for(var o=h.length-1;o>=0&&h[o].end(g)===!1;o--);for(o--;o>=0;o--)h[o].end(!1)}else this._handlerFb(this._id,"END",g)},x.prototype.start=function(){this.reset(),this._id=-1,this._state=1},x.prototype.put=function(g,h,o){if(this._state!==3){if(this._state===1)for(;h0&&this._put(g,h,o)}},x.prototype.end=function(g){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(g)),this._id=-1,this._state=0)},x}();L.OscParser=f;var E=function(){function x(g){this._handler=g,this._data="",this._hitLimit=!1}return x.prototype.start=function(){this._data="",this._hitLimit=!1},x.prototype.put=function(g,h,o){this._hitLimit||(this._data+=M.utf32ToString(g,h,o),this._data.length>k.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},x.prototype.end=function(g){var h;return this._hitLimit?h=!1:g&&(h=this._handler(this._data)),this._data="",this._hitLimit=!1,h},x}();L.OscHandler=E},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.PAYLOAD_LIMIT=void 0,L.PAYLOAD_LIMIT=1e7},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DcsHandler=L.DcsParser=void 0;var k=I(8),M=I(21),f=I(23),E=[],x=function(){function h(){this._handlers=Object.create(null),this._active=E,this._ident=0,this._handlerFb=function(){}}return h.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},h.prototype.addHandler=function(o,u){this._handlers[o]===void 0&&(this._handlers[o]=[]);var r=this._handlers[o];return r.push(u),{dispose:function(){var n=r.indexOf(u);n!==-1&&r.splice(n,1)}}},h.prototype.setHandler=function(o,u){this._handlers[o]=[u]},h.prototype.clearHandler=function(o){this._handlers[o]&&delete this._handlers[o]},h.prototype.setHandlerFallback=function(o){this._handlerFb=o},h.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=E,this._ident=0},h.prototype.hook=function(o,u){if(this.reset(),this._ident=o,this._active=this._handlers[o]||E,this._active.length)for(var r=this._active.length-1;r>=0;r--)this._active[r].hook(u);else this._handlerFb(this._ident,"HOOK",u)},h.prototype.put=function(o,u,r){if(this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].put(o,u,r);else this._handlerFb(this._ident,"PUT",k.utf32ToString(o,u,r))},h.prototype.unhook=function(o){if(this._active.length){for(var u=this._active.length-1;u>=0&&this._active[u].unhook(o)===!1;u--);for(u--;u>=0;u--)this._active[u].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",o);this._active=E,this._ident=0},h}();L.DcsParser=x;var g=function(){function h(o){this._handler=o,this._data="",this._hitLimit=!1}return h.prototype.hook=function(o){this._params=o.clone(),this._data="",this._hitLimit=!1},h.prototype.put=function(o,u,r){this._hitLimit||(this._data+=k.utf32ToString(o,u,r),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},h.prototype.unhook=function(o){var u;return this._hitLimit?u=!1:o&&(u=this._handler(this._data,this._params||new M.Params)),this._params=void 0,this._data="",this._hitLimit=!1,u},h}();L.DcsHandler=g},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.removeTerminalFromCache=L.acquireCharAtlas=void 0;var k=I(26),M=I(43),f=[];L.acquireCharAtlas=function(E,x,g,h,o){for(var u=k.generateConfig(h,o,E,g),r=0;r=0){if(k.configEquals(t.config,u))return t.atlas;t.ownedBy.length===1?(t.atlas.dispose(),f.splice(r,1)):t.ownedBy.splice(n,1);break}}for(r=0;r1)for(var m=this._getJoinedRanges(t,l,s,r,i),S=0;S1)for(m=this._getJoinedRanges(t,l,s,r,i),S=0;S=this._line.length))return s?(this._line.loadCell(i,s),s):this._line.loadCell(i,new k.CellData)},t.prototype.translateToString=function(i,s,l){return this._line.translateToString(i,s,l)},t}(),r=function(){function t(i){this._core=i}return t.prototype.registerCsiHandler=function(i,s){return this._core.addCsiHandler(i,function(l){return s(l.toArray())})},t.prototype.addCsiHandler=function(i,s){return this.registerCsiHandler(i,s)},t.prototype.registerDcsHandler=function(i,s){return this._core.addDcsHandler(i,function(l,c){return s(l,c.toArray())})},t.prototype.addDcsHandler=function(i,s){return this.registerDcsHandler(i,s)},t.prototype.registerEscHandler=function(i,s){return this._core.addEscHandler(i,s)},t.prototype.addEscHandler=function(i,s){return this.registerEscHandler(i,s)},t.prototype.registerOscHandler=function(i,s){return this._core.addOscHandler(i,s)},t.prototype.addOscHandler=function(i,s){return this.registerOscHandler(i,s)},t}(),n=function(){function t(i){this._core=i}return t.prototype.register=function(i){this._core.unicodeService.register(i)},Object.defineProperty(t.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(i){this._core.unicodeService.activeVersion=i},enumerable:!1,configurable:!0}),t}()},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(K,U){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,B){X.__proto__=B}||function(X,B){for(var N in B)B.hasOwnProperty(N)&&(X[N]=B[N])})(K,U)},function(K,U){function X(){this.constructor=K}k(K,U),K.prototype=U===null?Object.create(U):(X.prototype=U.prototype,new X)});Object.defineProperty(L,"__esModule",{value:!0}),L.Terminal=void 0;var f=I(36),E=I(37),x=I(38),g=I(12),h=I(19),o=I(40),u=I(50),r=I(51),n=I(11),t=I(7),i=I(18),s=I(54),l=I(55),c=I(56),d=I(57),w=I(59),m=I(0),S=I(16),C=I(27),v=I(60),y=I(5),T=I(61),A=I(62),p=I(63),D=I(64),O=I(65),P=typeof window!="undefined"?window.document:null,j=function(K){function U(X){X===void 0&&(X={});var B=K.call(this,X)||this;return B.browser=n,B._keyDownHandled=!1,B._onCursorMove=new m.EventEmitter,B._onKey=new m.EventEmitter,B._onRender=new m.EventEmitter,B._onSelectionChange=new m.EventEmitter,B._onTitleChange=new m.EventEmitter,B._onFocus=new m.EventEmitter,B._onBlur=new m.EventEmitter,B._onA11yCharEmitter=new m.EventEmitter,B._onA11yTabEmitter=new m.EventEmitter,B._setup(),B.linkifier=B._instantiationService.createInstance(u.Linkifier),B.linkifier2=B.register(B._instantiationService.createInstance(p.Linkifier2)),B.register(B._inputHandler.onRequestBell(function(){return B.bell()})),B.register(B._inputHandler.onRequestRefreshRows(function(N,z){return B.refresh(N,z)})),B.register(B._inputHandler.onRequestReset(function(){return B.reset()})),B.register(B._inputHandler.onRequestScroll(function(N,z){return B.scroll(N,z||void 0)})),B.register(B._inputHandler.onRequestWindowsOptionsReport(function(N){return B._reportWindowsOptions(N)})),B.register(m.forwardEvent(B._inputHandler.onCursorMove,B._onCursorMove)),B.register(m.forwardEvent(B._inputHandler.onTitleChange,B._onTitleChange)),B.register(m.forwardEvent(B._inputHandler.onA11yChar,B._onA11yCharEmitter)),B.register(m.forwardEvent(B._inputHandler.onA11yTab,B._onA11yTabEmitter)),B.register(B._bufferService.onResize(function(N){return B._afterResize(N.cols,N.rows)})),B}return M(U,K),Object.defineProperty(U.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),U.prototype.dispose=function(){var X,B,N;this._isDisposed||(K.prototype.dispose.call(this),(X=this._renderService)===null||X===void 0||X.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(N=(B=this.element)===null||B===void 0?void 0:B.parentNode)===null||N===void 0||N.removeChild(this.element))},U.prototype._setup=function(){K.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(U.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),U.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},U.prototype._updateOptions=function(X){var B,N,z,te;switch(K.prototype._updateOptions.call(this,X),X){case"fontFamily":case"fontSize":(B=this._renderService)===null||B===void 0||B.clear(),(N=this._charSizeService)===null||N===void 0||N.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":(z=this.viewport)===null||z===void 0||z.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new c.AccessibilityManager(this,this._renderService)):((te=this._accessibilityManager)===null||te===void 0||te.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},U.prototype._onTextAreaFocus=function(X){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(g.C0.ESC+"[I"),this.updateCursorStyle(X),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},U.prototype.blur=function(){var X;return(X=this.textarea)===null||X===void 0?void 0:X.blur()},U.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(g.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},U.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var X=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),B=this._bufferService.buffer.y*X,N=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=N+"px",this.textarea.style.top=B+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=X+"px",this.textarea.style.lineHeight=X+"px",this.textarea.style.zIndex="-5"}},U.prototype._initGlobal=function(){var X=this;this._bindKeys(),this.register(t.addDisposableDomListener(this.element,"copy",function(N){X.hasSelection()&&x.copyHandler(N,X._selectionService)}));var B=function(N){return x.handlePasteEvent(N,X.textarea,X._coreService)};this.register(t.addDisposableDomListener(this.textarea,"paste",B)),this.register(t.addDisposableDomListener(this.element,"paste",B)),n.isFirefox?this.register(t.addDisposableDomListener(this.element,"mousedown",function(N){N.button===2&&x.rightClickHandler(N,X.textarea,X.screenElement,X._selectionService,X.options.rightClickSelectsWord)})):this.register(t.addDisposableDomListener(this.element,"contextmenu",function(N){x.rightClickHandler(N,X.textarea,X.screenElement,X._selectionService,X.options.rightClickSelectsWord)})),n.isLinux&&this.register(t.addDisposableDomListener(this.element,"auxclick",function(N){N.button===1&&x.moveTextAreaUnderMouseCursor(N,X.textarea,X.screenElement)}))},U.prototype._bindKeys=function(){var X=this;this.register(t.addDisposableDomListener(this.textarea,"keyup",function(B){return X._keyUp(B)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keydown",function(B){return X._keyDown(B)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keypress",function(B){return X._keyPress(B)},!0)),this.register(t.addDisposableDomListener(this.textarea,"compositionstart",function(){return X._compositionHelper.compositionstart()})),this.register(t.addDisposableDomListener(this.textarea,"compositionupdate",function(B){return X._compositionHelper.compositionupdate(B)})),this.register(t.addDisposableDomListener(this.textarea,"compositionend",function(){return X._compositionHelper.compositionend()})),this.register(this.onRender(function(){return X._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(B){return X._queueLinkification(B.start,B.end)}))},U.prototype.open=function(X){var B=this;if(!X)throw new Error("Terminal requires a parent element.");P.body.contains(X)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=X.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),X.appendChild(this.element);var N=P.createDocumentFragment();this._viewportElement=P.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.appendChild(this._viewportElement),this._viewportScrollArea=P.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=P.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=P.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=P.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",i.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(t.addDisposableDomListener(this.textarea,"focus",function(ce){return B._onTextAreaFocus(ce)})),this.register(t.addDisposableDomListener(this.textarea,"blur",function(){return B._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var z=this._instantiationService.createInstance(D.CoreBrowserService,this.textarea);this._instantiationService.setService(y.ICoreBrowserService,z),this._charSizeService=this._instantiationService.createInstance(T.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._compositionView=P.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(N),this._theme=this.options.theme||this._theme,this._colorManager=new C.ColorManager(P,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(ce){return B._colorManager.onOptionsChange(ce)})),this._colorManager.setTheme(this._theme);var te=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(v.RenderService,te,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(ce){return B._onRender.fire(ce)})),this.onResize(function(ce){return B._renderService.resize(ce.cols,ce.rows)}),this._soundService=this._instantiationService.createInstance(s.SoundService),this._instantiationService.setService(y.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(E.Viewport,function(ce,be){return B.scrollLines(ce,be)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return B.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){B._renderService.onCursorMove(),B._syncTextArea()})),this.register(this.onResize(function(){return B._renderService.onResize(B.cols,B.rows)})),this.register(this.onBlur(function(){return B._renderService.onBlur()})),this.register(this.onFocus(function(){return B._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return B.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(r.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(ce){return B.scrollLines(ce.amount,ce.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return B._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(ce){return B._renderService.onSelectionChanged(ce.start,ce.end,ce.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(ce){B.textarea.value=ce,B.textarea.focus(),B.textarea.select()})),this.register(this.onScroll(function(){B.viewport.syncScrollArea(),B._selectionService.refresh()})),this.register(t.addDisposableDomListener(this._viewportElement,"scroll",function(){return B._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(l.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return B._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(t.addDisposableDomListener(this.element,"mousedown",function(ce){return B._selectionService.onMouseDown(ce)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new c.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},U.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(o.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(d.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},U.prototype._setTheme=function(X){var B,N,z;this._theme=X,(B=this._colorManager)===null||B===void 0||B.setTheme(X),(N=this._renderService)===null||N===void 0||N.setColors(this._colorManager.colors),(z=this.viewport)===null||z===void 0||z.onThemeChange(this._colorManager.colors)},U.prototype.bindMouse=function(){var X=this,B=this,N=this.element;function z(Re){var Be,Ke,Ae=B._mouseService.getRawByteCoords(Re,B.screenElement,B.cols,B.rows);if(!Ae)return!1;switch(Re.overrideType||Re.type){case"mousemove":Ke=32,Re.buttons===void 0?(Be=3,Re.button!==void 0&&(Be=Re.button<3?Re.button:3)):Be=1&Re.buttons?0:4&Re.buttons?1:2&Re.buttons?2:3;break;case"mouseup":Ke=0,Be=Re.button<3?Re.button:3;break;case"mousedown":Ke=1,Be=Re.button<3?Re.button:3;break;case"wheel":Re.deltaY!==0&&(Ke=Re.deltaY<0?0:1),Be=4;break;default:return!1}return!(Ke===void 0||Be===void 0||Be>4)&&B._coreMouseService.triggerMouseEvent({col:Ae.x-33,row:Ae.y-33,button:Be,action:Ke,ctrl:Re.ctrlKey,alt:Re.altKey,shift:Re.shiftKey})}var te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce=function(Re){return z(Re),Re.buttons||(X._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&X._document.removeEventListener("mousemove",te.mousedrag)),X.cancel(Re)},be=function(Re){return z(Re),Re.preventDefault(),X.cancel(Re)},Fe=function(Re){Re.buttons&&z(Re)},Oe=function(Re){Re.buttons||z(Re)};this.register(this._coreMouseService.onProtocolChange(function(Re){Re?(X.optionsService.options.logLevel==="debug"&&X._logService.debug("Binding to mouse events:",X._coreMouseService.explainEvents(Re)),X.element.classList.add("enable-mouse-events"),X._selectionService.disable()):(X._logService.debug("Unbinding from mouse events."),X.element.classList.remove("enable-mouse-events"),X._selectionService.enable()),8&Re?te.mousemove||(N.addEventListener("mousemove",Oe),te.mousemove=Oe):(N.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&Re?te.wheel||(N.addEventListener("wheel",be,{passive:!1}),te.wheel=be):(N.removeEventListener("wheel",te.wheel),te.wheel=null),2&Re?te.mouseup||(te.mouseup=ce):(X._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&Re?te.mousedrag||(te.mousedrag=Fe):(X._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(t.addDisposableDomListener(N,"mousedown",function(Re){if(Re.preventDefault(),X.focus(),X._coreMouseService.areMouseEventsActive&&!X._selectionService.shouldForceSelection(Re))return z(Re),te.mouseup&&X._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&X._document.addEventListener("mousemove",te.mousedrag),X.cancel(Re)})),this.register(t.addDisposableDomListener(N,"wheel",function(Re){if(!te.wheel){if(!X.buffer.hasScrollback){var Be=X.viewport.getLinesScrolled(Re);if(Be===0)return;for(var Ke=g.C0.ESC+(X._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Re.deltaY<0?"A":"B"),Ae="",_e=0;_e47)},U.prototype._keyUp=function(X){this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||(function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18}(X)||this.focus(),this.updateCursorStyle(X))},U.prototype._keyPress=function(X){var B;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)B=X.charCode;else if(X.which===null||X.which===void 0)B=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;B=X.which}return!(!B||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X))&&(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:X}),this._showCursor(),this._coreService.triggerDataEvent(B,!0),!0)},U.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},U.prototype.resize=function(X,B){X!==this.cols||B!==this.rows?K.prototype.resize.call(this,X,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},U.prototype._afterResize=function(X,B){var N,z;(N=this._charSizeService)===null||N===void 0||N.measure(),(z=this.viewport)===null||z===void 0||z.syncScrollArea(!0)},U.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var X=1;X=0;i--)(r=g[i])&&(t=(n<3?r(t):n>3?r(h,o,t):r(h,o))||t);return n>3&&t&&Object.defineProperty(h,o,t),t},M=this&&this.__param||function(g,h){return function(o,u){h(o,u,g)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CompositionHelper=void 0;var f=I(5),E=I(1),x=function(){function g(h,o,u,r,n,t){this._textarea=h,this._compositionView=o,this._bufferService=u,this._optionsService=r,this._charSizeService=n,this._coreService=t,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(g.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),g.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},g.prototype.compositionupdate=function(h){var o=this;this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout(function(){o._compositionPosition.end=o._textarea.value.length},0)},g.prototype.compositionend=function(){this._finalizeComposition(!0)},g.prototype.keydown=function(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229)return!1;if(h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},g.prototype._finalizeComposition=function(h){var o=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){var u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(o._isSendingComposition){o._isSendingComposition=!1;var n=void 0;n=o._isComposing?o._textarea.value.substring(u.start,u.end):o._textarea.value.substring(u.start),o._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}},g.prototype._handleAnyTextareaChanges=function(){var h=this,o=this._textarea.value;setTimeout(function(){if(!h._isComposing){var u=h._textarea.value.replace(o,"");u.length>0&&h._coreService.triggerDataEvent(u,!0)}},0)},g.prototype.updateCompositionElements=function(h){var o=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var u=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),r=this._bufferService.buffer.y*u,n=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var t=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=t.width+"px",this._textarea.style.height=t.height+"px",this._textarea.style.lineHeight=t.height+"px"}h||setTimeout(function(){return o.updateCompositionElements(!0)},0)}},g=k([M(2,E.IBufferService),M(3,E.IOptionsService),M(4,f.ICharSizeService),M(5,E.ICoreService)],g)}();L.CompositionHelper=x},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),f=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Viewport=void 0;var x=I(2),g=I(7),h=I(5),o=I(1),u=function(r){function n(t,i,s,l,c,d,w){var m=r.call(this)||this;return m._scrollLines=t,m._viewportElement=i,m._scrollArea=s,m._bufferService=l,m._optionsService=c,m._charSizeService=d,m._renderService=w,m.scrollBarWidth=0,m._currentRowHeight=0,m._lastRecordedBufferLength=0,m._lastRecordedViewportHeight=0,m._lastRecordedBufferHeight=0,m._lastTouchY=0,m._lastScrollTop=0,m._wheelPartialScroll=0,m._refreshAnimationFrame=null,m._ignoreNextScrollEvent=!1,m.scrollBarWidth=m._viewportElement.offsetWidth-m._scrollArea.offsetWidth||15,m.register(g.addDisposableDomListener(m._viewportElement,"scroll",m._onScroll.bind(m))),setTimeout(function(){return m.syncScrollArea()},0),m}return M(n,r),n.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},n.prototype._refresh=function(t){var i=this;if(t)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return i._innerRefresh()}))},n.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null},n.prototype.syncScrollArea=function(t){if(t===void 0&&(t=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(t);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===i&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(t)}else this._refresh(t)},n.prototype._onScroll=function(t){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(i,!0)}},n.prototype._bubbleScroll=function(t,i){var s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&s0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i},n.prototype._applyScrollModifier=function(t,i){var s=this._optionsService.options.fastScrollModifier;return s==="alt"&&i.altKey||s==="ctrl"&&i.ctrlKey||s==="shift"&&i.shiftKey?t*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:t*this._optionsService.options.scrollSensitivity},n.prototype.onTouchStart=function(t){this._lastTouchY=t.touches[0].pageY},n.prototype.onTouchMove=function(t){var i=this._lastTouchY-t.touches[0].pageY;return this._lastTouchY=t.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(t,i))},n=f([E(3,o.IBufferService),E(4,o.IOptionsService),E(5,h.ICharSizeService),E(6,h.IRenderService)],n)}(x.Disposable);L.Viewport=u},function(V,L,I){"use strict";function k(x){return x.replace(/\r?\n/g,"\r")}function M(x,g){return g?"[200~"+x+"[201~":x}function f(x,g,h){x=M(x=k(x),h.decPrivateModes.bracketedPasteMode),h.triggerDataEvent(x,!0),g.value=""}function E(x,g,h){var o=h.getBoundingClientRect(),u=x.clientX-o.left-10,r=x.clientY-o.top-10;g.style.width="20px",g.style.height="20px",g.style.left=u+"px",g.style.top=r+"px",g.style.zIndex="1000",g.focus()}Object.defineProperty(L,"__esModule",{value:!0}),L.rightClickHandler=L.moveTextAreaUnderMouseCursor=L.paste=L.handlePasteEvent=L.copyHandler=L.bracketTextForPaste=L.prepareTextForTerminal=void 0,L.prepareTextForTerminal=k,L.bracketTextForPaste=M,L.copyHandler=function(x,g){x.clipboardData&&x.clipboardData.setData("text/plain",g.selectionText),x.preventDefault()},L.handlePasteEvent=function(x,g,h){x.stopPropagation(),x.clipboardData&&f(x.clipboardData.getData("text/plain"),g,h)},L.paste=f,L.moveTextAreaUnderMouseCursor=E,L.rightClickHandler=function(x,g,h,o,u){E(x,g,h),u&&!o.isClickInSelection(x)&&o.selectWordAtCursor(x),g.value=o.selectionText,g.select()}},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)});Object.defineProperty(L,"__esModule",{value:!0}),L.EscapeSequenceParser=L.VT500_TRANSITION_TABLE=L.TransitionTable=void 0;var f=I(2),E=I(15),x=I(21),g=I(22),h=I(24),o=function(){function r(n){this.table=new Uint8Array(n)}return r.prototype.setDefault=function(n,t){E.fill(this.table,n<<4|t)},r.prototype.add=function(n,t,i,s){this.table[t<<8|n]=i<<4|s},r.prototype.addMany=function(n,t,i,s){for(var l=0;l1)throw new Error("only one byte as prefix supported");if((s=t.prefix.charCodeAt(0))&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var l=0;lc||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=c}}if(t.final.length!==1)throw new Error("final must be a single byte");var d=t.final.charCodeAt(0);if(i[0]>d||d>i[1])throw new Error("final must be in range "+i[0]+" .. "+i[1]);return s<<=8,s|=d},n.prototype.identToString=function(t){for(var i=[];t;)i.push(String.fromCharCode(255&t)),t>>=8;return i.reverse().join("")},n.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},n.prototype.setPrintHandler=function(t){this._printHandler=t},n.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},n.prototype.addEscHandler=function(t,i){var s=this._identifier(t,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);var l=this._escHandlers[s];return l.push(i),{dispose:function(){var c=l.indexOf(i);c!==-1&&l.splice(c,1)}}},n.prototype.setEscHandler=function(t,i){this._escHandlers[this._identifier(t,[48,126])]=[i]},n.prototype.clearEscHandler=function(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]},n.prototype.setEscHandlerFallback=function(t){this._escHandlerFb=t},n.prototype.setExecuteHandler=function(t,i){this._executeHandlers[t.charCodeAt(0)]=i},n.prototype.clearExecuteHandler=function(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]},n.prototype.setExecuteHandlerFallback=function(t){this._executeHandlerFb=t},n.prototype.addCsiHandler=function(t,i){var s=this._identifier(t);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);var l=this._csiHandlers[s];return l.push(i),{dispose:function(){var c=l.indexOf(i);c!==-1&&l.splice(c,1)}}},n.prototype.setCsiHandler=function(t,i){this._csiHandlers[this._identifier(t)]=[i]},n.prototype.clearCsiHandler=function(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]},n.prototype.setCsiHandlerFallback=function(t){this._csiHandlerFb=t},n.prototype.addDcsHandler=function(t,i){return this._dcsParser.addHandler(this._identifier(t),i)},n.prototype.setDcsHandler=function(t,i){this._dcsParser.setHandler(this._identifier(t),i)},n.prototype.clearDcsHandler=function(t){this._dcsParser.clearHandler(this._identifier(t))},n.prototype.setDcsHandlerFallback=function(t){this._dcsParser.setHandlerFallback(t)},n.prototype.addOscHandler=function(t,i){return this._oscParser.addHandler(t,i)},n.prototype.setOscHandler=function(t,i){this._oscParser.setHandler(t,i)},n.prototype.clearOscHandler=function(t){this._oscParser.clearHandler(t)},n.prototype.setOscHandlerFallback=function(t){this._oscParser.setHandlerFallback(t)},n.prototype.setErrorHandler=function(t){this._errorHandler=t},n.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},n.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},n.prototype.parse=function(t,i){for(var s=0,l=0,c=this.currentState,d=this._oscParser,w=this._dcsParser,m=this._collect,S=this._params,C=this._transitions.table,v=0;v>4){case 2:for(var y=v+1;;++y){if(y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}if(++y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}if(++y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}if(++y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:s,currentState:c,collect:m,params:S,abort:!1}).abort)return;break;case 7:for(var T=this._csiHandlers[m<<8|s],A=T?T.length-1:-1;A>=0&&T[A](S)===!1;A--);A<0&&this._csiHandlerFb(m<<8|s,S),this.precedingCodepoint=0;break;case 8:do switch(s){case 59:S.addParam(0);break;case 58:S.addSubParam(-1);break;default:S.addDigit(s-48)}while(++v47&&s<60);v--;break;case 9:m<<=8,m|=s;break;case 10:for(var p=this._escHandlers[m<<8|s],D=p?p.length-1:-1;D>=0&&p[D]()===!1;D--);D<0&&this._escHandlerFb(m<<8|s),this.precedingCodepoint=0;break;case 11:S.reset(),S.addParam(0),m=0;break;case 12:w.hook(m<<8|s,S);break;case 13:for(var O=v+1;;++O)if(O>=i||(s=t[O])===24||s===26||s===27||s>127&&s<160){w.put(t,v,O),v=O-1;break}break;case 14:w.unhook(s!==24&&s!==26),s===27&&(l|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0;break;case 4:d.start();break;case 5:for(var P=v+1;;P++)if(P>=i||(s=t[P])<32||s>127&&s<=159){d.put(t,v,P),v=P-1;break}break;case 6:d.end(s!==24&&s!==26),s===27&&(l|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0}c=15&l}this._collect=m,this.currentState=c},n}(f.Disposable);L.EscapeSequenceParser=u},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(d,w){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var C in S)S.hasOwnProperty(C)&&(m[C]=S[C])})(d,w)},function(d,w){function m(){this.constructor=d}k(d,w),d.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}),f=this&&this.__decorate||function(d,w,m,S){var C,v=arguments.length,y=v<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(d,w,m,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(y=(v<3?C(y):v>3?C(w,m,y):C(w,m))||y);return v>3&&y&&Object.defineProperty(w,m,y),y},E=this&&this.__param||function(d,w){return function(m,S){w(m,S,d)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Renderer=void 0;var x=I(41),g=I(47),h=I(48),o=I(49),u=I(29),r=I(2),n=I(5),t=I(1),i=I(25),s=I(0),l=1,c=function(d){function w(m,S,C,v,y,T,A,p,D){var O=d.call(this)||this;O._colors=m,O._screenElement=S,O._bufferService=y,O._charSizeService=T,O._optionsService=A,O._id=l++,O._onRequestRedraw=new s.EventEmitter;var P=O._optionsService.options.allowTransparency;return O._characterJoinerRegistry=new u.CharacterJoinerRegistry(O._bufferService),O._renderLayers=[new x.TextRenderLayer(O._screenElement,0,O._colors,O._characterJoinerRegistry,P,O._id,O._bufferService,A),new g.SelectionRenderLayer(O._screenElement,1,O._colors,O._id,O._bufferService,A),new o.LinkRenderLayer(O._screenElement,2,O._colors,O._id,C,v,O._bufferService,A),new h.CursorRenderLayer(O._screenElement,3,O._colors,O._id,O._onRequestRedraw,O._bufferService,A,p,D)],O.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},O._devicePixelRatio=window.devicePixelRatio,O._updateDimensions(),O.onOptionsChanged(),O}return M(w,d),Object.defineProperty(w.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){for(var m=0,S=this._renderLayers;m0&&S===m[0][0]){v=!0;var T=m.shift();C=new h.JoinedCellData(this._workCell,w.translateToString(!0,T[0],T[1]),T[1]-T[0]),y=T[1]-1}!v&&this._isOverlapping(C)&&ythis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[i]=s,s},n}(E.BaseRenderLayer);L.TextRenderLayer=u},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.GridCache=void 0;var k=function(){function M(){this.cache=[]}return M.prototype.resize=function(f,E){for(var x=0;x>>24,j=D.rgba>>>16&255,K=D.rgba>>>8&255,U=0;U=this.capacity)x=this._head,this._unlinkNode(x),delete this._map[x.key],x.key=f,x.value=E,this._map[f]=x;else{var g=this._nodePool;g.length>0?((x=g.pop()).key=f,x.value=E):x={prev:null,next:null,key:f,value:E},this._map[f]=x,this.size++}this._appendNode(x)},M}();L.LRUMap=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(E,x){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,h){g.__proto__=h}||function(g,h){for(var o in h)h.hasOwnProperty(o)&&(g[o]=h[o])})(E,x)},function(E,x){function g(){this.constructor=E}k(E,x),E.prototype=x===null?Object.create(x):(g.prototype=x.prototype,new g)});Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionRenderLayer=void 0;var f=function(E){function x(g,h,o,u,r,n){var t=E.call(this,g,"selection",h,!0,o,u,r,n)||this;return t._clearState(),t}return M(x,E),x.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},x.prototype.resize=function(g){E.prototype.resize.call(this,g),this._clearState()},x.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},x.prototype.onSelectionChanged=function(g,h,o){if(this._didStateChange(g,h,o,this._bufferService.buffer.ydisp))if(this._clearAll(),g&&h){var u=g[1]-this._bufferService.buffer.ydisp,r=h[1]-this._bufferService.buffer.ydisp,n=Math.max(u,0),t=Math.min(r,this._bufferService.rows-1);if(!(n>=this._bufferService.rows||t<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,o){var i=g[0],s=h[0]-i,l=t-n+1;this._fillCells(i,n,s,l)}else{i=u===n?g[0]:0;var c=n===t?h[0]:this._bufferService.cols;this._fillCells(i,n,c-i,1);var d=Math.max(t-n-1,0);if(this._fillCells(0,n+1,this._bufferService.cols,d),n!==t){var w=r===t?h[0]:this._bufferService.cols;this._fillCells(0,t,w,1)}}this._state.start=[g[0],g[1]],this._state.end=[h[0],h[1]],this._state.columnSelectMode=o,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},x.prototype._didStateChange=function(g,h,o,u){return!this._areCoordinatesEqual(g,this._state.start)||!this._areCoordinatesEqual(h,this._state.end)||o!==this._state.columnSelectMode||u!==this._state.ydisp},x.prototype._areCoordinatesEqual=function(g,h){return!(!g||!h)&&g[0]===h[0]&&g[1]===h[1]},x}(I(13).BaseRenderLayer);L.SelectionRenderLayer=f},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(h,o){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,r){u.__proto__=r}||function(u,r){for(var n in r)r.hasOwnProperty(n)&&(u[n]=r[n])})(h,o)},function(h,o){function u(){this.constructor=h}k(h,o),h.prototype=o===null?Object.create(o):(u.prototype=o.prototype,new u)});Object.defineProperty(L,"__esModule",{value:!0}),L.CursorRenderLayer=void 0;var f=I(13),E=I(4),x=function(h){function o(u,r,n,t,i,s,l,c,d){var w=h.call(this,u,"cursor",r,!0,n,t,s,l)||this;return w._onRequestRedraw=i,w._coreService=c,w._coreBrowserService=d,w._cell=new E.CellData,w._state={x:0,y:0,isFocused:!1,style:"",width:0},w._cursorRenderers={bar:w._renderBarCursor.bind(w),block:w._renderBlockCursor.bind(w),underline:w._renderUnderlineCursor.bind(w)},w}return M(o,h),o.prototype.resize=function(u){h.prototype.resize.call(this,u),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},o.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},o.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onOptionsChanged=function(){var u,r=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new g(this._coreBrowserService.isFocused,function(){r._render(!0)})):((u=this._cursorBlinkStateManager)===null||u===void 0||u.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype.onGridChanged=function(u,r){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype._render=function(u){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var r=this._bufferService.buffer.ybase+this._bufferService.buffer.y,n=r-this._bufferService.buffer.ydisp;if(n<0||n>=this._bufferService.rows)this._clearCursor();else{var t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(r).loadCell(t,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var i=this._optionsService.options.cursorStyle;return i&&i!=="block"?this._cursorRenderers[i](t,n,this._cell):this._renderBlurCursor(t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=i,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t&&this._state.y===n&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},o.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},o.prototype._renderBarCursor=function(u,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(u,r,this._optionsService.options.cursorWidth),this._ctx.restore()},o.prototype._renderBlockCursor=function(u,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(u,r,n.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(n,u,r),this._ctx.restore()},o.prototype._renderUnderlineCursor=function(u,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(u,r),this._ctx.restore()},o.prototype._renderBlurCursor=function(u,r,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(u,r,n.getWidth(),1),this._ctx.restore()},o}(f.BaseRenderLayer);L.CursorRenderLayer=x;var g=function(){function h(o,u){this._renderCallback=u,this.isCursorVisible=!0,o&&this._restartInterval()}return Object.defineProperty(h.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),h.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},h.prototype.restartBlinkAnimation=function(){var o=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){o._renderCallback(),o._animationFrame=void 0})))},h.prototype._restartInterval=function(o){var u=this;o===void 0&&(o=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(u._animationTimeRestarted){var r=600-(Date.now()-u._animationTimeRestarted);if(u._animationTimeRestarted=void 0,r>0)return void u._restartInterval(r)}u.isCursorVisible=!1,u._animationFrame=window.requestAnimationFrame(function(){u._renderCallback(),u._animationFrame=void 0}),u._blinkInterval=window.setInterval(function(){if(u._animationTimeRestarted){var n=600-(Date.now()-u._animationTimeRestarted);return u._animationTimeRestarted=void 0,void u._restartInterval(n)}u.isCursorVisible=!u.isCursorVisible,u._animationFrame=window.requestAnimationFrame(function(){u._renderCallback(),u._animationFrame=void 0})},600)},o)},h.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},h.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},h}()},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(h,o){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,r){u.__proto__=r}||function(u,r){for(var n in r)r.hasOwnProperty(n)&&(u[n]=r[n])})(h,o)},function(h,o){function u(){this.constructor=h}k(h,o),h.prototype=o===null?Object.create(o):(u.prototype=o.prototype,new u)});Object.defineProperty(L,"__esModule",{value:!0}),L.LinkRenderLayer=void 0;var f=I(13),E=I(9),x=I(26),g=function(h){function o(u,r,n,t,i,s,l,c){var d=h.call(this,u,"link",r,!0,n,t,l,c)||this;return i.onShowLinkUnderline(function(w){return d._onShowLinkUnderline(w)}),i.onHideLinkUnderline(function(w){return d._onHideLinkUnderline(w)}),s.onShowLinkUnderline(function(w){return d._onShowLinkUnderline(w)}),s.onHideLinkUnderline(function(w){return d._onHideLinkUnderline(w)}),d}return M(o,h),o.prototype.resize=function(u){h.prototype.resize.call(this,u),this._state=void 0},o.prototype.reset=function(){this._clearCurrentLink()},o.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var u=this._state.y2-this._state.y1-1;u>0&&this._clearCells(0,this._state.y1+1,this._state.cols,u),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},o.prototype._onShowLinkUnderline=function(u){if(u.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:u.fg&&x.is256Color(u.fg)?this._ctx.fillStyle=this._colors.ansi[u.fg].css:this._ctx.fillStyle=this._colors.foreground.css,u.y1===u.y2)this._fillBottomLineAtCells(u.x1,u.y1,u.x2-u.x1);else{this._fillBottomLineAtCells(u.x1,u.y1,u.cols-u.x1);for(var r=u.y1+1;r=0;s--)(n=h[s])&&(i=(t<3?n(i):t>3?n(o,u,i):n(o,u))||i);return t>3&&i&&Object.defineProperty(o,u,i),i},M=this&&this.__param||function(h,o){return function(u,r){o(u,r,h)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseZone=L.Linkifier=void 0;var f=I(0),E=I(1),x=function(){function h(o,u,r){this._bufferService=o,this._logService=u,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new f.EventEmitter,this._onHideLinkUnderline=new f.EventEmitter,this._onLinkTooltip=new f.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(h.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),h.prototype.attachToDom=function(o,u){this._element=o,this._mouseZoneManager=u},h.prototype.linkifyRows=function(o,u){var r=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=o,this._rowsToLinkify.end=u):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,o),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,u)),this._mouseZoneManager.clearAll(o,u),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return r._linkifyRows()},h._timeBeforeLatency))},h.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var o=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var u=o.ydisp+this._rowsToLinkify.start;if(!(u>=o.lines.length)){for(var r=o.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,n=Math.ceil(2e3/this._bufferService.cols),t=this._bufferService.buffer.iterator(!1,u,r,n,n);t.hasNext();)for(var i=t.next(),s=0;s=0;u--)if(o.priority<=this._linkMatchers[u].priority)return void this._linkMatchers.splice(u+1,0,o);this._linkMatchers.splice(0,0,o)}else this._linkMatchers.push(o)},h.prototype.deregisterLinkMatcher=function(o){for(var u=0;u>9&511:void 0;r.validationCallback?r.validationCallback(d,function(v){t._rowsTimeoutId||v&&t._addLink(w[1],w[0]-t._bufferService.buffer.ydisp,d,r,C)}):c._addLink(w[1],w[0]-c._bufferService.buffer.ydisp,d,r,C)},c=this;(n=i.exec(u))!==null&&!(l()==="break"););},h.prototype._addLink=function(o,u,r,n,t){var i=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(r),l=o%this._bufferService.cols,c=u+Math.floor(o/this._bufferService.cols),d=(l+s)%this._bufferService.cols,w=c+Math.floor((l+s)/this._bufferService.cols);d===0&&(d=this._bufferService.cols,w--),this._mouseZoneManager.add(new g(l+1,c+1,d+1,w+1,function(m){if(n.handler)return n.handler(m,r);var S=window.open();S?(S.opener=null,S.location.href=r):console.warn("Opening link blocked as opener could not be cleared")},function(){i._onShowLinkUnderline.fire(i._createLinkHoverEvent(l,c,d,w,t)),i._element.classList.add("xterm-cursor-pointer")},function(m){i._onLinkTooltip.fire(i._createLinkHoverEvent(l,c,d,w,t)),n.hoverTooltipCallback&&n.hoverTooltipCallback(m,r,{start:{x:l,y:c},end:{x:d,y:w}})},function(){i._onHideLinkUnderline.fire(i._createLinkHoverEvent(l,c,d,w,t)),i._element.classList.remove("xterm-cursor-pointer"),n.hoverLeaveCallback&&n.hoverLeaveCallback()},function(m){return!n.willLinkActivate||n.willLinkActivate(m,r)}))}},h.prototype._createLinkHoverEvent=function(o,u,r,n,t){return{x1:o,y1:u,x2:r,y2:n,cols:this._bufferService.cols,fg:t}},h._timeBeforeLatency=200,h=k([M(0,E.IBufferService),M(1,E.ILogService),M(2,E.IUnicodeService)],h)}();L.Linkifier=x;var g=function(h,o,u,r,n,t,i,s,l){this.x1=h,this.y1=o,this.x2=u,this.y2=r,this.clickCallback=n,this.hoverCallback=t,this.tooltipCallback=i,this.leaveCallback=s,this.willLinkActivate=l};L.MouseZone=g},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(d,w){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var C in S)S.hasOwnProperty(C)&&(m[C]=S[C])})(d,w)},function(d,w){function m(){this.constructor=d}k(d,w),d.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}),f=this&&this.__decorate||function(d,w,m,S){var C,v=arguments.length,y=v<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(d,w,m,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(y=(v<3?C(y):v>3?C(w,m,y):C(w,m))||y);return v>3&&y&&Object.defineProperty(w,m,y),y},E=this&&this.__param||function(d,w){return function(m,S){w(m,S,d)}};Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionService=void 0;var x=I(11),g=I(52),h=I(4),o=I(0),u=I(5),r=I(1),n=I(30),t=I(53),i=I(2),s=String.fromCharCode(160),l=new RegExp(s,"g"),c=function(d){function w(m,S,C,v,y,T,A){var p=d.call(this)||this;return p._element=m,p._screenElement=S,p._bufferService=C,p._coreService=v,p._mouseService=y,p._optionsService=T,p._renderService=A,p._dragScrollAmount=0,p._enabled=!0,p._workCell=new h.CellData,p._mouseDownTimeStamp=0,p._onLinuxMouseSelection=p.register(new o.EventEmitter),p._onRedrawRequest=p.register(new o.EventEmitter),p._onSelectionChange=p.register(new o.EventEmitter),p._onRequestScrollLines=p.register(new o.EventEmitter),p._mouseMoveListener=function(D){return p._onMouseMove(D)},p._mouseUpListener=function(D){return p._onMouseUp(D)},p._coreService.onUserInput(function(){p.hasSelection&&p.clearSelection()}),p._trimListener=p._bufferService.buffer.lines.onTrim(function(D){return p._onTrim(D)}),p.register(p._bufferService.buffers.onBufferActivate(function(D){return p._onBufferActivate(D)})),p.enable(),p._model=new g.SelectionModel(p._bufferService),p._activeSelectionMode=0,p}return M(w,d),Object.defineProperty(w.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){this._removeMouseDownListeners()},w.prototype.reset=function(){this.clearSelection()},w.prototype.disable=function(){this.clearSelection(),this._enabled=!1},w.prototype.enable=function(){this._enabled=!0},Object.defineProperty(w.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"hasSelection",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!m||!S)&&(m[0]!==S[0]||m[1]!==S[1])},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectionText",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!m||!S)return"";var C=this._bufferService.buffer,v=[];if(this._activeSelectionMode===3){if(m[0]===S[0])return"";for(var y=m[1];y<=S[1];y++){var T=C.translateBufferLineToString(y,!0,m[0],S[0]);v.push(T)}}else{var A=m[1]===S[1]?S[0]:void 0;for(v.push(C.translateBufferLineToString(m[1],!0,m[0],A)),y=m[1]+1;y<=S[1]-1;y++){var p=C.lines.get(y);T=C.translateBufferLineToString(y,!0),p&&p.isWrapped?v[v.length-1]+=T:v.push(T)}m[1]!==S[1]&&(p=C.lines.get(S[1]),T=C.translateBufferLineToString(S[1],!0,0,S[0]),p&&p.isWrapped?v[v.length-1]+=T:v.push(T))}return v.map(function(D){return D.replace(l," ")}).join(x.isWindows?`\r `:` `)},enumerable:!1,configurable:!0}),w.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},w.prototype.refresh=function(m){var S=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return S._refresh()})),x.isLinux&&m)&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},w.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},w.prototype.isClickInSelection=function(m){var S=this._getMouseBufferCoords(m),C=this._model.finalSelectionStart,v=this._model.finalSelectionEnd;return!!(C&&v&&S)&&this._areCoordsInSelection(S,C,v)},w.prototype._areCoordsInSelection=function(m,S,C){return m[1]>S[1]&&m[1]=S[0]&&m[0]=S[0]},w.prototype.selectWordAtCursor=function(m){var S=this._getMouseBufferCoords(m);S&&(this._selectWordAt(S,!1),this._model.selectionEnd=void 0,this.refresh(!0))},w.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},w.prototype.selectLines=function(m,S){this._model.clearSelection(),m=Math.max(m,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()},w.prototype._onTrim=function(m){this._model.onTrim(m)&&this.refresh()},w.prototype._getMouseBufferCoords=function(m){var S=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S},w.prototype._getMouseEventScrollAmount=function(m){var S=n.getCoordsRelativeToElement(m,this._screenElement)[1],C=this._renderService.dimensions.canvasHeight;return S>=0&&S<=C?0:(S>C&&(S-=C),S=Math.min(Math.max(S,-50),50),(S/=50)/Math.abs(S)+Math.round(14*S))},w.prototype.shouldForceSelection=function(m){return x.isMac?m.altKey&&this._optionsService.options.macOptionClickForcesSelection:m.shiftKey},w.prototype.onMouseDown=function(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._onIncrementalClick(m):m.detail===1?this._onSingleClick(m):m.detail===2?this._onDoubleClick(m):m.detail===3&&this._onTripleClick(m),this._addMouseDownListeners(),this.refresh(!0)}},w.prototype._addMouseDownListeners=function(){var m=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return m._dragScroll()},50)},w.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},w.prototype._onIncrementalClick=function(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))},w.prototype._onSingleClick=function(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),this._model.selectionStart){this._model.selectionEnd=void 0;var S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},w.prototype._onDoubleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=1,this._selectWordAt(S,!0))},w.prototype._onTripleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))},w.prototype.shouldColumnSelect=function(m){return m.altKey&&!(x.isMac&&this._optionsService.options.macOptionClickForcesSelection)},w.prototype._onMouseMove=function(m){if(m.stopImmediatePropagation(),this._model.selectionStart){var S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var C=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}},w.prototype._onMouseUp=function(m){var S=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&m.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var C=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){var v=t.moveToCellSequence(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(v,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},w.prototype._onBufferActivate=function(m){var S=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(function(C){return S._onTrim(C)})},w.prototype._convertViewportColToCharacterIndex=function(m,S){for(var C=S[0],v=0;S[0]>=v;v++){var y=m.loadCell(v,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&S[0]!==v&&(C+=y-1)}return C},w.prototype.setSelection=function(m,S,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,S],this._model.selectionStartLength=C,this.refresh()},w.prototype._getWordAt=function(m,S,C,v){if(C===void 0&&(C=!0),v===void 0&&(v=!0),!(m[0]>=this._bufferService.cols)){var y=this._bufferService.buffer,T=y.lines.get(m[1]);if(T){var A=y.translateBufferLineToString(m[1],!1),p=this._convertViewportColToCharacterIndex(T,m),D=p,O=m[0]-p,P=0,j=0,K=0,U=0;if(A.charAt(p)===" "){for(;p>0&&A.charAt(p-1)===" ";)p--;for(;D1&&(U+=N-1,D+=N-1);X>0&&p>0&&!this._isCharWordSeparator(T.loadCell(X-1,this._workCell));){T.loadCell(X-1,this._workCell);var z=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,X--):z>1&&(K+=z-1,p-=z-1),p--,X--}for(;B1&&(U+=te-1,D+=te-1),D++,B++}}D++;var ce=p+O-P+K,be=Math.min(this._bufferService.cols,D-p+P+j-K-U);if(S||A.slice(p,D).trim()!==""){if(C&&ce===0&&T.getCodePoint(0)!==32){var Fe=y.lines.get(m[1]-1);if(Fe&&T.isWrapped&&Fe.getCodePoint(this._bufferService.cols-1)!==32){var Oe=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Oe){var Re=this._bufferService.cols-Oe.start;ce-=Re,be+=Re}}}if(v&&ce+be===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){var Be=y.lines.get(m[1]+1);if(Be&&Be.isWrapped&&Be.getCodePoint(0)!==32){var Ke=this._getWordAt([0,m[1]+1],!1,!1,!0);Ke&&(be+=Ke.length)}}return{start:ce,length:be}}}}},w.prototype._selectWordAt=function(m,S){var C=this._getWordAt(m,S);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[C.start,m[1]],this._model.selectionStartLength=C.length}},w.prototype._selectToWordAt=function(m){var S=this._getWordAt(m,!0);if(S){for(var C=m[1];S.start<0;)S.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,C]}},w.prototype._isCharWordSeparator=function(m){return m.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(m.getChars())>=0},w.prototype._selectLineAt=function(m){var S=this._bufferService.buffer.getWrappedRangeForLine(m);this._model.selectionStart=[0,S.first],this._model.selectionEnd=[this._bufferService.cols,S.last],this._model.selectionStartLength=0},w=f([E(2,r.IBufferService),E(3,r.ICoreService),E(4,u.IMouseService),E(5,r.IOptionsService),E(6,u.IRenderService)],w)}(i.Disposable);L.SelectionService=c},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionModel=void 0;var k=function(){function M(f){this._bufferService=f,this.isSelectAllActive=!1,this.selectionStartLength=0}return M.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(M.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[f,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),M.prototype.areSelectionValuesReversed=function(){var f=this.selectionStart,E=this.selectionEnd;return!(!f||!E)&&(f[1]>E[1]||f[1]===E[1]&&f[0]>E[0])},M.prototype.onTrim=function(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},M}();L.SelectionModel=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.moveToCellSequence=void 0;var k=I(12);function M(o,u,r,n){var t=o-f(r,o),i=u-f(r,u);return h(Math.abs(t-i)-function(s,l,c){for(var d=0,w=s-f(c,s),m=l-f(c,l),S=0;S=0&&uu?"A":"B"}function x(o,u,r,n,t,i){for(var s=o,l=u,c="";s!==r||l!==n;)s+=t?1:-1,t&&s>i.cols-1?(c+=i.buffer.translateBufferLineToString(l,!1,o,s),s=0,o=0,l++):!t&&s<0&&(c+=i.buffer.translateBufferLineToString(l,!1,0,o+1),o=s=i.cols-1,l--);return c+i.buffer.translateBufferLineToString(l,!1,o,s)}function g(o,u){var r=u?"O":"[";return k.C0.ESC+r+o}function h(o,u){o=Math.floor(o);for(var r="",n=0;n0?m-f(S,m):d;var y=m,T=function(A,p,D,O,P,j){var K;return K=M(D,O,P,j).length>0?O-f(P,O):p,A=D&&Ko?"D":"C",h(Math.abs(i-o),g(t,n));t=s>u?"D":"C";var l=Math.abs(s-u);return h(function(c,d){return d.cols-c}(s>u?o:i,r)+(l-1)*r.cols+1+((s>u?i:o)-1),g(t,n))}},function(V,L,I){"use strict";var k=this&&this.__decorate||function(x,g,h,o){var u,r=arguments.length,n=r<3?g:o===null?o=Object.getOwnPropertyDescriptor(g,h):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(x,g,h,o);else for(var t=x.length-1;t>=0;t--)(u=x[t])&&(n=(r<3?u(n):r>3?u(g,h,n):u(g,h))||n);return r>3&&n&&Object.defineProperty(g,h,n),n},M=this&&this.__param||function(x,g){return function(h,o){g(h,o,x)}};Object.defineProperty(L,"__esModule",{value:!0}),L.SoundService=void 0;var f=I(1),E=function(){function x(g){this._optionsService=g}return Object.defineProperty(x,"audioContext",{get:function(){if(!x._audioContext){var g=window.AudioContext||window.webkitAudioContext;if(!g)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;x._audioContext=new g}return x._audioContext},enumerable:!1,configurable:!0}),x.prototype.playBellSound=function(){var g=x.audioContext;if(g){var h=g.createBufferSource();g.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(o){h.buffer=o,h.connect(g.destination),h.start(0)})}},x.prototype._base64ToArrayBuffer=function(g){for(var h=window.atob(g),o=h.length,u=new Uint8Array(o),r=0;r=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseZoneManager=void 0;var x=I(2),g=I(7),h=I(5),o=I(1),u=function(r){function n(t,i,s,l,c,d){var w=r.call(this)||this;return w._element=t,w._screenElement=i,w._bufferService=s,w._mouseService=l,w._selectionService=c,w._optionsService=d,w._zones=[],w._areZonesActive=!1,w._lastHoverCoords=[void 0,void 0],w._initialSelectionLength=0,w.register(g.addDisposableDomListener(w._element,"mousedown",function(m){return w._onMouseDown(m)})),w._mouseMoveListener=function(m){return w._onMouseMove(m)},w._mouseLeaveListener=function(m){return w._onMouseLeave(m)},w._clickListener=function(m){return w._onClick(m)},w}return M(n,r),n.prototype.dispose=function(){r.prototype.dispose.call(this),this._deactivate()},n.prototype.add=function(t){this._zones.push(t),this._zones.length===1&&this._activate()},n.prototype.clearAll=function(t,i){if(this._zones.length!==0){t&&i||(t=0,i=this._bufferService.rows-1);for(var s=0;st&&l.y1<=i+1||l.y2>t&&l.y2<=i+1||l.y1i+1)&&(this._currentZone&&this._currentZone===l&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(s--,1))}this._zones.length===0&&this._deactivate()}},n.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},n.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},n.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},n.prototype._onHover=function(t){var i=this,s=this._findZoneEventAt(t);s!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),s&&(this._currentZone=s,s.hoverCallback&&s.hoverCallback(t),this._tooltipTimeout=window.setTimeout(function(){return i._onTooltip(t)},this._optionsService.options.linkTooltipHoverDuration)))},n.prototype._onTooltip=function(t){this._tooltipTimeout=void 0;var i=this._findZoneEventAt(t);i&&i.tooltipCallback&&i.tooltipCallback(t)},n.prototype._onMouseDown=function(t){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var i=this._findZoneEventAt(t);(i==null?void 0:i.willLinkActivate(t))&&(t.preventDefault(),t.stopImmediatePropagation())}},n.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},n.prototype._onClick=function(t){var i=this._findZoneEventAt(t),s=this._getSelectionLength();i&&s===this._initialSelectionLength&&(i.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},n.prototype._getSelectionLength=function(){var t=this._selectionService.selectionText;return t?t.length:0},n.prototype._findZoneEventAt=function(t){var i=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(i)for(var s=i[0],l=i[1],c=0;c=d.x1&&s=d.x1||l===d.y2&&sd.y1&&li;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i},t.prototype._onTab=function(i){for(var s=0;s0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===` `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)),E.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){s._accessibilityTreeRoot.appendChild(s._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,E.isMac&&u.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(i){this._clearLiveRegion(),this._charsToConsume.push(i)},t.prototype._refreshRows=function(i,s){this._renderRowsDebouncer.refresh(i,s,this._terminal.rows)},t.prototype._renderRows=function(i,s){for(var l=this._terminal.buffer,c=l.lines.length.toString(),d=i;d<=s;d++){var w=l.translateBufferLineToString(l.ydisp+d,!0),m=(l.ydisp+d+1).toString(),S=this._rowElements[d];S&&(w.length===0?S.innerHTML=" ":S.textContent=w,S.setAttribute("aria-posinset",m),S.setAttribute("aria-setsize",c))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var i=0;i=0;v--)(m=l[v])&&(C=(S<3?m(C):S>3?m(c,d,C):m(c,d))||C);return S>3&&C&&Object.defineProperty(c,d,C),C},E=this&&this.__param||function(l,c){return function(d,w){c(d,w,l)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DomRenderer=void 0;var x=I(58),g=I(9),h=I(2),o=I(5),u=I(1),r=I(0),n=I(10),t=I(17),i=1,s=function(l){function c(d,w,m,S,C,v,y,T,A){var p=l.call(this)||this;return p._colors=d,p._element=w,p._screenElement=m,p._viewportElement=S,p._linkifier=C,p._linkifier2=v,p._charSizeService=y,p._optionsService=T,p._bufferService=A,p._terminalClass=i++,p._rowElements=[],p._rowContainer=document.createElement("div"),p._rowContainer.classList.add("xterm-rows"),p._rowContainer.style.lineHeight="normal",p._rowContainer.setAttribute("aria-hidden","true"),p._refreshRowElements(p._bufferService.cols,p._bufferService.rows),p._selectionContainer=document.createElement("div"),p._selectionContainer.classList.add("xterm-selection"),p._selectionContainer.setAttribute("aria-hidden","true"),p.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},p._updateDimensions(),p._injectCss(),p._rowFactory=new x.DomRendererRowFactory(document,p._optionsService,p._colors),p._element.classList.add("xterm-dom-renderer-owner-"+p._terminalClass),p._screenElement.appendChild(p._rowContainer),p._screenElement.appendChild(p._selectionContainer),p._linkifier.onShowLinkUnderline(function(D){return p._onLinkHover(D)}),p._linkifier.onHideLinkUnderline(function(D){return p._onLinkLeave(D)}),p._linkifier2.onShowLinkUnderline(function(D){return p._onLinkHover(D)}),p._linkifier2.onHideLinkUnderline(function(D){return p._onLinkLeave(D)}),p}return M(c,l),Object.defineProperty(c.prototype,"onRequestRedraw",{get:function(){return new r.EventEmitter().event},enumerable:!1,configurable:!0}),c.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),t.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),l.prototype.dispose.call(this)},c.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var d=0,w=this._rowElements;dw;)this._rowContainer.removeChild(this._rowElements.pop())},c.prototype.onResize=function(d,w){this._refreshRowElements(d,w),this._updateDimensions()},c.prototype.onCharSizeChanged=function(){this._updateDimensions()},c.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},c.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},c.prototype.onSelectionChanged=function(d,w,m){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(d&&w){var S=d[1]-this._bufferService.buffer.ydisp,C=w[1]-this._bufferService.buffer.ydisp,v=Math.max(S,0),y=Math.min(C,this._bufferService.rows-1);if(!(v>=this._bufferService.rows||y<0)){var T=document.createDocumentFragment();if(m)T.appendChild(this._createSelectionElement(v,d[0],w[0],y-v+1));else{var A=S===v?d[0]:0,p=v===y?w[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(v,A,p));var D=y-v-1;if(T.appendChild(this._createSelectionElement(v+1,0,this._bufferService.cols,D)),v!==y){var O=C===y?w[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(y,0,O))}}this._selectionContainer.appendChild(T)}}},c.prototype._createSelectionElement=function(d,w,m,S){S===void 0&&(S=1);var C=document.createElement("div");return C.style.height=S*this.dimensions.actualCellHeight+"px",C.style.top=d*this.dimensions.actualCellHeight+"px",C.style.left=w*this.dimensions.actualCellWidth+"px",C.style.width=this.dimensions.actualCellWidth*(m-w)+"px",C},c.prototype.onCursorMove=function(){},c.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},c.prototype.clear=function(){for(var d=0,w=this._rowElements;d=C&&(d=0,m++)}},c=f([E(6,o.ICharSizeService),E(7,u.IOptionsService),E(8,u.IBufferService)],c)}(h.Disposable);L.DomRenderer=s},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DomRendererRowFactory=L.CURSOR_STYLE_UNDERLINE_CLASS=L.CURSOR_STYLE_BAR_CLASS=L.CURSOR_STYLE_BLOCK_CLASS=L.CURSOR_BLINK_CLASS=L.CURSOR_CLASS=L.UNDERLINE_CLASS=L.ITALIC_CLASS=L.DIM_CLASS=L.BOLD_CLASS=void 0;var k=I(9),M=I(3),f=I(4),E=I(10);L.BOLD_CLASS="xterm-bold",L.DIM_CLASS="xterm-dim",L.ITALIC_CLASS="xterm-italic",L.UNDERLINE_CLASS="xterm-underline",L.CURSOR_CLASS="xterm-cursor",L.CURSOR_BLINK_CLASS="xterm-cursor-blink",L.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",L.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",L.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var x=function(){function h(o,u,r){this._document=o,this._optionsService=u,this._colors=r,this._workCell=new f.CellData}return h.prototype.setColors=function(o){this._colors=o},h.prototype.createRow=function(o,u,r,n,t,i,s){for(var l=this._document.createDocumentFragment(),c=0,d=Math.min(o.length,s)-1;d>=0;d--)if(o.loadCell(d,this._workCell).getCode()!==M.NULL_CELL_CODE||u&&d===n){c=d+1;break}for(d=0;d1&&(m.style.width=i*w+"px"),u&&d===n)switch(m.classList.add(L.CURSOR_CLASS),t&&m.classList.add(L.CURSOR_BLINK_CLASS),r){case"bar":m.classList.add(L.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(L.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(L.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&m.classList.add(L.BOLD_CLASS),this._workCell.isItalic()&&m.classList.add(L.ITALIC_CLASS),this._workCell.isDim()&&m.classList.add(L.DIM_CLASS),this._workCell.isUnderline()&&m.classList.add(L.UNDERLINE_CLASS),this._workCell.isInvisible()?m.textContent=M.WHITESPACE_CELL_CHAR:m.textContent=this._workCell.getChars()||M.WHITESPACE_CELL_CHAR;var S=this._workCell.getFgColor(),C=this._workCell.getFgColorMode(),v=this._workCell.getBgColor(),y=this._workCell.getBgColorMode(),T=!!this._workCell.isInverse();if(T){var A=S;S=v,v=A;var p=C;C=y,y=p}switch(C){case 16777216:case 33554432:this._workCell.isBold()&&S<8&&this._optionsService.options.drawBoldTextInBrightColors&&(S+=8),this._applyMinimumContrast(m,this._colors.background,this._colors.ansi[S])||m.classList.add("xterm-fg-"+S);break;case 50331648:var D=E.rgba.toColor(S>>16&255,S>>8&255,255&S);this._applyMinimumContrast(m,this._colors.background,D)||this._addStyle(m,"color:#"+g(S.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(m,this._colors.background,this._colors.foreground)||T&&m.classList.add("xterm-fg-"+k.INVERTED_DEFAULT_COLOR)}switch(y){case 16777216:case 33554432:m.classList.add("xterm-bg-"+v);break;case 50331648:this._addStyle(m,"background-color:#"+g(v.toString(16),"0",6));break;case 0:default:T&&m.classList.add("xterm-bg-"+k.INVERTED_DEFAULT_COLOR)}l.appendChild(m)}}return l},h.prototype._applyMinimumContrast=function(o,u,r){if(this._optionsService.options.minimumContrastRatio===1)return!1;var n=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return n===void 0&&(n=E.color.ensureContrastRatio(u,r,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,n!=null?n:null)),!!n&&(this._addStyle(o,"color:"+n.css),!0)},h.prototype._addStyle=function(o,u){o.setAttribute("style",""+(o.getAttribute("style")||"")+u+";")},h}();function g(h,o,u){for(;h.length"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};L.evaluateKeyboardEvent=function(f,E,x,g){var h={type:0,cancel:!1,key:void 0},o=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?h.key=E?k.C0.ESC+"OA":k.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?h.key=E?k.C0.ESC+"OD":k.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?h.key=E?k.C0.ESC+"OC":k.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(h.key=E?k.C0.ESC+"OB":k.C0.ESC+"[B");break;case 8:if(f.shiftKey){h.key=k.C0.BS;break}if(f.altKey){h.key=k.C0.ESC+k.C0.DEL;break}h.key=k.C0.DEL;break;case 9:if(f.shiftKey){h.key=k.C0.ESC+"[Z";break}h.key=k.C0.HT,h.cancel=!0;break;case 13:h.key=f.altKey?k.C0.ESC+k.C0.CR:k.C0.CR,h.cancel=!0;break;case 27:h.key=k.C0.ESC,f.altKey&&(h.key=k.C0.ESC+k.C0.ESC),h.cancel=!0;break;case 37:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"D",h.key===k.C0.ESC+"[1;3D"&&(h.key=k.C0.ESC+(x?"b":"[1;5D"))):h.key=E?k.C0.ESC+"OD":k.C0.ESC+"[D";break;case 39:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"C",h.key===k.C0.ESC+"[1;3C"&&(h.key=k.C0.ESC+(x?"f":"[1;5C"))):h.key=E?k.C0.ESC+"OC":k.C0.ESC+"[C";break;case 38:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"A",x||h.key!==k.C0.ESC+"[1;3A"||(h.key=k.C0.ESC+"[1;5A")):h.key=E?k.C0.ESC+"OA":k.C0.ESC+"[A";break;case 40:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"B",x||h.key!==k.C0.ESC+"[1;3B"||(h.key=k.C0.ESC+"[1;5B")):h.key=E?k.C0.ESC+"OB":k.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(h.key=k.C0.ESC+"[2~");break;case 46:h.key=o?k.C0.ESC+"[3;"+(o+1)+"~":k.C0.ESC+"[3~";break;case 36:h.key=o?k.C0.ESC+"[1;"+(o+1)+"H":E?k.C0.ESC+"OH":k.C0.ESC+"[H";break;case 35:h.key=o?k.C0.ESC+"[1;"+(o+1)+"F":E?k.C0.ESC+"OF":k.C0.ESC+"[F";break;case 33:f.shiftKey?h.type=2:h.key=k.C0.ESC+"[5~";break;case 34:f.shiftKey?h.type=3:h.key=k.C0.ESC+"[6~";break;case 112:h.key=o?k.C0.ESC+"[1;"+(o+1)+"P":k.C0.ESC+"OP";break;case 113:h.key=o?k.C0.ESC+"[1;"+(o+1)+"Q":k.C0.ESC+"OQ";break;case 114:h.key=o?k.C0.ESC+"[1;"+(o+1)+"R":k.C0.ESC+"OR";break;case 115:h.key=o?k.C0.ESC+"[1;"+(o+1)+"S":k.C0.ESC+"OS";break;case 116:h.key=o?k.C0.ESC+"[15;"+(o+1)+"~":k.C0.ESC+"[15~";break;case 117:h.key=o?k.C0.ESC+"[17;"+(o+1)+"~":k.C0.ESC+"[17~";break;case 118:h.key=o?k.C0.ESC+"[18;"+(o+1)+"~":k.C0.ESC+"[18~";break;case 119:h.key=o?k.C0.ESC+"[19;"+(o+1)+"~":k.C0.ESC+"[19~";break;case 120:h.key=o?k.C0.ESC+"[20;"+(o+1)+"~":k.C0.ESC+"[20~";break;case 121:h.key=o?k.C0.ESC+"[21;"+(o+1)+"~":k.C0.ESC+"[21~";break;case 122:h.key=o?k.C0.ESC+"[23;"+(o+1)+"~":k.C0.ESC+"[23~";break;case 123:h.key=o?k.C0.ESC+"[24;"+(o+1)+"~":k.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(x&&!g||!f.altKey||f.metaKey)x&&!f.altKey&&!f.ctrlKey&&f.metaKey?f.keyCode===65&&(h.type=1):f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?h.key=f.key:f.key&&f.ctrlKey&&f.key==="_"&&(h.key=k.C0.US);else{var u=M[f.keyCode],r=u&&u[f.shiftKey?1:0];if(r)h.key=k.C0.ESC+r;else if(f.keyCode>=65&&f.keyCode<=90){var n=f.ctrlKey?f.keyCode-64:f.keyCode+32;h.key=k.C0.ESC+String.fromCharCode(n)}}else f.keyCode>=65&&f.keyCode<=90?h.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?h.key=k.C0.NUL:f.keyCode>=51&&f.keyCode<=55?h.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?h.key=k.C0.DEL:f.keyCode===219?h.key=k.C0.ESC:f.keyCode===220?h.key=k.C0.FS:f.keyCode===221&&(h.key=k.C0.GS)}return h}},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(i,s){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var d in c)c.hasOwnProperty(d)&&(l[d]=c[d])})(i,s)},function(i,s){function l(){this.constructor=i}k(i,s),i.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}),f=this&&this.__decorate||function(i,s,l,c){var d,w=arguments.length,m=w<3?s:c===null?c=Object.getOwnPropertyDescriptor(s,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,s,l,c);else for(var S=i.length-1;S>=0;S--)(d=i[S])&&(m=(w<3?d(m):w>3?d(s,l,m):d(s,l))||m);return w>3&&m&&Object.defineProperty(s,l,m),m},E=this&&this.__param||function(i,s){return function(l,c){s(l,c,i)}};Object.defineProperty(L,"__esModule",{value:!0}),L.RenderService=void 0;var x=I(31),g=I(0),h=I(2),o=I(32),u=I(7),r=I(1),n=I(5),t=function(i){function s(l,c,d,w,m,S){var C=i.call(this)||this;if(C._renderer=l,C._rowCount=c,C._isPaused=!1,C._needsFullRefresh=!1,C._isNextRenderRedrawOnly=!0,C._needsSelectionRefresh=!1,C._canvasWidth=0,C._canvasHeight=0,C._selectionState={start:void 0,end:void 0,columnSelectMode:!1},C._onDimensionsChange=new g.EventEmitter,C._onRender=new g.EventEmitter,C._onRefreshRequest=new g.EventEmitter,C.register({dispose:function(){return C._renderer.dispose()}}),C._renderDebouncer=new x.RenderDebouncer(function(y,T){return C._renderRows(y,T)}),C.register(C._renderDebouncer),C._screenDprMonitor=new o.ScreenDprMonitor,C._screenDprMonitor.setListener(function(){return C.onDevicePixelRatioChange()}),C.register(C._screenDprMonitor),C.register(S.onResize(function(y){return C._fullRefresh()})),C.register(w.onOptionChange(function(){return C._renderer.onOptionsChanged()})),C.register(m.onCharSizeChange(function(){return C.onCharSizeChanged()})),C._renderer.onRequestRedraw(function(y){return C.refreshRows(y.start,y.end,!0)}),C.register(u.addDisposableDomListener(window,"resize",function(){return C.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var v=new IntersectionObserver(function(y){return C._onIntersectionChange(y[y.length-1])},{threshold:0});v.observe(d),C.register({dispose:function(){return v.disconnect()}})}return C}return M(s,i),Object.defineProperty(s.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),s.prototype._onIntersectionChange=function(l){this._isPaused=l.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},s.prototype.refreshRows=function(l,c,d){d===void 0&&(d=!1),this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,c,this._rowCount))},s.prototype._renderRows=function(l,c){this._renderer.renderRows(l,c),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:l,end:c}),this._isNextRenderRedrawOnly=!0},s.prototype.resize=function(l,c){this._rowCount=c,this._fireOnCanvasResize()},s.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},s.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},s.prototype.dispose=function(){i.prototype.dispose.call(this)},s.prototype.setRenderer=function(l){var c=this;this._renderer.dispose(),this._renderer=l,this._renderer.onRequestRedraw(function(d){return c.refreshRows(d.start,d.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},s.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},s.prototype.setColors=function(l){this._renderer.setColors(l),this._fullRefresh()},s.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},s.prototype.onResize=function(l,c){this._renderer.onResize(l,c),this._fullRefresh()},s.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},s.prototype.onBlur=function(){this._renderer.onBlur()},s.prototype.onFocus=function(){this._renderer.onFocus()},s.prototype.onSelectionChanged=function(l,c,d){this._selectionState.start=l,this._selectionState.end=c,this._selectionState.columnSelectMode=d,this._renderer.onSelectionChanged(l,c,d)},s.prototype.onCursorMove=function(){this._renderer.onCursorMove()},s.prototype.clear=function(){this._renderer.clear()},s.prototype.registerCharacterJoiner=function(l){return this._renderer.registerCharacterJoiner(l)},s.prototype.deregisterCharacterJoiner=function(l){return this._renderer.deregisterCharacterJoiner(l)},s=f([E(3,r.IOptionsService),E(4,n.ICharSizeService),E(5,r.IBufferService)],s)}(h.Disposable);L.RenderService=t},function(V,L,I){"use strict";var k=this&&this.__decorate||function(h,o,u,r){var n,t=arguments.length,i=t<3?o:r===null?r=Object.getOwnPropertyDescriptor(o,u):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(h,o,u,r);else for(var s=h.length-1;s>=0;s--)(n=h[s])&&(i=(t<3?n(i):t>3?n(o,u,i):n(o,u))||i);return t>3&&i&&Object.defineProperty(o,u,i),i},M=this&&this.__param||function(h,o){return function(u,r){o(u,r,h)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CharSizeService=void 0;var f=I(1),E=I(0),x=function(){function h(o,u,r){this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new g(o,u,this._optionsService)}return Object.defineProperty(h.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),h.prototype.measure=function(){var o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())},h=k([M(2,f.IOptionsService)],h)}();L.CharSizeService=x;var g=function(){function h(o,u,r){this._document=o,this._parentElement=u,this._optionsService=r,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return h.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var o=this._measureElement.getBoundingClientRect();return o.width!==0&&o.height!==0&&(this._result.width=o.width,this._result.height=Math.ceil(o.height)),this._result},h}()},function(V,L,I){"use strict";var k=this&&this.__decorate||function(g,h,o,u){var r,n=arguments.length,t=n<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(g,h,o,u);else for(var i=g.length-1;i>=0;i--)(r=g[i])&&(t=(n<3?r(t):n>3?r(h,o,t):r(h,o))||t);return n>3&&t&&Object.defineProperty(h,o,t),t},M=this&&this.__param||function(g,h){return function(o,u){h(o,u,g)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseService=void 0;var f=I(5),E=I(30),x=function(){function g(h,o){this._renderService=h,this._charSizeService=o}return g.prototype.getCoords=function(h,o,u,r,n){return E.getCoords(h,o,u,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,n)},g.prototype.getRawByteCoords=function(h,o,u,r){var n=this.getCoords(h,o,u,r);return E.getRawByteCoords(n)},g=k([M(0,f.IRenderService),M(1,f.ICharSizeService)],g)}();L.MouseService=x},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),f=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Linkifier2=void 0;var x=I(1),g=I(0),h=I(2),o=I(7),u=function(r){function n(t){var i=r.call(this)||this;return i._bufferService=t,i._linkProviders=[],i._linkCacheDisposables=[],i._isMouseOut=!0,i._activeLine=-1,i._onShowLinkUnderline=i.register(new g.EventEmitter),i._onHideLinkUnderline=i.register(new g.EventEmitter),i.register(h.getDisposeArrayDisposable(i._linkCacheDisposables)),i}return M(n,r),Object.defineProperty(n.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),n.prototype.registerLinkProvider=function(t){var i=this;return this._linkProviders.push(t),{dispose:function(){var s=i._linkProviders.indexOf(t);s!==-1&&i._linkProviders.splice(s,1)}}},n.prototype.attachToDom=function(t,i,s){var l=this;this._element=t,this._mouseService=i,this._renderService=s,this.register(o.addDisposableDomListener(this._element,"mouseleave",function(){l._isMouseOut=!0,l._clearCurrentLink()})),this.register(o.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(o.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},n.prototype._onMouseMove=function(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){var i=this._positionFromMouseEvent(t,this._element,this._mouseService);if(i){this._isMouseOut=!1;for(var s=t.composedPath(),l=0;lt?this._bufferService.cols:w.link.range.end.x,C=m;C<=S;C++){if(s.has(C)){c.splice(d--,1);break}s.add(C)}}},n.prototype._checkLinkProviderResult=function(t,i,s){var l,c=this;if(!this._activeProviderReplies)return s;for(var d=this._activeProviderReplies.get(t),w=!1,m=0;m=t&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,h.disposeArray(this._linkCacheDisposables))},n.prototype._handleNewLink=function(t){var i=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(t.link,s)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0||t.link.decorations.underline,pointerCursor:t.link.decorations===void 0||t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:function(){var l,c;return(c=(l=i._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:function(l){var c,d;((c=i._currentLink)===null||c===void 0?void 0:c.state)&&i._currentLink.state.decorations.pointerCursor!==l&&(i._currentLink.state.decorations.pointerCursor=l,i._currentLink.state.isHovered&&((d=i._element)===null||d===void 0||d.classList.toggle("xterm-cursor-pointer",l)))}},underline:{get:function(){var l,c;return(c=(l=i._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.underline},set:function(l){var c,d,w;((c=i._currentLink)===null||c===void 0?void 0:c.state)&&((w=(d=i._currentLink)===null||d===void 0?void 0:d.state)===null||w===void 0?void 0:w.decorations.underline)!==l&&(i._currentLink.state.decorations.underline=l,i._currentLink.state.isHovered&&i._fireUnderlineEvent(t.link,l))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(l){var c=l.start===0?0:l.start+1+i._bufferService.buffer.ydisp;i._clearCurrentLink(c,l.end+1+i._bufferService.buffer.ydisp)})))}},n.prototype._linkHover=function(t,i,s){var l;((l=this._currentLink)===null||l===void 0?void 0:l.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(s,i.text)},n.prototype._fireUnderlineEvent=function(t,i){var s=t.range,l=this._bufferService.buffer.ydisp,c=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-l-1,s.end.x,s.end.y-l-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(c)},n.prototype._linkLeave=function(t,i,s){var l;((l=this._currentLink)===null||l===void 0?void 0:l.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(s,i.text)},n.prototype._linkAtPosition=function(t,i){var s=t.range.start.y===t.range.end.y,l=t.range.start.yi.y;return(s&&t.range.start.x<=i.x&&t.range.end.x>=i.x||l&&t.range.end.x>=i.x||c&&t.range.start.x<=i.x||l&&c)&&t.range.start.y<=i.y&&t.range.end.y>=i.y},n.prototype._positionFromMouseEvent=function(t,i,s){var l=s.getCoords(t,i,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}},n.prototype._createLinkUnderlineEvent=function(t,i,s,l,c){return{x1:t,y1:i,x2:s,y2:l,cols:this._bufferService.cols,fg:c}},n=f([E(0,x.IBufferService)],n)}(h.Disposable);L.Linkifier2=u},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CoreBrowserService=void 0;var k=function(){function M(f){this._textarea=f}return Object.defineProperty(M.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),M}();L.CoreBrowserService=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(m,S){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,v){C.__proto__=v}||function(C,v){for(var y in v)v.hasOwnProperty(y)&&(C[y]=v[y])})(m,S)},function(m,S){function C(){this.constructor=m}k(m,S),m.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)});Object.defineProperty(L,"__esModule",{value:!0}),L.CoreTerminal=void 0;var f=I(2),E=I(1),x=I(66),g=I(67),h=I(68),o=I(74),u=I(75),r=I(0),n=I(76),t=I(77),i=I(78),s=I(80),l=I(81),c=I(19),d=I(82),w=function(m){function S(C){var v=m.call(this)||this;return v._onBinary=new r.EventEmitter,v._onData=new r.EventEmitter,v._onLineFeed=new r.EventEmitter,v._onResize=new r.EventEmitter,v._onScroll=new r.EventEmitter,v._instantiationService=new x.InstantiationService,v.optionsService=new o.OptionsService(C),v._instantiationService.setService(E.IOptionsService,v.optionsService),v._bufferService=v.register(v._instantiationService.createInstance(h.BufferService)),v._instantiationService.setService(E.IBufferService,v._bufferService),v._logService=v._instantiationService.createInstance(g.LogService),v._instantiationService.setService(E.ILogService,v._logService),v._coreService=v.register(v._instantiationService.createInstance(u.CoreService,function(){return v.scrollToBottom()})),v._instantiationService.setService(E.ICoreService,v._coreService),v._coreMouseService=v._instantiationService.createInstance(n.CoreMouseService),v._instantiationService.setService(E.ICoreMouseService,v._coreMouseService),v._dirtyRowService=v._instantiationService.createInstance(t.DirtyRowService),v._instantiationService.setService(E.IDirtyRowService,v._dirtyRowService),v.unicodeService=v._instantiationService.createInstance(i.UnicodeService),v._instantiationService.setService(E.IUnicodeService,v.unicodeService),v._charsetService=v._instantiationService.createInstance(s.CharsetService),v._instantiationService.setService(E.ICharsetService,v._charsetService),v._inputHandler=new c.InputHandler(v._bufferService,v._charsetService,v._coreService,v._dirtyRowService,v._logService,v.optionsService,v._coreMouseService,v.unicodeService),v.register(r.forwardEvent(v._inputHandler.onLineFeed,v._onLineFeed)),v.register(v._inputHandler),v.register(r.forwardEvent(v._bufferService.onResize,v._onResize)),v.register(r.forwardEvent(v._coreService.onData,v._onData)),v.register(r.forwardEvent(v._coreService.onBinary,v._onBinary)),v.register(v.optionsService.onOptionChange(function(y){return v._updateOptions(y)})),v._writeBuffer=new d.WriteBuffer(function(y){return v._inputHandler.parse(y)}),v}return M(S,m),Object.defineProperty(S.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){var C;this._isDisposed||(m.prototype.dispose.call(this),(C=this._windowsMode)===null||C===void 0||C.dispose(),this._windowsMode=void 0)},S.prototype.write=function(C,v){this._writeBuffer.write(C,v)},S.prototype.writeSync=function(C){this._writeBuffer.writeSync(C)},S.prototype.resize=function(C,v){isNaN(C)||isNaN(v)||(C=Math.max(C,h.MINIMUM_COLS),v=Math.max(v,h.MINIMUM_ROWS),this._bufferService.resize(C,v))},S.prototype.scroll=function(C,v){v===void 0&&(v=!1);var y,T=this._bufferService.buffer;(y=this._cachedBlankLine)&&y.length===this.cols&&y.getFg(0)===C.fg&&y.getBg(0)===C.bg||(y=T.getBlankLine(C,v),this._cachedBlankLine=y),y.isWrapped=v;var A=T.ybase+T.scrollTop,p=T.ybase+T.scrollBottom;if(T.scrollTop===0){var D=T.lines.isFull;p===T.lines.length-1?D?T.lines.recycle().copyFrom(y):T.lines.push(y.clone()):T.lines.splice(p+1,0,y.clone()),D?this._bufferService.isUserScrolling&&(T.ydisp=Math.max(T.ydisp-1,0)):(T.ybase++,this._bufferService.isUserScrolling||T.ydisp++)}else{var O=p-A+1;T.lines.shiftElements(A+1,O-1,-1),T.lines.set(p,y.clone())}this._bufferService.isUserScrolling||(T.ydisp=T.ybase),this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom),this._onScroll.fire(T.ydisp)},S.prototype.scrollLines=function(C,v){var y=this._bufferService.buffer;if(C<0){if(y.ydisp===0)return;this._bufferService.isUserScrolling=!0}else C+y.ydisp>=y.ybase&&(this._bufferService.isUserScrolling=!1);var T=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+C,y.ybase),0),T!==y.ydisp&&(v||this._onScroll.fire(y.ydisp))},S.prototype.scrollPages=function(C){this.scrollLines(C*(this.rows-1))},S.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},S.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},S.prototype.scrollToLine=function(C){var v=C-this._bufferService.buffer.ydisp;v!==0&&this.scrollLines(v)},S.prototype.addEscHandler=function(C,v){return this._inputHandler.addEscHandler(C,v)},S.prototype.addDcsHandler=function(C,v){return this._inputHandler.addDcsHandler(C,v)},S.prototype.addCsiHandler=function(C,v){return this._inputHandler.addCsiHandler(C,v)},S.prototype.addOscHandler=function(C,v){return this._inputHandler.addOscHandler(C,v)},S.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},S.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},S.prototype._updateOptions=function(C){var v;switch(C){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((v=this._windowsMode)===null||v===void 0||v.dispose(),this._windowsMode=void 0)}},S.prototype._enableWindowsMode=function(){var C=this;if(!this._windowsMode){var v=[];v.push(this.onLineFeed(l.updateWindowsModeWrappedState.bind(null,this._bufferService))),v.push(this.addCsiHandler({final:"H"},function(){return l.updateWindowsModeWrappedState(C._bufferService),!1})),this._windowsMode={dispose:function(){for(var y=0,T=v;y0?r[0].index:o.length;if(o.length!==c)throw new Error("[createInstance] First service dependency of "+h.name+" at position "+(c+1)+" conflicts with "+o.length+" static arguments");return new(h.bind.apply(h,k([void 0],k(o,n))))},g}();L.InstantiationService=x},function(V,L,I){"use strict";var k=this&&this.__decorate||function(o,u,r,n){var t,i=arguments.length,s=i<3?u:n===null?n=Object.getOwnPropertyDescriptor(u,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,u,r,n);else for(var l=o.length-1;l>=0;l--)(t=o[l])&&(s=(i<3?t(s):i>3?t(u,r,s):t(u,r))||s);return i>3&&s&&Object.defineProperty(u,r,s),s},M=this&&this.__param||function(o,u){return function(r,n){u(r,n,o)}},f=this&&this.__spreadArrays||function(){for(var o=0,u=0,r=arguments.length;u=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.BufferService=L.MINIMUM_ROWS=L.MINIMUM_COLS=void 0;var x=I(1),g=I(69),h=I(0),o=I(2);L.MINIMUM_COLS=2,L.MINIMUM_ROWS=1;var u=function(r){function n(t){var i=r.call(this)||this;return i._optionsService=t,i.isUserScrolling=!1,i._onResize=new h.EventEmitter,i.cols=Math.max(t.options.cols,L.MINIMUM_COLS),i.rows=Math.max(t.options.rows,L.MINIMUM_ROWS),i.buffers=new g.BufferSet(t,i),i}return M(n,r),Object.defineProperty(n.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){r.prototype.dispose.call(this),this.buffers.dispose()},n.prototype.resize=function(t,i){this.cols=t,this.rows=i,this.buffers.resize(t,i),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:t,rows:i})},n.prototype.reset=function(){this.buffers.dispose(),this.buffers=new g.BufferSet(this._optionsService,this),this.isUserScrolling=!1},n=f([E(0,x.IOptionsService)],n)}(o.Disposable);L.BufferService=u},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(g,h){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var r in u)u.hasOwnProperty(r)&&(o[r]=u[r])})(g,h)},function(g,h){function o(){this.constructor=g}k(g,h),g.prototype=h===null?Object.create(h):(o.prototype=h.prototype,new o)});Object.defineProperty(L,"__esModule",{value:!0}),L.BufferSet=void 0;var f=I(70),E=I(0),x=function(g){function h(o,u){var r=g.call(this)||this;return r._onBufferActivate=r.register(new E.EventEmitter),r._normal=new f.Buffer(!0,o,u),r._normal.fillViewportRows(),r._alt=new f.Buffer(!1,o,u),r._activeBuffer=r._normal,r.setupTabStops(),r}return M(h,g),Object.defineProperty(h.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),h.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},h.prototype.activateAltBuffer=function(o){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(o),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},h.prototype.resize=function(o,u){this._normal.resize(o,u),this._alt.resize(o,u)},h.prototype.setupTabStops=function(o){this._normal.setupTabStops(o),this._alt.setupTabStops(o)},h}(I(2).Disposable);L.BufferSet=x},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BufferStringIterator=L.Buffer=L.MAX_BUFFER_SIZE=void 0;var k=I(71),M=I(16),f=I(4),E=I(3),x=I(72),g=I(73),h=I(20),o=I(6);L.MAX_BUFFER_SIZE=4294967295;var u=function(){function n(t,i,s){this._hasScrollback=t,this._optionsService=i,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=M.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=f.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=f.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new k.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return n.prototype.getNullCell=function(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell},n.prototype.getWhitespaceCell=function(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell},n.prototype.getBlankLine=function(t,i){return new M.BufferLine(this._bufferService.cols,this.getNullCell(t),i)},Object.defineProperty(n.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return t>=0&&tL.MAX_BUFFER_SIZE?L.MAX_BUFFER_SIZE:i},n.prototype.fillViewportRows=function(t){if(this.lines.length===0){t===void 0&&(t=M.DEFAULT_ATTR_DATA);for(var i=this._rows;i--;)this.lines.push(this.getBlankLine(t))}},n.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new k.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},n.prototype.resize=function(t,i){var s=this.getNullCell(M.DEFAULT_ATTR_DATA),l=this._getCorrectBufferLength(i);if(l>this.lines.maxLength&&(this.lines.maxLength=l),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+d+1?(this.ybase--,d++,this.ydisp>0&&this.ydisp--):this.lines.push(new M.BufferLine(t,s)));else for(w=this._rows;w>i;w--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(l0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=l}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,i-1),d&&(this.y+=d),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(t,i),this._cols>t))for(c=0;cthis._cols?this._reflowLarger(t,i):this._reflowSmaller(t,i))},n.prototype._reflowLarger=function(t,i){var s=x.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(M.DEFAULT_ATTR_DATA));if(s.length>0){var l=x.reflowLargerCreateNewLayout(this.lines,s);x.reflowLargerApplyNewLayout(this.lines,l.layout),this._reflowLargerAdjustViewport(t,i,l.countRemoved)}},n.prototype._reflowLargerAdjustViewport=function(t,i,s){for(var l=this.getNullCell(M.DEFAULT_ATTR_DATA),c=s;c-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;d--){var w=this.lines.get(d);if(!(!w||!w.isWrapped&&w.getTrimmedLength()<=t)){for(var m=[w];w.isWrapped&&d>0;)w=this.lines.get(--d),m.unshift(w);var S=this.ybase+this.y;if(!(S>=d&&S0&&(l.push({start:d+m.length+c,newLines:A}),c+=A.length),m.push.apply(m,A);var O=v.length-1,P=v[O];P===0&&(P=v[--O]);for(var j=m.length-y-1,K=C;j>=0;){var U=Math.min(K,P);if(m[O].copyCellsFrom(m[j],K-U,P-U,U,!0),(P-=U)===0&&(P=v[--O]),(K-=U)===0){j--;var X=Math.max(j,0);K=x.getWrappedLineTrimmedLength(m,X,this._cols)}}for(p=0;p0;)this.ybase===0?this.y0){var N=[],z=[];for(p=0;p=0;p--)if(Fe&&Fe.start>ce+Oe){for(var Re=Fe.newLines.length-1;Re>=0;Re--)this.lines.set(p--,Fe.newLines[Re]);p++,N.push({index:ce+1,amount:Fe.newLines.length}),Oe+=Fe.newLines.length,Fe=l[++be]}else this.lines.set(p,z[ce--]);var Be=0;for(p=N.length-1;p>=0;p--)N[p].index+=Be,this.lines.onInsertEmitter.fire(N[p]),Be+=N[p].amount;var Ke=Math.max(0,te+c-this.lines.maxLength);Ke>0&&this.lines.onTrimEmitter.fire(Ke)}},n.prototype.stringIndexToBufferIndex=function(t,i,s){for(s===void 0&&(s=!1);i;){var l=this.lines.get(t);if(!l)return[-1,-1];for(var c=s?l.getTrimmedLength():l.length,d=0;d0&&this.lines.get(i).isWrapped;)i--;for(;s+10;);return t>=this._cols?this._cols-1:t<0?0:t},n.prototype.nextStop=function(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t},n.prototype.addMarker=function(t){var i=this,s=new g.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim(function(l){s.line-=l,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(function(l){s.line>=l.index&&(s.line+=l.amount)})),s.register(this.lines.onDelete(function(l){s.line>=l.index&&s.linel.index&&(s.line-=l.amount)})),s.register(s.onDispose(function(){return i._removeMarker(s)})),s},n.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},n.prototype.iterator=function(t,i,s,l,c){return new r(this,t,i,s,l,c)},n}();L.Buffer=u;var r=function(){function n(t,i,s,l,c,d){s===void 0&&(s=0),l===void 0&&(l=t.lines.length),c===void 0&&(c=0),d===void 0&&(d=0),this._buffer=t,this._trimRight=i,this._startIndex=s,this._endIndex=l,this._startOverscan=c,this._endOverscan=d,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return n.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var i="",s=t.first;s<=t.last;++s)i+=this._buffer.translateBufferLineToString(s,this._trimRight);return this._current=t.last+1,{range:t,content:i}},n}();L.BufferStringIterator=r},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CircularList=void 0;var k=I(0),M=function(){function f(E){this._maxLength=E,this.onDeleteEmitter=new k.EventEmitter,this.onInsertEmitter=new k.EventEmitter,this.onTrimEmitter=new k.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(f.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var x=new Array(E),g=0;gthis._length)for(var x=this._length;x=E;o--)this._array[this._getCyclicIndex(o+g.length)]=this._array[this._getCyclicIndex(o)];for(o=0;othis._maxLength){var u=this._length+g.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=g.length},f.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},f.prototype.shiftElements=function(E,x,g){if(!(x<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(var h=x-1;h>=0;h--)this.set(E+h+g,this.get(E+h));var o=E+x+g-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(h=0;h=o&&x0&&(C>t||n[C].getTrimmedLength()===0);C--)S++;S>0&&(h.push(o+n.length-S),h.push(S)),o+=n.length-1}}}return h},L.reflowLargerCreateNewLayout=function(M,f){for(var E=[],x=0,g=f[x],h=0,o=0;or&&(h-=r,o++);var n=M[o].getWidth(h-1)===2;n&&h--;var t=n?E-1:E;x.push(t),u+=t}return x},L.getWrappedLineTrimmedLength=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(x,g){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,o){h.__proto__=o}||function(h,o){for(var u in o)o.hasOwnProperty(u)&&(h[u]=o[u])})(x,g)},function(x,g){function h(){this.constructor=x}k(x,g),x.prototype=g===null?Object.create(g):(h.prototype=g.prototype,new h)});Object.defineProperty(L,"__esModule",{value:!0}),L.Marker=void 0;var f=I(0),E=function(x){function g(h){var o=x.call(this)||this;return o.line=h,o._id=g._nextId++,o.isDisposed=!1,o._onDispose=new f.EventEmitter,o}return M(g,x),Object.defineProperty(g.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),g.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},g._nextId=1,g}(I(2).Disposable);L.Marker=E},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.OptionsService=L.DEFAULT_OPTIONS=L.DEFAULT_BELL_SOUND=void 0;var k=I(0),M=I(11),f=I(33);L.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",L.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:L.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:M.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var E=["cols","rows"],x=function(){function g(h){this._onOptionChange=new k.EventEmitter,this.options=f.clone(L.DEFAULT_OPTIONS);for(var o=0,u=Object.keys(h);o=0;m--)(c=t[m])&&(w=(d<3?c(w):d>3?c(i,s,w):c(i,s))||w);return d>3&&w&&Object.defineProperty(i,s,w),w},E=this&&this.__param||function(t,i){return function(s,l){i(s,l,t)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CoreService=void 0;var x=I(1),g=I(0),h=I(33),o=I(2),u=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),n=function(t){function i(s,l,c,d){var w=t.call(this)||this;return w._bufferService=l,w._logService=c,w._optionsService=d,w.isCursorInitialized=!1,w.isCursorHidden=!1,w._onData=w.register(new g.EventEmitter),w._onUserInput=w.register(new g.EventEmitter),w._onBinary=w.register(new g.EventEmitter),w._scrollToBottom=s,w.register({dispose:function(){return w._scrollToBottom=void 0}}),w.modes=h.clone(u),w.decPrivateModes=h.clone(r),w}return M(i,t),Object.defineProperty(i.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),i.prototype.reset=function(){this.modes=h.clone(u),this.decPrivateModes=h.clone(r)},i.prototype.triggerDataEvent=function(s,l){if(l===void 0&&(l=!1),!this._optionsService.options.disableStdin){var c=this._bufferService.buffer;c.ybase!==c.ydisp&&this._scrollToBottom(),l&&this._onUserInput.fire(),this._logService.debug('sending data "'+s+'"',function(){return s.split("").map(function(d){return d.charCodeAt(0)})}),this._onData.fire(s)}},i.prototype.triggerBinaryEvent=function(s){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+s+'"',function(){return s.split("").map(function(l){return l.charCodeAt(0)})}),this._onBinary.fire(s))},i=f([E(1,x.IBufferService),E(2,x.ILogService),E(3,x.IOptionsService)],i)}(o.Disposable);L.CoreService=n},function(V,L,I){"use strict";var k=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},M=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CoreMouseService=void 0;var f=I(1),E=I(0),x={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(r){return r.button!==4&&r.action===1&&(r.ctrl=!1,r.alt=!1,r.shift=!1,!0)}},VT200:{events:19,restrict:function(r){return r.action!==32}},DRAG:{events:23,restrict:function(r){return r.action!==32||r.button!==3}},ANY:{events:31,restrict:function(r){return!0}}};function g(r,n){var t=(r.ctrl?16:0)|(r.shift?4:0)|(r.alt?8:0);return r.button===4?(t|=64,t|=r.action):(t|=3&r.button,4&r.button&&(t|=64),8&r.button&&(t|=128),r.action===32?t|=32:r.action!==0||n||(t|=3)),t}var h=String.fromCharCode,o={DEFAULT:function(r){var n=[g(r,!1)+32,r.col+32,r.row+32];return n[0]>255||n[1]>255||n[2]>255?"":""+h(n[0])+h(n[1])+h(n[2])},SGR:function(r){var n=r.action===0&&r.button!==4?"m":"M";return"[<"+g(r,!0)+";"+r.col+";"+r.row+n}},u=function(){function r(n,t){this._bufferService=n,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var i=0,s=Object.keys(x);i=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows)return!1;if(n.button===4&&n.action===32)return!1;if(n.button===3&&n.action!==32)return!1;if(n.button!==4&&(n.action===2||n.action===3))return!1;if(n.col++,n.row++,n.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,n))return!1;if(!this._protocols[this._activeProtocol].restrict(n))return!1;var t=this._encodings[this._activeEncoding](n);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=n,!0},r.prototype.explainEvents=function(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}},r.prototype._compareEvents=function(n,t){return n.col===t.col&&(n.row===t.row&&(n.button===t.button&&(n.action===t.action&&(n.ctrl===t.ctrl&&n.alt===t.alt))))&&n.shift===t.shift},r=k([M(0,f.IBufferService),M(1,f.ICoreService)],r)}();L.CoreMouseService=u},function(V,L,I){"use strict";var k=this&&this.__decorate||function(x,g,h,o){var u,r=arguments.length,n=r<3?g:o===null?o=Object.getOwnPropertyDescriptor(g,h):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(x,g,h,o);else for(var t=x.length-1;t>=0;t--)(u=x[t])&&(n=(r<3?u(n):r>3?u(g,h,n):u(g,h))||n);return r>3&&n&&Object.defineProperty(g,h,n),n},M=this&&this.__param||function(x,g){return function(h,o){g(h,o,x)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DirtyRowService=void 0;var f=I(1),E=function(){function x(g){this._bufferService=g,this.clearRange()}return Object.defineProperty(x.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),x.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},x.prototype.markDirty=function(g){gthis._end&&(this._end=g)},x.prototype.markRangeDirty=function(g,h){if(g>h){var o=g;g=h,h=o}gthis._end&&(this._end=h)},x.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},x=k([M(0,f.IBufferService)],x)}();L.DirtyRowService=E},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.UnicodeService=void 0;var k=I(0),M=I(79),f=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new k.EventEmitter;var x=new M.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}return Object.defineProperty(E.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"activeVersion",{get:function(){return this._active},set:function(x){if(!this._providers[x])throw new Error('unknown Unicode version "'+x+'"');this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)},enumerable:!1,configurable:!0}),E.prototype.register=function(x){this._providers[x.version]=x},E.prototype.wcwidth=function(x){return this._activeProvider.wcwidth(x)},E.prototype.getStringCellWidth=function(x){for(var g=0,h=x.length,o=0;o=h)return g+this.wcwidth(u);var r=x.charCodeAt(o);56320<=r&&r<=57343?u=1024*(u-55296)+r-56320+65536:g+=this.wcwidth(r)}g+=this.wcwidth(u)}return g},E}();L.UnicodeService=f},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.UnicodeV6=void 0;var k,M=I(15),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],E=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],x=function(){function g(){if(this.version="6",!k){k=new Uint8Array(65536),M.fill(k,1),k[0]=0,M.fill(k,0,1,32),M.fill(k,0,127,160),M.fill(k,2,4352,4448),k[9001]=2,k[9002]=2,M.fill(k,2,11904,42192),k[12351]=1,M.fill(k,2,44032,55204),M.fill(k,2,63744,64256),M.fill(k,2,65040,65050),M.fill(k,2,65072,65136),M.fill(k,2,65280,65377),M.fill(k,2,65504,65511);for(var h=0;hu[t][1])return!1;for(;t>=n;)if(o>u[r=n+t>>1][1])n=r+1;else{if(!(o=131072&&h<=196605||h>=196608&&h<=262141?2:1},g}();L.UnicodeV6=x},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CharsetService=void 0;var k=function(){function M(){this.glevel=0,this._charsets=[]}return M.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},M.prototype.setgLevel=function(f){this.glevel=f,this.charset=this._charsets[f]},M.prototype.setgCharset=function(f,E){this._charsets[f]=E,this.glevel===f&&(this.charset=E)},M}();L.CharsetService=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.updateWindowsModeWrappedState=void 0;var k=I(3);L.updateWindowsModeWrappedState=function(M){var f=M.buffer.lines.get(M.buffer.ybase+M.buffer.y-1),E=f==null?void 0:f.get(M.cols-1),x=M.buffer.lines.get(M.buffer.ybase+M.buffer.y);x&&E&&(x.isWrapped=E[k.CHAR_DATA_CODE_INDEX]!==k.NULL_CELL_CODE&&E[k.CHAR_DATA_CODE_INDEX]!==k.WHITESPACE_CELL_CODE)}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.WriteBuffer=void 0;var k=function(){function M(f){this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return M.prototype.writeSync=function(f){if(this._writeBuffer.length){for(var E=this._bufferOffset;E5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return x._innerWrite()})),this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(E)},M.prototype._innerWrite=function(){for(var f=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var x=this._writeBuffer[this._bufferOffset],g=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(x),this._pendingData-=x.length,g&&g(),Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return f._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},M}();L.WriteBuffer=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.AddonManager=void 0;var k=function(){function M(){this._addons=[]}return M.prototype.dispose=function(){for(var f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()},M.prototype.loadAddon=function(f,E){var x=this,g={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(g),E.dispose=function(){return x._wrappedAddonDispose(g)},E.activate(f)},M.prototype._wrappedAddonDispose=function(f){if(!f.isDisposed){for(var E=-1,x=0;x> RFB.constructor"),ae._screen=document.createElement("div"),ae._screen.style.display="flex",ae._screen.style.width="100%",ae._screen.style.height="100%",ae._screen.style.overflow="auto",ae._screen.style.background=te,ae._canvas=document.createElement("canvas"),ae._canvas.style.margin="auto",ae._canvas.style.outline="none",ae._canvas.style.flexShrink="0",ae._canvas.width=0,ae._canvas.height=0,ae._canvas.tabIndex=-1,ae._screen.appendChild(ae._canvas),ae._cursor=new r.default,ae._cursorImage=Pe.cursors.none,ae._decoders[l.encodings.encodingRaw]=new c.default,ae._decoders[l.encodings.encodingCopyRect]=new d.default,ae._decoders[l.encodings.encodingRRE]=new w.default,ae._decoders[l.encodings.encodingHextile]=new m.default,ae._decoders[l.encodings.encodingTight]=new S.default,ae._decoders[l.encodings.encodingTightPNG]=new C.default;try{ae._display=new x.default(ae._canvas)}catch(De){throw L.Error("Display exception: "+De),De}return ae._display.onflush=ae._onFlush.bind(X(ae)),ae._keyboard=new o.default(ae._canvas),ae._keyboard.onkeyevent=ae._handleKeyEvent.bind(X(ae)),ae._gestures=new u.default,ae._sock=new n.default,ae._sock.on("message",function(){ae._handleMessage()}),ae._sock.on("open",function(){ae._rfbConnectionState==="connecting"&&ae._rfbInitState===""?(ae._rfbInitState="ProtocolVersion",L.Debug("Starting VNC handshake")):ae._fail("Unexpected server connection while "+ae._rfbConnectionState)}),ae._sock.on("close",function(De){L.Debug("WebSocket on-close event");var qe="";De.code&&(qe="(code: "+De.code,De.reason&&(qe+=", reason: "+De.reason),qe+=")");switch(ae._rfbConnectionState){case"connecting":ae._fail("Connection closed "+qe);break;case"connected":ae._updateConnectionState("disconnecting"),ae._updateConnectionState("disconnected");break;case"disconnecting":ae._updateConnectionState("disconnected");break;case"disconnected":ae._fail("Unexpected server disconnect when already disconnected "+qe);break;default:ae._fail("Unexpected server disconnect before connecting "+qe);break}ae._sock.off("close")}),ae._sock.on("error",function(De){return L.Warn("WebSocket on-error event")}),setTimeout(ae._updateConnectionState.bind(X(ae),"connecting")),L.Debug("<< RFB.constructor"),ae.dragViewport=!1,ae.focusOnClick=!0,ae._viewOnly=!1,ae._clipViewport=!1,ae._scaleViewport=!1,ae._resizeSession=!1,ae._showDotCursor=!1,ve.showDotCursor!==void 0&&(L.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),ae._showDotCursor=ve.showDotCursor),ae._qualityLevel=6,ae._compressionLevel=2,ae}return O(Pe,[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(re){this._rfbCredentials=re,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;L.Info("Sending Ctrl-Alt-Del"),this.sendKey(i.default.XK_Control_L,"ControlLeft",!0),this.sendKey(i.default.XK_Alt_L,"AltLeft",!0),this.sendKey(i.default.XK_Delete,"Delete",!0),this.sendKey(i.default.XK_Delete,"Delete",!1),this.sendKey(i.default.XK_Alt_L,"AltLeft",!1),this.sendKey(i.default.XK_Control_L,"ControlLeft",!1)}},{key:"machineShutdown",value:function(){this._xvpOp(1,2)}},{key:"machineReboot",value:function(){this._xvpOp(1,3)}},{key:"machineReset",value:function(){this._xvpOp(1,4)}},{key:"sendKey",value:function(re,ve,ae){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(ae===void 0){this.sendKey(re,ve,!0),this.sendKey(re,ve,!1);return}var De=s.default[ve];if(this._qemuExtKeyEventSupported&&De)re=re||0,L.Info("Sending key ("+(ae?"down":"up")+"): keysym "+re+", scancode "+De),Pe.messages.QEMUExtendedKeyEvent(this._sock,re,ae,De);else{if(!re)return;L.Info("Sending keysym ("+(ae?"down":"up")+"): "+re),Pe.messages.keyEvent(this._sock,re,ae?1:0)}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(re){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(this._clipboardServerCapabilitiesFormats[Ae]&&this._clipboardServerCapabilitiesActions[Ze])this._clipboardText=re,Pe.messages.extendedClipboardNotify(this._sock,[Ae]);else{for(var ve=new Uint8Array(re.length),ae=0;ae> RFB.connect"),L.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(re){re.name==="SyntaxError"?this._fail("Invalid host or port ("+re+")"):this._fail("Error when opening socket ("+re+")")}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),window.addEventListener("resize",this._eventHandlers.windowResize),this._canvas.addEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.addEventListener("touchstart",this._eventHandlers.focusCanvas),this._canvas.addEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.addEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.addEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.addEventListener("click",this._eventHandlers.handleMouse),this._canvas.addEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.addEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.addEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.addEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.addEventListener("gestureend",this._eventHandlers.handleGesture),L.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){L.Debug(">> RFB.disconnect"),this._cursor.detach(),this._canvas.removeEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gestureend",this._eventHandlers.handleGesture),this._canvas.removeEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.removeEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.removeEventListener("click",this._eventHandlers.handleMouse),this._canvas.removeEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.removeEventListener("touchstart",this._eventHandlers.focusCanvas),window.removeEventListener("resize",this._eventHandlers.windowResize),this._keyboard.ungrab(),this._gestures.detach(),this._sock.close();try{this._target.removeChild(this._screen)}catch(re){if(!(re.name==="NotFoundError"))throw re}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),L.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(re){if(!this.focusOnClick)return;this.focus()}},{key:"_setDesktopName",value:function(re){this._fbName=re,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(re){var ve=this;window.requestAnimationFrame(function(){ve._updateClip(),ve._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var re=this._display.clipViewport,ve=this._clipViewport;if(this._scaleViewport&&(ve=!1),re!==ve&&(this._display.clipViewport=ve),ve){var ae=this._screenSize();this._display.viewportChangeSize(ae.w,ae.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(!this._scaleViewport)this._display.scale=1;else{var re=this._screenSize();this._display.autoscale(re.w,re.h)}this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;var re=this._screenSize();Pe.messages.setDesktopSize(this._sock,Math.floor(re.w),Math.floor(re.h),this._screenID,this._screenFlags),L.Debug("Requested new desktop size: "+re.w+"x"+re.h)}},{key:"_screenSize",value:function(){var re=this._screen.getBoundingClientRect();return{w:re.width,h:re.height}}},{key:"_fixScrollbars",value:function(){var re=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=re}},{key:"_updateConnectionState",value:function(re){var ve=this,ae=this._rfbConnectionState;if(re===ae){L.Debug("Already in state '"+re+"', ignoring");return}if(ae==="disconnected"){L.Error("Tried changing state of a disconnected RFB object");return}switch(re){case"connected":if(ae!=="connecting"){L.Error("Bad transition to connected state, previous connection state: "+ae);return}break;case"disconnected":if(ae!=="disconnecting"){L.Error("Bad transition to disconnected state, previous connection state: "+ae);return}break;case"connecting":if(ae!==""){L.Error("Bad transition to connecting state, previous connection state: "+ae);return}break;case"disconnecting":if(ae!=="connected"&&ae!=="connecting"){L.Error("Bad transition to disconnecting state, previous connection state: "+ae);return}break;default:L.Error("Unknown connection state: "+re);return}this._rfbConnectionState=re,L.Debug("New state '"+re+"', was '"+ae+"'."),this._disconnTimer&&re!=="disconnecting"&&(L.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close"));switch(re){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(function(){L.Error("Disconnection timed out."),ve._updateConnectionState("disconnected")},z*1e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}},{key:"_fail",value:function(re){switch(this._rfbConnectionState){case"disconnecting":L.Error("Failed when disconnecting: "+re);break;case"connected":L.Error("Failed while connected: "+re);break;case"connecting":L.Error("Failed when connecting: "+re);break;default:L.Error("RFB failure: "+re);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(re,ve){this._capabilities[re]=ve,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(this._sock.rQlen===0){L.Warn("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":L.Error("Got data while disconnected");break;case"connected":for(;!this._flushing;){if(!this._normalMsg())break;if(this._sock.rQlen===0)break}break;default:this._initMsg();break}}},{key:"_handleKeyEvent",value:function(re,ve,ae){this.sendKey(re,ve,ae)}},{key:"_handleMouse",value:function(re){if(re.type==="click"&&re.target!==this._canvas)return;if(re.stopPropagation(),re.preventDefault(),re.type==="click"||re.type==="contextmenu")return;var ve=(0,M.clientToElement)(re.clientX,re.clientY,this._canvas);switch(re.type){case"mousedown":(0,f.setCapture)(this._canvas),this._handleMouseButton(ve.x,ve.y,!0,1<k.dragThreshold||Math.abs(qe)>k.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:re,y:ve},this._display.viewportChangePos(De,qe));return}if(this._mousePos={x:re,y:ve},this._mouseMoveTimer==null){var et=Date.now()-this._mouseLastMoveTime;et>ce?(this._sendMouse(re,ve,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(function(){ae._handleDelayedMouseMove()},ce-et)}}},{key:"_handleDelayedMouseMove",value:function(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}},{key:"_sendMouse",value:function(re,ve,ae){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;Pe.messages.pointerEvent(this._sock,this._display.absX(re),this._display.absY(ve),ae)}},{key:"_handleWheel",value:function(re){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;re.stopPropagation(),re.preventDefault();var ve=(0,M.clientToElement)(re.clientX,re.clientY,this._canvas),ae=re.deltaX,De=re.deltaY;re.deltaMode!==0&&(ae*=Fe,De*=Fe),this._accumulatedWheelDeltaX+=ae,this._accumulatedWheelDeltaY+=De,Math.abs(this._accumulatedWheelDeltaX)>=be&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(ve.x,ve.y,!0,1<<5),this._handleMouseButton(ve.x,ve.y,!1,1<<5)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(ve.x,ve.y,!0,1<<6),this._handleMouseButton(ve.x,ve.y,!1,1<<6)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=be&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(ve.x,ve.y,!0,1<<3),this._handleMouseButton(ve.x,ve.y,!1,1<<3)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(ve.x,ve.y,!0,1<<4),this._handleMouseButton(ve.x,ve.y,!1,1<<4)),this._accumulatedWheelDeltaY=0)}},{key:"_fakeMouseMove",value:function(re,ve,ae){this._handleMouseMove(ve,ae),this._cursor.move(re.detail.clientX,re.detail.clientY)}},{key:"_handleTapEvent",value:function(re,ve){var ae=(0,M.clientToElement)(re.detail.clientX,re.detail.clientY,this._canvas);if(this._gestureLastTapTime!==null&&Date.now()-this._gestureLastTapTimeRe;)this._handleMouseButton(ae.x,ae.y,!0,8),this._handleMouseButton(ae.x,ae.y,!1,8),this._gestureLastMagnitudeY+=Re;for(;re.detail.magnitudeY-this._gestureLastMagnitudeY<-Re;)this._handleMouseButton(ae.x,ae.y,!0,16),this._handleMouseButton(ae.x,ae.y,!1,16),this._gestureLastMagnitudeY-=Re;for(;re.detail.magnitudeX-this._gestureLastMagnitudeX>Re;)this._handleMouseButton(ae.x,ae.y,!0,32),this._handleMouseButton(ae.x,ae.y,!1,32),this._gestureLastMagnitudeX+=Re;for(;re.detail.magnitudeX-this._gestureLastMagnitudeX<-Re;)this._handleMouseButton(ae.x,ae.y,!0,64),this._handleMouseButton(ae.x,ae.y,!1,64),this._gestureLastMagnitudeX-=Re;break;case"pinch":if(this._fakeMouseMove(re,ae.x,ae.y),ve=Math.hypot(re.detail.magnitudeX,re.detail.magnitudeY),Math.abs(ve-this._gestureLastMagnitudeX)>Oe){for(this._handleKeyEvent(i.default.XK_Control_L,"ControlLeft",!0);ve-this._gestureLastMagnitudeX>Oe;)this._handleMouseButton(ae.x,ae.y,!0,8),this._handleMouseButton(ae.x,ae.y,!1,8),this._gestureLastMagnitudeX+=Oe;for(;ve-this._gestureLastMagnitudeX<-Oe;)this._handleMouseButton(ae.x,ae.y,!0,16),this._handleMouseButton(ae.x,ae.y,!1,16),this._gestureLastMagnitudeX-=Oe}this._handleKeyEvent(i.default.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(re.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!1,1);break;case"longpress":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!1,4);break}break}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var re=this._sock.rQshiftStr(12).substr(4,7);L.Info("Server ProtocolVersion: "+re);var ve=0;switch(re){case"000.000":ve=1;break;case"003.003":case"003.006":case"003.889":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+re)}if(ve){for(var ae="ID:"+this._repeaterID;ae.length<250;)ae+="\0";return this._sock.sendString(ae),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var De="00"+parseInt(this._rfbVersion,10)+".00"+this._rfbVersion*10%10;this._sock.sendString("RFB "+De+` `),L.Debug("Sent ProtocolVersion: "+De),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function re(De,qe){for(var et=0;et=3.7){var ve=this._sock.rQshift8();if(this._sock.rQwait("security type",ve,1))return!1;if(ve===0)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var ae=this._sock.rQshiftBytes(ve);if(L.Debug("Server security types: "+ae),re(1,ae))this._rfbAuthScheme=1;else if(re(22,ae))this._rfbAuthScheme=22;else if(re(16,ae))this._rfbAuthScheme=16;else if(re(2,ae))this._rfbAuthScheme=2;else if(re(19,ae))this._rfbAuthScheme=19;else return this._fail("Unsupported security types (types: "+ae+")");this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),this._rfbAuthScheme==0)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",L.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var re=this._sock.rQshift32(),ve="";if(re>0){if(this._sock.rQwait("reason",re,4))return!1;ve=this._sock.rQshiftStr(re)}return ve!==""?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:ve}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+ve+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}},{key:"_negotiateXvpAuth",value:function(){if(this._rfbCredentials.username===void 0||this._rfbCredentials.password===void 0||this._rfbCredentials.target===void 0)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;var re=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(re),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(this._rfbVeNCryptState==0){if(this._sock.rQwait("vencrypt version",2))return!1;var re=this._sock.rQshift8(),ve=this._sock.rQshift8();if(!(re==0&&ve==2))return this._fail("Unsupported VeNCrypt version "+re+"."+ve);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(this._rfbVeNCryptState==1){if(this._sock.rQwait("vencrypt ack",1))return!1;var ae=this._sock.rQshift8();if(ae!=0)return this._fail("VeNCrypt failure "+ae);this._rfbVeNCryptState=2}if(this._rfbVeNCryptState==2){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var De=this._sock.rQshift8();if(De<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=De,this._rfbVeNCryptState=3}if(this._rfbVeNCryptState==3){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var qe=[],et=0;et0&&this._sock.rQwait("tunnel capabilities",16*re,4))return!1;if(this._rfbTightVNC=!0,re>0)return this._negotiateTightTunnels(re),!1}if(this._sock.rQwait("sub auth count",4))return!1;var ve=this._sock.rQshift32();if(ve===0)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*ve,4))return!1;for(var ae={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},De=[],qe=0;qe=3.8?(this._rfbInitState="SecurityResult",!0):(this._rfbInitState="ClientInitialisation",this._initMsg());case 22:return this._negotiateXvpAuth();case 2:return this._negotiateStdVNCAuth();case 16:return this._negotiateTightAuth();case 19:return this._negotiateVeNCryptAuth();case 129:return this._negotiateTightUnixAuth();default:return this._fail("Unsupported auth scheme (scheme: "+this._rfbAuthScheme+")")}}},{key:"_handleSecurityResult",value:function(){if(this._sock.rQwait("VNC auth response ",4))return!1;var re=this._sock.rQshift32();return re===0?(this._rfbInitState="ClientInitialisation",L.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=re,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:re}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var re=this._sock.rQshift16(),ve=this._sock.rQshift16(),ae=this._sock.rQshift8(),De=this._sock.rQshift8(),qe=this._sock.rQshift8(),et=this._sock.rQshift8(),je=this._sock.rQshift16(),ct=this._sock.rQshift16(),he=this._sock.rQshift16(),Te=this._sock.rQshift8(),We=this._sock.rQshift8(),xe=this._sock.rQshift8();this._sock.rQskipBytes(3);var ge=this._sock.rQshift32();if(this._sock.rQwait("server init name",ge,24))return!1;var ye=this._sock.rQshiftStr(ge);if(ye=(0,I.decodeUTF8)(ye,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+ge))return!1;var J=this._sock.rQshift16(),ne=this._sock.rQshift16(),q=this._sock.rQshift16();this._sock.rQskipBytes(2);var me=(J+ne+q)*16;if(this._sock.rQwait("TightVNC extended server init header",me,32+ge))return!1;this._sock.rQskipBytes(16*J),this._sock.rQskipBytes(16*ne),this._sock.rQskipBytes(16*q)}return L.Info("Screen: "+re+"x"+ve+", bpp: "+ae+", depth: "+De+", bigEndian: "+qe+", trueColor: "+et+", redMax: "+je+", greenMax: "+ct+", blueMax: "+he+", redShift: "+Te+", greenShift: "+We+", blueShift: "+xe),this._setDesktopName(ye),this._resize(re,ve),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,this._fbName==="Intel(r) AMT KVM"&&(L.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),Pe.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),Pe.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var re=[];re.push(l.encodings.encodingCopyRect),this._fbDepth==24&&(re.push(l.encodings.encodingTight),re.push(l.encodings.encodingTightPNG),re.push(l.encodings.encodingHextile),re.push(l.encodings.encodingRRE)),re.push(l.encodings.encodingRaw),re.push(l.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),re.push(l.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),re.push(l.encodings.pseudoEncodingDesktopSize),re.push(l.encodings.pseudoEncodingLastRect),re.push(l.encodings.pseudoEncodingQEMUExtendedKeyEvent),re.push(l.encodings.pseudoEncodingExtendedDesktopSize),re.push(l.encodings.pseudoEncodingXvp),re.push(l.encodings.pseudoEncodingFence),re.push(l.encodings.pseudoEncodingContinuousUpdates),re.push(l.encodings.pseudoEncodingDesktopName),re.push(l.encodings.pseudoEncodingExtendedClipboard),this._fbDepth==24&&(re.push(l.encodings.pseudoEncodingVMwareCursor),re.push(l.encodings.pseudoEncodingCursor)),Pe.messages.clientEncodings(this._sock,re)}},{key:"_initMsg",value:function(){switch(this._rfbInitState){case"ProtocolVersion":return this._negotiateProtocolVersion();case"Security":return this._negotiateSecurity();case"Authentication":return this._negotiateAuthentication();case"SecurityResult":return this._handleSecurityResult();case"SecurityReason":return this._handleSecurityReason();case"ClientInitialisation":return this._sock.send([this._shared?1:0]),this._rfbInitState="ServerInitialisation",!0;case"ServerInitialisation":return this._negotiateServerInit();default:return this._fail("Unknown init state (state: "+this._rfbInitState+")")}}},{key:"_handleSetColourMapMsg",value:function(){return L.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(L.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var re=this._sock.rQshift32();if(re=(0,V.toSigned32bit)(re),this._sock.rQwait("ServerCutText content",Math.abs(re),8))return!1;if(re>=0){var ve=this._sock.rQshiftStr(re);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ve}}))}else{re=Math.abs(re);var ae=this._sock.rQshift32(),De=ae&65535,qe=ae&4278190080,et=!!(qe&Ge);if(et){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var je=0;je<=15;je++){var ct=1<0&&ye.charAt(ye.length-1)==="\0"&&(ye=ye.slice(0,-1)),ye=ye.replace(`\r `,` `),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ye}}))}}else return this._fail("Unexpected action in extended clipboard message: "+qe)}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var re=this._sock.rQshift32(),ve=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",ve,9))return!1;ve>64&&(L.Warn("Bad payload length ("+ve+") in fence response"),ve=64);var ae=this._sock.rQshiftStr(ve);return this._supportsFence=!0,re&1<<31?(re&=1<<0|1<<1,Pe.messages.clientFence(this._sock,re,ae),!0):this._fail("Unexpected fence response")}},{key:"_handleXvpMsg",value:function(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);var re=this._sock.rQshift8(),ve=this._sock.rQshift8();switch(ve){case 0:L.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=re,L.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+ve+")");break}return!0}},{key:"_normalMsg",value:function(){var re;this._FBU.rects>0?re=0:re=this._sock.rQshift8();var ve,ae;switch(re){case 0:return ae=this._framebufferUpdate(),ae&&!this._enabledContinuousUpdates&&Pe.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),ae;case 1:return this._handleSetColourMapMsg();case 2:return L.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return ve=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,ve&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),L.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+re+")"),L.Debug("sock.rQslice(0, 30): "+this._sock.rQslice(0,30)),!0}}},{key:"_onFlush",value:function(){this._flushing=!1,this._sock.rQlen>0&&this._handleMessage()}},{key:"_framebufferUpdate",value:function(){if(this._FBU.rects===0){if(this._sock.rQwait("FBU header",3,1))return!1;if(this._sock.rQskipBytes(1),this._FBU.rects=this._sock.rQshift16(),this._display.pending())return this._flushing=!0,this._display.flush(),!1}for(;this._FBU.rects>0;){if(this._FBU.encoding===null){if(this._sock.rQwait("rect header",12))return!1;var re=this._sock.rQshiftBytes(12);this._FBU.x=(re[0]<<8)+re[1],this._FBU.y=(re[2]<<8)+re[3],this._FBU.width=(re[4]<<8)+re[5],this._FBU.height=(re[6]<<8)+re[7],this._FBU.encoding=parseInt((re[8]<<24)+(re[9]<<16)+(re[10]<<8)+re[11],10)}if(!this._handleRect())return!1;this._FBU.rects--,this._FBU.encoding=null}return this._display.flip(),!0}},{key:"_handleRect",value:function(){switch(this._FBU.encoding){case l.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case l.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case l.encodings.pseudoEncodingCursor:return this._handleCursor();case l.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{var re=document.createEvent("keyboardEvent");re.code!==void 0&&(this._qemuExtKeyEventSupported=!0)}catch(ve){}return!0;case l.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case l.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case l.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var re=this._FBU.x,ve=this._FBU.y,ae=this._FBU.width,De=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var qe=this._sock.rQshift8();this._sock.rQshift8();var et,je=4;if(qe==0){var ct=4294967040|0;if(et=new Array(ae*De*je),this._sock.rQwait("VMware cursor classic encoding",ae*De*je*2,2))return!1;for(var he=new Array(ae*De),Te=0;Te>8&255,ne=ye>>16&255,q=ye>>24&255;et[ge*je]=J,et[ge*je+1]=ne,et[ge*je+2]=q,et[ge*je+3]=255}else(he[ge]&ct)==ct?We[ge]==0?(et[ge*je]=0,et[ge*je+1]=0,et[ge*je+2]=0,et[ge*je+3]=0):((We[ge]&ct)==ct,et[ge*je]=0,et[ge*je+1]=0,et[ge*je+2]=0,et[ge*je+3]=255):(et[ge*je]=0,et[ge*je+1]=0,et[ge*je+2]=0,et[ge*je+3]=255)}else if(qe==1){if(this._sock.rQwait("VMware cursor alpha encoding",ae*De*4,2))return!1;et=new Array(ae*De*je);for(var me=0;me>24&255,et[me*4+1]=Ce>>16&255,et[me*4+2]=Ce>>8&255,et[me*4+3]=Ce&255}}else return L.Warn("The given cursor type is not supported: "+qe+" given."),!1;return this._updateCursor(et,re,ve,ae,De),!0}},{key:"_handleCursor",value:function(){var re=this._FBU.x,ve=this._FBU.y,ae=this._FBU.width,De=this._FBU.height,qe=ae*De*4,et=Math.ceil(ae/8)*De,je=qe+et;if(this._sock.rQwait("cursor encoding",je))return!1;for(var ct=this._sock.rQshiftBytes(qe),he=this._sock.rQshiftBytes(et),Te=new Uint8Array(ae*De*4),We=0,xe=0;xe9){L.Error("qualityLevel must be an integer between 0 and 9");return}if(this._qualityLevel===re)return;this._qualityLevel=re,this._rfbConnectionState==="connected"&&this._sendEncodings()}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(re){if(!Number.isInteger(re)||re<0||re>9){L.Error("compressionLevel must be an integer between 0 and 9");return}if(this._compressionLevel===re)return;this._compressionLevel=re,this._rfbConnectionState==="connected"&&this._sendEncodings()}}],[{key:"genDES",value:function(re,ve){var ae=re.split("").map(function(De){return De.charCodeAt(0)});return new t.default(ae).encrypt(ve)}}]),Pe}(E.default);fe.default=$e,$e.messages={keyEvent:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen;re[ve]=4,re[ve+1]=ke,re[ve+2]=0,re[ve+3]=0,re[ve+4]=Pe>>24,re[ve+5]=Pe>>16,re[ve+6]=Pe>>8,re[ve+7]=Pe,Ue._sQlen+=8,Ue.flush()},QEMUExtendedKeyEvent:function(Ue,Pe,ke,re){function ve(et){var je=re>>8,ct=re&255;return je===224&&ct<127?ct|128:et}var ae=Ue._sQ,De=Ue._sQlen;ae[De]=255,ae[De+1]=0,ae[De+2]=ke>>8,ae[De+3]=ke,ae[De+4]=Pe>>24,ae[De+5]=Pe>>16,ae[De+6]=Pe>>8,ae[De+7]=Pe;var qe=ve(re);ae[De+8]=qe>>24,ae[De+9]=qe>>16,ae[De+10]=qe>>8,ae[De+11]=qe,Ue._sQlen+=12,Ue.flush()},pointerEvent:function(Ue,Pe,ke,re){var ve=Ue._sQ,ae=Ue._sQlen;ve[ae]=5,ve[ae+1]=re,ve[ae+2]=Pe>>8,ve[ae+3]=Pe,ve[ae+4]=ke>>8,ve[ae+5]=ke,Ue._sQlen+=6,Ue.flush()},_buildExtendedClipboardFlags:function(Ue,Pe){for(var ke=new Uint8Array(4),re=0,ve=0,ae=0;ae>24,ke[1]=0,ke[2]=0,ke[3]=re,ke},extendedClipboardProvide:function(Ue,Pe,ke){for(var re=new h.default,ve=[],ae=0;ae>24&255,De.length>>16&255,De.length>>8&255,De.length&255);for(var qe=0;qe>24,ve[ae+1]=ke[re[De]]>>16,ve[ae+2]=ke[re[De]]>>8,ve[ae+3]=ke[re[De]]>>0,ae+=4,ve[3]|=1<2&&arguments[2]!==void 0?arguments[2]:!1,re=Ue._sQ,ve=Ue._sQlen;re[ve]=6,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0;var ae;ke?ae=(0,V.toUnsigned32bit)(-Pe.length):ae=Pe.length,re[ve+4]=ae>>24,re[ve+5]=ae>>16,re[ve+6]=ae>>8,re[ve+7]=ae,Ue._sQlen+=8;for(var De=0,qe=Pe.length;qe>0;){for(var et=Math.min(qe,Ue._sQbufferSize-Ue._sQlen),je=0;je>8,ae[De+3]=Pe,ae[De+4]=ke>>8,ae[De+5]=ke,ae[De+6]=1,ae[De+7]=0,ae[De+8]=re>>24,ae[De+9]=re>>16,ae[De+10]=re>>8,ae[De+11]=re,ae[De+12]=0,ae[De+13]=0,ae[De+14]=0,ae[De+15]=0,ae[De+16]=Pe>>8,ae[De+17]=Pe,ae[De+18]=ke>>8,ae[De+19]=ke,ae[De+20]=ve>>24,ae[De+21]=ve>>16,ae[De+22]=ve>>8,ae[De+23]=ve,Ue._sQlen+=24,Ue.flush()},clientFence:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen;re[ve]=248,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0,re[ve+4]=Pe>>24,re[ve+5]=Pe>>16,re[ve+6]=Pe>>8,re[ve+7]=Pe;var ae=ke.length;re[ve+8]=ae;for(var De=0;De>8,De[qe+3]=ke,De[qe+4]=re>>8,De[qe+5]=re,De[qe+6]=ve>>8,De[qe+7]=ve,De[qe+8]=ae>>8,De[qe+9]=ae,Ue._sQlen+=10,Ue.flush()},pixelFormat:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen,ae;Pe>16?ae=32:Pe>8?ae=16:ae=8;var De=Math.floor(Pe/3);re[ve]=0,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0,re[ve+4]=ae,re[ve+5]=Pe,re[ve+6]=0,re[ve+7]=ke?1:0,re[ve+8]=0,re[ve+9]=(1<>8,ke[re+3]=Pe.length;for(var ve=re+4,ae=0;ae>24,ke[ve+1]=De>>16,ke[ve+2]=De>>8,ke[ve+3]=De,ve+=4}Ue._sQlen+=ve-re,Ue.flush()},fbUpdateRequest:function(Ue,Pe,ke,re,ve,ae){var De=Ue._sQ,qe=Ue._sQlen;typeof ke=="undefined"&&(ke=0),typeof re=="undefined"&&(re=0),De[qe]=3,De[qe+1]=Pe?1:0,De[qe+2]=ke>>8&255,De[qe+3]=ke&255,De[qe+4]=re>>8&255,De[qe+5]=re&255,De[qe+6]=ve>>8&255,De[qe+7]=ve&255,De[qe+8]=ae>>8&255,De[qe+9]=ae&255,Ue._sQlen+=10,Ue.flush()},xvpOp:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen;re[ve]=250,re[ve+1]=0,re[ve+2]=Pe,re[ve+3]=ke,Ue._sQlen+=4,Ue.flush()}},$e.cursors={none:{rgbaPixels:new Uint8Array,w:0,h:0,hotx:0,hoty:0},dot:{rgbaPixels:new Uint8Array([255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,255,255,255,255]),w:3,h:3,hotx:1,hoty:1}}},"1eCo":function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){"use strict";var L={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};V.defineMode("xml",function(k,M){var f=k.indentUnit,E={},x=M.htmlMode?L:I;for(var g in x)E[g]=x[g];for(var g in M)E[g]=M[g];var h,o;function u(p,D){function O(K){return D.tokenize=K,K(p,D)}var P=p.next();if(P=="<")return p.eat("!")?p.eat("[")?p.match("CDATA[")?O(t("atom","]]>")):null:p.match("--")?O(t("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),O(i(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),D.tokenize=t("meta","?>"),"meta"):(h=p.eat("/")?"closeTag":"openTag",D.tokenize=r,"tag bracket");if(P=="&"){var j;return p.eat("#")?p.eat("x")?j=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):j=p.eatWhile(/[\d]/)&&p.eat(";"):j=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),j?"atom":"error"}else return p.eatWhile(/[^&<]/),null}u.isInText=!0;function r(p,D){var O=p.next();if(O==">"||O=="/"&&p.eat(">"))return D.tokenize=u,h=O==">"?"endTag":"selfcloseTag","tag bracket";if(O=="=")return h="equals",null;if(O=="<"){D.tokenize=u,D.state=d,D.tagName=D.tagStart=null;var P=D.tokenize(p,D);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(O)?(D.tokenize=n(O),D.stringStartCol=p.column(),D.tokenize(p,D)):(p.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function n(p){var D=function(O,P){for(;!O.eol();)if(O.next()==p){P.tokenize=r;break}return"string"};return D.isInAttribute=!0,D}function t(p,D){return function(O,P){for(;!O.eol();){if(O.match(D)){P.tokenize=u;break}O.next()}return p}}function i(p){return function(D,O){for(var P;(P=D.next())!=null;){if(P=="<")return O.tokenize=i(p+1),O.tokenize(D,O);if(P==">")if(p==1){O.tokenize=u;break}else return O.tokenize=i(p-1),O.tokenize(D,O)}return"meta"}}function s(p,D,O){this.prev=p.context,this.tagName=D,this.indent=p.indented,this.startOfLine=O,(E.doNotIndent.hasOwnProperty(D)||p.context&&p.context.noIndent)&&(this.noIndent=!0)}function l(p){p.context&&(p.context=p.context.prev)}function c(p,D){for(var O;;){if(!p.context)return;if(O=p.context.tagName,!E.contextGrabbers.hasOwnProperty(O)||!E.contextGrabbers[O].hasOwnProperty(D))return;l(p)}}function d(p,D,O){return p=="openTag"?(O.tagStart=D.column(),w):p=="closeTag"?m:d}function w(p,D,O){return p=="word"?(O.tagName=D.current(),o="tag",v):E.allowMissingTagName&&p=="endTag"?(o="tag bracket",v(p,D,O)):(o="error",w)}function m(p,D,O){if(p=="word"){var P=D.current();return O.context&&O.context.tagName!=P&&E.implicitlyClosed.hasOwnProperty(O.context.tagName)&&l(O),O.context&&O.context.tagName==P||E.matchClosing===!1?(o="tag",S):(o="tag error",C)}else return E.allowMissingTagName&&p=="endTag"?(o="tag bracket",S(p,D,O)):(o="error",C)}function S(p,D,O){return p!="endTag"?(o="error",S):(l(O),d)}function C(p,D,O){return o="error",S(p,D,O)}function v(p,D,O){if(p=="word")return o="attribute",y;if(p=="endTag"||p=="selfcloseTag"){var P=O.tagName,j=O.tagStart;return O.tagName=O.tagStart=null,p=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(P)?c(O,P):(c(O,P),O.context=new s(O,P,j==O.indented)),d}return o="error",v}function y(p,D,O){return p=="equals"?T:(E.allowMissing||(o="error"),v(p,D,O))}function T(p,D,O){return p=="string"?A:p=="word"&&E.allowUnquoted?(o="string",v):(o="error",v(p,D,O))}function A(p,D,O){return p=="string"?A:v(p,D,O)}return{startState:function(p){var D={tokenize:u,state:d,indented:p||0,tagName:null,tagStart:null,context:null};return p!=null&&(D.baseIndent=p),D},token:function(p,D){if(!D.tagName&&p.sol()&&(D.indented=p.indentation()),p.eatSpace())return null;h=null;var O=D.tokenize(p,D);return(O||h)&&O!="comment"&&(o=null,D.state=D.state(h||O,p,D),o&&(O=o=="error"?O+" error":o)),O},indent:function(p,D,O){var P=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+f;if(P&&P.noIndent)return V.Pass;if(p.tokenize!=r&&p.tokenize!=u)return O?O.match(/^(\s*)/)[0].length:0;if(p.tagName)return E.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+f*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/$/,blockCommentStart:"",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(p){p.state==T&&(p.state=v)},xmlCurrentTag:function(p){return p.tagName?{name:p.tagName,close:p.type=="closeTag"}:null},xmlCurrentContext:function(p){for(var D=[],O=p.context;O;O=O.prev)O.tagName&&D.push(O.tagName);return D.reverse()}}}),V.defineMIME("text/xml","xml"),V.defineMIME("application/xml","xml"),V.mimeModes.hasOwnProperty("text/html")||V.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1q3G":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=V;function V(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},"34/K":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E>0&3)*255/3,w[m*4+1]=(l[c+m]>>2&3)*255/3,w[m*4+2]=(l[c+m]>>4&3)*255/3,w[m*4+4]=0;l=w,c=0}return u.blitImage(E,i,g,s,l,c),o.rQskipBytes(s*t),this._lines-=s,!(this._lines>0)}}]),M}();fe.default=k},"3690":function(at,fe,oe){"use strict";function V(g){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(o){return typeof o}:V=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},V(g)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var g=new WeakMap;return I=function(){return g},g}function k(g){if(g&&g.__esModule)return g;if(g===null||V(g)!=="object"&&typeof g!="function")return{default:g};var h=I();if(h&&h.has(g))return h.get(g);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in g)if(Object.prototype.hasOwnProperty.call(g,r)){var n=u?Object.getOwnPropertyDescriptor(g,r):null;n&&(n.get||n.set)?Object.defineProperty(o,r,n):o[r]=g[r]}return o.default=g,h&&h.set(g,o),o}function M(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function f(g,h){for(var o=0;o0;){var l=1;if(t.rQwait("HEXTILE",l))return!1;var c=t.rQ,d=t.rQi,w=c[d];if(w>30)throw new Error("Illegal hextile subencoding (subencoding: "+w+")");var m=this._totalTiles-this._tiles,S=m%this._tilesX,C=Math.floor(m/this._tilesX),v=o+S*16,y=u+C*16,T=Math.min(16,o+r-v),A=Math.min(16,u+n-y);if(w&1)l+=T*A*4;else if(w&2&&(l+=4),w&4&&(l+=4),w&8){if(l++,t.rQwait("HEXTILE",l))return!1;var p=c[d+l-1];w&16?l+=p*(4+2):l+=p*2}if(t.rQwait("HEXTILE",l))return!1;if(d++,w===0)this._lastsubencoding&1?L.Debug(" Ignoring blank after RAW"):i.fillRect(v,y,T,A,this._background);else if(w&1)i.blitImage(v,y,T,A,c,d),d+=l-1;else{if(w&2&&(this._background=[c[d],c[d+1],c[d+2],c[d+3]],d+=4),w&4&&(this._foreground=[c[d],c[d+1],c[d+2],c[d+3]],d+=4),i.startTile(v,y,T,A,this._background),w&8){var D=c[d];d++;for(var O=0;O>4,U=j&15,X=c[d];d++;var B=(X>>4)+1,N=(X&15)+1;i.subTile(K,U,B,N,P)}}i.finishTile()}t.rQi=d,this._lastsubencoding=w,this._tiles--}return!0}}]),g}();fe.default=x},"5VLF":function(at,fe,oe){"use strict";var V,L;function I(k,M,f){var E=function(x,g){return k.js_beautify(x,g)};return E.js=k.js_beautify,E.css=M.css_beautify,E.html=f.html_beautify,E.js_beautify=k.js_beautify,E.css_beautify=M.css_beautify,E.html_beautify=f.html_beautify,E}!(V=[oe("6UM0"),oe("TXwP"),oe("psGv")],L=function(k,M,f){return I(k,M,f)}.apply(fe,V),L!==void 0&&(at.exports=L))},"6BzB":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.shrinkBuf=V,fe.arraySet=L,fe.flattenChunks=I,fe.Buf32=fe.Buf16=fe.Buf8=void 0;function V(E,x){return E.length===x?E:E.subarray?E.subarray(0,x):(E.length=x,E)}function L(E,x,g,h,o){if(x.subarray&&E.subarray){E.set(x.subarray(g,g+h),o);return}for(var u=0;ute&&(te=N.line_indent_level));var ce={mode:z,parent:N,last_token:N?N.last_token:new r(c.START_BLOCK,""),last_word:N?N.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:te,alignment:0,line_indent_level:N?N.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return ce},X.prototype._reset=function(N){var z=N.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new u(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p.BlockStatement);var te=new i(N,this._options);return this._tokens=te.tokenize(),N},X.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var N,z=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=` `,z&&n.lineBreak.test(z||"")&&(te=z.match(n.lineBreak)[0]));for(var ce=this._tokens.next();ce;)this.handle_token(ce),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ce,ce=this._tokens.next();return N=this._output.get_code(te),N},X.prototype.handle_token=function(N,z){N.type===c.START_EXPR?this.handle_start_expr(N):N.type===c.END_EXPR?this.handle_end_expr(N):N.type===c.START_BLOCK?this.handle_start_block(N):N.type===c.END_BLOCK?this.handle_end_block(N):N.type===c.WORD?this.handle_word(N):N.type===c.RESERVED?this.handle_word(N):N.type===c.SEMICOLON?this.handle_semicolon(N):N.type===c.STRING?this.handle_string(N):N.type===c.EQUALS?this.handle_equals(N):N.type===c.OPERATOR?this.handle_operator(N):N.type===c.COMMA?this.handle_comma(N):N.type===c.BLOCK_COMMENT?this.handle_block_comment(N,z):N.type===c.COMMENT?this.handle_comment(N,z):N.type===c.DOT?this.handle_dot(N):N.type===c.EOF?this.handle_eof(N):N.type===c.UNKNOWN?this.handle_unknown(N,z):this.handle_unknown(N,z)},X.prototype.handle_whitespace_and_comments=function(N,z){var te=N.newlines,ce=this._options.keep_array_indentation&&P(this._flags.mode);if(N.comments_before)for(var be=N.comments_before.next();be;)this.handle_whitespace_and_comments(be,z),this.handle_token(be,z),be=N.comments_before.next();if(ce)for(var Fe=0;Fe0,z);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,z);for(var Oe=1;Oe0&&(!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))},X.prototype.set_mode=function(N){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,N),this._flags=this.create_flags(this._previous_flags,N),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},X.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===p.Statement&&D(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},X.prototype.start_of_object_property=function(){return this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"]))},X.prototype.start_of_statement=function(N){var z=!1;return z=z||C(this._flags.last_token,["var","let","const"])&&N.type===c.WORD,z=z||S(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement)&&C(this._flags.last_token,B)&&!N.newlines,z=z||S(this._flags.last_token,"else")&&!(S(N,"if")&&!N.comments_before),z=z||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===p.ForInitializer||this._previous_flags.mode===p.Conditional),z=z||this._flags.last_token.type===c.WORD&&this._flags.mode===p.BlockStatement&&!this._flags.in_case&&!(N.text==="--"||N.text==="++")&&this._last_last_text!=="function"&&N.type!==c.WORD&&N.type!==c.RESERVED,z=z||this._flags.mode===p.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"])),z?(this.set_mode(p.Statement),this.indent(),this.handle_whitespace_and_comments(N,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N,C(N,["do","for","if","while"])),!0):!1},X.prototype.handle_start_expr=function(N){this.start_of_statement(N)||this.handle_whitespace_and_comments(N);var z=p.Expression;if(N.text==="["){if(this._flags.last_token.type===c.WORD||this._flags.last_token.text===")"){C(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(N),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=p.ArrayLiteral,P(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())),d(this._flags.last_token.type,[c.START_EXPR,c.END_EXPR,c.WORD,c.OPERATOR,c.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===c.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=p.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=p.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&N.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N);else if(this._flags.last_token.type===c.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var ce=this._tokens.peek(-4);C(te,["async","function"])||te.text==="*"&&C(ce,["async","function"])?this._output.space_before_token=!0:this._flags.mode===p.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(ce.text==="{"||ce.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(N);(this._flags.last_token.type===c.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&d(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===c.START_BLOCK?this.print_newline():(this._flags.last_token.type===c.END_EXPR||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===c.COMMA)&&this.allow_wrap_or_preserved_newline(N,N.newlines),this.print_token(N),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},X.prototype.handle_end_expr=function(N){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(N),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(N,N.text==="]"&&P(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===c.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(N),this.restore_mode(),D(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===p.Conditional&&(this._previous_flags.mode=p.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},X.prototype.handle_start_block=function(N){this.handle_whitespace_and_comments(N);var z=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===c.END_EXPR?(this.set_mode(p.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p.BlockStatement):te&&(d(te.text,[":",","])&&d(z.type,[c.STRING,c.WORD,c.RESERVED])||d(z.text,["get","set","..."])&&d(te.type,[c.WORD,c.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(te.text,[":",","])?this.set_mode(p.BlockStatement):this.set_mode(p.ObjectLiteral):this._flags.last_token.type===c.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(p.BlockStatement):d(this._flags.last_token.type,[c.EQUALS,c.START_EXPR,c.COMMA,c.OPERATOR])||C(this._flags.last_token,["return","throw","import","default"])?this.set_mode(p.ObjectLiteral):this.set_mode(p.BlockStatement),this._flags.last_token&&(C(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ce=!z.comments_before&&z.text==="}",be=ce&&this._flags.last_word==="function"&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var Fe=0,Oe=null;this._flags.inline_frame=!0;do if(Fe+=1,Oe=this._tokens.peek(Fe-1),Oe.newlines){this._flags.inline_frame=!1;break}while(Oe.type!==c.EOF&&!(Oe.type===c.END_BLOCK&&Oe.opened===N))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&N.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==c.OPERATOR&&(be||this._flags.last_token.type===c.EQUALS||C(this._flags.last_token,v)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(P(this._previous_flags.mode)&&(this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.COMMA)&&((this._flags.last_token.type===c.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(N),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==c.OPERATOR&&this._flags.last_token.type!==c.START_EXPR&&(this._flags.last_token.type===c.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(N),this.indent(),!ce&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},X.prototype.handle_end_block=function(N){for(this.handle_whitespace_and_comments(N);this._flags.mode===p.Statement;)this.restore_mode();var z=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(P(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(N)},X.prototype.handle_word=function(N){if(N.type===c.RESERVED){if(d(N.text,["set","get"])&&this._flags.mode!==p.ObjectLiteral)N.type=c.WORD;else if(N.text==="import"&&d(this._tokens.peek().text,["(","."]))N.type=c.WORD;else if(d(N.text,["as","from"])&&!this._flags.import_block)N.type=c.WORD;else if(this._flags.mode===p.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(N.type=c.WORD)}}if(this.start_of_statement(N)?C(this._flags.last_token,["var","let","const"])&&N.type===c.WORD&&(this._flags.declaration_statement=!0):N.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==c.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==c.EQUALS&&(this._options.preserve_newlines||!C(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(N),this.print_newline()):this.handle_whitespace_and_comments(N),this._flags.do_block&&!this._flags.do_while)if(S(N,"while")){this._output.space_before_token=!0,this.print_token(N),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&&S(N,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===p.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&C(N,["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(N),this._flags.in_case=!0;return}if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N)),S(N,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===c.OPERATOR))&&(!this._output.just_added_blankline()&&!N.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD?C(this._flags.last_token,["get","set","new","export"])||C(this._flags.last_token,B)?this._output.space_before_token=!0:S(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===c.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||P(this._flags.mode))||this.print_newline(),this.print_token(N),this._flags.last_word=N.text;return}var te="NONE";if(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":C(N,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&N.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===p.BlockStatement?te="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&j(this._flags.mode)?te="SPACE":this._flags.last_token.type===c.STRING?te="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&d(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===c.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),C(N,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),C(N,["else","catch","finally"]))if((!(this._flags.last_token.type===c.END_BLOCK&&this._previous_flags.mode===p.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&N.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ce=this._output.current_line;ce.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?C(this._flags.last_token,v)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&C(N,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==c.END_EXPR?(this._flags.last_token.type!==c.START_EXPR||!C(N,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(N,"if")&&S(N.previous,"else")?this._output.space_before_token=!0:this.print_newline()):C(N,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&P(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);N.previous&&(N.previous.type===c.WORD||N.previous.type===c.RESERVED)&&(this._output.space_before_token=!0),this.print_token(N),this._flags.last_word=N.text,N.type===c.RESERVED&&(N.text==="do"?this._flags.do_block=!0:N.text==="if"?this._flags.if_block=!0:N.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(N,"from")&&(this._flags.import_block=!1))},X.prototype.handle_semicolon=function(N){this.start_of_statement(N)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(N);for(var z=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&S(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(N)},X.prototype.handle_string=function(N){N.text.startsWith("`")&&N.newlines===0&&N.whitespace_before===""&&(N.previous.text===")"||this._flags.last_token.type===c.WORD)||(this.start_of_statement(N)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(N),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N):N.text.startsWith("`")&&this._flags.last_token.type===c.END_EXPR&&(N.previous.text==="]"||N.previous.text===")")&&N.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(N)},X.prototype.handle_equals=function(N){this.start_of_statement(N)||this.handle_whitespace_and_comments(N),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(N),this._output.space_before_token=!0},X.prototype.handle_comma=function(N){this.handle_whitespace_and_comments(N,!0),this.print_token(N),this._output.space_before_token=!0,this._flags.declaration_statement?(j(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(N)):this._flags.mode===p.ObjectLiteral||this._flags.mode===p.Statement&&this._flags.parent.mode===p.ObjectLiteral?(this._flags.mode===p.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(N)},X.prototype.handle_operator=function(N){var z=N.text==="*"&&(C(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),te=d(N.text,["-","+"])&&(d(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||d(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(N)){var ce=!z;this.handle_whitespace_and_comments(N,ce)}if(N.text==="*"&&this._flags.last_token.type===c.DOT){this.print_token(N);return}if(N.text==="::"){this.print_token(N);return}if(this._flags.last_token.type===c.OPERATOR&&d(this._options.operator_position,A)&&this.allow_wrap_or_preserved_newline(N),N.text===":"&&this._flags.in_case){this.print_token(N),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==c.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var be=!0,Fe=!0,Oe=!1;if(N.text===":"?this._flags.ternary_depth===0?be=!1:(this._flags.ternary_depth-=1,Oe=!0):N.text==="?"&&(this._flags.ternary_depth+=1),!te&&!z&&this._options.preserve_newlines&&d(N.text,l)){var Re=N.text===":",Be=Re&&Oe,Ke=Re&&!Oe;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!Ke,this.print_token(N),(!Re||Be)&&this.allow_wrap_or_preserved_newline(N),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!Re||Be?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(N):this._output.space_before_token=!1,this.print_token(N),this._output.space_before_token=!0;return;case T.preserve_newline:Ke||this.allow_wrap_or_preserved_newline(N),be=!(this._output.just_added_newline()||Ke),this._output.space_before_token=be,this.print_token(N),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(N),be=!1;var Ae=this._tokens.peek();Fe=Ae&&d(Ae.type,[c.WORD,c.RESERVED])}else if(N.text==="...")this.allow_wrap_or_preserved_newline(N),be=this._flags.last_token.type===c.START_BLOCK,Fe=!1;else if(d(N.text,["--","++","!","~"])||te){if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR)&&this.allow_wrap_or_preserved_newline(N),be=!1,Fe=!1,N.newlines&&(N.text==="--"||N.text==="++"||N.text==="~")){var _e=C(this._flags.last_token,v)&&N.newlines;_e&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(_e,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(be=!0),this._flags.last_token.type===c.RESERVED?be=!0:this._flags.last_token.type===c.END_EXPR?be=!(this._flags.last_token.text==="]"&&(N.text==="--"||N.text==="++")):this._flags.last_token.type===c.OPERATOR&&(be=d(N.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(N.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(Fe=!0)),(this._flags.mode===p.BlockStatement&&!this._flags.inline_frame||this._flags.mode===p.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||be,this.print_token(N),this._output.space_before_token=Fe},X.prototype.handle_block_comment=function(N,z){if(this._output.raw){this._output.add_raw_token(N),N.directives&&N.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(N.directives){this.print_newline(!1,z),this.print_token(N),N.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(N.text)&&!N.newlines){this._output.space_before_token=!0,this.print_token(N),this._output.space_before_token=!0;return}else this.print_block_commment(N,z)},X.prototype.print_block_commment=function(N,z){var te=O(N.text),ce,be=!1,Fe=!1,Oe=N.whitespace_before,Re=Oe.length;if(this.print_newline(!1,z),this.print_token_line_indentation(N),this._output.add_token(te[0]),this.print_newline(!1,z),te.length>1){for(te=te.slice(1),be=K(te,"*"),Fe=U(te,Oe),be&&(this._flags.alignment=1),ce=0;ce=0;n--)if(this.__items[n].match(r))return!0;return!1},h.prototype.set_indent=function(r,n){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.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)},h.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},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(r){this.__items.push(r);var n=r.lastIndexOf(` `);n!==-1?this.__character_count=r.length-n:this.__character_count+=r.length},h.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function o(r,n){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),n=n||"",r.indent_level>0&&(n=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}o.prototype.get_indent_size=function(r,n){var t=this.__base_string_length;return n=n||0,r<0&&(t=0),t+=r*this.__indent_size,t+=n,t},o.prototype.get_indent_string=function(r,n){var t=this.__base_string;return n=n||0,r<0&&(r=0,t=""),n+=r*this.__indent_size,this.__ensure_cache(n),t+=this.__cache[n],t},o.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var r=this.__cache.length,n=0,t="";this.__indent_size&&r>=this.__indent_size&&(n=Math.floor(r/this.__indent_size),r-=n*this.__indent_size,t=new Array(n+1).join(this.__indent_string)),r&&(t+=new Array(r+1).join(" ")),this.__cache.push(t)};function u(r,n){this.__indent_cache=new o(r,n),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(r,n){return this.__indent_cache.get_indent_string(r,n)},u.prototype.get_indent_size=function(r,n){return this.__indent_cache.get_indent_size(r,n)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(r){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===` `&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(` `);return r!==` `&&(t=t.replace(/[\n]/g,r)),t},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(r,n){return r=r||0,n=n||0,this.next_line.set_indent(r,n),this.__lines.length>1?(this.current_line.set_indent(r,n),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(r){for(var n=0;n1&&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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(r,n){for(var t=this.__lines.length-2;t>=0;){var i=this.__lines[t];if(i.is_empty())break;if(i.item(0).indexOf(r)!==0&&i.item(-1)!==n){this.__lines.splice(t+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},g.exports.Output=u},function(g){function h(o,u,r,n){this.type=o,this.text=u,this.comments_before=null,this.newlines=r||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=h},function(g,h){var o="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\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",n="\\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",t="(?:\\\\u[0-9a-fA-F]{4}|["+o+r+"])",i="(?:\\\\u[0-9a-fA-F]{4}|["+u+r+n+"])*";h.identifier=new RegExp(t+i,"g"),h.identifierStart=new RegExp(t),h.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+u+r+n+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;h.newline=/[\n\r\u2028\u2029]/,h.lineBreak=new RegExp(`\r |`+h.newline.source),h.allLineBreaks=new RegExp(h.lineBreak.source,"g")},function(g,h,o){var u=o(6).Options,r=["before-newline","after-newline","preserve-newline"];function n(t){u.call(this,t,"js");var i=this.raw_options.brace_style||null;i==="expand-strict"?this.raw_options.brace_style="expand":i==="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 s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var l=0;l>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var T=new RegExp(y),A="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),p=A.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),D=new RegExp("^(?:"+p.join("|")+")$"),O,P=function(K,U){r.call(this,K,U),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var X=new s(this._input),B=new l(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(i.identifier).matching(i.identifierMatch),number:X.matching(m),punct:X.matching(T),comment:X.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:X.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:X.matching(//),include:X.starting_with(/#include/).until_after(i.lineBreak),shebang:X.starting_with(/#!/).until_after(i.lineBreak),xml:X.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:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};P.prototype=new r,P.prototype._is_comment=function(K){return K.type===d.COMMENT||K.type===d.BLOCK_COMMENT||K.type===d.UNKNOWN},P.prototype._is_opening=function(K){return K.type===d.START_BLOCK||K.type===d.START_EXPR},P.prototype._is_closing=function(K,U){return(K.type===d.END_BLOCK||K.type===d.END_EXPR)&&U&&(K.text==="]"&&U.text==="["||K.text===")"&&U.text==="("||K.text==="}"&&U.text==="{")},P.prototype._reset=function(){O=!1},P.prototype._get_next_token=function(K,U){var X=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(d.EOF,""):(X=X||this._read_non_javascript(B),X=X||this._read_string(B),X=X||this._read_word(K),X=X||this._read_singles(B),X=X||this._read_comment(B),X=X||this._read_regexp(B,K),X=X||this._read_xml(B,K),X=X||this._read_punctuation(),X=X||this._create_token(d.UNKNOWN,this._input.next()),X)},P.prototype._read_word=function(K){var U;if(U=this.__patterns.identifier.read(),U!=="")return U=U.replace(i.allLineBreaks,` `),!(K.type===d.DOT||K.type===d.RESERVED&&(K.text==="set"||K.text==="get"))&&D.test(U)?(U==="in"||U==="of")&&(K.type===d.WORD||K.type===d.STRING)?this._create_token(d.OPERATOR,U):this._create_token(d.RESERVED,U):this._create_token(d.WORD,U);if(U=this.__patterns.number.read(),U!=="")return this._create_token(d.WORD,U)},P.prototype._read_singles=function(K){var U=null;return K==="("||K==="["?U=this._create_token(d.START_EXPR,K):K===")"||K==="]"?U=this._create_token(d.END_EXPR,K):K==="{"?U=this._create_token(d.START_BLOCK,K):K==="}"?U=this._create_token(d.END_BLOCK,K):K===";"?U=this._create_token(d.SEMICOLON,K):K==="."&&C.test(this._input.peek(1))?U=this._create_token(d.DOT,K):K===","&&(U=this._create_token(d.COMMA,K)),U&&this._input.next(),U},P.prototype._read_punctuation=function(){var K=this.__patterns.punct.read();if(K!=="")return K==="="?this._create_token(d.EQUALS,K):K==="?."?this._create_token(d.DOT,K):this._create_token(d.OPERATOR,K)},P.prototype._read_non_javascript=function(K){var U="";if(K==="#"){if(this._is_first_token()&&(U=this.__patterns.shebang.read(),U))return this._create_token(d.UNKNOWN,U.trim()+` `);if(U=this.__patterns.include.read(),U)return this._create_token(d.UNKNOWN,U.trim()+` `);K=this._input.next();var X="#";if(this._input.hasNext()&&this._input.testChar(S)){do K=this._input.next(),X+=K;while(this._input.hasNext()&&K!=="#"&&K!=="=");return K==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(X+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(X+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,X)}this._input.back()}else if(K==="<"&&this._is_first_token()){if(U=this.__patterns.html_comment_start.read(),U){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)U+=this._input.next();return O=!0,this._create_token(d.COMMENT,U)}}else if(O&&K==="-"&&(U=this.__patterns.html_comment_end.read(),U))return O=!1,this._create_token(d.COMMENT,U);return null},P.prototype._read_comment=function(K){var U=null;if(K==="/"){var X="";if(this._input.peek(1)==="*"){X=this.__patterns.block_comment.read();var B=w.get_directives(X);B&&B.ignore==="start"&&(X+=w.readIgnored(this._input)),X=X.replace(i.allLineBreaks,` `),U=this._create_token(d.BLOCK_COMMENT,X),U.directives=B}else this._input.peek(1)==="/"&&(X=this.__patterns.comment.read(),U=this._create_token(d.COMMENT,X))}return U},P.prototype._read_string=function(K){if(K==="`"||K==="'"||K==='"'){var U=this._input.next();return this.has_char_escapes=!1,K==="`"?U+=this._read_string_recursive("`",!0,"${"):U+=this._read_string_recursive(K),this.has_char_escapes&&this._options.unescape_strings&&(U=j(U)),this._input.peek()===K&&(U+=this._input.next()),U=U.replace(i.allLineBreaks,` `),this._create_token(d.STRING,U)}return null},P.prototype._allow_regexp_or_xml=function(K){return K.type===d.RESERVED&&c(K.text,["return","case","throw","else","do","typeof","yield"])||K.type===d.END_EXPR&&K.text===")"&&K.opened.previous.type===d.RESERVED&&c(K.opened.previous.text,["if","while","for"])||c(K.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},P.prototype._read_regexp=function(K,U){if(K==="/"&&this._allow_regexp_or_xml(U)){for(var X=this._input.next(),B=!1,N=!1;this._input.hasNext()&&(B||N||this._input.peek()!==K)&&!this._input.testChar(i.newline);)X+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?N=!0:this._input.peek()==="]"&&(N=!1)),this._input.next();return this._input.peek()===K&&(X+=this._input.next(),X+=this._input.read(i.identifier)),this._create_token(d.STRING,X)}return null},P.prototype._read_xml=function(K,U){if(this._options.e4x&&K==="<"&&this._allow_regexp_or_xml(U)){var X="",B=this.__patterns.xml.read_match();if(B){for(var N=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=N.indexOf("{")===0,te=0;B;){var ce=!!B[1],be=B[2],Fe=!!B[B.length-1]||be.slice(0,8)==="![CDATA[";if(!Fe&&(be===N||z&&be.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ce?--te:++te),X+=B[0],te<=0)break;B=this.__patterns.xml.read_match()}return B||(X+=this._input.match(/[\s\S]*/g)[0]),X=X.replace(i.allLineBreaks,` `),this._create_token(d.STRING,X)}}return null};function j(K){for(var U="",X=0,B=new u(K),N=null;B.hasNext();)if(N=B.match(/([\s]|[^\\]|\\\\)+/g),N&&(U+=N[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")N=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")N=B.match(/u([0-9A-Fa-f]{4})/g);else{U+="\\",B.hasNext()&&(U+=B.next());continue}if(!N)return K;if(X=parseInt(N[1],16),X>126&&X<=255&&N[0].indexOf("x")===0)return K;if(X>=0&&X<32){U+="\\"+N[0];continue}else X===34||X===39||X===92?U+="\\"+String.fromCharCode(X):U+=String.fromCharCode(X)}return U}P.prototype._read_string_recursive=function(K,U,X){var B,N;K==="'"?N=this.__patterns.single_quote:K==='"'?N=this.__patterns.double_quote:K==="`"?N=this.__patterns.template_text:K==="}"&&(N=this.__patterns.template_expression);for(var z=N.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===K||!U&&i.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===` `&&this._input.next(),te+=this._input.next()):X&&(X==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),X===te&&(K==="`"?te+=this._read_string_recursive("}",U,"`"):te+=this._read_string_recursive("`",U,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=N.read(),z+=te}return z},g.exports.Tokenizer=P,g.exports.TOKEN=d,g.exports.positionable_operators=v.slice(),g.exports.line_starters=A.slice()},function(g){var h=RegExp.prototype.hasOwnProperty("sticky");function o(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position=0&&u=0&&r=u.length&&this.__input.substring(r-u.length,r).toLowerCase()===u},g.exports.InputScanner=o},function(g,h,o){var u=o(8).InputScanner,r=o(3).Token,n=o(10).TokenStream,t=o(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(l,c){this._input=new u(l),this._options=c||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new t(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new n,this._reset();for(var l,c=new r(i.START,""),d=null,w=[],m=new n;c.type!==i.EOF;){for(l=this._get_next_token(c,d);this._is_comment(l);)m.add(l),l=this._get_next_token(c,d);m.isEmpty()||(l.comments_before=m,m=new n),l.parent=d,this._is_opening(l)?(w.push(d),d=l):d&&this._is_closing(l,d)&&(l.opened=d,d.closed=l,d=w.pop(),l.parent=d),l.previous=c,c.next=l,this.__tokens.add(l),c=l}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(l,c){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(i.RAW,d):this._create_token(i.EOF,"")},s.prototype._is_comment=function(l){return!1},s.prototype._is_opening=function(l){return!1},s.prototype._is_closing=function(l,c){return!1},s.prototype._create_token=function(l,c){var d=new r(l,c,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=s,g.exports.TOKEN=i},function(g){function h(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position=0&&o/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}n.prototype=new u,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(t){var i=this._create();return i._disabled[t]=!0,i._update(),i},n.prototype.read_options=function(t){var i=this._create();for(var s in r)i._disabled[s]=t.templating.indexOf(s)===-1;return i._update(),i},n.prototype.exclude=function(t){var i=this._create();return i._excluded[t]=!0,i._update(),i},n.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),t+=i,i=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},n.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},n.prototype._read_template=function(){var t="",i=this._input.peek();if(i==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(t=t||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},g.exports.TemplatablePattern=n}],f={};function E(g){var h=f[g];if(h!==void 0)return h.exports;var o=f[g]={exports:{}};return M[g](o,o.exports,E),o.exports}var x=E(0);I=x})();var k=I;!(V=[],L=function(){return{js_beautify:k}}.apply(fe,V),L!==void 0&&(at.exports=L))})()},"7Cbv":function(at,fe,oe){"use strict";var V=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),L=new Uint8Array(16);function I(){if(!V)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return V(L)}var k=/^(?:[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 M(r){return typeof r=="string"&&k.test(r)}for(var f=M,E=[],x=0;x<256;++x)E.push((x+256).toString(16).substr(1));function g(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(E[r[n+0]]+E[r[n+1]]+E[r[n+2]]+E[r[n+3]]+"-"+E[r[n+4]]+E[r[n+5]]+"-"+E[r[n+6]]+E[r[n+7]]+"-"+E[r[n+8]]+E[r[n+9]]+"-"+E[r[n+10]]+E[r[n+11]]+E[r[n+12]]+E[r[n+13]]+E[r[n+14]]+E[r[n+15]]).toLowerCase();if(!f(t))throw TypeError("Stringified UUID is invalid");return t}var h=g;function o(r,n,t){r=r||{};var i=r.random||(r.rng||I)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,n){t=t||0;for(var s=0;s<16;++s)n[t+s]=i[s];return n}return h(i)}var u=fe.a=o},"7ahc":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return w});var V=oe("k1fw"),L=oe("0Owb"),I=oe("+L6B"),k=oe("2/Rp"),M=oe("y8nQ"),f=oe("Vl3Y"),E=oe("tJVT"),x=oe("OaEy"),g=oe("2fM7"),h=oe("q1tI"),o=oe.n(h),u=oe("VrN/"),r=oe.n(u),n=oe("p77/"),t=oe.n(n),i=oe("c5Ni"),s=oe.n(i),l=g.a.Option,c={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};fe.b=function(m){var S=m.callback,C=m.onCancel,v=Object(h.useState)("python"),y=Object(E.a)(v,2),T=y[0],A=y[1];function p(O){A(d[O][1])}function D(O){S(O)}return o.a.createElement(f.a,Object(L.a)({},c,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:D}),o.a.createElement(f.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},o.a.createElement(g.a,{onChange:p},Object.keys(d).map(function(O){return o.a.createElement(l,{key:O,value:O},d[O][0])}))),o.a.createElement(f.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},o.a.createElement(w,{mode:T})),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(k.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(k.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function w(m){var S=m.value,C=m.onChange,v=m.mode,y=m.options,T=y===void 0?{}:y,A=Object(h.useRef)(),p=Object(h.useState)(),D=Object(E.a)(p,2),O=D[0],P=D[1];return Object(h.useEffect)(function(){if(O){function j(K){var U=K.getValue();C&&C(U)}return O.on("change",j),function(){O.off("change",j)}}},[O,C]),Object(h.useEffect)(function(){O&&O.setOption("mode",v)},[O,v]),Object(h.useEffect)(function(){O&&((S!==O.getValue()||S==="")&&setTimeout(function(){O.setValue(S||" ")},300))},[O,S]),Object(h.useEffect)(function(){if(A.current&&!O){var j=r.a.fromTextArea(A.current,Object(V.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));P(j)}},[A.current,O]),o.a.createElement("div",{className:"my-codemirror-container"},o.a.createElement("textarea",{ref:A}))}},"7ixt":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return I});var V={adjustX:1,adjustY:1},L=[0,0],I={left:{points:["cr","cl"],overflow:V,offset:[-4,0],targetOffset:L},right:{points:["cl","cr"],overflow:V,offset:[4,0],targetOffset:L},top:{points:["bc","tc"],overflow:V,offset:[0,-4],targetOffset:L},bottom:{points:["tc","bc"],overflow:V,offset:[0,4],targetOffset:L},topLeft:{points:["bl","tl"],overflow:V,offset:[0,-4],targetOffset:L},leftTop:{points:["tr","tl"],overflow:V,offset:[-4,0],targetOffset:L},topRight:{points:["br","tr"],overflow:V,offset:[0,-4],targetOffset:L},rightTop:{points:["tl","tr"],overflow:V,offset:[4,0],targetOffset:L},bottomRight:{points:["tr","br"],overflow:V,offset:[0,4],targetOffset:L},rightBottom:{points:["bl","br"],overflow:V,offset:[4,0],targetOffset:L},bottomLeft:{points:["tl","bl"],overflow:V,offset:[0,4],targetOffset:L},leftBottom:{points:["br","bl"],overflow:V,offset:[-4,0],targetOffset:L}},k=I},"8+yF":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={256:960,257:992,258:451,259:483,260:417,261:433,262:454,263:486,264:710,265:742,266:709,267:741,268:456,269:488,270:463,271:495,272:464,273:496,274:938,275:954,278:972,279:1004,280:458,281:490,282:460,283:492,284:728,285:760,286:683,287:699,288:725,289:757,290:939,291:955,292:678,293:694,294:673,295:689,296:933,297:949,298:975,299:1007,302:967,303:999,304:681,305:697,308:684,309:700,310:979,311:1011,312:930,313:453,314:485,315:934,316:950,317:421,318:437,321:419,322:435,323:465,324:497,325:977,326:1009,327:466,328:498,330:957,331:959,332:978,333:1010,336:469,337:501,338:5052,339:5053,340:448,341:480,342:931,343:947,344:472,345:504,346:422,347:438,348:734,349:766,350:426,351:442,352:425,353:441,354:478,355:510,356:427,357:443,358:940,359:956,360:989,361:1021,362:990,363:1022,364:733,365:765,366:473,367:505,368:475,369:507,370:985,371:1017,376:5054,377:428,378:444,379:431,380:447,381:430,382:446,402:2294,466:16777681,711:439,728:418,729:511,731:434,733:445,901:1966,902:1953,904:1954,905:1955,906:1956,908:1959,910:1960,911:1963,912:1974,913:1985,914:1986,915:1987,916:1988,917:1989,918:1990,919:1991,920:1992,921:1993,922:1994,923:1995,924:1996,925:1997,926:1998,927:1999,928:2e3,929:2001,931:2002,932:2004,933:2005,934:2006,935:2007,936:2008,937:2009,938:1957,939:1961,940:1969,941:1970,942:1971,943:1972,944:1978,945:2017,946:2018,947:2019,948:2020,949:2021,950:2022,951:2023,952:2024,953:2025,954:2026,955:2027,956:2028,957:2029,958:2030,959:2031,960:2032,961:2033,962:2035,963:2034,964:2036,965:2037,966:2038,967:2039,968:2040,969:2041,970:1973,971:1977,972:1975,973:1976,974:1979,1025:1715,1026:1713,1027:1714,1028:1716,1029:1717,1030:1718,1031:1719,1032:1720,1033:1721,1034:1722,1035:1723,1036:1724,1038:1726,1039:1727,1040:1761,1041:1762,1042:1783,1043:1767,1044:1764,1045:1765,1046:1782,1047:1786,1048:1769,1049:1770,1050:1771,1051:1772,1052:1773,1053:1774,1054:1775,1055:1776,1056:1778,1057:1779,1058:1780,1059:1781,1060:1766,1061:1768,1062:1763,1063:1790,1064:1787,1065:1789,1066:1791,1067:1785,1068:1784,1069:1788,1070:1760,1071:1777,1072:1729,1073:1730,1074:1751,1075:1735,1076:1732,1077:1733,1078:1750,1079:1754,1080:1737,1081:1738,1082:1739,1083:1740,1084:1741,1085:1742,1086:1743,1087:1744,1088:1746,1089:1747,1090:1748,1091:1749,1092:1734,1093:1736,1094:1731,1095:1758,1096:1755,1097:1757,1098:1759,1099:1753,1100:1752,1101:1756,1102:1728,1103:1745,1105:1699,1106:1697,1107:1698,1108:1700,1109:1701,1110:1702,1111:1703,1112:1704,1113:1705,1114:1706,1115:1707,1116:1708,1118:1710,1119:1711,1168:1725,1169:1709,1488:3296,1489:3297,1490:3298,1491:3299,1492:3300,1493:3301,1494:3302,1495:3303,1496:3304,1497:3305,1498:3306,1499:3307,1500:3308,1501:3309,1502:3310,1503:3311,1504:3312,1505:3313,1506:3314,1507:3315,1508:3316,1509:3317,1510:3318,1511:3319,1512:3320,1513:3321,1514:3322,1548:1452,1563:1467,1567:1471,1569:1473,1570:1474,1571:1475,1572:1476,1573:1477,1574:1478,1575:1479,1576:1480,1577:1481,1578:1482,1579:1483,1580:1484,1581:1485,1582:1486,1583:1487,1584:1488,1585:1489,1586:1490,1587:1491,1588:1492,1589:1493,1590:1494,1591:1495,1592:1496,1593:1497,1594:1498,1600:1504,1601:1505,1602:1506,1603:1507,1604:1508,1605:1509,1606:1510,1607:1511,1608:1512,1609:1513,1610:1514,1611:1515,1612:1516,1613:1517,1614:1518,1615:1519,1616:1520,1617:1521,1618:1522,3585:3489,3586:3490,3587:3491,3588:3492,3589:3493,3590:3494,3591:3495,3592:3496,3593:3497,3594:3498,3595:3499,3596:3500,3597:3501,3598:3502,3599:3503,3600:3504,3601:3505,3602:3506,3603:3507,3604:3508,3605:3509,3606:3510,3607:3511,3608:3512,3609:3513,3610:3514,3611:3515,3612:3516,3613:3517,3614:3518,3615:3519,3616:3520,3617:3521,3618:3522,3619:3523,3620:3524,3621:3525,3622:3526,3623:3527,3624:3528,3625:3529,3626:3530,3627:3531,3628:3532,3629:3533,3630:3534,3631:3535,3632:3536,3633:3537,3634:3538,3635:3539,3636:3540,3637:3541,3638:3542,3639:3543,3640:3544,3641:3545,3642:3546,3647:3551,3648:3552,3649:3553,3650:3554,3651:3555,3652:3556,3653:3557,3654:3558,3655:3559,3656:3560,3657:3561,3658:3562,3659:3563,3660:3564,3661:3565,3664:3568,3665:3569,3666:3570,3667:3571,3668:3572,3669:3573,3670:3574,3671:3575,3672:3576,3673:3577,8194:2722,8195:2721,8196:2723,8197:2724,8199:2725,8200:2726,8201:2727,8202:2728,8210:2747,8211:2730,8212:2729,8213:1967,8215:3295,8216:2768,8217:2769,8218:2813,8220:2770,8221:2771,8222:2814,8224:2801,8225:2802,8226:2790,8229:2735,8230:2734,8240:2773,8242:2774,8243:2775,8248:2812,8254:1150,8361:3839,8364:8364,8453:2744,8470:1712,8471:2811,8478:2772,8482:2761,8531:2736,8532:2737,8533:2738,8534:2739,8535:2740,8536:2741,8537:2742,8538:2743,8539:2755,8540:2756,8541:2757,8542:2758,8592:2299,8593:2300,8594:2301,8595:2302,8658:2254,8660:2253,8706:2287,8711:2245,8728:3018,8730:2262,8733:2241,8734:2242,8743:2270,8744:2271,8745:2268,8746:2269,8747:2239,8756:2240,8764:2248,8771:2249,8773:16785992,8800:2237,8801:2255,8804:2236,8805:2238,8834:2266,8835:2267,8866:3068,8867:3036,8868:3010,8869:3022,8968:3027,8970:3012,8981:2810,8992:2212,8993:2213,9109:3020,9115:2219,9117:2220,9118:2221,9120:2222,9121:2215,9123:2216,9124:2217,9126:2218,9128:2223,9132:2224,9143:2209,9146:2543,9147:2544,9148:2546,9149:2547,9225:2530,9226:2533,9227:2537,9228:2531,9229:2532,9251:2732,9252:2536,9472:2211,9474:2214,9484:2210,9488:2539,9492:2541,9496:2538,9500:2548,9508:2549,9516:2551,9524:2550,9532:2542,9618:2529,9642:2791,9643:2785,9644:2779,9645:2786,9646:2783,9647:2767,9650:2792,9651:2787,9654:2781,9655:2765,9660:2793,9661:2788,9664:2780,9665:2764,9670:2528,9675:2766,9679:2782,9702:2784,9734:2789,9742:2809,9747:2762,9756:2794,9758:2795,9792:2808,9794:2807,9827:2796,9829:2798,9830:2797,9837:2806,9839:2805,10003:2803,10007:2804,10013:2777,10016:2800,10216:2748,10217:2750,12289:1188,12290:1185,12300:1186,12301:1187,12443:1246,12444:1247,12449:1191,12450:1201,12451:1192,12452:1202,12453:1193,12454:1203,12455:1194,12456:1204,12457:1195,12458:1205,12459:1206,12461:1207,12463:1208,12465:1209,12467:1210,12469:1211,12471:1212,12473:1213,12475:1214,12477:1215,12479:1216,12481:1217,12483:1199,12484:1218,12486:1219,12488:1220,12490:1221,12491:1222,12492:1223,12493:1224,12494:1225,12495:1226,12498:1227,12501:1228,12504:1229,12507:1230,12510:1231,12511:1232,12512:1233,12513:1234,12514:1235,12515:1196,12516:1236,12517:1197,12518:1237,12519:1198,12520:1238,12521:1239,12522:1240,12523:1241,12524:1242,12525:1243,12527:1244,12530:1190,12531:1245,12539:1189,12540:1200},L={lookup:function(k){if(k>=32&&k<=255)return k;var M=V[k];return M!==void 0?M:16777216|k}};fe.default=L},"8CQX":function(at,fe,oe){"use strict";function V(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(i){return typeof i}:V=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},V(n)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.getKeycode=o,fe.getKey=u,fe.getKeysym=r;var L=h(oe("mHUz")),I=h(oe("8+yF")),k=h(oe("6Qwc")),M=h(oe("gIYZ")),f=h(oe("mTgk")),E=g(oe("GdRQ"));function x(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return x=function(){return n},n}function g(n){if(n&&n.__esModule)return n;if(n===null||V(n)!=="object"&&typeof n!="function")return{default:n};var t=x();if(t&&t.has(n))return t.get(n);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in n)if(Object.prototype.hasOwnProperty.call(n,l)){var c=s?Object.getOwnPropertyDescriptor(n,l):null;c&&(c.get||c.set)?Object.defineProperty(i,l,c):i[l]=n[l]}return i.default=n,t&&t.set(n,i),i}function h(n){return n&&n.__esModule?n:{default:n}}function o(n){if(n.code){switch(n.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return n.code}if(n.type!=="keypress"&&n.keyCode in k.default){var t=k.default[n.keyCode];if(E.isMac()&&t==="ContextMenu"&&(t="MetaRight"),n.location===2)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(n.location===3)switch(t){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return t}return"Unidentified"}function u(n){if(n.key!==void 0){switch(n.key){case"Spacebar":return" ";case"Esc":return"Escape";case"Scroll":return"ScrollLock";case"Win":return"Meta";case"Apps":return"ContextMenu";case"Up":return"ArrowUp";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";case"Down":return"ArrowDown";case"Del":return"Delete";case"Divide":return"/";case"Multiply":return"*";case"Subtract":return"-";case"Add":return"+";case"Decimal":return n.char}switch(n.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(n.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if(n.key==="\0"&&n.code==="NumpadDecimal")return"Delete";if(!E.isIE()&&!E.isEdge())return n.key;if(n.key.length!==1&&n.key!=="Unidentified")return n.key}var t=o(n);return t in M.default?M.default[t]:n.charCode?String.fromCharCode(n.charCode):"Unidentified"}function r(n){var t=u(n);if(t==="Unidentified")return null;if(t in f.default){var i=n.location;if(t==="Meta"&&i===0&&(i=2),t==="Clear"&&i===3){var s=o(n);s==="NumLock"&&(i=0)}if((i===void 0||i>3)&&(i=0),t==="Meta"){var l=o(n);if(l==="AltLeft")return L.default.XK_Meta_L;if(l==="AltRight")return L.default.XK_Meta_R}if(t==="Clear"){var c=o(n);if(c==="NumLock")return L.default.XK_Num_Lock}return f.default[t][i]}if(t.length!==1)return null;var d=t.charCodeAt();return d?I.default.lookup(d):null}},"8EBN":function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){"use strict";V.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 L=0;L-1&&k.substring(E+1,k.length);if(x)return V.findModeByExtension(x)},V.findModeByName=function(k){k=k.toLowerCase();for(var M=0;M>d&1&&(this._zlibs[d].reset(),L.Info("Reset zlib stream "+d));this._ctl=this._ctl>>4}var w;if(this._ctl===8)w=this._fillRect(r,n,t,i,s,l,c);else if(this._ctl===9)w=this._jpegRect(r,n,t,i,s,l,c);else if(this._ctl===10)w=this._pngRect(r,n,t,i,s,l,c);else if((this._ctl&128)==0)w=this._basicRect(this._ctl,r,n,t,i,s,l,c);else throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");return w&&(this._ctl=null),w}},{key:"_fillRect",value:function(r,n,t,i,s,l,c){if(s.rQwait("TIGHT",3))return!1;var d=s.rQi,w=s.rQ;return l.fillRect(r,n,t,i,[w[d+2],w[d+1],w[d]],!1),s.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(r,n,t,i,s,l,c){var d=this._readData(s);return d===null?!1:(l.imageRect(r,n,t,i,"image/jpeg",d),!0)}},{key:"_pngRect",value:function(r,n,t,i,s,l,c){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(r,n,t,i,s,l,c,d){if(this._filter===null)if(r&4){if(l.rQwait("TIGHT",1))return!1;this._filter=l.rQshift8()}else this._filter=0;var w=r&3,m;switch(this._filter){case 0:m=this._copyFilter(w,n,t,i,s,l,c,d);break;case 1:m=this._paletteFilter(w,n,t,i,s,l,c,d);break;case 2:m=this._gradientFilter(w,n,t,i,s,l,c,d);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return m&&(this._filter=null),m}},{key:"_copyFilter",value:function(r,n,t,i,s,l,c,d){var w=i*s*3,m;if(w<12){if(l.rQwait("TIGHT",w))return!1;m=l.rQshiftBytes(w)}else{if(m=this._readData(l),m===null)return!1;this._zlibs[r].setInput(m),m=this._zlibs[r].inflate(w),this._zlibs[r].setInput(null)}return c.blitRgbImage(n,t,i,s,m,0,!1),!0}},{key:"_paletteFilter",value:function(r,n,t,i,s,l,c,d){if(this._numColors===0){if(l.rQwait("TIGHT palette",1))return!1;var w=l.rQpeek8()+1,m=w*3;if(l.rQwait("TIGHT palette",1+m))return!1;this._numColors=w,l.rQskipBytes(1),l.rQshiftTo(this._palette,m)}var S=this._numColors<=2?1:8,C=Math.floor((i*S+7)/8),v=C*s,y;if(v<12){if(l.rQwait("TIGHT",v))return!1;y=l.rQshiftBytes(v)}else{if(y=this._readData(l),y===null)return!1;this._zlibs[r].setInput(y),y=this._zlibs[r].inflate(v),this._zlibs[r].setInput(null)}return this._numColors==2?this._monoRect(n,t,i,s,y,this._palette,c):this._paletteRect(n,t,i,s,y,this._palette,c),this._numColors=0,!0}},{key:"_monoRect",value:function(r,n,t,i,s,l,c){for(var d=this._getScratchBuffer(t*i*4),w=Math.floor((t+7)/8),m=Math.floor(t/8),S=0;S=0;T--)C=(S*t+y*8+7-T)*4,v=(s[S*w+y]>>T&1)*3,d[C]=l[v],d[C+1]=l[v+1],d[C+2]=l[v+2],d[C+3]=255;for(var A=7;A>=8-t%8;A--)C=(S*t+y*8+7-A)*4,v=(s[S*w+y]>>A&1)*3,d[C]=l[v],d[C+1]=l[v+1],d[C+2]=l[v+2],d[C+3]=255}c.blitRgbxImage(r,n,t,i,d,0,!1)}},{key:"_paletteRect",value:function(r,n,t,i,s,l,c){for(var d=this._getScratchBuffer(t*i*4),w=t*i*4,m=0,S=0;m=Y.length?se.slice(Y.length):se}).join(` `)}var s=[],l=["
    "],c=new n.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){s.length=0,l=["
      "]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S($,F,H,Y){if(F>=$.length||$[F].level<=H)return F;var se=$[F];Y.push("
    • "+se.text+""),F++;var Z=[];return F=S($,F,se.level,Z),Z.length>0&&(Y.push("
        "),Z.forEach(function(Me){Y.push(Me)}),Y.push("
      ")),Y.push("
    • "),F=S($,F,H,Y),F}function C(){return S(s,0,0,l),l.push("
    "),l.join("")}var v={heading:function(F){var H=d.exec(F);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},fences:function(F){var H=this.rules.block.fences.exec(F);if(H){var Y=H[0],se=i(Y,H[3]||""),Z=H[2]?H[2].trim():H[2];if(["latex","katex","math"].indexOf(Z)>=0){var Me=A(),rt=se;se=Me,p[Me]={type:"block",expression:rt}}return{type:"code",raw:Y,lang:Z,text:se}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,A=function(){return"__special_katext_id_".concat(T++,"__")},p={};function D(){return p}function O(){T=0,p={}}function P($){return $=$.replace(y,function(F,H){var Y=A();return p[Y]={type:"inline",expression:H},Y}),$}var j=c.listitem;c.listitem=function($){return j(P($))};var K=c.paragraph;c.paragraph=function($){return K(P($))};var U=c.tablecell;c.tablecell=function($,F){return U(P($),F)},c.code=function($,F,H){var Y=(F||"").match(/\S*/)[0];return Y?["latex","katex","math"].indexOf(Y)>=0?"

    ".concat($,"

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

    [TOC]

    ",C()),w()),Kt=Kt.replace(/(__special_katext_id_\d+__)/g,function(ir,fi){var Ai=si[fi],Gr=Ai.type,xr=Ai.expression;return Object(ce.renderToString)(gr(xr)||"",{displayMode:Gr==="block",throwOnError:!1,output:"html"})}),Kt=Kt.replace(/▁/g,"\u2581\u2581\u2581"),O(),Me){var qt=document.createElement("div");return qt.innerHTML=Kt,qt.innerText}return setTimeout(function(){return cn()},500),Kt},[Ei]),Gi=Object(h.useRef)();m.WebkitLineClamp=rt,rt&&(Gt=Object(M.a)(Object(M.a)({},Gt),m));function yr(ni){var Vt=ni.target;if(Vt.tagName.toUpperCase()==="IMG"){if(Et){var _i=Vt.getAttribute("src");or(_i),_r("image")}}else if(Vt.tagName.toUpperCase()==="A"){var Kt=Vt.getAttribute("href");if(Kt.indexOf("office")>-1)ni.preventDefault(),or(Kt),_r("office");else if(Kt.indexOf("application/pdf")>-1)ni.preventDefault(),or(Kt),_r("pdf");else if(Kt.indexOf("text/html")>-1)ni.preventDefault(),or(Kt),_r("html");else if(Kt.startsWith("#")){ni.preventDefault();var si=document.getElementById(Kt.replace("#",""));si&&si.scrollIntoView(!0)}}}var cn=function(){var Vt,_i=(Vt=Gi.current)===null||Vt===void 0?void 0:Vt.querySelectorAll("video");_i==null||_i.forEach(function(Kt){if(Kt.oncontextmenu=function(){return!1},Kt.src.indexOf(".m3u8")>-1&&!Kt.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var si=new z.a;si.loadSource(Kt.src),si.attachMedia(Kt)}}})};Object(h.useEffect)(function(){if(Gi.current&&qi&&(qi.match(mr)&&window.PR.prettyPrint()),Gi.current)return Gi.current.addEventListener("click",yr),function(){Gi.current.removeEventListener("click",yr),O(),w()}},[qi,Gi.current,yr]);var br=function(Vt){if(!se)return;Vt.target.nodeName==="IMG"?(wi.current.style.zIndex=1,wi.current.style.display="flex",wi.current.style.width=Vt.target.clientWidth+"px",wi.current.style.height=Vt.target.clientHeight+"px",wi.current.style.top=Vt.target.offsetTop+"px",wi.current.style.left=Vt.target.offsetLeft+"px",Qi.current.src=Vt.target.getAttribute("src")):wi.current.style.display="none"};return o.a.createElement("div",{style:{position:"relative"}},o.a.createElement("div",{ref:Gi,style:Object(M.a)({},Gt),className:"".concat(Z||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:br,dangerouslySetInnerHTML:{__html:qi}}),o.a.createElement("div",{ref:wi,className:pr.a.button},o.a.createElement(L.a,null,o.a.createElement(k.a,{onClick:function(){return Xr()}},"\u88C1\u526A"),o.a.createElement(k.a,{onClick:function(){return zr()}},"\u7F16\u8F91"))),o.a.createElement("img",{ref:Qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),o.a.createElement(be.a,{close:!0,data:Wi,type:Wi!=null&&Wi.length?Ir:"",style:Object(M.a)({},Fi),onClose:function(){return or("")}}))}},"9VGf":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return I});var V=oe("q1tI"),L=oe.n(V);function I(k,M){var f=Object(V.useRef)();Object(V.useEffect)(function(){f.current=k}),Object(V.useEffect)(function(){function E(){f.current()}if(M!==null){var x=setInterval(E,M);return function(){return clearInterval(x)}}},[M])}},BU3w:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return f});var V=oe("MNnm"),L="rc-util-key";function I(E){if(E.attachTo)return E.attachTo;var x=document.querySelector("head");return x||document.body}function k(E){var x,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(V.a)())return null;var h=document.createElement("style");if((x=g.csp)===null||x===void 0?void 0:x.nonce){var o;h.nonce=(o=g.csp)===null||o===void 0?void 0:o.nonce}h.innerHTML=E;var u=I(g),r=u.firstChild;return g.prepend&&u.prepend?u.prepend(h):g.prepend&&r?u.insertBefore(h,r):u.appendChild(h),h}var M=new Map;function f(E,x){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},h=I(g);if(!M.has(h)){var o=k("",g),u=o.parentNode;M.set(h,u),u.removeChild(o)}var r=Array.from(M.get(h).children).find(function(l){return l.tagName==="STYLE"&&l[L]===x});if(r){var n,t;if(((n=g.csp)===null||n===void 0?void 0:n.nonce)&&r.nonce!==((t=g.csp)===null||t===void 0?void 0:t.nonce)){var i;r.nonce=(i=g.csp)===null||i===void 0?void 0:i.nonce}return r.innerHTML!==E&&(r.innerHTML=E),r}var s=k(E,g);return s[L]=x,s}},Bd2K:function(at,fe,oe){(function(V){V(oe("VrN/"),oe("osHv"))})(function(V){V.defineOption("autoCloseTags",!1,function(g,h,o){if(o!=V.Init&&o&&g.removeKeyMap("autoCloseTags"),!h)return;var u={name:"autoCloseTags"};(typeof h!="object"||h.whenClosing!==!1)&&(u["'/'"]=function(r){return f(r)}),(typeof h!="object"||h.whenOpening!==!1)&&(u["'>'"]=function(r){return k(r)}),g.addKeyMap(u)});var L=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function k(g){if(g.getOption("disableInput"))return V.Pass;for(var h=g.listSelections(),o=[],u=g.getOption("autoCloseTags"),r=0;rn.ch&&(c=c.slice(0,c.length-t.end+n.ch));var S=c.toLowerCase();if(!c||t.type=="string"&&(t.end!=n.ch||!/[\"\']/.test(t.string.charAt(t.string.length-1))||t.string.length==1)||t.type=="tag"&&l.close||t.string.indexOf("/")==n.ch-t.start-1||w&&E(w,S)>-1||x(g,i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(s)||[],c,n,!0))return V.Pass;var C=typeof u=="object"&&u.emptyTags;if(C&&E(C,c)>-1){o[r]={text:"/>",newPos:V.Pos(n.line,n.ch+2)};continue}var v=m&&E(m,S)>-1;o[r]={indent:v,text:">"+(v?` `:"")+"",newPos:v?V.Pos(n.line+1,0):V.Pos(n.line,n.ch+1)}}for(var y=typeof u=="object"&&u.dontIndentOnAutoClose,r=h.length-1;r>=0;r--){var T=o[r];g.replaceRange(T.text,h[r].head,h[r].anchor,"+insert");var A=g.listSelections().slice(0);A[r]={head:T.newPos,anchor:T.newPos},g.setSelections(A),!y&&T.indent&&(g.indentLine(T.newPos.line,null,!0),g.indentLine(T.newPos.line+1,null,!0))}}function M(g,h){for(var o=g.listSelections(),u=[],r=h?"/":""&&(w+=">"),u[i]=w}if(g.replaceSelections(u),o=g.listSelections(),!t)for(var i=0;i=0&&h[s]==o;s--)++i;u=t.to;for(var s=1;s0){for(var h=0;h1&&arguments[1]!==void 0?arguments[1]:"",h=[],o=0;oxe.length)&&(ge=xe.length);for(var ye=0,J=new Array(ge);ye=xe.length?{done:!0}:{done:!1,value:xe[J++]}}}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 ye=xe[Symbol.iterator](),ye.next.bind(ye)}function f(xe,ge){return ge={exports:{}},xe(ge,ge.exports),ge.exports}var E=f(function(xe){function ge(){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 ye(J){xe.exports.defaults=J}xe.exports={defaults:ge(),getDefaults:ge,changeDefaults:ye}}),x=E.defaults,g=E.getDefaults,h=E.changeDefaults,o=/[&<>"']/,u=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,n=/[<>"']|&(?!#?\w+;)/g,t={"&":"&","<":"<",">":">",'"':""","'":"'"},i=function(ge){return t[ge]};function s(xe,ge){if(ge){if(o.test(xe))return xe.replace(u,i)}else if(r.test(xe))return xe.replace(n,i);return xe}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(xe){return xe.replace(l,function(ge,ye){return ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""})}var d=/(^|[^\[])\^/g;function w(xe,ge){xe=xe.source||xe,ge=ge||"";var ye={replace:function(ne,q){return q=q.source||q,q=q.replace(d,"$1"),xe=xe.replace(ne,q),ye},getRegex:function(){return new RegExp(xe,ge)}};return ye}var m=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(xe,ge,ye){if(xe){var J;try{J=decodeURIComponent(c(ye)).replace(m,"").toLowerCase()}catch(ne){return null}if(J.indexOf("javascript:")===0||J.indexOf("vbscript:")===0||J.indexOf("data:")===0)return null}ge&&!S.test(ye)&&(ye=p(ge,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(ne){return null}return ye}var v={},y=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(xe,ge){v[" "+xe]||(y.test(xe)?v[" "+xe]=xe+"/":v[" "+xe]=j(xe,"/",!0)),xe=v[" "+xe];var ye=xe.indexOf(":")===-1;return ge.substring(0,2)==="//"?ye?ge:xe.replace(T,"$1")+ge:ge.charAt(0)==="/"?ye?ge:xe.replace(A,"$1")+ge:xe+ge}var D={exec:function(){}};function O(xe){for(var ge=1,ye,J;ge=0&&Ce[we]==="\\";)G=!G;return G?"|":" |"}),J=ye.split(/ \|/),ne=0;if(J.length>ge)J.splice(ge);else for(;J.length=J.length?ne.slice(J.length):ne}).join(` `)}var Oe=function(){function xe(ye){this.options=ye||B}var ge=xe.prototype;return ge.space=function(J){var ne=this.rules.block.newline.exec(J);if(ne)return ne[0].length>1?{type:"space",raw:ne[0]}:{raw:` `}},ge.code=function(J,ne){var q=this.rules.block.code.exec(J);if(q){var me=ne[ne.length-1];if(me&&me.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var Ce=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:N(Ce,` `)}}},ge.fences=function(J){var ne=this.rules.block.fences.exec(J);if(ne){var q=ne[0],me=Fe(q,ne[3]||"");return{type:"code",raw:q,lang:ne[2]?ne[2].trim():ne[2],text:me}}},ge.heading=function(J){var ne=this.rules.block.heading.exec(J);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},ge.nptable=function(J){var ne=this.rules.block.nptable.exec(J);if(ne){var q={type:"table",header:z(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(` `):[],raw:ne[0]};if(q.header.length===q.align.length){var me=q.align.length,Ce;for(Ce=0;Ce ?/gm,"");return{type:"blockquote",raw:ne[0],text:q}}},ge.list=function(J){var ne=this.rules.block.list.exec(J);if(ne){for(var q=ne[0],me=ne[2],Ce=me.length>1,G=me[me.length-1]===")",we={type:"list",raw:q,ordered:Ce,start:Ce?+me.slice(0,-1):"",loose:!1,items:[]},Ne=ne[0].match(this.rules.block.item),de=!1,Se,Xe,lt,tt,st,mt,Ct,_t=Ne.length,ft=0;ft<_t;ft++)Se=Ne[ft],q=Se,Xe=Se.length,Se=Se.replace(/^ *([*+-]|\d+[.)]) */,""),~Se.indexOf(` `)&&(Xe-=Se.length,Se=this.options.pedantic?Se.replace(/^ {1,4}/gm,""):Se.replace(new RegExp("^ {1,"+Xe+"}","gm"),"")),ft!==_t-1&&(lt=this.rules.block.bullet.exec(Ne[ft+1])[0],(Ce?lt.length===1||!G&<[lt.length-1]===")":lt.length>1||this.options.smartLists&<!==me)&&(tt=Ne.slice(ft+1).join(` `),we.raw=we.raw.substring(0,we.raw.length-tt.length),ft=_t-1)),st=de||/\n\n(?!\s*$)/.test(Se),ft!==_t-1&&(de=Se.charAt(Se.length-1)===` `,st||(st=de)),st&&(we.loose=!0),mt=/^\[[ xX]\] /.test(Se),Ct=void 0,mt&&(Ct=Se[1]!==" ",Se=Se.replace(/^\[[ xX]\] +/,"")),we.items.push({type:"list_item",raw:q,task:mt,checked:Ct,loose:st,text:Se});return we}},ge.html=function(J){var ne=this.rules.block.html.exec(J);if(ne)return{type:this.options.sanitize?"paragraph":"html",raw:ne[0],pre:!this.options.sanitizer&&(ne[1]==="pre"||ne[1]==="script"||ne[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):te(ne[0]):ne[0]}},ge.def=function(J){var ne=this.rules.block.def.exec(J);if(ne){ne[3]&&(ne[3]=ne[3].substring(1,ne[3].length-1));var q=ne[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:ne[0],href:ne[2],title:ne[3]}}},ge.table=function(J){var ne=this.rules.block.table.exec(J);if(ne){var q={type:"table",header:z(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(` `):[]};if(q.header.length===q.align.length){q.raw=ne[0];var me=q.align.length,Ce;for(Ce=0;Ce/i.test(me[0])&&(ne=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:ne,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]}},ge.link=function(J){var ne=this.rules.inline.link.exec(J);if(ne){var q=ce(ne[2],"()");if(q>-1){var me=ne[0].indexOf("!")===0?5:4,Ce=me+ne[1].length+q;ne[2]=ne[2].substring(0,q),ne[0]=ne[0].substring(0,Ce).trim(),ne[3]=""}var G=ne[2],we="";if(this.options.pedantic){var Ne=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(G);Ne?(G=Ne[1],we=Ne[3]):we=""}else we=ne[3]?ne[3].slice(1,-1):"";G=G.trim().replace(/^<([\s\S]*)>$/,"$1");var de=be(ne,{href:G&&G.replace(this.rules.inline._escapes,"$1"),title:we&&we.replace(this.rules.inline._escapes,"$1")},ne[0]);return de}},ge.reflink=function(J,ne){var q;if((q=this.rules.inline.reflink.exec(J))||(q=this.rules.inline.nolink.exec(J))){var me=(q[2]||q[1]).replace(/\s+/g," ");if(me=ne[me.toLowerCase()],!me||!me.href){var Ce=q[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var G=be(q,me,q[0]);return G}},ge.strong=function(J,ne,q){q===void 0&&(q="");var me=this.rules.inline.strong.start.exec(J);if(me&&(!me[1]||me[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){ne=ne.slice(-1*J.length);var Ce=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var G;(me=Ce.exec(ne))!=null;)if(G=this.rules.inline.strong.middle.exec(ne.slice(0,me.index+3)),G)return{type:"strong",raw:J.slice(0,G[0].length),text:J.slice(2,G[0].length-2)}}},ge.em=function(J,ne,q){q===void 0&&(q="");var me=this.rules.inline.em.start.exec(J);if(me&&(!me[1]||me[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){ne=ne.slice(-1*J.length);var Ce=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var G;(me=Ce.exec(ne))!=null;)if(G=this.rules.inline.em.middle.exec(ne.slice(0,me.index+2)),G)return{type:"em",raw:J.slice(0,G[0].length),text:J.slice(1,G[0].length-1)}}},ge.codespan=function(J){var ne=this.rules.inline.code.exec(J);if(ne){var q=ne[2].replace(/\n/g," "),me=/[^ ]/.test(q),Ce=q.startsWith(" ")&&q.endsWith(" ");return me&&Ce&&(q=q.substring(1,q.length-1)),q=te(q,!0),{type:"codespan",raw:ne[0],text:q}}},ge.br=function(J){var ne=this.rules.inline.br.exec(J);if(ne)return{type:"br",raw:ne[0]}},ge.del=function(J){var ne=this.rules.inline.del.exec(J);if(ne)return{type:"del",raw:ne[0],text:ne[1]}},ge.autolink=function(J,ne){var q=this.rules.inline.autolink.exec(J);if(q){var me,Ce;return q[2]==="@"?(me=te(this.options.mangle?ne(q[1]):q[1]),Ce="mailto:"+me):(me=te(q[1]),Ce=me),{type:"link",raw:q[0],text:me,href:Ce,tokens:[{type:"text",raw:me,text:me}]}}},ge.url=function(J,ne){var q;if(q=this.rules.inline.url.exec(J)){var me,Ce;if(q[2]==="@")me=te(this.options.mangle?ne(q[0]):q[0]),Ce="mailto:"+me;else{var G;do G=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(G!==q[0]);me=te(q[0]),q[1]==="www."?Ce="http://"+me:Ce=me}return{type:"link",raw:q[0],text:me,href:Ce,tokens:[{type:"text",raw:me,text:me}]}}},ge.inlineText=function(J,ne,q){var me=this.rules.inline.text.exec(J);if(me){var Ce;return ne?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]:Ce=te(this.options.smartypants?q(me[0]):me[0]),{type:"text",raw:me[0],text:Ce}}},xe}(),Re=X.noopTest,Be=X.edit,Ke=X.merge,Ae={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ae.def=Be(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex(),Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ae.item=Be(Ae.item,"gm").replace(/bull/g,Ae.bullet).getRegex(),Ae.list=Be(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex(),Ae._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",Ae._comment=//,Ae.html=Be(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ae.paragraph=Be(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.blockquote=Be(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex(),Ae.normal=Ke({},Ae),Ae.gfm=Ke({},Ae.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*|$)"}),Ae.gfm.nptable=Be(Ae.gfm.nptable).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.gfm.table=Be(Ae.gfm.table).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.pedantic=Ke({},Ae.normal,{html:Be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Re,paragraph:Be(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var _e={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",_e.punctuation=Be(_e.punctuation).replace(/punctuation/g,_e._punctuation).getRegex(),_e._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",_e._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",_e.em.start=Be(_e.em.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.middle=Be(_e.em.middle).replace(/punctuation/g,_e._punctuation).replace(/overlapSkip/g,_e._overlapSkip).getRegex(),_e.em.endAst=Be(_e.em.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.endUnd=Be(_e.em.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.start=Be(_e.strong.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.middle=Be(_e.strong.middle).replace(/punctuation/g,_e._punctuation).replace(/blockSkip/g,_e._blockSkip).getRegex(),_e.strong.endAst=Be(_e.strong.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.endUnd=Be(_e.strong.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.blockSkip=Be(_e._blockSkip,"g").getRegex(),_e.overlapSkip=Be(_e._overlapSkip,"g").getRegex(),_e._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_e._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_e._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])?)+(?![-_])/,_e.autolink=Be(_e.autolink).replace("scheme",_e._scheme).replace("email",_e._email).getRegex(),_e._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_e.tag=Be(_e.tag).replace("comment",Ae._comment).replace("attribute",_e._attribute).getRegex(),_e._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_e._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,_e._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_e.link=Be(_e.link).replace("label",_e._label).replace("href",_e._href).replace("title",_e._title).getRegex(),_e.reflink=Be(_e.reflink).replace("label",_e._label).getRegex(),_e.reflinkSearch=Be(_e.reflinkSearch,"g").replace("reflink",_e.reflink).replace("nolink",_e.nolink).getRegex(),_e.normal=Ke({},_e),_e.pedantic=Ke({},_e.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:Be(/^!?\[(label)\]\((.*?)\)/).replace("label",_e._label).getRegex(),reflink:Be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_e._label).getRegex()}),_e.gfm=Ke({},_e.normal,{escape:Be(_e.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(J="x"+J.toString(16)),ge+="&#"+J+";";return ge}var Ze=function(){function xe(ye){this.tokens=[],this.tokens.links=Object.create(null),this.options=ye||Ee,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var J={block:pe.normal,inline:Ge.normal};this.options.pedantic?(J.block=pe.pedantic,J.inline=Ge.pedantic):this.options.gfm&&(J.block=pe.gfm,this.options.breaks?J.inline=Ge.breaks:J.inline=Ge.gfm),this.tokenizer.rules=J}xe.lex=function(J,ne){var q=new xe(ne);return q.lex(J)};var ge=xe.prototype;return ge.lex=function(J){return J=J.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(J,this.tokens,!0),this.inline(this.tokens),this.tokens},ge.blockTokens=function(J,ne,q){ne===void 0&&(ne=[]),q===void 0&&(q=!0),J=J.replace(/^ +$/gm,"");for(var me,Ce,G,we;J;){if(me=this.tokenizer.space(J)){J=J.substring(me.raw.length),me.type&&ne.push(me);continue}if(me=this.tokenizer.code(J,ne)){J=J.substring(me.raw.length),me.type?ne.push(me):(we=ne[ne.length-1],we.raw+=` `+me.raw,we.text+=` `+me.text);continue}if(me=this.tokenizer.fences(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.heading(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.nptable(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.hr(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.blockquote(J)){J=J.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],q),ne.push(me);continue}if(me=this.tokenizer.list(J)){for(J=J.substring(me.raw.length),G=me.items.length,Ce=0;Ce0)for(;(Ne=this.tokenizer.rules.inline.reflinkSearch.exec(we))!=null;)de.includes(Ne[0].slice(Ne[0].lastIndexOf("[")+1,-1))&&(we=we.slice(0,Ne.index)+"["+"a".repeat(Ne[0].length-2)+"]"+we.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ne=this.tokenizer.rules.inline.blockSkip.exec(we))!=null;)we=we.slice(0,Ne.index)+"["+"a".repeat(Ne[0].length-2)+"]"+we.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;J;){if(G=this.tokenizer.escape(J)){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.tag(J,q,me)){J=J.substring(G.raw.length),q=G.inLink,me=G.inRawBlock,ne.push(G);continue}if(G=this.tokenizer.link(J)){J=J.substring(G.raw.length),G.type==="link"&&(G.tokens=this.inlineTokens(G.text,[],!0,me)),ne.push(G);continue}if(G=this.tokenizer.reflink(J,this.tokens.links)){J=J.substring(G.raw.length),G.type==="link"&&(G.tokens=this.inlineTokens(G.text,[],!0,me)),ne.push(G);continue}if(G=this.tokenizer.strong(J,we,Ce)){J=J.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],q,me),ne.push(G);continue}if(G=this.tokenizer.em(J,we,Ce)){J=J.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],q,me),ne.push(G);continue}if(G=this.tokenizer.codespan(J)){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.br(J)){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.del(J)){J=J.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],q,me),ne.push(G);continue}if(G=this.tokenizer.autolink(J,ze)){J=J.substring(G.raw.length),ne.push(G);continue}if(!q&&(G=this.tokenizer.url(J,ze))){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.inlineText(J,me,Ye)){J=J.substring(G.raw.length),Ce=G.raw.slice(-1),ne.push(G);continue}if(J){var Se="Infinite loop on byte: "+J.charCodeAt(0);if(this.options.silent){console.error(Se);break}else throw new Error(Se)}}return ne},L(xe,null,[{key:"rules",get:function(){return{block:pe,inline:Ge}}}]),xe}(),Je=E.defaults,$e=X.cleanUrl,He=X.escape,Ue=function(){function xe(ye){this.options=ye||Je}var ge=xe.prototype;return ge.code=function(J,ne,q){var me=(ne||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(J,me);Ce!=null&&Ce!==J&&(q=!0,J=Ce)}return me?'
    '+(q?J:He(J,!0))+`
    `:"
    "+(q?J:He(J,!0))+`
    `},ge.blockquote=function(J){return`
    `+J+`
    `},ge.html=function(J){return J},ge.heading=function(J,ne,q,me){return this.options.headerIds?"'+J+" `:""+J+" `},ge.hr=function(){return this.options.xhtml?`
    `:`
    `},ge.list=function(J,ne,q){var me=ne?"ol":"ul",Ce=ne&&q!==1?' start="'+q+'"':"";return"<"+me+Ce+`> `+J+" `},ge.listitem=function(J){return"
  • "+J+`
  • `},ge.checkbox=function(J){return" "},ge.paragraph=function(J){return"

    "+J+`

    `},ge.table=function(J,ne){return ne&&(ne=""+ne+""),` `+J+` `+ne+`
    `},ge.tablerow=function(J){return` `+J+` `},ge.tablecell=function(J,ne){var q=ne.header?"th":"td",me=ne.align?"<"+q+' align="'+ne.align+'">':"<"+q+">";return me+J+" `},ge.strong=function(J){return""+J+""},ge.em=function(J){return""+J+""},ge.codespan=function(J){return""+J+""},ge.br=function(){return this.options.xhtml?"
    ":"
    "},ge.del=function(J){return""+J+""},ge.link=function(J,ne,q){if(J=$e(this.options.sanitize,this.options.baseUrl,J),J===null)return q;var me='",me},ge.image=function(J,ne,q){if(J=$e(this.options.sanitize,this.options.baseUrl,J),J===null)return q;var me=''+q+'":">",me},ge.text=function(J){return J},xe}(),Pe=function(){function xe(){}var ge=xe.prototype;return ge.strong=function(J){return J},ge.em=function(J){return J},ge.codespan=function(J){return J},ge.del=function(J){return J},ge.html=function(J){return J},ge.text=function(J){return J},ge.link=function(J,ne,q){return""+q},ge.image=function(J,ne,q){return""+q},ge.br=function(){return""},xe}(),ke=function(){function xe(){this.seen={}}var ge=xe.prototype;return ge.slug=function(J){var ne=J.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ne)){var q=ne;do this.seen[q]++,ne=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(ne))}return this.seen[ne]=0,ne},xe}(),re=E.defaults,ve=X.unescape,ae=function(){function xe(ye){this.options=ye||re,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new ke}xe.parse=function(J,ne){var q=new xe(ne);return q.parse(J)};var ge=xe.prototype;return ge.parse=function(J,ne){ne===void 0&&(ne=!0);var q="",me,Ce,G,we,Ne,de,Se,Xe,lt,tt,st,mt,Ct,_t,ft,kt,Nt,nt,Tt=J.length;for(me=0;me0&&ft.tokens[0].type==="text"?(ft.tokens[0].text=nt+" "+ft.tokens[0].text,ft.tokens[0].tokens&&ft.tokens[0].tokens.length>0&&ft.tokens[0].tokens[0].type==="text"&&(ft.tokens[0].tokens[0].text=nt+" "+ft.tokens[0].tokens[0].text)):ft.tokens.unshift({type:"text",text:nt}):_t+=nt),_t+=this.parse(ft.tokens,Ct),lt+=this.renderer.listitem(_t,Nt,kt);q+=this.renderer.list(lt,st,mt);continue}case"html":{q+=this.renderer.html(tt.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(lt=tt.tokens?this.parseInline(tt.tokens):tt.text;me+1An error occurred:

    "+et(G.message+"",!0)+"
    ";throw G}}Te.options=Te.setOptions=function(xe){return De(Te.defaults,xe),ct(Te.defaults),Te},Te.getDefaults=je,Te.defaults=he,Te.use=function(xe){var ge=De({},xe);if(xe.renderer&&function(){var J=Te.defaults.renderer||new Ue,ne=function(Ce){var G=J[Ce];J[Ce]=function(){for(var we=arguments.length,Ne=new Array(we),de=0;de0||v.target.offsetWidth>0){var y=i(v.target.offsetWidth,v.target.offsetHeight,c),T=Object(L.a)(y,2),A=T[0],p=T[1];console.log("cols, rows",A,p),n.a.publish("ssh-xterm-resize",{columns:A,rows:p,width:v.target.offsetWidth,height:v.target.offsetHeight}),c.resize(A,p);var D=f.Base64.decode("IA=="),O=f.Base64.decode("CBtbSw==");c.write(D),c.write(O)}}}catch(P){S.e(P)}finally{S.f()}});return w.observe(d),w}var l=3e4;fe.a=function(c){var d=c.sshConfigData,w=c.sid,m=Object(k.useState)(null),S=Object(L.a)(m,2),C=S[0],v=S[1],y=d.link_url,T=d.password,A=d.port,p=Object(k.useRef)(),D=Object(k.useRef)(),O=Object(k.useRef)(!1);return Object(k.useEffect)(function(){if(p.current&&y){var P=new x.Terminal({fontSize:16,rendererType:"dom"});P.open(p.current),P.onData(function(K){D.current&&(D.current.readyState===1&&(D.current.send(JSON.stringify({tp:"client",data:K})),n.a.publish("on-operating-ssh")))}),P.write("Connecting..."),v(P);var j=s(P,p.current);return function(){P.dispose(),j.unobserve(p.current)}}},[y,p.current]),Object(k.useEffect)(function(){if(C&&y){function P(){var N=new WebSocket(y);D.current=N,N.onopen=function(){var z=C.element.parentElement;if(z){var te=z.offsetWidth,ce=z.offsetHeight;console.log("init",{tp:"init",data:Object(V.a)(Object(V.a)({},d),{},{secret:T,width:te,height:ce,rows:C.rows,columns:C.cols})}),N.send(JSON.stringify({tp:"init",data:Object(V.a)(Object(V.a)({},d),{},{secret:T,width:te,height:ce,rows:C.rows,columns:C.cols})}))}C.focus()},N.onerror=function(z){console.log("------in socket error----",z,N,y)},N.onmessage=function(z){O.current||(C.write("\r"),setTimeout(function(){},1e3)),O.current=!0,console.log("event:",z);var te=f.Base64.decode(z.data.toString()),ce=C._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",te,ce,C),C.write(te)},N.onclose=function(z){j&&clearInterval(j),C.write(`\r connection closed`)}}var j=setInterval(function(){D.current&&D.current.send(JSON.stringify({tp:"h"}))},l),K=n.a.subscribe("create-socket",function(N){w==N&&(D.current&&D.current.readyState===1?C.focus():P(),C.focus())}),U=n.a.subscribe("close-socket",function(N){w===N&&(D.current&&(D.current.close(),O.current=!1,C.clear()),D.current=null)}),X=n.a.subscribe("ssh-xterm-resize",function(N){D.current&&D.current.readyState===1&&D.current.send(JSON.stringify({tp:"resize",data:Object(V.a)({},N)}))}),B=n.a.subscribe("ssh-add-connect-time",function(){D.current&&D.current.readyState===1&&D.current.send(JSON.stringify({tp:"overtime"}))});return function(){U(),K(),X(),B(),D.current&&(D.current.close(),O.current=!1)}}},[C,y,A]),M.a.createElement("div",{ref:p,className:r.a["xterm-panel"]},y?null:M.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},ELLl:function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){var L={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=V.Pos;V.defineOption("autoCloseBrackets",!1,function(t,i,s){s&&s!=V.Init&&(t.removeKeyMap(M),t.state.closeBrackets=null),i&&(f(k(i,"pairs")),t.state.closeBrackets=i,t.addKeyMap(M))});function k(t,i){return i=="pairs"&&typeof t=="string"?t:typeof t=="object"&&t[i]!=null?t[i]:L[i]}var M={Backspace:g,Enter:h};function f(t){for(var i=0;i=0;c--){var w=l[c].head;t.replaceRange("",I(w.line,w.ch-1),I(w.line,w.ch+1),"+delete")}}function h(t){var i=x(t),s=i&&k(i,"explode");if(!s||t.getOption("disableInput"))return V.Pass;for(var l=t.listSelections(),c=0;c0;return{anchor:new I(t.anchor.line,t.anchor.ch+(i?-1:1)),head:new I(t.head.line,t.head.ch+(i?1:-1))}}function u(t,i){var s=x(t);if(!s||t.getOption("disableInput"))return V.Pass;var l=k(s,"pairs"),c=l.indexOf(i);if(c==-1)return V.Pass;for(var d=k(s,"closeBefore"),w=k(s,"triples"),m=l.charAt(c+1)==i,S=t.listSelections(),C=c%2==0,v,y=0;y=0&&t.getRange(A,I(A.line,A.ch+3))==i+i+i?p="skipThree":p="skip";else if(m&&A.ch>1&&w.indexOf(i)>=0&&t.getRange(I(A.line,A.ch-2),A)==i+i){if(A.ch>2&&/\bstring/.test(t.getTokenTypeAt(I(A.line,A.ch-2))))return V.Pass;p="addFour"}else if(m){var O=A.ch==0?" ":t.getRange(I(A.line,A.ch-1),A);if(!V.isWordChar(D)&&O!=i&&!V.isWordChar(O))p="both";else return V.Pass}else if(C&&(D.length===0||/\s/.test(D)||d.indexOf(D)>-1))p="both";else return V.Pass;if(!v)v=p;else if(v!=p)return V.Pass}var P=c%2?l.charAt(c-1):i,j=c%2?i:l.charAt(c+1);t.operation(function(){if(v=="skip")t.execCommand("goCharRight");else if(v=="skipThree")for(var K=0;K<3;K++)t.execCommand("goCharRight");else if(v=="surround"){for(var U=t.getSelections(),K=0;K=48&&i.keyCode<=57)s=i.keyCode;else if(i.keyCode>=65&&i.keyCode<=90){var c=String.fromCharCode(i.keyCode);i.shiftKey?c=c.toUpperCase():c=c.toLowerCase(),s=c.charCodeAt()}else s=0;this._sendKeyEvent(s,l,!0)}},{key:"_handleKeyUp",value:function(i){(0,I.stopEvent)(i);var s=this._getKeyCode(i);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),(f.isMac()||f.isIOS())&&s==="CapsLock"){this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!1);return}this._sendKeyEvent(this._keyDownList[s],s,!1),f.isWindows()&&(s==="ShiftLeft"||s==="ShiftRight")&&("ShiftRight"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftRight,"ShiftRight",!1),"ShiftLeft"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftLeft,"ShiftLeft",!1))}},{key:"_handleAltGrTimeout",value:function(){this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){L.Debug(">> Keyboard.allKeysUp");for(var i in this._keyDownList)this._sendKeyEvent(this._keyDownList[i],i,!1);L.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(i){if(i.skipCheckAlt)return;if(i.altKey)return;var s=this._target,l=this._keyDownList;["AltLeft","AltRight"].forEach(function(c){if(!(c in l))return;var d=new KeyboardEvent("keyup",{key:l[c],code:c});d.skipCheckAlt=!0,s.dispatchEvent(d)})}},{key:"grab",value:function(){if(this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),this._target.addEventListener("keypress",this._eventHandlers.keypress),window.addEventListener("blur",this._eventHandlers.blur),f.isWindows()&&f.isFirefox()){var i=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.addEventListener(s,i,{capture:!0,passive:!0})})}}},{key:"ungrab",value:function(){if(f.isWindows()&&f.isFirefox()){var i=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.removeEventListener(s,i)})}this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),this._target.removeEventListener("keypress",this._eventHandlers.keypress),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}]),n}();fe.default=r},GQ8N:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.toUnsigned32bit=V,fe.toSigned32bit=L;function V(I){return I>>>0}function L(I){return I|0}},GdRQ:function(at,fe,oe){"use strict";function V(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(y){return typeof y}:V=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},V(C)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.isMac=s,fe.isWindows=l,fe.isIOS=c,fe.isSafari=d,fe.isIE=w,fe.isEdge=m,fe.isFirefox=S,fe.hasScrollbarGutter=fe.supportsImageMetadata=fe.supportsCursorURIs=fe.dragThreshold=fe.isTouchDevice=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return I=function(){return C},C}function k(C){if(C&&C.__esModule)return C;if(C===null||V(C)!=="object"&&typeof C!="function")return{default:C};var v=I();if(v&&v.has(C))return v.get(C);var y={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in C)if(Object.prototype.hasOwnProperty.call(C,A)){var p=T?Object.getOwnPropertyDescriptor(C,A):null;p&&(p.get||p.set)?Object.defineProperty(y,A,p):y[A]=C[A]}return y.default=C,v&&v.set(C,y),y}var M="ontouchstart"in document.documentElement||document.ontouchstart!==void 0||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;fe.isTouchDevice=M,window.addEventListener("touchstart",function C(){fe.isTouchDevice=M=!0,window.removeEventListener("touchstart",C,!1)},!1);var f=10*(window.devicePixelRatio||1);fe.dragThreshold=f;var E=!1;try{var x=document.createElement("canvas");x.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',x.style.cursor.indexOf("url")===0?(L.Info("Data URI scheme cursor supported"),E=!0):L.Warn("Data URI scheme cursor not supported")}catch(C){L.Error("Data URI scheme cursor test exception: "+C)}var g=E;fe.supportsCursorURIs=g;var h=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),h=!0}catch(C){}var o=h;fe.supportsImageMetadata=o;var u=!0;try{var r=document.createElement("div");r.style.visibility="hidden",r.style.overflow="scroll",document.body.appendChild(r);var n=document.createElement("div");r.appendChild(n);var t=r.offsetWidth-n.offsetWidth;r.parentNode.removeChild(r),u=t!=0}catch(C){L.Error("Scrollbar test exception: "+C)}var i=u;fe.hasScrollbarGutter=i;function s(){return navigator&&!!/mac/i.exec(navigator.platform)}function l(){return navigator&&!!/win/i.exec(navigator.platform)}function c(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function d(){return navigator&&navigator.userAgent.indexOf("Safari")!==-1&&navigator.userAgent.indexOf("Chrome")===-1}function w(){return navigator&&!!/trident/i.exec(navigator.userAgent)}function m(){return navigator&&!!/edge/i.exec(navigator.userAgent)}function S(){return navigator&&!!/firefox/i.exec(navigator.userAgent)}},Gytx:function(at,fe){at.exports=function(V,L,I,k){var M=I?I.call(k,V,L):void 0;if(M!==void 0)return!!M;if(V===L)return!0;if(typeof V!="object"||!V||typeof L!="object"||!L)return!1;var f=Object.keys(V),E=Object.keys(L);if(f.length!==E.length)return!1;for(var x=Object.prototype.hasOwnProperty.bind(L),g=0;gthis.chunkSize&&(this.chunkSize=h,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=h;var o=(0,V.inflate)(this.strm,0);if(o<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=h)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,V.inflateReset)(this.strm)}}]),x}();fe.default=E},IxHN:function(at,fe,oe){"use strict";var V=oe("q1tI"),L=oe.n(V),I=oe("07cG"),k=oe.n(I);fe.a=function(M){var f=M.message,E=M.className,x=M.children,g=M.style,h=g===void 0?{}:g;return L.a.createElement("div",{className:"".concat(k.a.idsRingWrapper," ").concat(E)},L.a.createElement("div",{className:k.a.ldsRing},L.a.createElement("div",null),L.a.createElement("div",null),L.a.createElement("div",null),L.a.createElement("div",null)),f?L.a.createElement("p",{style:h},f):null,x)}},J66h:function(at,fe,oe){(function(V){var L,I;(function(k,M){at.exports=M(k)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof V!="undefined"?V:this,function(k){"use strict";k=k||{};var M=k.Base64,f="2.6.4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x=function(P){for(var j={},K=0,U=P.length;K>>6)+g(128|j&63):g(224|j>>>12&15)+g(128|j>>>6&63)+g(128|j&63)}else{var j=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return g(240|j>>>18&7)+g(128|j>>>12&63)+g(128|j>>>6&63)+g(128|j&63)}},o=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(P){return P.replace(o,h)},r=function(P){var j=[0,2,1][P.length%3],K=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),U=[E.charAt(K>>>18),E.charAt(K>>>12&63),j>=2?"=":E.charAt(K>>>6&63),j>=1?"=":E.charAt(K&63)];return U.join("")},n=k.btoa&&typeof k.btoa=="function"?function(P){return k.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,r)},t=function(P){return n(u(String(P)))},i=function(P){return P.replace(/[+\/]/g,function(j){return j=="+"?"-":"_"}).replace(/=/g,"")},s=function(P,j){return j?i(t(P)):t(P)},l=function(P){return s(P,!0)},c;k.Uint8Array&&(c=function(P,j){for(var K="",U=0,X=P.length;U>>18)+E.charAt(te>>>12&63)+(typeof N!="undefined"?E.charAt(te>>>6&63):"=")+(typeof z!="undefined"?E.charAt(te&63):"=")}return j?i(K):K});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(P){switch(P.length){case 4:var j=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),K=j-65536;return g((K>>>10)+55296)+g((K&1023)+56320);case 3:return g((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return g((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},m=function(P){return P.replace(d,w)},S=function(P){var j=P.length,K=j%4,U=(j>0?x[P.charAt(0)]<<18:0)|(j>1?x[P.charAt(1)]<<12:0)|(j>2?x[P.charAt(2)]<<6:0)|(j>3?x[P.charAt(3)]:0),X=[g(U>>>16),g(U>>>8&255),g(U&255)];return X.length-=[0,0,2,1][K],X.join("")},C=k.atob&&typeof k.atob=="function"?function(P){return k.atob(P)}:function(P){return P.replace(/\S{1,4}/g,S)},v=function(P){return C(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(P){return m(C(P))},T=function(P){return String(P).replace(/[-_]/g,function(j){return j=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},A=function(P){return y(T(P))},p;k.Uint8Array&&(p=function(P){return Uint8Array.from(v(T(P)),function(j){return j.charCodeAt(0)})});var D=function(){var P=k.Base64;return k.Base64=M,P};if(k.Base64={VERSION:f,atob:v,btoa:n,fromBase64:A,toBase64:s,utob:u,encode:s,encodeURI:l,btou:m,decode:A,noConflict:D,fromUint8Array:c,toUint8Array:p},typeof Object.defineProperty=="function"){var O=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};k.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",O(function(){return A(this)})),Object.defineProperty(String.prototype,"toBase64",O(function(P){return s(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",O(function(){return s(this,!0)}))}}return k.Meteor&&(Base64=k.Base64),at.exports?at.exports.Base64=k.Base64:!(L=[],I=function(){return k.Base64}.apply(fe,L),I!==void 0&&(at.exports=I)),{Base64:k.Base64}})}).call(this,oe("IyRk"))},JSwD:function(at,fe,oe){"use strict";function V(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(l){return typeof l}:V=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},V(i)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=t;var L=k(oe("6BzB"));function I(){if(typeof WeakMap!="function")return null;var i=new WeakMap;return I=function(){return i},i}function k(i){if(i&&i.__esModule)return i;if(i===null||V(i)!=="object"&&typeof i!="function")return{default:i};var s=I();if(s&&s.has(i))return s.get(i);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in i)if(Object.prototype.hasOwnProperty.call(i,d)){var w=c?Object.getOwnPropertyDescriptor(i,d):null;w&&(w.get||w.set)?Object.defineProperty(l,d,w):l[d]=i[d]}return l.default=i,s&&s.set(i,l),l}var M=15,f=852,E=592,x=0,g=1,h=2,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],r=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function t(i,s,l,c,d,w,m,S){var C=S.bits,v=0,y=0,T=0,A=0,p=0,D=0,O=0,P=0,j=0,K=0,U,X,B,N,z,te=null,ce=0,be,Fe=new L.Buf16(M+1),Oe=new L.Buf16(M+1),Re=null,Be=0,Ke,Ae,_e;for(v=0;v<=M;v++)Fe[v]=0;for(y=0;y=1&&!(Fe[A]!==0);A--);if(p>A&&(p=A),A===0)return d[w++]=1<<24|64<<16|0,d[w++]=1<<24|64<<16|0,S.bits=1,0;for(T=1;T0&&(i===x||A!==1))return-1;for(Oe[1]=0,v=1;vf||i===h&&j>E)return 1;for(;;){Ke=v-O,m[y]be?(Ae=Re[Be+m[y]],_e=te[ce+m[y]]):(Ae=32+64,_e=0),U=1<>O)+X]=Ke<<24|Ae<<16|_e|0;while(X!==0);for(U=1<>=1;if(U!==0?(K&=U-1,K+=U):K=0,y++,--Fe[v]===0){if(v===A)break;v=s[l+m[y]]}if(v>p&&(K&N)!==B){for(O===0&&(O=p),z+=T,D=v-O,P=1<f||i===h&&j>E)return 1;B=K&N,d[B]=p<<24|D<<16|z-w|0}}return K!==0&&(d[z+K]=v-O<<24|64<<16|0),S.bits=p,0}},LCi9:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")}function L(d,w){for(var m=0;m0&&Date.now()-this._tracked[0].started>t){this._state=k,this._ignored.push(m);return}if(this._waitingRelease){this._state=k,this._ignored.push(m);return}this._tracked.push({id:m,started:Date.now(),active:!0,firstX:S,firstY:C,lastX:S,lastY:C,angle:0});switch(this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(M|x|g),this._stopLongpressTimeout();break;case 3:this._state&=~(f|h|o);break;default:this._state=k}}},{key:"_touchMove",value:function(m,S,C){var v=this._tracked.find(function(O){return O.id===m});if(v===void 0)return;v.lastX=S,v.lastY=C;var y=S-v.firstX,T=C-v.firstY;if((v.firstX!==v.lastX||v.firstY!==v.lastY)&&(v.angle=Math.atan2(T,y)*180/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(y,T)r){var D=Math.abs(v.angle-A.angle);D=Math.abs((D+180)%360-180),D>n?this._state&=~h:this._state&=~o,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}},{key:"_touchEnd",value:function(m,S,C){if(this._ignored.indexOf(m)!==-1){this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&this._tracked.length===0&&(this._state=u,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=k),!this._hasDetectedGesture()&&(this._state&=~(x|h|o),this._state&=~g,this._stopLongpressTimeout(),!this._waitingRelease)){this._releaseStart=Date.now(),this._waitingRelease=!0;switch(this._tracked.length){case 1:this._state&=~(f|E);break;case 2:this._state&=~(M|E);break}}if(this._waitingRelease){Date.now()-this._releaseStart>t&&(this._state=k),this._tracked.some(function(T){return Date.now()-T.started>i})&&(this._state=k);var v=this._tracked.find(function(T){return T.id===m});if(v.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==k)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var y=0;y1&&arguments[1]!==void 0?arguments[1]:1,ye=Pe.length,J=0;J1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(N).map(function(te,ce){if(!M.isValidElement(te)||!te.type)return null;var be=te.type.isSelectOptGroup,Fe=te.key,Oe=te.props,Re=Oe.children,Be=Object(E.a)(Oe,["children"]);return z||!be?v(te):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Fe===null?ce:Fe,"__"),label:Fe},Be),{},{options:y(Re)})}).filter(function(te){return te})}var T=oe("2Qr1"),A=oe("qNPg"),p=oe("U8pU"),D=oe("Kwbf"),O=oe("WKfj");function P(N){var z=N.mode,te=N.options,ce=N.children,be=N.backfill,Fe=N.allowClear,Oe=N.placeholder,Re=N.getInputElement,Be=N.showSearch,Ke=N.onSearch,Ae=N.defaultOpen,_e=N.autoFocus,le=N.labelInValue,Ee=N.value,pe=N.inputValue,Ge=N.optionLabelProp,Ye=z==="multiple"||z==="tags",ze=Be!==void 0?Be:Ye||z==="combobox",Ze=te||y(ce);if(Object(D.a)(z!=="tags"||Ze.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Je=Ze.some(function(Ue){return Ue.options?Ue.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(D.a)(!Je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(D.a)(z!=="combobox"||!Ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(D.a)(z==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(D.a)(z==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(D.b)(z!=="combobox"||!Re||!Fe||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ke&&!ze&&z!=="combobox"&&z!=="tags"&&Object(D.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(D.b)(!Ae||_e,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ee!=null){var $e=Object(O.d)(Ee);Object(D.a)(!le||$e.every(function(Ue){return Object(p.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(D.a)(!Ye||Array.isArray(Ee),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var He=null;Object(C.a)(ce).some(function(Ue){if(!M.isValidElement(Ue)||!Ue.type)return!1;var Pe=Ue.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var ke=Object(C.a)(Ue.props.children).every(function(re){return!M.isValidElement(re)||!Ue.type||re.type.isSelectOption?!0:(He=re.type,!1)});return!ke}return He=Pe,!0}),He&&Object(D.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(D.a)(pe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=P,K=Object(A.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:y,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:j,fillOptionsWithMissingValue:T.a}),U=function(N){Object(I.a)(te,N);var z=Object(k.a)(te);function te(){var ce;return Object(V.a)(this,te),ce=z.apply(this,arguments),ce.selectRef=M.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object(L.a)(te,[{key:"render",value:function(){return M.createElement(K,Object.assign({ref:this.selectRef},this.props))}}]),te}(M.Component);U.Option=d,U.OptGroup=m;var X=U,B=fe.c=X},Lmeb:function(at,fe,oe){},Lo0S:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.initLogging=f,fe.getLogging=E,fe.Error=fe.Warn=fe.Info=fe.Debug=void 0;var V="warn",L=function(){};fe.Debug=L;var I=function(){};fe.Info=I;var k=function(){};fe.Warn=k;var M=function(){};fe.Error=M;function f(x){if(typeof x=="undefined"?x=V:V=x,fe.Debug=L=fe.Info=I=fe.Warn=k=fe.Error=M=function(){},typeof window.console!="undefined")switch(x){case"debug":fe.Debug=L=console.debug.bind(window.console);case"info":fe.Info=I=console.info.bind(window.console);case"warn":fe.Warn=k=console.warn.bind(window.console);case"error":fe.Error=M=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+x+"'")}}function E(){return V}f()},M8RZ:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return g});var V=oe("fWQN"),L=oe("mtLc"),I=oe("yKVA"),k=oe("879j"),M=oe("q1tI"),f=oe.n(M),E=oe("i8i4"),x=oe.n(E),g=function(h){Object(I.a)(u,h);var o=Object(k.a)(u);function u(r){var n;Object(V.a)(this,u),n=o.call(this,r);var t=window.document;return n.node=t.createElement("div"),t.body.appendChild(n.node),n}return Object(L.a)(u,[{key:"render",value:function(){var n=this.props.children;return Object(E.createPortal)(n,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),u}(f.a.Component)},MZdM:function(at,fe,oe){"use strict";function V(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(t){return typeof t}:V=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(r)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=x(oe("Lo0S")),I=f(oe("N/zr")),k=oe("GdRQ"),M=oe("GQ8N");function f(r){return r&&r.__esModule?r:{default:r}}function E(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return E=function(){return r},r}function x(r){if(r&&r.__esModule)return r;if(r===null||V(r)!=="object"&&typeof r!="function")return{default:r};var n=E();if(n&&n.has(r))return n.get(r);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){var l=i?Object.getOwnPropertyDescriptor(r,s):null;l&&(l.get||l.set)?Object.defineProperty(t,s,l):t[s]=r[s]}return t.default=r,n&&n.set(r,t),t}function g(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function h(r,n){for(var t=0;t> Display.constructor"),this._target=n,!this._target)throw new Error("Target must be set");if(typeof this._target=="string")throw new Error("target must be a DOM element");if(!this._target.getContext)throw new Error("no getContext method");if(this._targetCtx=this._target.getContext("2d"),this._viewportLoc={x:0,y:0,w:this._target.width,h:this._target.height},this._backbuffer=document.createElement("canvas"),this._drawCtx=this._backbuffer.getContext("2d"),this._damageBounds={left:0,top:0,right:this._backbuffer.width,bottom:this._backbuffer.height},L.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),L.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}return o(r,[{key:"viewportChangePos",value:function(t,i){var s=this._viewportLoc;t=Math.floor(t),i=Math.floor(i),this._clipViewport||(t=-s.w,i=-s.h);var l=s.x+s.w-1,c=s.y+s.h-1;if(t<0&&s.x+t<0&&(t=-s.x),l+t>=this._fbWidth&&(t-=l+t-this._fbWidth+1),s.y+i<0&&(i=-s.y),c+i>=this._fbHeight&&(i-=c+i-this._fbHeight+1),t===0&&i===0)return;L.Debug("viewportChange deltaX: "+t+", deltaY: "+i),s.x+=t,s.y+=i,this._damage(s.x,s.y,s.w,s.h),this.flip()}},{key:"viewportChangeSize",value:function(t,i){(!this._clipViewport||typeof t=="undefined"||typeof i=="undefined")&&(L.Debug("Setting viewport to full display region"),t=this._fbWidth,i=this._fbHeight),t=Math.floor(t),i=Math.floor(i),t>this._fbWidth&&(t=this._fbWidth),i>this._fbHeight&&(i=this._fbHeight);var s=this._viewportLoc;if(s.w!==t||s.h!==i){s.w=t,s.h=i;var l=this._target;l.width=t,l.height=i,this.viewportChangePos(0,0),this._damage(s.x,s.y,s.w,s.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(t,i){this._prevDrawStyle="",this._fbWidth=t,this._fbHeight=i;var s=this._backbuffer;if(s.width!==t||s.height!==i){var l=null;s.width>0&&s.height>0&&(l=this._drawCtx.getImageData(0,0,s.width,s.height)),s.width!==t&&(s.width=t),s.height!==i&&(s.height=i),l&&this._drawCtx.putImageData(l,0,0)}var c=this._viewportLoc;this.viewportChangeSize(c.w,c.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(t,i,s,l){tthis._damageBounds.right&&(this._damageBounds.right=t+s),i+l>this._damageBounds.bottom&&(this._damageBounds.bottom=i+l)}},{key:"flip",value:function(t){if(this._renderQ.length!==0&&!t)this._renderQPush({type:"flip"});else{var i=this._damageBounds.left,s=this._damageBounds.top,l=this._damageBounds.right-i,c=this._damageBounds.bottom-s,d=i-this._viewportLoc.x,w=s-this._viewportLoc.y;d<0&&(l+=d,i-=d,d=0),w<0&&(c+=w,s-=w,w=0),d+l>this._viewportLoc.w&&(l=this._viewportLoc.w-d),w+c>this._viewportLoc.h&&(c=this._viewportLoc.h-w),l>0&&c>0&&this._targetCtx.drawImage(this._backbuffer,i,s,l,c,d,w,l,c),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}}},{key:"pending",value:function(){return this._renderQ.length>0}},{key:"flush",value:function(){this._renderQ.length===0?this.onflush():this._flushing=!0}},{key:"fillRect",value:function(t,i,s,l,c,d){this._renderQ.length!==0&&!d?this._renderQPush({type:"fill",x:t,y:i,width:s,height:l,color:c}):(this._setFillColor(c),this._drawCtx.fillRect(t,i,s,l),this._damage(t,i,s,l))}},{key:"copyImage",value:function(t,i,s,l,c,d,w){this._renderQ.length!==0&&!w?this._renderQPush({type:"copy",oldX:t,oldY:i,x:s,y:l,width:c,height:d}):(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,t,i,c,d,s,l,c,d),this._damage(s,l,c,d))}},{key:"imageRect",value:function(t,i,s,l,c,d){if(s===0||l===0)return;var w=new Image;w.src="data: "+c+";base64,"+I.default.encode(d),this._renderQPush({type:"img",img:w,x:t,y:i,width:s,height:l})}},{key:"startTile",value:function(t,i,s,l,c){this._tileX=t,this._tileY=i,s===16&&l===16?this._tile=this._tile16x16:this._tile=this._drawCtx.createImageData(s,l);for(var d=c[2],w=c[1],m=c[0],S=this._tile.data,C=0;C=c?s=t/l.w:s=i/l.h}this._rescale(s)}},{key:"_rescale",value:function(t){this._scale=t;var i=this._viewportLoc,s=t*i.w+"px",l=t*i.h+"px";(this._target.style.width!==s||this._target.style.height!==l)&&(this._target.style.width=s,this._target.style.height=l)}},{key:"_setFillColor",value:function(t){var i="rgb("+t[2]+","+t[1]+","+t[0]+")";i!==this._prevDrawStyle&&(this._drawCtx.fillStyle=i,this._prevDrawStyle=i)}},{key:"_rgbImageData",value:function(t,i,s,l,c,d){for(var w=this._drawCtx.createImageData(s,l),m=w.data,S=0,C=d;S0;){var i=this._renderQ[0];switch(i.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(i.oldX,i.oldY,i.x,i.y,i.width,i.height,!0);break;case"fill":this.fillRect(i.x,i.y,i.width,i.height,i.color,!0);break;case"blit":this.blitImage(i.x,i.y,i.width,i.height,i.data,0,!0);break;case"blitRgb":this.blitRgbImage(i.x,i.y,i.width,i.height,i.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(i.x,i.y,i.width,i.height,i.data,0,!0);break;case"img":if(i.img.complete&&i.img.width!==0&&i.img.height!==0){if(i.img.width!==i.width||i.img.height!==i.height){L.Error("Decoded image has incorrect dimensions. Got "+i.img.width+"x"+i.img.height+". Expected "+i.width+"x"+i.height+".");return}this.drawImage(i.img,i.x,i.y)}else i.img._noVNCDisplay=this,i.img.addEventListener("load",this._resumeRenderQ),t=!1;break}t&&this._renderQ.shift()}this._renderQ.length===0&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(t){this._rescale(t)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(t){this._clipViewport=t;var i=this._viewportLoc;this.viewportChangeSize(i.w,i.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}]),r}();fe.default=u},Mmt2:function(at,fe,oe){"use strict";function V(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(r){return typeof r}:V=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},V(o)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return I=function(){return o},o}function k(o){if(o&&o.__esModule)return o;if(o===null||V(o)!=="object"&&typeof o!="function")return{default:o};var u=I();if(u&&u.has(o))return u.get(o);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var i=n?Object.getOwnPropertyDescriptor(o,t):null;i&&(i.get||i.set)?Object.defineProperty(r,t,i):r[t]=o[t]}return r.default=o,u&&u.set(o,r),r}function M(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}function f(o,u){for(var r=0;r=0;t--)n+=this._rQ[this._rQi++]<1&&arguments[1]!==void 0?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+r,n-r)}},{key:"rQwait",value:function(r,n,t){if(this.rQlen0&&this._websocket.readyState===WebSocket.OPEN&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}},{key:"send",value:function(r){this._sQ.set(r,this._sQlen),this._sQlen+=r.length,this.flush()}},{key:"sendString",value:function(r){this.send(r.split("").map(function(n){return n.charCodeAt(0)}))}},{key:"off",value:function(r){this._eventHandlers[r]=function(){}}},{key:"on",value:function(r,n){this._eventHandlers[r]=n}},{key:"_allocateBuffers",value:function(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}},{key:"init",value:function(){this._allocateBuffers(),this._rQi=0,this._websocket=null}},{key:"open",value:function(r,n){var t=this;this.init(),this._websocket=new WebSocket(r,n),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){L.Debug(">> WebSock.onopen"),t._websocket.protocol&&L.Info("Server choose sub-protocol: "+t._websocket.protocol),t._eventHandlers.open(),L.Debug("<< WebSock.onopen")},this._websocket.onclose=function(i){L.Debug(">> WebSock.onclose"),t._eventHandlers.close(i),L.Debug("<< WebSock.onclose")},this._websocket.onerror=function(i){L.Debug(">> WebSock.onerror: "+i),t._eventHandlers.error(i),L.Debug("<< WebSock.onerror: "+i)}}},{key:"close",value:function(){this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(L.Info("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=function(){})}},{key:"_encodeMessage",value:function(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}},{key:"_expandCompactRQ",value:function(r){var n=(this._rQlen-this._rQi+r)*8,t=this._rQbufferSizeg&&(this._rQbufferSize=g,this._rQbufferSize-this.rQlenthis._rQbufferSize-this._rQlen&&this._expandCompactRQ(n.length),this._rQ.set(n,this._rQlen),this._rQlen+=n.length}},{key:"_recvMessage",value:function(r){this._DecodeMessage(r.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):L.Debug("Ignoring empty message")}},{key:"sQ",get:function(){return this._sQ}},{key:"rQ",get:function(){return this._rQ}},{key:"rQi",get:function(){return this._rQi},set:function(r){this._rQi=r}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}]),o}();fe.default=h},"N/zr":function(at,fe,oe){"use strict";function V(f){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(x){return typeof x}:V=function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},V(f)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var f=new WeakMap;return I=function(){return f},f}function k(f){if(f&&f.__esModule)return f;if(f===null||V(f)!=="object"&&typeof f!="function")return{default:f};var E=I();if(E&&E.has(f))return E.get(f);var x={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in f)if(Object.prototype.hasOwnProperty.call(f,h)){var o=g?Object.getOwnPropertyDescriptor(f,h):null;o&&(o.get||o.set)?Object.defineProperty(x,h,o):x[h]=f[h]}return x.default=f,E&&E.set(f,x),x}var M={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(E){"use strict";for(var x="",g=E.length,h=g%3,o=0;o>2],x+=this.toBase64Table[((E[o]&3)<<4)+(E[o+1]>>4)],x+=this.toBase64Table[((E[o+1]&15)<<2)+(E[o+2]>>6)],x+=this.toBase64Table[E[o+2]&63];var u=g-h;return h===2?(x+=this.toBase64Table[E[u]>>2],x+=this.toBase64Table[((E[u]&3)<<4)+(E[u+1]>>4)],x+=this.toBase64Table[(E[u+1]&15)<<2],x+=this.toBase64Table[64]):h===1&&(x+=this.toBase64Table[E[u]>>2],x+=this.toBase64Table[(E[u]&3)<<4],x+=this.toBase64Table[64],x+=this.toBase64Table[64]),x},toBinaryTable:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],decode:function(E){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,g=E.indexOf("=")-x;g<0&&(g=E.length-x);for(var h=(g>>2)*3+Math.floor(g%4/1.5),o=new Array(h),u=0,r=0,n=0,t=x;t=8&&(u-=8,s||(o[n++]=r>>u&255),r&=(1<=0,ye=ge?"Cmd":"Ctrl",J=["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"],ne=(qe={},Object(x.a)(qe,ye+"-B","bold"),Object(x.a)(qe,ye+"-I","italic"),qe),q=(et={},Object(x.a)(et,Ue,"\u6DFB\u52A0\u94FE\u63A5"),Object(x.a)(et,ke,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(x.a)(et,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(x.a)(et,re,"\u6DFB\u52A0\u8868\u683C"),et),me=fe.a=function(Ce){var G=Ce.defaultValue,we=G===void 0?"":G,Ne=Ce.onChange,de=Ce.width,Se=de===void 0?"100%":de,Xe=Ce.height,lt=Xe===void 0?400:Xe,tt=Ce.miniToolbar,st=tt===void 0?!1:tt,mt=Ce.isFocus,Ct=mt===void 0?!1:mt,_t=Ce.watch,ft=Ce.insertTemp,kt=Ce.mode,Nt=kt===void 0?"markdown":kt,nt=Ce.id,Tt=nt===void 0?"markdown-editor-id":nt,It=Ce.showResizeBar,wt=It===void 0?!1:It,Ft=Ce.noStorage,zt=Ft===void 0?!1:Ft,ui=Ce.showNullButton,Pt=ui===void 0?!1:ui,xt=Ce.hidetoolBar,zi=xt===void 0?!1:xt,tr=Ce.fullScreen,xi=tr===void 0?!1:tr,Ht=Ce.onBlur,Ki=Ce.onCMBeforeChange,Yi=Ce.onFullScreen,fr=Ce.className,ht=fr===void 0?"":fr,Dt=Ce.disablePaste,pr=Dt===void 0?!1:Dt,mr=Ce.placeholder,gr=mr===void 0?"":mr,vr=Ce.values,$=vr===void 0?"":vr,F=Object(o.useState)(null),H=Object(E.a)(F,2),Y=H[0],se=H[1],Z=Object(o.useState)(we),Me=Object(E.a)(Z,2),rt=Me[0],pt=Me[1],Et=Object(o.useState)(_t),ot=Object(E.a)(Et,2),Rt=ot[0],Gt=ot[1],ei=Object(o.useState)(xi),Fi=Object(E.a)(ei,2),Ei=Fi[0],wi=Fi[1],Qi=Object(o.useState)(""),Or=Object(E.a)(Qi,2),di=Or[0],Wi=Or[1],or=Object(o.useState)(0),lr=Object(E.a)(or,2),Ui=lr[0],Ir=lr[1],_r=Object(o.useState)(lt),Xr=Object(E.a)(_r,2),zr=Xr[0],qi=Xr[1],Gi=Object(o.useState)(!1),yr=Object(E.a)(Gi,2),cn=yr[0],br=yr[1],ni=Object(o.useRef)(Object(He.a)()),Vt=Object(o.useRef)(!1),_i=Object(o.useRef)(),Kt=Object(o.useRef)(),si=Object(o.useRef)(),qt=Object(o.useRef)(),ir=Object(o.useRef)(),fi=function(){var St=Object(f.a)(h.a.mark(function Mt(){var Lt,Bt;return h.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object($e.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ni.current}});case 2:Bt=$t.sent,Bt!=null&&(Lt=Bt.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",Y,Kt),Bt.attachments.map(function(jt){jt.content_type.indexOf("image")>-1?Y.replaceSelection("![,](/api/attachments/".concat(jt.id,"?type=").concat(jt.content_type,")")):jt.content_type.indexOf("video")>-1?Y.replaceSelection('')):jt.content_type.indexOf("pdf")>-1?Y.replaceSelection('
    ').concat(jt.name,"")):Y.replaceSelection("[".concat(jt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}));case 4:case"end":return $t.stop()}},Mt)}));return function(){return St.apply(this,arguments)}}();Object(o.useEffect)(function(){pt($),Y==null||Y.setValue($)},[$]),Object(o.useEffect)(function(){Yi==null||Yi(Ei)},[Ei]),Object(o.useEffect)(function(){if(Kt.current){var St=n.a.fromTextArea(Kt.current,{mode:Nt,lineNumbers:!st,lineWrapping:!0,value:we,autoCloseTags:!0,autoCloseBrackets:!0});Ct&&St.focus();function Mt(Lt,Bt){if(pr){Bt.preventDefault();return}var Xt=Bt.clipboardData;if(Xt){var $t=Xt.types.toString(),jt=Xt.items;if($t==="Files"||Xt.types.indexOf("Files")>-1){if(Bt.preventDefault(),Nt=="stex")return;try{var hi,ki=jt[1];((hi=jt[0])===null||hi===void 0?void 0:hi.kind)==="file"&&(ki=jt[0]);var Wt=ki.getAsFile(),ur=Wt.name.split(".").pop();le(Wt,function(Yt){if(Yt.id){var Oi,Si,Vi;(Wt==null||((Oi=Wt.type)===null||Oi===void 0)?void 0:Oi.indexOf("image"))>-1?St.replaceSelection("![,](/api/attachments/".concat(Yt.id,"?type=").concat(Yt.content_type,")")):(Wt==null||((Si=Wt.type)===null||Si===void 0)?void 0:Si.indexOf("video"))>-1?St.replaceSelection('')):(Wt==null||((Vi=Wt.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?St.replaceSelection('').concat(Wt.name,"")):J.includes(ur)?St.replaceSelection('').concat(Wt.name,"")):St.replaceSelection("[".concat(Wt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})}catch(Yt){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return St.on("paste",Mt),St.on("dragleave",function(Lt,Bt){si.current.classList.remove("mouse-hover-md")}),St.on("dragover",function(Lt,Bt){si.current.classList.add("mouse-hover-md")}),St.on("drop",function(Lt,Bt){si.current.classList.add("mouse-hover-md");var Xt;if(Xt=Bt.dataTransfer.files,Xt.length>0){Bt.preventDefault(),Bt.stopPropagation();for(var $t=function(ki){var Wt=Xt[ki],ur=Wt.name.split(".").pop();le(Wt,function(Yt){if(Yt.id){var Oi,Si,Vi;(Wt==null||((Oi=Wt.type)===null||Oi===void 0)?void 0:Oi.indexOf("image"))>-1?St.replaceSelection("![,](/api/attachments/".concat(Yt.id,"?type=").concat(Yt.content_type,")")):(Wt==null||((Si=Wt.type)===null||Si===void 0)?void 0:Si.indexOf("video"))>-1?St.replaceSelection('')):(Wt==null||((Vi=Wt.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?St.replaceSelection('').concat(Wt.name,"")):J.includes(ur)?St.replaceSelection('').concat(Wt.name,"")):St.replaceSelection("[".concat(Wt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})},jt=0;jt0||jt.target.offsetWidth>0)&&(Ai(),Y.setSize("100%","100%"),Y.refresh())}}catch(hi){Xt.e(hi)}finally{Xt.f()}});return Lt.observe(Kt.current.parentElement),Lt}if(Y){var Mt=St();return function(){Mt.unobserve(Kt.current.parentElement)}}},[Y,Ai]),Object(o.useEffect)(function(){if(Y){for(var St=[],Mt=function(){var jt=Bt[Lt];Xt=Object(E.a)(jt,2);var hi=Xt[0],ki=Xt[1],Wt=Object(x.a)({},hi,function(){Gr(ki)});St.push(Wt),Y.addKeyMap(Wt)},Lt=0,Bt=Object.entries(ne);Lt0){var St=new Date().getTime(),Mt=window.sessionStorage.getItem(Tt);St>=Ui+he&&(!Mt||Mt!==rt)&&(window.sessionStorage.setItem(Tt,rt),br(!0))}},he),Object(o.useEffect)(function(){Gt(_t)},[Y,_t]),Object(o.useEffect)(function(){Y&&(Ct&&Y.focus())},[Y,Ct]),Object(o.useEffect)(function(){if(Rt&&Y){var St=Y.getScrollerElement();function Mt(Lt){var Bt=Lt.target;if(ir.current){var Xt=Bt.scrollTop/Bt.scrollHeight;ir.current.scrollTop=ir.current.scrollHeight*Xt}}return St.addEventListener("scroll",Mt),function(){St.removeEventListener("scroll",Mt)}}},[Y,Rt]),Object(o.useEffect)(function(){if(Y&&Ki){function St(Mt,Lt){Ki(Mt,Lt)}return Y.on("beforeChange",St),function(){Y.off("beforeChange",St)}}},[Y,Ki]),Object(o.useEffect)(function(){if(Y&&Ht){function St(){Ht(Y.getValue())}return Y.on("blur",St),function(){Y.off("blur",St)}}},[Y,Ht]),Object(o.useEffect)(function(){if(Y){function St(Mt){var Lt=Mt.getValue();pt(Lt),Ir(new Date().getTime()),Mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ne&&Ne(Lt)}return Y.on("change",St),function(){Y.off("change",St)}}},[Y,Ne]),Object(o.useEffect)(function(){Y&&(we==null?(Y.setValue(""),pt("")):we!==Y.getValue()&&(Y.setValue(we),pt(we),Y.setCursor(Y.lineCount(),0)))},[Y,we]);var Gr=Object(o.useCallback)(function(St){var Mt=Y.getCursor(),Lt=Y.getSelection(),Bt=Lt.split(` `);switch(St){case"bold":return Y.replaceSelection("**"+Lt+"**"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+Lt+"*"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+Lt+"`"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+Lt+"$$`"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+Lt+"\n```"),Y.setCursor(Mt.line+1,Lt.length+1),Y.focus();case"line-break":return Y.replaceSelection(`
    `),Y.focus();case"list-ul":return Lt===""?Y.replaceSelection("- "+Lt):Y.replaceSelection(Bt.map(function(Xt){return Xt===""?"":"- ".concat(Xt)}).join(` `)),Y.focus();case"list-ol":return Lt===""?Y.replaceSelection("1. "+Lt):Y.replaceSelection(Bt.map(function(Xt,$t){return Xt===""?"":"".concat($t+1,". ").concat(Xt)}).join(` `)),Y.focus();case"add-null-ch":return Lt===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.replaceSelection(Te),Y.focus();case"inster-template-1":return Lt===""&&Y.setCursor(Mt.line,Mt.ch),Y.replaceSelection(We),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return Gt(!Rt),Y.focus();case"trigger-full-screen":return wi(!Ei),Y.focus();case Ue:Wi(Ue);return;case ke:Wi(ke);return;case Pe:Wi(Pe);return;case re:Wi(re);return;default:throw new Error}},[Y,Rt,Ei]),xr=Object(o.useCallback)(function(St){Wi("");switch(di){case Ue:var Mt=St.title,Lt=St.link;return Y.replaceSelection("[".concat(Mt,"](").concat(Lt,")")),Y.focus();case ke:var Bt=St.language,Xt=St.content;return Y.replaceSelection(["```"+Bt,Xt,"```"].join(` `)),Y.focus();case Pe:var $t=St.src,jt=St.alt;return jt?Y.replaceSelection("![ ".concat(jt," ]( ").concat($t,' "').concat(jt,'" )')):Y.replaceSelection("![,](".concat($t,")")),Y.focus();case re:for(var hi=St.row,ki=St.col,Wt=St.align,ur=` `,Yt=0;Yt300&&(hi=300);var ki=lt+hi+"px";qi(ki)}}return St.addEventListener("mousedown",Bt),document.addEventListener("mousemove",$t),document.addEventListener("mouseup",Xt),function(){St.removeEventListener("mousedown",Bt),document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",Xt)}}},[Y,qt]),Object(o.useEffect)(function(){qi(lt)},[lt]);var rr=xe(Se),fn=xe(zr),Zi={width:rr,height:fn},pn=Object(o.useMemo)(function(){if(Ui){var St=new Date(Ui),Mt=St.getHours(),Lt=St.getMinutes(),Bt=St.getSeconds();return Mt=Mt<10?"0"+Mt:Mt,Lt=Lt<10?"0"+Lt:Lt,Bt=Bt<10?"0"+Bt:Bt,"".concat(Mt,":").concat(Lt,":").concat(Bt)}return 0},[Ui]);function Hn(){window.sessionStorage.removeItem(Tt),br(!1),Ir(0)}function Dr(){br(!1),Ir(0),Y.setValue(window.sessionStorage.getItem(Tt))}function ua(St,Mt){var Lt=Y.getValue();Lt=Lt.replace(St,Mt),pt(Lt),Y==null||Y.setValue(Lt)}return u.a.createElement(o.Fragment,null,u.a.createElement("div",{className:"markdown-editor-wrapper",ref:si},u.a.createElement("div",{className:"markdown-editor-container ".concat(ht," ").concat(Rt?"on-preview":""," ").concat(st?"mini":""," ").concat(Ei?"full-screen":""),style:Zi},u.a.createElement(P,{insertTemp:ft,watch:Rt,fullScreen:Ei,showNullButton:Pt,onActionCallback:Gr,hidetoolBar:zi,uuid:ni.current,setOpenPhones:function(){Vt.current=!0}}),u.a.createElement("div",{className:"markdown-editor-body"},u.a.createElement("div",{className:"codemirror-container"},u.a.createElement("textarea",{ref:Kt,placeholder:gr})),Rt?u.a.createElement("div",{ref:ir,className:"preview-container"},Nt==="stex"&&u.a.createElement(C,{value:rt}),Nt!=="stex"&&u.a.createElement(S.a,{edit:!0,value:rt,replaces:ua})):null))),wt?u.a.createElement("a",{ref:qt,className:"editor-resize"}):null,u.a.createElement(j.a,null,q[di]?u.a.createElement(L.a,{centered:!0,title:q[di],visible:!0,onCancel:Er,footer:null,className:"markdown-popup-form"},dn):null))}},P2ho:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={Again:57349,AltLeft:56,AltRight:57400,ArrowDown:57424,ArrowLeft:57419,ArrowRight:57421,ArrowUp:57416,AudioVolumeDown:57390,AudioVolumeMute:57376,AudioVolumeUp:57392,Backquote:41,Backslash:43,Backspace:14,BracketLeft:26,BracketRight:27,BrowserBack:57450,BrowserFavorites:57446,BrowserForward:57449,BrowserHome:57394,BrowserRefresh:57447,BrowserSearch:57445,BrowserStop:57448,CapsLock:58,Comma:51,ContextMenu:57437,ControlLeft:29,ControlRight:57373,Convert:121,Copy:57464,Cut:57404,Delete:57427,Digit0:11,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Eject:57469,End:57423,Enter:28,Equal:13,Escape:1,F1:59,F10:68,F11:87,F12:88,F13:93,F14:94,F15:95,F16:85,F17:57347,F18:57463,F19:57348,F2:60,F20:90,F21:116,F22:57465,F23:109,F24:111,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,Find:57409,Help:57461,Hiragana:119,Home:57415,Insert:57426,IntlBackslash:86,IntlRo:115,IntlYen:125,KanaMode:112,Katakana:120,KeyA:30,KeyB:48,KeyC:46,KeyD:32,KeyE:18,KeyF:33,KeyG:34,KeyH:35,KeyI:23,KeyJ:36,KeyK:37,KeyL:38,KeyM:50,KeyN:49,KeyO:24,KeyP:25,KeyQ:16,KeyR:19,KeyS:31,KeyT:20,KeyU:22,KeyV:47,KeyW:17,KeyX:45,KeyY:21,KeyZ:44,Lang3:120,Lang4:119,Lang5:118,LaunchApp1:57451,LaunchApp2:57377,LaunchMail:57452,MediaPlayPause:57378,MediaSelect:57453,MediaStop:57380,MediaTrackNext:57369,MediaTrackPrevious:57360,MetaLeft:57435,MetaRight:57436,Minus:12,NonConvert:123,NumLock:69,Numpad0:82,Numpad1:79,Numpad2:80,Numpad3:81,Numpad4:75,Numpad5:76,Numpad6:77,Numpad7:71,Numpad8:72,Numpad9:73,NumpadAdd:78,NumpadComma:126,NumpadDecimal:83,NumpadDivide:57397,NumpadEnter:57372,NumpadEqual:89,NumpadMultiply:55,NumpadParenLeft:57462,NumpadParenRight:57467,NumpadSubtract:74,Open:100,PageDown:57425,PageUp:57417,Paste:101,Pause:57414,Period:52,Power:57438,PrintScreen:84,Props:57350,Quote:40,ScrollLock:70,Semicolon:39,ShiftLeft:42,ShiftRight:54,Slash:53,Sleep:57439,Space:57,Suspend:57381,Tab:15,Undo:57351,WakeUp:57443};fe.default=V},QV2g:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=V;function V(){for(var k,M=[],f=0;f<256;f++){k=f;for(var E=0;E<8;E++)k=k&1?3988292384^k>>>1:k>>>1;M[f]=k}return M}var L=V();function I(k,M,f,E){var x=L,g=E+f;k^=-1;for(var h=E;h>>8^x[(k^M[h])&255];return k^-1}},SJMd:function(at,fe){/** * @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 oe,V,L,I=!1,k,M;window.PR_SHOULD_USE_CONTINUATION=!0;var f,E;(function(){var x=window,g=["break,continue,do,else,for,if,return,while"],h=[g,"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"],o=[h,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],u=[o,"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"],r=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],n=[o,"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"],t="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",i=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",l=[g,"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"],c=[g,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[g,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[u,n,r,i,s,l,c,d],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",C="kwd",v="com",y="typ",T="lit",A="pun",p="pln",D="tag",O="dec",P="src",j="atn",K="atv",U="nocode",X="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(ze){for(var Ze=0,Je=!1,$e=!1,He=0,Ue=ze.length;He122||(J<65||ye>90||ct.push([Math.max(65,ye)|32,Math.min(J,90)|32]),J<97||ye>122||ct.push([Math.max(97,ye)&~32,Math.min(J,122)&~32]))}}ct.sort(function(Ce,G){return Ce[0]-G[0]||G[1]-Ce[1]});for(var ne=[],q=[],We=0;Weme[0]&&(me[1]+1>me[0]&&Te.push("-"),Te.push(ve(me[1])))}return Te.push("]"),Te.join("")}function De(et){for(var je=et.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ct=je.length,he=[],Te=0,We=0;Te=2&&ye==="["?je[Te]=ae(xe):ye!=="\\"&&(je[Te]=xe.replace(/[a-zA-Z]/g,function(q){var me=q.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return je.join("")}for(var qe=[],He=0,Ue=ze.length;He=0;)Je[qe.charAt(et)]=De;var je=De[1],ct=""+je;re.hasOwnProperty(ct)||(ke.push(je),re[ct]=null)}ke.push(/[\0-\uffff]/),$e=B(ke)})();var He=Ze.length,Ue=function(Pe){for(var ke=Pe.sourceCode,re=Pe.basePos,ve=Pe.sourceNode,ae=[re,p],De=0,qe=ke.match($e)||[],et={},je=0,ct=qe.length;je=5&&Te.substring(0,5)==="lang-",xe&&!(We&&typeof We[1]=="string")&&(xe=!1,Te=P),xe||(et[he]=Te)}var J=De;if(De+=he.length,!xe)ae.push(re+J,Te);else{var ne=We[1],q=he.indexOf(ne),me=q+ne.length;We[2]&&(me=he.length-We[2].length,q=me-ne.length);var Ce=Te.substring(5);z(ve,re+J,he.substring(0,q),Ue,ae),z(ve,re+J+q,ne,_e(Ce,ne),ae),z(ve,re+J+me,he.substring(me),Ue,ae)}}Pe.decorations=ae};return Ue}function Fe(ze){var Ze=[],Je=[];ze.tripleQuotedStrings?Ze.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?Ze.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ze.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&Je.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var $e=ze.hashComments;$e&&(ze.cStyleComments?($e>1?Ze.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ze.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Je.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ze.push([v,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(Je.push([v,/^\/\/[^\r\n]*/,null]),Je.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=ze.regexLiterals;if(He){var Ue=He>1?"":` \r`,Pe=Ue?".":"[\\S\\s]",ke="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";Je.push(["lang-regex",RegExp("^"+X+"("+ke+")")])}var re=ze.types;re&&Je.push([y,re]);var ve=(""+ze.keywords).replace(/^ | $/g,"");ve.length&&Je.push([C,new RegExp("^(?:"+ve.replace(/[\s,]+/g,"|")+")\\b"),null]),Ze.push([p,/^\s+/,null,` \r \xA0`]);var ae="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(ae+="(?!s*/)"),Je.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[p,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[p,/^\\[\s\S]?/,null],[A,new RegExp(ae),null]),be(Ze,Je)}var Oe=Fe({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(ze,Ze,Je){for(var $e=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,Ue=ze.ownerDocument,Pe=Ue.createElement("li");ze.firstChild;)Pe.appendChild(ze.firstChild);var ke=[Pe];function re(je){var ct=je.nodeType;if(ct==1&&!$e.test(je.className))if(je.nodeName==="br")ve(je),je.parentNode&&je.parentNode.removeChild(je);else for(var he=je.firstChild;he;he=he.nextSibling)re(he);else if((ct==3||ct==4)&&Je){var Te=je.nodeValue,We=Te.match(He);if(We){var xe=Te.substring(0,We.index);je.nodeValue=xe;var ge=Te.substring(We.index+We[0].length);if(ge){var ye=je.parentNode;ye.insertBefore(Ue.createTextNode(ge),je.nextSibling)}ve(je),xe||je.parentNode.removeChild(je)}}}function ve(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function ct(We,xe){var ge=xe?We.cloneNode(!1):We,ye=We.parentNode;if(ye){var J=ct(ye,1),ne=We.nextSibling;J.appendChild(ge);for(var q=ne;q;q=ne)ne=q.nextSibling,J.appendChild(q)}return ge}for(var he=ct(je.nextSibling,0),Te;(Te=he.parentNode)&&Te.nodeType===1;)he=Te;ke.push(he)}for(var ae=0;ae=ye&&(re+=2),Ue>=J&&(De+=2)}}finally{Te&&(Te.style.display=We)}}var Ke={};function Ae(ze,Ze){for(var Je=Ze.length;--Je>=0;){var $e=Ze[Je];Ke.hasOwnProperty($e)?x.console&&console.warn("cannot override language handler %s",$e):Ke[$e]=ze}}function _e(ze,Ze){return ze&&Ke.hasOwnProperty(ze)||(ze=/^\s*]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[A,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ae(be([[p,/^[\s]+/,null,` \r `],[K,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[D,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[A,/^[=<>\/]+/],["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"]),Ae(be([],[[K,/^[\s\S]+/]]),["uq.val"]),Ae(Fe({keywords:u,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),Ae(Fe({keywords:"null,true,false"}),["json"]),Ae(Fe({keywords:n,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),Ae(Fe({keywords:r,cStyleComments:!0}),["java"]),Ae(Fe({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ae(Fe({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ae(Fe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ae(Fe({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ae(Fe({keywords:i,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ae(Fe({keywords:t,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ae(be([],[[S,/^[\s\S]+/]]),["regex"]);function le(ze){var Ze=ze.langExtension;try{var Je=N(ze.sourceNode,ze.pre),$e=Je.sourceCode;ze.sourceCode=$e,ze.spans=Je.spans,ze.basePos=0,_e(Ze,$e)(ze),Be(ze)}catch(He){x.console&&console.log(He&&He.stack||He)}}function Ee(ze,Ze,Je){var $e=Je||!1,He=Ze||null,Ue=document.createElement("div");Ue.innerHTML="
    "+ze+"
    ",Ue=Ue.firstChild,$e&&Re(Ue,$e,!0);var Pe={langExtension:He,numberLines:$e,sourceNode:Ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return le(Pe),Ue.innerHTML}function pe(ze,Ze){var Je=Ze||document.body,$e=Je.ownerDocument||document;function He(ge){return Je.getElementsByTagName(ge)}for(var Ue=[He("pre"),He("code"),He("xmp")],Pe=[],ke=0;ke=M.right?f.x=M.width-1:f.x=L-M.left,I=M.bottom?f.y=M.height-1:f.y=I-M.top,f}},SgaC:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E0;){if(o.rQwait("RRE",4+8))return!1;var t=o.rQshiftBytes(4),i=o.rQshift16(),s=o.rQshift16(),l=o.rQshift16(),c=o.rQshift16();u.fillRect(E+i,x+s,l,c,t),this._subrects--}return!0}}]),M}();fe.default=k},TXwP:function(at,fe,oe){var V,L;(function(){var I;(function(){"use strict";var M=[,,function(g){function h(r){this.__parent=r,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=[]}h.prototype.clone_empty=function(){var r=new h(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},h.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},h.prototype.has_match=function(r){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(r))return!0;return!1},h.prototype.set_indent=function(r,n){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.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)},h.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},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(r){this.__items.push(r);var n=r.lastIndexOf(` `);n!==-1?this.__character_count=r.length-n:this.__character_count+=r.length},h.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function o(r,n){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),n=n||"",r.indent_level>0&&(n=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}o.prototype.get_indent_size=function(r,n){var t=this.__base_string_length;return n=n||0,r<0&&(t=0),t+=r*this.__indent_size,t+=n,t},o.prototype.get_indent_string=function(r,n){var t=this.__base_string;return n=n||0,r<0&&(r=0,t=""),n+=r*this.__indent_size,this.__ensure_cache(n),t+=this.__cache[n],t},o.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var r=this.__cache.length,n=0,t="";this.__indent_size&&r>=this.__indent_size&&(n=Math.floor(r/this.__indent_size),r-=n*this.__indent_size,t=new Array(n+1).join(this.__indent_string)),r&&(t+=new Array(r+1).join(" ")),this.__cache.push(t)};function u(r,n){this.__indent_cache=new o(r,n),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(r,n){return this.__indent_cache.get_indent_string(r,n)},u.prototype.get_indent_size=function(r,n){return this.__indent_cache.get_indent_size(r,n)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(r){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===` `&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(` `);return r!==` `&&(t=t.replace(/[\n]/g,r)),t},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(r,n){return r=r||0,n=n||0,this.next_line.set_indent(r,n),this.__lines.length>1?(this.current_line.set_indent(r,n),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(r){for(var n=0;n1&&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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(r,n){for(var t=this.__lines.length-2;t>=0;){var i=this.__lines[t];if(i.is_empty())break;if(i.item(0).indexOf(r)!==0&&i.item(-1)!==n){this.__lines.splice(t+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},g.exports.Output=u},,,,function(g){function h(r,n){this.raw_options=o(r,n),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"])}h.prototype._get_array=function(r,n){var t=this.raw_options[r],i=n||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(i=t.concat()):typeof t=="string"&&(i=t.split(/[^a-zA-Z0-9_\/\-]+/)),i},h.prototype._get_boolean=function(r,n){var t=this.raw_options[r],i=t===void 0?!!n:!!t;return i},h.prototype._get_characters=function(r,n){var t=this.raw_options[r],i=n||"";return typeof t=="string"&&(i=t.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),i},h.prototype._get_number=function(r,n){var t=this.raw_options[r];n=parseInt(n,10),isNaN(n)&&(n=0);var i=parseInt(t,10);return isNaN(i)&&(i=n),i},h.prototype._get_selection=function(r,n,t){var i=this._get_selection_list(r,n,t);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values: `+n+` You passed in: '`+this.raw_options[r]+"'");return i[0]},h.prototype._get_selection_list=function(r,n,t){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[n[0]],!this._is_valid_selection(t,n))throw new Error("Invalid Default Value!");var i=this._get_array(r,t);if(!this._is_valid_selection(i,n))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values: `+n+` You passed in: '`+this.raw_options[r]+"'");return i},h.prototype._is_valid_selection=function(r,n){return r.length&&n.length&&!r.some(function(t){return n.indexOf(t)===-1})};function o(r,n){var t={};r=u(r);var i;for(i in r)i!==n&&(t[i]=r[i]);if(n&&r[n])for(i in r[n])t[i]=r[n][i];return t}function u(r){var n={},t;for(t in r){var i=t.replace(/-/g,"_");n[i]=r[t]}return n}g.exports.Options=h,g.exports.normalizeOpts=u,g.exports.mergeOpts=o},,function(g){var h=RegExp.prototype.hasOwnProperty("sticky");function o(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position=0&&u=0&&r=u.length&&this.__input.substring(r-u.length,r).toLowerCase()===u},g.exports.InputScanner=o},,,,,function(g){function h(o,u){o=typeof o=="string"?o:o.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+u,"g")}h.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(o);r;)u[r[1]]=r[2],r=this.__directive_pattern.exec(o);return u},h.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=h},,function(g,h,o){var u=o(16).Beautifier,r=o(17).Options;function n(t,i){var s=new u(t,i);return s.beautify()}g.exports=n,g.exports.defaultOptions=function(){return new r}},function(g,h,o){var u=o(17).Options,r=o(2).Output,n=o(8).InputScanner,t=o(13).Directives,i=new t(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,c=/\s/,d=/(?:\s|\n)+/g,w=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(C,v){this._source_text=C||"",this._options=new u(v),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"]}S.prototype.eatString=function(C){var v="";for(this._ch=this._input.next();this._ch;){if(v+=this._ch,this._ch==="\\")v+=this._input.next();else if(C.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return v},S.prototype.eatWhitespace=function(C){for(var v=c.test(this._input.peek()),y=0;c.test(this._input.peek());)this._ch=this._input.next(),C&&this._ch===` `&&((y===0||y0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,v=this._options.eol;v==="auto"&&(v=` `,C&&s.test(C||"")&&(v=C.match(s)[0])),C=C.replace(l,` `);var y=C.match(/^[\t ]*/)[0];this._output=new r(this._options,y),this._input=new n(C),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,A=!1,p=!1,D=!1,O=!1,P=!1,j=!1,K=this._ch,U=!1,X,B,N;X=this._input.read(d),B=X!=="",N=K,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),K=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(w),te=i.get_directives(z);te&&te.ignore==="start"&&(z+=i.readIgnored(this._input)),this.print_string(z),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(m)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ce=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ce.match(/[ :]$/)&&(ce=this.eatString(": ").replace(/\s$/,""),this.print_string(ce),this._output.space_before_token=!0),ce=ce.replace(/\s$/,""),ce==="extend"?O=!0:ce==="import"&&(P=!0),ce in this.NESTED_AT_RULE?(this._nestedLevel+=1,ce in this.CONDITIONAL_GROUP_RULE&&(D=!0)):!A&&T===0&&ce.indexOf(":")!==-1&&(p=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")p&&(p=!1,this.outdent()),D?(D=!1,A=this._indentLevel>=this._nestedLevel):A=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&A&&(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)):(N==="("?this._output.space_before_token=!1:N!==","&&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(),N==="{"&&this._output.trim(!0),P=!1,O=!1,p&&(this.outdent(),p=!1),this.print_string(this._ch),A=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var be=0;be"||this._ch==="+"||this._ch==="~")&&!p&&T===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&&c.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),c.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 Re=N==='"'||N==="'";this.preserveSingleSpace(Re||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&U&&this._output.add_new_line()}var Be=this._output.get_code(v);return Be},g.exports.Beautifier=S},function(g,h,o){var u=o(6).Options;function r(n){u.call(this,n,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s1&&arguments[1]!==void 0?arguments[1]:!1;try{return decodeURIComponent(escape(I))}catch(M){if(M instanceof URIError&&k)return I;throw M}}function L(I){return unescape(encodeURIComponent(I))}},"VaU+":function(at,fe,oe){at.exports={wrp:"wrp___1lJPu",header:"header___2p05v",cuttDown:"cuttDown___1-ls7",container:"container___1Nx55",info:"info___2lI6e",buttons:"buttons___3Q0yr",fullBtn:"fullBtn___18HVx",shrink:"shrink___367DS",elseShrink:"elseShrink___3Anw7",spin:"spin___3h9s3"}},"VrN/":function(at,fe,oe){(function(V,L){at.exports=L()})(this,function(){"use strict";var V=navigator.userAgent,L=navigator.platform,I=/gecko\/\d/i.test(V),k=/MSIE \d/.test(V),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(V),f=/Edge\/(\d+)/.exec(V),E=k||M||f,x=E&&(k?document.documentMode||6:+(f||M)[1]),g=!f&&/WebKit\//.test(V),h=g&&/Qt\/\d+\.\d+/.test(V),o=!f&&/Chrome\//.test(V),u=/Opera\//.test(V),r=/Apple Computer/.test(navigator.vendor),n=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(V),t=/PhantomJS/.test(V),i=!f&&/AppleWebKit/.test(V)&&/Mobile\/\w+/.test(V),s=/Android/.test(V),l=i||s||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(V),c=i||/Mac/.test(L),d=/\bCrOS\b/.test(V),w=/win/i.test(L),m=u&&V.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(u=!1,g=!0);var S=c&&(h||u&&(m==null||m<12.11)),C=I||E&&x>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,a){var b=e.className,_=v(a).exec(b);if(_){var R=b.slice(_.index+_[0].length);e.className=b.slice(0,_.index)+(R?_[1]+R:"")}};function T(e){for(var a=e.childNodes.length;a>0;--a)e.removeChild(e.firstChild);return e}function A(e,a){return T(e).appendChild(a)}function p(e,a,b,_){var R=document.createElement(e);if(b&&(R.className=b),_&&(R.style.cssText=_),typeof a=="string")R.appendChild(document.createTextNode(a));else if(a)for(var W=0;W=a)return Q+(a-W);Q+=ee-W,Q+=b-Q%b,W=ee+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,a){this.f=a;var b=+new Date+e;(!this.id||b=a)return _+Math.min(Q,a-R);if(R+=W-_,R+=b-R%b,_=W+1,R>=a)return _}}var Ae=[""];function _e(e){for(;Ae.length<=e;)Ae.push(le(Ae)+" ");return Ae[e]}function le(e){return e[e.length-1]}function Ee(e,a){for(var b=[],_=0;_"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function Je(e,a){return a?a.source.indexOf("\\w")>-1&&Ze(e)?!0:a.test(e):Ze(e)}function $e(e){for(var a in e)if(e.hasOwnProperty(a)&&e[a])return!1;return!0}var He=/[\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 Ue(e){return e.charCodeAt(0)>=768&&He.test(e)}function Pe(e,a,b){for(;(b<0?a>0:ab?-1:1;;){if(a==b)return a;var R=(a+b)/2,W=_<0?Math.ceil(R):Math.floor(R);if(W==a)return e(W)?a:b;e(W)?b=W:a=W+_}}function re(e,a,b,_){if(!e)return _(a,b,"ltr",0);for(var R=!1,W=0;Wa||a==b&&Q.to==a)&&(_(Math.max(Q.from,a),Math.min(Q.to,b),Q.level==1?"rtl":"ltr",W),R=!0)}R||_(a,b,"ltr")}var ve=null;function ae(e,a,b){var _;ve=null;for(var R=0;Ra)return R;W.to==a&&(W.from!=W.to&&b=="before"?_=R:ve=R),W.from==a&&(W.from!=W.to&&b!="before"?_=R:ve=R)}return _!=null?_:ve}var De=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",a="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function b(ue){return ue<=247?e.charAt(ue):1424<=ue&&ue<=1524?"R":1536<=ue&&ue<=1785?a.charAt(ue-1536):1774<=ue&&ue<=2220?"r":8192<=ue&&ue<=8203?"w":ue==8204?"b":"L"}var _=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,R=/[stwN]/,W=/[LRr]/,Q=/[Lb1n]/,ee=/[1n]/;function ie(ue,Le,Ie){this.level=ue,this.from=Le,this.to=Ie}return function(ue,Le){var Ie=Le=="ltr"?"L":"R";if(ue.length==0||Le=="ltr"&&!_.test(ue))return!1;for(var Qe=ue.length,Ve=[],it=0;it-1&&(_[a]=R.slice(0,W).concat(R.slice(W+1)))}}}function Te(e,a){var b=ct(e,a);if(!b.length)return;for(var _=Array.prototype.slice.call(arguments,2),R=0;R0}function ye(e){e.prototype.on=function(a,b){je(this,a,b)},e.prototype.off=function(a,b){he(this,a,b)}}function J(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ne(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function q(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){J(e),ne(e)}function Ce(e){return e.target||e.srcElement}function G(e){var a=e.which;return a==null&&(e.button&1?a=1:e.button&2?a=3:e.button&4&&(a=2)),c&&e.ctrlKey&&a==1&&(a=3),a}var we=function(){if(E&&x<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),Ne;function de(e){if(Ne==null){var a=p("span","\u200B");A(e,p("span",[a,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ne=a.offsetWidth<=1&&a.offsetHeight>2&&!(E&&x<8))}var b=Ne?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return b.setAttribute("cm-text",""),b}var Se;function Xe(e){if(Se!=null)return Se;var a=A(e,document.createTextNode("A\u062EA")),b=O(a,0,1).getBoundingClientRect(),_=O(a,1,2).getBoundingClientRect();return T(e),!b||b.left==b.right?!1:Se=_.right-b.right<3}var lt=` b`.split(/\n/).length!=3?function(e){for(var a=0,b=[],_=e.length;a<=_;){var R=e.indexOf(` `,a);R==-1&&(R=e.length);var W=e.slice(a,e.charAt(R-1)=="\r"?R-1:R),Q=W.indexOf("\r");Q!=-1?(b.push(W.slice(0,Q)),a+=Q+1):(b.push(W),a=R+1)}return b}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(a){return!1}}:function(e){var a;try{a=e.ownerDocument.selection.createRange()}catch(b){}return!a||a.parentElement()!=e?!1:a.compareEndPoints("StartToEnd",a)!=0},st=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),mt=null;function Ct(e){if(mt!=null)return mt;var a=A(e,p("span","x")),b=a.getBoundingClientRect(),_=O(a,0,1).getBoundingClientRect();return mt=Math.abs(b.left-_.left)>1}var _t={},ft={};function kt(e,a){arguments.length>2&&(a.dependencies=Array.prototype.slice.call(arguments,2)),_t[e]=a}function Nt(e,a){ft[e]=a}function nt(e){if(typeof e=="string"&&ft.hasOwnProperty(e))e=ft[e];else if(e&&typeof e.name=="string"&&ft.hasOwnProperty(e.name)){var a=ft[e.name];typeof a=="string"&&(a={name:a}),e=Ye(a,e),e.name=a.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return nt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return nt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Tt(e,a){a=nt(a);var b=_t[a.name];if(!b)return Tt(e,"text/plain");var _=b(e,a);if(It.hasOwnProperty(a.name)){var R=It[a.name];for(var W in R){if(!R.hasOwnProperty(W))continue;_.hasOwnProperty(W)&&(_["_"+W]=_[W]),_[W]=R[W]}}if(_.name=a.name,a.helperType&&(_.helperType=a.helperType),a.modeProps)for(var Q in a.modeProps)_[Q]=a.modeProps[Q];return _}var It={};function wt(e,a){var b=It.hasOwnProperty(e)?It[e]:It[e]={};N(a,b)}function Ft(e,a){if(a===!0)return a;if(e.copyState)return e.copyState(a);var b={};for(var _ in a){var R=a[_];R instanceof Array&&(R=R.concat([])),b[_]=R}return b}function zt(e,a){for(var b;e.innerMode&&!(b=e.innerMode(a),!b||b.mode==e);)a=b.state,e=b.mode;return b||{mode:e,state:a}}function ui(e,a,b){return e.startState?e.startState(a,b):!0}var Pt=function(e,a,b){this.pos=this.start=0,this.string=e,this.tabSize=a||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=b};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.posa},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var a=this.string.indexOf(e,this.pos);if(a>-1)return this.pos=a,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos0?null:(W&&a!==!1&&(this.pos+=W[0].length),W)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,a){this.lineStart+=e;try{return a()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var a=this.lineOracle;return a&&a.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function xt(e,a){if(a-=e.first,a<0||a>=e.size)throw new Error("There is no line "+(a+e.first)+" in the document.");for(var b=e;!b.lines;)for(var _=0;;++_){var R=b.children[_],W=R.chunkSize();if(a=e.first&&ab?ht(b,xt(e,b).text.length):H(a,xt(e,a.line).text.length)}function H(e,a){var b=e.ch;return b==null||b>a?ht(e.line,a):b<0?ht(e.line,0):e}function Y(e,a){for(var b=[],_=0;_this.maxLookAhead&&(this.maxLookAhead=e),a},Z.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var a=this.baseTokens[this.baseTokenPos+1];return{type:a&&a.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Z.fromSaved=function(e,a,b){return a instanceof se?new Z(e,Ft(e.mode,a.state),b,a.lookAhead):new Z(e,Ft(e.mode,a),b)},Z.prototype.save=function(e){var a=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new se(a,this.maxLookAhead):a};function Me(e,a,b,_){var R=[e.state.modeGen],W={};Ei(e,a.text,e.doc.mode,b,function(ue,Le){return R.push(ue,Le)},W,_);for(var Q=b.state,ee=function(ue){b.baseTokens=R;var Le=e.state.overlays[ue],Ie=1,Qe=0;b.state=!0,Ei(e,a.text,Le.mode,b,function(Ve,it){for(var ut=Ie;QeVe&&R.splice(Ie,1,Ve,R[Ie+1],dt),Ie+=2,Qe=Math.min(Ve,dt)}if(!it)return;if(Le.opaque)R.splice(ut,Ie-ut,Ve,"overlay "+it),Ie=ut+2;else for(;ute.options.maxHighlightLength&&Ft(e.doc.mode,_.state),W=Me(e,a,_);R&&(_.state=R),a.stateAfter=_.save(!R),a.styles=W.styles,W.classes?a.styleClasses=W.classes:a.styleClasses&&(a.styleClasses=null),b===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return a.styles}function pt(e,a,b){var _=e.doc,R=e.display;if(!_.mode.startState)return new Z(_,!0,a);var W=wi(e,a,b),Q=W>_.first&&xt(_,W-1).stateAfter,ee=Q?Z.fromSaved(_,Q,W):new Z(_,ui(_.mode),W);return _.iter(W,a,function(ie){Et(e,ie.text,ee);var ue=ee.line;ie.stateAfter=ue==a-1||ue%5==0||ue>=R.viewFrom&&uea.start)return W}throw new Error("Mode "+e.name+" failed to advance stream.")}var Gt=function(e,a,b){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=a||null,this.state=b};function ei(e,a,b,_){var R=e.doc,W=R.mode,Q;a=F(R,a);var ee=xt(R,a.line),ie=pt(e,a.line,b),ue=new Pt(ee.text,e.options.tabSize,ie),Le;for(_&&(Le=[]);(_||ue.pose.options.maxHighlightLength?(ee=!1,Q&&Et(e,a,_,Le.pos),Le.pos=a.length,Ie=null):Ie=Fi(Rt(b,Le,_.state,Qe),W),Qe){var Ve=Qe[0].name;Ve&&(Ie="m-"+(Ie?Ve+" "+Ie:Ve))}if(!ee||ue!=Ie){for(;ieQ;--ee){if(ee<=W.first)return W.first;var ie=xt(W,ee-1),ue=ie.stateAfter;if(ue&&(!b||ee+(ue instanceof se?ue.lookAhead:0)<=W.modeFrontier))return ee;var Le=z(ie.text,null,e.options.tabSize);(R==null||_>Le)&&(R=ee-1,_=Le)}return R}function Qi(e,a){if(e.modeFrontier=Math.min(e.modeFrontier,a),e.highlightFrontierb;_--){var R=xt(e,_).stateAfter;if(R&&(!(R instanceof se)||_+R.lookAhead=a:W.to>a);(_||(_=[])).push(new lr(Q,W.from,ie?null:W.to))}}return _}function zr(e,a,b){var _;if(e)for(var R=0;R=a:W.to>a);if(ee||W.from==a&&Q.type=="bookmark"&&(!b||W.marker.insertLeft)){var ie=W.from==null||(Q.inclusiveLeft?W.from<=a:W.from0&&ee)for(var bt=0;bt0)continue;var Le=[ie,1],Ie=Dt(ue.from,ee.from),Qe=Dt(ue.to,ee.to);(Ie<0||!Q.inclusiveLeft&&!Ie)&&Le.push({from:ue.from,to:ee.from}),(Qe>0||!Q.inclusiveRight&&!Qe)&&Le.push({from:ee.to,to:ue.to}),R.splice.apply(R,Le),ie+=Le.length-3}return R}function cn(e){var a=e.markedSpans;if(!a)return;for(var b=0;ba)&&(!_||_i(_,W.marker)<0)&&(_=W.marker)}return _}function fi(e,a,b,_,R){var W=xt(e,a),Q=di&&W.markedSpans;if(Q)for(var ee=0;ee=0&&Ie<=0||Le<=0&&Ie>=0)continue;if(Le<=0&&(ie.marker.inclusiveRight&&R.inclusiveLeft?Dt(ue.to,b)>=0:Dt(ue.to,b)>0)||Le>=0&&(ie.marker.inclusiveRight&&R.inclusiveLeft?Dt(ue.from,_)<=0:Dt(ue.from,_)<0))return!0}}function Ai(e){for(var a;a=si(e);)e=a.find(-1,!0).line;return e}function Gr(e){for(var a;a=qt(e);)e=a.find(1,!0).line;return e}function xr(e){for(var a,b;a=qt(e);)e=a.find(1,!0).line,(b||(b=[])).push(e);return b}function dn(e,a){var b=xt(e,a),_=Ai(b);return b==_?a:Ht(_)}function Er(e,a){if(a>e.lastLine())return a;var b=xt(e,a),_;if(!rr(e,b))return a;for(;_=qt(b);)b=_.find(1,!0).line;return Ht(b)+1}function rr(e,a){var b=di&&a.markedSpans;if(b)for(var _=void 0,R=0;Ra.maxLineLength&&(a.maxLineLength=R,a.maxLine=_)})}var Dr=function(e,a,b){this.text=e,br(this,a),this.height=b?b(this):1};Dr.prototype.lineNo=function(){return Ht(this)},ye(Dr);function ua(e,a,b,_){e.text=a,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),cn(e),br(e,b);var R=_?_(e):1;R!=e.height&&xi(e,R)}function St(e){e.parent=null,cn(e)}var Mt={},Lt={};function Bt(e,a){if(!e||/^\s*$/.test(e))return null;var b=a.addModeClass?Lt:Mt;return b[e]||(b[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,a){var b=D("span",null,null,g?"padding-right: .1px":null),_={pre:D("pre",[b],"CodeMirror-line"),content:b,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};a.measure={};for(var R=0;R<=(a.rest?a.rest.length:0);R++){var W=R?a.rest[R-1]:a.line,Q=void 0;_.pos=0,_.addToken=jt,Xe(e.display.measure)&&(Q=qe(W,e.doc.direction))&&(_.addToken=ki(_.addToken,Q)),_.map=[];var ee=a!=e.display.externalMeasured&&Ht(W);ur(W,_,rt(e,W,ee)),W.styleClasses&&(W.styleClasses.bgClass&&(_.bgClass=U(W.styleClasses.bgClass,_.bgClass||"")),W.styleClasses.textClass&&(_.textClass=U(W.styleClasses.textClass,_.textClass||""))),_.map.length==0&&_.map.push(0,0,_.content.appendChild(de(e.display.measure))),R==0?(a.measure.map=_.map,a.measure.cache={}):((a.measure.maps||(a.measure.maps=[])).push(_.map),(a.measure.caches||(a.measure.caches=[])).push({}))}if(g){var ie=_.content.lastChild;(/\bcm-tab\b/.test(ie.className)||ie.querySelector&&ie.querySelector(".cm-tab"))&&(_.content.className="cm-tab-wrap-hack")}return Te(e,"renderLine",e,a.line,_.pre),_.pre.className&&(_.textClass=U(_.pre.className,_.textClass||"")),_}function $t(e){var a=p("span","\u2022","cm-invalidchar");return a.title="\\u"+e.charCodeAt(0).toString(16),a.setAttribute("aria-label",a.title),a}function jt(e,a,b,_,R,W,Q){if(!a)return;var ee=e.splitSpaces?hi(a,e.trailingSpace):a,ie=e.cm.state.specialChars,ue=!1,Le;if(!ie.test(a))e.col+=a.length,Le=document.createTextNode(ee),e.map.push(e.pos,e.pos+a.length,Le),E&&x<9&&(ue=!0),e.pos+=a.length;else{Le=document.createDocumentFragment();for(var Ie=0;;){ie.lastIndex=Ie;var Qe=ie.exec(a),Ve=Qe?Qe.index-Ie:a.length-Ie;if(Ve){var it=document.createTextNode(ee.slice(Ie,Ie+Ve));E&&x<9?Le.appendChild(p("span",[it])):Le.appendChild(it),e.map.push(e.pos,e.pos+Ve,it),e.col+=Ve,e.pos+=Ve}if(!Qe)break;Ie+=Ve+1;var ut=void 0;if(Qe[0]==" "){var dt=e.cm.options.tabSize,gt=dt-e.col%dt;ut=Le.appendChild(p("span",_e(gt),"cm-tab")),ut.setAttribute("role","presentation"),ut.setAttribute("cm-text"," "),e.col+=gt}else Qe[0]=="\r"||Qe[0]==` `?(ut=Le.appendChild(p("span",Qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ut.setAttribute("cm-text",Qe[0]),e.col+=1):(ut=e.cm.options.specialCharPlaceholder(Qe[0]),ut.setAttribute("cm-text",Qe[0]),E&&x<9?Le.appendChild(p("span",[ut])):Le.appendChild(ut),e.col+=1);e.map.push(e.pos,e.pos+1,ut),e.pos++}}if(e.trailingSpace=ee.charCodeAt(a.length-1)==32,b||_||R||ue||W||Q){var yt=b||"";_&&(yt+=_),R&&(yt+=R);var vt=p("span",[Le],yt,W);if(Q)for(var bt in Q)Q.hasOwnProperty(bt)&&bt!="style"&&bt!="class"&&vt.setAttribute(bt,Q[bt]);return e.content.appendChild(vt)}e.content.appendChild(Le)}function hi(e,a){if(e.length>1&&!/ /.test(e))return e;for(var b=a,_="",R=0;Rue&&Ie.from<=ue);Qe++);if(Ie.to>=Le)return e(b,_,R,W,Q,ee,ie);e(b,_.slice(0,Ie.to-ue),R,W,null,ee,ie),W=null,_=_.slice(Ie.to-ue),ue=Ie.to}}}function Wt(e,a,b,_){var R=!_&&b.widgetNode;R&&e.map.push(e.pos,e.pos+a,R),!_&&e.cm.display.input.needsContentAttribute&&(R||(R=e.content.appendChild(document.createElement("span"))),R.setAttribute("cm-marker",b.id)),R&&(e.cm.display.input.setUneditable(R),e.content.appendChild(R)),e.pos+=a,e.trailingSpace=!1}function ur(e,a,b){var _=e.markedSpans,R=e.text,W=0;if(!_){for(var Q=1;Qie||Ut.collapsed&&At.to==ie&&At.from==ie)){if(At.to!=null&&At.to!=ie&&Ve>At.to&&(Ve=At.to,ut=""),Ut.className&&(it+=" "+Ut.className),Ut.css&&(Qe=(Qe?Qe+";":"")+Ut.css),Ut.startStyle&&At.from==ie&&(dt+=" "+Ut.startStyle),Ut.endStyle&&At.to==Ve&&(bt||(bt=[])).push(Ut.endStyle,At.to),Ut.title&&((yt||(yt={})).title=Ut.title),Ut.attributes)for(var Jt in Ut.attributes)(yt||(yt={}))[Jt]=Ut.attributes[Jt];Ut.collapsed&&(!gt||_i(gt.marker,Ut)<0)&&(gt=At)}else At.from>ie&&Ve>At.from&&(Ve=At.from)}if(bt)for(var gi=0;gi=ee)break;for(var Hi=Math.min(ee,Ve);;){if(Le){var Mi=ie+Le.length;if(!gt){var oi=Mi>Hi?Le.slice(0,Hi-ie):Le;a.addToken(a,oi,Ie?Ie+it:it,dt,ie+oi.length==Ve?ut:"",Qe,yt)}if(Mi>=Hi){Le=Le.slice(Hi-ie),ie=Hi;break}ie=Mi,dt=""}Le=R.slice(W,W=b[ue++]),Ie=Bt(b[ue++],a.cm.options)}}}function Yt(e,a,b){this.line=a,this.rest=xr(a),this.size=this.rest?Ht(le(this.rest))-b+1:1,this.node=this.text=null,this.hidden=rr(e,a)}function Oi(e,a,b){for(var _=[],R,W=a;W2&&W.push((ie.bottom+ue.top)/2-b.top)}}W.push(b.bottom-b.top)}}function es(e,a,b){if(e.line==a)return{map:e.measure.map,cache:e.measure.cache};for(var _=0;_b)return{map:e.measure.maps[R],cache:e.measure.caches[R],before:!0}}function Bo(e,a){a=Ai(a);var b=Ht(a),_=e.display.externalMeasured=new Yt(e.doc,a,b);_.lineN=b;var R=_.built=Xt(e,_);return _.text=R.pre,A(e.display.lineMeasure,R.pre),_}function ts(e,a,b,_){return ar(e,Vr(e,a),b,_)}function fa(e,a){if(a>=e.display.viewFrom&&a=b.lineN&&aa)&&(W=ie-ee,R=W-1,a>=ie&&(Q="right")),R!=null){if(_=e[ue+2],ee==ie&&b==(_.insertLeft?"left":"right")&&(Q=b),b=="left"&&R==0)for(;ue&&e[ue-2]==e[ue-3]&&e[ue-1].insertLeft;)_=e[(ue-=3)+2],Q="left";if(b=="right"&&R==ie-ee)for(;ue=0&&!((b=e[R]).left!=b.right);R--);return b}function Ko(e,a,b,_){var R=rs(a.map,b,_),W=R.node,Q=R.start,ee=R.end,ie=R.collapse,ue;if(W.nodeType==3){for(var Le=0;Le<4;Le++){for(;Q&&Ue(a.line.text.charAt(R.coverStart+Q));)--Q;for(;R.coverStart+ee0&&(ie=_="right");var Ie;e.options.lineWrapping&&(Ie=W.getClientRects()).length>1?ue=Ie[_=="right"?Ie.length-1:0]:ue=W.getBoundingClientRect()}if(E&&x<9&&!Q&&(!ue||!ue.left&&!ue.right)){var Qe=W.parentNode.getClientRects()[0];Qe?ue={left:Qe.left,right:Qe.left+Qr(e.display),top:Qe.top,bottom:Qe.bottom}:ue=is}for(var Ve=ue.top-a.rect.top,it=ue.bottom-a.rect.top,ut=(Ve+it)/2,dt=a.view.measure.heights,gt=0;gt=_.text.length?(ie=_.text.length,ue="before"):ie<=0&&(ie=0,ue="after"),!ee)return Q(ue=="before"?ie-1:ie,ue=="before");function Le(it,ut,dt){var gt=ee[ut],yt=gt.level==1;return Q(dt?it-1:it,yt!=dt)}var Ie=ae(ee,ie,ue),Qe=ve,Ve=Le(ie,Ie,ue=="before");return Qe!=null&&(Ve.other=Le(ie,Qe,ue!="before")),Ve}function us(e,a){var b=0;a=F(e.doc,a),e.options.lineWrapping||(b=Qr(e.display)*a.ch);var _=xt(e.doc,a.line),R=Zi(_)+Kn(e.display);return{left:b,right:b,top:R,bottom:R+_.height}}function ga(e,a,b,_,R){var W=ht(e,a,b);return W.xRel=R,_&&(W.outside=_),W}function va(e,a,b){var _=e.doc;if(b+=e.display.viewOffset,b<0)return ga(_.first,0,null,-1,-1);var R=Ki(_,b),W=_.first+_.size-1;if(R>W)return ga(_.first+_.size-1,xt(_,W).text.length,null,1,1);a<0&&(a=0);for(var Q=xt(_,R);;){var ee=jo(e,Q,R,a,b),ie=ir(Q,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!ie)return ee;var ue=ie.find(1);if(ue.line==R)return ue;Q=xt(_,R=ue.line)}}function hs(e,a,b,_){_-=pa(a);var R=a.text.length,W=ke(function(Q){return ar(e,b,Q-1).bottom<=_},R,0);return R=ke(function(Q){return ar(e,b,Q).top>_},W,R),{begin:W,end:R}}function cs(e,a,b,_){b||(b=Vr(e,a));var R=Wn(e,a,ar(e,b,_),"line").top;return hs(e,a,b,R)}function _a(e,a,b,_){return e.bottom<=b?!1:e.top>b?!0:(_?e.left:e.right)>a}function jo(e,a,b,_,R){R-=Zi(a);var W=Vr(e,a),Q=pa(a),ee=0,ie=a.text.length,ue=!0,Le=qe(a,e.doc.direction);if(Le){var Ie=(e.options.lineWrapping?zo:Xo)(e,a,b,W,Le,_,R);ue=Ie.level!=1,ee=ue?Ie.from:Ie.to-1,ie=ue?Ie.to:Ie.from-1}var Qe=null,Ve=null,it=ke(function(Ot){var At=ar(e,W,Ot);return At.top+=Q,At.bottom+=Q,_a(At,_,R,!1)?(At.top<=R&&At.left<=_&&(Qe=Ot,Ve=At),!0):!1},ee,ie),ut,dt,gt=!1;if(Ve){var yt=_-Ve.left=bt.bottom?1:0}return it=Pe(a.text,it,1),ga(b,it,dt,gt,_-ut)}function Xo(e,a,b,_,R,W,Q){var ee=ke(function(Ie){var Qe=R[Ie],Ve=Qe.level!=1;return _a($i(e,ht(b,Ve?Qe.to:Qe.from,Ve?"before":"after"),"line",a,_),W,Q,!0)},0,R.length-1),ie=R[ee];if(ee>0){var ue=ie.level!=1,Le=$i(e,ht(b,ue?ie.from:ie.to,ue?"after":"before"),"line",a,_);_a(Le,W,Q,!0)&&Le.top>Q&&(ie=R[ee-1])}return ie}function zo(e,a,b,_,R,W,Q){var ee=hs(e,a,_,Q),ie=ee.begin,ue=ee.end;/\s/.test(a.text.charAt(ue-1))&&ue--;for(var Le=null,Ie=null,Qe=0;Qe=ue||Ve.to<=ie)continue;var it=Ve.level!=1,ut=ar(e,_,it?Math.min(ue,Ve.to)-1:Math.max(ie,Ve.from)).right,dt=utdt)&&(Le=Ve,Ie=dt)}return Le||(Le=R[R.length-1]),Le.fromue&&(Le={from:Le.from,to:ue,level:Le.level}),Le}var Pr;function Yr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pr==null){Pr=p("pre",null,"CodeMirror-line-like");for(var a=0;a<49;++a)Pr.appendChild(document.createTextNode("x")),Pr.appendChild(p("br"));Pr.appendChild(document.createTextNode("x"))}A(e.measure,Pr);var b=Pr.offsetHeight/50;return b>3&&(e.cachedTextHeight=b),T(e.measure),b||1}function Qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var a=p("span","xxxxxxxxxx"),b=p("pre",[a],"CodeMirror-line-like");A(e.measure,b);var _=a.getBoundingClientRect(),R=(_.right-_.left)/10;return R>2&&(e.cachedCharWidth=R),R||10}function ya(e){for(var a=e.display,b={},_={},R=a.gutters.clientLeft,W=a.gutters.firstChild,Q=0;W;W=W.nextSibling,++Q){var ee=e.display.gutterSpecs[Q].className;b[ee]=W.offsetLeft+W.clientLeft+R,_[ee]=W.clientWidth}return{fixedPos:ba(a),gutterTotalWidth:a.gutters.offsetWidth,gutterLeft:b,gutterWidth:_,wrapperWidth:a.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var a=Yr(e.display),b=e.options.lineWrapping,_=b&&Math.max(5,e.display.scroller.clientWidth/Qr(e.display)-3);return function(R){if(rr(e.doc,R))return 0;var W=0;if(R.widgets)for(var Q=0;Q0&&(ue=xt(e.doc,ie.line).text).length==ie.ch){var Le=z(ue,ue.length,e.options.tabSize)-ue.length;ie=ht(ie.line,Math.max(0,Math.round((W-Ja(e.display).left)/Qr(e.display))-Le))}return ie}function Fr(e,a){if(a>=e.display.viewTo)return null;if(a-=e.display.viewFrom,a<0)return null;for(var b=e.display.view,_=0;_a)&&(R.updateLineNumbers=a),e.curOp.viewChanged=!0,a>=R.viewTo)di&&dn(e.doc,a)R.viewFrom?Sr(e):(R.viewFrom+=_,R.viewTo+=_);else if(a<=R.viewFrom&&b>=R.viewTo)Sr(e);else if(a<=R.viewFrom){var W=jn(e,b,b+_,1);W?(R.view=R.view.slice(W.index),R.viewFrom=W.lineN,R.viewTo+=_):Sr(e)}else if(b>=R.viewTo){var Q=jn(e,a,a,-1);Q?(R.view=R.view.slice(0,Q.index),R.viewTo=Q.lineN):Sr(e)}else{var ee=jn(e,a,a,-1),ie=jn(e,b,b+_,1);ee&&ie?(R.view=R.view.slice(0,ee.index).concat(Oi(e,ee.lineN,ie.lineN)).concat(R.view.slice(ie.index)),R.viewTo+=_):Sr(e)}var ue=R.externalMeasured;ue&&(b=R.lineN&&a=_.viewTo)return;var W=_.view[Fr(e,a)];if(W.node==null)return;var Q=W.changes||(W.changes=[]);ce(Q,b)==-1&&Q.push(b)}function Sr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jn(e,a,b,_){var R=Fr(e,a),W,Q=e.display.view;if(!di||b==e.doc.first+e.doc.size)return{index:R,lineN:b};for(var ee=e.display.viewFrom,ie=0;ie0){if(R==Q.length-1)return null;W=ee+Q[R].size-a,R++}else W=ee-a;a+=W,b+=W}for(;dn(e.doc,b)!=b;){if(R==(_<0?0:Q.length-1))return null;b+=_*Q[R-(_<0?1:0)].size,R+=_}return{index:R,lineN:b}}function Go(e,a,b){var _=e.display,R=_.view;R.length==0||a>=_.viewTo||b<=_.viewFrom?(_.view=Oi(e,a,b),_.viewFrom=a):(_.viewFrom>a?_.view=Oi(e,a,_.viewFrom).concat(_.view):_.viewFromb&&(_.view=_.view.slice(0,Fr(e,b)))),_.viewTo=b}function fs(e){for(var a=e.display.view,b=0,_=0;_=e.display.viewTo||ee.to().line0?a.blinker=setInterval(function(){e.hasFocus()||qr(e),a.cursorDiv.style.visibility=(b=!b)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(a.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),wa(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qr(e))},100)}function wa(e,a){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Te(e,"focus",e,a),e.state.focused=!0,K(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ea(e)}function qr(e,a){if(e.state.delayingBlurEvent)return;e.state.focused&&(Te(e,"blur",e,a),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zn(e){for(var a=e.display,b=a.lineDiv.offsetTop,_=0;_.005||Le<-.005)&&(xi(R.line,Q),_s(R.line),R.rest))for(var Ie=0;Iee.display.sizerWidth){var Qe=Math.ceil(ee/Qr(e.display));Qe>e.display.maxLineLength&&(e.display.maxLineLength=Qe,e.display.maxLine=R.line,e.display.maxLineChanged=!0)}}}function _s(e){if(e.widgets)for(var a=0;a=Q&&(W=Ki(a,Zi(xt(a,ie))-e.wrapper.clientHeight),Q=ie)}return{from:W,to:Math.max(Q,W+1)}}function Yo(e,a){if(We(e,"scrollCursorIntoView"))return;var b=e.display,_=b.sizer.getBoundingClientRect(),R=null;if(a.top+_.top<0?R=!0:a.bottom+_.top>(window.innerHeight||document.documentElement.clientHeight)&&(R=!1),R!=null&&!t){var W=p("div","\u200B",null,`position: absolute; top: `+(a.top-b.viewOffset-Kn(e.display))+`px; height: `+(a.bottom-a.top+nr(e)+b.barHeight)+`px; left: `+a.left+"px; width: "+Math.max(2,a.right-a.left)+"px;");e.display.lineSpace.appendChild(W),W.scrollIntoView(R),e.display.lineSpace.removeChild(W)}}function Qo(e,a,b,_){_==null&&(_=0);var R;!e.options.lineWrapping&&a==b&&(a=a.ch?ht(a.line,a.sticky=="before"?a.ch-1:a.ch,"after"):a,b=a.sticky=="before"?ht(a.line,a.ch+1,"before"):a);for(var W=0;W<5;W++){var Q=!1,ee=$i(e,a),ie=!b||b==a?ee:$i(e,b);R={left:Math.min(ee.left,ie.left),top:Math.min(ee.top,ie.top)-_,right:Math.max(ee.left,ie.left),bottom:Math.max(ee.bottom,ie.bottom)+_};var ue=Sa(e,R),Le=e.doc.scrollTop,Ie=e.doc.scrollLeft;if(ue.scrollTop!=null&&(xn(e,ue.scrollTop),Math.abs(e.doc.scrollTop-Le)>1&&(Q=!0)),ue.scrollLeft!=null&&(Ur(e,ue.scrollLeft),Math.abs(e.doc.scrollLeft-Ie)>1&&(Q=!0)),!Q)break}return R}function qo(e,a){var b=Sa(e,a);b.scrollTop!=null&&xn(e,b.scrollTop),b.scrollLeft!=null&&Ur(e,b.scrollLeft)}function Sa(e,a){var b=e.display,_=Yr(e.display);a.top<0&&(a.top=0);var R=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:b.scroller.scrollTop,W=da(e),Q={};a.bottom-a.top>W&&(a.bottom=a.top+W);var ee=e.doc.height+ca(b),ie=a.top<_,ue=a.bottom>ee-_;if(a.topR+W){var Le=Math.min(a.top,(ue?ee:a.bottom)-W);Le!=R&&(Q.scrollTop=Le)}var Ie=e.options.fixedGutter?0:b.gutters.offsetWidth,Qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:b.scroller.scrollLeft-Ie,Ve=Mr(e)-b.gutters.offsetWidth,it=a.right-a.left>Ve;return it&&(a.right=a.left+Ve),a.left<10?Q.scrollLeft=0:a.leftVe+Qe-3&&(Q.scrollLeft=a.right+(it?0:10)-Ve),Q}function Ta(e,a){if(a==null)return;Vn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+a}function Zr(e){Vn(e);var a=e.getCursor();e.curOp.scrollToPos={from:a,to:a,margin:e.options.cursorScrollMargin}}function bn(e,a,b){(a!=null||b!=null)&&Vn(e),a!=null&&(e.curOp.scrollLeft=a),b!=null&&(e.curOp.scrollTop=b)}function Zo(e,a){Vn(e),e.curOp.scrollToPos=a}function Vn(e){var a=e.curOp.scrollToPos;if(a){e.curOp.scrollToPos=null;var b=us(e,a.from),_=us(e,a.to);ys(e,b,_,a.margin)}}function ys(e,a,b,_){var R=Sa(e,{left:Math.min(a.left,b.left),top:Math.min(a.top,b.top)-_,right:Math.max(a.right,b.right),bottom:Math.max(a.bottom,b.bottom)+_});bn(e,R.scrollLeft,R.scrollTop)}function xn(e,a){if(Math.abs(e.doc.scrollTop-a)<2)return;I||Aa(e,{top:a}),bs(e,a,!0),I&&Aa(e),Sn(e,100)}function bs(e,a,b){if(a=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,a)),e.display.scroller.scrollTop==a&&!b)return;e.doc.scrollTop=a,e.display.scrollbars.setScrollTop(a),e.display.scroller.scrollTop!=a&&(e.display.scroller.scrollTop=a)}function Ur(e,a,b,_){if(a=Math.max(0,Math.min(a,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(b?a==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-a)<2)&&!_)return;e.doc.scrollLeft=a,Ts(e),e.display.scroller.scrollLeft!=a&&(e.display.scroller.scrollLeft=a),e.display.scrollbars.setScrollLeft(a)}function En(e){var a=e.display,b=a.gutters.offsetWidth,_=Math.round(e.doc.height+ca(e.display));return{clientHeight:a.scroller.clientHeight,viewHeight:a.wrapper.clientHeight,scrollWidth:a.scroller.scrollWidth,clientWidth:a.scroller.clientWidth,viewWidth:a.wrapper.clientWidth,barLeft:e.options.fixedGutter?b:0,docHeight:_,scrollHeight:_+nr(e)+a.barHeight,nativeBarWidth:a.nativeBarWidth,gutterWidth:b}}var Br=function(e,a,b){this.cm=b;var _=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),R=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");_.tabIndex=R.tabIndex=-1,e(_),e(R),je(_,"scroll",function(){_.clientHeight&&a(_.scrollTop,"vertical")}),je(R,"scroll",function(){R.clientWidth&&a(R.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var a=e.scrollWidth>e.clientWidth+1,b=e.scrollHeight>e.clientHeight+1,_=e.nativeBarWidth;if(b){this.vert.style.display="block",this.vert.style.bottom=a?_+"px":"0";var R=e.viewHeight-(a?_:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+R)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(a){this.horiz.style.display="block",this.horiz.style.right=b?_+"px":"0",this.horiz.style.left=e.barLeft+"px";var W=e.viewWidth-e.barLeft-(b?_:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+W)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(_==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:b?_:0,bottom:a?_:0}},Br.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var e=c&&!n?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},Br.prototype.enableZeroWidthBar=function(e,a,b){e.style.pointerEvents="auto";function _(){var R=e.getBoundingClientRect(),W=b=="vert"?document.elementFromPoint(R.right-1,(R.top+R.bottom)/2):document.elementFromPoint((R.right+R.left)/2,R.bottom-1);W!=e?e.style.pointerEvents="none":a.set(1e3,_)}a.set(1e3,_)},Br.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wn=function(){};wn.prototype.update=function(){return{bottom:0,right:0}},wn.prototype.setScrollLeft=function(){},wn.prototype.setScrollTop=function(){},wn.prototype.clear=function(){};function $r(e,a){a||(a=En(e));var b=e.display.barWidth,_=e.display.barHeight;xs(e,a);for(var R=0;R<4&&b!=e.display.barWidth||_!=e.display.barHeight;R++)b!=e.display.barWidth&&e.options.lineWrapping&&zn(e),xs(e,En(e)),b=e.display.barWidth,_=e.display.barHeight}function xs(e,a){var b=e.display,_=b.scrollbars.update(a);b.sizer.style.paddingRight=(b.barWidth=_.right)+"px",b.sizer.style.paddingBottom=(b.barHeight=_.bottom)+"px",b.heightForcer.style.borderBottom=_.bottom+"px solid transparent",_.right&&_.bottom?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=_.bottom+"px",b.scrollbarFiller.style.width=_.right+"px"):b.scrollbarFiller.style.display="",_.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=_.bottom+"px",b.gutterFiller.style.width=a.gutterWidth+"px"):b.gutterFiller.style.display=""}var Es={native:Br,null:wn};function ws(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Es[e.options.scrollbarStyle](function(a){e.display.wrapper.insertBefore(a,e.display.scrollbarFiller),je(a,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,b){b=="horizontal"?Ur(e,a):xn(e,a)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var $o=0;function Hr(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:++$o},Vi(e.curOp)}function Kr(e){var a=e.curOp;a&&Oo(a,function(b){for(var _=0;_=b.viewTo)||b.maxLineChanged&&a.options.lineWrapping,e.update=e.mustUpdate&&new Yn(a,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function il(e){var a=e.cm,b=a.display;e.updatedDisplay&&zn(a),e.barMeasure=En(a),b.maxLineChanged&&!a.options.lineWrapping&&(e.adjustWidthTo=ts(a,b.maxLine,b.maxLine.text.length).left+3,a.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(b.scroller.clientWidth,b.sizer.offsetLeft+e.adjustWidthTo+nr(a)+a.display.barWidth),e.maxScrollLeft=Math.max(0,b.sizer.offsetLeft+e.adjustWidthTo-Mr(a))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=b.input.prepareSelection())}function rl(e){var a=e.cm;e.adjustWidthTo!=null&&(a.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var b=+new Date+e.options.workTime,_=pt(e,a.highlightFrontier),R=[];a.iter(_.line,Math.min(a.first+a.size,e.display.viewTo+500),function(W){if(_.line>=e.display.viewFrom){var Q=W.styles,ee=W.text.length>e.options.maxHighlightLength?Ft(a.mode,_.state):null,ie=Me(e,W,_,!0);ee&&(_.state=ee),W.styles=ie.styles;var ue=W.styleClasses,Le=ie.classes;Le?W.styleClasses=Le:ue&&(W.styleClasses=null);for(var Ie=!Q||Q.length!=W.styles.length||ue!=Le&&(!ue||!Le||ue.bgClass!=Le.bgClass||ue.textClass!=Le.textClass),Qe=0;!Ie&&Qeb)return Sn(e,e.options.workDelay),!0}),a.highlightFrontier=_.line,a.modeFrontier=Math.max(a.modeFrontier,_.line),R.length&&Bi(e,function(){for(var W=0;W=b.viewFrom&&a.visible.to<=b.viewTo&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo)&&b.renderedView==b.view&&fs(e)==0)return!1;Cs(e)&&(Sr(e),a.dims=ya(e));var R=_.first+_.size,W=Math.max(a.visible.from-e.options.viewportMargin,_.first),Q=Math.min(R,a.visible.to+e.options.viewportMargin);b.viewFromQ&&b.viewTo-Q<20&&(Q=Math.min(R,b.viewTo)),di&&(W=dn(e.doc,W),Q=Er(e.doc,Q));var ee=W!=b.viewFrom||Q!=b.viewTo||b.lastWrapHeight!=a.wrapperHeight||b.lastWrapWidth!=a.wrapperWidth;Go(e,W,Q),b.viewOffset=Zi(xt(e.doc,b.viewFrom)),e.display.mover.style.top=b.viewOffset+"px";var ie=fs(e);if(!ee&&ie==0&&!a.force&&b.renderedView==b.view&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo))return!1;var ue=ol(e);return ie>4&&(b.lineDiv.style.display="none"),ul(e,b.updateLineNumbers,a.dims),ie>4&&(b.lineDiv.style.display=""),b.renderedView=b.view,ll(ue),T(b.cursorDiv),T(b.selectionDiv),b.gutters.style.height=b.sizer.style.minHeight=0,ee&&(b.lastWrapHeight=a.wrapperHeight,b.lastWrapWidth=a.wrapperWidth,Sn(e,400)),b.updateLineNumbers=null,!0}function Ss(e,a){for(var b=a.viewport,_=!0;;_=!1){if(!_||!e.options.lineWrapping||a.oldDisplayWidth==Mr(e)){if(b&&b.top!=null&&(b={top:Math.min(e.doc.height+ca(e.display)-da(e),b.top)}),a.visible=Gn(e.display,e.doc,b),a.visible.from>=e.display.viewFrom&&a.visible.to<=e.display.viewTo)break}else _&&(a.visible=Gn(e.display,e.doc,b));if(!Ca(e,a))break;zn(e);var R=En(e);yn(e),$r(e,R),La(e,R),a.force=!1}a.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(a.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,a){var b=new Yn(e,a);if(Ca(e,b)){zn(e),Ss(e,b);var _=En(e);yn(e),$r(e,_),La(e,_),b.finish()}}function ul(e,a,b){var _=e.display,R=e.options.lineNumbers,W=_.lineDiv,Q=W.firstChild;function ee(it){var ut=it.nextSibling;return g&&c&&e.display.currentWheelTarget==it?it.style.display="none":it.parentNode.removeChild(it),ut}for(var ie=_.view,ue=_.viewFrom,Le=0;Le-1&&(Ve=!1),Ya(e,Ie,ue,b)),Ve&&(T(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(fr(e.options,ue)))),Q=Ie.node.nextSibling}ue+=Ie.size}for(;Q;)Q=ee(Q)}function Ra(e){var a=e.gutters.offsetWidth;e.sizer.style.marginLeft=a+"px"}function La(e,a){e.display.sizer.style.minHeight=a.docHeight+"px",e.display.heightForcer.style.top=a.docHeight+"px",e.display.gutters.style.height=a.docHeight+e.display.barHeight+nr(e)+"px"}function Ts(e){var a=e.display,b=a.view;if(!a.alignWidgets&&(!a.gutters.firstChild||!e.options.fixedGutter))return;for(var _=ba(a)-a.scroller.scrollLeft+e.doc.scrollLeft,R=a.gutters.offsetWidth,W=_+"px",Q=0;QQ.clientWidth,ie=Q.scrollHeight>Q.clientHeight;if(!(_&&ee||R&&ie))return;if(R&&c&&g){e:for(var ue=a.target,Le=W.view;ue!=Q;ue=ue.parentNode)for(var Ie=0;Ie=0&&Dt(e,_.to())<=0)return b}return-1};var Qt=function(e,a){this.anchor=e,this.head=a};Qt.prototype.from=function(){return vr(this.anchor,this.head)},Qt.prototype.to=function(){return gr(this.anchor,this.head)},Qt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ji(e,a,b){var _=e&&e.options.selectionsMayTouch,R=a[b];a.sort(function(Qe,Ve){return Dt(Qe.from(),Ve.from())}),b=ce(a,R);for(var W=1;W0:ie>=0){var ue=vr(ee.from(),Q.from()),Le=gr(ee.to(),Q.to()),Ie=ee.empty()?Q.from()==Q.head:ee.from()==ee.head;W<=b&&--b,a.splice(--W,2,new Qt(Ie?Le:ue,Ie?ue:Le))}}return new Xi(a,b)}function Tr(e,a){return new Xi([new Qt(e,a||e)],0)}function Cr(e){return e.text?ht(e.from.line+e.text.length-1,le(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ks(e,a){if(Dt(e,a.from)<0)return e;if(Dt(e,a.to)<=0)return Cr(a);var b=e.line+a.text.length-(a.to.line-a.from.line)-1,_=e.ch;return e.line==a.to.line&&(_+=Cr(a).ch-a.to.ch),ht(b,_)}function Oa(e,a){for(var b=[],_=0;_1&&e.remove(ee.line+1,it-1),e.insert(ee.line+1,gt)}yi(e,"change",e,a)}function Ar(e,a,b){function _(R,W,Q){if(R.linked)for(var ee=0;ee1&&!e.done[e.done.length-2].ranges)return e.done.pop(),le(e.done)}function Ns(e,a,b,_){var R=e.history;R.undone.length=0;var W=+new Date,Q,ee;if((R.lastOp==_||R.lastOrigin==a.origin&&a.origin&&(a.origin.charAt(0)=="+"&&R.lastModTime>W-(e.cm?e.cm.options.historyEventDelay:500)||a.origin.charAt(0)=="*"))&&(Q=pl(R,R.lastOp==_)))ee=le(Q.changes),Dt(a.from,a.to)==0&&Dt(a.from,ee.to)==0?ee.to=Cr(a):Q.changes.push(Ma(e,a));else{var ie=le(R.done);for((!ie||!ie.ranges)&&Zn(e.sel,R.done),Q={changes:[Ma(e,a)],generation:R.generation},R.done.push(Q);R.done.length>R.undoDepth;)R.done.shift(),R.done[0].ranges||R.done.shift()}R.done.push(b),R.generation=++R.maxGeneration,R.lastModTime=R.lastSelTime=W,R.lastOp=R.lastSelOp=_,R.lastOrigin=R.lastSelOrigin=a.origin,ee||Te(e,"historyAdded")}function ml(e,a,b,_){var R=a.charAt(0);return R=="*"||R=="+"&&b.ranges.length==_.ranges.length&&b.somethingSelected()==_.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,a,b,_){var R=e.history,W=_&&_.origin;b==R.lastSelOp||W&&R.lastSelOrigin==W&&(R.lastModTime==R.lastSelTime&&R.lastOrigin==W||ml(e,W,le(R.done),a))?R.done[R.done.length-1]=a:Zn(a,R.done),R.lastSelTime=+new Date,R.lastSelOrigin=W,R.lastSelOp=b,_&&_.clearRedo!==!1&&Ps(R.undone)}function Zn(e,a){var b=le(a);b&&b.ranges&&b.equals(e)||a.push(e)}function Fs(e,a,b,_){var R=a["spans_"+e.id],W=0;e.iter(Math.max(e.first,b),Math.min(e.first+e.size,_),function(Q){Q.markedSpans&&((R||(R=a["spans_"+e.id]={}))[W]=Q.markedSpans),++W})}function vl(e){if(!e)return null;for(var a,b=0;b-1&&(le(ee)[Ie]=ue[Ie],delete ue[Ie]))}}return _}function Pa(e,a,b,_){if(_){var R=e.anchor;if(b){var W=Dt(a,R)<0;W!=Dt(b,R)<0?(R=a,a=b):W!=Dt(a,b)<0&&(a=b)}return new Qt(R,a)}else return new Qt(b||a,a)}function $n(e,a,b,_,R){R==null&&(R=e.cm&&(e.cm.display.shift||e.extend)),Ti(e,new Xi([Pa(e.sel.primary(),a,b,R)],0),_)}function Bs(e,a,b){for(var _=[],R=e.cm&&(e.cm.display.shift||e.extend),W=0;W=a.ch:ee.to>a.ch))){if(R&&(Te(ie,"beforeCursorEnter"),ie.explicitlyCleared))if(W.markedSpans){--Q;continue}else break;if(!ie.atomic)continue;if(b){var Ie=ie.find(_<0?1:-1),Qe=void 0;if((_<0?Le:ue)&&(Ie=zs(e,Ie,-_,Ie&&Ie.line==a.line?W:null)),Ie&&Ie.line==a.line&&(Qe=Dt(Ie,b))&&(_<0?Qe<0:Qe>0))return en(e,Ie,a,_,R)}var Ve=ie.find(_<0?-1:1);return(_<0?ue:Le)&&(Ve=zs(e,Ve,_,Ve.line==a.line?W:null)),Ve?en(e,Ve,a,_,R):null}}return a}function ea(e,a,b,_,R){var W=_||1,Q=en(e,a,b,W,R)||!R&&en(e,a,b,W,!0)||en(e,a,b,-W,R)||!R&&en(e,a,b,-W,!0);return Q||(e.cantEdit=!0,ht(e.first,0))}function zs(e,a,b,_){return b<0&&a.ch==0?a.line>e.first?F(e,ht(a.line-1)):null:b>0&&a.ch==(_||xt(e,a.line)).text.length?a.line=0;--R)Ys(e,{from:_[R].from,to:_[R].to,text:R?[""]:a.text,origin:a.origin});else Ys(e,a)}function Ys(e,a){if(a.text.length==1&&a.text[0]==""&&Dt(a.from,a.to)==0)return;var b=Oa(e,a);Ns(e,a,b,e.cm?e.cm.curOp.id:NaN),An(e,a,b,qi(e,a));var _=[];Ar(e,function(R,W){!W&&ce(_,R.history)==-1&&($s(R.history,a),_.push(R.history)),An(R,a,null,qi(R,a))})}function ta(e,a,b){var _=e.cm&&e.cm.state.suppressEdits;if(_&&!b)return;for(var R=e.history,W,Q=e.sel,ee=a=="undo"?R.done:R.undone,ie=a=="undo"?R.undone:R.done,ue=0;ue=0;--Ve){var it=Qe(Ve);if(it)return it.v}}function Qs(e,a){if(a==0)return;if(e.first+=a,e.sel=new Xi(Ee(e.sel.ranges,function(R){return new Qt(ht(R.anchor.line+a,R.anchor.ch),ht(R.head.line+a,R.head.ch))}),e.sel.primIndex),e.cm){Ii(e.cm,e.first,e.first-a,a);for(var b=e.cm.display,_=b.viewFrom;_e.lastLine())return;if(a.from.lineW&&(a={from:a.from,to:ht(W,xt(e,W).text.length),text:[a.text[0]],origin:a.origin}),a.removed=zi(e,a.from,a.to),b||(b=Oa(e,a)),e.cm?bl(e.cm,a,_):Da(e,a,_),Jn(e,b,Oe),e.cantEdit&&ea(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,a,b){var _=e.doc,R=e.display,W=a.from,Q=a.to,ee=!1,ie=W.line;e.options.lineWrapping||(ie=Ht(Ai(xt(_,W.line))),_.iter(ie,Q.line+1,function(Ve){if(Ve==R.maxLine)return ee=!0,!0})),_.sel.contains(a.from,a.to)>-1&&xe(e),Da(_,a,b,ds(e)),e.options.lineWrapping||(_.iter(ie,W.line+a.text.length,function(Ve){var it=pn(Ve);it>R.maxLineLength&&(R.maxLine=Ve,R.maxLineLength=it,R.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),Qi(_,W.line),Sn(e,400);var ue=a.text.length-(Q.line-W.line)-1;a.full?Ii(e):W.line==Q.line&&a.text.length==1&&!Is(e.doc,a)?wr(e,W.line,"text"):Ii(e,W.line,Q.line+1,ue);var Le=ge(e,"changes"),Ie=ge(e,"change");if(Ie||Le){var Qe={from:W,to:Q,text:a.text,removed:a.removed,origin:a.origin};Ie&&yi(e,"change",e,Qe),Le&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Qe)}e.display.selForContextMenu=null}function rn(e,a,b,_,R){var W;_||(_=b),Dt(_,b)<0&&(W=[_,b],b=W[0],_=W[1]),typeof a=="string"&&(a=e.splitLines(a)),tn(e,{from:b,to:_,text:a,origin:R})}function qs(e,a,b,_){b1||!(this.children[0]instanceof Ln))){var ee=[];this.collapse(ee),this.children=[new Ln(ee)],this.children[0].parent=this}},collapse:function(e){for(var a=0;a50){for(var Q=R.lines.length%25+25,ee=Q;ee10);e.parent.maybeSpill()},iterN:function(e,a,b){for(var _=0;_e.display.maxLineLength&&(e.display.maxLine=ue,e.display.maxLineLength=Le,e.display.maxLineChanged=!0)}_!=null&&e&&this.collapsed&&Ii(e,_,R+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&js(e.doc)),e&&yi(e,"markerCleared",e,this,_,R),a&&Kr(e),this.parent&&this.parent.clear()},Rr.prototype.find=function(e,a){e==null&&this.type=="bookmark"&&(e=1);for(var b,_,R=0;R0||Q==0&&W.clearWhenEmpty!==!1)return W;if(W.replacedWith&&(W.collapsed=!0,W.widgetNode=D("span",[W.replacedWith],"CodeMirror-widget"),_.handleMouseEvents||W.widgetNode.setAttribute("cm-ignore-events","true"),_.insertLeft&&(W.widgetNode.insertLeft=!0)),W.collapsed){if(fi(e,a.line,a,b,W)||a.line!=b.line&&fi(e,b.line,a,b,W))throw new Error("Inserting collapsed marker partially overlapping an existing one");or()}W.addToHistory&&Ns(e,{from:a,to:b,origin:"markText"},e.sel,NaN);var ee=a.line,ie=e.cm,ue;if(e.iter(ee,b.line+1,function(Ie){ie&&W.collapsed&&!ie.options.lineWrapping&&Ai(Ie)==ie.display.maxLine&&(ue=!0),W.collapsed&&ee!=a.line&&xi(Ie,0),_r(Ie,new lr(W,ee==a.line?a.ch:null,ee==b.line?b.ch:null)),++ee}),W.collapsed&&e.iter(a.line,b.line+1,function(Ie){rr(e,Ie)&&xi(Ie,0)}),W.clearOnEnter&&je(W,"beforeCursorEnter",function(){return W.clear()}),W.readOnly&&(Wi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),W.collapsed&&(W.id=++eo,W.atomic=!0),ie){if(ue&&(ie.curOp.updateMaxLine=!0),W.collapsed)Ii(ie,a.line,b.line+1);else if(W.className||W.startStyle||W.endStyle||W.css||W.attributes||W.title)for(var Le=a.line;Le<=b.line;Le++)wr(ie,Le,"text");W.atomic&&js(ie.doc),yi(ie,"markerAdded",ie,W)}return W}var In=function(e,a){this.markers=e,this.primary=a;for(var b=0;b=0;ie--)tn(this,_[ie]);ee?Ks(this,ee):this.cm&&Zr(this.cm)}),undo:mi(function(){ta(this,"undo")}),redo:mi(function(){ta(this,"redo")}),undoSelection:mi(function(){ta(this,"undo",!0)}),redoSelection:mi(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,a=0,b=0,_=0;_=e.ch)&&a.push(R.marker.parent||R.marker)}return a},findMarks:function(e,a,b){e=F(this,e),a=F(this,a);var _=[],R=e.line;return this.iter(e.line,a.line+1,function(W){var Q=W.markedSpans;if(Q)for(var ee=0;ee=ie.to||ie.from==null&&R!=e.line||ie.from!=null&&R==a.line&&ie.from>=a.ch)&&(!b||b(ie.marker))&&_.push(ie.marker.parent||ie.marker)}++R}),_},getAllMarks:function(){var e=[];return this.iter(function(a){var b=a.markedSpans;if(b)for(var _=0;_e)return a=e,!0;e-=W,++b}),F(this,ht(b,a))},indexFromPos:function(e){e=F(this,e);var a=e.ch;if(e.linea&&(a=e.from),e.to!=null&&e.to-1){a.state.draggingText(e),setTimeout(function(){return a.display.input.focus()},20);return}try{var Le=e.dataTransfer.getData("Text");if(Le){var Ie;if(a.state.draggingText&&!a.state.draggingText.copy&&(Ie=a.listSelections()),Jn(a.doc,Tr(b,b)),Ie)for(var Qe=0;Qe=0;ee--)rn(e.doc,"",_[ee].from,_[ee].to,"+delete");Zr(e)})}function Fa(e,a,b){var _=Pe(e.text,a+b,b);return _<0||_>e.text.length?null:_}function Ua(e,a,b){var _=Fa(e,a.ch,b);return _==null?null:new ht(a.line,_,b<0?"after":"before")}function Ba(e,a,b,_,R){if(e){a.doc.direction=="rtl"&&(R=-R);var W=qe(b,a.doc.direction);if(W){var Q=R<0?le(W):W[0],ee=R<0==(Q.level==1),ie=ee?"after":"before",ue;if(Q.level>0||a.doc.direction=="rtl"){var Le=Vr(a,b);ue=R<0?b.text.length-1:0;var Ie=ar(a,Le,ue).top;ue=ke(function(Qe){return ar(a,Le,Qe).top==Ie},R<0==(Q.level==1)?Q.from:Q.to-1,ue),ie=="before"&&(ue=Fa(b,ue,1))}else ue=R<0?Q.to:Q.from;return new ht(_,ue,ie)}}return new ht(_,R<0?b.text.length:0,R<0?"before":"after")}function Ml(e,a,b,_){var R=qe(a,e.doc.direction);if(!R)return Ua(a,b,_);b.ch>=a.text.length?(b.ch=a.text.length,b.sticky="before"):b.ch<=0&&(b.ch=0,b.sticky="after");var W=ae(R,b.ch,b.sticky),Q=R[W];if(e.doc.direction=="ltr"&&Q.level%2==0&&(_>0?Q.to>b.ch:Q.from=Q.from&&Qe>=Le.begin)){var Ve=Ie?"before":"after";return new ht(b.line,Qe,Ve)}}var it=function(gt,yt,vt){for(var bt=function(Jt,gi){return gi?new ht(b.line,ee(Jt,1),"before"):new ht(b.line,Jt,"after")};gt>=0&>0==(Ot.level!=1),Ut=At?vt.begin:ee(vt.end,-1);if(Ot.from<=Ut&&Ut0?Le.end:ee(Le.begin,-1);return dt!=null&&!(_>0&&dt==a.text.length)&&(ut=it(_>0?0:R.length-1,_,ue(dt)),ut)?ut:null}var Pn={selectAll:Gs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oe)},killLine:function(e){return sn(e,function(a){if(a.empty()){var b=xt(e.doc,a.head.line).text.length;return a.head.ch==b&&a.head.line0)R=new ht(R.line,R.ch+1),e.replaceRange(W.charAt(R.ch-1)+W.charAt(R.ch-2),ht(R.line,R.ch-2),R,"+transpose");else if(R.line>e.doc.first){var Q=xt(e.doc,R.line-1).text;Q&&(R=new ht(R.line,1),e.replaceRange(W.charAt(0)+e.doc.lineSeparator()+Q.charAt(Q.length-1),ht(R.line-1,Q.length-1),R,"+transpose"))}}b.push(new Qt(R,R))}e.setSelections(b)})},newlineAndIndent:function(e){return Bi(e,function(){for(var a=e.listSelections(),b=a.length-1;b>=0;b--)e.replaceRange(e.doc.lineSeparator(),a[b].anchor,a[b].head,"+input");a=e.listSelections();for(var _=0;_e&&Dt(a,this.pos)==0&&b==this.button};var Fn,Un;function Kl(e,a){var b=+new Date;return Un&&Un.compare(b,e,a)?(Fn=Un=null,"triple"):Fn&&Fn.compare(b,e,a)?(Un=new Ka(b,e,a),Fn=null,"double"):(Fn=new Ka(b,e,a),Un=null,"single")}function vo(e){var a=this,b=a.display;if(We(a,e)||b.activeTouch&&b.input.supportsTouch())return;if(b.input.ensurePolled(),b.shift=e.shiftKey,hr(b,e)){g||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));return}if(Wa(a,e))return;var _=Nr(a,e),R=G(e),W=_?Kl(_,R):"single";if(window.focus(),R==1&&a.state.selectingText&&a.state.selectingText(e),_&&Wl(a,R,_,W,e))return;R==1?_?Xl(a,_,W,e):Ce(e)==b.scroller&&J(e):R==2?(_&&$n(a.doc,_),setTimeout(function(){return b.input.focus()},20)):R==3&&(C?a.display.input.onContextMenu(e):vs(a))}function Wl(e,a,b,_,R){var W="Click";return _=="double"?W="Double"+W:_=="triple"&&(W="Triple"+W),W=(a==1?"Left":a==2?"Middle":"Right")+W,Nn(e,oo(W,R),R,function(Q){if(typeof Q=="string"&&(Q=Pn[Q]),!Q)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=Q(e,b)!=Fe}finally{e.state.suppressEdits=!1}return ee})}function jl(e,a,b){var _=e.getOption("configureMouse"),R=_?_(e,a,b):{};if(R.unit==null){var W=d?b.shiftKey&&b.metaKey:b.altKey;R.unit=W?"rectangle":a=="single"?"char":a=="double"?"word":"line"}return(R.extend==null||e.doc.extend)&&(R.extend=e.doc.extend||b.shiftKey),R.addNew==null&&(R.addNew=c?b.metaKey:b.ctrlKey),R.moveOnDrag==null&&(R.moveOnDrag=!(c?b.altKey:b.ctrlKey)),R}function Xl(e,a,b,_){E?setTimeout(B(gs,e),0):e.curOp.focus=j();var R=jl(e,b,_),W=e.doc.sel,Q;e.options.dragDrop&&we&&!e.isReadOnly()&&b=="single"&&(Q=W.contains(a))>-1&&(Dt((Q=W.ranges[Q]).from(),a)<0||a.xRel>0)&&(Dt(Q.to(),a)>0||a.xRel<0)?zl(e,_,a,R):Gl(e,_,a,R)}function zl(e,a,b,_){var R=e.display,W=!1,Q=pi(e,function(ue){g&&(R.scroller.draggable=!1),e.state.draggingText=!1,he(R.wrapper.ownerDocument,"mouseup",Q),he(R.wrapper.ownerDocument,"mousemove",ee),he(R.scroller,"dragstart",ie),he(R.scroller,"drop",Q),W||(J(ue),_.addNew||$n(e.doc,b,null,null,_.extend),g&&!r||E&&x==9?setTimeout(function(){R.wrapper.ownerDocument.body.focus({preventScroll:!0}),R.input.focus()},20):R.input.focus())}),ee=function(ue){W=W||Math.abs(a.clientX-ue.clientX)+Math.abs(a.clientY-ue.clientY)>=10},ie=function(){return W=!0};g&&(R.scroller.draggable=!0),e.state.draggingText=Q,Q.copy=!_.moveOnDrag,R.scroller.dragDrop&&R.scroller.dragDrop(),je(R.wrapper.ownerDocument,"mouseup",Q),je(R.wrapper.ownerDocument,"mousemove",ee),je(R.scroller,"dragstart",ie),je(R.scroller,"drop",Q),vs(e),setTimeout(function(){return R.input.focus()},20)}function _o(e,a,b){if(b=="char")return new Qt(a,a);if(b=="word")return e.findWordAt(a);if(b=="line")return new Qt(ht(a.line,0),F(e.doc,ht(a.line+1,0)));var _=b(e,a);return new Qt(_.from,_.to)}function Gl(e,a,b,_){var R=e.display,W=e.doc;J(a);var Q,ee,ie=W.sel,ue=ie.ranges;if(_.addNew&&!_.extend?(ee=W.sel.contains(b),ee>-1?Q=ue[ee]:Q=new Qt(b,b)):(Q=W.sel.primary(),ee=W.sel.primIndex),_.unit=="rectangle")_.addNew||(Q=new Qt(b,b)),b=Nr(e,a,!0,!0),ee=-1;else{var Le=_o(e,b,_.unit);_.extend?Q=Pa(Q,Le.anchor,Le.head,_.extend):Q=Le}_.addNew?ee==-1?(ee=ue.length,Ti(W,Ji(e,ue.concat([Q]),ee),{scroll:!1,origin:"*mouse"})):ue.length>1&&ue[ee].empty()&&_.unit=="char"&&!_.extend?(Ti(W,Ji(e,ue.slice(0,ee).concat(ue.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),ie=W.sel):Na(W,ee,Q,Re):(ee=0,Ti(W,new Xi([Q],0),Re),ie=W.sel);var Ie=b;function Qe(vt){if(Dt(Ie,vt)==0)return;if(Ie=vt,_.unit=="rectangle"){for(var bt=[],Ot=e.options.tabSize,At=z(xt(W,b.line).text,b.ch,Ot),Ut=z(xt(W,vt.line).text,vt.ch,Ot),Jt=Math.min(At,Ut),gi=Math.max(At,Ut),ii=Math.min(b.line,vt.line),Hi=Math.min(e.lastLine(),Math.max(b.line,vt.line));ii<=Hi;ii++){var Mi=xt(W,ii).text,oi=Ke(Mi,Jt,Ot);Jt==gi?bt.push(new Qt(ht(ii,oi),ht(ii,oi))):Mi.length>oi&&bt.push(new Qt(ht(ii,oi),ht(ii,Ke(Mi,gi,Ot))))}bt.length||bt.push(new Qt(b,b)),Ti(W,Ji(e,ie.ranges.slice(0,ee).concat(bt),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(vt)}else{var Pi=Q,bi=_o(e,vt,_.unit),ci=Pi.anchor,li;Dt(bi.anchor,ci)>0?(li=bi.head,ci=vr(Pi.from(),bi.anchor)):(li=bi.anchor,ci=gr(Pi.to(),bi.head));var ri=ie.ranges.slice(0);ri[ee]=Vl(e,new Qt(F(W,ci),li)),Ti(W,Ji(e,ri,ee),Re)}}var Ve=R.wrapper.getBoundingClientRect(),it=0;function ut(vt){var bt=++it,Ot=Nr(e,vt,!0,_.unit=="rectangle");if(!Ot)return;if(Dt(Ot,Ie)!=0){e.curOp.focus=j(),Qe(Ot);var At=Gn(R,W);(Ot.line>=At.to||Ot.lineVe.bottom?20:0;Ut&&setTimeout(pi(e,function(){if(it!=bt)return;R.scroller.scrollTop+=Ut,ut(vt)}),50)}}function dt(vt){e.state.selectingText=!1,it=Infinity,vt&&(J(vt),R.input.focus()),he(R.wrapper.ownerDocument,"mousemove",gt),he(R.wrapper.ownerDocument,"mouseup",yt),W.history.lastSelOrigin=null}var gt=pi(e,function(vt){vt.buttons===0||!G(vt)?dt(vt):ut(vt)}),yt=pi(e,dt);e.state.selectingText=yt,je(R.wrapper.ownerDocument,"mousemove",gt),je(R.wrapper.ownerDocument,"mouseup",yt)}function Vl(e,a){var b=a.anchor,_=a.head,R=xt(e.doc,b.line);if(Dt(b,_)==0&&b.sticky==_.sticky)return a;var W=qe(R);if(!W)return a;var Q=ae(W,b.ch,b.sticky),ee=W[Q];if(ee.from!=b.ch&&ee.to!=b.ch)return a;var ie=Q+(ee.from==b.ch==(ee.level!=1)?0:1);if(ie==0||ie==W.length)return a;var ue;if(_.line!=b.line)ue=(_.line-b.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Le=ae(W,_.ch,_.sticky),Ie=Le-Q||(_.ch-b.ch)*(ee.level==1?-1:1);Le==ie-1||Le==ie?ue=Ie<0:ue=Ie>0}var Qe=W[ie+(ue?-1:0)],Ve=ue==(Qe.level==1),it=Ve?Qe.from:Qe.to,ut=Ve?"after":"before";return b.ch==it&&b.sticky==ut?a:new Qt(new ht(b.line,it,ut),_)}function yo(e,a,b,_){var R,W;if(a.touches)R=a.touches[0].clientX,W=a.touches[0].clientY;else try{R=a.clientX,W=a.clientY}catch(Qe){return!1}if(R>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;_&&J(a);var Q=e.display,ee=Q.lineDiv.getBoundingClientRect();if(W>ee.bottom||!ge(e,b))return q(a);W-=ee.top-Q.viewOffset;for(var ie=0;ie=R){var Le=Ki(e.doc,W),Ie=e.display.gutterSpecs[ie];return Te(e,b,e,Le,Ie.className,a),q(a)}}}function Wa(e,a){return yo(e,a,"gutterClick",!0)}function bo(e,a){if(hr(e.display,a)||Yl(e,a))return;if(We(e,a,"contextmenu"))return;C||e.display.input.onContextMenu(a)}function Yl(e,a){return ge(e,"gutterContextMenu")?yo(e,a,"gutterContextMenu",!1):!1}function xo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),_n(e)}var on={toString:function(){return"CodeMirror.Init"}},Eo={},aa={};function Ql(e){var a=e.optionHandlers;function b(_,R,W,Q){e.defaults[_]=R,W&&(a[_]=Q?function(ee,ie,ue){ue!=on&&W(ee,ie,ue)}:W)}e.defineOption=b,e.Init=on,b("value","",function(_,R){return _.setValue(R)},!0),b("mode",null,function(_,R){_.doc.modeOption=R,Ia(_)},!0),b("indentUnit",2,Ia,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,function(_){Cn(_),_n(_),Ii(_)},!0),b("lineSeparator",null,function(_,R){if(_.doc.lineSep=R,!R)return;var W=[],Q=_.doc.first;_.doc.iter(function(ie){for(var ue=0;;){var Le=ie.text.indexOf(R,ue);if(Le==-1)break;ue=Le+R.length,W.push(ht(Q,Le))}Q++});for(var ee=W.length-1;ee>=0;ee--)rn(_.doc,R,W[ee],ht(W[ee].line,W[ee].ch+R.length))}),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(_,R,W){_.state.specialChars=new RegExp(R.source+(R.test(" ")?"":"| "),"g"),W!=on&&_.refresh()}),b("specialCharPlaceholder",$t,function(_){return _.refresh()},!0),b("electricChars",!0),b("inputStyle",l?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),b("spellcheck",!1,function(_,R){return _.getInputField().spellcheck=R},!0),b("autocorrect",!1,function(_,R){return _.getInputField().autocorrect=R},!0),b("autocapitalize",!1,function(_,R){return _.getInputField().autocapitalize=R},!0),b("rtlMoveVisually",!w),b("wholeLineUpdateBefore",!0),b("theme","default",function(_){xo(_),Tn(_)},!0),b("keyMap","default",function(_,R,W){var Q=ra(R),ee=W!=on&&ra(W);ee&&ee.detach&&ee.detach(_,Q),Q.attach&&Q.attach(_,ee||null)}),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,Zl,!0),b("gutters",[],function(_,R){_.display.gutterSpecs=ka(R,_.options.lineNumbers),Tn(_)},!0),b("fixedGutter",!0,function(_,R){_.display.gutters.style.left=R?ba(_.display)+"px":"0",_.refresh()},!0),b("coverGutterNextToScrollbar",!1,function(_){return $r(_)},!0),b("scrollbarStyle","native",function(_){ws(_),$r(_),_.display.scrollbars.setScrollTop(_.doc.scrollTop),_.display.scrollbars.setScrollLeft(_.doc.scrollLeft)},!0),b("lineNumbers",!1,function(_,R){_.display.gutterSpecs=ka(_.options.gutters,R),Tn(_)},!0),b("firstLineNumber",1,Tn,!0),b("lineNumberFormatter",function(_){return _},Tn,!0),b("showCursorWhenSelecting",!1,yn,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("selectionsMayTouch",!1),b("readOnly",!1,function(_,R){R=="nocursor"&&(qr(_),_.display.input.blur()),_.display.input.readOnlyChanged(R)}),b("screenReaderLabel",null,function(_,R){R=R===""?null:R,_.display.input.screenReaderLabelChanged(R)}),b("disableInput",!1,function(_,R){R||_.display.input.reset()},!0),b("dragDrop",!0,ql),b("allowDropFileTypes",null),b("cursorBlinkRate",530),b("cursorScrollMargin",0),b("cursorHeight",1,yn,!0),b("singleCursorHeightPerLine",!0,yn,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,Cn,!0),b("addModeClass",!1,Cn,!0),b("pollInterval",100),b("undoDepth",200,function(_,R){return _.doc.history.undoDepth=R}),b("historyEventDelay",1250),b("viewportMargin",10,function(_){return _.refresh()},!0),b("maxHighlightLength",1e4,Cn,!0),b("moveInputWithCursor",!0,function(_,R){R||_.display.input.resetPosition()}),b("tabindex",null,function(_,R){return _.display.input.getField().tabIndex=R||""}),b("autofocus",null),b("direction","ltr",function(_,R){return _.doc.setDirection(R)},!0),b("phrases",null)}function ql(e,a,b){var _=b&&b!=on;if(!a!=!_){var R=e.display.dragFunctions,W=a?je:he;W(e.display.scroller,"dragstart",R.start),W(e.display.scroller,"dragenter",R.enter),W(e.display.scroller,"dragover",R.over),W(e.display.scroller,"dragleave",R.leave),W(e.display.scroller,"drop",R.drop)}}function Zl(e){e.options.lineWrapping?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),Hn(e)),xa(e),Ii(e),_n(e),setTimeout(function(){return $r(e)},100)}function ti(e,a){var b=this;if(!(this instanceof ti))return new ti(e,a);this.options=a=a?N(a):{},N(Eo,a,!1);var _=a.value;typeof _=="string"?_=new Di(_,a.mode,null,a.lineSeparator,a.direction):a.mode&&(_.modeOption=a.mode),this.doc=_;var R=new ti.inputStyles[a.inputStyle](this),W=this.display=new hl(e,_,R,a);W.wrapper.CodeMirror=this,xo(this),a.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ws(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 te,keySeq:null,specialChars:null},a.autofocus&&!l&&W.input.focus(),E&&x<11&&setTimeout(function(){return b.display.input.reset(!0)},20),$l(this),Ll(),Hr(this),this.curOp.forceUpdate=!0,Ds(this,_),a.autofocus&&!l||this.hasFocus()?setTimeout(function(){b.hasFocus()&&!b.state.focused&&wa(b)},20):qr(this);for(var Q in aa)aa.hasOwnProperty(Q)&&aa[Q](this,a[Q],on);Cs(this),a.finishInit&&a.finishInit(this);for(var ee=0;ee20*20}je(a.scroller,"touchstart",function(ie){if(!We(e,ie)&&!W(ie)&&!Wa(e,ie)){a.input.ensurePolled(),clearTimeout(b);var ue=+new Date;a.activeTouch={start:ue,moved:!1,prev:ue-_.end<=300?_:null},ie.touches.length==1&&(a.activeTouch.left=ie.touches[0].pageX,a.activeTouch.top=ie.touches[0].pageY)}}),je(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),je(a.scroller,"touchend",function(ie){var ue=a.activeTouch;if(ue&&!hr(a,ie)&&ue.left!=null&&!ue.moved&&new Date-ue.start<300){var Le=e.coordsChar(a.activeTouch,"page"),Ie;!ue.prev||Q(ue,ue.prev)?Ie=new Qt(Le,Le):!ue.prev.prev||Q(ue,ue.prev.prev)?Ie=e.findWordAt(Le):Ie=new Qt(ht(Le.line,0),F(e.doc,ht(Le.line+1,0))),e.setSelection(Ie.anchor,Ie.head),e.focus(),J(ie)}R()}),je(a.scroller,"touchcancel",R),je(a.scroller,"scroll",function(){a.scroller.clientHeight&&(xn(e,a.scroller.scrollTop),Ur(e,a.scroller.scrollLeft,!0),Te(e,"scroll",e))}),je(a.scroller,"mousewheel",function(ie){return Ls(e,ie)}),je(a.scroller,"DOMMouseScroll",function(ie){return Ls(e,ie)}),je(a.wrapper,"scroll",function(){return a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(ie){We(e,ie)||me(ie)},over:function(ie){We(e,ie)||(Rl(e,ie),me(ie))},start:function(ie){return Al(e,ie)},drop:pi(e,Cl),leave:function(ie){We(e,ie)||ro(e)}};var ee=a.input.getField();je(ee,"keyup",function(ie){return mo.call(e,ie)}),je(ee,"keydown",pi(e,po)),je(ee,"keypress",pi(e,go)),je(ee,"focus",function(ie){return wa(e,ie)}),je(ee,"blur",function(ie){return qr(e,ie)})}var ja=[];ti.defineInitHook=function(e){return ja.push(e)};function Bn(e,a,b,_){var R=e.doc,W;b==null&&(b="add"),b=="smart"&&(R.mode.indent?W=pt(e,a).state:b="prev");var Q=e.options.tabSize,ee=xt(R,a),ie=z(ee.text,null,Q);ee.stateAfter&&(ee.stateAfter=null);var ue=ee.text.match(/^\s*/)[0],Le;if(!_&&!/\S/.test(ee.text))Le=0,b="not";else if(b=="smart"&&(Le=R.mode.indent(W,ee.text.slice(ue.length),ee.text),Le==Fe||Le>150)){if(!_)return;b="prev"}b=="prev"?a>R.first?Le=z(xt(R,a-1).text,null,Q):Le=0:b=="add"?Le=ie+e.options.indentUnit:b=="subtract"?Le=ie-e.options.indentUnit:typeof b=="number"&&(Le=ie+b),Le=Math.max(0,Le);var Ie="",Qe=0;if(e.options.indentWithTabs)for(var Ve=Math.floor(Le/Q);Ve;--Ve)Qe+=Q,Ie+=" ";if(QeQ,ie=lt(a),ue=null;if(ee&&_.ranges.length>1)if(er&&er.text.join(` `)==a){if(_.ranges.length%er.text.length==0){ue=[];for(var Le=0;Le=0;Qe--){var Ve=_.ranges[Qe],it=Ve.from(),ut=Ve.to();Ve.empty()&&(b&&b>0?it=ht(it.line,it.ch-b):e.state.overwrite&&!ee?ut=ht(ut.line,Math.min(xt(W,ut.line).text.length,ut.ch+le(ie).length)):ee&&er&&er.lineWise&&er.text.join(` `)==ie.join(` `)&&(it=ut=ht(it.line,0)));var dt={from:it,to:ut,text:ue?ue[Qe%ue.length]:ie,origin:R||(ee?"paste":e.state.cutIncoming>Q?"cut":"+input")};tn(e.doc,dt),yi(e,"inputRead",e,dt)}a&&!ee&&So(e,a),Zr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ie),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function wo(e,a){var b=e.clipboardData&&e.clipboardData.getData("Text");if(b)return e.preventDefault(),!a.isReadOnly()&&!a.options.disableInput&&Bi(a,function(){return Xa(a,b,0,null,"paste")}),!0}function So(e,a){if(!e.options.electricChars||!e.options.smartIndent)return;for(var b=e.doc.sel,_=b.ranges.length-1;_>=0;_--){var R=b.ranges[_];if(R.head.ch>100||_&&b.ranges[_-1].head.line==R.head.line)continue;var W=e.getModeAt(R.head),Q=!1;if(W.electricChars){for(var ee=0;ee-1){Q=Bn(e,R.head.line,"smart");break}}else W.electricInput&&(W.electricInput.test(xt(e.doc,R.head.line).text.slice(0,R.head.ch))&&(Q=Bn(e,R.head.line,"smart")));Q&&yi(e,"electricInput",e,R.head.line)}}function To(e){for(var a=[],b=[],_=0;_W&&(Bn(this,ee.head.line,_,!0),W=ee.head.line,Q==this.doc.sel.primIndex&&Zr(this));else{var ie=ee.from(),ue=ee.to(),Le=Math.max(W,ie.line);W=Math.min(this.lastLine(),ue.line-(ue.ch?0:1))+1;for(var Ie=Le;Ie0&&Na(this.doc,Q,new Qt(ie,Qe[Q].to()),Oe)}}}),getTokenAt:function(_,R){return ei(this,_,R)},getLineTokens:function(_,R){return ei(this,ht(_),R,!0)},getTokenTypeAt:function(_){_=F(this.doc,_);var R=rt(this,xt(this.doc,_.line)),W=0,Q=(R.length-1)/2,ee=_.ch,ie;if(ee==0)ie=R[2];else for(;;){var ue=W+Q>>1;if((ue?R[ue*2-1]:0)>=ee)Q=ue;else if(R[ue*2+1]ie&&(_=ie,Q=!0),ee=xt(this.doc,_)}else ee=_;return Wn(this,ee,{top:0,left:0},R||"page",W||Q).top+(Q?this.doc.height-Zi(ee):0)},defaultTextHeight:function(){return Yr(this.display)},defaultCharWidth:function(){return Qr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(_,R,W,Q,ee){var ie=this.display;_=$i(this,F(this.doc,_));var ue=_.bottom,Le=_.left;if(R.style.position="absolute",R.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(R),ie.sizer.appendChild(R),Q=="over")ue=_.top;else if(Q=="above"||Q=="near"){var Ie=Math.max(ie.wrapper.clientHeight,this.doc.height),Qe=Math.max(ie.sizer.clientWidth,ie.lineSpace.clientWidth);(Q=="above"||_.bottom+R.offsetHeight>Ie)&&_.top>R.offsetHeight?ue=_.top-R.offsetHeight:_.bottom+R.offsetHeight<=Ie&&(ue=_.bottom),Le+R.offsetWidth>Qe&&(Le=Qe-R.offsetWidth)}R.style.top=ue+"px",R.style.left=R.style.right="",ee=="right"?(Le=ie.sizer.clientWidth-R.offsetWidth,R.style.right="0px"):(ee=="left"?Le=0:ee=="middle"&&(Le=(ie.sizer.clientWidth-R.offsetWidth)/2),R.style.left=Le+"px"),W&&qo(this,{left:Le,top:ue,right:Le+R.offsetWidth,bottom:ue+R.offsetHeight})},triggerOnKeyDown:Ri(po),triggerOnKeyPress:Ri(go),triggerOnKeyUp:mo,triggerOnMouseDown:Ri(vo),execCommand:function(_){if(Pn.hasOwnProperty(_))return Pn[_].call(null,this)},triggerElectric:Ri(function(_){So(this,_)}),findPosH:function(_,R,W,Q){var ee=1;R<0&&(ee=-1,R=-R);for(var ie=F(this.doc,_),ue=0;ue0&&Le(W.charAt(Q-1));)--Q;for(;ee.5||this.options.lineWrapping)&&xa(this),Te(this,"refresh",this)}),swapDoc:Ri(function(_){var R=this.doc;return R.cm=null,this.state.selectingText&&this.state.selectingText(),Ds(this,_),_n(this),this.display.input.reset(),bn(this,_.scrollLeft,_.scrollTop),this.curOp.forceScroll=!0,yi(this,"swapDoc",this,R),R}),phrase:function(_){var R=this.options.phrases;return R&&Object.prototype.hasOwnProperty.call(R,_)?R[_]:_},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}},ye(e),e.registerHelper=function(_,R,W){b.hasOwnProperty(_)||(b[_]=e[_]={_global:[]}),b[_][R]=W},e.registerGlobalHelper=function(_,R,W,Q){e.registerHelper(_,R,Q),b[_]._global.push({pred:W,val:Q})}}function za(e,a,b,_,R){var W=a,Q=b,ee=xt(e,a.line),ie=R&&e.direction=="rtl"?-b:b;function ue(){var yt=a.line+ie;return yt=e.first+e.size?!1:(a=new ht(yt,a.ch,a.sticky),ee=xt(e,yt))}function Le(yt){var vt;if(_=="codepoint"){var bt=ee.text.charCodeAt(a.ch+(_>0?0:-1));isNaN(bt)?vt=null:vt=new ht(a.line,Math.max(0,Math.min(ee.text.length,a.ch+b*(bt>=55296&&bt<56320?2:1))),-b)}else R?vt=Ml(e.cm,ee,a,b):vt=Ua(ee,a,b);if(vt==null)if(!yt&&ue())a=Ba(R,e.cm,ee,a.line,ie);else return!1;else a=vt;return!0}if(_=="char"||_=="codepoint")Le();else if(_=="column")Le(!0);else if(_=="word"||_=="group")for(var Ie=null,Qe=_=="group",Ve=e.cm&&e.cm.getHelper(a,"wordChars"),it=!0;!(b<0&&!Le(!it));it=!1){var ut=ee.text.charAt(a.ch)||` `,dt=Je(ut,Ve)?"w":Qe&&ut==` `?"n":!Qe||/\s/.test(ut)?null:"p";if(Qe&&!it&&!dt&&(dt="s"),Ie&&Ie!=dt){b<0&&(b=1,Le(),a.sticky="after");break}if(dt&&(Ie=dt),b>0&&!Le(!it))break}var gt=ea(e,a,W,Q,!0);return pr(W,gt)&&(gt.hitSide=!0),gt}function Ro(e,a,b,_){var R=e.doc,W=a.left,Q;if(_=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ie=Math.max(ee-.5*Yr(e.display),3);Q=(b>0?a.bottom:a.top)+b*ie}else _=="line"&&(Q=b>0?a.bottom+3:a.top-3);for(var ue;!(ue=va(e,W,Q),!ue.outside);){if(b<0?Q<=0:Q>=R.height){ue.hitSide=!0;break}Q+=b*5}return ue}var Zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Zt.prototype.init=function(e){var a=this,b=this,_=b.cm,R=b.div=e.lineDiv;Co(R,_.options.spellcheck,_.options.autocorrect,_.options.autocapitalize);function W(ee){for(var ie=ee.target;ie;ie=ie.parentNode){if(ie==R)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ie.className))break}return!1}je(R,"paste",function(ee){if(!W(ee)||We(_,ee)||wo(ee,_))return;x<=11&&setTimeout(pi(_,function(){return a.updateFromDOM()}),20)}),je(R,"compositionstart",function(ee){a.composing={data:ee.data,done:!1}}),je(R,"compositionupdate",function(ee){a.composing||(a.composing={data:ee.data,done:!1})}),je(R,"compositionend",function(ee){a.composing&&(ee.data!=a.composing.data&&a.readFromDOMSoon(),a.composing.done=!0)}),je(R,"touchstart",function(){return b.forceCompositionEnd()}),je(R,"input",function(){a.composing||a.readFromDOMSoon()});function Q(ee){if(!W(ee)||We(_,ee))return;if(_.somethingSelected())sa({lineWise:!1,text:_.getSelections()}),ee.type=="cut"&&_.replaceSelection("",null,"cut");else if(_.options.lineWiseCopyCut){var ie=To(_);sa({lineWise:!0,text:ie.text}),ee.type=="cut"&&_.operation(function(){_.setSelections(ie.ranges,0,Oe),_.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var ue=er.text.join(` `);if(ee.clipboardData.setData("Text",ue),ee.clipboardData.getData("Text")==ue){ee.preventDefault();return}}var Le=Ao(),Ie=Le.firstChild;_.display.lineSpace.insertBefore(Le,_.display.lineSpace.firstChild),Ie.value=er.text.join(` `);var Qe=document.activeElement;X(Ie),setTimeout(function(){_.display.lineSpace.removeChild(Le),Qe.focus(),Qe==R&&b.showPrimarySelection()},50)}je(R,"copy",Q),je(R,"cut",Q)},Zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Zt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Zt.prototype.showSelection=function(e,a){if(!e||!this.cm.display.view.length)return;(e.focus||a)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),a=this.cm,b=a.doc.sel.primary(),_=b.from(),R=b.to();if(a.display.viewTo==a.display.viewFrom||_.line>=a.display.viewTo||R.line=a.display.viewFrom&&Lo(a,_)||{node:ee[0].measure.map[2],offset:0},ue=R.linee.firstLine()&&(_=ht(_.line-1,xt(e.doc,_.line-1).length)),R.ch==xt(e.doc,R.line).text.length&&R.linea.viewTo-1)return!1;var W,Q,ee;_.line==a.viewFrom||(W=Fr(e,_.line))==0?(Q=Ht(a.view[0].line),ee=a.view[0].node):(Q=Ht(a.view[W].line),ee=a.view[W-1].node.nextSibling);var ie=Fr(e,R.line),ue,Le;if(ie==a.view.length-1?(ue=a.viewTo-1,Le=a.lineDiv.lastChild):(ue=Ht(a.view[ie+1].line)-1,Le=a.view[ie+1].node.previousSibling),!ee)return!1;for(var Ie=e.doc.splitLines(tu(e,ee,Le,Q,ue)),Qe=zi(e.doc,ht(Q,0),ht(ue,xt(e.doc,ue).text.length));Ie.length>1&&Qe.length>1;)if(le(Ie)==le(Qe))Ie.pop(),Qe.pop(),ue--;else if(Ie[0]==Qe[0])Ie.shift(),Qe.shift(),Q++;else break;for(var Ve=0,it=0,ut=Ie[0],dt=Qe[0],gt=Math.min(ut.length,dt.length);Ve_.ch&&yt.charCodeAt(yt.length-it-1)==vt.charCodeAt(vt.length-it-1);)Ve--,it++;Ie[Ie.length-1]=yt.slice(0,yt.length-it).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice(Ve).replace(/\u200b+$/,"");var Ot=ht(Q,Ve),At=ht(ue,Qe.length?le(Qe).length-it:0);if(Ie.length>1||Ie[0]||Dt(Ot,At))return rn(e.doc,Ie,Ot,At,"+input"),!0},Zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zt.prototype.reset=function(){this.forceCompositionEnd()},Zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Zt.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)},Zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Bi(this.cm,function(){return Ii(e.cm)})},Zt.prototype.setUneditable=function(e){e.contentEditable="false"},Zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||pi(this.cm,Xa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Zt.prototype.onContextMenu=function(){},Zt.prototype.resetPosition=function(){},Zt.prototype.needsContentAttribute=!0;function Lo(e,a){var b=fa(e,a.line);if(!b||b.hidden)return null;var _=xt(e.doc,a.line),R=es(b,_,a.line),W=qe(_,e.doc.direction),Q="left";if(W){var ee=ae(W,a.ch);Q=ee%2?"right":"left"}var ie=rs(R.map,a.ch,Q);return ie.offset=ie.collapse=="right"?ie.end:ie.start,ie}function eu(e){for(var a=e;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;return!1}function ln(e,a){return a&&(e.bad=!0),e}function tu(e,a,b,_,R){var W="",Q=!1,ee=e.doc.lineSeparator(),ie=!1;function ue(Ve){return function(it){return it.id==Ve}}function Le(){Q&&(W+=ee,ie&&(W+=ee),Q=ie=!1)}function Ie(Ve){Ve&&(Le(),W+=Ve)}function Qe(Ve){if(Ve.nodeType==1){var it=Ve.getAttribute("cm-text");if(it){Ie(it);return}var ut=Ve.getAttribute("cm-marker"),dt;if(ut){var gt=e.findMarks(ht(_,0),ht(R+1,0),ue(+ut));gt.length&&(dt=gt[0].find(0))&&Ie(zi(e.doc,dt.from,dt.to).join(ee));return}if(Ve.getAttribute("contenteditable")=="false")return;var yt=/^(pre|div|p|li|table|br)$/i.test(Ve.nodeName);if(!/^br$/i.test(Ve.nodeName)&&Ve.textContent.length==0)return;yt&&Le();for(var vt=0;vt=9&&a.hasSelection&&(a.hasSelection=null),b.poll()}),je(R,"paste",function(Q){if(We(_,Q)||wo(Q,_))return;_.state.pasteIncoming=+new Date,b.fastPoll()});function W(Q){if(We(_,Q))return;if(_.somethingSelected())sa({lineWise:!1,text:_.getSelections()});else if(_.options.lineWiseCopyCut){var ee=To(_);sa({lineWise:!0,text:ee.text}),Q.type=="cut"?_.setSelections(ee.ranges,null,Oe):(b.prevInput="",R.value=ee.text.join(` `),X(R))}else return;Q.type=="cut"&&(_.state.cutIncoming=+new Date)}je(R,"cut",W),je(R,"copy",W),je(e.scroller,"paste",function(Q){if(hr(e,Q)||We(_,Q))return;if(!R.dispatchEvent){_.state.pasteIncoming=+new Date,b.focus();return}var ee=new Event("paste");ee.clipboardData=Q.clipboardData,R.dispatchEvent(ee)}),je(e.lineSpace,"selectstart",function(Q){hr(e,Q)||J(Q)}),je(R,"compositionstart",function(){var Q=_.getCursor("from");b.composing&&b.composing.range.clear(),b.composing={start:Q,range:_.markText(Q,_.getCursor("to"),{className:"CodeMirror-composing"})}}),je(R,"compositionend",function(){b.composing&&(b.poll(),b.composing.range.clear(),b.composing=null)})},ai.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ai.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ai.prototype.prepareSelection=function(){var e=this.cm,a=e.display,b=e.doc,_=ps(e);if(e.options.moveInputWithCursor){var R=$i(e,b.sel.primary().head,"div"),W=a.wrapper.getBoundingClientRect(),Q=a.lineDiv.getBoundingClientRect();_.teTop=Math.max(0,Math.min(a.wrapper.clientHeight-10,R.top+Q.top-W.top)),_.teLeft=Math.max(0,Math.min(a.wrapper.clientWidth-10,R.left+Q.left-W.left))}return _},ai.prototype.showSelection=function(e){var a=this.cm,b=a.display;A(b.cursorDiv,e.cursors),A(b.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ai.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var a=this.cm;if(a.somethingSelected()){this.prevInput="";var b=a.getSelection();this.textarea.value=b,a.state.focused&&X(this.textarea),E&&x>=9&&(this.hasSelection=b)}else e||(this.prevInput=this.textarea.value="",E&&x>=9&&(this.hasSelection=null))},ai.prototype.getField=function(){return this.textarea},ai.prototype.supportsTouch=function(){return!1},ai.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!l||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},ai.prototype.blur=function(){this.textarea.blur()},ai.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ai.prototype.receivedFocus=function(){this.slowPoll()},ai.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()})},ai.prototype.fastPoll=function(){var e=!1,a=this;a.pollingFast=!0;function b(){var _=a.poll();!_&&!e?(e=!0,a.polling.set(60,b)):(a.pollingFast=!1,a.slowPoll())}a.polling.set(20,b)},ai.prototype.poll=function(){var e=this,a=this.cm,b=this.textarea,_=this.prevInput;if(this.contextMenuPending||!a.state.focused||tt(b)&&!_&&!this.composing||a.isReadOnly()||a.options.disableInput||a.state.keySeq)return!1;var R=b.value;if(R==_&&!a.somethingSelected())return!1;if(E&&x>=9&&this.hasSelection===R||c&&/[\uf700-\uf7ff]/.test(R))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var W=R.charCodeAt(0);if(W==8203&&!_&&(_="\u200B"),W==8666)return this.reset(),this.cm.execCommand("undo")}for(var Q=0,ee=Math.min(_.length,R.length);Q1e3||R.indexOf(` `)>-1?b.value=e.prevInput="":e.prevInput=R,e.composing&&(e.composing.range.clear(),e.composing.range=a.markText(e.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ai.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ai.prototype.onKeyPress=function(){E&&x>=9&&(this.hasSelection=null),this.fastPoll()},ai.prototype.onContextMenu=function(e){var a=this,b=a.cm,_=b.display,R=a.textarea;a.contextMenuPending&&a.contextMenuPending();var W=Nr(b,e),Q=_.scroller.scrollTop;if(!W||u)return;var ee=b.options.resetSelectionOnContextMenu;ee&&b.doc.sel.contains(W)==-1&&pi(b,Ti)(b.doc,Tr(W),Oe);var ie=R.style.cssText,ue=a.wrapper.style.cssText,Le=a.wrapper.offsetParent.getBoundingClientRect();a.wrapper.style.cssText="position: static",R.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Le.top-5)+"px; left: "+(e.clientX-Le.left-5)+`px; z-index: 1000; background: `+(E?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;g&&(Ie=window.scrollY),_.input.focus(),g&&window.scrollTo(null,Ie),_.input.reset(),b.somethingSelected()||(R.value=a.prevInput=" "),a.contextMenuPending=Ve,_.selForContextMenu=b.doc.sel,clearTimeout(_.detectingSelectAll);function Qe(){if(R.selectionStart!=null){var ut=b.somethingSelected(),dt="\u200B"+(ut?R.value:"");R.value="\u21DA",R.value=dt,a.prevInput=ut?"":"\u200B",R.selectionStart=1,R.selectionEnd=dt.length,_.selForContextMenu=b.doc.sel}}function Ve(){if(a.contextMenuPending!=Ve)return;if(a.contextMenuPending=!1,a.wrapper.style.cssText=ue,R.style.cssText=ie,E&&x<9&&_.scrollbars.setScrollTop(_.scroller.scrollTop=Q),R.selectionStart!=null){(!E||E&&x<9)&&Qe();var ut=0,dt=function(){_.selForContextMenu==b.doc.sel&&R.selectionStart==0&&R.selectionEnd>0&&a.prevInput=="\u200B"?pi(b,Gs)(b):ut++<10?_.detectingSelectAll=setTimeout(dt,500):(_.selForContextMenu=null,_.input.reset())};_.detectingSelectAll=setTimeout(dt,200)}}if(E&&x>=9&&Qe(),C){me(e);var it=function(){he(window,"mouseup",it),setTimeout(Ve,20)};je(window,"mouseup",it)}else setTimeout(Ve,50)},ai.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ai.prototype.setUneditable=function(){},ai.prototype.needsContentAttribute=!1;function ru(e,a){if(a=a?N(a):{},a.value=e.value,!a.tabindex&&e.tabIndex&&(a.tabindex=e.tabIndex),!a.placeholder&&e.placeholder&&(a.placeholder=e.placeholder),a.autofocus==null){var b=j();a.autofocus=b==e||e.getAttribute("autofocus")!=null&&b==document.body}function _(){e.value=ee.getValue()}var R;if(e.form&&(je(e.form,"submit",_),!a.leaveSubmitMethodAlone)){var W=e.form;R=W.submit;try{var Q=W.submit=function(){_(),W.submit=R,W.submit(),W.submit=Q}}catch(ie){}}a.finishInit=function(ie){ie.save=_,ie.getTextArea=function(){return e},ie.toTextArea=function(){ie.toTextArea=isNaN,_(),e.parentNode.removeChild(ie.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",_),!a.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=R))}},e.style.display="none";var ee=ti(function(ie){return e.parentNode.insertBefore(ie,e.nextSibling)},a);return ee}function nu(e){e.off=he,e.on=je,e.wheelEventPixels=cl,e.Doc=Di,e.splitLines=lt,e.countColumn=z,e.findColumn=Ke,e.isWordChar=Ze,e.Pass=Fe,e.signal=Te,e.Line=Dr,e.changeEnd=Cr,e.scrollbarModel=Es,e.Pos=ht,e.cmpPos=Dt,e.modes=_t,e.mimeModes=ft,e.resolveMode=nt,e.getMode=Tt,e.modeExtensions=It,e.extendMode=wt,e.copyState=Ft,e.startState=ui,e.innerMode=zt,e.commands=Pn,e.keyMap=cr,e.keyName=lo,e.isModifierKey=so,e.lookupKey=an,e.normalizeKeyMap=Dl,e.StringStream=Pt,e.SharedTextMarker=In,e.TextMarker=Rr,e.LineWidget=On,e.e_preventDefault=J,e.e_stopPropagation=ne,e.e_stop=me,e.addClass=K,e.contains=P,e.rmClass=y,e.keyNames=Lr}Ql(ti),Jl(ti);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Di.prototype)Di.prototype.hasOwnProperty(la)&&ce(au,la)<0&&(ti.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Di.prototype[la]));return ye(Di),ti.inputStyles={textarea:ai,contenteditable:Zt},ti.defineMode=function(e){!ti.defaults.mode&&e!="null"&&(ti.defaults.mode=e),kt.apply(this,arguments)},ti.defineMIME=Nt,ti.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ti.defineMIME("text/plain","null"),ti.defineExtension=function(e,a){ti.prototype[e]=a},ti.defineDocExtension=function(e,a){Di.prototype[e]=a},ti.fromTextArea=ru,nu(ti),ti.version="5.58.2",ti})},Y1PL:function(at,fe,oe){"use strict";oe.r(fe),oe.d(fe,"ResizableTextArea",function(){return ce});var V=oe("wx14"),L=oe("1OyB"),I=oe("vuIU"),k=oe("Ji7U"),M=oe("LK+K"),f=oe("q1tI"),E=oe("VTBJ"),x=oe("rePB"),g=oe("Zm9Q"),h=oe("Kwbf"),o=oe("c+Xe"),u=oe("m+aA"),r=oe("bdgK"),n=new Map;function t(Oe){Oe.forEach(function(Re){var Be,Ke=Re.target;(Be=n.get(Ke))===null||Be===void 0||Be.forEach(function(Ae){return Ae(Ke)})})}var i=new r.default(t),s=null,l=null;function c(Oe,Re){n.has(Oe)||(n.set(Oe,new Set),i.observe(Oe)),n.get(Oe).add(Re)}function d(Oe,Re){n.has(Oe)&&(n.get(Oe).delete(Re),n.get(Oe).size||(i.unobserve(Oe),n.delete(Oe)))}var w=function(Oe){Object(k.a)(Be,Oe);var Re=Object(M.a)(Be);function Be(){return Object(L.a)(this,Be),Re.apply(this,arguments)}return Object(I.a)(Be,[{key:"render",value:function(){return this.props.children}}]),Be}(f.Component),m=f.createContext(null);function S(Oe){var Re=Oe.children,Be=Oe.onBatchResize,Ke=f.useRef(0),Ae=f.useRef([]),_e=f.useContext(m),le=f.useCallback(function(Ee,pe,Ge){Ke.current+=1;var Ye=Ke.current;Ae.current.push({size:Ee,element:pe,data:Ge}),Promise.resolve().then(function(){Ye===Ke.current&&(Be==null||Be(Ae.current),Ae.current=[])}),_e==null||_e(Ee,pe,Ge)},[Be,_e]);return f.createElement(m.Provider,{value:le},Re)}function C(Oe){var Re=Oe.children,Be=Oe.disabled,Ke=f.useRef(null),Ae=f.useRef(null),_e=f.useContext(m),le=f.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ee=f.isValidElement(Re)&&Object(o.c)(Re),pe=Ee?Re.ref:null,Ge=f.useMemo(function(){return Object(o.a)(pe,Ke)},[pe,Ke]),Ye=f.useRef(Oe);Ye.current=Oe;var ze=f.useCallback(function(Ze){var Je=Ye.current,$e=Je.onResize,He=Je.data,Ue=Ze.getBoundingClientRect(),Pe=Ue.width,ke=Ue.height,re=Ze.offsetWidth,ve=Ze.offsetHeight,ae=Math.floor(Pe),De=Math.floor(ke);if(le.current.width!==ae||le.current.height!==De||le.current.offsetWidth!==re||le.current.offsetHeight!==ve){var qe={width:ae,height:De,offsetWidth:re,offsetHeight:ve};le.current=qe;var et=re===Math.round(Pe)?Pe:re,je=ve===Math.round(ke)?ke:ve,ct=Object(E.a)(Object(E.a)({},qe),{},{offsetWidth:et,offsetHeight:je});_e==null||_e(ct,Ze,He),$e&&Promise.resolve().then(function(){$e(ct,Ze)})}},[]);return f.useEffect(function(){var Ze=Object(u.a)(Ke.current)||Object(u.a)(Ae.current);return Ze&&!Be&&c(Ze,ze),function(){return d(Ze,ze)}},[Ke.current,Be]),f.createElement(w,{ref:Ae},Ee?f.cloneElement(Re,{ref:Ge}):Re)}var v="rc-observer-key";function y(Oe){var Re=Oe.children,Be=Object(g.a)(Re);return Be.map(function(Ke,Ae){var _e=(Ke==null?void 0:Ke.key)||"".concat(v,"-").concat(Ae);return f.createElement(C,Object(V.a)({},Oe,{key:_e}),Ke)})}y.Collection=S;var T=y,A=oe("bT9E"),p=oe("TSYQ"),D=oe.n(p),O=` 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 `,P=["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"],j={},K;function U(Oe){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Be=Oe.getAttribute("id")||Oe.getAttribute("data-reactid")||Oe.getAttribute("name");if(Re&&j[Be])return j[Be];var Ke=window.getComputedStyle(Oe),Ae=Ke.getPropertyValue("box-sizing")||Ke.getPropertyValue("-moz-box-sizing")||Ke.getPropertyValue("-webkit-box-sizing"),_e=parseFloat(Ke.getPropertyValue("padding-bottom"))+parseFloat(Ke.getPropertyValue("padding-top")),le=parseFloat(Ke.getPropertyValue("border-bottom-width"))+parseFloat(Ke.getPropertyValue("border-top-width")),Ee=P.map(function(Ge){return"".concat(Ge,":").concat(Ke.getPropertyValue(Ge))}).join(";"),pe={sizingStyle:Ee,paddingSize:_e,borderSize:le,boxSizing:Ae};return Re&&Be&&(j[Be]=pe),pe}function X(Oe){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;K||(K=document.createElement("textarea"),K.setAttribute("tab-index","-1"),K.setAttribute("aria-hidden","true"),document.body.appendChild(K)),Oe.getAttribute("wrap")?K.setAttribute("wrap",Oe.getAttribute("wrap")):K.removeAttribute("wrap");var Ae=U(Oe,Re),_e=Ae.paddingSize,le=Ae.borderSize,Ee=Ae.boxSizing,pe=Ae.sizingStyle;K.setAttribute("style","".concat(pe,";").concat(O)),K.value=Oe.value||Oe.placeholder||"";var Ge=Number.MIN_SAFE_INTEGER,Ye=Number.MAX_SAFE_INTEGER,ze=K.scrollHeight,Ze;if(Ee==="border-box"?ze+=le:Ee==="content-box"&&(ze-=_e),Be!==null||Ke!==null){K.value=" ";var Je=K.scrollHeight-_e;Be!==null&&(Ge=Je*Be,Ee==="border-box"&&(Ge=Ge+_e+le),ze=Math.max(Ge,ze)),Ke!==null&&(Ye=Je*Ke,Ee==="border-box"&&(Ye=Ye+_e+le),Ze=ze>Ye?"":"hidden",ze=Math.min(Ye,ze))}return{height:ze,minHeight:Ge,maxHeight:Ye,overflowY:Ze,resize:"none"}}var B=oe("Gytx"),N=oe.n(B),z;(function(Oe){Oe[Oe.NONE=0]="NONE",Oe[Oe.RESIZING=1]="RESIZING",Oe[Oe.RESIZED=2]="RESIZED"})(z||(z={}));var te=function(Oe){Object(k.a)(Be,Oe);var Re=Object(M.a)(Be);function Be(Ke){var Ae;return Object(L.a)(this,Be),Ae=Re.call(this,Ke),Ae.nextFrameActionId=void 0,Ae.resizeFrameId=void 0,Ae.textArea=void 0,Ae.saveTextArea=function(_e){Ae.textArea=_e},Ae.handleResize=function(_e){var le=Ae.state.resizeStatus,Ee=Ae.props,pe=Ee.autoSize,Ge=Ee.onResize;if(le!==z.NONE)return;typeof Ge=="function"&&Ge(_e),pe&&Ae.resizeOnNextFrame()},Ae.resizeOnNextFrame=function(){cancelAnimationFrame(Ae.nextFrameActionId),Ae.nextFrameActionId=requestAnimationFrame(Ae.resizeTextarea)},Ae.resizeTextarea=function(){var _e=Ae.props.autoSize;if(!_e||!Ae.textArea)return;var le=_e.minRows,Ee=_e.maxRows,pe=X(Ae.textArea,!1,le,Ee);Ae.setState({textareaStyles:pe,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(Ae.resizeFrameId),Ae.resizeFrameId=requestAnimationFrame(function(){Ae.setState({resizeStatus:z.RESIZED},function(){Ae.resizeFrameId=requestAnimationFrame(function(){Ae.setState({resizeStatus:z.NONE}),Ae.fixFirefoxAutoScroll()})})})})},Ae.renderTextArea=function(){var _e=Ae.props,le=_e.prefixCls,Ee=le===void 0?"rc-textarea":le,pe=_e.autoSize,Ge=_e.onResize,Ye=_e.className,ze=_e.disabled,Ze=Ae.state,Je=Ze.textareaStyles,$e=Ze.resizeStatus,He=Object(A.a)(Ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ue=D()(Ee,Ye,Object(x.a)({},"".concat(Ee,"-disabled"),ze));"value"in He&&(He.value=He.value||"");var Pe=Object(E.a)(Object(E.a)(Object(E.a)({},Ae.props.style),Je),$e===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return f.createElement(T,{onResize:Ae.handleResize,disabled:!(pe||Ge)},f.createElement("textarea",Object(V.a)({},He,{className:Ue,style:Pe,ref:Ae.saveTextArea})))},Ae.state={textareaStyles:{},resizeStatus:z.NONE},Ae}return Object(I.a)(Be,[{key:"componentDidUpdate",value:function(Ae){(Ae.value!==this.props.value||!N()(Ae.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 Ae=this.textArea.selectionStart,_e=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ae,_e)}}catch(le){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Be}(f.Component),ce=te,be=function(Oe){Object(k.a)(Be,Oe);var Re=Object(M.a)(Be);function Be(Ke){var Ae;Object(L.a)(this,Be),Ae=Re.call(this,Ke),Ae.resizableTextArea=void 0,Ae.focus=function(){Ae.resizableTextArea.textArea.focus()},Ae.saveTextArea=function(le){Ae.resizableTextArea=le},Ae.handleChange=function(le){var Ee=Ae.props.onChange;Ae.setValue(le.target.value,function(){Ae.resizableTextArea.resizeTextarea()}),Ee&&Ee(le)},Ae.handleKeyDown=function(le){var Ee=Ae.props,pe=Ee.onPressEnter,Ge=Ee.onKeyDown;le.keyCode===13&&pe&&pe(le),Ge&&Ge(le)};var _e=typeof Ke.value=="undefined"||Ke.value===null?Ke.defaultValue:Ke.value;return Ae.state={value:_e},Ae}return Object(I.a)(Be,[{key:"setValue",value:function(Ae,_e){"value"in this.props||this.setState({value:Ae},_e)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return f.createElement(ce,Object(V.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ae){return"value"in Ae?{value:Ae.value}:null}}]),Be}(f.Component),Fe=fe.default=be},YJ9k:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"for",content:["for( ; ; ){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(` `)}]},l=oe("5VLF"),c=oe.n(l),d={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"]}},w=function(N,z){return z.map(function(te){return{label:te,kind:N.languages.CompletionItemKind.Keyword,insertText:te}})},m=function(N){return Object.keys(d.tables).map(function(z){return{label:z,kind:N.languages.CompletionItemKind.Variable,insertText:z}})},S=function(N,z){var te=d.tables[N];return te?te.map(function(ce){return{label:ce,kind:z.languages.CompletionItemKind.Field,insertText:ce}}):[]};function C(B,N,z,te,ce){var be=N.getWordUntilPosition(z),Fe={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:be.startColumn,endColumn:be.endColumn},Oe=te.map(function(Re){return{label:Re,kind:B.languages.CompletionItemKind.Keyword,insertText:Re,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}});return ce.map(function(Re){Oe.push(Object(V.a)(Object(V.a)({},Re),{},{range:Fe}))}),Oe}var v=function(B){d.languages.map(function(ce){return B.languages.registerDocumentFormattingEditProvider(ce,{provideDocumentFormattingEdits:function(Fe,Oe,Re){return Object(o.a)(r.a.mark(function Be(){var Ke;return r.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return Ke=c()(Fe.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}),_e.abrupt("return",[{range:Fe.getFullModelRange(),text:Ke}]);case 2:case"end":return _e.stop()}},Be)}))()}}),ce});var N=i.quickKey.map(function(ce){return{label:ce.label,kind:B.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=s.quickKey.map(function(ce){return{label:ce.label,kind:B.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=t.quickKey.map(function(ce){return{label:ce.label,kind:B.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(h.a)(i.keywords),Object(h.a)(i.quickKey.map(function(ce){return ce.label}))),provideCompletionItems:function(be,Fe){var Oe=be.getValueInRange({startLineNumber:Fe.lineNumber,startColumn:1,endLineNumber:Fe.lineNumber,endColumn:Fe.column}),Re=Oe.match(/cu/gim);console.log("match:",Re,Fe,Oe,be);var Be=[],Ke=Fe.lineNumber,Ae=Fe.column,_e=be.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:Ae}),le=_e.trim().split(/\s+/),Ee=le[le.length-1];if(Ee.endsWith(".")){var pe=Ee.slice(0,Ee.length-1);Object.keys(d.tables).includes(pe)&&(Be=Object(h.a)(S(pe,B)))}else Ee==="."?Be=[]:Be=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,i.keywords)),Object(h.a)(N));return{suggestions:Be}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(h.a)(n.keywords)),provideCompletionItems:function(be,Fe){var Oe=be.getValueInRange({startLineNumber:Fe.lineNumber,startColumn:1,endLineNumber:Fe.lineNumber,endColumn:Fe.column}),Re=Oe.match(/cu/gim);console.log("match:",Re,Fe,Oe,be);var Be=[],Ke=Fe.lineNumber,Ae=Fe.column,_e=be.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:Ae}),le=_e.trim().split(/\s+/),Ee=le[le.length-1];if(Ee.endsWith(".")){var pe=Ee.slice(0,Ee.length-1);Object.keys(d.tables).includes(pe)&&(Be=Object(h.a)(S(pe,B)))}else Ee==="."?Be=[]:Be=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,n.keywords)));return{suggestions:Be}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(h.a)(t.keywords)),provideCompletionItems:function(be,Fe){var Oe=[],Re=Fe.lineNumber,Be=Fe.column,Ke=be.getValueInRange({startLineNumber:Re,startColumn:0,endLineNumber:Re,endColumn:Be}),Ae=Ke.trim().split(/\s+/),_e=Ae[Ae.length-1];if(_e.endsWith(".")){var le=_e.slice(0,_e.length-1);Object.keys(d.tables).includes(le)&&(Oe=Object(h.a)(S(le,B)))}else _e==="."?Oe=[]:Oe=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,t.keywords)),Object(h.a)(te));return{suggestions:Oe}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(h.a)(s.keywords)),provideCompletionItems:function(be,Fe){var Oe=[],Re=Fe.lineNumber,Be=Fe.column,Ke=be.getValueInRange({startLineNumber:Re,startColumn:0,endLineNumber:Re,endColumn:Be}),Ae=Ke.trim().split(/\s+/),_e=Ae[Ae.length-1];if(_e.endsWith(".")){var le=_e.slice(0,_e.length-1);Object.keys(d.tables).includes(le)&&(Oe=Object(h.a)(S(le,B)))}else _e==="."?Oe=[]:Oe=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,s.keywords)),Object(h.a)(z));return{suggestions:Oe}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=oe("LvDl"),A=oe("+ua5");function p(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}function D(){}var O=!1,P={"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 j(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],N=B;if(Array.isArray(B)){for(var z=0;z0||Ft.target.offsetWidth>0)&&Te.current.instance.layout()}}catch(zt){It.e(zt)}finally{It.f()}}),nt.observe(he.current)),nt}function Ce(){I.b.warn(decodeURIComponent(y))}var G=function(){var Tt=Te.current.instance;if(be!=null&&Tt&&ne){var It=Tt.getModel();It&&be!==It.getValue()&&(O=!0,It.setValue(be),Tt.layout(),O=!1)}};Object(E.useEffect)(function(){We.current&&clearTimeout(We.current),We.current=setTimeout(function(){G()},500)},[be,ne,Te.current]),Object(E.useEffect)(function(){if(qe&&Te.current&&Te.current.instance){var nt=Te.current.instance;nt.changeViewZones(function(It){var wt=document.createElement("div");wt.style.padding="10px 20px",wt.style.width="calc(100% - 20px)",wt.className="my-error-line-wrp",wt.innerHTML=je,It.addZone({afterLineNumber:qe||11,heightInLines:3,domNode:wt})});var Tt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};nt.addOverlayWidget(Tt),nt.revealPositionInCenter({lineNumber:20,column:1})}},[qe,Te.current,ne]);function we(){var nt=Te.current.instance;if(nt){var Tt=nt.getSelection(),It=Te.current.pastePos||{},wt=new K.Range(It.startLineNumber||Tt.endLineNumber,It.startColumn||Tt.endColumn,It.endLineNumber||Tt.endLineNumber,It.endColumn||Tt.endColumn);setTimeout(function(){nt.executeEdits("",[{range:wt,text:""}])},300)}}function Ne(nt){(window.navigator.platform.match("Mac")?nt.metaKey:nt.ctrlKey)&&nt.keyCode==83&&(nt.preventDefault(),Ye())}var de=function(){if(Ze&&Te.current.instance){var Tt=Te.current.instance.getContentHeight();kt(Tt0||Pe.target.offsetWidth>0)&&Ze.layout()}}catch(ke){He.e(ke)}finally{He.f()}}),Je.observe(Ke.current)),Je}Object(E.useEffect)(function(){Ke.current&&oe.e(27).then(oe.t.bind(null,"M/lh",7)).then(function(Ze){K=Ze;var Je=K.editor.createDiffEditor(Ke.current,Object(V.a)(Object(V.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Be),{},{wordWrap:!0}));Ee(Je);var $e=pe(Je);return function(){Je.dispose();var He=Je.getModel();He&&He.dispose(),$e.unobserve(Ke.current)}})},[]),Object(E.useEffect)(function(){le&&le.setModel({original:K.editor.createModel(be,Oe),modified:K.editor.createModel(Fe,Oe)})},[be,Fe,Oe,le]);var Ge=p(z),Ye=p(ce),ze={width:Ge,height:Ye};return x.a.createElement("div",{className:"my-diff-editor",ref:Ke,style:ze})}},ZpRC:function(at,fe,oe){"use strict";function V(o){return typeof o=="object"&&o!=null&&o.nodeType===1}function L(o,u){return(!u||o!=="hidden")&&o!=="visible"&&o!=="clip"}function I(o,u){if(o.clientHeightu||i>o&&s=u&&l>=r?i-o-n:s>u&&lr?s-u+t:0}var M=function(o,u){var r=window,n=u.scrollMode,t=u.block,i=u.inline,s=u.boundary,l=u.skipOverflowHiddenElements,c=typeof s=="function"?s:function(Je){return Je!==s};if(!V(o))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,w=[],m=o;V(m)&&c(m);){if((m=m.parentElement)===d){w.push(m);break}m!=null&&m===document.body&&I(m)&&!I(document.documentElement)||m!=null&&I(m,l)&&w.push(m)}for(var S=r.visualViewport?r.visualViewport.width:innerWidth,C=r.visualViewport?r.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,T=o.getBoundingClientRect(),A=T.height,p=T.width,D=T.top,O=T.right,P=T.bottom,j=T.left,K=t==="start"||t==="nearest"?D:t==="end"?P:D+A/2,U=i==="center"?j+p/2:i==="end"?O:j,X=[],B=0;B=0&&j>=0&&P<=C&&O<=S&&D>=be&&P<=Oe&&j>=Re&&O<=Fe)return X;var Be=getComputedStyle(N),Ke=parseInt(Be.borderLeftWidth,10),Ae=parseInt(Be.borderTopWidth,10),_e=parseInt(Be.borderRightWidth,10),le=parseInt(Be.borderBottomWidth,10),Ee=0,pe=0,Ge="offsetWidth"in N?N.offsetWidth-N.clientWidth-Ke-_e:0,Ye="offsetHeight"in N?N.offsetHeight-N.clientHeight-Ae-le:0;if(d===N)Ee=t==="start"?K:t==="end"?K-C:t==="nearest"?k(y,y+C,C,Ae,le,y+K,y+K+A,A):K-C/2,pe=i==="start"?U:i==="center"?U-S/2:i==="end"?U-S:k(v,v+S,S,Ke,_e,v+U,v+U+p,p),Ee=Math.max(0,Ee+y),pe=Math.max(0,pe+v);else{Ee=t==="start"?K-be-Ae:t==="end"?K-Oe+le+Ye:t==="nearest"?k(be,Oe,te,Ae,le+Ye,K,K+A,A):K-(be+te/2)+Ye/2,pe=i==="start"?U-Re-Ke:i==="center"?U-(Re+ce/2)+Ge/2:i==="end"?U-Fe+_e+Ge:k(Re,Fe,ce,Ke,_e+Ge,U,U+p,p);var ze=N.scrollLeft,Ze=N.scrollTop;K+=Ze-(Ee=Math.max(0,Math.min(Ze+Ee,N.scrollHeight-te+Ye))),U+=ze-(pe=Math.max(0,Math.min(ze+pe,N.scrollWidth-ce+Ge)))}X.push({el:N,top:Ee,left:pe})}return X};function f(o){return o===Object(o)&&Object.keys(o).length!==0}function E(o,u){u===void 0&&(u="auto");var r="scrollBehavior"in document.body.style;o.forEach(function(n){var t=n.el,i=n.top,s=n.left;t.scroll&&r?t.scroll({top:i,left:s,behavior:u}):(t.scrollTop=i,t.scrollLeft=s)})}function x(o){return o===!1?{block:"end",inline:"nearest"}:f(o)?o:{block:"start",inline:"nearest"}}function g(o,u){var r=!o.ownerDocument.documentElement.contains(o);if(f(u)&&typeof u.behavior=="function")return u.behavior(r?[]:M(o,u));if(r)return;var n=x(u);return E(M(o,n),n.behavior)}var h=fe.a=g},Zss7:function(at,fe,oe){var V;(function(L){var I=/^\s+/,k=/\s+$/,M=0,f=L.round,E=L.min,x=L.max,g=L.random;function h(le,Ee){if(le=le||"",Ee=Ee||{},le instanceof h)return le;if(!(this instanceof h))return new h(le,Ee);var pe=o(le);this._originalInput=le,this._r=pe.r,this._g=pe.g,this._b=pe.b,this._a=pe.a,this._roundA=f(100*this._a)/100,this._format=Ee.format||pe.format,this._gradientType=Ee.gradientType,this._r<1&&(this._r=f(this._r)),this._g<1&&(this._g=f(this._g)),this._b<1&&(this._b=f(this._b)),this._ok=pe.ok,this._tc_id=M++}h.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var le=this.toRgb();return(le.r*299+le.g*587+le.b*114)/1e3},getLuminance:function(){var le=this.toRgb(),Ee,pe,Ge,Ye,ze,Ze;return Ee=le.r/255,pe=le.g/255,Ge=le.b/255,Ee<=.03928?Ye=Ee/12.92:Ye=L.pow((Ee+.055)/1.055,2.4),pe<=.03928?ze=pe/12.92:ze=L.pow((pe+.055)/1.055,2.4),Ge<=.03928?Ze=Ge/12.92:Ze=L.pow((Ge+.055)/1.055,2.4),.2126*Ye+.7152*ze+.0722*Ze},setAlpha:function(le){return this._a=X(le),this._roundA=f(100*this._a)/100,this},toHsv:function(){var le=t(this._r,this._g,this._b);return{h:le.h*360,s:le.s,v:le.v,a:this._a}},toHsvString:function(){var le=t(this._r,this._g,this._b),Ee=f(le.h*360),pe=f(le.s*100),Ge=f(le.v*100);return this._a==1?"hsv("+Ee+", "+pe+"%, "+Ge+"%)":"hsva("+Ee+", "+pe+"%, "+Ge+"%, "+this._roundA+")"},toHsl:function(){var le=r(this._r,this._g,this._b);return{h:le.h*360,s:le.s,l:le.l,a:this._a}},toHslString:function(){var le=r(this._r,this._g,this._b),Ee=f(le.h*360),pe=f(le.s*100),Ge=f(le.l*100);return this._a==1?"hsl("+Ee+", "+pe+"%, "+Ge+"%)":"hsla("+Ee+", "+pe+"%, "+Ge+"%, "+this._roundA+")"},toHex:function(le){return s(this._r,this._g,this._b,le)},toHexString:function(le){return"#"+this.toHex(le)},toHex8:function(le){return l(this._r,this._g,this._b,this._a,le)},toHex8String:function(le){return"#"+this.toHex8(le)},toRgb:function(){return{r:f(this._r),g:f(this._g),b:f(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+f(this._r)+", "+f(this._g)+", "+f(this._b)+")":"rgba("+f(this._r)+", "+f(this._g)+", "+f(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:f(B(this._r,255)*100)+"%",g:f(B(this._g,255)*100)+"%",b:f(B(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+f(B(this._r,255)*100)+"%, "+f(B(this._g,255)*100)+"%, "+f(B(this._b,255)*100)+"%)":"rgba("+f(B(this._r,255)*100)+"%, "+f(B(this._g,255)*100)+"%, "+f(B(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:K[s(this._r,this._g,this._b,!0)]||!1},toFilter:function(le){var Ee="#"+c(this._r,this._g,this._b,this._a),pe=Ee,Ge=this._gradientType?"GradientType = 1, ":"";if(le){var Ye=h(le);pe="#"+c(Ye._r,Ye._g,Ye._b,Ye._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ge+"startColorstr="+Ee+",endColorstr="+pe+")"},toString:function(le){var Ee=!!le;le=le||this._format;var pe=!1,Ge=this._a<1&&this._a>=0,Ye=!Ee&&Ge&&(le==="hex"||le==="hex6"||le==="hex3"||le==="hex4"||le==="hex8"||le==="name");return Ye?le==="name"&&this._a===0?this.toName():this.toRgbString():(le==="rgb"&&(pe=this.toRgbString()),le==="prgb"&&(pe=this.toPercentageRgbString()),(le==="hex"||le==="hex6")&&(pe=this.toHexString()),le==="hex3"&&(pe=this.toHexString(!0)),le==="hex4"&&(pe=this.toHex8String(!0)),le==="hex8"&&(pe=this.toHex8String()),le==="name"&&(pe=this.toName()),le==="hsl"&&(pe=this.toHslString()),le==="hsv"&&(pe=this.toHsvString()),pe||this.toHexString())},clone:function(){return h(this.toString())},_applyModification:function(le,Ee){var pe=le.apply(null,[this].concat([].slice.call(Ee)));return this._r=pe._r,this._g=pe._g,this._b=pe._b,this.setAlpha(pe._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(C,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(le,Ee){return le.apply(null,[this].concat([].slice.call(Ee)))},analogous:function(){return this._applyCombination(O,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(D,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(p,arguments)}},h.fromRatio=function(le,Ee){if(typeof le=="object"){var pe={};for(var Ge in le)le.hasOwnProperty(Ge)&&(Ge==="a"?pe[Ge]=le[Ge]:pe[Ge]=Fe(le[Ge]));le=pe}return h(le,Ee)};function o(le){var Ee={r:0,g:0,b:0},pe=1,Ge=null,Ye=null,ze=null,Ze=!1,Je=!1;return typeof le=="string"&&(le=Ae(le)),typeof le=="object"&&(Ke(le.r)&&Ke(le.g)&&Ke(le.b)?(Ee=u(le.r,le.g,le.b),Ze=!0,Je=String(le.r).substr(-1)==="%"?"prgb":"rgb"):Ke(le.h)&&Ke(le.s)&&Ke(le.v)?(Ge=Fe(le.s),Ye=Fe(le.v),Ee=i(le.h,Ge,Ye),Ze=!0,Je="hsv"):Ke(le.h)&&Ke(le.s)&&Ke(le.l)&&(Ge=Fe(le.s),ze=Fe(le.l),Ee=n(le.h,Ge,ze),Ze=!0,Je="hsl"),le.hasOwnProperty("a")&&(pe=le.a)),pe=X(pe),{ok:Ze,format:le.format||Je,r:E(255,x(Ee.r,0)),g:E(255,x(Ee.g,0)),b:E(255,x(Ee.b,0)),a:pe}}function u(le,Ee,pe){return{r:B(le,255)*255,g:B(Ee,255)*255,b:B(pe,255)*255}}function r(le,Ee,pe){le=B(le,255),Ee=B(Ee,255),pe=B(pe,255);var Ge=x(le,Ee,pe),Ye=E(le,Ee,pe),ze,Ze,Je=(Ge+Ye)/2;if(Ge==Ye)ze=Ze=0;else{var $e=Ge-Ye;Ze=Je>.5?$e/(2-Ge-Ye):$e/(Ge+Ye);switch(Ge){case le:ze=(Ee-pe)/$e+(Ee1&&(Pe-=1),Pe<1/6?He+(Ue-He)*6*Pe:Pe<1/2?Ue:Pe<2/3?He+(Ue-He)*(2/3-Pe)*6:He}if(Ee===0)Ge=Ye=ze=pe;else{var Je=pe<.5?pe*(1+Ee):pe+Ee-pe*Ee,$e=2*pe-Je;Ge=Ze($e,Je,le+1/3),Ye=Ze($e,Je,le),ze=Ze($e,Je,le-1/3)}return{r:Ge*255,g:Ye*255,b:ze*255}}function t(le,Ee,pe){le=B(le,255),Ee=B(Ee,255),pe=B(pe,255);var Ge=x(le,Ee,pe),Ye=E(le,Ee,pe),ze,Ze,Je=Ge,$e=Ge-Ye;if(Ze=Ge===0?0:$e/Ge,Ge==Ye)ze=0;else{switch(Ge){case le:ze=(Ee-pe)/$e+(Ee>1)+720)%360;--Ee;)Ge.h=(Ge.h+Ye)%360,ze.push(h(Ge));return ze}function P(le,Ee){Ee=Ee||6;for(var pe=h(le).toHsv(),Ge=pe.h,Ye=pe.s,ze=pe.v,Ze=[],Je=1/Ee;Ee--;)Ze.push(h({h:Ge,s:Ye,v:ze})),ze=(ze+Je)%1;return Ze}h.mix=function(le,Ee,pe){pe=pe===0?0:pe||50;var Ge=h(le).toRgb(),Ye=h(Ee).toRgb(),ze=pe/100,Ze={r:(Ye.r-Ge.r)*ze+Ge.r,g:(Ye.g-Ge.g)*ze+Ge.g,b:(Ye.b-Ge.b)*ze+Ge.b,a:(Ye.a-Ge.a)*ze+Ge.a};return h(Ze)},h.readability=function(le,Ee){var pe=h(le),Ge=h(Ee);return(L.max(pe.getLuminance(),Ge.getLuminance())+.05)/(L.min(pe.getLuminance(),Ge.getLuminance())+.05)},h.isReadable=function(le,Ee,pe){var Ge=h.readability(le,Ee),Ye,ze;ze=!1,Ye=_e(pe);switch(Ye.level+Ye.size){case"AAsmall":case"AAAlarge":ze=Ge>=4.5;break;case"AAlarge":ze=Ge>=3;break;case"AAAsmall":ze=Ge>=7;break}return ze},h.mostReadable=function(le,Ee,pe){var Ge=null,Ye=0,ze,Ze,Je,$e;pe=pe||{},Ze=pe.includeFallbackColors,Je=pe.level,$e=pe.size;for(var He=0;HeYe&&(Ye=ze,Ge=h(Ee[He]));return h.isReadable(le,Ge,{level:Je,size:$e})||!Ze?Ge:(pe.includeFallbackColors=!1,h.mostReadable(le,["#fff","#000"],pe))};var j=h.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},K=h.hexNames=U(j);function U(le){var Ee={};for(var pe in le)le.hasOwnProperty(pe)&&(Ee[le[pe]]=pe);return Ee}function X(le){return le=parseFloat(le),(isNaN(le)||le<0||le>1)&&(le=1),le}function B(le,Ee){te(le)&&(le="100%");var pe=ce(le);return le=E(Ee,x(0,parseFloat(le))),pe&&(le=parseInt(le*Ee,10)/100),L.abs(le-Ee)<1e-6?1:le%Ee/parseFloat(Ee)}function N(le){return E(1,x(0,le))}function z(le){return parseInt(le,16)}function te(le){return typeof le=="string"&&le.indexOf(".")!=-1&&parseFloat(le)===1}function ce(le){return typeof le=="string"&&le.indexOf("%")!=-1}function be(le){return le.length==1?"0"+le:""+le}function Fe(le){return le<=1&&(le=le*100+"%"),le}function Oe(le){return L.round(parseFloat(le)*255).toString(16)}function Re(le){return z(le)/255}var Be=function(){var le="[-\\+]?\\d+%?",Ee="[-\\+]?\\d*\\.\\d+%?",pe="(?:"+Ee+")|(?:"+le+")",Ge="[\\s|\\(]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")\\s*\\)?",Ye="[\\s|\\(]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")\\s*\\)?";return{CSS_UNIT:new RegExp(pe),rgb:new RegExp("rgb"+Ge),rgba:new RegExp("rgba"+Ye),hsl:new RegExp("hsl"+Ge),hsla:new RegExp("hsla"+Ye),hsv:new RegExp("hsv"+Ge),hsva:new RegExp("hsva"+Ye),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ke(le){return!!Be.CSS_UNIT.exec(le)}function Ae(le){le=le.replace(I,"").replace(k,"").toLowerCase();var Ee=!1;if(j[le])le=j[le],Ee=!0;else if(le=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var pe;return(pe=Be.rgb.exec(le))?{r:pe[1],g:pe[2],b:pe[3]}:(pe=Be.rgba.exec(le))?{r:pe[1],g:pe[2],b:pe[3],a:pe[4]}:(pe=Be.hsl.exec(le))?{h:pe[1],s:pe[2],l:pe[3]}:(pe=Be.hsla.exec(le))?{h:pe[1],s:pe[2],l:pe[3],a:pe[4]}:(pe=Be.hsv.exec(le))?{h:pe[1],s:pe[2],v:pe[3]}:(pe=Be.hsva.exec(le))?{h:pe[1],s:pe[2],v:pe[3],a:pe[4]}:(pe=Be.hex8.exec(le))?{r:z(pe[1]),g:z(pe[2]),b:z(pe[3]),a:Re(pe[4]),format:Ee?"name":"hex8"}:(pe=Be.hex6.exec(le))?{r:z(pe[1]),g:z(pe[2]),b:z(pe[3]),format:Ee?"name":"hex"}:(pe=Be.hex4.exec(le))?{r:z(pe[1]+""+pe[1]),g:z(pe[2]+""+pe[2]),b:z(pe[3]+""+pe[3]),a:Re(pe[4]+""+pe[4]),format:Ee?"name":"hex8"}:(pe=Be.hex3.exec(le))?{r:z(pe[1]+""+pe[1]),g:z(pe[2]+""+pe[2]),b:z(pe[3]+""+pe[3]),format:Ee?"name":"hex"}:!1}function _e(le){var Ee,pe;return le=le||{level:"AA",size:"small"},Ee=(le.level||"AA").toUpperCase(),pe=(le.size||"small").toLowerCase(),Ee!=="AA"&&Ee!=="AAA"&&(Ee="AA"),pe!=="small"&&pe!=="large"&&(pe="small"),{level:Ee,size:pe}}at.exports?at.exports=h:!(V=function(){return h}.call(fe,oe,fe,at),V!==void 0&&(at.exports=V))})(Math)},bT9E:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return L});var V=oe("VTBJ");function L(I,k){var M=Object(V.a)({},I);return Array.isArray(k)&&k.forEach(function(f){delete M[f]}),M}},c5Ni:function(at,fe,oe){},c5fP:function(at,fe,oe){"use strict";function V(he){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(We){return typeof We}:V=function(We){return We&&typeof Symbol=="function"&&We.constructor===Symbol&&We!==Symbol.prototype?"symbol":typeof We},V(he)}Object.defineProperty(fe,"__esModule",{value:!0}),fe._tr_init=De,fe._tr_stored_block=qe,fe._tr_flush_block=je,fe._tr_tally=ct,fe._tr_align=et;var L=k(oe("6BzB"));function I(){if(typeof WeakMap!="function")return null;var he=new WeakMap;return I=function(){return he},he}function k(he){if(he&&he.__esModule)return he;if(he===null||V(he)!=="object"&&typeof he!="function")return{default:he};var Te=I();if(Te&&Te.has(he))return Te.get(he);var We={},xe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ge in he)if(Object.prototype.hasOwnProperty.call(he,ge)){var ye=xe?Object.getOwnPropertyDescriptor(he,ge):null;ye&&(ye.get||ye.set)?Object.defineProperty(We,ge,ye):We[ge]=he[ge]}return We.default=he,Te&&Te.set(he,We),We}var M=4,f=0,E=1,x=2;function g(he){for(var Te=he.length;--Te>=0;)he[Te]=0}var h=0,o=1,u=2,r=3,n=258,t=29,i=256,s=i+1+t,l=30,c=19,d=2*s+1,w=15,m=16,S=7,C=256,v=16,y=17,T=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],p=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=512,j=new Array((s+2)*2);g(j);var K=new Array(l*2);g(K);var U=new Array(P);g(U);var X=new Array(n-r+1);g(X);var B=new Array(t);g(B);var N=new Array(l);g(N);function z(he,Te,We,xe,ge){this.static_tree=he,this.extra_bits=Te,this.extra_base=We,this.elems=xe,this.max_length=ge,this.has_stree=he&&he.length}var te,ce,be;function Fe(he,Te){this.dyn_tree=he,this.max_code=0,this.stat_desc=Te}function Oe(he){return he<256?U[he]:U[256+(he>>>7)]}function Re(he,Te){he.pending_buf[he.pending++]=Te&255,he.pending_buf[he.pending++]=Te>>>8&255}function Be(he,Te,We){he.bi_valid>m-We?(he.bi_buf|=Te<>m-he.bi_valid,he.bi_valid+=We-m):(he.bi_buf|=Te<>>=1,We<<=1;while(--Te>0);return We>>>1}function _e(he){he.bi_valid===16?(Re(he,he.bi_buf),he.bi_buf=0,he.bi_valid=0):he.bi_valid>=8&&(he.pending_buf[he.pending++]=he.bi_buf&255,he.bi_buf>>=8,he.bi_valid-=8)}function le(he,Te){var We=Te.dyn_tree,xe=Te.max_code,ge=Te.stat_desc.static_tree,ye=Te.stat_desc.has_stree,J=Te.stat_desc.extra_bits,ne=Te.stat_desc.extra_base,q=Te.stat_desc.max_length,me,Ce,G,we,Ne,de,Se=0;for(we=0;we<=w;we++)he.bl_count[we]=0;for(We[he.heap[he.heap_max]*2+1]=0,me=he.heap_max+1;meq&&(we=q,Se++),We[Ce*2+1]=we,Ce>xe)continue;he.bl_count[we]++,Ne=0,Ce>=ne&&(Ne=J[Ce-ne]),de=We[Ce*2],he.opt_len+=de*(we+Ne),ye&&(he.static_len+=de*(ge[Ce*2+1]+Ne))}if(Se===0)return;do{for(we=q-1;he.bl_count[we]===0;)we--;he.bl_count[we]--,he.bl_count[we+1]+=2,he.bl_count[q]--,Se-=2}while(Se>0);for(we=q;we!==0;we--)for(Ce=he.bl_count[we];Ce!==0;){if(G=he.heap[--me],G>xe)continue;We[G*2+1]!==we&&(he.opt_len+=(we-We[G*2+1])*We[G*2],We[G*2+1]=we),Ce--}}function Ee(he,Te,We){var xe=new Array(w+1),ge=0,ye,J;for(ye=1;ye<=w;ye++)xe[ye]=ge=ge+We[ye-1]<<1;for(J=0;J<=Te;J++){var ne=he[J*2+1];if(ne===0)continue;he[J*2]=Ae(xe[ne]++,ne)}}function pe(){var he,Te,We,xe,ge,ye=new Array(w+1);for(We=0,xe=0;xe>=7;xe8?Re(he,he.bi_buf):he.bi_valid>0&&(he.pending_buf[he.pending++]=he.bi_buf),he.bi_buf=0,he.bi_valid=0}function ze(he,Te,We,xe){Ye(he),xe&&(Re(he,We),Re(he,~We)),L.arraySet(he.pending_buf,he.window,Te,We,he.pending),he.pending+=We}function Ze(he,Te,We,xe){var ge=Te*2,ye=We*2;return he[ge]>1;J>=1;J--)Je(he,We,J);me=ye;do J=he.heap[1],he.heap[1]=he.heap[he.heap_len--],Je(he,We,1),ne=he.heap[1],he.heap[--he.heap_max]=J,he.heap[--he.heap_max]=ne,We[me*2]=We[J*2]+We[ne*2],he.depth[me]=(he.depth[J]>=he.depth[ne]?he.depth[J]:he.depth[ne])+1,We[J*2+1]=We[ne*2+1]=me,he.heap[1]=me++,Je(he,We,1);while(he.heap_len>=2);he.heap[--he.heap_max]=he.heap[1],le(he,Te),Ee(We,q,he.bl_count)}function Ue(he,Te,We){var xe,ge=-1,ye,J=Te[0*2+1],ne=0,q=7,me=4;for(J===0&&(q=138,me=3),Te[(We+1)*2+1]=65535,xe=0;xe<=We;xe++){if(ye=J,J=Te[(xe+1)*2+1],++ne=3&&!(he.bl_tree[O[Te]*2+1]!==0);Te--);return he.opt_len+=3*(Te+1)+5+5+4,Te}function re(he,Te,We,xe){var ge;for(Be(he,Te-257,5),Be(he,We-1,5),Be(he,xe-4,4),ge=0;ge>>=1)if(Te&1&&he.dyn_ltree[We*2]!==0)return f;if(he.dyn_ltree[9*2]!==0||he.dyn_ltree[10*2]!==0||he.dyn_ltree[13*2]!==0)return E;for(We=32;We0?(he.strm.data_type===x&&(he.strm.data_type=ve(he)),He(he,he.l_desc),He(he,he.d_desc),J=ke(he),ge=he.opt_len+3+7>>>3,ye=he.static_len+3+7>>>3,ye<=ge&&(ge=ye)):ge=ye=We+5,We+4<=ge&&Te!==-1?qe(he,Te,We,xe):he.strategy===M||ye===ge?(Be(he,(o<<1)+(xe?1:0),3),$e(he,j,K)):(Be(he,(u<<1)+(xe?1:0),3),re(he,he.l_desc.max_code+1,he.d_desc.max_code+1,J+1),$e(he,he.dyn_ltree,he.dyn_dtree)),Ge(he),xe&&Ye(he)}function ct(he,Te,We){return he.pending_buf[he.d_buf+he.last_lit*2]=Te>>>8&255,he.pending_buf[he.d_buf+he.last_lit*2+1]=Te&255,he.pending_buf[he.l_buf+he.last_lit]=We&255,he.last_lit++,Te===0?he.dyn_ltree[We*2]++:(he.matches++,Te--,he.dyn_ltree[(X[We]+i+1)*2]++,he.dyn_dtree[Oe(Te)*2]++),he.last_lit===he.lit_bufsize-1}},dejd:function(at,fe,oe){},dmUQ:function(at,fe,oe){"use strict";var V=oe("Ff2n"),L=oe("rePB"),I=oe("1OyB"),k=oe("vuIU"),M=oe("Ji7U"),f=oe("md7G"),E=oe("foSv"),x=oe("q1tI"),g=oe.n(x),h=oe("TSYQ"),o=oe.n(h),u=oe("4IlW");function r(A,p){var D=Object.keys(A);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(A);p&&(O=O.filter(function(P){return Object.getOwnPropertyDescriptor(A,P).enumerable})),D.push.apply(D,O)}return D}function n(A){for(var p=1;p1?ce-1:0),Fe=1;Fe1?B-1:0),z=1;z=0)return parseInt(X.slice(X.indexOf("e-")+2),10);var B=0;return X.indexOf(".")>=0&&(B=X.length-X.indexOf(".")-1),B},P.getInputDisplayValue=function(U){var X=U||P.state,B=X.focused,N=X.inputValue,z=X.value,te;B?te=N:te=P.toPrecisionAsStep(z),te==null&&(te="");var ce=P.formatWrapper(te);return S(P.props.decimalSeparator)&&(ce=ce.toString().replace(".",P.props.decimalSeparator)),ce},P.recordCursorPosition=function(){try{P.cursorStart=P.input.selectionStart,P.cursorEnd=P.input.selectionEnd,P.currentValue=P.input.value,P.cursorBefore=P.input.value.substring(0,P.cursorStart),P.cursorAfter=P.input.value.substring(P.cursorEnd)}catch(U){}},P.restoreByAfter=function(U){if(U===void 0)return!1;var X=P.input.value,B=X.lastIndexOf(U);if(B===-1)return!1;var N=P.cursorBefore.length;return P.lastKeyCode===u.a.DELETE&&P.cursorBefore.charAt(N-1)===U[0]?(P.fixCaret(N,N),!0):B+U.length===X.length?(P.fixCaret(B,B),!0):!1},P.partRestoreByAfter=function(U){return U===void 0?!1:Array.prototype.some.call(U,function(X,B){var N=U.substring(B);return P.restoreByAfter(N)})},P.isNotCompleteNumber=function(U){return isNaN(U)||U===""||U===null||U&&U.toString().indexOf(".")===U.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(U,X,B){P.pressingUpOrDown=!0,P.step("down",U,X,B)},P.up=function(U,X,B){P.pressingUpOrDown=!0,P.step("up",U,X,B)},P.saveInput=function(U){P.input=U};var j=O.value;j===void 0&&(j=O.defaultValue),P.state={focused:O.autoFocus};var K=P.getValidValue(P.toNumber(j));return P.state=n(n({},P.state),{},{inputValue:P.toPrecisionAsStep(K),value:K}),P}return Object(k.a)(D,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var j=this.props,K=j.value,U=j.onChange,X=j.max,B=j.min,N=this.state.focused;if(P){if(!C(P.value,K)||!C(P.max,X)||!C(P.min,B)){var z=N?K:this.getValidValue(K),te;this.pressingUpOrDown?te=z:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:te})}var ce="value"in this.props?K:this.state.value;"max"in this.props&&P.max!==X&&typeof ce=="number"&&ce>X&&U&&U(X),"min"in this.props&&P.min!==B&&typeof ce=="number"&&ce1&&arguments[1]!==void 0?arguments[1]:this.props.min,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,U=parseFloat(P);return isNaN(U)?P:(UK&&(U=K),U)}},{key:"setValue",value:function(P,j){var K=this.props.precision,U=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),X=this.state.value,B=X===void 0?null:X,N=this.state.inputValue,z=N===void 0?null:N,te=typeof U=="number"?U.toFixed(K):"".concat(U),ce=U!==B||te!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},j)):this.setState({value:U,inputValue:this.toPrecisionAsStep(P)},j),ce&&this.props.onChange(U),U}},{key:"getMaxPrecision",value:function(P){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.props,U=K.precision,X=K.step;if(S(U))return U;var B=this.getPrecision(j),N=this.getPrecision(X),z=this.getPrecision(P);return P?Math.max(z,B+N):B+N}},{key:"getPrecisionFactor",value:function(P){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.getMaxPrecision(P,j);return Math.pow(10,K)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(P){return this.props.formatter?this.props.formatter(P):P}},{key:"toPrecisionAsStep",value:function(P){if(this.isNotCompleteNumber(P)||P==="")return P;var j=Math.abs(this.getMaxPrecision(P));return isNaN(j)?P.toString():Number(P).toFixed(j)}},{key:"toNumber",value:function(P){var j=this.props.precision,K=this.state.focused,U=P&&P.length>16&&K;return this.isNotCompleteNumber(P)||U?P:S(j)?Math.round(P*Math.pow(10,j))/Math.pow(10,j):Number(P)}},{key:"upStep",value:function(P,j){var K=this.props.step,U=this.getPrecisionFactor(P,j),X=Math.abs(this.getMaxPrecision(P,j)),B=((U*P+U*K*j)/U).toFixed(X);return this.toNumber(B)}},{key:"downStep",value:function(P,j){var K=this.props.step,U=this.getPrecisionFactor(P,j),X=Math.abs(this.getMaxPrecision(P,j)),B=((U*P-U*K*j)/U).toFixed(X);return this.toNumber(B)}},{key:"step",value:function(P,j){var K=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,X=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var B=this.props;if(B.disabled)return;var N=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(N))return;var z=this["".concat(P,"Step")](N,U),te=z>B.max||zB.max?z=B.max:z=be),We=(De||De===0)&&(isNaN(De)||Number(De)<=Fe),xe=Te||U||X,ge=We||U||X,ye=o()("".concat(K,"-handler"),"".concat(K,"-handler-up"),Object(L.a)({},"".concat(K,"-handler-up-disabled"),xe)),J=o()("".concat(K,"-handler"),"".concat(K,"-handler-down"),Object(L.a)({},"".concat(K,"-handler-down-disabled"),ge)),ne=B?{onTouchStart:xe?s:this.up,onTouchEnd:this.stop}:{onMouseDown:xe?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},q=B?{onTouchStart:ge?s:this.down,onTouchEnd:this.stop}:{onMouseDown:ge?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return g.a.createElement("div",{className:et,style:Oe,title:Re,onMouseEnter:Be,onMouseLeave:Ke,onMouseOver:Ae,onMouseOut:_e,onFocus:function(){return null},onBlur:function(){return null}},g.a.createElement("div",{className:"".concat(K,"-handler-wrap")},g.a.createElement("span",Object.assign({unselectable:"on"},ne,{role:"button","aria-label":"Increase Value","aria-disabled":xe,className:ye}),z||g.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-up-inner"),onClick:l})),g.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Decrease Value","aria-disabled":ge,className:J}),te||g.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-down-inner"),onClick:l}))),g.a.createElement("div",{className:"".concat(K,"-input-wrap")},g.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Fe,"aria-valuemax":be,"aria-valuenow":De,required:le,type:Ge,placeholder:Ye,onPaste:ke,onClick:Ee,onMouseUp:this.onMouseUp,className:"".concat(K,"-input"),tabIndex:pe,autoComplete:N,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ct?this.onKeyDown:s,onKeyUp:ct?this.onKeyUp:s,autoFocus:Ue,maxLength:He,readOnly:X,disabled:U,max:be,min:Fe,step:$e,name:Pe,title:Re,id:ze,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(he),pattern:Je,inputMode:Ze,onInput:re},je))))}}]),D}(g.a.Component);v.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:c,required:!1,autoComplete:"off"};var y=v,T=fe.a=y},eP3c:function(at,fe,oe){"use strict";function V(J){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(q){return typeof q}:V=function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},V(J)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.inflateReset=re,fe.inflateReset2=ve,fe.inflateResetKeep=ke,fe.inflateInit=De,fe.inflateInit2=ae,fe.inflate=Te,fe.inflateEnd=We,fe.inflateGetHeader=xe,fe.inflateSetDictionary=ge,fe.inflateInfo=fe.Z_DEFLATED=fe.Z_BUF_ERROR=fe.Z_MEM_ERROR=fe.Z_DATA_ERROR=fe.Z_STREAM_ERROR=fe.Z_NEED_DICT=fe.Z_STREAM_END=fe.Z_OK=fe.Z_TREES=fe.Z_BLOCK=fe.Z_FINISH=void 0;var L=g(oe("6BzB")),I=E(oe("xlC8")),k=E(oe("QV2g")),M=E(oe("sjKO")),f=E(oe("JSwD"));function E(J){return J&&J.__esModule?J:{default:J}}function x(){if(typeof WeakMap!="function")return null;var J=new WeakMap;return x=function(){return J},J}function g(J){if(J&&J.__esModule)return J;if(J===null||V(J)!=="object"&&typeof J!="function")return{default:J};var ne=x();if(ne&&ne.has(J))return ne.get(J);var q={},me=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ce in J)if(Object.prototype.hasOwnProperty.call(J,Ce)){var G=me?Object.getOwnPropertyDescriptor(J,Ce):null;G&&(G.get||G.set)?Object.defineProperty(q,Ce,G):q[Ce]=J[Ce]}return q.default=J,ne&&ne.set(J,q),q}var h=0,o=1,u=2,r=4;fe.Z_FINISH=r;var n=5;fe.Z_BLOCK=n;var t=6;fe.Z_TREES=t;var i=0;fe.Z_OK=i;var s=1;fe.Z_STREAM_END=s;var l=2;fe.Z_NEED_DICT=l;var c=-2;fe.Z_STREAM_ERROR=c;var d=-3;fe.Z_DATA_ERROR=d;var w=-4;fe.Z_MEM_ERROR=w;var m=-5;fe.Z_BUF_ERROR=m;var S=8;fe.Z_DEFLATED=S;var C=1,v=2,y=3,T=4,A=5,p=6,D=7,O=8,P=9,j=10,K=11,U=12,X=13,B=14,N=15,z=16,te=17,ce=18,be=19,Fe=20,Oe=21,Re=22,Be=23,Ke=24,Ae=25,_e=26,le=27,Ee=28,pe=29,Ge=30,Ye=31,ze=32,Ze=852,Je=592,$e=15,He=$e;function Ue(J){return(J>>>24&255)+(J>>>8&65280)+((J&65280)<<8)+((J&255)<<24)}function Pe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new L.Buf16(320),this.work=new L.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ke(J){var ne;return!J||!J.state?c:(ne=J.state,J.total_in=J.total_out=ne.total=0,J.msg="",ne.wrap&&(J.adler=ne.wrap&1),ne.mode=C,ne.last=0,ne.havedict=0,ne.dmax=32768,ne.head=null,ne.hold=0,ne.bits=0,ne.lencode=ne.lendyn=new L.Buf32(Ze),ne.distcode=ne.distdyn=new L.Buf32(Je),ne.sane=1,ne.back=-1,i)}function re(J){var ne;return!J||!J.state?c:(ne=J.state,ne.wsize=0,ne.whave=0,ne.wnext=0,ke(J))}function ve(J,ne){var q,me;return!J||!J.state?c:(me=J.state,ne<0?(q=0,ne=-ne):(q=(ne>>4)+1,ne<48&&(ne&=15)),ne&&(ne<8||ne>15)?c:(me.window!==null&&me.wbits!==ne&&(me.window=null),me.wrap=q,me.wbits=ne,re(J)))}function ae(J,ne){var q,me;return J?(me=new Pe,J.state=me,me.window=null,q=ve(J,ne),q!==i&&(J.state=null),q):c}function De(J){return ae(J,He)}var qe=!0,et,je;function ct(J){if(qe){var ne;for(et=new L.Buf32(512),je=new L.Buf32(32),ne=0;ne<144;)J.lens[ne++]=8;for(;ne<256;)J.lens[ne++]=9;for(;ne<280;)J.lens[ne++]=7;for(;ne<288;)J.lens[ne++]=8;for((0,f.default)(o,J.lens,0,288,et,0,J.work,{bits:9}),ne=0;ne<32;)J.lens[ne++]=5;(0,f.default)(u,J.lens,0,32,je,0,J.work,{bits:5}),qe=!1}J.lencode=et,J.lenbits=9,J.distcode=je,J.distbits=5}function he(J,ne,q,me){var Ce,G=J.state;return G.window===null&&(G.wsize=1<=G.wsize?(L.arraySet(G.window,ne,q-G.wsize,G.wsize,0),G.wnext=0,G.whave=G.wsize):(Ce=G.wsize-G.wnext,Ce>me&&(Ce=me),L.arraySet(G.window,ne,q-me,Ce,G.wnext),me-=Ce,me?(L.arraySet(G.window,ne,q-me,me,0),G.wnext=me,G.whave=G.wsize):(G.wnext+=Ce,G.wnext===G.wsize&&(G.wnext=0),G.whave>>8&255,q.check=(0,k.default)(q.check,zt,2,0),Se=0,Xe=0,q.mode=v;break}if(q.flags=0,q.head&&(q.head.done=!1),!(q.wrap&1)||(((Se&255)<<8)+(Se>>8))%31){J.msg="incorrect header check",q.mode=Ge;break}if((Se&15)!==S){J.msg="unknown compression method",q.mode=Ge;break}if(Se>>>=4,Xe-=4,wt=(Se&15)+8,q.wbits===0)q.wbits=wt;else if(wt>q.wbits){J.msg="invalid window size",q.mode=Ge;break}q.dmax=1<>8&1),q.flags&512&&(zt[0]=Se&255,zt[1]=Se>>>8&255,q.check=(0,k.default)(q.check,zt,2,0)),Se=0,Xe=0,q.mode=y;case y:for(;Xe<32;){if(Ne===0)break e;Ne--,Se+=me[G++]<>>8&255,zt[2]=Se>>>16&255,zt[3]=Se>>>24&255,q.check=(0,k.default)(q.check,zt,4,0)),Se=0,Xe=0,q.mode=T;case T:for(;Xe<16;){if(Ne===0)break e;Ne--,Se+=me[G++]<>8),q.flags&512&&(zt[0]=Se&255,zt[1]=Se>>>8&255,q.check=(0,k.default)(q.check,zt,2,0)),Se=0,Xe=0,q.mode=A;case A:if(q.flags&1024){for(;Xe<16;){if(Ne===0)break e;Ne--,Se+=me[G++]<>>8&255,q.check=(0,k.default)(q.check,zt,2,0)),Se=0,Xe=0}else q.head&&(q.head.extra=null);q.mode=p;case p:if(q.flags&1024&&(st=q.length,st>Ne&&(st=Ne),st&&(q.head&&(wt=q.head.extra_len-q.length,q.head.extra||(q.head.extra=new Array(q.head.extra_len)),L.arraySet(q.head.extra,me,G,st,wt)),q.flags&512&&(q.check=(0,k.default)(q.check,me,st,G)),Ne-=st,G+=st,q.length-=st),q.length))break e;q.length=0,q.mode=D;case D:if(q.flags&2048){if(Ne===0)break e;st=0;do wt=me[G+st++],q.head&&wt&&q.length<65536&&(q.head.name+=String.fromCharCode(wt));while(wt&&st>9&1,q.head.done=!0),J.adler=q.check=0,q.mode=U;break;case j:for(;Xe<32;){if(Ne===0)break e;Ne--,Se+=me[G++]<>>=Xe&7,Xe-=Xe&7,q.mode=le;break}for(;Xe<3;){if(Ne===0)break e;Ne--,Se+=me[G++]<>>=1,Xe-=1;switch(Se&3){case 0:q.mode=B;break;case 1:if(ct(q),q.mode=Fe,ne===t){Se>>>=2,Xe-=2;break e}break;case 2:q.mode=te;break;case 3:J.msg="invalid block type",q.mode=Ge}Se>>>=2,Xe-=2;break;case B:for(Se>>>=Xe&7,Xe-=Xe&7;Xe<32;){if(Ne===0)break e;Ne--,Se+=me[G++]<>>16^65535)){J.msg="invalid stored block lengths",q.mode=Ge;break}if(q.length=Se&65535,Se=0,Xe=0,q.mode=N,ne===t)break e;case N:q.mode=z;case z:if(st=q.length,st){if(st>Ne&&(st=Ne),st>de&&(st=de),st===0)break e;L.arraySet(Ce,me,G,st,we),Ne-=st,G+=st,de-=st,we+=st,q.length-=st;break}q.mode=U;break;case te:for(;Xe<14;){if(Ne===0)break e;Ne--,Se+=me[G++]<>>=5,Xe-=5,q.ndist=(Se&31)+1,Se>>>=5,Xe-=5,q.ncode=(Se&15)+4,Se>>>=4,Xe-=4,q.nlen>286||q.ndist>30){J.msg="too many length or distance symbols",q.mode=Ge;break}q.have=0,q.mode=ce;case ce:for(;q.have>>=3,Xe-=3}for(;q.have<19;)q.lens[xt[q.have++]]=0;if(q.lencode=q.lendyn,q.lenbits=7,ui={bits:q.lenbits},Ft=(0,f.default)(h,q.lens,0,19,q.lencode,0,q.work,ui),q.lenbits=ui.bits,Ft){J.msg="invalid code lengths set",q.mode=Ge;break}q.have=0,q.mode=be;case be:for(;q.have>>24,kt=_t>>>16&255,Nt=_t&65535,ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<>>=ft,Xe-=ft,q.lens[q.have++]=Nt;else{if(Nt===16){for(Pt=ft+2;Xe>>=ft,Xe-=ft,q.have===0){J.msg="invalid bit length repeat",q.mode=Ge;break}wt=q.lens[q.have-1],st=3+(Se&3),Se>>>=2,Xe-=2}else if(Nt===17){for(Pt=ft+3;Xe>>=ft,Xe-=ft,wt=0,st=3+(Se&7),Se>>>=3,Xe-=3}else{for(Pt=ft+7;Xe>>=ft,Xe-=ft,wt=0,st=11+(Se&127),Se>>>=7,Xe-=7}if(q.have+st>q.nlen+q.ndist){J.msg="invalid bit length repeat",q.mode=Ge;break}for(;st--;)q.lens[q.have++]=wt}}if(q.mode===Ge)break;if(q.lens[256]===0){J.msg="invalid code -- missing end-of-block",q.mode=Ge;break}if(q.lenbits=9,ui={bits:q.lenbits},Ft=(0,f.default)(o,q.lens,0,q.nlen,q.lencode,0,q.work,ui),q.lenbits=ui.bits,Ft){J.msg="invalid literal/lengths set",q.mode=Ge;break}if(q.distbits=6,q.distcode=q.distdyn,ui={bits:q.distbits},Ft=(0,f.default)(u,q.lens,q.nlen,q.ndist,q.distcode,0,q.work,ui),q.distbits=ui.bits,Ft){J.msg="invalid distances set",q.mode=Ge;break}if(q.mode=Fe,ne===t)break e;case Fe:q.mode=Oe;case Oe:if(Ne>=6&&de>=258){J.next_out=we,J.avail_out=de,J.next_in=G,J.avail_in=Ne,q.hold=Se,q.bits=Xe,(0,M.default)(J,tt),we=J.next_out,Ce=J.output,de=J.avail_out,G=J.next_in,me=J.input,Ne=J.avail_in,Se=q.hold,Xe=q.bits,q.mode===U&&(q.back=-1);break}for(q.back=0;!(_t=q.lencode[Se&(1<>>24,kt=_t>>>16&255,Nt=_t&65535,ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<>nt)],ft=_t>>>24,kt=_t>>>16&255,Nt=_t&65535,nt+ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<>>=nt,Xe-=nt,q.back+=nt}if(Se>>>=ft,Xe-=ft,q.back+=ft,q.length=Nt,kt===0){q.mode=_e;break}if(kt&32){q.back=-1,q.mode=U;break}if(kt&64){J.msg="invalid literal/length code",q.mode=Ge;break}q.extra=kt&15,q.mode=Re;case Re:if(q.extra){for(Pt=q.extra;Xe>>=q.extra,Xe-=q.extra,q.back+=q.extra}q.was=q.length,q.mode=Be;case Be:for(;!(_t=q.distcode[Se&(1<>>24,kt=_t>>>16&255,Nt=_t&65535,ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<>nt)],ft=_t>>>24,kt=_t>>>16&255,Nt=_t&65535,nt+ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<>>=nt,Xe-=nt,q.back+=nt}if(Se>>>=ft,Xe-=ft,q.back+=ft,kt&64){J.msg="invalid distance code",q.mode=Ge;break}q.offset=Nt,q.extra=kt&15,q.mode=Ke;case Ke:if(q.extra){for(Pt=q.extra;Xe>>=q.extra,Xe-=q.extra,q.back+=q.extra}if(q.offset>q.dmax){J.msg="invalid distance too far back",q.mode=Ge;break}q.mode=Ae;case Ae:if(de===0)break e;if(st=tt-de,q.offset>st){if(st=q.offset-st,st>q.whave&&q.sane){J.msg="invalid distance too far back",q.mode=Ge;break}st>q.wnext?(st-=q.wnext,mt=q.wsize-st):mt=q.wnext-st,st>q.length&&(st=q.length),Ct=q.window}else Ct=Ce,mt=we-q.offset,st=q.length;st>de&&(st=de),de-=st,q.length-=st;do Ce[we++]=Ct[mt++];while(--st);q.length===0&&(q.mode=Oe);break;case _e:if(de===0)break e;Ce[we++]=q.length,de--,q.mode=Oe;break;case le:if(q.wrap){for(;Xe<32;){if(Ne===0)break e;Ne--,Se|=me[G++]<K.length)&&(U=K.length);for(var X=0,B=new Array(U);X=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,B))continue;X[B]=K[B]}}return X}function t(K,U){if(K==null)return{};var X={},B=Object.keys(K),N,z;for(z=0;z=0)continue;X[N]=K[N]}return X}var i=function(U){var X=U.className,B=U.percent,N=U.prefixCls,z=U.strokeColor,te=U.strokeLinecap,ce=U.strokeWidth,be=U.style,Fe=U.trailColor,Oe=U.trailWidth,Re=U.transition,Be=n(U,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Be.gapPosition;var Ke=Array.isArray(B)?B:[B],Ae=Array.isArray(z)?z:[z],_e=f(Ke),le=x(_e,1),Ee=le[0],pe=ce/2,Ge=100-ce/2,Ye="M ".concat(te==="round"?pe:0,",").concat(pe,` L `).concat(te==="round"?Ge:100,",").concat(pe),ze="0 0 100 ".concat(ce),Ze=0;return L.a.createElement("svg",E({className:k()("".concat(N,"-line"),X),viewBox:ze,preserveAspectRatio:"none",style:be},Be),L.a.createElement("path",{className:"".concat(N,"-line-trail"),d:Ye,strokeLinecap:te,stroke:Fe,strokeWidth:Oe||ce,fillOpacity:"0"}),Ke.map(function(Je,$e){var He={strokeDasharray:"".concat(Je,"px, 100px"),strokeDashoffset:"-".concat(Ze,"px"),transition:Re||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ue=Ae[$e]||Ae[Ae.length-1];return Ze+=Je,L.a.createElement("path",{key:$e,className:"".concat(N,"-line-path"),d:Ye,strokeLinecap:te,stroke:Ue,strokeWidth:ce,fillOpacity:"0",ref:Ee[$e],style:He})}))};i.defaultProps=M;var s=i;function l(){return l=Object.assign||function(K){for(var U=1;UK.length)&&(U=K.length);for(var X=0,B=new Array(U);X=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,B))continue;X[B]=K[B]}}return X}function y(K,U){if(K==null)return{};var X={},B=Object.keys(K),N,z;for(z=0;z=0)continue;X[N]=K[N]}return X}var T=0;function A(K){return+K.replace("%","")}function p(K){return Array.isArray(K)?K:[K]}function D(K,U,X,B){var N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,z=arguments.length>5?arguments[5]:void 0,te=50-B/2,ce=0,be=-te,Fe=0,Oe=-2*te;switch(z){case"left":ce=-te,be=0,Fe=2*te,Oe=0;break;case"right":ce=te,be=0,Fe=-2*te,Oe=0;break;case"bottom":be=te,Oe=2*te;break;default:}var Re="M 50,50 m ".concat(ce,",").concat(be,` a `).concat(te,",").concat(te," 0 1 1 ").concat(Fe,",").concat(-Oe,` a `).concat(te,",").concat(te," 0 1 1 ").concat(-Fe,",").concat(Oe),Be=Math.PI*2*te,Ke={stroke:X,strokeDasharray:"".concat(U/100*(Be-N),"px ").concat(Be,"px"),strokeDashoffset:"-".concat(N/2+K/100*(Be-N),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Re,pathStyle:Ke}}var O=function(U){var X=U.prefixCls,B=U.strokeWidth,N=U.trailWidth,z=U.gapDegree,te=U.gapPosition,ce=U.trailColor,be=U.strokeLinecap,Fe=U.style,Oe=U.className,Re=U.strokeColor,Be=U.percent,Ke=v(U,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Ae=Object(V.useMemo)(function(){return T+=1,T},[]),_e=D(0,100,ce,B,z,te),le=_e.pathString,Ee=_e.pathStyle,pe=p(Be),Ge=p(Re),Ye=Ge.find(function(He){return Object.prototype.toString.call(He)==="[object Object]"}),ze=f(pe),Ze=c(ze,1),Je=Ze[0],$e=function(){var Ue=0;return pe.map(function(Pe,ke){var re=Ge[ke]||Ge[Ge.length-1],ve=Object.prototype.toString.call(re)==="[object Object]"?"url(#".concat(X,"-gradient-").concat(Ae,")"):"",ae=D(Ue,Pe,re,B,z,te);return Ue+=Pe,L.a.createElement("path",{key:ke,className:"".concat(X,"-circle-path"),d:ae.pathString,stroke:ve,strokeLinecap:be,strokeWidth:B,opacity:Pe===0?0:1,fillOpacity:"0",style:ae.pathStyle,ref:Je[ke]})})};return L.a.createElement("svg",l({className:k()("".concat(X,"-circle"),Oe),viewBox:"0 0 100 100",style:Fe},Ke),Ye&&L.a.createElement("defs",null,L.a.createElement("linearGradient",{id:"".concat(X,"-gradient-").concat(Ae),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ye).sort(function(He,Ue){return A(He)-A(Ue)}).map(function(He,Ue){return L.a.createElement("stop",{key:Ue,offset:He,stopColor:Ye[He]})}))),L.a.createElement("path",{className:"".concat(X,"-circle-trail"),d:le,stroke:ce,strokeLinecap:be,strokeWidth:N||B,fillOpacity:"0",style:Ee}),$e().reverse())};O.defaultProps=M;var P=O,j={Line:s,Circle:P}},hXwI:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E0||Xe.target.offsetWidth>0)&&G._eventHandlers.windowResize()}}catch(lt){de.e(lt)}finally{de.f()}}),we.observe(Ye.current)),we}var q=function(){var G=Object(h.a)(l.a.mark(function we(){var Ne;return l.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(U.sb)(Object(g.a)({},ge));case 2:if(Ne=Se.sent,!((Ne==null?void 0:Ne.status)===-3)){Se.next=5;break}return Se.abrupt("return",new Promise(function(){var Xe=Object(h.a)(l.a.mark(function lt(tt,st){return l.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:u.a.confirm({content:"\u68C0\u6D4B\u5230\u60A8\u5DF2\u7ECF\u5F00\u542F\u4E86\u5176\u4ED6windows\u73AF\u5883\uFF0C\u8BF7\u5148\u5173\u95ED\u73AF\u5883\u540E\uFF0C\u518D\u8FDE\u63A5",okText:"\u7ACB\u5373\u5173\u95ED",cancelText:"\u7A0D\u540E\u5173\u95ED",onOk:function(){var _t=Object(h.a)(l.a.mark(function kt(){return l.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return clearTimeout(We),Te(0),q(),nt.abrupt("return");case 4:case"end":return nt.stop()}},kt)}));function ft(){return _t.apply(this,arguments)}return ft}()});case 1:case"end":return Ct.stop()}},lt)}));return function(lt,tt){return Xe.apply(this,arguments)}}()));case 5:if(!((Ne==null?void 0:Ne.status)===-1)){Se.next=7;break}throw new String(Ne==null?void 0:Ne.message);case 7:return v.a.publish("update-windows-time",Ne==null?void 0:Ne.data),Se.abrupt("return",Ne);case 9:case"end":return Se.stop()}},we)}));return function(){return G.apply(this,arguments)}}();Object(c.useEffect)(function(){return xe.current=setTimeout(function(){u.a.confirm({title:d.a.createElement(d.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 5 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){v.a.publish("delayed-time",1),re(ke+1)}})},1e3*60*60),function(){clearTimeout(xe.current)}},[]),Object(c.useEffect)(function(){var G,we;function Ne(st){pe&&(k.b.warn("\u7531\u4E8E\u957F\u65F6\u95F4\u672A\u64CD\u4F5C\uFF0C\u8FDE\u63A5\u5931\u6548\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5Windows VNC\u670D\u52A1"),He({type:Fe.SET_LOADING,payload:!0}),re(ke+1))}function de(){clearTimeout(We),Te(100),setTimeout(function(){He({type:Fe.SET_LOADING,payload:!1})},1300),v.a.subscribe("send-ctrl-alt-delete",function(){var st;(st=G)===null||st===void 0||st.sendCtrlAltDel()})}function Se(st){var mt=te(st.detail.text);He({type:Fe.SET_TRANSFER_CONTENT,payload:mt})}if((pe||Ee)&&Ye.current){new Promise(Object(h.a)(l.a.mark(function st(){var mt,Ct,_t,ft,kt,Nt,nt,Tt,It,wt;return l.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return mt=ce(),Ct="",zt.next=4,q();case 4:ft=zt.sent,pe?(_t="Edu123",Ct=decodeURIComponent(ft==null||((kt=ft.data)===null||kt===void 0)?void 0:kt.vnc_url)):(nt=new URL(ft==null||((Nt=ft.data)===null||Nt===void 0)?void 0:Nt.vnc_url),Tt=nt.protocol,It=nt.searchParams,wt=nt.host,_t=It.get("password"),Ct="".concat(Tt==="https:"?"wss":"ws","://").concat(wt,"/").concat(mt.path||"websockify")),G=new K.a(Ye.current,Ct,{credentials:{password:_t},wsProtocols:["binary"]}),we=ne(G),G.viewOnly=mt.view_only||!1,pe?G.scaleViewport=!0:G.scaleViewport=mt.scale||!1,G.scaleViewport=mt.scale||!0,G.resizeSession=!0,ze.current=G,G.addEventListener("disconnect",Ne),G.addEventListener("connect",de),G.addEventListener("clipboard",Se);case 16:case"end":return zt.stop()}},st)})));var Xe=v.a.subscribe("vnc-reseting",function(){He({type:Fe.SET_STATE,payload:{loading:!0,mes:"\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"}})}),lt=v.a.subscribe("vnc-enlarge",function(){He({type:Fe.SET_IS_LARGE,payload:!0})}),tt=v.a.subscribe("show-clipboard-box",function(){He({type:Fe.SHOW_CLIPBOARD_BOX,payload:!0})});return Te(0),function(){var st,mt,Ct,_t;(st=G)===null||st===void 0||st.removeEventListener("disconnect",Ne),(mt=G)===null||mt===void 0||mt.removeEventListener("connect",de),(Ct=G)===null||Ct===void 0||Ct.removeEventListener("clipboard",Se),Xe(),lt(),tt(),(_t=we)===null||_t===void 0||_t.unobserve(Ye.current)}}},[Ee,pe,ke]);function me(G){var we;(we=ze.current)===null||we===void 0||we.clipboardPasteFrom(G),He({type:Fe.SET_TRANSFER_CONTENT,payload:G}),k.b.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9"),ye()}Object(c.useEffect)(function(){he==0&&Ce()},[he]);var Ce=function G(){he>99?he=99:(he=he+1,We=setTimeout(function(){G()},1500)),he<100&&Te(he)};return d.a.createElement(c.Fragment,null,d.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(pe?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(qe?"full-screen":"")},d.a.createElement("a",{className:"btn-vnc-resize",onClick:J},d.a.createElement("i",{className:"iconfont ".concat(qe?"icon-tuichuquanping1":"icon-quanping1")})),ae?d.a.createElement(p.a,{className:B.a.spin,message:ve,style:{color:"#0152d9"}},d.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},d.a.createElement(T.a,{percent:he,format:function(we){return d.a.createElement("span",{className:"c-white"},we,"%")}}))):null,d.a.createElement("div",{ref:Ye,className:"vnc-panel ".concat(ae?"hide":"animated fadeIn")})),d.a.createElement(O.a,null))},Be=oe("m3rI"),Ke=i.a.Countdown,Ae=function(Ee){var pe,Ge,Ye=Ee.shixunsDetail,ze=Ee.globalSetting,Ze=Ee.loading,Je=Ee.dispatch,$e=Ee.user,He=Ee.history,Ue=Object(n.a)(Ee,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),Pe=Object(c.useState)({}),ke=Object(r.a)(Pe,2),re=ke[0],ve=ke[1],ae=Object(c.useState)(400),De=Object(r.a)(ae,2),qe=De[0],et=De[1],je=Object(c.useState)(!1),ct=Object(r.a)(je,2),he=ct[0],Te=ct[1],We=Object(c.useState)(""),xe=Object(r.a)(We,2),ge=xe[0],ye=xe[1],J=Object(c.useState)(Date.now()+1e3*60*60),ne=Object(r.a)(J,2),q=ne[0],me=ne[1],Ce=Ue.match.params,G=Ue.location.query,we=Object(c.useState)(!1),Ne=Object(r.a)(we,2),de=Ne[0],Se=Ne[1],Xe=Ye.mirrorApplies,lt=Object(c.useRef)();Object(c.useEffect)(function(){return Je({type:"globalSetting/headerFooterToggle",payload:!1}),st(),mt(),window.addEventListener("resize",st),v.a.subscribe("delayed-time",function(){me(Date.now()+1e3*60*60)}),function(){window.removeEventListener("resize",st),clearTimeout(lt.current),Je({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(c.useEffect)(function(){re.host&&setTimeout(function(){v.a.publish("create-socket",1)},1500)},[re]),Object(c.useEffect)(function(){Xe.webssh&&(tt(),lt.current=setTimeout(function(){u.a.confirm({title:d.a.createElement(d.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 15 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){v.a.publish("ssh-add-connect-time",{}),v.a.publish("delayed-time",1)}})},1e3*60*60)),Xe.id&&st()},[Xe]);var tt=function(){var Ct=Object(h.a)(l.a.mark(function _t(){var ft;return l.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(U.tb)(Object(g.a)({},Ce));case 2:ft=Nt.sent,ve(Object(g.a)({},ft));case 4:case"end":return Nt.stop()}},_t)}));return function(){return Ct.apply(this,arguments)}}(),st=function(){var _t=window.innerHeight;et(_t-(Xe.audit_remark?400:270))},mt=function(){var Ct=Object(h.a)(l.a.mark(function _t(){return l.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:Je({type:"shixunsDetail/getMirrorApplies",payload:Object(g.a)({},Ce)});case 1:case"end":return kt.stop()}},_t)}));return function(){return Ct.apply(this,arguments)}}();return console.log($e==null?void 0:$e.userInfo),d.a.createElement("section",{className:B.a.wrp},d.a.createElement("header",{className:B.a.header},d.a.createElement(f.a,{align:"middle"},d.a.createElement(x.a,{flex:"1"},d.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"40",src:"".concat(Be.a.IMG_SERVER,"/images/").concat($e==null||((pe=$e.userInfo)===null||pe===void 0)?void 0:pe.image_url),width:"40",style:{borderRadius:"50%"}}),d.a.createElement("span",{className:"ml10"},$e==null||((Ge=$e.userInfo)===null||Ge===void 0)?void 0:Ge.real_name)),d.a.createElement(x.a,{flex:"1"},d.a.createElement("span",{className:"mr10 font18"},Xe.name)),d.a.createElement(x.a,null,d.a.createElement("span",null,"\u5269\u4F59\u65F6\u957F:",d.a.createElement(Ke,{className:B.a.cuttDown,value:q,format:"mm:ss",valueStyle:{color:"#FFF"}})),d.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){u.a.confirm({title:"\u9000\u51FA\u955C\u50CF",content:"\u4F60\u786E\u5B9A\u8981\u9000\u51FA\u955C\u50CF\u5417\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var ft;He.push("/users/".concat((ft=$e.userInfo)===null||ft===void 0?void 0:ft.login,"/experiment-img"))}})}})))),d.a.createElement("aside",{className:B.a.container},d.a.createElement(f.a,null,d.a.createElement(x.a,{style:{position:"relative",width:de?"0%":"40%"}},d.a.createElement("section",{className:"".concat(B.a.info," ml40 mr40"),style:{display:de?"none":"flex"}},d.a.createElement("aside",null,d.a.createElement(f.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},d.a.createElement(x.a,{className:"font18"},"\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E ",d.a.createElement("span",{className:"font16 ml20 c-grey-999"},"\u8BF7\u6309\u6A21\u677F\u586B\u5199\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E"))),d.a.createElement("aside",{className:"mt30 flex1"},d.a.createElement(S.a,{height:qe,defaultValue:Xe.description||"",onChange:function(_t){return ye(_t)}}),Xe.audit_remark&&d.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"\u5BA1\u6838\u4E0D\u901A\u8FC7\u539F\u56E0\uFF1A",d.a.createElement("span",{className:"c-red"},Xe.audit_remark))),d.a.createElement("aside",{className:"mb20"},d.a.createElement(f.a,{justify:"center",gutter:[20,20],className:B.a.buttons},d.a.createElement(x.a,null,d.a.createElement(L.a,{type:"primary",size:"large",loading:he,onClick:Object(h.a)(l.a.mark(function Ct(){var _t;return l.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return Te(!0),u.a.info({title:"\u4FDD\u5B58\u955C\u50CF",centered:!0,content:"\u4E34\u65F6\u955C\u50CF\u7CFB\u7EDF\u9ED8\u8BA4\u53EA\u4FDD\u5B5830\u5929\uFF0C\u8FC7\u671F\u5C06\u4F1A\u81EA\u52A8\u6E05\u7406\u3002\u8BF7\u5C3D\u5FEB\u7533\u8BF7\u53D1\u5E03\u3002",okText:"\u6211\u77E5\u9053\u4E86",onOk:function(){}}),kt.next=4,Object(U.vb)(Object(g.a)(Object(g.a)({},Ce),{},{description:ge}));case 4:_t=kt.sent,(_t==null?void 0:_t.status)===0&&k.b.success("\u4FDD\u5B58\u6210\u529F"),Te(!1);case 7:case"end":return kt.stop()}},Ct)}))},"\u4FDD\u5B58")),d.a.createElement(x.a,null,d.a.createElement(L.a,{type:"primary",ghost:!0,size:"large",onClick:Object(h.a)(l.a.mark(function Ct(){return l.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:u.a.confirm({title:"\u7533\u8BF7\u53D1\u5E03",centered:!0,content:"\u4F60\u786E\u5B9A\u8981\u7533\u8BF7\u53D1\u5E03\u8BE5\u955C\u50CF\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var kt=Object(h.a)(l.a.mark(function nt(){var Tt,It;return l.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Object(U.ub)(Object(g.a)(Object(g.a)({},Ce),{},{description:ge}));case 2:Tt=Ft.sent,(Tt==null?void 0:Tt.status)===0&&(He.push("/users/".concat((It=$e.userInfo)===null||It===void 0?void 0:It.login,"/experiment-img")),k.b.success("\u7533\u8BF7\u53D1\u5E03\u6210\u529F"));case 4:case"end":return Ft.stop()}},nt)}));function Nt(){return kt.apply(this,arguments)}return Nt}()});case 1:case"end":return ft.stop()}},Ct)}))},"\u7533\u8BF7\u53D1\u5E03")))))),d.a.createElement("div",{className:de?B.a.elseShrink:B.a.shrink,onClick:function(){return Se(!de)}},d.a.createElement("i",{className:"iconfont icon-cela"}))),d.a.createElement(x.a,{style:{background:"#000",width:de?"100%":"60%"}},d.a.createElement("div",null,d.a.createElement("aside",{className:B.a.fullBtn},d.a.createElement("span",{className:"icon-quanping"})),Xe.webssh&&d.a.createElement(C.a,{sshConfigData:re,sid:1}),((Xe==null?void 0:Xe.vnc)||(Xe==null?void 0:Xe.windows))&&d.a.createElement(Re,{taskId:Xe.type==="windows"?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:Xe.vnc,window_vnc_url:Xe.windows}))))))},_e=fe.default=Object(w.a)(function(le){var Ee=le.shixunsDetail,pe=le.loading,Ge=le.user,Ye=le.globalSetting;return{shixunsDetail:Ee,globalSetting:Ye,user:Ge,loading:pe.models.shixunsDetail}})(Ae)},iUHT:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(m,S){if(!(m instanceof S))throw new TypeError("Cannot call a class as a function")}function L(m,S){for(var C=0;C>>3]&1<>>10,this.keys[z]|=(ce&4032)>>>6,++z,this.keys[z]=(te&258048)<<12,this.keys[z]|=(te&63)<<16,this.keys[z]|=(ce&258048)>>>4,this.keys[z]|=ce&63,++z}}return I(m,[{key:"enc8",value:function(C){var v=C.slice(),y=0,T,A,p;T=v[y++]<<24|v[y++]<<16|v[y++]<<8|v[y++],A=v[y++]<<24|v[y++]<<16|v[y++]<<8|v[y++],p=(T>>>4^A)&252645135,A^=p,T^=p<<4,p=(T>>>16^A)&65535,A^=p,T^=p<<16,p=(A>>>2^T)&858993459,T^=p,A^=p<<2,p=(A>>>8^T)&16711935,T^=p,A^=p<<8,A=A<<1|A>>>31&1,p=(T^A)&2863311530,T^=p,A^=p,T=T<<1|T>>>31&1;for(var D=0,O=0;D<8;++D){p=A<<28|A>>>4,p^=this.keys[O++];var P=c[p&63];P|=s[p>>>8&63],P|=t[p>>>16&63],P|=r[p>>>24&63],p=A^this.keys[O++],P|=d[p&63],P|=l[p>>>8&63],P|=i[p>>>16&63],P|=n[p>>>24&63],T^=P,p=T<<28|T>>>4,p^=this.keys[O++],P=c[p&63],P|=s[p>>>8&63],P|=t[p>>>16&63],P|=r[p>>>24&63],p=T^this.keys[O++],P|=d[p&63],P|=l[p>>>8&63],P|=i[p>>>16&63],P|=n[p>>>24&63],A^=P}for(A=A<<31|A>>>1,p=(T^A)&2863311530,T^=p,A^=p,T=T<<31|T>>>1,p=(T>>>8^A)&16711935,A^=p,T^=p<<8,p=(T>>>2^A)&858993459,A^=p,T^=p<<2,p=(A>>>16^T)&65535,T^=p,A^=p<<16,p=(A>>>4^T)&252645135,T^=p,A^=p<<4,p=[A,T],y=0;y<8;y++)v[y]=(p[y>>>2]>>>8*(3-y%4))%256,v[y]<0&&(v[y]+=256);return v}},{key:"encrypt",value:function(C){return this.enc8(C.slice(0,8)).concat(this.enc8(C.slice(8,16)))}}]),m}();fe.default=w},kSUc:function(at,fe,oe){},lNSK:function(at,fe,oe){"use strict";function V(G){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(Ne){return typeof Ne}:V=function(Ne){return Ne&&typeof Symbol=="function"&&Ne.constructor===Symbol&&Ne!==Symbol.prototype?"symbol":typeof Ne},V(G)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.deflateInit=J,fe.deflateInit2=ye,fe.deflateReset=xe,fe.deflateResetKeep=We,fe.deflateSetHeader=ge,fe.deflate=ne,fe.deflateEnd=q,fe.deflateSetDictionary=me,fe.deflateInfo=fe.Z_DEFLATED=fe.Z_UNKNOWN=fe.Z_DEFAULT_STRATEGY=fe.Z_FIXED=fe.Z_RLE=fe.Z_HUFFMAN_ONLY=fe.Z_FILTERED=fe.Z_DEFAULT_COMPRESSION=fe.Z_BUF_ERROR=fe.Z_DATA_ERROR=fe.Z_STREAM_ERROR=fe.Z_STREAM_END=fe.Z_OK=fe.Z_BLOCK=fe.Z_FINISH=fe.Z_FULL_FLUSH=fe.Z_PARTIAL_FLUSH=fe.Z_NO_FLUSH=void 0;var L=g(oe("6BzB")),I=g(oe("c5fP")),k=E(oe("xlC8")),M=E(oe("QV2g")),f=E(oe("xSIq"));function E(G){return G&&G.__esModule?G:{default:G}}function x(){if(typeof WeakMap!="function")return null;var G=new WeakMap;return x=function(){return G},G}function g(G){if(G&&G.__esModule)return G;if(G===null||V(G)!=="object"&&typeof G!="function")return{default:G};var we=x();if(we&&we.has(G))return we.get(G);var Ne={},de=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Se in G)if(Object.prototype.hasOwnProperty.call(G,Se)){var Xe=de?Object.getOwnPropertyDescriptor(G,Se):null;Xe&&(Xe.get||Xe.set)?Object.defineProperty(Ne,Se,Xe):Ne[Se]=G[Se]}return Ne.default=G,we&&we.set(G,Ne),Ne}var h=0;fe.Z_NO_FLUSH=h;var o=1;fe.Z_PARTIAL_FLUSH=o;var u=3;fe.Z_FULL_FLUSH=u;var r=4;fe.Z_FINISH=r;var n=5;fe.Z_BLOCK=n;var t=0;fe.Z_OK=t;var i=1;fe.Z_STREAM_END=i;var s=-2;fe.Z_STREAM_ERROR=s;var l=-3;fe.Z_DATA_ERROR=l;var c=-5;fe.Z_BUF_ERROR=c;var d=-1;fe.Z_DEFAULT_COMPRESSION=d;var w=1;fe.Z_FILTERED=w;var m=2;fe.Z_HUFFMAN_ONLY=m;var S=3;fe.Z_RLE=S;var C=4;fe.Z_FIXED=C;var v=0;fe.Z_DEFAULT_STRATEGY=v;var y=2;fe.Z_UNKNOWN=y;var T=8;fe.Z_DEFLATED=T;var A=9,p=15,D=8,O=29,P=256,j=P+1+O,K=30,U=19,X=2*j+1,B=15,N=3,z=258,te=z+N+1,ce=32,be=42,Fe=69,Oe=73,Re=91,Be=103,Ke=113,Ae=666,_e=1,le=2,Ee=3,pe=4,Ge=3;function Ye(G,we){return G.msg=f.default[we],we}function ze(G){return(G<<1)-(G>4?9:0)}function Ze(G){for(var we=G.length;--we>=0;)G[we]=0}function Je(G){var we=G.state,Ne=we.pending;if(Ne>G.avail_out&&(Ne=G.avail_out),Ne===0)return;L.arraySet(G.output,we.pending_buf,we.pending_out,Ne,G.next_out),G.next_out+=Ne,we.pending_out+=Ne,G.total_out+=Ne,G.avail_out-=Ne,we.pending-=Ne,we.pending===0&&(we.pending_out=0)}function $e(G,we){I._tr_flush_block(G,G.block_start>=0?G.block_start:-1,G.strstart-G.block_start,we),G.block_start=G.strstart,Je(G.strm)}function He(G,we){G.pending_buf[G.pending++]=we}function Ue(G,we){G.pending_buf[G.pending++]=we>>>8&255,G.pending_buf[G.pending++]=we&255}function Pe(G,we,Ne,de){var Se=G.avail_in;return Se>de&&(Se=de),Se===0?0:(G.avail_in-=Se,L.arraySet(we,G.input,G.next_in,Se,Ne),G.state.wrap===1?G.adler=(0,k.default)(G.adler,we,Se,Ne):G.state.wrap===2&&(G.adler=(0,M.default)(G.adler,we,Se,Ne)),G.next_in+=Se,G.total_in+=Se,Se)}function ke(G,we){var Ne=G.max_chain_length,de=G.strstart,Se,Xe,lt=G.prev_length,tt=G.nice_match,st=G.strstart>G.w_size-te?G.strstart-(G.w_size-te):0,mt=G.window,Ct=G.w_mask,_t=G.prev,ft=G.strstart+z,kt=mt[de+lt-1],Nt=mt[de+lt];G.prev_length>=G.good_match&&(Ne>>=2),tt>G.lookahead&&(tt=G.lookahead);do{if(Se=we,mt[Se+lt]!==Nt||mt[Se+lt-1]!==kt||mt[Se]!==mt[de]||mt[++Se]!==mt[de+1])continue;de+=2,Se++;do;while(mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&delt){if(G.match_start=we,lt=Xe,Xe>=tt)break;kt=mt[de+lt-1],Nt=mt[de+lt]}}while((we=_t[we&Ct])>st&&--Ne!==0);return lt<=G.lookahead?lt:G.lookahead}function re(G){var we=G.w_size,Ne,de,Se,Xe,lt;do{if(Xe=G.window_size-G.lookahead-G.strstart,G.strstart>=we+(we-te)){L.arraySet(G.window,G.window,we,we,0),G.match_start-=we,G.strstart-=we,G.block_start-=we,de=G.hash_size,Ne=de;do Se=G.head[--Ne],G.head[Ne]=Se>=we?Se-we:0;while(--de);de=we,Ne=de;do Se=G.prev[--Ne],G.prev[Ne]=Se>=we?Se-we:0;while(--de);Xe+=we}if(G.strm.avail_in===0)break;if(de=Pe(G.strm,G.window,G.strstart+G.lookahead,Xe),G.lookahead+=de,G.lookahead+G.insert>=N)for(lt=G.strstart-G.insert,G.ins_h=G.window[lt],G.ins_h=(G.ins_h<G.pending_buf_size-5&&(Ne=G.pending_buf_size-5);;){if(G.lookahead<=1){if(re(G),G.lookahead===0&&we===h)return _e;if(G.lookahead===0)break}G.strstart+=G.lookahead,G.lookahead=0;var de=G.block_start+Ne;if((G.strstart===0||G.strstart>=de)&&(G.lookahead=G.strstart-de,G.strstart=de,$e(G,!1),G.strm.avail_out===0))return _e;if(G.strstart-G.block_start>=G.w_size-te&&($e(G,!1),G.strm.avail_out===0))return _e}return G.insert=0,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):(G.strstart>G.block_start&&($e(G,!1),G.strm.avail_out===0),_e)}function ae(G,we){for(var Ne,de;;){if(G.lookahead=N&&(G.ins_h=(G.ins_h<=N)if(de=I._tr_tally(G,G.strstart-G.match_start,G.match_length-N),G.lookahead-=G.match_length,G.match_length<=G.max_lazy_match&&G.lookahead>=N){G.match_length--;do G.strstart++,G.ins_h=(G.ins_h<=N&&(G.ins_h=(G.ins_h<4096)&&(G.match_length=N-1)),G.prev_length>=N&&G.match_length<=G.prev_length){Se=G.strstart+G.lookahead-N,de=I._tr_tally(G,G.strstart-1-G.prev_match,G.prev_length-N),G.lookahead-=G.prev_length-1,G.prev_length-=2;do++G.strstart<=Se&&(G.ins_h=(G.ins_h<=N&&G.strstart>0&&(Se=G.strstart-1,de=lt[Se],de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se])){Xe=G.strstart+z;do;while(de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&SeG.lookahead&&(G.match_length=G.lookahead)}if(G.match_length>=N?(Ne=I._tr_tally(G,1,G.match_length-N),G.lookahead-=G.match_length,G.strstart+=G.match_length,G.match_length=0):(Ne=I._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++),Ne&&($e(G,!1),G.strm.avail_out===0))return _e}return G.insert=0,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):G.last_lit&&($e(G,!1),G.strm.avail_out===0)?_e:le}function et(G,we){for(var Ne;;){if(G.lookahead===0&&(re(G),G.lookahead===0)){if(we===h)return _e;break}if(G.match_length=0,Ne=I._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++,Ne&&($e(G,!1),G.strm.avail_out===0))return _e}return G.insert=0,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):G.last_lit&&($e(G,!1),G.strm.avail_out===0)?_e:le}function je(G,we,Ne,de,Se){this.good_length=G,this.max_lazy=we,this.nice_length=Ne,this.max_chain=de,this.func=Se}var ct;ct=[new je(0,0,0,0,ve),new je(4,4,8,4,ae),new je(4,5,16,8,ae),new je(4,6,32,32,ae),new je(4,4,16,16,De),new je(8,16,32,32,De),new je(8,16,128,128,De),new je(8,32,128,256,De),new je(32,128,258,1024,De),new je(32,258,258,4096,De)];function he(G){G.window_size=2*G.w_size,Ze(G.head),G.max_lazy_match=ct[G.level].max_lazy,G.good_match=ct[G.level].good_length,G.nice_match=ct[G.level].nice_length,G.max_chain_length=ct[G.level].max_chain,G.strstart=0,G.block_start=0,G.lookahead=0,G.insert=0,G.match_length=G.prev_length=N-1,G.match_available=0,G.ins_h=0}function Te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new L.Buf16(X*2),this.dyn_dtree=new L.Buf16((2*K+1)*2),this.bl_tree=new L.Buf16((2*U+1)*2),Ze(this.dyn_ltree),Ze(this.dyn_dtree),Ze(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new L.Buf16(B+1),this.heap=new L.Buf16(2*j+1),Ze(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new L.Buf16(2*j+1),Ze(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function We(G){var we;return!G||!G.state?Ye(G,s):(G.total_in=G.total_out=0,G.data_type=y,we=G.state,we.pending=0,we.pending_out=0,we.wrap<0&&(we.wrap=-we.wrap),we.status=we.wrap?be:Ke,G.adler=we.wrap===2?0:1,we.last_flush=h,I._tr_init(we),t)}function xe(G){var we=We(G);return we===t&&he(G.state),we}function ge(G,we){return!G||!G.state||G.state.wrap!==2?s:(G.state.gzhead=we,t)}function ye(G,we,Ne,de,Se,Xe){if(!G)return s;var lt=1;if(we===d&&(we=6),de<0?(lt=0,de=-de):de>15&&(lt=2,de-=16),Se<1||Se>A||Ne!==T||de<8||de>15||we<0||we>9||Xe<0||Xe>C)return Ye(G,s);de===8&&(de=9);var tt=new Te;return G.state=tt,tt.strm=G,tt.wrap=lt,tt.gzhead=null,tt.w_bits=de,tt.w_size=1<n||we<0)return G?Ye(G,s):s;if(de=G.state,!G.output||!G.input&&G.avail_in!==0||de.status===Ae&&we!==r)return Ye(G,G.avail_out===0?c:s);if(de.strm=G,Ne=de.last_flush,de.last_flush=we,de.status===be)if(de.wrap===2)G.adler=0,He(de,31),He(de,139),He(de,8),de.gzhead?(He(de,(de.gzhead.text?1:0)+(de.gzhead.hcrc?2:0)+(de.gzhead.extra?4:0)+(de.gzhead.name?8:0)+(de.gzhead.comment?16:0)),He(de,de.gzhead.time&255),He(de,de.gzhead.time>>8&255),He(de,de.gzhead.time>>16&255),He(de,de.gzhead.time>>24&255),He(de,de.level===9?2:de.strategy>=m||de.level<2?4:0),He(de,de.gzhead.os&255),de.gzhead.extra&&de.gzhead.extra.length&&(He(de,de.gzhead.extra.length&255),He(de,de.gzhead.extra.length>>8&255)),de.gzhead.hcrc&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending,0)),de.gzindex=0,de.status=Fe):(He(de,0),He(de,0),He(de,0),He(de,0),He(de,0),He(de,de.level===9?2:de.strategy>=m||de.level<2?4:0),He(de,Ge),de.status=Ke);else{var lt=T+(de.w_bits-8<<4)<<8,tt=-1;de.strategy>=m||de.level<2?tt=0:de.level<6?tt=1:de.level===6?tt=2:tt=3,lt|=tt<<6,de.strstart!==0&&(lt|=ce),lt+=31-lt%31,de.status=Ke,Ue(de,lt),de.strstart!==0&&(Ue(de,G.adler>>>16),Ue(de,G.adler&65535)),G.adler=1}if(de.status===Fe)if(de.gzhead.extra){for(Se=de.pending;de.gzindex<(de.gzhead.extra.length&65535)&&!(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Je(G),Se=de.pending,de.pending===de.pending_buf_size));)He(de,de.gzhead.extra[de.gzindex]&255),de.gzindex++;de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),de.gzindex===de.gzhead.extra.length&&(de.gzindex=0,de.status=Oe)}else de.status=Oe;if(de.status===Oe)if(de.gzhead.name){Se=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Je(G),Se=de.pending,de.pending===de.pending_buf_size)){Xe=1;break}de.gzindexSe&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Xe===0&&(de.gzindex=0,de.status=Re)}else de.status=Re;if(de.status===Re)if(de.gzhead.comment){Se=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Je(G),Se=de.pending,de.pending===de.pending_buf_size)){Xe=1;break}de.gzindexSe&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Xe===0&&(de.status=Be)}else de.status=Be;if(de.status===Be&&(de.gzhead.hcrc?(de.pending+2>de.pending_buf_size&&Je(G),de.pending+2<=de.pending_buf_size&&(He(de,G.adler&255),He(de,G.adler>>8&255),G.adler=0,de.status=Ke)):de.status=Ke),de.pending!==0){if(Je(G),G.avail_out===0)return de.last_flush=-1,t}else if(G.avail_in===0&&ze(we)<=ze(Ne)&&we!==r)return Ye(G,c);if(de.status===Ae&&G.avail_in!==0)return Ye(G,c);if(G.avail_in!==0||de.lookahead!==0||we!==h&&de.status!==Ae){var st=de.strategy===m?et(de,we):de.strategy===S?qe(de,we):ct[de.level].func(de,we);if((st===Ee||st===pe)&&(de.status=Ae),st===_e||st===Ee)return G.avail_out===0&&(de.last_flush=-1),t;if(st===le&&(we===o?I._tr_align(de):we!==n&&(I._tr_stored_block(de,0,0,!1),we===u&&(Ze(de.head),de.lookahead===0&&(de.strstart=0,de.block_start=0,de.insert=0))),Je(G),G.avail_out===0))return de.last_flush=-1,t}return we!==r?t:de.wrap<=0?i:(de.wrap===2?(He(de,G.adler&255),He(de,G.adler>>8&255),He(de,G.adler>>16&255),He(de,G.adler>>24&255),He(de,G.total_in&255),He(de,G.total_in>>8&255),He(de,G.total_in>>16&255),He(de,G.total_in>>24&255)):(Ue(de,G.adler>>>16),Ue(de,G.adler&65535)),Je(G),de.wrap>0&&(de.wrap=-de.wrap),de.pending!==0?t:i)}function q(G){var we;return!G||!G.state?s:(we=G.state.status,we!==be&&we!==Fe&&we!==Oe&&we!==Re&&we!==Be&&we!==Ke&&we!==Ae?Ye(G,s):(G.state=null,we===Ke?Ye(G,l):t))}function me(G,we){var Ne=we.length,de,Se,Xe,lt,tt,st,mt,Ct;if(!G||!G.state)return s;if(de=G.state,lt=de.wrap,lt===2||lt===1&&de.status!==be||de.lookahead)return s;for(lt===1&&(G.adler=(0,k.default)(G.adler,we,Ne,0)),de.wrap=0,Ne>=de.w_size&&(lt===0&&(Ze(de.head),de.strstart=0,de.block_start=0,de.insert=0),Ct=new L.Buf8(de.w_size),L.arraySet(Ct,we,Ne-de.w_size,de.w_size,0),we=Ct,Ne=de.w_size),tt=G.avail_in,st=G.next_in,mt=G.input,G.avail_in=Ne,G.next_in=0,G.input=we,re(de);de.lookahead>=N;){Se=de.strstart,Xe=de.lookahead-(N-1);do de.ins_h=(de.ins_h<` "'(~:]+/,t=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,i=/^\s*\[[^\]]+?\]:.*$/,s=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,l=" ";function c(B,N,z){return N.f=N.inline=z,z(B,N)}function d(B,N,z){return N.f=N.block=z,z(B,N)}function w(B){return!B||!/\S/.test(B.string)}function m(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==C){var N=M;if(!N){var z=V.innerMode(k,B.htmlState);N=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}N&&(B.f=A,B.block=S,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function S(B,N){var z=B.column()===N.indentation,te=w(N.prevLine.stream),ce=N.indentedCode,be=N.prevLine.hr,Fe=N.list!==!1,Oe=(N.listStack[N.listStack.length-1]||0)+3;N.indentedCode=!1;var Re=N.indentation;if(N.indentationDiff===null&&(N.indentationDiff=N.indentation,Fe)){for(N.list=null;Re=4&&(ce||N.prevLine.fencedCodeEnd||N.prevLine.header||te))return B.skipToEnd(),N.indentedCode=!0,E.code;if(B.eatSpace())return null;if(z&&N.indentation<=Oe&&(Ae=B.match(u))&&Ae[1].length<=6)return N.quote=0,N.header=Ae[1].length,N.thisLine.header=!0,I.highlightFormatting&&(N.formatting="header"),N.f=N.inline,y(N);if(N.indentation<=Oe&&B.eat(">"))return N.quote=z?1:N.quote+1,I.highlightFormatting&&(N.formatting="quote"),B.eatSpace(),y(N);if(!Ke&&!N.setext&&z&&N.indentation<=Oe&&(Ae=B.match(h))){var _e=Ae[1]?"ol":"ul";return N.indentation=Re+B.current().length,N.list=!0,N.quote=0,N.listStack.push(N.indentation),N.em=!1,N.strong=!1,N.code=!1,N.strikethrough=!1,I.taskLists&&B.match(o,!1)&&(N.taskList=!0),N.f=N.inline,I.highlightFormatting&&(N.formatting=["list","list-"+_e]),y(N)}else{if(z&&N.indentation<=Oe&&(Ae=B.match(t,!0)))return N.quote=0,N.fencedEndRE=new RegExp(Ae[1]+"+ *$"),N.localMode=I.fencedCodeBlockHighlighting&&f(Ae[2]||I.fencedCodeBlockDefaultMode),N.localMode&&(N.localState=V.startState(N.localMode)),N.f=N.block=v,I.highlightFormatting&&(N.formatting="code-block"),N.code=-1,y(N);if(N.setext||(!Be||!Fe)&&!N.quote&&N.list===!1&&!N.code&&!Ke&&!i.test(B.string)&&(Ae=B.lookAhead(1))&&(Ae=Ae.match(r)))return N.setext?(N.header=N.setext,N.setext=0,B.skipToEnd(),I.highlightFormatting&&(N.formatting="header")):(N.header=Ae[0].charAt(0)=="="?1:2,N.setext=N.header),N.thisLine.header=!0,N.f=N.inline,y(N);if(Ke)return B.skipToEnd(),N.hr=!0,N.thisLine.hr=!0,E.hr;if(B.peek()==="[")return c(B,N,j)}return c(B,N,N.inline)}function C(B,N){var z=k.token(B,N.htmlState);if(!M){var te=V.innerMode(k,N.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||N.md_inside&&B.current().indexOf(">")>-1)&&(N.f=A,N.block=S,N.htmlState=null)}return z}function v(B,N){var z=N.listStack[N.listStack.length-1]||0,te=N.indentation=B.quote?N.push(E.formatting+"-"+B.formatting[z]+"-"+B.quote):N.push("error"))}if(B.taskOpen)return N.push("meta"),N.length?N.join(" "):null;if(B.taskClosed)return N.push("property"),N.length?N.join(" "):null;if(B.linkHref?N.push(E.linkHref,"url"):(B.strong&&N.push(E.strong),B.em&&N.push(E.em),B.strikethrough&&N.push(E.strikethrough),B.emoji&&N.push(E.emoji),B.linkText&&N.push(E.linkText),B.code&&N.push(E.code),B.image&&N.push(E.image),B.imageAltText&&N.push(E.imageAltText,"link"),B.imageMarker&&N.push(E.imageMarker)),B.header&&N.push(E.header,E.header+"-"+B.header),B.quote&&(N.push(E.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=B.quote?N.push(E.quote+"-"+B.quote):N.push(E.quote+"-"+I.maxBlockquoteDepth)),B.list!==!1){var te=(B.listStack.length-1)%3;te?te===1?N.push(E.list2):N.push(E.list3):N.push(E.list1)}return B.trailingSpaceNewLine?N.push("trailing-space-new-line"):B.trailingSpace&&N.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),N.length?N.join(" "):null}function T(B,N){return B.match(n,!0)?y(N):void 0}function A(B,N){var z=N.text(B,N);if(typeof z!="undefined")return z;if(N.list)return N.list=null,y(N);if(N.taskList){var te=B.match(o,!0)[1]===" ";return te?N.taskOpen=!0:N.taskClosed=!0,I.highlightFormatting&&(N.formatting="task"),N.taskList=!1,y(N)}if(N.taskOpen=!1,N.taskClosed=!1,N.header&&B.match(/^#+$/,!0))return I.highlightFormatting&&(N.formatting="header"),y(N);var ce=B.next();if(N.linkTitle){N.linkTitle=!1;var be=ce;ce==="("&&(be=")"),be=(be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Fe="^\\s*(?:[^"+be+"\\\\]+|\\\\\\\\|\\\\.)"+be;if(B.match(new RegExp(Fe),!0))return E.linkHref}if(ce==="`"){var Oe=N.formatting;I.highlightFormatting&&(N.formatting="code"),B.eatWhile("`");var Re=B.current().length;if(N.code==0&&(!N.quote||Re==1))return N.code=Re,y(N);if(Re==N.code){var Be=y(N);return N.code=0,Be}else return N.formatting=Oe,y(N)}else if(N.code)return y(N);if(ce==="\\"&&(B.next(),I.highlightFormatting)){var Ke=y(N),Ae=E.formatting+"-escape";return Ke?Ke+" "+Ae:Ae}if(ce==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return N.imageMarker=!0,N.image=!0,I.highlightFormatting&&(N.formatting="image"),y(N);if(ce==="["&&N.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return N.imageMarker=!1,N.imageAltText=!0,I.highlightFormatting&&(N.formatting="image"),y(N);if(ce==="]"&&N.imageAltText){I.highlightFormatting&&(N.formatting="image");var Ke=y(N);return N.imageAltText=!1,N.image=!1,N.inline=N.f=D,Ke}if(ce==="["&&!N.image)return N.linkText&&B.match(/^.*?\]/)||(N.linkText=!0,I.highlightFormatting&&(N.formatting="link")),y(N);if(ce==="]"&&N.linkText){I.highlightFormatting&&(N.formatting="link");var Ke=y(N);return N.linkText=!1,N.inline=N.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?D:A,Ke}if(ce==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=p,I.highlightFormatting&&(N.formatting="link");var Ke=y(N);return Ke?Ke+=" ":Ke="",Ke+E.linkInline}if(ce==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=p,I.highlightFormatting&&(N.formatting="link");var Ke=y(N);return Ke?Ke+=" ":Ke="",Ke+E.linkEmail}if(I.xml&&ce==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _e=B.string.indexOf(">",B.pos);if(_e!=-1){var le=B.string.substring(B.start,_e);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(le)&&(N.md_inside=!0)}return B.backUp(1),N.htmlState=V.startState(k),d(B,N,C)}if(I.xml&&ce==="<"&&B.match(/^\/\w*?>/))return N.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var Ee=1,pe=B.pos==1?" ":B.string.charAt(B.pos-2);Ee<3&&B.eat(ce);)Ee++;var Ge=B.peek()||" ",Ye=!/\s/.test(Ge)&&(!s.test(Ge)||/\s/.test(pe)||s.test(pe)),ze=!/\s/.test(pe)&&(!s.test(pe)||/\s/.test(Ge)||s.test(Ge)),Ze=null,Je=null;if(Ee%2&&(!N.em&&Ye&&(ce==="*"||!ze||s.test(pe))?Ze=!0:N.em==ce&&ze&&(ce==="*"||!Ye||s.test(Ge))&&(Ze=!1)),Ee>1&&(!N.strong&&Ye&&(ce==="*"||!ze||s.test(pe))?Je=!0:N.strong==ce&&ze&&(ce==="*"||!Ye||s.test(Ge))&&(Je=!1)),Je!=null||Ze!=null){I.highlightFormatting&&(N.formatting=Ze==null?"strong":Je==null?"em":"strong em"),Ze===!0&&(N.em=ce),Je===!0&&(N.strong=ce);var Be=y(N);return Ze===!1&&(N.em=!1),Je===!1&&(N.strong=!1),Be}}else if(ce===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return y(N);B.backUp(1)}if(I.strikethrough){if(ce==="~"&&B.eatWhile(ce)){if(N.strikethrough){I.highlightFormatting&&(N.formatting="strikethrough");var Be=y(N);return N.strikethrough=!1,Be}else if(B.match(/^[^\s]/,!1))return N.strikethrough=!0,I.highlightFormatting&&(N.formatting="strikethrough"),y(N)}else if(ce===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return y(N);B.backUp(2)}}if(I.emoji&&ce===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){N.emoji=!0,I.highlightFormatting&&(N.formatting="emoji");var $e=y(N);return N.emoji=!1,$e}return ce===" "&&(B.match(/^ +$/,!1)?N.trailingSpace++:N.trailingSpace&&(N.trailingSpaceNewLine=!0)),y(N)}function p(B,N){var z=B.next();if(z===">"){N.f=N.inline=A,I.highlightFormatting&&(N.formatting="link");var te=y(N);return te?te+=" ":te="",te+E.linkInline}return B.match(/^[^>]+/,!0),E.linkInline}function D(B,N){if(B.eatSpace())return null;var z=B.next();return z==="("||z==="["?(N.f=N.inline=P(z==="("?")":"]"),I.highlightFormatting&&(N.formatting="link-string"),N.linkHref=!0,y(N)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(B){return function(N,z){var te=N.next();if(te===B){z.f=z.inline=A,I.highlightFormatting&&(z.formatting="link-string");var ce=y(z);return z.linkHref=!1,ce}return N.match(O[B]),z.linkHref=!0,y(z)}}function j(B,N){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(N.f=K,B.next(),I.highlightFormatting&&(N.formatting="link"),N.linkText=!0,y(N)):c(B,N,A)}function K(B,N){if(B.match(/^\]:/,!0)){N.f=N.inline=U,I.highlightFormatting&&(N.formatting="link");var z=y(N);return N.linkText=!1,z}return B.match(/^([^\]\\]|\\.)+/,!0),E.linkText}function U(B,N){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?N.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),N.f=N.inline=A,E.linkHref+" url")}var X={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:A,text:T,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&V.copyState(k,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?V.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,N){if(N.formatting=!1,B!=N.thisLine.stream){if(N.header=0,N.hr=!1,B.match(/^\s*$/,!0))return m(N),null;if(N.prevLine=N.thisLine,N.thisLine={stream:B},N.taskList=!1,N.trailingSpace=0,N.trailingSpaceNewLine=!1,!N.localState&&(N.f=N.block,N.f!=C)){var z=B.match(/^\s*/,!0)[0].replace(/\t/g,l).length;if(N.indentation=z,N.indentationDiff=null,z>0)return null}}return N.f(B,N)},innerMode:function(B){return B.block==C?{state:B.htmlState,mode:k}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:X}},indent:function(B,N,z){return B.block==C&&k.indent?k.indent(B.htmlState,N,z):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,N,z):V.Pass},blankLine:m,getType:y,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return X},"xml"),V.defineMIME("text/markdown","markdown"),V.defineMIME("text/x-markdown","markdown")})},mHUz:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={XK_VoidSymbol:16777215,XK_BackSpace:65288,XK_Tab:65289,XK_Linefeed:65290,XK_Clear:65291,XK_Return:65293,XK_Pause:65299,XK_Scroll_Lock:65300,XK_Sys_Req:65301,XK_Escape:65307,XK_Delete:65535,XK_Multi_key:65312,XK_Codeinput:65335,XK_SingleCandidate:65340,XK_MultipleCandidate:65341,XK_PreviousCandidate:65342,XK_Kanji:65313,XK_Muhenkan:65314,XK_Henkan_Mode:65315,XK_Henkan:65315,XK_Romaji:65316,XK_Hiragana:65317,XK_Katakana:65318,XK_Hiragana_Katakana:65319,XK_Zenkaku:65320,XK_Hankaku:65321,XK_Zenkaku_Hankaku:65322,XK_Touroku:65323,XK_Massyo:65324,XK_Kana_Lock:65325,XK_Kana_Shift:65326,XK_Eisu_Shift:65327,XK_Eisu_toggle:65328,XK_Kanji_Bangou:65335,XK_Zen_Koho:65341,XK_Mae_Koho:65342,XK_Home:65360,XK_Left:65361,XK_Up:65362,XK_Right:65363,XK_Down:65364,XK_Prior:65365,XK_Page_Up:65365,XK_Next:65366,XK_Page_Down:65366,XK_End:65367,XK_Begin:65368,XK_Select:65376,XK_Print:65377,XK_Execute:65378,XK_Insert:65379,XK_Undo:65381,XK_Redo:65382,XK_Menu:65383,XK_Find:65384,XK_Cancel:65385,XK_Help:65386,XK_Break:65387,XK_Mode_switch:65406,XK_script_switch:65406,XK_Num_Lock:65407,XK_KP_Space:65408,XK_KP_Tab:65417,XK_KP_Enter:65421,XK_KP_F1:65425,XK_KP_F2:65426,XK_KP_F3:65427,XK_KP_F4:65428,XK_KP_Home:65429,XK_KP_Left:65430,XK_KP_Up:65431,XK_KP_Right:65432,XK_KP_Down:65433,XK_KP_Prior:65434,XK_KP_Page_Up:65434,XK_KP_Next:65435,XK_KP_Page_Down:65435,XK_KP_End:65436,XK_KP_Begin:65437,XK_KP_Insert:65438,XK_KP_Delete:65439,XK_KP_Equal:65469,XK_KP_Multiply:65450,XK_KP_Add:65451,XK_KP_Separator:65452,XK_KP_Subtract:65453,XK_KP_Decimal:65454,XK_KP_Divide:65455,XK_KP_0:65456,XK_KP_1:65457,XK_KP_2:65458,XK_KP_3:65459,XK_KP_4:65460,XK_KP_5:65461,XK_KP_6:65462,XK_KP_7:65463,XK_KP_8:65464,XK_KP_9:65465,XK_F1:65470,XK_F2:65471,XK_F3:65472,XK_F4:65473,XK_F5:65474,XK_F6:65475,XK_F7:65476,XK_F8:65477,XK_F9:65478,XK_F10:65479,XK_F11:65480,XK_L1:65480,XK_F12:65481,XK_L2:65481,XK_F13:65482,XK_L3:65482,XK_F14:65483,XK_L4:65483,XK_F15:65484,XK_L5:65484,XK_F16:65485,XK_L6:65485,XK_F17:65486,XK_L7:65486,XK_F18:65487,XK_L8:65487,XK_F19:65488,XK_L9:65488,XK_F20:65489,XK_L10:65489,XK_F21:65490,XK_R1:65490,XK_F22:65491,XK_R2:65491,XK_F23:65492,XK_R3:65492,XK_F24:65493,XK_R4:65493,XK_F25:65494,XK_R5:65494,XK_F26:65495,XK_R6:65495,XK_F27:65496,XK_R7:65496,XK_F28:65497,XK_R8:65497,XK_F29:65498,XK_R9:65498,XK_F30:65499,XK_R10:65499,XK_F31:65500,XK_R11:65500,XK_F32:65501,XK_R12:65501,XK_F33:65502,XK_R13:65502,XK_F34:65503,XK_R14:65503,XK_F35:65504,XK_R15:65504,XK_Shift_L:65505,XK_Shift_R:65506,XK_Control_L:65507,XK_Control_R:65508,XK_Caps_Lock:65509,XK_Shift_Lock:65510,XK_Meta_L:65511,XK_Meta_R:65512,XK_Alt_L:65513,XK_Alt_R:65514,XK_Super_L:65515,XK_Super_R:65516,XK_Hyper_L:65517,XK_Hyper_R:65518,XK_ISO_Level3_Shift:65027,XK_ISO_Next_Group:65032,XK_ISO_Prev_Group:65034,XK_ISO_First_Group:65036,XK_ISO_Last_Group:65038,XK_space:32,XK_exclam:33,XK_quotedbl:34,XK_numbersign:35,XK_dollar:36,XK_percent:37,XK_ampersand:38,XK_apostrophe:39,XK_quoteright:39,XK_parenleft:40,XK_parenright:41,XK_asterisk:42,XK_plus:43,XK_comma:44,XK_minus:45,XK_period:46,XK_slash:47,XK_0:48,XK_1:49,XK_2:50,XK_3:51,XK_4:52,XK_5:53,XK_6:54,XK_7:55,XK_8:56,XK_9:57,XK_colon:58,XK_semicolon:59,XK_less:60,XK_equal:61,XK_greater:62,XK_question:63,XK_at:64,XK_A:65,XK_B:66,XK_C:67,XK_D:68,XK_E:69,XK_F:70,XK_G:71,XK_H:72,XK_I:73,XK_J:74,XK_K:75,XK_L:76,XK_M:77,XK_N:78,XK_O:79,XK_P:80,XK_Q:81,XK_R:82,XK_S:83,XK_T:84,XK_U:85,XK_V:86,XK_W:87,XK_X:88,XK_Y:89,XK_Z:90,XK_bracketleft:91,XK_backslash:92,XK_bracketright:93,XK_asciicircum:94,XK_underscore:95,XK_grave:96,XK_quoteleft:96,XK_a:97,XK_b:98,XK_c:99,XK_d:100,XK_e:101,XK_f:102,XK_g:103,XK_h:104,XK_i:105,XK_j:106,XK_k:107,XK_l:108,XK_m:109,XK_n:110,XK_o:111,XK_p:112,XK_q:113,XK_r:114,XK_s:115,XK_t:116,XK_u:117,XK_v:118,XK_w:119,XK_x:120,XK_y:121,XK_z:122,XK_braceleft:123,XK_bar:124,XK_braceright:125,XK_asciitilde:126,XK_nobreakspace:160,XK_exclamdown:161,XK_cent:162,XK_sterling:163,XK_currency:164,XK_yen:165,XK_brokenbar:166,XK_section:167,XK_diaeresis:168,XK_copyright:169,XK_ordfeminine:170,XK_guillemotleft:171,XK_notsign:172,XK_hyphen:173,XK_registered:174,XK_macron:175,XK_degree:176,XK_plusminus:177,XK_twosuperior:178,XK_threesuperior:179,XK_acute:180,XK_mu:181,XK_paragraph:182,XK_periodcentered:183,XK_cedilla:184,XK_onesuperior:185,XK_masculine:186,XK_guillemotright:187,XK_onequarter:188,XK_onehalf:189,XK_threequarters:190,XK_questiondown:191,XK_Agrave:192,XK_Aacute:193,XK_Acircumflex:194,XK_Atilde:195,XK_Adiaeresis:196,XK_Aring:197,XK_AE:198,XK_Ccedilla:199,XK_Egrave:200,XK_Eacute:201,XK_Ecircumflex:202,XK_Ediaeresis:203,XK_Igrave:204,XK_Iacute:205,XK_Icircumflex:206,XK_Idiaeresis:207,XK_ETH:208,XK_Eth:208,XK_Ntilde:209,XK_Ograve:210,XK_Oacute:211,XK_Ocircumflex:212,XK_Otilde:213,XK_Odiaeresis:214,XK_multiply:215,XK_Oslash:216,XK_Ooblique:216,XK_Ugrave:217,XK_Uacute:218,XK_Ucircumflex:219,XK_Udiaeresis:220,XK_Yacute:221,XK_THORN:222,XK_Thorn:222,XK_ssharp:223,XK_agrave:224,XK_aacute:225,XK_acircumflex:226,XK_atilde:227,XK_adiaeresis:228,XK_aring:229,XK_ae:230,XK_ccedilla:231,XK_egrave:232,XK_eacute:233,XK_ecircumflex:234,XK_ediaeresis:235,XK_igrave:236,XK_iacute:237,XK_icircumflex:238,XK_idiaeresis:239,XK_eth:240,XK_ntilde:241,XK_ograve:242,XK_oacute:243,XK_ocircumflex:244,XK_otilde:245,XK_odiaeresis:246,XK_division:247,XK_oslash:248,XK_ooblique:248,XK_ugrave:249,XK_uacute:250,XK_ucircumflex:251,XK_udiaeresis:252,XK_yacute:253,XK_thorn:254,XK_ydiaeresis:255,XK_Hangul:65329,XK_Hangul_Hanja:65332,XK_Hangul_Jeonja:65336,XF86XK_ModeLock:269025025,XF86XK_MonBrightnessUp:269025026,XF86XK_MonBrightnessDown:269025027,XF86XK_KbdLightOnOff:269025028,XF86XK_KbdBrightnessUp:269025029,XF86XK_KbdBrightnessDown:269025030,XF86XK_Standby:269025040,XF86XK_AudioLowerVolume:269025041,XF86XK_AudioMute:269025042,XF86XK_AudioRaiseVolume:269025043,XF86XK_AudioPlay:269025044,XF86XK_AudioStop:269025045,XF86XK_AudioPrev:269025046,XF86XK_AudioNext:269025047,XF86XK_HomePage:269025048,XF86XK_Mail:269025049,XF86XK_Start:269025050,XF86XK_Search:269025051,XF86XK_AudioRecord:269025052,XF86XK_Calculator:269025053,XF86XK_Memo:269025054,XF86XK_ToDoList:269025055,XF86XK_Calendar:269025056,XF86XK_PowerDown:269025057,XF86XK_ContrastAdjust:269025058,XF86XK_RockerUp:269025059,XF86XK_RockerDown:269025060,XF86XK_RockerEnter:269025061,XF86XK_Back:269025062,XF86XK_Forward:269025063,XF86XK_Stop:269025064,XF86XK_Refresh:269025065,XF86XK_PowerOff:269025066,XF86XK_WakeUp:269025067,XF86XK_Eject:269025068,XF86XK_ScreenSaver:269025069,XF86XK_WWW:269025070,XF86XK_Sleep:269025071,XF86XK_Favorites:269025072,XF86XK_AudioPause:269025073,XF86XK_AudioMedia:269025074,XF86XK_MyComputer:269025075,XF86XK_VendorHome:269025076,XF86XK_LightBulb:269025077,XF86XK_Shop:269025078,XF86XK_History:269025079,XF86XK_OpenURL:269025080,XF86XK_AddFavorite:269025081,XF86XK_HotLinks:269025082,XF86XK_BrightnessAdjust:269025083,XF86XK_Finance:269025084,XF86XK_Community:269025085,XF86XK_AudioRewind:269025086,XF86XK_BackForward:269025087,XF86XK_Launch0:269025088,XF86XK_Launch1:269025089,XF86XK_Launch2:269025090,XF86XK_Launch3:269025091,XF86XK_Launch4:269025092,XF86XK_Launch5:269025093,XF86XK_Launch6:269025094,XF86XK_Launch7:269025095,XF86XK_Launch8:269025096,XF86XK_Launch9:269025097,XF86XK_LaunchA:269025098,XF86XK_LaunchB:269025099,XF86XK_LaunchC:269025100,XF86XK_LaunchD:269025101,XF86XK_LaunchE:269025102,XF86XK_LaunchF:269025103,XF86XK_ApplicationLeft:269025104,XF86XK_ApplicationRight:269025105,XF86XK_Book:269025106,XF86XK_CD:269025107,XF86XK_Calculater:269025108,XF86XK_Clear:269025109,XF86XK_Close:269025110,XF86XK_Copy:269025111,XF86XK_Cut:269025112,XF86XK_Display:269025113,XF86XK_DOS:269025114,XF86XK_Documents:269025115,XF86XK_Excel:269025116,XF86XK_Explorer:269025117,XF86XK_Game:269025118,XF86XK_Go:269025119,XF86XK_iTouch:269025120,XF86XK_LogOff:269025121,XF86XK_Market:269025122,XF86XK_Meeting:269025123,XF86XK_MenuKB:269025125,XF86XK_MenuPB:269025126,XF86XK_MySites:269025127,XF86XK_New:269025128,XF86XK_News:269025129,XF86XK_OfficeHome:269025130,XF86XK_Open:269025131,XF86XK_Option:269025132,XF86XK_Paste:269025133,XF86XK_Phone:269025134,XF86XK_Q:269025136,XF86XK_Reply:269025138,XF86XK_Reload:269025139,XF86XK_RotateWindows:269025140,XF86XK_RotationPB:269025141,XF86XK_RotationKB:269025142,XF86XK_Save:269025143,XF86XK_ScrollUp:269025144,XF86XK_ScrollDown:269025145,XF86XK_ScrollClick:269025146,XF86XK_Send:269025147,XF86XK_Spell:269025148,XF86XK_SplitScreen:269025149,XF86XK_Support:269025150,XF86XK_TaskPane:269025151,XF86XK_Terminal:269025152,XF86XK_Tools:269025153,XF86XK_Travel:269025154,XF86XK_UserPB:269025156,XF86XK_User1KB:269025157,XF86XK_User2KB:269025158,XF86XK_Video:269025159,XF86XK_WheelButton:269025160,XF86XK_Word:269025161,XF86XK_Xfer:269025162,XF86XK_ZoomIn:269025163,XF86XK_ZoomOut:269025164,XF86XK_Away:269025165,XF86XK_Messenger:269025166,XF86XK_WebCam:269025167,XF86XK_MailForward:269025168,XF86XK_Pictures:269025169,XF86XK_Music:269025170,XF86XK_Battery:269025171,XF86XK_Bluetooth:269025172,XF86XK_WLAN:269025173,XF86XK_UWB:269025174,XF86XK_AudioForward:269025175,XF86XK_AudioRepeat:269025176,XF86XK_AudioRandomPlay:269025177,XF86XK_Subtitle:269025178,XF86XK_AudioCycleTrack:269025179,XF86XK_CycleAngle:269025180,XF86XK_FrameBack:269025181,XF86XK_FrameForward:269025182,XF86XK_Time:269025183,XF86XK_Select:269025184,XF86XK_View:269025185,XF86XK_TopMenu:269025186,XF86XK_Red:269025187,XF86XK_Green:269025188,XF86XK_Yellow:269025189,XF86XK_Blue:269025190,XF86XK_Suspend:269025191,XF86XK_Hibernate:269025192,XF86XK_TouchpadToggle:269025193,XF86XK_TouchpadOn:269025200,XF86XK_TouchpadOff:269025201,XF86XK_AudioMicMute:269025202,XF86XK_Switch_VT_1:269024769,XF86XK_Switch_VT_2:269024770,XF86XK_Switch_VT_3:269024771,XF86XK_Switch_VT_4:269024772,XF86XK_Switch_VT_5:269024773,XF86XK_Switch_VT_6:269024774,XF86XK_Switch_VT_7:269024775,XF86XK_Switch_VT_8:269024776,XF86XK_Switch_VT_9:269024777,XF86XK_Switch_VT_10:269024778,XF86XK_Switch_VT_11:269024779,XF86XK_Switch_VT_12:269024780,XF86XK_Ungrab:269024800,XF86XK_ClearGrab:269024801,XF86XK_Next_VMode:269024802,XF86XK_Prev_VMode:269024803,XF86XK_LogWindowTree:269024804,XF86XK_LogGrabInfo:269024805};fe.default=V},mTgk:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=L(oe("mHUz"));function L(x){return x&&x.__esModule?x:{default:x}}var I={};function k(x,g){if(g===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(x in I)throw new Error('Duplicate entry for key "'+x+'"');I[x]=[g,g,g,g]}function M(x,g,h){if(g===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(h===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(x in I)throw new Error('Duplicate entry for key "'+x+'"');I[x]=[g,g,h,g]}function f(x,g,h){if(g===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(h===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(x in I)throw new Error('Duplicate entry for key "'+x+'"');I[x]=[g,g,g,h]}M("Alt",V.default.XK_Alt_L,V.default.XK_Alt_R),k("AltGraph",V.default.XK_ISO_Level3_Shift),k("CapsLock",V.default.XK_Caps_Lock),M("Control",V.default.XK_Control_L,V.default.XK_Control_R),M("Meta",V.default.XK_Super_L,V.default.XK_Super_R),k("NumLock",V.default.XK_Num_Lock),k("ScrollLock",V.default.XK_Scroll_Lock),M("Shift",V.default.XK_Shift_L,V.default.XK_Shift_R),f("Enter",V.default.XK_Return,V.default.XK_KP_Enter),k("Tab",V.default.XK_Tab),f(" ",V.default.XK_space,V.default.XK_KP_Space),f("ArrowDown",V.default.XK_Down,V.default.XK_KP_Down),f("ArrowUp",V.default.XK_Up,V.default.XK_KP_Up),f("ArrowLeft",V.default.XK_Left,V.default.XK_KP_Left),f("ArrowRight",V.default.XK_Right,V.default.XK_KP_Right),f("End",V.default.XK_End,V.default.XK_KP_End),f("Home",V.default.XK_Home,V.default.XK_KP_Home),f("PageDown",V.default.XK_Next,V.default.XK_KP_Next),f("PageUp",V.default.XK_Prior,V.default.XK_KP_Prior),k("Backspace",V.default.XK_BackSpace),f("Clear",V.default.XK_Clear,V.default.XK_KP_Begin),k("Copy",V.default.XF86XK_Copy),k("Cut",V.default.XF86XK_Cut),f("Delete",V.default.XK_Delete,V.default.XK_KP_Delete),f("Insert",V.default.XK_Insert,V.default.XK_KP_Insert),k("Paste",V.default.XF86XK_Paste),k("Redo",V.default.XK_Redo),k("Undo",V.default.XK_Undo),k("Cancel",V.default.XK_Cancel),k("ContextMenu",V.default.XK_Menu),k("Escape",V.default.XK_Escape),k("Execute",V.default.XK_Execute),k("Find",V.default.XK_Find),k("Help",V.default.XK_Help),k("Pause",V.default.XK_Pause),k("Select",V.default.XK_Select),k("ZoomIn",V.default.XF86XK_ZoomIn),k("ZoomOut",V.default.XF86XK_ZoomOut),k("BrightnessDown",V.default.XF86XK_MonBrightnessDown),k("BrightnessUp",V.default.XF86XK_MonBrightnessUp),k("Eject",V.default.XF86XK_Eject),k("LogOff",V.default.XF86XK_LogOff),k("Power",V.default.XF86XK_PowerOff),k("PowerOff",V.default.XF86XK_PowerDown),k("PrintScreen",V.default.XK_Print),k("Hibernate",V.default.XF86XK_Hibernate),k("Standby",V.default.XF86XK_Standby),k("WakeUp",V.default.XF86XK_WakeUp),k("AllCandidates",V.default.XK_MultipleCandidate),k("Alphanumeric",V.default.XK_Eisu_Shift),k("CodeInput",V.default.XK_Codeinput),k("Compose",V.default.XK_Multi_key),k("Convert",V.default.XK_Henkan),k("GroupFirst",V.default.XK_ISO_First_Group),k("GroupLast",V.default.XK_ISO_Last_Group),k("GroupNext",V.default.XK_ISO_Next_Group),k("GroupPrevious",V.default.XK_ISO_Prev_Group),k("NonConvert",V.default.XK_Muhenkan),k("PreviousCandidate",V.default.XK_PreviousCandidate),k("SingleCandidate",V.default.XK_SingleCandidate),k("HangulMode",V.default.XK_Hangul),k("HanjaMode",V.default.XK_Hangul_Hanja),k("JunjuaMode",V.default.XK_Hangul_Jeonja),k("Eisu",V.default.XK_Eisu_toggle),k("Hankaku",V.default.XK_Hankaku),k("Hiragana",V.default.XK_Hiragana),k("HiraganaKatakana",V.default.XK_Hiragana_Katakana),k("KanaMode",V.default.XK_Kana_Shift),k("KanjiMode",V.default.XK_Kanji),k("Katakana",V.default.XK_Katakana),k("Romaji",V.default.XK_Romaji),k("Zenkaku",V.default.XK_Zenkaku),k("ZenkakuHanaku",V.default.XK_Zenkaku_Hankaku),k("F1",V.default.XK_F1),k("F2",V.default.XK_F2),k("F3",V.default.XK_F3),k("F4",V.default.XK_F4),k("F5",V.default.XK_F5),k("F6",V.default.XK_F6),k("F7",V.default.XK_F7),k("F8",V.default.XK_F8),k("F9",V.default.XK_F9),k("F10",V.default.XK_F10),k("F11",V.default.XK_F11),k("F12",V.default.XK_F12),k("F13",V.default.XK_F13),k("F14",V.default.XK_F14),k("F15",V.default.XK_F15),k("F16",V.default.XK_F16),k("F17",V.default.XK_F17),k("F18",V.default.XK_F18),k("F19",V.default.XK_F19),k("F20",V.default.XK_F20),k("F21",V.default.XK_F21),k("F22",V.default.XK_F22),k("F23",V.default.XK_F23),k("F24",V.default.XK_F24),k("F25",V.default.XK_F25),k("F26",V.default.XK_F26),k("F27",V.default.XK_F27),k("F28",V.default.XK_F28),k("F29",V.default.XK_F29),k("F30",V.default.XK_F30),k("F31",V.default.XK_F31),k("F32",V.default.XK_F32),k("F33",V.default.XK_F33),k("F34",V.default.XK_F34),k("F35",V.default.XK_F35),k("Close",V.default.XF86XK_Close),k("MailForward",V.default.XF86XK_MailForward),k("MailReply",V.default.XF86XK_Reply),k("MailSend",V.default.XF86XK_Send),k("MediaFastForward",V.default.XF86XK_AudioForward),k("MediaPause",V.default.XF86XK_AudioPause),k("MediaPlay",V.default.XF86XK_AudioPlay),k("MediaRecord",V.default.XF86XK_AudioRecord),k("MediaRewind",V.default.XF86XK_AudioRewind),k("MediaStop",V.default.XF86XK_AudioStop),k("MediaTrackNext",V.default.XF86XK_AudioNext),k("MediaTrackPrevious",V.default.XF86XK_AudioPrev),k("New",V.default.XF86XK_New),k("Open",V.default.XF86XK_Open),k("Print",V.default.XK_Print),k("Save",V.default.XF86XK_Save),k("SpellCheck",V.default.XF86XK_Spell),k("AudioVolumeDown",V.default.XF86XK_AudioLowerVolume),k("AudioVolumeUp",V.default.XF86XK_AudioRaiseVolume),k("AudioVolumeMute",V.default.XF86XK_AudioMute),k("MicrophoneVolumeMute",V.default.XF86XK_AudioMicMute),k("LaunchApplication1",V.default.XF86XK_MyComputer),k("LaunchApplication2",V.default.XF86XK_Calculator),k("LaunchCalendar",V.default.XF86XK_Calendar),k("LaunchMail",V.default.XF86XK_Mail),k("LaunchMediaPlayer",V.default.XF86XK_AudioMedia),k("LaunchMusicPlayer",V.default.XF86XK_Music),k("LaunchPhone",V.default.XF86XK_Phone),k("LaunchScreenSaver",V.default.XF86XK_ScreenSaver),k("LaunchSpreadsheet",V.default.XF86XK_Excel),k("LaunchWebBrowser",V.default.XF86XK_WWW),k("LaunchWebCam",V.default.XF86XK_WebCam),k("LaunchWordProcessor",V.default.XF86XK_Word),k("BrowserBack",V.default.XF86XK_Back),k("BrowserFavorites",V.default.XF86XK_Favorites),k("BrowserForward",V.default.XF86XK_Forward),k("BrowserHome",V.default.XF86XK_HomePage),k("BrowserRefresh",V.default.XF86XK_Refresh),k("BrowserSearch",V.default.XF86XK_Search),k("BrowserStop",V.default.XF86XK_Stop),k("Dimmer",V.default.XF86XK_BrightnessAdjust),k("MediaAudioTrack",V.default.XF86XK_AudioCycleTrack),k("RandomToggle",V.default.XF86XK_AudioRandomPlay),k("SplitScreenToggle",V.default.XF86XK_SplitScreen),k("Subtitle",V.default.XF86XK_Subtitle),k("VideoModeNext",V.default.XF86XK_Next_VMode),f("=",V.default.XK_equal,V.default.XK_KP_Equal),f("+",V.default.XK_plus,V.default.XK_KP_Add),f("-",V.default.XK_minus,V.default.XK_KP_Subtract),f("*",V.default.XK_asterisk,V.default.XK_KP_Multiply),f("/",V.default.XK_slash,V.default.XK_KP_Divide),f(".",V.default.XK_period,V.default.XK_KP_Decimal),f(",",V.default.XK_comma,V.default.XK_KP_Separator),f("0",V.default.XK_0,V.default.XK_KP_0),f("1",V.default.XK_1,V.default.XK_KP_1),f("2",V.default.XK_2,V.default.XK_KP_2),f("3",V.default.XK_3,V.default.XK_KP_3),f("4",V.default.XK_4,V.default.XK_KP_4),f("5",V.default.XK_5,V.default.XK_KP_5),f("6",V.default.XK_6,V.default.XK_KP_6),f("7",V.default.XK_7,V.default.XK_KP_7),f("8",V.default.XK_8,V.default.XK_KP_8),f("9",V.default.XK_9,V.default.XK_KP_9);var E=I;fe.default=E},mdZa:function(at,fe,oe){"use strict";typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(L,I){"use strict";if(L==null)throw new TypeError("Cannot convert undefined or null to object");for(var k=Object(L),M=1;M=s.max?void 0:(s.ch=0,s.text=s.cm.getLine(++s.line),!0)}function h(s){return s.line<=s.min?void 0:(s.text=s.cm.getLine(--s.line),s.ch=s.text.length,!0)}function o(s){for(;;){var l=s.text.indexOf(">",s.ch);if(l==-1){if(g(s))continue;return}if(!x(s,l+1)){s.ch=l+1;continue}var c=s.text.lastIndexOf("/",l),d=c>-1&&!/\S/.test(s.text.slice(c+1,l));return s.ch=l+1,d?"selfClose":"regular"}}function u(s){for(;;){var l=s.ch?s.text.lastIndexOf("<",s.ch-1):-1;if(l==-1){if(h(s))continue;return}if(!x(s,l+1)){s.ch=l;continue}f.lastIndex=l,s.ch=l;var c=f.exec(s.text);if(c&&c.index==l)return c}}function r(s){for(;;){f.lastIndex=s.ch;var l=f.exec(s.text);if(!l){if(g(s))continue;return}if(!x(s,l.index+1)){s.ch=l.index+1;continue}return s.ch=l.index+l[0].length,l}}function n(s){for(;;){var l=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(l==-1){if(h(s))continue;return}if(!x(s,l+1)){s.ch=l;continue}var c=s.text.lastIndexOf("/",l),d=c>-1&&!/\S/.test(s.text.slice(c+1,l));return s.ch=l+1,d?"selfClose":"regular"}}function t(s,l){for(var c=[];;){var d=r(s),w,m=s.line,S=s.ch-(d?d[0].length:0);if(!d||!(w=o(s)))return;if(w=="selfClose")continue;if(d[1]){for(var C=c.length-1;C>=0;--C)if(c[C]==d[2]){c.length=C;break}if(C<0&&(!l||l==d[2]))return{tag:d[2],from:L(m,S),to:L(s.line,s.ch)}}else c.push(d[2])}}function i(s,l){for(var c=[];;){var d=n(s);if(!d)return;if(d=="selfClose"){u(s);continue}var w=s.line,m=s.ch,S=u(s);if(!S)return;if(S[1])c.push(S[2]);else{for(var C=c.length-1;C>=0;--C)if(c[C]==S[2]){c.length=C;break}if(C<0&&(!l||l==S[2]))return{tag:S[2],from:L(s.line,s.ch),to:L(w,m)}}}}V.registerHelper("fold","xml",function(s,l){for(var c=new E(s,l.line,0);;){var d=r(c);if(!d||c.line!=l.line)return;var w=o(c);if(!w)return;if(!d[1]&&w!="selfClose"){var m=L(c.line,c.ch),S=t(c,d[2]);return S&&I(S.from,m)>0?{from:m,to:S.from}:null}}}),V.findMatchingTag=function(s,l,c){var d=new E(s,l.line,l.ch,c);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var w=o(d),m=w&&L(d.line,d.ch),S=w&&u(d);if(!w||!S||I(d,l)>0)return;var C={from:L(d.line,d.ch),to:m,tag:S[2]};return w=="selfClose"?{open:C,close:null,at:"open"}:S[1]?{open:i(d,S[2]),close:C,at:"close"}:(d=new E(s,m.line,m.ch,c),{open:C,close:t(d,S[2]),at:"open"})},V.findEnclosingTag=function(s,l,c,d){for(var w=new E(s,l.line,l.ch,c);;){var m=i(w,d);if(!m)break;var S=new E(s,l.line,l.ch,c),C=t(S,m.tag);if(C)return{open:m,close:C}}},V.scanForClosingTag=function(s,l,c,d){var w=new E(s,l.line,l.ch,d?{from:0,to:d}:null);return t(w,c)}})},p5ED:function(at,fe,oe){"use strict";var V=oe("+L6B"),L=oe("2/Rp"),I=oe("5Dmo"),k=oe("3S7+"),M=oe("k1fw"),f=oe("tJVT"),E=oe("q1tI"),x=oe.n(E),g=oe("vHTk"),h=oe.n(g),o=oe("yEEn"),u=oe("ZW9T"),r=oe("1vsH");fe.a=function(n){var t=n.name,i=n.data,s=n.theme,l=n.type,c=n.filename,d=n.monacoEditor,w=n.className,m=n.style,S=n.close,C=n.onClose,v=n.hasMask,y=Object(E.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),T=Object(f.a)(y,2),A=T[0],p=T[1],D=Object(E.useState)(""),O=Object(f.a)(D,2),P=O[0],j=O[1],K,U=1024*1024,X=10*U,B=Object(E.useRef)();l==="office"&&(K=Object(r.T)(i).filesize,K>X&&(l="other")),c&&(d.filename=c),Object(E.useEffect)(function(){var te,ce,be=(te=document.cookie)===null||te===void 0||((ce=te.replace(/\s/g,""))===null||ce===void 0)?void 0:ce.split(";");be==null||be.map(function(Fe){var Oe=Fe.split("=");Oe[0]==="_educoder_session"&&j(Oe[1])})},[]);var N=function(){if(i.startsWith("http")||i.startsWith("/")){z();return}Object(r.z)(c||"educoder",i,c)},z=function(){Object(r.x)(c||t,i)};return console.log("data:",i,"fileanme:",c," name:",t),x.a.createElement("div",{style:Object(M.a)({},m||{}),className:"".concat(v&&h.a.bgBlack," ").concat(l?h.a.wrp:"hide")},S&&x.a.createElement("div",{className:h.a.close,ref:B},x.a.createElement(k.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},x.a.createElement("span",{onClick:z},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(k.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},x.a.createElement("span",{className:"",onClick:C},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(h.a[w]," ").concat(w," ").concat(h.a.monaco," ").concat(l==="txt"?"show":"hide")},l==="txt"&&x.a.createElement(u.b,d)),l==="audio"&&x.a.createElement("audio",{src:"".concat(i!=null&&i.startsWith("/")||(i==null?void 0:i.indexOf("https://"))>-1?i:"data:audio/mp3;base64,").concat(i),autoPlay:!0}),l==="video"&&x.a.createElement(x.a.Fragment,null,i!=null&&i.startsWith("/")?x.a.createElement("video",{controls:!0,src:"".concat(i),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(i),autoPlay:!0})),l==="html"&&x.a.createElement("iframe",{src:i+"&disposition=inline"}),l==="pdf"&&x.a.createElement("embed",{className:h.a.embed,src:i}),l==="image"&&x.a.createElement(x.a.Fragment,null,x.a.createElement("img",{src:"".concat(i!=null&&i.startsWith("/")||(i==null?void 0:i.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(i)})),l==="other"&&x.a.createElement("div",null,x.a.createElement(L.a,{type:"primary",size:"large",onClick:N},x.a.createElement(o.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(l==="download"||l==="office")&&x.a.createElement(L.a,{type:"primary",size:"large",onClick:N},x.a.createElement(o.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(at,fe,oe){},psGv:function(at,fe,oe){var V,L;(function(){var I;(function(){"use strict";var E=[,,function(o){function u(t){this.__parent=t,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=[]}u.prototype.clone_empty=function(){var t=new u(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},u.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},u.prototype.has_match=function(t){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(t))return!0;return!1},u.prototype.set_indent=function(t,i){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(t){this.__items.push(t);var i=t.lastIndexOf(` `);i!==-1?this.__character_count=t.length-i:this.__character_count+=t.length},u.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function r(t,i){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),i=i||"",t.indent_level>0&&(i=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}r.prototype.get_indent_size=function(t,i){var s=this.__base_string_length;return i=i||0,t<0&&(s=0),s+=t*this.__indent_size,s+=i,s},r.prototype.get_indent_string=function(t,i){var s=this.__base_string;return i=i||0,t<0&&(t=0,s=""),i+=t*this.__indent_size,this.__ensure_cache(i),s+=this.__cache[i],s},r.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},r.prototype.__add_column=function(){var t=this.__cache.length,i=0,s="";this.__indent_size&&t>=this.__indent_size&&(i=Math.floor(t/this.__indent_size),t-=i*this.__indent_size,s=new Array(i+1).join(this.__indent_string)),t&&(s+=new Array(t+1).join(" ")),this.__cache.push(s)};function n(t,i){this.__indent_cache=new r(t,i),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(t,i){return this.__indent_cache.get_indent_string(t,i)},n.prototype.get_indent_size=function(t,i){return this.__indent_cache.get_indent_size(t,i)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(t){this.trim(!0);var i=this.current_line.pop();i&&(i[i.length-1]===` `&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(` `);return t!==` `&&(s=s.replace(/[\n]/g,t)),s},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(t,i){return t=t||0,i=i||0,this.next_line.set_indent(t,i),this.__lines.length>1?(this.current_line.set_indent(t,i),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(t){for(var i=0;i1&&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},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,i){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(t)!==0&&l.item(-1)!==i){this.__lines.splice(s+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},o.exports.Output=n},function(o){function u(r,n,t,i){this.type=r,this.text=n,this.comments_before=null,this.newlines=t||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}o.exports.Token=u},,,function(o){function u(t,i){this.raw_options=r(t,i),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"])}u.prototype._get_array=function(t,i){var s=this.raw_options[t],l=i||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},u.prototype._get_boolean=function(t,i){var s=this.raw_options[t],l=s===void 0?!!i:!!s;return l},u.prototype._get_characters=function(t,i){var s=this.raw_options[t],l=i||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),l},u.prototype._get_number=function(t,i){var s=this.raw_options[t];i=parseInt(i,10),isNaN(i)&&(i=0);var l=parseInt(s,10);return isNaN(l)&&(l=i),l},u.prototype._get_selection=function(t,i,s){var l=this._get_selection_list(t,i,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+t+`' can only be one of the following values: `+i+` You passed in: '`+this.raw_options[t]+"'");return l[0]},u.prototype._get_selection_list=function(t,i,s){if(!i||i.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[i[0]],!this._is_valid_selection(s,i))throw new Error("Invalid Default Value!");var l=this._get_array(t,s);if(!this._is_valid_selection(l,i))throw new Error("Invalid Option Value: The option '"+t+`' can contain only the following values: `+i+` You passed in: '`+this.raw_options[t]+"'");return l},u.prototype._is_valid_selection=function(t,i){return t.length&&i.length&&!t.some(function(s){return i.indexOf(s)===-1})};function r(t,i){var s={};t=n(t);var l;for(l in t)l!==i&&(s[l]=t[l]);if(i&&t[i])for(l in t[i])s[l]=t[i][l];return s}function n(t){var i={},s;for(s in t){var l=s.replace(/-/g,"_");i[l]=t[s]}return i}o.exports.Options=u,o.exports.normalizeOpts=n,o.exports.mergeOpts=r},,function(o){var u=RegExp.prototype.hasOwnProperty("sticky");function r(n){this.__input=n||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position=0&&n=0&&t=n.length&&this.__input.substring(t-n.length,t).toLowerCase()===n},o.exports.InputScanner=r},function(o,u,r){var n=r(8).InputScanner,t=r(3).Token,i=r(10).TokenStream,s=r(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(d,w){this._input=new n(d),this._options=w||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new i,this._reset();for(var d,w=new t(l.START,""),m=null,S=[],C=new i;w.type!==l.EOF;){for(d=this._get_next_token(w,m);this._is_comment(d);)C.add(d),d=this._get_next_token(w,m);C.isEmpty()||(d.comments_before=C,C=new i),d.parent=m,this._is_opening(d)?(S.push(m),m=d):m&&this._is_closing(d,m)&&(d.opened=m,m.closed=d,m=S.pop(),d.parent=m),d.previous=w,w.next=d,this.__tokens.add(d),w=d}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(d,w){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(l.RAW,m):this._create_token(l.EOF,"")},c.prototype._is_comment=function(d){return!1},c.prototype._is_opening=function(d){return!1},c.prototype._is_closing=function(d,w){return!1},c.prototype._create_token=function(d,w){var m=new t(d,w,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},o.exports.Tokenizer=c,o.exports.TOKEN=l},function(o){function u(r){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=r}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position=0&&r/),erb:c.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:c.starting_with(/{%/).until_after(/%}/),django_value:c.starting_with(/{{/).until_after(/}}/),django_comment:c.starting_with(/{#/).until_after(/#}/),smarty:c.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:c.starting_with(/{\*/).until_after(/\*}/),smarty_literal:c.starting_with(/{literal}/).until_after(/{\/literal}/)}}i.prototype=new n,i.prototype._create=function(){return new i(this._input,this)},i.prototype._update=function(){this.__set_templated_pattern()},i.prototype.disable=function(s){var l=this._create();return l._disabled[s]=!0,l._update(),l},i.prototype.read_options=function(s){var l=this._create();for(var c in t)l._disabled[c]=s.templating.indexOf(c)===-1;return l._update(),l},i.prototype.exclude=function(s){var l=this._create();return l._excluded[s]=!0,l._update(),l},i.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),s+=l,l=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},i.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},i.prototype._read_template=function(){var s="",l=this._input.peek();if(l==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(s=s||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},o.exports.TemplatablePattern=i},,,,function(o,u,r){var n=r(19).Beautifier,t=r(20).Options;function i(s,l,c,d){var w=new n(s,l,c,d);return w.beautify()}o.exports=i,o.exports.defaultOptions=function(){return new t}},function(o,u,r){var n=r(20).Options,t=r(2).Output,i=r(21).Tokenizer,s=r(21).TOKEN,l=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,d=function(D,O){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=D.max_preserve_newlines,this.preserve_newlines=D.preserve_newlines,this._output=new t(D,O)};d.prototype.current_line_has_match=function(D){return this._output.current_line.has_match(D)},d.prototype.set_space_before_token=function(D,O){this._output.space_before_token=D,this._output.non_breaking_space=O},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(D){this._output.add_raw_token(D)},d.prototype.print_preserved_newlines=function(D){var O=0;D.type!==s.TEXT&&D.previous.type!==s.TEXT&&(O=D.newlines?1:0),this.preserve_newlines&&(O=D.newlines0);return O!==0},d.prototype.traverse_whitespace=function(D){return D.whitespace_before||D.newlines?(this.print_preserved_newlines(D)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(D){this._output.add_new_line(D)},d.prototype.print_token=function(D){D.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(D.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(D){return D=this.indent_level+(D||0),D<1?"":this._output.get_indent_string(D)};var w=function(D){for(var O=null,P=D.next;P.type!==s.EOF&&D.closed!==P;){if(P.type===s.ATTRIBUTE&&P.text==="type"){P.next&&P.next.type===s.EQUALS&&P.next.next&&P.next.next.type===s.VALUE&&(O=P.next.next.text);break}P=P.next}return O},m=function(D,O){var P=null,j=null;return O.closed?(D==="script"?P="text/javascript":D==="style"&&(P="text/css"),P=w(O)||P,P.search("text/css")>-1?j="css":P.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":P.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":P.search(/test\/null/)>-1&&(j="null"),j):null};function S(D,O){return O.indexOf(D)!==-1}function C(D,O,P){this.parent=D||null,this.tag=O?O.tag_name:"",this.indent_level=P||0,this.parser_token=O||null}function v(D){this._printer=D,this._current_frame=null}v.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},v.prototype.record_tag=function(D){var O=new C(this._current_frame,D,this._printer.indent_level);this._current_frame=O},v.prototype._try_pop_frame=function(D){var O=null;return D&&(O=D.parser_token,this._printer.indent_level=D.indent_level,this._current_frame=D.parent),O},v.prototype._get_frame=function(D,O){for(var P=this._current_frame;P&&!(D.indexOf(P.tag)!==-1);){if(O&&O.indexOf(P.tag)!==-1){P=null;break}P=P.parent}return P},v.prototype.try_pop=function(D,O){var P=this._get_frame([D],O);return this._try_pop_frame(P)},v.prototype.indent_to_tag=function(D){var O=this._get_frame(D);O&&(this._printer.indent_level=O.indent_level)};function y(D,O,P,j){this._source_text=D||"",O=O||{},this._js_beautify=P,this._css_beautify=j,this._tag_stack=null;var K=new n(O,"html");this._options=K,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,O=this._options.eol;this._options.eol==="auto"&&(O=` `,D&&l.test(D)&&(O=D.match(l)[0])),D=D.replace(c,` `);var P=D.match(/^[\t ]*/)[0],j={text:"",type:""},K=new T,U=new d(this._options,P),X=new i(D,this._options).tokenize();this._tag_stack=new v(U);for(var B=null,N=X.next();N.type!==s.EOF;)N.type===s.TAG_OPEN||N.type===s.COMMENT?(B=this._handle_tag_open(U,N,K,j),K=B):N.type===s.ATTRIBUTE||N.type===s.EQUALS||N.type===s.VALUE||N.type===s.TEXT&&!K.tag_complete?B=this._handle_inside_tag(U,N,K,X):N.type===s.TAG_CLOSE?B=this._handle_tag_close(U,N,K):N.type===s.TEXT?B=this._handle_text(U,N,K):U.add_raw_token(N),j=B,N=X.next();var z=U._output.get_code(O);return z},y.prototype._handle_tag_close=function(D,O,P){var j={text:O.text,type:O.type};return D.alignment_size=0,P.tag_complete=!0,D.set_space_before_token(O.newlines||O.whitespace_before!=="",!0),P.is_unformatted?D.add_raw_token(O):(P.tag_start_char==="<"&&(D.set_space_before_token(O.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&P.has_wrapped_attrs&&D.print_newline(!1)),D.print_token(O)),P.indent_content&&!(P.is_unformatted||P.is_content_unformatted)&&(D.indent(),P.indent_content=!1),!P.is_inline_element&&!(P.is_unformatted||P.is_content_unformatted)&&D.set_wrap_point(),j},y.prototype._handle_inside_tag=function(D,O,P,j){var K=P.has_wrapped_attrs,U={text:O.text,type:O.type};if(D.set_space_before_token(O.newlines||O.whitespace_before!=="",!0),P.is_unformatted)D.add_raw_token(O);else if(P.tag_start_char==="{"&&O.type===s.TEXT)D.print_preserved_newlines(O)?(O.newlines=0,D.add_raw_token(O)):D.print_token(O);else{if(O.type===s.ATTRIBUTE?(D.set_space_before_token(!0),P.attr_count+=1):(O.type===s.EQUALS||O.type===s.VALUE&&O.previous.type===s.EQUALS)&&D.set_space_before_token(!1),O.type===s.ATTRIBUTE&&P.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(D.traverse_whitespace(O),K=K||O.newlines!==0),this._is_wrap_attributes_force)){var X=P.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&P.attr_count===1){var B=!0,N=0,z;do{if(z=j.peek(N),z.type===s.ATTRIBUTE){B=!1;break}N+=1}while(N<4&&z.type!==s.EOF&&z.type!==s.TAG_CLOSE);X=!B}X&&(D.print_newline(!1),K=!0)}D.print_token(O),K=K||D.previous_token_wrapped(),P.has_wrapped_attrs=K}return U},y.prototype._handle_text=function(D,O,P){var j={text:O.text,type:"TK_CONTENT"};return P.custom_beautifier_name?this._print_custom_beatifier_text(D,O,P):P.is_unformatted||P.is_content_unformatted?D.add_raw_token(O):(D.traverse_whitespace(O),D.print_token(O)),j},y.prototype._print_custom_beatifier_text=function(D,O,P){var j=this;if(O.text!==""){var K=O.text,U,X=1,B="",N="";P.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?U=this._js_beautify:P.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?U=this._css_beautify:P.custom_beautifier_name==="html"&&(U=function(Oe,Re){var Be=new y(Oe,Re,j._js_beautify,j._css_beautify);return Be.beautify()}),this._options.indent_scripts==="keep"?X=0:this._options.indent_scripts==="separate"&&(X=-D.indent_level);var z=D.get_full_indent(X);if(K=K.replace(/\n[ \t]*$/,""),P.custom_beautifier_name!=="html"&&K[0]==="<"&&K.match(/^(|]]>)$/.exec(K);if(!te){D.add_raw_token(O);return}B=z+te[1]+` `,K=te[4],te[5]&&(N=z+te[5]),K=K.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(` `)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(O.whitespace_before=te[0]))}if(K)if(U){var ce=function(){this.eol=` `};ce.prototype=this._options.raw_options;var be=new ce;K=U(z+K,be)}else{var Fe=O.whitespace_before;Fe&&(K=K.replace(new RegExp(` (`+Fe+")?","g"),` `)),K=z+K.replace(/\n/g,` `+z)}B&&(K?K=B+K+` `+N:K=B+N),D.print_newline(!1),K&&(O.text=K,O.whitespace_before="",O.newlines=0,D.add_raw_token(O),D.print_newline(!0))}},y.prototype._handle_tag_open=function(D,O,P,j){var K=this._get_tag_open_token(O);return(P.is_unformatted||P.is_content_unformatted)&&!P.is_empty_element&&O.type===s.TAG_OPEN&&O.text.indexOf("]*)/),this.tag_check=P?P[1]:""):(P=O.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=P?P[1]:"",(O.text.startsWith("{{#>")||O.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&O.next!==null?this.tag_check=O.next.text.split(" ")[0]:this.tag_check=O.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),O.type===s.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||O.closed&&O.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};y.prototype._get_tag_open_token=function(D){var O=new T(this._tag_stack.get_parser_token(),D);return O.alignment_size=this._options.wrap_attributes_indent_size,O.is_end_tag=O.is_end_tag||S(O.tag_check,this._options.void_elements),O.is_empty_element=O.tag_complete||O.is_start_tag&&O.is_end_tag,O.is_unformatted=!O.tag_complete&&S(O.tag_check,this._options.unformatted),O.is_content_unformatted=!O.is_empty_element&&S(O.tag_check,this._options.content_unformatted),O.is_inline_element=S(O.tag_name,this._options.inline)||O.tag_name.includes("-")||O.tag_start_char==="{",O},y.prototype._set_tag_position=function(D,O,P,j,K){if(P.is_empty_element||(P.is_end_tag?P.start_tag_token=this._tag_stack.try_pop(P.tag_name):(this._do_optional_end_element(P)&&(P.is_inline_element||D.print_newline(!1)),this._tag_stack.record_tag(P),(P.tag_name==="script"||P.tag_name==="style")&&!(P.is_unformatted||P.is_content_unformatted)&&(P.custom_beautifier_name=m(P.tag_check,O)))),S(P.tag_check,this._options.extra_liners)&&(D.print_newline(!1),D._output.just_added_blankline()||D.print_newline(!0)),P.is_empty_element){if(P.tag_start_char==="{"&&P.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),P.indent_content=!0;var U=D.current_line_has_match(/{{#if/);U||D.print_newline(!1)}P.tag_name==="!--"&&K.type===s.TAG_CLOSE&&j.is_end_tag&&P.text.indexOf(` `)===-1||(P.is_inline_element||P.is_unformatted||D.print_newline(!1),this._calcluate_parent_multiline(D,P))}else if(P.is_end_tag){var X=!1;X=P.start_tag_token&&P.start_tag_token.multiline_content,X=X||!P.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(K.type===s.TAG_CLOSE&&P.start_tag_token===j)&&K.type!=="TK_CONTENT",(P.is_content_unformatted||P.is_unformatted)&&(X=!1),X&&D.print_newline(!1)}else P.indent_content=!P.custom_beautifier_name,P.tag_start_char==="<"&&(P.tag_name==="html"?P.indent_content=this._options.indent_inner_html:P.tag_name==="head"?P.indent_content=this._options.indent_head_inner_html:P.tag_name==="body"&&(P.indent_content=this._options.indent_body_inner_html)),!(P.is_inline_element||P.is_unformatted)&&(K.type!=="TK_CONTENT"||P.is_content_unformatted)&&D.print_newline(!1),this._calcluate_parent_multiline(D,P)},y.prototype._calcluate_parent_multiline=function(D,O){O.parent&&D._output.just_added_newline()&&!((O.is_inline_element||O.is_unformatted)&&O.parent.is_inline_element)&&(O.parent.multiline_content=!0)};var A=["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"],p=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(D){var O=null;if(D.is_empty_element||!D.is_start_tag||!D.parent)return;if(D.tag_name==="body")O=O||this._tag_stack.try_pop("head");else if(D.tag_name==="li")O=O||this._tag_stack.try_pop("li",["ol","ul"]);else if(D.tag_name==="dd"||D.tag_name==="dt")O=O||this._tag_stack.try_pop("dt",["dl"]),O=O||this._tag_stack.try_pop("dd",["dl"]);else if(D.parent.tag_name==="p"&&A.indexOf(D.tag_name)!==-1){var P=D.parent.parent;(!P||p.indexOf(P.tag_name)===-1)&&(O=O||this._tag_stack.try_pop("p"))}else D.tag_name==="rp"||D.tag_name==="rt"?(O=O||this._tag_stack.try_pop("rt",["ruby","rtc"]),O=O||this._tag_stack.try_pop("rp",["ruby","rtc"])):D.tag_name==="optgroup"?O=O||this._tag_stack.try_pop("optgroup",["select"]):D.tag_name==="option"?O=O||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):D.tag_name==="colgroup"?O=O||this._tag_stack.try_pop("caption",["table"]):D.tag_name==="thead"?(O=O||this._tag_stack.try_pop("caption",["table"]),O=O||this._tag_stack.try_pop("colgroup",["table"])):D.tag_name==="tbody"||D.tag_name==="tfoot"?(O=O||this._tag_stack.try_pop("caption",["table"]),O=O||this._tag_stack.try_pop("colgroup",["table"]),O=O||this._tag_stack.try_pop("thead",["table"]),O=O||this._tag_stack.try_pop("tbody",["table"])):D.tag_name==="tr"?(O=O||this._tag_stack.try_pop("caption",["table"]),O=O||this._tag_stack.try_pop("colgroup",["table"]),O=O||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(D.tag_name==="th"||D.tag_name==="td")&&(O=O||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),O=O||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return D.parent=this._tag_stack.get_parser_token(),O},o.exports.Beautifier=y},function(o,u,r){var n=r(6).Options;function t(i){n.call(this,i,"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"])}t.prototype=new n,o.exports.Options=t},function(o,u,r){var n=r(9).Tokenizer,t=r(9).TOKEN,i=r(13).Directives,s=r(14).TemplatablePattern,l=r(12).Pattern,c={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:t.START,RAW:t.RAW,EOF:t.EOF},d=new i(/<\!--/,/-->/),w=function(m,S){n.call(this,m,S),this._current_tag_name="";var C=new s(this._input).read_options(this._options),v=new l(this._input);if(this.__patterns={word:C.until(/[\n\r\t <]/),single_quote:C.until_after(/'/),double_quote:C.until_after(/"/),attribute:C.until(/[\n\r\t =>]|\/>/),element_name:C.until(/[\n\r\t >\/]/),handlebars_comment:v.starting_with(/{{!--/).until_after(/--}}/),handlebars:v.starting_with(/{{/).until_after(/}}/),handlebars_open:v.until(/[\n\r\t }]/),handlebars_raw_close:v.until(/}}/),comment:v.starting_with(//),cdata:v.starting_with(//),conditional_comment:v.starting_with(//),processing:v.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=v.matching(y).until_after(y)}};w.prototype=new n,w.prototype._is_comment=function(m){return!1},w.prototype._is_opening=function(m){return m.type===c.TAG_OPEN},w.prototype._is_closing=function(m,S){return m.type===c.TAG_CLOSE&&S&&((m.text===">"||m.text==="/>")&&S.text[0]==="<"||m.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},w.prototype._reset=function(){this._current_tag_name=""},w.prototype._get_next_token=function(m,S){var C=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(c.EOF,""):(C=C||this._read_open_handlebars(v,S),C=C||this._read_attribute(v,m,S),C=C||this._read_close(v,S),C=C||this._read_raw_content(v,m,S),C=C||this._read_content_word(v),C=C||this._read_comment_or_cdata(v),C=C||this._read_processing(v),C=C||this._read_open(v,S),C=C||this._create_token(c.UNKNOWN,this._input.next()),C)},w.prototype._read_comment_or_cdata=function(m){var S=null,C=null,v=null;if(m==="<"){var y=this._input.peek(1);y==="!"&&(C=this.__patterns.comment.read(),C?(v=d.get_directives(C),v&&v.ignore==="start"&&(C+=d.readIgnored(this._input))):C=this.__patterns.cdata.read()),C&&(S=this._create_token(c.COMMENT,C),S.directives=v)}return S},w.prototype._read_processing=function(m){var S=null,C=null,v=null;if(m==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(C=this.__patterns.conditional_comment.read(),C=C||this.__patterns.processing.read()),C&&(S=this._create_token(c.COMMENT,C),S.directives=v)}return S},w.prototype._read_open=function(m,S){var C=null,v=null;return S||m==="<"&&(C=this._input.next(),this._input.peek()==="/"&&(C+=this._input.next()),C+=this.__patterns.element_name.read(),v=this._create_token(c.TAG_OPEN,C)),v},w.prototype._read_open_handlebars=function(m,S){var C=null,v=null;return S||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(C=this.__patterns.handlebars_comment.read(),C=C||this.__patterns.handlebars.read(),v=this._create_token(c.COMMENT,C)):(C=this.__patterns.handlebars_open.read(),v=this._create_token(c.TAG_OPEN,C))),v},w.prototype._read_close=function(m,S){var C=null,v=null;return S&&(S.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(C=this._input.next(),m==="/"&&(C+=this._input.next()),v=this._create_token(c.TAG_CLOSE,C)):S.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),v=this._create_token(c.TAG_CLOSE,"}}"))),v},w.prototype._read_attribute=function(m,S,C){var v=null,y="";if(C&&C.text[0]==="<")if(m==="=")v=this._create_token(c.EQUALS,this._input.next());else if(m==='"'||m==="'"){var T=this._input.next();m==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),v=this._create_token(c.VALUE,T)}else y=this.__patterns.attribute.read(),y&&(S.type===c.EQUALS?v=this._create_token(c.VALUE,y):v=this._create_token(c.ATTRIBUTE,y));return v},w.prototype._is_content_unformatted=function(m){return this._options.void_elements.indexOf(m)===-1&&(this._options.content_unformatted.indexOf(m)!==-1||this._options.unformatted.indexOf(m)!==-1)},w.prototype._read_raw_content=function(m,S,C){var v="";if(C&&C.text[0]==="{")v=this.__patterns.handlebars_raw_close.read();else if(S.type===c.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var y=S.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var T=this._read_comment_or_cdata(m);if(T)return T.type=c.TEXT,T;v=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(y)&&(v=this._input.readUntil(new RegExp("","ig")))}return v?this._create_token(c.TEXT,v):null},w.prototype._read_content_word=function(m){var S="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(c.TEXT,S)},o.exports.Tokenizer=w,o.exports.TOKEN=c}],x={};function g(o){var u=x[o];if(u!==void 0)return u.exports;var r=x[o]={exports:{}};return E[o](r,r.exports,g),r.exports}var h=g(18);I=h})();var k=I;if(!0)!(V=[oe,oe("6UM0"),oe("TXwP")],L=function(E){var x=oe("6UM0"),g=oe("TXwP");return{html_beautify:function(h,o){return k(h,o,x.js_beautify,g.css_beautify)}}}.apply(fe,V),L!==void 0&&(at.exports=L));else var M,f})()},q7KB:function(at,fe,oe){},"rAM+":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return L});var V=oe("Qw5x");function L(I,k){var M;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(M=Object(V.a)(I))||k&&I&&typeof I.length=="number"){M&&(I=M);var f=0,E=function(){};return{s:E,n:function(){return f>=I.length?{done:!0}:{done:!1,value:I[f++]}},e:function(u){throw u},f:E}}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 x=!0,g=!1,h;return{s:function(){M=I[Symbol.iterator]()},n:function(){var u=M.next();return x=u.done,u},e:function(u){g=!0,h=u},f:function(){try{!x&&M.return!=null&&M.return()}finally{if(g)throw h}}}}},rUJ1:function(at,fe){const oe=/[&<>"']/,V=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,k={"&":"&","<":"<",">":">",'"':""","'":"'"},M=v=>k[v];function f(v,y){if(y){if(oe.test(v))return v.replace(V,M)}else if(L.test(v))return v.replace(I,M);return v}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function x(v){return v.replace(E,(y,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const g=/(^|[^\[])\^/g;function h(v,y){v=v.source||v,y=y||"";const T={replace:(A,p)=>(p=p.source||p,p=p.replace(g,"$1"),v=v.replace(A,p),T),getRegex:()=>new RegExp(v,y)};return T}const o=/[^\w:]/g,u=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function r(v,y,T){if(v){let A;try{A=decodeURIComponent(x(T)).replace(o,"").toLowerCase()}catch(p){return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}y&&!u.test(T)&&(T=l(y,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(A){return null}return T}const n={},t=/^[^:]+:\/*[^/]*$/,i=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(v,y){n[" "+v]||(t.test(v)?n[" "+v]=v+"/":n[" "+v]=m(v,"/",!0)),v=n[" "+v];const T=v.indexOf(":")===-1;return y.substring(0,2)==="//"?T?y:v.replace(i,"$1")+y:y.charAt(0)==="/"?T?y:v.replace(s,"$1")+y:v+y}const c={exec:function(){}};function d(v){let y=1,T,A;for(;y{let j=!1,K=O;for(;--K>=0&&P[K]==="\\";)j=!j;return j?"|":" |"}),A=T.split(/ \|/);let p=0;if(A.length>y)A.splice(y);else for(;A.length>>24,s>>>=C,l-=C,C=S>>>16&255,C===0)D[g++]=S&65535;else if(C&16){v=S&65535,C&=15,C&&(l>>=C,l-=C),l<15&&(s+=p[E++]<>>24,s>>>=C,l-=C,C=S>>>16&255,C&16){if(y=S&65535,C&=15,lu){k.msg="invalid distance too far back",f.mode=V;break e}if(s>>>=C,l-=C,C=g-h,y>C){if(C=y-C,C>n&&f.sane){k.msg="invalid distance too far back",f.mode=V;break e}if(T=0,A=i,t===0){if(T+=r-C,C2;)D[g++]=A[T++],D[g++]=A[T++],D[g++]=A[T++],v-=3;v&&(D[g++]=A[T++],v>1&&(D[g++]=A[T++]))}else{T=g-y;do D[g++]=D[T++],D[g++]=D[T++],D[g++]=D[T++],v-=3;while(v>2);v&&(D[g++]=D[T++],v>1&&(D[g++]=D[T++]))}}else if((C&64)===0){S=d[(S&65535)+(s&(1<>3,E-=v,l-=v<<3,s&=(1<0},!1)}function o(u,r){for(var n={main:[r]},t={main:[]},i={main:{}};h(n);)for(var s=Object.keys(n),l=0;l=2*C/y||P<=K)return;var U=Number.POSITIVE_INFINITY,X;for(X=s.level-1;X>A;X--){var B=T[X].maxBitrate;if(U=C*B/(8*.8*O),U=P)return;var N=this.bwEstimator.getEstimate();h.logger.warn("Fragment "+s.sn+(l?" part "+l.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+X+` Current BW estimate: `+(Object(k.isFiniteNumber)(N)?(N/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+P.toFixed(3)+` s Estimated load time for the next fragment: `+U.toFixed(3)+` s Time to underbuffer: `+K.toFixed(3)+" s"),c.nextLoadLevel=X,this.bwEstimator.sample(v,S.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),c.trigger(f.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:l,stats:S})},t.onFragLoaded=function(s,l){var c=l.frag,d=l.part;if(c.type===g.PlaylistLevelType.MAIN&&Object(k.isFiniteNumber)(c.sn)){var w=d?d.stats:c.stats,m=d?d.duration:c.duration;if(this.clearTimer(),this.lastLoadedFragLevel=c.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[c.level],C=(S.loaded?S.loaded.bytes:0)+w.loaded,v=(S.loaded?S.loaded.duration:0)+m;S.loaded={bytes:C,duration:v},S.realBitrate=Math.round(8*C/v)}if(c.bitrateTest){var y={stats:w,frag:c,part:d,id:c.type};this.onFragBuffered(f.Events.FRAG_BUFFERED,y),c.bitrateTest=!1}}},t.onFragBuffered=function(s,l){var c=l.frag,d=l.part,w=d?d.stats:c.stats;if(w.aborted)return;if(c.type!==g.PlaylistLevelType.MAIN||c.sn==="initSegment")return;var m=w.parsing.end-w.loading.start;this.bwEstimator.sample(m,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),c.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},t.onError=function(s,l){switch(l.details){case x.ErrorDetails.FRAG_LOAD_ERROR:case x.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},t.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},t.getNextABRAutoLevel=function(){var s=this.fragCurrent,l=this.partCurrent,c=this.hls,d=c.maxAutoLevel,w=c.config,m=c.minAutoLevel,S=c.media,C=l?l.duration:s?s.duration:0,v=S?S.currentTime:0,y=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,A=(E.BufferHelper.bufferInfo(S,v,w.maxBufferHole).end-v)/y,p=this.findBestLevel(T,m,d,A,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(p>=0)return p;h.logger.trace((A?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var D=C?Math.min(C,w.maxStarvationDelay):w.maxStarvationDelay,O=w.abrBandWidthFactor,P=w.abrBandWidthUpFactor;if(!A){var j=this.bitrateTestDelay;if(j){var K=C?Math.min(C,w.maxLoadingDelay):w.maxLoadingDelay;D=K-j,h.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*D)+" ms"),O=P=1}}return p=this.findBestLevel(T,m,d,A+D,O,P),Math.max(p,0)},t.findBestLevel=function(s,l,c,d,w,m){for(var S,C=this.fragCurrent,v=this.partCurrent,y=this.lastLoadedFragLevel,T=this.hls.levels,A=T[y],p=!!(A!=null&&(S=A.details)!==null&&S!==void 0&&S.live),D=A==null?void 0:A.codecSet,O=v?v.duration:C?C.duration:0,P=c;P>=l;P--){var j=T[P];if(!j||D&&j.codecSet!==D)continue;var K=j.details,U=(v?K==null?void 0:K.partTarget:K==null?void 0:K.averagetargetduration)||O,X=void 0;P<=y?X=w*s:X=m*s;var B=T[P].maxBitrate,N=B*U/X;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(X)+"/"+B+"/"+U+"/"+d+"/"+N),X>B&&(!N||p&&!this.bitrateTestDelay||N0&&A===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=M.State.IDLE):(this.loadedmetadata=!1,this.state=M.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=A,this.tick()},y.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_TRACK:{var A,p=this.levels,D=this.trackId,O=p==null||((A=p[D])===null||A===void 0)?void 0:A.details;if(O){if(this.waitForCdnTuneIn(O))break;this.state=M.State.WAITING_INIT_PTS}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var P,j=performance.now(),K=this.retryDate;(!K||j>=K||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=M.State.IDLE);break}case M.State.WAITING_INIT_PTS:{var U=this.waitingData;if(U){var X=U.frag,B=U.part,N=U.cache,z=U.complete;if(this.initPTS[X.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.FRAG_LOADING;var te=N.flush(),ce={frag:X,part:B,payload:te,networkDetails:null};this._handleFragmentLoadProgress(ce),z&&C.prototype._handleFragmentLoadComplete.call(this,ce)}else if(this.videoTrackCC!==this.waitingVideoCC)l.logger.log("Waiting fragment cc ("+X.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var be=this.getLoadPosition(),Fe=E.BufferHelper.bufferInfo(this.mediaBuffer,be,this.config.maxBufferHole),Oe=Object(t.fragmentWithinToleranceTest)(Fe.end,this.config.maxFragLookUpTolerance,X);Oe<0&&(l.logger.log("Waiting fragment cc ("+X.cc+") @ "+X.start+" cancelled because another fragment at "+Fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=M.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var A=this.waitingData;A&&(this.fragmentTracker.removeFragment(A.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.IDLE)},y.onTickEnd=function(){var A=this.media;if(!A||!A.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:A,D=p.buffered;!this.loadedmetadata&&D.length&&(this.loadedmetadata=!0),this.lastCurrentTime=A.currentTime},y.doTickIdle=function(){var A,p,D=this.hls,O=this.levels,P=this.media,j=this.trackId,K=D.config;if(!O||!O[j])return;if(!P&&(this.startFragRequested||!K.startFragPrefetch))return;var U=O[j],X=U.details;if(!X||X.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(X)){this.state=M.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,o.ElementaryStreamTypes.AUDIO,h.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,h.PlaylistLevelType.AUDIO);if(B===null)return;var N=B.len,z=this.getMaxBufferLength(),te=this.audioSwitch;if(N>=z&&!te)return;if(!te&&this._streamEnded(B,X)){D.trigger(f.Events.BUFFER_EOS,{type:"audio"}),this.state=M.State.ENDED;return}var ce=X.fragments,be=ce[0].start,Fe=B.end;if(te){var Oe=this.getLoadPosition();Fe=Oe,X.PTSKnown&&Oebe||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=be+.05))}var Re=this.getNextFragment(Fe,X);if(!Re){this.bufferFlushed=!0;return}((A=Re.decryptdata)===null||A===void 0?void 0:A.keyFormat)==="identity"&&!((p=Re.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(Re,X):this.loadFragment(Re,X,Fe)},y.getMaxBufferLength=function(){var A=C.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,h.PlaylistLevelType.MAIN);return p===null?A:Math.max(A,p.len)},y.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(A,p){var D=p.audioTracks;this.resetTransmuxer(),this.levels=D.map(function(O){return new g.Level(O)})},y.onAudioTrackSwitching=function(A,p){var D=!!p.url;this.trackId=p.id;var O=this.fragCurrent;O!=null&&O.loader&&O.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),D?this.setInterval(m):this.resetTransmuxer(),D?(this.audioSwitch=!0,this.state=M.State.IDLE):this.state=M.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(A,p){this.mainDetails=p.details},y.onAudioTrackLoaded=function(A,p){var D,O=this.levels,P=p.details,j=p.id;if(!O){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var K=O[j],U=0;if(P.live||(D=K.details)!==null&&D!==void 0&&D.live){var X=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!X)return;!K.details&&P.hasProgramDateTime&&X.hasProgramDateTime?(Object(i.alignMediaPlaylistByPDT)(P,X),U=P.fragments[0].start):U=this.alignPlaylists(P,K.details)}K.details=P,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition(K.details,U),this.state===M.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=M.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(A){var p,D=A.frag,O=A.part,P=A.payload,j=this.config,K=this.trackId,U=this.levels;if(!U){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+D.sn+" of level "+D.level+" will not be buffered");return}var X=U[K];console.assert(X,"Audio track is defined on fragment load progress");var B=X.details;console.assert(B,"Audio track details are defined on fragment load progress");var N=j.defaultAudioCodec||X.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new r.default(this.hls,h.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[D.cc],ce=(p=D.initSegment)===null||p===void 0?void 0:p.data;if(te!==void 0){var be=!1,Fe=O?O.index:-1,Oe=Fe!==-1,Re=new n.ChunkMetadata(D.level,D.sn,D.stats.chunkCount,P.byteLength,Fe,Oe);z.push(P,ce,N,"",D,O,B.totalduration,be,Re,te)}else{l.logger.log("Unknown video PTS for cc "+D.cc+", waiting for video PTS before demuxing audio frag "+D.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+K);var Be=this.waitingData=this.waitingData||{frag:D,part:O,cache:new u.default,complete:!1},Ke=Be.cache;Ke.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=M.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(A){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,A)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(A,p){var D=p.tracks.audio;D&&(this.mediaBuffer=D.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},y.onFragBuffered=function(A,p){var D=p.frag,O=p.part;if(D.type!==h.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(D)){this.warn("Fragment "+D.sn+(O?" p: "+O.index:"")+" of level "+D.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}D.sn!=="initSegment"&&(this.fragPrevious=D,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(f.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(D,O)},y.onError=function(A,p){switch(p.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(h.PlaylistLevelType.AUDIO,p);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==M.State.ERROR&&this.state!==M.State.STOPPED&&(this.state=p.fatal?M.State.ERROR:M.State.IDLE,this.warn(p.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="audio"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var D=!0,O=this.getFwdBufferInfo(this.mediaBuffer,h.PlaylistLevelType.AUDIO);O&&O.len>.5&&(D=!this.reduceMaxBufferLength(O.len)),D&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(A,p){var D=p.type;D===o.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(A){var p,D="audio",O=this.hls,P=A.remuxResult,j=A.chunkMeta,K=this.getCurrentContext(j);if(!K){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var U=K.frag,X=K.part,B=P.audio,N=P.text,z=P.id3,te=P.initSegment;if(this.fragContextChanged(U))return;if(this.state=M.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,U,j),O.trigger(f.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:D,tracks:te.tracks})),B){var ce=B.startPTS,be=B.endPTS,Fe=B.startDTS,Oe=B.endDTS;X&&(X.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:be,startDTS:Fe,endDTS:Oe}),U.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,ce,be,Fe,Oe),this.bufferFragmentData(B,U,X,j)}if(z!=null&&(p=z.samples)!==null&&p!==void 0&&p.length){var Re=c({frag:U,id:D},z);O.trigger(f.Events.FRAG_PARSING_METADATA,Re)}if(N){var Be=c({frag:U,id:D},N);O.trigger(f.Events.FRAG_PARSING_USERDATA,Be)}},y._bufferInitSegment=function(A,p,D){if(this.state!==M.State.PARSING)return;A.video&&delete A.video;var O=A.audio;if(!O)return;O.levelCodec=O.codec,O.id="audio",this.log("Init audio buffer, container:"+O.container+", codecs[parsed]=["+O.codec+"]"),this.hls.trigger(f.Events.BUFFER_CODECS,A);var P=O.initSegment;if(P!=null&&P.byteLength){var j={type:"audio",frag:p,part:null,chunkMeta:D,parent:p.type,data:P};this.hls.trigger(f.Events.BUFFER_APPENDING,j)}this.tick()},y.loadFragment=function(A,p,D){var O=this.fragmentTracker.getState(A);this.fragCurrent=A,(this.audioSwitch||O===x.FragmentState.NOT_LOADED||O===x.FragmentState.PARTIAL)&&(A.sn==="initSegment"?this._loadInitSegment(A):p.live&&!Object(k.isFiniteNumber)(this.initPTS[A.cc])?(this.log("Waiting for video PTS in continuity counter "+A.cc+" of live stream before loading audio fragment "+A.sn+" of level "+this.trackId),this.state=M.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,A,p,D)))},y.completeAudioSwitch=function(){var A=this.hls,p=this.media,D=this.trackId;p&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,A.trigger(f.Events.AUDIO_TRACK_SWITCHED,{id:D})},v}(M.default);L.default=S},"./src/controller/audio-track-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts"),M=I("./src/errors.ts"),f=I("./src/controller/base-playlist-controller.ts"),E=I("./src/types/loader.ts");function x(r,n){for(var t=0;t=l.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var c=l[this.trackId];this.log("Now switching to audio-track index "+s);var d=l[s],w=d.id,m=d.groupId,S=m===void 0?"":m,C=d.name,v=d.type,y=d.url;if(this.trackId=s,this.trackName=C,this.selectDefaultTrack=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:S,name:C,type:v,url:y}),d.details&&!d.details.live)return;var T=this.switchParams(d.url,c==null?void 0:c.details);this.loadPlaylist(T)},t.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var l=this.trackName,c=this.findTrackId(l)||this.findTrackId();c!==-1?this.setAudioTrack(c):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},t.findTrackId=function(s){for(var l=this.tracksInGroup,c=0;cn.partTarget&&(d+=1)}if(Object(k.isFiniteNumber)(c))return new M.HlsUrlParameters(c,Object(k.isFiniteNumber)(d)?d:void 0,M.HlsSkip.No)}}},o.loadPlaylist=function(r){},o.shouldLoadTrack=function(r){return this.canLoad&&r&&!!r.url&&(!r.details||r.details.live)},o.playlistLoaded=function(r,n,t){var i=this,s=n.details,l=n.stats,c=l.loading.end?Math.max(0,self.performance.now()-l.loading.end):0;if(s.advancedDateTime=Date.now()-c,s.live||t!=null&&t.live){if(s.reloaded(t),t&&this.log("live playlist "+r+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),t&&s.fragments.length>0&&Object(f.mergeDetails)(t,s),!this.canLoad||!s.live)return;var d,w=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var S=this.hls.config.lowLatencyMode,C=s.lastPartSn,v=s.endSN,y=s.lastPartIndex,T=y!==-1,A=C===v,p=S?0:y;T?(w=A?v+1:C,m=A?p:y+1):w=v+1;var D=s.age,O=D+s.ageHeader,P=Math.min(O-s.partTarget,s.targetduration*1.5);if(P>0){if(t&&P>t.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+t.tuneInGoal+" to: "+P+" with playlist age: "+s.age),P=0;else{var j=Math.floor(P/s.targetduration);if(w+=j,m!==void 0){var K=Math.round(P%s.targetduration/s.partTarget);m+=K}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+D.toFixed(2)+"s goal: "+P+" skip sn "+j+" to part "+m)}s.tuneInGoal=P}if(d=this.getDeliveryDirectives(s,n.deliveryDirectives,w,m),S||!A){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(s,n.deliveryDirectives,w,m);var U=Object(f.computeReloadInterval)(s,l);w!==void 0&&s.canBlockReload&&(U-=s.partTarget||1),this.log("reload live playlist "+r+" in "+Math.round(U)+" ms"),this.timer=self.setTimeout(function(){return i.loadPlaylist(d)},U)}else this.clearTimer()},o.getDeliveryDirectives=function(r,n,t,i){var s=Object(M.getSkipValue)(r,t);return n!=null&&n.skip&&r.deltaUpdateFailed&&(t=n.msn,i=n.part,s=M.HlsSkip.No),new M.HlsUrlParameters(t,i,s)},o.retryLoadingOrFail=function(r){var n=this,t=this.hls.config,i=this.retryCount-1&&(s=r.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+r.details+'"'),this.loadPlaylist();else{var l=Math.min(Math.pow(2,this.retryCount)*t.levelLoadingRetryDelay,t.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return n.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+r.details+'"')}}else this.warn('cannot recover from error "'+r.details+'"'),this.clearTimer(),r.fatal=!0;return i},h}()},"./src/controller/base-stream-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"State",function(){return v}),I.d(L,"default",function(){return y});var k=I("./src/polyfills/number.ts"),M=I("./src/task-loop.ts"),f=I("./src/controller/fragment-tracker.ts"),E=I("./src/utils/buffer-helper.ts"),x=I("./src/utils/logger.ts"),g=I("./src/events.ts"),h=I("./src/errors.ts"),o=I("./src/types/transmuxer.ts"),u=I("./src/utils/mp4-tools.ts"),r=I("./src/utils/discontinuities.ts"),n=I("./src/controller/fragment-finders.ts"),t=I("./src/controller/level-helper.ts"),i=I("./src/loader/fragment-loader.ts"),s=I("./src/crypt/decrypter.ts"),l=I("./src/utils/time-ranges.ts"),c=I("./src/types/loader.ts");function d(T,A){for(var p=0;pte;(X0&&X&&X.key&&X.iv&&X.method==="AES-128"){var B=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(U),X.key.buffer,X.iv.buffer).then(function(N){var z=self.performance.now();return K.trigger(g.Events.FRAG_DECRYPTED,{frag:O,payload:N,stats:{tstart:B,tdecrypt:z}}),j.payload=N,j})}return j}).then(function(j){var K=P.fragCurrent,U=P.hls,X=P.levels;if(!X)throw new Error("init load aborted, missing levels");var B=X[O.level].details;console.assert(B,"Level details are defined when init segment is loaded");var N=O.stats;P.state=v.IDLE,P.fragLoadError=0,O.data=new Uint8Array(j.payload),N.parsing.start=N.buffering.start=self.performance.now(),N.parsing.end=N.buffering.end=self.performance.now(),j.frag===K&&U.trigger(g.Events.FRAG_BUFFERED,{stats:N,frag:K,part:null,id:O.type}),P.tick()}).catch(function(j){P.warn(j),P.resetFragmentLoading(O)})},p.fragContextChanged=function(O){var P=this.fragCurrent;return!O||!P||O.level!==P.level||O.sn!==P.sn||O.urlId!==P.urlId},p.fragBufferedComplete=function(O,P){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+O.type+" sn: "+O.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level+" "+l.default.toString(E.BufferHelper.getBuffered(j))),this.state=v.IDLE,this.tick()},p._handleFragmentLoadComplete=function(O){var P=this.transmuxer;if(!P)return;var j=O.frag,K=O.part,U=O.partsLoaded,X=!U||U.length===0||U.some(function(N){return!N}),B=new o.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,K?K.index:-1,!X);P.flush(B)},p._handleFragmentLoadProgress=function(O){},p._doFragLoad=function(O,P,j,K){var U=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(O.start,j||0),this.config.lowLatencyMode&&P){var X=P.partList;if(X&&K){j>O.end&&P.fragmentHint&&(O=P.fragmentHint);var B=this.getNextPart(X,O,j);if(B>-1){var N=X[B];return this.log("Loading part sn: "+O.sn+" p: "+N.index+" cc: "+O.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+B+"-"+(X.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=N.start+N.duration,this.state=v.FRAG_LOADING,this.hls.trigger(g.Events.FRAG_LOADING,{frag:O,part:X[B],targetBufferTime:j}),this.doFragPartsLoad(O,X,B,K).catch(function(z){return U.handleFragLoadError(z)})}else if(!O.url||this.loadedEndOfParts(X,j))return Promise.resolve(null)}}return this.log("Loading fragment "+O.sn+" cc: "+O.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(j.toFixed(3))),Object(k.isFiniteNumber)(O.sn)&&!this.bitrateTest&&(this.nextLoadPosition=O.start+O.duration),this.state=v.FRAG_LOADING,this.hls.trigger(g.Events.FRAG_LOADING,{frag:O,targetBufferTime:j}),this.fragmentLoader.load(O,K).catch(function(z){return U.handleFragLoadError(z)})},p.doFragPartsLoad=function(O,P,j,K){var U=this;return new Promise(function(X,B){var N=[],z=function te(ce){var be=P[ce];U.fragmentLoader.loadPart(O,be,K).then(function(Fe){N[be.index]=Fe;var Oe=Fe.part;U.hls.trigger(g.Events.FRAG_LOADED,Fe);var Re=P[ce+1];if(Re&&Re.fragment===O)te(ce+1);else return X({frag:O,part:Oe,partsLoaded:N})}).catch(B)};z(j)})},p.handleFragLoadError=function(O){var P=O.data;return P&&P.details===h.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(g.Events.ERROR,P),null},p._handleTransmuxerFlush=function(O){var P=this.getCurrentContext(O);if(!P||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var j=P.frag,K=P.part,U=P.level,X=self.performance.now();j.stats.parsing.end=X,K&&(K.stats.parsing.end=X),this.updateLevelTiming(j,K,U,O.partial)},p.getCurrentContext=function(O){var P=this.levels,j=O.level,K=O.sn,U=O.part;if(!P||!P[j])return this.warn("Levels object was unset while buffering fragment "+K+" of level "+j+". The current chunk will not be buffered."),null;var X=P[j],B=U>-1?Object(t.getPartWith)(X,K,U):null,N=B?B.fragment:Object(t.getFragmentWithSN)(X,K,this.fragCurrent);return N?{frag:N,part:B,level:X}:null},p.bufferFragmentData=function(O,P,j,K){if(!O||this.state!==v.PARSING)return;var U=O.data1,X=O.data2,B=U;if(U&&X&&(B=Object(u.appendUint8Array)(U,X)),!B||!B.length)return;var N={type:O.type,frag:P,part:j,chunkMeta:K,parent:P.type,data:B};this.hls.trigger(g.Events.BUFFER_APPENDING,N),O.dropped&&O.independent&&!j&&this.flushBufferGap(P)},p.flushBufferGap=function(O){var P=this.media;if(!P)return;if(!E.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,O.start);return}var j=P.currentTime,K=E.BufferHelper.bufferInfo(P,j,0),U=O.duration,X=Math.min(this.config.maxFragLookUpTolerance*2,U*.25),B=Math.max(Math.min(O.start-X,K.end-X),j+X);O.start-B>X&&this.flushMainBuffer(B,O.start)},p.getFwdBufferInfo=function(O,P){var j=this.config,K=this.getLoadPosition();if(!Object(k.isFiniteNumber)(K))return null;var U=E.BufferHelper.bufferInfo(O,K,j.maxBufferHole);if(U.len===0&&U.nextStart!==void 0){var X=this.fragmentTracker.getBufferedFrag(K,P);if(X&&U.nextStart=j?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(O,P){var j,K,U=P.fragments,X=U.length;if(!X)return null;var B=this.config,N=U[0].start,z;if(P.live){var te=B.initialLiveManifestSize;if(X-1&&jj.start&&j.loaded},p.getInitialLiveFragment=function(O,P){var j=this.fragPrevious,K=null;if(j){if(O.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),K=Object(n.findFragmentByPDT)(P,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!K){var U=j.sn+1;if(U>=O.startSN&&U<=O.endSN){var X=P[U-O.startSN];j.cc===X.cc&&(K=X,this.log("Live playlist, switching playlist, load frag with next SN: "+K.sn))}K||(K=Object(n.findFragWithCC)(P,j.cc),K&&this.log("Live playlist, switching playlist, load frag with same CC: "+K.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(K=this.getFragmentAtPosition(B,this.bitrateTest?O.fragmentEnd:O.edge,O))}return K},p.getFragmentAtPosition=function(O,P,j){var K=this.config,U=this.fragPrevious,X=j.fragments,B=j.endSN,N=j.fragmentHint,z=K.maxFragLookUpTolerance,te=!!(K.lowLatencyMode&&j.partList&&N);te&&N&&!this.bitrateTest&&(X=X.concat(N),B=N.sn);var ce;if(OP-z?0:z;ce=Object(n.findFragmentByPTS)(U,X,O,be)}else ce=X[X.length-1];if(ce){var Fe=ce.sn-j.startSN,Oe=U&&ce.level===U.level,Re=X[Fe+1],Be=this.fragmentTracker.getState(ce);if(Be===f.FragmentState.BACKTRACKED){ce=null;for(var Ke=Fe;X[Ke]&&this.fragmentTracker.getState(X[Ke])===f.FragmentState.BACKTRACKED;)U?ce=X[Ke--]:ce=X[--Ke];ce||(ce=Re)}else U&&ce.sn===U.sn&&!te&&(Oe&&(ce.sn=X-P.maxFragLookUpTolerance&&U<=B;if(K!==null&&j.duration>K&&(U"+O.startSN+" prev-sn: "+(U?U.sn:"na")+" fragments: "+B),ce}return N},p.waitForCdnTuneIn=function(O){var P=3;return O.live&&O.canBlockReload&&O.tuneInGoal>Math.max(O.partHoldBack,O.partTarget*P)},p.setStartPosition=function(O,P){var j=this.startPosition;if(j"+O))}}]),A}(M.default)},"./src/controller/buffer-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n});var k=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),f=I("./src/utils/logger.ts"),E=I("./src/errors.ts"),x=I("./src/utils/buffer-helper.ts"),g=I("./src/utils/mediasource-helper.ts"),h=I("./src/loader/fragment.ts"),o=I("./src/controller/buffer-operation-queue.ts"),u=Object(g.getMediaSource)(),r=/([ha]vc.)(?:\.[^.,]+)+/,n=function(){function t(s){var l=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var c=l.hls,d=l.media,w=l.mediaSource;f.logger.log("[buffer-controller]: Media source opened"),d&&(l.updateMediaElementDuration(),c.trigger(M.Events.MEDIA_ATTACHED,{media:d})),w&&w.removeEventListener("sourceopen",l._onMediaSourceOpen),l.checkPendingTracks()},this._onMediaSourceClose=function(){f.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){f.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var i=t.prototype;return i.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},i.destroy=function(){this.unregisterListeners(),this.details=null},i.registerListeners=function(){var l=this.hls;l.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(M.Events.BUFFER_RESET,this.onBufferReset,this),l.on(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(M.Events.BUFFER_EOS,this.onBufferEos,this),l.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.on(M.Events.FRAG_PARSED,this.onFragParsed,this),l.on(M.Events.FRAG_CHANGED,this.onFragChanged,this)},i.unregisterListeners=function(){var l=this.hls;l.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(M.Events.BUFFER_RESET,this.onBufferReset,this),l.off(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(M.Events.BUFFER_EOS,this.onBufferEos,this),l.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.off(M.Events.FRAG_PARSED,this.onFragParsed,this),l.off(M.Events.FRAG_CHANGED,this.onFragChanged,this)},i._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new o.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},i.onManifestParsed=function(l,c){var d=2;(c.audio&&!c.video||!c.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,f.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},i.onMediaAttaching=function(l,c){var d=this.media=c.media;if(d&&u){var w=this.mediaSource=new u;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(w),this._objectUrl=d.src}},i.onMediaDetaching=function(){var l=this.media,c=this.mediaSource,d=this._objectUrl;if(c){if(f.logger.log("[buffer-controller]: media source detaching"),c.readyState==="open")try{c.endOfStream()}catch(w){f.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),c.removeEventListener("sourceopen",this._onMediaSourceOpen),c.removeEventListener("sourceended",this._onMediaSourceEnded),c.removeEventListener("sourceclose",this._onMediaSourceClose),l&&(d&&self.URL.revokeObjectURL(d),l.src===d?(l.removeAttribute("src"),l.load()):f.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(M.Events.MEDIA_DETACHED,void 0)},i.onBufferReset=function(){var l=this;this.getSourceBufferTypes().forEach(function(c){var d=l.sourceBuffer[c];try{d&&(l.removeBufferListeners(c),l.mediaSource&&l.mediaSource.removeSourceBuffer(d),l.sourceBuffer[c]=void 0)}catch(w){f.logger.warn("[buffer-controller]: Failed to reset the "+c+" buffer",w)}}),this._initSourceBuffer()},i.onBufferCodecs=function(l,c){var d=this,w=this.getSourceBufferTypes().length;if(Object.keys(c).forEach(function(m){if(w){var S=d.tracks[m];if(S&&typeof S.buffer.changeType=="function"){var C=c[m],v=C.codec,y=C.levelCodec,T=C.container,A=(S.levelCodec||S.codec).replace(r,"$1"),p=(y||v).replace(r,"$1");if(A!==p){var D=T+";codecs="+(y||v);d.appendChangeType(m,D)}}}else d.pendingTracks[m]=c[m]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},i.appendChangeType=function(l,c){var d=this,w=this.operationQueue,m={execute:function(){var C=d.sourceBuffer[l];C&&(f.logger.log("[buffer-controller]: changing "+l+" sourceBuffer type to "+c),C.changeType(c)),w.shiftAndExecuteNext(l)},onStart:function(){},onComplete:function(){},onError:function(C){f.logger.warn("[buffer-controller]: Failed to change "+l+" SourceBuffer type",C)}};w.append(m,l)},i.onBufferAppending=function(l,c){var d=this,w=this.hls,m=this.operationQueue,S=this.tracks,C=c.data,v=c.type,y=c.frag,T=c.part,A=c.chunkMeta,p=A.buffering[v],D=self.performance.now();p.start=D;var O=y.stats.buffering,P=T?T.stats.buffering:null;O.start===0&&(O.start=D),P&&P.start===0&&(P.start=D);var j=S.audio,K=v==="audio"&&A.id===1&&(j==null?void 0:j.container)==="audio/mpeg",U={execute:function(){if(p.executeStart=self.performance.now(),K){var B=d.sourceBuffer[v];if(B){var N=y.start-B.timestampOffset;Math.abs(N)>=.1&&(f.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+N+") sn: "+y.sn+")"),B.timestampOffset=y.start)}}d.appendExecutor(C,v)},onStart:function(){},onComplete:function(){var B=self.performance.now();p.executeEnd=p.end=B,O.first===0&&(O.first=B),P&&P.first===0&&(P.first=B);var N=d.sourceBuffer,z={};for(var te in N)z[te]=x.BufferHelper.getBuffered(N[te]);d.appendError=0,d.hls.trigger(M.Events.BUFFER_APPENDED,{type:v,frag:y,part:T,chunkMeta:A,parent:y.type,timeRanges:z})},onError:function(B){f.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",B);var N={type:E.ErrorTypes.MEDIA_ERROR,parent:y.type,details:E.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?N.details=E.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,N.details=E.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>w.config.appendErrorMaxRetry&&(f.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),N.fatal=!0)),w.trigger(M.Events.ERROR,N)}};m.append(U,v)},i.onBufferFlushing=function(l,c){var d=this,w=this.operationQueue,m=function(C){return{execute:d.removeExecutor.bind(d,C,c.startOffset,c.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(M.Events.BUFFER_FLUSHED,{type:C})},onError:function(y){f.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",y)}}};c.type?w.append(m(c.type),c.type):this.getSourceBufferTypes().forEach(function(S){w.append(m(S),S)})},i.onFragParsed=function(l,c){var d=this,w=c.frag,m=c.part,S=[],C=m?m.elementaryStreams:w.elementaryStreams;C[h.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(C[h.ElementaryStreamTypes.AUDIO]&&S.push("audio"),C[h.ElementaryStreamTypes.VIDEO]&&S.push("video"));var v=function(){var T=self.performance.now();w.stats.buffering.end=T,m&&(m.stats.buffering.end=T);var A=m?m.stats:w.stats;d.hls.trigger(M.Events.FRAG_BUFFERED,{frag:w,part:m,stats:A,id:w.type})};S.length===0&&f.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(v,S)},i.onFragChanged=function(l,c){this.flushBackBuffer()},i.onBufferEos=function(l,c){var d=this,w=this.getSourceBufferTypes().reduce(function(m,S){var C=d.sourceBuffer[S];return(!c.type||c.type===S)&&(C&&!C.ended&&(C.ended=!0,f.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),m&&!!(!C||C.ended)},!0);w&&this.blockBuffers(function(){var m=d.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},i.onLevelUpdated=function(l,c){var d=c.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},i.flushBackBuffer=function(){var l=this.hls,c=this.details,d=this.media,w=this.sourceBuffer;if(!d||c===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var S=c.live&&l.config.liveBackBufferLength!==null?l.config.liveBackBufferLength:l.config.backBufferLength;if(!Object(k.isFiniteNumber)(S)||S<0)return;var C=d.currentTime,v=c.levelTargetDuration,y=Math.max(S,v),T=Math.floor(C/v)*v-y;m.forEach(function(A){var p=w[A];if(p){var D=x.BufferHelper.getBuffered(p);D.length>0&&T>D.start(0)&&(l.trigger(M.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),c.live&&l.trigger(M.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),l.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:A}))}})},i.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var l=this.details,c=this.hls,d=this.media,w=this.mediaSource,m=l.fragments[0].start+l.totalduration,S=d.duration,C=Object(k.isFiniteNumber)(w.duration)?w.duration:0;l.live&&c.config.liveDurationInfinity?(f.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(l)):(m>C&&m>S||!Object(k.isFiniteNumber)(S))&&(f.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),w.duration=m)},i.updateSeekableRange=function(l){var c=this.mediaSource,d=l.fragments,w=d.length;if(w&&l.live&&c!==null&&c!==void 0&&c.setLiveSeekableRange){var m=Math.max(0,d[0].start),S=Math.max(m,m+l.totalduration);c.setLiveSeekableRange(m,S)}},i.checkPendingTracks=function(){var l=this.bufferCodecEventsExpected,c=this.operationQueue,d=this.pendingTracks,w=Object.keys(d).length;if(w&&!l||w===2){this.createSourceBuffers(d),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(S){c.executeNext(S)})}},i.createSourceBuffers=function(l){var c=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var m in l)if(!c[m]){var S=l[m];if(!S)throw Error("source buffer exists for track "+m+", however track does not");var C=S.levelCodec||S.codec,v=S.container+";codecs="+C;f.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var y=c[m]=d.addSourceBuffer(v),T=m;this.addBufferListener(T,"updatestart",this._onSBUpdateStart),this.addBufferListener(T,"updateend",this._onSBUpdateEnd),this.addBufferListener(T,"error",this._onSBUpdateError),this.tracks[m]={buffer:y,codec:C,container:S.container,levelCodec:S.levelCodec,id:S.id},w++}catch(A){f.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+A.message),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:A,mimeType:v})}}w&&this.hls.trigger(M.Events.BUFFER_CREATED,{tracks:this.tracks})},i._onSBUpdateStart=function(l){var c=this.operationQueue,d=c.current(l);d.onStart()},i._onSBUpdateEnd=function(l){var c=this.operationQueue,d=c.current(l);d.onComplete(),c.shiftAndExecuteNext(l)},i._onSBUpdateError=function(l,c){f.logger.error("[buffer-controller]: "+l+" SourceBuffer error",c),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(l);d&&d.onError(c)},i.removeExecutor=function(l,c,d){var w=this.media,m=this.mediaSource,S=this.operationQueue,C=this.sourceBuffer,v=C[l];if(!w||!m||!v){f.logger.warn("[buffer-controller]: Attempting to remove from the "+l+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(l);return}var y=Object(k.isFiniteNumber)(w.duration)?w.duration:Infinity,T=Object(k.isFiniteNumber)(m.duration)?m.duration:Infinity,A=Math.max(0,c),p=Math.min(d,y,T);p>A?(f.logger.log("[buffer-controller]: Removing ["+A+","+p+"] from the "+l+" SourceBuffer"),console.assert(!v.updating,l+" sourceBuffer must not be updating"),v.remove(A,p)):S.shiftAndExecuteNext(l)},i.appendExecutor=function(l,c){var d=this.operationQueue,w=this.sourceBuffer,m=w[c];if(!m){f.logger.warn("[buffer-controller]: Attempting to append to the "+c+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(c);return}m.ended=!1,console.assert(!m.updating,c+" sourceBuffer must not be updating"),m.appendBuffer(l)},i.blockBuffers=function(l,c){var d=this;if(c===void 0&&(c=this.getSourceBufferTypes()),!c.length){f.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(l);return}var w=this.operationQueue,m=c.map(function(S){return w.appendBlocker(S)});Promise.all(m).then(function(){l(),c.forEach(function(S){var C=d.sourceBuffer[S];(!C||!C.updating)&&w.shiftAndExecuteNext(S)})})},i.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},i.addBufferListener=function(l,c,d){var w=this.sourceBuffer[l];if(!w)return;var m=d.bind(this,l);this.listeners[l].push({event:c,listener:m}),w.addEventListener(c,m)},i.removeBufferListeners=function(l){var c=this.sourceBuffer[l];if(!c)return;this.listeners[l].forEach(function(d){c.removeEventListener(d.event,d.listener)})},t}()},"./src/controller/buffer-operation-queue.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return M});var k=I("./src/utils/logger.ts"),M=function(){function f(x){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=x}var E=f.prototype;return E.append=function(g,h){var o=this.queues[h];o.push(g),o.length===1&&this.buffers[h]&&this.executeNext(h)},E.insertAbort=function(g,h){var o=this.queues[h];o.unshift(g),this.executeNext(h)},E.appendBlocker=function(g){var h,o=new Promise(function(r){h=r}),u={execute:h,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(u,g),o},E.executeNext=function(g){var h=this.buffers,o=this.queues,u=h[g],r=o[g];if(r.length){var n=r[0];try{n.execute()}catch(t){k.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(t),(!u||!u.updating)&&(r.shift(),this.executeNext(g))}}},E.shiftAndExecuteNext=function(g){this.queues[g].shift(),this.executeNext(g)},E.current=function(g){return this.queues[g][0]},f}()},"./src/controller/cap-level-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts");function M(x,g){for(var h=0;h0&&this.mediaWidth>0){var o=this.hls.levels;if(o.length){var u=this.hls;u.autoLevelCapping=this.getMaxLevel(o.length-1),u.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=u.autoLevelCapping}}},g.getMaxLevel=function(o){var u=this,r=this.hls.levels;if(!r.length)return-1;var n=r.filter(function(t,i){return x.isLevelAllowed(i,u.restrictedLevels)&&i<=o});return this.clientRect=null,x.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},g.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()},g.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},g.getDimensions=function(){if(this.clientRect)return this.clientRect;var o=this.media,u={width:0,height:0};if(o){var r=o.getBoundingClientRect();u.width=r.width,u.height=r.height,!u.width&&!u.height&&(u.width=r.right-r.left||o.width||0,u.height=r.bottom-r.top||o.height||0)}return this.clientRect=u,u},x.isLevelAllowed=function(o,u){return u===void 0&&(u=[]),u.indexOf(o)===-1},x.getMaxLevelByMediaSize=function(o,u,r){if(!o||!o.length)return-1;for(var n=function(c,d){return d?c.width!==d.width||c.height!==d.height:!0},t=o.length-1,i=0;i=u||s.height>=r)&&n(s,o[i+1])){t=i;break}}return t},f(x,[{key:"mediaWidth",get:function(){return this.getDimensions().width*x.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*x.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var o=1;try{o=self.devicePixelRatio}catch(u){}return o}}]),x}();L.default=E},"./src/controller/cmcd-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n});var k=I("./src/events.ts"),M=I("./src/types/cmcd.ts"),f=I("./src/utils/buffer-helper.ts"),E=I("./src/utils/logger.ts");function x(t,i){for(var s=0;s=t.length?{done:!0}:{done:!1,value:t[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(t,i){if(!t)return;if(typeof t=="string")return u(t,i);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return u(t,i)}function u(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=new Array(i);sc&&(c=S.bitrate)}return c>0?c:NaN},i.getBufferLength=function(l){var c=this.hls.media,d=l===M.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!c)return NaN;var w=f.BufferHelper.bufferInfo(d,c.currentTime,this.config.maxBufferHole);return w.len*1e3},i.createPlaylistLoader=function(){var l=this.config.pLoader,c=this.applyPlaylistData,d=l||this.config.loader;return function(){function w(S){this.loader=void 0,this.loader=new d(S)}var m=w.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,v,y){c(C),this.loader.load(C,v,y)},g(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},i.createFragmentLoader=function(){var l=this.config.fLoader,c=this.applyFragmentData,d=l||this.config.loader;return function(){function w(S){this.loader=void 0,this.loader=new d(S)}var m=w.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,v,y){c(C),this.loader.load(C,v,y)},g(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},t.uuid=function(){var l=URL.createObjectURL(new Blob),c=l.toString();return URL.revokeObjectURL(l),c.substr(c.lastIndexOf("/")+1)},t.serialize=function(l){for(var c=[],d=function(K){return!Number.isNaN(K)&&K!=null&&K!==""&&K!==!1},w=function(K){return Math.round(K)},m=function(K){return w(K/100)*100},S=function(K){return encodeURIComponent(K)},C={br:w,d:w,bl:m,dl:m,mtp:m,nor:S,rtp:m,tb:w},v=Object.keys(l||{}).sort(),y=h(v),T;!(T=y()).done;){var A=T.value,p=l[A];if(!d(p))continue;if(A==="v"&&p===1)continue;if(A=="pr"&&p===1)continue;var D=C[A];D&&(p=D(p));var O=typeof p,P=void 0;A==="ot"||A==="sf"||A==="st"?P=A+"="+p:O==="boolean"?P=A:O==="number"?P=A+"="+p:P=A+"="+JSON.stringify(p),c.push(P)}return c.join(",")},t.toHeaders=function(l){for(var c=Object.keys(l),d={},w=["Object","Request","Session","Status"],m=[{},{},{},{}],S={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},C=0,v=c;Ch){this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=h-this._requestLicenseFailureCount+1;f.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(c,d)}break}},t._generateLicenseRequestChallenge=function(s,l){switch(s.mediaKeySystemDomain){case E.KeySystems.WIDEVINE:return l}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},t._requestLicense=function(s,l){f.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){f.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(c.mediaKeySystemDomain),w=this._createLicenseXhr(d,s,l);f.logger.log("Sending license request to URL: "+d);var m=this._generateLicenseRequestChallenge(c,s);w.send(m)}catch(S){f.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},t.onMediaAttached=function(s,l){if(!this._emeEnabled)return;var c=l.media;this._media=c,c.addEventListener("encrypted",this._onMediaEncrypted)},t.onMediaDetached=function(){var s=this._media,l=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(l.map(function(c){if(c.mediaKeysSession)return c.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},t.onManifestParsed=function(s,l){if(!this._emeEnabled)return;var c=l.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),d=l.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(E.KeySystems.WIDEVINE,c,d)},g(n,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),n}();L.default=r},"./src/controller/fps-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts"),M=I("./src/utils/logger.ts"),f=function(){function E(g){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=g,this.registerListeners()}var x=E.prototype;return x.setStreamController=function(h){this.streamController=h},x.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},x.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching)},x.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},x.onMediaAttaching=function(h,o){var u=this.hls.config;if(u.capLevelOnFPSDrop){var r=o.media instanceof self.HTMLVideoElement?o.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),u.fpsDroppedMonitoringPeriod)}},x.checkFPS=function(h,o,u){var r=performance.now();if(o){if(this.lastTime){var n=r-this.lastTime,t=u-this.lastDroppedFrames,i=o-this.lastDecodedFrames,s=1e3*t/n,l=this.hls;if(l.trigger(k.Events.FPS_DROP,{currentDropped:t,currentDecoded:i,totalDroppedFrames:u}),s>0&&t>l.config.fpsDroppedMonitoringThreshold*i){var c=l.currentLevel;M.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=c)&&(c=c-1,l.trigger(k.Events.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=u,this.lastDecodedFrames=o}},x.checkFPSInterval=function(){var h=this.media;if(h)if(this.isVideoPlaybackQualityAvailable){var o=h.getVideoPlaybackQuality();this.checkFPS(h,o.totalVideoFrames,o.droppedVideoFrames)}else this.checkFPS(h,h.webkitDecodedFrameCount,h.webkitDroppedFrameCount)},E}();L.default=f},"./src/controller/fragment-finders.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"findFragmentByPDT",function(){return f}),I.d(L,"findFragmentByPTS",function(){return E}),I.d(L,"fragmentWithinToleranceTest",function(){return x}),I.d(L,"pdtWithinToleranceTest",function(){return g}),I.d(L,"findFragWithCC",function(){return h});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/binary-search.ts");function f(o,u,r){if(u===null||!Array.isArray(o)||!o.length||!Object(k.isFiniteNumber)(u))return null;var n=o[0].programDateTime;if(u<(n||0))return null;var t=o[o.length-1].endProgramDateTime;if(u>=(t||0))return null;r=r||0;for(var i=0;io&&r.start?-1:0}function g(o,u,r){var n=Math.min(u,r.duration+(r.deltaPTS?r.deltaPTS:0))*1e3,t=r.endProgramDateTime||0;return t-n>o}function h(o,u){return M.default.search(o,function(r){return r.ccu?-1:0})}},"./src/controller/fragment-tracker.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"FragmentState",function(){return f}),I.d(L,"FragmentTracker",function(){return E});var k=I("./src/events.ts"),M=I("./src/types/loader.ts"),f;(function(h){h.NOT_LOADED="NOT_LOADED",h.BACKTRACKED="BACKTRACKED",h.APPENDING="APPENDING",h.PARTIAL="PARTIAL",h.OK="OK"})(f||(f={}));var E=function(){function h(u){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=u,this._registerListeners()}var o=h.prototype;return o._registerListeners=function(){var r=this.hls;r.on(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),r.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.on(k.Events.FRAG_LOADED,this.onFragLoaded,this)},o._unregisterListeners=function(){var r=this.hls;r.off(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),r.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.off(k.Events.FRAG_LOADED,this.onFragLoaded,this)},o.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},o.getAppendedFrag=function(r,n){if(n===M.PlaylistLevelType.MAIN){var t=this.activeFragment,i=this.activeParts;if(!t)return null;if(i)for(var s=i.length;s--;){var l=i[s],c=l?l.end:t.appendedPTS;if(l.start<=r&&c!==void 0&&r<=c)return s>9&&(this.activeParts=i.slice(s-9)),l}else if(t.start<=r&&t.appendedPTS!==void 0&&r<=t.appendedPTS)return t}return this.getBufferedFrag(r,n)},o.getBufferedFrag=function(r,n){for(var t=this.fragments,i=Object.keys(t),s=i.length;s--;){var l=t[i[s]];if((l==null?void 0:l.body.type)===n&&l.buffered){var c=l.body;if(c.start<=r&&r<=c.end)return c}}return null},o.detectEvictedFragments=function(r,n,t){var i=this;Object.keys(this.fragments).forEach(function(s){var l=i.fragments[s];if(!l)return;if(!l.buffered){l.body.type===t&&i.removeFragment(l.body);return}var c=l.range[r];if(!c)return;c.time.some(function(d){var w=!i.isTimeBuffered(d.startPTS,d.endPTS,n);return w&&i.removeFragment(l.body),w})})},o.detectPartialFragments=function(r){var n=this,t=this.timeRanges,i=r.frag,s=r.part;if(!t||i.sn==="initSegment")return;var l=g(i),c=this.fragments[l];if(!c)return;Object.keys(t).forEach(function(d){var w=i.elementaryStreams[d];if(!w)return;var m=t[d],S=s!==null||w.partial===!0;c.range[d]=n.getBufferedTimes(i,s,S,m)}),c.backtrack=c.loaded=null,Object.keys(c.range).length?c.buffered=!0:this.removeFragment(c.body)},o.fragBuffered=function(r){var n=g(r),t=this.fragments[n];t&&(t.backtrack=t.loaded=null,t.buffered=!0)},o.getBufferedTimes=function(r,n,t,i){for(var s={time:[],partial:t},l=n?n.start:r.start,c=n?n.end:r.end,d=r.minEndPTS||c,w=r.maxStartPTS||l,m=0;m=S&&d<=C){s.time.push({startPTS:Math.max(l,i.start(m)),endPTS:Math.min(c,i.end(m))});break}else if(lS)s.partial=!0,s.time.push({startPTS:Math.max(l,i.start(m)),endPTS:Math.min(c,i.end(m))});else if(c<=S)break}return s},o.getPartialFragment=function(r){var n=null,t,i,s,l=0,c=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(w){var m=d[w];if(!m)return;x(m)&&(i=m.body.start-c,s=m.body.end+c,r>=i&&r<=s&&(t=Math.min(r-i,s-r),l<=t&&(n=m.body,l=t)))}),n},o.getState=function(r){var n=g(r),t=this.fragments[n];return t?t.buffered?x(t)?f.PARTIAL:f.OK:t.backtrack?f.BACKTRACKED:f.APPENDING:f.NOT_LOADED},o.backtrack=function(r,n){var t=g(r),i=this.fragments[t];if(!i||i.backtrack)return null;var s=i.backtrack=n||i.loaded;return i.loaded=null,s},o.getBacktrackData=function(r){var n=g(r),t=this.fragments[n];if(t){var i,s=t.backtrack;if(s!=null&&(i=s.payload)!==null&&i!==void 0&&i.byteLength)return s;this.removeFragment(r)}return null},o.isTimeBuffered=function(r,n,t){for(var i,s,l=0;l=i&&n<=s)return!0;if(n<=i)return!1}return!1},o.onFragLoaded=function(r,n){var t=n.frag,i=n.part;if(t.sn==="initSegment"||t.bitrateTest||i)return;var s=g(t);this.fragments[s]={body:t,loaded:n,backtrack:null,buffered:!1,range:Object.create(null)}},o.onBufferAppended=function(r,n){var t=this,i=n.frag,s=n.part,l=n.timeRanges;if(i.type===M.PlaylistLevelType.MAIN)if(this.activeFragment=i,s){var c=this.activeParts;c||(this.activeParts=c=[]),c.push(s)}else this.activeParts=null;this.timeRanges=l,Object.keys(l).forEach(function(d){var w=l[d];if(t.detectEvictedFragments(d,w),!s)for(var m=0;mr&&i.removeFragment(c)}})},o.removeFragment=function(r){var n=g(r);r.stats.loaded=0,r.clearElementaryStreamInfo(),delete this.fragments[n]},o.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},h}();function x(h){var o,u;return h.buffered&&(((o=h.range.video)===null||o===void 0?void 0:o.partial)||((u=h.range.audio)===null||u===void 0?void 0:u.partial))}function g(h){return h.type+"_"+h.level+"_"+h.urlId+"_"+h.sn}},"./src/controller/gap-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"STALL_MINIMUM_DURATION_MS",function(){return x}),I.d(L,"MAX_START_GAP_JUMP",function(){return g}),I.d(L,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return h}),I.d(L,"SKIP_BUFFER_RANGE_START",function(){return o}),I.d(L,"default",function(){return u});var k=I("./src/utils/buffer-helper.ts"),M=I("./src/errors.ts"),f=I("./src/events.ts"),E=I("./src/utils/logger.ts"),x=250,g=2,h=.1,o=.05,u=function(){function r(t,i,s,l){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=i,this.fragmentTracker=s,this.hls=l}var n=r.prototype;return n.destroy=function(){this.hls=this.fragmentTracker=this.media=null},n.poll=function(i){var s=this.config,l=this.media,c=this.stalled,d=l.currentTime,w=l.seeking,m=this.seeking&&!w,S=!this.seeking&&w;if(this.seeking=w,d!==i){if(this.moved=!0,c!==null){if(this.stallReported){var C=self.performance.now()-c;E.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(C)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||m)&&(this.stalled=null),l.paused||l.ended||l.playbackRate===0||!k.BufferHelper.getBuffered(l).length)return;var v=k.BufferHelper.bufferInfo(l,d,0),y=v.len>0,T=v.nextStart||0;if(!y&&!T)return;if(w){var A=v.len>g,p=!T||T-d>g&&!this.fragmentTracker.getPartialFragment(d);if(A||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var D,O=Math.max(T,v.start||0)-d,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=P==null||((D=P.details)===null||D===void 0)?void 0:D.live,K=j?P.details.targetduration*2:g;if(O>0&&O<=K){this._trySkipBufferHole(null);return}}var U=self.performance.now();if(c===null){this.stalled=U;return}var X=U-c;!w&&X>=x&&this._reportStall(v.len);var B=k.BufferHelper.bufferInfo(l,d,s.maxBufferHole);this._tryFixBufferStall(B,X)},n._tryFixBufferStall=function(i,s){var l=this.config,c=this.fragmentTracker,d=this.media,w=d.currentTime,m=c.getPartialFragment(w);if(m){var S=this._trySkipBufferHole(m);if(S)return}i.len>l.maxBufferHole&&s>l.highBufferWatchdogPeriod*1e3&&(E.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},n._reportStall=function(i){var s=this.hls,l=this.media,c=this.stallReported;c||(this.stallReported=!0,E.logger.warn("Playback stalling at @"+l.currentTime+" due to low buffer (buffer="+i+")"),s.trigger(f.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:i}))},n._trySkipBufferHole=function(i){for(var s=this.config,l=this.hls,c=this.media,d=c.currentTime,w=0,m=k.BufferHelper.getBuffered(c),S=0;S=w&&d.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,l)),C=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;r.playbackRate=Math.min(S,Math.max(1,C))}else r.playbackRate!==1&&r.playbackRate!==0&&(r.playbackRate=1)},o.estimateLiveEdge=function(){var r=this.levelDetails;return r===null?null:r.edge+r.age},o.computeLatency=function(){var r=this.estimateLiveEdge();return r===null?null:r-this.currentTime},x(h,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var r=this.config,n=this.levelDetails;return r.liveMaxLatencyDuration!==void 0?r.liveMaxLatencyDuration:n?r.liveMaxLatencyDurationCount*n.targetduration:0}},{key:"targetLatency",get:function(){var r=this.levelDetails;if(r===null)return null;var n=r.holdBack,t=r.partHoldBack,i=r.targetduration,s=this.config,l=s.liveSyncDuration,c=s.liveSyncDurationCount,d=s.lowLatencyMode,w=this.hls.userConfig,m=d&&t||n;(w.liveSyncDuration||w.liveSyncDurationCount||m===0)&&(m=l!==void 0?l:c*i);var S=i,C=1;return m+Math.min(this.stallCount*C,S)}},{key:"liveSyncPosition",get:function(){var r=this.estimateLiveEdge(),n=this.targetLatency,t=this.levelDetails;if(r===null||n===null||t===null)return null;var i=t.edge,s=r-n-this.edgeStalled,l=i-t.totalduration,c=i-(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.min(Math.max(l,s),c)}},{key:"drift",get:function(){var r=this.levelDetails;return r===null?1:r.drift}},{key:"edgeStalled",get:function(){var r=this.levelDetails;if(r===null)return 0;var n=(this.config.lowLatencyMode&&r.partTarget||r.targetduration)*3;return Math.max(r.age-n,0)}},{key:"forwardBufferLength",get:function(){var r=this.media,n=this.levelDetails;if(!r||!n)return 0;var t=r.buffered.length;return t?r.buffered.end(t-1):n.edge-this.currentTime}}]),h}()},"./src/controller/level-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return s});var k=I("./src/types/level.ts"),M=I("./src/events.ts"),f=I("./src/errors.ts"),E=I("./src/utils/codecs.ts"),x=I("./src/controller/level-helper.ts"),g=I("./src/controller/base-playlist-controller.ts"),h=I("./src/types/loader.ts");function o(){return o=Object.assign||function(l){for(var c=1;c0){T=C[0].bitrate,C.sort(function(X,B){return X.bitrate-B.bitrate}),this._levels=C;for(var j=0;jthis.hls.config.fragLoadingMaxRetry&&(A=S.frag.level)):A=S.frag.level}break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:C&&(C.deliveryDirectives&&(T=!1),A=C.level),y=!0;break;case f.ErrorDetails.REMUX_ALLOC_ERROR:A=S.level,y=!0;break}A!==void 0&&this.recoverLevel(S,A,y,T)},d.recoverLevel=function(m,S,C,v){var y=m.details,T=this._levels[S];if(T.loadError++,C){var A=this.retryLoadingOrFail(m);if(A)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var p=T.url.length;if(p>1&&T.loadError1){var v=(S.urlId+1)%C;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(y){y.urlId=v}),this.level=m}},d.onFragLoaded=function(m,S){var C=S.frag;if(C!==void 0&&C.type===h.PlaylistLevelType.MAIN){var v=this._levels[C.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},d.onLevelLoaded=function(m,S){var C,v=S.level,y=S.details,T=this._levels[v];if(!T){var A;this.warn("Invalid level index "+v),(A=S.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(y.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(v,S,T.details)):(C=S.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(y.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(m,S){var C=this.hls.levels[this.currentLevelIndex];if(!C)return;if(C.audioGroupIds){for(var v=-1,y=this.hls.audioTracks[S.id].groupId,T=0;T0){var v=C.urlId,y=C.url[v];if(m)try{y=m.addDirectives(y)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Attempt loading level index "+S+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+v+" "+y),this.clearTimer(),this.hls.trigger(M.Events.LEVEL_LOADING,{url:y,level:S,id:v,deliveryDirectives:m||null})}},d.removeLevel=function(m,S){var C=function(T,A){return A!==S},v=this._levels.filter(function(y,T){return T!==m?!0:y.url.length>1&&S!==void 0?(y.url=y.url.filter(C),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(C)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(C)),y.urlId=0,!0):!1}).map(function(y,T){var A=y.details;return A!=null&&A.fragments&&A.fragments.forEach(function(p){p.level=T}),y});this._levels=v,this.hls.trigger(M.Events.LEVELS_UPDATED,{levels:v})},r(c,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var S,C=this._levels;if(C.length===0)return;if(this.currentLevelIndex===m&&(S=C[m])!==null&&S!==void 0&&S.details)return;if(m<0||m>=C.length){var v=m<0;if(this.hls.trigger(M.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:v,reason:"invalid level idx"}),v)return;m=Math.min(m,C.length-1)}this.clearTimer();var y=this.currentLevelIndex,T=C[y],A=C[m];this.log("switching to level "+m+" from "+y),this.currentLevelIndex=m;var p=o({},A,{level:m,maxBitrate:A.maxBitrate,uri:A.uri,urlId:A.urlId});delete p._urlId,this.hls.trigger(M.Events.LEVEL_SWITCHING,p);var D=A.details;if(!D||D.live){var O=this.switchParams(A.uri,T==null?void 0:T.details);this.loadPlaylist(O)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),c}(g.default)},"./src/controller/level-helper.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"addGroupId",function(){return f}),I.d(L,"assignTrackIdsByGroup",function(){return E}),I.d(L,"updatePTS",function(){return x}),I.d(L,"updateFragPTSDTS",function(){return h}),I.d(L,"mergeDetails",function(){return o}),I.d(L,"mapPartIntersection",function(){return u}),I.d(L,"mapFragmentIntersection",function(){return r}),I.d(L,"adjustSliding",function(){return n}),I.d(L,"addSliding",function(){return t}),I.d(L,"computeReloadInterval",function(){return i}),I.d(L,"getFragmentWithSN",function(){return s}),I.d(L,"getPartWith",function(){return l});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts");function f(c,d,w){switch(d){case"audio":c.audioGroupIds||(c.audioGroupIds=[]),c.audioGroupIds.push(w);break;case"text":c.textGroupIds||(c.textGroupIds=[]),c.textGroupIds.push(w);break}}function E(c){var d={};c.forEach(function(w){var m=w.groupId||"";w.id=d[m]=d[m]||0,d[m]++})}function x(c,d,w){var m=c[d],S=c[w];g(m,S)}function g(c,d){var w=d.startPTS;if(Object(k.isFiniteNumber)(w)){var m=0,S;d.sn>c.sn?(m=w-c.start,S=c):(m=c.start-w,S=d),S.duration!==m&&(S.duration=m)}else if(d.sn>c.sn){var C=c.cc===d.cc;C&&c.minEndPTS?d.start=c.start+(c.minEndPTS-c.start):d.start=c.start+c.duration}else d.start=Math.max(c.start-d.duration,0)}function h(c,d,w,m,S,C){var v=m-w;v<=0&&(M.logger.warn("Fragment should have a positive duration",d),m=w+d.duration,C=S+d.duration);var y=w,T=m,A=d.startPTS,p=d.endPTS;if(Object(k.isFiniteNumber)(A)){var D=Math.abs(A-w);Object(k.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(D,d.deltaPTS):d.deltaPTS=D,y=Math.max(w,A),w=Math.min(w,A),S=Math.min(S,d.startDTS),T=Math.min(m,p),m=Math.max(m,p),C=Math.max(C,d.endDTS)}d.duration=m-w;var O=w-d.start;d.appendedPTS=m,d.start=d.startPTS=w,d.maxStartPTS=y,d.startDTS=S,d.endPTS=m,d.minEndPTS=T,d.endDTS=C;var P=d.sn;if(!c||Pc.endSN)return 0;var j,K=P-c.startSN,U=c.fragments;for(U[K]=d,j=K;j>0;j--)g(U[j],U[j-1]);for(j=K;j=0;S--){var C=m[S].initSegment;if(C){w=C;break}}c.fragmentHint&&delete c.fragmentHint.endPTS;var v=0,y;if(r(c,d,function(j,K){j.relurl&&(v=j.cc-K.cc),Object(k.isFiniteNumber)(j.startPTS)&&Object(k.isFiniteNumber)(j.endPTS)&&(K.start=K.startPTS=j.startPTS,K.startDTS=j.startDTS,K.appendedPTS=j.appendedPTS,K.maxStartPTS=j.maxStartPTS,K.endPTS=j.endPTS,K.endDTS=j.endDTS,K.minEndPTS=j.minEndPTS,K.duration=j.endPTS-j.startPTS,K.duration&&(y=K),d.PTSKnown=d.alignedSliding=!0),K.elementaryStreams=j.elementaryStreams,K.loader=j.loader,K.stats=j.stats,K.urlId=j.urlId,j.initSegment&&(K.initSegment=j.initSegment,w=j.initSegment)}),w){var T=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;T.forEach(function(j){var K;(!j.initSegment||j.initSegment.relurl===((K=w)===null||K===void 0?void 0:K.relurl))&&(j.initSegment=w)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(j){return!j}),d.deltaUpdateFailed)){M.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var A=d.skippedSegments;A--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var p=d.fragments;if(v){M.logger.warn("discontinuity sliding from playlist, take drift into account");for(var D=0;D=m.length)return;t(d,m[w].start)}function t(c,d){if(d){for(var w=c.fragments,m=c.skippedSegments;m0&&S0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+A.toFixed(3)),T=A),this.state=M.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=M.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_LEVEL:{var T,A=this.levels,p=this.level,D=A==null||((T=A[p])===null||T===void 0)?void 0:T.details;if(D&&(!D.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(D))break;this.state=M.State.IDLE;break}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var O,P=self.performance.now(),j=this.retryDate;(!j||P>=j||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=M.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var T,A,p=this.hls,D=this.levelLastLoaded,O=this.levels,P=this.media,j=p.config,K=p.nextLoadLevel;if(D===null||!P&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!O||!O[K])return;var U=O[K];this.level=p.nextLoadLevel=K;var X=U.details;if(!X||this.state===M.State.WAITING_LEVEL||X.live&&this.levelLastLoaded!==K){this.state=M.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,h.PlaylistLevelType.MAIN);if(B===null)return;var N=B.len,z=this.getMaxBufferLength(U.maxBitrate);if(N>=z)return;if(this._streamEnded(B,X)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(E.Events.BUFFER_EOS,te),this.state=M.State.ENDED;return}var ce=B.end,be=this.getNextFragment(ce,X);if(this.couldBacktrack&&!this.fragPrevious&&be&&be.sn!=="initSegment"){var Fe=be.sn-X.startSN;Fe>1&&(be=X.fragments[Fe-1],this.fragmentTracker.removeFragment(be))}if(be&&this.fragmentTracker.getState(be)===g.FragmentState.OK&&this.nextLoadPosition>ce){var Oe=this.audioOnly&&!this.altAudio?o.ElementaryStreamTypes.AUDIO:o.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,Oe,h.PlaylistLevelType.MAIN),be=this.getNextFragment(this.nextLoadPosition,X)}if(!be)return;be.initSegment&&!be.initSegment.data&&!this.bitrateTest&&(be=be.initSegment),((T=be.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((A=be.decryptdata)!==null&&A!==void 0&&A.key)?this.loadKey(be,X):this.loadFragment(be,X,ce)},v.loadFragment=function(T,A,p){var D,O=this.fragmentTracker.getState(T);if(this.fragCurrent=T,O===g.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(T);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else O=g.FragmentState.NOT_LOADED}O===g.FragmentState.NOT_LOADED||O===g.FragmentState.PARTIAL?T.sn==="initSegment"?this._loadInitSegment(T):this.bitrateTest?(T.bitrateTest=!0,this.log("Fragment "+T.sn+" of level "+T.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(T)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,T,A,p)):O===g.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((D=this.media)===null||D===void 0?void 0:D.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(T){var A=this.fragmentTracker.getAppendedFrag(T,h.PlaylistLevelType.MAIN);return A&&"fragment"in A?A.fragment:A},v.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,h.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var T=this.levels,A=this.media;if(A!=null&&A.readyState){var p,D=this.getAppendedFrag(A.currentTime);if(D&&D.start>1&&this.flushMainBuffer(0,D.start-1),!A.paused&&T){var O=this.hls.nextLoadLevel,P=T[O],j=this.fragLastKbps;j&&this.fragCurrent?p=this.fragCurrent.duration*P.maxBitrate/(1e3*j)+1:p=0}else p=0;var K=this.getBufferedFrag(A.currentTime+p);if(K){var U=this.followingBufferedFrag(K);if(U){this.abortCurrentFrag();var X=U.maxStartPTS?U.maxStartPTS:U.start,B=U.duration,N=Math.max(K.end,X+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(N,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var T=this.fragCurrent;this.fragCurrent=null,T!=null&&T.loader&&T.loader.abort(),this.state===M.State.KEY_LOADING&&(this.state=M.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(T,A){S.prototype.flushMainBuffer.call(this,T,A,this.altAudio?"video":null)},v.onMediaAttached=function(T,A){S.prototype.onMediaAttached.call(this,T,A);var p=A.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),p.addEventListener("playing",this.onvplaying),p.addEventListener("seeked",this.onvseeked),this.gapController=new n.default(this.config,p,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var T=this.media;T&&(T.removeEventListener("playing",this.onvplaying),T.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var T=this.media,A=T?T.currentTime:null;Object(k.isFiniteNumber)(A)&&this.log("Media seeked to "+A.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(E.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(T,A){var p=!1,D=!1,O;A.levels.forEach(function(P){O=P.audioCodec,O&&(O.indexOf("mp4a.40.2")!==-1&&(p=!0),O.indexOf("mp4a.40.5")!==-1&&(D=!0))}),this.audioCodecSwitch=p&&D&&!Object(f.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=A.levels,this.startFragRequested=!1},v.onLevelLoading=function(T,A){var p=this.levels;if(!p||this.state!==M.State.IDLE)return;var D=p[A.level];(!D.details||D.details.live&&this.levelLastLoaded!==A.level||this.waitForCdnTuneIn(D.details))&&(this.state=M.State.WAITING_LEVEL)},v.onLevelLoaded=function(T,A){var p,D=this.levels,O=A.level,P=A.details,j=P.totalduration;if(!D){this.warn("Levels were reset while loading level "+O);return}this.log("Level "+O+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+j);var K=this.fragCurrent;K&&(this.state===M.State.FRAG_LOADING||this.state===M.State.FRAG_LOADING_WAITING_RETRY)&&(K.level!==A.level&&K.loader&&(this.state=M.State.IDLE,K.loader.abort()));var U=D[O],X=0;if(P.live||(p=U.details)!==null&&p!==void 0&&p.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;X=this.alignPlaylists(P,U.details)}if(U.details=P,this.levelLastLoaded=O,this.hls.trigger(E.Events.LEVEL_UPDATED,{details:P,level:O}),this.state===M.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=M.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,X),this.tick()},v._handleFragmentLoadProgress=function(T){var A,p=T.frag,D=T.part,O=T.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+p.sn+" of level "+p.level+" will not be buffered");return}var j=P[p.level],K=j.details;if(!K){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var U=j.videoCodec,X=K.PTSKnown||!K.live,B=(A=p.initSegment)===null||A===void 0?void 0:A.data,N=this._getAudioCodec(j),z=this.transmuxer=this.transmuxer||new u.default(this.hls,h.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=D?D.index:-1,ce=te!==-1,be=new r.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,O.byteLength,te,ce),Fe=this.initPTS[p.cc];z.push(O,B,N,U,p,D,K.totalduration,X,be,Fe)},v.onAudioTrackSwitching=function(T,A){var p=this.altAudio,D=!!A.url,O=A.id;if(!D){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var P=this.fragCurrent;P!=null&&P.loader&&(this.log("Switching to main audio track, cancel main fragment load"),P.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;p&&j.trigger(E.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:O})}},v.onAudioTrackSwitched=function(T,A){var p=A.id,D=!!this.hls.audioTracks[p].url;if(D){var O=this.videoBuffer;O&&this.mediaBuffer!==O&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=O)}this.altAudio=D,this.tick()},v.onBufferCreated=function(T,A){var p=A.tracks,D,O,P=!1;for(var j in p){var K=p[j];if(K.id==="main"){if(O=j,D=K,j==="video"){var U=p[j];U&&(this.videoBuffer=U.buffer)}}else P=!0}P&&D?(this.log("Alternate track found, use "+O+".buffered to schedule main fragment loading"),this.mediaBuffer=D.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(T,A){var p=A.frag,D=A.part;if(p&&p.type!==h.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(p)){this.warn("Fragment "+p.sn+(D?" p: "+D.index:"")+" of level "+p.level+" finished buffering, but was aborted. state: "+this.state),this.state===M.State.PARSED&&(this.state=M.State.IDLE);return}var O=D?D.stats:p.stats;this.fragLastKbps=Math.round(8*O.total/(O.buffering.end-O.loading.first)),p.sn!=="initSegment"&&(this.fragPrevious=p),this.fragBufferedComplete(p,D)},v.onError=function(T,A){switch(A.details){case t.ErrorDetails.FRAG_LOAD_ERROR:case t.ErrorDetails.FRAG_LOAD_TIMEOUT:case t.ErrorDetails.KEY_LOAD_ERROR:case t.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(h.PlaylistLevelType.MAIN,A);break;case t.ErrorDetails.LEVEL_LOAD_ERROR:case t.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==M.State.ERROR&&(A.fatal?(this.warn(""+A.details),this.state=M.State.ERROR):!A.levelRetry&&this.state===M.State.WAITING_LEVEL&&(this.state=M.State.IDLE));break;case t.ErrorDetails.BUFFER_FULL_ERROR:if(A.parent==="main"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var p=!0,D=this.getFwdBufferInfo(this.media,h.PlaylistLevelType.MAIN);D&&D.len>.5&&(p=!this.reduceMaxBufferLength(D.len)),p&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},v.checkBuffer=function(){var T=this.media,A=this.gapController;if(!T||!A||!T.readyState)return;var p=x.BufferHelper.getBuffered(T);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):A.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=M.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(T,A){var p=A.type;if(p!==o.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var D=(p===o.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(D,p,h.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(T,A){this.levels=A.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var T=this.media,A=T.currentTime,p=this.startPosition;if(p>=0&&A0&&(P1&&T.seeking===!1){var p=T.currentTime;if(x.BufferHelper.isBuffered(T,p)?A=this.getAppendedFrag(p):x.BufferHelper.isBuffered(T,p+.1)&&(A=this.getAppendedFrag(p+.1)),A){var D=this.fragPlaying,O=A.level;(!D||A.sn!==D.sn||D.level!==O||A.urlId!==D.urlId)&&(this.hls.trigger(E.Events.FRAG_CHANGED,{frag:A}),(!D||D.level!==O)&&this.hls.trigger(E.Events.LEVEL_SWITCHED,{level:O}),this.fragPlaying=A)}}},l(C,[{key:"nextLevel",get:function(){var T=this.nextBufferedFrag;return T?T.level:-1}},{key:"currentLevel",get:function(){var T=this.media;if(T){var A=this.getAppendedFrag(T.currentTime);if(A)return A.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var A=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(A)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),C}(M.default)},"./src/controller/subtitle-stream-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"SubtitleStreamController",function(){return c});var k=I("./src/events.ts"),M=I("./src/utils/logger.ts"),f=I("./src/utils/buffer-helper.ts"),E=I("./src/controller/fragment-finders.ts"),x=I("./src/utils/discontinuities.ts"),g=I("./src/controller/level-helper.ts"),h=I("./src/controller/fragment-tracker.ts"),o=I("./src/controller/base-stream-controller.ts"),u=I("./src/types/loader.ts"),r=I("./src/types/level.ts");function n(d,w){for(var m=0;m=A[O].start&&D<=A[O].end){p=A[O];break}var P=y.start+y.duration;p?p.end=P:(p={start:D,end:P},A.push(p)),this.fragmentTracker.fragBuffered(y)},m.onBufferFlushing=function(C,v){var y=v.startOffset,T=v.endOffset;if(y===0&&T!==Number.POSITIVE_INFINITY){var A=this.currentTrackId,p=this.levels;if(!p.length||!p[A]||!p[A].details)return;var D=p[A].details,O=D.targetduration,P=T-O;if(P<=0)return;v.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(j){for(var K=0;K=D.length||A!==p||!O)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(y=O.details)!==null&&y!==void 0&&y.live){var P=this.mainDetails;if(T.deltaUpdateFailed||!P)return;var j=P.fragments[0];if(!O.details)T.hasProgramDateTime&&P.hasProgramDateTime?Object(x.alignMediaPlaylistByPDT)(T,P):j&&Object(g.addSliding)(T,j.start);else{var K=this.alignPlaylists(T,O.details);K===0&&j&&Object(g.addSliding)(T,j.start)}}if(O.details=T,this.levelLastLoaded=A,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===o.State.IDLE){var U=Object(E.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);U||(this.warn("Subtitle playlist not aligned with playback"),O.details=void 0)}},m._handleFragmentLoadComplete=function(C){var v=C.frag,y=C.payload,T=v.decryptdata,A=this.hls;if(this.fragContextChanged(v))return;if(y&&y.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var p=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),T.key.buffer,T.iv.buffer).then(function(D){var O=performance.now();A.trigger(k.Events.FRAG_DECRYPTED,{frag:v,payload:D,stats:{tstart:p,tdecrypt:O}})})}},m.doTick=function(){if(!this.media){this.state=o.State.IDLE;return}if(this.state===o.State.IDLE){var C,v=this.currentTrackId,y=this.levels;if(!y.length||!y[v]||!y[v].details)return;var T=y[v].details,A=T.targetduration,p=this.config,D=this.media,O=f.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,D.currentTime-A,p.maxBufferHole),P=O.end,j=O.len,K=this.getMaxBufferLength()+A;if(j>K)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var U=T.fragments,X=U.length,B=T.edge,N,z=this.fragPrevious;if(P-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)},i.pollTrackChange=function(l){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,l)},i.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var l=r(this.media.textTracks);l.forEach(function(c){Object(M.clearCurrentCues)(c)}),this.subtitleTrack=-1,this.media=null},i.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},i.onManifestParsed=function(l,c){this.tracks=c.subtitleTracks},i.onSubtitleTrackLoaded=function(l,c){var d=c.id,w=c.details,m=this.trackId,S=this.tracksInGroup[m];if(!S){this.warn("Invalid subtitle track id "+d);return}var C=S.details;S.details=c.details,this.log("subtitle track "+d+" loaded ["+w.startSN+"-"+w.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,c,C))},i.onLevelLoading=function(l,c){this.switchLevel(c.level)},i.onLevelSwitching=function(l,c){this.switchLevel(c.level)},i.switchLevel=function(l){var c=this.hls.levels[l];if(!(c!=null&&c.textGroupIds))return;var d=c.textGroupIds[c.urlId];if(this.groupId!==d){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(v){return!d||v.groupId===d});this.tracksInGroup=m;var S=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=d;var C={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(k.Events.SUBTITLE_TRACKS_UPDATED,C),S!==-1&&this.setSubtitleTrack(S,w)}},i.findTrackId=function(l){for(var c=this.tracksInGroup,d=0;d=w.length)return;this.clearTimer();var m=w[l];if(this.log("Switching to subtitle track "+l),this.trackId=l,m){var S=m.id,C=m.groupId,v=C===void 0?"":C,y=m.name,T=m.type,A=m.url;this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:v,name:y,type:T,url:A});var p=this.switchParams(m.url,c==null?void 0:c.details);this.loadPlaylist(p)}else this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:l})},i.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var l=-1,c=r(this.media.textTracks),d=0;d=0&&(T[0]=Math.min(T[0],w),T[1]=Math.max(T[1],m),v=!0,A/(m-w)>.5))return}if(v||C.push([w,m]),this.config.renderTextTracksNatively){var p=this.captionsTracks[d];this.Cues.newCue(p,w,m,S)}else{var D=this.Cues.newCue(null,w,m,S);this.hls.trigger(M.Events.CUES_PARSED,{type:"captions",cues:D,track:d})}},l.onInitPtsFound=function(d,w){var m=this,S=w.frag,C=w.id,v=w.initPTS,y=w.timescale,T=this.unparsedVttFrags;C==="main"&&(this.initPTS[S.cc]=v,this.timescale[S.cc]=y),T.length&&(this.unparsedVttFrags=[],T.forEach(function(A){m.onFragLoaded(M.Events.FRAG_LOADED,A)}))},l.getExistingTrack=function(d){var w=this.media;if(w)for(var m=0;m>>8^y&255^99,h[S]=y,o[y]=S;var T=m[S],A=m[T],p=m[A],D=m[y]*257^y*16843008;r[S]=D<<24|D>>>8,n[S]=D<<16|D>>>16,t[S]=D<<8|D>>>24,i[S]=D,D=p*16843009^A*65537^T*257^S*16843008,l[y]=D<<24|D>>>8,c[y]=D<<16|D>>>16,d[y]=D<<8|D>>>24,w[y]=D,S?(S=T^m[m[m[p^T]]],C^=m[m[C]]):S=C=1}},x.expandKey=function(h){for(var o=this.uint8ArrayToUint32Array_(h),u=!0,r=0;r>>6)+1;var D=(d[w+2]&60)>>>2;if(D>p.length-1){c.trigger(f.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+D});return}return v=(d[w+2]&1)<<2,v|=(d[w+3]&192)>>>6,k.logger.log("manifest codec:"+m+", ADTS type:"+S+", samplingIndex:"+D),/firefox/i.test(T)?D>=6?(S=5,y=new Array(4),C=D-3):(S=2,y=new Array(2),C=D):T.indexOf("android")!==-1?(S=2,y=new Array(2),C=D):(S=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&D>=6?C=D-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(D>=6&&v===1||/vivaldi/i.test(T))||!m&&v===1)&&(S=2,y=new Array(2)),C=D)),y[0]=S<<3,y[0]|=(D&14)>>1,y[1]|=(D&1)<<7,y[1]|=v<<3,S===5&&(y[1]|=(C&14)>>1,y[2]=(C&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:p[D],channelCount:v,codec:"mp4a.40."+S,manifestCodec:A}}function x(c,d){return c[d]===255&&(c[d+1]&246)===240}function g(c,d){return c[d+1]&1?7:9}function h(c,d){return(c[d+3]&3)<<11|c[d+4]<<3|(c[d+5]&224)>>>5}function o(c,d){return d+5=c.length)return!1;var m=h(c,d);if(m<=w)return!1;var S=d+m;return S===c.length||u(c,S)}return!1}function t(c,d,w,m,S){if(!c.samplerate){var C=E(d,w,m,S);if(!C)return;c.config=C.config,c.samplerate=C.samplerate,c.channelCount=C.channelCount,c.codec=C.codec,c.manifestCodec=C.manifestCodec,k.logger.log("parsed codec:"+c.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function i(c){return 1024*9e4/c}function s(c,d,w,m,S){var C=g(c,d),v=h(c,d);if(v-=C,v>0){var y=w+m*S;return{headerLength:C,frameLength:v,stamp:y}}}function l(c,d,w,m,S){var C=i(c.samplerate),v=s(d,w,m,S,C);if(v){var y=v.frameLength,T=v.headerLength,A=v.stamp,p=T+y,D=Math.max(0,w+p-d.length),O;D?(O=new Uint8Array(p-T),O.set(d.subarray(w+T,d.length),0)):O=d.subarray(w+T,w+p);var P={unit:O,pts:A};return D||c.samples.push(P),{sample:P,length:p,missing:D}}}},"./src/demux/base-audio-demuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"initPTSFn",function(){return h});var k=I("./src/polyfills/number.ts"),M=I("./src/demux/id3.ts"),f=I("./src/demux/dummy-demuxed-track.ts"),E=I("./src/utils/mp4-tools.ts"),x=I("./src/utils/typed-array.ts"),g=function(){function o(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var u=o.prototype;return u.resetInitSegment=function(n,t,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},u.resetTimeStamp=function(){},u.resetContiguity=function(){},u.canParse=function(n,t){return!1},u.appendFrame=function(n,t,i){},u.demux=function(n,t){this.cachedData&&(n=Object(E.appendUint8Array)(this.cachedData,n),this.cachedData=null);var i=M.getID3Data(n,0),s=i?i.length:0,l,c,d=this._audioTrack,w=this._id3Track,m=i?M.getTimeStamp(i):void 0,S=n.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=h(m,t)),i&&i.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:i}),c=this.initPTS;sg?(this.word<<=g,this.bitsAvailable-=g):(g-=this.bitsAvailable,h=g>>3,g-=h>>3,this.bytesAvailable-=h,this.loadWord(),this.word<<=g,this.bitsAvailable-=g)},E.readBits=function(g){var h=Math.min(this.bitsAvailable,g),o=this.word>>>32-h;return g>32&&k.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=h,this.bitsAvailable>0?this.word<<=h:this.bytesAvailable>0&&this.loadWord(),h=g-h,h>0&&this.bitsAvailable?o<>>g)!==0)return this.word<<=g,this.bitsAvailable-=g,g;return this.loadWord(),g+this.skipLZ()},E.skipUEG=function(){this.skipBits(1+this.skipLZ())},E.skipEG=function(){this.skipBits(1+this.skipLZ())},E.readUEG=function(){var g=this.skipLZ();return this.readBits(g+1)-1},E.readEG=function(){var g=this.readUEG();return 1&g?1+g>>>1:-1*(g>>>1)},E.readBoolean=function(){return this.readBits(1)===1},E.readUByte=function(){return this.readBits(8)},E.readUShort=function(){return this.readBits(16)},E.readUInt=function(){return this.readBits(32)},E.skipScalingList=function(g){for(var h=8,o=8,u,r=0;r0?S.subarray(v,v+y):void 0},E=function(S,C){var v=0;return v=(S[C]&127)<<21,v|=(S[C+1]&127)<<14,v|=(S[C+2]&127)<<7,v|=S[C+3]&127,v},x=function(S,C){return k(S,C)&&E(S,C+6)+10<=S.length-C},g=function(S){for(var C=u(S),v=0;v>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(p);break;case 12:case 13:D=S[j++],P+=String.fromCharCode((p&31)<<6|D&63);break;case 14:D=S[j++],O=S[j++],P+=String.fromCharCode((p&15)<<12|(D&63)<<6|(O&63)<<0);break;default:}}return P},c={decodeTextFrame:t},d;function w(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/demux/base-audio-demuxer.ts"),M=I("./src/demux/id3.ts"),f=I("./src/utils/logger.ts"),E=I("./src/demux/mpegaudio.ts");function x(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,g(o,u)}function g(o,u){return g=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},g(o,u)}var h=function(o){x(u,o);function u(){return o.apply(this,arguments)||this}var r=u.prototype;return r.resetInitSegment=function(t,i,s){o.prototype.resetInitSegment.call(this,t,i,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},u.probe=function(t){if(!t)return!1;for(var i=M.getID3Data(t,0)||[],s=i.length,l=t.length;s0},x.demux=function(h){var o=h,u=Object(M.dummyTrack)();if(this.config.progressive){this.remainderData&&(o=Object(k.appendUint8Array)(this.remainderData,h));var r=Object(k.segmentValidRange)(o);this.remainderData=r.remainder,u.samples=r.valid||new Uint8Array}else u.samples=o;return{audioTrack:Object(M.dummyTrack)(),avcTrack:u,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},x.flush=function(){var h=Object(M.dummyTrack)();return h.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(M.dummyTrack)(),avcTrack:h,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},x.demuxSampleAes=function(h,o,u){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},x.destroy=function(){},E}();f.minProbeByteLength=1024,L.default=f},"./src/demux/mpegaudio.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"appendFrame",function(){return g}),I.d(L,"parseHeader",function(){return h}),I.d(L,"isHeaderPattern",function(){return o}),I.d(L,"isHeader",function(){return u}),I.d(L,"canParse",function(){return r}),I.d(L,"probe",function(){return n});var k=null,M=[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],f=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],E=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],x=[0,1,1,4];function g(t,i,s,l,c){if(s+24>i.length)return;var d=h(i,s);if(d&&s+d.frameLength<=i.length){var w=d.samplesPerFrame*9e4/d.sampleRate,m=l+c*w,S={unit:i.subarray(s,s+d.frameLength),pts:m,dts:m};return t.config=[],t.channelCount=d.channelCount,t.samplerate=d.sampleRate,t.samples.push(S),{sample:S,length:d.frameLength,missing:0}}}function h(t,i){var s=t[i+1]>>3&3,l=t[i+1]>>1&3,c=t[i+2]>>4&15,d=t[i+2]>>2&3;if(s!==1&&c!==0&&c!==15&&d!==3){var w=t[i+2]>>1&1,m=t[i+3]>>6,S=s===3?3-l:l===3?3:4,C=M[S*14+c-1]*1e3,v=s===3?0:s===2?1:2,y=f[v*3+d],T=m===3?1:2,A=E[s][l],p=x[l],D=A*8*p,O=Math.floor(A*C/y+w)*p;if(k===null){var P=navigator.userAgent||"",j=P.match(/Chrome\/(\d+)/i);k=j?parseInt(j[1]):0}var K=!!k&&k<=87;return K&&l===2&&C>=224e3&&m===0&&(t[i+3]=t[i+3]|128),{sampleRate:y,channelCount:T,frameLength:O,samplesPerFrame:D}}}function o(t,i){return t[i]===255&&(t[i+1]&224)===224&&(t[i+1]&6)!==0}function u(t,i){return i+1=h.length){u();return}if(h[o].unit.length<32)continue;var r=this.decrypter.isSync();if(this.decryptAacSample(h,o,u,r),!r)return}},x.getAvcEncryptedData=function(h){for(var o=Math.floor((h.length-48)/160)*16+16,u=new Int8Array(o),r=0,n=32;n<=h.length-16;n+=160,r+=16)u.set(h.subarray(n,n+16),r);return u},x.getAvcDecryptedUnit=function(h,o){for(var u=new Uint8Array(o),r=0,n=32;n<=h.length-16;n+=160,r+=16)h.set(u.subarray(r,r+16),n);return h},x.decryptAvcSample=function(h,o,u,r,n,t){var i=Object(M.discardEPB)(n.data),s=this.getAvcEncryptedData(i),l=this;this.decryptBuffer(s.buffer,function(c){n.data=l.getAvcDecryptedUnit(i,c),t||l.decryptAvcSamples(h,o,u+1,r)})},x.decryptAvcSamples=function(h,o,u,r){if(h instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;o++,u=0){if(o>=h.length){r();return}for(var n=h[o].units;!(u>=n.length);u++){var t=n[u];if(t.data.length<=48||t.type!==1&&t.type!==5)continue;var i=this.decrypter.isSync();if(this.decryptAvcSample(h,o,u,r,t,i),!i)return}}},E}();L.default=f},"./src/demux/transmuxer-interface.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n});var k=I("./node_modules/webworkify-webpack/index.js"),M=I.n(k),f=I("./src/events.ts"),E=I("./src/demux/transmuxer.ts"),x=I("./src/utils/logger.ts"),g=I("./src/errors.ts"),h=I("./src/utils/mediasource-helper.ts"),o=I("./node_modules/eventemitter3/index.js"),u=I.n(o),r=Object(h.getMediaSource)()||{isTypeSupported:function(){return!1}},n=function(){function t(s,l,c,d){var w=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=s,this.id=l,this.onTransmuxComplete=c,this.onFlush=d;var m=s.config,S=function(A,p){p=p||{},p.frag=w.frag,p.id=w.id,s.trigger(A,p)};this.observer=new o.EventEmitter,this.observer.on(f.Events.FRAG_DECRYPTED,S),this.observer.on(f.Events.ERROR,S);var C={mp4:r.isTypeSupported("video/mp4"),mpeg:r.isTypeSupported("audio/mpeg"),mp3:r.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){x.logger.log("demuxing in webworker");var y;try{y=this.worker=k("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(T){s.trigger(f.Events.ERROR,{type:g.ErrorTypes.OTHER_ERROR,details:g.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},y.postMessage({cmd:"init",typeSupported:C,vendor:v,id:l,config:JSON.stringify(m)})}catch(T){x.logger.warn("Error in worker:",T),x.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new E.default(this.observer,C,m,v,l),this.worker=null}}else this.transmuxer=new E.default(this.observer,C,m,v,l)}var i=t.prototype;return i.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.terminate(),this.worker=null;else{var c=this.transmuxer;c&&(c.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},i.push=function(l,c,d,w,m,S,C,v,y,T){var A=this;y.transmuxing.start=self.performance.now();var p=this.transmuxer,D=this.worker,O=S?S.start:m.start,P=m.decryptdata,j=this.frag,K=!(j&&m.cc===j.cc),U=!(j&&y.level===j.level),X=j?y.sn-j.sn:-1,B=this.part?y.part-this.part.index:1,N=!U&&(X===1||X===0&&B===1),z=self.performance.now();(U||X||m.stats.parsing.start===0)&&(m.stats.parsing.start=z),S&&(B||!N)&&(S.stats.parsing.start=z);var te=new E.TransmuxState(K,N,v,U,O);if(!N||K){x.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+` discontinuity: `+K+` trackSwitch: `+U+` contiguous: `+N+` accurateTimeOffset: `+v+` timeOffset: `+O);var ce=new E.TransmuxConfig(d,w,c,C,T);this.configureTransmuxer(ce)}if(this.frag=m,this.part=S,D)D.postMessage({cmd:"demux",data:l,decryptdata:P,chunkMeta:y,state:te},l instanceof ArrayBuffer?[l]:[]);else if(p){var be=p.push(l,P,y,te);Object(E.isPromise)(be)?be.then(function(Fe){A.handleTransmuxComplete(Fe)}):this.handleTransmuxComplete(be)}},i.flush=function(l){var c=this;l.transmuxing.start=self.performance.now();var d=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:l});else if(d){var m=d.flush(l);Object(E.isPromise)(m)?m.then(function(S){c.handleFlushResult(S,l)}):this.handleFlushResult(m,l)}},i.handleFlushResult=function(l,c){var d=this;l.forEach(function(w){d.handleTransmuxComplete(w)}),this.onFlush(c)},i.onWorkerMessage=function(l){var c=l.data,d=this.hls;switch(c.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(c.data);break}case"flush":{this.onFlush(c.data);break}default:{c.data=c.data||{},c.data.frag=this.frag,c.data.id=this.id,d.trigger(c.event,c.data);break}}},i.configureTransmuxer=function(l){var c=this.worker,d=this.transmuxer;c?c.postMessage({cmd:"configure",config:l}):d&&d.configure(l)},i.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},t}()},"./src/demux/transmuxer-worker.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return g});var k=I("./src/demux/transmuxer.ts"),M=I("./src/events.ts"),f=I("./src/utils/logger.ts"),E=I("./node_modules/eventemitter3/index.js"),x=I.n(E);function g(n){var t=new E.EventEmitter,i=function(l,c){n.postMessage({event:l,data:c})};t.on(M.Events.FRAG_DECRYPTED,i),t.on(M.Events.ERROR,i),n.addEventListener("message",function(s){var l=s.data;switch(l.cmd){case"init":{var c=JSON.parse(l.config);n.transmuxer=new k.default(t,l.typeSupported,c,l.vendor,l.id),Object(f.enableLogs)(c.debug),i("init",null);break}case"configure":{n.transmuxer.configure(l.config);break}case"demux":{var d=n.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);Object(k.isPromise)(d)?d.then(function(S){h(n,S)}):h(n,d);break}case"flush":{var w=l.chunkMeta,m=n.transmuxer.flush(w);Object(k.isPromise)(m)?m.then(function(S){u(n,S,w)}):u(n,m,w);break}default:break}})}function h(n,t){if(r(t.remuxResult))return;var i=[],s=t.remuxResult,l=s.audio,c=s.video;l&&o(i,l),c&&o(i,c),n.postMessage({event:"transmuxComplete",data:t},i)}function o(n,t){t.data1&&n.push(t.data1.buffer),t.data2&&n.push(t.data2.buffer)}function u(n,t,i){t.forEach(function(s){h(n,s)}),n.postMessage({event:"flush",data:i})}function r(n){return!n.audio&&!n.video&&!n.text&&!n.id3&&!n.initSegment}},"./src/demux/transmuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return c}),I.d(L,"isPromise",function(){return m}),I.d(L,"TransmuxConfig",function(){return S}),I.d(L,"TransmuxState",function(){return C});var k=I("./src/events.ts"),M=I("./src/errors.ts"),f=I("./src/crypt/decrypter.ts"),E=I("./src/demux/aacdemuxer.ts"),x=I("./src/demux/mp4demuxer.ts"),g=I("./src/demux/tsdemuxer.ts"),h=I("./src/demux/mp3demuxer.ts"),o=I("./src/remux/mp4-remuxer.ts"),u=I("./src/remux/passthrough-remuxer.ts"),r=I("./src/demux/chunk-cache.ts"),n=I("./src/utils/mp4-tools.ts"),t=I("./src/utils/logger.ts"),i;try{i=self.performance.now.bind(self.performance)}catch(v){t.logger.debug("Unable to use Performance API on this environment"),i=self.Date.now}var s=[{demux:g.default,remux:o.default},{demux:x.default,remux:u.default},{demux:E.default,remux:o.default},{demux:h.default,remux:o.default}],l=1024;s.forEach(function(v){var y=v.demux;l=Math.max(l,y.minProbeByteLength)});var c=function(){function v(T,A,p,D,O){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 r.default,this.observer=T,this.typeSupported=A,this.config=p,this.vendor=D,this.id=O}var y=v.prototype;return y.configure=function(A){this.transmuxConfig=A,this.decrypter&&this.decrypter.reset()},y.push=function(A,p,D,O){var P=this,j=D.transmuxing;j.executeStart=i();var K=new Uint8Array(A),U=this.cache,X=this.config,B=this.currentTransmuxState,N=this.transmuxConfig;O&&(this.currentTransmuxState=O);var z=d(K,p);if(z&&z.method==="AES-128"){var te=this.getDecrypter();if(X.enableSoftwareAES){var ce=te.softwareDecrypt(K,z.key.buffer,z.iv.buffer);if(!ce)return j.executeEnd=i(),w(D);K=new Uint8Array(ce)}else return this.decryptionPromise=te.webCryptoDecrypt(K,z.key.buffer,z.iv.buffer).then(function(Ze){var Je=P.push(Ze,null,D);return P.decryptionPromise=null,Je}),this.decryptionPromise}var be=O||B,Fe=be.contiguous,Oe=be.discontinuity,Re=be.trackSwitch,Be=be.accurateTimeOffset,Ke=be.timeOffset,Ae=N.audioCodec,_e=N.videoCodec,le=N.defaultInitPts,Ee=N.duration,pe=N.initSegmentData;if((Oe||Re)&&this.resetInitSegment(pe,Ae,_e,Ee),Oe&&this.resetInitialTimestamp(le),Fe||this.resetContiguity(),this.needsProbing(K,Oe,Re)){if(U.dataLength){var Ge=U.flush();K=Object(n.appendUint8Array)(Ge,K)}this.configureTransmuxer(K,N)}var Ye=this.transmux(K,z,Ke,Be,D),ze=this.currentTransmuxState;return ze.contiguous=!0,ze.discontinuity=!1,ze.trackSwitch=!1,j.executeEnd=i(),Ye},y.flush=function(A){var p=this,D=A.transmuxing;D.executeStart=i();var O=this.decrypter,P=this.cache,j=this.currentTransmuxState,K=this.decryptionPromise;if(K)return K.then(function(){return p.flush(A)});var U=[],X=j.timeOffset;if(O){var B=O.flush();B&&U.push(this.push(B,null,A))}var N=P.dataLength;P.reset();var z=this.demuxer,te=this.remuxer;if(!z||!te)return N>=l&&this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),D.executeEnd=i(),[w(A)];var ce=z.flush(X);return m(ce)?ce.then(function(be){return p.flushRemux(U,be,A),U}):(this.flushRemux(U,ce,A),U)},y.flushRemux=function(A,p,D){var O=p.audioTrack,P=p.avcTrack,j=p.id3Track,K=p.textTrack,U=this.currentTransmuxState,X=U.accurateTimeOffset,B=U.timeOffset;t.logger.log("[transmuxer.ts]: Flushed fragment "+D.sn+(D.part>-1?" p: "+D.part:"")+" of level "+D.level);var N=this.remuxer.remux(O,P,j,K,B,X,!0,this.id);A.push({remuxResult:N,chunkMeta:D}),D.transmuxing.executeEnd=i()},y.resetInitialTimestamp=function(A){var p=this.demuxer,D=this.remuxer;if(!p||!D)return;p.resetTimeStamp(A),D.resetTimeStamp(A)},y.resetContiguity=function(){var A=this.demuxer,p=this.remuxer;if(!A||!p)return;A.resetContiguity(),p.resetNextTimestamp()},y.resetInitSegment=function(A,p,D,O){var P=this.demuxer,j=this.remuxer;if(!P||!j)return;P.resetInitSegment(p,D,O),j.resetInitSegment(A,p,D)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(A,p,D,O,P){var j;return p&&p.method==="SAMPLE-AES"?j=this.transmuxSampleAes(A,p,D,O,P):j=this.transmuxUnencrypted(A,D,O,P),j},y.transmuxUnencrypted=function(A,p,D,O){var P=this.demuxer.demux(A,p,!1,!this.config.progressive),j=P.audioTrack,K=P.avcTrack,U=P.id3Track,X=P.textTrack,B=this.remuxer.remux(j,K,U,X,p,D,!1,this.id);return{remuxResult:B,chunkMeta:O}},y.transmuxSampleAes=function(A,p,D,O,P){var j=this;return this.demuxer.demuxSampleAes(A,p,D).then(function(K){var U=j.remuxer.remux(K.audioTrack,K.avcTrack,K.id3Track,K.textTrack,D,O,!1,j.id);return{remuxResult:U,chunkMeta:P}})},y.configureTransmuxer=function(A,p){for(var D=this.config,O=this.observer,P=this.typeSupported,j=this.vendor,K=p.audioCodec,U=p.defaultInitPts,X=p.duration,B=p.initSegmentData,N=p.videoCodec,z,te=0,ce=s.length;te0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(T=y),T}var w=function(y){return{remuxResult:{},chunkMeta:y}};function m(v){return"then"in v&&v.then instanceof Function}var S=function(y,T,A,p,D){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=T,this.initSegmentData=A,this.duration=p,this.defaultInitPts=D},C=function(y,T,A,p,D){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=T,this.accurateTimeOffset=A,this.trackSwitch=p,this.timeOffset=D}},"./src/demux/tsdemuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"discardEPB",function(){return w});var k=I("./src/demux/adts.ts"),M=I("./src/demux/mpegaudio.ts"),f=I("./src/demux/exp-golomb.ts"),E=I("./src/demux/id3.ts"),x=I("./src/demux/sample-aes.ts"),g=I("./src/events.ts"),h=I("./src/utils/mp4-tools.ts"),o=I("./src/utils/logger.ts"),u=I("./src/errors.ts"),r={video:1,audio:2,id3:3,text:4},n=function(){function m(C,v,y){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=C,this.config=v,this.typeSupported=y}m.probe=function(v){var y=m.syncOffset(v);return y<0?!1:(y&&o.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},m.syncOffset=function(v){for(var y=Math.min(1e3,v.length-3*188),T=0;T>4,Ae=void 0;if(Ke>1){if(Ae=Oe+5+v[Oe+4],Ae===Oe+188)continue}else Ae=Oe+4;switch(Be){case j:Re&&(K&&(p=l(K))&&this.parseAVCPES(p,!1),K={data:[],size:0}),K&&(K.data.push(v.subarray(Ae,Oe+188)),K.size+=Oe+188-Ae);break;case U:Re&&(B&&(p=l(B))&&(O.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),B={data:[],size:0}),B&&(B.data.push(v.subarray(Ae,Oe+188)),B.size+=Oe+188-Ae);break;case X:Re&&(N&&(p=l(N))&&this.parseID3PES(p),N={data:[],size:0}),N&&(N.data.push(v.subarray(Ae,Oe+188)),N.size+=Oe+188-Ae);break;case 0:Re&&(Ae+=v[Ae]+1),ce=this._pmtId=i(v,Ae);break;case ce:{Re&&(Ae+=v[Ae]+1);var _e=s(v,Ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);j=_e.avc,j>0&&(D.pid=j),U=_e.audio,U>0&&(O.pid=U,O.isAAC=_e.isAAC),X=_e.id3,X>0&&(P.pid=X),z&&!te&&(o.logger.log("reparse from beginning"),z=!1,Oe=Fe-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(g.Events.ERROR,g.Events.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});D.pesData=K,O.pesData=B,P.pesData=N;var le={audioTrack:O,avcTrack:D,id3Track:P,textTrack:this._txtTrack};return A&&this.extractRemainingSamples(le),le},S.flush=function(){var v=this.remainderData;this.remainderData=null;var y;return v?y=this.demux(v,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},S.extractRemainingSamples=function(v){var y=v.audioTrack,T=v.avcTrack,A=v.id3Track,p=T.pesData,D=y.pesData,O=A.pesData,P;p&&(P=l(p))?(this.parseAVCPES(P,!0),T.pesData=null):T.pesData=p,D&&(P=l(D))?(y.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),y.pesData=null):(D!=null&&D.size&&o.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=D),O&&(P=l(O))?(this.parseID3PES(P),A.pesData=null):A.pesData=O},S.demuxSampleAes=function(v,y,T){var A=this.demux(v,T,!0,!this.config.progressive),p=this.sampleAes=new x.default(this.observer,this.config,y);return this.decrypt(A,p)},S.decrypt=function(v,y){return new Promise(function(T){var A=v.audioTrack,p=v.avcTrack;A.samples&&A.isAAC?y.decryptAacSamples(A.samples,0,function(){p.samples?y.decryptAvcSamples(p.samples,0,0,function(){T(v)}):T(v)}):p.samples&&y.decryptAvcSamples(p.samples,0,0,function(){T(v)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(v,y){var T=this,A=this._avcTrack,p=this.parseAVCNALu(v.data),D=!1,O=this.avcSample,P,j=!1;v.data=null,O&&p.length&&!A.audFound&&(c(O,A),O=this.avcSample=t(!1,v.pts,v.dts,"")),p.forEach(function(K){switch(K.type){case 1:{P=!0,O||(O=T.avcSample=t(!0,v.pts,v.dts,"")),D&&(O.debug+="NDR "),O.frame=!0;var U=K.data;if(j&&U.length>4){var X=new f.default(U).readSliceType();(X===2||X===4||X===7||X===9)&&(O.key=!0)}break}case 5:P=!0,O||(O=T.avcSample=t(!0,v.pts,v.dts,"")),D&&(O.debug+="IDR "),O.key=!0,O.frame=!0;break;case 6:{P=!0,D&&O&&(O.debug+="SEI ");var B=new f.default(w(K.data));B.readUByte();for(var N=0,z=0,te=!1,ce=0;!te&&B.bytesAvailable>1;){N=0;do ce=B.readUByte(),N+=ce;while(ce===255);z=0;do ce=B.readUByte(),z+=ce;while(ce===255);if(N===4&&B.bytesAvailable!==0){te=!0;var be=B.readUByte();if(be===181){var Fe=B.readUShort();if(Fe===49){var Oe=B.readUInt();if(Oe===1195456820){var Re=B.readUByte();if(Re===3){for(var Be=B.readUByte(),Ke=B.readUByte(),Ae=31&Be,_e=[Be,Ke],le=0;le16){for(var Ee=[],pe=0;pe<16;pe++)Ee.push(B.readUByte().toString(16)),(pe===3||pe===5||pe===7||pe===9)&&Ee.push("-");for(var Ge=z-16,Ye=new Uint8Array(Ge),ze=0;ze=0){var B={data:v.subarray(U,O-A-1),type:X};D.push(B)}else{var N=this.getLastNalUnit();if(N&&(p&&O<=4-p&&(N.state&&(N.data=N.data.subarray(0,N.data.byteLength-p))),j=O-A-1,j>0)){var z=new Uint8Array(N.data.byteLength+j);z.set(N.data,0),z.set(v.subarray(0,j),N.data.byteLength),N.data=z,N.state=0}}O=0&&A>=0){var te={data:v.subarray(U,y),type:X,state:A};D.push(te)}if(D.length===0){var ce=this.getLastNalUnit();if(ce){var be=new Uint8Array(ce.data.byteLength+v.byteLength);be.set(ce.data,0),be.set(v,ce.data.byteLength),ce.data=be}}return T.naluState=A,D},S.parseAACPES=function(v){var y=0,T=this._audioTrack,A=this.aacOverFlow,p=v.data;if(A){this.aacOverFlow=null;var D=A.sample.unit.byteLength,O=Math.min(A.missing,D),P=D-O;A.sample.unit.set(p.subarray(0,O),P),T.samples.push(A.sample),y=A.missing}var j,K;for(j=y,K=p.length;j1;){var D=new Uint8Array(p[0].length+p[1].length);D.set(p[0]),D.set(p[1],p[0].length),p[0]=D,p.splice(1,1)}C=p[0];var O=(C[0]<<16)+(C[1]<<8)+C[2];if(O===1){if(v=(C[4]<<8)+C[5],v&&v>m.size-6)return null;var P=C[7];P&192&&(T=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,P&64?(A=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,T-A>60*9e4&&(o.logger.warn(Math.round((T-A)/9e4)+"s delta between PTS and DTS, align them"),T=A)):A=T),y=C[8];var j=y+9;if(m.size<=j)return null;m.size-=j;for(var K=new Uint8Array(m.size),U=0,X=p.length;UB){j-=B;continue}else C=C.subarray(j),B-=j,j=0;K.set(C,S),S+=B}return v&&(v-=y+3),{data:K,pts:T,dts:A,len:v}}return null}function c(m,S){if(m.units.length&&m.frame){if(m.pts===void 0){var C=S.samples,v=C.length;if(v){var y=C[v-1];m.pts=y.pts,m.dts=y.dts}else{S.dropped++;return}}S.samples.push(m)}m.debug.length&&o.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function d(m,S){var C=m.length;if(C>0){if(S.pts>=m[C-1].pts)m.push(S);else for(var v=C-1;v>=0;v--)if(S.ptsT)return p;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,T=this.autoLevelCapping,A;return T===-1&&y&&y.length?A=y.length-1:A=T,A}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var T=this.audioTrackController;T&&(T.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var T=this.subtitleTrackController;T&&(T.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var T=this.subtitleTrackController;T&&(T.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return l.Events}},{key:"ErrorTypes",get:function(){return c.ErrorTypes}},{key:"ErrorDetails",get:function(){return c.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:t.hlsDefaultConfig},set:function(y){S.defaultConfig=y}}]),S}();m.defaultConfig=void 0},"./src/is-supported.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"isSupported",function(){return f}),I.d(L,"changeTypeSupported",function(){return E});var k=I("./src/utils/mediasource-helper.ts");function M(){return self.SourceBuffer||self.WebKitSourceBuffer}function f(){var x=Object(k.getMediaSource)();if(!x)return!1;var g=M(),h=x&&typeof x.isTypeSupported=="function"&&x.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!g||g.prototype&&typeof g.prototype.appendBuffer=="function"&&typeof g.prototype.remove=="function";return!!h&&!!o}function E(){var x,g=M();return typeof(g==null||((x=g.prototype)===null||x===void 0)?void 0:x.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n}),I.d(L,"LoadError",function(){return i});var k=I("./src/polyfills/number.ts"),M=I("./src/errors.ts");function f(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,o(s,l)}function E(s){var l=typeof Map=="function"?new Map:void 0;return E=function(d){if(d===null||!h(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l!="undefined"){if(l.has(d))return l.get(d);l.set(d,w)}function w(){return x(d,arguments,u(this).constructor)}return w.prototype=Object.create(d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),o(w,d)},E(s)}function x(s,l,c){return g()?x=Reflect.construct:x=function(w,m,S){var C=[null];C.push.apply(C,m);var v=Function.bind.apply(w,C),y=new v;return S&&o(y,S.prototype),y},x.apply(null,arguments)}function g(){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 h(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function o(s,l){return o=Object.setPrototypeOf||function(d,w){return d.__proto__=w,d},o(s,l)}function u(s){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},u(s)}var r=Math.pow(2,17),n=function(){function s(c){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=c}var l=s.prototype;return l.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},l.abort=function(){this.loader&&this.loader.abort()},l.load=function(d,w){var m=this,S=d.url;if(!S)return Promise.reject(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var C=this.config,v=C.fLoader,y=C.loader;return new Promise(function(T,A){m.loader&&m.loader.destroy();var p=m.loader=d.loader=v?new v(C):new y(C),D=t(d),O={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:r};d.stats=p.stats,p.load(D,O,{onSuccess:function(j,K,U,X){m.resetLoader(d,p),T({frag:d,part:null,payload:j.data,networkDetails:X})},onError:function(j,K,U){m.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:j,networkDetails:U}))},onAbort:function(j,K,U){m.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:U}))},onTimeout:function(j,K,U){m.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:U}))},onProgress:function(j,K,U,X){w&&w({frag:d,part:null,payload:U,networkDetails:X})}})})},l.loadPart=function(d,w,m){var S=this;this.abort();var C=this.config,v=C.fLoader,y=C.loader;return new Promise(function(T,A){S.loader&&S.loader.destroy();var p=S.loader=d.loader=v?new v(C):new y(C),D=t(d,w),O={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:r};w.stats=p.stats,p.load(D,O,{onSuccess:function(j,K,U,X){S.resetLoader(d,p),S.updateStatsFromPart(d,w);var B={frag:d,part:w,payload:j.data,networkDetails:X};m(B),T(B)},onError:function(j,K,U){S.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:w,response:j,networkDetails:U}))},onAbort:function(j,K,U){d.stats.aborted=w.stats.aborted,S.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:w,networkDetails:U}))},onTimeout:function(j,K,U){S.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:w,networkDetails:U}))}})})},l.updateStatsFromPart=function(d,w){var m=d.stats,S=w.stats,C=S.total;if(m.loaded+=S.loaded,C){var v=Math.round(d.duration/w.duration),y=Math.min(Math.round(m.loaded/C),v),T=v-y,A=T*Math.round(m.loaded/y);m.total=m.loaded+A}else m.total=Math.max(m.loaded,m.total);var p=m.loading,D=S.loading;p.start?p.first+=D.first-D.start:(p.start=D.start,p.first=D.first),p.end=D.end},l.resetLoader=function(d,w){d.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},s}();function t(s,l){l===void 0&&(l=null);var c=l||s,d={frag:s,part:l,responseType:"arraybuffer",url:c.url,headers:{},rangeStart:0,rangeEnd:0},w=c.byteRangeStartOffset,m=c.byteRangeEndOffset;return Object(k.isFiniteNumber)(w)&&Object(k.isFiniteNumber)(m)&&(d.rangeStart=w,d.rangeEnd=m),d}var i=function(s){f(l,s);function l(c){for(var d,w=arguments.length,m=new Array(w>1?w-1:0),S=1;S>8*(15-C)&255;return S},d.setDecryptDataFromLevelKey=function(m,S){var C=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(C=x.LevelKey.fromURI(m.uri),C.method=m.method,C.iv=this.createInitializationVector(S),C.keyFormat="identity"),C},d.setElementaryStreamInfo=function(m,S,C,v,y,T){T===void 0&&(T=!1);var A=this.elementaryStreams,p=A[m];if(!p){A[m]={startPTS:S,endPTS:C,startDTS:v,endDTS:y,partial:T};return}p.startPTS=Math.min(p.startPTS,S),p.endPTS=Math.max(p.endPTS,C),p.startDTS=Math.min(p.startDTS,v),p.endDTS=Math.max(p.endDTS,y)},d.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[n.AUDIO]=null,m[n.VIDEO]=null,m[n.AUDIOVIDEO]=null},r(c,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&E.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(k.isFiniteNumber)(this.programDateTime))return null;var m=Object(k.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),c}(t),s=function(l){h(c,l);function c(d,w,m,S,C){var v;v=l.call(this,m)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new g.LoadStats,v.duration=d.decimalFloatingPoint("DURATION"),v.gap=d.bool("GAP"),v.independent=d.bool("INDEPENDENT"),v.relurl=d.enumeratedString("URI"),v.fragment=w,v.index=S;var y=d.enumeratedString("BYTERANGE");return y&&v.setByteRange(y,C),C&&(v.fragOffset=C.fragOffset+C.duration),v}return r(c,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),c}(t)},"./src/loader/key-loader.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return E});var k=I("./src/events.ts"),M=I("./src/errors.ts"),f=I("./src/utils/logger.ts"),E=function(){function x(h){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=h,this._registerListeners()}var g=x.prototype;return g._registerListeners=function(){this.hls.on(k.Events.KEY_LOADING,this.onKeyLoading,this)},g._unregisterListeners=function(){this.hls.off(k.Events.KEY_LOADING,this.onKeyLoading)},g.destroy=function(){this._unregisterListeners();for(var o in this.loaders){var u=this.loaders[o];u&&u.destroy()}this.loaders={}},g.onKeyLoading=function(o,u){var r=u.frag,n=r.type,t=this.loaders[n];if(!r.decryptdata){f.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var i=r.decryptdata.uri;if(i!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(t&&(f.logger.warn("abort previous key loader for type:"+n),t.abort()),!i){f.logger.warn("key uri is falsy");return}var l=s.loader,c=r.loader=this.loaders[n]=new l(s);this.decrypturl=i,this.decryptkey=null;var d={url:i,frag:r,responseType:"arraybuffer"},w={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(d,w,m)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(k.Events.KEY_LOADED,{frag:r}))},g.loadsuccess=function(o,u,r){var n=r.frag;if(!n.decryptdata){f.logger.error("after key load, decryptdata unset");return}this.decryptkey=n.decryptdata.key=new Uint8Array(o.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(k.Events.KEY_LOADED,{frag:n})},g.loaderror=function(o,u){var r=u.frag,n=r.loader;n&&n.abort(),delete this.loaders[r.type],this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:o})},g.loadtimeout=function(o,u){var r=u.frag,n=r.loader;n&&n.abort(),delete this.loaders[r.type],this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},x}()},"./src/loader/level-details.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"LevelDetails",function(){return x});var k=I("./src/polyfills/number.ts");function M(g,h){for(var o=0;ou.endSN||r>0||r===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(u.misses*.6):this.misses=u.misses+1,this.availabilityDelay=u.availabilityDelay},f(g,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(k.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||E}},{key:"drift",get:function(){var u=this.driftEndTime-this.driftStartTime;if(u>0){var r=this.driftEnd-this.driftStart;return r*1e3/u}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var u;return(u=this.fragments)!==null&&u!==void 0&&u.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 u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),g}()},"./src/loader/level-key.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"LevelKey",function(){return x});var k=I("./node_modules/url-toolkit/src/url-toolkit.js"),M=I.n(k);function f(g,h){for(var o=0;o2){var A=T.shift()+".";return A+=parseInt(T.shift()).toString(16),A+=("000"+parseInt(T.shift()).toString(16)).substr(-4),A}return y},C.resolve=function(y,T){return M.buildAbsoluteURL(T,y,{alwaysNormalize:!0})},C.parseMasterPlaylist=function(y,T){var A=[],p={},D=!1;r.lastIndex=0;for(var O;(O=r.exec(y))!=null;)if(O[1]){var P=new h.AttrList(O[1]),j={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:C.resolve(O[2],T)},K=P.decimalResolution("RESOLUTION");K&&(j.width=K.width,j.height=K.height),d((P.CODECS||"").split(/[ ,]+/).filter(function(X){return X}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=C.convertAVC1ToAVCOTI(j.videoCodec)),A.push(j)}else if(O[3]){var U=new h.AttrList(O[3]);U["DATA-ID"]&&(D=!0,p[U["DATA-ID"]]=U)}return{levels:A,sessionData:D?p:null}},C.parseMasterPlaylistMedia=function(y,T,A,p){p===void 0&&(p=[]);var D,O=[],P=0;for(n.lastIndex=0;(D=n.exec(y))!==null;){var j=new h.AttrList(D[1]);if(j.TYPE===A){var K={attrs:j,bitrate:0,id:P++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:A,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?C.resolve(j.URI,T):""};if(p.length){var U=C.findGroup(p,K.groupId)||p[0];w(K,U,"audioCodec"),w(K,U,"textCodec")}O.push(K)}}return O},C.parseLevelPlaylist=function(y,T,A,p,D){var O=new x.LevelDetails(T),P=O.fragments,j=null,K=0,U=0,X=0,B=0,N=null,z=new E.Fragment(p,T),te,ce,be,Fe=-1,Oe=!1;for(t.lastIndex=0,O.m3u8=y;(te=t.exec(y))!==null;){Oe&&(Oe=!1,z=new E.Fragment(p,T),z.start=X,z.sn=K,z.cc=B,z.level=A,j&&(z.initSegment=j,z.rawProgramDateTime=j.rawProgramDateTime));var Re=te[1];if(Re){z.duration=parseFloat(Re);var Be=(" "+te[2]).slice(1);z.title=Be||null,z.tagList.push(Be?["INF",Re,Be]:["INF",Re])}else if(te[3])Object(k.isFiniteNumber)(z.duration)&&(z.start=X,be&&(z.levelkey=be),z.sn=K,z.level=A,z.cc=B,z.urlId=D,P.push(z),z.relurl=(" "+te[3]).slice(1),S(z,N),N=z,X+=z.duration,K++,U=0,Oe=!0);else if(te[4]){var Ke=(" "+te[4]).slice(1);N?z.setByteRange(Ke,N):z.setByteRange(Ke)}else if(te[5])z.rawProgramDateTime=(" "+te[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),Fe===-1&&(Fe=P.length);else{if(te=te[0].match(i),!te){o.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce-1){o.logger.warn("Keyformat "+ke+" is not supported from the manifest");continue}else if(ke!=="identity")continue;Je&&(be=g.LevelKey.fromURL(T,$e),$e&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Je)>=0&&(be.method=Je,be.keyFormat=ke,Pe&&(be.keyID=Pe),Ue&&(be.keyFormatVersions=Ue),be.iv=He));break}case"START":{var ve=new h.AttrList(_e),ae=ve.decimalFloatingPoint("TIME-OFFSET");Object(k.isFiniteNumber)(ae)&&(O.startTimeOffset=ae);break}case"MAP":{var De=new h.AttrList(_e);z.relurl=De.URI,De.BYTERANGE&&z.setByteRange(De.BYTERANGE),z.level=A,z.sn="initSegment",be&&(z.levelkey=be),z.initSegment=null,j=z,Oe=!0;break}case"SERVER-CONTROL":{var qe=new h.AttrList(_e);O.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),O.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),O.canSkipDateRanges=O.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),O.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),O.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var et=new h.AttrList(_e);O.partTarget=et.decimalFloatingPoint("PART-TARGET");break}case"PART":{var je=O.partList;je||(je=O.partList=[]);var ct=U>0?je[je.length-1]:void 0,he=U++,Te=new E.Part(new h.AttrList(_e),z,T,he,ct);je.push(Te),z.duration+=Te.duration;break}case"PRELOAD-HINT":{var We=new h.AttrList(_e);O.preloadHint=We;break}case"RENDITION-REPORT":{var xe=new h.AttrList(_e);O.renditionReports=O.renditionReports||[],O.renditionReports.push(xe);break}default:o.logger.warn("line parsed but not handled: "+te);break}}}N&&!N.relurl?(P.pop(),X-=N.duration,O.partList&&(O.fragmentHint=N)):O.partList&&(S(z,N),z.cc=B,O.fragmentHint=z);var ge=P.length,ye=P[0],J=P[ge-1];if(X+=O.skippedSegments*O.targetduration,X>0&&ge&&J){O.averagetargetduration=X/ge;var ne=J.sn;O.endSN=ne!=="initSegment"?ne:0,ye&&(O.startCC=ye.cc,ye.initSegment||O.fragments.every(function(q){return q.relurl&&l(q.relurl)})&&(o.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new E.Fragment(p,T),z.relurl=J.relurl,z.level=A,z.sn="initSegment",ye.initSegment=z,O.needSidxRanges=!0))}else O.endSN=0,O.startCC=0;return O.fragmentHint&&(X+=O.fragmentHint.duration),O.totalduration=X,O.endCC=B,Fe>0&&m(P,Fe),O},C}();function d(C,v){["video","audio","text"].forEach(function(y){var T=C.filter(function(p){return Object(u.isCodecType)(p,y)});if(T.length){var A=T.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});v[y+"Codec"]=A.length>0?A[0]:T[0],C=C.filter(function(p){return T.indexOf(p)===-1})}}),v.unknownCodecs=C}function w(C,v,y){var T=v[y];T&&(C[y]=T)}function m(C,v){for(var y=C[v],T=v;T--;){var A=C[T];if(!A)return;A.programDateTime=y.programDateTime-A.duration*1e3,y=A}}function S(C,v){C.rawProgramDateTime?C.programDateTime=Date.parse(C.rawProgramDateTime):v!=null&&v.programDateTime&&(C.programDateTime=v.endProgramDateTime),Object(k.isFiniteNumber)(C.programDateTime)||(C.programDateTime=null,C.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),f=I("./src/errors.ts"),E=I("./src/utils/logger.ts"),x=I("./src/utils/mp4-tools.ts"),g=I("./src/loader/m3u8-parser.ts"),h=I("./src/types/loader.ts"),o=I("./src/utils/attr-list.ts");function u(t){var i=t.type;switch(i){case h.PlaylistContextType.AUDIO_TRACK:return h.PlaylistLevelType.AUDIO;case h.PlaylistContextType.SUBTITLE_TRACK:return h.PlaylistLevelType.SUBTITLE;default:return h.PlaylistLevelType.MAIN}}function r(t,i){var s=t.url;return(s===void 0||s.indexOf("data:")===0)&&(s=i.url),s}var n=function(){function t(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var i=t.prototype;return i.registerListeners=function(){var l=this.hls;l.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.on(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},i.unregisterListeners=function(){var l=this.hls;l.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.off(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},i.createInternalLoader=function(l){var c=this.hls.config,d=c.pLoader,w=c.loader,m=d||w,S=new m(c);return l.loader=S,this.loaders[l.type]=S,S},i.getInternalLoader=function(l){return this.loaders[l.type]},i.resetInternalLoader=function(l){this.loaders[l]&&delete this.loaders[l]},i.destroyInternalLoaders=function(){for(var l in this.loaders){var c=this.loaders[l];c&&c.destroy(),this.resetInternalLoader(l)}},i.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},i.onManifestLoading=function(l,c){var d=c.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:h.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},i.onLevelLoading=function(l,c){var d=c.id,w=c.level,m=c.url,S=c.deliveryDirectives;this.load({id:d,groupId:null,level:w,responseType:"text",type:h.PlaylistContextType.LEVEL,url:m,deliveryDirectives:S})},i.onAudioTrackLoading=function(l,c){var d=c.id,w=c.groupId,m=c.url,S=c.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:h.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:S})},i.onSubtitleTrackLoading=function(l,c){var d=c.id,w=c.groupId,m=c.url,S=c.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:h.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:S})},i.load=function(l){var c,d=this.hls.config,w=this.getInternalLoader(l);if(w){var m=w.context;if(m&&m.url===l.url){E.logger.trace("[playlist-loader]: playlist request ongoing");return}E.logger.log("[playlist-loader]: aborting previous loader for type: "+l.type),w.abort()}var S,C,v,y;switch(l.type){case h.PlaylistContextType.MANIFEST:S=d.manifestLoadingMaxRetry,C=d.manifestLoadingTimeOut,v=d.manifestLoadingRetryDelay,y=d.manifestLoadingMaxRetryTimeout;break;case h.PlaylistContextType.LEVEL:case h.PlaylistContextType.AUDIO_TRACK:case h.PlaylistContextType.SUBTITLE_TRACK:S=0,C=d.levelLoadingTimeOut;break;default:S=d.levelLoadingMaxRetry,C=d.levelLoadingTimeOut,v=d.levelLoadingRetryDelay,y=d.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(l),(c=l.deliveryDirectives)!==null&&c!==void 0&&c.part){var T;if(l.type===h.PlaylistContextType.LEVEL&&l.level!==null?T=this.hls.levels[l.level].details:l.type===h.PlaylistContextType.AUDIO_TRACK&&l.id!==null?T=this.hls.audioTracks[l.id].details:l.type===h.PlaylistContextType.SUBTITLE_TRACK&&l.id!==null&&(T=this.hls.subtitleTracks[l.id].details),T){var A=T.partTarget,p=T.targetduration;A&&p&&(C=Math.min(Math.max(A*3,p*.8)*1e3,C))}}var D={timeout:C,maxRetry:S,retryDelay:v,maxRetryDelay:y,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(l,D,O)},i.loadsuccess=function(l,c,d,w){if(w===void 0&&(w=null),d.isSidxRequest){this.handleSidxRequest(l,d),this.handlePlaylistLoaded(l,c,d,w);return}this.resetInternalLoader(d.type);var m=l.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,d,"no EXTM3U delimiter",w);return}c.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(l,c,d,w):this.handleMasterPlaylist(l,c,d,w)},i.loaderror=function(l,c,d){d===void 0&&(d=null),this.handleNetworkError(c,d,!1,l)},i.loadtimeout=function(l,c,d){d===void 0&&(d=null),this.handleNetworkError(c,d,!0)},i.handleMasterPlaylist=function(l,c,d,w){var m=this.hls,S=l.data,C=r(l,d),v=g.default.parseMasterPlaylist(S,C),y=v.levels,T=v.sessionData;if(!y.length){this.handleManifestParsingError(l,d,"no level found in manifest",w);return}var A=y.map(function(K){return{id:K.attrs.AUDIO,audioCodec:K.audioCodec}}),p=y.map(function(K){return{id:K.attrs.SUBTITLES,textCodec:K.textCodec}}),D=g.default.parseMasterPlaylistMedia(S,C,"AUDIO",A),O=g.default.parseMasterPlaylistMedia(S,C,"SUBTITLES",p),P=g.default.parseMasterPlaylistMedia(S,C,"CLOSED-CAPTIONS");if(D.length){var j=D.some(function(K){return!K.url});!j&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(E.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),D.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new o.AttrList({}),bitrate:0,url:""}))}m.trigger(M.Events.MANIFEST_LOADED,{levels:y,audioTracks:D,subtitles:O,captions:P,url:C,stats:c,networkDetails:w,sessionData:T})},i.handleTrackOrLevelPlaylist=function(l,c,d,w){var m=this.hls,S=d.id,C=d.level,v=d.type,y=r(l,d),T=Object(k.isFiniteNumber)(S)?S:0,A=Object(k.isFiniteNumber)(C)?C:T,p=u(d),D=g.default.parseLevelPlaylist(l.data,y,A,p,T);if(!D.fragments.length){m.trigger(M.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(v===h.PlaylistContextType.MANIFEST){var O={attrs:new o.AttrList({}),bitrate:0,details:D,name:"",url:y};m.trigger(M.Events.MANIFEST_LOADED,{levels:[O],audioTracks:[],url:y,stats:c,networkDetails:w,sessionData:null})}if(c.parsing.end=performance.now(),D.needSidxRanges){var P,j=(P=D.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:j,isSidxRequest:!0,type:v,level:C,levelDetails:D,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=D,this.handlePlaylistLoaded(l,c,d,w)},i.handleSidxRequest=function(l,c){var d=Object(x.parseSegmentIndex)(new Uint8Array(l.data));if(!d)return;var w=d.references,m=c.levelDetails;w.forEach(function(S,C){var v=S.info,y=m.fragments[C];y.byteRange.length===0&&y.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),y.initSegment&&y.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},i.handleManifestParsingError=function(l,c,d,w){this.hls.trigger(M.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:c.type===h.PlaylistContextType.MANIFEST,url:l.url,reason:d,response:l,context:c,networkDetails:w})},i.handleNetworkError=function(l,c,d,w){d===void 0&&(d=!1),E.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+l.type+" level: "+l.level+" id: "+l.id+' group-id: "'+l.groupId+'"');var m=f.ErrorDetails.UNKNOWN,S=!1,C=this.getInternalLoader(l);switch(l.type){case h.PlaylistContextType.MANIFEST:m=d?f.ErrorDetails.MANIFEST_LOAD_TIMEOUT:f.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case h.PlaylistContextType.LEVEL:m=d?f.ErrorDetails.LEVEL_LOAD_TIMEOUT:f.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case h.PlaylistContextType.AUDIO_TRACK:m=d?f.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:f.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case h.PlaylistContextType.SUBTITLE_TRACK:m=d?f.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:f.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}C&&this.resetInternalLoader(l.type);var v={type:f.ErrorTypes.NETWORK_ERROR,details:m,fatal:S,url:l.url,loader:C,context:l,networkDetails:c};w&&(v.response=w),this.hls.trigger(M.Events.ERROR,v)},i.handlePlaylistLoaded=function(l,c,d,w){var m=d.type,S=d.level,C=d.id,v=d.groupId,y=d.loader,T=d.levelDetails,A=d.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(l,d,"invalid target duration",w);return}if(!y)return;T.live&&(y.getCacheAge&&(T.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(m){case h.PlaylistContextType.MANIFEST:case h.PlaylistContextType.LEVEL:this.hls.trigger(M.Events.LEVEL_LOADED,{details:T,level:S||0,id:C||0,stats:c,networkDetails:w,deliveryDirectives:A});break;case h.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,{details:T,id:C||0,groupId:v||"",stats:c,networkDetails:w,deliveryDirectives:A});break;case h.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(M.Events.SUBTITLE_TRACK_LOADED,{details:T,id:C||0,groupId:v||"",stats:c,networkDetails:w,deliveryDirectives:A});break}},t}();L.default=n},"./src/polyfills/number.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"isFiniteNumber",function(){return k}),I.d(L,"MAX_SAFE_INTEGER",function(){return M});var k=Number.isFinite||function(f){return typeof f=="number"&&isFinite(f)},M=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(V,L,I){"use strict";I.r(L);var k=function(){function M(){}return M.getSilentFrame=function(E,x){switch(E){case"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]);break;default: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]);break}return},M}();L.default=k},"./src/remux/mp4-generator.ts":function(V,L,I){"use strict";I.r(L);var k=Math.pow(2,32)-1,M=function(){function f(){}return f.init=function(){f.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 x;for(x in f.types)f.types.hasOwnProperty(x)&&(f.types[x]=[x.charCodeAt(0),x.charCodeAt(1),x.charCodeAt(2),x.charCodeAt(3)]);var g=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]),h=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]);f.HDLR_TYPES={video:g,audio:h};var o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),u=new Uint8Array([0,0,0,0,0,0,0,0]);f.STTS=f.STSC=f.STCO=u,f.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),f.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),f.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),f.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var r=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),t=new Uint8Array([0,0,0,1]);f.FTYP=f.box(f.types.ftyp,r,t,r,n),f.DINF=f.box(f.types.dinf,f.box(f.types.dref,o))},f.box=function(x){for(var g=8,h=arguments.length,o=new Array(h>1?h-1:0),u=1;u>24&255,t[1]=g>>16&255,t[2]=g>>8&255,t[3]=g&255,t.set(x,4),r=0,g=8;r>24&255,x>>16&255,x>>8&255,x&255,h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))},f.mdia=function(x){return f.box(f.types.mdia,f.mdhd(x.timescale,x.duration),f.hdlr(x.type),f.minf(x))},f.mfhd=function(x){return f.box(f.types.mfhd,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255]))},f.minf=function(x){return x.type==="audio"?f.box(f.types.minf,f.box(f.types.smhd,f.SMHD),f.DINF,f.stbl(x)):f.box(f.types.minf,f.box(f.types.vmhd,f.VMHD),f.DINF,f.stbl(x))},f.moof=function(x,g,h){return f.box(f.types.moof,f.mfhd(x),f.traf(h,g))},f.moov=function(x){for(var g=x.length,h=[];g--;)h[g]=f.trak(x[g]);return f.box.apply(null,[f.types.moov,f.mvhd(x[0].timescale,x[0].duration)].concat(h).concat(f.mvex(x)))},f.mvex=function(x){for(var g=x.length,h=[];g--;)h[g]=f.trex(x[g]);return f.box.apply(null,[f.types.mvex].concat(h))},f.mvhd=function(x,g){g*=x;var h=Math.floor(g/(k+1)),o=Math.floor(g%(k+1)),u=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,x>>24&255,x>>16&255,x>>8&255,x&255,h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&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 f.box(f.types.mvhd,u)},f.sdtp=function(x){var g=x.samples||[],h=new Uint8Array(4+g.length),o,u;for(o=0;o>>8&255),g.push(r&255),g=g.concat(Array.prototype.slice.call(u));for(o=0;o>>8&255),h.push(r&255),h=h.concat(Array.prototype.slice.call(u));var n=f.box(f.types.avcC,new Uint8Array([1,g[3],g[4],g[5],252|3,224|x.sps.length].concat(g).concat([x.pps.length]).concat(h))),t=x.width,i=x.height,s=x.pixelRatio[0],l=x.pixelRatio[1];return f.box(f.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,t>>8&255,t&255,i>>8&255,i&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]),n,f.box(f.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),f.box(f.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&255])))},f.esds=function(x){var g=x.config.length;return new Uint8Array([0,0,0,0,3,23+g,0,1,0,4,15+g,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([g]).concat(x.config).concat([6,1,2]))},f.mp4a=function(x){var g=x.samplerate;return f.box(f.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,x.channelCount,0,16,0,0,0,0,g>>8&255,g&255,0,0]),f.box(f.types.esds,f.esds(x)))},f.mp3=function(x){var g=x.samplerate;return f.box(f.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,x.channelCount,0,16,0,0,0,0,g>>8&255,g&255,0,0]))},f.stsd=function(x){return x.type==="audio"?!x.isAAC&&x.codec==="mp3"?f.box(f.types.stsd,f.STSD,f.mp3(x)):f.box(f.types.stsd,f.STSD,f.mp4a(x)):f.box(f.types.stsd,f.STSD,f.avc1(x))},f.tkhd=function(x){var g=x.id,h=x.duration*x.timescale,o=x.width,u=x.height,r=Math.floor(h/(k+1)),n=Math.floor(h%(k+1));return f.box(f.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,g>>24&255,g>>16&255,g>>8&255,g&255,0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&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,o>>8&255,o&255,0,0,u>>8&255,u&255,0,0]))},f.traf=function(x,g){var h=f.sdtp(x),o=x.id,u=Math.floor(g/(k+1)),r=Math.floor(g%(k+1));return f.box(f.types.traf,f.box(f.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),f.box(f.types.tfdt,new Uint8Array([1,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,r>>24,r>>16&255,r>>8&255,r&255])),f.trun(x,h.length+16+20+8+16+8+8),h)},f.trak=function(x){return x.duration=x.duration||4294967295,f.box(f.types.trak,f.tkhd(x),f.mdia(x))},f.trex=function(x){var g=x.id;return f.box(f.types.trex,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},f.trun=function(x,g){var h=x.samples||[],o=h.length,u=12+16*o,r=new Uint8Array(u),n,t,i,s,l,c;for(g+=8+u,r.set([0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,g>>>24&255,g>>>16&255,g>>>8&255,g&255],0),n=0;n>>24&255,i>>>16&255,i>>>8&255,i&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,l.degradPrio&240<<8,l.degradPrio&15,c>>>24&255,c>>>16&255,c>>>8&255,c&255],12+16*n);return f.box(f.types.trun,r)},f.initSegment=function(x){f.types||f.init();var g=f.moov(x),h=new Uint8Array(f.FTYP.byteLength+g.byteLength);return h.set(f.FTYP),h.set(g,f.FTYP.byteLength),h},f}();M.types=void 0,M.HDLR_TYPES=void 0,M.STTS=void 0,M.STSC=void 0,M.STCO=void 0,M.STSZ=void 0,M.VMHD=void 0,M.SMHD=void 0,M.STSD=void 0,M.FTYP=void 0,M.DINF=void 0,L.default=M},"./src/remux/mp4-remuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return c}),I.d(L,"normalizePts",function(){return d});var k=I("./src/polyfills/number.ts"),M=I("./src/remux/aac-helper.ts"),f=I("./src/remux/mp4-generator.ts"),E=I("./src/events.ts"),x=I("./src/errors.ts"),g=I("./src/utils/logger.ts"),h=I("./src/types/loader.ts"),o=I("./src/utils/timescale-conversion.ts");function u(){return u=Object.assign||function(C){for(var v=1;v0?D:O.pts},T[0].pts);return A&&g.logger.debug("PTS rollover detected"),p},v.remux=function(T,A,p,D,O,P,j,K){var U,X,B,N,z,te,ce=O,be=O,Fe=T.pid>-1,Oe=A.pid>-1,Re=A.samples.length,Be=T.samples.length>0,Ke=Re>1,Ae=(!Fe||Be)&&(!Oe||Ke)||this.ISGenerated||j;if(Ae){this.ISGenerated||(B=this.generateIS(T,A,O));var _e=this.isVideoContiguous,le=-1;if(Ke&&(le=w(A.samples),!_e&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,le>0){g.logger.warn("[mp4-remuxer]: Dropped "+le+" out of "+Re+" video samples due to a missing keyframe");var Ee=this.getVideoStartPts(A.samples);A.samples=A.samples.slice(le),A.dropped+=le,be+=(A.samples[0].pts-Ee)/(A.timescale||9e4)}else le===-1&&(g.logger.warn("[mp4-remuxer]: No keyframe found out of "+Re+" video samples"),te=!1);if(this.ISGenerated){if(Be&&Ke){var pe=this.getVideoStartPts(A.samples),Ge=d(T.samples[0].pts,pe)-pe,Ye=Ge/A.inputTimeScale;ce+=Math.max(0,Ye),be+=Math.max(0,-Ye)}if(Be){if(T.samplerate||(g.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(T,A,O)),X=this.remuxAudio(T,ce,this.isAudioContiguous,P,Oe||Ke||K===h.PlaylistLevelType.AUDIO?be:void 0),Ke){var ze=X?X.endPTS-X.startPTS:0;A.inputTimeScale||(g.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(T,A,O)),U=this.remuxVideo(A,be,_e,ze)}}else Ke&&(U=this.remuxVideo(A,be,_e,0));U&&(U.firstKeyFrame=le,U.independent=le!==-1)}}return this.ISGenerated&&(p.samples.length&&(z=this.remuxID3(p,O)),D.samples.length&&(N=this.remuxText(D,O))),{audio:X,video:U,initSegment:B,independent:te,text:N,id3:z}},v.generateIS=function(T,A,p){var D=T.samples,O=A.samples,P=this.typeSupported,j={},K=!Object(k.isFiniteNumber)(this._initPTS),U="audio/mp4",X,B,N;if(K&&(X=B=Infinity),T.config&&D.length&&(T.timescale=T.samplerate,T.isAAC||(P.mpeg?(U="audio/mpeg",T.codec=""):P.mp3&&(T.codec="mp3")),j.audio={id:"audio",container:U,codec:T.codec,initSegment:!T.isAAC&&P.mpeg?new Uint8Array(0):f.default.initSegment([T]),metadata:{channelCount:T.channelCount}},K&&(N=T.inputTimeScale,X=B=D[0].pts-Math.round(N*p))),A.sps&&A.pps&&O.length&&(A.timescale=A.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:A.codec,initSegment:f.default.initSegment([A]),metadata:{width:A.width,height:A.height}},K)){N=A.inputTimeScale;var z=this.getVideoStartPts(O),te=Math.round(N*p);B=Math.min(B,d(O[0].dts,z)-te),X=Math.min(X,z-te)}if(Object.keys(j).length)return this.ISGenerated=!0,K&&(this._initPTS=X,this._initDTS=B),{tracks:j,initPTS:X,timescale:N}},v.remuxVideo=function(T,A,p,D){var O=T.inputTimeScale,P=T.samples,j=[],K=P.length,U=this._initPTS,X=this.nextAvcDts,B=8,N,z,te,ce=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,Fe=0,Oe=!1;if(!p||X===null){var Re=A*O,Be=P[0].pts-d(P[0].dts,P[0].pts);X=Re-Be}for(var Ke=0;KeAe.pts){var _e=9e4*.2;Fe=Math.max(Math.min(Fe,Ae.pts-Ae.dts),-1*_e)}Ae.dts0?Ke-1:Ke].dts&&(Oe=!0)}Oe&&P.sort(function(Xe,lt){var tt=Xe.dts-lt.dts,st=Xe.pts-lt.pts;return tt||st}),z=P[0].dts,te=P[P.length-1].dts;var le=Math.round((te-z)/(K-1));if(Fe<0){if(Fele,Ze=Ye<-1;if(ze||Ze){ze?g.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(Ye,!0)+" ms ("+Ye+"dts) hole between fragments detected, filling it"):g.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(-Ye,!0)+" ms ("+Ye+"dts) overlapping between fragments detected"),z=X;var Je=P[0].pts-Ye;P[0].dts=z,P[0].pts=Je,g.logger.log("Video: First PTS/DTS adjusted: "+Object(o.toMsFromMpegTsClock)(Je,!0)+"/"+Object(o.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(o.toMsFromMpegTsClock)(Ye,!0)+" ms")}}l&&(z=Math.max(0,z));for(var $e=0,He=0,Ue=0;Ue0?je-1:je].dts;if(ne.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(ne.maxBufferHole*O),Ce=(D?ce+D*O:this.nextAudioPts)-ct.pts;Ce>me?(N=Ce-q,N<0&&(N=q),g.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+N/90+" ms for the last video frame.")):N=q}else N=q}var G=Math.round(ct.pts-ct.dts);j.push(new m(ct.key,N,Te,G))}if(j.length&&i&&i<70){var we=j[0].flags;we.dependsOn=2,we.isNonSync=0}console.assert(N!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=X=te+N,this.isVideoContiguous=!0;var Ne=f.default.moof(T.sequenceNumber++,z,u({},T,{samples:j})),de="video",Se={data1:Ne,data2:qe,startPTS:ce/O,endPTS:(be+N)/O,startDTS:z/O,endDTS:X/O,type:de,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),Se},v.remuxAudio=function(T,A,p,D,O){var P=T.inputTimeScale,j=T.samplerate?T.samplerate:P,K=P/j,U=T.isAAC?n:t,X=U*K,B=this._initPTS,N=!T.isAAC&&this.typeSupported.mpeg,z=[],te=T.samples,ce=N?0:8,be=this.nextAudioPts||-1,Fe=A*P;if(this.isAudioContiguous=p=p||te.length&&be>0&&(D&&Math.abs(Fe-be)<9e3||Math.abs(d(te[0].pts-B,Fe)-be)<20*X),te.forEach(function(ye){ye.pts=d(ye.pts-B,Fe)}),!p||be<0){if(te=te.filter(function(ye){return ye.pts>=0}),!te.length)return;O===0?be=0:D?be=Math.max(0,Fe):be=te[0].pts}if(T.isAAC)for(var Oe=O!==void 0,Re=this.config.maxAudioFramesDrift,Be=0,Ke=be;Be=Re*X&&Ee0){He+=ce;try{$e=new Uint8Array(He)}catch(ye){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:x.ErrorTypes.MUX_ERROR,details:x.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:He,reason:"fail allocating audio mdat "+He});return}if(!N){var qe=new DataView($e.buffer);qe.setUint32(0,He),$e.set(f.default.types.mdat,4)}}else return;$e.set(ve,ce);var et=ve.byteLength;ce+=et,z.push(new m(!0,U,et,0)),Je=ae}var je=z.length;if(!je)return;var ct=z[z.length-1];this.nextAudioPts=be=Je+K*ct.duration;var he=N?new Uint8Array(0):f.default.moof(T.sequenceNumber++,Ze/K,u({},T,{samples:z}));T.samples=[];var Te=Ze/P,We=be/P,xe="audio",ge={data1:he,data2:$e,startPTS:Te,endPTS:We,startDTS:Te,endDTS:We,type:xe,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert($e.length,"MDAT length must not be zero"),ge},v.remuxEmptyAudio=function(T,A,p,D){var O=T.inputTimeScale,P=T.samplerate?T.samplerate:O,j=O/P,K=this.nextAudioPts,U=(K!==null?K:D.startDTS*O)+this._initDTS,X=D.endDTS*O+this._initDTS,B=j*n,N=Math.ceil((X-U)/B),z=M.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(g.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){g.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],ce=0;ce4294967296;)C+=y;return C}function w(C){for(var v=0;v0?this.lastEndDTS=T:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var A=!!C.audio,p=!!C.video,D="";A&&(D+="audio"),p&&(D+="video");var O={data1:m,startPTS:y,startDTS:y,endPTS:T,endDTS:T,type:D,hasAudio:A,hasVideo:p,nb:1,dropped:0};return w.audio=O.type==="audio"?O:void 0,w.video=O.type!=="audio"?O:void 0,w.text=s,w.id3=i,w.initSegment=S,w},o}(),g=function(u,r,n){return Object(M.getStartDTS)(u,r)-n};function h(o,u){var r=o==null?void 0:o.codec;return r&&r.length>4?r:r==="hvc1"?"hvc1.1.c.L120.90":r==="av01"?"av01.0.04M.08":r==="avc1"||u===f.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}L.default=x},"./src/task-loop.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return k});var k=function(){function M(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var f=M.prototype;return f.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},f.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},f.onHandlerDestroyed=function(){},f.hasInterval=function(){return!!this._tickInterval},f.hasNextTick=function(){return!!this._tickTimer},f.setInterval=function(x){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,x),!0)},f.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},f.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},f.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},f.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},f.doTick=function(){},M}()},"./src/types/cmcd.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"CMCDVersion",function(){return k}),I.d(L,"CMCDObjectType",function(){return M}),I.d(L,"CMCDStreamingFormat",function(){return f}),I.d(L,"CMCDStreamType",function(){return E});var k=1,M;(function(x){x.MANIFEST="m",x.AUDIO="a",x.VIDEO="v",x.MUXED="av",x.INIT="i",x.CAPTION="c",x.TIMED_TEXT="tt",x.KEY="k",x.OTHER="o"})(M||(M={}));var f;(function(x){x.DASH="d",x.HLS="h",x.SMOOTH="s",x.OTHER="o"})(f||(f={}));var E;(function(x){x.VOD="v",x.LIVE="l"})(E||(E={}))},"./src/types/level.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"HlsSkip",function(){return f}),I.d(L,"getSkipValue",function(){return E}),I.d(L,"HlsUrlParameters",function(){return x}),I.d(L,"Level",function(){return g});function k(h,o){for(var u=0;uNumber.MAX_SAFE_INTEGER?Infinity:o},x.hexadecimalInteger=function(h){if(this[h]){var o=(this[h]||"0x").slice(2);o=(o.length&1?"0":"")+o;for(var u=new Uint8Array(o.length/2),r=0;rNumber.MAX_SAFE_INTEGER?Infinity:o},x.decimalFloatingPoint=function(h){return parseFloat(this[h])},x.optionalFloat=function(h,o){var u=this[h];return u?parseFloat(u):o},x.enumeratedString=function(h){return this[h]},x.bool=function(h){return this[h]==="YES"},x.decimalResolution=function(h){var o=k.exec(this[h]);return o===null?void 0:{width:parseInt(o[1],10),height:parseInt(o[2],10)}},E.parseAttrList=function(h){var o,u={},r='"';for(M.lastIndex=0;(o=M.exec(h))!==null;){var n=o[2];n.indexOf(r)===0&&n.lastIndexOf(r)===n.length-1&&(n=n.slice(1,-1)),u[o[1]]=n}return u},E}()},"./src/utils/binary-search.ts":function(V,L,I){"use strict";I.r(L);var k={search:function(f,E){for(var x=0,g=f.length-1,h=null,o=null;x<=g;){h=(x+g)/2|0,o=f[h];var u=E(o);if(u>0)x=h+1;else if(u<0)g=h-1;else return o}return null}};L.default=k},"./src/utils/buffer-helper.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"BufferHelper",function(){return f});var k=I("./src/utils/logger.ts"),M={length:0,start:function(){return 0},end:function(){return 0}},f=function(){function E(){}return E.isBuffered=function(g,h){try{if(g){for(var o=E.getBuffered(g),u=0;u=o.start(u)&&h<=o.end(u))return!0}}catch(r){}return!1},E.bufferInfo=function(g,h,o){try{if(g){var u=E.getBuffered(g),r=[],n;for(n=0;nt&&(u[n-1].end=g[r].end):u.push(g[r])}else u.push(g[r])}else u=g;for(var i=0,s,l=h,c=h,d=0;d=w&&h=p&&k.logger.log(this.time+" ["+p+"] "+D)},y}(),i=function(T){for(var A=[],p=0;px&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=x)},T.moveCursor=function(p){var D=this.pos+p;if(p>1)for(var O=this.pos+1;O=144&&this.backSpace();var D=f(p);if(this.pos>=x){this.logger.log(n.ERROR,"Cannot insert "+p.toString(16)+" ("+D+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(D,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(p){var D;for(D=p;D0&&(p?O="["+D.join(" | ")+"]":O=D.join(` `)),O},T.getTextAndFormat=function(){return this.rows},y}(),w=function(){function y(A,p,D){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=A,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new d(D),this.nonDisplayedMemory=new d(D),this.lastOutputScreen=new d(D),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=D}var T=y.prototype;return T.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},T.getHandler=function(){return this.outputFilter},T.setHandler=function(p){this.outputFilter=p},T.setPAC=function(p){this.writeScreen.setPAC(p)},T.setBkgData=function(p){this.writeScreen.setBkgData(p)},T.setMode=function(p){if(p===this.mode)return;this.mode=p,this.logger.log(n.INFO,"MODE="+p),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=p},T.insertChars=function(p){for(var D=0;D=46,D.italics)D.foreground="white";else{var O=Math.floor(p/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];D.foreground=P[O]}this.logger.log(n.INFO,"MIDROW: "+JSON.stringify(D)),this.writeScreen.setPen(D)},T.outputDataUpdate=function(p){p===void 0&&(p=!1);var D=this.logger.time;if(D===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=D:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,D,this.lastOutputScreen),p&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:D),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(p){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,p,this.displayedMemory),this.cueStartTime=p))},y}(),m=function(){function y(A,p,D){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var O=new t;this.channels=[null,new w(A,p,O),new w(A+1,D,O)],this.cmdHistory=v(),this.logger=O}var T=y.prototype;return T.getHandler=function(p){return this.channels[p].getHandler()},T.setHandler=function(p,D){this.channels[p].setHandler(D)},T.addData=function(p,D){var O,P,j,K=!1;this.logger.time=p;for(var U=0;U ("+i([P,j])+")"),O=this.parseCmd(P,j),O||(O=this.parseMidrow(P,j)),O||(O=this.parsePAC(P,j)),O||(O=this.parseBackgroundAttributes(P,j)),!O&&(K=this.parseChars(P,j),K)){var X=this.currentChannel;if(X&&X>0){var B=this.channels[X];B.insertChars(K)}else this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}!O&&!K&&this.logger.log(n.WARNING,"Couldn't parse cleaned data "+i([P,j])+" orig: "+i([D[U],D[U+1]]))}},T.parseCmd=function(p,D){var O=this.cmdHistory,P=(p===20||p===28||p===21||p===29)&&D>=32&&D<=47,j=(p===23||p===31)&&D>=33&&D<=35;if(!(P||j))return!1;if(C(p,D,O))return S(null,null,O),this.logger.log(n.DEBUG,"Repeated command ("+i([p,D])+") is dropped"),!0;var K=p===20||p===21||p===23?1:2,U=this.channels[K];return p===20||p===21||p===28||p===29?D===32?U.ccRCL():D===33?U.ccBS():D===34?U.ccAOF():D===35?U.ccAON():D===36?U.ccDER():D===37?U.ccRU(2):D===38?U.ccRU(3):D===39?U.ccRU(4):D===40?U.ccFON():D===41?U.ccRDC():D===42?U.ccTR():D===43?U.ccRTD():D===44?U.ccEDM():D===45?U.ccCR():D===46?U.ccENM():D===47&&U.ccEOC():U.ccTO(D-32),S(p,D,O),this.currentChannel=K,!0},T.parseMidrow=function(p,D){var O=0;if((p===17||p===25)&&D>=32&&D<=47){if(p===17?O=1:O=2,O!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[O];return P?(P.ccMIDROW(D),this.logger.log(n.DEBUG,"MIDROW ("+i([p,D])+")"),!0):!1}return!1},T.parsePAC=function(p,D){var O,P=this.cmdHistory,j=(p>=17&&p<=23||p>=25&&p<=31)&&D>=64&&D<=127,K=(p===16||p===24)&&D>=64&&D<=95;if(!(j||K))return!1;if(C(p,D,P))return S(null,null,P),!0;var U=p<=23?1:2;D>=64&&D<=95?O=U===1?g[p]:o[p]:O=U===1?h[p]:u[p];var X=this.channels[U];return X?(X.setPAC(this.interpretPAC(O,D)),S(p,D,P),this.currentChannel=U,!0):!1},T.interpretPAC=function(p,D){var O,P={color:null,italics:!1,indent:null,underline:!1,row:p};return D>95?O=D-96:O=D-64,P.underline=(O&1)===1,O<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(O/2)]:O<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((O-16)/2)*4,P},T.parseChars=function(p,D){var O,P=null,j=null;if(p>=25?(O=2,j=p-8):(O=1,j=p),j>=17&&j<=19){var K;j===17?K=D+80:j===18?K=D+112:K=D+144,this.logger.log(n.INFO,"Special char '"+f(K)+"' in channel "+O),P=[K]}else p>=32&&p<=127&&(P=D===0?[p]:[p,D]);if(P){var U=i(P);this.logger.log(n.DEBUG,"Char codes = "+U.join(",")),S(p,D,this.cmdHistory)}return P},T.parseBackgroundAttributes=function(p,D){var O=(p===16||p===24)&&D>=32&&D<=47,P=(p===23||p===31)&&D>=45&&D<=47;if(!(O||P))return!1;var j,K={};p===16||p===24?(j=Math.floor((D-32)/2),K.background=r[j],D%2===1&&(K.background=K.background+"_semi")):D===45?K.background="transparent":(K.foreground="black",D===47&&(K.underline=!0));var U=p<=23?1:2,X=this.channels[U];return X.setBkgData(K),S(p,D,this.cmdHistory),!0},T.reset=function(){for(var p=0;p=16?l--:l++;var S=Object(k.fixLineBreaks)(c.trim()),C=Object(M.generateCueId)(o,u,S);(!h||!h.cues||!h.cues.getCueById(C))&&(i=new d(o,u,S),i.id=C,i.line=w+1,i.align="left",i.position=10+Math.min(80,Math.floor(l*8/32)*10),n.push(i))}return h&&n.length&&(n.sort(function(v,y){return v.line==="auto"||y.line==="auto"?0:v.line>8&&y.line>8?y.line-v.line:v.line-y.line}),n.forEach(function(v){return Object(f.addCueToTrack)(h,v)})),n}};L.default=x},"./src/utils/discontinuities.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"findFirstFragWithCC",function(){return E}),I.d(L,"shouldAlignOnDiscontinuities",function(){return x}),I.d(L,"findDiscontinuousReferenceFrag",function(){return g}),I.d(L,"adjustSlidingStart",function(){return o}),I.d(L,"alignStream",function(){return u}),I.d(L,"alignPDT",function(){return n}),I.d(L,"alignFragmentByPDTDelta",function(){return t}),I.d(L,"alignMediaPlaylistByPDT",function(){return i});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts"),f=I("./src/controller/level-helper.ts");function E(s,l){for(var c=null,d=0,w=s.length;dc.startCC||s&&s.cc=this.minWeight_},E.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},E.destroy=function(){},f}();L.default=M},"./src/utils/ewma.ts":function(V,L,I){"use strict";I.r(L);var k=function(){function M(E,x,g){x===void 0&&(x=0),g===void 0&&(g=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=E,this.alpha_=E?Math.exp(Math.log(.5)/E):0,this.estimate_=x,this.totalWeight_=g}var f=M.prototype;return f.sample=function(x,g){var h=Math.pow(this.alpha_,x);this.estimate_=g*(1-h)+h*this.estimate_,this.totalWeight_+=x},f.getTotalWeight=function(){return this.totalWeight_},f.getEstimate=function(){if(this.alpha_){var x=1-Math.pow(this.alpha_,this.totalWeight_);if(x)return this.estimate_/x}return this.estimate_},M}();L.default=k},"./src/utils/fetch-loader.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"fetchSupported",function(){return t});var k=I("./src/polyfills/number.ts"),M=I("./src/loader/load-stats.ts"),f=I("./src/demux/chunk-cache.ts");function E(d,w){d.prototype=Object.create(w.prototype),d.prototype.constructor=d,u(d,w)}function x(d){var w=typeof Map=="function"?new Map:void 0;return x=function(S){if(S===null||!o(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(S))return w.get(S);w.set(S,C)}function C(){return g(S,arguments,r(this).constructor)}return C.prototype=Object.create(S.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),u(C,S)},x(d)}function g(d,w,m){return h()?g=Reflect.construct:g=function(C,v,y){var T=[null];T.push.apply(T,v);var A=Function.bind.apply(C,T),p=new A;return y&&u(p,y.prototype),p},g.apply(null,arguments)}function h(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function o(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function u(d,w){return u=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},u(d,w)}function r(d){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},r(d)}function n(){return n=Object.assign||function(d){for(var w=1;w=y&&T(C,v,A.flush(),S)):T(C,v,j,S),O()}).catch(function(){return Promise.reject()})};return D()},d}();function s(d,w){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(n({},d.headers))};return d.rangeEnd&&m.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),m}function l(d,w){return new self.Request(d.url,w)}var c=function(d){E(w,d);function w(m,S,C){var v;return v=d.call(this,m)||this,v.code=void 0,v.details=void 0,v.code=S,v.details=C,v}return w}(x(Error));L.default=i},"./src/utils/imsc1-ttml-parser.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"IMSC1_CODEC",function(){return o}),I.d(L,"parseIMSC1",function(){return t});var k=I("./src/utils/mp4-tools.ts"),M=I("./src/utils/vttparser.ts"),f=I("./src/utils/vttcue.ts"),E=I("./src/demux/id3.ts"),x=I("./src/utils/timescale-conversion.ts"),g=I("./src/utils/webvtt-parser.ts");function h(){return h=Object.assign||function(y){for(var T=1;T"):k}function x(o){for(var u=arguments.length,r=new Array(u>1?u-1:0),n=1;n>24,w[m+1]=S>>16&255,w[m+2]=S>>8&255,w[m+3]=S&255}function u(w,m){var S=[];if(!m.length)return S;var C,v,y;"data"in w?(C=w.data,v=w.start,y=w.end):(C=w,v=0,y=C.byteLength);for(var T=v;T1?T+A:y;if(p===m[0])if(m.length===1)S.push({data:C,start:T+8,end:D});else{var O=u({data:C,start:T+8,end:D},m.slice(1));O.length&&E.apply(S,O)}T=D}return S}function r(w){var m=u(w,["moov"]),S=m[0],C=S?S.end:null,v=u(w,["sidx"]);if(!v||!v[0])return null;var y=[],T=v[0],A=T.data[0],p=A===0?8:16,D=h(T,p);p+=4;var O=0,P=0;A===0?p+=8:p+=16,p+=2;var j=T.end+P,K=g(T,p);p+=2;for(var U=0;U>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=h(T,X);X+=4,y.push({referenceSize:N,subsegmentDuration:te,info:{duration:te/D,start:j,end:j+N-1}}),j+=N,X+=4,p=X}return{earliestPresentationTime:O,timescale:D,version:A,referencesCount:K,references:y,moovEndOffset:C}}function n(w){for(var m=[],S=u(w,["moov","trak"]),C=0;Cx)&&(this.startTime=x),this.endTime=g,this.screen=h,this.timelineController.createCaptionsTrack(this.trackName)},f.reset=function(){this.cueRanges=[]},M}()},"./src/utils/texttrack-utils.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"sendAddTrackEvent",function(){return M}),I.d(L,"addCueToTrack",function(){return f}),I.d(L,"clearCurrentCues",function(){return E}),I.d(L,"removeCuesInRange",function(){return x}),I.d(L,"getCuesInRange",function(){return h});var k=I("./src/utils/logger.ts");function M(o,u){var r;try{r=new Event("addtrack")}catch(n){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=o,u.dispatchEvent(r)}function f(o,u){var r=o.mode;if(r==="disabled"&&(o.mode="hidden"),o.cues&&!o.cues.getCueById(u.id))try{if(o.addCue(u),!o.cues.getCueById(u.id))throw new Error("addCue is failed for: "+u)}catch(t){k.logger.debug("[texttrack-utils]: "+t);var n=new self.TextTrackCue(u.startTime,u.endTime,u.text);n.id=u.id,o.addCue(n)}r==="disabled"&&(o.mode=r)}function E(o){var u=o.mode;if(u==="disabled"&&(o.mode="hidden"),o.cues)for(var r=o.cues.length;r--;)o.removeCue(o.cues[r]);u==="disabled"&&(o.mode=u)}function x(o,u,r){var n=o.mode;if(n==="disabled"&&(o.mode="hidden"),o.cues&&o.cues.length>0)for(var t=h(o.cues,u,r),i=0;io[r].endTime)return-1;for(var n=0,t=r;n<=t;){var i=Math.floor((t+n)/2);if(uo[i].startTime&&n-1)for(var i=t,s=o.length;i=u&&l.endTime<=r)n.push(l);else if(l.startTime>r)return n}return n}},"./src/utils/time-ranges.ts":function(V,L,I){"use strict";I.r(L);var k={toString:function(f){for(var E="",x=f.length,g=0;g1?u-1:0),n=1;n100)throw new Error("Position must be between 0 and 100.");y=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",g({},t,{get:function(){return T},set:function(O){var P=x(O);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");T=P,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",g({},t,{get:function(){return A},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");A=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",g({},t,{get:function(){return p},set:function(O){var P=x(O);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");p=P,this.hasBeenReset=!0}})),n.displayState=void 0}return h.prototype.getCueAsHTML=function(){var o=self.WebVTT;return o.convertCueToDOMTree(self,this.text)},h}()},"./src/utils/vttparser.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"parseTimeStamp",function(){return f}),I.d(L,"fixLineBreaks",function(){return u}),I.d(L,"VTTParser",function(){return r});var k=I("./src/utils/vttcue.ts"),M=function(){function n(){}var t=n.prototype;return t.decode=function(s,l){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},n}();function f(n){function t(s,l,c,d){return(s|0)*3600+(l|0)*60+(c|0)+parseFloat(d||0)}var i=n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}var E=function(){function n(){this.values=Object.create(null)}var t=n.prototype;return t.set=function(s,l){!this.get(s)&&l!==""&&(this.values[s]=l)},t.get=function(s,l,c){return c?this.has(s)?this.values[s]:l[c]:this.has(s)?this.values[s]:l},t.has=function(s){return s in this.values},t.alt=function(s,l,c){for(var d=0;d=0&&c<=100)return this.set(s,c),!0}return!1},n}();function x(n,t,i,s){var l=s?n.split(s):[n];for(var c in l){if(typeof l[c]!="string")continue;var d=l[c].split(i);if(d.length!==2)continue;var w=d[0],m=d[1];t(w,m)}}var g=new k.default(0,0,""),h=g.align==="middle"?"middle":"center";function o(n,t,i){var s=n;function l(){var w=f(n);if(w===null)throw new Error("Malformed timestamp: "+s);return n=n.replace(/^[^\sa-zA-Z-]+/,""),w}function c(w,m){var S=new E;x(w,function(y,T){var A;switch(y){case"region":for(var p=i.length-1;p>=0;p--)if(i[p].id===T){S.set(y,i[p].region);break}break;case"vertical":S.alt(y,T,["rl","lr"]);break;case"line":A=T.split(","),S.integer(y,A[0]),S.percent(y,A[0])&&S.set("snapToLines",!1),S.alt(y,A[0],["auto"]),A.length===2&&S.alt("lineAlign",A[1],["start",h,"end"]);break;case"position":A=T.split(","),S.percent(y,A[0]),A.length===2&&S.alt("positionAlign",A[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":S.percent(y,T);break;case"align":S.alt(y,T,["start",h,"end","left","right"]);break}},/:/,/\s/),m.region=S.get("region",null),m.vertical=S.get("vertical","");var C=S.get("line","auto");C==="auto"&&g.line===-1&&(C=-1),m.line=C,m.lineAlign=S.get("lineAlign","start"),m.snapToLines=S.get("snapToLines",!0),m.size=S.get("size",100),m.align=S.get("align",h);var v=S.get("position","auto");v==="auto"&&g.position===50&&(v=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=v}function d(){n=n.replace(/^\s+/,"")}if(d(),t.startTime=l(),d(),n.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);n=n.substr(3),d(),t.endTime=l(),d(),c(n,t)}function u(n){return n.replace(//gi,` `)}var r=function(){function n(){this.state="INITIAL",this.buffer="",this.decoder=new M,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=n.prototype;return t.parse=function(s){var l=this;s&&(l.buffer+=l.decoder.decode(s,{stream:!0}));function c(){var v=l.buffer,y=0;for(v=u(v);y")===-1){l.cue.id=w;continue}case"CUE":if(!l.cue){l.state="BADCUE";continue}try{o(w,l.cue,l.regionList)}catch(v){l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":{var C=w.indexOf("-->")!==-1;if(!w||C&&(S=!0)){l.oncue&&l.cue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}if(l.cue===null)continue;l.cue.text&&(l.cue.text+=` `),l.cue.text+=w}continue;case"BADCUE":w||(l.state="ID")}}}catch(v){l.state==="CUETEXT"&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state=l.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=` `,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(l){s.onparsingerror&&s.onparsingerror(l)}return s.onflush&&s.onflush(),this},n}()},"./src/utils/webvtt-parser.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"generateCueId",function(){return r}),I.d(L,"parseWebVTT",function(){return t});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/vttparser.ts"),f=I("./src/demux/id3.ts"),E=I("./src/utils/timescale-conversion.ts"),x=I("./src/remux/mp4-remuxer.ts"),g=/\r\n|\n\r|\n|\r/g,h=function(s,l,c){return c===void 0&&(c=0),s.substr(c,l.length)===l},o=function(s){var l=parseInt(s.substr(-3)),c=parseInt(s.substr(-6,2)),d=parseInt(s.substr(-9,2)),w=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(k.isFiniteNumber)(l)||!Object(k.isFiniteNumber)(c)||!Object(k.isFiniteNumber)(d)||!Object(k.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return l+=1e3*c,l+=60*1e3*d,l+=60*60*1e3*w,l},u=function(s){for(var l=5381,c=s.length;c;)l=l*33^s.charCodeAt(--c);return(l>>>0).toString()};function r(i,s,l){return u(i.toString())+u(s.toString())+u(l)}var n=function(s,l,c){var d=s[l],w=s[d.prevCC];if(!w||!w.new&&d.new){s.ccOffset=s.presentationOffset=d.start,d.new=!1;return}for(;(m=w)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=d.start-w.start,d.new=!1,d=w,w=s[d.prevCC]}s.presentationOffset=c};function t(i,s,l,c,d,w,m,S){var C=new M.VTTParser,v=Object(f.utf8ArrayToStr)(new Uint8Array(i)).trim().replace(g,` `).split(` `),y=[],T=Object(E.toMpegTsClockFromTimescale)(s,l),A="00:00.000",p=0,D=0,O,P=!0,j=!1;C.oncue=function(K){var U=c[d],X=c.ccOffset,B=(p-T)/9e4;if(U!=null&&U.new&&(D!==void 0?X=c.ccOffset=U.start:n(c,d,B)),B&&(X=B-c.presentationOffset),j){var N=K.endTime-K.startTime,z=Object(x.normalizePts)((K.startTime+X-D)*9e4,w*9e4)/9e4;K.startTime=z,K.endTime=z+N}var te=K.text.trim();K.text=decodeURIComponent(encodeURIComponent(te)),K.id||(K.id=r(K.startTime,K.endTime,te)),K.endTime>0&&y.push(K)},C.onparsingerror=function(K){O=K},C.onflush=function(){if(O){S(O);return}m(y)},v.forEach(function(K){if(P)if(h(K,"X-TIMESTAMP-MAP=")){P=!1,j=!0,K.substr(16).split(",").forEach(function(U){h(U,"LOCAL:")?A=U.substr(6):h(U,"MPEGTS:")&&(p=parseInt(U.substr(7)))});try{D=o(A)/1e3}catch(U){j=!1,O=U}return}else K===""&&(P=!1);C.parse(K+` `)}),C.flush()}},"./src/utils/xhr-loader.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/utils/logger.ts"),M=I("./src/loader/load-stats.ts"),f=/^age:\s*[\d.]+\s*$/m,E=function(){function x(h){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=h?h.xhrSetup:null,this.stats=new M.LoadStats,this.retryDelay=0}var g=x.prototype;return g.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},g.abortInternal=function(){var o=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),o&&(o.onreadystatechange=null,o.onprogress=null,o.readyState!==4&&(this.stats.aborted=!0,o.abort()))},g.abort=function(){var o;this.abortInternal(),(o=this.callbacks)!==null&&o!==void 0&&o.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},g.load=function(o,u,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=o,this.config=u,this.callbacks=r,this.retryDelay=u.retryDelay,this.loadInternal()},g.loadInternal=function(){var o=this.config,u=this.context;if(!o)return;var r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var t=this.xhrSetup;try{if(t)try{t(r,u.url)}catch(l){r.open("GET",u.url,!0),t(r,u.url)}r.readyState||r.open("GET",u.url,!0);var i=this.context.headers;if(i)for(var s in i)r.setRequestHeader(s,i[s])}catch(l){this.callbacks.onError({code:r.status,text:l.message},u,r);return}u.rangeEnd&&r.setRequestHeader("Range","bytes="+u.rangeStart+"-"+(u.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=u.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout),r.send()},g.readystatechange=function(){var o=this.context,u=this.loader,r=this.stats;if(!o||!u)return;var n=u.readyState,t=this.config;if(r.aborted)return;if(n>=2)if(self.clearTimeout(this.requestTimeout),r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),n===4){u.onreadystatechange=null,u.onprogress=null;var i=u.status;if(i>=200&&i<300){r.loading.end=Math.max(self.performance.now(),r.loading.first);var s,l;if(o.responseType==="arraybuffer"?(s=u.response,l=s.byteLength):(s=u.responseText,l=s.length),r.loaded=r.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(r,o,s,u),!this.callbacks)return;var d={url:u.responseURL,data:s};this.callbacks.onSuccess(d,r,o,u)}else r.retry>=t.maxRetry||i>=400&&i<499?(k.logger.error(i+" while loading "+o.url),this.callbacks.onError({code:i,text:u.statusText},o,u)):(k.logger.warn(i+" while loading "+o.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,t.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout)},g.loadtimeout=function(){k.logger.warn("timeout while loading "+this.context.url);var o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))},g.loadprogress=function(o){var u=this.stats;u.loaded=o.loaded,o.lengthComputable&&(u.total=o.total)},g.getCacheAge=function(){var o=null;if(this.loader&&f.test(this.loader.getAllResponseHeaders())){var u=this.loader.getResponseHeader("age");o=u?parseFloat(u):null}return o},x}();L.default=E}}).default})},vHTk:function(at,fe,oe){at.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.getPointerEvent=V,fe.stopEvent=L,fe.setCapture=x,fe.releaseCapture=g;function V(h){return h.changedTouches?h.changedTouches[0]:h.touches?h.touches[0]:h}function L(h){h.stopPropagation(),h.preventDefault()}var I=!1,k=null;document.captureElement=null;function M(h){if(I)return;var o=new h.constructor(h.type,h);I=!0,document.captureElement?document.captureElement.dispatchEvent(o):k.dispatchEvent(o),I=!1,h.stopPropagation(),o.defaultPrevented&&h.preventDefault(),h.type==="mouseup"&&g()}function f(){var h=document.getElementById("noVNC_mouse_capture_elem");h.style.cursor=window.getComputedStyle(document.captureElement).cursor}var E=new MutationObserver(f);function x(h){if(h.setCapture)h.setCapture(),document.captureElement=h,h.addEventListener("mouseup",g);else{g();var o=document.getElementById("noVNC_mouse_capture_elem");o===null&&(o=document.createElement("div"),o.id="noVNC_mouse_capture_elem",o.style.position="fixed",o.style.top="0px",o.style.left="0px",o.style.width="100%",o.style.height="100%",o.style.zIndex=1e4,o.style.display="none",document.body.appendChild(o),o.addEventListener("contextmenu",M),o.addEventListener("mousemove",M),o.addEventListener("mouseup",M)),document.captureElement=h,E.observe(h,{attributes:!0}),f(),o.style.display="",window.addEventListener("mousemove",M),window.addEventListener("mouseup",M)}}function g(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;k=document.captureElement,document.captureElement=null,E.disconnect();var h=document.getElementById("noVNC_mouse_capture_elem");h.style.display="none",window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",M)}}},whVF:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=oe("lNSK"),L=I(oe("1q3G"));function I(x){return x&&x.__esModule?x:{default:x}}function k(x,g){if(!(x instanceof g))throw new TypeError("Cannot call a class as a function")}function M(x,g){for(var h=0;h0){var r=[u],n=u.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,o=(0,V.deflate)(this.strm,V.Z_FULL_FLUSH),o<0)throw new Error("zlib deflate failed");var t=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);n+=t.length,r.push(t)}while(this.strm.avail_in>0);for(var i=new Uint8Array(n),s=0,l=0;l>>16&65535|0,x=0;k!==0;){x=k>2e3?2e3:k,k-=x;do f=f+I[M++]|0,E=E+f|0;while(--x);f%=65521,E%=65521}return f|E<<16|0}}}]);