You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__New__ImagePrevi...

456 lines
1.6 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([[253,5,6,7,19],{"+NIl":function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){"use strict";G.defineMode("stex",function(R,I){"use strict";function L(a,t){a.cmdState.push(t)}function M(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function p(a){var t=a.cmdState.pop();t&&t.closeBracket()}function E(a){for(var t=a.cmdState,r=t.length-1;r>=0;r--){var s=t[r];if(s.name=="DEFAULT")continue;return s}return{styleIdentifier:function(){return null}}}function b(a,t,r){return function(){this.name=a,this.bracketNo=0,this.style=t,this.styles=r,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var i={};i.importmodule=b("importmodule","tag",["string","builtin"]),i.documentclass=b("documentclass","tag",["","atom"]),i.usepackage=b("usepackage","tag",["atom"]),i.begin=b("begin","tag",["atom"]),i.end=b("end","tag",["atom"]),i.label=b("label","tag",["atom"]),i.ref=b("ref","tag",["atom"]),i.eqref=b("eqref","tag",["atom"]),i.cite=b("cite","tag",["atom"]),i.bibitem=b("bibitem","tag",["atom"]),i.Bibitem=b("Bibitem","tag",["atom"]),i.RBibitem=b("RBibitem","tag",["atom"]),i.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function c(a,t){a.f=t}function o(a,t){var r;if(a.match(/^\\[a-zA-Z@]+/)){var s=a.current().slice(1);return r=i.hasOwnProperty(s)?i[s]:i.DEFAULT,r=new r,L(t,r),c(t,n),r.style}if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/\\]/))return"tag";if(a.match("\\["))return c(t,function(f,d){return h(f,d,"\\]")}),"keyword";if(a.match("\\("))return c(t,function(f,d){return h(f,d,"\\)")}),"keyword";if(a.match("$$"))return c(t,function(f,d){return h(f,d,"$$")}),"keyword";if(a.match("$"))return c(t,function(f,d){return h(f,d,"$")}),"keyword";var u=a.next();if(u=="%")return a.skipToEnd(),"comment";if(u=="}"||u=="]"){if(r=M(t),r)r.closeBracket(u),c(t,n);else return"error";return"bracket"}else return u=="{"||u=="["?(r=i.DEFAULT,r=new r,L(t,r),"bracket"):/\d/.test(u)?(a.eatWhile(/[\w.%]/),"atom"):(a.eatWhile(/[\w\-_]/),r=E(t),r.name=="begin"&&(r.argument=a.current()),r.styleIdentifier())}function h(a,t,r){if(a.eatSpace())return null;if(r&&a.match(r))return c(t,o),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var s=a.next();return s=="{"||s=="}"||s=="["||s=="]"||s=="("||s==")"?"bracket":s=="%"?(a.skipToEnd(),"comment"):"error"}function n(a,t){var r=a.peek(),s;return r=="{"||r=="["?(s=M(t),s.openBracket(r),a.eat(r),c(t,o),"bracket"):/[ \t\r]/.test(r)?(a.eat(r),null):(c(t,o),p(t),o(a,t))}return{startState:function(){var a=I.inMathMode?function(t,r){return h(t,r)}:o;return{cmdState:[],f:a}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,t){return t.f(a,t)},blankLine:function(a){a.f=o,a.cmdState.length=0},lineComment:"%"}}),G.defineMIME("text/x-stex","stex"),G.defineMIME("text/x-latex","stex")})},"+ua5":function(it,re,Q){},"/POA":function(it,re,Q){!function(G,R){if(!0)it.exports=R();else var I,L}(window,function(){return function(G){var R={};function I(L){if(R[L])return R[L].exports;var M=R[L]={i:L,l:!1,exports:{}};return G[L].call(M.exports,M,M.exports,I),M.l=!0,M.exports}return I.m=G,I.c=R,I.d=function(L,M,p){I.o(L,M)||Object.defineProperty(L,M,{enumerable:!0,get:p})},I.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})},I.t=function(L,M){if(1&M&&(L=I(L)),8&M)return L;if(4&M&&typeof L=="object"&&L&&L.__esModule)return L;var p=Object.create(null);if(I.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:L}),2&M&&typeof L!="string")for(var E in L)I.d(p,E,function(b){return L[b]}.bind(null,E));return p},I.n=function(L){var M=L&&L.__esModule?function(){return L.default}:function(){return L};return I.d(M,"a",M),M},I.o=function(L,M){return Object.prototype.hasOwnProperty.call(L,M)},I.p="",I(I.s=34)}([function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.forwardEvent=R.EventEmitter=void 0;var L=function(){function M(){this._listeners=[],this._disposed=!1}return Object.defineProperty(M.prototype,"event",{get:function(){var p=this;return this._event||(this._event=function(E){return p._listeners.push(E),{dispose:function(){if(!p._disposed){for(var b=0;b<p._listeners.length;b++)if(p._listeners[b]===E)return void p._listeners.splice(b,1)}}}}),this._event},enumerable:!1,configurable:!0}),M.prototype.fire=function(p,E){for(var b=[],i=0;i<this._listeners.length;i++)b.push(this._listeners[i]);for(i=0;i<b.length;i++)b[i].call(void 0,p,E)},M.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},M}();R.EventEmitter=L,R.forwardEvent=function(M,p){return M(function(E){return p.fire(E)})}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.IUnicodeService=R.IOptionsService=R.ILogService=R.IInstantiationService=R.IDirtyRowService=R.ICharsetService=R.ICoreService=R.ICoreMouseService=R.IBufferService=void 0;var L=I(14);R.IBufferService=L.createDecorator("BufferService"),R.ICoreMouseService=L.createDecorator("CoreMouseService"),R.ICoreService=L.createDecorator("CoreService"),R.ICharsetService=L.createDecorator("CharsetService"),R.IDirtyRowService=L.createDecorator("DirtyRowService"),R.IInstantiationService=L.createDecorator("InstantiationService"),R.ILogService=L.createDecorator("LogService"),R.IOptionsService=L.createDecorator("OptionsService"),R.IUnicodeService=L.createDecorator("UnicodeService")},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.getDisposeArrayDisposable=R.disposeArray=R.Disposable=void 0;var L=function(){function p(){this._disposables=[],this._isDisposed=!1}return p.prototype.dispose=function(){this._isDisposed=!0;for(var E=0,b=this._disposables;E<b.length;E++)b[E].dispose();this._disposables.length=0},p.prototype.register=function(E){return this._disposables.push(E),E},p.prototype.unregister=function(E){var b=this._disposables.indexOf(E);b!==-1&&this._disposables.splice(b,1)},p}();function M(p){for(var E=0,b=p;E<b.length;E++)b[E].dispose();p.length=0}R.Disposable=L,R.disposeArray=M,R.getDisposeArrayDisposable=function(p){return{dispose:function(){return M(p)}}}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.WHITESPACE_CELL_CODE=R.WHITESPACE_CELL_WIDTH=R.WHITESPACE_CELL_CHAR=R.NULL_CELL_CODE=R.NULL_CELL_WIDTH=R.NULL_CELL_CHAR=R.CHAR_DATA_CODE_INDEX=R.CHAR_DATA_WIDTH_INDEX=R.CHAR_DATA_CHAR_INDEX=R.CHAR_DATA_ATTR_INDEX=R.DEFAULT_ATTR=R.DEFAULT_COLOR=void 0,R.DEFAULT_COLOR=256,R.DEFAULT_ATTR=256|R.DEFAULT_COLOR<<9,R.CHAR_DATA_ATTR_INDEX=0,R.CHAR_DATA_CHAR_INDEX=1,R.CHAR_DATA_WIDTH_INDEX=2,R.CHAR_DATA_CODE_INDEX=3,R.NULL_CELL_CHAR="",R.NULL_CELL_WIDTH=1,R.NULL_CELL_CODE=0,R.WHITESPACE_CELL_CHAR=" ",R.WHITESPACE_CELL_WIDTH=1,R.WHITESPACE_CELL_CODE=32},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(c,o){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}L(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(R,"__esModule",{value:!0}),R.CellData=void 0;var p=I(8),E=I(3),b=I(6),i=function(c){function o(){var h=c!==null&&c.apply(this,arguments)||this;return h.content=0,h.fg=0,h.bg=0,h.extended=new b.ExtendedAttrs,h.combinedData="",h}return M(o,c),o.fromCharData=function(h){var n=new o;return n.setFromCharData(h),n},o.prototype.isCombined=function(){return 2097152&this.content},o.prototype.getWidth=function(){return this.content>>22},o.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?p.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(h){this.fg=h[E.CHAR_DATA_ATTR_INDEX],this.bg=0;var n=!1;if(h[E.CHAR_DATA_CHAR_INDEX].length>2)n=!0;else if(h[E.CHAR_DATA_CHAR_INDEX].length===2){var a=h[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){var t=h[E.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=t&&t<=57343?this.content=1024*(a-55296)+t-56320+65536|h[E.CHAR_DATA_WIDTH_INDEX]<<22:n=!0}else n=!0}else this.content=h[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[E.CHAR_DATA_WIDTH_INDEX]<<22;n&&(this.combinedData=h[E.CHAR_DATA_CHAR_INDEX],this.content=2097152|h[E.CHAR_DATA_WIDTH_INDEX]<<22)},o.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},o}(b.AttributeData);R.CellData=i},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.ISoundService=R.ISelectionService=R.IRenderService=R.IMouseService=R.ICoreBrowserService=R.ICharSizeService=void 0;var L=I(14);R.ICharSizeService=L.createDecorator("CharSizeService"),R.ICoreBrowserService=L.createDecorator("CoreBrowserService"),R.IMouseService=L.createDecorator("MouseService"),R.IRenderService=L.createDecorator("RenderService"),R.ISelectionService=L.createDecorator("SelectionService"),R.ISoundService=L.createDecorator("SoundService")},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.ExtendedAttrs=R.AttributeData=void 0;var L=function(){function p(){this.fg=0,this.bg=0,this.extended=new M}return p.toColorRGB=function(E){return[E>>>16&255,E>>>8&255,255&E]},p.fromColorRGB=function(E){return(255&E[0])<<16|(255&E[1])<<8|255&E[2]},p.prototype.clone=function(){var E=new p;return E.fg=this.fg,E.bg=this.bg,E.extended=this.extended.clone(),E},p.prototype.isInverse=function(){return 67108864&this.fg},p.prototype.isBold=function(){return 134217728&this.fg},p.prototype.isUnderline=function(){return 268435456&this.fg},p.prototype.isBlink=function(){return 536870912&this.fg},p.prototype.isInvisible=function(){return 1073741824&this.fg},p.prototype.isItalic=function(){return 67108864&this.bg},p.prototype.isDim=function(){return 134217728&this.bg},p.prototype.getFgColorMode=function(){return 50331648&this.fg},p.prototype.getBgColorMode=function(){return 50331648&this.bg},p.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},p.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},p.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},p.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},p.prototype.isFgDefault=function(){return(50331648&this.fg)==0},p.prototype.isBgDefault=function(){return(50331648&this.bg)==0},p.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},p.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},p.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},p.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},p.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},p.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()},p.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},p.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},p.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},p.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},p.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},p}();R.AttributeData=L;var M=function(){function p(E,b){E===void 0&&(E=0),b===void 0&&(b=-1),this.underlineStyle=E,this.underlineColor=b}return p.prototype.clone=function(){return new p(this.underlineStyle,this.underlineColor)},p.prototype.isEmpty=function(){return this.underlineStyle===0},p}();R.ExtendedAttrs=M},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.addDisposableDomListener=void 0,R.addDisposableDomListener=function(L,M,p,E){L.addEventListener(M,p,E);var b=!1;return{dispose:function(){b||(b=!0,L.removeEventListener(M,p,E))}}}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.Utf8ToUtf32=R.StringToUtf32=R.utf32ToString=R.stringFromCodePoint=void 0,R.stringFromCodePoint=function(p){return p>65535?(p-=65536,String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):String.fromCharCode(p)},R.utf32ToString=function(p,E,b){E===void 0&&(E=0),b===void 0&&(b=p.length);for(var i="",c=E;c<b;++c){var o=p[c];o>65535?(o-=65536,i+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):i+=String.fromCharCode(o)}return i};var L=function(){function p(){this._interim=0}return p.prototype.clear=function(){this._interim=0},p.prototype.decode=function(E,b){var i=E.length;if(!i)return 0;var c=0,o=0;this._interim&&(56320<=(a=E.charCodeAt(o++))&&a<=57343?b[c++]=1024*(this._interim-55296)+a-56320+65536:(b[c++]=this._interim,b[c++]=a),this._interim=0);for(var h=o;h<i;++h){var n=E.charCodeAt(h);if(55296<=n&&n<=56319){if(++h>=i)return this._interim=n,c;var a;56320<=(a=E.charCodeAt(h))&&a<=57343?b[c++]=1024*(n-55296)+a-56320+65536:(b[c++]=n,b[c++]=a)}else b[c++]=n}return c},p}();R.StringToUtf32=L;var M=function(){function p(){this.interim=new Uint8Array(3)}return p.prototype.clear=function(){this.interim.fill(0)},p.prototype.decode=function(E,b){var i=E.length;if(!i)return 0;var c,o,h,n,a=0,t=0,r=0;if(this.interim[0]){var s=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;for(var f=0,d=void 0;(d=63&this.interim[++f])&&f<4;)u<<=6,u|=d;for(var v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=v-f;r<m;){if(r>=i)return 0;if((192&(d=E[r++]))!=128){r--,s=!0;break}this.interim[f++]=d,u<<=6,u|=63&d}s||(v===2?u<128?r--:b[a++]=u:v===3?u<2048||u>=55296&&u<=57343||(b[a++]=u):u<65536||u>1114111||(b[a++]=u)),this.interim.fill(0)}for(var S=i-4,C=r;C<i;){for(;!(!(C<S)||128&(c=E[C])||128&(o=E[C+1])||128&(h=E[C+2])||128&(n=E[C+3]));)b[a++]=c,b[a++]=o,b[a++]=h,b[a++]=n,C+=4;if((c=E[C++])<128)b[a++]=c;else if((224&c)==192){if(C>=i)return this.interim[0]=c,a;if((192&(o=E[C++]))!=128){C--;continue}if((t=(31&c)<<6|63&o)<128){C--;continue}b[a++]=t}else if((240&c)==224){if(C>=i)return this.interim[0]=c,a;if((192&(o=E[C++]))!=128){C--;continue}if(C>=i)return this.interim[0]=c,this.interim[1]=o,a;if((192&(h=E[C++]))!=128){C--;continue}if((t=(15&c)<<12|(63&o)<<6|63&h)<2048||t>=55296&&t<=57343)continue;b[a++]=t}else if((248&c)==240){if(C>=i)return this.interim[0]=c,a;if((192&(o=E[C++]))!=128){C--;continue}if(C>=i)return this.interim[0]=c,this.interim[1]=o,a;if((192&(h=E[C++]))!=128){C--;continue}if(C>=i)return this.interim[0]=c,this.interim[1]=o,this.interim[2]=h,a;if((192&(n=E[C++]))!=128){C--;continue}if((t=(7&c)<<18|(63&o)<<12|(63&h)<<6|63&n)<65536||t>1114111)continue;b[a++]=t}}return a},p}();R.Utf8ToUtf32=M},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.CHAR_ATLAS_CELL_SPACING=R.DIM_OPACITY=R.INVERTED_DEFAULT_COLOR=void 0,R.INVERTED_DEFAULT_COLOR=257,R.DIM_OPACITY=.5,R.CHAR_ATLAS_CELL_SPACING=1},function(G,R,I){"use strict";var L,M,p,E;function b(c){var o=c.toString(16);return o.length<2?"0"+o:o}function i(c,o){return c<o?(o+.05)/(c+.05):(c+.05)/(o+.05)}Object.defineProperty(R,"__esModule",{value:!0}),R.contrastRatio=R.toPaddedHex=R.rgba=R.rgb=R.css=R.color=R.channels=void 0,function(c){c.toCss=function(o,h,n,a){return a!==void 0?"#"+b(o)+b(h)+b(n)+b(a):"#"+b(o)+b(h)+b(n)},c.toRgba=function(o,h,n,a){return a===void 0&&(a=255),(o<<24|h<<16|n<<8|a)>>>0}}(L=R.channels||(R.channels={})),(M=R.color||(R.color={})).blend=function(c,o){var h=(255&o.rgba)/255;if(h===1)return{css:o.css,rgba:o.rgba};var n=o.rgba>>24&255,a=o.rgba>>16&255,t=o.rgba>>8&255,r=c.rgba>>24&255,s=c.rgba>>16&255,u=c.rgba>>8&255,f=r+Math.round((n-r)*h),d=s+Math.round((a-s)*h),v=u+Math.round((t-u)*h);return{css:L.toCss(f,d,v),rgba:L.toRgba(f,d,v)}},M.isOpaque=function(c){return(255&c.rgba)==255},M.ensureContrastRatio=function(c,o,h){var n=E.ensureContrastRatio(c.rgba,o.rgba,h);if(n)return E.toColor(n>>24&255,n>>16&255,n>>8&255)},M.opaque=function(c){var o=(255|c.rgba)>>>0,h=E.toChannels(o),n=h[0],a=h[1],t=h[2];return{css:L.toCss(n,a,t),rgba:o}},M.opacity=function(c,o){var h=Math.round(255*o),n=E.toChannels(c.rgba),a=n[0],t=n[1],r=n[2];return{css:L.toCss(a,t,r,h),rgba:L.toRgba(a,t,r,h)}},(R.css||(R.css={})).toColor=function(c){switch(c.length){case 7:return{css:c,rgba:(parseInt(c.slice(1),16)<<8|255)>>>0};case 9:return{css:c,rgba:parseInt(c.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(c){function o(h,n,a){var t=h/255,r=n/255,s=a/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))}c.relativeLuminance=function(h){return o(h>>16&255,h>>8&255,255&h)},c.relativeLuminance2=o}(p=R.rgb||(R.rgb={})),function(c){function o(n,a,t){for(var r=n>>24&255,s=n>>16&255,u=n>>8&255,f=a>>24&255,d=a>>16&255,v=a>>8&255,m=i(p.relativeLuminance2(f,v,d),p.relativeLuminance2(r,s,u));m<t&&(f>0||d>0||v>0);)f-=Math.max(0,Math.ceil(.1*f)),d-=Math.max(0,Math.ceil(.1*d)),v-=Math.max(0,Math.ceil(.1*v)),m=i(p.relativeLuminance2(f,v,d),p.relativeLuminance2(r,s,u));return(f<<24|d<<16|v<<8|255)>>>0}function h(n,a,t){for(var r=n>>24&255,s=n>>16&255,u=n>>8&255,f=a>>24&255,d=a>>16&255,v=a>>8&255,m=i(p.relativeLuminance2(f,v,d),p.relativeLuminance2(r,s,u));m<t&&(f<255||d<255||v<255);)f=Math.min(255,f+Math.ceil(.1*(255-f))),d=Math.min(255,d+Math.ceil(.1*(255-d))),v=Math.min(255,v+Math.ceil(.1*(255-v))),m=i(p.relativeLuminance2(f,v,d),p.relativeLuminance2(r,s,u));return(f<<24|d<<16|v<<8|255)>>>0}c.ensureContrastRatio=function(n,a,t){var r=p.relativeLuminance(n>>8),s=p.relativeLuminance(a>>8);if(i(r,s)<t)return s<r?o(n,a,t):h(n,a,t)},c.reduceLuminance=o,c.increaseLuminance=h,c.toChannels=function(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]},c.toColor=function(n,a,t){return{css:L.toCss(n,a,t),rgba:L.toRgba(n,a,t)}}}(E=R.rgba||(R.rgba={})),R.toPaddedHex=b,R.contrastRatio=i},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.isLinux=R.isWindows=R.isIphone=R.isIpad=R.isMac=R.isSafari=R.isFirefox=void 0;var L=typeof navigator=="undefined",M=L?"node":navigator.userAgent,p=L?"node":navigator.platform;function E(b,i){return b.indexOf(i)>=0}R.isFirefox=!!~M.indexOf("Firefox"),R.isSafari=/^((?!chrome|android).)*safari/i.test(M),R.isMac=E(["Macintosh","MacIntel","MacPPC","Mac68K"],p),R.isIpad=p==="iPad",R.isIphone=p==="iPhone",R.isWindows=E(["Windows","Win16","Win32","WinCE"],p),R.isLinux=p.indexOf("Linux")>=0},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.C1=R.C0=void 0,function(L){L.NUL="\0",L.SOH="",L.STX="",L.ETX="",L.EOT="",L.ENQ="",L.ACK="",L.BEL="\x07",L.BS="\b",L.HT=" ",L.LF=`
`,L.VT="\v",L.FF="\f",L.CR="\r",L.SO="",L.SI="",L.DLE="",L.DC1="",L.DC2="",L.DC3="",L.DC4="",L.NAK="",L.SYN="",L.ETB="",L.CAN="",L.EM="",L.SUB="",L.ESC="",L.FS="",L.GS="",L.RS="",L.US="",L.SP=" ",L.DEL="\x7F"}(R.C0||(R.C0={})),function(L){L.PAD="\x80",L.HOP="\x81",L.BPH="\x82",L.NBH="\x83",L.IND="\x84",L.NEL="\x85",L.SSA="\x86",L.ESA="\x87",L.HTS="\x88",L.HTJ="\x89",L.VTS="\x8A",L.PLD="\x8B",L.PLU="\x8C",L.RI="\x8D",L.SS2="\x8E",L.SS3="\x8F",L.DCS="\x90",L.PU1="\x91",L.PU2="\x92",L.STS="\x93",L.CCH="\x94",L.MW="\x95",L.SPA="\x96",L.EPA="\x97",L.SOS="\x98",L.SGCI="\x99",L.SCI="\x9A",L.CSI="\x9B",L.ST="\x9C",L.OSC="\x9D",L.PM="\x9E",L.APC="\x9F"}(R.C1||(R.C1={}))},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.BaseRenderLayer=void 0;var L=I(3),M=I(9),p=I(25),E=I(6),b=I(28),i=I(10),c=I(17),o=function(){function h(n,a,t,r,s,u,f,d){this._container=n,this._alpha=r,this._colors=s,this._rendererId=u,this._bufferService=f,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-"+a+"-layer"),this._canvas.style.zIndex=t.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return h.prototype.dispose=function(){var n;c.removeElementFromParent(this._canvas),(n=this._charAtlas)===null||n===void 0||n.dispose()},h.prototype._initCanvas=function(){this._ctx=b.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},h.prototype.onOptionsChanged=function(){},h.prototype.onBlur=function(){},h.prototype.onFocus=function(){},h.prototype.onCursorMove=function(){},h.prototype.onGridChanged=function(n,a){},h.prototype.onSelectionChanged=function(n,a,t){t===void 0&&(t=!1)},h.prototype.setColors=function(n){this._refreshCharAtlas(n)},h.prototype._setTransparency=function(n){if(n!==this._alpha){var a=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,a),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},h.prototype._refreshCharAtlas=function(n){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=p.acquireCharAtlas(this._optionsService.options,this._rendererId,n,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},h.prototype.resize=function(n){this._scaledCellWidth=n.scaledCellWidth,this._scaledCellHeight=n.scaledCellHeight,this._scaledCharWidth=n.scaledCharWidth,this._scaledCharHeight=n.scaledCharHeight,this._scaledCharLeft=n.scaledCharLeft,this._scaledCharTop=n.scaledCharTop,this._canvas.width=n.scaledCanvasWidth,this._canvas.height=n.scaledCanvasHeight,this._canvas.style.width=n.canvasWidth+"px",this._canvas.style.height=n.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},h.prototype._fillCells=function(n,a,t,r){this._ctx.fillRect(n*this._scaledCellWidth,a*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight)},h.prototype._fillBottomLineAtCells=function(n,a,t){t===void 0&&(t=1),this._ctx.fillRect(n*this._scaledCellWidth,(a+1)*this._scaledCellHeight-window.devicePixelRatio-1,t*this._scaledCellWidth,window.devicePixelRatio)},h.prototype._fillLeftLineAtCell=function(n,a,t){this._ctx.fillRect(n*this._scaledCellWidth,a*this._scaledCellHeight,window.devicePixelRatio*t,this._scaledCellHeight)},h.prototype._strokeRectAtCell=function(n,a,t,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(n*this._scaledCellWidth+window.devicePixelRatio/2,a*this._scaledCellHeight+window.devicePixelRatio/2,t*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},h.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))},h.prototype._clearCells=function(n,a,t,r){this._alpha?this._ctx.clearRect(n*this._scaledCellWidth,a*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(n*this._scaledCellWidth,a*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight))},h.prototype._fillCharTrueColor=function(n,a,t){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(t),this._ctx.fillText(n.getChars(),a*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},h.prototype._drawChars=function(n,a,t){var r,s,u=this._getContrastColor(n);u||n.isFgRGB()||n.isBgRGB()?this._drawUncachedChars(n,a,t,u):(n.isInverse()?(r=n.isBgDefault()?M.INVERTED_DEFAULT_COLOR:n.getBgColor(),s=n.isFgDefault()?M.INVERTED_DEFAULT_COLOR:n.getFgColor()):(s=n.isBgDefault()?L.DEFAULT_COLOR:n.getBgColor(),r=n.isFgDefault()?L.DEFAULT_COLOR:n.getFgColor()),r+=this._optionsService.options.drawBoldTextInBrightColors&&n.isBold()&&r<8?8:0,this._currentGlyphIdentifier.chars=n.getChars()||L.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=n.getCode()||L.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=r,this._currentGlyphIdentifier.bold=!!n.isBold(),this._currentGlyphIdentifier.dim=!!n.isDim(),this._currentGlyphIdentifier.italic=!!n.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,a*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(n,a,t))},h.prototype._drawUncachedChars=function(n,a,t,r){if(this._ctx.save(),this._ctx.font=this._getFont(!!n.isBold(),!!n.isItalic()),this._ctx.textBaseline="middle",n.isInverse())if(r)this._ctx.fillStyle=r.css;else if(n.isBgDefault())this._ctx.fillStyle=i.color.opaque(this._colors.background).css;else if(n.isBgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(n.getBgColor()).join(",")+")";else{var s=n.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&n.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}else if(r)this._ctx.fillStyle=r.css;else if(n.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(n.isFgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(n.getFgColor()).join(",")+")";else{var u=n.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&n.isBold()&&u<8&&(u+=8),this._ctx.fillStyle=this._colors.ansi[u].css}this._clipRow(t),n.isDim()&&(this._ctx.globalAlpha=M.DIM_OPACITY),this._ctx.fillText(n.getChars(),a*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},h.prototype._clipRow=function(n){this._ctx.beginPath(),this._ctx.rect(0,n*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},h.prototype._getFont=function(n,a){return(a?"italic":"")+" "+(n?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},h.prototype._getContrastColor=function(n){if(this._optionsService.options.minimumContrastRatio!==1){var a=this._colors.contrastCache.getColor(n.bg,n.fg);if(a!==void 0)return a||void 0;var t=n.getFgColor(),r=n.getFgColorMode(),s=n.getBgColor(),u=n.getBgColorMode(),f=!!n.isInverse(),d=!!n.isInverse();if(f){var v=t;t=s,s=v;var m=r;r=u,u=m}var S=this._resolveBackgroundRgba(u,s,f),C=this._resolveForegroundRgba(r,t,f,d),_=i.rgba.ensureContrastRatio(S,C,this._optionsService.options.minimumContrastRatio);if(_){var y={css:i.channels.toCss(_>>24&255,_>>16&255,_>>8&255),rgba:_};return this._colors.contrastCache.setColor(n.bg,n.fg,y),y}this._colors.contrastCache.setColor(n.bg,n.fg,null)}},h.prototype._resolveBackgroundRgba=function(n,a,t){switch(n){case 16777216:case 33554432:return this._colors.ansi[a].rgba;case 50331648:return a<<8;case 0:default:return t?this._colors.foreground.rgba:this._colors.background.rgba}},h.prototype._resolveForegroundRgba=function(n,a,t,r){switch(n){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&a<8&&(a+=8),this._colors.ansi[a].rgba;case 50331648:return a<<8;case 0:default:return t?this._colors.background.rgba:this._colors.foreground.rgba}},h}();R.BaseRenderLayer=o},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.createDecorator=R.getServiceDependencies=R.serviceRegistry=void 0;function L(M,p,E){p.di$target===p?p.di$dependencies.push({id:M,index:E}):(p.di$dependencies=[{id:M,index:E}],p.di$target=p)}R.serviceRegistry=new Map,R.getServiceDependencies=function(M){return M.di$dependencies||[]},R.createDecorator=function(M){if(R.serviceRegistry.has(M))return R.serviceRegistry.get(M);var p=function(E,b,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");L(p,E,i)};return p.toString=function(){return M},R.serviceRegistry.set(M,p),p}},function(G,R,I){"use strict";function L(M,p,E,b){if(E===void 0&&(E=0),b===void 0&&(b=M.length),E>=M.length)return M;E=(M.length+E)%M.length,b=b>=M.length?M.length:(M.length+b)%M.length;for(var i=E;i<b;++i)M[i]=p;return M}Object.defineProperty(R,"__esModule",{value:!0}),R.concat=R.fillFallback=R.fill=void 0,R.fill=function(M,p,E,b){return M.fill?M.fill(p,E,b):L(M,p,E,b)},R.fillFallback=L,R.concat=function(M,p){var E=new M.constructor(M.length+p.length);return E.set(M),E.set(p,M.length),E}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.BufferLine=R.DEFAULT_ATTR_DATA=void 0;var L=I(8),M=I(3),p=I(4),E=I(6);R.DEFAULT_ATTR_DATA=Object.freeze(new E.AttributeData);var b=function(){function i(c,o,h){h===void 0&&(h=!1),this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);for(var n=o||p.CellData.fromCharData([0,M.NULL_CELL_CHAR,M.NULL_CELL_WIDTH,M.NULL_CELL_CODE]),a=0;a<c;++a)this.setCell(a,n);this.length=c}return i.prototype.get=function(c){var o=this._data[3*c+0],h=2097151&o;return[this._data[3*c+1],2097152&o?this._combined[c]:h?L.stringFromCodePoint(h):"",o>>22,2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):h]},i.prototype.set=function(c,o){this._data[3*c+1]=o[M.CHAR_DATA_ATTR_INDEX],o[M.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=o[1],this._data[3*c+0]=2097152|c|o[M.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=o[M.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[M.CHAR_DATA_WIDTH_INDEX]<<22},i.prototype.getWidth=function(c){return this._data[3*c+0]>>22},i.prototype.hasWidth=function(c){return 12582912&this._data[3*c+0]},i.prototype.getFg=function(c){return this._data[3*c+1]},i.prototype.getBg=function(c){return this._data[3*c+2]},i.prototype.hasContent=function(c){return 4194303&this._data[3*c+0]},i.prototype.getCodePoint=function(c){var o=this._data[3*c+0];return 2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&o},i.prototype.isCombined=function(c){return 2097152&this._data[3*c+0]},i.prototype.getString=function(c){var o=this._data[3*c+0];return 2097152&o?this._combined[c]:2097151&o?L.stringFromCodePoint(2097151&o):""},i.prototype.loadCell=function(c,o){var h=3*c;return o.content=this._data[h+0],o.fg=this._data[h+1],o.bg=this._data[h+2],2097152&o.content&&(o.combinedData=this._combined[c]),268435456&o.bg&&(o.extended=this._extendedAttrs[c]),o},i.prototype.setCell=function(c,o){2097152&o.content&&(this._combined[c]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[c]=o.extended),this._data[3*c+0]=o.content,this._data[3*c+1]=o.fg,this._data[3*c+2]=o.bg},i.prototype.setCellFromCodePoint=function(c,o,h,n,a,t){268435456&a&&(this._extendedAttrs[c]=t),this._data[3*c+0]=o|h<<22,this._data[3*c+1]=n,this._data[3*c+2]=a},i.prototype.addCodepointToCell=function(c,o){var h=this._data[3*c+0];2097152&h?this._combined[c]+=L.stringFromCodePoint(o):(2097151&h?(this._combined[c]=L.stringFromCodePoint(2097151&h)+L.stringFromCodePoint(o),h&=-2097152,h|=2097152):h=o|1<<22,this._data[3*c+0]=h)},i.prototype.insertCells=function(c,o,h,n){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodePoint(c-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs),o<this.length-c){for(var a=new p.CellData,t=this.length-c-o-1;t>=0;--t)this.setCell(c+o+t,this.loadCell(c+t,a));for(t=0;t<o;++t)this.setCell(c+t,h)}else for(t=c;t<this.length;++t)this.setCell(t,h);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs)},i.prototype.deleteCells=function(c,o,h,n){if(c%=this.length,o<this.length-c){for(var a=new p.CellData,t=0;t<this.length-c-o;++t)this.setCell(c+t,this.loadCell(c+o+t,a));for(t=this.length-o;t<this.length;++t)this.setCell(t,h)}else for(t=c;t<this.length;++t)this.setCell(t,h);c&&this.getWidth(c-1)===2&&this.setCellFromCodePoint(c-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodePoint(c,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs)},i.prototype.replaceCells=function(c,o,h,n){for(c&&this.getWidth(c-1)===2&&this.setCellFromCodePoint(c-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs);c<o&&c<this.length;)this.setCell(c++,h)},i.prototype.resize=function(c,o){if(c!==this.length){if(c>this.length){var h=new Uint32Array(3*c);this.length&&(3*c<this._data.length?h.set(this._data.subarray(0,3*c)):h.set(this._data)),this._data=h;for(var n=this.length;n<c;++n)this.setCell(n,o)}else if(c){(h=new Uint32Array(3*c)).set(this._data.subarray(0,3*c)),this._data=h;var a=Object.keys(this._combined);for(n=0;n<a.length;n++){var t=parseInt(a[n],10);t>=c&&delete this._combined[t]}}else this._data=new Uint32Array(0),this._combined={};this.length=c}},i.prototype.fill=function(c){this._combined={},this._extendedAttrs={};for(var o=0;o<this.length;++o)this.setCell(o,c)},i.prototype.copyFrom=function(c){for(var o in this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={},c._combined)this._combined[o]=c._combined[o];for(var o in this._extendedAttrs={},c._extendedAttrs)this._extendedAttrs[o]=c._extendedAttrs[o];this.isWrapped=c.isWrapped},i.prototype.clone=function(){var c=new i(0);for(var o in c._data=new Uint32Array(this._data),c.length=this.length,this._combined)c._combined[o]=this._combined[o];for(var o in this._extendedAttrs)c._extendedAttrs[o]=this._extendedAttrs[o];return c.isWrapped=this.isWrapped,c},i.prototype.getTrimmedLength=function(){for(var c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0},i.prototype.copyCellsFrom=function(c,o,h,n,a){var t=c._data;if(a)for(var r=n-1;r>=0;r--)for(var s=0;s<3;s++)this._data[3*(h+r)+s]=t[3*(o+r)+s];else for(r=0;r<n;r++)for(s=0;s<3;s++)this._data[3*(h+r)+s]=t[3*(o+r)+s];var u=Object.keys(c._combined);for(s=0;s<u.length;s++){var f=parseInt(u[s],10);f>=o&&(this._combined[f-o+h]=c._combined[f])}},i.prototype.translateToString=function(c,o,h){c===void 0&&(c=!1),o===void 0&&(o=0),h===void 0&&(h=this.length),c&&(h=Math.min(h,this.getTrimmedLength()));for(var n="";o<h;){var a=this._data[3*o+0],t=2097151&a;n+=2097152&a?this._combined[o]:t?L.stringFromCodePoint(t):M.WHITESPACE_CELL_CHAR,o+=a>>22||1}return n},i}();R.BufferLine=b},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.removeElementFromParent=void 0,R.removeElementFromParent=function(){for(var L,M=[],p=0;p<arguments.length;p++)M[p]=arguments[p];for(var E=0,b=M;E<b.length;E++){var i=b[E];(L=i==null?void 0:i.parentElement)===null||L===void 0||L.removeChild(i)}}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.tooMuchOutput=R.promptLabel=void 0,R.promptLabel="Terminal input",R.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(C,_){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var k in T)T.hasOwnProperty(k)&&(y[k]=T[k])})(C,_)},function(C,_){function y(){this.constructor=C}L(C,_),C.prototype=_===null?Object.create(_):(y.prototype=_.prototype,new y)});Object.defineProperty(R,"__esModule",{value:!0}),R.InputHandler=R.WindowsOptionsReportType=void 0;var p,E=I(12),b=I(20),i=I(39),c=I(2),o=I(15),h=I(8),n=I(16),a=I(0),t=I(3),r=I(4),s=I(6),u=I(22),f=I(24),d={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function v(C,_){if(C>24)return _.setWinLines||!1;switch(C){case 1:return!!_.restoreWin;case 2:return!!_.minimizeWin;case 3:return!!_.setWinPosition;case 4:return!!_.setWinSizePixels;case 5:return!!_.raiseWin;case 6:return!!_.lowerWin;case 7:return!!_.refreshWin;case 8:return!!_.setWinSizeChars;case 9:return!!_.maximizeWin;case 10:return!!_.fullscreenWin;case 11:return!!_.getWinState;case 13:return!!_.getWinPosition;case 14:return!!_.getWinSizePixels;case 15:return!!_.getScreenSizePixels;case 16:return!!_.getCellSizePixels;case 18:return!!_.getWinSizeChars;case 19:return!!_.getScreenSizeChars;case 20:return!!_.getIconTitle;case 21:return!!_.getWinTitle;case 22:return!!_.pushTitle;case 23:return!!_.popTitle;case 24:return!!_.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"}(p=R.WindowsOptionsReportType||(R.WindowsOptionsReportType={}));var m=function(){function C(_,y,T,k){this._bufferService=_,this._coreService=y,this._logService=T,this._optionsService=k,this._data=new Uint32Array(0)}return C.prototype.hook=function(_){this._data=new Uint32Array(0)},C.prototype.put=function(_,y,T){this._data=o.concat(this._data,_.subarray(y,T))},C.prototype.unhook=function(_){if(_){var y=h.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 k={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return k-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+k+" 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 _(y,T,k,g,F,P,N,W,j){j===void 0&&(j=new i.EscapeSequenceParser);var A=C.call(this)||this;A._bufferService=y,A._charsetService=T,A._coreService=k,A._dirtyRowService=g,A._logService=F,A._optionsService=P,A._coreMouseService=N,A._unicodeService=W,A._parser=j,A._parseBuffer=new Uint32Array(4096),A._stringDecoder=new h.StringToUtf32,A._utf8Decoder=new h.Utf8ToUtf32,A._workCell=new r.CellData,A._windowTitle="",A._iconName="",A._windowTitleStack=[],A._iconNameStack=[],A._curAttrData=n.DEFAULT_ATTR_DATA.clone(),A._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),A._onRequestBell=new a.EventEmitter,A._onRequestRefreshRows=new a.EventEmitter,A._onRequestReset=new a.EventEmitter,A._onRequestScroll=new a.EventEmitter,A._onRequestSyncScrollBar=new a.EventEmitter,A._onRequestWindowsOptionsReport=new a.EventEmitter,A._onA11yChar=new a.EventEmitter,A._onA11yTab=new a.EventEmitter,A._onCursorMove=new a.EventEmitter,A._onLineFeed=new a.EventEmitter,A._onScroll=new a.EventEmitter,A._onTitleChange=new a.EventEmitter,A.register(A._parser),A._parser.setCsiHandlerFallback(function(z,te){A._logService.debug("Unknown CSI code: ",{identifier:A._parser.identToString(z),params:te.toArray()})}),A._parser.setEscHandlerFallback(function(z){A._logService.debug("Unknown ESC code: ",{identifier:A._parser.identToString(z)})}),A._parser.setExecuteHandlerFallback(function(z){A._logService.debug("Unknown EXECUTE code: ",{code:z})}),A._parser.setOscHandlerFallback(function(z,te,de){A._logService.debug("Unknown OSC code: ",{identifier:z,action:te,data:de})}),A._parser.setDcsHandlerFallback(function(z,te,de){te==="HOOK"&&(de=de.toArray()),A._logService.debug("Unknown DCS code: ",{identifier:A._parser.identToString(z),action:te,payload:de})}),A._parser.setPrintHandler(function(z,te,de){return A.print(z,te,de)}),A._parser.setCsiHandler({final:"@"},function(z){return A.insertChars(z)}),A._parser.setCsiHandler({intermediates:" ",final:"@"},function(z){return A.scrollLeft(z)}),A._parser.setCsiHandler({final:"A"},function(z){return A.cursorUp(z)}),A._parser.setCsiHandler({intermediates:" ",final:"A"},function(z){return A.scrollRight(z)}),A._parser.setCsiHandler({final:"B"},function(z){return A.cursorDown(z)}),A._parser.setCsiHandler({final:"C"},function(z){return A.cursorForward(z)}),A._parser.setCsiHandler({final:"D"},function(z){return A.cursorBackward(z)}),A._parser.setCsiHandler({final:"E"},function(z){return A.cursorNextLine(z)}),A._parser.setCsiHandler({final:"F"},function(z){return A.cursorPrecedingLine(z)}),A._parser.setCsiHandler({final:"G"},function(z){return A.cursorCharAbsolute(z)}),A._parser.setCsiHandler({final:"H"},function(z){return A.cursorPosition(z)}),A._parser.setCsiHandler({final:"I"},function(z){return A.cursorForwardTab(z)}),A._parser.setCsiHandler({final:"J"},function(z){return A.eraseInDisplay(z)}),A._parser.setCsiHandler({prefix:"?",final:"J"},function(z){return A.eraseInDisplay(z)}),A._parser.setCsiHandler({final:"K"},function(z){return A.eraseInLine(z)}),A._parser.setCsiHandler({prefix:"?",final:"K"},function(z){return A.eraseInLine(z)}),A._parser.setCsiHandler({final:"L"},function(z){return A.insertLines(z)}),A._parser.setCsiHandler({final:"M"},function(z){return A.deleteLines(z)}),A._parser.setCsiHandler({final:"P"},function(z){return A.deleteChars(z)}),A._parser.setCsiHandler({final:"S"},function(z){return A.scrollUp(z)}),A._parser.setCsiHandler({final:"T"},function(z){return A.scrollDown(z)}),A._parser.setCsiHandler({final:"X"},function(z){return A.eraseChars(z)}),A._parser.setCsiHandler({final:"Z"},function(z){return A.cursorBackwardTab(z)}),A._parser.setCsiHandler({final:"`"},function(z){return A.charPosAbsolute(z)}),A._parser.setCsiHandler({final:"a"},function(z){return A.hPositionRelative(z)}),A._parser.setCsiHandler({final:"b"},function(z){return A.repeatPrecedingCharacter(z)}),A._parser.setCsiHandler({final:"c"},function(z){return A.sendDeviceAttributesPrimary(z)}),A._parser.setCsiHandler({prefix:">",final:"c"},function(z){return A.sendDeviceAttributesSecondary(z)}),A._parser.setCsiHandler({final:"d"},function(z){return A.linePosAbsolute(z)}),A._parser.setCsiHandler({final:"e"},function(z){return A.vPositionRelative(z)}),A._parser.setCsiHandler({final:"f"},function(z){return A.hVPosition(z)}),A._parser.setCsiHandler({final:"g"},function(z){return A.tabClear(z)}),A._parser.setCsiHandler({final:"h"},function(z){return A.setMode(z)}),A._parser.setCsiHandler({prefix:"?",final:"h"},function(z){return A.setModePrivate(z)}),A._parser.setCsiHandler({final:"l"},function(z){return A.resetMode(z)}),A._parser.setCsiHandler({prefix:"?",final:"l"},function(z){return A.resetModePrivate(z)}),A._parser.setCsiHandler({final:"m"},function(z){return A.charAttributes(z)}),A._parser.setCsiHandler({final:"n"},function(z){return A.deviceStatus(z)}),A._parser.setCsiHandler({prefix:"?",final:"n"},function(z){return A.deviceStatusPrivate(z)}),A._parser.setCsiHandler({intermediates:"!",final:"p"},function(z){return A.softReset(z)}),A._parser.setCsiHandler({intermediates:" ",final:"q"},function(z){return A.setCursorStyle(z)}),A._parser.setCsiHandler({final:"r"},function(z){return A.setScrollRegion(z)}),A._parser.setCsiHandler({final:"s"},function(z){return A.saveCursor(z)}),A._parser.setCsiHandler({final:"t"},function(z){return A.windowOptions(z)}),A._parser.setCsiHandler({final:"u"},function(z){return A.restoreCursor(z)}),A._parser.setCsiHandler({intermediates:"'",final:"}"},function(z){return A.insertColumns(z)}),A._parser.setCsiHandler({intermediates:"'",final:"~"},function(z){return A.deleteColumns(z)}),A._parser.setExecuteHandler(E.C0.BEL,function(){return A.bell()}),A._parser.setExecuteHandler(E.C0.LF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(E.C0.VT,function(){return A.lineFeed()}),A._parser.setExecuteHandler(E.C0.FF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(E.C0.CR,function(){return A.carriageReturn()}),A._parser.setExecuteHandler(E.C0.BS,function(){return A.backspace()}),A._parser.setExecuteHandler(E.C0.HT,function(){return A.tab()}),A._parser.setExecuteHandler(E.C0.SO,function(){return A.shiftOut()}),A._parser.setExecuteHandler(E.C0.SI,function(){return A.shiftIn()}),A._parser.setExecuteHandler(E.C1.IND,function(){return A.index()}),A._parser.setExecuteHandler(E.C1.NEL,function(){return A.nextLine()}),A._parser.setExecuteHandler(E.C1.HTS,function(){return A.tabSet()}),A._parser.setOscHandler(0,new u.OscHandler(function(z){A.setTitle(z),A.setIconName(z)})),A._parser.setOscHandler(1,new u.OscHandler(function(z){return A.setIconName(z)})),A._parser.setOscHandler(2,new u.OscHandler(function(z){return A.setTitle(z)})),A._parser.setEscHandler({final:"7"},function(){return A.saveCursor()}),A._parser.setEscHandler({final:"8"},function(){return A.restoreCursor()}),A._parser.setEscHandler({final:"D"},function(){return A.index()}),A._parser.setEscHandler({final:"E"},function(){return A.nextLine()}),A._parser.setEscHandler({final:"H"},function(){return A.tabSet()}),A._parser.setEscHandler({final:"M"},function(){return A.reverseIndex()}),A._parser.setEscHandler({final:"="},function(){return A.keypadApplicationMode()}),A._parser.setEscHandler({final:">"},function(){return A.keypadNumericMode()}),A._parser.setEscHandler({final:"c"},function(){return A.fullReset()}),A._parser.setEscHandler({final:"n"},function(){return A.setgLevel(2)}),A._parser.setEscHandler({final:"o"},function(){return A.setgLevel(3)}),A._parser.setEscHandler({final:"|"},function(){return A.setgLevel(3)}),A._parser.setEscHandler({final:"}"},function(){return A.setgLevel(2)}),A._parser.setEscHandler({final:"~"},function(){return A.setgLevel(1)}),A._parser.setEscHandler({intermediates:"%",final:"@"},function(){return A.selectDefaultCharset()}),A._parser.setEscHandler({intermediates:"%",final:"G"},function(){return A.selectDefaultCharset()});var K=function(z){U._parser.setEscHandler({intermediates:"(",final:z},function(){return A.selectCharset("("+z)}),U._parser.setEscHandler({intermediates:")",final:z},function(){return A.selectCharset(")"+z)}),U._parser.setEscHandler({intermediates:"*",final:z},function(){return A.selectCharset("*"+z)}),U._parser.setEscHandler({intermediates:"+",final:z},function(){return A.selectCharset("+"+z)}),U._parser.setEscHandler({intermediates:"-",final:z},function(){return A.selectCharset("-"+z)}),U._parser.setEscHandler({intermediates:".",final:z},function(){return A.selectCharset("."+z)}),U._parser.setEscHandler({intermediates:"/",final:z},function(){return A.selectCharset("/"+z)})},U=this;for(var O in b.CHARSETS)K(O);return A._parser.setEscHandler({intermediates:"#",final:"8"},function(){return A.screenAlignmentPattern()}),A._parser.setErrorHandler(function(z){return A._logService.error("Parsing error: ",z),z}),A._parser.setDcsHandler({intermediates:"$",final:"q"},new m(A._bufferService,A._coreService,A._logService,A._optionsService)),A}return M(_,C),Object.defineProperty(_.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),_.prototype.dispose=function(){C.prototype.dispose.call(this)},_.prototype.parse=function(y){var T=this._bufferService.buffer,k=T.x,g=T.y;if(this._logService.debug("parsing data",y),this._parseBuffer.length<y.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(y.length,131072))),this._dirtyRowService.clearRange(),y.length>131072)for(var F=0;F<y.length;F+=131072){var P=F+131072<y.length?F+131072:y.length,N=typeof y=="string"?this._stringDecoder.decode(y.substring(F,P),this._parseBuffer):this._utf8Decoder.decode(y.subarray(F,P),this._parseBuffer);this._parser.parse(this._parseBuffer,N)}else N=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer),this._parser.parse(this._parseBuffer,N);(T=this._bufferService.buffer).x===k&&T.y===g||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},_.prototype.print=function(y,T,k){var g,F,P=this._bufferService.buffer,N=this._charsetService.charset,W=this._optionsService.options.screenReaderMode,j=this._bufferService.cols,A=this._coreService.decPrivateModes.wraparound,K=this._coreService.modes.insertMode,U=this._curAttrData,O=P.lines.get(P.ybase+P.y);this._dirtyRowService.markDirty(P.y),P.x&&k-T>0&&O.getWidth(P.x-1)===2&&O.setCellFromCodePoint(P.x-1,0,1,U.fg,U.bg,U.extended);for(var z=T;z<k;++z){if(g=y[z],F=this._unicodeService.wcwidth(g),g<127&&N){var te=N[String.fromCharCode(g)];te&&(g=te.charCodeAt(0))}if(W&&this._onA11yChar.fire(h.stringFromCodePoint(g)),F||!P.x){if(P.x+F-1>=j){if(A){for(;P.x<j;)O.setCellFromCodePoint(P.x++,0,1,U.fg,U.bg,U.extended);P.x=0,P.y++,P.y===P.scrollBottom+1?(P.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(P.y>=this._bufferService.rows&&(P.y=this._bufferService.rows-1),P.lines.get(P.ybase+P.y).isWrapped=!0),O=P.lines.get(P.ybase+P.y)}else if(P.x=j-1,F===2)continue}if(K&&(O.insertCells(P.x,F,P.getNullCell(U),U),O.getWidth(j-1)===2&&O.setCellFromCodePoint(j-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,U.fg,U.bg,U.extended)),O.setCellFromCodePoint(P.x++,g,F,U.fg,U.bg,U.extended),F>0)for(;--F;)O.setCellFromCodePoint(P.x++,0,0,U.fg,U.bg,U.extended)}else O.getWidth(P.x-1)?O.addCodepointToCell(P.x-1,g):O.addCodepointToCell(P.x-2,g)}k-T>0&&(O.loadCell(P.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),P.x<j&&k-T>0&&O.getWidth(P.x)===0&&!O.hasContent(P.x)&&O.setCellFromCodePoint(P.x,0,1,U.fg,U.bg,U.extended),this._dirtyRowService.markDirty(P.y)},_.prototype.addCsiHandler=function(y,T){var k=this;return y.final!=="t"||y.prefix||y.intermediates?this._parser.addCsiHandler(y,T):this._parser.addCsiHandler(y,function(g){return!v(g.params[0],k._optionsService.options.windowOptions)||T(g)})},_.prototype.addDcsHandler=function(y,T){return this._parser.addDcsHandler(y,new f.DcsHandler(T))},_.prototype.addEscHandler=function(y,T){return this._parser.addEscHandler(y,T)},_.prototype.addOscHandler=function(y,T){return this._parser.addOscHandler(y,new u.OscHandler(T))},_.prototype.bell=function(){this._onRequestBell.fire()},_.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()},_.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},_.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 k=T.lines.get(T.ybase+T.y);k.hasWidth(T.x)&&!k.hasContent(T.x)&&T.x--}this._restrictCursor()},_.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)}},_.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},_.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},_.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)},_.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)},_.prototype._moveCursor=function(y,T){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+y,this._bufferService.buffer.y+T)},_.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))},_.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)},_.prototype.cursorForward=function(y){this._moveCursor(y.params[0]||1,0)},_.prototype.cursorBackward=function(y){this._moveCursor(-(y.params[0]||1),0)},_.prototype.cursorNextLine=function(y){this.cursorDown(y),this._bufferService.buffer.x=0},_.prototype.cursorPrecedingLine=function(y){this.cursorUp(y),this._bufferService.buffer.x=0},_.prototype.cursorCharAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.cursorPosition=function(y){this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1)},_.prototype.charPosAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.hPositionRelative=function(y){this._moveCursor(y.params[0]||1,0)},_.prototype.linePosAbsolute=function(y){this._setCursor(this._bufferService.buffer.x,(y.params[0]||1)-1)},_.prototype.vPositionRelative=function(y){this._moveCursor(0,y.params[0]||1)},_.prototype.hVPosition=function(y){this.cursorPosition(y)},_.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={})},_.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()},_.prototype.cursorBackwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var T=y.params[0]||1,k=this._bufferService.buffer;T--;)k.x=k.prevStop()},_.prototype._eraseInBufferLine=function(y,T,k,g){g===void 0&&(g=!1);var F=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);F.replaceCells(T,k,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),g&&(F.isWrapped=!1)},_.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},_.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.rows;T++)this._resetBufferLine(T);this._dirtyRowService.markDirty(T);break;case 1:for(T=this._bufferService.buffer.y,this._dirtyRowService.markDirty(T),this._eraseInBufferLine(T,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=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 k=this._bufferService.buffer.lines.length-this._bufferService.rows;k>0&&(this._bufferService.buffer.lines.trimStart(k),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-k,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-k,0),this._onScroll.fire(0))}},_.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)},_.prototype.insertLines=function(y){this._restrictCursor();var T=y.params[0]||1,k=this._bufferService.buffer;if(!(k.y>k.scrollBottom||k.y<k.scrollTop)){for(var g=k.ybase+k.y,F=this._bufferService.rows-1-k.scrollBottom,P=this._bufferService.rows-1+k.ybase-F+1;T--;)k.lines.splice(P-1,1),k.lines.splice(g,0,k.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(k.y,k.scrollBottom),k.x=0}},_.prototype.deleteLines=function(y){this._restrictCursor();var T=y.params[0]||1,k=this._bufferService.buffer;if(!(k.y>k.scrollBottom||k.y<k.scrollTop)){var g,F=k.ybase+k.y;for(g=this._bufferService.rows-1-k.scrollBottom,g=this._bufferService.rows-1+k.ybase-g;T--;)k.lines.splice(F,1),k.lines.splice(g,0,k.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(k.y,k.scrollBottom),k.x=0}},_.prototype.insertChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.insertCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.deleteChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.deleteCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.scrollUp=function(y){for(var T=y.params[0]||1,k=this._bufferService.buffer;T--;)k.lines.splice(k.ybase+k.scrollTop,1),k.lines.splice(k.ybase+k.scrollBottom,0,k.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(k.scrollTop,k.scrollBottom)},_.prototype.scrollDown=function(y){for(var T=y.params[0]||1,k=this._bufferService.buffer;T--;)k.lines.splice(k.ybase+k.scrollBottom,1),k.lines.splice(k.ybase+k.scrollTop,0,k.getBlankLine(n.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(k.scrollTop,k.scrollBottom)},_.prototype.scrollLeft=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var k=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=T.lines.get(T.ybase+g);F.deleteCells(0,k,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.scrollRight=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var k=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=T.lines.get(T.ybase+g);F.insertCells(0,k,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.insertColumns=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var k=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=this._bufferService.buffer.lines.get(T.ybase+g);F.insertCells(T.x,k,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.deleteColumns=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var k=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=T.lines.get(T.ybase+g);F.deleteCells(T.x,k,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.eraseChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(y.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.repeatPrecedingCharacter=function(y){if(this._parser.precedingCodepoint){for(var T=y.params[0]||1,k=new Uint32Array(T),g=0;g<T;++g)k[g]=this._parser.precedingCodepoint;this.print(k,0,k.length)}},_.prototype.sendDeviceAttributesPrimary=function(y){y.params[0]>0||(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"))},_.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"))},_.prototype._is=function(y){return(this._optionsService.options.termName+"").indexOf(y)===0},_.prototype.setMode=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 4:this._coreService.modes.insertMode=!0}},_.prototype.setModePrivate=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},_.prototype.resetMode=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 4:this._coreService.modes.insertMode=!1}},_.prototype.resetModePrivate=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),y.params[T]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},_.prototype._updateAttrColor=function(y,T,k,g,F){return T===2?(y|=50331648,y&=-16777216,y|=s.AttributeData.fromColorRGB([k,g,F])):T===5&&(y&=-50331904,y|=33554432|255&k),y},_.prototype._extractColor=function(y,T,k){var g=[0,0,-1,0,0,0],F=0,P=0;do{if(g[P+F]=y.params[T+P],y.hasSubParams(T+P)){var N=y.getSubParams(T+P),W=0;do g[1]===5&&(F=1),g[P+W+1+F]=N[W];while(++W<N.length&&W+P+1+F<g.length);break}if(g[1]===5&&P+F>=2||g[1]===2&&P+F>=5)break;g[1]&&(F=1)}while(++P+T<y.length&&P+F<g.length);for(W=2;W<g.length;++W)g[W]===-1&&(g[W]=0);switch(g[0]){case 38:k.fg=this._updateAttrColor(k.fg,g[1],g[3],g[4],g[5]);break;case 48:k.bg=this._updateAttrColor(k.bg,g[1],g[3],g[4],g[5]);break;case 58:k.extended=k.extended.clone(),k.extended.underlineColor=this._updateAttrColor(k.extended.underlineColor,g[1],g[3],g[4],g[5])}return P},_.prototype._processUnderline=function(y,T){T.extended=T.extended.clone(),(!~y||y>5)&&(y=1),T.extended.underlineStyle=y,T.fg|=268435456,y===0&&(T.fg&=-268435457),T.updateExtended()},_.prototype.charAttributes=function(y){if(y.length===1&&y.params[0]===0)return this._curAttrData.fg=n.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=n.DEFAULT_ATTR_DATA.bg);for(var T,k=y.length,g=this._curAttrData,F=0;F<k;F++)(T=y.params[F])>=30&&T<=37?(g.fg&=-50331904,g.fg|=16777216|T-30):T>=40&&T<=47?(g.bg&=-50331904,g.bg|=16777216|T-40):T>=90&&T<=97?(g.fg&=-50331904,g.fg|=16777224|T-90):T>=100&&T<=107?(g.bg&=-50331904,g.bg|=16777224|T-100):T===0?(g.fg=n.DEFAULT_ATTR_DATA.fg,g.bg=n.DEFAULT_ATTR_DATA.bg):T===1?g.fg|=134217728:T===3?g.bg|=67108864:T===4?(g.fg|=268435456,this._processUnderline(y.hasSubParams(F)?y.getSubParams(F)[0]:1,g)):T===5?g.fg|=536870912:T===7?g.fg|=67108864:T===8?g.fg|=1073741824:T===2?g.bg|=134217728:T===21?this._processUnderline(2,g):T===22?(g.fg&=-134217729,g.bg&=-134217729):T===23?g.bg&=-67108865:T===24?g.fg&=-268435457:T===25?g.fg&=-536870913:T===27?g.fg&=-67108865:T===28?g.fg&=-1073741825:T===39?(g.fg&=-67108864,g.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):T===49?(g.bg&=-67108864,g.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?F+=this._extractColor(y,F,g):T===59?(g.extended=g.extended.clone(),g.extended.underlineColor=-1,g.updateExtended()):T===100?(g.fg&=-67108864,g.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,g.bg&=-67108864,g.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T)},_.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,k=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"["+T+";"+k+"R")}},_.prototype.deviceStatusPrivate=function(y){switch(y.params[0]){case 6:var T=this._bufferService.buffer.y+1,k=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"[?"+T+";"+k+"R")}},_.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=n.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},_.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 k=T%2==1;this._optionsService.options.cursorBlink=k},_.prototype.setScrollRegion=function(y){var T,k=y.params[0]||1;(y.length<2||(T=y.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>k&&(this._bufferService.buffer.scrollTop=k-1,this._bufferService.buffer.scrollBottom=T-1,this._setCursor(0,0))},_.prototype.windowOptions=function(y){if(v(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(p.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(p.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())}}},_.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},_.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()},_.prototype.setTitle=function(y){this._windowTitle=y,this._onTitleChange.fire(y)},_.prototype.setIconName=function(y){this._iconName=y},_.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},_.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},_.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},_.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,b.DEFAULT_CHARSET)},_.prototype.selectCharset=function(y){y.length===2?y[0]!=="/"&&this._charsetService.setgCharset(d[y[0]],b.CHARSETS[y[1]]||b.DEFAULT_CHARSET):this.selectDefaultCharset()},_.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()},_.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},_.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()},_.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},_.prototype.reset=function(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()},_.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},_.prototype.setgLevel=function(y){this._charsetService.setgLevel(y)},_.prototype.screenAlignmentPattern=function(){var y=new r.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 k=0;k<this._bufferService.rows;++k){var g=T.ybase+T.y+k,F=T.lines.get(g);F&&(F.fill(y),F.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},_}(c.Disposable);R.InputHandler=S},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.DEFAULT_CHARSET=R.CHARSETS=void 0,R.CHARSETS={},R.DEFAULT_CHARSET=R.CHARSETS.B,R.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},R.CHARSETS.A={"#":"\xA3"},R.CHARSETS.B=void 0,R.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},R.CHARSETS.C=R.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},R.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},R.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},R.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},R.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},R.CHARSETS.E=R.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},R.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},R.CHARSETS.H=R.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},R.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.Params=void 0;var L=function(){function M(p,E){if(p===void 0&&(p=32),E===void 0&&(E=32),this.maxLength=p,this.maxSubParamsLength=E,E>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(E),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return M.fromArray=function(p){var E=new M;if(!p.length)return E;for(var b=p[0]instanceof Array?1:0;b<p.length;++b){var i=p[b];if(i instanceof Array)for(var c=0;c<i.length;++c)E.addSubParam(i[c]);else E.addParam(i)}return E},M.prototype.clone=function(){var p=new M(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p},M.prototype.toArray=function(){for(var p=[],E=0;E<this.length;++E){p.push(this.params[E]);var b=this._subParamsIdx[E]>>8,i=255&this._subParamsIdx[E];i-b>0&&p.push(Array.prototype.slice.call(this._subParams,b,i))}return p},M.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},M.prototype.addParam=function(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>2147483647?2147483647:p}},M.prototype.addSubParam=function(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>2147483647?2147483647:p,this._subParamsIdx[this.length-1]++}},M.prototype.hasSubParams=function(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0},M.prototype.getSubParams=function(p){var E=this._subParamsIdx[p]>>8,b=255&this._subParamsIdx[p];return b-E>0?this._subParams.subarray(E,b):null},M.prototype.getSubParamsAll=function(){for(var p={},E=0;E<this.length;++E){var b=this._subParamsIdx[E]>>8,i=255&this._subParamsIdx[E];i-b>0&&(p[E]=this._subParams.slice(b,i))}return p},M.prototype.addDigit=function(p){var E;if(!(this._rejectDigits||!(E=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var b=this._digitIsSub?this._subParams:this.params,i=b[E-1];b[E-1]=~i?Math.min(10*i+p,2147483647):p}},M}();R.Params=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.OscHandler=R.OscParser=void 0;var L=I(23),M=I(8),p=function(){function b(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return b.prototype.addHandler=function(i,c){this._handlers[i]===void 0&&(this._handlers[i]=[]);var o=this._handlers[i];return o.push(c),{dispose:function(){var h=o.indexOf(c);h!==-1&&o.splice(h,1)}}},b.prototype.setHandler=function(i,c){this._handlers[i]=[c]},b.prototype.clearHandler=function(i){this._handlers[i]&&delete this._handlers[i]},b.prototype.setHandlerFallback=function(i){this._handlerFb=i},b.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},b.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},b.prototype._start=function(){var i=this._handlers[this._id];if(i)for(var c=i.length-1;c>=0;c--)i[c].start();else this._handlerFb(this._id,"START")},b.prototype._put=function(i,c,o){var h=this._handlers[this._id];if(h)for(var n=h.length-1;n>=0;n--)h[n].put(i,c,o);else this._handlerFb(this._id,"PUT",M.utf32ToString(i,c,o))},b.prototype._end=function(i){var c=this._handlers[this._id];if(c){for(var o=c.length-1;o>=0&&c[o].end(i)===!1;o--);for(o--;o>=0;o--)c[o].end(!1)}else this._handlerFb(this._id,"END",i)},b.prototype.start=function(){this.reset(),this._id=-1,this._state=1},b.prototype.put=function(i,c,o){if(this._state!==3){if(this._state===1)for(;c<o;){var h=i[c++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&o-c>0&&this._put(i,c,o)}},b.prototype.end=function(i){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(i)),this._id=-1,this._state=0)},b}();R.OscParser=p;var E=function(){function b(i){this._handler=i,this._data="",this._hitLimit=!1}return b.prototype.start=function(){this._data="",this._hitLimit=!1},b.prototype.put=function(i,c,o){this._hitLimit||(this._data+=M.utf32ToString(i,c,o),this._data.length>L.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},b.prototype.end=function(i){var c;return this._hitLimit?c=!1:i&&(c=this._handler(this._data)),this._data="",this._hitLimit=!1,c},b}();R.OscHandler=E},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.PAYLOAD_LIMIT=void 0,R.PAYLOAD_LIMIT=1e7},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.DcsHandler=R.DcsParser=void 0;var L=I(8),M=I(21),p=I(23),E=[],b=function(){function c(){this._handlers=Object.create(null),this._active=E,this._ident=0,this._handlerFb=function(){}}return c.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},c.prototype.addHandler=function(o,h){this._handlers[o]===void 0&&(this._handlers[o]=[]);var n=this._handlers[o];return n.push(h),{dispose:function(){var a=n.indexOf(h);a!==-1&&n.splice(a,1)}}},c.prototype.setHandler=function(o,h){this._handlers[o]=[h]},c.prototype.clearHandler=function(o){this._handlers[o]&&delete this._handlers[o]},c.prototype.setHandlerFallback=function(o){this._handlerFb=o},c.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=E,this._ident=0},c.prototype.hook=function(o,h){if(this.reset(),this._ident=o,this._active=this._handlers[o]||E,this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].hook(h);else this._handlerFb(this._ident,"HOOK",h)},c.prototype.put=function(o,h,n){if(this._active.length)for(var a=this._active.length-1;a>=0;a--)this._active[a].put(o,h,n);else this._handlerFb(this._ident,"PUT",L.utf32ToString(o,h,n))},c.prototype.unhook=function(o){if(this._active.length){for(var h=this._active.length-1;h>=0&&this._active[h].unhook(o)===!1;h--);for(h--;h>=0;h--)this._active[h].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",o);this._active=E,this._ident=0},c}();R.DcsParser=b;var i=function(){function c(o){this._handler=o,this._data="",this._hitLimit=!1}return c.prototype.hook=function(o){this._params=o.clone(),this._data="",this._hitLimit=!1},c.prototype.put=function(o,h,n){this._hitLimit||(this._data+=L.utf32ToString(o,h,n),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},c.prototype.unhook=function(o){var h;return this._hitLimit?h=!1:o&&(h=this._handler(this._data,this._params||new M.Params)),this._params=void 0,this._data="",this._hitLimit=!1,h},c}();R.DcsHandler=i},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.removeTerminalFromCache=R.acquireCharAtlas=void 0;var L=I(26),M=I(43),p=[];R.acquireCharAtlas=function(E,b,i,c,o){for(var h=L.generateConfig(c,o,E,i),n=0;n<p.length;n++){var a=(t=p[n]).ownedBy.indexOf(b);if(a>=0){if(L.configEquals(t.config,h))return t.atlas;t.ownedBy.length===1?(t.atlas.dispose(),p.splice(n,1)):t.ownedBy.splice(a,1);break}}for(n=0;n<p.length;n++){var t=p[n];if(L.configEquals(t.config,h))return t.ownedBy.push(b),t.atlas}var r={atlas:new M.DynamicCharAtlas(document,h),config:h,ownedBy:[b]};return p.push(r),r.atlas},R.removeTerminalFromCache=function(E){for(var b=0;b<p.length;b++){var i=p[b].ownedBy.indexOf(E);if(i!==-1){p[b].ownedBy.length===1?(p[b].atlas.dispose(),p.splice(b,1)):p[b].ownedBy.splice(i,1);break}}}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.is256Color=R.configEquals=R.generateConfig=void 0;var L=I(3);R.generateConfig=function(M,p,E,b){var i={foreground:b.foreground,background:b.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:b.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:M,scaledCharHeight:p,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,colors:i}},R.configEquals=function(M,p){for(var E=0;E<M.colors.ansi.length;E++)if(M.colors.ansi[E].rgba!==p.colors.ansi[E].rgba)return!1;return M.devicePixelRatio===p.devicePixelRatio&&M.fontFamily===p.fontFamily&&M.fontSize===p.fontSize&&M.fontWeight===p.fontWeight&&M.fontWeightBold===p.fontWeightBold&&M.allowTransparency===p.allowTransparency&&M.scaledCharWidth===p.scaledCharWidth&&M.scaledCharHeight===p.scaledCharHeight&&M.colors.foreground===p.colors.foreground&&M.colors.background===p.colors.background},R.is256Color=function(M){return M<L.DEFAULT_COLOR}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.ColorManager=R.DEFAULT_ANSI_COLORS=void 0;var L=I(10),M=I(45),p=L.css.toColor("#ffffff"),E=L.css.toColor("#000000"),b=L.css.toColor("#ffffff"),i=L.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};R.DEFAULT_ANSI_COLORS=function(){for(var h=[L.css.toColor("#2e3436"),L.css.toColor("#cc0000"),L.css.toColor("#4e9a06"),L.css.toColor("#c4a000"),L.css.toColor("#3465a4"),L.css.toColor("#75507b"),L.css.toColor("#06989a"),L.css.toColor("#d3d7cf"),L.css.toColor("#555753"),L.css.toColor("#ef2929"),L.css.toColor("#8ae234"),L.css.toColor("#fce94f"),L.css.toColor("#729fcf"),L.css.toColor("#ad7fa8"),L.css.toColor("#34e2e2"),L.css.toColor("#eeeeec")],n=[0,95,135,175,215,255],a=0;a<216;a++){var t=n[a/36%6|0],r=n[a/6%6|0],s=n[a%6];h.push({css:L.channels.toCss(t,r,s),rgba:L.channels.toRgba(t,r,s)})}for(a=0;a<24;a++){var u=8+10*a;h.push({css:L.channels.toCss(u,u,u),rgba:L.channels.toRgba(u,u,u)})}return h}();var o=function(){function h(n,a){this.allowTransparency=a;var t=n.createElement("canvas");t.width=1,t.height=1;var r=t.getContext("2d");if(!r)throw new Error("Could not get rendering context");this._ctx=r,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new M.ColorContrastCache,this.colors={foreground:p,background:E,cursor:b,cursorAccent:i,selectionTransparent:c,selectionOpaque:L.color.blend(E,c),ansi:R.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return h.prototype.onOptionsChange=function(n){n==="minimumContrastRatio"&&this._contrastCache.clear()},h.prototype.setTheme=function(n){(n===void 0&&(n={}),this.colors.foreground=this._parseColor(n.foreground,p),this.colors.background=this._parseColor(n.background,E),this.colors.cursor=this._parseColor(n.cursor,b,!0),this.colors.cursorAccent=this._parseColor(n.cursorAccent,i,!0),this.colors.selectionTransparent=this._parseColor(n.selection,c,!0),this.colors.selectionOpaque=L.color.blend(this.colors.background,this.colors.selectionTransparent),L.color.isOpaque(this.colors.selectionTransparent))&&(this.colors.selectionTransparent=L.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(n.black,R.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(n.red,R.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(n.green,R.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(n.yellow,R.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(n.blue,R.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(n.magenta,R.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(n.cyan,R.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(n.white,R.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(n.brightBlack,R.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(n.brightRed,R.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(n.brightGreen,R.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(n.brightYellow,R.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(n.brightBlue,R.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(n.brightMagenta,R.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(n.brightCyan,R.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(n.brightWhite,R.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},h.prototype._parseColor=function(n,a,t){if(t===void 0&&(t=this.allowTransparency),n===void 0)return a;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=n,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+n+" is invalid using fallback "+a.css),a;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;if(r[3]!==255){if(!t)return console.warn("Color: "+n+" is using transparency, but allowTransparency is false. Using fallback "+a.css+"."),a;var s=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(S){return Number(S)}),u=s[0],f=s[1],d=s[2],v=s[3],m=Math.round(255*v);return{rgba:L.channels.toRgba(u,f,d,m),css:n}}return{css:this._ctx.fillStyle,rgba:L.channels.toRgba(r[0],r[1],r[2],r[3])}},h}();R.ColorManager=o},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.throwIfFalsy=void 0,R.throwIfFalsy=function(L){if(!L)throw new Error("value must not be falsy");return L}},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(o,h){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var t in a)a.hasOwnProperty(t)&&(n[t]=a[t])})(o,h)},function(o,h){function n(){this.constructor=o}L(o,h),o.prototype=h===null?Object.create(h):(n.prototype=h.prototype,new n)});Object.defineProperty(R,"__esModule",{value:!0}),R.CharacterJoinerRegistry=R.JoinedCellData=void 0;var p=I(6),E=I(3),b=I(4),i=function(o){function h(n,a,t){var r=o.call(this)||this;return r.content=0,r.combinedData="",r.fg=n.fg,r.bg=n.bg,r.combinedData=a,r._width=t,r}return M(h,o),h.prototype.isCombined=function(){return 2097152},h.prototype.getWidth=function(){return this._width},h.prototype.getChars=function(){return this.combinedData},h.prototype.getCode=function(){return 2097151},h.prototype.setFromCharData=function(n){throw new Error("not implemented")},h.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},h}(p.AttributeData);R.JoinedCellData=i;var c=function(){function o(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}return o.prototype.registerCharacterJoiner=function(h){var n={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(n),n.id},o.prototype.deregisterCharacterJoiner=function(h){for(var n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===h)return this._characterJoiners.splice(n,1),!0;return!1},o.prototype.getJoinedCharacters=function(h){if(this._characterJoiners.length===0)return[];var n=this._bufferService.buffer.lines.get(h);if(!n||n.length===0)return[];for(var a=[],t=n.translateToString(!0),r=0,s=0,u=0,f=n.getFg(0),d=n.getBg(0),v=0;v<n.getTrimmedLength();v++)if(n.loadCell(v,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==d){if(v-r>1)for(var m=this._getJoinedRanges(t,u,s,n,r),S=0;S<m.length;S++)a.push(m[S]);r=v,u=s,f=this._workCell.fg,d=this._workCell.bg}s+=this._workCell.getChars().length||E.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1)for(m=this._getJoinedRanges(t,u,s,n,r),S=0;S<m.length;S++)a.push(m[S]);return a},o.prototype._getJoinedRanges=function(h,n,a,t,r){for(var s=h.substring(n,a),u=this._characterJoiners[0].handler(s),f=1;f<this._characterJoiners.length;f++)for(var d=this._characterJoiners[f].handler(s),v=0;v<d.length;v++)o._mergeRanges(u,d[v]);return this._stringRangesToCellRanges(u,t,r),u},o.prototype._stringRangesToCellRanges=function(h,n,a){var t=0,r=!1,s=0,u=h[t];if(u){for(var f=a;f<this._bufferService.cols;f++){var d=n.getWidth(f),v=n.getString(f).length||E.WHITESPACE_CELL_CHAR.length;if(d!==0){if(!r&&u[0]<=s&&(u[0]=f,r=!0),u[1]<=s){if(u[1]=f,!(u=h[++t]))break;u[0]<=s?(u[0]=f,r=!0):r=!1}s+=v}}u&&(u[1]=this._bufferService.cols)}},o._mergeRanges=function(h,n){for(var a=!1,t=0;t<h.length;t++){var r=h[t];if(a){if(n[1]<=r[0])return h[t-1][1]=n[1],h;if(n[1]<=r[1])return h[t-1][1]=Math.max(n[1],r[1]),h.splice(t,1),h;h.splice(t,1),t--}else{if(n[1]<=r[0])return h.splice(t,0,n),h;if(n[1]<=r[1])return r[0]=Math.min(n[0],r[0]),h;n[0]<r[1]&&(r[0]=Math.min(n[0],r[0]),a=!0)}}return a?h[h.length-1][1]=n[1]:h.push(n),h},o}();R.CharacterJoinerRegistry=c},function(G,R,I){"use strict";function L(M,p){var E=p.getBoundingClientRect();return[M.clientX-E.left,M.clientY-E.top]}Object.defineProperty(R,"__esModule",{value:!0}),R.getRawByteCoords=R.getCoords=R.getCoordsRelativeToElement=void 0,R.getCoordsRelativeToElement=L,R.getCoords=function(M,p,E,b,i,c,o,h){if(i){var n=L(M,p);if(n)return n[0]=Math.ceil((n[0]+(h?c/2:0))/c),n[1]=Math.ceil(n[1]/o),n[0]=Math.min(Math.max(n[0],1),E+(h?1:0)),n[1]=Math.min(Math.max(n[1],1),b),n}},R.getRawByteCoords=function(M){if(M)return{x:M[0]+32,y:M[1]+32}}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.RenderDebouncer=void 0;var L=function(){function M(p){this._renderCallback=p}return M.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},M.prototype.refresh=function(p,E,b){var i=this;this._rowCount=b,p=p!==void 0?p:0,E=E!==void 0?E:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,p):p,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,E):E,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return i._innerRefresh()}))},M.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var p=Math.max(this._rowStart,0),E=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(p,E)}},M}();R.RenderDebouncer=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(E,b){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,c){i.__proto__=c}||function(i,c){for(var o in c)c.hasOwnProperty(o)&&(i[o]=c[o])})(E,b)},function(E,b){function i(){this.constructor=E}L(E,b),E.prototype=b===null?Object.create(b):(i.prototype=b.prototype,new i)});Object.defineProperty(R,"__esModule",{value:!0}),R.ScreenDprMonitor=void 0;var p=function(E){function b(){var i=E!==null&&E.apply(this,arguments)||this;return i._currentDevicePixelRatio=window.devicePixelRatio,i}return M(b,E),b.prototype.setListener=function(i){var c=this;this._listener&&this.clearListener(),this._listener=i,this._outerListener=function(){c._listener&&(c._listener(window.devicePixelRatio,c._currentDevicePixelRatio),c._updateDpr())},this._updateDpr()},b.prototype.dispose=function(){E.prototype.dispose.call(this),this.clearListener()},b.prototype._updateDpr=function(){var i;this._outerListener&&((i=this._resolutionMediaMatchList)===null||i===void 0||i.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},b.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},b}(I(2).Disposable);R.ScreenDprMonitor=p},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.clone=void 0,R.clone=function L(M,p){if(p===void 0&&(p=5),typeof M!="object")return M;var E=Array.isArray(M)?[]:{};for(var b in M)E[b]=p<=1?M[b]:M[b]?L(M[b],p-1):M[b];return E}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;var L=I(4),M=I(35),p=I(18),E=I(0),b=I(83),i=function(){function t(r){this._core=new M.Terminal(r),this._addonManager=new b.AddonManager}return t.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new n(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unicode",{get:function(){return this._checkProposedApi(),new a(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._checkProposedApi(),new o(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),t.prototype.blur=function(){this._core.blur()},t.prototype.focus=function(){this._core.focus()},t.prototype.resize=function(r,s){this._verifyIntegers(r,s),this._core.resize(r,s)},t.prototype.open=function(r){this._core.open(r)},t.prototype.attachCustomKeyEventHandler=function(r){this._core.attachCustomKeyEventHandler(r)},t.prototype.registerLinkMatcher=function(r,s,u){return this._checkProposedApi(),this._core.registerLinkMatcher(r,s,u)},t.prototype.deregisterLinkMatcher=function(r){this._checkProposedApi(),this._core.deregisterLinkMatcher(r)},t.prototype.registerLinkProvider=function(r){return this._checkProposedApi(),this._core.registerLinkProvider(r)},t.prototype.registerCharacterJoiner=function(r){return this._checkProposedApi(),this._core.registerCharacterJoiner(r)},t.prototype.deregisterCharacterJoiner=function(r){this._checkProposedApi(),this._core.deregisterCharacterJoiner(r)},t.prototype.registerMarker=function(r){return this._checkProposedApi(),this._verifyIntegers(r),this._core.addMarker(r)},t.prototype.addMarker=function(r){return this.registerMarker(r)},t.prototype.hasSelection=function(){return this._core.hasSelection()},t.prototype.select=function(r,s,u){this._verifyIntegers(r,s,u),this._core.select(r,s,u)},t.prototype.getSelection=function(){return this._core.getSelection()},t.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},t.prototype.clearSelection=function(){this._core.clearSelection()},t.prototype.selectAll=function(){this._core.selectAll()},t.prototype.selectLines=function(r,s){this._verifyIntegers(r,s),this._core.selectLines(r,s)},t.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},t.prototype.scrollLines=function(r){this._verifyIntegers(r),this._core.scrollLines(r)},t.prototype.scrollPages=function(r){this._verifyIntegers(r),this._core.scrollPages(r)},t.prototype.scrollToTop=function(){this._core.scrollToTop()},t.prototype.scrollToBottom=function(){this._core.scrollToBottom()},t.prototype.scrollToLine=function(r){this._verifyIntegers(r),this._core.scrollToLine(r)},t.prototype.clear=function(){this._core.clear()},t.prototype.write=function(r,s){this._core.write(r,s)},t.prototype.writeUtf8=function(r,s){this._core.write(r,s)},t.prototype.writeln=function(r,s){this._core.write(r),this._core.write(`\r
`,s)},t.prototype.paste=function(r){this._core.paste(r)},t.prototype.getOption=function(r){return this._core.optionsService.getOption(r)},t.prototype.setOption=function(r,s){this._core.optionsService.setOption(r,s)},t.prototype.refresh=function(r,s){this._verifyIntegers(r,s),this._core.refresh(r,s)},t.prototype.reset=function(){this._core.reset()},t.prototype.loadAddon=function(r){return this._addonManager.loadAddon(this,r)},Object.defineProperty(t,"strings",{get:function(){return p},enumerable:!1,configurable:!0}),t.prototype._verifyIntegers=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];for(var u=0,f=r;u<f.length;u++){var d=f[u];if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}},t}();R.Terminal=i;var c=function(){function t(r,s){this._buffer=r,this.type=s}return t.prototype.init=function(r){return this._buffer=r,this},Object.defineProperty(t.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),t.prototype.getLine=function(r){var s=this._buffer.lines.get(r);if(s)return new h(s)},t.prototype.getNullCell=function(){return new L.CellData},t}(),o=function(){function t(r){var s=this;this._buffers=r,this._onBufferChange=new E.EventEmitter,this._normal=new c(this._buffers.normal,"normal"),this._alternate=new c(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return s._onBufferChange.fire(s.active)})}return Object.defineProperty(t.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),t}(),h=function(){function t(r){this._line=r}return Object.defineProperty(t.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),t.prototype.getCell=function(r,s){if(!(r<0||r>=this._line.length))return s?(this._line.loadCell(r,s),s):this._line.loadCell(r,new L.CellData)},t.prototype.translateToString=function(r,s,u){return this._line.translateToString(r,s,u)},t}(),n=function(){function t(r){this._core=r}return t.prototype.registerCsiHandler=function(r,s){return this._core.addCsiHandler(r,function(u){return s(u.toArray())})},t.prototype.addCsiHandler=function(r,s){return this.registerCsiHandler(r,s)},t.prototype.registerDcsHandler=function(r,s){return this._core.addDcsHandler(r,function(u,f){return s(u,f.toArray())})},t.prototype.addDcsHandler=function(r,s){return this.registerDcsHandler(r,s)},t.prototype.registerEscHandler=function(r,s){return this._core.addEscHandler(r,s)},t.prototype.addEscHandler=function(r,s){return this.registerEscHandler(r,s)},t.prototype.registerOscHandler=function(r,s){return this._core.addOscHandler(r,s)},t.prototype.addOscHandler=function(r,s){return this.registerOscHandler(r,s)},t}(),a=function(){function t(r){this._core=r}return t.prototype.register=function(r){this._core.unicodeService.register(r)},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(r){this._core.unicodeService.activeVersion=r},enumerable:!1,configurable:!0}),t}()},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(j,A){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,U){K.__proto__=U}||function(K,U){for(var O in U)U.hasOwnProperty(O)&&(K[O]=U[O])})(j,A)},function(j,A){function K(){this.constructor=j}L(j,A),j.prototype=A===null?Object.create(A):(K.prototype=A.prototype,new K)});Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;var p=I(36),E=I(37),b=I(38),i=I(12),c=I(19),o=I(40),h=I(50),n=I(51),a=I(11),t=I(7),r=I(18),s=I(54),u=I(55),f=I(56),d=I(57),v=I(59),m=I(0),S=I(16),C=I(27),_=I(60),y=I(5),T=I(61),k=I(62),g=I(63),F=I(64),P=I(65),N=typeof window!="undefined"?window.document:null,W=function(j){function A(K){K===void 0&&(K={});var U=j.call(this,K)||this;return U.browser=a,U._keyDownHandled=!1,U._onCursorMove=new m.EventEmitter,U._onKey=new m.EventEmitter,U._onRender=new m.EventEmitter,U._onSelectionChange=new m.EventEmitter,U._onTitleChange=new m.EventEmitter,U._onFocus=new m.EventEmitter,U._onBlur=new m.EventEmitter,U._onA11yCharEmitter=new m.EventEmitter,U._onA11yTabEmitter=new m.EventEmitter,U._setup(),U.linkifier=U._instantiationService.createInstance(h.Linkifier),U.linkifier2=U.register(U._instantiationService.createInstance(g.Linkifier2)),U.register(U._inputHandler.onRequestBell(function(){return U.bell()})),U.register(U._inputHandler.onRequestRefreshRows(function(O,z){return U.refresh(O,z)})),U.register(U._inputHandler.onRequestReset(function(){return U.reset()})),U.register(U._inputHandler.onRequestScroll(function(O,z){return U.scroll(O,z||void 0)})),U.register(U._inputHandler.onRequestWindowsOptionsReport(function(O){return U._reportWindowsOptions(O)})),U.register(m.forwardEvent(U._inputHandler.onCursorMove,U._onCursorMove)),U.register(m.forwardEvent(U._inputHandler.onTitleChange,U._onTitleChange)),U.register(m.forwardEvent(U._inputHandler.onA11yChar,U._onA11yCharEmitter)),U.register(m.forwardEvent(U._inputHandler.onA11yTab,U._onA11yTabEmitter)),U.register(U._bufferService.onResize(function(O){return U._afterResize(O.cols,O.rows)})),U}return M(A,j),Object.defineProperty(A.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){var K,U,O;this._isDisposed||(j.prototype.dispose.call(this),(K=this._renderService)===null||K===void 0||K.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(O=(U=this.element)===null||U===void 0?void 0:U.parentNode)===null||O===void 0||O.removeChild(this.element))},A.prototype._setup=function(){j.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(A.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),A.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},A.prototype._updateOptions=function(K){var U,O,z,te;switch(j.prototype._updateOptions.call(this,K),K){case"fontFamily":case"fontSize":(U=this._renderService)===null||U===void 0||U.clear(),(O=this._charSizeService)===null||O===void 0||O.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 f.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)}},A.prototype._onTextAreaFocus=function(K){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(i.C0.ESC+"[I"),this.updateCursorStyle(K),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},A.prototype.blur=function(){var K;return(K=this.textarea)===null||K===void 0?void 0:K.blur()},A.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(i.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},A.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var K=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),U=this._bufferService.buffer.y*K,O=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=O+"px",this.textarea.style.top=U+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=K+"px",this.textarea.style.lineHeight=K+"px",this.textarea.style.zIndex="-5"}},A.prototype._initGlobal=function(){var K=this;this._bindKeys(),this.register(t.addDisposableDomListener(this.element,"copy",function(O){K.hasSelection()&&b.copyHandler(O,K._selectionService)}));var U=function(O){return b.handlePasteEvent(O,K.textarea,K._coreService)};this.register(t.addDisposableDomListener(this.textarea,"paste",U)),this.register(t.addDisposableDomListener(this.element,"paste",U)),a.isFirefox?this.register(t.addDisposableDomListener(this.element,"mousedown",function(O){O.button===2&&b.rightClickHandler(O,K.textarea,K.screenElement,K._selectionService,K.options.rightClickSelectsWord)})):this.register(t.addDisposableDomListener(this.element,"contextmenu",function(O){b.rightClickHandler(O,K.textarea,K.screenElement,K._selectionService,K.options.rightClickSelectsWord)})),a.isLinux&&this.register(t.addDisposableDomListener(this.element,"auxclick",function(O){O.button===1&&b.moveTextAreaUnderMouseCursor(O,K.textarea,K.screenElement)}))},A.prototype._bindKeys=function(){var K=this;this.register(t.addDisposableDomListener(this.textarea,"keyup",function(U){return K._keyUp(U)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keydown",function(U){return K._keyDown(U)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keypress",function(U){return K._keyPress(U)},!0)),this.register(t.addDisposableDomListener(this.textarea,"compositionstart",function(){return K._compositionHelper.compositionstart()})),this.register(t.addDisposableDomListener(this.textarea,"compositionupdate",function(U){return K._compositionHelper.compositionupdate(U)})),this.register(t.addDisposableDomListener(this.textarea,"compositionend",function(){return K._compositionHelper.compositionend()})),this.register(this.onRender(function(){return K._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(U){return K._queueLinkification(U.start,U.end)}))},A.prototype.open=function(K){var U=this;if(!K)throw new Error("Terminal requires a parent element.");N.body.contains(K)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=K.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"),K.appendChild(this.element);var O=N.createDocumentFragment();this._viewportElement=N.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),O.appendChild(this._viewportElement),this._viewportScrollArea=N.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=N.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=N.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),O.appendChild(this.screenElement),this.textarea=N.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",r.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(de){return U._onTextAreaFocus(de)})),this.register(t.addDisposableDomListener(this.textarea,"blur",function(){return U._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var z=this._instantiationService.createInstance(F.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=N.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(O),this._theme=this.options.theme||this._theme,this._colorManager=new C.ColorManager(N,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(de){return U._colorManager.onOptionsChange(de)})),this._colorManager.setTheme(this._theme);var te=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,te,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(de){return U._onRender.fire(de)})),this.onResize(function(de){return U._renderService.resize(de.cols,de.rows)}),this._soundService=this._instantiationService.createInstance(s.SoundService),this._instantiationService.setService(y.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(E.Viewport,function(de,be){return U.scrollLines(de,be)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return U.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){U._renderService.onCursorMove(),U._syncTextArea()})),this.register(this.onResize(function(){return U._renderService.onResize(U.cols,U.rows)})),this.register(this.onBlur(function(){return U._renderService.onBlur()})),this.register(this.onFocus(function(){return U._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return U.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(n.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(de){return U.scrollLines(de.amount,de.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return U._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(de){return U._renderService.onSelectionChanged(de.start,de.end,de.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(de){U.textarea.value=de,U.textarea.focus(),U.textarea.select()})),this.register(this.onScroll(function(){U.viewport.syncScrollArea(),U._selectionService.refresh()})),this.register(t.addDisposableDomListener(this._viewportElement,"scroll",function(){return U._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(u.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return U._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(de){return U._selectionService.onMouseDown(de)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new f.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},A.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+'"')}},A.prototype._setTheme=function(K){var U,O,z;this._theme=K,(U=this._colorManager)===null||U===void 0||U.setTheme(K),(O=this._renderService)===null||O===void 0||O.setColors(this._colorManager.colors),(z=this.viewport)===null||z===void 0||z.onThemeChange(this._colorManager.colors)},A.prototype.bindMouse=function(){var K=this,U=this,O=this.element;function z(Oe){var Ke,We,Te=U._mouseService.getRawByteCoords(Oe,U.screenElement,U.cols,U.rows);if(!Te)return!1;switch(Oe.overrideType||Oe.type){case"mousemove":We=32,Oe.buttons===void 0?(Ke=3,Oe.button!==void 0&&(Ke=Oe.button<3?Oe.button:3)):Ke=1&Oe.buttons?0:4&Oe.buttons?1:2&Oe.buttons?2:3;break;case"mouseup":We=0,Ke=Oe.button<3?Oe.button:3;break;case"mousedown":We=1,Ke=Oe.button<3?Oe.button:3;break;case"wheel":Oe.deltaY!==0&&(We=Oe.deltaY<0?0:1),Ke=4;break;default:return!1}return!(We===void 0||Ke===void 0||Ke>4)&&U._coreMouseService.triggerMouseEvent({col:Te.x-33,row:Te.y-33,button:Ke,action:We,ctrl:Oe.ctrlKey,alt:Oe.altKey,shift:Oe.shiftKey})}var te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de=function(Oe){return z(Oe),Oe.buttons||(K._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&K._document.removeEventListener("mousemove",te.mousedrag)),K.cancel(Oe)},be=function(Oe){return z(Oe),Oe.preventDefault(),K.cancel(Oe)},je=function(Oe){Oe.buttons&&z(Oe)},Ne=function(Oe){Oe.buttons||z(Oe)};this.register(this._coreMouseService.onProtocolChange(function(Oe){Oe?(K.optionsService.options.logLevel==="debug"&&K._logService.debug("Binding to mouse events:",K._coreMouseService.explainEvents(Oe)),K.element.classList.add("enable-mouse-events"),K._selectionService.disable()):(K._logService.debug("Unbinding from mouse events."),K.element.classList.remove("enable-mouse-events"),K._selectionService.enable()),8&Oe?te.mousemove||(O.addEventListener("mousemove",Ne),te.mousemove=Ne):(O.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&Oe?te.wheel||(O.addEventListener("wheel",be,{passive:!1}),te.wheel=be):(O.removeEventListener("wheel",te.wheel),te.wheel=null),2&Oe?te.mouseup||(te.mouseup=de):(K._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&Oe?te.mousedrag||(te.mousedrag=je):(K._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(t.addDisposableDomListener(O,"mousedown",function(Oe){if(Oe.preventDefault(),K.focus(),K._coreMouseService.areMouseEventsActive&&!K._selectionService.shouldForceSelection(Oe))return z(Oe),te.mouseup&&K._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&K._document.addEventListener("mousemove",te.mousedrag),K.cancel(Oe)})),this.register(t.addDisposableDomListener(O,"wheel",function(Oe){if(!te.wheel){if(!K.buffer.hasScrollback){var Ke=K.viewport.getLinesScrolled(Oe);if(Ke===0)return;for(var We=i.C0.ESC+(K._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Oe.deltaY<0?"A":"B"),Te="",we=0;we<Math.abs(Ke);we++)Te+=We;K._coreService.triggerDataEvent(Te,!0)}}},{passive:!0})),this.register(t.addDisposableDomListener(O,"wheel",function(Oe){if(!te.wheel)return K.viewport.onWheel(Oe)?void 0:K.cancel(Oe)},{passive:!1})),this.register(t.addDisposableDomListener(O,"touchstart",function(Oe){if(!K._coreMouseService.areMouseEventsActive)return K.viewport.onTouchStart(Oe),K.cancel(Oe)},{passive:!0})),this.register(t.addDisposableDomListener(O,"touchmove",function(Oe){if(!K._coreMouseService.areMouseEventsActive)return K.viewport.onTouchMove(Oe)?void 0:K.cancel(Oe)},{passive:!1}))},A.prototype.refresh=function(K,U){var O;(O=this._renderService)===null||O===void 0||O.refreshRows(K,U)},A.prototype._queueLinkification=function(K,U){var O;(O=this.linkifier)===null||O===void 0||O.linkifyRows(K,U)},A.prototype.updateCursorStyle=function(K){this._selectionService&&this._selectionService.shouldColumnSelect(K)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},A.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},A.prototype.scrollLines=function(K,U){j.prototype.scrollLines.call(this,K,U),this.refresh(0,this.rows-1)},A.prototype.paste=function(K){b.paste(K,this.textarea,this._coreService)},A.prototype.attachCustomKeyEventHandler=function(K){this._customKeyEventHandler=K},A.prototype.registerLinkMatcher=function(K,U,O){var z=this.linkifier.registerLinkMatcher(K,U,O);return this.refresh(0,this.rows-1),z},A.prototype.deregisterLinkMatcher=function(K){this.linkifier.deregisterLinkMatcher(K)&&this.refresh(0,this.rows-1)},A.prototype.registerLinkProvider=function(K){return this.linkifier2.registerLinkProvider(K)},A.prototype.registerCharacterJoiner=function(K){var U=this._renderService.registerCharacterJoiner(K);return this.refresh(0,this.rows-1),U},A.prototype.deregisterCharacterJoiner=function(K){this._renderService.deregisterCharacterJoiner(K)&&this.refresh(0,this.rows-1)},Object.defineProperty(A.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),A.prototype.addMarker=function(K){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)},A.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},A.prototype.select=function(K,U,O){this._selectionService.setSelection(K,U,O)},A.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},A.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},A.prototype.clearSelection=function(){var K;(K=this._selectionService)===null||K===void 0||K.clearSelection()},A.prototype.selectAll=function(){var K;(K=this._selectionService)===null||K===void 0||K.selectAll()},A.prototype.selectLines=function(K,U){var O;(O=this._selectionService)===null||O===void 0||O.selectLines(K,U)},A.prototype._keyDown=function(K){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(!this._compositionHelper.keydown(K))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var U=v.evaluateKeyboardEvent(K,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),U.type===3||U.type===2){var O=this.rows-1;return this.scrollLines(U.type===2?-O:O),this.cancel(K,!0)}return U.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(U.cancel&&this.cancel(K,!0),!U.key||(U.key!==i.C0.ETX&&U.key!==i.C0.CR||(this.textarea.value=""),this._onKey.fire({key:U.key,domEvent:K}),this._showCursor(),this._coreService.triggerDataEvent(U.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(K,!0)))},A.prototype._isThirdLevelShift=function(K,U){var O=K.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||K.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey;return U.type==="keypress"?O:O&&(!U.keyCode||U.keyCode>47)},A.prototype._keyUp=function(K){this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||(function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18}(K)||this.focus(),this.updateCursorStyle(K))},A.prototype._keyPress=function(K){var U;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)U=K.charCode;else if(K.which===null||K.which===void 0)U=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;U=K.which}return!(!U||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K))&&(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:K}),this._showCursor(),this._coreService.triggerDataEvent(U,!0),!0)},A.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},A.prototype.resize=function(K,U){K!==this.cols||U!==this.rows?j.prototype.resize.call(this,K,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},A.prototype._afterResize=function(K,U){var O,z;(O=this._charSizeService)===null||O===void 0||O.measure(),(z=this.viewport)===null||z===void 0||z.syncScrollArea(!0)},A.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 K=1;K<this.rows;K++)this.buffer.lines.push(this.buffer.getBlankLine(S.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},A.prototype.reset=function(){var K,U;this.options.rows=this.rows,this.options.cols=this.cols;var O=this._customKeyEventHandler;this._setup(),j.prototype.reset.call(this),(K=this._selectionService)===null||K===void 0||K.reset(),this._customKeyEventHandler=O,this.refresh(0,this.rows-1),(U=this.viewport)===null||U===void 0||U.syncScrollArea()},A.prototype._reportWindowsOptions=function(K){if(this._renderService)switch(K){case c.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var U=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),O=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(i.C0.ESC+"[4;"+O+";"+U+"t");break;case c.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var z=this._renderService.dimensions.scaledCellWidth.toFixed(0),te=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(i.C0.ESC+"[6;"+te+";"+z+"t")}},A.prototype.cancel=function(K,U){if(this.options.cancelEvents||U)return K.preventDefault(),K.stopPropagation(),!1},A.prototype._visualBell=function(){return!1},A.prototype._soundBell=function(){return this.options.bellStyle==="sound"},A}(P.CoreTerminal);R.Terminal=W},function(G,R,I){"use strict";var L=this&&this.__decorate||function(i,c,o,h){var n,a=arguments.length,t=a<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,c,o,h);else for(var r=i.length-1;r>=0;r--)(n=i[r])&&(t=(a<3?n(t):a>3?n(c,o,t):n(c,o))||t);return a>3&&t&&Object.defineProperty(c,o,t),t},M=this&&this.__param||function(i,c){return function(o,h){c(o,h,i)}};Object.defineProperty(R,"__esModule",{value:!0}),R.CompositionHelper=void 0;var p=I(5),E=I(1),b=function(){function i(c,o,h,n,a,t){this._textarea=c,this._compositionView=o,this._bufferService=h,this._optionsService=n,this._charSizeService=a,this._coreService=t,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(i.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),i.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},i.prototype.compositionupdate=function(c){var o=this;this._compositionView.textContent=c.data,this.updateCompositionElements(),setTimeout(function(){o._compositionPosition.end=o._textarea.value.length},0)},i.prototype.compositionend=function(){this._finalizeComposition(!0)},i.prototype.keydown=function(c){if(this._isComposing||this._isSendingComposition){if(c.keyCode===229)return!1;if(c.keyCode===16||c.keyCode===17||c.keyCode===18)return!1;this._finalizeComposition(!1)}return c.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},i.prototype._finalizeComposition=function(c){var o=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,c){var h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(o._isSendingComposition){o._isSendingComposition=!1;var a=void 0;a=o._isComposing?o._textarea.value.substring(h.start,h.end):o._textarea.value.substring(h.start),o._coreService.triggerDataEvent(a,!0)}},0)}else{this._isSendingComposition=!1;var n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}},i.prototype._handleAnyTextareaChanges=function(){var c=this,o=this._textarea.value;setTimeout(function(){if(!c._isComposing){var h=c._textarea.value.replace(o,"");h.length>0&&c._coreService.triggerDataEvent(h,!0)}},0)},i.prototype.updateCompositionElements=function(c){var o=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var h=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),n=this._bufferService.buffer.y*h,a=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"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=a+"px",this._textarea.style.top=n+"px",this._textarea.style.width=t.width+"px",this._textarea.style.height=t.height+"px",this._textarea.style.lineHeight=t.height+"px"}c||setTimeout(function(){return o.updateCompositionElements(!0)},0)}},i=L([M(2,E.IBufferService),M(3,E.IOptionsService),M(4,p.ICharSizeService),M(5,E.ICoreService)],i)}();R.CompositionHelper=b},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(n,a){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}L(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,f=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,a,t,r);else for(var d=n.length-1;d>=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.Viewport=void 0;var b=I(2),i=I(7),c=I(5),o=I(1),h=function(n){function a(t,r,s,u,f,d,v){var m=n.call(this)||this;return m._scrollLines=t,m._viewportElement=r,m._scrollArea=s,m._bufferService=u,m._optionsService=f,m._charSizeService=d,m._renderService=v,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(i.addDisposableDomListener(m._viewportElement,"scroll",m._onScroll.bind(m))),setTimeout(function(){return m.syncScrollArea()},0),m}return M(a,n),a.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},a.prototype._refresh=function(t){var r=this;if(t)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return r._innerRefresh()}))},a.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 r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==r&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=r),this._refreshAnimationFrame=null},a.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 r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===r&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(t)}else this._refresh(t)},a.prototype._onScroll=function(t){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(r,!0)}},a.prototype._bubbleScroll=function(t,r){var s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&s<this._lastRecordedBufferHeight)||(t.cancelable&&t.preventDefault(),!1)},a.prototype.onWheel=function(t){var r=this._getPixelsScrolled(t);return r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(t,r))},a.prototype._getPixelsScrolled=function(t){if(t.deltaY===0)return 0;var r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r},a.prototype.getLinesScrolled=function(t){if(t.deltaY===0)return 0;var r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r},a.prototype._applyScrollModifier=function(t,r){var s=this._optionsService.options.fastScrollModifier;return s==="alt"&&r.altKey||s==="ctrl"&&r.ctrlKey||s==="shift"&&r.shiftKey?t*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:t*this._optionsService.options.scrollSensitivity},a.prototype.onTouchStart=function(t){this._lastTouchY=t.touches[0].pageY},a.prototype.onTouchMove=function(t){var r=this._lastTouchY-t.touches[0].pageY;return this._lastTouchY=t.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(t,r))},a=p([E(3,o.IBufferService),E(4,o.IOptionsService),E(5,c.ICharSizeService),E(6,c.IRenderService)],a)}(b.Disposable);R.Viewport=h},function(G,R,I){"use strict";function L(b){return b.replace(/\r?\n/g,"\r")}function M(b,i){return i?"[200~"+b+"[201~":b}function p(b,i,c){b=M(b=L(b),c.decPrivateModes.bracketedPasteMode),c.triggerDataEvent(b,!0),i.value=""}function E(b,i,c){var o=c.getBoundingClientRect(),h=b.clientX-o.left-10,n=b.clientY-o.top-10;i.style.width="20px",i.style.height="20px",i.style.left=h+"px",i.style.top=n+"px",i.style.zIndex="1000",i.focus()}Object.defineProperty(R,"__esModule",{value:!0}),R.rightClickHandler=R.moveTextAreaUnderMouseCursor=R.paste=R.handlePasteEvent=R.copyHandler=R.bracketTextForPaste=R.prepareTextForTerminal=void 0,R.prepareTextForTerminal=L,R.bracketTextForPaste=M,R.copyHandler=function(b,i){b.clipboardData&&b.clipboardData.setData("text/plain",i.selectionText),b.preventDefault()},R.handlePasteEvent=function(b,i,c){b.stopPropagation(),b.clipboardData&&p(b.clipboardData.getData("text/plain"),i,c)},R.paste=p,R.moveTextAreaUnderMouseCursor=E,R.rightClickHandler=function(b,i,c,o,h){E(b,i,c),h&&!o.isClickInSelection(b)&&o.selectWordAtCursor(b),i.value=o.selectionText,i.select()}},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(n,a){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}L(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)});Object.defineProperty(R,"__esModule",{value:!0}),R.EscapeSequenceParser=R.VT500_TRANSITION_TABLE=R.TransitionTable=void 0;var p=I(2),E=I(15),b=I(21),i=I(22),c=I(24),o=function(){function n(a){this.table=new Uint8Array(a)}return n.prototype.setDefault=function(a,t){E.fill(this.table,a<<4|t)},n.prototype.add=function(a,t,r,s){this.table[t<<8|a]=r<<4|s},n.prototype.addMany=function(a,t,r,s){for(var u=0;u<a.length;u++)this.table[t<<8|a[u]]=r<<4|s},n}();R.TransitionTable=o,R.VT500_TRANSITION_TABLE=function(){var n=new o(4095),a=Array.apply(null,Array(256)).map(function(d,v){return v}),t=function(d,v){return a.slice(d,v)},r=t(32,127),s=t(0,24);s.push(25),s.push.apply(s,t(28,32));var u,f=t(0,14);for(u in n.setDefault(1,0),n.addMany(r,0,2,0),f)n.addMany([24,26,153,154],u,3,0),n.addMany(t(128,144),u,3,0),n.addMany(t(144,152),u,3,0),n.add(156,u,0,0),n.add(27,u,11,1),n.add(157,u,4,8),n.addMany([152,158,159],u,0,7),n.add(155,u,11,3),n.add(144,u,11,9);return n.addMany(s,0,3,0),n.addMany(s,1,3,1),n.add(127,1,0,1),n.addMany(s,8,0,8),n.addMany(s,3,3,3),n.add(127,3,0,3),n.addMany(s,4,3,4),n.add(127,4,0,4),n.addMany(s,6,3,6),n.addMany(s,5,3,5),n.add(127,5,0,5),n.addMany(s,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(r,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(t(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(r,7,0,7),n.addMany(s,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(t(64,127),3,7,0),n.addMany(t(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(t(48,60),4,8,4),n.addMany(t(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(t(32,64),6,0,6),n.add(127,6,0,6),n.addMany(t(64,127),6,0,0),n.addMany(t(32,48),3,9,5),n.addMany(t(32,48),5,9,5),n.addMany(t(48,64),5,0,6),n.addMany(t(64,127),5,7,0),n.addMany(t(32,48),4,9,5),n.addMany(t(32,48),1,9,2),n.addMany(t(32,48),2,9,2),n.addMany(t(48,127),2,10,0),n.addMany(t(48,80),1,10,0),n.addMany(t(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(t(96,127),1,10,0),n.add(80,1,11,9),n.addMany(s,9,0,9),n.add(127,9,0,9),n.addMany(t(28,32),9,0,9),n.addMany(t(32,48),9,9,12),n.addMany(t(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(s,11,0,11),n.addMany(t(32,128),11,0,11),n.addMany(t(28,32),11,0,11),n.addMany(s,10,0,10),n.add(127,10,0,10),n.addMany(t(28,32),10,0,10),n.addMany(t(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(t(32,48),10,9,12),n.addMany(s,12,0,12),n.add(127,12,0,12),n.addMany(t(28,32),12,0,12),n.addMany(t(32,48),12,9,12),n.addMany(t(48,64),12,0,11),n.addMany(t(64,127),12,12,13),n.addMany(t(64,127),10,12,13),n.addMany(t(64,127),9,12,13),n.addMany(s,13,13,13),n.addMany(r,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(160,0,2,0),n.add(160,8,5,8),n.add(160,6,0,6),n.add(160,11,0,11),n.add(160,13,13,13),n}();var h=function(n){function a(t){t===void 0&&(t=R.VT500_TRANSITION_TABLE);var r=n.call(this)||this;return r._transitions=t,r.initialState=0,r.currentState=r.initialState,r._params=new b.Params,r._params.addParam(0),r._collect=0,r.precedingCodepoint=0,r._printHandlerFb=function(s,u,f){},r._executeHandlerFb=function(s){},r._csiHandlerFb=function(s,u){},r._escHandlerFb=function(s){},r._errorHandlerFb=function(s){return s},r._printHandler=r._printHandlerFb,r._executeHandlers=Object.create(null),r._csiHandlers=Object.create(null),r._escHandlers=Object.create(null),r._oscParser=new i.OscParser,r._dcsParser=new c.DcsParser,r._errorHandler=r._errorHandlerFb,r.setEscHandler({final:"\\"},function(){}),r}return M(a,n),a.prototype._identifier=function(t,r){r===void 0&&(r=[64,126]);var s=0;if(t.prefix){if(t.prefix.length>1)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 u=0;u<t.intermediates.length;++u){var f=t.intermediates.charCodeAt(u);if(32>f||f>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=f}}if(t.final.length!==1)throw new Error("final must be a single byte");var d=t.final.charCodeAt(0);if(r[0]>d||d>r[1])throw new Error("final must be in range "+r[0]+" .. "+r[1]);return s<<=8,s|=d},a.prototype.identToString=function(t){for(var r=[];t;)r.push(String.fromCharCode(255&t)),t>>=8;return r.reverse().join("")},a.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},a.prototype.setPrintHandler=function(t){this._printHandler=t},a.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},a.prototype.addEscHandler=function(t,r){var s=this._identifier(t,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);var u=this._escHandlers[s];return u.push(r),{dispose:function(){var f=u.indexOf(r);f!==-1&&u.splice(f,1)}}},a.prototype.setEscHandler=function(t,r){this._escHandlers[this._identifier(t,[48,126])]=[r]},a.prototype.clearEscHandler=function(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]},a.prototype.setEscHandlerFallback=function(t){this._escHandlerFb=t},a.prototype.setExecuteHandler=function(t,r){this._executeHandlers[t.charCodeAt(0)]=r},a.prototype.clearExecuteHandler=function(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]},a.prototype.setExecuteHandlerFallback=function(t){this._executeHandlerFb=t},a.prototype.addCsiHandler=function(t,r){var s=this._identifier(t);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);var u=this._csiHandlers[s];return u.push(r),{dispose:function(){var f=u.indexOf(r);f!==-1&&u.splice(f,1)}}},a.prototype.setCsiHandler=function(t,r){this._csiHandlers[this._identifier(t)]=[r]},a.prototype.clearCsiHandler=function(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]},a.prototype.setCsiHandlerFallback=function(t){this._csiHandlerFb=t},a.prototype.addDcsHandler=function(t,r){return this._dcsParser.addHandler(this._identifier(t),r)},a.prototype.setDcsHandler=function(t,r){this._dcsParser.setHandler(this._identifier(t),r)},a.prototype.clearDcsHandler=function(t){this._dcsParser.clearHandler(this._identifier(t))},a.prototype.setDcsHandlerFallback=function(t){this._dcsParser.setHandlerFallback(t)},a.prototype.addOscHandler=function(t,r){return this._oscParser.addHandler(t,r)},a.prototype.setOscHandler=function(t,r){this._oscParser.setHandler(t,r)},a.prototype.clearOscHandler=function(t){this._oscParser.clearHandler(t)},a.prototype.setOscHandlerFallback=function(t){this._oscParser.setHandlerFallback(t)},a.prototype.setErrorHandler=function(t){this._errorHandler=t},a.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},a.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},a.prototype.parse=function(t,r){for(var s=0,u=0,f=this.currentState,d=this._oscParser,v=this._dcsParser,m=this._collect,S=this._params,C=this._transitions.table,_=0;_<r;++_){switch((u=C[f<<8|((s=t[_])<160?s:160)])>>4){case 2:for(var y=_+1;;++y){if(y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=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:_,code:s,currentState:f,collect:m,params:S,abort:!1}).abort)return;break;case 7:for(var T=this._csiHandlers[m<<8|s],k=T?T.length-1:-1;k>=0&&T[k](S)===!1;k--);k<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(++_<r&&(s=t[_])>47&&s<60);_--;break;case 9:m<<=8,m|=s;break;case 10:for(var g=this._escHandlers[m<<8|s],F=g?g.length-1:-1;F>=0&&g[F]()===!1;F--);F<0&&this._escHandlerFb(m<<8|s),this.precedingCodepoint=0;break;case 11:S.reset(),S.addParam(0),m=0;break;case 12:v.hook(m<<8|s,S);break;case 13:for(var P=_+1;;++P)if(P>=r||(s=t[P])===24||s===26||s===27||s>127&&s<160){v.put(t,_,P),_=P-1;break}break;case 14:v.unhook(s!==24&&s!==26),s===27&&(u|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0;break;case 4:d.start();break;case 5:for(var N=_+1;;N++)if(N>=r||(s=t[N])<32||s>127&&s<=159){d.put(t,_,N),_=N-1;break}break;case 6:d.end(s!==24&&s!==26),s===27&&(u|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0}f=15&u}this._collect=m,this.currentState=f},a}(p.Disposable);R.EscapeSequenceParser=h},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(d,v){return(L=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,v)},function(d,v){function m(){this.constructor=d}L(d,v),d.prototype=v===null?Object.create(v):(m.prototype=v.prototype,new m)}),p=this&&this.__decorate||function(d,v,m,S){var C,_=arguments.length,y=_<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(d,v,m,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(y=(_<3?C(y):_>3?C(v,m,y):C(v,m))||y);return _>3&&y&&Object.defineProperty(v,m,y),y},E=this&&this.__param||function(d,v){return function(m,S){v(m,S,d)}};Object.defineProperty(R,"__esModule",{value:!0}),R.Renderer=void 0;var b=I(41),i=I(47),c=I(48),o=I(49),h=I(29),n=I(2),a=I(5),t=I(1),r=I(25),s=I(0),u=1,f=function(d){function v(m,S,C,_,y,T,k,g,F){var P=d.call(this)||this;P._colors=m,P._screenElement=S,P._bufferService=y,P._charSizeService=T,P._optionsService=k,P._id=u++,P._onRequestRedraw=new s.EventEmitter;var N=P._optionsService.options.allowTransparency;return P._characterJoinerRegistry=new h.CharacterJoinerRegistry(P._bufferService),P._renderLayers=[new b.TextRenderLayer(P._screenElement,0,P._colors,P._characterJoinerRegistry,N,P._id,P._bufferService,k),new i.SelectionRenderLayer(P._screenElement,1,P._colors,P._id,P._bufferService,k),new o.LinkRenderLayer(P._screenElement,2,P._colors,P._id,C,_,P._bufferService,k),new c.CursorRenderLayer(P._screenElement,3,P._colors,P._id,P._onRequestRedraw,P._bufferService,k,g,F)],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._devicePixelRatio=window.devicePixelRatio,P._updateDimensions(),P.onOptionsChanged(),P}return M(v,d),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){for(var m=0,S=this._renderLayers;m<S.length;m++)S[m].dispose();d.prototype.dispose.call(this),r.removeTerminalFromCache(this._id)},v.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},v.prototype.setColors=function(m){this._colors=m;for(var S=0,C=this._renderLayers;S<C.length;S++){var _=C[S];_.setColors(this._colors),_.reset()}},v.prototype.onResize=function(m,S){this._updateDimensions();for(var C=0,_=this._renderLayers;C<_.length;C++)_[C].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},v.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},v.prototype.onBlur=function(){this._runOperation(function(m){return m.onBlur()})},v.prototype.onFocus=function(){this._runOperation(function(m){return m.onFocus()})},v.prototype.onSelectionChanged=function(m,S,C){C===void 0&&(C=!1),this._runOperation(function(_){return _.onSelectionChanged(m,S,C)})},v.prototype.onCursorMove=function(){this._runOperation(function(m){return m.onCursorMove()})},v.prototype.onOptionsChanged=function(){this._runOperation(function(m){return m.onOptionsChanged()})},v.prototype.clear=function(){this._runOperation(function(m){return m.reset()})},v.prototype._runOperation=function(m){for(var S=0,C=this._renderLayers;S<C.length;S++)m(C[S])},v.prototype.renderRows=function(m,S){for(var C=0,_=this._renderLayers;C<_.length;C++)_[C].onGridChanged(m,S)},v.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=this._optionsService.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},v.prototype.registerCharacterJoiner=function(m){return this._characterJoinerRegistry.registerCharacterJoiner(m)},v.prototype.deregisterCharacterJoiner=function(m){return this._characterJoinerRegistry.deregisterCharacterJoiner(m)},v=p([E(4,t.IBufferService),E(5,a.ICharSizeService),E(6,t.IOptionsService),E(7,t.ICoreService),E(8,a.ICoreBrowserService)],v)}(n.Disposable);R.Renderer=f},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(n,a){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}L(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)});Object.defineProperty(R,"__esModule",{value:!0}),R.TextRenderLayer=void 0;var p=I(42),E=I(13),b=I(6),i=I(3),c=I(29),o=I(4),h=function(n){function a(t,r,s,u,f,d,v,m){var S=n.call(this,t,"text",r,f,s,d,v,m)||this;return S._characterWidth=0,S._characterFont="",S._characterOverlapCache={},S._workCell=new o.CellData,S._state=new p.GridCache,S._characterJoinerRegistry=u,S}return M(a,n),a.prototype.resize=function(t){n.prototype.resize.call(this,t);var r=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===r||(this._characterWidth=t.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},a.prototype.reset=function(){this._state.clear(),this._clearAll()},a.prototype._forEachCell=function(t,r,s,u){for(var f=t;f<=r;f++)for(var d=f+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(d),m=s?s.getJoinedCharacters(d):[],S=0;S<this._bufferService.cols;S++){v.loadCell(S,this._workCell);var C=this._workCell,_=!1,y=S;if(C.getWidth()!==0){if(m.length>0&&S===m[0][0]){_=!0;var T=m.shift();C=new c.JoinedCellData(this._workCell,v.translateToString(!0,T[0],T[1]),T[1]-T[0]),y=T[1]-1}!_&&this._isOverlapping(C)&&y<v.length-1&&v.getCodePoint(y+1)===i.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=2<<22),u(C,S,f),S=y}}},a.prototype._drawBackground=function(t,r){var s=this,u=this._ctx,f=this._bufferService.cols,d=0,v=0,m=null;u.save(),this._forEachCell(t,r,null,function(S,C,_){var y=null;S.isInverse()?y=S.isFgDefault()?s._colors.foreground.css:S.isFgRGB()?"rgb("+b.AttributeData.toColorRGB(S.getFgColor()).join(",")+")":s._colors.ansi[S.getFgColor()].css:S.isBgRGB()?y="rgb("+b.AttributeData.toColorRGB(S.getBgColor()).join(",")+")":S.isBgPalette()&&(y=s._colors.ansi[S.getBgColor()].css),m===null&&(d=C,v=_),_!==v?(u.fillStyle=m||"",s._fillCells(d,v,f-d,1),d=C,v=_):m!==y&&(u.fillStyle=m||"",s._fillCells(d,v,C-d,1),d=C,v=_),m=y}),m!==null&&(u.fillStyle=m,this._fillCells(d,v,f-d,1)),u.restore()},a.prototype._drawForeground=function(t,r){var s=this;this._forEachCell(t,r,this._characterJoinerRegistry,function(u,f,d){if(!u.isInvisible()&&(s._drawChars(u,f,d),u.isUnderline())){if(s._ctx.save(),u.isInverse())if(u.isBgDefault())s._ctx.fillStyle=s._colors.background.css;else if(u.isBgRGB())s._ctx.fillStyle="rgb("+b.AttributeData.toColorRGB(u.getBgColor()).join(",")+")";else{var v=u.getBgColor();s._optionsService.options.drawBoldTextInBrightColors&&u.isBold()&&v<8&&(v+=8),s._ctx.fillStyle=s._colors.ansi[v].css}else if(u.isFgDefault())s._ctx.fillStyle=s._colors.foreground.css;else if(u.isFgRGB())s._ctx.fillStyle="rgb("+b.AttributeData.toColorRGB(u.getFgColor()).join(",")+")";else{var m=u.getFgColor();s._optionsService.options.drawBoldTextInBrightColors&&u.isBold()&&m<8&&(m+=8),s._ctx.fillStyle=s._colors.ansi[m].css}s._fillBottomLineAtCells(f,d,u.getWidth()),s._ctx.restore()}})},a.prototype.onGridChanged=function(t,r){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,t,this._bufferService.cols,r-t+1),this._drawBackground(t,r),this._drawForeground(t,r))},a.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},a.prototype._isOverlapping=function(t){if(t.getWidth()!==1)return!1;if(t.getCode()<256)return!1;var r=t.getChars();if(this._characterOverlapCache.hasOwnProperty(r))return this._characterOverlapCache[r];this._ctx.save(),this._ctx.font=this._characterFont;var s=Math.floor(this._ctx.measureText(r).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[r]=s,s},a}(E.BaseRenderLayer);R.TextRenderLayer=h},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.GridCache=void 0;var L=function(){function M(){this.cache=[]}return M.prototype.resize=function(p,E){for(var b=0;b<p;b++){this.cache.length<=b&&this.cache.push([]);for(var i=this.cache[b].length;i<E;i++)this.cache[b].push(void 0);this.cache[b].length=E}this.cache.length=p},M.prototype.clear=function(){for(var p=0;p<this.cache.length;p++)for(var E=0;E<this.cache[p].length;E++)this.cache[p][E]=void 0},M}();R.GridCache=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(s,u){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var v in d)d.hasOwnProperty(v)&&(f[v]=d[v])})(s,u)},function(s,u){function f(){this.constructor=s}L(s,u),s.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)});Object.defineProperty(R,"__esModule",{value:!0}),R.NoneCharAtlas=R.DynamicCharAtlas=R.getGlyphCacheKey=void 0;var p=I(9),E=I(44),b=I(27),i=I(46),c=I(11),o=I(28),h=I(10),n={css:"rgba(0, 0, 0, 0)",rgba:0};function a(s){return s.code<<21|s.bg<<12|s.fg<<3|(s.bold?0:4)+(s.dim?0:2)+(s.italic?0:1)}R.getGlyphCacheKey=a;var t=function(s){function u(f,d){var v=s.call(this)||this;v._config=d,v._drawToCacheCount=0,v._glyphsWaitingOnBitmap=[],v._bitmapCommitTimeout=null,v._bitmap=null,v._cacheCanvas=f.createElement("canvas"),v._cacheCanvas.width=1024,v._cacheCanvas.height=1024,v._cacheCtx=o.throwIfFalsy(v._cacheCanvas.getContext("2d",{alpha:!0}));var m=f.createElement("canvas");m.width=v._config.scaledCharWidth,m.height=v._config.scaledCharHeight,v._tmpCtx=o.throwIfFalsy(m.getContext("2d",{alpha:v._config.allowTransparency})),v._width=Math.floor(1024/v._config.scaledCharWidth),v._height=Math.floor(1024/v._config.scaledCharHeight);var S=v._width*v._height;return v._cacheMap=new i.LRUMap(S),v._cacheMap.prealloc(S),v}return M(u,s),u.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},u.prototype.beginFrame=function(){this._drawToCacheCount=0},u.prototype.draw=function(f,d,v,m){if(d.code===32)return!0;if(!this._canCache(d))return!1;var S=a(d),C=this._cacheMap.get(S);if(C!=null)return this._drawFromCache(f,C,v,m),!0;if(this._drawToCacheCount<100){var _=void 0;_=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var y=this._drawToCache(d,_);return this._cacheMap.set(S,y),this._drawFromCache(f,y,v,m),!0}return!1},u.prototype._canCache=function(f){return f.code<256},u.prototype._toCoordinateX=function(f){return f%this._width*this._config.scaledCharWidth},u.prototype._toCoordinateY=function(f){return Math.floor(f/this._width)*this._config.scaledCharHeight},u.prototype._drawFromCache=function(f,d,v,m){if(!d.isEmpty){var S=this._toCoordinateX(d.index),C=this._toCoordinateY(d.index);f.drawImage(d.inBitmap?this._bitmap:this._cacheCanvas,S,C,this._config.scaledCharWidth,this._config.scaledCharHeight,v,m,this._config.scaledCharWidth,this._config.scaledCharHeight)}},u.prototype._getColorFromAnsiIndex=function(f){return f<this._config.colors.ansi.length?this._config.colors.ansi[f]:b.DEFAULT_ANSI_COLORS[f]},u.prototype._getBackgroundColor=function(f){return this._config.allowTransparency?n:f.bg===p.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:f.bg<256?this._getColorFromAnsiIndex(f.bg):this._config.colors.background},u.prototype._getForegroundColor=function(f){return f.fg===p.INVERTED_DEFAULT_COLOR?h.color.opaque(this._config.colors.background):f.fg<256?this._getColorFromAnsiIndex(f.fg):this._config.colors.foreground},u.prototype._drawToCache=function(f,d){this._drawToCacheCount++,this._tmpCtx.save();var v=this._getBackgroundColor(f);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=v.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var m=f.bold?this._config.fontWeightBold:this._config.fontWeight,S=f.italic?"italic":"";this._tmpCtx.font=S+" "+m+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(f).css,f.dim&&(this._tmpCtx.globalAlpha=p.DIM_OPACITY),this._tmpCtx.fillText(f.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var C=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),_=!1;this._config.allowTransparency||(_=function(g,F){for(var P=!0,N=F.rgba>>>24,W=F.rgba>>>16&255,j=F.rgba>>>8&255,A=0;A<g.data.length;A+=4)g.data[A]===N&&g.data[A+1]===W&&g.data[A+2]===j?g.data[A+3]=0:P=!1;return P}(C,v));var y=this._toCoordinateX(d),T=this._toCoordinateY(d);this._cacheCtx.putImageData(C,y,T);var k={index:d,isEmpty:_,inBitmap:!1};return this._addGlyphToBitmap(k),k},u.prototype._addGlyphToBitmap=function(f){var d=this;!("createImageBitmap"in window)||c.isFirefox||c.isSafari||(this._glyphsWaitingOnBitmap.push(f),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return d._generateBitmap()},100)))},u.prototype._generateBitmap=function(){var f=this,d=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(v){f._bitmap=v;for(var m=0;m<d.length;m++)d[m].inBitmap=!0}),this._bitmapCommitTimeout=null},u}(E.BaseCharAtlas);R.DynamicCharAtlas=t;var r=function(s){function u(f,d){return s.call(this)||this}return M(u,s),u.prototype.draw=function(f,d,v,m){return!1},u}(E.BaseCharAtlas);R.NoneCharAtlas=r},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.BaseCharAtlas=void 0;var L=function(){function M(){this._didWarmUp=!1}return M.prototype.dispose=function(){},M.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},M.prototype._doWarmUp=function(){},M.prototype.beginFrame=function(){},M}();R.BaseCharAtlas=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.ColorContrastCache=void 0;var L=function(){function M(){this._color={},this._rgba={}}return M.prototype.clear=function(){this._color={},this._rgba={}},M.prototype.setCss=function(p,E,b){this._rgba[p]||(this._rgba[p]={}),this._rgba[p][E]=b},M.prototype.getCss=function(p,E){return this._rgba[p]?this._rgba[p][E]:void 0},M.prototype.setColor=function(p,E,b){this._color[p]||(this._color[p]={}),this._color[p][E]=b},M.prototype.getColor=function(p,E){return this._color[p]?this._color[p][E]:void 0},M}();R.ColorContrastCache=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.LRUMap=void 0;var L=function(){function M(p){this.capacity=p,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return M.prototype._unlinkNode=function(p){var E=p.prev,b=p.next;p===this._head&&(this._head=b),p===this._tail&&(this._tail=E),E!==null&&(E.next=b),b!==null&&(b.prev=E)},M.prototype._appendNode=function(p){var E=this._tail;E!==null&&(E.next=p),p.prev=E,p.next=null,this._tail=p,this._head===null&&(this._head=p)},M.prototype.prealloc=function(p){for(var E=this._nodePool,b=0;b<p;b++)E.push({prev:null,next:null,key:null,value:null})},M.prototype.get=function(p){var E=this._map[p];return E!==void 0?(this._unlinkNode(E),this._appendNode(E),E.value):null},M.prototype.peekValue=function(p){var E=this._map[p];return E!==void 0?E.value:null},M.prototype.peek=function(){var p=this._head;return p===null?null:p.value},M.prototype.set=function(p,E){var b=this._map[p];if(b!==void 0)b=this._map[p],this._unlinkNode(b),b.value=E;else if(this.size>=this.capacity)b=this._head,this._unlinkNode(b),delete this._map[b.key],b.key=p,b.value=E,this._map[p]=b;else{var i=this._nodePool;i.length>0?((b=i.pop()).key=p,b.value=E):b={prev:null,next:null,key:p,value:E},this._map[p]=b,this.size++}this._appendNode(b)},M}();R.LRUMap=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(E,b){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,c){i.__proto__=c}||function(i,c){for(var o in c)c.hasOwnProperty(o)&&(i[o]=c[o])})(E,b)},function(E,b){function i(){this.constructor=E}L(E,b),E.prototype=b===null?Object.create(b):(i.prototype=b.prototype,new i)});Object.defineProperty(R,"__esModule",{value:!0}),R.SelectionRenderLayer=void 0;var p=function(E){function b(i,c,o,h,n,a){var t=E.call(this,i,"selection",c,!0,o,h,n,a)||this;return t._clearState(),t}return M(b,E),b.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},b.prototype.resize=function(i){E.prototype.resize.call(this,i),this._clearState()},b.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},b.prototype.onSelectionChanged=function(i,c,o){if(this._didStateChange(i,c,o,this._bufferService.buffer.ydisp))if(this._clearAll(),i&&c){var h=i[1]-this._bufferService.buffer.ydisp,n=c[1]-this._bufferService.buffer.ydisp,a=Math.max(h,0),t=Math.min(n,this._bufferService.rows-1);if(!(a>=this._bufferService.rows||t<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,o){var r=i[0],s=c[0]-r,u=t-a+1;this._fillCells(r,a,s,u)}else{r=h===a?i[0]:0;var f=a===t?c[0]:this._bufferService.cols;this._fillCells(r,a,f-r,1);var d=Math.max(t-a-1,0);if(this._fillCells(0,a+1,this._bufferService.cols,d),a!==t){var v=n===t?c[0]:this._bufferService.cols;this._fillCells(0,t,v,1)}}this._state.start=[i[0],i[1]],this._state.end=[c[0],c[1]],this._state.columnSelectMode=o,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},b.prototype._didStateChange=function(i,c,o,h){return!this._areCoordinatesEqual(i,this._state.start)||!this._areCoordinatesEqual(c,this._state.end)||o!==this._state.columnSelectMode||h!==this._state.ydisp},b.prototype._areCoordinatesEqual=function(i,c){return!(!i||!c)&&i[0]===c[0]&&i[1]===c[1]},b}(I(13).BaseRenderLayer);R.SelectionRenderLayer=p},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(c,o){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}L(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(R,"__esModule",{value:!0}),R.CursorRenderLayer=void 0;var p=I(13),E=I(4),b=function(c){function o(h,n,a,t,r,s,u,f,d){var v=c.call(this,h,"cursor",n,!0,a,t,s,u)||this;return v._onRequestRedraw=r,v._coreService=f,v._coreBrowserService=d,v._cell=new E.CellData,v._state={x:0,y:0,isFocused:!1,style:"",width:0},v._cursorRenderers={bar:v._renderBarCursor.bind(v),block:v._renderBlockCursor.bind(v),underline:v._renderUnderlineCursor.bind(v)},v}return M(o,c),o.prototype.resize=function(h){c.prototype.resize.call(this,h),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 h,n=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new i(this._coreBrowserService.isFocused,function(){n._render(!0)})):((h=this._cursorBlinkStateManager)===null||h===void 0||h.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(h,n){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype._render=function(h){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var n=this._bufferService.buffer.ybase+this._bufferService.buffer.y,a=n-this._bufferService.buffer.ydisp;if(a<0||a>=this._bufferService.rows)this._clearCursor();else{var t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(n).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 r=this._optionsService.options.cursorStyle;return r&&r!=="block"?this._cursorRenderers[r](t,a,this._cell):this._renderBlurCursor(t,a,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=a,this._state.isFocused=!1,this._state.style=r,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t&&this._state.y===a&&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,a,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=a,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(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(h,n,this._optionsService.options.cursorWidth),this._ctx.restore()},o.prototype._renderBlockCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(h,n,a.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(a,h,n),this._ctx.restore()},o.prototype._renderUnderlineCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(h,n),this._ctx.restore()},o.prototype._renderBlurCursor=function(h,n,a){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(h,n,a.getWidth(),1),this._ctx.restore()},o}(p.BaseRenderLayer);R.CursorRenderLayer=b;var i=function(){function c(o,h){this._renderCallback=h,this.isCursorVisible=!0,o&&this._restartInterval()}return Object.defineProperty(c.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),c.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)},c.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})))},c.prototype._restartInterval=function(o){var h=this;o===void 0&&(o=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(h._animationTimeRestarted){var n=600-(Date.now()-h._animationTimeRestarted);if(h._animationTimeRestarted=void 0,n>0)return void h._restartInterval(n)}h.isCursorVisible=!1,h._animationFrame=window.requestAnimationFrame(function(){h._renderCallback(),h._animationFrame=void 0}),h._blinkInterval=window.setInterval(function(){if(h._animationTimeRestarted){var a=600-(Date.now()-h._animationTimeRestarted);return h._animationTimeRestarted=void 0,void h._restartInterval(a)}h.isCursorVisible=!h.isCursorVisible,h._animationFrame=window.requestAnimationFrame(function(){h._renderCallback(),h._animationFrame=void 0})},600)},o)},c.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)},c.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},c}()},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(c,o){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}L(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(R,"__esModule",{value:!0}),R.LinkRenderLayer=void 0;var p=I(13),E=I(9),b=I(26),i=function(c){function o(h,n,a,t,r,s,u,f){var d=c.call(this,h,"link",n,!0,a,t,u,f)||this;return r.onShowLinkUnderline(function(v){return d._onShowLinkUnderline(v)}),r.onHideLinkUnderline(function(v){return d._onHideLinkUnderline(v)}),s.onShowLinkUnderline(function(v){return d._onShowLinkUnderline(v)}),s.onHideLinkUnderline(function(v){return d._onHideLinkUnderline(v)}),d}return M(o,c),o.prototype.resize=function(h){c.prototype.resize.call(this,h),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 h=this._state.y2-this._state.y1-1;h>0&&this._clearCells(0,this._state.y1+1,this._state.cols,h),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},o.prototype._onShowLinkUnderline=function(h){if(h.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:h.fg&&b.is256Color(h.fg)?this._ctx.fillStyle=this._colors.ansi[h.fg].css:this._ctx.fillStyle=this._colors.foreground.css,h.y1===h.y2)this._fillBottomLineAtCells(h.x1,h.y1,h.x2-h.x1);else{this._fillBottomLineAtCells(h.x1,h.y1,h.cols-h.x1);for(var n=h.y1+1;n<h.y2;n++)this._fillBottomLineAtCells(0,n,h.cols);this._fillBottomLineAtCells(0,h.y2,h.x2)}this._state=h},o.prototype._onHideLinkUnderline=function(h){this._clearCurrentLink()},o}(p.BaseRenderLayer);R.LinkRenderLayer=i},function(G,R,I){"use strict";var L=this&&this.__decorate||function(c,o,h,n){var a,t=arguments.length,r=t<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,h):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(c,o,h,n);else for(var s=c.length-1;s>=0;s--)(a=c[s])&&(r=(t<3?a(r):t>3?a(o,h,r):a(o,h))||r);return t>3&&r&&Object.defineProperty(o,h,r),r},M=this&&this.__param||function(c,o){return function(h,n){o(h,n,c)}};Object.defineProperty(R,"__esModule",{value:!0}),R.MouseZone=R.Linkifier=void 0;var p=I(0),E=I(1),b=function(){function c(o,h,n){this._bufferService=o,this._logService=h,this._unicodeService=n,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new p.EventEmitter,this._onHideLinkUnderline=new p.EventEmitter,this._onLinkTooltip=new p.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(c.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),c.prototype.attachToDom=function(o,h){this._element=o,this._mouseZoneManager=h},c.prototype.linkifyRows=function(o,h){var n=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=o,this._rowsToLinkify.end=h):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,o),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,h)),this._mouseZoneManager.clearAll(o,h),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return n._linkifyRows()},c._timeBeforeLatency))},c.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var o=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var h=o.ydisp+this._rowsToLinkify.start;if(!(h>=o.lines.length)){for(var n=o.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,a=Math.ceil(2e3/this._bufferService.cols),t=this._bufferService.buffer.iterator(!1,h,n,a,a);t.hasNext();)for(var r=t.next(),s=0;s<this._linkMatchers.length;s++)this._doLinkifyRow(r.range.first,r.content,this._linkMatchers[s]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},c.prototype.registerLinkMatcher=function(o,h,n){if(n===void 0&&(n={}),!h)throw new Error("handler must be defined");var a={id:this._nextLinkMatcherId++,regex:o,handler:h,matchIndex:n.matchIndex,validationCallback:n.validationCallback,hoverTooltipCallback:n.tooltipCallback,hoverLeaveCallback:n.leaveCallback,willLinkActivate:n.willLinkActivate,priority:n.priority||0};return this._addLinkMatcherToList(a),a.id},c.prototype._addLinkMatcherToList=function(o){if(this._linkMatchers.length!==0){for(var h=this._linkMatchers.length-1;h>=0;h--)if(o.priority<=this._linkMatchers[h].priority)return void this._linkMatchers.splice(h+1,0,o);this._linkMatchers.splice(0,0,o)}else this._linkMatchers.push(o)},c.prototype.deregisterLinkMatcher=function(o){for(var h=0;h<this._linkMatchers.length;h++)if(this._linkMatchers[h].id===o)return this._linkMatchers.splice(h,1),!0;return!1},c.prototype._doLinkifyRow=function(o,h,n){for(var a,t=this,r=new RegExp(n.regex.source,(n.regex.flags||"")+"g"),s=-1,u=function(){var d=a[typeof n.matchIndex!="number"?0:n.matchIndex];if(!d)return f._logService.debug("match found without corresponding matchIndex",a,n),"break";if(s=h.indexOf(d,s+1),r.lastIndex=s+d.length,s<0)return"break";var v=f._bufferService.buffer.stringIndexToBufferIndex(o,s);if(v[0]<0)return"break";var m=f._bufferService.buffer.lines.get(v[0]);if(!m)return"break";var S=m.getFg(v[1]),C=S?S>>9&511:void 0;n.validationCallback?n.validationCallback(d,function(_){t._rowsTimeoutId||_&&t._addLink(v[1],v[0]-t._bufferService.buffer.ydisp,d,n,C)}):f._addLink(v[1],v[0]-f._bufferService.buffer.ydisp,d,n,C)},f=this;(a=r.exec(h))!==null&&!(u()==="break"););},c.prototype._addLink=function(o,h,n,a,t){var r=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(n),u=o%this._bufferService.cols,f=h+Math.floor(o/this._bufferService.cols),d=(u+s)%this._bufferService.cols,v=f+Math.floor((u+s)/this._bufferService.cols);d===0&&(d=this._bufferService.cols,v--),this._mouseZoneManager.add(new i(u+1,f+1,d+1,v+1,function(m){if(a.handler)return a.handler(m,n);var S=window.open();S?(S.opener=null,S.location.href=n):console.warn("Opening link blocked as opener could not be cleared")},function(){r._onShowLinkUnderline.fire(r._createLinkHoverEvent(u,f,d,v,t)),r._element.classList.add("xterm-cursor-pointer")},function(m){r._onLinkTooltip.fire(r._createLinkHoverEvent(u,f,d,v,t)),a.hoverTooltipCallback&&a.hoverTooltipCallback(m,n,{start:{x:u,y:f},end:{x:d,y:v}})},function(){r._onHideLinkUnderline.fire(r._createLinkHoverEvent(u,f,d,v,t)),r._element.classList.remove("xterm-cursor-pointer"),a.hoverLeaveCallback&&a.hoverLeaveCallback()},function(m){return!a.willLinkActivate||a.willLinkActivate(m,n)}))}},c.prototype._createLinkHoverEvent=function(o,h,n,a,t){return{x1:o,y1:h,x2:n,y2:a,cols:this._bufferService.cols,fg:t}},c._timeBeforeLatency=200,c=L([M(0,E.IBufferService),M(1,E.ILogService),M(2,E.IUnicodeService)],c)}();R.Linkifier=b;var i=function(c,o,h,n,a,t,r,s,u){this.x1=c,this.y1=o,this.x2=h,this.y2=n,this.clickCallback=a,this.hoverCallback=t,this.tooltipCallback=r,this.leaveCallback=s,this.willLinkActivate=u};R.MouseZone=i},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(d,v){return(L=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,v)},function(d,v){function m(){this.constructor=d}L(d,v),d.prototype=v===null?Object.create(v):(m.prototype=v.prototype,new m)}),p=this&&this.__decorate||function(d,v,m,S){var C,_=arguments.length,y=_<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(d,v,m,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(y=(_<3?C(y):_>3?C(v,m,y):C(v,m))||y);return _>3&&y&&Object.defineProperty(v,m,y),y},E=this&&this.__param||function(d,v){return function(m,S){v(m,S,d)}};Object.defineProperty(R,"__esModule",{value:!0}),R.SelectionService=void 0;var b=I(11),i=I(52),c=I(4),o=I(0),h=I(5),n=I(1),a=I(30),t=I(53),r=I(2),s=String.fromCharCode(160),u=new RegExp(s,"g"),f=function(d){function v(m,S,C,_,y,T,k){var g=d.call(this)||this;return g._element=m,g._screenElement=S,g._bufferService=C,g._coreService=_,g._mouseService=y,g._optionsService=T,g._renderService=k,g._dragScrollAmount=0,g._enabled=!0,g._workCell=new c.CellData,g._mouseDownTimeStamp=0,g._onLinuxMouseSelection=g.register(new o.EventEmitter),g._onRedrawRequest=g.register(new o.EventEmitter),g._onSelectionChange=g.register(new o.EventEmitter),g._onRequestScrollLines=g.register(new o.EventEmitter),g._mouseMoveListener=function(F){return g._onMouseMove(F)},g._mouseUpListener=function(F){return g._onMouseUp(F)},g._coreService.onUserInput(function(){g.hasSelection&&g.clearSelection()}),g._trimListener=g._bufferService.buffer.lines.onTrim(function(F){return g._onTrim(F)}),g.register(g._bufferService.buffers.onBufferActivate(function(F){return g._onBufferActivate(F)})),g.enable(),g._model=new i.SelectionModel(g._bufferService),g._activeSelectionMode=0,g}return M(v,d),Object.defineProperty(v.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){this._removeMouseDownListeners()},v.prototype.reset=function(){this.clearSelection()},v.prototype.disable=function(){this.clearSelection(),this._enabled=!1},v.prototype.enable=function(){this._enabled=!0},Object.defineProperty(v.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(v.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(v.prototype,"selectionText",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!m||!S)return"";var C=this._bufferService.buffer,_=[];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]);_.push(T)}}else{var k=m[1]===S[1]?S[0]:void 0;for(_.push(C.translateBufferLineToString(m[1],!0,m[0],k)),y=m[1]+1;y<=S[1]-1;y++){var g=C.lines.get(y);T=C.translateBufferLineToString(y,!0),g&&g.isWrapped?_[_.length-1]+=T:_.push(T)}m[1]!==S[1]&&(g=C.lines.get(S[1]),T=C.translateBufferLineToString(S[1],!0,0,S[0]),g&&g.isWrapped?_[_.length-1]+=T:_.push(T))}return _.map(function(F){return F.replace(u," ")}).join(b.isWindows?`\r
`:`
`)},enumerable:!1,configurable:!0}),v.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},v.prototype.refresh=function(m){var S=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return S._refresh()})),b.isLinux&&m)&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},v.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},v.prototype.isClickInSelection=function(m){var S=this._getMouseBufferCoords(m),C=this._model.finalSelectionStart,_=this._model.finalSelectionEnd;return!!(C&&_&&S)&&this._areCoordsInSelection(S,C,_)},v.prototype._areCoordsInSelection=function(m,S,C){return m[1]>S[1]&&m[1]<C[1]||S[1]===C[1]&&m[1]===S[1]&&m[0]>=S[0]&&m[0]<C[0]||S[1]<C[1]&&m[1]===C[1]&&m[0]<C[0]||S[1]<C[1]&&m[1]===S[1]&&m[0]>=S[0]},v.prototype.selectWordAtCursor=function(m){var S=this._getMouseBufferCoords(m);S&&(this._selectWordAt(S,!1),this._model.selectionEnd=void 0,this.refresh(!0))},v.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},v.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()},v.prototype._onTrim=function(m){this._model.onTrim(m)&&this.refresh()},v.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},v.prototype._getMouseEventScrollAmount=function(m){var S=a.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))},v.prototype.shouldForceSelection=function(m){return b.isMac?m.altKey&&this._optionsService.options.macOptionClickForcesSelection:m.shiftKey},v.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)}},v.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)},v.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},v.prototype._onIncrementalClick=function(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))},v.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]++}},v.prototype._onDoubleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=1,this._selectWordAt(S,!0))},v.prototype._onTripleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))},v.prototype.shouldColumnSelect=function(m){return m.altKey&&!(b.isMac&&this._optionsService.options.macOptionClickForcesSelection)},v.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]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>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]<C.lines.length){var _=C.lines.get(this._model.selectionEnd[1]);_&&_.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},v.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var m=this._bufferService.buffer;this._dragScrollAmount>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()}},v.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 _=t.moveToCellSequence(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(_,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},v.prototype._onBufferActivate=function(m){var S=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(function(C){return S._onTrim(C)})},v.prototype._convertViewportColToCharacterIndex=function(m,S){for(var C=S[0],_=0;S[0]>=_;_++){var y=m.loadCell(_,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&S[0]!==_&&(C+=y-1)}return C},v.prototype.setSelection=function(m,S,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,S],this._model.selectionStartLength=C,this.refresh()},v.prototype._getWordAt=function(m,S,C,_){if(C===void 0&&(C=!0),_===void 0&&(_=!0),!(m[0]>=this._bufferService.cols)){var y=this._bufferService.buffer,T=y.lines.get(m[1]);if(T){var k=y.translateBufferLineToString(m[1],!1),g=this._convertViewportColToCharacterIndex(T,m),F=g,P=m[0]-g,N=0,W=0,j=0,A=0;if(k.charAt(g)===" "){for(;g>0&&k.charAt(g-1)===" ";)g--;for(;F<k.length&&k.charAt(F+1)===" ";)F++}else{var K=m[0],U=m[0];T.getWidth(K)===0&&(N++,K--),T.getWidth(U)===2&&(W++,U++);var O=T.getString(U).length;for(O>1&&(A+=O-1,F+=O-1);K>0&&g>0&&!this._isCharWordSeparator(T.loadCell(K-1,this._workCell));){T.loadCell(K-1,this._workCell);var z=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,K--):z>1&&(j+=z-1,g-=z-1),g--,K--}for(;U<T.length&&F+1<k.length&&!this._isCharWordSeparator(T.loadCell(U+1,this._workCell));){T.loadCell(U+1,this._workCell);var te=this._workCell.getChars().length;this._workCell.getWidth()===2?(W++,U++):te>1&&(A+=te-1,F+=te-1),F++,U++}}F++;var de=g+P-N+j,be=Math.min(this._bufferService.cols,F-g+N+W-j-A);if(S||k.slice(g,F).trim()!==""){if(C&&de===0&&T.getCodePoint(0)!==32){var je=y.lines.get(m[1]-1);if(je&&T.isWrapped&&je.getCodePoint(this._bufferService.cols-1)!==32){var Ne=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Ne){var Oe=this._bufferService.cols-Ne.start;de-=Oe,be+=Oe}}}if(_&&de+be===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){var Ke=y.lines.get(m[1]+1);if(Ke&&Ke.isWrapped&&Ke.getCodePoint(0)!==32){var We=this._getWordAt([0,m[1]+1],!1,!1,!0);We&&(be+=We.length)}}return{start:de,length:be}}}}},v.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}},v.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]}},v.prototype._isCharWordSeparator=function(m){return m.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(m.getChars())>=0},v.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},v=p([E(2,n.IBufferService),E(3,n.ICoreService),E(4,h.IMouseService),E(5,n.IOptionsService),E(6,h.IRenderService)],v)}(r.Disposable);R.SelectionService=f},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.SelectionModel=void 0;var L=function(){function M(p){this._bufferService=p,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 p=this.selectionStart[0]+this.selectionStartLength;return p>this._bufferService.cols?[p%this._bufferService.cols,this.selectionStart[1]+Math.floor(p/this._bufferService.cols)]:[p,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 p=this.selectionStart,E=this.selectionEnd;return!(!p||!E)&&(p[1]>E[1]||p[1]===E[1]&&p[0]>E[0])},M.prototype.onTrim=function(p){return this.selectionStart&&(this.selectionStart[1]-=p),this.selectionEnd&&(this.selectionEnd[1]-=p),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},M}();R.SelectionModel=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.moveToCellSequence=void 0;var L=I(12);function M(o,h,n,a){var t=o-p(n,o),r=h-p(n,h);return c(Math.abs(t-r)-function(s,u,f){for(var d=0,v=s-p(f,s),m=u-p(f,u),S=0;S<Math.abs(v-m);S++){var C=E(s,u)==="A"?-1:1,_=f.buffer.lines.get(v+C*S);_&&_.isWrapped&&d++}return d}(o,h,n),i(E(o,h),a))}function p(o,h){for(var n=0,a=o.buffer.lines.get(h),t=a&&a.isWrapped;t&&h>=0&&h<o.rows;)n++,t=(a=o.buffer.lines.get(--h))&&a.isWrapped;return n}function E(o,h){return o>h?"A":"B"}function b(o,h,n,a,t,r){for(var s=o,u=h,f="";s!==n||u!==a;)s+=t?1:-1,t&&s>r.cols-1?(f+=r.buffer.translateBufferLineToString(u,!1,o,s),s=0,o=0,u++):!t&&s<0&&(f+=r.buffer.translateBufferLineToString(u,!1,0,o+1),o=s=r.cols-1,u--);return f+r.buffer.translateBufferLineToString(u,!1,o,s)}function i(o,h){var n=h?"O":"[";return L.C0.ESC+n+o}function c(o,h){o=Math.floor(o);for(var n="",a=0;a<o;a++)n+=h;return n}R.moveToCellSequence=function(o,h,n,a){var t,r=n.buffer.x,s=n.buffer.y;if(!n.buffer.hasScrollback)return function(f,d,v,m,S,C){return M(d,m,S,C).length===0?"":c(b(f,d,f,d-p(S,d),!1,S).length,i("D",C))}(r,s,0,h,n,a)+M(s,h,n,a)+function(f,d,v,m,S,C){var _;_=M(d,m,S,C).length>0?m-p(S,m):d;var y=m,T=function(k,g,F,P,N,W){var j;return j=M(F,P,N,W).length>0?P-p(N,P):g,k<F&&j<=P||k>=F&&j<P?"C":"D"}(f,d,v,m,S,C);return c(b(f,_,v,y,T==="C",S).length,i(T,C))}(r,s,o,h,n,a);if(s===h)return t=r>o?"D":"C",c(Math.abs(r-o),i(t,a));t=s>h?"D":"C";var u=Math.abs(s-h);return c(function(f,d){return d.cols-f}(s>h?o:r,n)+(u-1)*n.cols+1+((s>h?r:o)-1),i(t,a))}},function(G,R,I){"use strict";var L=this&&this.__decorate||function(b,i,c,o){var h,n=arguments.length,a=n<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(b,i,c,o);else for(var t=b.length-1;t>=0;t--)(h=b[t])&&(a=(n<3?h(a):n>3?h(i,c,a):h(i,c))||a);return n>3&&a&&Object.defineProperty(i,c,a),a},M=this&&this.__param||function(b,i){return function(c,o){i(c,o,b)}};Object.defineProperty(R,"__esModule",{value:!0}),R.SoundService=void 0;var p=I(1),E=function(){function b(i){this._optionsService=i}return Object.defineProperty(b,"audioContext",{get:function(){if(!b._audioContext){var i=window.AudioContext||window.webkitAudioContext;if(!i)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;b._audioContext=new i}return b._audioContext},enumerable:!1,configurable:!0}),b.prototype.playBellSound=function(){var i=b.audioContext;if(i){var c=i.createBufferSource();i.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(o){c.buffer=o,c.connect(i.destination),c.start(0)})}},b.prototype._base64ToArrayBuffer=function(i){for(var c=window.atob(i),o=c.length,h=new Uint8Array(o),n=0;n<o;n++)h[n]=c.charCodeAt(n);return h.buffer},b.prototype._removeMimeType=function(i){return i.split(",")[1]},b=L([M(0,p.IOptionsService)],b)}();R.SoundService=E},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(n,a){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}L(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,f=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,a,t,r);else for(var d=n.length-1;d>=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.MouseZoneManager=void 0;var b=I(2),i=I(7),c=I(5),o=I(1),h=function(n){function a(t,r,s,u,f,d){var v=n.call(this)||this;return v._element=t,v._screenElement=r,v._bufferService=s,v._mouseService=u,v._selectionService=f,v._optionsService=d,v._zones=[],v._areZonesActive=!1,v._lastHoverCoords=[void 0,void 0],v._initialSelectionLength=0,v.register(i.addDisposableDomListener(v._element,"mousedown",function(m){return v._onMouseDown(m)})),v._mouseMoveListener=function(m){return v._onMouseMove(m)},v._mouseLeaveListener=function(m){return v._onMouseLeave(m)},v._clickListener=function(m){return v._onClick(m)},v}return M(a,n),a.prototype.dispose=function(){n.prototype.dispose.call(this),this._deactivate()},a.prototype.add=function(t){this._zones.push(t),this._zones.length===1&&this._activate()},a.prototype.clearAll=function(t,r){if(this._zones.length!==0){t&&r||(t=0,r=this._bufferService.rows-1);for(var s=0;s<this._zones.length;s++){var u=this._zones[s];(u.y1>t&&u.y1<=r+1||u.y2>t&&u.y2<=r+1||u.y1<t&&u.y2>r+1)&&(this._currentZone&&this._currentZone===u&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(s--,1))}this._zones.length===0&&this._deactivate()}},a.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))},a.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))},a.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},a.prototype._onHover=function(t){var r=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 r._onTooltip(t)},this._optionsService.options.linkTooltipHoverDuration)))},a.prototype._onTooltip=function(t){this._tooltipTimeout=void 0;var r=this._findZoneEventAt(t);r&&r.tooltipCallback&&r.tooltipCallback(t)},a.prototype._onMouseDown=function(t){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var r=this._findZoneEventAt(t);(r==null?void 0:r.willLinkActivate(t))&&(t.preventDefault(),t.stopImmediatePropagation())}},a.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},a.prototype._onClick=function(t){var r=this._findZoneEventAt(t),s=this._getSelectionLength();r&&s===this._initialSelectionLength&&(r.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},a.prototype._getSelectionLength=function(){var t=this._selectionService.selectionText;return t?t.length:0},a.prototype._findZoneEventAt=function(t){var r=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(r)for(var s=r[0],u=r[1],f=0;f<this._zones.length;f++){var d=this._zones[f];if(d.y1===d.y2){if(u===d.y1&&s>=d.x1&&s<d.x2)return d}else if(u===d.y1&&s>=d.x1||u===d.y2&&s<d.x2||u>d.y1&&u<d.y2)return d}},a=p([E(2,o.IBufferService),E(3,c.IMouseService),E(4,c.ISelectionService),E(5,o.IOptionsService)],a)}(b.Disposable);R.MouseZoneManager=h},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(a,t){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var u in s)s.hasOwnProperty(u)&&(r[u]=s[u])})(a,t)},function(a,t){function r(){this.constructor=a}L(a,t),a.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(R,"__esModule",{value:!0}),R.AccessibilityManager=void 0;var p=I(18),E=I(11),b=I(31),i=I(7),c=I(2),o=I(32),h=I(17),n=function(a){function t(r,s){var u=a.call(this)||this;u._terminal=r,u._renderService=s,u._liveRegionLineCount=0,u._charsToConsume=[],u._charsToAnnounce="",u._accessibilityTreeRoot=document.createElement("div"),u._accessibilityTreeRoot.classList.add("xterm-accessibility"),u._rowContainer=document.createElement("div"),u._rowContainer.classList.add("xterm-accessibility-tree"),u._rowContainer.setAttribute("role","list"),u._rowElements=[];for(var f=0;f<u._terminal.rows;f++)u._rowElements[f]=u._createAccessibilityTreeNode(),u._rowContainer.appendChild(u._rowElements[f]);if(u._topBoundaryFocusListener=function(d){return u._onBoundaryFocus(d,0)},u._bottomBoundaryFocusListener=function(d){return u._onBoundaryFocus(d,1)},u._rowElements[0].addEventListener("focus",u._topBoundaryFocusListener),u._rowElements[u._rowElements.length-1].addEventListener("focus",u._bottomBoundaryFocusListener),u._refreshRowsDimensions(),u._accessibilityTreeRoot.appendChild(u._rowContainer),u._renderRowsDebouncer=new b.RenderDebouncer(u._renderRows.bind(u)),u._refreshRows(),u._liveRegion=document.createElement("div"),u._liveRegion.classList.add("live-region"),u._liveRegion.setAttribute("aria-live","assertive"),u._accessibilityTreeRoot.appendChild(u._liveRegion),!u._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return u._terminal.element.insertAdjacentElement("afterbegin",u._accessibilityTreeRoot),u.register(u._renderRowsDebouncer),u.register(u._terminal.onResize(function(d){return u._onResize(d.rows)})),u.register(u._terminal.onRender(function(d){return u._refreshRows(d.start,d.end)})),u.register(u._terminal.onScroll(function(){return u._refreshRows()})),u.register(u._terminal.onA11yChar(function(d){return u._onChar(d)})),u.register(u._terminal.onLineFeed(function(){return u._onChar(`
`)})),u.register(u._terminal.onA11yTab(function(d){return u._onTab(d)})),u.register(u._terminal.onKey(function(d){return u._onKey(d.key)})),u.register(u._terminal.onBlur(function(){return u._clearLiveRegion()})),u.register(u._renderService.onDimensionsChange(function(){return u._refreshRowsDimensions()})),u._screenDprMonitor=new o.ScreenDprMonitor,u.register(u._screenDprMonitor),u._screenDprMonitor.setListener(function(){return u._refreshRowsDimensions()}),u.register(i.addDisposableDomListener(window,"resize",function(){return u._refreshRowsDimensions()})),u}return M(t,a),t.prototype.dispose=function(){a.prototype.dispose.call(this),h.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(r,s){var u=r.target,f=this._rowElements[s===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")!==(s===0?"1":""+this._terminal.buffer.lines.length)&&r.relatedTarget===f){var d,v;if(s===0?(d=u,v=this._rowElements.pop(),this._rowContainer.removeChild(v)):(d=this._rowElements.shift(),v=u,this._rowContainer.removeChild(d)),d.removeEventListener("focus",this._topBoundaryFocusListener),v.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){var m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else m=this._createAccessibilityTreeNode(),this._rowElements.push(m),this._rowContainer.appendChild(m);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),r.preventDefault(),r.stopImmediatePropagation()}},t.prototype._onResize=function(r){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var r=document.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r},t.prototype._onTab=function(r){for(var s=0;s<r;s++)this._onChar(" ")},t.prototype._onChar=function(r){var s=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==r&&(this._charsToAnnounce+=r):this._charsToAnnounce+=r,r===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.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&&h.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(r){this._clearLiveRegion(),this._charsToConsume.push(r)},t.prototype._refreshRows=function(r,s){this._renderRowsDebouncer.refresh(r,s,this._terminal.rows)},t.prototype._renderRows=function(r,s){for(var u=this._terminal.buffer,f=u.lines.length.toString(),d=r;d<=s;d++){var v=u.translateBufferLineToString(u.ydisp+d,!0),m=(u.ydisp+d+1).toString(),S=this._rowElements[d];S&&(v.length===0?S.innerHTML="&nbsp;":S.textContent=v,S.setAttribute("aria-posinset",m),S.setAttribute("aria-setsize",f))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var r=0;r<this._terminal.rows;r++)this._refreshRowDimensions(this._rowElements[r])}},t.prototype._refreshRowDimensions=function(r){r.style.height=this._renderService.dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(c.Disposable);R.AccessibilityManager=n},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(u,f){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,v){d.__proto__=v}||function(d,v){for(var m in v)v.hasOwnProperty(m)&&(d[m]=v[m])})(u,f)},function(u,f){function d(){this.constructor=u}L(u,f),u.prototype=f===null?Object.create(f):(d.prototype=f.prototype,new d)}),p=this&&this.__decorate||function(u,f,d,v){var m,S=arguments.length,C=S<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,f,d,v);else for(var _=u.length-1;_>=0;_--)(m=u[_])&&(C=(S<3?m(C):S>3?m(f,d,C):m(f,d))||C);return S>3&&C&&Object.defineProperty(f,d,C),C},E=this&&this.__param||function(u,f){return function(d,v){f(d,v,u)}};Object.defineProperty(R,"__esModule",{value:!0}),R.DomRenderer=void 0;var b=I(58),i=I(9),c=I(2),o=I(5),h=I(1),n=I(0),a=I(10),t=I(17),r=1,s=function(u){function f(d,v,m,S,C,_,y,T,k){var g=u.call(this)||this;return g._colors=d,g._element=v,g._screenElement=m,g._viewportElement=S,g._linkifier=C,g._linkifier2=_,g._charSizeService=y,g._optionsService=T,g._bufferService=k,g._terminalClass=r++,g._rowElements=[],g._rowContainer=document.createElement("div"),g._rowContainer.classList.add("xterm-rows"),g._rowContainer.style.lineHeight="normal",g._rowContainer.setAttribute("aria-hidden","true"),g._refreshRowElements(g._bufferService.cols,g._bufferService.rows),g._selectionContainer=document.createElement("div"),g._selectionContainer.classList.add("xterm-selection"),g._selectionContainer.setAttribute("aria-hidden","true"),g.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},g._updateDimensions(),g._injectCss(),g._rowFactory=new b.DomRendererRowFactory(document,g._optionsService,g._colors),g._element.classList.add("xterm-dom-renderer-owner-"+g._terminalClass),g._screenElement.appendChild(g._rowContainer),g._screenElement.appendChild(g._selectionContainer),g._linkifier.onShowLinkUnderline(function(F){return g._onLinkHover(F)}),g._linkifier.onHideLinkUnderline(function(F){return g._onLinkLeave(F)}),g._linkifier2.onShowLinkUnderline(function(F){return g._onLinkHover(F)}),g._linkifier2.onHideLinkUnderline(function(F){return g._onLinkLeave(F)}),g}return M(f,u),Object.defineProperty(f.prototype,"onRequestRedraw",{get:function(){return new n.EventEmitter().event},enumerable:!1,configurable:!0}),f.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),t.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),u.prototype.dispose.call(this)},f.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,v=this._rowElements;d<v.length;d++){var m=v[d];m.style.width=this.dimensions.canvasWidth+"px",m.style.height=this.dimensions.actualCellHeight+"px",m.style.lineHeight=this.dimensions.actualCellHeight+"px",m.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var S=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=S,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},f.prototype.setColors=function(d){this._colors=d,this._injectCss()},f.prototype._injectCss=function(){var d=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var v=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";v+=this._terminalSelector+" span:not(."+b.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+b.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+b.ITALIC_CLASS+" { font-style: italic;}",v+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",v+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",v+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+b.CURSOR_CLASS+"."+b.CURSOR_BLINK_CLASS+":not(."+b.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+b.CURSOR_CLASS+"."+b.CURSOR_BLINK_CLASS+"."+b.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",v+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach(function(m,S){v+=d._terminalSelector+" .xterm-fg-"+S+" { color: "+m.css+"; }"+d._terminalSelector+" .xterm-bg-"+S+" { background-color: "+m.css+"; }"}),v+=this._terminalSelector+" .xterm-fg-"+i.INVERTED_DEFAULT_COLOR+" { color: "+a.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+i.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=v},f.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},f.prototype._refreshRowElements=function(d,v){for(var m=this._rowElements.length;m<=v;m++){var S=document.createElement("div");this._rowContainer.appendChild(S),this._rowElements.push(S)}for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop())},f.prototype.onResize=function(d,v){this._refreshRowElements(d,v),this._updateDimensions()},f.prototype.onCharSizeChanged=function(){this._updateDimensions()},f.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},f.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},f.prototype.onSelectionChanged=function(d,v,m){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(d&&v){var S=d[1]-this._bufferService.buffer.ydisp,C=v[1]-this._bufferService.buffer.ydisp,_=Math.max(S,0),y=Math.min(C,this._bufferService.rows-1);if(!(_>=this._bufferService.rows||y<0)){var T=document.createDocumentFragment();if(m)T.appendChild(this._createSelectionElement(_,d[0],v[0],y-_+1));else{var k=S===_?d[0]:0,g=_===y?v[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(_,k,g));var F=y-_-1;if(T.appendChild(this._createSelectionElement(_+1,0,this._bufferService.cols,F)),_!==y){var P=C===y?v[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(y,0,P))}}this._selectionContainer.appendChild(T)}}},f.prototype._createSelectionElement=function(d,v,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=v*this.dimensions.actualCellWidth+"px",C.style.width=this.dimensions.actualCellWidth*(m-v)+"px",C},f.prototype.onCursorMove=function(){},f.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},f.prototype.clear=function(){for(var d=0,v=this._rowElements;d<v.length;d++)v[d].innerHTML=""},f.prototype.renderRows=function(d,v){for(var m=this._bufferService.buffer.ybase+this._bufferService.buffer.y,S=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),C=this._optionsService.options.cursorBlink,_=d;_<=v;_++){var y=this._rowElements[_];y.innerHTML="";var T=_+this._bufferService.buffer.ydisp,k=this._bufferService.buffer.lines.get(T),g=this._optionsService.options.cursorStyle;y.appendChild(this._rowFactory.createRow(k,T===m,g,S,C,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(f.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),f.prototype.registerCharacterJoiner=function(d){return-1},f.prototype.deregisterCharacterJoiner=function(d){return!1},f.prototype._onLinkHover=function(d){this._setCellUnderline(d.x1,d.x2,d.y1,d.y2,d.cols,!0)},f.prototype._onLinkLeave=function(d){this._setCellUnderline(d.x1,d.x2,d.y1,d.y2,d.cols,!1)},f.prototype._setCellUnderline=function(d,v,m,S,C,_){for(;d!==v||m!==S;){var y=this._rowElements[m];if(!y)return;var T=y.children[d];T&&(T.style.textDecoration=_?"underline":"none"),++d>=C&&(d=0,m++)}},f=p([E(6,o.ICharSizeService),E(7,h.IOptionsService),E(8,h.IBufferService)],f)}(c.Disposable);R.DomRenderer=s},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.DomRendererRowFactory=R.CURSOR_STYLE_UNDERLINE_CLASS=R.CURSOR_STYLE_BAR_CLASS=R.CURSOR_STYLE_BLOCK_CLASS=R.CURSOR_BLINK_CLASS=R.CURSOR_CLASS=R.UNDERLINE_CLASS=R.ITALIC_CLASS=R.DIM_CLASS=R.BOLD_CLASS=void 0;var L=I(9),M=I(3),p=I(4),E=I(10);R.BOLD_CLASS="xterm-bold",R.DIM_CLASS="xterm-dim",R.ITALIC_CLASS="xterm-italic",R.UNDERLINE_CLASS="xterm-underline",R.CURSOR_CLASS="xterm-cursor",R.CURSOR_BLINK_CLASS="xterm-cursor-blink",R.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",R.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",R.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var b=function(){function c(o,h,n){this._document=o,this._optionsService=h,this._colors=n,this._workCell=new p.CellData}return c.prototype.setColors=function(o){this._colors=o},c.prototype.createRow=function(o,h,n,a,t,r,s){for(var u=this._document.createDocumentFragment(),f=0,d=Math.min(o.length,s)-1;d>=0;d--)if(o.loadCell(d,this._workCell).getCode()!==M.NULL_CELL_CODE||h&&d===a){f=d+1;break}for(d=0;d<f;d++){o.loadCell(d,this._workCell);var v=this._workCell.getWidth();if(v!==0){var m=this._document.createElement("span");if(v>1&&(m.style.width=r*v+"px"),h&&d===a)switch(m.classList.add(R.CURSOR_CLASS),t&&m.classList.add(R.CURSOR_BLINK_CLASS),n){case"bar":m.classList.add(R.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(R.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(R.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&m.classList.add(R.BOLD_CLASS),this._workCell.isItalic()&&m.classList.add(R.ITALIC_CLASS),this._workCell.isDim()&&m.classList.add(R.DIM_CLASS),this._workCell.isUnderline()&&m.classList.add(R.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(),_=this._workCell.getBgColor(),y=this._workCell.getBgColorMode(),T=!!this._workCell.isInverse();if(T){var k=S;S=_,_=k;var g=C;C=y,y=g}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 F=E.rgba.toColor(S>>16&255,S>>8&255,255&S);this._applyMinimumContrast(m,this._colors.background,F)||this._addStyle(m,"color:#"+i(S.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(m,this._colors.background,this._colors.foreground)||T&&m.classList.add("xterm-fg-"+L.INVERTED_DEFAULT_COLOR)}switch(y){case 16777216:case 33554432:m.classList.add("xterm-bg-"+_);break;case 50331648:this._addStyle(m,"background-color:#"+i(_.toString(16),"0",6));break;case 0:default:T&&m.classList.add("xterm-bg-"+L.INVERTED_DEFAULT_COLOR)}u.appendChild(m)}}return u},c.prototype._applyMinimumContrast=function(o,h,n){if(this._optionsService.options.minimumContrastRatio===1)return!1;var a=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return a===void 0&&(a=E.color.ensureContrastRatio(h,n,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,a!=null?a:null)),!!a&&(this._addStyle(o,"color:"+a.css),!0)},c.prototype._addStyle=function(o,h){o.setAttribute("style",""+(o.getAttribute("style")||"")+h+";")},c}();function i(c,o,h){for(;c.length<h;)c=o+c;return c}R.DomRendererRowFactory=b},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.evaluateKeyboardEvent=void 0;var L=I(12),M={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};R.evaluateKeyboardEvent=function(p,E,b,i){var c={type:0,cancel:!1,key:void 0},o=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?c.key=E?L.C0.ESC+"OA":L.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?c.key=E?L.C0.ESC+"OD":L.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?c.key=E?L.C0.ESC+"OC":L.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(c.key=E?L.C0.ESC+"OB":L.C0.ESC+"[B");break;case 8:if(p.shiftKey){c.key=L.C0.BS;break}if(p.altKey){c.key=L.C0.ESC+L.C0.DEL;break}c.key=L.C0.DEL;break;case 9:if(p.shiftKey){c.key=L.C0.ESC+"[Z";break}c.key=L.C0.HT,c.cancel=!0;break;case 13:c.key=p.altKey?L.C0.ESC+L.C0.CR:L.C0.CR,c.cancel=!0;break;case 27:c.key=L.C0.ESC,p.altKey&&(c.key=L.C0.ESC+L.C0.ESC),c.cancel=!0;break;case 37:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"D",c.key===L.C0.ESC+"[1;3D"&&(c.key=L.C0.ESC+(b?"b":"[1;5D"))):c.key=E?L.C0.ESC+"OD":L.C0.ESC+"[D";break;case 39:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"C",c.key===L.C0.ESC+"[1;3C"&&(c.key=L.C0.ESC+(b?"f":"[1;5C"))):c.key=E?L.C0.ESC+"OC":L.C0.ESC+"[C";break;case 38:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"A",b||c.key!==L.C0.ESC+"[1;3A"||(c.key=L.C0.ESC+"[1;5A")):c.key=E?L.C0.ESC+"OA":L.C0.ESC+"[A";break;case 40:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"B",b||c.key!==L.C0.ESC+"[1;3B"||(c.key=L.C0.ESC+"[1;5B")):c.key=E?L.C0.ESC+"OB":L.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(c.key=L.C0.ESC+"[2~");break;case 46:c.key=o?L.C0.ESC+"[3;"+(o+1)+"~":L.C0.ESC+"[3~";break;case 36:c.key=o?L.C0.ESC+"[1;"+(o+1)+"H":E?L.C0.ESC+"OH":L.C0.ESC+"[H";break;case 35:c.key=o?L.C0.ESC+"[1;"+(o+1)+"F":E?L.C0.ESC+"OF":L.C0.ESC+"[F";break;case 33:p.shiftKey?c.type=2:c.key=L.C0.ESC+"[5~";break;case 34:p.shiftKey?c.type=3:c.key=L.C0.ESC+"[6~";break;case 112:c.key=o?L.C0.ESC+"[1;"+(o+1)+"P":L.C0.ESC+"OP";break;case 113:c.key=o?L.C0.ESC+"[1;"+(o+1)+"Q":L.C0.ESC+"OQ";break;case 114:c.key=o?L.C0.ESC+"[1;"+(o+1)+"R":L.C0.ESC+"OR";break;case 115:c.key=o?L.C0.ESC+"[1;"+(o+1)+"S":L.C0.ESC+"OS";break;case 116:c.key=o?L.C0.ESC+"[15;"+(o+1)+"~":L.C0.ESC+"[15~";break;case 117:c.key=o?L.C0.ESC+"[17;"+(o+1)+"~":L.C0.ESC+"[17~";break;case 118:c.key=o?L.C0.ESC+"[18;"+(o+1)+"~":L.C0.ESC+"[18~";break;case 119:c.key=o?L.C0.ESC+"[19;"+(o+1)+"~":L.C0.ESC+"[19~";break;case 120:c.key=o?L.C0.ESC+"[20;"+(o+1)+"~":L.C0.ESC+"[20~";break;case 121:c.key=o?L.C0.ESC+"[21;"+(o+1)+"~":L.C0.ESC+"[21~";break;case 122:c.key=o?L.C0.ESC+"[23;"+(o+1)+"~":L.C0.ESC+"[23~";break;case 123:c.key=o?L.C0.ESC+"[24;"+(o+1)+"~":L.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(b&&!i||!p.altKey||p.metaKey)b&&!p.altKey&&!p.ctrlKey&&p.metaKey?p.keyCode===65&&(c.type=1):p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?c.key=p.key:p.key&&p.ctrlKey&&p.key==="_"&&(c.key=L.C0.US);else{var h=M[p.keyCode],n=h&&h[p.shiftKey?1:0];if(n)c.key=L.C0.ESC+n;else if(p.keyCode>=65&&p.keyCode<=90){var a=p.ctrlKey?p.keyCode-64:p.keyCode+32;c.key=L.C0.ESC+String.fromCharCode(a)}}else p.keyCode>=65&&p.keyCode<=90?c.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?c.key=L.C0.NUL:p.keyCode>=51&&p.keyCode<=55?c.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?c.key=L.C0.DEL:p.keyCode===219?c.key=L.C0.ESC:p.keyCode===220?c.key=L.C0.FS:p.keyCode===221&&(c.key=L.C0.GS)}return c}},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(r,s){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var d in f)f.hasOwnProperty(d)&&(u[d]=f[d])})(r,s)},function(r,s){function u(){this.constructor=r}L(r,s),r.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}),p=this&&this.__decorate||function(r,s,u,f){var d,v=arguments.length,m=v<3?s:f===null?f=Object.getOwnPropertyDescriptor(s,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,s,u,f);else for(var S=r.length-1;S>=0;S--)(d=r[S])&&(m=(v<3?d(m):v>3?d(s,u,m):d(s,u))||m);return v>3&&m&&Object.defineProperty(s,u,m),m},E=this&&this.__param||function(r,s){return function(u,f){s(u,f,r)}};Object.defineProperty(R,"__esModule",{value:!0}),R.RenderService=void 0;var b=I(31),i=I(0),c=I(2),o=I(32),h=I(7),n=I(1),a=I(5),t=function(r){function s(u,f,d,v,m,S){var C=r.call(this)||this;if(C._renderer=u,C._rowCount=f,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 i.EventEmitter,C._onRender=new i.EventEmitter,C._onRefreshRequest=new i.EventEmitter,C.register({dispose:function(){return C._renderer.dispose()}}),C._renderDebouncer=new b.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(v.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(h.addDisposableDomListener(window,"resize",function(){return C.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var _=new IntersectionObserver(function(y){return C._onIntersectionChange(y[y.length-1])},{threshold:0});_.observe(d),C.register({dispose:function(){return _.disconnect()}})}return C}return M(s,r),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(u){this._isPaused=u.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},s.prototype.refreshRows=function(u,f,d){d===void 0&&(d=!1),this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(u,f,this._rowCount))},s.prototype._renderRows=function(u,f){this._renderer.renderRows(u,f),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:u,end:f}),this._isNextRenderRedrawOnly=!0},s.prototype.resize=function(u,f){this._rowCount=f,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(){r.prototype.dispose.call(this)},s.prototype.setRenderer=function(u){var f=this;this._renderer.dispose(),this._renderer=u,this._renderer.onRequestRedraw(function(d){return f.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(u){this._renderer.setColors(u),this._fullRefresh()},s.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},s.prototype.onResize=function(u,f){this._renderer.onResize(u,f),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(u,f,d){this._selectionState.start=u,this._selectionState.end=f,this._selectionState.columnSelectMode=d,this._renderer.onSelectionChanged(u,f,d)},s.prototype.onCursorMove=function(){this._renderer.onCursorMove()},s.prototype.clear=function(){this._renderer.clear()},s.prototype.registerCharacterJoiner=function(u){return this._renderer.registerCharacterJoiner(u)},s.prototype.deregisterCharacterJoiner=function(u){return this._renderer.deregisterCharacterJoiner(u)},s=p([E(3,n.IOptionsService),E(4,a.ICharSizeService),E(5,n.IBufferService)],s)}(c.Disposable);R.RenderService=t},function(G,R,I){"use strict";var L=this&&this.__decorate||function(c,o,h,n){var a,t=arguments.length,r=t<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,h):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(c,o,h,n);else for(var s=c.length-1;s>=0;s--)(a=c[s])&&(r=(t<3?a(r):t>3?a(o,h,r):a(o,h))||r);return t>3&&r&&Object.defineProperty(o,h,r),r},M=this&&this.__param||function(c,o){return function(h,n){o(h,n,c)}};Object.defineProperty(R,"__esModule",{value:!0}),R.CharSizeService=void 0;var p=I(1),E=I(0),b=function(){function c(o,h,n){this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new i(o,h,this._optionsService)}return Object.defineProperty(c.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),c.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())},c=L([M(2,p.IOptionsService)],c)}();R.CharSizeService=b;var i=function(){function c(o,h,n){this._document=o,this._parentElement=h,this._optionsService=n,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 c.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},c}()},function(G,R,I){"use strict";var L=this&&this.__decorate||function(i,c,o,h){var n,a=arguments.length,t=a<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,c,o,h);else for(var r=i.length-1;r>=0;r--)(n=i[r])&&(t=(a<3?n(t):a>3?n(c,o,t):n(c,o))||t);return a>3&&t&&Object.defineProperty(c,o,t),t},M=this&&this.__param||function(i,c){return function(o,h){c(o,h,i)}};Object.defineProperty(R,"__esModule",{value:!0}),R.MouseService=void 0;var p=I(5),E=I(30),b=function(){function i(c,o){this._renderService=c,this._charSizeService=o}return i.prototype.getCoords=function(c,o,h,n,a){return E.getCoords(c,o,h,n,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,a)},i.prototype.getRawByteCoords=function(c,o,h,n){var a=this.getCoords(c,o,h,n);return E.getRawByteCoords(a)},i=L([M(0,p.IRenderService),M(1,p.ICharSizeService)],i)}();R.MouseService=b},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(n,a){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}L(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,f=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,a,t,r);else for(var d=n.length-1;d>=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.Linkifier2=void 0;var b=I(1),i=I(0),c=I(2),o=I(7),h=function(n){function a(t){var r=n.call(this)||this;return r._bufferService=t,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new i.EventEmitter),r._onHideLinkUnderline=r.register(new i.EventEmitter),r.register(c.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return M(a,n),Object.defineProperty(a.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),a.prototype.registerLinkProvider=function(t){var r=this;return this._linkProviders.push(t),{dispose:function(){var s=r._linkProviders.indexOf(t);s!==-1&&r._linkProviders.splice(s,1)}}},a.prototype.attachToDom=function(t,r,s){var u=this;this._element=t,this._mouseService=r,this._renderService=s,this.register(o.addDisposableDomListener(this._element,"mouseleave",function(){u._isMouseOut=!0,u._clearCurrentLink()})),this.register(o.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(o.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},a.prototype._onMouseMove=function(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){var r=this._positionFromMouseEvent(t,this._element,this._mouseService);if(r){this._isMouseOut=!1;for(var s=t.composedPath(),u=0;u<s.length;u++){var f=s[u];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._onHover(r),this._lastBufferCell=r)}}},a.prototype._onHover=function(t){if(this._activeLine!==t.y)return this._clearCurrentLink(),void this._askForLink(t,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))},a.prototype._askForLink=function(t,r){var s=this;this._activeProviderReplies&&r||(this._activeProviderReplies=new Map,this._activeLine=t.y);var u=!1;this._linkProviders.forEach(function(f,d){var v;r?((v=s._activeProviderReplies)===null||v===void 0?void 0:v.get(d))&&(u=s._checkLinkProviderResult(d,t,u)):f.provideLinks(t.y,function(m){var S,C;if(!s._isMouseOut){var _=m==null?void 0:m.map(function(y){return{link:y}});(S=s._activeProviderReplies)===null||S===void 0||S.set(d,_),u=s._checkLinkProviderResult(d,t,u),((C=s._activeProviderReplies)===null||C===void 0?void 0:C.size)===s._linkProviders.length&&s._removeIntersectingLinks(t.y,s._activeProviderReplies)}})})},a.prototype._removeIntersectingLinks=function(t,r){for(var s=new Set,u=0;u<r.size;u++){var f=r.get(u);if(f)for(var d=0;d<f.length;d++)for(var v=f[d],m=v.link.range.start.y<t?0:v.link.range.start.x,S=v.link.range.end.y>t?this._bufferService.cols:v.link.range.end.x,C=m;C<=S;C++){if(s.has(C)){f.splice(d--,1);break}s.add(C)}}},a.prototype._checkLinkProviderResult=function(t,r,s){var u,f=this;if(!this._activeProviderReplies)return s;for(var d=this._activeProviderReplies.get(t),v=!1,m=0;m<t;m++)this._activeProviderReplies.has(m)&&!this._activeProviderReplies.get(m)||(v=!0);if(!v&&d){var S=d.find(function(_){return f._linkAtPosition(_.link,r)});S&&(s=!0,this._handleNewLink(S))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(m=0;m<this._activeProviderReplies.size;m++){var C=(u=this._activeProviderReplies.get(m))===null||u===void 0?void 0:u.find(function(_){return f._linkAtPosition(_.link,r)});if(C){s=!0,this._handleNewLink(C);break}}return s},a.prototype._onClick=function(t){if(this._element&&this._mouseService&&this._currentLink){var r=this._positionFromMouseEvent(t,this._element,this._mouseService);r&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(t,this._currentLink.link.text)}},a.prototype._clearCurrentLink=function(t,r){this._element&&this._currentLink&&this._lastMouseEvent&&(!t||!r||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,c.disposeArray(this._linkCacheDisposables))},a.prototype._handleNewLink=function(t){var r=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 u,f;return(f=(u=r._currentLink)===null||u===void 0?void 0:u.state)===null||f===void 0?void 0:f.decorations.pointerCursor},set:function(u){var f,d;((f=r._currentLink)===null||f===void 0?void 0:f.state)&&r._currentLink.state.decorations.pointerCursor!==u&&(r._currentLink.state.decorations.pointerCursor=u,r._currentLink.state.isHovered&&((d=r._element)===null||d===void 0||d.classList.toggle("xterm-cursor-pointer",u)))}},underline:{get:function(){var u,f;return(f=(u=r._currentLink)===null||u===void 0?void 0:u.state)===null||f===void 0?void 0:f.decorations.underline},set:function(u){var f,d,v;((f=r._currentLink)===null||f===void 0?void 0:f.state)&&((v=(d=r._currentLink)===null||d===void 0?void 0:d.state)===null||v===void 0?void 0:v.decorations.underline)!==u&&(r._currentLink.state.decorations.underline=u,r._currentLink.state.isHovered&&r._fireUnderlineEvent(t.link,u))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(u){var f=u.start===0?0:u.start+1+r._bufferService.buffer.ydisp;r._clearCurrentLink(f,u.end+1+r._bufferService.buffer.ydisp)})))}},a.prototype._linkHover=function(t,r,s){var u;((u=this._currentLink)===null||u===void 0?void 0:u.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(s,r.text)},a.prototype._fireUnderlineEvent=function(t,r){var s=t.range,u=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-u-1,s.end.x,s.end.y-u-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)},a.prototype._linkLeave=function(t,r,s){var u;((u=this._currentLink)===null||u===void 0?void 0:u.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(s,r.text)},a.prototype._linkAtPosition=function(t,r){var s=t.range.start.y===t.range.end.y,u=t.range.start.y<r.y,f=t.range.end.y>r.y;return(s&&t.range.start.x<=r.x&&t.range.end.x>=r.x||u&&t.range.end.x>=r.x||f&&t.range.start.x<=r.x||u&&f)&&t.range.start.y<=r.y&&t.range.end.y>=r.y},a.prototype._positionFromMouseEvent=function(t,r,s){var u=s.getCoords(t,r,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}},a.prototype._createLinkUnderlineEvent=function(t,r,s,u,f){return{x1:t,y1:r,x2:s,y2:u,cols:this._bufferService.cols,fg:f}},a=p([E(0,b.IBufferService)],a)}(c.Disposable);R.Linkifier2=h},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.CoreBrowserService=void 0;var L=function(){function M(p){this._textarea=p}return Object.defineProperty(M.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),M}();R.CoreBrowserService=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(m,S){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,_){C.__proto__=_}||function(C,_){for(var y in _)_.hasOwnProperty(y)&&(C[y]=_[y])})(m,S)},function(m,S){function C(){this.constructor=m}L(m,S),m.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)});Object.defineProperty(R,"__esModule",{value:!0}),R.CoreTerminal=void 0;var p=I(2),E=I(1),b=I(66),i=I(67),c=I(68),o=I(74),h=I(75),n=I(0),a=I(76),t=I(77),r=I(78),s=I(80),u=I(81),f=I(19),d=I(82),v=function(m){function S(C){var _=m.call(this)||this;return _._onBinary=new n.EventEmitter,_._onData=new n.EventEmitter,_._onLineFeed=new n.EventEmitter,_._onResize=new n.EventEmitter,_._onScroll=new n.EventEmitter,_._instantiationService=new b.InstantiationService,_.optionsService=new o.OptionsService(C),_._instantiationService.setService(E.IOptionsService,_.optionsService),_._bufferService=_.register(_._instantiationService.createInstance(c.BufferService)),_._instantiationService.setService(E.IBufferService,_._bufferService),_._logService=_._instantiationService.createInstance(i.LogService),_._instantiationService.setService(E.ILogService,_._logService),_._coreService=_.register(_._instantiationService.createInstance(h.CoreService,function(){return _.scrollToBottom()})),_._instantiationService.setService(E.ICoreService,_._coreService),_._coreMouseService=_._instantiationService.createInstance(a.CoreMouseService),_._instantiationService.setService(E.ICoreMouseService,_._coreMouseService),_._dirtyRowService=_._instantiationService.createInstance(t.DirtyRowService),_._instantiationService.setService(E.IDirtyRowService,_._dirtyRowService),_.unicodeService=_._instantiationService.createInstance(r.UnicodeService),_._instantiationService.setService(E.IUnicodeService,_.unicodeService),_._charsetService=_._instantiationService.createInstance(s.CharsetService),_._instantiationService.setService(E.ICharsetService,_._charsetService),_._inputHandler=new f.InputHandler(_._bufferService,_._charsetService,_._coreService,_._dirtyRowService,_._logService,_.optionsService,_._coreMouseService,_.unicodeService),_.register(n.forwardEvent(_._inputHandler.onLineFeed,_._onLineFeed)),_.register(_._inputHandler),_.register(n.forwardEvent(_._bufferService.onResize,_._onResize)),_.register(n.forwardEvent(_._coreService.onData,_._onData)),_.register(n.forwardEvent(_._coreService.onBinary,_._onBinary)),_.register(_.optionsService.onOptionChange(function(y){return _._updateOptions(y)})),_._writeBuffer=new d.WriteBuffer(function(y){return _._inputHandler.parse(y)}),_}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,_){this._writeBuffer.write(C,_)},S.prototype.writeSync=function(C){this._writeBuffer.writeSync(C)},S.prototype.resize=function(C,_){isNaN(C)||isNaN(_)||(C=Math.max(C,c.MINIMUM_COLS),_=Math.max(_,c.MINIMUM_ROWS),this._bufferService.resize(C,_))},S.prototype.scroll=function(C,_){_===void 0&&(_=!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,_),this._cachedBlankLine=y),y.isWrapped=_;var k=T.ybase+T.scrollTop,g=T.ybase+T.scrollBottom;if(T.scrollTop===0){var F=T.lines.isFull;g===T.lines.length-1?F?T.lines.recycle().copyFrom(y):T.lines.push(y.clone()):T.lines.splice(g+1,0,y.clone()),F?this._bufferService.isUserScrolling&&(T.ydisp=Math.max(T.ydisp-1,0)):(T.ybase++,this._bufferService.isUserScrolling||T.ydisp++)}else{var P=g-k+1;T.lines.shiftElements(k+1,P-1,-1),T.lines.set(g,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,_){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&&(_||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 _=C-this._bufferService.buffer.ydisp;_!==0&&this.scrollLines(_)},S.prototype.addEscHandler=function(C,_){return this._inputHandler.addEscHandler(C,_)},S.prototype.addDcsHandler=function(C,_){return this._inputHandler.addDcsHandler(C,_)},S.prototype.addCsiHandler=function(C,_){return this._inputHandler.addCsiHandler(C,_)},S.prototype.addOscHandler=function(C,_){return this._inputHandler.addOscHandler(C,_)},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 _;switch(C){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((_=this._windowsMode)===null||_===void 0||_.dispose(),this._windowsMode=void 0)}},S.prototype._enableWindowsMode=function(){var C=this;if(!this._windowsMode){var _=[];_.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),_.push(this.addCsiHandler({final:"H"},function(){return u.updateWindowsModeWrappedState(C._bufferService),!1})),this._windowsMode={dispose:function(){for(var y=0,T=_;y<T.length;y++)T[y].dispose()}}}},S}(p.Disposable);R.CoreTerminal=v},function(G,R,I){"use strict";var L=this&&this.__spreadArrays||function(){for(var i=0,c=0,o=arguments.length;c<o;c++)i+=arguments[c].length;var h=Array(i),n=0;for(c=0;c<o;c++)for(var a=arguments[c],t=0,r=a.length;t<r;t++,n++)h[n]=a[t];return h};Object.defineProperty(R,"__esModule",{value:!0}),R.InstantiationService=R.ServiceCollection=void 0;var M=I(1),p=I(14),E=function(){function i(){for(var c=[],o=0;o<arguments.length;o++)c[o]=arguments[o];this._entries=new Map;for(var h=0,n=c;h<n.length;h++){var a=n[h],t=a[0],r=a[1];this.set(t,r)}}return i.prototype.set=function(c,o){var h=this._entries.get(c);return this._entries.set(c,o),h},i.prototype.forEach=function(c){this._entries.forEach(function(o,h){return c(h,o)})},i.prototype.has=function(c){return this._entries.has(c)},i.prototype.get=function(c){return this._entries.get(c)},i}();R.ServiceCollection=E;var b=function(){function i(){this._services=new E,this._services.set(M.IInstantiationService,this)}return i.prototype.setService=function(c,o){this._services.set(c,o)},i.prototype.getService=function(c){return this._services.get(c)},i.prototype.createInstance=function(c){for(var o=[],h=1;h<arguments.length;h++)o[h-1]=arguments[h];for(var n=p.getServiceDependencies(c).sort(function(d,v){return d.index-v.index}),a=[],t=0,r=n;t<r.length;t++){var s=r[t],u=this._services.get(s.id);if(!u)throw new Error("[createInstance] "+c.name+" depends on UNKNOWN service "+s.id+".");a.push(u)}var f=n.length>0?n[0].index:o.length;if(o.length!==f)throw new Error("[createInstance] First service dependency of "+c.name+" at position "+(f+1)+" conflicts with "+o.length+" static arguments");return new(c.bind.apply(c,L([void 0],L(o,a))))},i}();R.InstantiationService=b},function(G,R,I){"use strict";var L=this&&this.__decorate||function(o,h,n,a){var t,r=arguments.length,s=r<3?h:a===null?a=Object.getOwnPropertyDescriptor(h,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,h,n,a);else for(var u=o.length-1;u>=0;u--)(t=o[u])&&(s=(r<3?t(s):r>3?t(h,n,s):t(h,n))||s);return r>3&&s&&Object.defineProperty(h,n,s),s},M=this&&this.__param||function(o,h){return function(n,a){h(n,a,o)}},p=this&&this.__spreadArrays||function(){for(var o=0,h=0,n=arguments.length;h<n;h++)o+=arguments[h].length;var a=Array(o),t=0;for(h=0;h<n;h++)for(var r=arguments[h],s=0,u=r.length;s<u;s++,t++)a[t]=r[s];return a};Object.defineProperty(R,"__esModule",{value:!0}),R.LogService=R.LogLevel=void 0;var E,b=I(1);!function(o){o[o.DEBUG=0]="DEBUG",o[o.INFO=1]="INFO",o[o.WARN=2]="WARN",o[o.ERROR=3]="ERROR",o[o.OFF=4]="OFF"}(E=R.LogLevel||(R.LogLevel={}));var i={debug:E.DEBUG,info:E.INFO,warn:E.WARN,error:E.ERROR,off:E.OFF},c=function(){function o(h){var n=this;this._optionsService=h,this._updateLogLevel(),this._optionsService.onOptionChange(function(a){a==="logLevel"&&n._updateLogLevel()})}return o.prototype._updateLogLevel=function(){this._logLevel=i[this._optionsService.options.logLevel]},o.prototype._evalLazyOptionalParams=function(h){for(var n=0;n<h.length;n++)typeof h[n]=="function"&&(h[n]=h[n]())},o.prototype._log=function(h,n,a){this._evalLazyOptionalParams(a),h.call.apply(h,p([console,"xterm.js: "+n],a))},o.prototype.debug=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.DEBUG&&this._log(console.log,h,n)},o.prototype.info=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.INFO&&this._log(console.info,h,n)},o.prototype.warn=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.WARN&&this._log(console.warn,h,n)},o.prototype.error=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.ERROR&&this._log(console.error,h,n)},o=L([M(0,b.IOptionsService)],o)}();R.LogService=c},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(n,a){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}L(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,f=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,a,t,r);else for(var d=n.length-1;d>=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.BufferService=R.MINIMUM_ROWS=R.MINIMUM_COLS=void 0;var b=I(1),i=I(69),c=I(0),o=I(2);R.MINIMUM_COLS=2,R.MINIMUM_ROWS=1;var h=function(n){function a(t){var r=n.call(this)||this;return r._optionsService=t,r.isUserScrolling=!1,r._onResize=new c.EventEmitter,r.cols=Math.max(t.options.cols,R.MINIMUM_COLS),r.rows=Math.max(t.options.rows,R.MINIMUM_ROWS),r.buffers=new i.BufferSet(t,r),r}return M(a,n),Object.defineProperty(a.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),a.prototype.dispose=function(){n.prototype.dispose.call(this),this.buffers.dispose()},a.prototype.resize=function(t,r){this.cols=t,this.rows=r,this.buffers.resize(t,r),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:t,rows:r})},a.prototype.reset=function(){this.buffers.dispose(),this.buffers=new i.BufferSet(this._optionsService,this),this.isUserScrolling=!1},a=p([E(0,b.IOptionsService)],a)}(o.Disposable);R.BufferService=h},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(i,c){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,h){o.__proto__=h}||function(o,h){for(var n in h)h.hasOwnProperty(n)&&(o[n]=h[n])})(i,c)},function(i,c){function o(){this.constructor=i}L(i,c),i.prototype=c===null?Object.create(c):(o.prototype=c.prototype,new o)});Object.defineProperty(R,"__esModule",{value:!0}),R.BufferSet=void 0;var p=I(70),E=I(0),b=function(i){function c(o,h){var n=i.call(this)||this;return n._onBufferActivate=n.register(new E.EventEmitter),n._normal=new p.Buffer(!0,o,h),n._normal.fillViewportRows(),n._alt=new p.Buffer(!1,o,h),n._activeBuffer=n._normal,n.setupTabStops(),n}return M(c,i),Object.defineProperty(c.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),c.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}))},c.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}))},c.prototype.resize=function(o,h){this._normal.resize(o,h),this._alt.resize(o,h)},c.prototype.setupTabStops=function(o){this._normal.setupTabStops(o),this._alt.setupTabStops(o)},c}(I(2).Disposable);R.BufferSet=b},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.BufferStringIterator=R.Buffer=R.MAX_BUFFER_SIZE=void 0;var L=I(71),M=I(16),p=I(4),E=I(3),b=I(72),i=I(73),c=I(20),o=I(6);R.MAX_BUFFER_SIZE=4294967295;var h=function(){function a(t,r,s){this._hasScrollback=t,this._optionsService=r,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=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=p.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=p.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 L.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return a.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},a.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},a.prototype.getBlankLine=function(t,r){return new M.BufferLine(this._bufferService.cols,this.getNullCell(t),r)},Object.defineProperty(a.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows},enumerable:!1,configurable:!0}),a.prototype._getCorrectBufferLength=function(t){if(!this._hasScrollback)return t;var r=t+this._optionsService.options.scrollback;return r>R.MAX_BUFFER_SIZE?R.MAX_BUFFER_SIZE:r},a.prototype.fillViewportRows=function(t){if(this.lines.length===0){t===void 0&&(t=M.DEFAULT_ATTR_DATA);for(var r=this._rows;r--;)this.lines.push(this.getBlankLine(t))}},a.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new L.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},a.prototype.resize=function(t,r){var s=this.getNullCell(M.DEFAULT_ATTR_DATA),u=this._getCorrectBufferLength(r);if(u>this.lines.maxLength&&(this.lines.maxLength=u),this.lines.length>0){if(this._cols<t)for(var f=0;f<this.lines.length;f++)this.lines.get(f).resize(t,s);var d=0;if(this._rows<r)for(var v=this._rows;v<r;v++)this.lines.length<r+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new M.BufferLine(t,s)):this.ybase>0&&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(v=this._rows;v>r;v--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(u<this.lines.maxLength){var m=this.lines.length-u;m>0&&(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=u}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,r-1),d&&(this.y+=d),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(t,r),this._cols>t))for(f=0;f<this.lines.length;f++)this.lines.get(f).resize(t,s);this._cols=t,this._rows=r},Object.defineProperty(a.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),a.prototype._reflow=function(t,r){this._cols!==t&&(t>this._cols?this._reflowLarger(t,r):this._reflowSmaller(t,r))},a.prototype._reflowLarger=function(t,r){var s=b.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(M.DEFAULT_ATTR_DATA));if(s.length>0){var u=b.reflowLargerCreateNewLayout(this.lines,s);b.reflowLargerApplyNewLayout(this.lines,u.layout),this._reflowLargerAdjustViewport(t,r,u.countRemoved)}},a.prototype._reflowLargerAdjustViewport=function(t,r,s){for(var u=this.getNullCell(M.DEFAULT_ATTR_DATA),f=s;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new M.BufferLine(t,u))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)},a.prototype._reflowSmaller=function(t,r){for(var s=this.getNullCell(M.DEFAULT_ATTR_DATA),u=[],f=0,d=this.lines.length-1;d>=0;d--){var v=this.lines.get(d);if(!(!v||!v.isWrapped&&v.getTrimmedLength()<=t)){for(var m=[v];v.isWrapped&&d>0;)v=this.lines.get(--d),m.unshift(v);var S=this.ybase+this.y;if(!(S>=d&&S<d+m.length)){var C=m[m.length-1].getTrimmedLength(),_=b.reflowSmallerGetNewLineLengths(m,this._cols,t),y=_.length-m.length,T=void 0;T=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+y):Math.max(0,this.lines.length-this.lines.maxLength+y);for(var k=[],g=0;g<y;g++){var F=this.getBlankLine(M.DEFAULT_ATTR_DATA,!0);k.push(F)}k.length>0&&(u.push({start:d+m.length+f,newLines:k}),f+=k.length),m.push.apply(m,k);var P=_.length-1,N=_[P];N===0&&(N=_[--P]);for(var W=m.length-y-1,j=C;W>=0;){var A=Math.min(j,N);if(m[P].copyCellsFrom(m[W],j-A,N-A,A,!0),(N-=A)===0&&(N=_[--P]),(j-=A)===0){W--;var K=Math.max(W,0);j=b.getWrappedLineTrimmedLength(m,K,this._cols)}}for(g=0;g<m.length;g++)_[g]<t&&m[g].setCell(_[g],s);for(var U=y-T;U-- >0;)this.ybase===0?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+r-1)}}}if(u.length>0){var O=[],z=[];for(g=0;g<this.lines.length;g++)z.push(this.lines.get(g));var te=this.lines.length,de=te-1,be=0,je=u[be];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);var Ne=0;for(g=Math.min(this.lines.maxLength-1,te+f-1);g>=0;g--)if(je&&je.start>de+Ne){for(var Oe=je.newLines.length-1;Oe>=0;Oe--)this.lines.set(g--,je.newLines[Oe]);g++,O.push({index:de+1,amount:je.newLines.length}),Ne+=je.newLines.length,je=u[++be]}else this.lines.set(g,z[de--]);var Ke=0;for(g=O.length-1;g>=0;g--)O[g].index+=Ke,this.lines.onInsertEmitter.fire(O[g]),Ke+=O[g].amount;var We=Math.max(0,te+f-this.lines.maxLength);We>0&&this.lines.onTrimEmitter.fire(We)}},a.prototype.stringIndexToBufferIndex=function(t,r,s){for(s===void 0&&(s=!1);r;){var u=this.lines.get(t);if(!u)return[-1,-1];for(var f=s?u.getTrimmedLength():u.length,d=0;d<f;++d)if(u.get(d)[E.CHAR_DATA_WIDTH_INDEX]&&(r-=u.get(d)[E.CHAR_DATA_CHAR_INDEX].length||1),r<0)return[t,d];t++}return[t,0]},a.prototype.translateBufferLineToString=function(t,r,s,u){s===void 0&&(s=0);var f=this.lines.get(t);return f?f.translateToString(r,s,u):""},a.prototype.getWrappedRangeForLine=function(t){for(var r=t,s=t;r>0&&this.lines.get(r).isWrapped;)r--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:r,last:s}},a.prototype.setupTabStops=function(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.options.tabStopWidth)this.tabs[t]=!0},a.prototype.prevStop=function(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t},a.prototype.nextStop=function(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t},a.prototype.addMarker=function(t){var r=this,s=new i.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim(function(u){s.line-=u,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(function(u){s.line>=u.index&&(s.line+=u.amount)})),s.register(this.lines.onDelete(function(u){s.line>=u.index&&s.line<u.index+u.amount&&s.dispose(),s.line>u.index&&(s.line-=u.amount)})),s.register(s.onDispose(function(){return r._removeMarker(s)})),s},a.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},a.prototype.iterator=function(t,r,s,u,f){return new n(this,t,r,s,u,f)},a}();R.Buffer=h;var n=function(){function a(t,r,s,u,f,d){s===void 0&&(s=0),u===void 0&&(u=t.lines.length),f===void 0&&(f=0),d===void 0&&(d=0),this._buffer=t,this._trimRight=r,this._startIndex=s,this._endIndex=u,this._startOverscan=f,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 a.prototype.hasNext=function(){return this._current<this._endIndex},a.prototype.next=function(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._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 r="",s=t.first;s<=t.last;++s)r+=this._buffer.translateBufferLineToString(s,this._trimRight);return this._current=t.last+1,{range:t,content:r}},a}();R.BufferStringIterator=n},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.CircularList=void 0;var L=I(0),M=function(){function p(E){this._maxLength=E,this.onDeleteEmitter=new L.EventEmitter,this.onInsertEmitter=new L.EventEmitter,this.onTrimEmitter=new L.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(p.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var b=new Array(E),i=0;i<Math.min(E,this.length);i++)b[i]=this._array[this._getCyclicIndex(i)];this._array=b,this._maxLength=E,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"length",{get:function(){return this._length},set:function(E){if(E>this._length)for(var b=this._length;b<E;b++)this._array[b]=void 0;this._length=E},enumerable:!1,configurable:!0}),p.prototype.get=function(E){return this._array[this._getCyclicIndex(E)]},p.prototype.set=function(E,b){this._array[this._getCyclicIndex(E)]=b},p.prototype.push=function(E){this._array[this._getCyclicIndex(this._length)]=E,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},p.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(p.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),p.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},p.prototype.splice=function(E,b){for(var i=[],c=2;c<arguments.length;c++)i[c-2]=arguments[c];if(b){for(var o=E;o<this._length-b;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+b)];this._length-=b}for(o=this._length-1;o>=E;o--)this._array[this._getCyclicIndex(o+i.length)]=this._array[this._getCyclicIndex(o)];for(o=0;o<i.length;o++)this._array[this._getCyclicIndex(E+o)]=i[o];if(this._length+i.length>this._maxLength){var h=this._length+i.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=i.length},p.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},p.prototype.shiftElements=function(E,b,i){if(!(b<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(var c=b-1;c>=0;c--)this.set(E+c+i,this.get(E+c));var o=E+b+i-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(c=0;c<b;c++)this.set(E+c+i,this.get(E+c))}},p.prototype._getCyclicIndex=function(E){return(this._startIndex+E)%this._maxLength},p}();R.CircularList=M},function(G,R,I){"use strict";function L(M,p,E){if(p===M.length-1)return M[p].getTrimmedLength();var b=!M[p].hasContent(E-1)&&M[p].getWidth(E-1)===1,i=M[p+1].getWidth(0)===2;return b&&i?E-1:E}Object.defineProperty(R,"__esModule",{value:!0}),R.getWrappedLineTrimmedLength=R.reflowSmallerGetNewLineLengths=R.reflowLargerApplyNewLayout=R.reflowLargerCreateNewLayout=R.reflowLargerGetLinesToRemove=void 0,R.reflowLargerGetLinesToRemove=function(M,p,E,b,i){for(var c=[],o=0;o<M.length-1;o++){var h=o,n=M.get(++h);if(n.isWrapped){for(var a=[M.get(o)];h<M.length&&n.isWrapped;)a.push(n),n=M.get(++h);if(b>=o&&b<h)o+=a.length-1;else{for(var t=0,r=L(a,t,p),s=1,u=0;s<a.length;){var f=L(a,s,p),d=f-u,v=E-r,m=Math.min(d,v);a[t].copyCellsFrom(a[s],u,r,m,!1),(r+=m)===E&&(t++,r=0),(u+=m)===f&&(s++,u=0),r===0&&t!==0&&a[t-1].getWidth(E-1)===2&&(a[t].copyCellsFrom(a[t-1],E-1,r++,1,!1),a[t-1].setCell(E-1,i))}a[t].replaceCells(r,E,i);for(var S=0,C=a.length-1;C>0&&(C>t||a[C].getTrimmedLength()===0);C--)S++;S>0&&(c.push(o+a.length-S),c.push(S)),o+=a.length-1}}}return c},R.reflowLargerCreateNewLayout=function(M,p){for(var E=[],b=0,i=p[b],c=0,o=0;o<M.length;o++)if(i===o){var h=p[++b];M.onDeleteEmitter.fire({index:o-c,amount:h}),o+=h-1,c+=h,i=p[++b]}else E.push(o);return{layout:E,countRemoved:c}},R.reflowLargerApplyNewLayout=function(M,p){for(var E=[],b=0;b<p.length;b++)E.push(M.get(p[b]));for(b=0;b<E.length;b++)M.set(b,E[b]);M.length=p.length},R.reflowSmallerGetNewLineLengths=function(M,p,E){for(var b=[],i=M.map(function(r,s){return L(M,s,p)}).reduce(function(r,s){return r+s}),c=0,o=0,h=0;h<i;){if(i-h<E){b.push(i-h);break}c+=E;var n=L(M,o,p);c>n&&(c-=n,o++);var a=M[o].getWidth(c-1)===2;a&&c--;var t=a?E-1:E;b.push(t),h+=t}return b},R.getWrappedLineTrimmedLength=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(b,i){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var h in o)o.hasOwnProperty(h)&&(c[h]=o[h])})(b,i)},function(b,i){function c(){this.constructor=b}L(b,i),b.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)});Object.defineProperty(R,"__esModule",{value:!0}),R.Marker=void 0;var p=I(0),E=function(b){function i(c){var o=b.call(this)||this;return o.line=c,o._id=i._nextId++,o.isDisposed=!1,o._onDispose=new p.EventEmitter,o}return M(i,b),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),i.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},i._nextId=1,i}(I(2).Disposable);R.Marker=E},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.OptionsService=R.DEFAULT_OPTIONS=R.DEFAULT_BELL_SOUND=void 0;var L=I(0),M=I(11),p=I(33);R.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",R.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:R.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"],b=function(){function i(c){this._onOptionChange=new L.EventEmitter,this.options=p.clone(R.DEFAULT_OPTIONS);for(var o=0,h=Object.keys(c);o<h.length;o++){var n=h[o];if(n in this.options){var a=c[n];this.options[n]=a}}}return Object.defineProperty(i.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),i.prototype.setOption=function(c,o){if(!(c in R.DEFAULT_OPTIONS))throw new Error('No option with key "'+c+'"');if(E.indexOf(c)!==-1)throw new Error('Option "'+c+'" can only be set in the constructor');this.options[c]!==o&&(o=this._sanitizeAndValidateOption(c,o),this.options[c]!==o&&(this.options[c]=o,this._onOptionChange.fire(c)))},i.prototype._sanitizeAndValidateOption=function(c,o){switch(c){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":o||(o=R.DEFAULT_OPTIONS[c]);break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(c+" cannot be less than 1, value: "+o);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(c+" cannot be less than 0, value: "+o);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(c+" cannot be less than or equal to 0, value: "+o)}return o},i.prototype.getOption=function(c){if(!(c in R.DEFAULT_OPTIONS))throw new Error('No option with key "'+c+'"');return this.options[c]},i}();R.OptionsService=b},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(t,r){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var f in u)u.hasOwnProperty(f)&&(s[f]=u[f])})(t,r)},function(t,r){function s(){this.constructor=t}L(t,r),t.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}),p=this&&this.__decorate||function(t,r,s,u){var f,d=arguments.length,v=d<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(t,r,s,u);else for(var m=t.length-1;m>=0;m--)(f=t[m])&&(v=(d<3?f(v):d>3?f(r,s,v):f(r,s))||v);return d>3&&v&&Object.defineProperty(r,s,v),v},E=this&&this.__param||function(t,r){return function(s,u){r(s,u,t)}};Object.defineProperty(R,"__esModule",{value:!0}),R.CoreService=void 0;var b=I(1),i=I(0),c=I(33),o=I(2),h=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),a=function(t){function r(s,u,f,d){var v=t.call(this)||this;return v._bufferService=u,v._logService=f,v._optionsService=d,v.isCursorInitialized=!1,v.isCursorHidden=!1,v._onData=v.register(new i.EventEmitter),v._onUserInput=v.register(new i.EventEmitter),v._onBinary=v.register(new i.EventEmitter),v._scrollToBottom=s,v.register({dispose:function(){return v._scrollToBottom=void 0}}),v.modes=c.clone(h),v.decPrivateModes=c.clone(n),v}return M(r,t),Object.defineProperty(r.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.modes=c.clone(h),this.decPrivateModes=c.clone(n)},r.prototype.triggerDataEvent=function(s,u){if(u===void 0&&(u=!1),!this._optionsService.options.disableStdin){var f=this._bufferService.buffer;f.ybase!==f.ydisp&&this._scrollToBottom(),u&&this._onUserInput.fire(),this._logService.debug('sending data "'+s+'"',function(){return s.split("").map(function(d){return d.charCodeAt(0)})}),this._onData.fire(s)}},r.prototype.triggerBinaryEvent=function(s){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+s+'"',function(){return s.split("").map(function(u){return u.charCodeAt(0)})}),this._onBinary.fire(s))},r=p([E(1,b.IBufferService),E(2,b.ILogService),E(3,b.IOptionsService)],r)}(o.Disposable);R.CoreService=a},function(G,R,I){"use strict";var L=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,f=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,a,t,r);else for(var d=n.length-1;d>=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},M=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.CoreMouseService=void 0;var p=I(1),E=I(0),b={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(n){return n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)}},VT200:{events:19,restrict:function(n){return n.action!==32}},DRAG:{events:23,restrict:function(n){return n.action!==32||n.button!==3}},ANY:{events:31,restrict:function(n){return!0}}};function i(n,a){var t=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(t|=64,t|=n.action):(t|=3&n.button,4&n.button&&(t|=64),8&n.button&&(t|=128),n.action===32?t|=32:n.action!==0||a||(t|=3)),t}var c=String.fromCharCode,o={DEFAULT:function(n){var a=[i(n,!1)+32,n.col+32,n.row+32];return a[0]>255||a[1]>255||a[2]>255?"":""+c(a[0])+c(a[1])+c(a[2])},SGR:function(n){var a=n.action===0&&n.button!==4?"m":"M";return"[<"+i(n,!0)+";"+n.col+";"+n.row+a}},h=function(){function n(a,t){this._bufferService=a,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var r=0,s=Object.keys(b);r<s.length;r++){var u=s[r];this.addProtocol(u,b[u])}for(var f=0,d=Object.keys(o);f<d.length;f++){var v=d[f];this.addEncoding(v,o[v])}this.reset()}return n.prototype.addProtocol=function(a,t){this._protocols[a]=t},n.prototype.addEncoding=function(a,t){this._encodings[a]=t},Object.defineProperty(n.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(a){if(!this._protocols[a])throw new Error('unknown protocol "'+a+'"');this._activeProtocol=a,this._onProtocolChange.fire(this._protocols[a].events)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(a){if(!this._encodings[a])throw new Error('unknown encoding "'+a+'"');this._activeEncoding=a},enumerable:!1,configurable:!0}),n.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(n.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),n.prototype.triggerMouseEvent=function(a){if(a.col<0||a.col>=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows)return!1;if(a.button===4&&a.action===32)return!1;if(a.button===3&&a.action!==32)return!1;if(a.button!==4&&(a.action===2||a.action===3))return!1;if(a.col++,a.row++,a.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,a))return!1;if(!this._protocols[this._activeProtocol].restrict(a))return!1;var t=this._encodings[this._activeEncoding](a);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=a,!0},n.prototype.explainEvents=function(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}},n.prototype._compareEvents=function(a,t){return a.col===t.col&&(a.row===t.row&&(a.button===t.button&&(a.action===t.action&&(a.ctrl===t.ctrl&&a.alt===t.alt))))&&a.shift===t.shift},n=L([M(0,p.IBufferService),M(1,p.ICoreService)],n)}();R.CoreMouseService=h},function(G,R,I){"use strict";var L=this&&this.__decorate||function(b,i,c,o){var h,n=arguments.length,a=n<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(b,i,c,o);else for(var t=b.length-1;t>=0;t--)(h=b[t])&&(a=(n<3?h(a):n>3?h(i,c,a):h(i,c))||a);return n>3&&a&&Object.defineProperty(i,c,a),a},M=this&&this.__param||function(b,i){return function(c,o){i(c,o,b)}};Object.defineProperty(R,"__esModule",{value:!0}),R.DirtyRowService=void 0;var p=I(1),E=function(){function b(i){this._bufferService=i,this.clearRange()}return Object.defineProperty(b.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),b.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},b.prototype.markDirty=function(i){i<this._start?this._start=i:i>this._end&&(this._end=i)},b.prototype.markRangeDirty=function(i,c){if(i>c){var o=i;i=c,c=o}i<this._start&&(this._start=i),c>this._end&&(this._end=c)},b.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},b=L([M(0,p.IBufferService)],b)}();R.DirtyRowService=E},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.UnicodeService=void 0;var L=I(0),M=I(79),p=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new L.EventEmitter;var b=new M.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}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(b){if(!this._providers[b])throw new Error('unknown Unicode version "'+b+'"');this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)},enumerable:!1,configurable:!0}),E.prototype.register=function(b){this._providers[b.version]=b},E.prototype.wcwidth=function(b){return this._activeProvider.wcwidth(b)},E.prototype.getStringCellWidth=function(b){for(var i=0,c=b.length,o=0;o<c;++o){var h=b.charCodeAt(o);if(55296<=h&&h<=56319){if(++o>=c)return i+this.wcwidth(h);var n=b.charCodeAt(o);56320<=n&&n<=57343?h=1024*(h-55296)+n-56320+65536:i+=this.wcwidth(n)}i+=this.wcwidth(h)}return i},E}();R.UnicodeService=p},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.UnicodeV6=void 0;var L,M=I(15),p=[[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]],b=function(){function i(){if(this.version="6",!L){L=new Uint8Array(65536),M.fill(L,1),L[0]=0,M.fill(L,0,1,32),M.fill(L,0,127,160),M.fill(L,2,4352,4448),L[9001]=2,L[9002]=2,M.fill(L,2,11904,42192),L[12351]=1,M.fill(L,2,44032,55204),M.fill(L,2,63744,64256),M.fill(L,2,65040,65050),M.fill(L,2,65072,65136),M.fill(L,2,65280,65377),M.fill(L,2,65504,65511);for(var c=0;c<p.length;++c)M.fill(L,0,p[c][0],p[c][1]+1)}}return i.prototype.wcwidth=function(c){return c<32?0:c<127?1:c<65536?L[c]:function(o,h){var n,a=0,t=h.length-1;if(o<h[0][0]||o>h[t][1])return!1;for(;t>=a;)if(o>h[n=a+t>>1][1])a=n+1;else{if(!(o<h[n][0]))return!0;t=n-1}return!1}(c,E)?0:c>=131072&&c<=196605||c>=196608&&c<=262141?2:1},i}();R.UnicodeV6=b},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.CharsetService=void 0;var L=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(p){this.glevel=p,this.charset=this._charsets[p]},M.prototype.setgCharset=function(p,E){this._charsets[p]=E,this.glevel===p&&(this.charset=E)},M}();R.CharsetService=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.updateWindowsModeWrappedState=void 0;var L=I(3);R.updateWindowsModeWrappedState=function(M){var p=M.buffer.lines.get(M.buffer.ybase+M.buffer.y-1),E=p==null?void 0:p.get(M.cols-1),b=M.buffer.lines.get(M.buffer.ybase+M.buffer.y);b&&E&&(b.isWrapped=E[L.CHAR_DATA_CODE_INDEX]!==L.NULL_CELL_CODE&&E[L.CHAR_DATA_CODE_INDEX]!==L.WHITESPACE_CELL_CODE)}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.WriteBuffer=void 0;var L=function(){function M(p){this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return M.prototype.writeSync=function(p){if(this._writeBuffer.length){for(var E=this._bufferOffset;E<this._writeBuffer.length;++E){var b=this._writeBuffer[E],i=this._callbacks[E];this._action(b),i&&i()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(p)},M.prototype.write=function(p,E){var b=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return b._innerWrite()})),this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(E)},M.prototype._innerWrite=function(){for(var p=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var b=this._writeBuffer[this._bufferOffset],i=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(b),this._pendingData-=b.length,i&&i(),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 p._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},M}();R.WriteBuffer=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.AddonManager=void 0;var L=function(){function M(){this._addons=[]}return M.prototype.dispose=function(){for(var p=this._addons.length-1;p>=0;p--)this._addons[p].instance.dispose()},M.prototype.loadAddon=function(p,E){var b=this,i={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(i),E.dispose=function(){return b._wrappedAddonDispose(i)},E.activate(p)},M.prototype._wrappedAddonDispose=function(p){if(!p.isDisposed){for(var E=-1,b=0;b<this._addons.length;b++)if(this._addons[b]===p){E=b;break}if(E===-1)throw new Error("Could not dispose an addon that has not been loaded");p.isDisposed=!0,p.dispose.apply(p.instance),this._addons.splice(E,1)}},M}();R.AddonManager=L}])})},"/cxE":function(it,re,Q){"use strict";Q.d(re,"f",function(){return I}),Q.d(re,"g",function(){return L}),Q.d(re,"h",function(){return M}),Q.d(re,"e",function(){return E}),Q.d(re,"b",function(){return b}),Q.d(re,"c",function(){return i}),Q.d(re,"d",function(){return c}),Q.d(re,"a",function(){return o});class G{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(h){setTimeout(()=>{throw h.stack?new Error(h.message+`
`+h.stack):h},0)}}emit(h){this.listeners.forEach(n=>{n(h)})}onUnexpectedError(h){this.unexpectedErrorHandler(h),this.emit(h)}onUnexpectedExternalError(h){this.unexpectedErrorHandler(h)}}const R=new G;function I(h){E(h)||R.onUnexpectedError(h);return}function L(h){E(h)||R.onUnexpectedExternalError(h);return}function M(h){if(h instanceof Error){let{name:n,message:a}=h;const t=h.stacktrace||h.stack;return{$isError:!0,name:n,message:a,stack:t}}return h}const p="Canceled";function E(h){return h instanceof Error&&h.name===p&&h.message===p}function b(){const h=new Error(p);return h.name=h.message,h}function i(h){return h?new Error(`Illegal argument: ${h}`):new Error("Illegal argument")}function c(h){return h?new Error(`Illegal state: ${h}`):new Error("Illegal state")}class o extends Error{constructor(h){super("NotSupported");h&&(this.message=h)}}},"07cG":function(it,re,Q){it.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){G.defineOption("placeholder","",function(b,i,c){var o=c&&c!=G.Init;if(i&&!o)b.on("blur",M),b.on("change",p),b.on("swapDoc",p),G.on(b.getInputField(),"compositionupdate",b.state.placeholderCompose=function(){L(b)}),p(b);else if(!i&&o){b.off("blur",M),b.off("change",p),b.off("swapDoc",p),G.off(b.getInputField(),"compositionupdate",b.state.placeholderCompose),R(b);var h=b.getWrapperElement();h.className=h.className.replace(" CodeMirror-empty","")}i&&!b.hasFocus()&&M(b)});function R(b){b.state.placeholder&&(b.state.placeholder.parentNode.removeChild(b.state.placeholder),b.state.placeholder=null)}function I(b){R(b);var i=b.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=b.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var c=b.getOption("placeholder");typeof c=="string"&&(c=document.createTextNode(c)),i.appendChild(c),b.display.lineSpace.insertBefore(i,b.display.lineSpace.firstChild)}function L(b){setTimeout(function(){var i=!1,c=b.getInputField();c.nodeName=="TEXTAREA"?i=!c.value:b.lineCount()==1&&(i=!/[^\u200b]/.test(c.querySelector(".CodeMirror-line").textContent)),i?I(b):R(b)},20)}function M(b){E(b)&&I(b)}function p(b){var i=b.getWrapperElement(),c=E(b);i.className=i.className.replace(" CodeMirror-empty","")+(c?" CodeMirror-empty":""),c?I(b):R(b)}function E(b){return b.lineCount()===1&&b.getLine(0)===""}})},"1dTM":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G=Q("GQ8N"),R=T(Q("Lo0S")),I=Q("VSMT"),L=Q("GdRQ"),M=Q("SZEN"),p=Q("vewr"),E=_(Q("YJ9k")),b=_(Q("MZdM")),i=_(Q("ItS6")),c=_(Q("whVF")),o=_(Q("Fv0C")),h=_(Q("LCi9")),n=_(Q("rwxt")),a=_(Q("Mmt2")),t=_(Q("iUHT")),r=_(Q("mHUz")),s=_(Q("P2ho")),u=Q("NBmB");Q("mdZa");var f=_(Q("34/K")),d=_(Q("hXwI")),v=_(Q("SgaC")),m=_(Q("3690")),S=_(Q("8K/p")),C=_(Q("xO64"));function _(ve){return ve&&ve.__esModule?ve:{default:ve}}function y(){if(typeof WeakMap!="function")return null;var ve=new WeakMap;return y=function(){return ve},ve}function T(ve){if(ve&&ve.__esModule)return ve;if(ve===null||k(ve)!=="object"&&typeof ve!="function")return{default:ve};var xe=y();if(xe&&xe.has(ve))return xe.get(ve);var Se={},Le=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ne in ve)if(Object.prototype.hasOwnProperty.call(ve,ne)){var ye=Le?Object.getOwnPropertyDescriptor(ve,ne):null;ye&&(ye.get||ye.set)?Object.defineProperty(Se,ne,ye):Se[ne]=ve[ne]}return Se.default=ve,xe&&xe.set(ve,Se),Se}function k(ve){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(Se){return typeof Se}:k=function(Se){return Se&&typeof Symbol=="function"&&Se.constructor===Symbol&&Se!==Symbol.prototype?"symbol":typeof Se},k(ve)}function g(ve,xe){if(!(ve instanceof xe))throw new TypeError("Cannot call a class as a function")}function F(ve,xe){for(var Se=0;Se<xe.length;Se++){var Le=xe[Se];Le.enumerable=Le.enumerable||!1,Le.configurable=!0,"value"in Le&&(Le.writable=!0),Object.defineProperty(ve,Le.key,Le)}}function P(ve,xe,Se){return xe&&F(ve.prototype,xe),Se&&F(ve,Se),ve}function N(ve,xe){if(typeof xe!="function"&&xe!==null)throw new TypeError("Super expression must either be null or a function");ve.prototype=Object.create(xe&&xe.prototype,{constructor:{value:ve,writable:!0,configurable:!0}}),xe&&W(ve,xe)}function W(ve,xe){return W=Object.setPrototypeOf||function(Le,ne){return Le.__proto__=ne,Le},W(ve,xe)}function j(ve){var xe=U();return function(){var Le=O(ve),ne;if(xe){var ye=O(this).constructor;ne=Reflect.construct(Le,arguments,ye)}else ne=Le.apply(this,arguments);return A(this,ne)}}function A(ve,xe){return xe&&(k(xe)==="object"||typeof xe=="function")?xe:K(ve)}function K(ve){if(ve===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ve}function U(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(ve){return!1}}function O(ve){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(Se){return Se.__proto__||Object.getPrototypeOf(Se)},O(ve)}var z=3,te="rgb(40, 40, 40)",de=17,be=50,je=19,Ne=75,Oe=50,Ke=1e3,We=50,Te=1,we=1<<1,ue=1<<2,Ae=1<<3,ge=1<<4,Ve=1<<24,Qe=1<<25,ze=1<<26,qe=1<<27,Je=1<<28,pe=function(ve){N(Se,ve);var xe=j(Se);function Se(Le,ne,ye){var se;if(g(this,Se),!Le)throw new Error("Must specify target");if(!ne)throw new Error("Must specify URL");se=xe.call(this),se._target=Le,se._url=ne,ye=ye||{},se._rfbCredentials=ye.credentials||{},se._shared="shared"in ye?!!ye.shared:!0,se._repeaterID=ye.repeaterID||"",se._wsProtocols=ye.wsProtocols||[],se._rfbConnectionState="",se._rfbInitState="",se._rfbAuthScheme=-1,se._rfbCleanDisconnect=!0,se._rfbVersion=0,se._rfbMaxVersion=3.8,se._rfbTightVNC=!1,se._rfbVeNCryptState=0,se._rfbXvpVer=0,se._fbWidth=0,se._fbHeight=0,se._fbName="",se._capabilities={power:!1},se._supportsFence=!1,se._supportsContinuousUpdates=!1,se._enabledContinuousUpdates=!1,se._supportsSetDesktopSize=!1,se._screenID=0,se._screenFlags=0,se._qemuExtKeyEventSupported=!1,se._clipboardText=null,se._clipboardServerCapabilitiesActions={},se._clipboardServerCapabilitiesFormats={},se._sock=null,se._display=null,se._flushing=!1,se._keyboard=null,se._gestures=null,se._disconnTimer=null,se._resizeTimeout=null,se._mouseMoveTimer=null,se._decoders={},se._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},se._mousePos={},se._mouseButtonMask=0,se._mouseLastMoveTime=0,se._viewportDragging=!1,se._viewportDragPos={},se._viewportHasMoved=!1,se._accumulatedWheelDeltaX=0,se._accumulatedWheelDeltaY=0,se._gestureLastTapTime=null,se._gestureFirstDoubleTapEv=null,se._gestureLastMagnitudeX=0,se._gestureLastMagnitudeY=0,se._eventHandlers={focusCanvas:se._focusCanvas.bind(K(se)),windowResize:se._windowResize.bind(K(se)),handleMouse:se._handleMouse.bind(K(se)),handleWheel:se._handleWheel.bind(K(se)),handleGesture:se._handleGesture.bind(K(se))},R.Debug(">> RFB.constructor"),se._screen=document.createElement("div"),se._screen.style.display="flex",se._screen.style.width="100%",se._screen.style.height="100%",se._screen.style.overflow="auto",se._screen.style.background=te,se._canvas=document.createElement("canvas"),se._canvas.style.margin="auto",se._canvas.style.outline="none",se._canvas.style.flexShrink="0",se._canvas.width=0,se._canvas.height=0,se._canvas.tabIndex=-1,se._screen.appendChild(se._canvas),se._cursor=new n.default,se._cursorImage=Se.cursors.none,se._decoders[u.encodings.encodingRaw]=new f.default,se._decoders[u.encodings.encodingCopyRect]=new d.default,se._decoders[u.encodings.encodingRRE]=new v.default,se._decoders[u.encodings.encodingHextile]=new m.default,se._decoders[u.encodings.encodingTight]=new S.default,se._decoders[u.encodings.encodingTightPNG]=new C.default;try{se._display=new b.default(se._canvas)}catch(Pe){throw R.Error("Display exception: "+Pe),Pe}return se._display.onflush=se._onFlush.bind(K(se)),se._keyboard=new o.default(se._canvas),se._keyboard.onkeyevent=se._handleKeyEvent.bind(K(se)),se._gestures=new h.default,se._sock=new a.default,se._sock.on("message",function(){se._handleMessage()}),se._sock.on("open",function(){se._rfbConnectionState==="connecting"&&se._rfbInitState===""?(se._rfbInitState="ProtocolVersion",R.Debug("Starting VNC handshake")):se._fail("Unexpected server connection while "+se._rfbConnectionState)}),se._sock.on("close",function(Pe){R.Debug("WebSocket on-close event");var Ze="";Pe.code&&(Ze="(code: "+Pe.code,Pe.reason&&(Ze+=", reason: "+Pe.reason),Ze+=")");switch(se._rfbConnectionState){case"connecting":se._fail("Connection closed "+Ze);break;case"connected":se._updateConnectionState("disconnecting"),se._updateConnectionState("disconnected");break;case"disconnecting":se._updateConnectionState("disconnected");break;case"disconnected":se._fail("Unexpected server disconnect when already disconnected "+Ze);break;default:se._fail("Unexpected server disconnect before connecting "+Ze);break}se._sock.off("close")}),se._sock.on("error",function(Pe){return R.Warn("WebSocket on-error event")}),setTimeout(se._updateConnectionState.bind(K(se),"connecting")),R.Debug("<< RFB.constructor"),se.dragViewport=!1,se.focusOnClick=!0,se._viewOnly=!1,se._clipViewport=!1,se._scaleViewport=!1,se._resizeSession=!1,se._showDotCursor=!1,ye.showDotCursor!==void 0&&(R.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),se._showDotCursor=ye.showDotCursor),se._qualityLevel=6,se._compressionLevel=2,se}return P(Se,[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(ne){this._rfbCredentials=ne,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;R.Info("Sending Ctrl-Alt-Del"),this.sendKey(r.default.XK_Control_L,"ControlLeft",!0),this.sendKey(r.default.XK_Alt_L,"AltLeft",!0),this.sendKey(r.default.XK_Delete,"Delete",!0),this.sendKey(r.default.XK_Delete,"Delete",!1),this.sendKey(r.default.XK_Alt_L,"AltLeft",!1),this.sendKey(r.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(ne,ye,se){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(se===void 0){this.sendKey(ne,ye,!0),this.sendKey(ne,ye,!1);return}var Pe=s.default[ye];if(this._qemuExtKeyEventSupported&&Pe)ne=ne||0,R.Info("Sending key ("+(se?"down":"up")+"): keysym "+ne+", scancode "+Pe),Se.messages.QEMUExtendedKeyEvent(this._sock,ne,se,Pe);else{if(!ne)return;R.Info("Sending keysym ("+(se?"down":"up")+"): "+ne),Se.messages.keyEvent(this._sock,ne,se?1:0)}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(ne){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(this._clipboardServerCapabilitiesFormats[Te]&&this._clipboardServerCapabilitiesActions[qe])this._clipboardText=ne,Se.messages.extendedClipboardNotify(this._sock,[Te]);else{for(var ye=new Uint8Array(ne.length),se=0;se<ne.length;se++)ye[se]=ne.charCodeAt(se);Se.messages.clientCutText(this._sock,ye)}}},{key:"_connect",value:function(){R.Debug(">> RFB.connect"),R.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(ne){ne.name==="SyntaxError"?this._fail("Invalid host or port ("+ne+")"):this._fail("Error when opening socket ("+ne+")")}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),R.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){R.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(ne){if(!(ne.name==="NotFoundError"))throw ne}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),R.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(ne){if(!this.focusOnClick)return;this.focus()}},{key:"_setDesktopName",value:function(ne){this._fbName=ne,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(ne){var ye=this;window.requestAnimationFrame(function(){ye._updateClip(),ye._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var ne=this._display.clipViewport,ye=this._clipViewport;if(this._scaleViewport&&(ye=!1),ne!==ye&&(this._display.clipViewport=ye),ye){var se=this._screenSize();this._display.viewportChangeSize(se.w,se.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(!this._scaleViewport)this._display.scale=1;else{var ne=this._screenSize();this._display.autoscale(ne.w,ne.h)}this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;var ne=this._screenSize();Se.messages.setDesktopSize(this._sock,Math.floor(ne.w),Math.floor(ne.h),this._screenID,this._screenFlags),R.Debug("Requested new desktop size: "+ne.w+"x"+ne.h)}},{key:"_screenSize",value:function(){var ne=this._screen.getBoundingClientRect();return{w:ne.width,h:ne.height}}},{key:"_fixScrollbars",value:function(){var ne=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=ne}},{key:"_updateConnectionState",value:function(ne){var ye=this,se=this._rfbConnectionState;if(ne===se){R.Debug("Already in state '"+ne+"', ignoring");return}if(se==="disconnected"){R.Error("Tried changing state of a disconnected RFB object");return}switch(ne){case"connected":if(se!=="connecting"){R.Error("Bad transition to connected state, previous connection state: "+se);return}break;case"disconnected":if(se!=="disconnecting"){R.Error("Bad transition to disconnected state, previous connection state: "+se);return}break;case"connecting":if(se!==""){R.Error("Bad transition to connecting state, previous connection state: "+se);return}break;case"disconnecting":if(se!=="connected"&&se!=="connecting"){R.Error("Bad transition to disconnecting state, previous connection state: "+se);return}break;default:R.Error("Unknown connection state: "+ne);return}this._rfbConnectionState=ne,R.Debug("New state '"+ne+"', was '"+se+"'."),this._disconnTimer&&ne!=="disconnecting"&&(R.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close"));switch(ne){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(function(){R.Error("Disconnection timed out."),ye._updateConnectionState("disconnected")},z*1e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}},{key:"_fail",value:function(ne){switch(this._rfbConnectionState){case"disconnecting":R.Error("Failed when disconnecting: "+ne);break;case"connected":R.Error("Failed while connected: "+ne);break;case"connecting":R.Error("Failed when connecting: "+ne);break;default:R.Error("RFB failure: "+ne);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(ne,ye){this._capabilities[ne]=ye,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(this._sock.rQlen===0){R.Warn("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":R.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(ne,ye,se){this.sendKey(ne,ye,se)}},{key:"_handleMouse",value:function(ne){if(ne.type==="click"&&ne.target!==this._canvas)return;if(ne.stopPropagation(),ne.preventDefault(),ne.type==="click"||ne.type==="contextmenu")return;var ye=(0,M.clientToElement)(ne.clientX,ne.clientY,this._canvas);switch(ne.type){case"mousedown":(0,p.setCapture)(this._canvas),this._handleMouseButton(ye.x,ye.y,!0,1<<ne.button);break;case"mouseup":this._handleMouseButton(ye.x,ye.y,!1,1<<ne.button);break;case"mousemove":this._handleMouseMove(ye.x,ye.y);break}}},{key:"_handleMouseButton",value:function(ne,ye,se,Pe){if(this.dragViewport)if(se&&!this._viewportDragging){this._viewportDragging=!0,this._viewportDragPos={x:ne,y:ye},this._viewportHasMoved=!1;return}else{if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(ne,ye,Pe)}this._mouseMoveTimer!==null&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(ne,ye,this._mouseButtonMask)),se?this._mouseButtonMask|=Pe:this._mouseButtonMask&=~Pe,this._sendMouse(ne,ye,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function(ne,ye){var se=this;if(this._viewportDragging){var Pe=this._viewportDragPos.x-ne,Ze=this._viewportDragPos.y-ye;(this._viewportHasMoved||Math.abs(Pe)>L.dragThreshold||Math.abs(Ze)>L.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:ne,y:ye},this._display.viewportChangePos(Pe,Ze));return}if(this._mousePos={x:ne,y:ye},this._mouseMoveTimer==null){var et=Date.now()-this._mouseLastMoveTime;et>de?(this._sendMouse(ne,ye,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(function(){se._handleDelayedMouseMove()},de-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(ne,ye,se){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;Se.messages.pointerEvent(this._sock,this._display.absX(ne),this._display.absY(ye),se)}},{key:"_handleWheel",value:function(ne){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;ne.stopPropagation(),ne.preventDefault();var ye=(0,M.clientToElement)(ne.clientX,ne.clientY,this._canvas),se=ne.deltaX,Pe=ne.deltaY;ne.deltaMode!==0&&(se*=je,Pe*=je),this._accumulatedWheelDeltaX+=se,this._accumulatedWheelDeltaY+=Pe,Math.abs(this._accumulatedWheelDeltaX)>=be&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(ye.x,ye.y,!0,1<<5),this._handleMouseButton(ye.x,ye.y,!1,1<<5)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(ye.x,ye.y,!0,1<<6),this._handleMouseButton(ye.x,ye.y,!1,1<<6)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=be&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(ye.x,ye.y,!0,1<<3),this._handleMouseButton(ye.x,ye.y,!1,1<<3)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(ye.x,ye.y,!0,1<<4),this._handleMouseButton(ye.x,ye.y,!1,1<<4)),this._accumulatedWheelDeltaY=0)}},{key:"_fakeMouseMove",value:function(ne,ye,se){this._handleMouseMove(ye,se),this._cursor.move(ne.detail.clientX,ne.detail.clientY)}},{key:"_handleTapEvent",value:function(ne,ye){var se=(0,M.clientToElement)(ne.detail.clientX,ne.detail.clientY,this._canvas);if(this._gestureLastTapTime!==null&&Date.now()-this._gestureLastTapTime<Ke&&this._gestureFirstDoubleTapEv.detail.type===ne.detail.type){var Pe=this._gestureFirstDoubleTapEv.detail.clientX-ne.detail.clientX,Ze=this._gestureFirstDoubleTapEv.detail.clientY-ne.detail.clientY,et=Math.hypot(Pe,Ze);et<We?se=(0,M.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=ne}else this._gestureFirstDoubleTapEv=ne;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,se.x,se.y),this._handleMouseButton(se.x,se.y,!0,ye),this._handleMouseButton(se.x,se.y,!1,ye)}},{key:"_handleGesture",value:function(ne){var ye,se=(0,M.clientToElement)(ne.detail.clientX,ne.detail.clientY,this._canvas);switch(ne.type){case"gesturestart":switch(ne.detail.type){case"onetap":this._handleTapEvent(ne,1);break;case"twotap":this._handleTapEvent(ne,4);break;case"threetap":this._handleTapEvent(ne,2);break;case"drag":this._fakeMouseMove(ne,se.x,se.y),this._handleMouseButton(se.x,se.y,!0,1);break;case"longpress":this._fakeMouseMove(ne,se.x,se.y),this._handleMouseButton(se.x,se.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=ne.detail.magnitudeX,this._gestureLastMagnitudeY=ne.detail.magnitudeY,this._fakeMouseMove(ne,se.x,se.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(ne.detail.magnitudeX,ne.detail.magnitudeY),this._fakeMouseMove(ne,se.x,se.y);break}break;case"gesturemove":switch(ne.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(ne,se.x,se.y);break;case"twodrag":for(this._fakeMouseMove(ne,se.x,se.y);ne.detail.magnitudeY-this._gestureLastMagnitudeY>Oe;)this._handleMouseButton(se.x,se.y,!0,8),this._handleMouseButton(se.x,se.y,!1,8),this._gestureLastMagnitudeY+=Oe;for(;ne.detail.magnitudeY-this._gestureLastMagnitudeY<-Oe;)this._handleMouseButton(se.x,se.y,!0,16),this._handleMouseButton(se.x,se.y,!1,16),this._gestureLastMagnitudeY-=Oe;for(;ne.detail.magnitudeX-this._gestureLastMagnitudeX>Oe;)this._handleMouseButton(se.x,se.y,!0,32),this._handleMouseButton(se.x,se.y,!1,32),this._gestureLastMagnitudeX+=Oe;for(;ne.detail.magnitudeX-this._gestureLastMagnitudeX<-Oe;)this._handleMouseButton(se.x,se.y,!0,64),this._handleMouseButton(se.x,se.y,!1,64),this._gestureLastMagnitudeX-=Oe;break;case"pinch":if(this._fakeMouseMove(ne,se.x,se.y),ye=Math.hypot(ne.detail.magnitudeX,ne.detail.magnitudeY),Math.abs(ye-this._gestureLastMagnitudeX)>Ne){for(this._handleKeyEvent(r.default.XK_Control_L,"ControlLeft",!0);ye-this._gestureLastMagnitudeX>Ne;)this._handleMouseButton(se.x,se.y,!0,8),this._handleMouseButton(se.x,se.y,!1,8),this._gestureLastMagnitudeX+=Ne;for(;ye-this._gestureLastMagnitudeX<-Ne;)this._handleMouseButton(se.x,se.y,!0,16),this._handleMouseButton(se.x,se.y,!1,16),this._gestureLastMagnitudeX-=Ne}this._handleKeyEvent(r.default.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(ne.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(ne,se.x,se.y),this._handleMouseButton(se.x,se.y,!1,1);break;case"longpress":this._fakeMouseMove(ne,se.x,se.y),this._handleMouseButton(se.x,se.y,!1,4);break}break}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var ne=this._sock.rQshiftStr(12).substr(4,7);R.Info("Server ProtocolVersion: "+ne);var ye=0;switch(ne){case"000.000":ye=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 "+ne)}if(ye){for(var se="ID:"+this._repeaterID;se.length<250;)se+="\0";return this._sock.sendString(se),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var Pe="00"+parseInt(this._rfbVersion,10)+".00"+this._rfbVersion*10%10;this._sock.sendString("RFB "+Pe+`
`),R.Debug("Sent ProtocolVersion: "+Pe),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function ne(Pe,Ze){for(var et=0;et<Ze.length;et++)if(Ze[et]===Pe)return!0;return!1}if(this._rfbVersion>=3.7){var ye=this._sock.rQshift8();if(this._sock.rQwait("security type",ye,1))return!1;if(ye===0)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var se=this._sock.rQshiftBytes(ye);if(R.Debug("Server security types: "+se),ne(1,se))this._rfbAuthScheme=1;else if(ne(22,se))this._rfbAuthScheme=22;else if(ne(16,se))this._rfbAuthScheme=16;else if(ne(2,se))this._rfbAuthScheme=2;else if(ne(19,se))this._rfbAuthScheme=19;else return this._fail("Unsupported security types (types: "+se+")");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",R.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var ne=this._sock.rQshift32(),ye="";if(ne>0){if(this._sock.rQwait("reason",ne,4))return!1;ye=this._sock.rQshiftStr(ne)}return ye!==""?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:ye}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+ye+")")):(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 ne=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(ne),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(this._rfbVeNCryptState==0){if(this._sock.rQwait("vencrypt version",2))return!1;var ne=this._sock.rQshift8(),ye=this._sock.rQshift8();if(!(ne==0&&ye==2))return this._fail("Unsupported VeNCrypt version "+ne+"."+ye);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(this._rfbVeNCryptState==1){if(this._sock.rQwait("vencrypt ack",1))return!1;var se=this._sock.rQshift8();if(se!=0)return this._fail("VeNCrypt failure "+se);this._rfbVeNCryptState=2}if(this._rfbVeNCryptState==2){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var Pe=this._sock.rQshift8();if(Pe<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=Pe,this._rfbVeNCryptState=3}if(this._rfbVeNCryptState==3){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var Ze=[],et=0;et<this._rfbVeNCryptSubtypesLength;et++)Ze.push(this._sock.rQshift32());if(Ze.indexOf(256)!=-1)this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4;else return this._fail("VeNCrypt Plain subtype not offered by server")}if(this._rfbVeNCryptState==4){if(!this._rfbCredentials.username||!this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;var Ge=(0,I.encodeUTF8)(this._rfbCredentials.username),ht=(0,I.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,Ge.length]),this._sock.send([0,0,0,ht.length]),this._sock.sendString(Ge),this._sock.sendString(ht),this._rfbInitState="SecurityResult",!0}}},{key:"_negotiateStdVNCAuth",value:function(){if(this._sock.rQwait("auth challenge",16))return!1;if(this._rfbCredentials.password===void 0)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;var ne=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),ye=Se.genDES(this._rfbCredentials.password,ne);return this._sock.send(ye),this._rfbInitState="SecurityResult",!0}},{key:"_negotiateTightUnixAuth",value:function(){return this._rfbCredentials.username===void 0||this._rfbCredentials.password===void 0?(this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1):(this._sock.send([0,0,0,this._rfbCredentials.username.length]),this._sock.send([0,0,0,this._rfbCredentials.password.length]),this._sock.sendString(this._rfbCredentials.username),this._sock.sendString(this._rfbCredentials.password),this._rfbInitState="SecurityResult",!0)}},{key:"_negotiateTightTunnels",value:function(ne){for(var ye={0:{vendor:"TGHT",signature:"NOTUNNEL"}},se={},Pe=0;Pe<ne;Pe++){var Ze=this._sock.rQshift32(),et=this._sock.rQshiftStr(4),Ge=this._sock.rQshiftStr(8);se[Ze]={vendor:et,signature:Ge}}return R.Debug("Server Tight tunnel types: "+se),se[1]&&se[1].vendor==="SICR"&&se[1].signature==="SCHANNEL"&&(R.Debug("Detected Siemens server. Assuming NOTUNNEL support."),se[0]={vendor:"TGHT",signature:"NOTUNNEL"}),se[0]?se[0].vendor!=ye[0].vendor||se[0].signature!=ye[0].signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(R.Debug("Selected tunnel type: "+ye[0]),this._sock.send([0,0,0,0]),!1):this._fail("Server wanted tunnels, but doesn't support the notunnel type")}},{key:"_negotiateTightAuth",value:function(){if(!this._rfbTightVNC){if(this._sock.rQwait("num tunnels",4))return!1;var ne=this._sock.rQshift32();if(ne>0&&this._sock.rQwait("tunnel capabilities",16*ne,4))return!1;if(this._rfbTightVNC=!0,ne>0)return this._negotiateTightTunnels(ne),!1}if(this._sock.rQwait("sub auth count",4))return!1;var ye=this._sock.rQshift32();if(ye===0)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*ye,4))return!1;for(var se={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},Pe=[],Ze=0;Ze<ye;Ze++){this._sock.rQshift32();var et=this._sock.rQshiftStr(12);Pe.push(et)}R.Debug("Server Tight authentication types: "+Pe);for(var Ge in se)if(Pe.indexOf(Ge)!=-1){this._sock.send([0,0,0,se[Ge]]),R.Debug("Selected authentication type: "+Ge);switch(Ge){case"STDVNOAUTH__":return this._rfbInitState="SecurityResult",!0;case"STDVVNCAUTH_":return this._rfbAuthScheme=2,this._initMsg();case"TGHTULGNAUTH":return this._rfbAuthScheme=129,this._initMsg();default:return this._fail("Unsupported tiny auth scheme (scheme: "+Ge+")")}}return this._fail("No supported sub-auth types!")}},{key:"_negotiateAuthentication",value:function(){switch(this._rfbAuthScheme){case 1:return this._rfbVersion>=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 ne=this._sock.rQshift32();return ne===0?(this._rfbInitState="ClientInitialisation",R.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=ne,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:ne}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var ne=this._sock.rQshift16(),ye=this._sock.rQshift16(),se=this._sock.rQshift8(),Pe=this._sock.rQshift8(),Ze=this._sock.rQshift8(),et=this._sock.rQshift8(),Ge=this._sock.rQshift16(),ht=this._sock.rQshift16(),ce=this._sock.rQshift16(),Me=this._sock.rQshift8(),Fe=this._sock.rQshift8(),Ce=this._sock.rQshift8();this._sock.rQskipBytes(3);var _e=this._sock.rQshift32();if(this._sock.rQwait("server init name",_e,24))return!1;var Ee=this._sock.rQshiftStr(_e);if(Ee=(0,I.decodeUTF8)(Ee,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+_e))return!1;var ee=this._sock.rQshift16(),oe=this._sock.rQshift16(),q=this._sock.rQshift16();this._sock.rQskipBytes(2);var me=(ee+oe+q)*16;if(this._sock.rQwait("TightVNC extended server init header",me,32+_e))return!1;this._sock.rQskipBytes(16*ee),this._sock.rQskipBytes(16*oe),this._sock.rQskipBytes(16*q)}return R.Info("Screen: "+ne+"x"+ye+", bpp: "+se+", depth: "+Pe+", bigEndian: "+Ze+", trueColor: "+et+", redMax: "+Ge+", greenMax: "+ht+", blueMax: "+ce+", redShift: "+Me+", greenShift: "+Fe+", blueShift: "+Ce),this._setDesktopName(Ee),this._resize(ne,ye),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,this._fbName==="Intel(r) AMT KVM"&&(R.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),Se.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),Se.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var ne=[];ne.push(u.encodings.encodingCopyRect),this._fbDepth==24&&(ne.push(u.encodings.encodingTight),ne.push(u.encodings.encodingTightPNG),ne.push(u.encodings.encodingHextile),ne.push(u.encodings.encodingRRE)),ne.push(u.encodings.encodingRaw),ne.push(u.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),ne.push(u.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),ne.push(u.encodings.pseudoEncodingDesktopSize),ne.push(u.encodings.pseudoEncodingLastRect),ne.push(u.encodings.pseudoEncodingQEMUExtendedKeyEvent),ne.push(u.encodings.pseudoEncodingExtendedDesktopSize),ne.push(u.encodings.pseudoEncodingXvp),ne.push(u.encodings.pseudoEncodingFence),ne.push(u.encodings.pseudoEncodingContinuousUpdates),ne.push(u.encodings.pseudoEncodingDesktopName),ne.push(u.encodings.pseudoEncodingExtendedClipboard),this._fbDepth==24&&(ne.push(u.encodings.pseudoEncodingVMwareCursor),ne.push(u.encodings.pseudoEncodingCursor)),Se.messages.clientEncodings(this._sock,ne)}},{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 R.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(R.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var ne=this._sock.rQshift32();if(ne=(0,G.toSigned32bit)(ne),this._sock.rQwait("ServerCutText content",Math.abs(ne),8))return!1;if(ne>=0){var ye=this._sock.rQshiftStr(ne);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ye}}))}else{ne=Math.abs(ne);var se=this._sock.rQshift32(),Pe=se&65535,Ze=se&4278190080,et=!!(Ze&Ve);if(et){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var Ge=0;Ge<=15;Ge++){var ht=1<<Ge;Pe&ht&&(this._clipboardServerCapabilitiesFormats[ht]=!0,this._sock.rQshift32())}for(var ce=24;ce<=31;ce++){var Me=1<<ce;this._clipboardServerCapabilitiesActions[Me]=!!(Ze&Me)}var Fe=[Ve,Qe,ze,qe,Je];Se.messages.extendedClipboardCaps(this._sock,Fe,{extendedClipboardFormatText:0})}else if(Ze===Qe){if(this._viewOnly)return!0;this._clipboardText!=null&&this._clipboardServerCapabilitiesActions[Je]&&(Pe&Te&&Se.messages.extendedClipboardProvide(this._sock,[Te],[this._clipboardText]))}else if(Ze===ze){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[qe]&&(this._clipboardText!=null?Se.messages.extendedClipboardNotify(this._sock,[Te]):Se.messages.extendedClipboardNotify(this._sock,[]))}else if(Ze===qe){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[Qe]&&(Pe&Te&&Se.messages.extendedClipboardRequest(this._sock,[Te]))}else if(Ze===Je){if(this._viewOnly)return!0;if(!(Pe&Te))return!0;this._clipboardText=null;var Ce=this._sock.rQshiftBytes(ne-4),_e=new i.default,Ee=null;_e.setInput(Ce);for(var ee=0;ee<=15;ee++){var oe=1<<ee;if(Pe&oe){var q=0,me=_e.inflate(4);q|=me[0]<<24,q|=me[1]<<16,q|=me[2]<<8,q|=me[3];var Ie=_e.inflate(q);oe===Te&&(Ee=Ie)}}if(_e.setInput(null),Ee!==null){for(var V="",Re=0;Re<Ee.length;Re++)V+=String.fromCharCode(Ee[Re]);Ee=V,Ee=(0,I.decodeUTF8)(Ee),Ee.length>0&&Ee.charAt(Ee.length-1)==="\0"&&(Ee=Ee.slice(0,-1)),Ee=Ee.replace(`\r
`,`
`),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:Ee}}))}}else return this._fail("Unexpected action in extended clipboard message: "+Ze)}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var ne=this._sock.rQshift32(),ye=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",ye,9))return!1;ye>64&&(R.Warn("Bad payload length ("+ye+") in fence response"),ye=64);var se=this._sock.rQshiftStr(ye);return this._supportsFence=!0,ne&1<<31?(ne&=1<<0|1<<1,Se.messages.clientFence(this._sock,ne,se),!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 ne=this._sock.rQshift8(),ye=this._sock.rQshift8();switch(ye){case 0:R.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=ne,R.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+ye+")");break}return!0}},{key:"_normalMsg",value:function(){var ne;this._FBU.rects>0?ne=0:ne=this._sock.rQshift8();var ye,se;switch(ne){case 0:return se=this._framebufferUpdate(),se&&!this._enabledContinuousUpdates&&Se.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),se;case 1:return this._handleSetColourMapMsg();case 2:return R.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return ye=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,ye&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),R.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+ne+")"),R.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 ne=this._sock.rQshiftBytes(12);this._FBU.x=(ne[0]<<8)+ne[1],this._FBU.y=(ne[2]<<8)+ne[3],this._FBU.width=(ne[4]<<8)+ne[5],this._FBU.height=(ne[6]<<8)+ne[7],this._FBU.encoding=parseInt((ne[8]<<24)+(ne[9]<<16)+(ne[10]<<8)+ne[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 u.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case u.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case u.encodings.pseudoEncodingCursor:return this._handleCursor();case u.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{var ne=document.createEvent("keyboardEvent");ne.code!==void 0&&(this._qemuExtKeyEventSupported=!0)}catch(ye){}return!0;case u.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case u.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case u.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var ne=this._FBU.x,ye=this._FBU.y,se=this._FBU.width,Pe=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var Ze=this._sock.rQshift8();this._sock.rQshift8();var et,Ge=4;if(Ze==0){var ht=4294967040|0;if(et=new Array(se*Pe*Ge),this._sock.rQwait("VMware cursor classic encoding",se*Pe*Ge*2,2))return!1;for(var ce=new Array(se*Pe),Me=0;Me<se*Pe;Me++)ce[Me]=this._sock.rQshift32();for(var Fe=new Array(se*Pe),Ce=0;Ce<se*Pe;Ce++)Fe[Ce]=this._sock.rQshift32();for(var _e=0;_e<se*Pe;_e++)if(ce[_e]==0){var Ee=Fe[_e],ee=Ee>>8&255,oe=Ee>>16&255,q=Ee>>24&255;et[_e*Ge]=ee,et[_e*Ge+1]=oe,et[_e*Ge+2]=q,et[_e*Ge+3]=255}else(ce[_e]&ht)==ht?Fe[_e]==0?(et[_e*Ge]=0,et[_e*Ge+1]=0,et[_e*Ge+2]=0,et[_e*Ge+3]=0):((Fe[_e]&ht)==ht,et[_e*Ge]=0,et[_e*Ge+1]=0,et[_e*Ge+2]=0,et[_e*Ge+3]=255):(et[_e*Ge]=0,et[_e*Ge+1]=0,et[_e*Ge+2]=0,et[_e*Ge+3]=255)}else if(Ze==1){if(this._sock.rQwait("VMware cursor alpha encoding",se*Pe*4,2))return!1;et=new Array(se*Pe*Ge);for(var me=0;me<se*Pe;me++){var Ie=this._sock.rQshift32();et[me*4]=Ie>>24&255,et[me*4+1]=Ie>>16&255,et[me*4+2]=Ie>>8&255,et[me*4+3]=Ie&255}}else return R.Warn("The given cursor type is not supported: "+Ze+" given."),!1;return this._updateCursor(et,ne,ye,se,Pe),!0}},{key:"_handleCursor",value:function(){var ne=this._FBU.x,ye=this._FBU.y,se=this._FBU.width,Pe=this._FBU.height,Ze=se*Pe*4,et=Math.ceil(se/8)*Pe,Ge=Ze+et;if(this._sock.rQwait("cursor encoding",Ge))return!1;for(var ht=this._sock.rQshiftBytes(Ze),ce=this._sock.rQshiftBytes(et),Me=new Uint8Array(se*Pe*4),Fe=0,Ce=0;Ce<Pe;Ce++)for(var _e=0;_e<se;_e++){var Ee=Ce*Math.ceil(se/8)+Math.floor(_e/8),ee=ce[Ee]<<_e%8&128?255:0;Me[Fe]=ht[Fe+2],Me[Fe+1]=ht[Fe+1],Me[Fe+2]=ht[Fe],Me[Fe+3]=ee,Fe+=4}return this._updateCursor(Me,ne,ye,se,Pe),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var ne=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",ne,4))return!1;var ye=this._sock.rQshiftStr(ne);return ye=(0,I.decodeUTF8)(ye,!0),this._setDesktopName(ye),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var ne=this._sock.rQpeek8(),ye=4+ne*16;if(this._sock.rQwait("ExtendedDesktopSize",ye))return!1;var se=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,se&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var Pe=0;Pe<ne;Pe+=1)Pe===0?(this._screenID=this._sock.rQshiftBytes(4),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._screenFlags=this._sock.rQshiftBytes(4)):this._sock.rQskipBytes(16);if(this._FBU.x===1&&this._FBU.y!==0){var Ze="";switch(this._FBU.y){case 1:Ze="Resize is administratively prohibited";break;case 2:Ze="Out of resources";break;case 3:Ze="Invalid screen layout";break;default:Ze="Unknown reason";break}R.Warn("Server did not accept the resize request: "+Ze)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var ne=this._decoders[this._FBU.encoding];if(!ne)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return ne.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(ye){return this._fail("Error decoding rect: "+ye),!1}}},{key:"_updateContinuousUpdates",value:function(){if(!this._enabledContinuousUpdates)return;Se.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function(ne,ye){this._fbWidth=ne,this._fbHeight=ye,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function(ne,ye){if(this._rfbXvpVer<ne)return;R.Info("Sending XVP operation "+ye+" (version "+ne+")"),Se.messages.xvpOp(this._sock,ne,ye)}},{key:"_updateCursor",value:function(ne,ye,se,Pe,Ze){this._cursorImage={rgbaPixels:ne,hotx:ye,hoty:se,w:Pe,h:Ze},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var ne=3;ne<this._cursorImage.rgbaPixels.length;ne+=4)if(this._cursorImage.rgbaPixels[ne])return!1;return!0}},{key:"_refreshCursor",value:function(){if(this._rfbConnectionState!=="connecting"&&this._rfbConnectionState!=="connected")return;var ne=this._shouldShowDotCursor()?Se.cursors.dot:this._cursorImage;this._cursor.change(ne.rgbaPixels,ne.hotx,ne.hoty,ne.w,ne.h)}},{key:"viewOnly",get:function(){return this._viewOnly},set:function(ne){this._viewOnly=ne,(this._rfbConnectionState==="connecting"||this._rfbConnectionState==="connected")&&(ne?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function(ne){R.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(ne){this._clipViewport=ne,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function(ne){this._scaleViewport=ne,ne&&this._clipViewport&&this._updateClip(),this._updateScale(),!ne&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function(ne){this._resizeSession=ne,ne&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function(ne){this._showDotCursor=ne,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function(ne){this._screen.style.background=ne}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function(ne){if(!Number.isInteger(ne)||ne<0||ne>9){R.Error("qualityLevel must be an integer between 0 and 9");return}if(this._qualityLevel===ne)return;this._qualityLevel=ne,this._rfbConnectionState==="connected"&&this._sendEncodings()}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(ne){if(!Number.isInteger(ne)||ne<0||ne>9){R.Error("compressionLevel must be an integer between 0 and 9");return}if(this._compressionLevel===ne)return;this._compressionLevel=ne,this._rfbConnectionState==="connected"&&this._sendEncodings()}}],[{key:"genDES",value:function(ne,ye){var se=ne.split("").map(function(Pe){return Pe.charCodeAt(0)});return new t.default(se).encrypt(ye)}}]),Se}(E.default);re.default=pe,pe.messages={keyEvent:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen;ne[ye]=4,ne[ye+1]=Le,ne[ye+2]=0,ne[ye+3]=0,ne[ye+4]=Se>>24,ne[ye+5]=Se>>16,ne[ye+6]=Se>>8,ne[ye+7]=Se,xe._sQlen+=8,xe.flush()},QEMUExtendedKeyEvent:function(xe,Se,Le,ne){function ye(et){var Ge=ne>>8,ht=ne&255;return Ge===224&&ht<127?ht|128:et}var se=xe._sQ,Pe=xe._sQlen;se[Pe]=255,se[Pe+1]=0,se[Pe+2]=Le>>8,se[Pe+3]=Le,se[Pe+4]=Se>>24,se[Pe+5]=Se>>16,se[Pe+6]=Se>>8,se[Pe+7]=Se;var Ze=ye(ne);se[Pe+8]=Ze>>24,se[Pe+9]=Ze>>16,se[Pe+10]=Ze>>8,se[Pe+11]=Ze,xe._sQlen+=12,xe.flush()},pointerEvent:function(xe,Se,Le,ne){var ye=xe._sQ,se=xe._sQlen;ye[se]=5,ye[se+1]=ne,ye[se+2]=Se>>8,ye[se+3]=Se,ye[se+4]=Le>>8,ye[se+5]=Le,xe._sQlen+=6,xe.flush()},_buildExtendedClipboardFlags:function(xe,Se){for(var Le=new Uint8Array(4),ne=0,ye=0,se=0;se<xe.length;se++)ye|=xe[se];for(var Pe=0;Pe<Se.length;Pe++)ne|=Se[Pe];return Le[0]=ye>>24,Le[1]=0,Le[2]=0,Le[3]=ne,Le},extendedClipboardProvide:function(xe,Se,Le){for(var ne=new c.default,ye=[],se=0;se<Se.length;se++){if(Se[se]!=Te)throw new Error("Unsupported extended clipboard format for Provide message.");Le[se]=Le[se].replace(/\r\n|\r|\n/gm,`\r
`);var Pe=(0,I.encodeUTF8)(Le[se]+"\0");ye.push(Pe.length>>24&255,Pe.length>>16&255,Pe.length>>8&255,Pe.length&255);for(var Ze=0;Ze<Pe.length;Ze++)ye.push(Pe.charCodeAt(Ze))}var et=ne.deflate(new Uint8Array(ye)),Ge=new Uint8Array(4+et.length);Ge.set(pe.messages._buildExtendedClipboardFlags([Je],Se)),Ge.set(et,4),pe.messages.clientCutText(xe,Ge,!0)},extendedClipboardNotify:function(xe,Se){var Le=pe.messages._buildExtendedClipboardFlags([qe],Se);pe.messages.clientCutText(xe,Le,!0)},extendedClipboardRequest:function(xe,Se){var Le=pe.messages._buildExtendedClipboardFlags([Qe],Se);pe.messages.clientCutText(xe,Le,!0)},extendedClipboardCaps:function(xe,Se,Le){var ne=Object.keys(Le),ye=new Uint8Array(4+4*ne.length);ne.map(function(Ze){return parseInt(Ze)}),ne.sort(function(Ze,et){return Ze-et}),ye.set(pe.messages._buildExtendedClipboardFlags(Se,[]));for(var se=4,Pe=0;Pe<ne.length;Pe++)ye[se]=Le[ne[Pe]]>>24,ye[se+1]=Le[ne[Pe]]>>16,ye[se+2]=Le[ne[Pe]]>>8,ye[se+3]=Le[ne[Pe]]>>0,se+=4,ye[3]|=1<<ne[Pe];pe.messages.clientCutText(xe,ye,!0)},clientCutText:function(xe,Se){var Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ne=xe._sQ,ye=xe._sQlen;ne[ye]=6,ne[ye+1]=0,ne[ye+2]=0,ne[ye+3]=0;var se;Le?se=(0,G.toUnsigned32bit)(-Se.length):se=Se.length,ne[ye+4]=se>>24,ne[ye+5]=se>>16,ne[ye+6]=se>>8,ne[ye+7]=se,xe._sQlen+=8;for(var Pe=0,Ze=Se.length;Ze>0;){for(var et=Math.min(Ze,xe._sQbufferSize-xe._sQlen),Ge=0;Ge<et;Ge++)ne[xe._sQlen+Ge]=Se[Pe+Ge];xe._sQlen+=et,xe.flush(),Ze-=et,Pe+=et}},setDesktopSize:function(xe,Se,Le,ne,ye){var se=xe._sQ,Pe=xe._sQlen;se[Pe]=251,se[Pe+1]=0,se[Pe+2]=Se>>8,se[Pe+3]=Se,se[Pe+4]=Le>>8,se[Pe+5]=Le,se[Pe+6]=1,se[Pe+7]=0,se[Pe+8]=ne>>24,se[Pe+9]=ne>>16,se[Pe+10]=ne>>8,se[Pe+11]=ne,se[Pe+12]=0,se[Pe+13]=0,se[Pe+14]=0,se[Pe+15]=0,se[Pe+16]=Se>>8,se[Pe+17]=Se,se[Pe+18]=Le>>8,se[Pe+19]=Le,se[Pe+20]=ye>>24,se[Pe+21]=ye>>16,se[Pe+22]=ye>>8,se[Pe+23]=ye,xe._sQlen+=24,xe.flush()},clientFence:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen;ne[ye]=248,ne[ye+1]=0,ne[ye+2]=0,ne[ye+3]=0,ne[ye+4]=Se>>24,ne[ye+5]=Se>>16,ne[ye+6]=Se>>8,ne[ye+7]=Se;var se=Le.length;ne[ye+8]=se;for(var Pe=0;Pe<se;Pe++)ne[ye+9+Pe]=Le.charCodeAt(Pe);xe._sQlen+=9+se,xe.flush()},enableContinuousUpdates:function(xe,Se,Le,ne,ye,se){var Pe=xe._sQ,Ze=xe._sQlen;Pe[Ze]=150,Pe[Ze+1]=Se,Pe[Ze+2]=Le>>8,Pe[Ze+3]=Le,Pe[Ze+4]=ne>>8,Pe[Ze+5]=ne,Pe[Ze+6]=ye>>8,Pe[Ze+7]=ye,Pe[Ze+8]=se>>8,Pe[Ze+9]=se,xe._sQlen+=10,xe.flush()},pixelFormat:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen,se;Se>16?se=32:Se>8?se=16:se=8;var Pe=Math.floor(Se/3);ne[ye]=0,ne[ye+1]=0,ne[ye+2]=0,ne[ye+3]=0,ne[ye+4]=se,ne[ye+5]=Se,ne[ye+6]=0,ne[ye+7]=Le?1:0,ne[ye+8]=0,ne[ye+9]=(1<<Pe)-1,ne[ye+10]=0,ne[ye+11]=(1<<Pe)-1,ne[ye+12]=0,ne[ye+13]=(1<<Pe)-1,ne[ye+14]=Pe*2,ne[ye+15]=Pe*1,ne[ye+16]=Pe*0,ne[ye+17]=0,ne[ye+18]=0,ne[ye+19]=0,xe._sQlen+=20,xe.flush()},clientEncodings:function(xe,Se){var Le=xe._sQ,ne=xe._sQlen;Le[ne]=2,Le[ne+1]=0,Le[ne+2]=Se.length>>8,Le[ne+3]=Se.length;for(var ye=ne+4,se=0;se<Se.length;se++){var Pe=Se[se];Le[ye]=Pe>>24,Le[ye+1]=Pe>>16,Le[ye+2]=Pe>>8,Le[ye+3]=Pe,ye+=4}xe._sQlen+=ye-ne,xe.flush()},fbUpdateRequest:function(xe,Se,Le,ne,ye,se){var Pe=xe._sQ,Ze=xe._sQlen;typeof Le=="undefined"&&(Le=0),typeof ne=="undefined"&&(ne=0),Pe[Ze]=3,Pe[Ze+1]=Se?1:0,Pe[Ze+2]=Le>>8&255,Pe[Ze+3]=Le&255,Pe[Ze+4]=ne>>8&255,Pe[Ze+5]=ne&255,Pe[Ze+6]=ye>>8&255,Pe[Ze+7]=ye&255,Pe[Ze+8]=se>>8&255,Pe[Ze+9]=se&255,xe._sQlen+=10,xe.flush()},xvpOp:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen;ne[ye]=250,ne[ye+1]=0,ne[ye+2]=Se,ne[ye+3]=Le,xe._sQlen+=4,xe.flush()}},pe.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(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){"use strict";var R={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};G.defineMode("xml",function(L,M){var p=L.indentUnit,E={},b=M.htmlMode?R:I;for(var i in b)E[i]=b[i];for(var i in M)E[i]=M[i];var c,o;function h(g,F){function P(j){return F.tokenize=j,j(g,F)}var N=g.next();if(N=="<")return g.eat("!")?g.eat("[")?g.match("CDATA[")?P(t("atom","]]>")):null:g.match("--")?P(t("comment","-->")):g.match("DOCTYPE",!0,!0)?(g.eatWhile(/[\w\._\-]/),P(r(1))):null:g.eat("?")?(g.eatWhile(/[\w\._\-]/),F.tokenize=t("meta","?>"),"meta"):(c=g.eat("/")?"closeTag":"openTag",F.tokenize=n,"tag bracket");if(N=="&"){var W;return g.eat("#")?g.eat("x")?W=g.eatWhile(/[a-fA-F\d]/)&&g.eat(";"):W=g.eatWhile(/[\d]/)&&g.eat(";"):W=g.eatWhile(/[\w\.\-:]/)&&g.eat(";"),W?"atom":"error"}else return g.eatWhile(/[^&<]/),null}h.isInText=!0;function n(g,F){var P=g.next();if(P==">"||P=="/"&&g.eat(">"))return F.tokenize=h,c=P==">"?"endTag":"selfcloseTag","tag bracket";if(P=="=")return c="equals",null;if(P=="<"){F.tokenize=h,F.state=d,F.tagName=F.tagStart=null;var N=F.tokenize(g,F);return N?N+" tag error":"tag error"}else return/[\'\"]/.test(P)?(F.tokenize=a(P),F.stringStartCol=g.column(),F.tokenize(g,F)):(g.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(g){var F=function(P,N){for(;!P.eol();)if(P.next()==g){N.tokenize=n;break}return"string"};return F.isInAttribute=!0,F}function t(g,F){return function(P,N){for(;!P.eol();){if(P.match(F)){N.tokenize=h;break}P.next()}return g}}function r(g){return function(F,P){for(var N;(N=F.next())!=null;){if(N=="<")return P.tokenize=r(g+1),P.tokenize(F,P);if(N==">")if(g==1){P.tokenize=h;break}else return P.tokenize=r(g-1),P.tokenize(F,P)}return"meta"}}function s(g,F,P){this.prev=g.context,this.tagName=F,this.indent=g.indented,this.startOfLine=P,(E.doNotIndent.hasOwnProperty(F)||g.context&&g.context.noIndent)&&(this.noIndent=!0)}function u(g){g.context&&(g.context=g.context.prev)}function f(g,F){for(var P;;){if(!g.context)return;if(P=g.context.tagName,!E.contextGrabbers.hasOwnProperty(P)||!E.contextGrabbers[P].hasOwnProperty(F))return;u(g)}}function d(g,F,P){return g=="openTag"?(P.tagStart=F.column(),v):g=="closeTag"?m:d}function v(g,F,P){return g=="word"?(P.tagName=F.current(),o="tag",_):E.allowMissingTagName&&g=="endTag"?(o="tag bracket",_(g,F,P)):(o="error",v)}function m(g,F,P){if(g=="word"){var N=F.current();return P.context&&P.context.tagName!=N&&E.implicitlyClosed.hasOwnProperty(P.context.tagName)&&u(P),P.context&&P.context.tagName==N||E.matchClosing===!1?(o="tag",S):(o="tag error",C)}else return E.allowMissingTagName&&g=="endTag"?(o="tag bracket",S(g,F,P)):(o="error",C)}function S(g,F,P){return g!="endTag"?(o="error",S):(u(P),d)}function C(g,F,P){return o="error",S(g,F,P)}function _(g,F,P){if(g=="word")return o="attribute",y;if(g=="endTag"||g=="selfcloseTag"){var N=P.tagName,W=P.tagStart;return P.tagName=P.tagStart=null,g=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(N)?f(P,N):(f(P,N),P.context=new s(P,N,W==P.indented)),d}return o="error",_}function y(g,F,P){return g=="equals"?T:(E.allowMissing||(o="error"),_(g,F,P))}function T(g,F,P){return g=="string"?k:g=="word"&&E.allowUnquoted?(o="string",_):(o="error",_(g,F,P))}function k(g,F,P){return g=="string"?k:_(g,F,P)}return{startState:function(g){var F={tokenize:h,state:d,indented:g||0,tagName:null,tagStart:null,context:null};return g!=null&&(F.baseIndent=g),F},token:function(g,F){if(!F.tagName&&g.sol()&&(F.indented=g.indentation()),g.eatSpace())return null;c=null;var P=F.tokenize(g,F);return(P||c)&&P!="comment"&&(o=null,F.state=F.state(c||P,g,F),o&&(P=o=="error"?P+" error":o)),P},indent:function(g,F,P){var N=g.context;if(g.tokenize.isInAttribute)return g.tagStart==g.indented?g.stringStartCol+1:g.indented+p;if(N&&N.noIndent)return G.Pass;if(g.tokenize!=n&&g.tokenize!=h)return P?P.match(/^(\s*)/)[0].length:0;if(g.tagName)return E.multilineTagIndentPastTag!==!1?g.tagStart+g.tagName.length+2:g.tagStart+p*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/<!\[CDATA\[/.test(F))return 0;var W=F&&/^<(\/)?([\w_:\.-]*)/.exec(F);if(W&&W[1])for(;N;)if(N.tagName==W[2]){N=N.prev;break}else if(E.implicitlyClosed.hasOwnProperty(N.tagName))N=N.prev;else break;else if(W)for(;N;){var j=E.contextGrabbers[N.tagName];if(j&&j.hasOwnProperty(W[2]))N=N.prev;else break}for(;N&&N.prev&&!N.startOfLine;)N=N.prev;return N?N.indent+p:g.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(g){g.state==T&&(g.state=_)},xmlCurrentTag:function(g){return g.tagName?{name:g.tagName,close:g.type=="closeTag"}:null},xmlCurrentContext:function(g){for(var F=[],P=g.context;P;P=P.prev)P.tagName&&F.push(P.tagName);return F.reverse()}}}),G.defineMIME("text/xml","xml"),G.defineMIME("application/xml","xml"),G.mimeModes.hasOwnProperty("text/html")||G.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1q3G":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=G;function G(){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}},"24hK":function(it,re,Q){"use strict";Q.d(re,"a",function(){return R});class G{constructor(I){this.element=I,this.next=G.Undefined,this.prev=G.Undefined}}G.Undefined=new G(void 0);class R{constructor(){this._first=G.Undefined,this._last=G.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===G.Undefined}clear(){let I=this._first;for(;I!==G.Undefined;){const L=I.next;I.prev=G.Undefined,I.next=G.Undefined,I=L}this._first=G.Undefined,this._last=G.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,L){const M=new G(I);if(this._first===G.Undefined)this._first=M,this._last=M;else if(L){const E=this._last;this._last=M,M.prev=E,E.next=M}else{const E=this._first;this._first=M,M.next=E,E.prev=M}this._size+=1;let p=!1;return()=>{p||(p=!0,this._remove(M))}}shift(){if(this._first===G.Undefined)return;{const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last===G.Undefined)return;{const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==G.Undefined&&I.next!==G.Undefined){const L=I.prev;L.next=I.next,I.next.prev=L}else I.prev===G.Undefined&&I.next===G.Undefined?(this._first=G.Undefined,this._last=G.Undefined):I.next===G.Undefined?(this._last=this._last.prev,this._last.next=G.Undefined):I.prev===G.Undefined&&(this._first=this._first.next,this._first.prev=G.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==G.Undefined;)yield I.element,I=I.next}}},"3/fG":function(it,re,Q){"use strict";Q.d(re,"a",function(){return R});function G(I,L){let M;return L.length===0?M=I:M=I.replace(/\{(\d+)\}/g,function(p,E){const b=E[0];return typeof L[b]!="undefined"?L[b]:p}),M}function R(I,L,...M){return G(L,M)}},"34/K":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function R(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&R(M.prototype,p),E&&R(M,E),M}var L=function(){function M(){G(this,M),this._lines=0}return I(M,[{key:"decodeRect",value:function(E,b,i,c,o,h,n){this._lines===0&&(this._lines=c);var a=n==8?1:4,t=i*a;if(o.rQwait("RAW",t))return!1;var r=b+(c-this._lines),s=Math.min(this._lines,Math.floor(o.rQlen/t)),u=o.rQ,f=o.rQi;if(n==8){for(var d=i*s,v=new Uint8Array(d*4),m=0;m<d;m++)v[m*4+0]=(u[f+m]>>0&3)*255/3,v[m*4+1]=(u[f+m]>>2&3)*255/3,v[m*4+2]=(u[f+m]>>4&3)*255/3,v[m*4+4]=0;u=v,f=0}return h.blitImage(E,r,i,s,u,f),o.rQskipBytes(s*t),this._lines-=s,!(this._lines>0)}}]),M}();re.default=L},"3690":function(it,re,Q){"use strict";function G(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(o){return typeof o}:G=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},G(i)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var i=new WeakMap;return I=function(){return i},i}function L(i){if(i&&i.__esModule)return i;if(i===null||G(i)!=="object"&&typeof i!="function")return{default:i};var c=I();if(c&&c.has(i))return c.get(i);var o={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var a=h?Object.getOwnPropertyDescriptor(i,n):null;a&&(a.get||a.set)?Object.defineProperty(o,n,a):o[n]=i[n]}return o.default=i,c&&c.set(i,o),o}function M(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}function p(i,c){for(var o=0;o<c.length;o++){var h=c[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(i,h.key,h)}}function E(i,c,o){return c&&p(i.prototype,c),o&&p(i,o),i}var b=function(){function i(){M(this,i),this._tiles=0,this._lastsubencoding=0}return E(i,[{key:"decodeRect",value:function(o,h,n,a,t,r,s){for(this._tiles===0&&(this._tilesX=Math.ceil(n/16),this._tilesY=Math.ceil(a/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var u=1;if(t.rQwait("HEXTILE",u))return!1;var f=t.rQ,d=t.rQi,v=f[d];if(v>30)throw new Error("Illegal hextile subencoding (subencoding: "+v+")");var m=this._totalTiles-this._tiles,S=m%this._tilesX,C=Math.floor(m/this._tilesX),_=o+S*16,y=h+C*16,T=Math.min(16,o+n-_),k=Math.min(16,h+a-y);if(v&1)u+=T*k*4;else if(v&2&&(u+=4),v&4&&(u+=4),v&8){if(u++,t.rQwait("HEXTILE",u))return!1;var g=f[d+u-1];v&16?u+=g*(4+2):u+=g*2}if(t.rQwait("HEXTILE",u))return!1;if(d++,v===0)this._lastsubencoding&1?R.Debug(" Ignoring blank after RAW"):r.fillRect(_,y,T,k,this._background);else if(v&1)r.blitImage(_,y,T,k,f,d),d+=u-1;else{if(v&2&&(this._background=[f[d],f[d+1],f[d+2],f[d+3]],d+=4),v&4&&(this._foreground=[f[d],f[d+1],f[d+2],f[d+3]],d+=4),r.startTile(_,y,T,k,this._background),v&8){var F=f[d];d++;for(var P=0;P<F;P++){var N=void 0;v&16?(N=[f[d],f[d+1],f[d+2],f[d+3]],d+=4):N=this._foreground;var W=f[d];d++;var j=W>>4,A=W&15,K=f[d];d++;var U=(K>>4)+1,O=(K&15)+1;r.subTile(j,A,U,O,N)}}r.finishTile()}t.rQi=d,this._lastsubencoding=v,this._tiles--}return!0}}]),i}();re.default=b},"5VLF":function(it,re,Q){"use strict";var G,R;function I(L,M,p){var E=function(b,i){return L.js_beautify(b,i)};return E.js=L.js_beautify,E.css=M.css_beautify,E.html=p.html_beautify,E.js_beautify=L.js_beautify,E.css_beautify=M.css_beautify,E.html_beautify=p.html_beautify,E}!(G=[Q("6UM0"),Q("TXwP"),Q("psGv")],R=function(L,M,p){return I(L,M,p)}.apply(re,G),R!==void 0&&(it.exports=R))},"5Y4S":function(it,re,Q){"use strict";Q.d(re,"a",function(){return I});var G=Q("MNsG");const R=G.b.performance&&typeof G.b.performance.now=="function";class I{constructor(L){this._highResolution=R&&L,this._startTime=this._now(),this._stopTime=-1}static create(L=!0){return new I(L)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?G.b.performance.now():Date.now()}}},"6BzB":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.shrinkBuf=G,re.arraySet=R,re.flattenChunks=I,re.Buf32=re.Buf16=re.Buf8=void 0;function G(E,b){return E.length===b?E:E.subarray?E.subarray(0,b):(E.length=b,E)}function R(E,b,i,c,o){if(b.subarray&&E.subarray){E.set(b.subarray(i,i+c),o);return}for(var h=0;h<c;h++)E[o+h]=b[i+h]}function I(E){var b,i,c,o,h,n;for(c=0,b=0,i=E.length;b<i;b++)c+=E[b].length;for(n=new Uint8Array(c),o=0,b=0,i=E.length;b<i;b++)h=E[b],n.set(h,o),o+=h.length;return n}var L=Uint8Array;re.Buf8=L;var M=Uint16Array;re.Buf16=M;var p=Int32Array;re.Buf32=p},"6Qwc":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={8:"Backspace",9:"Tab",10:"NumpadClear",12:"Numpad5",13:"Enter",16:"ShiftLeft",17:"ControlLeft",18:"AltLeft",19:"Pause",20:"CapsLock",21:"Lang1",25:"Lang2",27:"Escape",28:"Convert",29:"NonConvert",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",44:"PrintScreen",45:"Insert",46:"Delete",47:"Help",48:"Digit0",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",91:"MetaLeft",92:"MetaRight",93:"ContextMenu",95:"Sleep",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",108:"NumpadDecimal",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",124:"F13",125:"F14",126:"F15",127:"F16",128:"F17",129:"F18",130:"F19",131:"F20",132:"F21",133:"F22",134:"F23",135:"F24",144:"NumLock",145:"ScrollLock",166:"BrowserBack",167:"BrowserForward",168:"BrowserRefresh",169:"BrowserStop",170:"BrowserSearch",171:"BrowserFavorites",172:"BrowserHome",173:"AudioVolumeMute",174:"AudioVolumeDown",175:"AudioVolumeUp",176:"MediaTrackNext",177:"MediaTrackPrevious",178:"MediaStop",179:"MediaPlayPause",180:"LaunchMail",181:"MediaSelect",182:"LaunchApp1",183:"LaunchApp2",225:"AltRight"};re.default=G},"6UM0":function(it,re,Q){var G,R;(function(){var I;(function(){"use strict";var M=[function(i,c,o){var h=o(1).Beautifier,n=o(5).Options;function a(t,r){var s=new h(t,r);return s.beautify()}i.exports=a,i.exports.defaultOptions=function(){return new n}},function(i,c,o){var h=o(2).Output,n=o(3).Token,a=o(4),t=o(5).Options,r=o(7).Tokenizer,s=o(7).line_starters,u=o(7).positionable_operators,f=o(7).TOKEN;function d(O,z){return z.indexOf(O)!==-1}function v(O){return O.replace(/^\s+/g,"")}function m(O){for(var z={},te=0;te<O.length;te++)z[O[te].replace(/-/g,"_")]=O[te];return z}function S(O,z){return O&&O.type===f.RESERVED&&O.text===z}function C(O,z){return O&&O.type===f.RESERVED&&d(O.text,z)}var _=["case","return","do","if","throw","else","await","break","continue","async"],y=["before-newline","after-newline","preserve-newline"],T=m(y),k=[T.before_newline,T.preserve_newline],g={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function F(O,z){if(z.multiline_frame||z.mode===g.ForInitializer||z.mode===g.Conditional)return;O.remove_indent(z.start_line_index)}function P(O){O=O.replace(a.allLineBreaks,`
`);for(var z=[],te=O.indexOf(`
`);te!==-1;)z.push(O.substring(0,te)),O=O.substring(te+1),te=O.indexOf(`
`);return O.length&&z.push(O),z}function N(O){return O===g.ArrayLiteral}function W(O){return d(O,[g.Expression,g.ForInitializer,g.Conditional])}function j(O,z){for(var te=0;te<O.length;te++){var de=O[te].trim();if(de.charAt(0)!==z)return!1}return!0}function A(O,z){for(var te=0,de=O.length,be;te<de;te++)if(be=O[te],be&&be.indexOf(z)!==0)return!1;return!0}function K(O,z){z=z||{},this._source_text=O||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new t(z)}K.prototype.create_flags=function(O,z){var te=0;O&&(te=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>te&&(te=O.line_indent_level));var de={mode:z,parent:O,last_token:O?O.last_token:new n(f.START_BLOCK,""),last_word:O?O.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:O?O.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return de},K.prototype._reset=function(O){var z=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new h(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(g.BlockStatement);var te=new r(O,this._options);return this._tokens=te.tokenize(),O},K.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,z=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
`,z&&a.lineBreak.test(z||"")&&(te=z.match(a.lineBreak)[0]));for(var de=this._tokens.next();de;)this.handle_token(de),this._last_last_text=this._flags.last_token.text,this._flags.last_token=de,de=this._tokens.next();return O=this._output.get_code(te),O},K.prototype.handle_token=function(O,z){O.type===f.START_EXPR?this.handle_start_expr(O):O.type===f.END_EXPR?this.handle_end_expr(O):O.type===f.START_BLOCK?this.handle_start_block(O):O.type===f.END_BLOCK?this.handle_end_block(O):O.type===f.WORD?this.handle_word(O):O.type===f.RESERVED?this.handle_word(O):O.type===f.SEMICOLON?this.handle_semicolon(O):O.type===f.STRING?this.handle_string(O):O.type===f.EQUALS?this.handle_equals(O):O.type===f.OPERATOR?this.handle_operator(O):O.type===f.COMMA?this.handle_comma(O):O.type===f.BLOCK_COMMENT?this.handle_block_comment(O,z):O.type===f.COMMENT?this.handle_comment(O,z):O.type===f.DOT?this.handle_dot(O):O.type===f.EOF?this.handle_eof(O):O.type===f.UNKNOWN?this.handle_unknown(O,z):this.handle_unknown(O,z)},K.prototype.handle_whitespace_and_comments=function(O,z){var te=O.newlines,de=this._options.keep_array_indentation&&N(this._flags.mode);if(O.comments_before)for(var be=O.comments_before.next();be;)this.handle_whitespace_and_comments(be,z),this.handle_token(be,z),be=O.comments_before.next();if(de)for(var je=0;je<te;je+=1)this.print_newline(je>0,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 Ne=1;Ne<te;Ne+=1)this.print_newline(!0,z)}};var U=["async","break","continue","return","throw","yield"];K.prototype.allow_wrap_or_preserved_newline=function(O,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var te=this._options.preserve_newlines&&O.newlines||z,de=d(this._flags.last_token.text,u)||d(O.text,u);if(de){var be=d(this._flags.last_token.text,u)&&d(this._options.operator_position,k)||d(O.text,u);te=te&&be}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(C(this._flags.last_token,U))return;this._output.set_wrap_point()}},K.prototype.print_newline=function(O,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==f.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var te=this._tokens.peek();this._flags.mode===g.Statement&&!(this._flags.if_block&&S(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},K.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||N(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},K.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===f.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},K.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===g.Statement&&F(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.prototype.start_of_object_property=function(){return this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"]))},K.prototype.start_of_statement=function(O){var z=!1;return z=z||C(this._flags.last_token,["var","let","const"])&&O.type===f.WORD,z=z||S(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement)&&C(this._flags.last_token,U)&&!O.newlines,z=z||S(this._flags.last_token,"else")&&!(S(O,"if")&&!O.comments_before),z=z||this._flags.last_token.type===f.END_EXPR&&(this._previous_flags.mode===g.ForInitializer||this._previous_flags.mode===g.Conditional),z=z||this._flags.last_token.type===f.WORD&&this._flags.mode===g.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==f.WORD&&O.type!==f.RESERVED,z=z||this._flags.mode===g.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"])),z?(this.set_mode(g.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,C(O,["do","for","if","while"])),!0):!1},K.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var z=g.Expression;if(O.text==="["){if(this._flags.last_token.type===f.WORD||this._flags.last_token.text===")"){C(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=g.ArrayLiteral,N(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,[f.START_EXPR,f.END_EXPR,f.WORD,f.OPERATOR,f.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===f.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=g.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=g.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.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===f.EQUALS||this._flags.last_token.type===f.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===f.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var de=this._tokens.peek(-4);C(te,["async","function"])||te.text==="*"&&C(de,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(de.text==="{"||de.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(O);(this._flags.last_token.type===f.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===g.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===f.START_BLOCK?this.print_newline():(this._flags.last_token.type===f.END_EXPR||this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===f.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},K.prototype.handle_end_expr=function(O){for(;this._flags.mode===g.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&N(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===f.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(O),this.restore_mode(),F(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===g.Conditional&&(this._previous_flags.mode=g.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},K.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var z=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===f.END_EXPR?(this.set_mode(g.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(g.BlockStatement):te&&(d(te.text,[":",","])&&d(z.type,[f.STRING,f.WORD,f.RESERVED])||d(z.text,["get","set","..."])&&d(te.type,[f.WORD,f.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(te.text,[":",","])?this.set_mode(g.BlockStatement):this.set_mode(g.ObjectLiteral):this._flags.last_token.type===f.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(g.BlockStatement):d(this._flags.last_token.type,[f.EQUALS,f.START_EXPR,f.COMMA,f.OPERATOR])||C(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g.ObjectLiteral):this.set_mode(g.BlockStatement),this._flags.last_token&&(C(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var de=!z.comments_before&&z.text==="}",be=de&&this._flags.last_word==="function"&&this._flags.last_token.type===f.END_EXPR;if(this._options.brace_preserve_inline){var je=0,Ne=null;this._flags.inline_frame=!0;do if(je+=1,Ne=this._tokens.peek(je-1),Ne.newlines){this._flags.inline_frame=!1;break}while(Ne.type!==f.EOF&&!(Ne.type===f.END_BLOCK&&Ne.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==f.OPERATOR&&(be||this._flags.last_token.type===f.EQUALS||C(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(N(this._previous_flags.mode)&&(this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.COMMA)&&((this._flags.last_token.type===f.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==f.OPERATOR&&this._flags.last_token.type!==f.START_EXPR&&(this._flags.last_token.type===f.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!de&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},K.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===g.Statement;)this.restore_mode();var z=this._flags.last_token.type===f.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(N(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(O)},K.prototype.handle_word=function(O){if(O.type===f.RESERVED){if(d(O.text,["set","get"])&&this._flags.mode!==g.ObjectLiteral)O.type=f.WORD;else if(O.text==="import"&&d(this._tokens.peek().text,["(","."]))O.type=f.WORD;else if(d(O.text,["as","from"])&&!this._flags.import_block)O.type=f.WORD;else if(this._flags.mode===g.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(O.type=f.WORD)}}if(this.start_of_statement(O)?C(this._flags.last_token,["var","let","const"])&&O.type===f.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!W(this._flags.mode)&&(this._flags.last_token.type!==f.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==f.EQUALS&&(this._options.preserve_newlines||!C(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(S(O,"while")){this._output.space_before_token=!0,this.print_token(O),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(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===g.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&C(O,["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(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.EQUALS||this._flags.last_token.type===f.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),S(O,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===f.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===f.RESERVED||this._flags.last_token.type===f.WORD?C(this._flags.last_token,["get","set","new","export"])||C(this._flags.last_token,U)?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===f.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(W(this._flags.mode)||N(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var te="NONE";if(this._flags.last_token.type===f.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":C(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===f.SEMICOLON&&this._flags.mode===g.BlockStatement?te="NEWLINE":this._flags.last_token.type===f.SEMICOLON&&W(this._flags.mode)?te="SPACE":this._flags.last_token.type===f.STRING?te="NEWLINE":this._flags.last_token.type===f.RESERVED||this._flags.last_token.type===f.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===g.ObjectLiteral&&d(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===f.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===f.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),C(O,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(O,["else","catch","finally"]))if((!(this._flags.last_token.type===f.END_BLOCK&&this._previous_flags.mode===g.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var de=this._output.current_line;de.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?C(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&C(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==f.END_EXPR?(this._flags.last_token.type!==f.START_EXPR||!C(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(O,"if")&&S(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):C(O,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&N(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===f.WORD||O.previous.type===f.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===f.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(O,"from")&&(this._flags.import_block=!1))},K.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var z=this._tokens.peek();this._flags.mode===g.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(O)},K.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===f.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===f.RESERVED||this._flags.last_token.type===f.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.EQUALS||this._flags.last_token.type===f.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===f.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},K.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},K.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(W(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(O)):this._flags.mode===g.ObjectLiteral||this._flags.mode===g.Statement&&this._flags.parent.mode===g.ObjectLiteral?(this._flags.mode===g.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},K.prototype.handle_operator=function(O){var z=O.text==="*"&&(C(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[f.START_BLOCK,f.COMMA,f.END_BLOCK,f.SEMICOLON])),te=d(O.text,["-","+"])&&(d(this._flags.last_token.type,[f.START_BLOCK,f.START_EXPR,f.EQUALS,f.OPERATOR])||d(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var de=!z;this.handle_whitespace_and_comments(O,de)}if(O.text==="*"&&this._flags.last_token.type===f.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===f.OPERATOR&&d(this._options.operator_position,k)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==f.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,je=!0,Ne=!1;if(O.text===":"?this._flags.ternary_depth===0?be=!1:(this._flags.ternary_depth-=1,Ne=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!te&&!z&&this._options.preserve_newlines&&d(O.text,u)){var Oe=O.text===":",Ke=Oe&&Ne,We=Oe&&!Ne;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!We,this.print_token(O),(!Oe||Ke)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!Oe||Ke?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case T.preserve_newline:We||this.allow_wrap_or_preserved_newline(O),be=!(this._output.just_added_newline()||We),this._output.space_before_token=be,this.print_token(O),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(O),be=!1;var Te=this._tokens.peek();je=Te&&d(Te.type,[f.WORD,f.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),be=this._flags.last_token.type===f.START_BLOCK,je=!1;else if(d(O.text,["--","++","!","~"])||te){if((this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),be=!1,je=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var we=C(this._flags.last_token,_)&&O.newlines;we&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(we,!0)}this._flags.last_token.text===";"&&W(this._flags.mode)&&(be=!0),this._flags.last_token.type===f.RESERVED?be=!0:this._flags.last_token.type===f.END_EXPR?be=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===f.OPERATOR&&(be=d(O.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(O.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(je=!0)),(this._flags.mode===g.BlockStatement&&!this._flags.inline_frame||this._flags.mode===g.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(O),this._output.space_before_token=je},K.prototype.handle_block_comment=function(O,z){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,z),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,z)},K.prototype.print_block_commment=function(O,z){var te=P(O.text),de,be=!1,je=!1,Ne=O.whitespace_before,Oe=Ne.length;if(this.print_newline(!1,z),this.print_token_line_indentation(O),this._output.add_token(te[0]),this.print_newline(!1,z),te.length>1){for(te=te.slice(1),be=j(te,"*"),je=A(te,Ne),be&&(this._flags.alignment=1),de=0;de<te.length;de++)be?(this.print_token_line_indentation(O),this._output.add_token(v(te[de]))):je&&te[de]?(this.print_token_line_indentation(O),this._output.add_token(te[de].substring(Oe))):(this._output.current_line.set_indent(-1),this._output.add_token(te[de])),this.print_newline(!1,z);this._flags.alignment=0}},K.prototype.handle_comment=function(O,z){O.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,z)},K.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),C(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(O)},K.prototype.handle_unknown=function(O,z){this.print_token(O),O.text[O.text.length-1]===`
`&&this.print_newline(!1,z)},K.prototype.handle_eof=function(O){for(;this._flags.mode===g.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},i.exports.Beautifier=K},function(i){function c(n){this.__parent=n,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=[]}c.prototype.clone_empty=function(){var n=new c(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},c.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},c.prototype.has_match=function(n){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(n))return!0;return!1},c.prototype.set_indent=function(n,a){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.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)},c.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},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(n){this.__items.push(n);var a=n.lastIndexOf(`
`);a!==-1?this.__character_count=n.length-a:this.__character_count+=n.length},c.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function o(n,a){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),a=a||"",n.indent_level>0&&(a=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}o.prototype.get_indent_size=function(n,a){var t=this.__base_string_length;return a=a||0,n<0&&(t=0),t+=n*this.__indent_size,t+=a,t},o.prototype.get_indent_string=function(n,a){var t=this.__base_string;return a=a||0,n<0&&(n=0,t=""),a+=n*this.__indent_size,this.__ensure_cache(a),t+=this.__cache[a],t},o.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var n=this.__cache.length,a=0,t="";this.__indent_size&&n>=this.__indent_size&&(a=Math.floor(n/this.__indent_size),n-=a*this.__indent_size,t=new Array(a+1).join(this.__indent_string)),n&&(t+=new Array(n+1).join(" ")),this.__cache.push(t)};function h(n,a){this.__indent_cache=new o(n,a),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(n,a){return this.__indent_cache.get_indent_string(n,a)},h.prototype.get_indent_size=function(n,a){return this.__indent_cache.get_indent_size(n,a)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(n){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
`);return n!==`
`&&(t=t.replace(/[\n]/g,n)),t},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(n,a){return n=n||0,a=a||0,this.next_line.set_indent(n,a),this.__lines.length>1?(this.current_line.set_indent(n,a),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(n){for(var a=0;a<n.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(n){for(var a=this.__lines.length;n<a;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(n,a){for(var t=this.__lines.length-2;t>=0;){var r=this.__lines[t];if(r.is_empty())break;if(r.item(0).indexOf(n)!==0&&r.item(-1)!==a){this.__lines.splice(t+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},i.exports.Output=h},function(i){function c(o,h,n,a){this.type=o,this.text=h,this.comments_before=null,this.newlines=n||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=c},function(i,c){var o="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\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",a="\\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+n+"])",r="(?:\\\\u[0-9a-fA-F]{4}|["+h+n+a+"])*";c.identifier=new RegExp(t+r,"g"),c.identifierStart=new RegExp(t),c.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+h+n+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;c.newline=/[\n\r\u2028\u2029]/,c.lineBreak=new RegExp(`\r
|`+c.newline.source),c.allLineBreaks=new RegExp(c.lineBreak.source,"g")},function(i,c,o){var h=o(6).Options,n=["before-newline","after-newline","preserve-newline"];function a(t){h.call(this,t,"js");var r=this.raw_options.brace_style||null;r==="expand-strict"?this.raw_options.brace_style="expand":r==="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 u=0;u<s.length;u++)s[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[u];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",n),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new h,i.exports.Options=a},function(i){function c(n,a){this.raw_options=o(n,a),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"])}c.prototype._get_array=function(n,a){var t=this.raw_options[n],r=a||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(r=t.concat()):typeof t=="string"&&(r=t.split(/[^a-zA-Z0-9_\/\-]+/)),r},c.prototype._get_boolean=function(n,a){var t=this.raw_options[n],r=t===void 0?!!a:!!t;return r},c.prototype._get_characters=function(n,a){var t=this.raw_options[n],r=a||"";return typeof t=="string"&&(r=t.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},c.prototype._get_number=function(n,a){var t=this.raw_options[n];a=parseInt(a,10),isNaN(a)&&(a=0);var r=parseInt(t,10);return isNaN(r)&&(r=a),r},c.prototype._get_selection=function(n,a,t){var r=this._get_selection_list(n,a,t);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[n]+"'");return r[0]},c.prototype._get_selection_list=function(n,a,t){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[a[0]],!this._is_valid_selection(t,a))throw new Error("Invalid Default Value!");var r=this._get_array(n,t);if(!this._is_valid_selection(r,a))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[n]+"'");return r},c.prototype._is_valid_selection=function(n,a){return n.length&&a.length&&!n.some(function(t){return a.indexOf(t)===-1})};function o(n,a){var t={};n=h(n);var r;for(r in n)r!==a&&(t[r]=n[r]);if(a&&n[a])for(r in n[a])t[r]=n[a][r];return t}function h(n){var a={},t;for(t in n){var r=t.replace(/-/g,"_");a[r]=n[t]}return a}i.exports.Options=c,i.exports.normalizeOpts=h,i.exports.mergeOpts=o},function(i,c,o){var h=o(8).InputScanner,n=o(9).Tokenizer,a=o(9).TOKEN,t=o(13).Directives,r=o(4),s=o(12).Pattern,u=o(14).TemplatablePattern;function f(j,A){return A.indexOf(j)!==-1}var d={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},v=new t(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,C=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var T=new RegExp(y),k="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),g=k.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),F=new RegExp("^(?:"+g.join("|")+")$"),P,N=function(j,A){n.call(this,j,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var K=new s(this._input),U=new u(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(r.identifier).matching(r.identifierMatch),number:K.matching(m),punct:K.matching(T),comment:K.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:K.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:K.matching(/<!--/),html_comment_end:K.matching(/-->/),include:K.starting_with(/#include/).until_after(r.lineBreak),shebang:K.starting_with(/#!/).until_after(r.lineBreak),xml:K.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};N.prototype=new n,N.prototype._is_comment=function(j){return j.type===d.COMMENT||j.type===d.BLOCK_COMMENT||j.type===d.UNKNOWN},N.prototype._is_opening=function(j){return j.type===d.START_BLOCK||j.type===d.START_EXPR},N.prototype._is_closing=function(j,A){return(j.type===d.END_BLOCK||j.type===d.END_EXPR)&&A&&(j.text==="]"&&A.text==="["||j.text===")"&&A.text==="("||j.text==="}"&&A.text==="{")},N.prototype._reset=function(){P=!1},N.prototype._get_next_token=function(j,A){var K=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(d.EOF,""):(K=K||this._read_non_javascript(U),K=K||this._read_string(U),K=K||this._read_word(j),K=K||this._read_singles(U),K=K||this._read_comment(U),K=K||this._read_regexp(U,j),K=K||this._read_xml(U,j),K=K||this._read_punctuation(),K=K||this._create_token(d.UNKNOWN,this._input.next()),K)},N.prototype._read_word=function(j){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(r.allLineBreaks,`
`),!(j.type===d.DOT||j.type===d.RESERVED&&(j.text==="set"||j.text==="get"))&&F.test(A)?(A==="in"||A==="of")&&(j.type===d.WORD||j.type===d.STRING)?this._create_token(d.OPERATOR,A):this._create_token(d.RESERVED,A):this._create_token(d.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(d.WORD,A)},N.prototype._read_singles=function(j){var A=null;return j==="("||j==="["?A=this._create_token(d.START_EXPR,j):j===")"||j==="]"?A=this._create_token(d.END_EXPR,j):j==="{"?A=this._create_token(d.START_BLOCK,j):j==="}"?A=this._create_token(d.END_BLOCK,j):j===";"?A=this._create_token(d.SEMICOLON,j):j==="."&&C.test(this._input.peek(1))?A=this._create_token(d.DOT,j):j===","&&(A=this._create_token(d.COMMA,j)),A&&this._input.next(),A},N.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(d.EQUALS,j):j==="?."?this._create_token(d.DOT,j):this._create_token(d.OPERATOR,j)},N.prototype._read_non_javascript=function(j){var A="";if(j==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(d.UNKNOWN,A.trim()+`
`);if(A=this.__patterns.include.read(),A)return this._create_token(d.UNKNOWN,A.trim()+`
`);j=this._input.next();var K="#";if(this._input.hasNext()&&this._input.testChar(S)){do j=this._input.next(),K+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(K+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(K+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,K)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(r.newline);)A+=this._input.next();return P=!0,this._create_token(d.COMMENT,A)}}else if(P&&j==="-"&&(A=this.__patterns.html_comment_end.read(),A))return P=!1,this._create_token(d.COMMENT,A);return null},N.prototype._read_comment=function(j){var A=null;if(j==="/"){var K="";if(this._input.peek(1)==="*"){K=this.__patterns.block_comment.read();var U=v.get_directives(K);U&&U.ignore==="start"&&(K+=v.readIgnored(this._input)),K=K.replace(r.allLineBreaks,`
`),A=this._create_token(d.BLOCK_COMMENT,K),A.directives=U}else this._input.peek(1)==="/"&&(K=this.__patterns.comment.read(),A=this._create_token(d.COMMENT,K))}return A},N.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var A=this._input.next();return this.has_char_escapes=!1,j==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(A=W(A)),this._input.peek()===j&&(A+=this._input.next()),A=A.replace(r.allLineBreaks,`
`),this._create_token(d.STRING,A)}return null},N.prototype._allow_regexp_or_xml=function(j){return j.type===d.RESERVED&&f(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===d.END_EXPR&&j.text===")"&&j.opened.previous.type===d.RESERVED&&f(j.opened.previous.text,["if","while","for"])||f(j.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},N.prototype._read_regexp=function(j,A){if(j==="/"&&this._allow_regexp_or_xml(A)){for(var K=this._input.next(),U=!1,O=!1;this._input.hasNext()&&(U||O||this._input.peek()!==j)&&!this._input.testChar(r.newline);)K+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===j&&(K+=this._input.next(),K+=this._input.read(r.identifier)),this._create_token(d.STRING,K)}return null},N.prototype._read_xml=function(j,A){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(A)){var K="",U=this.__patterns.xml.read_match();if(U){for(var O=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=O.indexOf("{")===0,te=0;U;){var de=!!U[1],be=U[2],je=!!U[U.length-1]||be.slice(0,8)==="![CDATA[";if(!je&&(be===O||z&&be.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(de?--te:++te),K+=U[0],te<=0)break;U=this.__patterns.xml.read_match()}return U||(K+=this._input.match(/[\s\S]*/g)[0]),K=K.replace(r.allLineBreaks,`
`),this._create_token(d.STRING,K)}}return null};function W(j){for(var A="",K=0,U=new h(j),O=null;U.hasNext();)if(O=U.match(/([\s]|[^\\]|\\\\)+/g),O&&(A+=O[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")O=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")O=U.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",U.hasNext()&&(A+=U.next());continue}if(!O)return j;if(K=parseInt(O[1],16),K>126&&K<=255&&O[0].indexOf("x")===0)return j;if(K>=0&&K<32){A+="\\"+O[0];continue}else K===34||K===39||K===92?A+="\\"+String.fromCharCode(K):A+=String.fromCharCode(K)}return A}N.prototype._read_string_recursive=function(j,A,K){var U,O;j==="'"?O=this.__patterns.single_quote:j==='"'?O=this.__patterns.double_quote:j==="`"?O=this.__patterns.template_text:j==="}"&&(O=this.__patterns.template_expression);for(var z=O.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===j||!A&&r.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),te+=this._input.next()):K&&(K==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),K===te&&(j==="`"?te+=this._read_string_recursive("}",A,"`"):te+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=O.read(),z+=te}return z},i.exports.Tokenizer=N,i.exports.TOKEN=d,i.exports.positionable_operators=_.slice(),i.exports.line_starters=k.slice()},function(i){var c=RegExp.prototype.hasOwnProperty("sticky");function o(h){this.__input=h||"",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<this.__input_length},o.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},o.prototype.peek=function(h){var n=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(n=this.__input.charAt(h)),n},o.prototype.__match=function(h,n){h.lastIndex=n;var a=h.exec(this.__input);return a&&!(c&&h.sticky)&&(a.index!==n&&(a=null)),a},o.prototype.test=function(h,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(h,n):!1},o.prototype.testChar=function(h,n){var a=this.peek(n);return h.lastIndex=0,a!==null&&h.test(a)},o.prototype.match=function(h){var n=this.__match(h,this.__position);return n?this.__position+=n[0].length:n=null,n},o.prototype.read=function(h,n,a){var t="",r;return h&&(r=this.match(h),r&&(t+=r[0])),n&&(r||!h)&&(t+=this.readUntil(n,a)),t},o.prototype.readUntil=function(h,n){var a="",t=this.__position;h.lastIndex=this.__position;var r=h.exec(this.__input);return r?(t=r.index,n&&(t+=r[0].length)):t=this.__input_length,a=this.__input.substring(this.__position,t),this.__position=t,a},o.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},o.prototype.get_regexp=function(h,n){var a=null,t="g";return n&&c&&(t="y"),typeof h=="string"&&h!==""?a=new RegExp(h,t):h&&(a=new RegExp(h.source,t)),a},o.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(h){var n=this.__position,a=this.readUntilAfter(h);return this.__position=n,a},o.prototype.lookBack=function(h){var n=this.__position-1;return n>=h.length&&this.__input.substring(n-h.length,n).toLowerCase()===h},i.exports.InputScanner=o},function(i,c,o){var h=o(8).InputScanner,n=o(3).Token,a=o(10).TokenStream,t=o(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(u,f){this._input=new h(u),this._options=f||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new t(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var u,f=new n(r.START,""),d=null,v=[],m=new a;f.type!==r.EOF;){for(u=this._get_next_token(f,d);this._is_comment(u);)m.add(u),u=this._get_next_token(f,d);m.isEmpty()||(u.comments_before=m,m=new a),u.parent=d,this._is_opening(u)?(v.push(d),d=u):d&&this._is_closing(u,d)&&(u.opened=d,d.closed=u,d=v.pop(),u.parent=d),u.previous=f,f.next=u,this.__tokens.add(u),f=u}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(u,f){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(r.RAW,d):this._create_token(r.EOF,"")},s.prototype._is_comment=function(u){return!1},s.prototype._is_opening=function(u){return!1},s.prototype._is_closing=function(u,f){return!1},s.prototype._create_token=function(u,f){var d=new n(u,f,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=s,i.exports.TOKEN=r},function(i){function c(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position<this.__tokens_length},c.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},c.prototype.peek=function(o){var h=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(h=this.__tokens[o]),h},c.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},i.exports.TokenStream=c},function(i,c,o){var h=o(12).Pattern;function n(a,t){h.call(this,a,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}n.prototype=new h,n.prototype.__set_whitespace_patterns=function(a,t){a+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},n.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var t=this.__split(this._newline_regexp,a);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return a},n.prototype.matching=function(a,t){var r=this._create();return r.__set_whitespace_patterns(a,t),r._update(),r},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(a,t){a.lastIndex=0;for(var r=0,s=[],u=a.exec(t);u;)s.push(t.substring(r,u.index)),r=u.index+u[0].length,u=a.exec(t);return r<t.length?s.push(t.substring(r,t.length)):s.push(""),s},i.exports.WhitespacePattern=n},function(i){function c(o,h){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}c.prototype.read=function(){var o=this._input.read(this._starting_pattern);return(!this._starting_pattern||o)&&(o+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),o},c.prototype.read_match=function(){return this._input.match(this._match_pattern)},c.prototype.until_after=function(o){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(o),h._update(),h},c.prototype.until=function(o){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(o),h._update(),h},c.prototype.starting_with=function(o){var h=this._create();return h._starting_pattern=this._input.get_regexp(o,!0),h._update(),h},c.prototype.matching=function(o){var h=this._create();return h._match_pattern=this._input.get_regexp(o,!0),h._update(),h},c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){},i.exports.Pattern=c},function(i){function c(o,h){o=typeof o=="string"?o:o.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+h,"g")}c.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(o);n;)h[n[1]]=n[2],n=this.__directive_pattern.exec(o);return h},c.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=c},function(i,c,o){var h=o(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(t,r){h.call(this,t,r),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var s=new h(t);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),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}/)}}a.prototype=new h,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(t){var r=this._create();return r._disabled[t]=!0,r._update(),r},a.prototype.read_options=function(t){var r=this._create();for(var s in n)r._disabled[s]=t.templating.indexOf(s)===-1;return r._update(),r},a.prototype.exclude=function(t){var r=this._create();return r._excluded[t]=!0,r._update(),r},a.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 r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),t+=r,r=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},a.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("|")+")")},a.prototype._read_template=function(){var t="",r=this._input.peek();if(r==="<"){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 r==="{"&&(!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},i.exports.TemplatablePattern=a}],p={};function E(i){var c=p[i];if(c!==void 0)return c.exports;var o=p[i]={exports:{}};return M[i](o,o.exports,E),o.exports}var b=E(0);I=b})();var L=I;!(G=[],R=function(){return{js_beautify:L}}.apply(re,G),R!==void 0&&(it.exports=R))})()},"746U":function(it,re,Q){"use strict";Q.d(re,"f",function(){return G}),Q.d(re,"l",function(){return R}),Q.d(re,"k",function(){return I}),Q.d(re,"j",function(){return L}),Q.d(re,"g",function(){return M}),Q.d(re,"m",function(){return p}),Q.d(re,"h",function(){return E}),Q.d(re,"n",function(){return b}),Q.d(re,"c",function(){return i}),Q.d(re,"a",function(){return c}),Q.d(re,"i",function(){return o}),Q.d(re,"o",function(){return h}),Q.d(re,"e",function(){return t}),Q.d(re,"d",function(){return r}),Q.d(re,"p",function(){return s}),Q.d(re,"b",function(){return u});function G(f){return Array.isArray(f)}function R(f){return typeof f=="string"}function I(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)&&!(f instanceof RegExp)&&!(f instanceof Date)}function L(f){return typeof f=="number"&&!isNaN(f)}function M(f){return f===!0||f===!1}function p(f){return typeof f=="undefined"}function E(f){return!b(f)}function b(f){return p(f)||f===null}function i(f,d){if(!f)throw new Error(d?`Unexpected type, expected '${d}'`:"Unexpected type")}function c(f){if(b(f))throw new Error("Assertion Failed: argument is undefined or null");return f}function o(f){return typeof f=="function"}function h(f,d){const v=Math.min(f.length,d.length);for(let m=0;m<v;m++)n(f[m],d[m])}function n(f,d){if(R(d)){if(typeof f!==d)throw new Error(`argument does not match constraint: typeof ${d}`)}else if(o(d)){try{if(f instanceof d)return}catch(v){}if(!b(f)&&f.constructor===d)return;if(d.length===1&&d.call(void 0,f)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(f){let d=[],v=Object.getPrototypeOf(f);for(;Object.prototype!==v;)d=d.concat(Object.getOwnPropertyNames(v)),v=Object.getPrototypeOf(v);return d}function t(f){const d=[];for(const v of a(f))typeof f[v]=="function"&&d.push(v);return d}function r(f,d){const v=S=>function(){const C=Array.prototype.slice.call(arguments,0);return d(S,C)};let m={};for(const S of f)m[S]=v(S);return m}function s(f){return f===null?void 0:f}function u(f,d="Unreachable"){throw new Error(d)}},"7Cbv":function(it,re,Q){"use strict";var G=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),R=new Uint8Array(16);function I(){if(!G)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return G(R)}var L=/^(?:[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(n){return typeof n=="string"&&L.test(n)}for(var p=M,E=[],b=0;b<256;++b)E.push((b+256).toString(16).substr(1));function i(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(E[n[a+0]]+E[n[a+1]]+E[n[a+2]]+E[n[a+3]]+"-"+E[n[a+4]]+E[n[a+5]]+"-"+E[n[a+6]]+E[n[a+7]]+"-"+E[n[a+8]]+E[n[a+9]]+"-"+E[n[a+10]]+E[n[a+11]]+E[n[a+12]]+E[n[a+13]]+E[n[a+14]]+E[n[a+15]]).toLowerCase();if(!p(t))throw TypeError("Stringified UUID is invalid");return t}var c=i;function o(n,a,t){n=n||{};var r=n.random||(n.rng||I)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,a){t=t||0;for(var s=0;s<16;++s)a[t+s]=r[s];return a}return c(r)}var h=re.a=o},"7ahc":function(it,re,Q){"use strict";Q.d(re,"a",function(){return v});var G=Q("k1fw"),R=Q("0Owb"),I=Q("+L6B"),L=Q("2/Rp"),M=Q("y8nQ"),p=Q("Vl3Y"),E=Q("tJVT"),b=Q("OaEy"),i=Q("2fM7"),c=Q("q1tI"),o=Q.n(c),h=Q("VrN/"),n=Q.n(h),a=Q("p77/"),t=Q.n(a),r=Q("c5Ni"),s=Q.n(r),u=i.a.Option,f={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"]};re.b=function(m){var S=m.callback,C=m.onCancel,_=Object(c.useState)("python"),y=Object(E.a)(_,2),T=y[0],k=y[1];function g(P){k(d[P][1])}function F(P){S(P)}return o.a.createElement(p.a,Object(R.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:F}),o.a.createElement(p.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},o.a.createElement(i.a,{onChange:g},Object.keys(d).map(function(P){return o.a.createElement(u,{key:P,value:P},d[P][0])}))),o.a.createElement(p.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},o.a.createElement(v,{mode:T})),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(L.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function v(m){var S=m.value,C=m.onChange,_=m.mode,y=m.options,T=y===void 0?{}:y,k=Object(c.useRef)(),g=Object(c.useState)(),F=Object(E.a)(g,2),P=F[0],N=F[1];return Object(c.useEffect)(function(){if(P){function W(j){var A=j.getValue();C&&C(A)}return P.on("change",W),function(){P.off("change",W)}}},[P,C]),Object(c.useEffect)(function(){P&&P.setOption("mode",_)},[P,_]),Object(c.useEffect)(function(){P&&((S!==P.getValue()||S==="")&&setTimeout(function(){P.setValue(S||" ")},300))},[P,S]),Object(c.useEffect)(function(){if(k.current&&!P){var W=n.a.fromTextArea(k.current,Object(G.a)({mode:_,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));N(W)}},[k.current,P]),o.a.createElement("div",{className:"my-codemirror-container"},o.a.createElement("textarea",{ref:k}))}},"7ixt":function(it,re,Q){"use strict";Q.d(re,"a",function(){return I});var G={adjustX:1,adjustY:1},R=[0,0],I={left:{points:["cr","cl"],overflow:G,offset:[-4,0],targetOffset:R},right:{points:["cl","cr"],overflow:G,offset:[4,0],targetOffset:R},top:{points:["bc","tc"],overflow:G,offset:[0,-4],targetOffset:R},bottom:{points:["tc","bc"],overflow:G,offset:[0,4],targetOffset:R},topLeft:{points:["bl","tl"],overflow:G,offset:[0,-4],targetOffset:R},leftTop:{points:["tr","tl"],overflow:G,offset:[-4,0],targetOffset:R},topRight:{points:["br","tr"],overflow:G,offset:[0,-4],targetOffset:R},rightTop:{points:["tl","tr"],overflow:G,offset:[4,0],targetOffset:R},bottomRight:{points:["tr","br"],overflow:G,offset:[0,4],targetOffset:R},rightBottom:{points:["bl","br"],overflow:G,offset:[4,0],targetOffset:R},bottomLeft:{points:["tl","bl"],overflow:G,offset:[0,4],targetOffset:R},leftBottom:{points:["br","bl"],overflow:G,offset:[-4,0],targetOffset:R}},L=I},"8+yF":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={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},R={lookup:function(L){if(L>=32&&L<=255)return L;var M=G[L];return M!==void 0?M:16777216|L}};re.default=R},"8CQX":function(it,re,Q){"use strict";function G(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(r){return typeof r}:G=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G(a)}Object.defineProperty(re,"__esModule",{value:!0}),re.getKeycode=o,re.getKey=h,re.getKeysym=n;var R=c(Q("mHUz")),I=c(Q("8+yF")),L=c(Q("6Qwc")),M=c(Q("gIYZ")),p=c(Q("mTgk")),E=i(Q("GdRQ"));function b(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return b=function(){return a},a}function i(a){if(a&&a.__esModule)return a;if(a===null||G(a)!=="object"&&typeof a!="function")return{default:a};var t=b();if(t&&t.has(a))return t.get(a);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in a)if(Object.prototype.hasOwnProperty.call(a,u)){var f=s?Object.getOwnPropertyDescriptor(a,u):null;f&&(f.get||f.set)?Object.defineProperty(r,u,f):r[u]=a[u]}return r.default=a,t&&t.set(a,r),r}function c(a){return a&&a.__esModule?a:{default:a}}function o(a){if(a.code){switch(a.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return a.code}if(a.type!=="keypress"&&a.keyCode in L.default){var t=L.default[a.keyCode];if(E.isMac()&&t==="ContextMenu"&&(t="MetaRight"),a.location===2)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(a.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 h(a){if(a.key!==void 0){switch(a.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 a.char}switch(a.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(a.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if(a.key==="\0"&&a.code==="NumpadDecimal")return"Delete";if(!E.isIE()&&!E.isEdge())return a.key;if(a.key.length!==1&&a.key!=="Unidentified")return a.key}var t=o(a);return t in M.default?M.default[t]:a.charCode?String.fromCharCode(a.charCode):"Unidentified"}function n(a){var t=h(a);if(t==="Unidentified")return null;if(t in p.default){var r=a.location;if(t==="Meta"&&r===0&&(r=2),t==="Clear"&&r===3){var s=o(a);s==="NumLock"&&(r=0)}if((r===void 0||r>3)&&(r=0),t==="Meta"){var u=o(a);if(u==="AltLeft")return R.default.XK_Meta_L;if(u==="AltRight")return R.default.XK_Meta_R}if(t==="Clear"){var f=o(a);if(f==="NumLock")return R.default.XK_Num_Lock}return p.default[t][r]}if(t.length!==1)return null;var d=t.charCodeAt();return d?I.default.lookup(d):null}},"8EBN":function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){"use strict";G.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 R=0;R<G.modeInfo.length;R++){var I=G.modeInfo[R];I.mimes&&(I.mime=I.mimes[0])}G.findModeByMIME=function(L){L=L.toLowerCase();for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.mime==L)return p;if(p.mimes){for(var E=0;E<p.mimes.length;E++)if(p.mimes[E]==L)return p}}if(/\+xml$/.test(L))return G.findModeByMIME("application/xml");if(/\+json$/.test(L))return G.findModeByMIME("application/json")},G.findModeByExtension=function(L){L=L.toLowerCase();for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.ext){for(var E=0;E<p.ext.length;E++)if(p.ext[E]==L)return p}}},G.findModeByFileName=function(L){for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.file&&p.file.test(L))return p}var E=L.lastIndexOf("."),b=E>-1&&L.substring(E+1,L.length);if(b)return G.findModeByExtension(b)},G.findModeByName=function(L){L=L.toLowerCase();for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.name.toLowerCase()==L)return p;if(p.alias){for(var E=0;E<p.alias.length;E++)if(p.alias[E].toLowerCase()==L)return p}}}})},"8HAY":function(it,re,Q){"use strict";Q.d(re,"a",function(){return M}),Q.d(re,"b",function(){return p}),Q.d(re,"d",function(){return E}),Q.d(re,"e",function(){return b}),Q.d(re,"c",function(){return i});var G=Q("MI8n"),R=Q("pmY6"),I=Q("3/fG"),L=function(c,o,h,n){function a(t){return t instanceof h?t:new h(function(r){r(t)})}return new(h||(h=Promise))(function(t,r){function s(d){try{f(n.next(d))}catch(v){r(v)}}function u(d){try{f(n.throw(d))}catch(v){r(v)}}function f(d){d.done?t(d.value):a(d.value).then(s,u)}f((n=n.apply(c,o||[])).next())})};class M extends R.a{constructor(c,o="",h="",n=!0,a){super();this._onDidChange=this._register(new G.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=c,this._label=o,this._cssClass=h,this._enabled=n,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(c){this._setLabel(c)}_setLabel(c){this._label!==c&&(this._label=c,this._onDidChange.fire({label:c}))}get tooltip(){return this._tooltip||""}set tooltip(c){this._setTooltip(c)}_setTooltip(c){this._tooltip!==c&&(this._tooltip=c,this._onDidChange.fire({tooltip:c}))}get class(){return this._cssClass}set class(c){this._setClass(c)}_setClass(c){this._cssClass!==c&&(this._cssClass=c,this._onDidChange.fire({class:c}))}get enabled(){return this._enabled}set enabled(c){this._setEnabled(c)}_setEnabled(c){this._enabled!==c&&(this._enabled=c,this._onDidChange.fire({enabled:c}))}get checked(){return this._checked}set checked(c){this._setChecked(c)}_setChecked(c){this._checked!==c&&(this._checked=c,this._onDidChange.fire({checked:c}))}run(c,o){return L(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(c))})}}class p extends R.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new G.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new G.b),this.onDidRun=this._onDidRun.event}run(c,o){return L(this,void 0,void 0,function*(){if(!c.enabled)return;this._onBeforeRun.fire({action:c});let h;try{yield this.runAction(c,o)}catch(n){h=n}this._onDidRun.fire({action:c,error:h})})}runAction(c,o){return L(this,void 0,void 0,function*(){yield c.run(o)})}}class E extends M{constructor(c){super(E.ID,c,c?"separator text":"separator");this.checked=!1,this.enabled=!1}}E.ID="vs.actions.separator";class b{constructor(c,o,h,n){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=c,this.label=o,this.class=n,this._actions=h}get actions(){return this._actions}dispose(){}run(){return L(this,void 0,void 0,function*(){})}}class i extends M{constructor(){super(i.ID,I.a("submenu.empty","(empty)"),void 0,!1)}}i.ID="vs.actions.empty"},"8K/p":function(it,re,Q){"use strict";function G(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(n){return typeof n}:G=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},G(o)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=p(Q("Lo0S")),I=L(Q("ItS6"));function L(o){return o&&o.__esModule?o:{default:o}}function M(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return M=function(){return o},o}function p(o){if(o&&o.__esModule)return o;if(o===null||G(o)!=="object"&&typeof o!="function")return{default:o};var h=M();if(h&&h.has(o))return h.get(o);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var r=a?Object.getOwnPropertyDescriptor(o,t):null;r&&(r.get||r.set)?Object.defineProperty(n,t,r):n[t]=o[t]}return n.default=o,h&&h.set(o,n),n}function E(o,h){if(!(o instanceof h))throw new TypeError("Cannot call a class as a function")}function b(o,h){for(var n=0;n<h.length;n++){var a=h[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function i(o,h,n){return h&&b(o.prototype,h),n&&b(o,n),o}var c=function(){function o(){E(this,o),this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(var h=0;h<4;h++)this._zlibs[h]=new I.default}return i(o,[{key:"decodeRect",value:function(n,a,t,r,s,u,f){if(this._ctl===null){if(s.rQwait("TIGHT compression-control",1))return!1;this._ctl=s.rQshift8();for(var d=0;d<4;d++)this._ctl>>d&1&&(this._zlibs[d].reset(),R.Info("Reset zlib stream "+d));this._ctl=this._ctl>>4}var v;if(this._ctl===8)v=this._fillRect(n,a,t,r,s,u,f);else if(this._ctl===9)v=this._jpegRect(n,a,t,r,s,u,f);else if(this._ctl===10)v=this._pngRect(n,a,t,r,s,u,f);else if((this._ctl&128)==0)v=this._basicRect(this._ctl,n,a,t,r,s,u,f);else throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");return v&&(this._ctl=null),v}},{key:"_fillRect",value:function(n,a,t,r,s,u,f){if(s.rQwait("TIGHT",3))return!1;var d=s.rQi,v=s.rQ;return u.fillRect(n,a,t,r,[v[d+2],v[d+1],v[d]],!1),s.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(n,a,t,r,s,u,f){var d=this._readData(s);return d===null?!1:(u.imageRect(n,a,t,r,"image/jpeg",d),!0)}},{key:"_pngRect",value:function(n,a,t,r,s,u,f){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(n,a,t,r,s,u,f,d){if(this._filter===null)if(n&4){if(u.rQwait("TIGHT",1))return!1;this._filter=u.rQshift8()}else this._filter=0;var v=n&3,m;switch(this._filter){case 0:m=this._copyFilter(v,a,t,r,s,u,f,d);break;case 1:m=this._paletteFilter(v,a,t,r,s,u,f,d);break;case 2:m=this._gradientFilter(v,a,t,r,s,u,f,d);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return m&&(this._filter=null),m}},{key:"_copyFilter",value:function(n,a,t,r,s,u,f,d){var v=r*s*3,m;if(v<12){if(u.rQwait("TIGHT",v))return!1;m=u.rQshiftBytes(v)}else{if(m=this._readData(u),m===null)return!1;this._zlibs[n].setInput(m),m=this._zlibs[n].inflate(v),this._zlibs[n].setInput(null)}return f.blitRgbImage(a,t,r,s,m,0,!1),!0}},{key:"_paletteFilter",value:function(n,a,t,r,s,u,f,d){if(this._numColors===0){if(u.rQwait("TIGHT palette",1))return!1;var v=u.rQpeek8()+1,m=v*3;if(u.rQwait("TIGHT palette",1+m))return!1;this._numColors=v,u.rQskipBytes(1),u.rQshiftTo(this._palette,m)}var S=this._numColors<=2?1:8,C=Math.floor((r*S+7)/8),_=C*s,y;if(_<12){if(u.rQwait("TIGHT",_))return!1;y=u.rQshiftBytes(_)}else{if(y=this._readData(u),y===null)return!1;this._zlibs[n].setInput(y),y=this._zlibs[n].inflate(_),this._zlibs[n].setInput(null)}return this._numColors==2?this._monoRect(a,t,r,s,y,this._palette,f):this._paletteRect(a,t,r,s,y,this._palette,f),this._numColors=0,!0}},{key:"_monoRect",value:function(n,a,t,r,s,u,f){for(var d=this._getScratchBuffer(t*r*4),v=Math.floor((t+7)/8),m=Math.floor(t/8),S=0;S<r;S++){var C=void 0,_=void 0,y=void 0;for(y=0;y<m;y++)for(var T=7;T>=0;T--)C=(S*t+y*8+7-T)*4,_=(s[S*v+y]>>T&1)*3,d[C]=u[_],d[C+1]=u[_+1],d[C+2]=u[_+2],d[C+3]=255;for(var k=7;k>=8-t%8;k--)C=(S*t+y*8+7-k)*4,_=(s[S*v+y]>>k&1)*3,d[C]=u[_],d[C+1]=u[_+1],d[C+2]=u[_+2],d[C+3]=255}f.blitRgbxImage(n,a,t,r,d,0,!1)}},{key:"_paletteRect",value:function(n,a,t,r,s,u,f){for(var d=this._getScratchBuffer(t*r*4),v=t*r*4,m=0,S=0;m<v;m+=4,S++){var C=s[S]*3;d[m]=u[C],d[m+1]=u[C+1],d[m+2]=u[C+2],d[m+3]=255}f.blitRgbxImage(n,a,t,r,d,0,!1)}},{key:"_gradientFilter",value:function(n,a,t,r,s,u,f,d){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(n){if(this._len===0){if(n.rQwait("TIGHT",3))return null;var a;a=n.rQshift8(),this._len=a&127,a&128&&(a=n.rQshift8(),this._len|=(a&127)<<7,a&128&&(a=n.rQshift8(),this._len|=a<<14))}if(n.rQwait("TIGHT",this._len))return null;var t=n.rQshiftBytes(this._len);return this._len=0,t}},{key:"_getScratchBuffer",value:function(n){return(!this._scratchBuffer||this._scratchBuffer.length<n)&&(this._scratchBuffer=new Uint8Array(n)),this._scratchBuffer}}]),o}();re.default=c},"8hTe":function(it,re,Q){it.exports={button:"button___1wy9m"}},"9Bee":function(it,re,Q){"use strict";var G=Q("DYRE"),R=Q("zeV3"),I=Q("+L6B"),L=Q("2/Rp"),M=Q("k1fw"),p=Q("9og8"),E=Q("tJVT"),b=Q("WmNS"),i=Q.n(b),c=Q("q1tI"),o=Q.n(c),h=Q("vg9a"),n=Q("DlQD"),a=Q.n(n),t=Q("rUJ1");function r(J,B){var H=J.match(/^(\s+)(?:```)/);if(H===null)return B;var Y=H[1];return B.split(`
`).map(function(le){var $=le.match(/^\s+/);if($===null)return le;var Be=Object(E.a)($,1),nt=Be[0];return nt.length>=Y.length?le.slice(Y.length):le}).join(`
`)}var s=[],u=["<ul>"],f=new a.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){s.length=0,u=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(J,B,H,Y){if(B>=J.length||J[B].level<=H)return B;var le=J[B];Y.push("<li><a href='#"+le.anchor+"'>"+le.text+"</a>"),B++;var $=[];return B=S(J,B,le.level,$),$.length>0&&(Y.push("<ul>"),$.forEach(function(Be){Y.push(Be)}),Y.push("</ul>")),Y.push("</li>"),B=S(J,B,H,Y),B}function C(){return S(s,0,0,u),u.push("</ul>"),u.join("")}var _={heading:function(B){var H=d.exec(B);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},fences:function(B){var H=this.rules.block.fences.exec(B);if(H){var Y=H[0],le=r(Y,H[3]||""),$=H[2]?H[2].trim():H[2];if(["latex","katex","math"].indexOf($)>=0){var Be=k(),nt=le;le=Be,g[Be]={type:"block",expression:nt}}return{type:"code",raw:Y,lang:$,text:le}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,k=function(){return"__special_katext_id_".concat(T++,"__")},g={};function F(){return g}function P(){T=0,g={}}function N(J){return J=J.replace(y,function(B,H){var Y=k();return g[Y]={type:"inline",expression:H},Y}),J}var W=f.listitem;f.listitem=function(J){return W(N(J))};var j=f.paragraph;f.paragraph=function(J){return j(N(J))};var A=f.tablecell;f.tablecell=function(J,B){return A(N(J),B)},f.code=function(J,B,H){var Y=(B||"").match(/\S*/)[0];return Y?["latex","katex","math"].indexOf(Y)>=0?"<p class='editormd-tex'>".concat(J,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(B,'">').concat(H?J:Object(t.escape)(J,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(H?J:Object(t.escape)(J,!0))+"</code></pre>"},f.heading=function(J,B,H){var Y=this.options.headerPrefix+H.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:Y,level:B,text:J}),"<h"+B+' id="'+Y+'">'+J+"</h"+B+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:f});var K=a.a,U=Q("SJMd"),O=Q("ulZh"),z=Q.n(O),te=Q("m3rI"),de=Q("Oy/b"),be=Q("p5ED"),je=Q("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 Ne=function(J,B){return(Ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(H[le]=Y[le])})(J,B)};function Oe(J,B){function H(){this.constructor=J}Ne(J,B),J.prototype=B===null?Object.create(B):(H.prototype=B.prototype,new H)}function Ke(J,B,H,Y){return new(H||(H=Promise))(function(le,$){function Be(St){try{ft(Y.next(St))}catch(st){$(st)}}function nt(St){try{ft(Y.throw(St))}catch(st){$(st)}}function ft(St){var st;St.done?le(St.value):(st=St.value,st instanceof H?st:new H(function(Rt){Rt(st)})).then(Be,nt)}ft((Y=Y.apply(J,B||[])).next())})}function We(J,B){var H,Y,le,$,Be={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return $={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function nt(ft){return function(St){return function(st){if(H)throw new TypeError("Generator is already executing.");for(;Be;)try{if(H=1,Y&&(le=2&st[0]?Y.return:st[0]?Y.throw||((le=Y.return)&&le.call(Y),0):Y.next)&&!(le=le.call(Y,st[1])).done)return le;switch(Y=0,le&&(st=[2&st[0],le.value]),st[0]){case 0:case 1:le=st;break;case 4:return Be.label++,{value:st[1],done:!1};case 5:Be.label++,Y=st[1],st=[0];continue;case 7:st=Be.ops.pop(),Be.trys.pop();continue;default:if(!(le=Be.trys,(le=le.length>0&&le[le.length-1])||st[0]!==6&&st[0]!==2)){Be=0;continue}if(st[0]===3&&(!le||st[1]>le[0]&&st[1]<le[3])){Be.label=st[1];break}if(st[0]===6&&Be.label<le[1]){Be.label=le[1],le=st;break}if(le&&Be.label<le[2]){Be.label=le[2],Be.ops.push(st);break}le[2]&&Be.ops.pop(),Be.trys.pop();continue}st=B.call(J,Be)}catch(Rt){st=[6,Rt],Y=0}finally{H=le=0}if(5&st[0])throw st[1];return{value:st[0]?st[1]:void 0,done:!0}}([ft,St])}}}function Te(){for(var J=0,B=0,H=arguments.length;B<H;B++)J+=arguments[B].length;var Y=Array(J),le=0;for(B=0;B<H;B++)for(var $=arguments[B],Be=0,nt=$.length;Be<nt;Be++,le++)Y[le]=$[Be];return Y}var we=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(B,H){for(var Y=0,le=H;Y<le.length;Y++){var $=le[Y],Be=$[0],nt=$[1];B.setAttribute(Be,nt)}},J.createRect=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","rect");return le.setAttribute("width",B.toString()),le.setAttribute("height",H.toString()),Y&&J.setAttributes(le,Y),le},J.createLine=function(B,H,Y,le,$){var Be=document.createElementNS("http://www.w3.org/2000/svg","line");return Be.setAttribute("x1",B.toString()),Be.setAttribute("y1",H.toString()),Be.setAttribute("x2",Y.toString()),Be.setAttribute("y2",le.toString()),$&&J.setAttributes(Be,$),Be},J.createPolygon=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",B),H&&J.setAttributes(Y,H),Y},J.createCircle=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(B/2).toString()),Y.setAttribute("cy",(B/2).toString()),Y.setAttribute("r",B.toString()),H&&J.setAttributes(Y,H),Y},J.createEllipse=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return le.setAttribute("cx",(B/2).toString()),le.setAttribute("cy",(H/2).toString()),le.setAttribute("rx",(B/2).toString()),le.setAttribute("ry",(H/2).toString()),Y&&J.setAttributes(le,Y),le},J.createGroup=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return B&&J.setAttributes(H,B),H},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(B,H,Y,le,$,Be,nt){var ft=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(ft,[["id",B],["orient",H],["markerWidth",Y.toString()],["markerHeight",le.toString()],["refX",$.toString()],["refY",Be.toString()]]),ft.appendChild(nt),ft},J.createText=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),B&&J.setAttributes(H,B),H},J.createTSpan=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=B,H&&J.setAttributes(Y,H),Y},J.createImage=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return B&&J.setAttributes(H,B),H},J.createPoint=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=B,Y.y=H,Y},J.createPath=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",B),H&&J.setAttributes(Y,H),Y},J}(),ue=function(){function J(){}return J.addKey=function(B){J.key=B},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),Ae=function(){function J(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return J.prototype.rasterize=function(B,H,Y){var le=this;return new Promise(function($){var Be=Y!==void 0?Y:document.createElement("canvas");B===null&&(le.markersOnly=!0,le.naturalSize=!1);var nt=document.createElementNS("http://www.w3.org/2000/svg","svg");nt.setAttribute("xmlns","http://www.w3.org/2000/svg"),nt.setAttribute("width",H.width.baseVal.valueAsString),nt.setAttribute("height",H.height.baseVal.valueAsString),nt.setAttribute("viewBox","0 0 "+H.viewBox.baseVal.width.toString()+" "+H.viewBox.baseVal.height.toString()),nt.innerHTML=H.innerHTML,le.naturalSize===!0?(nt.width.baseVal.value=B.naturalWidth,nt.height.baseVal.value=B.naturalHeight):le.width!==void 0&&le.height!==void 0&&(nt.width.baseVal.value=le.width,nt.height.baseVal.value=le.height),Be.width=nt.width.baseVal.value,Be.height=nt.height.baseVal.value;var ft=nt.outerHTML,St=Be.getContext("2d");le.markersOnly!==!0&&St.drawImage(B,0,0,Be.width,Be.height);var st=window.URL,Rt=new Image(Be.width,Be.height);Rt.setAttribute("crossOrigin","anonymous");var zt=new Blob([ft],{type:"image/svg+xml"}),ii=st.createObjectURL(zt);Rt.onload=function(){St.drawImage(Rt,0,0),st.revokeObjectURL(ii);var Hi=Be.toDataURL(le.imageType,le.imageQuality);$(Hi)},Rt.src=ii})},J}(),ge=function(){},Ve=function(){function J(B){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+B+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(B){return this.styleSheet===void 0&&this.addStyleSheet(),B.name=""+this.classNamePrefix+B.localName,this.classes.push(B),this.styleSheet.sheet.insertRule("."+B.name+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length),B},J.prototype.addRule=function(B){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(B),this.styleSheet.sheet.insertRule(B.selector+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var B;this.styleSheet=document.createElement("style"),((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).appendChild(this.styleSheet),this.addRule(new Qe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Qe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Qe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ze("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ze("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},J.prototype.removeStyleSheet=function(){var B;this.styleSheet&&(((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),Qe=function(J,B){this.selector=J,this.style=B},ze=function(J,B){this.localName=J,this.style=B},qe=function(){function J(B,H,Y,le,$){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=B,this.displayMode=H,this.markerItems=Y,this.uiStyleSettings=le,this.styles=$,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return J.prototype.show=function(B){var H=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=B,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",this.uiContainer.appendChild(Y),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function($){var Be=document.createElement("div");Be.className=""+H.toolbarButtonStyleClass.name,Be.setAttribute("data-type-name",$.typeName),Be.innerHTML=$.icon,Be.addEventListener("click",function(){H.markerToolbarButtonClicked(Be,$)}),H.buttons.push(Be),H.markerButtons.push(Be)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var le=document.createElement("div");le.className=this.toolbarBlockStyleClass.name,le.style.whiteSpace="nowrap",le.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(le),this.addActionButton(le,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(le,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},J.prototype.addButtonClickListener=function(B){this.buttonClickListeners.push(B)},J.prototype.removeButtonClickListener=function(B){this.buttonClickListeners.indexOf(B)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(B),1)},J.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},J.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var B=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var H=0;H<this.markerButtons.length;H++)H<B||H===B&&this.markerButtons.length-1===B?this.markerButtonBlock.appendChild(this.markerButtons[H]):(H===B&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[H]))}},J.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},J.prototype.resetButtonStyles=function(){var B=this;this.buttons.forEach(function(H){H.className=H.className.replace(B.uiStyleSettings.toolbarButtonStyleColorsClassName?B.uiStyleSettings.toolbarButtonStyleColorsClassName:B.toolbarButtonStyleColorsClass.name,"").trim(),H.className=H.className.replace(B.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?B.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:B.toolbarActiveButtonStyleColorsClass.name,"").trim(),H.className+=" "+(B.uiStyleSettings.toolbarButtonStyleColorsClassName?B.uiStyleSettings.toolbarButtonStyleColorsClassName:B.toolbarButtonStyleColorsClass.name)})},J.prototype.addActionButton=function(B,H,Y){var le=this,$=document.createElement("div");switch($.className=""+this.toolbarButtonStyleClass.name,$.innerHTML=H,$.setAttribute("data-action",Y),$.addEventListener("click",function(){le.actionToolbarButtonClicked($,Y)}),Y){case"select":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":$.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":$.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":$.style.fill=this.uiStyleSettings.closeButtonColor}B.appendChild($),this.buttons.push($)},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ze("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ze("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ze("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ze("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ze("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var B=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ze("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
padding: `+B+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Qe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Qe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},J.prototype.markerToolbarButtonClicked=function(B,H){this.setActiveButton(B),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("marker",H)}),this.markerButtonOverflowBlock.style.display="none"},J.prototype.actionToolbarButtonClicked=function(B,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])},J.prototype.setActiveButton=function(B){this.resetButtonStyles(),B.className=B.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),B.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},J.prototype.setActiveMarkerButton=function(B){var H=this.markerButtons.find(function(Y){return Y.getAttribute("data-type-name")===B});H&&this.setActiveButton(H)},J.prototype.setCurrentMarker=function(B){var H=this;this.currentMarker=B,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")})},J}(),Je=function(){function J(B,H,Y,le){this.panels=[],this.panelButtons=[],this.markerjsContainer=B,this.displayMode=H,this.uiStyleSettings=Y,this.styles=le,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return J.prototype.addStyles=function(){var B;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: `+((B=this.uiStyleSettings.toolboxBackgroundColor)!==null&&B!==void 0?B: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 Qe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Qe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},J.prototype.show=function(B){var H;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=B,this.uiContainer.className=this.toolboxStyleClass.name+" "+((H=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},J.prototype.setPanelButtons=function(B){var H,Y,le=this;this.panels=B,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($){var Be;$.uiStyleSettings=le.uiStyleSettings;var nt=document.createElement("div");nt.className=le.toolboxButtonStyleClass.name+" "+((Be=le.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Be!==void 0?Be:le.toolboxButtonStyleColorsClass.name),nt.innerHTML=$.icon,nt.title=$.title,nt.addEventListener("click",function(){le.panelButtonClick($)}),le.panelButtons.push(nt),le.buttonRow.appendChild(nt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},J.prototype.panelButtonClick=function(B){var H=this,Y=-1;if(B!==this.activePanel){Y=this.panels.indexOf(B),this.panelRow.innerHTML="";var le=B.getUi();le.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(le),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=B}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($,Be){var nt,ft;$.className=H.toolboxButtonStyleClass.name+" "+(Be===Y?""+((nt=H.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&nt!==void 0?nt:H.toolboxActiveButtonStyleColorsClass.name):""+((ft=H.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ft!==void 0?ft:H.toolboxButtonStyleColorsClass.name))})},J}(),pe=function(J,B){this.title=J,this.icon=B},ve=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Be.colors=[],Be.addTransparent=!1,Be.colorBoxes=[],Be.colors=Y,Be.currentColor=le,Be.setCurrentColor=Be.setCurrentColor.bind(Be),Be.getColorBox=Be.getColorBox.bind(Be),Be}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.whiteSpace="nowrap",this.colors.forEach(function(le){var $=H.getColorBox(le);Y.appendChild($),H.colorBoxes.push($)}),Y},B.prototype.getColorBox=function(H){var Y=this,le=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-le,Be=document.createElement("div");Be.style.display="inline-block",Be.style.boxSizing="content-box",Be.style.width=$-2+"px",Be.style.height=$-2+"px",Be.style.padding="1px",Be.style.marginRight="2px",Be.style.marginBottom="2px",Be.style.borderWidth="2px",Be.style.borderStyle="solid",Be.style.borderRadius=($+2)/2+"px",Be.style.borderColor=H===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Be.addEventListener("click",function(){Y.setCurrentColor(H,Be)});var nt=document.createElement("div");return nt.style.display="inline-block",nt.style.width=$-2+"px",nt.style.height=$-2+"px",nt.style.backgroundColor=H,nt.style.borderRadius=$/2+"px",H==="transparent"&&(nt.style.fill=this.uiStyleSettings.toolboxAccentColor,nt.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Be.appendChild(nt),Be},B.prototype.setCurrentColor=function(H,Y){var le=this;this.currentColor=H,this.colorBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(H)},B}(pe),xe=function(){function J(B,H,Y){this._state="new",this._isSelected=!1,this._container=B,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(J.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),J.prototype.ownsTarget=function(B){return!1},Object.defineProperty(J.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),J.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},J.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},J.prototype.pointerDown=function(B,H){},J.prototype.dblClick=function(B,H){},J.prototype.manipulate=function(B){},J.prototype.pointerUp=function(B){this.stateChanged()},J.prototype.dispose=function(){},J.prototype.addMarkerVisualToContainer=function(B){this.container.childNodes.length>0?this.container.insertBefore(B,this.container.childNodes[0]):this.container.appendChild(B)},J.prototype.getState=function(){return{typeName:J.typeName,state:this.state,notes:this.notes}},J.prototype.restoreState=function(B){this._state=B.state,this.notes=B.notes},J.prototype.scale=function(B,H){},J.prototype.colorChanged=function(B){this.onColorChanged&&this.onColorChanged(B),this.stateChanged()},J.prototype.fillColorChanged=function(B){this.onFillColorChanged&&this.onFillColorChanged(B),this.stateChanged()},J.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var B=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),B.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(B)&&this.onStateChanged(this)}},J.typeName="MarkerBase",J}(),Se=function(){function J(){this.findGripByVisual=this.findGripByVisual.bind(this)}return J.prototype.findGripByVisual=function(B){return this.topLeft.ownsTarget(B)?this.topLeft:this.topCenter.ownsTarget(B)?this.topCenter:this.topRight.ownsTarget(B)?this.topRight:this.centerLeft.ownsTarget(B)?this.centerLeft:this.centerRight.ownsTarget(B)?this.centerRight:this.bottomLeft.ownsTarget(B)?this.bottomLeft:this.bottomCenter.ownsTarget(B)?this.bottomCenter:this.bottomRight.ownsTarget(B)?this.bottomRight:void 0},J}(),Le=function(){function J(){this.GRIP_SIZE=10,this.visual=we.createGroup(),this.visual.appendChild(we.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(we.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},J}(),ne=function(){function J(){}return J.toITransformMatrix=function(B){return{a:B.a,b:B.b,c:B.c,d:B.d,e:B.e,f:B.f}},J.toSVGMatrix=function(B,H){return B.a=H.a,B.b=H.b,B.c=H.c,B.d=H.d,B.e=H.e,B.f=H.f,B},J}(),ye=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.left=0,$.top=0,$.width=0,$.height=0,$.defaultSize={x:50,y:20},$.offsetX=0,$.offsetY=0,$.rotationAngle=0,$.CB_DISTANCE=10,$._suppressMarkerCreateEvent=!1,$.container.transform.baseVal.appendItem(we.createTransform()),$.setupControlBox(),$}return Oe(B,J),Object.defineProperty(B.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"visual",{get:function(){return this._visual},set:function(H){this._visual=H;var Y=we.createTransform();this._visual.transform.baseVal.appendItem(Y)},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(H){return!!J.prototype.ownsTarget.call(this,H)||!!(this.controlGrips.findGripByVisual(H)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H))},B.prototype.pointerDown=function(H,Y){J.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 le=this.unrotatePoint(H);if(this.manipulationStartX=le.x,this.manipulationStartY=le.y,this.offsetX=le.x-this.left,this.offsetY=le.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 $=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=$.x-this.width/2,this.top=$.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Be=this.container.transform.baseVal.getItem(0);Be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},B.prototype.pointerUp=function(H){var Y=this.state;J.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)},B.prototype.moveVisual=function(H){this.visual.style.transform="translate("+H.x+"px, "+H.y+"px)"},B.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)},B.prototype.resize=function(H){var Y=this.manipulationStartLeft,le=this.manipulationStartWidth,$=this.manipulationStartTop,Be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Y=this.manipulationStartLeft+H.x-this.manipulationStartX,le=this.manipulationStartWidth+this.manipulationStartLeft-Y;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:le=this.manipulationStartWidth+H.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:$=this.manipulationStartTop+H.y-this.manipulationStartY,Be=this.manipulationStartHeight+this.manipulationStartTop-$;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Be=this.manipulationStartHeight+H.y-this.manipulationStartY}le>=0?(this.left=Y,this.width=le):(this.left=Y+le,this.width=-le),Be>=0?(this.top=$,this.height=Be):(this.top=$+Be,this.height=-Be),this.setSize()},B.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},B.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()}},B.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)},B.prototype.rotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM(),le=we.createPoint(H.x,H.y);return{x:(le=le.matrixTransform(Y)).x,y:le.y}},B.prototype.unrotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM();Y=Y.inverse();var le=we.createPoint(H.x,H.y);return{x:(le=le.matrixTransform(Y)).x,y:le.y}},B.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=we.createGroup();var H=we.createTransform();H.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(H),this.container.appendChild(this.controlBox),this.controlRect=we.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=we.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 Se,this.addControlGrips(),this.controlBox.style.display="none"},B.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()},B.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()},B.prototype.createGrip=function(){var H=new Le;return H.visual.transform.baseVal.appendItem(we.createTransform()),this.controlBox.appendChild(H.visual),H},B.prototype.positionGrips=function(){var H=this.controlGrips.topLeft.GRIP_SIZE,Y=-H/2,le=Y,$=(this.width+this.CB_DISTANCE)/2-H/2,Be=(this.height+this.CB_DISTANCE)/2-H/2,nt=this.height+this.CB_DISTANCE-H/2,ft=this.width+this.CB_DISTANCE-H/2;this.positionGrip(this.controlGrips.topLeft.visual,Y,le),this.positionGrip(this.controlGrips.topCenter.visual,$,le),this.positionGrip(this.controlGrips.topRight.visual,ft,le),this.positionGrip(this.controlGrips.centerLeft.visual,Y,Be),this.positionGrip(this.controlGrips.centerRight.visual,ft,Be),this.positionGrip(this.controlGrips.bottomLeft.visual,Y,nt),this.positionGrip(this.controlGrips.bottomCenter.visual,$,nt),this.positionGrip(this.controlGrips.bottomRight.visual,ft,nt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,$,le-3*this.CB_DISTANCE)},B.prototype.positionGrip=function(H,Y,le){var $=H.transform.baseVal.getItem(0);$.setTranslate(Y,le),H.transform.baseVal.replaceItem($,0)},B.prototype.hideControlBox=function(){this.controlBox.style.display="none"},B.prototype.showControlBox=function(){this.controlBox.style.display=""},B.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ne.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ne.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){J.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(ne.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Y.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ne.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Y.containerTransformMatrix))},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y);var le=this.rotatePoint({x:this.left,y:this.top}),$=this.unrotatePoint({x:le.x*H,y:le.y*Y});this.left=$.x,this.top=$.y,this.width=this.width*H,this.height=this.height*Y,this.adjustControlBox()},B}(xe),se=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.createVisual=$.createVisual.bind($),$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual)},B.prototype.createVisual=function(){this.visual=we.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)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.setSize()},B.prototype.setSize=function(){J.prototype.setSize.call(this),we.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(H){J.prototype.pointerUp.call(this,H),this.setSize()},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&we.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},B.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&we.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&we.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&we.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this))},B.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(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize()},B.title="Rectangle marker",B}(ye),Pe=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Be.widths=[],Be.widthBoxes=[],Be.widths=Y,Be.currentWidth=le,Be.setCurrentWidth=Be.setCurrentWidth.bind(Be),Be}return Oe(B,J),B.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(le){var $=document.createElement("div");$.style.display="flex",$.style.flexGrow="2",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=le===H.currentWidth?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentWidth(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.innerText=le.toString(),Be.style.marginRight="5px",$.appendChild(Be);var nt=document.createElement("div");nt.style.minHeight="20px",nt.style.flexGrow="2",nt.style.display="flex",nt.style.alignItems="center";var ft=document.createElement("hr");ft.style.minWidth="20px",ft.style.border="0px",ft.style.borderTop=le+"px solid "+H.uiStyleSettings.toolboxColor,ft.style.flexGrow="2",nt.appendChild(ft),$.appendChild(nt),H.widthBoxes.push($)}),Y},B.prototype.setCurrentWidth=function(H,Y){var le=this;this.currentWidth=H,this.widthBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},B}(pe),Ze=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Be.styles=[],Be.styleBoxes=[],Be.styles=Y,Be.currentStyle=le,Be.setCurrentStyle=Be.setCurrentStyle.bind(Be),Be}return Oe(B,J),B.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(le){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/H.styles.length-5+"%",$.style.borderColor=le===H.currentStyle?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentStyle(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.overflow="hidden";var nt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+H.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(le!==""?'stroke-dasharray="'+le+'"':"")+` />
</svg>`;Be.innerHTML=nt,$.appendChild(Be),H.styleBoxes.push($)}),Y},B.prototype.setCurrentStyle=function(H,Y){var le=this;this.currentStyle=H,this.styleBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},B}(pe),et=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ve("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Pe("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ze("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Oe(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="FrameMarker",B.title="Frame marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',B}(se),Ge=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},ht=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!!J.prototype.ownsTarget.call(this,H)||!(!this.grip1.ownsTarget(H)&&!this.grip2.ownsTarget(H))},B.prototype.pointerDown=function(H,Y){J.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")},B.prototype.pointerUp=function(H){var Y=this.state;J.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)},B.prototype.adjustVisual=function(){},B.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)},B.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()},B.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=we.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},B.prototype.adjustControlBox=function(){this.positionGrips()},B.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},B.prototype.createGrip=function(){var H=new Le;return H.visual.transform.baseVal.appendItem(we.createTransform()),this.controlBox.appendChild(H.visual),H},B.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)},B.prototype.positionGrip=function(H,Y,le){var $=H.transform.baseVal.getItem(0);$.setTranslate(Y,le),H.transform.baseVal.replaceItem($,0)},B.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.x1=Y.x1,this.y1=Y.y1,this.x2=Y.x2,this.y2=Y.y2},B.prototype.scale=function(H,Y){J.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()},B}(xe),ce=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ve("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Pe("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ze("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorLine&&H!==this.visibleLine)},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.selectorLine=we.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=we.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)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},B.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()),we.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),we.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),we.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.createVisual(),this.adjustVisual()},B.typeName="LineMarker",B.title="Line marker",B.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',B}(ht),Me=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Be.fonts=[],Be.fontBoxes=[],Be.fonts=Y,Be.currentFont=le,Be.setCurrentFont=Be.setCurrentFont.bind(Be),Be}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.flexGrow="2",this.fonts.forEach(function(le){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/H.fonts.length-5+"%",$.style.borderColor=le===H.currentFont?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentFont(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.style.display="flex",Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.fontFamily=le,Be.style.overflow="hidden";var nt=document.createElement("div");nt.style.whiteSpace="nowrap",nt.style.overflow="hidden",nt.style.textOverflow="ellipsis",nt.innerHTML="The quick brown fox jumps over the lazy dog",Be.appendChild(nt),$.appendChild(Be),H.fontBoxes.push($)}),Y},B.prototype.setCurrentFont=function(H,Y){var le=this;this.currentFont=H,this.fontBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},B}(pe),Fe=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=le.defaultColor,$.fontFamily=le.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new ve("Color",le.defaultColorSet,le.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new Me("Font",le.defaultFontFamilies,le.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return Oe(B,J),B.prototype.ownsTarget=function(H){if(J.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(le){le===H&&(Y=!0)}),Y},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.bgRectangle=we.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=we.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(we.createTransform()),this.textElement.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},B.prototype.pointerDown=function(H,Y){J.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")},B.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(we.createTSpan(Y.trim()===""?" ":Y.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},B.prototype.getTextScale=function(){var H=this.textElement.getBBox(),Y=1;if(H.width>0&&H.height>0){var le=(1*this.width-this.width*this.padding*2/100)/H.width,$=(1*this.height-this.height*this.padding*2/100)/H.height;Y=Math.min(le,$)}return Y},B.prototype.getTextPosition=function(H){var Y=this.textElement.getBBox(),le=0,$=0;return Y.width>0&&Y.height>0&&(le=(this.width-Y.width*H)/2,$=this.height/2-Y.height*H/2),{x:le,y:$}},B.prototype.sizeText=function(){var H=this.textElement.getBBox(),Y=this.getTextScale(),le=this.getTextPosition(Y);le.y-=H.y*Y,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+le.x+"px, "+le.y+"px) scale("+Y+", "+Y+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(le.x,le.y),this.textElement.transform.baseVal.getItem(1).setScale(Y,Y))},B.prototype.manipulate=function(H){J.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)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.isMoved=!0,this.setSize(),this.sizeText()},B.prototype.setSize=function(){J.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(we.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),we.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},B.prototype.pointerUp=function(H){var Y=this.state;Y==="creating"&&(this._suppressMarkerCreateEvent=!0),J.prototype.pointerUp.call(this,H),this.setSize(),(Y==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},B.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 le=Y.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(le)),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")},B.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}),le=this.textElement.getBBox(),$={x:le.width*H,y:le.height*H};Y.x-=$.x/2,Y.y-=$.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"}},B.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()},B.prototype.select=function(){J.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},B.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),J.prototype.deselect.call(this)},B.prototype.dblClick=function(H,Y){J.prototype.dblClick.call(this,H,Y),this.showTextEditor()},B.prototype.setColor=function(H){this.textElement&&we.setAttributes(this.textElement,[["fill",H]]),this.color=H,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(H)},B.prototype.setFont=function(H){this.textElement&&we.setAttributes(this.textElement,[["font-family",H]]),this.fontFamily=H,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},B.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},B.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.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(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize(),this.sizeText(),this.positionTextEditor()},B.typeName="TextMarker",B.title="Text marker",B.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',B}(ye),Ce=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=le.defaultColor,$.lineWidth=le.defaultStrokeWidth,$.pixelRatio=le.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new ve("Color",le.defaultColorSet,le.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new Pe("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.drawingImage)},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.drawingImage=we.createImage(),this.visual.appendChild(this.drawingImage);var H=we.createTransform();this.visual.transform.baseVal.appendItem(H),this.addMarkerVisualToContainer(this.visual)},B.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):J.prototype.pointerDown.call(this,H,Y)},B.prototype.manipulate=function(H){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(H.x,H.y),this.canvasContext.stroke()):J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),we.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),we.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(H){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):J.prototype.pointerUp.call(this,H)},B.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)},B.prototype.select=function(){this.state==="creating"&&this.finishCreation(),J.prototype.select.call(this)},B.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),J.prototype.deselect.call(this)},B.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],le=Y[0],$=Y[1],Be=Y[2],nt=Y[3],ft=!1,St=0;St<this.canvasElement.height;St++)for(var st=0;st<this.canvasElement.width;st++)H.data[St*this.canvasElement.width*4+4*st+3]>0&&(ft=!0,St<$&&($=St),st<le&&(le=st),St>nt&&(nt=St),st>Be&&(Be=st));if(ft){this.left=le/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Be-le)/this.pixelRatio,this.height=(nt-$)/this.pixelRatio;var Rt=document.createElement("canvas");Rt.width=Be-le,Rt.height=nt-$,Rt.getContext("2d").putImageData(this.canvasContext.getImageData(le,$,Be-le,nt-$),0,0),this.drawingImgUrl=Rt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},B.prototype.setDrawingImage=function(){we.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),we.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},B.prototype.setColor=function(H){this.color=H,this.colorChanged(H)},B.prototype.setLineWidth=function(H){this.lineWidth=H},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({drawingImgUrl:this.drawingImgUrl},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){this.createVisual(),J.prototype.restoreState.call(this,H),this.drawingImgUrl=H.drawingImgUrl,this.setDrawingImage()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setDrawingImage()},B.typeName="FreehandMarker",B.title="Freehand marker",B.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',B}(ye),_e=function(J){function B(H,Y,le){var $=J.call(this,H,le||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return $.typeBoxes=[],$.currentType=Y,$.setCurrentType=$.setCurrentType.bind($),$}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2";for(var le=function(nt){var ft="both";switch(nt){case 0:ft="both";break;case 1:ft="start";break;case 2:ft="end";break;case 3:ft="none"}var St=document.createElement("div");if(St.style.display="flex",St.style.flexGrow="2",St.style.alignItems="center",St.style.justifyContent="space-between",St.style.padding="5px",St.style.borderWidth="2px",St.style.borderStyle="solid",St.style.borderColor=ft===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",St.addEventListener("click",function(){H.setCurrentType(ft,St)}),Y.appendChild(St),ft==="both"||ft==="start"){var st=document.createElement("div");st.style.display="flex",st.style.alignItems="center",st.style.minHeight="20px",st.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,st.style.marginLeft="5px",St.appendChild(st)}var Rt=document.createElement("div");Rt.style.display="flex",Rt.style.alignItems="center",Rt.style.minHeight="20px",Rt.style.flexGrow="2";var zt=document.createElement("hr");if(zt.style.minWidth="20px",zt.style.border="0px",zt.style.borderTop="3px solid "+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee"),zt.style.flexGrow="2",Rt.appendChild(zt),St.appendChild(Rt),ft==="both"||ft==="end"){var ii=document.createElement("div");ii.style.display="flex",ii.style.alignItems="center",ii.style.minHeight="20px",ii.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ii.style.marginRight="5px",St.appendChild(ii)}$.typeBoxes.push(St)},$=this,Be=0;Be<4;Be++)le(Be);return Y},B.prototype.setCurrentType=function(H,Y){var le=this;this.currentType=H,this.typeBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},B}(pe),Ee=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new _e("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.arrow1&&H!==this.arrow2)},B.prototype.getArrowPoints=function(H,Y){var le=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return H-le/2+","+(Y+$/2)+" "+H+","+(Y-$/2)+" "+(H+le/2)+","+(Y+$/2)},B.prototype.createTips=function(){this.arrow1=we.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=we.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.arrow2)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(J.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",we.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),we.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 le=this.arrow2.transform.baseVal.getItem(0);le.setRotate(H+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(le,0)}},B.prototype.setArrowType=function(H){this.arrowType=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({arrowType:this.arrowType},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.arrowType=Y.arrowType,this.createTips(),this.adjustVisual()},B.typeName="ArrowMarker",B.title="Arrow marker",B.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',B}(ce),ee=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor=le.defaultFillColor,$.strokeWidth=0,$.fillPanel=new ve("Color",le.defaultColorSet,le.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return Oe(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="CoverMarker",B.title="Cover marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',B}(se),oe=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Be.opacities=[],Be.opacityBoxes=[],Be.opacities=Y,Be.currentOpacity=le,Be.setCurrentOpacity=Be.setCurrentOpacity.bind(Be),Be}return Oe(B,J),B.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(le){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=le===H.currentOpacity?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentOpacity(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.innerText=100*le+"%",$.appendChild(Be),H.opacityBoxes.push($)}),Y},B.prototype.setCurrentOpacity=function(H,Y){var le=this;this.currentOpacity=H,this.opacityBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},B}(pe),q=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=le.defaultHighlightColor,$.strokeWidth=0,$.opacity=le.defaultHighlightOpacity,$.fillPanel=new ve("Color",le.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new oe("Opacity",le.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Oe(B,J),B.prototype.setOpacity=function(H){this.opacity=H,this.visual&&we.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="HighlightMarker",B.title="Highlight marker",B.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',B}(ee),me='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ie=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=le.defaultStrokeColor,$.bgColor=le.defaultFillColor,$.fontFamily=le.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new ve("Text color",le.defaultColorSet,$.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new ve("Fill color",le.defaultColorSet,$.bgColor,me),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new Me("Font",le.defaultFontFamilies,le.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new Le,$.tipGrip.visual.transform.baseVal.appendItem(we.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return Oe(B,J),B.prototype.ownsTarget=function(H){return J.prototype.ownsTarget.call(this,H)||this.tipGrip.ownsTarget(H)||this.tip===H},B.prototype.createTip=function(){we.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=we.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},B.prototype.pointerDown=function(H,Y){this.state==="new"&&J.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):J.prototype.pointerDown.call(this,H,Y)},B.prototype.pointerUp=function(H){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,J.prototype.pointerUp.call(this,H);else{var Y=this.state==="creating";J.prototype.pointerUp.call(this,H),this.setTipPoints(Y),this.positionTip()}},B.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 J.prototype.manipulate.call(this,H)},B.prototype.setBgColor=function(H){this.bgRectangle&&this.tip&&(we.setAttributes(this.bgRectangle,[["fill",H]]),we.setAttributes(this.tip,[["fill",H]])),this.bgColor=H,this.fillColorChanged(H)},B.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},B.prototype.setTipPoints=function(H){H===void 0&&(H=!1);var Y=Math.min(this.height/2,15),le=this.height/5;H&&(this.tipPosition={x:Y+le/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:0},this.tipBase2Position={x:Y+le,y:0}):(this.tipBase1Position={x:0,y:Y},this.tipBase2Position={x:0,y:Y+le}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-le,y:0},this.tipBase2Position={x:this.width-Y,y:0}):(this.tipBase1Position={x:this.width,y:Y},this.tipBase2Position={x:this.width,y:Y+le}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?$<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-le,y:this.height},this.tipBase2Position={x:this.width-Y,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Y-le},this.tipBase2Position={x:this.width,y:this.height-Y}):$<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:this.height},this.tipBase2Position={x:Y+le,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Y},this.tipBase2Position={x:0,y:this.height-Y-le})},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.positionTip()},B.prototype.positionTip=function(){we.setAttributes(this.tip,[["points",this.getTipPoints()]]);var H=this.tipGrip.visual.transform.baseVal.getItem(0);H.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(H,0)},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),B.prototype.select=function(){this.positionTip(),J.prototype.select.call(this)},B.prototype.getState=function(){var H=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){var Y=H;this.bgColor=Y.bgColor,this.tipPosition=Y.tipPosition,J.prototype.restoreState.call(this,H),this.createTip(),this.setTipPoints()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.tipPosition={x:this.tipPosition.x*H,y:this.tipPosition.y*Y},this.positionTip()},B.typeName="CalloutMarker",B.title="Callout marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',B}(Fe),V=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.fillColor=le.defaultFillColor,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.setOpacity=$.setOpacity.bind($),$.createVisual=$.createVisual.bind($),$.strokePanel=new ve("Line color",Te(le.defaultColorSet,["transparent"]),le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.fillPanel=new ve("Fill color",Te(le.defaultColorSet,["transparent"]),$.fillColor,me),$.fillPanel.onColorChanged=$.setFillColor,$.strokeWidthPanel=new Pe("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ze("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$.opacityPanel=new oe("Opacity",le.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual)},B.prototype.createVisual=function(){this.visual=we.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.setSize()},B.prototype.setSize=function(){J.prototype.setSize.call(this),we.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},B.prototype.pointerUp=function(H){J.prototype.pointerUp.call(this,H),this.setSize()},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&we.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},B.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&we.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(H),this.stateChanged()},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&we.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&we.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.setOpacity=function(H){this.opacity=H,this.visual&&we.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.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(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize()},B.typeName="EllipseMarker",B.title="Ellipse marker",B.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',B}(ye),Re=function(J){function B(H,Y,le){return J.call(this,H,Y,le)||this}return Oe(B,J),Object.defineProperty(B.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.tip1&&H!==this.tip2)},B.prototype.createTips=function(){this.tip1=we.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.tip1),this.tip2=we.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.tip2)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(we.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),we.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var 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 le=this.tip2.transform.baseVal.getItem(0);le.setRotate(H+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(le,0)}},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H),this.createTips(),this.adjustVisual()},B.typeName="MeasurementMarker",B.title="Measurement marker",B.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',B}(ce),He=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokePanel.colors=le.defaultColorSet,$.fillColor="transparent",$}return Oe(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="EllipseFrameMarker",B.title="Ellipse frame marker",B.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',B}(V),fe=function(){function J(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),J.prototype.addUndoStep=function(B){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(B)||(this.undoStack.push(B),JSON.stringify(this.lastRedoStep)!==JSON.stringify(B)&&this.redoStack.splice(0,this.redoStack.length))},J.prototype.replaceLastUndoStep=function(B){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=B)},J.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},J.prototype.undo=function(){if(this.undoStack.length>1){var B=this.undoStack.pop();return B!==void 0&&this.redoStack.push(B),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},J.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},J}(),ke=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ve("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Pe("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ze("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorCurve&&H!==this.visibleCurve&&!this.curveGrip.ownsTarget(H))},B.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.selectorCurve=we.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=we.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)},B.prototype.pointerDown=function(H,Y){J.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")},B.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),we.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),we.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),we.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setupControlBox=function(){J.prototype.setupControlBox.call(this),this.curveControlLine1=we.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=we.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)},B.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,J.prototype.addControlGrips.call(this)},B.prototype.positionGrips=function(){J.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()))},B.prototype.manipulate=function(H){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+H.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+H.y-this.manipulationStartY),J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){this.activeGrip===this.curveGrip&&(this.curveX=H.x,this.curveY=H.y),J.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)},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual()},B.prototype.scale=function(H,Y){this.curveX=this.curveX*H,this.curveY=this.curveY*Y,J.prototype.scale.call(this,H,Y)},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.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()},B.typeName="CurveMarker",B.title="Curve marker",B.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',B}(ht),Xe=function(){function J(B,H){H===void 0&&(H=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=B,this.cancelable=H}return Object.defineProperty(J.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),J.prototype.preventDefault=function(){this._defaultPrevented=!0},J}(),ot=function(J){function B(H,Y,le){var $=J.call(this,H,!1)||this;return $.dataUrl=Y,$.state=le,$}return Oe(B,J),B}(Xe),tt=function(J){function B(H,Y,le){le===void 0&&(le=!1);var $=J.call(this,H,le)||this;return $.marker=Y,$}return Oe(B,J),B}(Xe),at=function(){function J(){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 J.prototype.addEventListener=function(B,H){this[B].push(H)},J.prototype.removeEventListener=function(B,H){var Y=this[B].indexOf(H);Y>-1&&this[B].splice(Y,1)},J}(),pt=function(){function J(B){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ge,this._isOpen=!1,this.undoRedoManager=new fe,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 at,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=J.instanceCounter++,this.styles=new Ve(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=B,this.targetRoot=document.body,this.width=B.clientWidth,this.height=B.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(J.prototype,"ALL_MARKER_TYPES",{get:function(){return[et,Ce,Ee,Fe,He,V,q,Ie,Re,ee,ce,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,Ce,Ee,Fe,V,q,Ie]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,Ce,Ee,Fe,q]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(B){var H=this;this._availableMarkerTypes.splice(0),B.forEach(function(Y){if(typeof Y=="string"){var le=H.ALL_MARKER_TYPES.find(function($){return $.typeName===Y});le!==void 0&&H._availableMarkerTypes.push(le)}else H._availableMarkerTypes.push(Y)})},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(B){this._zoomLevel=B,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ue.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},J.prototype.show=function(){var B=this;this.styles.styleSheetRoot===void 0&&ge.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ge.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(H){return H(new Xe(B))})},J.prototype.render=function(){return Ke(this,void 0,void 0,function(){var B;return We(this,function(H){switch(H.label){case 0:return this.setCurrentMarker(),(B=new Ae).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.markersOnly=this.renderMarkersOnly,B.width=this.renderWidth,B.height=this.renderHeight,[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return H.sent(),[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,H.sent()]}})})},J.prototype.close=function(B){var H=this;if(B===void 0&&(B=!1),this.isOpen){var Y=!1;B||this.eventListeners.beforeclose.forEach(function(le){var $=new Xe(H,!0);le($),$.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(le){return le(new Xe(H))}),this.detachEvents(),this._isOpen=!1)}},J.prototype.addMarkersToToolbar=function(){for(var B,H=[],Y=0;Y<arguments.length;Y++)H[Y]=arguments[Y];(B=this._availableMarkerTypes).push.apply(B,H)},J.prototype.addRenderEventListener=function(B){this.addEventListener("render",function(H){B(H.dataUrl,H.state)})},J.prototype.removeRenderEventListener=function(B){},J.prototype.addCloseEventListener=function(B){this.addEventListener("close",function(){B()})},J.prototype.removeCloseEventListener=function(B){},J.prototype.setupResizeObserver=function(){var B=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){B.resize(B.target.clientWidth,B.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return B.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupTargetResize=function(){var B=1*this.target.clientWidth/this.target.clientHeight,H=this.editorCanvas.clientWidth/B>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*B:this.editorCanvas.clientWidth,Y=H<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/B;this.resize(H,Y)},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.prototype.resize=function(B,H){this._isResizing=!0;var Y=B/this.imageWidth,le=H/this.imageHeight;this.imageWidth=Math.round(B),this.imageHeight=Math.round(H),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Y,le),this._isResizing=!1},J.prototype.scaleMarkers=function(B,H){var Y,le=this;this._currentMarker&&this._currentMarker instanceof Fe?this._currentMarker.scale(B,H):(Y=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function($){$!==le._currentMarker&&$.scale(B,H)}),Y!==void 0&&this.setCurrentMarker(Y)},J.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},J.prototype.setTopLeft=function(){var B=this.editingTarget.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=B.left-H.left,this.top=B.top-H.top},J.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},J.prototype.addDefs=function(){for(var B,H=[],Y=0;Y<arguments.length;Y++)H[Y]=arguments[Y];this.defs=we.createDefs(),this.addDefsToImage(),(B=this.defs).append.apply(B,H)},J.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},J.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},J.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},J.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},J.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},J.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},J.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},J.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var B=document.createElement("a");B.href="https://markerjs.com/",B.target="_blank",B.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',B.title="Powered by marker.js",B.style.display="grid",B.style.alignItems="center",B.style.justifyItems="center",B.style.padding="3px",B.style.width="20px",B.style.height="20px",this.logoUI.appendChild(B),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},J.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")},J.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"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.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 B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"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 qe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},J.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.removeMarker=function(B){this.markerImage.removeChild(B.container),this.markers.indexOf(B)>-1&&this.markers.splice(this.markers.indexOf(B),1),B.dispose()},J.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())},J.prototype.toolbarButtonClicked=function(B,H){if(B==="marker"&&H!==void 0)this.createNewMarker(H);else if(B==="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()}},J.prototype.deleteSelectedMarker=function(){var B=this;if(this._currentMarker!==void 0){var H=!1;if(this.eventListeners.markerbeforedelete.forEach(function(le){var $=new tt(B,B._currentMarker,!0);le($),$.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(le){return le(new tt(B,Y))})}}},J.prototype.clear=function(){var B=this,H=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Be){var nt=new tt(B,void 0,!0);Be(nt),nt.defaultPrevented&&(H=!0)}),!H)){this.setCurrentMarker();for(var Y=function(Be){var nt=le.markers[Be];le.setCurrentMarker(le.markers[Be]),le._currentMarker.dispose(),le.markerImage.removeChild(le._currentMarker.container),le.markers.splice(le.markers.indexOf(le._currentMarker),1),le.eventListeners.markerdelete.forEach(function(ft){return ft(new tt(B,nt))})},le=this,$=this.markers.length-1;$>=0;$--)Y($);this.addUndoStep()}},Object.defineProperty(J.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),J.prototype.showNotesEditor=function(){var B;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=(B=this._currentMarker.notes)!==null&&B!==void 0?B:"",this.overlayContainer.appendChild(this.notesArea))},J.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)},J.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},J.prototype.addUndoStep=function(){var B=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 le=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(H),le<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function($){return $(new Xe(B))})}else this.undoRedoManager.replaceLastUndoStep(H),this.eventListeners.statechange.forEach(function($){return $(new Xe(B))})}},J.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},J.prototype.undoStep=function(){var B=this,H=this.undoRedoManager.undo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Xe(B))}))},J.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},J.prototype.redoStep=function(){var B=this,H=this.undoRedoManager.redo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Xe(B))}))},J.prototype.stepZoom=function(){var B=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=B<this.zoomSteps.length-1?this.zoomSteps[B+1]:this.zoomSteps[0]},J.prototype.panTo=function(B){this.contentDiv.scrollBy({left:this.prevPanPoint.x-B.x,top:this.prevPanPoint.y-B.y}),this.prevPanPoint=B},J.prototype.startRenderAndClose=function(){return Ke(this,void 0,void 0,function(){var B,H,Y=this;return We(this,function(le){switch(le.label){case 0:return[4,this.render()];case 1:return B=le.sent(),H=this.getState(),this.eventListeners.render.forEach(function($){return $(new ot(Y,B,H))}),this.close(!0),[2]}})})},J.prototype.getState=function(B){B===!0&&this.setCurrentMarker();var H={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Y){return H.markers.push(Y.getState())}),H},J.prototype.restoreState=function(B){var H=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);B.markers.forEach(function(Y){var le=H._availableMarkerTypes.find(function(Be){return Be.typeName===Y.typeName});if(le!==void 0){var $=H.addNewMarker(le);$.restoreState(Y),H.markers.push($)}}),B.width&&B.height&&(B.width!==this.imageWidth||B.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/B.width,this.imageHeight/B.height),this.eventListeners.restorestate.forEach(function(Y){return Y(new Xe(H))})},J.prototype.addNewMarker=function(B){var H=we.createGroup();return this.markerImage.appendChild(H),new B(H,this.overlayContainer,this.settings)},J.prototype.createNewMarker=function(B){var H,Y=this;(H=typeof B=="string"?this._availableMarkerTypes.find(function(le){return le.typeName===B}):B)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(H),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(H.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(le){return le(new tt(Y,Y._currentMarker))}))},J.prototype.markerCreated=function(B){var H=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(B),this.setCurrentMarker(B),B instanceof Ce&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ce):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Y){return Y(new tt(H,H._currentMarker))})},J.prototype.colorChanged=function(B){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=B,this.settings.defaultStrokeColor=B)},J.prototype.fillColorChanged=function(B){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=B)},J.prototype.markerStateChanged=function(B){var H=this;this.eventListeners.markerchange.forEach(function(Y){return Y(new tt(H,B))})},J.prototype.setCurrentMarker=function(B){var H=this;this._currentMarker!==B&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Y){return Y(new tt(H,H._currentMarker))})),this._currentMarker=B,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Y){return Y(new tt(H,H._currentMarker))}))},J.prototype.onPointerDown=function(B){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||B.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var H=this.markers.find(function(Y){return Y.ownsTarget(B.target)});H!==void 0?(this.setCurrentMarker(H),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(B.clientX,B.clientY),B.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:B.clientX,y:B.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(B.clientX,B.clientY))},J.prototype.onDblClick=function(B){if(this._isFocused||this.focus(),this.mode==="select"){var H=this.markers.find(function(Y){return Y.ownsTarget(B.target)});H!==void 0&&H!==this._currentMarker&&this.setCurrentMarker(H),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(B.clientX,B.clientY),B.target):this.setCurrentMarker()}},J.prototype.onPointerMove=function(B){this.touchPoints!==1&&B.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||B.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(B.clientX,B.clientY)):this.zoomLevel>1&&this.panTo({x:B.clientX,y:B.clientY}))},J.prototype.onPointerUp=function(B){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(B.clientX,B.clientY)),this.isDragging=!1,this.addUndoStep()},J.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},J.prototype.onKeyUp=function(B){this._currentMarker===void 0||this.notesArea!==void 0||B.key!=="Delete"&&B.key!=="Backspace"||this.deleteSelectedMarker()},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.markerImage.getBoundingClientRect();return{x:(B-Y.left)/this.zoomLevel,y:(H-Y.top)/this.zoomLevel}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"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()},J.prototype.addLicenseKey=function(B){ue.addKey(B)},J.prototype.addEventListener=function(B,H){this.eventListeners.addEventListener(B,H)},J.prototype.removeEventListener=function(B,H){this.eventListeners.removeEventListener(B,H)},J.prototype.renderState=function(B){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(B),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(J.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),J.prototype.focus=function(){var B=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(B))}))},J.prototype.blur=function(){var B=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(H){return H(new Xe(B))}))},J.instanceCounter=0,J}();/* **********************************
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(J,B){return(Ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(H[le]=Y[le])})(J,B)};function bt(J,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");function H(){this.constructor=J}Ct(J,B),J.prototype=B===null?Object.create(B):(H.prototype=B.prototype,new H)}function dt(J,B,H,Y){return new(H||(H=Promise))(function(le,$){function Be(St){try{ft(Y.next(St))}catch(st){$(st)}}function nt(St){try{ft(Y.throw(St))}catch(st){$(st)}}function ft(St){var st;St.done?le(St.value):(st=St.value,st instanceof H?st:new H(function(Rt){Rt(st)})).then(Be,nt)}ft((Y=Y.apply(J,B||[])).next())})}function kt(J,B){var H,Y,le,$,Be={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return $={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function nt(ft){return function(St){return function(st){if(H)throw new TypeError("Generator is already executing.");for(;Be;)try{if(H=1,Y&&(le=2&st[0]?Y.return:st[0]?Y.throw||((le=Y.return)&&le.call(Y),0):Y.next)&&!(le=le.call(Y,st[1])).done)return le;switch(Y=0,le&&(st=[2&st[0],le.value]),st[0]){case 0:case 1:le=st;break;case 4:return Be.label++,{value:st[1],done:!1};case 5:Be.label++,Y=st[1],st=[0];continue;case 7:st=Be.ops.pop(),Be.trys.pop();continue;default:if(!(le=Be.trys,(le=le.length>0&&le[le.length-1])||st[0]!==6&&st[0]!==2)){Be=0;continue}if(st[0]===3&&(!le||st[1]>le[0]&&st[1]<le[3])){Be.label=st[1];break}if(st[0]===6&&Be.label<le[1]){Be.label=le[1],le=st;break}if(le&&Be.label<le[2]){Be.label=le[2],Be.ops.push(st);break}le[2]&&Be.ops.pop(),Be.trys.pop();continue}st=B.call(J,Be)}catch(Rt){st=[6,Rt],Y=0}finally{H=le=0}if(5&st[0])throw st[1];return{value:st[0]?st[1]:void 0,done:!0}}([ft,St])}}}var Ft=function(){function J(){}return J.addKey=function(B){J.key=B},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),mt=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(B,H){for(var Y=0,le=H;Y<le.length;Y++){var $=le[Y],Be=$[0],nt=$[1];B.setAttribute(Be,nt)}},J.createRect=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","rect");return le.setAttribute("width",B.toString()),le.setAttribute("height",H.toString()),Y&&J.setAttributes(le,Y),le},J.createLine=function(B,H,Y,le,$){var Be=document.createElementNS("http://www.w3.org/2000/svg","line");return Be.setAttribute("x1",B.toString()),Be.setAttribute("y1",H.toString()),Be.setAttribute("x2",Y.toString()),Be.setAttribute("y2",le.toString()),$&&J.setAttributes(Be,$),Be},J.createPolygon=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",B),H&&J.setAttributes(Y,H),Y},J.createCircle=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(B/2).toString()),Y.setAttribute("cy",(B/2).toString()),Y.setAttribute("r",B.toString()),H&&J.setAttributes(Y,H),Y},J.createEllipse=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return le.setAttribute("cx",(B/2).toString()),le.setAttribute("cy",(H/2).toString()),le.setAttribute("rx",(B/2).toString()),le.setAttribute("ry",(H/2).toString()),Y&&J.setAttributes(le,Y),le},J.createGroup=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return B&&J.setAttributes(H,B),H},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(B,H,Y,le,$,Be,nt){var ft=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(ft,[["id",B],["orient",H],["markerWidth",Y.toString()],["markerHeight",le.toString()],["refX",$.toString()],["refY",Be.toString()]]),ft.appendChild(nt),ft},J.createText=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),B&&J.setAttributes(H,B),H},J.createTSpan=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=B,H&&J.setAttributes(Y,H),Y},J.createImage=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return B&&J.setAttributes(H,B),H},J.createPoint=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=B,Y.y=H,Y},J.createPath=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",B),H&&J.setAttributes(Y,H),Y},J.createElement=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg",B);return H&&J.setAttributes(Y,H),Y},J.getHollowRectanglePath=function(B,H,Y,le,$,Be,nt,ft){return"M"+B+","+H+"V"+(H+le)+"H"+(B+Y)+"V"+H+"H"+$+"V"+Be+"H"+($+nt)+"V"+(Be+ft)+"H"+$+"V"+H+"Z"},J}(),$t=function(){function J(B){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+B+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(B){return this.styleSheet===void 0&&this.addStyleSheet(),B.name=""+this.classNamePrefix+B.localName,this.classes.push(B),this.styleSheet.sheet.insertRule("."+B.name+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length),B},J.prototype.addRule=function(B){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(B),this.styleSheet.sheet.insertRule(B.selector+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var B;this.styleSheet=document.createElement("style"),((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).appendChild(this.styleSheet),this.addRule(new wt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new wt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new wt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new _t("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new _t("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},J.prototype.removeStyleSheet=function(){var B;this.styleSheet&&(((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),wt=function(J,B){this.selector=J,this.style=B},_t=function(J,B){this.localName=J,this.style=B},Ot=function(){function J(){this.blocks=[],this.display=""}return J.prototype.addButtonBlock=function(B){B.className=this.blockClassName,B.buttonClassName=this.buttonClassName,B.buttonColorsClassName=this.buttonColorsClassName,B.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(B)},J.prototype.addElementBlock=function(B){B.className===void 0&&(B.className=this.blockClassName),this.blocks.push(B)},J.prototype.getUI=function(){var B=document.createElement("div");return B.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,B.style.display=this.display,this.blocks.forEach(function(H){return B.appendChild(H.getUI())}),B},J}(),Nt=function(){function J(){}return J.prototype.getUI=function(){var B=document.createElement("div");if(B.className=this.className,this.minWidth!==void 0&&(B.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":B.style.justifyContent="flex-start";break;case"center":B.style.justifyContent="center";break;case"end":B.style.justifyContent="flex-end"}return B.style.whiteSpace="nowrap",B},J}(),qt=function(J){function B(){var H=J!==null&&J.apply(this,arguments)||this;return H.buttons=[],H}return bt(B,J),B.prototype.addButton=function(H){H.className=this.buttonClassName,H.colorsClassName=this.buttonColorsClassName,H.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(H)},B.prototype.getUI=function(){var H=J.prototype.getUI.call(this);return this.buttons.forEach(function(Y){return H.appendChild(Y.getUI())}),H},B}(Nt),Pt=function(){function J(B,H){this._isActive=!1,this._isHidden=!1,this._icon=B,this.title=H,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(J.prototype,"icon",{get:function(){return this._icon},set:function(B){this._icon=B,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isActive",{get:function(){return this._isActive},set:function(B){this._isActive=B,this.adjustClassName()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){var B=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return B.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},J.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},J.prototype.hide=function(){this._isHidden=!0},J}(),xt=function(J){function B(){var H=J!==null&&J.apply(this,arguments)||this;return H.elements=[],H}return bt(B,J),B.prototype.addElement=function(H){this.elements.push(H)},B.prototype.getUI=function(){var H=J.prototype.getUI.call(this);return this.elements.forEach(function(Y){return H.appendChild(Y)}),H},B}(Nt),Ki=function(){function J(B,H){this.horizontal=B,this.vertical=H}return Object.defineProperty(J.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),J.prototype.getVerticalLength=function(B){return B/this.ratio},J.prototype.getHorizontalLength=function(B){return B*this.ratio},J}(),Jt=function(){function J(){}return J.getIcon=function(B,H){if(B>0&&H>0){var Y=new Ki(B,H),le=Y.ratio>=1?20:Y.getHorizontalLength(20),$=Y.ratio<1?20:Y.getVerticalLength(20),Be=document.createElementNS("http://www.w3.org/2000/svg","svg");Be.setAttribute("xmlns","http://www.w3.org/2000/svg"),Be.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Be);var nt=mt.createDefs();Be.appendChild(nt);var ft=mt.createElement("clipPath",[["id","text-bg-clip"]]);nt.appendChild(ft);var St=mt.createPath(mt.getHollowRectanglePath((24-le)/2,(24-$)/2,le,$,(24-le)/2+2,(24-$)/2+2,le-4,$-4));Be.appendChild(St);var st=mt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);st.appendChild(mt.createTSpan(B+":"+H)),Be.appendChild(st);var Rt=st.getBBox();mt.setAttributes(st,[["x",((24-Rt.width)/2).toString()],["y",((24-Rt.height)/2-Rt.y).toString()]]);var zt=mt.createPath(mt.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 ft.appendChild(zt),mt.setAttributes(St,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Be),Be.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},J}(),ri=function(J){function B(H,Y,le){var $=J.call(this,H,Y)||this;return $.isDropdownOpen=!1,$.onClick=$.dropdownButtonClicked,$.dropdownButtons=le,$}return bt(B,J),B.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)},B.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},B.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},B.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},B.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},B.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},B}(Pt),Ut=function(){function J(B,H){this.GRIP_SIZE=10,this.color=B,this.fillColor=H,this.visual=mt.createGroup(),this.visual.appendChild(mt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(mt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},J.prototype.setCenter=function(B,H){this.visual.childNodes.forEach(function(Y){return mt.setAttributes(Y,[["cx",B.toString()],["cy",H.toString()]])})},J}(),di=function(){function J(B,H,Y,le){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=B,this.canvasHeight=H,this.margin=Y,this.container=le,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(J.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(B){this._aspectRatio=B,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.gridContainer&&mt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(B){this._zoomFactor=B,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),J.prototype.open=function(){var B=this;this.cropShadeElement=mt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=mt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var H=0;H<this.numberOfGridLines;H++)this.horizontalGridLines.push(mt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(mt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(Y){return B.gridContainer.appendChild(Y)}),this.verticalGridLines.forEach(function(Y){return B.gridContainer.appendChild(Y)}),this.cropRectElement=mt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},J.prototype.setCropRectangle=function(B){this.cropRect=B;var H=Object.assign({},this.cropRect);this.zoomFactor!==1&&(H.width=this.cropRect.width*this.zoomFactor,H.height=this.cropRect.height*this.zoomFactor,H.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-H.width/2,H.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-H.height/2),mt.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($,Be){var nt=H.y+Y*(Be+1);mt.setAttributes($,[["x1",""+H.x],["y1",""+nt],["x2",""+(H.x+H.width)],["y2",""+nt]])});var le=H.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function($,Be){var nt=H.x+le*(Be+1);mt.setAttributes($,[["x1",""+nt],["y1",""+H.y],["x2",""+nt],["y2",""+(H.y+H.height)]])}),mt.setAttributes(this.cropShadeElement,[["d",mt.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},J.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)},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.container.getBoundingClientRect();return{x:B-Y.left+this.margin,y:H-Y.top+this.margin}},J.prototype.onPointerDown=function(B){this.container.setPointerCapture(B.pointerId),this.previousPoint=this.clientToLocalCoordinates(B.clientX,B.clientY),this.cropRectElement===B.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(B.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(B.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(B.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(B.target)&&(this.activeGrip=this.bottomRightGrip)},J.prototype.onPointerMove=function(B){if(this.isMoving)this.move(this.clientToLocalCoordinates(B.clientX,B.clientY));else if(this.activeGrip){var H=this.clientToLocalCoordinates(B.clientX,B.clientY);this.resize(H)}B.preventDefault()},J.prototype.onPointerUp=function(B){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(B.pointerId)},J.prototype.move=function(B){var H=B.x-this.previousPoint.x,Y=B.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=B},J.prototype.resize=function(B){var H=Object.assign({},this.cropRect),Y=B.x-this.previousPoint.x,le=B.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:H.x+Y<this.margin&&(Y=this.margin-H.x),H.x+=Y,H.width=this.cropRect.x+this.cropRect.width-H.x;break;case this.bottomRightGrip:case this.topRightGrip:H.width+Y>this.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+=le,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+=le}H.width<10&&(H.x=this.cropRect.x,H.width=10),H.height<10&&(H.y=this.cropRect.y,H.height=10),this.previousPoint=B,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))},J.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var B=this.cropRect.x+this.cropRect.width/2,H=this.cropRect.y+this.cropRect.height/2,Y=this.aspectRatio.getHorizontalLength(this.cropRect.height),le=this.aspectRatio.getVerticalLength(this.cropRect.width);Y/this.canvasWidth<le/this.canvasHeight?this.cropRect.width=Y:this.cropRect.height=le,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=B-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)}},J.prototype.getRescaledRect=function(B,H,Y,le,$,Be){var nt=Y/B,ft=le/H;return{x:($.x-Be)*nt+Be,y:($.y-Be)*ft+Be,width:$.width*nt,height:$.height*ft}},J.prototype.scaleCanvas=function(B,H){var Y=this.getRescaledRect(this.canvasWidth,this.canvasHeight,B,H,this.cropRect,this.margin);this.canvasWidth=B,this.canvasHeight=H,this.onCropChange&&this.onCropChange(Y),this.setCropRectangle(Y)},J}(),Ii=function(){function J(B){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=B,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(J.prototype,"angle",{get:function(){return this._angle},set:function(B){this._angle=B,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),J.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},J.prototype.onPointerDown=function(B){this.controlContainer.setPointerCapture(B.pointerId),this.isDragging=!0,this.previousPoint={x:B.clientX,y:B.clientY}},J.prototype.onPointerMove=function(B){this.isDragging&&(this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.previousPoint.x=B.clientX)},J.prototype.onPointerUp=function(B){this.isDragging&&this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(B.pointerId)},J.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var B=this.angleLabelText.getBBox();mt.setAttributes(this.angleLabelElement,[["x",((this.width-B.width)/2).toString()],["y",(this.height/2).toString()]])}},J.prototype.positionScaleShape=function(){if(this.scaleShape){var B=this.scaleShape.transform.baseVal.getItem(0);B.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(B,0)}},J.prototype.getVisual=function(){var B=document.createElementNS("http://www.w3.org/2000/svg","svg");B.setAttribute("xmlns","http://www.w3.org/2000/svg"),B.setAttribute("width",this.width+"px"),B.setAttribute("height",this.height+"px"),B.setAttribute("viewBox","0 0 "+this.width+" "+this.height),B.style.flexShrink="0",document.body.appendChild(B);for(var H="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Y=1;Y<=this.width/5+10;Y++){var le=Y%5==0?this.height/3:this.height/6;H+="h4v"+-le+"h1v"+le}H+="v1H0Z",this.scaleShape=mt.createPath(H);var $=mt.createTransform();this.scaleShape.transform.baseVal.appendItem($),B.appendChild(this.scaleShape),this.angleLabelElement=mt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=mt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Be=mt.createTSpan("");return Be.innerHTML="&deg;",this.angleLabelElement.appendChild(Be),B.appendChild(this.angleLabelElement),document.body.removeChild(B),B},J}(),Yi=function(){function J(){this.naturalSize=!1,this.imageType="image/png"}return J.prototype.rasterize=function(B,H,Y,le,$,Be,nt){var ft=this;return new Promise(function(St){var st=document.createElement("canvas");st.width=B.width.baseVal.value-2*le,st.height=B.height.baseVal.value-2*le;var Rt=1,zt=1;ft.naturalSize===!0?(Rt=H.naturalWidth/(B.width.baseVal.value-2*le)/Be,zt=H.naturalHeight/(B.height.baseVal.value-2*le)/nt,st.width=H.naturalWidth/Be,st.height=H.naturalHeight/nt):ft.width!==void 0&&ft.height!==void 0&&(Rt=ft.width/Y.width,zt=ft.height/Y.height,st.width*=Rt,st.height*=zt);var ii=st.getContext("2d");ii.translate(st.width/2,st.height/2),ii.rotate($*Math.PI/180),ii.scale(Be,nt),ii.translate(-st.width/2,-st.height/2),ii.drawImage(H,0,0,st.width,st.height);var Hi=document.createElement("canvas");Hi.width=Y.width*Rt,Hi.height=Y.height*zt,Hi.getContext("2d").putImageData(ii.getImageData((Y.x-le)*Rt,(Y.y-le)*zt,Y.width*Rt,Y.height*zt),0,0),St(Hi.toDataURL(ft.imageType,ft.imageQuality))})},J}(),ut=function(){function J(B){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=J.instanceCounter++,this.styles=new $t(this.instanceNo),this.target=B,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(B){this._zoomToCropEnabled=B,B?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"gridLines",{get:function(){return this._gridLines},set:function(B){this._gridLines=B,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(B){this._rotationAngle=B,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"aspectRatio",{get:function(){var B;return(B=this._aspectRatio)!==null&&B!==void 0?B:this.aspectRatios[0]},set:function(B){this._aspectRatio=B},enumerable:!1,configurable:!0}),J.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},J.prototype.show=function(){this.showUI(),this.open()},J.prototype.close=function(B){B===void 0&&(B=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),B||this.closeEventListeners.forEach(function(H){return H()}),this._isOpen=!1)},J.prototype.addRenderEventListener=function(B){this.renderEventListeners.push(B)},J.prototype.removeRenderEventListener=function(B){this.renderEventListeners.indexOf(B)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(B),1)},J.prototype.addCloseEventListener=function(B){this.closeEventListeners.push(B)},J.prototype.removeCloseEventListener=function(B){this.closeEventListeners.indexOf(B)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(B),1)},J.prototype.setupResizeObserver=function(){var B=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){B.resize(B.target.clientWidth,B.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))},J.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var B=1*this.target.clientWidth/this.target.clientHeight,H=this.contentDiv.clientWidth/B>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*B:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Y=H+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/B;this.resize(H,Y)}},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",mt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},J.prototype.resize=function(B,H){this.imageWidth=Math.round(B),this.imageHeight=Math.round(H),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},J.prototype.setEditingTarget=function(){var B=document.createElement("canvas");B.width=this.target.naturalWidth,B.height=this.target.naturalHeight,B.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var H=B.toDataURL();mt.setAttributes(this.editingTarget,[["href",H]]),this.setEditingTargetSize()},J.prototype.setTopLeft=function(){var B=this.target.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=B.left-H.left-this.CANVAS_MARGIN,this.top=B.top-H.top-this.CANVAS_MARGIN},J.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=mt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=mt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=mt.createGroup(),this.editingTargetRotationScaleContainer=mt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var B=mt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(B);var H=mt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(H),this.editingTargetContainer=mt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},J.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},J.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=mt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new di(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},J.prototype.zoomToCrop=function(){if(this.cropRect){var B=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,H=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=B+"px "+H+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-B+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-H+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},J.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},J.prototype.cropRectChanged=function(B){this.cropRect=B,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},J.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},J.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"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var B=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,H=this.target.offsetTop>B+this.CANVAS_MARGIN?this.target.offsetTop-(B+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},J.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},J.prototype.addTopToolbar=function(){var B=this;this.topToolbar=new Ot,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 qt;H.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(H);var Y=[];this.aspectRatios.forEach(function(zt){var ii=new Pt(Jt.getIcon(zt.horizontal,zt.vertical),zt.horizontal===0&&zt.vertical===0?"FREE":zt.horizontal+":"+zt.vertical);ii.onClick=function(){return B.ratioButtonClicked(zt)},Y.push(ii)}),this.aspectRatioButton=new ri(Jt.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 le=new Pt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");le.isActive=this.isGridVisible,le.onClick=function(){B.isGridVisible=!B.isGridVisible,le.isActive=B.isGridVisible},H.addButton(le);var $=new Pt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if($.isActive=this.zoomToCropEnabled,$.onClick=function(){B.zoomToCropEnabled=!B.zoomToCropEnabled,$.isActive=B.zoomToCropEnabled},H.addButton($),!Ft.isLicensed){var Be=new xt;this.topToolbar.addElementBlock(Be);var nt=document.createElement("div");nt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ft=document.createElement("a");ft.style.color="currentColor",ft.href="https://markerjs.com/products/cropro",ft.target="_blank",ft.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',nt.appendChild(ft),Be.addElement(nt)}var St=new qt;St.minWidth=3*this.toolbarHeight+"px",St.contentAlign="end",this.topToolbar.addButtonBlock(St);var st=new Pt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");st.onClick=this.startRenderAndClose,St.addButton(st),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(st.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Rt=new Pt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Rt.onClick=this.close,St.addButton(Rt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Rt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},J.prototype.addBottomToolbar=function(){var B=this;this.bottomToolbar=new Ot,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 qt;H.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(H);var Y=new Pt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");Y.onClick=this.rotateLeftButtonClicked,H.addButton(Y);var le=new Pt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");le.onClick=this.rotateRightButtonClicked,H.addButton(le);var $=new xt;$.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock($),this.straightener=new Ii("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(St){B.rotateBy(St),B.straightener.angle=B.rotationAngle},$.addElement(this.straightener.getUI());var Be=new qt;Be.minWidth=2*this.toolbarHeight+"px",Be.contentAlign="end",this.bottomToolbar.addButtonBlock(Be);var nt=new Pt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");nt.onClick=this.flipHorizontallyButtonClicked,Be.addButton(nt);var ft=new Pt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");ft.onClick=this.flipVerticallyButtonClicked,Be.addButton(ft)},J.prototype.ratioButtonClicked=function(B){this.aspectRatio=B,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},J.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Jt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},J.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ki(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},J.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},J.prototype.restoreState=function(B){if(B){var H=this.cropLayer.getRescaledRect(B.width,B.height,this.imageWidth,this.imageHeight,B.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(H),this.cropRectChanged(H),this.flippedHorizontally=B.flippedHorizontally,this.flippedVertically=B.flippedVertically,this.applyFlip(),this.rotationAngle=B.rotationAngle,this.applyRotation()}},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.cropImage.getBoundingClientRect();return{x:B-Y.left,y:H-Y.top}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var B=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=B+"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()},J.prototype.rotateLeftButtonClicked=function(){var B=this.rotationAngle-90;this.rotationAngle%90!=0&&(B+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(B)},J.prototype.rotateRightButtonClicked=function(){var B=this.rotationAngle+90;this.rotationAngle%90!=0&&(B-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(B)},J.prototype.rotateTo=function(B){B=(B=B>180?B-360:B)<=-180?B+360:B,this.rotationAngle=B,this.applyRotation()},J.prototype.rotateBy=function(B){this.rotateTo((this.rotationAngle+B)%360)},J.prototype.applyRotation=function(){var B=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=B},J.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},J.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},J.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},J.prototype.startRenderAndClose=function(){return dt(this,void 0,void 0,function(){var B,H;return kt(this,function(Y){switch(Y.label){case 0:return[4,this.render()];case 1:return B=Y.sent(),H=this.getState(),this.renderEventListeners.forEach(function(le){return le(B,H)}),this.close(!0),[2]}})})},J.prototype.render=function(){return dt(this,void 0,void 0,function(){var B;return kt(this,function(H){switch(H.label){case 0:return(B=new Yi).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.width=this.renderWidth,B.height=this.renderHeight,this.unzoomFromCrop(),mt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,B.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,B.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()]}})})},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new _t("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 _t("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new _t("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var B=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new _t("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*B)+`px;
height: `+(this.toolbarHeight-2*B)+`px;
padding: `+B+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new _t("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new _t("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new wt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new wt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new _t("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 _t("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new _t("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 _t("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*B)+`px;
padding: `+B+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new _t("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},J.instanceCounter=0,J}(),Dt=Q("8hTe"),pr=Q.n(Dt),mr=/<pre[^>]*>/g;function gr(J){var B=document.createElement("div");return B.innerHTML=J,B.childNodes.length===0?"":B.childNodes[0].nodeValue}var vr=re.a=function(J){var B=J.value,H=B===void 0?"":B,Y=J.edit,le=Y===void 0?!1:Y,$=J.className,Be=J.showTextOnly,nt=J.showLines,ft=J.replaces,St=J.zoomImg,st=J.hasMask,Rt=J.style,zt=Rt===void 0?{}:Rt,ii=J.stylesPrev,Hi=ii===void 0?{}:ii,Si=String(H),Ti=Object(c.useRef)(),qi=Object(c.useRef)(),kr=Object(c.useState)(""),mi=Object(E.a)(kr,2),zi=mi[0],lr=mi[1],ur=Object(c.useState)("office"),ji=Object(E.a)(ur,2),Ir=ji[0],_r=ji[1],Xr=function(){var Gt=new ut(qi.current);Gt.displayMode="popup",Gt.addRenderEventListener(function(){var xi=Object(p.a)(i.a.mark(function Ht(ui){var Qt;return i.a.wrap(function(gi){for(;;)switch(gi.prev=gi.next){case 0:return Ti.current.style.display="none",gi.next=3,Object(je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ui}});case 3:Qt=gi.sent,Qt!=null&&Qt.id&&ft(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 gi.stop()}},Ht)}));return function(Ht){return xi.apply(this,arguments)}}()),Gt.show()},zr=function(){var Gt=new pt(qi.current);Gt.settings.displayMode="popup",Gt.addEventListener("render",function(){var xi=Object(p.a)(i.a.mark(function Ht(ui){var Qt;return i.a.wrap(function(gi){for(;;)switch(gi.prev=gi.next){case 0:if(Ti.current.style.display="none",!qi.current){gi.next=6;break}return gi.next=4,Object(je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ui.dataUrl}});case 4:Qt=gi.sent,Qt!=null&&Qt.id&&ft(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 gi.stop()}},Ht)}));return function(Ht){return xi.apply(this,arguments)}}()),Gt.show(),window.markerArea=Gt},$i=Object(c.useMemo)(function(){Ti.current&&(Ti.current.style.zIndex=-1);try{var oi=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Gt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Si=Si.replace(oi,"("+te.a.API_SERVER+"/api/attachments/").replace(Gt,'"'+te.a.API_SERVER+"/api/attachments/").replace(xi,'"'+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(rr){}var Ht=K(Si),ui=F();if(Si.match(/\[TOC\]/)&&(Ht=Ht.replace("<p>[TOC]</p>",C()),v()),Ht=Ht.replace(/(__special_katext_id_\d+__)/g,function(rr,gi){var Li=ui[gi],Gr=Li.type,xr=Li.expression;return Object(de.renderToString)(gr(xr)||"",{displayMode:Gr==="block",throwOnError:!1,output:"html"})}),Ht=Ht.replace(/▁/g,"\u2581\u2581\u2581"),P(),Be){var Qt=document.createElement("div");return Qt.innerHTML=Ht,Qt.innerText}return setTimeout(function(){return cn()},500),Ht},[Si]),Qi=Object(c.useRef)();m.WebkitLineClamp=nt,nt&&(zt=Object(M.a)(Object(M.a)({},zt),m));function yr(oi){var Gt=oi.target;if(Gt.tagName.toUpperCase()==="IMG"){if(St){var xi=Gt.getAttribute("src");lr(xi),_r("image")}}else if(Gt.tagName.toUpperCase()==="A"){var Ht=Gt.getAttribute("href");if(Ht.indexOf("office")>-1)oi.preventDefault(),lr(Ht),_r("office");else if(Ht.indexOf("application/pdf")>-1)oi.preventDefault(),lr(Ht),_r("pdf");else if(Ht.indexOf("text/html")>-1)oi.preventDefault(),lr(Ht),_r("html");else if(Ht.startsWith("#")){oi.preventDefault();var ui=document.getElementById(Ht.replace("#",""));ui&&ui.scrollIntoView(!0)}}}var cn=function(){var Gt,xi=(Gt=Qi.current)===null||Gt===void 0?void 0:Gt.querySelectorAll("video");xi==null||xi.forEach(function(Ht){if(Ht.oncontextmenu=function(){return!1},Ht.src.indexOf(".m3u8")>-1&&!Ht.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var ui=new z.a;ui.loadSource(Ht.src),ui.attachMedia(Ht)}}})};Object(c.useEffect)(function(){if(Qi.current&&$i&&($i.match(mr)&&window.PR.prettyPrint()),Qi.current)return Qi.current.addEventListener("click",yr),function(){Qi.current.removeEventListener("click",yr),P(),v()}},[$i,Qi.current,yr]);var br=function(Gt){if(!le)return;Gt.target.nodeName==="IMG"?(Ti.current.style.zIndex=1,Ti.current.style.display="flex",Ti.current.style.width=Gt.target.clientWidth+"px",Ti.current.style.height=Gt.target.clientHeight+"px",Ti.current.style.top=Gt.target.offsetTop+"px",Ti.current.style.left=Gt.target.offsetLeft+"px",qi.current.src=Gt.target.getAttribute("src")):Ti.current.style.display="none"};return o.a.createElement("div",{style:{position:"relative"}},o.a.createElement("div",{ref:Qi,style:Object(M.a)({},zt),className:"".concat($||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:br,dangerouslySetInnerHTML:{__html:$i}}),o.a.createElement("div",{ref:Ti,className:pr.a.button},o.a.createElement(R.a,null,o.a.createElement(L.a,{onClick:function(){return Xr()}},"\u88C1\u526A"),o.a.createElement(L.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:zi,type:zi!=null&&zi.length?Ir:"",style:Object(M.a)({},Hi),onClose:function(){return lr("")}}))}},"9VGf":function(it,re,Q){"use strict";Q.d(re,"a",function(){return I});var G=Q("q1tI"),R=Q.n(G);function I(L,M){var p=Object(G.useRef)();Object(G.useEffect)(function(){p.current=L}),Object(G.useEffect)(function(){function E(){p.current()}if(M!==null){var b=setInterval(E,M);return function(){return clearInterval(b)}}},[M])}},BU3w:function(it,re,Q){"use strict";Q.d(re,"a",function(){return p});var G=Q("MNnm"),R="rc-util-key";function I(E){if(E.attachTo)return E.attachTo;var b=document.querySelector("head");return b||document.body}function L(E){var b,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(G.a)())return null;var c=document.createElement("style");if((b=i.csp)===null||b===void 0?void 0:b.nonce){var o;c.nonce=(o=i.csp)===null||o===void 0?void 0:o.nonce}c.innerHTML=E;var h=I(i),n=h.firstChild;return i.prepend&&h.prepend?h.prepend(c):i.prepend&&n?h.insertBefore(c,n):h.appendChild(c),c}var M=new Map;function p(E,b){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=I(i);if(!M.has(c)){var o=L("",i),h=o.parentNode;M.set(c,h),h.removeChild(o)}var n=Array.from(M.get(c).children).find(function(u){return u.tagName==="STYLE"&&u[R]===b});if(n){var a,t;if(((a=i.csp)===null||a===void 0?void 0:a.nonce)&&n.nonce!==((t=i.csp)===null||t===void 0?void 0:t.nonce)){var r;n.nonce=(r=i.csp)===null||r===void 0?void 0:r.nonce}return n.innerHTML!==E&&(n.innerHTML=E),n}var s=L(E,i);return s[R]=b,s}},Bd2K:function(it,re,Q){(function(G){G(Q("VrN/"),Q("osHv"))})(function(G){G.defineOption("autoCloseTags",!1,function(i,c,o){if(o!=G.Init&&o&&i.removeKeyMap("autoCloseTags"),!c)return;var h={name:"autoCloseTags"};(typeof c!="object"||c.whenClosing!==!1)&&(h["'/'"]=function(n){return p(n)}),(typeof c!="object"||c.whenOpening!==!1)&&(h["'>'"]=function(n){return L(n)}),i.addKeyMap(h)});var R=["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 L(i){if(i.getOption("disableInput"))return G.Pass;for(var c=i.listSelections(),o=[],h=i.getOption("autoCloseTags"),n=0;n<c.length;n++){if(!c[n].empty())return G.Pass;var a=c[n].head,t=i.getTokenAt(a),r=G.innerMode(i.getMode(),t.state),s=r.state,u=r.mode.xmlCurrentTag&&r.mode.xmlCurrentTag(s),f=u&&u.name;if(!f)return G.Pass;var d=r.mode.configuration=="html",v=typeof h=="object"&&h.dontCloseTags||d&&R,m=typeof h=="object"&&h.indentTags||d&&I;t.end>a.ch&&(f=f.slice(0,f.length-t.end+a.ch));var S=f.toLowerCase();if(!f||t.type=="string"&&(t.end!=a.ch||!/[\"\']/.test(t.string.charAt(t.string.length-1))||t.string.length==1)||t.type=="tag"&&u.close||t.string.indexOf("/")==a.ch-t.start-1||v&&E(v,S)>-1||b(i,r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(s)||[],f,a,!0))return G.Pass;var C=typeof h=="object"&&h.emptyTags;if(C&&E(C,f)>-1){o[n]={text:"/>",newPos:G.Pos(a.line,a.ch+2)};continue}var _=m&&E(m,S)>-1;o[n]={indent:_,text:">"+(_?`
`:"")+"</"+f+">",newPos:_?G.Pos(a.line+1,0):G.Pos(a.line,a.ch+1)}}for(var y=typeof h=="object"&&h.dontIndentOnAutoClose,n=c.length-1;n>=0;n--){var T=o[n];i.replaceRange(T.text,c[n].head,c[n].anchor,"+insert");var k=i.listSelections().slice(0);k[n]={head:T.newPos,anchor:T.newPos},i.setSelections(k),!y&&T.indent&&(i.indentLine(T.newPos.line,null,!0),i.indentLine(T.newPos.line+1,null,!0))}}function M(i,c){for(var o=i.listSelections(),h=[],n=c?"/":"</",a=i.getOption("autoCloseTags"),t=typeof a=="object"&&a.dontIndentOnSlash,r=0;r<o.length;r++){if(!o[r].empty())return G.Pass;var s=o[r].head,u=i.getTokenAt(s),f=G.innerMode(i.getMode(),u.state),d=f.state;if(c&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=s.ch-1))return G.Pass;var v,m=f.mode.name!="xml"&&i.getMode().name=="htmlmixed";if(m&&f.mode.name=="javascript")v=n+"script";else if(m&&f.mode.name=="css")v=n+"style";else{var S=f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(d);if(!S||S.length&&b(i,S,S[S.length-1],s))return G.Pass;v=n+S[S.length-1]}i.getLine(s.line).charAt(u.end)!=">"&&(v+=">"),h[r]=v}if(i.replaceSelections(h),o=i.listSelections(),!t)for(var r=0;r<o.length;r++)(r==o.length-1||o[r].head.line<o[r+1].head.line)&&i.indentLine(o[r].head.line)}function p(i){return i.getOption("disableInput")?G.Pass:M(i,!0)}G.commands.closeTag=function(i){return M(i)};function E(i,c){if(i.indexOf)return i.indexOf(c);for(var o=0,h=i.length;o<h;++o)if(i[o]==c)return o;return-1}function b(i,c,o,h,n){if(!G.scanForClosingTag)return!1;var a=Math.min(i.lastLine()+1,h.line+500),t=G.scanForClosingTag(i,h,null,a);if(!t||t.tag!=o)return!1;for(var r=n?1:0,s=c.length-1;s>=0&&c[s]==o;s--)++r;h=t.to;for(var s=1;s<r;s++){var u=G.scanForClosingTag(i,h,null,a);if(!u||u.tag!=o)return!1;h=u.to}return!0}})},BjJ7:function(it,re,Q){"use strict";Q.d(re,"d",function(){return R}),Q.d(re,"c",function(){return I}),Q.d(re,"e",function(){return L}),Q.d(re,"b",function(){return M}),Q.d(re,"a",function(){return E});var G=Q("m3rI");function R(b){var i=!0;if(b.length>0){for(var c=0;c<b.length;c++)if(b[c].compile_success==0||!b[c].compile_success){i=!1;break}}else i=!1;return i}function I(b){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",c=[],o=0;o<b.length;o++){var h=b[o],n=i?"".concat(i,"/").concat(h.name):"".concat(h.name);c.push({title:h.name,isLeaf:!(h.type==="tree"),key:n})}return c}function L(b,i,c){for(var o=0;o<b.length;o++){var h=b[o];if(h.key===i){h.children=c;break}h.children&&L(h.children,i,c)}return b}function M(b,i,c){var o;return function(){var h=this,n=arguments,a=function(){o=null,c||b.apply(h,n)},t=c&&!o;clearTimeout(o),o=setTimeout(a,i),t&&b.apply(h,n)}}var p=!0,E=G.a.API_SERVER},"C+DQ":function(it,re,Q){},"C/vA":function(it,re,Q){"use strict";Q.d(re,"a",function(){return G});function G(R){const I=this;let L=!1,M;return function(){return L||(L=!0,M=R.apply(I,arguments)),M}}},"Cg/j":function(it,re,Q){"use strict";Q.d(re,"b",function(){return G}),Q.d(re,"a",function(){return R}),Q.d(re,"c",function(){return L}),Q.d(re,"d",function(){return M});var G;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function E(b){return b[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=E})(G||(G={}));const R=L("instantiationService");function I(p,E,b,i){E[G.DI_TARGET]===E?E[G.DI_DEPENDENCIES].push({id:p,index:b,optional:i}):(E[G.DI_DEPENDENCIES]=[{id:p,index:b,optional:i}],E[G.DI_TARGET]=E)}function L(p){if(G.serviceIds.has(p))return G.serviceIds.get(p);const E=function(b,i,c){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I(E,b,c,!1)};return E.toString=()=>p,G.serviceIds.set(p,E),E}function M(p){return function(E,b,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");I(p,E,i,!0)}}},DlQD:function(it,re,Q){(function(G,R){it.exports=R()})(this,function(){"use strict";function G(Ce,_e){for(var Ee=0;Ee<_e.length;Ee++){var ee=_e[Ee];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(Ce,ee.key,ee)}}function R(Ce,_e,Ee){return _e&&G(Ce.prototype,_e),Ee&&G(Ce,Ee),Ce}function I(Ce,_e){if(!Ce)return;if(typeof Ce=="string")return L(Ce,_e);var Ee=Object.prototype.toString.call(Ce).slice(8,-1);if(Ee==="Object"&&Ce.constructor&&(Ee=Ce.constructor.name),Ee==="Map"||Ee==="Set")return Array.from(Ce);if(Ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ee))return L(Ce,_e)}function L(Ce,_e){(_e==null||_e>Ce.length)&&(_e=Ce.length);for(var Ee=0,ee=new Array(_e);Ee<_e;Ee++)ee[Ee]=Ce[Ee];return ee}function M(Ce,_e){var Ee;if(typeof Symbol=="undefined"||Ce[Symbol.iterator]==null){if(Array.isArray(Ce)||(Ee=I(Ce))||_e&&Ce&&typeof Ce.length=="number"){Ee&&(Ce=Ee);var ee=0;return function(){return ee>=Ce.length?{done:!0}:{done:!1,value:Ce[ee++]}}}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 Ee=Ce[Symbol.iterator](),Ee.next.bind(Ee)}function p(Ce,_e){return _e={exports:{}},Ce(_e,_e.exports),_e.exports}var E=p(function(Ce){function _e(){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 Ee(ee){Ce.exports.defaults=ee}Ce.exports={defaults:_e(),getDefaults:_e,changeDefaults:Ee}}),b=E.defaults,i=E.getDefaults,c=E.changeDefaults,o=/[&<>"']/,h=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},r=function(_e){return t[_e]};function s(Ce,_e){if(_e){if(o.test(Ce))return Ce.replace(h,r)}else if(n.test(Ce))return Ce.replace(a,r);return Ce}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function f(Ce){return Ce.replace(u,function(_e,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var d=/(^|[^\[])\^/g;function v(Ce,_e){Ce=Ce.source||Ce,_e=_e||"";var Ee={replace:function(oe,q){return q=q.source||q,q=q.replace(d,"$1"),Ce=Ce.replace(oe,q),Ee},getRegex:function(){return new RegExp(Ce,_e)}};return Ee}var m=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(Ce,_e,Ee){if(Ce){var ee;try{ee=decodeURIComponent(f(Ee)).replace(m,"").toLowerCase()}catch(oe){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}_e&&!S.test(Ee)&&(Ee=g(_e,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(oe){return null}return Ee}var _={},y=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,k=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(Ce,_e){_[" "+Ce]||(y.test(Ce)?_[" "+Ce]=Ce+"/":_[" "+Ce]=W(Ce,"/",!0)),Ce=_[" "+Ce];var Ee=Ce.indexOf(":")===-1;return _e.substring(0,2)==="//"?Ee?_e:Ce.replace(T,"$1")+_e:_e.charAt(0)==="/"?Ee?_e:Ce.replace(k,"$1")+_e:Ce+_e}var F={exec:function(){}};function P(Ce){for(var _e=1,Ee,ee;_e<arguments.length;_e++){Ee=arguments[_e];for(ee in Ee)Object.prototype.hasOwnProperty.call(Ee,ee)&&(Ce[ee]=Ee[ee])}return Ce}function N(Ce,_e){var Ee=Ce.replace(/\|/g,function(q,me,Ie){for(var V=!1,Re=me;--Re>=0&&Ie[Re]==="\\";)V=!V;return V?"|":" |"}),ee=Ee.split(/ \|/),oe=0;if(ee.length>_e)ee.splice(_e);else for(;ee.length<_e;)ee.push("");for(;oe<ee.length;oe++)ee[oe]=ee[oe].trim().replace(/\\\|/g,"|");return ee}function W(Ce,_e,Ee){var ee=Ce.length;if(ee===0)return"";for(var oe=0;oe<ee;){var q=Ce.charAt(ee-oe-1);if(q===_e&&!Ee)oe++;else if(q!==_e&&Ee)oe++;else break}return Ce.substr(0,ee-oe)}function j(Ce,_e){if(Ce.indexOf(_e[1])===-1)return-1;for(var Ee=Ce.length,ee=0,oe=0;oe<Ee;oe++)if(Ce[oe]==="\\")oe++;else if(Ce[oe]===_e[0])ee++;else if(Ce[oe]===_e[1]&&(ee--,ee<0))return oe;return-1}function A(Ce){Ce&&Ce.sanitize&&!Ce.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var K={escape:s,unescape:f,edit:v,cleanUrl:C,resolveUrl:g,noopTest:F,merge:P,splitCells:N,rtrim:W,findClosingBracket:j,checkSanitizeDeprecation:A},U=E.defaults,O=K.rtrim,z=K.splitCells,te=K.escape,de=K.findClosingBracket;function be(Ce,_e,Ee){var ee=_e.href,oe=_e.title?te(_e.title):null,q=Ce[1].replace(/\\([\[\]])/g,"$1");return Ce[0].charAt(0)!=="!"?{type:"link",raw:Ee,href:ee,title:oe,text:q}:{type:"image",raw:Ee,href:ee,title:oe,text:te(q)}}function je(Ce,_e){var Ee=Ce.match(/^(\s+)(?:```)/);if(Ee===null)return _e;var ee=Ee[1];return _e.split(`
`).map(function(oe){var q=oe.match(/^\s+/);if(q===null)return oe;var me=q[0];return me.length>=ee.length?oe.slice(ee.length):oe}).join(`
`)}var Ne=function(){function Ce(Ee){this.options=Ee||U}var _e=Ce.prototype;return _e.space=function(ee){var oe=this.rules.block.newline.exec(ee);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},_e.code=function(ee,oe){var q=this.rules.block.code.exec(ee);if(q){var me=oe[oe.length-1];if(me&&me.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var Ie=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?Ie:O(Ie,`
`)}}},_e.fences=function(ee){var oe=this.rules.block.fences.exec(ee);if(oe){var q=oe[0],me=je(q,oe[3]||"");return{type:"code",raw:q,lang:oe[2]?oe[2].trim():oe[2],text:me}}},_e.heading=function(ee){var oe=this.rules.block.heading.exec(ee);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},_e.nptable=function(ee){var oe=this.rules.block.nptable.exec(ee);if(oe){var q={type:"table",header:z(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(q.header.length===q.align.length){var me=q.align.length,Ie;for(Ie=0;Ie<me;Ie++)/^ *-+: *$/.test(q.align[Ie])?q.align[Ie]="right":/^ *:-+: *$/.test(q.align[Ie])?q.align[Ie]="center":/^ *:-+ *$/.test(q.align[Ie])?q.align[Ie]="left":q.align[Ie]=null;for(me=q.cells.length,Ie=0;Ie<me;Ie++)q.cells[Ie]=z(q.cells[Ie],q.header.length);return q}}},_e.hr=function(ee){var oe=this.rules.block.hr.exec(ee);if(oe)return{type:"hr",raw:oe[0]}},_e.blockquote=function(ee){var oe=this.rules.block.blockquote.exec(ee);if(oe){var q=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:q}}},_e.list=function(ee){var oe=this.rules.block.list.exec(ee);if(oe){for(var q=oe[0],me=oe[2],Ie=me.length>1,V=me[me.length-1]===")",Re={type:"list",raw:q,ordered:Ie,start:Ie?+me.slice(0,-1):"",loose:!1,items:[]},He=oe[0].match(this.rules.block.item),fe=!1,ke,Xe,ot,tt,at,pt,Ct,bt=He.length,dt=0;dt<bt;dt++)ke=He[dt],q=ke,Xe=ke.length,ke=ke.replace(/^ *([*+-]|\d+[.)]) */,""),~ke.indexOf(`
`)&&(Xe-=ke.length,ke=this.options.pedantic?ke.replace(/^ {1,4}/gm,""):ke.replace(new RegExp("^ {1,"+Xe+"}","gm"),"")),dt!==bt-1&&(ot=this.rules.block.bullet.exec(He[dt+1])[0],(Ie?ot.length===1||!V&&ot[ot.length-1]===")":ot.length>1||this.options.smartLists&&ot!==me)&&(tt=He.slice(dt+1).join(`
`),Re.raw=Re.raw.substring(0,Re.raw.length-tt.length),dt=bt-1)),at=fe||/\n\n(?!\s*$)/.test(ke),dt!==bt-1&&(fe=ke.charAt(ke.length-1)===`
`,at||(at=fe)),at&&(Re.loose=!0),pt=/^\[[ xX]\] /.test(ke),Ct=void 0,pt&&(Ct=ke[1]!==" ",ke=ke.replace(/^\[[ xX]\] +/,"")),Re.items.push({type:"list_item",raw:q,task:pt,checked:Ct,loose:at,text:ke});return Re}},_e.html=function(ee){var oe=this.rules.block.html.exec(ee);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):te(oe[0]):oe[0]}},_e.def=function(ee){var oe=this.rules.block.def.exec(ee);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var q=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:oe[0],href:oe[2],title:oe[3]}}},_e.table=function(ee){var oe=this.rules.block.table.exec(ee);if(oe){var q={type:"table",header:z(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(q.header.length===q.align.length){q.raw=oe[0];var me=q.align.length,Ie;for(Ie=0;Ie<me;Ie++)/^ *-+: *$/.test(q.align[Ie])?q.align[Ie]="right":/^ *:-+: *$/.test(q.align[Ie])?q.align[Ie]="center":/^ *:-+ *$/.test(q.align[Ie])?q.align[Ie]="left":q.align[Ie]=null;for(me=q.cells.length,Ie=0;Ie<me;Ie++)q.cells[Ie]=z(q.cells[Ie].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},_e.lheading=function(ee){var oe=this.rules.block.lheading.exec(ee);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},_e.paragraph=function(ee){var oe=this.rules.block.paragraph.exec(ee);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
`?oe[1].slice(0,-1):oe[1]}},_e.text=function(ee,oe){var q=this.rules.block.text.exec(ee);if(q){var me=oe[oe.length-1];return me&&me.type==="text"?{raw:q[0],text:q[0]}:{type:"text",raw:q[0],text:q[0]}}},_e.escape=function(ee){var oe=this.rules.inline.escape.exec(ee);if(oe)return{type:"escape",raw:oe[0],text:te(oe[1])}},_e.tag=function(ee,oe,q){var me=this.rules.inline.tag.exec(ee);if(me)return!oe&&/^<a /i.test(me[0])?oe=!0:oe&&/^<\/a>/i.test(me[0])&&(oe=!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:oe,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]}},_e.link=function(ee){var oe=this.rules.inline.link.exec(ee);if(oe){var q=de(oe[2],"()");if(q>-1){var me=oe[0].indexOf("!")===0?5:4,Ie=me+oe[1].length+q;oe[2]=oe[2].substring(0,q),oe[0]=oe[0].substring(0,Ie).trim(),oe[3]=""}var V=oe[2],Re="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(V);He?(V=He[1],Re=He[3]):Re=""}else Re=oe[3]?oe[3].slice(1,-1):"";V=V.trim().replace(/^<([\s\S]*)>$/,"$1");var fe=be(oe,{href:V&&V.replace(this.rules.inline._escapes,"$1"),title:Re&&Re.replace(this.rules.inline._escapes,"$1")},oe[0]);return fe}},_e.reflink=function(ee,oe){var q;if((q=this.rules.inline.reflink.exec(ee))||(q=this.rules.inline.nolink.exec(ee))){var me=(q[2]||q[1]).replace(/\s+/g," ");if(me=oe[me.toLowerCase()],!me||!me.href){var Ie=q[0].charAt(0);return{type:"text",raw:Ie,text:Ie}}var V=be(q,me,q[0]);return V}},_e.strong=function(ee,oe,q){q===void 0&&(q="");var me=this.rules.inline.strong.start.exec(ee);if(me&&(!me[1]||me[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){oe=oe.slice(-1*ee.length);var Ie=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ie.lastIndex=0;for(var V;(me=Ie.exec(oe))!=null;)if(V=this.rules.inline.strong.middle.exec(oe.slice(0,me.index+3)),V)return{type:"strong",raw:ee.slice(0,V[0].length),text:ee.slice(2,V[0].length-2)}}},_e.em=function(ee,oe,q){q===void 0&&(q="");var me=this.rules.inline.em.start.exec(ee);if(me&&(!me[1]||me[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){oe=oe.slice(-1*ee.length);var Ie=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ie.lastIndex=0;for(var V;(me=Ie.exec(oe))!=null;)if(V=this.rules.inline.em.middle.exec(oe.slice(0,me.index+2)),V)return{type:"em",raw:ee.slice(0,V[0].length),text:ee.slice(1,V[0].length-1)}}},_e.codespan=function(ee){var oe=this.rules.inline.code.exec(ee);if(oe){var q=oe[2].replace(/\n/g," "),me=/[^ ]/.test(q),Ie=q.startsWith(" ")&&q.endsWith(" ");return me&&Ie&&(q=q.substring(1,q.length-1)),q=te(q,!0),{type:"codespan",raw:oe[0],text:q}}},_e.br=function(ee){var oe=this.rules.inline.br.exec(ee);if(oe)return{type:"br",raw:oe[0]}},_e.del=function(ee){var oe=this.rules.inline.del.exec(ee);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},_e.autolink=function(ee,oe){var q=this.rules.inline.autolink.exec(ee);if(q){var me,Ie;return q[2]==="@"?(me=te(this.options.mangle?oe(q[1]):q[1]),Ie="mailto:"+me):(me=te(q[1]),Ie=me),{type:"link",raw:q[0],text:me,href:Ie,tokens:[{type:"text",raw:me,text:me}]}}},_e.url=function(ee,oe){var q;if(q=this.rules.inline.url.exec(ee)){var me,Ie;if(q[2]==="@")me=te(this.options.mangle?oe(q[0]):q[0]),Ie="mailto:"+me;else{var V;do V=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(V!==q[0]);me=te(q[0]),q[1]==="www."?Ie="http://"+me:Ie=me}return{type:"link",raw:q[0],text:me,href:Ie,tokens:[{type:"text",raw:me,text:me}]}}},_e.inlineText=function(ee,oe,q){var me=this.rules.inline.text.exec(ee);if(me){var Ie;return oe?Ie=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]:Ie=te(this.options.smartypants?q(me[0]):me[0]),{type:"text",raw:me[0],text:Ie}}},Ce}(),Oe=K.noopTest,Ke=K.edit,We=K.merge,Te={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Te.def=Ke(Te.def).replace("label",Te._label).replace("title",Te._title).getRegex(),Te.bullet=/(?:[*+-]|\d{1,9}[.)])/,Te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Te.item=Ke(Te.item,"gm").replace(/bull/g,Te.bullet).getRegex(),Te.list=Ke(Te.list).replace(/bull/g,Te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Te.def.source+")").getRegex(),Te._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Te._comment=/<!--(?!-?>)[\s\S]*?-->/,Te.html=Ke(Te.html,"i").replace("comment",Te._comment).replace("tag",Te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Te.paragraph=Ke(Te._paragraph).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Te._tag).getRegex(),Te.blockquote=Ke(Te.blockquote).replace("paragraph",Te.paragraph).getRegex(),Te.normal=We({},Te),Te.gfm=We({},Te.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Te.gfm.nptable=Ke(Te.gfm.nptable).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Te._tag).getRegex(),Te.gfm.table=Ke(Te.gfm.table).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Te._tag).getRegex(),Te.pedantic=We({},Te.normal,{html:Ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Te._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Oe,paragraph:Ke(Te.normal._paragraph).replace("hr",Te.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var we={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};we._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",we.punctuation=Ke(we.punctuation).replace(/punctuation/g,we._punctuation).getRegex(),we._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",we._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",we.em.start=Ke(we.em.start).replace(/punctuation/g,we._punctuation).getRegex(),we.em.middle=Ke(we.em.middle).replace(/punctuation/g,we._punctuation).replace(/overlapSkip/g,we._overlapSkip).getRegex(),we.em.endAst=Ke(we.em.endAst,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.em.endUnd=Ke(we.em.endUnd,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.strong.start=Ke(we.strong.start).replace(/punctuation/g,we._punctuation).getRegex(),we.strong.middle=Ke(we.strong.middle).replace(/punctuation/g,we._punctuation).replace(/blockSkip/g,we._blockSkip).getRegex(),we.strong.endAst=Ke(we.strong.endAst,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.strong.endUnd=Ke(we.strong.endUnd,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.blockSkip=Ke(we._blockSkip,"g").getRegex(),we.overlapSkip=Ke(we._overlapSkip,"g").getRegex(),we._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,we._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,we._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])?)+(?![-_])/,we.autolink=Ke(we.autolink).replace("scheme",we._scheme).replace("email",we._email).getRegex(),we._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,we.tag=Ke(we.tag).replace("comment",Te._comment).replace("attribute",we._attribute).getRegex(),we._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,we._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,we._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,we.link=Ke(we.link).replace("label",we._label).replace("href",we._href).replace("title",we._title).getRegex(),we.reflink=Ke(we.reflink).replace("label",we._label).getRegex(),we.reflinkSearch=Ke(we.reflinkSearch,"g").replace("reflink",we.reflink).replace("nolink",we.nolink).getRegex(),we.normal=We({},we),we.pedantic=We({},we.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:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",we._label).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",we._label).getRegex()}),we.gfm=We({},we.normal,{escape:Ke(we.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),we.gfm.url=Ke(we.gfm.url,"i").replace("email",we.gfm._extended_email).getRegex(),we.breaks=We({},we.gfm,{br:Ke(we.br).replace("{2,}","*").getRegex(),text:Ke(we.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ue={block:Te,inline:we},Ae=E.defaults,ge=ue.block,Ve=ue.inline;function Qe(Ce){return Ce.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ze(Ce){var _e="",Ee,ee,oe=Ce.length;for(Ee=0;Ee<oe;Ee++)ee=Ce.charCodeAt(Ee),Math.random()>.5&&(ee="x"+ee.toString(16)),_e+="&#"+ee+";";return _e}var qe=function(){function Ce(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||Ae,this.options.tokenizer=this.options.tokenizer||new Ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:ge.normal,inline:Ve.normal};this.options.pedantic?(ee.block=ge.pedantic,ee.inline=Ve.pedantic):this.options.gfm&&(ee.block=ge.gfm,this.options.breaks?ee.inline=Ve.breaks:ee.inline=Ve.gfm),this.tokenizer.rules=ee}Ce.lex=function(ee,oe){var q=new Ce(oe);return q.lex(ee)};var _e=Ce.prototype;return _e.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},_e.blockTokens=function(ee,oe,q){oe===void 0&&(oe=[]),q===void 0&&(q=!0),ee=ee.replace(/^ +$/gm,"");for(var me,Ie,V,Re;ee;){if(me=this.tokenizer.space(ee)){ee=ee.substring(me.raw.length),me.type&&oe.push(me);continue}if(me=this.tokenizer.code(ee,oe)){ee=ee.substring(me.raw.length),me.type?oe.push(me):(Re=oe[oe.length-1],Re.raw+=`
`+me.raw,Re.text+=`
`+me.text);continue}if(me=this.tokenizer.fences(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.heading(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.nptable(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.hr(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.blockquote(ee)){ee=ee.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],q),oe.push(me);continue}if(me=this.tokenizer.list(ee)){for(ee=ee.substring(me.raw.length),V=me.items.length,Ie=0;Ie<V;Ie++)me.items[Ie].tokens=this.blockTokens(me.items[Ie].text,[],!1);oe.push(me);continue}if(me=this.tokenizer.html(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(q&&(me=this.tokenizer.def(ee))){ee=ee.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.lheading(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(q&&(me=this.tokenizer.paragraph(ee))){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.text(ee,oe)){ee=ee.substring(me.raw.length),me.type?oe.push(me):(Re=oe[oe.length-1],Re.raw+=`
`+me.raw,Re.text+=`
`+me.text);continue}if(ee){var He="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(He);break}else throw new Error(He)}}return oe},_e.inline=function(ee){var oe,q,me,Ie,V,Re,He=ee.length;for(oe=0;oe<He;oe++){Re=ee[oe];switch(Re.type){case"paragraph":case"text":case"heading":{Re.tokens=[],this.inlineTokens(Re.text,Re.tokens);break}case"table":{for(Re.tokens={header:[],cells:[]},Ie=Re.header.length,q=0;q<Ie;q++)Re.tokens.header[q]=[],this.inlineTokens(Re.header[q],Re.tokens.header[q]);for(Ie=Re.cells.length,q=0;q<Ie;q++)for(V=Re.cells[q],Re.tokens.cells[q]=[],me=0;me<V.length;me++)Re.tokens.cells[q][me]=[],this.inlineTokens(V[me],Re.tokens.cells[q][me]);break}case"blockquote":{this.inline(Re.tokens);break}case"list":{for(Ie=Re.items.length,q=0;q<Ie;q++)this.inline(Re.items[q].tokens);break}}}return ee},_e.inlineTokens=function(ee,oe,q,me,Ie){oe===void 0&&(oe=[]),q===void 0&&(q=!1),me===void 0&&(me=!1),Ie===void 0&&(Ie="");var V,Re=ee,He;if(this.tokens.links){var fe=Object.keys(this.tokens.links);if(fe.length>0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(Re))!=null;)fe.includes(He[0].slice(He[0].lastIndexOf("[")+1,-1))&&(Re=Re.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(He=this.tokenizer.rules.inline.blockSkip.exec(Re))!=null;)Re=Re.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(V=this.tokenizer.escape(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.tag(ee,q,me)){ee=ee.substring(V.raw.length),q=V.inLink,me=V.inRawBlock,oe.push(V);continue}if(V=this.tokenizer.link(ee)){ee=ee.substring(V.raw.length),V.type==="link"&&(V.tokens=this.inlineTokens(V.text,[],!0,me)),oe.push(V);continue}if(V=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(V.raw.length),V.type==="link"&&(V.tokens=this.inlineTokens(V.text,[],!0,me)),oe.push(V);continue}if(V=this.tokenizer.strong(ee,Re,Ie)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],q,me),oe.push(V);continue}if(V=this.tokenizer.em(ee,Re,Ie)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],q,me),oe.push(V);continue}if(V=this.tokenizer.codespan(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.br(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.del(ee)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],q,me),oe.push(V);continue}if(V=this.tokenizer.autolink(ee,ze)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(!q&&(V=this.tokenizer.url(ee,ze))){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.inlineText(ee,me,Qe)){ee=ee.substring(V.raw.length),Ie=V.raw.slice(-1),oe.push(V);continue}if(ee){var ke="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(ke);break}else throw new Error(ke)}}return oe},R(Ce,null,[{key:"rules",get:function(){return{block:ge,inline:Ve}}}]),Ce}(),Je=E.defaults,pe=K.cleanUrl,ve=K.escape,xe=function(){function Ce(Ee){this.options=Ee||Je}var _e=Ce.prototype;return _e.code=function(ee,oe,q){var me=(oe||"").match(/\S*/)[0];if(this.options.highlight){var Ie=this.options.highlight(ee,me);Ie!=null&&Ie!==ee&&(q=!0,ee=Ie)}return me?'<pre><code class="'+this.options.langPrefix+ve(me,!0)+'">'+(q?ee:ve(ee,!0))+`</code></pre>
`:"<pre><code>"+(q?ee:ve(ee,!0))+`</code></pre>
`},_e.blockquote=function(ee){return`<blockquote>
`+ee+`</blockquote>
`},_e.html=function(ee){return ee},_e.heading=function(ee,oe,q,me){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+me.slug(q)+'">'+ee+"</h"+oe+`>
`:"<h"+oe+">"+ee+"</h"+oe+`>
`},_e.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},_e.list=function(ee,oe,q){var me=oe?"ol":"ul",Ie=oe&&q!==1?' start="'+q+'"':"";return"<"+me+Ie+`>
`+ee+"</"+me+`>
`},_e.listitem=function(ee){return"<li>"+ee+`</li>
`},_e.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},_e.paragraph=function(ee){return"<p>"+ee+`</p>
`},_e.table=function(ee,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
<thead>
`+ee+`</thead>
`+oe+`</table>
`},_e.tablerow=function(ee){return`<tr>
`+ee+`</tr>
`},_e.tablecell=function(ee,oe){var q=oe.header?"th":"td",me=oe.align?"<"+q+' align="'+oe.align+'">':"<"+q+">";return me+ee+"</"+q+`>
`},_e.strong=function(ee){return"<strong>"+ee+"</strong>"},_e.em=function(ee){return"<em>"+ee+"</em>"},_e.codespan=function(ee){return"<code>"+ee+"</code>"},_e.br=function(){return this.options.xhtml?"<br/>":"<br>"},_e.del=function(ee){return"<del>"+ee+"</del>"},_e.link=function(ee,oe,q){if(ee=pe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return q;var me='<a href="'+ve(ee)+'"';return oe&&(me+=' title="'+oe+'"'),me+=">"+q+"</a>",me},_e.image=function(ee,oe,q){if(ee=pe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return q;var me='<img src="'+ee+'" alt="'+q+'"';return oe&&(me+=' title="'+oe+'"'),me+=this.options.xhtml?"/>":">",me},_e.text=function(ee){return ee},Ce}(),Se=function(){function Ce(){}var _e=Ce.prototype;return _e.strong=function(ee){return ee},_e.em=function(ee){return ee},_e.codespan=function(ee){return ee},_e.del=function(ee){return ee},_e.html=function(ee){return ee},_e.text=function(ee){return ee},_e.link=function(ee,oe,q){return""+q},_e.image=function(ee,oe,q){return""+q},_e.br=function(){return""},Ce}(),Le=function(){function Ce(){this.seen={}}var _e=Ce.prototype;return _e.slug=function(ee){var oe=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var q=oe;do this.seen[q]++,oe=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Ce}(),ne=E.defaults,ye=K.unescape,se=function(){function Ce(Ee){this.options=Ee||ne,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Le}Ce.parse=function(ee,oe){var q=new Ce(oe);return q.parse(ee)};var _e=Ce.prototype;return _e.parse=function(ee,oe){oe===void 0&&(oe=!0);var q="",me,Ie,V,Re,He,fe,ke,Xe,ot,tt,at,pt,Ct,bt,dt,kt,Ft,mt,$t=ee.length;for(me=0;me<$t;me++){tt=ee[me];switch(tt.type){case"space":continue;case"hr":{q+=this.renderer.hr();continue}case"heading":{q+=this.renderer.heading(this.parseInline(tt.tokens),tt.depth,ye(this.parseInline(tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{q+=this.renderer.code(tt.text,tt.lang,tt.escaped);continue}case"table":{for(Xe="",ke="",Re=tt.header.length,Ie=0;Ie<Re;Ie++)ke+=this.renderer.tablecell(this.parseInline(tt.tokens.header[Ie]),{header:!0,align:tt.align[Ie]});for(Xe+=this.renderer.tablerow(ke),ot="",Re=tt.cells.length,Ie=0;Ie<Re;Ie++){for(fe=tt.tokens.cells[Ie],ke="",He=fe.length,V=0;V<He;V++)ke+=this.renderer.tablecell(this.parseInline(fe[V]),{header:!1,align:tt.align[V]});ot+=this.renderer.tablerow(ke)}q+=this.renderer.table(Xe,ot);continue}case"blockquote":{ot=this.parse(tt.tokens),q+=this.renderer.blockquote(ot);continue}case"list":{for(at=tt.ordered,pt=tt.start,Ct=tt.loose,Re=tt.items.length,ot="",Ie=0;Ie<Re;Ie++)dt=tt.items[Ie],kt=dt.checked,Ft=dt.task,bt="",dt.task&&(mt=this.renderer.checkbox(kt),Ct?dt.tokens.length>0&&dt.tokens[0].type==="text"?(dt.tokens[0].text=mt+" "+dt.tokens[0].text,dt.tokens[0].tokens&&dt.tokens[0].tokens.length>0&&dt.tokens[0].tokens[0].type==="text"&&(dt.tokens[0].tokens[0].text=mt+" "+dt.tokens[0].tokens[0].text)):dt.tokens.unshift({type:"text",text:mt}):bt+=mt),bt+=this.parse(dt.tokens,Ct),ot+=this.renderer.listitem(bt,Ft,kt);q+=this.renderer.list(ot,at,pt);continue}case"html":{q+=this.renderer.html(tt.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(ot=tt.tokens?this.parseInline(tt.tokens):tt.text;me+1<$t&&ee[me+1].type==="text";)tt=ee[++me],ot+=`
`+(tt.tokens?this.parseInline(tt.tokens):tt.text);q+=oe?this.renderer.paragraph(ot):ot;continue}default:{var wt='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(wt);return}else throw new Error(wt)}}}return q},_e.parseInline=function(ee,oe){oe=oe||this.renderer;var q="",me,Ie,V=ee.length;for(me=0;me<V;me++){Ie=ee[me];switch(Ie.type){case"escape":{q+=oe.text(Ie.text);break}case"html":{q+=oe.html(Ie.text);break}case"link":{q+=oe.link(Ie.href,Ie.title,this.parseInline(Ie.tokens,oe));break}case"image":{q+=oe.image(Ie.href,Ie.title,Ie.text);break}case"strong":{q+=oe.strong(this.parseInline(Ie.tokens,oe));break}case"em":{q+=oe.em(this.parseInline(Ie.tokens,oe));break}case"codespan":{q+=oe.codespan(Ie.text);break}case"br":{q+=oe.br();break}case"del":{q+=oe.del(this.parseInline(Ie.tokens,oe));break}case"text":{q+=oe.text(Ie.text);break}default:{var Re='Token with "'+Ie.type+'" type was not found.';if(this.options.silent){console.error(Re);return}else throw new Error(Re)}}}return q},Ce}(),Pe=K.merge,Ze=K.checkSanitizeDeprecation,et=K.escape,Ge=E.getDefaults,ht=E.changeDefaults,ce=E.defaults;function Me(Ce,_e,Ee){if(typeof Ce=="undefined"||Ce===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ce!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ce)+", string expected");if(typeof _e=="function"&&(Ee=_e,_e=null),_e=Pe({},Me.defaults,_e||{}),Ze(_e),Ee){var ee=_e.highlight,oe;try{oe=qe.lex(Ce,_e)}catch(V){return Ee(V)}var q=function(Re){var He;if(!Re)try{He=se.parse(oe,_e)}catch(fe){Re=fe}return _e.highlight=ee,Re?Ee(Re):Ee(null,He)};if(!ee||ee.length<3)return q();if(delete _e.highlight,!oe.length)return q();var me=0;Me.walkTokens(oe,function(V){V.type==="code"&&(me++,setTimeout(function(){ee(V.text,V.lang,function(Re,He){if(Re)return q(Re);He!=null&&He!==V.text&&(V.text=He,V.escaped=!0),me--,me===0&&q()})},0))}),me===0&&q();return}try{var Ie=qe.lex(Ce,_e);return _e.walkTokens&&Me.walkTokens(Ie,_e.walkTokens),se.parse(Ie,_e)}catch(V){if(V.message+=`
Please report this to https://github.com/markedjs/marked.`,_e.silent)return"<p>An error occurred:</p><pre>"+et(V.message+"",!0)+"</pre>";throw V}}Me.options=Me.setOptions=function(Ce){return Pe(Me.defaults,Ce),ht(Me.defaults),Me},Me.getDefaults=Ge,Me.defaults=ce,Me.use=function(Ce){var _e=Pe({},Ce);if(Ce.renderer&&function(){var ee=Me.defaults.renderer||new xe,oe=function(Ie){var V=ee[Ie];ee[Ie]=function(){for(var Re=arguments.length,He=new Array(Re),fe=0;fe<Re;fe++)He[fe]=arguments[fe];var ke=Ce.renderer[Ie].apply(ee,He);return ke===!1&&(ke=V.apply(ee,He)),ke}};for(var q in Ce.renderer)oe(q);_e.renderer=ee}(),Ce.tokenizer&&function(){var ee=Me.defaults.tokenizer||new Ne,oe=function(Ie){var V=ee[Ie];ee[Ie]=function(){for(var Re=arguments.length,He=new Array(Re),fe=0;fe<Re;fe++)He[fe]=arguments[fe];var ke=Ce.tokenizer[Ie].apply(ee,He);return ke===!1&&(ke=V.apply(ee,He)),ke}};for(var q in Ce.tokenizer)oe(q);_e.tokenizer=ee}(),Ce.walkTokens){var Ee=Me.defaults.walkTokens;_e.walkTokens=function(ee){Ce.walkTokens(ee),Ee&&Ee(ee)}}Me.setOptions(_e)},Me.walkTokens=function(Ce,_e){for(var Ee=M(Ce),ee;!(ee=Ee()).done;){var oe=ee.value;_e(oe);switch(oe.type){case"table":{for(var q=M(oe.tokens.header),me;!(me=q()).done;){var Ie=me.value;Me.walkTokens(Ie,_e)}for(var V=M(oe.tokens.cells),Re;!(Re=V()).done;)for(var He=Re.value,fe=M(He),ke;!(ke=fe()).done;){var Xe=ke.value;Me.walkTokens(Xe,_e)}break}case"list":{Me.walkTokens(oe.items,_e);break}default:oe.tokens&&Me.walkTokens(oe.tokens,_e)}}},Me.Parser=se,Me.parser=se.parse,Me.Renderer=xe,Me.TextRenderer=Se,Me.Lexer=qe,Me.lexer=qe.lex,Me.Tokenizer=Ne,Me.Slugger=Le,Me.parse=Me;var Fe=Me;return Fe})},Dqnf:function(it,re,Q){"use strict";var G=Q("k1fw"),R=Q("tJVT"),I=Q("rAM+"),L=Q("q1tI"),M=Q.n(L),p=Q("J66h"),E=Q.n(p),b=Q("/POA"),i=Q.n(b),c=Q("q7KB"),o=Q.n(c),h=Q("ER/M"),n=Q.n(h),a=Q("dhSg"),t=Q("bdgK");function r(f,d,v){var m=v._core._renderService.dimensions.actualCellWidth||9.5,S=v._core._renderService.dimensions.actualCellHeight||18,C=Math.floor(d/S),_=Math.floor(f/m);return[_,C]}function s(f,d){var v=new t.default(function(m){var S=Object(I.a)(m),C;try{for(S.s();!(C=S.n()).done;){var _=C.value;if(_.target.offsetHeight>0||_.target.offsetWidth>0){var y=r(_.target.offsetWidth,_.target.offsetHeight,f),T=Object(R.a)(y,2),k=T[0],g=T[1];console.log("cols, rows",k,g),a.a.publish("ssh-xterm-resize",{columns:k,rows:g,width:_.target.offsetWidth,height:_.target.offsetHeight}),f.resize(k,g);var F=p.Base64.decode("IA=="),P=p.Base64.decode("CBtbSw==");f.write(F),f.write(P)}}}catch(N){S.e(N)}finally{S.f()}});return v.observe(d),v}var u=3e4;re.a=function(f){var d=f.sshConfigData,v=f.sid,m=Object(L.useState)(null),S=Object(R.a)(m,2),C=S[0],_=S[1],y=d.link_url,T=d.password,k=d.port,g=Object(L.useRef)(),F=Object(L.useRef)(),P=Object(L.useRef)(!1);return Object(L.useEffect)(function(){if(g.current&&y){var N=new b.Terminal({fontSize:16,rendererType:"dom"});N.open(g.current),N.onData(function(j){F.current&&(F.current.readyState===1&&(F.current.send(JSON.stringify({tp:"client",data:j})),a.a.publish("on-operating-ssh")))}),N.write("Connecting..."),_(N);var W=s(N,g.current);return function(){N.dispose(),W.unobserve(g.current)}}},[y,g.current]),Object(L.useEffect)(function(){if(C&&y){function N(){var O=new WebSocket(y);F.current=O,O.onopen=function(){var z=C.element.parentElement;if(z){var te=z.offsetWidth,de=z.offsetHeight;console.log("init",{tp:"init",data:Object(G.a)(Object(G.a)({},d),{},{secret:T,width:te,height:de,rows:C.rows,columns:C.cols})}),O.send(JSON.stringify({tp:"init",data:Object(G.a)(Object(G.a)({},d),{},{secret:T,width:te,height:de,rows:C.rows,columns:C.cols})}))}C.focus()},O.onerror=function(z){console.log("------in socket error----",z,O,y)},O.onmessage=function(z){P.current||(C.write("\r"),setTimeout(function(){},1e3)),P.current=!0,console.log("event:",z);var te=p.Base64.decode(z.data.toString()),de=C._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",te,de,C),C.write(te)},O.onclose=function(z){W&&clearInterval(W),C.write(`\r
connection closed`)}}var W=setInterval(function(){F.current&&F.current.send(JSON.stringify({tp:"h"}))},u),j=a.a.subscribe("create-socket",function(O){v==O&&(F.current&&F.current.readyState===1?C.focus():N(),C.focus())}),A=a.a.subscribe("close-socket",function(O){v===O&&(F.current&&(F.current.close(),P.current=!1,C.clear()),F.current=null)}),K=a.a.subscribe("ssh-xterm-resize",function(O){F.current&&F.current.readyState===1&&F.current.send(JSON.stringify({tp:"resize",data:Object(G.a)({},O)}))}),U=a.a.subscribe("ssh-add-connect-time",function(){F.current&&F.current.readyState===1&&F.current.send(JSON.stringify({tp:"overtime"}))});return function(){A(),j(),K(),U(),F.current&&(F.current.close(),P.current=!1)}}},[C,y,k]),M.a.createElement("div",{ref:g,className:n.a["xterm-panel"]},y?null:M.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},ELLl:function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){var R={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=G.Pos;G.defineOption("autoCloseBrackets",!1,function(t,r,s){s&&s!=G.Init&&(t.removeKeyMap(M),t.state.closeBrackets=null),r&&(p(L(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(M))});function L(t,r){return r=="pairs"&&typeof t=="string"?t:typeof t=="object"&&t[r]!=null?t[r]:R[r]}var M={Backspace:i,Enter:c};function p(t){for(var r=0;r<t.length;r++){var s=t.charAt(r),u="'"+s+"'";M[u]||(M[u]=E(s))}}p(R.pairs+"`");function E(t){return function(r){return h(r,t)}}function b(t){var r=t.state.closeBrackets;if(!r||r.override)return r;var s=t.getModeAt(t.getCursor());return s.closeBrackets||r}function i(t){var r=b(t);if(!r||t.getOption("disableInput"))return G.Pass;for(var s=L(r,"pairs"),u=t.listSelections(),f=0;f<u.length;f++){if(!u[f].empty())return G.Pass;var d=n(t,u[f].head);if(!d||s.indexOf(d)%2!=0)return G.Pass}for(var f=u.length-1;f>=0;f--){var v=u[f].head;t.replaceRange("",I(v.line,v.ch-1),I(v.line,v.ch+1),"+delete")}}function c(t){var r=b(t),s=r&&L(r,"explode");if(!s||t.getOption("disableInput"))return G.Pass;for(var u=t.listSelections(),f=0;f<u.length;f++){if(!u[f].empty())return G.Pass;var d=n(t,u[f].head);if(!d||s.indexOf(d)%2!=0)return G.Pass}t.operation(function(){var v=t.lineSeparator()||`
`;t.replaceSelection(v+v,null),t.execCommand("goCharLeft"),u=t.listSelections();for(var m=0;m<u.length;m++){var S=u[m].head.line;t.indentLine(S,null,!0),t.indentLine(S+1,null,!0)}})}function o(t){var r=G.cmpPos(t.anchor,t.head)>0;return{anchor:new I(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new I(t.head.line,t.head.ch+(r?1:-1))}}function h(t,r){var s=b(t);if(!s||t.getOption("disableInput"))return G.Pass;var u=L(s,"pairs"),f=u.indexOf(r);if(f==-1)return G.Pass;for(var d=L(s,"closeBefore"),v=L(s,"triples"),m=u.charAt(f+1)==r,S=t.listSelections(),C=f%2==0,_,y=0;y<S.length;y++){var T=S[y],k=T.head,g,F=t.getRange(k,I(k.line,k.ch+1));if(C&&!T.empty())g="surround";else if((m||!C)&&F==r)m&&a(t,k)?g="both":v.indexOf(r)>=0&&t.getRange(k,I(k.line,k.ch+3))==r+r+r?g="skipThree":g="skip";else if(m&&k.ch>1&&v.indexOf(r)>=0&&t.getRange(I(k.line,k.ch-2),k)==r+r){if(k.ch>2&&/\bstring/.test(t.getTokenTypeAt(I(k.line,k.ch-2))))return G.Pass;g="addFour"}else if(m){var P=k.ch==0?" ":t.getRange(I(k.line,k.ch-1),k);if(!G.isWordChar(F)&&P!=r&&!G.isWordChar(P))g="both";else return G.Pass}else if(C&&(F.length===0||/\s/.test(F)||d.indexOf(F)>-1))g="both";else return G.Pass;if(!_)_=g;else if(_!=g)return G.Pass}var N=f%2?u.charAt(f-1):r,W=f%2?r:u.charAt(f+1);t.operation(function(){if(_=="skip")t.execCommand("goCharRight");else if(_=="skipThree")for(var j=0;j<3;j++)t.execCommand("goCharRight");else if(_=="surround"){for(var A=t.getSelections(),j=0;j<A.length;j++)A[j]=N+A[j]+W;t.replaceSelections(A,"around"),A=t.listSelections().slice();for(var j=0;j<A.length;j++)A[j]=o(A[j]);t.setSelections(A)}else _=="both"?(t.replaceSelection(N+W,null),t.triggerElectric(N+W),t.execCommand("goCharLeft")):_=="addFour"&&(t.replaceSelection(N+N+N+N,"before"),t.execCommand("goCharRight"))})}function n(t,r){var s=t.getRange(I(r.line,r.ch-1),I(r.line,r.ch+1));return s.length==2?s:null}function a(t,r){var s=t.getTokenAt(I(r.line,r.ch+1));return/\bstring/.test(s.type)&&s.start==r.ch&&(r.ch==0||!/\bstring/.test(t.getTokenTypeAt(r)))}})},"ER/M":function(it,re,Q){it.exports={"xterm-panel":"xterm-panel___2r2xx"}},FWmy:function(it,re,Q){"use strict";Q.d(re,"a",function(){return G});function G(R,I){if(!R)throw new Error(I?`Assertion failed (${I})`:"Assertion Failed")}},Fv0C:function(it,re,Q){"use strict";function G(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(r){return typeof r}:G=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G(a)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=i(Q("Lo0S")),I=Q("vewr"),L=i(Q("8CQX")),M=E(Q("mHUz")),p=i(Q("GdRQ"));function E(a){return a&&a.__esModule?a:{default:a}}function b(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return b=function(){return a},a}function i(a){if(a&&a.__esModule)return a;if(a===null||G(a)!=="object"&&typeof a!="function")return{default:a};var t=b();if(t&&t.has(a))return t.get(a);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in a)if(Object.prototype.hasOwnProperty.call(a,u)){var f=s?Object.getOwnPropertyDescriptor(a,u):null;f&&(f.get||f.set)?Object.defineProperty(r,u,f):r[u]=a[u]}return r.default=a,t&&t.set(a,r),r}function c(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function o(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function h(a,t,r){return t&&o(a.prototype,t),r&&o(a,r),a}var n=function(){function a(t){c(this,a),this._target=t||null,this._keyDownList={},this._pendingKey=null,this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),keypress:this._handleKeyPress.bind(this),blur:this._allKeysUp.bind(this),checkalt:this._checkAlt.bind(this)},this.onkeyevent=function(){}}return h(a,[{key:"_sendKeyEvent",value:function(r,s,u){if(u)this._keyDownList[s]=r;else{if(!(s in this._keyDownList))return;delete this._keyDownList[s]}R.Debug("onkeyevent "+(u?"down":"up")+", keysym: "+r,", code: "+s),this.onkeyevent(r,s,u)}},{key:"_getKeyCode",value:function(r){var s=L.getKeycode(r);if(s!=="Unidentified")return s;if(r.keyCode&&r.type!=="keypress"&&r.keyCode!==229)return"Platform"+r.keyCode;if(r.keyIdentifier){if(r.keyIdentifier.substr(0,2)!=="U+")return r.keyIdentifier;var u=parseInt(r.keyIdentifier.substr(2),16),f=String.fromCharCode(u).toUpperCase();return"Platform"+f.charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(r){var s=this._getKeyCode(r),u=L.getKeysym(r);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),s==="AltRight"&&r.timeStamp-this._altGrCtrlTime<50?u=M.default.XK_ISO_Level3_Shift:this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),s==="Unidentified"){u&&(this._sendKeyEvent(u,s,!0),this._sendKeyEvent(u,s,!1)),(0,I.stopEvent)(r);return}if(p.isMac()||p.isIOS())switch(u){case M.default.XK_Super_L:u=M.default.XK_Alt_L;break;case M.default.XK_Super_R:u=M.default.XK_Super_L;break;case M.default.XK_Alt_L:u=M.default.XK_Mode_switch;break;case M.default.XK_Alt_R:u=M.default.XK_ISO_Level3_Shift;break}if(s in this._keyDownList&&(u=this._keyDownList[s]),(p.isMac()||p.isIOS())&&s==="CapsLock"){this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!1),(0,I.stopEvent)(r);return}if(!u&&(!r.key||p.isIE()||p.isEdge())){this._pendingKey=s,setTimeout(this._handleKeyPressTimeout.bind(this),10,r);return}if(this._pendingKey=null,(0,I.stopEvent)(r),s==="ControlLeft"&&p.isWindows()&&!("ControlLeft"in this._keyDownList)){this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),this._altGrCtrlTime=r.timeStamp;return}this._sendKeyEvent(u,s,!0)}},{key:"_handleKeyPress",value:function(r){if((0,I.stopEvent)(r),this._pendingKey===null)return;var s=this._getKeyCode(r),u=L.getKeysym(r);if(s!=="Unidentified"&&s!=this._pendingKey)return;if(s=this._pendingKey,this._pendingKey=null,!u){R.Info("keypress with no keysym:",r);return}this._sendKeyEvent(u,s,!0)}},{key:"_handleKeyPressTimeout",value:function(r){if(this._pendingKey===null)return;var s,u=this._pendingKey;if(this._pendingKey=null,r.keyCode>=48&&r.keyCode<=57)s=r.keyCode;else if(r.keyCode>=65&&r.keyCode<=90){var f=String.fromCharCode(r.keyCode);r.shiftKey?f=f.toUpperCase():f=f.toLowerCase(),s=f.charCodeAt()}else s=0;this._sendKeyEvent(s,u,!0)}},{key:"_handleKeyUp",value:function(r){(0,I.stopEvent)(r);var s=this._getKeyCode(r);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),(p.isMac()||p.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),p.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(){R.Debug(">> Keyboard.allKeysUp");for(var r in this._keyDownList)this._sendKeyEvent(this._keyDownList[r],r,!1);R.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(r){if(r.skipCheckAlt)return;if(r.altKey)return;var s=this._target,u=this._keyDownList;["AltLeft","AltRight"].forEach(function(f){if(!(f in u))return;var d=new KeyboardEvent("keyup",{key:u[f],code:f});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),p.isWindows()&&p.isFirefox()){var r=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.addEventListener(s,r,{capture:!0,passive:!0})})}}},{key:"ungrab",value:function(){if(p.isWindows()&&p.isFirefox()){var r=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.removeEventListener(s,r)})}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()}}]),a}();re.default=n},GQ8N:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.toUnsigned32bit=G,re.toSigned32bit=R;function G(I){return I>>>0}function R(I){return I|0}},GdRQ:function(it,re,Q){"use strict";function G(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(y){return typeof y}:G=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},G(C)}Object.defineProperty(re,"__esModule",{value:!0}),re.isMac=s,re.isWindows=u,re.isIOS=f,re.isSafari=d,re.isIE=v,re.isEdge=m,re.isFirefox=S,re.hasScrollbarGutter=re.supportsImageMetadata=re.supportsCursorURIs=re.dragThreshold=re.isTouchDevice=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return I=function(){return C},C}function L(C){if(C&&C.__esModule)return C;if(C===null||G(C)!=="object"&&typeof C!="function")return{default:C};var _=I();if(_&&_.has(C))return _.get(C);var y={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in C)if(Object.prototype.hasOwnProperty.call(C,k)){var g=T?Object.getOwnPropertyDescriptor(C,k):null;g&&(g.get||g.set)?Object.defineProperty(y,k,g):y[k]=C[k]}return y.default=C,_&&_.set(C,y),y}var M="ontouchstart"in document.documentElement||document.ontouchstart!==void 0||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;re.isTouchDevice=M,window.addEventListener("touchstart",function C(){re.isTouchDevice=M=!0,window.removeEventListener("touchstart",C,!1)},!1);var p=10*(window.devicePixelRatio||1);re.dragThreshold=p;var E=!1;try{var b=document.createElement("canvas");b.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',b.style.cursor.indexOf("url")===0?(R.Info("Data URI scheme cursor supported"),E=!0):R.Warn("Data URI scheme cursor not supported")}catch(C){R.Error("Data URI scheme cursor test exception: "+C)}var i=E;re.supportsCursorURIs=i;var c=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),c=!0}catch(C){}var o=c;re.supportsImageMetadata=o;var h=!0;try{var n=document.createElement("div");n.style.visibility="hidden",n.style.overflow="scroll",document.body.appendChild(n);var a=document.createElement("div");n.appendChild(a);var t=n.offsetWidth-a.offsetWidth;n.parentNode.removeChild(n),h=t!=0}catch(C){R.Error("Scrollbar test exception: "+C)}var r=h;re.hasScrollbarGutter=r;function s(){return navigator&&!!/mac/i.exec(navigator.platform)}function u(){return navigator&&!!/win/i.exec(navigator.platform)}function f(){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 v(){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(it,re){it.exports=function(G,R,I,L){var M=I?I.call(L,G,R):void 0;if(M!==void 0)return!!M;if(G===R)return!0;if(typeof G!="object"||!G||typeof R!="object"||!R)return!1;var p=Object.keys(G),E=Object.keys(R);if(p.length!==E.length)return!1;for(var b=Object.prototype.hasOwnProperty.bind(R),i=0;i<p.length;i++){var c=p[i];if(!b(c))return!1;var o=G[c],h=R[c];if(M=I?I.call(L,o,h,c):void 0,M===!1||M===void 0&&o!==h)return!1}return!0}},HmJG:function(it,re,Q){},ItS6:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G=Q("eP3c"),R=I(Q("1q3G"));function I(b){return b&&b.__esModule?b:{default:b}}function L(b,i){if(!(b instanceof i))throw new TypeError("Cannot call a class as a function")}function M(b,i){for(var c=0;c<i.length;c++){var o=i[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(b,o.key,o)}}function p(b,i,c){return i&&M(b.prototype,i),c&&M(b,c),b}var E=function(){function b(){L(this,b),this.strm=new R.default,this.chunkSize=1024*10*10,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,G.inflateInit)(this.strm,this.windowBits)}return p(b,[{key:"setInput",value:function(c){c?(this.strm.input=c,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0):(this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0)}},{key:"inflate",value:function(c){c>this.chunkSize&&(this.chunkSize=c,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=c;var o=(0,G.inflate)(this.strm,0);if(o<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=c)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,G.inflateReset)(this.strm)}}]),b}();re.default=E},IxHN:function(it,re,Q){"use strict";var G=Q("q1tI"),R=Q.n(G),I=Q("07cG"),L=Q.n(I);re.a=function(M){var p=M.message,E=M.className,b=M.children,i=M.style,c=i===void 0?{}:i;return R.a.createElement("div",{className:"".concat(L.a.idsRingWrapper," ").concat(E)},R.a.createElement("div",{className:L.a.ldsRing},R.a.createElement("div",null),R.a.createElement("div",null),R.a.createElement("div",null),R.a.createElement("div",null)),p?R.a.createElement("p",{style:c},p):null,b)}},J66h:function(it,re,Q){(function(G){var R,I;(function(L,M){it.exports=M(L)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof G!="undefined"?G:this,function(L){"use strict";L=L||{};var M=L.Base64,p="2.6.4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=function(N){for(var W={},j=0,A=N.length;j<A;j++)W[N.charAt(j)]=j;return W}(E),i=String.fromCharCode,c=function(N){if(N.length<2){var W=N.charCodeAt(0);return W<128?N:W<2048?i(192|W>>>6)+i(128|W&63):i(224|W>>>12&15)+i(128|W>>>6&63)+i(128|W&63)}else{var W=65536+(N.charCodeAt(0)-55296)*1024+(N.charCodeAt(1)-56320);return i(240|W>>>18&7)+i(128|W>>>12&63)+i(128|W>>>6&63)+i(128|W&63)}},o=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(N){return N.replace(o,c)},n=function(N){var W=[0,2,1][N.length%3],j=N.charCodeAt(0)<<16|(N.length>1?N.charCodeAt(1):0)<<8|(N.length>2?N.charCodeAt(2):0),A=[E.charAt(j>>>18),E.charAt(j>>>12&63),W>=2?"=":E.charAt(j>>>6&63),W>=1?"=":E.charAt(j&63)];return A.join("")},a=L.btoa&&typeof L.btoa=="function"?function(N){return L.btoa(N)}:function(N){if(N.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return N.replace(/[\s\S]{1,3}/g,n)},t=function(N){return a(h(String(N)))},r=function(N){return N.replace(/[+\/]/g,function(W){return W=="+"?"-":"_"}).replace(/=/g,"")},s=function(N,W){return W?r(t(N)):t(N)},u=function(N){return s(N,!0)},f;L.Uint8Array&&(f=function(N,W){for(var j="",A=0,K=N.length;A<K;A+=3){var U=N[A],O=N[A+1],z=N[A+2],te=U<<16|O<<8|z;j+=E.charAt(te>>>18)+E.charAt(te>>>12&63)+(typeof O!="undefined"?E.charAt(te>>>6&63):"=")+(typeof z!="undefined"?E.charAt(te&63):"=")}return W?r(j):j});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(N){switch(N.length){case 4:var W=(7&N.charCodeAt(0))<<18|(63&N.charCodeAt(1))<<12|(63&N.charCodeAt(2))<<6|63&N.charCodeAt(3),j=W-65536;return i((j>>>10)+55296)+i((j&1023)+56320);case 3:return i((15&N.charCodeAt(0))<<12|(63&N.charCodeAt(1))<<6|63&N.charCodeAt(2));default:return i((31&N.charCodeAt(0))<<6|63&N.charCodeAt(1))}},m=function(N){return N.replace(d,v)},S=function(N){var W=N.length,j=W%4,A=(W>0?b[N.charAt(0)]<<18:0)|(W>1?b[N.charAt(1)]<<12:0)|(W>2?b[N.charAt(2)]<<6:0)|(W>3?b[N.charAt(3)]:0),K=[i(A>>>16),i(A>>>8&255),i(A&255)];return K.length-=[0,0,2,1][j],K.join("")},C=L.atob&&typeof L.atob=="function"?function(N){return L.atob(N)}:function(N){return N.replace(/\S{1,4}/g,S)},_=function(N){return C(String(N).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(N){return m(C(N))},T=function(N){return String(N).replace(/[-_]/g,function(W){return W=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},k=function(N){return y(T(N))},g;L.Uint8Array&&(g=function(N){return Uint8Array.from(_(T(N)),function(W){return W.charCodeAt(0)})});var F=function(){var N=L.Base64;return L.Base64=M,N};if(L.Base64={VERSION:p,atob:_,btoa:a,fromBase64:k,toBase64:s,utob:h,encode:s,encodeURI:u,btou:m,decode:k,noConflict:F,fromUint8Array:f,toUint8Array:g},typeof Object.defineProperty=="function"){var P=function(N){return{value:N,enumerable:!1,writable:!0,configurable:!0}};L.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",P(function(){return k(this)})),Object.defineProperty(String.prototype,"toBase64",P(function(N){return s(this,N)})),Object.defineProperty(String.prototype,"toBase64URI",P(function(){return s(this,!0)}))}}return L.Meteor&&(Base64=L.Base64),it.exports?it.exports.Base64=L.Base64:!(R=[],I=function(){return L.Base64}.apply(re,R),I!==void 0&&(it.exports=I)),{Base64:L.Base64}})}).call(this,Q("IyRk"))},JSwD:function(it,re,Q){"use strict";function G(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(u){return typeof u}:G=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},G(r)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=t;var R=L(Q("6BzB"));function I(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return I=function(){return r},r}function L(r){if(r&&r.__esModule)return r;if(r===null||G(r)!=="object"&&typeof r!="function")return{default:r};var s=I();if(s&&s.has(r))return s.get(r);var u={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in r)if(Object.prototype.hasOwnProperty.call(r,d)){var v=f?Object.getOwnPropertyDescriptor(r,d):null;v&&(v.get||v.set)?Object.defineProperty(u,d,v):u[d]=r[d]}return u.default=r,s&&s.set(r,u),u}var M=15,p=852,E=592,b=0,i=1,c=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],h=[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],n=[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],a=[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(r,s,u,f,d,v,m,S){var C=S.bits,_=0,y=0,T=0,k=0,g=0,F=0,P=0,N=0,W=0,j=0,A,K,U,O,z,te=null,de=0,be,je=new R.Buf16(M+1),Ne=new R.Buf16(M+1),Oe=null,Ke=0,We,Te,we;for(_=0;_<=M;_++)je[_]=0;for(y=0;y<f;y++)je[s[u+y]]++;for(g=C,k=M;k>=1&&!(je[k]!==0);k--);if(g>k&&(g=k),k===0)return d[v++]=1<<24|64<<16|0,d[v++]=1<<24|64<<16|0,S.bits=1,0;for(T=1;T<k&&!(je[T]!==0);T++);for(g<T&&(g=T),N=1,_=1;_<=M;_++)if(N<<=1,N-=je[_],N<0)return-1;if(N>0&&(r===b||k!==1))return-1;for(Ne[1]=0,_=1;_<M;_++)Ne[_+1]=Ne[_]+je[_];for(y=0;y<f;y++)s[u+y]!==0&&(m[Ne[s[u+y]]++]=y);if(r===b?(te=Oe=m,be=19):r===i?(te=o,de-=257,Oe=h,Ke-=257,be=256):(te=n,Oe=a,be=-1),j=0,y=0,_=T,z=v,F=g,P=0,U=-1,W=1<<g,O=W-1,r===i&&W>p||r===c&&W>E)return 1;for(;;){We=_-P,m[y]<be?(Te=0,we=m[y]):m[y]>be?(Te=Oe[Ke+m[y]],we=te[de+m[y]]):(Te=32+64,we=0),A=1<<_-P,K=1<<F,T=K;do K-=A,d[z+(j>>P)+K]=We<<24|Te<<16|we|0;while(K!==0);for(A=1<<_-1;j&A;)A>>=1;if(A!==0?(j&=A-1,j+=A):j=0,y++,--je[_]===0){if(_===k)break;_=s[u+m[y]]}if(_>g&&(j&O)!==U){for(P===0&&(P=g),z+=T,F=_-P,N=1<<F;F+P<k&&!(N-=je[F+P],N<=0);)F++,N<<=1;if(W+=1<<F,r===i&&W>p||r===c&&W>E)return 1;U=j&O,d[U]=g<<24|F<<16|z-v|0}}return j!==0&&(d[z+j]=_-P<<24|64<<16|0),S.bits=g,0}},JYp7:function(it,re,Q){"use strict";Q.d(re,"a",function(){return G});var G;(function(R){function I(d){return d&&typeof d=="object"&&typeof d[Symbol.iterator]=="function"}R.is=I;const L=Object.freeze([]);function M(){return L}R.empty=M;function*p(d){yield d}R.single=p;function E(d){return d||L}R.from=E;function b(d){return!d||d[Symbol.iterator]().next().done===!0}R.isEmpty=b;function i(d){return d[Symbol.iterator]().next().value}R.first=i;function c(d,v){for(const m of d)if(v(m))return!0;return!1}R.some=c;function o(d,v){for(const m of d)if(v(m))return m;return}R.find=o;function*h(d,v){for(const m of d)v(m)&&(yield m)}R.filter=h;function*n(d,v){let m=0;for(const S of d)yield v(S,m++)}R.map=n;function*a(...d){for(const v of d)for(const m of v)yield m}R.concat=a;function*t(d){for(const v of d)for(const m of v)yield m}R.concatNested=t;function r(d,v,m){let S=m;for(const C of d)S=v(S,C);return S}R.reduce=r;function*s(d,v,m=d.length){for(v<0&&(v+=d.length),m<0?m+=d.length:m>d.length&&(m=d.length);v<m;v++)yield d[v]}R.slice=s;function u(d,v=Number.POSITIVE_INFINITY){const m=[];if(v===0)return[m,d];const S=d[Symbol.iterator]();for(let C=0;C<v;C++){const _=S.next();if(_.done)return[m,R.empty()];m.push(_.value)}return[m,{[Symbol.iterator](){return S}}]}R.consume=u;function f(d,v,m=(S,C)=>S===C){const S=d[Symbol.iterator](),C=v[Symbol.iterator]();for(;;){const _=S.next(),y=C.next();if(_.done!==y.done)return!1;if(_.done)return!0;if(!m(_.value,y.value))return!1}}R.equals=f})(G||(G={}))},LCi9:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(d,v){if(!(d instanceof v))throw new TypeError("Cannot call a class as a function")}function R(d,v){for(var m=0;m<v.length;m++){var S=v[m];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(d,S.key,S)}}function I(d,v,m){return v&&R(d.prototype,v),m&&R(d,m),d}var L=0,M=1,p=2,E=4,b=8,i=16,c=32,o=64,h=127,n=50,a=90,t=250,r=1e3,s=1e3,u=50,f=function(){function d(){G(this,d),this._target=null,this._state=h,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}return I(d,[{key:"attach",value:function(m){this.detach(),this._target=m,this._target.addEventListener("touchstart",this._boundEventHandler),this._target.addEventListener("touchmove",this._boundEventHandler),this._target.addEventListener("touchend",this._boundEventHandler),this._target.addEventListener("touchcancel",this._boundEventHandler)}},{key:"detach",value:function(){if(!this._target)return;this._stopLongpressTimeout(),this._stopTwoTouchTimeout(),this._target.removeEventListener("touchstart",this._boundEventHandler),this._target.removeEventListener("touchmove",this._boundEventHandler),this._target.removeEventListener("touchend",this._boundEventHandler),this._target.removeEventListener("touchcancel",this._boundEventHandler),this._target=null}},{key:"_eventHandler",value:function(m){var S;m.stopPropagation(),m.preventDefault();switch(m.type){case"touchstart":S=this._touchStart;break;case"touchmove":S=this._touchMove;break;case"touchend":case"touchcancel":S=this._touchEnd;break}for(var C=0;C<m.changedTouches.length;C++){var _=m.changedTouches[C];S.call(this,_.identifier,_.clientX,_.clientY)}}},{key:"_touchStart",value:function(m,S,C){if(this._hasDetectedGesture()||this._state===L){this._ignored.push(m);return}if(this._tracked.length>0&&Date.now()-this._tracked[0].started>t){this._state=L,this._ignored.push(m);return}if(this._waitingRelease){this._state=L,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|b|i),this._stopLongpressTimeout();break;case 3:this._state&=~(p|c|o);break;default:this._state=L}}},{key:"_touchMove",value:function(m,S,C){var _=this._tracked.find(function(P){return P.id===m});if(_===void 0)return;_.lastX=S,_.lastY=C;var y=S-_.firstX,T=C-_.firstY;if((_.firstX!==_.lastX||_.firstY!==_.lastY)&&(_.angle=Math.atan2(T,y)*180/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(y,T)<n)return;if(this._state&=~(M|p|E|i),this._stopLongpressTimeout(),this._tracked.length!==1&&(this._state&=~b),this._tracked.length!==2&&(this._state&=~(c|o)),this._tracked.length===2){var k=this._tracked.find(function(P){return P.id!==m}),g=Math.hypot(k.firstX-k.lastX,k.firstY-k.lastY);if(g>n){var F=Math.abs(_.angle-k.angle);F=Math.abs((F+180)%360-180),F>a?this._state&=~c: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=h,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=L),!this._hasDetectedGesture()&&(this._state&=~(b|c|o),this._state&=~i,this._stopLongpressTimeout(),!this._waitingRelease)){this._releaseStart=Date.now(),this._waitingRelease=!0;switch(this._tracked.length){case 1:this._state&=~(p|E);break;case 2:this._state&=~(M|E);break}}if(this._waitingRelease){Date.now()-this._releaseStart>t&&(this._state=L),this._tracked.some(function(T){return Date.now()-T.started>r})&&(this._state=L);var _=this._tracked.find(function(T){return T.id===m});if(_.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==L)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var y=0;y<this._tracked.length;y++)this._tracked[y].active&&this._ignored.push(this._tracked[y].id);this._tracked=[],this._state=L,this._ignored.indexOf(m)!==-1&&this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&(this._state=h,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return this._state===L||this._state&this._state-1?!1:!(this._state&(M|p|E)&&this._tracked.some(function(m){return m.active}))}},{key:"_startLongpressTimeout",value:function(){var m=this;this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout(function(){return m._longpressTimeout()},s)}},{key:"_stopLongpressTimeout",value:function(){clearTimeout(this._longpressTimeoutId),this._longpressTimeoutId=null}},{key:"_longpressTimeout",value:function(){if(this._hasDetectedGesture())throw new Error("A longpress gesture failed, conflict with a different gesture");this._state=i,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var m=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(function(){return m._twoTouchTimeout()},u)}},{key:"_stopTwoTouchTimeout",value:function(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}},{key:"_isTwoTouchTimeoutRunning",value:function(){return this._twoTouchTimeoutId!==null}},{key:"_twoTouchTimeout",value:function(){if(this._tracked.length===0)throw new Error("A pinch or two drag gesture failed, no tracked touches");var m=this._getAverageMovement(),S=Math.abs(m.x),C=Math.abs(m.y),_=this._getAverageDistance(),y=Math.abs(Math.hypot(_.first.x,_.first.y)-Math.hypot(_.last.x,_.last.y));C<y&&S<y?this._state=o:this._state=c,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(m){var S={type:this._stateToGesture(this._state)},C=this._getPosition(),_=C.last;m==="gesturestart"&&(_=C.first);switch(this._state){case c:case o:_=C.first;break}if(S.clientX=_.x,S.clientY=_.y,this._state===o){var y=this._getAverageDistance();m==="gesturestart"?(S.magnitudeX=y.first.x,S.magnitudeY=y.first.y):(S.magnitudeX=y.last.x,S.magnitudeY=y.last.y)}else if(this._state===c)if(m==="gesturestart")S.magnitudeX=0,S.magnitudeY=0;else{var T=this._getAverageMovement();S.magnitudeX=T.x,S.magnitudeY=T.y}var k=new CustomEvent(m,{detail:S});this._target.dispatchEvent(k)}},{key:"_stateToGesture",value:function(m){switch(m){case M:return"onetap";case p:return"twotap";case E:return"threetap";case b:return"drag";case i:return"longpress";case c:return"twodrag";case o:return"pinch"}throw new Error("Unknown gesture state: "+m)}},{key:"_getPosition",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture position, no tracked touches");for(var m=this._tracked.length,S=0,C=0,_=0,y=0,T=0;T<this._tracked.length;T++)S+=this._tracked[T].firstX,C+=this._tracked[T].firstY,_+=this._tracked[T].lastX,y+=this._tracked[T].lastY;return{first:{x:S/m,y:C/m},last:{x:_/m,y:y/m}}}},{key:"_getAverageMovement",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture movement, no tracked touches");var m,S;m=S=0;for(var C=this._tracked.length,_=0;_<this._tracked.length;_++)m+=this._tracked[_].lastX-this._tracked[_].firstX,S+=this._tracked[_].lastY-this._tracked[_].firstY;return{x:m/C,y:S/C}}},{key:"_getAverageDistance",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture distance, no tracked touches");var m=this._tracked[0],S=this._tracked[this._tracked.length-1],C=Math.abs(S.firstX-m.firstX),_=Math.abs(S.firstY-m.firstY),y=Math.abs(S.lastX-m.lastX),T=Math.abs(S.lastY-m.lastY);return{first:{x:C,y:_},last:{x:y,y:T}}}}]),d}();re.default=f},LdHM:function(it,re,Q){"use strict";Q.d(re,"b",function(){return d}),Q.d(re,"a",function(){return m});var G=Q("1OyB"),R=Q("vuIU"),I=Q("Ji7U"),L=Q("LK+K"),M=Q("q1tI"),p=Q("rePB"),E=Q("Ff2n"),b=Q("ODXe"),i=Q("4IlW"),c=Q("bX4T"),o=Q("YrtM"),h=Q("TSYQ"),n=Q.n(h),a=Q("+nKL"),t=Q("8OUc"),r=function(z,te){var de=z.prefixCls,be=z.id,je=z.flattenOptions,Ne=z.childrenAsData,Oe=z.values,Ke=z.searchValue,We=z.multiple,Te=z.defaultActiveFirstOption,we=z.height,ue=z.itemHeight,Ae=z.notFoundContent,ge=z.open,Ve=z.menuItemSelectedIcon,Qe=z.virtual,ze=z.onSelect,qe=z.onToggleOpen,Je=z.onActiveValue,pe=z.onScroll,ve=z.onMouseEnter,xe="".concat(de,"-item"),Se=Object(o.a)(function(){return je},[ge,je],function(Fe,Ce){return Ce[0]&&Fe[1]!==Ce[1]}),Le=M.useRef(null),ne=function(Ce){Ce.preventDefault()},ye=function(Ce){Le.current&&Le.current.scrollTo({index:Ce})},se=function(Ce){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=Se.length,ee=0;ee<Ee;ee+=1){var oe=(Ce+ee*_e+Ee)%Ee,q=Se[oe],me=q.group,Ie=q.data;if(!me&&!Ie.disabled)return oe}return-1},Pe=M.useState(function(){return se(0)}),Ze=Object(b.a)(Pe,2),et=Ze[0],Ge=Ze[1],ht=function(Ce){Ge(Ce);var _e=Se[Ce];if(!_e){Je(null,-1);return}Je(_e.data.value,Ce)};M.useEffect(function(){ht(Te!==!1?se(0):-1)},[Se.length,Ke]),M.useEffect(function(){var Fe=setTimeout(function(){if(!We&&ge&&Oe.size===1){var Ce=Array.from(Oe)[0],_e=Se.findIndex(function(Ee){var ee=Ee.data;return ee.value===Ce});ht(_e),ye(_e)}});return function(){return clearTimeout(Fe)}},[ge]);var ce=function(Ce){Ce!==void 0&&ze(Ce,{selected:!Oe.has(Ce)}),We||qe(!1)};if(M.useImperativeHandle(te,function(){return{onKeyDown:function(Ce){var _e=Ce.which;switch(_e){case i.a.UP:case i.a.DOWN:{var Ee=0;if(_e===i.a.UP?Ee=-1:_e===i.a.DOWN&&(Ee=1),Ee!==0){var ee=se(et+Ee,Ee);ye(ee),ht(ee)}break}case i.a.ENTER:{var oe=Se[et];oe&&!oe.data.disabled?ce(oe.data.value):ce(void 0),ge&&Ce.preventDefault();break}case i.a.ESC:qe(!1)}},onKeyUp:function(){},scrollTo:function(Ce){ye(Ce)}}}),Se.length===0)return M.createElement("div",{role:"listbox",id:"".concat(be,"_list"),className:"".concat(xe,"-empty"),onMouseDown:ne},Ae);function Me(Fe){var Ce=Se[Fe];if(!Ce)return null;var _e=Ce.data||{},Ee=_e.value,ee=_e.label,oe=_e.children,q=Object(c.a)(_e,!0),me=Ne?oe:ee;return Ce?M.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},q,{key:Fe,role:"option",id:"".concat(be,"_list_").concat(Fe),"aria-selected":Oe.has(Ee)}),Ee):null}return M.createElement(M.Fragment,null,M.createElement("div",{role:"listbox",id:"".concat(be,"_list"),style:{height:0,width:0,overflow:"hidden"}},Me(et-1),Me(et),Me(et+1)),M.createElement(a.a,{itemKey:"key",ref:Le,data:Se,height:we,itemHeight:ue,fullHeight:!1,onMouseDown:ne,onScroll:pe,virtual:Qe,onMouseEnter:ve},function(Fe,Ce){var _e,Ee=Fe.group,ee=Fe.groupOption,oe=Fe.data,q=oe.label,me=oe.key;if(Ee)return M.createElement("div",{className:n()(xe,"".concat(xe,"-group"))},q!==void 0?q:me);var Ie=oe.disabled,V=oe.value,Re=oe.title,He=oe.children,fe=oe.style,ke=oe.className,Xe=Object(E.a)(oe,["disabled","value","title","children","style","className"]),ot=Oe.has(V),tt="".concat(xe,"-option"),at=n()(xe,tt,ke,(_e={},Object(p.a)(_e,"".concat(tt,"-grouped"),ee),Object(p.a)(_e,"".concat(tt,"-active"),et===Ce&&!Ie),Object(p.a)(_e,"".concat(tt,"-disabled"),Ie),Object(p.a)(_e,"".concat(tt,"-selected"),ot),_e)),pt=Ne?He:q,Ct=!Ve||typeof Ve=="function"||ot;return M.createElement("div",Object.assign({},Xe,{"aria-selected":ot,className:at,title:Re,onMouseMove:function(){if(et===Ce||Ie)return;ht(Ce)},onClick:function(){Ie||ce(V)},style:fe}),M.createElement("div",{className:"".concat(tt,"-content")},pt||V),M.isValidElement(Ve)||ot,Ct&&M.createElement(t.a,{className:"".concat(xe,"-option-state"),customizeIcon:Ve,customizeIconProps:{isSelected:ot}},ot?"\u2713":null))}))},s=M.forwardRef(r);s.displayName="OptionList";var u=s,f=function(){return null};f.isSelectOption=!0;var d=f,v=function(){return null};v.isSelectOptGroup=!0;var m=v,S=Q("VTBJ"),C=Q("Zm9Q");function _(O){var z=O.key,te=O.props,de=te.children,be=te.value,je=Object(E.a)(te,["children","value"]);return Object(S.a)({key:z,value:be!==void 0?be:z,children:de},je)}function y(O){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(O).map(function(te,de){if(!M.isValidElement(te)||!te.type)return null;var be=te.type.isSelectOptGroup,je=te.key,Ne=te.props,Oe=Ne.children,Ke=Object(E.a)(Ne,["children"]);return z||!be?_(te):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(je===null?de:je,"__"),label:je},Ke),{},{options:y(Oe)})}).filter(function(te){return te})}var T=Q("2Qr1"),k=Q("qNPg"),g=Q("U8pU"),F=Q("Kwbf"),P=Q("WKfj");function N(O){var z=O.mode,te=O.options,de=O.children,be=O.backfill,je=O.allowClear,Ne=O.placeholder,Oe=O.getInputElement,Ke=O.showSearch,We=O.onSearch,Te=O.defaultOpen,we=O.autoFocus,ue=O.labelInValue,Ae=O.value,ge=O.inputValue,Ve=O.optionLabelProp,Qe=z==="multiple"||z==="tags",ze=Ke!==void 0?Ke:Qe||z==="combobox",qe=te||y(de);if(Object(F.a)(z!=="tags"||qe.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Je=qe.some(function(xe){return xe.options?xe.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(F.a)(!Je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(F.a)(z!=="combobox"||!Ve,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(F.a)(z==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(F.a)(z==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(F.b)(z!=="combobox"||!Oe||!je||!Ne,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),We&&!ze&&z!=="combobox"&&z!=="tags"&&Object(F.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(F.b)(!Te||we,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ae!=null){var pe=Object(P.d)(Ae);Object(F.a)(!ue||pe.every(function(xe){return Object(g.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(F.a)(!Qe||Array.isArray(Ae),"`value` should be array when `mode` is `multiple` or `tags`")}if(de){var ve=null;Object(C.a)(de).some(function(xe){if(!M.isValidElement(xe)||!xe.type)return!1;var Se=xe.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Le=Object(C.a)(xe.props.children).every(function(ne){return!M.isValidElement(ne)||!xe.type||ne.type.isSelectOption?!0:(ve=ne.type,!1)});return!Le}return ve=Se,!0}),ve&&Object(F.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ve.displayName||ve.name||ve,"`.")),Object(F.a)(ge===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var W=N,j=Object(k.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:y,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:W,fillOptionsWithMissingValue:T.a}),A=function(O){Object(I.a)(te,O);var z=Object(L.a)(te);function te(){var de;return Object(G.a)(this,te),de=z.apply(this,arguments),de.selectRef=M.createRef(),de.focus=function(){de.selectRef.current.focus()},de.blur=function(){de.selectRef.current.blur()},de}return Object(R.a)(te,[{key:"render",value:function(){return M.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),te}(M.Component);A.Option=d,A.OptGroup=m;var K=A,U=re.c=K},Lmeb:function(it,re,Q){},Lo0S:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.initLogging=p,re.getLogging=E,re.Error=re.Warn=re.Info=re.Debug=void 0;var G="warn",R=function(){};re.Debug=R;var I=function(){};re.Info=I;var L=function(){};re.Warn=L;var M=function(){};re.Error=M;function p(b){if(typeof b=="undefined"?b=G:G=b,re.Debug=R=re.Info=I=re.Warn=L=re.Error=M=function(){},typeof window.console!="undefined")switch(b){case"debug":re.Debug=R=console.debug.bind(window.console);case"info":re.Info=I=console.info.bind(window.console);case"warn":re.Warn=L=console.warn.bind(window.console);case"error":re.Error=M=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+b+"'")}}function E(){return G}p()},M8RZ:function(it,re,Q){"use strict";Q.d(re,"a",function(){return i});var G=Q("fWQN"),R=Q("mtLc"),I=Q("yKVA"),L=Q("879j"),M=Q("q1tI"),p=Q.n(M),E=Q("i8i4"),b=Q.n(E),i=function(c){Object(I.a)(h,c);var o=Object(L.a)(h);function h(n){var a;Object(G.a)(this,h),a=o.call(this,n);var t=window.document;return a.node=t.createElement("div"),t.body.appendChild(a.node),a}return Object(R.a)(h,[{key:"render",value:function(){var a=this.props.children;return Object(E.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),h}(p.a.Component)},MI8n:function(it,re,Q){"use strict";Q.d(re,"c",function(){return M}),Q.d(re,"b",function(){return i}),Q.d(re,"e",function(){return c}),Q.d(re,"a",function(){return o}),Q.d(re,"d",function(){return h}),Q.d(re,"f",function(){return n});var G=Q("/cxE"),R=Q("pmY6"),I=Q("24hK"),L=Q("5Y4S"),M;(function(a){a.None=()=>R.a.None;function t(N){return(W,j=null,A)=>{let K=!1,U;return U=N(O=>K?void 0:(U?U.dispose():K=!0,W.call(j,O)),null,A),K&&U.dispose(),U}}a.once=t;function r(N,W){return m((j,A=null,K)=>N(U=>j.call(A,W(U)),null,K))}a.map=r;function s(N,W){return m((j,A=null,K)=>N(U=>{W(U),j.call(A,U)},null,K))}a.forEach=s;function u(N,W){return m((j,A=null,K)=>N(U=>W(U)&&j.call(A,U),null,K))}a.filter=u;function f(N){return N}a.signal=f;function d(...N){return(W,j=null,A)=>Object(R.e)(...N.map(K=>K(U=>W.call(j,U),null,A)))}a.any=d;function v(N,W,j){let A=j;return r(N,K=>(A=W(A,K),A))}a.reduce=v;function m(N){let W;const j=new i({onFirstListenerAdd(){W=N(j.fire,j)},onLastListenerRemove(){W.dispose()}});return j.event}function S(N,W,j=100,A=!1,K){let U,O,z,te=0;const de=new i({leakWarningThreshold:K,onFirstListenerAdd(){U=N(be=>{te++,O=W(O,be),A&&!z&&(de.fire(O),O=void 0),clearTimeout(z),z=setTimeout(()=>{const je=O;O=void 0,z=void 0,(!A||te>1)&&de.fire(je),te=0},j)})},onLastListenerRemove(){U.dispose()}});return de.event}a.debounce=S;function C(N,W=(j,A)=>j===A){let j=!0,A;return u(N,K=>{const U=j||!W(K,A);return j=!1,A=K,U})}a.latch=C;function _(N,W){return[a.filter(N,W),a.filter(N,j=>!W(j))]}a.split=_;function y(N,W=!1,j=[]){let A=j.slice(),K=N(z=>{A?A.push(z):O.fire(z)});const U=()=>{A&&A.forEach(z=>O.fire(z)),A=null},O=new i({onFirstListenerAdd(){K||(K=N(z=>O.fire(z)))},onFirstListenerDidAdd(){A&&(W?setTimeout(U):U())},onLastListenerRemove(){K&&K.dispose(),K=null}});return O.event}a.buffer=y;class T{constructor(N){this.event=N}map(N){return new T(r(this.event,N))}forEach(N){return new T(s(this.event,N))}filter(N){return new T(u(this.event,N))}reduce(N,W){return new T(v(this.event,N,W))}latch(){return new T(C(this.event))}debounce(N,W=100,j=!1,A){return new T(S(this.event,N,W,j,A))}on(N,W,j){return this.event(N,W,j)}once(N,W,j){return t(this.event)(N,W,j)}}function k(N){return new T(N)}a.chain=k;function g(N,W,j=A=>A){const A=(...z)=>O.fire(j(...z)),K=()=>N.on(W,A),U=()=>N.removeListener(W,A),O=new i({onFirstListenerAdd:K,onLastListenerRemove:U});return O.event}a.fromNodeEventEmitter=g;function F(N,W,j=A=>A){const A=(...z)=>O.fire(j(...z)),K=()=>N.addEventListener(W,A),U=()=>N.removeEventListener(W,A),O=new i({onFirstListenerAdd:K,onLastListenerRemove:U});return O.event}a.fromDOMEventEmitter=F;function P(N){return new Promise(W=>t(N)(W))}a.toPromise=P})(M||(M={}));class p{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${p._idPool++}`}start(a){this._stopWatch=new L.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let E=-1;class b{constructor(a,t=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let t=E;if(typeof this.customThreshold=="number"&&(t=this.customThreshold),t<=0||a<t)return;this._stacks||(this._stacks=new Map);const r=new Error().stack.split(`
`).slice(3).join(`
`),s=this._stacks.get(r)||0;if(this._stacks.set(r,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=t*.5;let u,f=0;for(const[d,v]of this._stacks)(!u||f<v)&&(u=d,f=v);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${f}):`),console.warn(u)}return()=>{const u=this._stacks.get(r)||0;this._stacks.set(r,u-1)}}}class i{constructor(a){var t;this._disposed=!1,this._options=a,this._leakageMon=E>0?new b(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((t=this._options)===null||t===void 0?void 0:t._profName)?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(a,t,r)=>{var s;this._listeners||(this._listeners=new I.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const f=this._listeners.push(t?[a,t]:a);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,t);const d=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),v=Object(R.i)(()=>{if(d&&d(),!this._disposed&&(f(),this._options&&this._options.onLastListenerRemove)){const m=this._listeners&&!this._listeners.isEmpty();m||this._options.onLastListenerRemove(this)}});return r instanceof R.b?r.add(v):Array.isArray(r)&&r.push(v),v}),this._event}fire(a){var t,r;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new I.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,u]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,u):s[0].call(s[1],u)}catch(f){Object(G.f)(f)}}(r=this._perfMon)===null||r===void 0||r.stop()}}dispose(){var a,t,r,s,u;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(s=(r=this._options)===null||r===void 0?void 0:r.onLastListenerRemove)===null||s===void 0||s.call(r),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class c extends i{constructor(a){super(a);this._isPaused=0,this._eventQueue=new I.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class o extends c{constructor(a){var t;super(a);this._delay=(t=a.delay)!==null&&t!==void 0?t:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class h{constructor(){this.buffers=[]}wrapEvent(a){return(t,r,s)=>a(u=>{const f=this.buffers[this.buffers.length-1];f?f.push(()=>t.call(r,u)):t.call(r,u)},void 0,s)}bufferEvents(a){const t=[];this.buffers.push(t);const r=a();return this.buffers.pop(),t.forEach(s=>s()),r}}class n{constructor(){this.listening=!1,this.inputEvent=M.None,this.inputEventListener=R.a.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(it,re,Q){"use strict";(function(G,R){Q.d(re,"b",function(){return r}),Q.d(re,"i",function(){return d}),Q.d(re,"f",function(){return v}),Q.d(re,"d",function(){return m}),Q.d(re,"g",function(){return S}),Q.d(re,"h",function(){return C}),Q.d(re,"c",function(){return _}),Q.d(re,"k",function(){return y}),Q.d(re,"j",function(){return T}),Q.d(re,"a",function(){return k}),Q.d(re,"e",function(){return P});var I;const L="en";let M=!1,p=!1,E=!1,b=!1,i=!1,c=!1,o=!1,h,n=L,a,t;const r=typeof self=="object"?self:typeof G=="object"?G:{};let s;typeof r.vscode!="undefined"&&typeof r.vscode.process!="undefined"?s=r.vscode.process:typeof R!="undefined"&&(s=R);const u=typeof((I=s==null?void 0:s.versions)===null||I===void 0?void 0:I.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!u)t=navigator.userAgent,M=t.indexOf("Windows")>=0,p=t.indexOf("Macintosh")>=0,o=(t.indexOf("Macintosh")>=0||t.indexOf("iPad")>=0||t.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,E=t.indexOf("Linux")>=0,c=!0,h=navigator.language,n=h;else if(typeof s=="object"){M=s.platform==="win32",p=s.platform==="darwin",E=s.platform==="linux",b=E&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,h=L,n=L;const N=s.env.VSCODE_NLS_CONFIG;if(N)try{const W=JSON.parse(N),j=W.availableLanguages["*"];h=W.locale,n=j||L,a=W._translationsConfigFile}catch(W){}i=!0}else console.error("Unable to resolve platform.");let f=0;p?f=1:M?f=3:E&&(f=2);const d=M,v=p,m=E,S=i,C=c,_=o,y=t,T=function(){if(r.setImmediate)return r.setImmediate.bind(r);if(typeof r.postMessage=="function"&&!r.importScripts){let j=[];r.addEventListener("message",K=>{if(K.data&&K.data.vscodeSetImmediateId)for(let U=0,O=j.length;U<O;U++){const z=j[U];if(z.id===K.data.vscodeSetImmediateId){j.splice(U,1),z.callback();return}}});let A=0;return K=>{const U=++A;j.push({id:U,callback:K}),r.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const W=Promise.resolve();return j=>W.then(j)}(),k=p||o?2:M?1:3;let g=!0,F=!1;function P(){if(!F){F=!0;const N=new Uint8Array(2);N[0]=1,N[1]=2;const W=new Uint16Array(N.buffer);g=W[0]===(2<<8)+1}return g}}).call(this,Q("IyRk"),Q("Q2Ig"))},MZdM:function(it,re,Q){"use strict";function G(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(t){return typeof t}:G=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(n)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=b(Q("Lo0S")),I=p(Q("N/zr")),L=Q("GdRQ"),M=Q("GQ8N");function p(n){return n&&n.__esModule?n:{default:n}}function E(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return E=function(){return n},n}function b(n){if(n&&n.__esModule)return n;if(n===null||G(n)!=="object"&&typeof n!="function")return{default:n};var a=E();if(a&&a.has(n))return a.get(n);var t={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var u=r?Object.getOwnPropertyDescriptor(n,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=n[s]}return t.default=n,a&&a.set(n,t),t}function i(n,a){if(!(n instanceof a))throw new TypeError("Cannot call a class as a function")}function c(n,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function o(n,a,t){return a&&c(n.prototype,a),t&&c(n,t),n}var h=function(){function n(a){if(i(this,n),this._drawCtx=null,this._renderQ=[],this._flushing=!1,this._fbWidth=0,this._fbHeight=0,this._prevDrawStyle="",this._tile=null,this._tile16x16=null,this._tileX=0,this._tileY=0,R.Debug(">> Display.constructor"),this._target=a,!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},R.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),R.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}return o(n,[{key:"viewportChangePos",value:function(t,r){var s=this._viewportLoc;t=Math.floor(t),r=Math.floor(r),this._clipViewport||(t=-s.w,r=-s.h);var u=s.x+s.w-1,f=s.y+s.h-1;if(t<0&&s.x+t<0&&(t=-s.x),u+t>=this._fbWidth&&(t-=u+t-this._fbWidth+1),s.y+r<0&&(r=-s.y),f+r>=this._fbHeight&&(r-=f+r-this._fbHeight+1),t===0&&r===0)return;R.Debug("viewportChange deltaX: "+t+", deltaY: "+r),s.x+=t,s.y+=r,this._damage(s.x,s.y,s.w,s.h),this.flip()}},{key:"viewportChangeSize",value:function(t,r){(!this._clipViewport||typeof t=="undefined"||typeof r=="undefined")&&(R.Debug("Setting viewport to full display region"),t=this._fbWidth,r=this._fbHeight),t=Math.floor(t),r=Math.floor(r),t>this._fbWidth&&(t=this._fbWidth),r>this._fbHeight&&(r=this._fbHeight);var s=this._viewportLoc;if(s.w!==t||s.h!==r){s.w=t,s.h=r;var u=this._target;u.width=t,u.height=r,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,r){this._prevDrawStyle="",this._fbWidth=t,this._fbHeight=r;var s=this._backbuffer;if(s.width!==t||s.height!==r){var u=null;s.width>0&&s.height>0&&(u=this._drawCtx.getImageData(0,0,s.width,s.height)),s.width!==t&&(s.width=t),s.height!==r&&(s.height=r),u&&this._drawCtx.putImageData(u,0,0)}var f=this._viewportLoc;this.viewportChangeSize(f.w,f.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(t,r,s,u){t<this._damageBounds.left&&(this._damageBounds.left=t),r<this._damageBounds.top&&(this._damageBounds.top=r),t+s>this._damageBounds.right&&(this._damageBounds.right=t+s),r+u>this._damageBounds.bottom&&(this._damageBounds.bottom=r+u)}},{key:"flip",value:function(t){if(this._renderQ.length!==0&&!t)this._renderQPush({type:"flip"});else{var r=this._damageBounds.left,s=this._damageBounds.top,u=this._damageBounds.right-r,f=this._damageBounds.bottom-s,d=r-this._viewportLoc.x,v=s-this._viewportLoc.y;d<0&&(u+=d,r-=d,d=0),v<0&&(f+=v,s-=v,v=0),d+u>this._viewportLoc.w&&(u=this._viewportLoc.w-d),v+f>this._viewportLoc.h&&(f=this._viewportLoc.h-v),u>0&&f>0&&this._targetCtx.drawImage(this._backbuffer,r,s,u,f,d,v,u,f),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,r,s,u,f,d){this._renderQ.length!==0&&!d?this._renderQPush({type:"fill",x:t,y:r,width:s,height:u,color:f}):(this._setFillColor(f),this._drawCtx.fillRect(t,r,s,u),this._damage(t,r,s,u))}},{key:"copyImage",value:function(t,r,s,u,f,d,v){this._renderQ.length!==0&&!v?this._renderQPush({type:"copy",oldX:t,oldY:r,x:s,y:u,width:f,height:d}):(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,t,r,f,d,s,u,f,d),this._damage(s,u,f,d))}},{key:"imageRect",value:function(t,r,s,u,f,d){if(s===0||u===0)return;var v=new Image;v.src="data: "+f+";base64,"+I.default.encode(d),this._renderQPush({type:"img",img:v,x:t,y:r,width:s,height:u})}},{key:"startTile",value:function(t,r,s,u,f){this._tileX=t,this._tileY=r,s===16&&u===16?this._tile=this._tile16x16:this._tile=this._drawCtx.createImageData(s,u);for(var d=f[2],v=f[1],m=f[0],S=this._tile.data,C=0;C<s*u*4;C+=4)S[C]=d,S[C+1]=v,S[C+2]=m,S[C+3]=255}},{key:"subTile",value:function(t,r,s,u,f){for(var d=f[2],v=f[1],m=f[0],S=t+s,C=r+u,_=this._tile.data,y=this._tile.width,T=r;T<C;T++)for(var k=t;k<S;k++){var g=(k+T*y)*4;_[g]=d,_[g+1]=v,_[g+2]=m,_[g+3]=255}}},{key:"finishTile",value:function(){this._drawCtx.putImageData(this._tile,this._tileX,this._tileY),this._damage(this._tileX,this._tileY,this._tile.width,this._tile.height)}},{key:"blitImage",value:function(t,r,s,u,f,d,v){if(this._renderQ.length!==0&&!v){var m=new Uint8Array(s*u*4);m.set(new Uint8Array(f.buffer,0,m.length)),this._renderQPush({type:"blit",data:m,x:t,y:r,width:s,height:u})}else this._bgrxImageData(t,r,s,u,f,d)}},{key:"blitRgbImage",value:function(t,r,s,u,f,d,v){if(this._renderQ.length!==0&&!v){var m=new Uint8Array(s*u*3);m.set(new Uint8Array(f.buffer,0,m.length)),this._renderQPush({type:"blitRgb",data:m,x:t,y:r,width:s,height:u})}else this._rgbImageData(t,r,s,u,f,d)}},{key:"blitRgbxImage",value:function(t,r,s,u,f,d,v){if(this._renderQ.length!==0&&!v){var m=new Uint8Array(s*u*4);m.set(new Uint8Array(f.buffer,0,m.length)),this._renderQPush({type:"blitRgbx",data:m,x:t,y:r,width:s,height:u})}else this._rgbxImageData(t,r,s,u,f,d)}},{key:"drawImage",value:function(t,r,s){this._drawCtx.drawImage(t,r,s),this._damage(r,s,t.width,t.height)}},{key:"autoscale",value:function(t,r){var s;if(t===0||r===0)s=0;else{var u=this._viewportLoc,f=t/r,d=u.w/u.h;d>=f?s=t/u.w:s=r/u.h}this._rescale(s)}},{key:"_rescale",value:function(t){this._scale=t;var r=this._viewportLoc,s=t*r.w+"px",u=t*r.h+"px";(this._target.style.width!==s||this._target.style.height!==u)&&(this._target.style.width=s,this._target.style.height=u)}},{key:"_setFillColor",value:function(t){var r="rgb("+t[2]+","+t[1]+","+t[0]+")";r!==this._prevDrawStyle&&(this._drawCtx.fillStyle=r,this._prevDrawStyle=r)}},{key:"_rgbImageData",value:function(t,r,s,u,f,d){for(var v=this._drawCtx.createImageData(s,u),m=v.data,S=0,C=d;S<s*u*4;S+=4,C+=3)m[S]=f[C],m[S+1]=f[C+1],m[S+2]=f[C+2],m[S+3]=255;this._drawCtx.putImageData(v,t,r),this._damage(t,r,v.width,v.height)}},{key:"_bgrxImageData",value:function(t,r,s,u,f,d){for(var v=this._drawCtx.createImageData(s,u),m=v.data,S=0,C=d;S<s*u*4;S+=4,C+=4)m[S]=f[C+2],m[S+1]=f[C+1],m[S+2]=f[C],m[S+3]=255;this._drawCtx.putImageData(v,t,r),this._damage(t,r,v.width,v.height)}},{key:"_rgbxImageData",value:function(t,r,s,u,f,d){var v;L.supportsImageMetadata?v=new ImageData(new Uint8ClampedArray(f.buffer,f.byteOffset,s*u*4),s,u):(v=this._drawCtx.createImageData(s,u),v.data.set(new Uint8ClampedArray(f.buffer,f.byteOffset,s*u*4))),this._drawCtx.putImageData(v,t,r),this._damage(t,r,v.width,v.height)}},{key:"_renderQPush",value:function(t){this._renderQ.push(t),this._renderQ.length===1&&this._scanRenderQ()}},{key:"_resumeRenderQ",value:function(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}},{key:"_scanRenderQ",value:function(){for(var t=!0;t&&this._renderQ.length>0;){var r=this._renderQ[0];switch(r.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(r.oldX,r.oldY,r.x,r.y,r.width,r.height,!0);break;case"fill":this.fillRect(r.x,r.y,r.width,r.height,r.color,!0);break;case"blit":this.blitImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"blitRgb":this.blitRgbImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"img":if(r.img.complete&&r.img.width!==0&&r.img.height!==0){if(r.img.width!==r.width||r.img.height!==r.height){R.Error("Decoded image has incorrect dimensions. Got "+r.img.width+"x"+r.img.height+". Expected "+r.width+"x"+r.height+".");return}this.drawImage(r.img,r.x,r.y)}else r.img._noVNCDisplay=this,r.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 r=this._viewportLoc;this.viewportChangeSize(r.w,r.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}]),n}();re.default=h},Mmt2:function(it,re,Q){"use strict";function G(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(n){return typeof n}:G=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},G(o)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return I=function(){return o},o}function L(o){if(o&&o.__esModule)return o;if(o===null||G(o)!=="object"&&typeof o!="function")return{default:o};var h=I();if(h&&h.has(o))return h.get(o);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var r=a?Object.getOwnPropertyDescriptor(o,t):null;r&&(r.get||r.set)?Object.defineProperty(n,t,r):n[t]=o[t]}return n.default=o,h&&h.set(o,n),n}function M(o,h){if(!(o instanceof h))throw new TypeError("Cannot call a class as a function")}function p(o,h){for(var n=0;n<h.length;n++){var a=h[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function E(o,h,n){return h&&p(o.prototype,h),n&&p(o,n),o}var b=!1,i=40*1024*1024,c=function(){function o(){M(this,o),this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=1024*1024*4,this._rQ=null,this._sQbufferSize=1024*10,this._sQlen=0,this._sQ=null,this._eventHandlers={message:function(){},open:function(){},close:function(){},error:function(){}}}return E(o,[{key:"rQpeek8",value:function(){return this._rQ[this._rQi]}},{key:"rQskipBytes",value:function(n){this._rQi+=n}},{key:"rQshift8",value:function(){return this._rQshift(1)}},{key:"rQshift16",value:function(){return this._rQshift(2)}},{key:"rQshift32",value:function(){return this._rQshift(4)}},{key:"_rQshift",value:function(n){for(var a=0,t=n-1;t>=0;t--)a+=this._rQ[this._rQi++]<<t*8;return a}},{key:"rQshiftStr",value:function(n){typeof n=="undefined"&&(n=this.rQlen);for(var a="",t=0;t<n;t+=4096){var r=this.rQshiftBytes(Math.min(4096,n-t));a+=String.fromCharCode.apply(null,r)}return a}},{key:"rQshiftBytes",value:function(n){return typeof n=="undefined"&&(n=this.rQlen),this._rQi+=n,new Uint8Array(this._rQ.buffer,this._rQi-n,n)}},{key:"rQshiftTo",value:function(n,a){a===void 0&&(a=this.rQlen),n.set(new Uint8Array(this._rQ.buffer,this._rQi,a)),this._rQi+=a}},{key:"rQslice",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+n,a-n)}},{key:"rQwait",value:function(n,a,t){if(this.rQlen<a){if(t){if(this._rQi<t)throw new Error("rQwait cannot backup "+t+" bytes");this._rQi-=t}return!0}return!1}},{key:"flush",value:function(){this._sQlen>0&&this._websocket.readyState===WebSocket.OPEN&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}},{key:"send",value:function(n){this._sQ.set(n,this._sQlen),this._sQlen+=n.length,this.flush()}},{key:"sendString",value:function(n){this.send(n.split("").map(function(a){return a.charCodeAt(0)}))}},{key:"off",value:function(n){this._eventHandlers[n]=function(){}}},{key:"on",value:function(n,a){this._eventHandlers[n]=a}},{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(n,a){var t=this;this.init(),this._websocket=new WebSocket(n,a),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){R.Debug(">> WebSock.onopen"),t._websocket.protocol&&R.Info("Server choose sub-protocol: "+t._websocket.protocol),t._eventHandlers.open(),R.Debug("<< WebSock.onopen")},this._websocket.onclose=function(r){R.Debug(">> WebSock.onclose"),t._eventHandlers.close(r),R.Debug("<< WebSock.onclose")},this._websocket.onerror=function(r){R.Debug(">> WebSock.onerror: "+r),t._eventHandlers.error(r),R.Debug("<< WebSock.onerror: "+r)}}},{key:"close",value:function(){this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(R.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(n){var a=(this._rQlen-this._rQi+n)*8,t=this._rQbufferSize<a;if(t&&(this._rQbufferSize=Math.max(this._rQbufferSize*2,a)),this._rQbufferSize>i&&(this._rQbufferSize=i,this._rQbufferSize-this.rQlen<n))throw new Error("Receive Queue buffer exceeded "+i+" bytes, and the new message could not fit");if(t){var r=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(r,this._rQi,this._rQlen-this._rQi))}else b?this._rQ.copyWithin(0,this._rQi,this._rQlen):this._rQ.set(new Uint8Array(this._rQ.buffer,this._rQi,this._rQlen-this._rQi));this._rQlen=this._rQlen-this._rQi,this._rQi=0}},{key:"_DecodeMessage",value:function(n){var a=new Uint8Array(n);a.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(a.length),this._rQ.set(a,this._rQlen),this._rQlen+=a.length}},{key:"_recvMessage",value:function(n){this._DecodeMessage(n.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):R.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(n){this._rQi=n}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}]),o}();re.default=c},"N/zr":function(it,re,Q){"use strict";function G(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(b){return typeof b}:G=function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},G(p)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return I=function(){return p},p}function L(p){if(p&&p.__esModule)return p;if(p===null||G(p)!=="object"&&typeof p!="function")return{default:p};var E=I();if(E&&E.has(p))return E.get(p);var b={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in p)if(Object.prototype.hasOwnProperty.call(p,c)){var o=i?Object.getOwnPropertyDescriptor(p,c):null;o&&(o.get||o.set)?Object.defineProperty(b,c,o):b[c]=p[c]}return b.default=p,E&&E.set(p,b),b}var M={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(E){"use strict";for(var b="",i=E.length,c=i%3,o=0;o<i-2;o+=3)b+=this.toBase64Table[E[o]>>2],b+=this.toBase64Table[((E[o]&3)<<4)+(E[o+1]>>4)],b+=this.toBase64Table[((E[o+1]&15)<<2)+(E[o+2]>>6)],b+=this.toBase64Table[E[o+2]&63];var h=i-c;return c===2?(b+=this.toBase64Table[E[h]>>2],b+=this.toBase64Table[((E[h]&3)<<4)+(E[h+1]>>4)],b+=this.toBase64Table[(E[h+1]&15)<<2],b+=this.toBase64Table[64]):c===1&&(b+=this.toBase64Table[E[h]>>2],b+=this.toBase64Table[(E[h]&3)<<4],b+=this.toBase64Table[64],b+=this.toBase64Table[64]),b},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 b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=E.indexOf("=")-b;i<0&&(i=E.length-b);for(var c=(i>>2)*3+Math.floor(i%4/1.5),o=new Array(c),h=0,n=0,a=0,t=b;t<E.length;t++){var r=this.toBinaryTable[E.charCodeAt(t)&127],s=E.charAt(t)===this.base64Pad;if(r===-1){R.Error("Illegal character code "+E.charCodeAt(t)+" at position "+t);continue}n=n<<6|r,h+=6,h>=8&&(h-=8,s||(o[a++]=n>>h&255),n&=(1<<h)-1)}if(h){var u=new Error("Corrupted base64 string");throw u.name="Base64-Error",u}return o}};re.default=M},N0LK:function(it,re,Q){"use strict";Q.d(re,"C",function(){return G}),Q.d(re,"v",function(){return I}),Q.d(re,"s",function(){return L}),Q.d(re,"t",function(){return M}),Q.d(re,"U",function(){return p}),Q.d(re,"J",function(){return E}),Q.d(re,"O",function(){return b}),Q.d(re,"p",function(){return i}),Q.d(re,"T",function(){return c}),Q.d(re,"q",function(){return o}),Q.d(re,"N",function(){return h}),Q.d(re,"M",function(){return n}),Q.d(re,"Q",function(){return a}),Q.d(re,"u",function(){return t}),Q.d(re,"x",function(){return r}),Q.d(re,"I",function(){return s}),Q.d(re,"f",function(){return u}),Q.d(re,"h",function(){return f}),Q.d(re,"g",function(){return d}),Q.d(re,"i",function(){return v}),Q.d(re,"G",function(){return m}),Q.d(re,"H",function(){return S}),Q.d(re,"r",function(){return C}),Q.d(re,"R",function(){return _}),Q.d(re,"d",function(){return y}),Q.d(re,"e",function(){return T}),Q.d(re,"E",function(){return k}),Q.d(re,"F",function(){return g}),Q.d(re,"j",function(){return F}),Q.d(re,"z",function(){return P}),Q.d(re,"K",function(){return W}),Q.d(re,"L",function(){return j}),Q.d(re,"m",function(){return K}),Q.d(re,"k",function(){return O}),Q.d(re,"A",function(){return te}),Q.d(re,"a",function(){return de}),Q.d(re,"n",function(){return be}),Q.d(re,"l",function(){return je}),Q.d(re,"D",function(){return Ne}),Q.d(re,"B",function(){return Oe}),Q.d(re,"b",function(){return Ke}),Q.d(re,"S",function(){return We}),Q.d(re,"o",function(){return Te}),Q.d(re,"P",function(){return we}),Q.d(re,"w",function(){return ue}),Q.d(re,"c",function(){return Ae}),Q.d(re,"y",function(){return Qe});function G(pe){return!pe||typeof pe!="string"?!0:pe.trim().length===0}const R=/{(\d+)}/g;function I(pe,...ve){return ve.length===0?pe:pe.replace(R,function(xe,Se){const Le=parseInt(Se,10);return isNaN(Le)||Le<0||Le>=ve.length?xe:ve[Le]})}function L(pe){return pe.replace(/[<>&]/g,function(ve){switch(ve){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ve}})}function M(pe){return pe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(pe,ve=" "){const xe=E(pe,ve);return b(xe,ve)}function E(pe,ve){if(!pe||!ve)return pe;const xe=ve.length;if(xe===0||pe.length===0)return pe;let Se=0;for(;pe.indexOf(ve,Se)===Se;)Se=Se+xe;return pe.substring(Se)}function b(pe,ve){if(!pe||!ve)return pe;const xe=ve.length,Se=pe.length;if(xe===0||Se===0)return pe;let Le=Se,ne=-1;for(;!(ne=pe.lastIndexOf(ve,Le-1),ne===-1||ne+xe!==Le);){if(ne===0)return"";Le=ne}return pe.substring(0,Le)}function i(pe){return pe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function c(pe){return pe.replace(/\*/g,"")}function o(pe,ve,xe={}){if(!pe)throw new Error("Cannot create regex from empty string");ve||(pe=M(pe)),xe.wholeWord&&(/\B/.test(pe.charAt(0))||(pe="\\b"+pe),/\B/.test(pe.charAt(pe.length-1))||(pe=pe+"\\b"));let Se="";return xe.global&&(Se+="g"),xe.matchCase||(Se+="i"),xe.multiline&&(Se+="m"),xe.unicode&&(Se+="u"),new RegExp(pe,Se)}function h(pe){if(pe.source==="^"||pe.source==="^$"||pe.source==="$"||pe.source==="^\\s*$")return!1;const ve=pe.exec("");return!!(ve&&pe.lastIndex===0)}function n(pe){return(pe.global?"g":"")+(pe.ignoreCase?"i":"")+(pe.multiline?"m":"")+(pe.unicode?"u":"")}function a(pe){return pe.split(/\r\n|\r|\n/)}function t(pe){for(let ve=0,xe=pe.length;ve<xe;ve++){const Se=pe.charCodeAt(ve);if(Se!==32&&Se!==9)return ve}return-1}function r(pe,ve=0,xe=pe.length){for(let Se=ve;Se<xe;Se++){const Le=pe.charCodeAt(Se);if(Le!==32&&Le!==9)return pe.substring(ve,Se)}return pe.substring(ve,xe)}function s(pe,ve=pe.length-1){for(let xe=ve;xe>=0;xe--){const Se=pe.charCodeAt(xe);if(Se!==32&&Se!==9)return xe}return-1}function u(pe,ve){return pe<ve?-1:pe>ve?1:0}function f(pe,ve,xe=0,Se=pe.length,Le=0,ne=ve.length){for(;xe<Se&&Le<ne;xe++,Le++){let Pe=pe.charCodeAt(xe),Ze=ve.charCodeAt(Le);if(Pe<Ze)return-1;if(Pe>Ze)return 1}const ye=Se-xe,se=ne-Le;return ye<se?-1:ye>se?1:0}function d(pe,ve){return v(pe,ve,0,pe.length,0,ve.length)}function v(pe,ve,xe=0,Se=pe.length,Le=0,ne=ve.length){for(;xe<Se&&Le<ne;xe++,Le++){let Pe=pe.charCodeAt(xe),Ze=ve.charCodeAt(Le);if(Pe===Ze)continue;if(Pe>=128||Ze>=128)return f(pe.toLowerCase(),ve.toLowerCase(),xe,Se,Le,ne);m(Pe)&&(Pe-=32),m(Ze)&&(Ze-=32);const et=Pe-Ze;if(et===0)continue;return et}const ye=Se-xe,se=ne-Le;return ye<se?-1:ye>se?1:0}function m(pe){return pe>=97&&pe<=122}function S(pe){return pe>=65&&pe<=90}function C(pe,ve){return pe.length===ve.length&&v(pe,ve)===0}function _(pe,ve){const xe=ve.length;return ve.length>pe.length?!1:v(pe,ve,0,xe)===0}function y(pe,ve){let xe,Se=Math.min(pe.length,ve.length);for(xe=0;xe<Se;xe++)if(pe.charCodeAt(xe)!==ve.charCodeAt(xe))return xe;return Se}function T(pe,ve){let xe,Se=Math.min(pe.length,ve.length);const Le=pe.length-1,ne=ve.length-1;for(xe=0;xe<Se;xe++)if(pe.charCodeAt(Le-xe)!==ve.charCodeAt(ne-xe))return xe;return Se}function k(pe){return 55296<=pe&&pe<=56319}function g(pe){return 56320<=pe&&pe<=57343}function F(pe,ve){return(pe-55296<<10)+(ve-56320)+65536}function P(pe,ve,xe){const Se=pe.charCodeAt(xe);if(k(Se)&&xe+1<ve){const Le=pe.charCodeAt(xe+1);if(g(Le))return F(Se,Le)}return Se}function N(pe,ve){const xe=pe.charCodeAt(ve-1);if(g(xe)&&ve>1){const Se=pe.charCodeAt(ve-2);if(k(Se))return F(Se,xe)}return xe}function W(pe,ve){const xe=ge.getInstance(),Se=ve,Le=pe.length,ne=P(pe,Le,ve);ve+=ne>=65536?2:1;let ye=xe.getGraphemeBreakType(ne);for(;ve<Le;){const se=P(pe,Le,ve),Pe=xe.getGraphemeBreakType(se);if(Ae(ye,Pe))break;ve+=se>=65536?2:1,ye=Pe}return ve-Se}function j(pe,ve){const xe=ge.getInstance(),Se=ve,Le=N(pe,ve);ve-=Le>=65536?2:1;let ne=xe.getGraphemeBreakType(Le);for(;ve>0;){const ye=N(pe,ve),se=xe.getGraphemeBreakType(ye);if(Ae(se,ne))break;ve-=ye>=65536?2:1,ne=se}return Se-ve}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function K(pe){return A.test(pe)}const U=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function O(pe){return U.test(pe)}const z=/^[\t\n\r\x20-\x7E]*$/;function te(pe){return z.test(pe)}const de=/[\u2028\u2029]/;function be(pe){return de.test(pe)}function je(pe){for(let ve=0,xe=pe.length;ve<xe;ve++)if(Ne(pe.charCodeAt(ve)))return!0;return!1}function Ne(pe){return pe=+pe,pe>=11904&&pe<=55215||pe>=63744&&pe<=64255||pe>=65281&&pe<=65374}function Oe(pe){return pe>=127462&&pe<=127487||pe===8986||pe===8987||pe===9200||pe===9203||pe>=9728&&pe<=10175||pe===11088||pe===11093||pe>=127744&&pe<=128591||pe>=128640&&pe<=128764||pe>=128992&&pe<=129003||pe>=129280&&pe<=129535||pe>=129648&&pe<=129750}const Ke=String.fromCharCode(65279);function We(pe){return!!(pe&&pe.length>0&&pe.charCodeAt(0)===65279)}function Te(pe,ve=!1){return pe?(ve&&(pe=pe.replace(/\\./g,"")),pe.toLowerCase()!==pe):!1}function we(pe){const ve=90-65+1;return pe=pe%(2*ve),pe<ve?String.fromCharCode(97+pe):String.fromCharCode(65+pe-ve)}function ue(pe){const ve=ge.getInstance();return ve.getGraphemeBreakType(pe)}function Ae(pe,ve){return pe===0?ve!==5&&ve!==7:pe===2&&ve===3?!1:pe===4||pe===2||pe===3||(ve===4||ve===2||ve===3)?!0:pe===8&&(ve===8||ve===9||ve===11||ve===12)||((pe===11||pe===9)&&(ve===9||ve===10)||((pe===12||pe===10)&&ve===10||(ve===5||ve===13||(ve===7||(pe===1||pe===13&&ve===14)))))?!1:!(pe===6&&ve===6)}class ge{constructor(){this._data=Ve()}static getInstance(){return ge._INSTANCE||(ge._INSTANCE=new ge),ge._INSTANCE}getGraphemeBreakType(pe){if(pe<32)return pe===10?3:pe===13?2:4;if(pe<127)return 0;const ve=this._data,xe=ve.length/3;let Se=1;for(;Se<=xe;)if(pe<ve[3*Se])Se=2*Se;else if(pe>ve[3*Se+1])Se=2*Se+1;else return ve[3*Se+2];return 0}}ge._INSTANCE=null;function Ve(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Qe(pe,ve){if(pe===0)return 0;const xe=ze(pe,ve);if(xe!==void 0)return xe;const Se=N(ve,pe);return pe-=qe(Se),pe}function ze(pe,ve){let xe=N(ve,pe);for(pe-=qe(xe);Je(xe)||xe===65039||xe===8419;){if(pe===0)return;xe=N(ve,pe),pe-=qe(xe)}if(!Oe(xe))return;if(pe>=0){const Se=N(ve,pe);Se===8205&&(pe-=qe(Se))}return pe}function qe(pe){return pe>=65536?2:1}function Je(pe){return 127995<=pe&&pe<=127999}},NBmB:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.encodingName=R,re.encodings=void 0;var G={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingTightPNG:-260,pseudoEncodingQualityLevel9:-23,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel9:-247,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};re.encodings=G;function R(I){switch(I){case G.encodingRaw:return"Raw";case G.encodingCopyRect:return"CopyRect";case G.encodingRRE:return"RRE";case G.encodingHextile:return"Hextile";case G.encodingTight:return"Tight";case G.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+I+"]"}}},OLES:function(it,re,Q){"use strict";var G=Q("U8pU"),R=Q("VTBJ"),I=Q("Ff2n"),L=Q("q1tI"),M=Q("uciX"),p=Q("7ixt"),E=function(n){var a=n.overlay,t=n.prefixCls,r=n.id,s=n.overlayInnerStyle;return L.createElement("div",{className:"".concat(t,"-inner"),id:r,role:"tooltip",style:s},typeof a=="function"?a():a)},b=E,i=function(n,a){var t=n.overlayClassName,r=n.trigger,s=r===void 0?["hover"]:r,u=n.mouseEnterDelay,f=u===void 0?0:u,d=n.mouseLeaveDelay,v=d===void 0?.1:d,m=n.overlayStyle,S=n.prefixCls,C=S===void 0?"rc-tooltip":S,_=n.children,y=n.onVisibleChange,T=n.afterVisibleChange,k=n.transitionName,g=n.animation,F=n.placement,P=F===void 0?"right":F,N=n.align,W=N===void 0?{}:N,j=n.destroyTooltipOnHide,A=j===void 0?!1:j,K=n.defaultVisible,U=n.getTooltipContainer,O=n.overlayInnerStyle,z=Object(I.a)(n,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(L.useRef)(null);Object(L.useImperativeHandle)(a,function(){return te.current});var de=Object(R.a)({},z);"visible"in n&&(de.popupVisible=n.visible);var be=function(){var We=n.arrowContent,Te=We===void 0?null:We,we=n.overlay,ue=n.id;return[L.createElement("div",{className:"".concat(C,"-arrow"),key:"arrow"},Te),L.createElement(b,{key:"content",prefixCls:C,id:ue,overlay:we,overlayInnerStyle:O})]},je=!1,Ne=!1;if(typeof A=="boolean")je=A;else if(A&&Object(G.a)(A)==="object"){var Oe=A.keepParent;je=Oe===!0,Ne=Oe===!1}return L.createElement(M.a,Object.assign({popupClassName:t,prefixCls:C,popup:be,action:s,builtinPlacements:p.a,popupPlacement:P,ref:te,popupAlign:W,getPopupContainer:U,onPopupVisibleChange:y,afterPopupVisibleChange:T,popupTransitionName:k,popupAnimation:g,defaultPopupVisible:K,destroyPopupOnHide:je,autoDestroy:Ne,mouseLeaveDelay:v,popupStyle:m,mouseEnterDelay:f},de),_)},c=Object(L.forwardRef)(i),o=re.a=c},Ot1p:function(it,re,Q){"use strict";var G=Q("2qtc"),R=Q("kLXV"),I=Q("rAM+"),L=Q("miYZ"),M=Q("tsqr"),p=Q("9og8"),E=Q("tJVT"),b=Q("jrin"),i=Q("WmNS"),c=Q.n(i),o=Q("q1tI"),h=Q.n(o),n=Q("VrN/"),a=Q.n(n),t=Q("bdgK"),r=Q("p77/"),s=Q("Bd2K"),u=Q("ELLl"),f=Q("19Vz"),d=Q("lZu9"),v=Q("+NIl"),m=Q("kSUc"),S=Q("9Bee"),C=function(Ie){var V=Ie.value,Re=V===void 0?"":V,He=Ie.className,fe=Ie.showTextOnly,ke=Ie.showLines,Xe=Ie.style,ot=Xe===void 0?{}:Xe,tt=Object(o.useMemo)(function(){return""},[Re]);return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},_=Q("0Owb"),y=Q("dejd"),T=Q("C+DQ"),k=Q("1vsH"),g=Q("m3rI"),F=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function P(Ie){var V=Ie.onActionCallback,Re=Ie.title,He=Ie.icon,fe=Ie.actionName,ke=Ie.className,Xe=ke===void 0?"":ke,ot=Ie.children;function tt(){V(fe)}return h.a.createElement("a",{title:Re,className:Xe,onClick:tt},h.a.createElement("i",{className:"md-iconfont ".concat(He)}),ot)}var N=function(Ie){var V=Ie.watch,Re=Ie.showNullButton,He=Ie.onActionCallback,fe=Ie.fullScreen,ke=Ie.insertTemp,Xe=Ie.hidetoolBar,ot=Ie.uuid,tt=Ie.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(k.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(k.F)("_educoder_session"),"&key=").concat(ot,"&api=").concat(encodeURIComponent(g.a.PROXY_SERVER)));var at=[].concat(F,[{title:"".concat(V?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(V?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return h.a.createElement("ul",{className:"markdown-toolbar-container"},!Xe&&at.map(function(pt,Ct){return h.a.createElement("li",{key:Ct},pt.actionName?h.a.createElement(P,Object(_.a)({},pt,{onActionCallback:He})):h.a.createElement("span",{className:"v-line"}))}),Re?h.a.createElement("li",null,h.a.createElement(P,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:He},h.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ke&&h.a.createElement("li",null,h.a.createElement(P,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ke),onActionCallback:He},h.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),h.a.createElement("li",{className:"btn-full-screen"},h.a.createElement(P,{icon:"".concat(fe?"icon-shrink":"icon-enlarge"),title:fe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:He})))},W=Q("M8RZ"),j=Q("+L6B"),A=Q("2/Rp"),K=Q("y8nQ"),U=Q("Vl3Y"),O=Q("5NDa"),z=Q("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},de=function(Ie){var V=Ie.callback,Re=Ie.onCancel;function He(fe){V(fe)}return h.a.createElement(U.a,Object(_.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:He}),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},h.a.createElement(z.a,null)),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},h.a.createElement(z.a,null)),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Re},"\u53D6\u6D88")))},be=Q("7ahc"),je=Q("HmJG"),Ne=Q("BjJ7"),Oe=U.a.useForm,Ke={width:280,marginRight:10},We={labelCol:{span:5},wrapperCol:{span:19}},Te=function(Ie){var V=Ie.callback,Re=Ie.onCancel,He=Oe(),fe=Object(E.a)(He,1),ke=fe[0];function Xe(at){V(at)}function ot(at,pt){if(at.status===-1){M.b.error(at.message);return}ke.setFieldsValue({src:"/api/attachments/".concat(at.id),type:pt.type})}function tt(at){var pt=at.target.files[0];ue(pt,ot)}return h.a.createElement(U.a,Object(_.a)({form:ke},We,{className:"upload-image-panel",onFinish:Xe}),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},h.a.createElement("div",{className:"flex-container"},h.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},h.a.createElement(z.a,{style:Ke})),h.a.createElement(we,{onFileChange:tt}))),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},h.a.createElement(z.a,{style:{width:264}})),h.a.createElement(U.a.Item,{style:{textAlign:"right"}},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Re},"\u53D6\u6D88")))};function we(Ie){var V=Ie.onFileChange;return h.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",h.a.createElement("input",{type:"file",onChange:V}))}function ue(Ie,V){if(!Ie)throw new String("\u6CA1\u6709\u6587\u4EF6");var Re=new FormData;Re.append("editormd-image-file",Ie),Re.append("file_param_name","editormd-image-file"),Re.append("byxhr","true");var He=new window.XMLHttpRequest;He.withCredentials=!0,He.addEventListener("load",function(fe){V(JSON.parse(fe.target.responseText),Ie)},!1),He.addEventListener("error",function(fe){console.error(fe)},!1),He.open("POST","".concat(Ne.a,"/api/attachments.json")),He.send(Re)}var Ae=Q("giR+"),ge=Q("fyUT"),Ve=Q("7Kak"),Qe=Q("9yH6"),ze=Qe.a.Group,qe={margin:"0 8px"},Je=function(Ie){var V=Ie.callback,Re=Ie.onCancel;function He(fe){V(fe)}return h.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:He},h.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},h.a.createElement("span",{style:qe},"\u5355\u5143\u683C\u6570\uFF1A"),h.a.createElement("span",{style:qe},"\u884C\u6570"),h.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},h.a.createElement(ge.a,null)),h.a.createElement("span",{style:qe},"\u5217\u6570"),h.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},h.a.createElement(ge.a,null))),h.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},h.a.createElement("span",{style:qe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),h.a.createElement(U.a.Item,{name:"align"},h.a.createElement(ze,null,h.a.createElement(Qe.a,{value:"default"},h.a.createElement("i",{className:"fa fa-align-justify"})),h.a.createElement(Qe.a,{value:"left"},h.a.createElement("i",{className:"fa fa-align-left"})),h.a.createElement(Qe.a,{value:"center"},h.a.createElement("i",{className:"fa fa-align-center"})),h.a.createElement(Qe.a,{value:"right"},h.a.createElement("i",{className:"fa fa-align-right"}))))),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Re},"\u53D6\u6D88")))},pe=Q("ErOA"),ve=Q("7Cbv"),xe="link",Se="upload-image",Le="code-block",ne="add-table",ye="------------",se={default:ye,left:":".concat(ye),center:":".concat(ye,":"),right:"".concat(ye,":")},Pe=Q("9VGf"),Ze,et;function Ge(){}var ht=0,ce=1e4,Me="\u2581",Fe=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ce(Ie){return/^\d+$/.test(Ie)?"".concat(Ie,"px"):Ie}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ee=_e?"Cmd":"Ctrl",ee=["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"],oe=(Ze={},Object(b.a)(Ze,Ee+"-B","bold"),Object(b.a)(Ze,Ee+"-I","italic"),Ze),q=(et={},Object(b.a)(et,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(b.a)(et,Le,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(b.a)(et,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(b.a)(et,ne,"\u6DFB\u52A0\u8868\u683C"),et),me=re.a=function(Ie){var V=Ie.defaultValue,Re=V===void 0?"":V,He=Ie.onChange,fe=Ie.width,ke=fe===void 0?"100%":fe,Xe=Ie.height,ot=Xe===void 0?400:Xe,tt=Ie.miniToolbar,at=tt===void 0?!1:tt,pt=Ie.isFocus,Ct=pt===void 0?!1:pt,bt=Ie.watch,dt=Ie.insertTemp,kt=Ie.mode,Ft=kt===void 0?"markdown":kt,mt=Ie.id,$t=mt===void 0?"markdown-editor-id":mt,wt=Ie.showResizeBar,_t=wt===void 0?!1:wt,Ot=Ie.noStorage,Nt=Ot===void 0?!1:Ot,qt=Ie.showNullButton,Pt=qt===void 0?!1:qt,xt=Ie.hidetoolBar,Ki=xt===void 0?!1:xt,Jt=Ie.fullScreen,ri=Jt===void 0?!1:Jt,Ut=Ie.onBlur,di=Ie.onCMBeforeChange,Ii=Ie.onFullScreen,Yi=Ie.className,ut=Yi===void 0?"":Yi,Dt=Ie.disablePaste,pr=Dt===void 0?!1:Dt,mr=Ie.placeholder,gr=mr===void 0?"":mr,vr=Ie.values,J=vr===void 0?"":vr,B=Object(o.useState)(null),H=Object(E.a)(B,2),Y=H[0],le=H[1],$=Object(o.useState)(Re),Be=Object(E.a)($,2),nt=Be[0],ft=Be[1],St=Object(o.useState)(bt),st=Object(E.a)(St,2),Rt=st[0],zt=st[1],ii=Object(o.useState)(ri),Hi=Object(E.a)(ii,2),Si=Hi[0],Ti=Hi[1],qi=Object(o.useState)(""),kr=Object(E.a)(qi,2),mi=kr[0],zi=kr[1],lr=Object(o.useState)(0),ur=Object(E.a)(lr,2),ji=ur[0],Ir=ur[1],_r=Object(o.useState)(ot),Xr=Object(E.a)(_r,2),zr=Xr[0],$i=Xr[1],Qi=Object(o.useState)(!1),yr=Object(E.a)(Qi,2),cn=yr[0],br=yr[1],oi=Object(o.useRef)(Object(ve.a)()),Gt=Object(o.useRef)(!1),xi=Object(o.useRef)(),Ht=Object(o.useRef)(),ui=Object(o.useRef)(),Qt=Object(o.useRef)(),rr=Object(o.useRef)(),gi=function(){var Tt=Object(p.a)(c.a.mark(function Mt(){var Lt,Kt;return c.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return ei.next=2,Object(pe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:Kt=ei.sent,Kt!=null&&(Lt=Kt.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",Y,Ht),Kt.attachments.map(function(Wt){Wt.content_type.indexOf("image")>-1?Y.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):Wt.content_type.indexOf("video")>-1?Y.replaceSelection('<video width="100%" controls src="'.concat(g.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Wt.content_type.indexOf("pdf")>-1?Y.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,'&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):Y.replaceSelection("[".concat(Wt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}));case 4:case"end":return ei.stop()}},Mt)}));return function(){return Tt.apply(this,arguments)}}();Object(o.useEffect)(function(){ft(J),Y==null||Y.setValue(J)},[J]),Object(o.useEffect)(function(){Ii==null||Ii(Si)},[Si]),Object(o.useEffect)(function(){if(Ht.current){var Tt=a.a.fromTextArea(Ht.current,{mode:Ft,lineNumbers:!at,lineWrapping:!0,value:Re,autoCloseTags:!0,autoCloseBrackets:!0});Ct&&Tt.focus();function Mt(Lt,Kt){if(pr){Kt.preventDefault();return}var Xt=Kt.clipboardData;if(Xt){var ei=Xt.types.toString(),Wt=Xt.items;if(ei==="Files"||Xt.types.indexOf("Files")>-1){if(Kt.preventDefault(),Ft=="stex")return;try{var fi,Di=Wt[1];((fi=Wt[0])===null||fi===void 0?void 0:fi.kind)==="file"&&(Di=Wt[0]);var jt=Di.getAsFile(),hr=jt.name.split(".").pop();ue(jt,function(Vt){if(Vt.id){var Mi,Ci,Zi;(jt==null||((Mi=jt.type)===null||Mi===void 0)?void 0:Mi.indexOf("image"))>-1?Tt.replaceSelection("![,](/api/attachments/".concat(Vt.id,"?type=").concat(Vt.content_type,")")):(jt==null||((Ci=jt.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(jt==null||((Zi=jt.type)===null||Zi===void 0)?void 0:Zi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(jt.type,'&disposition=inline" target="_blank">').concat(jt.name,"</a>")):ee.includes(hr)?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(jt.name,"</a>")):Tt.replaceSelection("[".concat(jt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})}catch(Vt){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Tt.on("paste",Mt),Tt.on("dragleave",function(Lt,Kt){ui.current.classList.remove("mouse-hover-md")}),Tt.on("dragover",function(Lt,Kt){ui.current.classList.add("mouse-hover-md")}),Tt.on("drop",function(Lt,Kt){ui.current.classList.add("mouse-hover-md");var Xt;if(Xt=Kt.dataTransfer.files,Xt.length>0){Kt.preventDefault(),Kt.stopPropagation();for(var ei=function(Di){var jt=Xt[Di],hr=jt.name.split(".").pop();ue(jt,function(Vt){if(Vt.id){var Mi,Ci,Zi;(jt==null||((Mi=jt.type)===null||Mi===void 0)?void 0:Mi.indexOf("image"))>-1?Tt.replaceSelection("![,](/api/attachments/".concat(Vt.id,"?type=").concat(Vt.content_type,")")):(jt==null||((Ci=jt.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(jt==null||((Zi=jt.type)===null||Zi===void 0)?void 0:Zi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(jt.type,'&disposition=inline" target="_blank">').concat(jt.name,"</a>")):ee.includes(hr)?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(jt.name,"</a>")):Tt.replaceSelection("[".concat(jt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})},Wt=0;Wt<Xt.length;Wt++)ei(Wt)}}),le(Tt),function(){Tt.off("paste",Mt)}}},[]);var Li=Object(o.useCallback)(function(){if(ui.current)try{}catch(Tt){console.log(Tt,"---- to set md editor body height")}},[zr,ui,Si]);Object(o.useEffect)(function(){function Tt(){var Lt=new t.default(function(Kt){var Xt=Object(I.a)(Kt),ei;try{for(Xt.s();!(ei=Xt.n()).done;){var Wt=ei.value;(Wt.target.offsetHeight>0||Wt.target.offsetWidth>0)&&(Li(),Y.setSize("100%","100%"),Y.refresh())}}catch(fi){Xt.e(fi)}finally{Xt.f()}});return Lt.observe(Ht.current.parentElement),Lt}if(Y){var Mt=Tt();return function(){Mt.unobserve(Ht.current.parentElement)}}},[Y,Li]),Object(o.useEffect)(function(){if(Y){for(var Tt=[],Mt=function(){var Wt=Kt[Lt];Xt=Object(E.a)(Wt,2);var fi=Xt[0],Di=Xt[1],jt=Object(b.a)({},fi,function(){Gr(Di)});Tt.push(jt),Y.addKeyMap(jt)},Lt=0,Kt=Object.entries(oe);Lt<Kt.length;Lt++){var Xt;Mt()}return xi.current=setInterval(function(){Gt.current&&gi()},4e3),function(){clearInterval(xi.current);var ei=Object(I.a)(Tt),Wt;try{for(ei.s();!(Wt=ei.n()).done;){var fi=Wt.value;Y.removeKeyMap(fi)}}catch(Di){ei.e(Di)}finally{ei.f()}}}},[Y]),Object(o.useEffect)(function(){ri!==Si&&Ti(ri)},[ri]),Object(Pe.a)(function(){if(!Nt&&ji>0){var Tt=new Date().getTime(),Mt=window.sessionStorage.getItem($t);Tt>=ji+ce&&(!Mt||Mt!==nt)&&(window.sessionStorage.setItem($t,nt),br(!0))}},ce),Object(o.useEffect)(function(){zt(bt)},[Y,bt]),Object(o.useEffect)(function(){Y&&(Ct&&Y.focus())},[Y,Ct]),Object(o.useEffect)(function(){if(Rt&&Y){var Tt=Y.getScrollerElement();function Mt(Lt){var Kt=Lt.target;if(rr.current){var Xt=Kt.scrollTop/Kt.scrollHeight;rr.current.scrollTop=rr.current.scrollHeight*Xt}}return Tt.addEventListener("scroll",Mt),function(){Tt.removeEventListener("scroll",Mt)}}},[Y,Rt]),Object(o.useEffect)(function(){if(Y&&di){function Tt(Mt,Lt){di(Mt,Lt)}return Y.on("beforeChange",Tt),function(){Y.off("beforeChange",Tt)}}},[Y,di]),Object(o.useEffect)(function(){if(Y&&Ut){function Tt(){Ut(Y.getValue())}return Y.on("blur",Tt),function(){Y.off("blur",Tt)}}},[Y,Ut]),Object(o.useEffect)(function(){if(Y){function Tt(Mt){var Lt=Mt.getValue();ft(Lt),Ir(new Date().getTime()),Mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),He&&He(Lt)}return Y.on("change",Tt),function(){Y.off("change",Tt)}}},[Y,He]),Object(o.useEffect)(function(){Y&&(Re==null?(Y.setValue(""),ft("")):Re!==Y.getValue()&&(Y.setValue(Re),ft(Re),Y.setCursor(Y.lineCount(),0)))},[Y,Re]);var Gr=Object(o.useCallback)(function(Tt){var Mt=Y.getCursor(),Lt=Y.getSelection(),Kt=Lt.split(`
`);switch(Tt){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(`<br/>
`),Y.focus();case"list-ul":return Lt===""?Y.replaceSelection("- "+Lt):Y.replaceSelection(Kt.map(function(Xt){return Xt===""?"":"- ".concat(Xt)}).join(`
`)),Y.focus();case"list-ol":return Lt===""?Y.replaceSelection("1. "+Lt):Y.replaceSelection(Kt.map(function(Xt,ei){return Xt===""?"":"".concat(ei+1,". ").concat(Xt)}).join(`
`)),Y.focus();case"add-null-ch":return Lt===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.replaceSelection(Me),Y.focus();case"inster-template-1":return Lt===""&&Y.setCursor(Mt.line,Mt.ch),Y.replaceSelection(Fe),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return zt(!Rt),Y.focus();case"trigger-full-screen":return Ti(!Si),Y.focus();case xe:zi(xe);return;case Le:zi(Le);return;case Se:zi(Se);return;case ne:zi(ne);return;default:throw new Error}},[Y,Rt,Si]),xr=Object(o.useCallback)(function(Tt){zi("");switch(mi){case xe:var Mt=Tt.title,Lt=Tt.link;return Y.replaceSelection("[".concat(Mt,"](").concat(Lt,")")),Y.focus();case Le:var Kt=Tt.language,Xt=Tt.content;return Y.replaceSelection(["```"+Kt,Xt,"```"].join(`
`)),Y.focus();case Se:var ei=Tt.src,Wt=Tt.alt;return Wt?Y.replaceSelection("![ ".concat(Wt," ]( ").concat(ei,' "').concat(Wt,'" )')):Y.replaceSelection("![,](".concat(ei,")")),Y.focus();case ne:for(var fi=Tt.row,Di=Tt.col,jt=Tt.align,hr=`
`,Vt=0;Vt<fi;Vt++){for(var Mi=[],Ci=[],Zi=0;Zi<Di;Zi++)Vt===1&&Ci.push(se[jt]),Mi.push(" ");Vt===1&&(hr+="| ".concat(Ci.join(" | "),` |
`)),hr+="| ".concat(Mi.join(Di===1?"":" | "),` |
`)}return Y.replaceSelection(hr+`
`),Y.focus();default:throw new Error}},[Y,mi]),dn=Object(o.useMemo)(function(){switch(mi){case xe:return h.a.createElement(de,{callback:xr,onCancel:Er});case Le:return h.a.createElement(be.b,{callback:xr,onCancel:Er});case Se:return h.a.createElement(Te,{callback:xr,onCancel:Er});case ne:return h.a.createElement(Je,{callback:xr,onCancel:Er});default:return null}},[mi]);function Er(){zi("")}Object(o.useEffect)(function(){if(Qt.current){var Tt=Qt.current,Mt=!1,Lt=0;function Kt(Wt){Mt=!0,Lt=Wt.pageY}function Xt(){Mt=!1}function ei(Wt){if(Mt){var fi=Wt.pageY-Lt;fi<0&&(fi=0),fi>300&&(fi=300);var Di=ot+fi+"px";$i(Di)}}return Tt.addEventListener("mousedown",Kt),document.addEventListener("mousemove",ei),document.addEventListener("mouseup",Xt),function(){Tt.removeEventListener("mousedown",Kt),document.removeEventListener("mousemove",ei),document.removeEventListener("mouseup",Xt)}}},[Y,Qt]),Object(o.useEffect)(function(){$i(ot)},[ot]);var nr=Ce(ke),fn=Ce(zr),Ji={width:nr,height:fn},pn=Object(o.useMemo)(function(){if(ji){var Tt=new Date(ji),Mt=Tt.getHours(),Lt=Tt.getMinutes(),Kt=Tt.getSeconds();return Mt=Mt<10?"0"+Mt:Mt,Lt=Lt<10?"0"+Lt:Lt,Kt=Kt<10?"0"+Kt:Kt,"".concat(Mt,":").concat(Lt,":").concat(Kt)}return 0},[ji]);function Kn(){window.sessionStorage.removeItem($t),br(!1),Ir(0)}function Dr(){br(!1),Ir(0),Y.setValue(window.sessionStorage.getItem($t))}function ua(Tt,Mt){var Lt=Y.getValue();Lt=Lt.replace(Tt,Mt),ft(Lt),Y==null||Y.setValue(Lt)}return h.a.createElement(o.Fragment,null,h.a.createElement("div",{className:"markdown-editor-wrapper",ref:ui},h.a.createElement("div",{className:"markdown-editor-container ".concat(ut," ").concat(Rt?"on-preview":""," ").concat(at?"mini":""," ").concat(Si?"full-screen":""),style:Ji},h.a.createElement(N,{insertTemp:dt,watch:Rt,fullScreen:Si,showNullButton:Pt,onActionCallback:Gr,hidetoolBar:Ki,uuid:oi.current,setOpenPhones:function(){Gt.current=!0}}),h.a.createElement("div",{className:"markdown-editor-body"},h.a.createElement("div",{className:"codemirror-container"},h.a.createElement("textarea",{ref:Ht,placeholder:gr})),Rt?h.a.createElement("div",{ref:rr,className:"preview-container"},Ft==="stex"&&h.a.createElement(C,{value:nt}),Ft!=="stex"&&h.a.createElement(S.a,{edit:!0,value:nt,replaces:ua})):null))),_t?h.a.createElement("a",{ref:Qt,className:"editor-resize"}):null,h.a.createElement(W.a,null,q[mi]?h.a.createElement(R.a,{centered:!0,title:q[mi],visible:!0,onCancel:Er,footer:null,className:"markdown-popup-form"},dn):null))}},P2ho:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={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};re.default=G},QV2g:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=G;function G(){for(var L,M=[],p=0;p<256;p++){L=p;for(var E=0;E<8;E++)L=L&1?3988292384^L>>>1:L>>>1;M[p]=L}return M}var R=G();function I(L,M,p,E){var b=R,i=E+p;L^=-1;for(var c=E;c<i;c++)L=L>>>8^b[(L^M[c])&255];return L^-1}},SJMd:function(it,re){/**
* @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 Q,G,R,I=!1,L,M;window.PR_SHOULD_USE_CONTINUATION=!0;var p,E;(function(){var b=window,i=["break,continue,do,else,for,if,return,while"],c=[i,"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=[c,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[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"],n=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[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",r=[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",u=[i,"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"],f=[i,"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=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[h,a,n,r,s,u,f,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",_="com",y="typ",T="lit",k="pun",g="pln",F="tag",P="dec",N="src",W="atn",j="atv",A="nocode",K="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(ze){for(var qe=0,Je=!1,pe=!1,ve=0,xe=ze.length;ve<xe;++ve){var Se=ze[ve];if(Se.ignoreCase)pe=!0;else if(/[a-z]/i.test(Se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Je=!0,pe=!1;break}}var Le={b:8,t:9,n:10,v:11,f:12,r:13};function ne(et){var Ge=et.charCodeAt(0);if(Ge!==92)return Ge;var ht=et.charAt(1);return Ge=Le[ht],Ge||("0"<=ht&&ht<="7"?parseInt(et.substring(1),8):ht==="u"||ht==="x"?parseInt(et.substring(2),16):et.charCodeAt(1))}function ye(et){if(et<32)return(et<16?"\\x0":"\\x")+et.toString(16);var Ge=String.fromCharCode(et);return Ge==="\\"||Ge==="-"||Ge==="]"||Ge==="^"?"\\"+Ge:Ge}function se(et){var Ge=et.substring(1,et.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ht=[],ce=Ge[0]==="^",Me=["["];ce&&Me.push("^");for(var Fe=ce?1:0,Ce=Ge.length;Fe<Ce;++Fe){var _e=Ge[Fe];if(/\\[bdsw]/i.test(_e))Me.push(_e);else{var Ee=ne(_e),ee;Fe+2<Ce&&Ge[Fe+1]==="-"?(ee=ne(Ge[Fe+2]),Fe+=2):ee=Ee,ht.push([Ee,ee]),ee<65||Ee>122||(ee<65||Ee>90||ht.push([Math.max(65,Ee)|32,Math.min(ee,90)|32]),ee<97||Ee>122||ht.push([Math.max(97,Ee)&~32,Math.min(ee,122)&~32]))}}ht.sort(function(Ie,V){return Ie[0]-V[0]||V[1]-Ie[1]});for(var oe=[],q=[],Fe=0;Fe<ht.length;++Fe){var me=ht[Fe];me[0]<=q[1]+1?q[1]=Math.max(q[1],me[1]):oe.push(q=me)}for(var Fe=0;Fe<oe.length;++Fe){var me=oe[Fe];Me.push(ye(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&Me.push("-"),Me.push(ye(me[1])))}return Me.push("]"),Me.join("")}function Pe(et){for(var Ge=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")),ht=Ge.length,ce=[],Me=0,Fe=0;Me<ht;++Me){var Ce=Ge[Me];if(Ce==="(")++Fe;else if(Ce.charAt(0)==="\\"){var _e=+Ce.substring(1);_e&&(_e<=Fe?ce[_e]=-1:Ge[Me]=ye(_e))}}for(var Me=1;Me<ce.length;++Me)ce[Me]===-1&&(ce[Me]=++qe);for(var Me=0,Fe=0;Me<ht;++Me){var Ce=Ge[Me];if(Ce==="(")++Fe,ce[Fe]||(Ge[Me]="(?:");else if(Ce.charAt(0)==="\\"){var _e=+Ce.substring(1);_e&&_e<=Fe&&(Ge[Me]="\\"+ce[_e])}}for(var Me=0;Me<ht;++Me)Ge[Me]==="^"&&Ge[Me+1]!=="^"&&(Ge[Me]="");if(et.ignoreCase&&Je)for(var Me=0;Me<ht;++Me){var Ce=Ge[Me],Ee=Ce.charAt(0);Ce.length>=2&&Ee==="["?Ge[Me]=se(Ce):Ee!=="\\"&&(Ge[Me]=Ce.replace(/[a-zA-Z]/g,function(q){var me=q.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Ge.join("")}for(var Ze=[],ve=0,xe=ze.length;ve<xe;++ve){var Se=ze[ve];if(Se.global||Se.multiline)throw new Error(""+Se);Ze.push("(?:"+Pe(Se)+")")}return new RegExp(Ze.join("|"),pe?"gi":"g")}function O(ze,qe){var Je=/(?:^|\s)nocode(?:\s|$)/,pe=[],ve=0,xe=[],Se=0;function Le(ne){var ye=ne.nodeType;if(ye==1){if(Je.test(ne.className))return;for(var se=ne.firstChild;se;se=se.nextSibling)Le(se);var Pe=ne.nodeName.toLowerCase();(Pe==="br"||Pe==="li")&&(pe[Se]=`
`,xe[Se<<1]=ve++,xe[Se++<<1|1]=ne)}else if(ye==3||ye==4){var Ze=ne.nodeValue;Ze.length&&(qe?Ze=Ze.replace(/\r\n?/g,`
`):Ze=Ze.replace(/[ \t\r\n]+/g," "),pe[Se]=Ze,xe[Se<<1]=ve,ve+=Ze.length,xe[Se++<<1|1]=ne)}}return Le(ze),{sourceCode:pe.join("").replace(/\n$/,""),spans:xe}}function z(ze,qe,Je,pe,ve){if(!Je)return;var xe={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:Je,spans:null,basePos:qe,decorations:null};pe(xe),ve.push.apply(ve,xe.decorations)}var te=/\S/;function de(ze){for(var qe=void 0,Je=ze.firstChild;Je;Je=Je.nextSibling){var pe=Je.nodeType;qe=pe===1?qe?ze:Je:pe===3&&te.test(Je.nodeValue)?ze:qe}return qe===ze?void 0:qe}function be(ze,qe){var Je={},pe;(function(){for(var Se=ze.concat(qe),Le=[],ne={},ye=0,se=Se.length;ye<se;++ye){var Pe=Se[ye],Ze=Pe[3];if(Ze)for(var et=Ze.length;--et>=0;)Je[Ze.charAt(et)]=Pe;var Ge=Pe[1],ht=""+Ge;ne.hasOwnProperty(ht)||(Le.push(Ge),ne[ht]=null)}Le.push(/[\0-\uffff]/),pe=U(Le)})();var ve=qe.length,xe=function(Se){for(var Le=Se.sourceCode,ne=Se.basePos,ye=Se.sourceNode,se=[ne,g],Pe=0,Ze=Le.match(pe)||[],et={},Ge=0,ht=Ze.length;Ge<ht;++Ge){var ce=Ze[Ge],Me=et[ce],Fe=void 0,Ce;if(typeof Me=="string")Ce=!1;else{var _e=Je[ce.charAt(0)];if(_e)Fe=ce.match(_e[1]),Me=_e[0];else{for(var Ee=0;Ee<ve;++Ee)if(_e=qe[Ee],Fe=ce.match(_e[1]),Fe){Me=_e[0];break}Fe||(Me=g)}Ce=Me.length>=5&&Me.substring(0,5)==="lang-",Ce&&!(Fe&&typeof Fe[1]=="string")&&(Ce=!1,Me=N),Ce||(et[ce]=Me)}var ee=Pe;if(Pe+=ce.length,!Ce)se.push(ne+ee,Me);else{var oe=Fe[1],q=ce.indexOf(oe),me=q+oe.length;Fe[2]&&(me=ce.length-Fe[2].length,q=me-oe.length);var Ie=Me.substring(5);z(ye,ne+ee,ce.substring(0,q),xe,se),z(ye,ne+ee+q,oe,we(Ie,oe),se),z(ye,ne+ee+me,ce.substring(me),xe,se)}}Se.decorations=se};return xe}function je(ze){var qe=[],Je=[];ze.tripleQuotedStrings?qe.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?qe.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):qe.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&Je.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var pe=ze.hashComments;pe&&(ze.cStyleComments?(pe>1?qe.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):qe.push([_,/^#(?:(?: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])):qe.push([_,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(Je.push([_,/^\/\/[^\r\n]*/,null]),Je.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ve=ze.regexLiterals;if(ve){var xe=ve>1?"":`
\r`,Se=xe?".":"[\\S\\s]",Le="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";Je.push(["lang-regex",RegExp("^"+K+"("+Le+")")])}var ne=ze.types;ne&&Je.push([y,ne]);var ye=(""+ze.keywords).replace(/^ | $/g,"");ye.length&&Je.push([C,new RegExp("^(?:"+ye.replace(/[\s,]+/g,"|")+")\\b"),null]),qe.push([g,/^\s+/,null,` \r
\xA0`]);var se="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(se+="(?!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],[g,/^[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"],[g,/^\\[\s\S]?/,null],[k,new RegExp(se),null]),be(qe,Je)}var Ne=je({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(ze,qe,Je){for(var pe=/(?:^|\s)nocode(?:\s|$)/,ve=/\r\n?|\n/,xe=ze.ownerDocument,Se=xe.createElement("li");ze.firstChild;)Se.appendChild(ze.firstChild);var Le=[Se];function ne(Ge){var ht=Ge.nodeType;if(ht==1&&!pe.test(Ge.className))if(Ge.nodeName==="br")ye(Ge),Ge.parentNode&&Ge.parentNode.removeChild(Ge);else for(var ce=Ge.firstChild;ce;ce=ce.nextSibling)ne(ce);else if((ht==3||ht==4)&&Je){var Me=Ge.nodeValue,Fe=Me.match(ve);if(Fe){var Ce=Me.substring(0,Fe.index);Ge.nodeValue=Ce;var _e=Me.substring(Fe.index+Fe[0].length);if(_e){var Ee=Ge.parentNode;Ee.insertBefore(xe.createTextNode(_e),Ge.nextSibling)}ye(Ge),Ce||Ge.parentNode.removeChild(Ge)}}}function ye(Ge){for(;!Ge.nextSibling;)if(Ge=Ge.parentNode,!Ge)return;function ht(Fe,Ce){var _e=Ce?Fe.cloneNode(!1):Fe,Ee=Fe.parentNode;if(Ee){var ee=ht(Ee,1),oe=Fe.nextSibling;ee.appendChild(_e);for(var q=oe;q;q=oe)oe=q.nextSibling,ee.appendChild(q)}return _e}for(var ce=ht(Ge.nextSibling,0),Me;(Me=ce.parentNode)&&Me.nodeType===1;)ce=Me;Le.push(ce)}for(var se=0;se<Le.length;++se)ne(Le[se]);qe===(qe|0)&&Le[0].setAttribute("value",qe);var Pe=xe.createElement("ol");Pe.className="linenums";for(var Ze=Math.max(0,qe-1|0)||0,se=0,et=Le.length;se<et;++se)Se=Le[se],Se.className="L"+(se+Ze)%10,Se.firstChild||Se.appendChild(xe.createTextNode("\xA0")),Pe.appendChild(Se);ze.appendChild(Pe)}function Ke(ze){var qe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);qe=qe&&+qe[1]<=8;var Je=/\n/g,pe=ze.sourceCode,ve=pe.length,xe=0,Se=ze.spans,Le=Se.length,ne=0,ye=ze.decorations,se=ye.length,Pe=0;ye[se]=ve;var Ze,et;for(et=Ze=0;et<se;)ye[et]!==ye[et+2]?(ye[Ze++]=ye[et++],ye[Ze++]=ye[et++]):et+=2;for(se=Ze,et=Ze=0;et<se;){for(var Ge=ye[et],ht=ye[et+1],ce=et+2;ce+2<=se&&ye[ce+1]===ht;)ce+=2;ye[Ze++]=Ge,ye[Ze++]=ht,et=ce}se=ye.length=Ze;var Me=ze.sourceNode,Fe="";Me&&(Fe=Me.style.display,Me.style.display="none");try{for(var Ce=null;ne<Le;){var _e=Se[ne],Ee=Se[ne+2]||ve,ee=ye[Pe+2]||ve,ce=Math.min(Ee,ee),oe=Se[ne+1],q;if(oe.nodeType!==1&&(q=pe.substring(xe,ce))){qe&&(q=q.replace(Je,"\r")),oe.nodeValue=q;var me=oe.ownerDocument,Ie=me.createElement("span");Ie.className=ye[Pe+1];var V=oe.parentNode;V.replaceChild(Ie,oe),Ie.appendChild(oe),xe<Ee&&(Se[ne+1]=oe=me.createTextNode(pe.substring(ce,Ee)),V.insertBefore(oe,Ie.nextSibling))}xe=ce,xe>=Ee&&(ne+=2),xe>=ee&&(Pe+=2)}}finally{Me&&(Me.style.display=Fe)}}var We={};function Te(ze,qe){for(var Je=qe.length;--Je>=0;){var pe=qe[Je];We.hasOwnProperty(pe)?b.console&&console.warn("cannot override language handler %s",pe):We[pe]=ze}}function we(ze,qe){return ze&&We.hasOwnProperty(ze)||(ze=/^\s*</.test(qe)?"default-markup":"default-code"),We[ze]}Te(Ne,["default-code"]),Te(be([],[[g,/^[^<?]+/],[P,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[k,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Te(be([[g,/^[\s]+/,null,` \r
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[F,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[W,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[k,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Te(be([],[[j,/^[\s\S]+/]]),["uq.val"]),Te(je({keywords:h,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),Te(je({keywords:"null,true,false"}),["json"]),Te(je({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),Te(je({keywords:n,cStyleComments:!0}),["java"]),Te(je({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Te(je({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Te(je({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Te(je({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Te(je({keywords:r,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Te(je({keywords:t,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Te(be([],[[S,/^[\s\S]+/]]),["regex"]);function ue(ze){var qe=ze.langExtension;try{var Je=O(ze.sourceNode,ze.pre),pe=Je.sourceCode;ze.sourceCode=pe,ze.spans=Je.spans,ze.basePos=0,we(qe,pe)(ze),Ke(ze)}catch(ve){b.console&&console.log(ve&&ve.stack||ve)}}function Ae(ze,qe,Je){var pe=Je||!1,ve=qe||null,xe=document.createElement("div");xe.innerHTML="<pre>"+ze+"</pre>",xe=xe.firstChild,pe&&Oe(xe,pe,!0);var Se={langExtension:ve,numberLines:pe,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ue(Se),xe.innerHTML}function ge(ze,qe){var Je=qe||document.body,pe=Je.ownerDocument||document;function ve(_e){return Je.getElementsByTagName(_e)}for(var xe=[ve("pre"),ve("code"),ve("xmp")],Se=[],Le=0;Le<xe.length;++Le)for(var ne=0,ye=xe[Le].length;ne<ye;++ne)Se.push(xe[Le][ne]);xe=null;var se=Date;se.now||(se={now:function(){return+new Date}});var Pe=0,Ze=/\blang(?:uage)?-([\w.]+)(?!\S)/,et=/\bprettyprint\b/,Ge=/\bprettyprinted\b/,ht=/pre|xmp/i,ce=/^code$/i,Me=/^(?:pre|code|xmp)$/i,Fe={};function Ce(){for(var _e=b.PR_SHOULD_USE_CONTINUATION?se.now()+250:Infinity;Pe<Se.length&&se.now()<_e;Pe++){for(var Ee=Se[Pe],ee=Fe,oe=Ee;oe=oe.previousSibling;){var q=oe.nodeType,me=(q===7||q===8)&&oe.nodeValue;if(me?!/^\??prettify\b/.test(me):q!==3||/\S/.test(oe.nodeValue))break;if(me){ee={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(bt,dt,kt){ee[dt]=kt});break}}var Ie=Ee.className;if((ee!==Fe||et.test(Ie))&&!Ge.test(Ie)){for(var V=!1,Re=Ee.parentNode;Re;Re=Re.parentNode){var He=Re.tagName;if(Me.test(He)&&Re.className&&et.test(Re.className)){V=!0;break}}if(!V){Ee.className+=" prettyprinted";var fe=ee.lang;if(!fe){fe=Ie.match(Ze);var ke;!fe&&(ke=de(Ee))&&ce.test(ke.tagName)&&(fe=ke.className.match(Ze)),fe&&(fe=fe[1])}var Xe;if(ht.test(Ee.tagName))Xe=1;else{var ot=Ee.currentStyle,tt=pe.defaultView,at=ot?ot.whiteSpace:tt&&tt.getComputedStyle?tt.getComputedStyle(Ee,null).getPropertyValue("white-space"):0;Xe=at&&at.substring(0,3)==="pre"}var pt=ee.linenums;(pt=pt==="true"||+pt)||(pt=Ie.match(/\blinenums\b(?::(\d+))?/),pt=pt?pt[1]&&pt[1].length?+pt[1]:!0:!1),pt&&Oe(Ee,pt,Xe);var Ct={langExtension:fe,sourceNode:Ee,numberLines:pt,pre:Xe,sourceCode:null,basePos:null,spans:null,decorations:null};ue(Ct)}}}Pe<Se.length?b.setTimeout(Ce,250):typeof ze=="function"&&ze()}Ce()}var Ve=b.PR={createSimpleLexer:be,registerLangHandler:Te,sourceDecorator:je,PR_ATTRIB_NAME:W,PR_ATTRIB_VALUE:j,PR_COMMENT:_,PR_DECLARATION:P,PR_KEYWORD:C,PR_LITERAL:T,PR_NOCODE:A,PR_PLAIN:g,PR_PUNCTUATION:k,PR_SOURCE:N,PR_STRING:S,PR_TAG:F,PR_TYPE:y,prettyPrintOne:I?b.prettyPrintOne=Ae:p=Ae,prettyPrint:E=I?b.prettyPrint=ge:E=ge},Qe=b.define;typeof Qe=="function"&&Qe.amd&&Qe("google-code-prettify",[],function(){return Ve})})()},SZEN:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.clientToElement=G;function G(R,I,L){var M=L.getBoundingClientRect(),p={x:0,y:0};return R<M.left?p.x=0:R>=M.right?p.x=M.width-1:p.x=R-M.left,I<M.top?p.y=0:I>=M.bottom?p.y=M.height-1:p.y=I-M.top,p}},SgaC:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function R(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&R(M.prototype,p),E&&R(M,E),M}var L=function(){function M(){G(this,M),this._subrects=0}return I(M,[{key:"decodeRect",value:function(E,b,i,c,o,h,n){if(this._subrects===0){if(o.rQwait("RRE",4+4))return!1;this._subrects=o.rQshift32();var a=o.rQshiftBytes(4);h.fillRect(E,b,i,c,a)}for(;this._subrects>0;){if(o.rQwait("RRE",4+8))return!1;var t=o.rQshiftBytes(4),r=o.rQshift16(),s=o.rQshift16(),u=o.rQshift16(),f=o.rQshift16();h.fillRect(E+r,b+s,u,f,t),this._subrects--}return!0}}]),M}();re.default=L},T8No:function(it,re,Q){"use strict";Q.d(re,"a",function(){return E}),Q.d(re,"e",function(){return b}),Q.d(re,"c",function(){return k}),Q.d(re,"b",function(){return g}),Q.d(re,"d",function(){return F}),Q.d(re,"f",function(){return W});var G=Q("MNsG"),R=Q("N0LK"),I=Q("Cg/j");let L=G.k||"";const M=new Map;M.set("false",!1),M.set("true",!0),M.set("isMac",G.f),M.set("isLinux",G.d),M.set("isWindows",G.i),M.set("isWeb",G.h),M.set("isMacNative",G.f&&!G.h),M.set("isEdge",L.indexOf("Edg/")>=0),M.set("isFirefox",L.indexOf("Firefox")>=0),M.set("isChrome",L.indexOf("Chrome")>=0),M.set("isSafari",L.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class E{static has(A){return h.create(A)}static equals(A,K){return n.create(A,K)}static regex(A,K){return S.create(A,K)}static not(A){return s.create(A)}static and(...A){return y.create(A,null)}static or(...A){return T.create(A,null,!0)}static deserialize(A,K=!1){return A?this._deserializeOrExpression(A,K):void 0}static _deserializeOrExpression(A,K){let U=A.split("||");return T.create(U.map(O=>this._deserializeAndExpression(O,K)),null,!0)}static _deserializeAndExpression(A,K){let U=A.split("&&");return y.create(U.map(O=>this._deserializeOne(O,K)),null)}static _deserializeOne(A,K){if(A=A.trim(),A.indexOf("!=")>=0){let U=A.split("!=");return r.create(U[0].trim(),this._deserializeValue(U[1],K))}if(A.indexOf("==")>=0){let U=A.split("==");return n.create(U[0].trim(),this._deserializeValue(U[1],K))}if(A.indexOf("=~")>=0){let U=A.split("=~");return S.create(U[0].trim(),this._deserializeRegexValue(U[1],K))}if(A.indexOf(" in ")>=0){let U=A.split(" in ");return a.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const U=A.split(">=");return d.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const U=A.split(">");return f.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const U=A.split("<=");return m.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const U=A.split("<");return v.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(A)?s.create(A.substr(1).trim()):h.create(A)}static _deserializeValue(A,K){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let U=/^'([^']*)'$/.exec(A);return U?U[1].trim():A}static _deserializeRegexValue(A,K){if(Object(R.C)(A)){if(K)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=A.indexOf("/"),O=A.lastIndexOf("/");if(U===O||U<0){if(K)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let z=A.slice(U+1,O),te=A[O+1]==="i"?"i":"";try{return new RegExp(z,te)}catch(de){if(K)throw new Error(`bad regexp-value '${A}', parse error: ${de}`);return console.warn(`bad regexp-value '${A}', parse error: ${de}`),null}}}function b(A,K){const U=A?A.substituteConstants():void 0,O=K?K.substituteConstants():void 0;return!U&&!O?!0:!U||!O?!1:U.equals(O)}function i(A,K){return A.cmp(K)}class c{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return o.INSTANCE}}c.INSTANCE=new c;class o{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return c.INSTANCE}}o.INSTANCE=new o;class h{constructor(A,K){this.key=A,this.negated=K,this.type=2}static create(A,K=null){const U=M.get(A);return typeof U=="boolean"?U?o.INSTANCE:c.INSTANCE:new h(A,K)}cmp(A){return A.type!==this.type?this.type-A.type:P(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=M.get(this.key);return typeof A=="boolean"?A?o.INSTANCE:c.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}class n{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=4}static create(A,K,U=null){if(typeof K=="boolean")return K?h.create(A,U):s.create(A,U);const O=M.get(A);if(typeof O=="boolean"){const z=O?"true":"false";return K===z?o.INSTANCE:c.INSTANCE}return new n(A,K,U)}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=M.get(this.key);if(typeof A=="boolean"){const K=A?"true":"false";return this.value===K?o.INSTANCE:c.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class a{constructor(A,K){this.key=A,this.valueKey=K,this.type=10,this.negated=null}static create(A,K){return new a(A,K)}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const K=A.getValue(this.valueKey),U=A.getValue(this.key);return Array.isArray(K)?K.indexOf(U)>=0:typeof U=="string"&&typeof K=="object"&&K!==null?p.call(K,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=t.create(this)),this.negated}}class t{constructor(A){this._actual=A,this.type=11}static create(A){return new t(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class r{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=5}static create(A,K,U=null){if(typeof K=="boolean")return K?s.create(A,U):h.create(A,U);const O=M.get(A);if(typeof O=="boolean"){const z=O?"true":"false";return K===z?c.INSTANCE:o.INSTANCE}return new r(A,K,U)}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=M.get(this.key);if(typeof A=="boolean"){const K=A?"true":"false";return this.value===K?c.INSTANCE:o.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class s{constructor(A,K){this.key=A,this.negated=K,this.type=3}static create(A,K=null){const U=M.get(A);return typeof U=="boolean"?U?c.INSTANCE:o.INSTANCE:new s(A,K)}cmp(A){return A.type!==this.type?this.type-A.type:P(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=M.get(this.key);return typeof A=="boolean"?A?c.INSTANCE:o.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this)),this.negated}}function u(A,K){if(typeof A=="string"){const U=parseFloat(A);isNaN(U)||(A=U)}return typeof A=="string"||typeof A=="number"?K(A):c.INSTANCE}class f{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=12}static create(A,K,U=null){return u(K,O=>new f(A,O,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class d{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=13}static create(A,K,U=null){return u(K,O=>new d(A,O,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class v{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=14}static create(A,K,U=null){return u(K,O=>new v(A,O,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class m{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=15}static create(A,K,U=null){return u(K,O=>new m(A,O,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class S{constructor(A,K){this.key=A,this.regexp=K,this.type=7,this.negated=null}static create(A,K){return new S(A,K)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const K=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return K<U?-1:K>U?1:0}equals(A){if(A.type===this.type){const K=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return this.key===A.key&&K===U}return!1}substituteConstants(){return this}evaluate(A){let K=A.getValue(this.key);return this.regexp?this.regexp.test(K):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this)),this.negated}}class C{constructor(A){this._actual=A,this.type=8}static create(A){return new C(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(A){let K=null;for(let U=0,O=A.length;U<O;U++){const z=A[U].substituteConstants();if(A[U]!==z&&K===null){K=[];for(let te=0;te<U;te++)K[te]=A[te]}K!==null&&(K[U]=z)}return K===null?A:K}class y{constructor(A,K){this.expr=A,this.negated=K,this.type=6}static create(A,K){return y._normalizeArr(A,K)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let K=0,U=this.expr.length;K<U;K++){const O=i(this.expr[K],A.expr[K]);if(O!==0)return O}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let K=0,U=this.expr.length;K<U;K++)if(!this.expr[K].equals(A.expr[K]))return!1;return!0}return!1}substituteConstants(){const A=_(this.expr);return A===this.expr?this:y.create(A,this.negated)}evaluate(A){for(let K=0,U=this.expr.length;K<U;K++)if(!this.expr[K].evaluate(A))return!1;return!0}static _normalizeArr(A,K){const U=[];let O=!1;for(const z of A){if(!z)continue;if(z.type===1){O=!0;continue}if(z.type===0)return c.INSTANCE;if(z.type===6){U.push(...z.expr);continue}U.push(z)}if(U.length===0&&O)return o.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(i);for(let z=1;z<U.length;z++)U[z-1].equals(U[z])&&(U.splice(z,1),z--);if(U.length===1)return U[0];for(;U.length>1;){const z=U[U.length-1];if(z.type!==9)break;U.pop();const te=U.pop(),de=U.length===0,be=T.create(z.expr.map(je=>y.create([je,te],null)),null,de);be&&(U.push(be),U.sort(i))}return U.length===1?U[0]:new y(U,K)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let K of this.expr)A.push(...K.keys());return A}negate(){if(!this.negated){const A=[];for(let K of this.expr)A.push(K.negate());this.negated=T.create(A,this,!0)}return this.negated}}class T{constructor(A,K){this.expr=A,this.negated=K,this.type=9}static create(A,K,U){return T._normalizeArr(A,K,U)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let K=0,U=this.expr.length;K<U;K++){const O=i(this.expr[K],A.expr[K]);if(O!==0)return O}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let K=0,U=this.expr.length;K<U;K++)if(!this.expr[K].equals(A.expr[K]))return!1;return!0}return!1}substituteConstants(){const A=_(this.expr);return A===this.expr?this:T.create(A,this.negated,!1)}evaluate(A){for(let K=0,U=this.expr.length;K<U;K++)if(this.expr[K].evaluate(A))return!0;return!1}static _normalizeArr(A,K,U){let O=[],z=!1;if(A){for(let te=0,de=A.length;te<de;te++){const be=A[te];if(!be)continue;if(be.type===0){z=!0;continue}if(be.type===1)return o.INSTANCE;if(be.type===9){O=O.concat(be.expr);continue}O.push(be)}if(O.length===0&&z)return c.INSTANCE;O.sort(i)}if(O.length===0)return;if(O.length===1)return O[0];for(let te=1;te<O.length;te++)O[te-1].equals(O[te])&&(O.splice(te,1),te--);if(O.length===1)return O[0];if(U){for(let te=0;te<O.length;te++)for(let de=te+1;de<O.length;de++)W(O[te],O[de])&&(O.splice(de,1),de--);if(O.length===1)return O[0]}return new T(O,K)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let K of this.expr)A.push(...K.keys());return A}negate(){if(!this.negated){let A=[];for(let K of this.expr)A.push(K.negate());for(;A.length>1;){const K=A.shift(),U=A.shift(),O=[];for(const te of j(K))for(const de of j(U))O.push(y.create([te,de],null));const z=A.length===0;A.unshift(T.create(O,null,z))}this.negated=A[0]}return this.negated}}class k extends h{constructor(A,K,U){super(A,null);this._defaultValue=K,typeof U=="object"?k._info.push(Object.assign(Object.assign({},U),{key:A})):U!==!0&&k._info.push({key:A,description:U,type:K!=null?typeof K:void 0})}static all(){return k._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return n.create(this.key,A)}}k._info=[];const g=Object(I.c)("contextKeyService"),F="setContext";function P(A,K){return A<K?-1:A>K?1:0}function N(A,K,U,O){return A<U?-1:A>U?1:K<O?-1:K>O?1:0}function W(A,K){if(K.type===6&&A.type!==9&&A.type!==6){for(const z of K.expr)if(A.equals(z))return!0}const U=A.negate(),O=j(U).concat(j(K));O.sort(i);for(let z=0;z<O.length;z++){const te=O[z],de=te.negate();for(let be=z+1;be<O.length;be++){const je=O[be];if(de.equals(je))return!0}}return!1}function j(A){return A.type===9?A.expr:[A]}},TXwP:function(it,re,Q){var G,R;(function(){var I;(function(){"use strict";var M=[,,function(i){function c(n){this.__parent=n,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=[]}c.prototype.clone_empty=function(){var n=new c(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},c.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},c.prototype.has_match=function(n){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(n))return!0;return!1},c.prototype.set_indent=function(n,a){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.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)},c.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},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(n){this.__items.push(n);var a=n.lastIndexOf(`
`);a!==-1?this.__character_count=n.length-a:this.__character_count+=n.length},c.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function o(n,a){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),a=a||"",n.indent_level>0&&(a=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}o.prototype.get_indent_size=function(n,a){var t=this.__base_string_length;return a=a||0,n<0&&(t=0),t+=n*this.__indent_size,t+=a,t},o.prototype.get_indent_string=function(n,a){var t=this.__base_string;return a=a||0,n<0&&(n=0,t=""),a+=n*this.__indent_size,this.__ensure_cache(a),t+=this.__cache[a],t},o.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var n=this.__cache.length,a=0,t="";this.__indent_size&&n>=this.__indent_size&&(a=Math.floor(n/this.__indent_size),n-=a*this.__indent_size,t=new Array(a+1).join(this.__indent_string)),n&&(t+=new Array(n+1).join(" ")),this.__cache.push(t)};function h(n,a){this.__indent_cache=new o(n,a),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(n,a){return this.__indent_cache.get_indent_string(n,a)},h.prototype.get_indent_size=function(n,a){return this.__indent_cache.get_indent_size(n,a)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(n){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
`);return n!==`
`&&(t=t.replace(/[\n]/g,n)),t},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(n,a){return n=n||0,a=a||0,this.next_line.set_indent(n,a),this.__lines.length>1?(this.current_line.set_indent(n,a),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(n){for(var a=0;a<n.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(n){for(var a=this.__lines.length;n<a;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(n,a){for(var t=this.__lines.length-2;t>=0;){var r=this.__lines[t];if(r.is_empty())break;if(r.item(0).indexOf(n)!==0&&r.item(-1)!==a){this.__lines.splice(t+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},i.exports.Output=h},,,,function(i){function c(n,a){this.raw_options=o(n,a),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"])}c.prototype._get_array=function(n,a){var t=this.raw_options[n],r=a||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(r=t.concat()):typeof t=="string"&&(r=t.split(/[^a-zA-Z0-9_\/\-]+/)),r},c.prototype._get_boolean=function(n,a){var t=this.raw_options[n],r=t===void 0?!!a:!!t;return r},c.prototype._get_characters=function(n,a){var t=this.raw_options[n],r=a||"";return typeof t=="string"&&(r=t.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},c.prototype._get_number=function(n,a){var t=this.raw_options[n];a=parseInt(a,10),isNaN(a)&&(a=0);var r=parseInt(t,10);return isNaN(r)&&(r=a),r},c.prototype._get_selection=function(n,a,t){var r=this._get_selection_list(n,a,t);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[n]+"'");return r[0]},c.prototype._get_selection_list=function(n,a,t){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[a[0]],!this._is_valid_selection(t,a))throw new Error("Invalid Default Value!");var r=this._get_array(n,t);if(!this._is_valid_selection(r,a))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[n]+"'");return r},c.prototype._is_valid_selection=function(n,a){return n.length&&a.length&&!n.some(function(t){return a.indexOf(t)===-1})};function o(n,a){var t={};n=h(n);var r;for(r in n)r!==a&&(t[r]=n[r]);if(a&&n[a])for(r in n[a])t[r]=n[a][r];return t}function h(n){var a={},t;for(t in n){var r=t.replace(/-/g,"_");a[r]=n[t]}return a}i.exports.Options=c,i.exports.normalizeOpts=h,i.exports.mergeOpts=o},,function(i){var c=RegExp.prototype.hasOwnProperty("sticky");function o(h){this.__input=h||"",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<this.__input_length},o.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},o.prototype.peek=function(h){var n=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(n=this.__input.charAt(h)),n},o.prototype.__match=function(h,n){h.lastIndex=n;var a=h.exec(this.__input);return a&&!(c&&h.sticky)&&(a.index!==n&&(a=null)),a},o.prototype.test=function(h,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(h,n):!1},o.prototype.testChar=function(h,n){var a=this.peek(n);return h.lastIndex=0,a!==null&&h.test(a)},o.prototype.match=function(h){var n=this.__match(h,this.__position);return n?this.__position+=n[0].length:n=null,n},o.prototype.read=function(h,n,a){var t="",r;return h&&(r=this.match(h),r&&(t+=r[0])),n&&(r||!h)&&(t+=this.readUntil(n,a)),t},o.prototype.readUntil=function(h,n){var a="",t=this.__position;h.lastIndex=this.__position;var r=h.exec(this.__input);return r?(t=r.index,n&&(t+=r[0].length)):t=this.__input_length,a=this.__input.substring(this.__position,t),this.__position=t,a},o.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},o.prototype.get_regexp=function(h,n){var a=null,t="g";return n&&c&&(t="y"),typeof h=="string"&&h!==""?a=new RegExp(h,t):h&&(a=new RegExp(h.source,t)),a},o.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(h){var n=this.__position,a=this.readUntilAfter(h);return this.__position=n,a},o.prototype.lookBack=function(h){var n=this.__position-1;return n>=h.length&&this.__input.substring(n-h.length,n).toLowerCase()===h},i.exports.InputScanner=o},,,,,function(i){function c(o,h){o=typeof o=="string"?o:o.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+h,"g")}c.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(o);n;)h[n[1]]=n[2],n=this.__directive_pattern.exec(o);return h},c.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=c},,function(i,c,o){var h=o(16).Beautifier,n=o(17).Options;function a(t,r){var s=new h(t,r);return s.beautify()}i.exports=a,i.exports.defaultOptions=function(){return new n}},function(i,c,o){var h=o(17).Options,n=o(2).Output,a=o(8).InputScanner,t=o(13).Directives,r=new t(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,f=/\s/,d=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(C,_){this._source_text=C||"",this._options=new h(_),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 _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(C.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return _},S.prototype.eatWhitespace=function(C){for(var _=f.test(this._input.peek()),y=0;f.test(this._input.peek());)this._ch=this._input.next(),C&&this._ch===`
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return _},S.prototype.foundNestedPseudoClass=function(){for(var C=0,_=1,y=this._input.peek(_);y;){if(y==="{")return!0;if(y==="(")C+=1;else if(y===")"){if(C===0)return!1;C-=1}else if(y===";"||y==="}")return!1;_++,y=this._input.peek(_)}return!1},S.prototype.print_string=function(C){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(C)},S.prototype.preserveSingleSpace=function(C){C&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,_=this._options.eol;_==="auto"&&(_=`
`,C&&s.test(C||"")&&(_=C.match(s)[0])),C=C.replace(u,`
`);var y=C.match(/^[\t ]*/)[0];this._output=new n(this._options,y),this._input=new a(C),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,k=!1,g=!1,F=!1,P=!1,N=!1,W=!1,j=this._ch,A=!1,K,U,O;K=this._input.read(d),U=K!=="",O=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(v),te=r.get_directives(z);te&&te.ignore==="start"&&(z+=r.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(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var de=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);de.match(/[ :]$/)&&(de=this.eatString(": ").replace(/\s$/,""),this.print_string(de),this._output.space_before_token=!0),de=de.replace(/\s$/,""),de==="extend"?P=!0:de==="import"&&(N=!0),de in this.NESTED_AT_RULE?(this._nestedLevel+=1,de in this.CONDITIONAL_GROUP_RULE&&(F=!0)):!k&&T===0&&de.indexOf(":")!==-1&&(g=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")g&&(g=!1,this.outdent()),F?(F=!1,k=this._indentLevel>=this._nestedLevel):k=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&k&&(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)):(O==="("?this._output.space_before_token=!1:O!==","&&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(),O==="{"&&this._output.trim(!0),N=!1,P=!1,g&&(this.outdent(),g=!1),this.print_string(this._ch),k=!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.NON_SEMICOLON_NEWLINE_PROPERTY.length;be++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[be])){A=!0;break}(k||F)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!P&&T===0?(this.print_string(":"),g||(g=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var je=O==='"'||O==="'";this.preserveSingleSpace(je||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,T===0?(g&&(this.outdent(),g=!1),P=!1,N=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),T++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),T&&(T--,this.outdent()));else{var Ne=!1;this._input.lookBack("with")&&(Ne=!0),this.preserveSingleSpace(U||Ne),this.print_string(this._ch),g&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),W=!0):(this.eatWhitespace(),T++,this.indent())}else if(this._ch===")")T&&(T--,this.outdent()),W&&this._input.peek()===";"&&this._options.selector_separator_newline&&(W=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!g||W)&&T===0&&!N&&!P?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!g&&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&&f.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),f.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 Oe=O==='"'||O==="'";this.preserveSingleSpace(Oe||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&A&&this._output.add_new_line()}var Ke=this._output.get_code(_);return Ke},i.exports.Beautifier=S},function(i,c,o){var h=o(6).Options;function n(a){h.call(this,a,"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 r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<r.length;s++)r[s]!=="expand"?this.brace_style="collapse":this.brace_style=r[s]}n.prototype=new h,i.exports.Options=n}],p={};function E(i){var c=p[i];if(c!==void 0)return c.exports;var o=p[i]={exports:{}};return M[i](o,o.exports,E),o.exports}var b=E(15);I=b})();var L=I;!(G=[],R=function(){return{css_beautify:L}}.apply(re,G),R!==void 0&&(it.exports=R))})()},VSMT:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.decodeUTF8=G,re.encodeUTF8=R;function G(I){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;try{return decodeURIComponent(escape(I))}catch(M){if(M instanceof URIError&&L)return I;throw M}}function R(I){return unescape(encodeURIComponent(I))}},"VaU+":function(it,re,Q){it.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"}},Vhoy:function(it,re,Q){"use strict";Q.d(re,"d",function(){return L}),Q.d(re,"e",function(){return M}),Q.d(re,"c",function(){return p}),Q.d(re,"b",function(){return E}),Q.d(re,"a",function(){return b});var G=Q("MI8n");class R{constructor(){this._icons=new Map,this._onDidRegister=new G.b}add(i){const c=this._icons.get(i.id);c?i.description?c.description=i.description:console.error(`Duplicate registration of codicon ${i.id}`):(this._icons.set(i.id,i),this._onDidRegister.fire(i))}get(i){return this._icons.get(i)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const I=new R,L=I;function M(i,c){return new E(i,c)}function p(i){return i?i.replace(/\$\((.*?)\)/g,(c,o)=>` ${o} `).trim():""}class E{constructor(i,c,o){this.id=i,this.definition=c,this.description=o,I.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var b;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9\\-]+",i.iconModifierExpression="~[A-Za-z]+";const c=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function o(a){if(a instanceof E)return["codicon","codicon-"+a.id];const t=c.exec(a.id);if(!t)return o(E.error);let[,r,s]=t;const u=["codicon","codicon-"+r];return s&&u.push("codicon-modifier-"+s.substr(1)),u}i.asClassNameArray=o;function h(a){return o(a).join(" ")}i.asClassName=h;function n(a){return"."+o(a).join(".")}i.asCSSSelector=n})(b||(b={})),function(i){i.add=new i("add",{fontCharacter:"\\ea60"}),i.plus=new i("plus",i.add.definition),i.gistNew=new i("gist-new",i.add.definition),i.repoCreate=new i("repo-create",i.add.definition),i.lightbulb=new i("lightbulb",{fontCharacter:"\\ea61"}),i.lightBulb=new i("light-bulb",{fontCharacter:"\\ea61"}),i.repo=new i("repo",{fontCharacter:"\\ea62"}),i.repoDelete=new i("repo-delete",{fontCharacter:"\\ea62"}),i.gistFork=new i("gist-fork",{fontCharacter:"\\ea63"}),i.repoForked=new i("repo-forked",{fontCharacter:"\\ea63"}),i.gitPullRequest=new i("git-pull-request",{fontCharacter:"\\ea64"}),i.gitPullRequestAbandoned=new i("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),i.recordKeys=new i("record-keys",{fontCharacter:"\\ea65"}),i.keyboard=new i("keyboard",{fontCharacter:"\\ea65"}),i.tag=new i("tag",{fontCharacter:"\\ea66"}),i.tagAdd=new i("tag-add",{fontCharacter:"\\ea66"}),i.tagRemove=new i("tag-remove",{fontCharacter:"\\ea66"}),i.person=new i("person",{fontCharacter:"\\ea67"}),i.personFollow=new i("person-follow",{fontCharacter:"\\ea67"}),i.personOutline=new i("person-outline",{fontCharacter:"\\ea67"}),i.personFilled=new i("person-filled",{fontCharacter:"\\ea67"}),i.gitBranch=new i("git-branch",{fontCharacter:"\\ea68"}),i.gitBranchCreate=new i("git-branch-create",{fontCharacter:"\\ea68"}),i.gitBranchDelete=new i("git-branch-delete",{fontCharacter:"\\ea68"}),i.sourceControl=new i("source-control",{fontCharacter:"\\ea68"}),i.mirror=new i("mirror",{fontCharacter:"\\ea69"}),i.mirrorPublic=new i("mirror-public",{fontCharacter:"\\ea69"}),i.star=new i("star",{fontCharacter:"\\ea6a"}),i.starAdd=new i("star-add",{fontCharacter:"\\ea6a"}),i.starDelete=new i("star-delete",{fontCharacter:"\\ea6a"}),i.starEmpty=new i("star-empty",{fontCharacter:"\\ea6a"}),i.comment=new i("comment",{fontCharacter:"\\ea6b"}),i.commentAdd=new i("comment-add",{fontCharacter:"\\ea6b"}),i.alert=new i("alert",{fontCharacter:"\\ea6c"}),i.warning=new i("warning",{fontCharacter:"\\ea6c"}),i.search=new i("search",{fontCharacter:"\\ea6d"}),i.searchSave=new i("search-save",{fontCharacter:"\\ea6d"}),i.logOut=new i("log-out",{fontCharacter:"\\ea6e"}),i.signOut=new i("sign-out",{fontCharacter:"\\ea6e"}),i.logIn=new i("log-in",{fontCharacter:"\\ea6f"}),i.signIn=new i("sign-in",{fontCharacter:"\\ea6f"}),i.eye=new i("eye",{fontCharacter:"\\ea70"}),i.eyeUnwatch=new i("eye-unwatch",{fontCharacter:"\\ea70"}),i.eyeWatch=new i("eye-watch",{fontCharacter:"\\ea70"}),i.circleFilled=new i("circle-filled",{fontCharacter:"\\ea71"}),i.primitiveDot=new i("primitive-dot",{fontCharacter:"\\ea71"}),i.closeDirty=new i("close-dirty",{fontCharacter:"\\ea71"}),i.debugBreakpoint=new i("debug-breakpoint",{fontCharacter:"\\ea71"}),i.debugBreakpointDisabled=new i("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),i.debugHint=new i("debug-hint",{fontCharacter:"\\ea71"}),i.primitiveSquare=new i("primitive-square",{fontCharacter:"\\ea72"}),i.edit=new i("edit",{fontCharacter:"\\ea73"}),i.pencil=new i("pencil",{fontCharacter:"\\ea73"}),i.info=new i("info",{fontCharacter:"\\ea74"}),i.issueOpened=new i("issue-opened",{fontCharacter:"\\ea74"}),i.gistPrivate=new i("gist-private",{fontCharacter:"\\ea75"}),i.gitForkPrivate=new i("git-fork-private",{fontCharacter:"\\ea75"}),i.lock=new i("lock",{fontCharacter:"\\ea75"}),i.mirrorPrivate=new i("mirror-private",{fontCharacter:"\\ea75"}),i.close=new i("close",{fontCharacter:"\\ea76"}),i.removeClose=new i("remove-close",{fontCharacter:"\\ea76"}),i.x=new i("x",{fontCharacter:"\\ea76"}),i.repoSync=new i("repo-sync",{fontCharacter:"\\ea77"}),i.sync=new i("sync",{fontCharacter:"\\ea77"}),i.clone=new i("clone",{fontCharacter:"\\ea78"}),i.desktopDownload=new i("desktop-download",{fontCharacter:"\\ea78"}),i.beaker=new i("beaker",{fontCharacter:"\\ea79"}),i.microscope=new i("microscope",{fontCharacter:"\\ea79"}),i.vm=new i("vm",{fontCharacter:"\\ea7a"}),i.deviceDesktop=new i("device-desktop",{fontCharacter:"\\ea7a"}),i.file=new i("file",{fontCharacter:"\\ea7b"}),i.fileText=new i("file-text",{fontCharacter:"\\ea7b"}),i.more=new i("more",{fontCharacter:"\\ea7c"}),i.ellipsis=new i("ellipsis",{fontCharacter:"\\ea7c"}),i.kebabHorizontal=new i("kebab-horizontal",{fontCharacter:"\\ea7c"}),i.mailReply=new i("mail-reply",{fontCharacter:"\\ea7d"}),i.reply=new i("reply",{fontCharacter:"\\ea7d"}),i.organization=new i("organization",{fontCharacter:"\\ea7e"}),i.organizationFilled=new i("organization-filled",{fontCharacter:"\\ea7e"}),i.organizationOutline=new i("organization-outline",{fontCharacter:"\\ea7e"}),i.newFile=new i("new-file",{fontCharacter:"\\ea7f"}),i.fileAdd=new i("file-add",{fontCharacter:"\\ea7f"}),i.newFolder=new i("new-folder",{fontCharacter:"\\ea80"}),i.fileDirectoryCreate=new i("file-directory-create",{fontCharacter:"\\ea80"}),i.trash=new i("trash",{fontCharacter:"\\ea81"}),i.trashcan=new i("trashcan",{fontCharacter:"\\ea81"}),i.history=new i("history",{fontCharacter:"\\ea82"}),i.clock=new i("clock",{fontCharacter:"\\ea82"}),i.folder=new i("folder",{fontCharacter:"\\ea83"}),i.fileDirectory=new i("file-directory",{fontCharacter:"\\ea83"}),i.symbolFolder=new i("symbol-folder",{fontCharacter:"\\ea83"}),i.logoGithub=new i("logo-github",{fontCharacter:"\\ea84"}),i.markGithub=new i("mark-github",{fontCharacter:"\\ea84"}),i.github=new i("github",{fontCharacter:"\\ea84"}),i.terminal=new i("terminal",{fontCharacter:"\\ea85"}),i.console=new i("console",{fontCharacter:"\\ea85"}),i.repl=new i("repl",{fontCharacter:"\\ea85"}),i.zap=new i("zap",{fontCharacter:"\\ea86"}),i.symbolEvent=new i("symbol-event",{fontCharacter:"\\ea86"}),i.error=new i("error",{fontCharacter:"\\ea87"}),i.stop=new i("stop",{fontCharacter:"\\ea87"}),i.variable=new i("variable",{fontCharacter:"\\ea88"}),i.symbolVariable=new i("symbol-variable",{fontCharacter:"\\ea88"}),i.array=new i("array",{fontCharacter:"\\ea8a"}),i.symbolArray=new i("symbol-array",{fontCharacter:"\\ea8a"}),i.symbolModule=new i("symbol-module",{fontCharacter:"\\ea8b"}),i.symbolPackage=new i("symbol-package",{fontCharacter:"\\ea8b"}),i.symbolNamespace=new i("symbol-namespace",{fontCharacter:"\\ea8b"}),i.symbolObject=new i("symbol-object",{fontCharacter:"\\ea8b"}),i.symbolMethod=new i("symbol-method",{fontCharacter:"\\ea8c"}),i.symbolFunction=new i("symbol-function",{fontCharacter:"\\ea8c"}),i.symbolConstructor=new i("symbol-constructor",{fontCharacter:"\\ea8c"}),i.symbolBoolean=new i("symbol-boolean",{fontCharacter:"\\ea8f"}),i.symbolNull=new i("symbol-null",{fontCharacter:"\\ea8f"}),i.symbolNumeric=new i("symbol-numeric",{fontCharacter:"\\ea90"}),i.symbolNumber=new i("symbol-number",{fontCharacter:"\\ea90"}),i.symbolStructure=new i("symbol-structure",{fontCharacter:"\\ea91"}),i.symbolStruct=new i("symbol-struct",{fontCharacter:"\\ea91"}),i.symbolParameter=new i("symbol-parameter",{fontCharacter:"\\ea92"}),i.symbolTypeParameter=new i("symbol-type-parameter",{fontCharacter:"\\ea92"}),i.symbolKey=new i("symbol-key",{fontCharacter:"\\ea93"}),i.symbolText=new i("symbol-text",{fontCharacter:"\\ea93"}),i.symbolReference=new i("symbol-reference",{fontCharacter:"\\ea94"}),i.goToFile=new i("go-to-file",{fontCharacter:"\\ea94"}),i.symbolEnum=new i("symbol-enum",{fontCharacter:"\\ea95"}),i.symbolValue=new i("symbol-value",{fontCharacter:"\\ea95"}),i.symbolRuler=new i("symbol-ruler",{fontCharacter:"\\ea96"}),i.symbolUnit=new i("symbol-unit",{fontCharacter:"\\ea96"}),i.activateBreakpoints=new i("activate-breakpoints",{fontCharacter:"\\ea97"}),i.archive=new i("archive",{fontCharacter:"\\ea98"}),i.arrowBoth=new i("arrow-both",{fontCharacter:"\\ea99"}),i.arrowDown=new i("arrow-down",{fontCharacter:"\\ea9a"}),i.arrowLeft=new i("arrow-left",{fontCharacter:"\\ea9b"}),i.arrowRight=new i("arrow-right",{fontCharacter:"\\ea9c"}),i.arrowSmallDown=new i("arrow-small-down",{fontCharacter:"\\ea9d"}),i.arrowSmallLeft=new i("arrow-small-left",{fontCharacter:"\\ea9e"}),i.arrowSmallRight=new i("arrow-small-right",{fontCharacter:"\\ea9f"}),i.arrowSmallUp=new i("arrow-small-up",{fontCharacter:"\\eaa0"}),i.arrowUp=new i("arrow-up",{fontCharacter:"\\eaa1"}),i.bell=new i("bell",{fontCharacter:"\\eaa2"}),i.bold=new i("bold",{fontCharacter:"\\eaa3"}),i.book=new i("book",{fontCharacter:"\\eaa4"}),i.bookmark=new i("bookmark",{fontCharacter:"\\eaa5"}),i.debugBreakpointConditionalUnverified=new i("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),i.debugBreakpointConditional=new i("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),i.debugBreakpointConditionalDisabled=new i("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),i.debugBreakpointDataUnverified=new i("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),i.debugBreakpointData=new i("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),i.debugBreakpointDataDisabled=new i("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),i.debugBreakpointLogUnverified=new i("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),i.debugBreakpointLog=new i("debug-breakpoint-log",{fontCharacter:"\\eaab"}),i.debugBreakpointLogDisabled=new i("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),i.briefcase=new i("briefcase",{fontCharacter:"\\eaac"}),i.broadcast=new i("broadcast",{fontCharacter:"\\eaad"}),i.browser=new i("browser",{fontCharacter:"\\eaae"}),i.bug=new i("bug",{fontCharacter:"\\eaaf"}),i.calendar=new i("calendar",{fontCharacter:"\\eab0"}),i.caseSensitive=new i("case-sensitive",{fontCharacter:"\\eab1"}),i.check=new i("check",{fontCharacter:"\\eab2"}),i.checklist=new i("checklist",{fontCharacter:"\\eab3"}),i.chevronDown=new i("chevron-down",{fontCharacter:"\\eab4"}),i.dropDownButton=new i("drop-down-button",i.chevronDown.definition),i.chevronLeft=new i("chevron-left",{fontCharacter:"\\eab5"}),i.chevronRight=new i("chevron-right",{fontCharacter:"\\eab6"}),i.chevronUp=new i("chevron-up",{fontCharacter:"\\eab7"}),i.chromeClose=new i("chrome-close",{fontCharacter:"\\eab8"}),i.chromeMaximize=new i("chrome-maximize",{fontCharacter:"\\eab9"}),i.chromeMinimize=new i("chrome-minimize",{fontCharacter:"\\eaba"}),i.chromeRestore=new i("chrome-restore",{fontCharacter:"\\eabb"}),i.circleOutline=new i("circle-outline",{fontCharacter:"\\eabc"}),i.debugBreakpointUnverified=new i("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),i.circleSlash=new i("circle-slash",{fontCharacter:"\\eabd"}),i.circuitBoard=new i("circuit-board",{fontCharacter:"\\eabe"}),i.clearAll=new i("clear-all",{fontCharacter:"\\eabf"}),i.clippy=new i("clippy",{fontCharacter:"\\eac0"}),i.closeAll=new i("close-all",{fontCharacter:"\\eac1"}),i.cloudDownload=new i("cloud-download",{fontCharacter:"\\eac2"}),i.cloudUpload=new i("cloud-upload",{fontCharacter:"\\eac3"}),i.code=new i("code",{fontCharacter:"\\eac4"}),i.collapseAll=new i("collapse-all",{fontCharacter:"\\eac5"}),i.colorMode=new i("color-mode",{fontCharacter:"\\eac6"}),i.commentDiscussion=new i("comment-discussion",{fontCharacter:"\\eac7"}),i.compareChanges=new i("compare-changes",{fontCharacter:"\\eafd"}),i.creditCard=new i("credit-card",{fontCharacter:"\\eac9"}),i.dash=new i("dash",{fontCharacter:"\\eacc"}),i.dashboard=new i("dashboard",{fontCharacter:"\\eacd"}),i.database=new i("database",{fontCharacter:"\\eace"}),i.debugContinue=new i("debug-continue",{fontCharacter:"\\eacf"}),i.debugDisconnect=new i("debug-disconnect",{fontCharacter:"\\ead0"}),i.debugPause=new i("debug-pause",{fontCharacter:"\\ead1"}),i.debugRestart=new i("debug-restart",{fontCharacter:"\\ead2"}),i.debugStart=new i("debug-start",{fontCharacter:"\\ead3"}),i.debugStepInto=new i("debug-step-into",{fontCharacter:"\\ead4"}),i.debugStepOut=new i("debug-step-out",{fontCharacter:"\\ead5"}),i.debugStepOver=new i("debug-step-over",{fontCharacter:"\\ead6"}),i.debugStop=new i("debug-stop",{fontCharacter:"\\ead7"}),i.debug=new i("debug",{fontCharacter:"\\ead8"}),i.deviceCameraVideo=new i("device-camera-video",{fontCharacter:"\\ead9"}),i.deviceCamera=new i("device-camera",{fontCharacter:"\\eada"}),i.deviceMobile=new i("device-mobile",{fontCharacter:"\\eadb"}),i.diffAdded=new i("diff-added",{fontCharacter:"\\eadc"}),i.diffIgnored=new i("diff-ignored",{fontCharacter:"\\eadd"}),i.diffModified=new i("diff-modified",{fontCharacter:"\\eade"}),i.diffRemoved=new i("diff-removed",{fontCharacter:"\\eadf"}),i.diffRenamed=new i("diff-renamed",{fontCharacter:"\\eae0"}),i.diff=new i("diff",{fontCharacter:"\\eae1"}),i.discard=new i("discard",{fontCharacter:"\\eae2"}),i.editorLayout=new i("editor-layout",{fontCharacter:"\\eae3"}),i.emptyWindow=new i("empty-window",{fontCharacter:"\\eae4"}),i.exclude=new i("exclude",{fontCharacter:"\\eae5"}),i.extensions=new i("extensions",{fontCharacter:"\\eae6"}),i.eyeClosed=new i("eye-closed",{fontCharacter:"\\eae7"}),i.fileBinary=new i("file-binary",{fontCharacter:"\\eae8"}),i.fileCode=new i("file-code",{fontCharacter:"\\eae9"}),i.fileMedia=new i("file-media",{fontCharacter:"\\eaea"}),i.filePdf=new i("file-pdf",{fontCharacter:"\\eaeb"}),i.fileSubmodule=new i("file-submodule",{fontCharacter:"\\eaec"}),i.fileSymlinkDirectory=new i("file-symlink-directory",{fontCharacter:"\\eaed"}),i.fileSymlinkFile=new i("file-symlink-file",{fontCharacter:"\\eaee"}),i.fileZip=new i("file-zip",{fontCharacter:"\\eaef"}),i.files=new i("files",{fontCharacter:"\\eaf0"}),i.filter=new i("filter",{fontCharacter:"\\eaf1"}),i.flame=new i("flame",{fontCharacter:"\\eaf2"}),i.foldDown=new i("fold-down",{fontCharacter:"\\eaf3"}),i.foldUp=new i("fold-up",{fontCharacter:"\\eaf4"}),i.fold=new i("fold",{fontCharacter:"\\eaf5"}),i.folderActive=new i("folder-active",{fontCharacter:"\\eaf6"}),i.folderOpened=new i("folder-opened",{fontCharacter:"\\eaf7"}),i.gear=new i("gear",{fontCharacter:"\\eaf8"}),i.gift=new i("gift",{fontCharacter:"\\eaf9"}),i.gistSecret=new i("gist-secret",{fontCharacter:"\\eafa"}),i.gist=new i("gist",{fontCharacter:"\\eafb"}),i.gitCommit=new i("git-commit",{fontCharacter:"\\eafc"}),i.gitCompare=new i("git-compare",{fontCharacter:"\\eafd"}),i.gitMerge=new i("git-merge",{fontCharacter:"\\eafe"}),i.githubAction=new i("github-action",{fontCharacter:"\\eaff"}),i.githubAlt=new i("github-alt",{fontCharacter:"\\eb00"}),i.globe=new i("globe",{fontCharacter:"\\eb01"}),i.grabber=new i("grabber",{fontCharacter:"\\eb02"}),i.graph=new i("graph",{fontCharacter:"\\eb03"}),i.gripper=new i("gripper",{fontCharacter:"\\eb04"}),i.heart=new i("heart",{fontCharacter:"\\eb05"}),i.home=new i("home",{fontCharacter:"\\eb06"}),i.horizontalRule=new i("horizontal-rule",{fontCharacter:"\\eb07"}),i.hubot=new i("hubot",{fontCharacter:"\\eb08"}),i.inbox=new i("inbox",{fontCharacter:"\\eb09"}),i.issueClosed=new i("issue-closed",{fontCharacter:"\\eba4"}),i.issueReopened=new i("issue-reopened",{fontCharacter:"\\eb0b"}),i.issues=new i("issues",{fontCharacter:"\\eb0c"}),i.italic=new i("italic",{fontCharacter:"\\eb0d"}),i.jersey=new i("jersey",{fontCharacter:"\\eb0e"}),i.json=new i("json",{fontCharacter:"\\eb0f"}),i.kebabVertical=new i("kebab-vertical",{fontCharacter:"\\eb10"}),i.key=new i("key",{fontCharacter:"\\eb11"}),i.law=new i("law",{fontCharacter:"\\eb12"}),i.lightbulbAutofix=new i("lightbulb-autofix",{fontCharacter:"\\eb13"}),i.linkExternal=new i("link-external",{fontCharacter:"\\eb14"}),i.link=new i("link",{fontCharacter:"\\eb15"}),i.listOrdered=new i("list-ordered",{fontCharacter:"\\eb16"}),i.listUnordered=new i("list-unordered",{fontCharacter:"\\eb17"}),i.liveShare=new i("live-share",{fontCharacter:"\\eb18"}),i.loading=new i("loading",{fontCharacter:"\\eb19"}),i.location=new i("location",{fontCharacter:"\\eb1a"}),i.mailRead=new i("mail-read",{fontCharacter:"\\eb1b"}),i.mail=new i("mail",{fontCharacter:"\\eb1c"}),i.markdown=new i("markdown",{fontCharacter:"\\eb1d"}),i.megaphone=new i("megaphone",{fontCharacter:"\\eb1e"}),i.mention=new i("mention",{fontCharacter:"\\eb1f"}),i.milestone=new i("milestone",{fontCharacter:"\\eb20"}),i.mortarBoard=new i("mortar-board",{fontCharacter:"\\eb21"}),i.move=new i("move",{fontCharacter:"\\eb22"}),i.multipleWindows=new i("multiple-windows",{fontCharacter:"\\eb23"}),i.mute=new i("mute",{fontCharacter:"\\eb24"}),i.noNewline=new i("no-newline",{fontCharacter:"\\eb25"}),i.note=new i("note",{fontCharacter:"\\eb26"}),i.octoface=new i("octoface",{fontCharacter:"\\eb27"}),i.openPreview=new i("open-preview",{fontCharacter:"\\eb28"}),i.package_=new i("package",{fontCharacter:"\\eb29"}),i.paintcan=new i("paintcan",{fontCharacter:"\\eb2a"}),i.pin=new i("pin",{fontCharacter:"\\eb2b"}),i.play=new i("play",{fontCharacter:"\\eb2c"}),i.run=new i("run",{fontCharacter:"\\eb2c"}),i.plug=new i("plug",{fontCharacter:"\\eb2d"}),i.preserveCase=new i("preserve-case",{fontCharacter:"\\eb2e"}),i.preview=new i("preview",{fontCharacter:"\\eb2f"}),i.project=new i("project",{fontCharacter:"\\eb30"}),i.pulse=new i("pulse",{fontCharacter:"\\eb31"}),i.question=new i("question",{fontCharacter:"\\eb32"}),i.quote=new i("quote",{fontCharacter:"\\eb33"}),i.radioTower=new i("radio-tower",{fontCharacter:"\\eb34"}),i.reactions=new i("reactions",{fontCharacter:"\\eb35"}),i.references=new i("references",{fontCharacter:"\\eb36"}),i.refresh=new i("refresh",{fontCharacter:"\\eb37"}),i.regex=new i("regex",{fontCharacter:"\\eb38"}),i.remoteExplorer=new i("remote-explorer",{fontCharacter:"\\eb39"}),i.remote=new i("remote",{fontCharacter:"\\eb3a"}),i.remove=new i("remove",{fontCharacter:"\\eb3b"}),i.replaceAll=new i("replace-all",{fontCharacter:"\\eb3c"}),i.replace=new i("replace",{fontCharacter:"\\eb3d"}),i.repoClone=new i("repo-clone",{fontCharacter:"\\eb3e"}),i.repoForcePush=new i("repo-force-push",{fontCharacter:"\\eb3f"}),i.repoPull=new i("repo-pull",{fontCharacter:"\\eb40"}),i.repoPush=new i("repo-push",{fontCharacter:"\\eb41"}),i.report=new i("report",{fontCharacter:"\\eb42"}),i.requestChanges=new i("request-changes",{fontCharacter:"\\eb43"}),i.rocket=new i("rocket",{fontCharacter:"\\eb44"}),i.rootFolderOpened=new i("root-folder-opened",{fontCharacter:"\\eb45"}),i.rootFolder=new i("root-folder",{fontCharacter:"\\eb46"}),i.rss=new i("rss",{fontCharacter:"\\eb47"}),i.ruby=new i("ruby",{fontCharacter:"\\eb48"}),i.saveAll=new i("save-all",{fontCharacter:"\\eb49"}),i.saveAs=new i("save-as",{fontCharacter:"\\eb4a"}),i.save=new i("save",{fontCharacter:"\\eb4b"}),i.screenFull=new i("screen-full",{fontCharacter:"\\eb4c"}),i.screenNormal=new i("screen-normal",{fontCharacter:"\\eb4d"}),i.searchStop=new i("search-stop",{fontCharacter:"\\eb4e"}),i.server=new i("server",{fontCharacter:"\\eb50"}),i.settingsGear=new i("settings-gear",{fontCharacter:"\\eb51"}),i.settings=new i("settings",{fontCharacter:"\\eb52"}),i.shield=new i("shield",{fontCharacter:"\\eb53"}),i.smiley=new i("smiley",{fontCharacter:"\\eb54"}),i.sortPrecedence=new i("sort-precedence",{fontCharacter:"\\eb55"}),i.splitHorizontal=new i("split-horizontal",{fontCharacter:"\\eb56"}),i.splitVertical=new i("split-vertical",{fontCharacter:"\\eb57"}),i.squirrel=new i("squirrel",{fontCharacter:"\\eb58"}),i.starFull=new i("star-full",{fontCharacter:"\\eb59"}),i.starHalf=new i("star-half",{fontCharacter:"\\eb5a"}),i.symbolClass=new i("symbol-class",{fontCharacter:"\\eb5b"}),i.symbolColor=new i("symbol-color",{fontCharacter:"\\eb5c"}),i.symbolConstant=new i("symbol-constant",{fontCharacter:"\\eb5d"}),i.symbolEnumMember=new i("symbol-enum-member",{fontCharacter:"\\eb5e"}),i.symbolField=new i("symbol-field",{fontCharacter:"\\eb5f"}),i.symbolFile=new i("symbol-file",{fontCharacter:"\\eb60"}),i.symbolInterface=new i("symbol-interface",{fontCharacter:"\\eb61"}),i.symbolKeyword=new i("symbol-keyword",{fontCharacter:"\\eb62"}),i.symbolMisc=new i("symbol-misc",{fontCharacter:"\\eb63"}),i.symbolOperator=new i("symbol-operator",{fontCharacter:"\\eb64"}),i.symbolProperty=new i("symbol-property",{fontCharacter:"\\eb65"}),i.wrench=new i("wrench",{fontCharacter:"\\eb65"}),i.wrenchSubaction=new i("wrench-subaction",{fontCharacter:"\\eb65"}),i.symbolSnippet=new i("symbol-snippet",{fontCharacter:"\\eb66"}),i.tasklist=new i("tasklist",{fontCharacter:"\\eb67"}),i.telescope=new i("telescope",{fontCharacter:"\\eb68"}),i.textSize=new i("text-size",{fontCharacter:"\\eb69"}),i.threeBars=new i("three-bars",{fontCharacter:"\\eb6a"}),i.thumbsdown=new i("thumbsdown",{fontCharacter:"\\eb6b"}),i.thumbsup=new i("thumbsup",{fontCharacter:"\\eb6c"}),i.tools=new i("tools",{fontCharacter:"\\eb6d"}),i.triangleDown=new i("triangle-down",{fontCharacter:"\\eb6e"}),i.triangleLeft=new i("triangle-left",{fontCharacter:"\\eb6f"}),i.triangleRight=new i("triangle-right",{fontCharacter:"\\eb70"}),i.triangleUp=new i("triangle-up",{fontCharacter:"\\eb71"}),i.twitter=new i("twitter",{fontCharacter:"\\eb72"}),i.unfold=new i("unfold",{fontCharacter:"\\eb73"}),i.unlock=new i("unlock",{fontCharacter:"\\eb74"}),i.unmute=new i("unmute",{fontCharacter:"\\eb75"}),i.unverified=new i("unverified",{fontCharacter:"\\eb76"}),i.verified=new i("verified",{fontCharacter:"\\eb77"}),i.versions=new i("versions",{fontCharacter:"\\eb78"}),i.vmActive=new i("vm-active",{fontCharacter:"\\eb79"}),i.vmOutline=new i("vm-outline",{fontCharacter:"\\eb7a"}),i.vmRunning=new i("vm-running",{fontCharacter:"\\eb7b"}),i.watch=new i("watch",{fontCharacter:"\\eb7c"}),i.whitespace=new i("whitespace",{fontCharacter:"\\eb7d"}),i.wholeWord=new i("whole-word",{fontCharacter:"\\eb7e"}),i.window=new i("window",{fontCharacter:"\\eb7f"}),i.wordWrap=new i("word-wrap",{fontCharacter:"\\eb80"}),i.zoomIn=new i("zoom-in",{fontCharacter:"\\eb81"}),i.zoomOut=new i("zoom-out",{fontCharacter:"\\eb82"}),i.listFilter=new i("list-filter",{fontCharacter:"\\eb83"}),i.listFlat=new i("list-flat",{fontCharacter:"\\eb84"}),i.listSelection=new i("list-selection",{fontCharacter:"\\eb85"}),i.selection=new i("selection",{fontCharacter:"\\eb85"}),i.listTree=new i("list-tree",{fontCharacter:"\\eb86"}),i.debugBreakpointFunctionUnverified=new i("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),i.debugBreakpointFunction=new i("debug-breakpoint-function",{fontCharacter:"\\eb88"}),i.debugBreakpointFunctionDisabled=new i("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),i.debugStackframeActive=new i("debug-stackframe-active",{fontCharacter:"\\eb89"}),i.debugStackframeDot=new i("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),i.debugStackframe=new i("debug-stackframe",{fontCharacter:"\\eb8b"}),i.debugStackframeFocused=new i("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),i.debugBreakpointUnsupported=new i("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),i.symbolString=new i("symbol-string",{fontCharacter:"\\eb8d"}),i.debugReverseContinue=new i("debug-reverse-continue",{fontCharacter:"\\eb8e"}),i.debugStepBack=new i("debug-step-back",{fontCharacter:"\\eb8f"}),i.debugRestartFrame=new i("debug-restart-frame",{fontCharacter:"\\eb90"}),i.callIncoming=new i("call-incoming",{fontCharacter:"\\eb92"}),i.callOutgoing=new i("call-outgoing",{fontCharacter:"\\eb93"}),i.menu=new i("menu",{fontCharacter:"\\eb94"}),i.expandAll=new i("expand-all",{fontCharacter:"\\eb95"}),i.feedback=new i("feedback",{fontCharacter:"\\eb96"}),i.groupByRefType=new i("group-by-ref-type",{fontCharacter:"\\eb97"}),i.ungroupByRefType=new i("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),i.account=new i("account",{fontCharacter:"\\eb99"}),i.bellDot=new i("bell-dot",{fontCharacter:"\\eb9a"}),i.debugConsole=new i("debug-console",{fontCharacter:"\\eb9b"}),i.library=new i("library",{fontCharacter:"\\eb9c"}),i.output=new i("output",{fontCharacter:"\\eb9d"}),i.runAll=new i("run-all",{fontCharacter:"\\eb9e"}),i.syncIgnored=new i("sync-ignored",{fontCharacter:"\\eb9f"}),i.pinned=new i("pinned",{fontCharacter:"\\eba0"}),i.githubInverted=new i("github-inverted",{fontCharacter:"\\eba1"}),i.debugAlt=new i("debug-alt",{fontCharacter:"\\eb91"}),i.serverProcess=new i("server-process",{fontCharacter:"\\eba2"}),i.serverEnvironment=new i("server-environment",{fontCharacter:"\\eba3"}),i.pass=new i("pass",{fontCharacter:"\\eba4"}),i.stopCircle=new i("stop-circle",{fontCharacter:"\\eba5"}),i.playCircle=new i("play-circle",{fontCharacter:"\\eba6"}),i.record=new i("record",{fontCharacter:"\\eba7"}),i.debugAltSmall=new i("debug-alt-small",{fontCharacter:"\\eba8"}),i.vmConnect=new i("vm-connect",{fontCharacter:"\\eba9"}),i.cloud=new i("cloud",{fontCharacter:"\\ebaa"}),i.merge=new i("merge",{fontCharacter:"\\ebab"}),i.exportIcon=new i("export",{fontCharacter:"\\ebac"}),i.graphLeft=new i("graph-left",{fontCharacter:"\\ebad"}),i.magnet=new i("magnet",{fontCharacter:"\\ebae"}),i.notebook=new i("notebook",{fontCharacter:"\\ebaf"}),i.redo=new i("redo",{fontCharacter:"\\ebb0"}),i.checkAll=new i("check-all",{fontCharacter:"\\ebb1"}),i.pinnedDirty=new i("pinned-dirty",{fontCharacter:"\\ebb2"}),i.passFilled=new i("pass-filled",{fontCharacter:"\\ebb3"}),i.circleLargeFilled=new i("circle-large-filled",{fontCharacter:"\\ebb4"}),i.circleLargeOutline=new i("circle-large-outline",{fontCharacter:"\\ebb5"}),i.combine=new i("combine",{fontCharacter:"\\ebb6"}),i.gather=new i("gather",{fontCharacter:"\\ebb6"}),i.table=new i("table",{fontCharacter:"\\ebb7"}),i.variableGroup=new i("variable-group",{fontCharacter:"\\ebb8"}),i.typeHierarchy=new i("type-hierarchy",{fontCharacter:"\\ebb9"}),i.typeHierarchySub=new i("type-hierarchy-sub",{fontCharacter:"\\ebba"}),i.typeHierarchySuper=new i("type-hierarchy-super",{fontCharacter:"\\ebbb"}),i.gitPullRequestCreate=new i("git-pull-request-create",{fontCharacter:"\\ebbc"}),i.runAbove=new i("run-above",{fontCharacter:"\\ebbd"}),i.runBelow=new i("run-below",{fontCharacter:"\\ebbe"}),i.notebookTemplate=new i("notebook-template",{fontCharacter:"\\ebbf"}),i.debugRerun=new i("debug-rerun",{fontCharacter:"\\ebc0"}),i.workspaceTrusted=new i("workspace-trusted",{fontCharacter:"\\ebc1"}),i.workspaceUntrusted=new i("workspace-untrusted",{fontCharacter:"\\ebc2"}),i.workspaceUnspecified=new i("workspace-unspecified",{fontCharacter:"\\ebc3"}),i.terminalCmd=new i("terminal-cmd",{fontCharacter:"\\ebc4"}),i.terminalDebian=new i("terminal-debian",{fontCharacter:"\\ebc5"}),i.terminalLinux=new i("terminal-linux",{fontCharacter:"\\ebc6"}),i.terminalPowershell=new i("terminal-powershell",{fontCharacter:"\\ebc7"}),i.terminalTmux=new i("terminal-tmux",{fontCharacter:"\\ebc8"}),i.terminalUbuntu=new i("terminal-ubuntu",{fontCharacter:"\\ebc9"}),i.terminalBash=new i("terminal-bash",{fontCharacter:"\\ebca"}),i.arrowSwap=new i("arrow-swap",{fontCharacter:"\\ebcb"}),i.copy=new i("copy",{fontCharacter:"\\ebcc"}),i.personAdd=new i("person-add",{fontCharacter:"\\ebcd"}),i.filterFilled=new i("filter-filled",{fontCharacter:"\\ebce"}),i.wand=new i("wand",{fontCharacter:"\\ebcf"}),i.debugLineByLine=new i("debug-line-by-line",{fontCharacter:"\\ebd0"}),i.inspect=new i("inspect",{fontCharacter:"\\ebd1"}),i.layers=new i("layers",{fontCharacter:"\\ebd2"}),i.layersDot=new i("layers-dot",{fontCharacter:"\\ebd3"}),i.layersActive=new i("layers-active",{fontCharacter:"\\ebd4"}),i.compass=new i("compass",{fontCharacter:"\\ebd5"}),i.compassDot=new i("compass-dot",{fontCharacter:"\\ebd6"}),i.compassActive=new i("compass-active",{fontCharacter:"\\ebd7"}),i.azure=new i("azure",{fontCharacter:"\\ebd8"}),i.issueDraft=new i("issue-draft",{fontCharacter:"\\ebd9"}),i.gitPullRequestClosed=new i("git-pull-request-closed",{fontCharacter:"\\ebda"}),i.gitPullRequestDraft=new i("git-pull-request-draft",{fontCharacter:"\\ebdb"}),i.debugAll=new i("debug-all",{fontCharacter:"\\ebdc"}),i.debugCoverage=new i("debug-coverage",{fontCharacter:"\\ebdd"}),i.runErrors=new i("run-errors",{fontCharacter:"\\ebde"}),i.folderLibrary=new i("folder-library",{fontCharacter:"\\ebdf"}),i.debugContinueSmall=new i("debug-continue-small",{fontCharacter:"\\ebe0"}),i.beakerStop=new i("beaker-stop",{fontCharacter:"\\ebe1"}),i.graphLine=new i("graph-line",{fontCharacter:"\\ebe2"}),i.graphScatter=new i("graph-scatter",{fontCharacter:"\\ebe3"}),i.pieChart=new i("pie-chart",{fontCharacter:"\\ebe4"}),i.bracket=new i("bracket",i.json.definition),i.bracketDot=new i("bracket-dot",{fontCharacter:"\\ebe5"}),i.bracketError=new i("bracket-error",{fontCharacter:"\\ebe6"}),i.lockSmall=new i("lock-small",{fontCharacter:"\\ebe7"}),i.azureDevops=new i("azure-devops",{fontCharacter:"\\ebe8"}),i.verifiedFilled=new i("verified-filled",{fontCharacter:"\\ebe9"})}(E||(E={}))},"VrN/":function(it,re,Q){(function(G,R){it.exports=R()})(this,function(){"use strict";var G=navigator.userAgent,R=navigator.platform,I=/gecko\/\d/i.test(G),L=/MSIE \d/.test(G),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(G),p=/Edge\/(\d+)/.exec(G),E=L||M||p,b=E&&(L?document.documentMode||6:+(p||M)[1]),i=!p&&/WebKit\//.test(G),c=i&&/Qt\/\d+\.\d+/.test(G),o=!p&&/Chrome\//.test(G),h=/Opera\//.test(G),n=/Apple Computer/.test(navigator.vendor),a=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(G),t=/PhantomJS/.test(G),r=!p&&/AppleWebKit/.test(G)&&/Mobile\/\w+/.test(G),s=/Android/.test(G),u=r||s||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(G),f=r||/Mac/.test(R),d=/\bCrOS\b/.test(G),v=/win/i.test(R),m=h&&G.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(h=!1,i=!0);var S=f&&(c||h&&(m==null||m<12.11)),C=I||E&&b>=9;function _(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,l){var w=e.className,x=_(l).exec(w);if(x){var D=w.slice(x.index+x[0].length);e.className=w.slice(0,x.index)+(D?x[1]+D:"")}};function T(e){for(var l=e.childNodes.length;l>0;--l)e.removeChild(e.firstChild);return e}function k(e,l){return T(e).appendChild(l)}function g(e,l,w,x){var D=document.createElement(e);if(w&&(D.className=w),x&&(D.style.cssText=x),typeof l=="string")D.appendChild(document.createTextNode(l));else if(l)for(var X=0;X<l.length;++X)D.appendChild(l[X]);return D}function F(e,l,w,x){var D=g(e,l,w,x);return D.setAttribute("role","presentation"),D}var P;document.createRange?P=function(e,l,w,x){var D=document.createRange();return D.setEnd(x||e,w),D.setStart(e,l),D}:P=function(e,l,w){var x=document.body.createTextRange();try{x.moveToElementText(e.parentNode)}catch(D){return x}return x.collapse(!0),x.moveEnd("character",w),x.moveStart("character",l),x};function N(e,l){if(l.nodeType==3&&(l=l.parentNode),e.contains)return e.contains(l);do if(l.nodeType==11&&(l=l.host),l==e)return!0;while(l=l.parentNode)}function W(){var e;try{e=document.activeElement}catch(l){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,l){var w=e.className;_(l).test(w)||(e.className+=(w?" ":"")+l)}function A(e,l){for(var w=e.split(" "),x=0;x<w.length;x++)w[x]&&!_(w[x]).test(l)&&(l+=" "+w[x]);return l}var K=function(e){e.select()};r?K=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:E&&(K=function(e){try{e.select()}catch(l){}});function U(e){var l=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,l)}}function O(e,l,w){l||(l={});for(var x in e)e.hasOwnProperty(x)&&(w!==!1||!l.hasOwnProperty(x))&&(l[x]=e[x]);return l}function z(e,l,w,x,D){l==null&&(l=e.search(/[^\s\u00a0]/),l==-1&&(l=e.length));for(var X=x||0,Z=D||0;;){var ie=e.indexOf(" ",X);if(ie<0||ie>=l)return Z+(l-X);Z+=ie-X,Z+=w-Z%w,X=ie+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=U(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,l){this.f=l;var w=+new Date+e;(!this.id||w<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=w)};function de(e,l){for(var w=0;w<e.length;++w)if(e[w]==l)return w;return-1}var be=50,je={toString:function(){return"CodeMirror.Pass"}},Ne={scroll:!1},Oe={origin:"*mouse"},Ke={origin:"+move"};function We(e,l,w){for(var x=0,D=0;;){var X=e.indexOf(" ",x);X==-1&&(X=e.length);var Z=X-x;if(X==e.length||D+Z>=l)return x+Math.min(Z,l-D);if(D+=X-x,D+=w-D%w,x=X+1,D>=l)return x}}var Te=[""];function we(e){for(;Te.length<=e;)Te.push(ue(Te)+" ");return Te[e]}function ue(e){return e[e.length-1]}function Ae(e,l){for(var w=[],x=0;x<e.length;x++)w[x]=l(e[x],x);return w}function ge(e,l,w){for(var x=0,D=w(l);x<e.length&&w(e[x])<=D;)x++;e.splice(x,0,l)}function Ve(){}function Qe(e,l){var w;return Object.create?w=Object.create(e):(Ve.prototype=e,w=new Ve),l&&O(l,w),w}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function qe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function Je(e,l){return l?l.source.indexOf("\\w")>-1&&qe(e)?!0:l.test(e):qe(e)}function pe(e){for(var l in e)if(e.hasOwnProperty(l)&&e[l])return!1;return!0}var ve=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function xe(e){return e.charCodeAt(0)>=768&&ve.test(e)}function Se(e,l,w){for(;(w<0?l>0:l<e.length)&&xe(e.charAt(l));)l+=w;return l}function Le(e,l,w){for(var x=l>w?-1:1;;){if(l==w)return l;var D=(l+w)/2,X=x<0?Math.ceil(D):Math.floor(D);if(X==l)return e(X)?l:w;e(X)?w=X:l=X+x}}function ne(e,l,w,x){if(!e)return x(l,w,"ltr",0);for(var D=!1,X=0;X<e.length;++X){var Z=e[X];(Z.from<w&&Z.to>l||l==w&&Z.to==l)&&(x(Math.max(Z.from,l),Math.min(Z.to,w),Z.level==1?"rtl":"ltr",X),D=!0)}D||x(l,w,"ltr")}var ye=null;function se(e,l,w){var x;ye=null;for(var D=0;D<e.length;++D){var X=e[D];if(X.from<l&&X.to>l)return D;X.to==l&&(X.from!=X.to&&w=="before"?x=D:ye=D),X.from==l&&(X.from!=X.to&&w!="before"?x=D:ye=D)}return x!=null?x:ye}var Pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",l="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function w(he){return he<=247?e.charAt(he):1424<=he&&he<=1524?"R":1536<=he&&he<=1785?l.charAt(he-1536):1774<=he&&he<=2220?"r":8192<=he&&he<=8203?"w":he==8204?"b":"L"}var x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,D=/[stwN]/,X=/[LRr]/,Z=/[Lb1n]/,ie=/[1n]/;function ae(he,De,Ue){this.level=he,this.from=De,this.to=Ue}return function(he,De){var Ue=De=="ltr"?"L":"R";if(he.length==0||De=="ltr"&&!x.test(he))return!1;for(var $e=he.length,Ye=[],rt=0;rt<$e;++rt)Ye.push(w(he.charCodeAt(rt)));for(var lt=0,ct=Ue;lt<$e;++lt){var gt=Ye[lt];gt=="m"?Ye[lt]=ct:ct=gt}for(var yt=0,vt=Ue;yt<$e;++yt){var Et=Ye[yt];Et=="1"&&vt=="r"?Ye[yt]="n":X.test(Et)&&(vt=Et,Et=="r"&&(Ye[yt]="R"))}for(var It=1,At=Ye[0];It<$e-1;++It){var Bt=Ye[It];Bt=="+"&&At=="1"&&Ye[It+1]=="1"?Ye[It]="1":Bt==","&&At==Ye[It+1]&&(At=="1"||At=="n")&&(Ye[It]=At),At=Bt}for(var ti=0;ti<$e;++ti){var yi=Ye[ti];if(yi==",")Ye[ti]="N";else if(yi=="%"){var ai=void 0;for(ai=ti+1;ai<$e&&Ye[ai]=="%";++ai);for(var Xi=ti&&Ye[ti-1]=="!"||ai<$e&&Ye[ai]=="1"?"1":"N",Fi=ti;Fi<ai;++Fi)Ye[Fi]=Xi;ti=ai-1}}for(var hi=0,Ui=Ue;hi<$e;++hi){var wi=Ye[hi];Ui=="L"&&wi=="1"?Ye[hi]="L":X.test(wi)&&(Ui=wi)}for(var pi=0;pi<$e;++pi)if(D.test(Ye[pi])){var ci=void 0;for(ci=pi+1;ci<$e&&D.test(Ye[ci]);++ci);for(var si=(pi?Ye[pi-1]:Ue)=="L",Bi=(ci<$e?Ye[ci]:Ue)=="L",un=si==Bi?si?"L":"R":Ue,Or=pi;Or<ci;++Or)Ye[Or]=un;pi=ci-1}for(var Ri=[],or,bi=0;bi<$e;)if(Z.test(Ye[bi])){var Ga=bi;for(++bi;bi<$e&&Z.test(Ye[bi]);++bi);Ri.push(new ae(0,Ga,bi))}else{var fr=bi,jr=Ri.length,Wr=De=="rtl"?1:0;for(++bi;bi<$e&&Ye[bi]!="L";++bi);for(var ki=fr;ki<bi;)if(ie.test(Ye[ki])){fr<ki&&(Ri.splice(jr,0,new ae(1,fr,ki)),jr+=Wr);var hn=ki;for(++ki;ki<bi&&ie.test(Ye[ki]);++ki);Ri.splice(jr,0,new ae(2,hn,ki)),jr+=Wr,fr=ki}else++ki;fr<bi&&Ri.splice(jr,0,new ae(1,fr,bi))}return De=="ltr"&&(Ri[0].level==1&&(or=he.match(/^\s+/))&&(Ri[0].from=or[0].length,Ri.unshift(new ae(0,0,or[0].length))),ue(Ri).level==1&&(or=he.match(/\s+$/))&&(ue(Ri).to-=or[0].length,Ri.push(new ae(0,$e-or[0].length,$e)))),De=="rtl"?Ri.reverse():Ri}}();function Ze(e,l){var w=e.order;return w==null&&(w=e.order=Pe(e.text,l)),w}var et=[],Ge=function(e,l,w){if(e.addEventListener)e.addEventListener(l,w,!1);else if(e.attachEvent)e.attachEvent("on"+l,w);else{var x=e._handlers||(e._handlers={});x[l]=(x[l]||et).concat(w)}};function ht(e,l){return e._handlers&&e._handlers[l]||et}function ce(e,l,w){if(e.removeEventListener)e.removeEventListener(l,w,!1);else if(e.detachEvent)e.detachEvent("on"+l,w);else{var x=e._handlers,D=x&&x[l];if(D){var X=de(D,w);X>-1&&(x[l]=D.slice(0,X).concat(D.slice(X+1)))}}}function Me(e,l){var w=ht(e,l);if(!w.length)return;for(var x=Array.prototype.slice.call(arguments,2),D=0;D<w.length;++D)w[D].apply(null,x)}function Fe(e,l,w){return typeof l=="string"&&(l={type:l,preventDefault:function(){this.defaultPrevented=!0}}),Me(e,w||l.type,e,l),q(l)||l.codemirrorIgnore}function Ce(e){var l=e._handlers&&e._handlers.cursorActivity;if(!l)return;for(var w=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),x=0;x<l.length;++x)de(w,l[x])==-1&&w.push(l[x])}function _e(e,l){return ht(e,l).length>0}function Ee(e){e.prototype.on=function(l,w){Ge(this,l,w)},e.prototype.off=function(l,w){ce(this,l,w)}}function ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function q(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){ee(e),oe(e)}function Ie(e){return e.target||e.srcElement}function V(e){var l=e.which;return l==null&&(e.button&1?l=1:e.button&2?l=3:e.button&4&&(l=2)),f&&e.ctrlKey&&l==1&&(l=3),l}var Re=function(){if(E&&b<9)return!1;var e=g("div");return"draggable"in e||"dragDrop"in e}(),He;function fe(e){if(He==null){var l=g("span","\u200B");k(e,g("span",[l,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(He=l.offsetWidth<=1&&l.offsetHeight>2&&!(E&&b<8))}var w=He?g("span","\u200B"):g("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return w.setAttribute("cm-text",""),w}var ke;function Xe(e){if(ke!=null)return ke;var l=k(e,document.createTextNode("A\u062EA")),w=P(l,0,1).getBoundingClientRect(),x=P(l,1,2).getBoundingClientRect();return T(e),!w||w.left==w.right?!1:ke=x.right-w.right<3}var ot=`
b`.split(/\n/).length!=3?function(e){for(var l=0,w=[],x=e.length;l<=x;){var D=e.indexOf(`
`,l);D==-1&&(D=e.length);var X=e.slice(l,e.charAt(D-1)=="\r"?D-1:D),Z=X.indexOf("\r");Z!=-1?(w.push(X.slice(0,Z)),l+=Z+1):(w.push(X),l=D+1)}return w}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(l){return!1}}:function(e){var l;try{l=e.ownerDocument.selection.createRange()}catch(w){}return!l||l.parentElement()!=e?!1:l.compareEndPoints("StartToEnd",l)!=0},at=function(){var e=g("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),pt=null;function Ct(e){if(pt!=null)return pt;var l=k(e,g("span","x")),w=l.getBoundingClientRect(),x=P(l,0,1).getBoundingClientRect();return pt=Math.abs(w.left-x.left)>1}var bt={},dt={};function kt(e,l){arguments.length>2&&(l.dependencies=Array.prototype.slice.call(arguments,2)),bt[e]=l}function Ft(e,l){dt[e]=l}function mt(e){if(typeof e=="string"&&dt.hasOwnProperty(e))e=dt[e];else if(e&&typeof e.name=="string"&&dt.hasOwnProperty(e.name)){var l=dt[e.name];typeof l=="string"&&(l={name:l}),e=Qe(l,e),e.name=l.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return mt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return mt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $t(e,l){l=mt(l);var w=bt[l.name];if(!w)return $t(e,"text/plain");var x=w(e,l);if(wt.hasOwnProperty(l.name)){var D=wt[l.name];for(var X in D){if(!D.hasOwnProperty(X))continue;x.hasOwnProperty(X)&&(x["_"+X]=x[X]),x[X]=D[X]}}if(x.name=l.name,l.helperType&&(x.helperType=l.helperType),l.modeProps)for(var Z in l.modeProps)x[Z]=l.modeProps[Z];return x}var wt={};function _t(e,l){var w=wt.hasOwnProperty(e)?wt[e]:wt[e]={};O(l,w)}function Ot(e,l){if(l===!0)return l;if(e.copyState)return e.copyState(l);var w={};for(var x in l){var D=l[x];D instanceof Array&&(D=D.concat([])),w[x]=D}return w}function Nt(e,l){for(var w;e.innerMode&&!(w=e.innerMode(l),!w||w.mode==e);)l=w.state,e=w.mode;return w||{mode:e,state:l}}function qt(e,l,w){return e.startState?e.startState(l,w):!0}var Pt=function(e,l,w){this.pos=this.start=0,this.string=e,this.tabSize=l||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=w};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.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var l=this.string.charAt(this.pos),w;if(typeof e=="string"?w=l==e:w=l&&(e.test?e.test(l):e(l)),w)return++this.pos,l},Pt.prototype.eatWhile=function(e){for(var l=this.pos;this.eat(e););return this.pos>l},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 l=this.string.indexOf(e,this.pos);if(l>-1)return this.pos=l,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,l,w){if(typeof e=="string"){var x=function(Z){return w?Z.toLowerCase():Z},D=this.string.substr(this.pos,e.length);if(x(D)==x(e))return l!==!1&&(this.pos+=e.length),!0}else{var X=this.string.slice(this.pos).match(e);return X&&X.index>0?null:(X&&l!==!1&&(this.pos+=X[0].length),X)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,l){this.lineStart+=e;try{return l()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var l=this.lineOracle;return l&&l.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function xt(e,l){if(l-=e.first,l<0||l>=e.size)throw new Error("There is no line "+(l+e.first)+" in the document.");for(var w=e;!w.lines;)for(var x=0;;++x){var D=w.children[x],X=D.chunkSize();if(l<X){w=D;break}l-=X}return w.lines[l]}function Ki(e,l,w){var x=[],D=l.line;return e.iter(l.line,w.line+1,function(X){var Z=X.text;D==w.line&&(Z=Z.slice(0,w.ch)),D==l.line&&(Z=Z.slice(l.ch)),x.push(Z),++D}),x}function Jt(e,l,w){var x=[];return e.iter(l,w,function(D){x.push(D.text)}),x}function ri(e,l){var w=l-e.height;if(w)for(var x=e;x;x=x.parent)x.height+=w}function Ut(e){if(e.parent==null)return null;for(var l=e.parent,w=de(l.lines,e),x=l.parent;x;l=x,x=x.parent)for(var D=0;!(x.children[D]==l);++D)w+=x.children[D].chunkSize();return w+l.first}function di(e,l){var w=e.first;e:do{for(var x=0;x<e.children.length;++x){var D=e.children[x],X=D.height;if(l<X){e=D;continue e}l-=X,w+=D.chunkSize()}return w}while(!e.lines);for(var Z=0;Z<e.lines.length;++Z){var ie=e.lines[Z],ae=ie.height;if(l<ae)break;l-=ae}return w+Z}function Ii(e,l){return l>=e.first&&l<e.first+e.size}function Yi(e,l){return String(e.lineNumberFormatter(l+e.firstLineNumber))}function ut(e,l,w){if(w===void 0&&(w=null),!(this instanceof ut))return new ut(e,l,w);this.line=e,this.ch=l,this.sticky=w}function Dt(e,l){return e.line-l.line||e.ch-l.ch}function pr(e,l){return e.sticky==l.sticky&&Dt(e,l)==0}function mr(e){return ut(e.line,e.ch)}function gr(e,l){return Dt(e,l)<0?l:e}function vr(e,l){return Dt(e,l)<0?e:l}function J(e,l){return Math.max(e.first,Math.min(l,e.first+e.size-1))}function B(e,l){if(l.line<e.first)return ut(e.first,0);var w=e.first+e.size-1;return l.line>w?ut(w,xt(e,w).text.length):H(l,xt(e,l.line).text.length)}function H(e,l){var w=e.ch;return w==null||w>l?ut(e.line,l):w<0?ut(e.line,0):e}function Y(e,l){for(var w=[],x=0;x<l.length;x++)w[x]=B(e,l[x]);return w}var le=function(e,l){this.state=e,this.lookAhead=l},$=function(e,l,w,x){this.state=l,this.doc=e,this.line=w,this.maxLookAhead=x||0,this.baseTokens=null,this.baseTokenPos=1};$.prototype.lookAhead=function(e){var l=this.doc.getLine(this.line+e);return l!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),l},$.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var l=this.baseTokens[this.baseTokenPos+1];return{type:l&&l.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},$.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$.fromSaved=function(e,l,w){return l instanceof le?new $(e,Ot(e.mode,l.state),w,l.lookAhead):new $(e,Ot(e.mode,l),w)},$.prototype.save=function(e){var l=e!==!1?Ot(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new le(l,this.maxLookAhead):l};function Be(e,l,w,x){var D=[e.state.modeGen],X={};Si(e,l.text,e.doc.mode,w,function(he,De){return D.push(he,De)},X,x);for(var Z=w.state,ie=function(he){w.baseTokens=D;var De=e.state.overlays[he],Ue=1,$e=0;w.state=!0,Si(e,l.text,De.mode,w,function(Ye,rt){for(var lt=Ue;$e<Ye;){var ct=D[Ue];ct>Ye&&D.splice(Ue,1,Ye,D[Ue+1],ct),Ue+=2,$e=Math.min(Ye,ct)}if(!rt)return;if(De.opaque)D.splice(lt,Ue-lt,Ye,"overlay "+rt),Ue=lt+2;else for(;lt<Ue;lt+=2){var gt=D[lt+1];D[lt+1]=(gt?gt+" ":"")+"overlay "+rt}},X),w.state=Z,w.baseTokens=null,w.baseTokenPos=1},ae=0;ae<e.state.overlays.length;++ae)ie(ae);return{styles:D,classes:X.bgClass||X.textClass?X:null}}function nt(e,l,w){if(!l.styles||l.styles[0]!=e.state.modeGen){var x=ft(e,Ut(l)),D=l.text.length>e.options.maxHighlightLength&&Ot(e.doc.mode,x.state),X=Be(e,l,x);D&&(x.state=D),l.stateAfter=x.save(!D),l.styles=X.styles,X.classes?l.styleClasses=X.classes:l.styleClasses&&(l.styleClasses=null),w===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return l.styles}function ft(e,l,w){var x=e.doc,D=e.display;if(!x.mode.startState)return new $(x,!0,l);var X=Ti(e,l,w),Z=X>x.first&&xt(x,X-1).stateAfter,ie=Z?$.fromSaved(x,Z,X):new $(x,qt(x.mode),X);return x.iter(X,l,function(ae){St(e,ae.text,ie);var he=ie.line;ae.stateAfter=he==l-1||he%5==0||he>=D.viewFrom&&he<D.viewTo?ie.save():null,ie.nextLine()}),w&&(x.modeFrontier=ie.line),ie}function St(e,l,w,x){var D=e.doc.mode,X=new Pt(l,e.options.tabSize,w);for(X.start=X.pos=x||0,l==""&&st(D,w.state);!X.eol();)Rt(D,X,w.state),X.start=X.pos}function st(e,l){if(e.blankLine)return e.blankLine(l);if(!e.innerMode)return;var w=Nt(e,l);if(w.mode.blankLine)return w.mode.blankLine(w.state)}function Rt(e,l,w,x){for(var D=0;D<10;D++){x&&(x[0]=Nt(e,w).mode);var X=e.token(l,w);if(l.pos>l.start)return X}throw new Error("Mode "+e.name+" failed to advance stream.")}var zt=function(e,l,w){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=l||null,this.state=w};function ii(e,l,w,x){var D=e.doc,X=D.mode,Z;l=B(D,l);var ie=xt(D,l.line),ae=ft(e,l.line,w),he=new Pt(ie.text,e.options.tabSize,ae),De;for(x&&(De=[]);(x||he.pos<l.ch)&&!he.eol();)he.start=he.pos,Z=Rt(X,he,ae.state),x&&De.push(new zt(he,Z,Ot(D.mode,ae.state)));return x?De:new zt(he,Z,ae.state)}function Hi(e,l){if(e)for(;;){var w=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!w)break;e=e.slice(0,w.index)+e.slice(w.index+w[0].length);var x=w[1]?"bgClass":"textClass";l[x]==null?l[x]=w[2]:new RegExp("(?:^|\\s)"+w[2]+"(?:$|\\s)").test(l[x])||(l[x]+=" "+w[2])}return e}function Si(e,l,w,x,D,X,Z){var ie=w.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var ae=0,he=null,De=new Pt(l,e.options.tabSize,x),Ue,$e=e.options.addModeClass&&[null];for(l==""&&Hi(st(w,x.state),X);!De.eol();){if(De.pos>e.options.maxHighlightLength?(ie=!1,Z&&St(e,l,x,De.pos),De.pos=l.length,Ue=null):Ue=Hi(Rt(w,De,x.state,$e),X),$e){var Ye=$e[0].name;Ye&&(Ue="m-"+(Ue?Ye+" "+Ue:Ye))}if(!ie||he!=Ue){for(;ae<De.start;)ae=Math.min(De.start,ae+5e3),D(ae,he);he=Ue}De.start=De.pos}for(;ae<De.pos;){var rt=Math.min(De.pos,ae+5e3);D(rt,he),ae=rt}}function Ti(e,l,w){for(var x,D,X=e.doc,Z=w?-1:l-(e.doc.mode.innerMode?1e3:100),ie=l;ie>Z;--ie){if(ie<=X.first)return X.first;var ae=xt(X,ie-1),he=ae.stateAfter;if(he&&(!w||ie+(he instanceof le?he.lookAhead:0)<=X.modeFrontier))return ie;var De=z(ae.text,null,e.options.tabSize);(D==null||x>De)&&(D=ie-1,x=De)}return D}function qi(e,l){if(e.modeFrontier=Math.min(e.modeFrontier,l),e.highlightFrontier<l-10)return;for(var w=e.first,x=l-1;x>w;x--){var D=xt(e,x).stateAfter;if(D&&(!(D instanceof le)||x+D.lookAhead<l)){w=x+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,w)}var kr=!1,mi=!1;function zi(){kr=!0}function lr(){mi=!0}function ur(e,l,w){this.marker=e,this.from=l,this.to=w}function ji(e,l){if(e)for(var w=0;w<e.length;++w){var x=e[w];if(x.marker==l)return x}}function Ir(e,l){for(var w,x=0;x<e.length;++x)e[x]!=l&&(w||(w=[])).push(e[x]);return w}function _r(e,l){e.markedSpans=e.markedSpans?e.markedSpans.concat([l]):[l],l.marker.attachLine(e)}function Xr(e,l,w){var x;if(e)for(var D=0;D<e.length;++D){var X=e[D],Z=X.marker,ie=X.from==null||(Z.inclusiveLeft?X.from<=l:X.from<l);if(ie||X.from==l&&Z.type=="bookmark"&&(!w||!X.marker.insertLeft)){var ae=X.to==null||(Z.inclusiveRight?X.to>=l:X.to>l);(x||(x=[])).push(new ur(Z,X.from,ae?null:X.to))}}return x}function zr(e,l,w){var x;if(e)for(var D=0;D<e.length;++D){var X=e[D],Z=X.marker,ie=X.to==null||(Z.inclusiveRight?X.to>=l:X.to>l);if(ie||X.from==l&&Z.type=="bookmark"&&(!w||X.marker.insertLeft)){var ae=X.from==null||(Z.inclusiveLeft?X.from<=l:X.from<l);(x||(x=[])).push(new ur(Z,ae?null:X.from-l,X.to==null?null:X.to-l))}}return x}function $i(e,l){if(l.full)return null;var w=Ii(e,l.from.line)&&xt(e,l.from.line).markedSpans,x=Ii(e,l.to.line)&&xt(e,l.to.line).markedSpans;if(!w&&!x)return null;var D=l.from.ch,X=l.to.ch,Z=Dt(l.from,l.to)==0,ie=Xr(w,D,Z),ae=zr(x,X,Z),he=l.text.length==1,De=ue(l.text).length+(he?D:0);if(ie)for(var Ue=0;Ue<ie.length;++Ue){var $e=ie[Ue];if($e.to==null){var Ye=ji(ae,$e.marker);Ye?he&&($e.to=Ye.to==null?null:Ye.to+De):$e.to=D}}if(ae)for(var rt=0;rt<ae.length;++rt){var lt=ae[rt];if(lt.to!=null&&(lt.to+=De),lt.from==null){var ct=ji(ie,lt.marker);ct||(lt.from=De,he&&(ie||(ie=[])).push(lt))}else lt.from+=De,he&&(ie||(ie=[])).push(lt)}ie&&(ie=Qi(ie)),ae&&ae!=ie&&(ae=Qi(ae));var gt=[ie];if(!he){var yt=l.text.length-2,vt;if(yt>0&&ie)for(var Et=0;Et<ie.length;++Et)ie[Et].to==null&&(vt||(vt=[])).push(new ur(ie[Et].marker,null,null));for(var It=0;It<yt;++It)gt.push(vt);gt.push(ae)}return gt}function Qi(e){for(var l=0;l<e.length;++l){var w=e[l];w.from!=null&&w.from==w.to&&w.marker.clearWhenEmpty!==!1&&e.splice(l--,1)}return e.length?e:null}function yr(e,l,w){var x=null;if(e.iter(l.line,w.line+1,function(Ye){if(Ye.markedSpans)for(var rt=0;rt<Ye.markedSpans.length;++rt){var lt=Ye.markedSpans[rt].marker;lt.readOnly&&(!x||de(x,lt)==-1)&&(x||(x=[])).push(lt)}}),!x)return null;for(var D=[{from:l,to:w}],X=0;X<x.length;++X)for(var Z=x[X],ie=Z.find(0),ae=0;ae<D.length;++ae){var he=D[ae];if(Dt(he.to,ie.from)<0||Dt(he.from,ie.to)>0)continue;var De=[ae,1],Ue=Dt(he.from,ie.from),$e=Dt(he.to,ie.to);(Ue<0||!Z.inclusiveLeft&&!Ue)&&De.push({from:he.from,to:ie.from}),($e>0||!Z.inclusiveRight&&!$e)&&De.push({from:ie.to,to:he.to}),D.splice.apply(D,De),ae+=De.length-3}return D}function cn(e){var l=e.markedSpans;if(!l)return;for(var w=0;w<l.length;++w)l[w].marker.detachLine(e);e.markedSpans=null}function br(e,l){if(!l)return;for(var w=0;w<l.length;++w)l[w].marker.attachLine(e);e.markedSpans=l}function oi(e){return e.inclusiveLeft?-1:0}function Gt(e){return e.inclusiveRight?1:0}function xi(e,l){var w=e.lines.length-l.lines.length;if(w!=0)return w;var x=e.find(),D=l.find(),X=Dt(x.from,D.from)||oi(e)-oi(l);if(X)return-X;var Z=Dt(x.to,D.to)||Gt(e)-Gt(l);return Z||l.id-e.id}function Ht(e,l){var w=mi&&e.markedSpans,x;if(w)for(var D=void 0,X=0;X<w.length;++X)D=w[X],D.marker.collapsed&&(l?D.from:D.to)==null&&(!x||xi(x,D.marker)<0)&&(x=D.marker);return x}function ui(e){return Ht(e,!0)}function Qt(e){return Ht(e,!1)}function rr(e,l){var w=mi&&e.markedSpans,x;if(w)for(var D=0;D<w.length;++D){var X=w[D];X.marker.collapsed&&(X.from==null||X.from<l)&&(X.to==null||X.to>l)&&(!x||xi(x,X.marker)<0)&&(x=X.marker)}return x}function gi(e,l,w,x,D){var X=xt(e,l),Z=mi&&X.markedSpans;if(Z)for(var ie=0;ie<Z.length;++ie){var ae=Z[ie];if(!ae.marker.collapsed)continue;var he=ae.marker.find(0),De=Dt(he.from,w)||oi(ae.marker)-oi(D),Ue=Dt(he.to,x)||Gt(ae.marker)-Gt(D);if(De>=0&&Ue<=0||De<=0&&Ue>=0)continue;if(De<=0&&(ae.marker.inclusiveRight&&D.inclusiveLeft?Dt(he.to,w)>=0:Dt(he.to,w)>0)||De>=0&&(ae.marker.inclusiveRight&&D.inclusiveLeft?Dt(he.from,x)<=0:Dt(he.from,x)<0))return!0}}function Li(e){for(var l;l=ui(e);)e=l.find(-1,!0).line;return e}function Gr(e){for(var l;l=Qt(e);)e=l.find(1,!0).line;return e}function xr(e){for(var l,w;l=Qt(e);)e=l.find(1,!0).line,(w||(w=[])).push(e);return w}function dn(e,l){var w=xt(e,l),x=Li(w);return w==x?l:Ut(x)}function Er(e,l){if(l>e.lastLine())return l;var w=xt(e,l),x;if(!nr(e,w))return l;for(;x=Qt(w);)w=x.find(1,!0).line;return Ut(w)+1}function nr(e,l){var w=mi&&l.markedSpans;if(w)for(var x=void 0,D=0;D<w.length;++D){if(x=w[D],!x.marker.collapsed)continue;if(x.from==null)return!0;if(x.marker.widgetNode)continue;if(x.from==0&&x.marker.inclusiveLeft&&fn(e,l,x))return!0}}function fn(e,l,w){if(w.to==null){var x=w.marker.find(1,!0);return fn(e,x.line,ji(x.line.markedSpans,w.marker))}if(w.marker.inclusiveRight&&w.to==l.text.length)return!0;for(var D=void 0,X=0;X<l.markedSpans.length;++X)if(D=l.markedSpans[X],D.marker.collapsed&&!D.marker.widgetNode&&D.from==w.to&&(D.to==null||D.to!=w.from)&&(D.marker.inclusiveLeft||w.marker.inclusiveRight)&&fn(e,l,D))return!0}function Ji(e){e=Li(e);for(var l=0,w=e.parent,x=0;x<w.lines.length;++x){var D=w.lines[x];if(D==e)break;l+=D.height}for(var X=w.parent;X;w=X,X=w.parent)for(var Z=0;Z<X.children.length;++Z){var ie=X.children[Z];if(ie==w)break;l+=ie.height}return l}function pn(e){if(e.height==0)return 0;for(var l=e.text.length,w,x=e;w=ui(x);){var D=w.find(0,!0);x=D.from.line,l+=D.from.ch-D.to.ch}for(x=e;w=Qt(x);){var X=w.find(0,!0);l-=x.text.length-X.from.ch,x=X.to.line,l+=x.text.length-X.to.ch}return l}function Kn(e){var l=e.display,w=e.doc;l.maxLine=xt(w,w.first),l.maxLineLength=pn(l.maxLine),l.maxLineChanged=!0,w.iter(function(x){var D=pn(x);D>l.maxLineLength&&(l.maxLineLength=D,l.maxLine=x)})}var Dr=function(e,l,w){this.text=e,br(this,l),this.height=w?w(this):1};Dr.prototype.lineNo=function(){return Ut(this)},Ee(Dr);function ua(e,l,w,x){e.text=l,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),cn(e),br(e,w);var D=x?x(e):1;D!=e.height&&ri(e,D)}function Tt(e){e.parent=null,cn(e)}var Mt={},Lt={};function Kt(e,l){if(!e||/^\s*$/.test(e))return null;var w=l.addModeClass?Lt:Mt;return w[e]||(w[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,l){var w=F("span",null,null,i?"padding-right: .1px":null),x={pre:F("pre",[w],"CodeMirror-line"),content:w,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};l.measure={};for(var D=0;D<=(l.rest?l.rest.length:0);D++){var X=D?l.rest[D-1]:l.line,Z=void 0;x.pos=0,x.addToken=Wt,Xe(e.display.measure)&&(Z=Ze(X,e.doc.direction))&&(x.addToken=Di(x.addToken,Z)),x.map=[];var ie=l!=e.display.externalMeasured&&Ut(X);hr(X,x,nt(e,X,ie)),X.styleClasses&&(X.styleClasses.bgClass&&(x.bgClass=A(X.styleClasses.bgClass,x.bgClass||"")),X.styleClasses.textClass&&(x.textClass=A(X.styleClasses.textClass,x.textClass||""))),x.map.length==0&&x.map.push(0,0,x.content.appendChild(fe(e.display.measure))),D==0?(l.measure.map=x.map,l.measure.cache={}):((l.measure.maps||(l.measure.maps=[])).push(x.map),(l.measure.caches||(l.measure.caches=[])).push({}))}if(i){var ae=x.content.lastChild;(/\bcm-tab\b/.test(ae.className)||ae.querySelector&&ae.querySelector(".cm-tab"))&&(x.content.className="cm-tab-wrap-hack")}return Me(e,"renderLine",e,l.line,x.pre),x.pre.className&&(x.textClass=A(x.pre.className,x.textClass||"")),x}function ei(e){var l=g("span","\u2022","cm-invalidchar");return l.title="\\u"+e.charCodeAt(0).toString(16),l.setAttribute("aria-label",l.title),l}function Wt(e,l,w,x,D,X,Z){if(!l)return;var ie=e.splitSpaces?fi(l,e.trailingSpace):l,ae=e.cm.state.specialChars,he=!1,De;if(!ae.test(l))e.col+=l.length,De=document.createTextNode(ie),e.map.push(e.pos,e.pos+l.length,De),E&&b<9&&(he=!0),e.pos+=l.length;else{De=document.createDocumentFragment();for(var Ue=0;;){ae.lastIndex=Ue;var $e=ae.exec(l),Ye=$e?$e.index-Ue:l.length-Ue;if(Ye){var rt=document.createTextNode(ie.slice(Ue,Ue+Ye));E&&b<9?De.appendChild(g("span",[rt])):De.appendChild(rt),e.map.push(e.pos,e.pos+Ye,rt),e.col+=Ye,e.pos+=Ye}if(!$e)break;Ue+=Ye+1;var lt=void 0;if($e[0]==" "){var ct=e.cm.options.tabSize,gt=ct-e.col%ct;lt=De.appendChild(g("span",we(gt),"cm-tab")),lt.setAttribute("role","presentation"),lt.setAttribute("cm-text"," "),e.col+=gt}else $e[0]=="\r"||$e[0]==`
`?(lt=De.appendChild(g("span",$e[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),lt.setAttribute("cm-text",$e[0]),e.col+=1):(lt=e.cm.options.specialCharPlaceholder($e[0]),lt.setAttribute("cm-text",$e[0]),E&&b<9?De.appendChild(g("span",[lt])):De.appendChild(lt),e.col+=1);e.map.push(e.pos,e.pos+1,lt),e.pos++}}if(e.trailingSpace=ie.charCodeAt(l.length-1)==32,w||x||D||he||X||Z){var yt=w||"";x&&(yt+=x),D&&(yt+=D);var vt=g("span",[De],yt,X);if(Z)for(var Et in Z)Z.hasOwnProperty(Et)&&Et!="style"&&Et!="class"&&vt.setAttribute(Et,Z[Et]);return e.content.appendChild(vt)}e.content.appendChild(De)}function fi(e,l){if(e.length>1&&!/ /.test(e))return e;for(var w=l,x="",D=0;D<e.length;D++){var X=e.charAt(D);X==" "&&w&&(D==e.length-1||e.charCodeAt(D+1)==32)&&(X="\xA0"),x+=X,w=X==" "}return x}function Di(e,l){return function(w,x,D,X,Z,ie,ae){D=D?D+" cm-force-border":"cm-force-border";for(var he=w.pos,De=he+x.length;;){for(var Ue=void 0,$e=0;$e<l.length&&!(Ue=l[$e],Ue.to>he&&Ue.from<=he);$e++);if(Ue.to>=De)return e(w,x,D,X,Z,ie,ae);e(w,x.slice(0,Ue.to-he),D,X,null,ie,ae),X=null,x=x.slice(Ue.to-he),he=Ue.to}}}function jt(e,l,w,x){var D=!x&&w.widgetNode;D&&e.map.push(e.pos,e.pos+l,D),!x&&e.cm.display.input.needsContentAttribute&&(D||(D=e.content.appendChild(document.createElement("span"))),D.setAttribute("cm-marker",w.id)),D&&(e.cm.display.input.setUneditable(D),e.content.appendChild(D)),e.pos+=l,e.trailingSpace=!1}function hr(e,l,w){var x=e.markedSpans,D=e.text,X=0;if(!x){for(var Z=1;Z<w.length;Z+=2)l.addToken(l,D.slice(X,X=w[Z]),Kt(w[Z+1],l.cm.options));return}for(var ie=D.length,ae=0,he=1,De="",Ue,$e,Ye=0,rt,lt,ct,gt,yt;;){if(Ye==ae){rt=lt=ct=$e="",yt=null,gt=null,Ye=Infinity;for(var vt=[],Et=void 0,It=0;It<x.length;++It){var At=x[It],Bt=At.marker;if(Bt.type=="bookmark"&&At.from==ae&&Bt.widgetNode)vt.push(Bt);else if(At.from<=ae&&(At.to==null||At.to>ae||Bt.collapsed&&At.to==ae&&At.from==ae)){if(At.to!=null&&At.to!=ae&&Ye>At.to&&(Ye=At.to,lt=""),Bt.className&&(rt+=" "+Bt.className),Bt.css&&($e=($e?$e+";":"")+Bt.css),Bt.startStyle&&At.from==ae&&(ct+=" "+Bt.startStyle),Bt.endStyle&&At.to==Ye&&(Et||(Et=[])).push(Bt.endStyle,At.to),Bt.title&&((yt||(yt={})).title=Bt.title),Bt.attributes)for(var ti in Bt.attributes)(yt||(yt={}))[ti]=Bt.attributes[ti];Bt.collapsed&&(!gt||xi(gt.marker,Bt)<0)&&(gt=At)}else At.from>ae&&Ye>At.from&&(Ye=At.from)}if(Et)for(var yi=0;yi<Et.length;yi+=2)Et[yi+1]==Ye&&(lt+=" "+Et[yi]);if(!gt||gt.from==ae)for(var ai=0;ai<vt.length;++ai)jt(l,0,vt[ai]);if(gt&&(gt.from||0)==ae){if(jt(l,(gt.to==null?ie+1:gt.to)-ae,gt.marker,gt.from==null),gt.to==null)return;gt.to==ae&&(gt=!1)}}if(ae>=ie)break;for(var Xi=Math.min(ie,Ye);;){if(De){var Fi=ae+De.length;if(!gt){var hi=Fi>Xi?De.slice(0,Xi-ae):De;l.addToken(l,hi,Ue?Ue+rt:rt,ct,ae+hi.length==Ye?lt:"",$e,yt)}if(Fi>=Xi){De=De.slice(Xi-ae),ae=Xi;break}ae=Fi,ct=""}De=D.slice(X,X=w[he++]),Ue=Kt(w[he++],l.cm.options)}}}function Vt(e,l,w){this.line=l,this.rest=xr(l),this.size=this.rest?Ut(ue(this.rest))-w+1:1,this.node=this.text=null,this.hidden=nr(e,l)}function Mi(e,l,w){for(var x=[],D,X=l;X<w;X=D){var Z=new Vt(e.doc,xt(e.doc,X),X);D=X+Z.size,x.push(Z)}return x}var Ci=null;function Zi(e){Ci?Ci.ops.push(e):e.ownsGroup=Ci={ops:[e],delayedCallbacks:[]}}function Oo(e){var l=e.delayedCallbacks,w=0;do{for(;w<l.length;w++)l[w].call(null);for(var x=0;x<e.ops.length;x++){var D=e.ops[x];if(D.cursorActivityHandlers)for(;D.cursorActivityCalled<D.cursorActivityHandlers.length;)D.cursorActivityHandlers[D.cursorActivityCalled++].call(null,D.cm)}}while(w<l.length)}function ko(e,l){var w=e.ownsGroup;if(!w)return;try{Oo(w)}finally{Ci=null,l(w)}}var mn=null;function Ei(e,l){var w=ht(e,l);if(!w.length)return;var x=Array.prototype.slice.call(arguments,2),D;Ci?D=Ci.delayedCallbacks:mn?D=mn:(D=mn=[],setTimeout(Io,0));for(var X=function(ie){D.push(function(){return w[ie].apply(null,x)})},Z=0;Z<w.length;++Z)X(Z)}function Io(){var e=mn;mn=null;for(var l=0;l<e.length;++l)e[l]()}function Ya(e,l,w,x){for(var D=0;D<l.changes.length;D++){var X=l.changes[D];X=="text"?Mo(e,l):X=="gutter"?Za(e,l,w,x):X=="class"?ha(e,l):X=="widget"&&Po(e,l,x)}l.changes=null}function gn(e){return e.node==e.text&&(e.node=g("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),E&&b<8&&(e.node.style.zIndex=2)),e.node}function Do(e,l){var w=l.bgClass?l.bgClass+" "+(l.line.bgClass||""):l.line.bgClass;if(w&&(w+=" CodeMirror-linebackground"),l.background)w?l.background.className=w:(l.background.parentNode.removeChild(l.background),l.background=null);else if(w){var x=gn(l);l.background=x.insertBefore(g("div",null,w),x.firstChild),e.display.input.setUneditable(l.background)}}function Qa(e,l){var w=e.display.externalMeasured;return w&&w.line==l.line?(e.display.externalMeasured=null,l.measure=w.measure,w.built):Xt(e,l)}function Mo(e,l){var w=l.text.className,x=Qa(e,l);l.text==l.node&&(l.node=x.pre),l.text.parentNode.replaceChild(x.pre,l.text),l.text=x.pre,x.bgClass!=l.bgClass||x.textClass!=l.textClass?(l.bgClass=x.bgClass,l.textClass=x.textClass,ha(e,l)):w&&(l.text.className=w)}function ha(e,l){Do(e,l),l.line.wrapClass?gn(l).className=l.line.wrapClass:l.node!=l.text&&(l.node.className="");var w=l.textClass?l.textClass+" "+(l.line.textClass||""):l.line.textClass;l.text.className=w||""}function Za(e,l,w,x){if(l.gutter&&(l.node.removeChild(l.gutter),l.gutter=null),l.gutterBackground&&(l.node.removeChild(l.gutterBackground),l.gutterBackground=null),l.line.gutterClass){var D=gn(l);l.gutterBackground=g("div",null,"CodeMirror-gutter-background "+l.line.gutterClass,"left: "+(e.options.fixedGutter?x.fixedPos:-x.gutterTotalWidth)+"px; width: "+x.gutterTotalWidth+"px"),e.display.input.setUneditable(l.gutterBackground),D.insertBefore(l.gutterBackground,l.text)}var X=l.line.gutterMarkers;if(e.options.lineNumbers||X){var Z=gn(l),ie=l.gutter=g("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?x.fixedPos:-x.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),Z.insertBefore(ie,l.text),l.line.gutterClass&&(ie.className+=" "+l.line.gutterClass),e.options.lineNumbers&&(!X||!X["CodeMirror-linenumbers"])&&(l.lineNumber=ie.appendChild(g("div",Yi(e.options,w),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+x.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),X)for(var ae=0;ae<e.display.gutterSpecs.length;++ae){var he=e.display.gutterSpecs[ae].className,De=X.hasOwnProperty(he)&&X[he];De&&ie.appendChild(g("div",[De],"CodeMirror-gutter-elt","left: "+x.gutterLeft[he]+"px; width: "+x.gutterWidth[he]+"px"))}}}function Po(e,l,w){l.alignable&&(l.alignable=null);for(var x=_("CodeMirror-linewidget"),D=l.node.firstChild,X=void 0;D;D=X)X=D.nextSibling,x.test(D.className)&&l.node.removeChild(D);qa(e,l,w)}function No(e,l,w,x){var D=Qa(e,l);return l.text=l.node=D.pre,D.bgClass&&(l.bgClass=D.bgClass),D.textClass&&(l.textClass=D.textClass),ha(e,l),Za(e,l,w,x),qa(e,l,x),l.node}function qa(e,l,w){if($a(e,l.line,l,w,!0),l.rest)for(var x=0;x<l.rest.length;x++)$a(e,l.rest[x],l,w,!1)}function $a(e,l,w,x,D){if(!l.widgets)return;for(var X=gn(w),Z=0,ie=l.widgets;Z<ie.length;++Z){var ae=ie[Z],he=g("div",[ae.node],"CodeMirror-linewidget"+(ae.className?" "+ae.className:""));ae.handleMouseEvents||he.setAttribute("cm-ignore-events","true"),Fo(ae,he,w,x),e.display.input.setUneditable(he),D&&ae.above?X.insertBefore(he,w.gutter||w.text):X.appendChild(he),Ei(ae,"redraw")}}function Fo(e,l,w,x){if(e.noHScroll){(w.alignable||(w.alignable=[])).push(l);var D=x.wrapperWidth;l.style.left=x.fixedPos+"px",e.coverGutter||(D-=x.gutterTotalWidth,l.style.paddingLeft=x.gutterTotalWidth+"px"),l.style.width=D+"px"}e.coverGutter&&(l.style.zIndex=5,l.style.position="relative",e.noHScroll||(l.style.marginLeft=-x.gutterTotalWidth+"px"))}function vn(e){if(e.height!=null)return e.height;var l=e.doc.cm;if(!l)return 0;if(!N(document.body,e.node)){var w="position: relative;";e.coverGutter&&(w+="margin-left: -"+l.display.gutters.offsetWidth+"px;"),e.noHScroll&&(w+="width: "+l.display.wrapper.clientWidth+"px;"),k(l.display.measure,g("div",[e.node],null,w))}return e.height=e.node.parentNode.offsetHeight}function cr(e,l){for(var w=Ie(l);w!=e.wrapper;w=w.parentNode)if(!w||w.nodeType==1&&w.getAttribute("cm-ignore-events")=="true"||w.parentNode==e.sizer&&w!=e.mover)return!0}function Hn(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ja(e){if(e.cachedPaddingH)return e.cachedPaddingH;var l=k(e.measure,g("pre","x","CodeMirror-line-like")),w=window.getComputedStyle?window.getComputedStyle(l):l.currentStyle,x={left:parseInt(w.paddingLeft),right:parseInt(w.paddingRight)};return!isNaN(x.left)&&!isNaN(x.right)&&(e.cachedPaddingH=x),x}function ar(e){return be-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-ar(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-ar(e)-e.display.barHeight}function Uo(e,l,w){var x=e.options.lineWrapping,D=x&&Mr(e);if(!l.measure.heights||x&&l.measure.width!=D){var X=l.measure.heights=[];if(x){l.measure.width=D;for(var Z=l.text.firstChild.getClientRects(),ie=0;ie<Z.length-1;ie++){var ae=Z[ie],he=Z[ie+1];Math.abs(ae.bottom-he.bottom)>2&&X.push((ae.bottom+he.top)/2-w.top)}}X.push(w.bottom-w.top)}}function es(e,l,w){if(e.line==l)return{map:e.measure.map,cache:e.measure.cache};for(var x=0;x<e.rest.length;x++)if(e.rest[x]==l)return{map:e.measure.maps[x],cache:e.measure.caches[x]};for(var D=0;D<e.rest.length;D++)if(Ut(e.rest[D])>w)return{map:e.measure.maps[D],cache:e.measure.caches[D],before:!0}}function Bo(e,l){l=Li(l);var w=Ut(l),x=e.display.externalMeasured=new Vt(e.doc,l,w);x.lineN=w;var D=x.built=Xt(e,x);return x.text=D.pre,k(e.display.lineMeasure,D.pre),x}function ts(e,l,w,x){return sr(e,Vr(e,l),w,x)}function fa(e,l){if(l>=e.display.viewFrom&&l<e.display.viewTo)return e.display.view[Fr(e,l)];var w=e.display.externalMeasured;if(w&&l>=w.lineN&&l<w.lineN+w.size)return w}function Vr(e,l){var w=Ut(l),x=fa(e,w);x&&!x.text?x=null:x&&x.changes&&(Ya(e,x,w,ya(e)),e.curOp.forceUpdate=!0),x||(x=Bo(e,l));var D=es(x,l,w);return{line:l,view:x,rect:null,map:D.map,cache:D.cache,before:D.before,hasHeights:!1}}function sr(e,l,w,x,D){l.before&&(w=-1);var X=w+(x||""),Z;return l.cache.hasOwnProperty(X)?Z=l.cache[X]:(l.rect||(l.rect=l.view.text.getBoundingClientRect()),l.hasHeights||(Uo(e,l.view,l.rect),l.hasHeights=!0),Z=Ho(e,l,w,x),Z.bogus||(l.cache[X]=Z)),{left:Z.left,right:Z.right,top:D?Z.rtop:Z.top,bottom:D?Z.rbottom:Z.bottom}}var is={left:0,right:0,top:0,bottom:0};function rs(e,l,w){for(var x,D,X,Z,ie,ae,he=0;he<e.length;he+=3)if(ie=e[he],ae=e[he+1],l<ie?(D=0,X=1,Z="left"):l<ae?(D=l-ie,X=D+1):(he==e.length-3||l==ae&&e[he+3]>l)&&(X=ae-ie,D=X-1,l>=ae&&(Z="right")),D!=null){if(x=e[he+2],ie==ae&&w==(x.insertLeft?"left":"right")&&(Z=w),w=="left"&&D==0)for(;he&&e[he-2]==e[he-3]&&e[he-1].insertLeft;)x=e[(he-=3)+2],Z="left";if(w=="right"&&D==ae-ie)for(;he<e.length-3&&e[he+3]==e[he+4]&&!e[he+5].insertLeft;)x=e[(he+=3)+2],Z="right";break}return{node:x,start:D,end:X,collapse:Z,coverStart:ie,coverEnd:ae}}function Ko(e,l){var w=is;if(l=="left")for(var x=0;x<e.length&&!((w=e[x]).left!=w.right);x++);else for(var D=e.length-1;D>=0&&!((w=e[D]).left!=w.right);D--);return w}function Ho(e,l,w,x){var D=rs(l.map,w,x),X=D.node,Z=D.start,ie=D.end,ae=D.collapse,he;if(X.nodeType==3){for(var De=0;De<4;De++){for(;Z&&xe(l.line.text.charAt(D.coverStart+Z));)--Z;for(;D.coverStart+ie<D.coverEnd&&xe(l.line.text.charAt(D.coverStart+ie));)++ie;if(E&&b<9&&Z==0&&ie==D.coverEnd-D.coverStart?he=X.parentNode.getBoundingClientRect():he=Ko(P(X,Z,ie).getClientRects(),x),he.left||he.right||Z==0)break;ie=Z,Z=Z-1,ae="right"}E&&b<11&&(he=jo(e.display.measure,he))}else{Z>0&&(ae=x="right");var Ue;e.options.lineWrapping&&(Ue=X.getClientRects()).length>1?he=Ue[x=="right"?Ue.length-1:0]:he=X.getBoundingClientRect()}if(E&&b<9&&!Z&&(!he||!he.left&&!he.right)){var $e=X.parentNode.getClientRects()[0];$e?he={left:$e.left,right:$e.left+Qr(e.display),top:$e.top,bottom:$e.bottom}:he=is}for(var Ye=he.top-l.rect.top,rt=he.bottom-l.rect.top,lt=(Ye+rt)/2,ct=l.view.measure.heights,gt=0;gt<ct.length-1&&!(lt<ct[gt]);gt++);var yt=gt?ct[gt-1]:0,vt=ct[gt],Et={left:(ae=="right"?he.right:he.left)-l.rect.left,right:(ae=="left"?he.left:he.right)-l.rect.left,top:yt,bottom:vt};return!he.left&&!he.right&&(Et.bogus=!0),e.options.singleCursorHeightPerLine||(Et.rtop=Ye,Et.rbottom=rt),Et}function jo(e,l){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ct(e))return l;var w=screen.logicalXDPI/screen.deviceXDPI,x=screen.logicalYDPI/screen.deviceYDPI;return{left:l.left*w,right:l.right*w,top:l.top*x,bottom:l.bottom*x}}function ns(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var l=0;l<e.rest.length;l++)e.measure.caches[l]={}}function as(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var l=0;l<e.display.view.length;l++)ns(e.display.view[l])}function _n(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return o&&s?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return o&&s?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var l=0;if(e.widgets)for(var w=0;w<e.widgets.length;++w)e.widgets[w].above&&(l+=vn(e.widgets[w]));return l}function jn(e,l,w,x,D){if(!D){var X=pa(l);w.top+=X,w.bottom+=X}if(x=="line")return w;x||(x="local");var Z=Ji(l);if(x=="local"?Z+=Hn(e.display):Z-=e.display.viewOffset,x=="page"||x=="window"){var ie=e.display.lineSpace.getBoundingClientRect();Z+=ie.top+(x=="window"?0:os());var ae=ie.left+(x=="window"?0:ss());w.left+=ae,w.right+=ae}return w.top+=Z,w.bottom+=Z,w}function ls(e,l,w){if(w=="div")return l;var x=l.left,D=l.top;if(w=="page")x-=ss(),D-=os();else if(w=="local"||!w){var X=e.display.sizer.getBoundingClientRect();x+=X.left,D+=X.top}var Z=e.display.lineSpace.getBoundingClientRect();return{left:x-Z.left,top:D-Z.top}}function ma(e,l,w,x,D){return x||(x=xt(e.doc,l.line)),jn(e,x,ts(e,x,l.ch,D),w)}function er(e,l,w,x,D,X){x=x||xt(e.doc,l.line),D||(D=Vr(e,x));function Z(rt,lt){var ct=sr(e,D,rt,lt?"right":"left",X);return lt?ct.left=ct.right:ct.right=ct.left,jn(e,x,ct,w)}var ie=Ze(x,e.doc.direction),ae=l.ch,he=l.sticky;if(ae>=x.text.length?(ae=x.text.length,he="before"):ae<=0&&(ae=0,he="after"),!ie)return Z(he=="before"?ae-1:ae,he=="before");function De(rt,lt,ct){var gt=ie[lt],yt=gt.level==1;return Z(ct?rt-1:rt,yt!=ct)}var Ue=se(ie,ae,he),$e=ye,Ye=De(ae,Ue,he=="before");return $e!=null&&(Ye.other=De(ae,$e,he!="before")),Ye}function us(e,l){var w=0;l=B(e.doc,l),e.options.lineWrapping||(w=Qr(e.display)*l.ch);var x=xt(e.doc,l.line),D=Ji(x)+Hn(e.display);return{left:w,right:w,top:D,bottom:D+x.height}}function ga(e,l,w,x,D){var X=ut(e,l,w);return X.xRel=D,x&&(X.outside=x),X}function va(e,l,w){var x=e.doc;if(w+=e.display.viewOffset,w<0)return ga(x.first,0,null,-1,-1);var D=di(x,w),X=x.first+x.size-1;if(D>X)return ga(x.first+x.size-1,xt(x,X).text.length,null,1,1);l<0&&(l=0);for(var Z=xt(x,D);;){var ie=Wo(e,Z,D,l,w),ae=rr(Z,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!ae)return ie;var he=ae.find(1);if(he.line==D)return he;Z=xt(x,D=he.line)}}function hs(e,l,w,x){x-=pa(l);var D=l.text.length,X=Le(function(Z){return sr(e,w,Z-1).bottom<=x},D,0);return D=Le(function(Z){return sr(e,w,Z).top>x},X,D),{begin:X,end:D}}function cs(e,l,w,x){w||(w=Vr(e,l));var D=jn(e,l,sr(e,w,x),"line").top;return hs(e,l,w,D)}function _a(e,l,w,x){return e.bottom<=w?!1:e.top>w?!0:(x?e.left:e.right)>l}function Wo(e,l,w,x,D){D-=Ji(l);var X=Vr(e,l),Z=pa(l),ie=0,ae=l.text.length,he=!0,De=Ze(l,e.doc.direction);if(De){var Ue=(e.options.lineWrapping?zo:Xo)(e,l,w,X,De,x,D);he=Ue.level!=1,ie=he?Ue.from:Ue.to-1,ae=he?Ue.to:Ue.from-1}var $e=null,Ye=null,rt=Le(function(It){var At=sr(e,X,It);return At.top+=Z,At.bottom+=Z,_a(At,x,D,!1)?(At.top<=D&&At.left<=x&&($e=It,Ye=At),!0):!1},ie,ae),lt,ct,gt=!1;if(Ye){var yt=x-Ye.left<Ye.right-x,vt=yt==he;rt=$e+(vt?0:1),ct=vt?"after":"before",lt=yt?Ye.left:Ye.right}else{!he&&(rt==ae||rt==ie)&&rt++,ct=rt==0?"after":rt==l.text.length?"before":sr(e,X,rt-(he?1:0)).bottom+Z<=D==he?"after":"before";var Et=er(e,ut(w,rt,ct),"line",l,X);lt=Et.left,gt=D<Et.top?-1:D>=Et.bottom?1:0}return rt=Se(l.text,rt,1),ga(w,rt,ct,gt,x-lt)}function Xo(e,l,w,x,D,X,Z){var ie=Le(function(Ue){var $e=D[Ue],Ye=$e.level!=1;return _a(er(e,ut(w,Ye?$e.to:$e.from,Ye?"before":"after"),"line",l,x),X,Z,!0)},0,D.length-1),ae=D[ie];if(ie>0){var he=ae.level!=1,De=er(e,ut(w,he?ae.from:ae.to,he?"after":"before"),"line",l,x);_a(De,X,Z,!0)&&De.top>Z&&(ae=D[ie-1])}return ae}function zo(e,l,w,x,D,X,Z){var ie=hs(e,l,x,Z),ae=ie.begin,he=ie.end;/\s/.test(l.text.charAt(he-1))&&he--;for(var De=null,Ue=null,$e=0;$e<D.length;$e++){var Ye=D[$e];if(Ye.from>=he||Ye.to<=ae)continue;var rt=Ye.level!=1,lt=sr(e,x,rt?Math.min(he,Ye.to)-1:Math.max(ae,Ye.from)).right,ct=lt<X?X-lt+1e9:lt-X;(!De||Ue>ct)&&(De=Ye,Ue=ct)}return De||(De=D[D.length-1]),De.from<ae&&(De={from:ae,to:De.to,level:De.level}),De.to>he&&(De={from:De.from,to:he,level:De.level}),De}var Pr;function Yr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pr==null){Pr=g("pre",null,"CodeMirror-line-like");for(var l=0;l<49;++l)Pr.appendChild(document.createTextNode("x")),Pr.appendChild(g("br"));Pr.appendChild(document.createTextNode("x"))}k(e.measure,Pr);var w=Pr.offsetHeight/50;return w>3&&(e.cachedTextHeight=w),T(e.measure),w||1}function Qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var l=g("span","xxxxxxxxxx"),w=g("pre",[l],"CodeMirror-line-like");k(e.measure,w);var x=l.getBoundingClientRect(),D=(x.right-x.left)/10;return D>2&&(e.cachedCharWidth=D),D||10}function ya(e){for(var l=e.display,w={},x={},D=l.gutters.clientLeft,X=l.gutters.firstChild,Z=0;X;X=X.nextSibling,++Z){var ie=e.display.gutterSpecs[Z].className;w[ie]=X.offsetLeft+X.clientLeft+D,x[ie]=X.clientWidth}return{fixedPos:ba(l),gutterTotalWidth:l.gutters.offsetWidth,gutterLeft:w,gutterWidth:x,wrapperWidth:l.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var l=Yr(e.display),w=e.options.lineWrapping,x=w&&Math.max(5,e.display.scroller.clientWidth/Qr(e.display)-3);return function(D){if(nr(e.doc,D))return 0;var X=0;if(D.widgets)for(var Z=0;Z<D.widgets.length;Z++)D.widgets[Z].height&&(X+=D.widgets[Z].height);return w?X+(Math.ceil(D.text.length/x)||1)*l:X+l}}function xa(e){var l=e.doc,w=ds(e);l.iter(function(x){var D=w(x);D!=x.height&&ri(x,D)})}function Nr(e,l,w,x){var D=e.display;if(!w&&Ie(l).getAttribute("cm-not-content")=="true")return null;var X,Z,ie=D.lineSpace.getBoundingClientRect();try{X=l.clientX-ie.left,Z=l.clientY-ie.top}catch(Ue){return null}var ae=va(e,X,Z),he;if(x&&ae.xRel>0&&(he=xt(e.doc,ae.line).text).length==ae.ch){var De=z(he,he.length,e.options.tabSize)-he.length;ae=ut(ae.line,Math.max(0,Math.round((X-Ja(e.display).left)/Qr(e.display))-De))}return ae}function Fr(e,l){if(l>=e.display.viewTo)return null;if(l-=e.display.viewFrom,l<0)return null;for(var w=e.display.view,x=0;x<w.length;x++)if(l-=w[x].size,l<0)return x}function Pi(e,l,w,x){l==null&&(l=e.doc.first),w==null&&(w=e.doc.first+e.doc.size),x||(x=0);var D=e.display;if(x&&w<D.viewTo&&(D.updateLineNumbers==null||D.updateLineNumbers>l)&&(D.updateLineNumbers=l),e.curOp.viewChanged=!0,l>=D.viewTo)mi&&dn(e.doc,l)<D.viewTo&&Sr(e);else if(w<=D.viewFrom)mi&&Er(e.doc,w+x)>D.viewFrom?Sr(e):(D.viewFrom+=x,D.viewTo+=x);else if(l<=D.viewFrom&&w>=D.viewTo)Sr(e);else if(l<=D.viewFrom){var X=Wn(e,w,w+x,1);X?(D.view=D.view.slice(X.index),D.viewFrom=X.lineN,D.viewTo+=x):Sr(e)}else if(w>=D.viewTo){var Z=Wn(e,l,l,-1);Z?(D.view=D.view.slice(0,Z.index),D.viewTo=Z.lineN):Sr(e)}else{var ie=Wn(e,l,l,-1),ae=Wn(e,w,w+x,1);ie&&ae?(D.view=D.view.slice(0,ie.index).concat(Mi(e,ie.lineN,ae.lineN)).concat(D.view.slice(ae.index)),D.viewTo+=x):Sr(e)}var he=D.externalMeasured;he&&(w<he.lineN?he.lineN+=x:l<he.lineN+he.size&&(D.externalMeasured=null))}function wr(e,l,w){e.curOp.viewChanged=!0;var x=e.display,D=e.display.externalMeasured;if(D&&l>=D.lineN&&l<D.lineN+D.size&&(x.externalMeasured=null),l<x.viewFrom||l>=x.viewTo)return;var X=x.view[Fr(e,l)];if(X.node==null)return;var Z=X.changes||(X.changes=[]);de(Z,w)==-1&&Z.push(w)}function Sr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wn(e,l,w,x){var D=Fr(e,l),X,Z=e.display.view;if(!mi||w==e.doc.first+e.doc.size)return{index:D,lineN:w};for(var ie=e.display.viewFrom,ae=0;ae<D;ae++)ie+=Z[ae].size;if(ie!=l){if(x>0){if(D==Z.length-1)return null;X=ie+Z[D].size-l,D++}else X=ie-l;l+=X,w+=X}for(;dn(e.doc,w)!=w;){if(D==(x<0?0:Z.length-1))return null;w+=x*Z[D-(x<0?1:0)].size,D+=x}return{index:D,lineN:w}}function Go(e,l,w){var x=e.display,D=x.view;D.length==0||l>=x.viewTo||w<=x.viewFrom?(x.view=Mi(e,l,w),x.viewFrom=l):(x.viewFrom>l?x.view=Mi(e,l,x.viewFrom).concat(x.view):x.viewFrom<l&&(x.view=x.view.slice(Fr(e,l))),x.viewFrom=l,x.viewTo<w?x.view=x.view.concat(Mi(e,x.viewTo,w)):x.viewTo>w&&(x.view=x.view.slice(0,Fr(e,w)))),x.viewTo=w}function fs(e){for(var l=e.display.view,w=0,x=0;x<l.length;x++){var D=l[x];!D.hidden&&(!D.node||D.changes)&&++w}return w}function yn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,l){l===void 0&&(l=!0);for(var w=e.doc,x={},D=x.cursors=document.createDocumentFragment(),X=x.selection=document.createDocumentFragment(),Z=0;Z<w.sel.ranges.length;Z++){if(!l&&Z==w.sel.primIndex)continue;var ie=w.sel.ranges[Z];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var ae=ie.empty();(ae||e.options.showCursorWhenSelecting)&&ms(e,ie.head,D),ae||Vo(e,ie,X)}return x}function ms(e,l,w){var x=er(e,l,"div",null,null,!e.options.singleCursorHeightPerLine),D=w.appendChild(g("div","\xA0","CodeMirror-cursor"));if(D.style.left=x.left+"px",D.style.top=x.top+"px",D.style.height=Math.max(0,x.bottom-x.top)*e.options.cursorHeight+"px",x.other){var X=w.appendChild(g("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));X.style.display="",X.style.left=x.other.left+"px",X.style.top=x.other.top+"px",X.style.height=(x.other.bottom-x.other.top)*.85+"px"}}function Xn(e,l){return e.top-l.top||e.left-l.left}function Vo(e,l,w){var x=e.display,D=e.doc,X=document.createDocumentFragment(),Z=Ja(e.display),ie=Z.left,ae=Math.max(x.sizerWidth,Mr(e)-x.sizer.offsetLeft)-Z.right,he=D.direction=="ltr";function De(vt,Et,It,At){Et<0&&(Et=0),Et=Math.round(Et),At=Math.round(At),X.appendChild(g("div",null,"CodeMirror-selected","position: absolute; left: "+vt+`px;
top: `+Et+"px; width: "+(It==null?ae-vt:It)+`px;
height: `+(At-Et)+"px"))}function Ue(vt,Et,It){var At=xt(D,vt),Bt=At.text.length,ti,yi;function ai(hi,Ui){return ma(e,ut(vt,hi),"div",At,Ui)}function Xi(hi,Ui,wi){var pi=cs(e,At,null,hi),ci=Ui=="ltr"==(wi=="after")?"left":"right",si=wi=="after"?pi.begin:pi.end-(/\s/.test(At.text.charAt(pi.end-1))?2:1);return ai(si,ci)[ci]}var Fi=Ze(At,D.direction);return ne(Fi,Et||0,It==null?Bt:It,function(hi,Ui,wi,pi){var ci=wi=="ltr",si=ai(hi,ci?"left":"right"),Bi=ai(Ui-1,ci?"right":"left"),un=Et==null&&hi==0,Or=It==null&&Ui==Bt,Ri=pi==0,or=!Fi||pi==Fi.length-1;if(Bi.top-si.top<=3){var bi=(he?un:Or)&&Ri,Ga=(he?Or:un)&&or,fr=bi?ie:(ci?si:Bi).left,jr=Ga?ae:(ci?Bi:si).right;De(fr,si.top,jr-fr,si.bottom)}else{var Wr,ki,hn,Va;ci?(Wr=he&&un&&Ri?ie:si.left,ki=he?ae:Xi(hi,wi,"before"),hn=he?ie:Xi(Ui,wi,"after"),Va=he&&Or&&or?ae:Bi.right):(Wr=he?Xi(hi,wi,"before"):ie,ki=!he&&un&&Ri?ae:si.right,hn=!he&&Or&&or?ie:Bi.left,Va=he?Xi(Ui,wi,"after"):ae),De(Wr,si.top,ki-Wr,si.bottom),si.bottom<Bi.top&&De(ie,si.bottom,null,Bi.top),De(hn,Bi.top,Va-hn,Bi.bottom)}(!ti||Xn(si,ti)<0)&&(ti=si),Xn(Bi,ti)<0&&(ti=Bi),(!yi||Xn(si,yi)<0)&&(yi=si),Xn(Bi,yi)<0&&(yi=Bi)}),{start:ti,end:yi}}var $e=l.from(),Ye=l.to();if($e.line==Ye.line)Ue($e.line,$e.ch,Ye.ch);else{var rt=xt(D,$e.line),lt=xt(D,Ye.line),ct=Li(rt)==Li(lt),gt=Ue($e.line,$e.ch,ct?rt.text.length+1:null).end,yt=Ue(Ye.line,ct?0:null,Ye.ch).start;ct&&(gt.top<yt.top-2?(De(gt.right,gt.top,null,gt.bottom),De(ie,yt.top,yt.left,yt.bottom)):De(gt.right,gt.top,yt.left-gt.right,gt.bottom)),gt.bottom<yt.top&&De(ie,gt.bottom,null,yt.top)}w.appendChild(X)}function Ea(e){if(!e.state.focused)return;var l=e.display;clearInterval(l.blinker);var w=!0;l.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?l.blinker=setInterval(function(){e.hasFocus()||Zr(e),l.cursorDiv.style.visibility=(w=!w)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(l.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,Zr(e))},100)}function wa(e,l){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Me(e,"focus",e,l),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),i&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ea(e)}function Zr(e,l){if(e.state.delayingBlurEvent)return;e.state.focused&&(Me(e,"blur",e,l),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 l=e.display,w=l.lineDiv.offsetTop,x=0;x<l.view.length;x++){var D=l.view[x],X=e.options.lineWrapping,Z=void 0,ie=0;if(D.hidden)continue;if(E&&b<8){var ae=D.node.offsetTop+D.node.offsetHeight;Z=ae-w,w=ae}else{var he=D.node.getBoundingClientRect();Z=he.bottom-he.top,!X&&D.text.firstChild&&(ie=D.text.firstChild.getBoundingClientRect().right-he.left-1)}var De=D.line.height-Z;if((De>.005||De<-.005)&&(ri(D.line,Z),_s(D.line),D.rest))for(var Ue=0;Ue<D.rest.length;Ue++)_s(D.rest[Ue]);if(ie>e.display.sizerWidth){var $e=Math.ceil(ie/Qr(e.display));$e>e.display.maxLineLength&&(e.display.maxLineLength=$e,e.display.maxLine=D.line,e.display.maxLineChanged=!0)}}}function _s(e){if(e.widgets)for(var l=0;l<e.widgets.length;++l){var w=e.widgets[l],x=w.node.parentNode;x&&(w.height=x.offsetHeight)}}function Gn(e,l,w){var x=w&&w.top!=null?Math.max(0,w.top):e.scroller.scrollTop;x=Math.floor(x-Hn(e));var D=w&&w.bottom!=null?w.bottom:x+e.wrapper.clientHeight,X=di(l,x),Z=di(l,D);if(w&&w.ensure){var ie=w.ensure.from.line,ae=w.ensure.to.line;ie<X?(X=ie,Z=di(l,Ji(xt(l,ie))+e.wrapper.clientHeight)):Math.min(ae,l.lastLine())>=Z&&(X=di(l,Ji(xt(l,ae))-e.wrapper.clientHeight),Z=ae)}return{from:X,to:Math.max(Z,X+1)}}function Yo(e,l){if(Fe(e,"scrollCursorIntoView"))return;var w=e.display,x=w.sizer.getBoundingClientRect(),D=null;if(l.top+x.top<0?D=!0:l.bottom+x.top>(window.innerHeight||document.documentElement.clientHeight)&&(D=!1),D!=null&&!t){var X=g("div","\u200B",null,`position: absolute;
top: `+(l.top-w.viewOffset-Hn(e.display))+`px;
height: `+(l.bottom-l.top+ar(e)+w.barHeight)+`px;
left: `+l.left+"px; width: "+Math.max(2,l.right-l.left)+"px;");e.display.lineSpace.appendChild(X),X.scrollIntoView(D),e.display.lineSpace.removeChild(X)}}function Qo(e,l,w,x){x==null&&(x=0);var D;!e.options.lineWrapping&&l==w&&(l=l.ch?ut(l.line,l.sticky=="before"?l.ch-1:l.ch,"after"):l,w=l.sticky=="before"?ut(l.line,l.ch+1,"before"):l);for(var X=0;X<5;X++){var Z=!1,ie=er(e,l),ae=!w||w==l?ie:er(e,w);D={left:Math.min(ie.left,ae.left),top:Math.min(ie.top,ae.top)-x,right:Math.max(ie.left,ae.left),bottom:Math.max(ie.bottom,ae.bottom)+x};var he=Sa(e,D),De=e.doc.scrollTop,Ue=e.doc.scrollLeft;if(he.scrollTop!=null&&(xn(e,he.scrollTop),Math.abs(e.doc.scrollTop-De)>1&&(Z=!0)),he.scrollLeft!=null&&(Ur(e,he.scrollLeft),Math.abs(e.doc.scrollLeft-Ue)>1&&(Z=!0)),!Z)break}return D}function Zo(e,l){var w=Sa(e,l);w.scrollTop!=null&&xn(e,w.scrollTop),w.scrollLeft!=null&&Ur(e,w.scrollLeft)}function Sa(e,l){var w=e.display,x=Yr(e.display);l.top<0&&(l.top=0);var D=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:w.scroller.scrollTop,X=da(e),Z={};l.bottom-l.top>X&&(l.bottom=l.top+X);var ie=e.doc.height+ca(w),ae=l.top<x,he=l.bottom>ie-x;if(l.top<D)Z.scrollTop=ae?0:l.top;else if(l.bottom>D+X){var De=Math.min(l.top,(he?ie:l.bottom)-X);De!=D&&(Z.scrollTop=De)}var Ue=e.options.fixedGutter?0:w.gutters.offsetWidth,$e=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:w.scroller.scrollLeft-Ue,Ye=Mr(e)-w.gutters.offsetWidth,rt=l.right-l.left>Ye;return rt&&(l.right=l.left+Ye),l.left<10?Z.scrollLeft=0:l.left<$e?Z.scrollLeft=Math.max(0,l.left+Ue-(rt?0:10)):l.right>Ye+$e-3&&(Z.scrollLeft=l.right+(rt?0:10)-Ye),Z}function Ta(e,l){if(l==null)return;Vn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+l}function qr(e){Vn(e);var l=e.getCursor();e.curOp.scrollToPos={from:l,to:l,margin:e.options.cursorScrollMargin}}function bn(e,l,w){(l!=null||w!=null)&&Vn(e),l!=null&&(e.curOp.scrollLeft=l),w!=null&&(e.curOp.scrollTop=w)}function qo(e,l){Vn(e),e.curOp.scrollToPos=l}function Vn(e){var l=e.curOp.scrollToPos;if(l){e.curOp.scrollToPos=null;var w=us(e,l.from),x=us(e,l.to);ys(e,w,x,l.margin)}}function ys(e,l,w,x){var D=Sa(e,{left:Math.min(l.left,w.left),top:Math.min(l.top,w.top)-x,right:Math.max(l.right,w.right),bottom:Math.max(l.bottom,w.bottom)+x});bn(e,D.scrollLeft,D.scrollTop)}function xn(e,l){if(Math.abs(e.doc.scrollTop-l)<2)return;I||Aa(e,{top:l}),bs(e,l,!0),I&&Aa(e),Sn(e,100)}function bs(e,l,w){if(l=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,l)),e.display.scroller.scrollTop==l&&!w)return;e.doc.scrollTop=l,e.display.scrollbars.setScrollTop(l),e.display.scroller.scrollTop!=l&&(e.display.scroller.scrollTop=l)}function Ur(e,l,w,x){if(l=Math.max(0,Math.min(l,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(w?l==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-l)<2)&&!x)return;e.doc.scrollLeft=l,Ts(e),e.display.scroller.scrollLeft!=l&&(e.display.scroller.scrollLeft=l),e.display.scrollbars.setScrollLeft(l)}function En(e){var l=e.display,w=l.gutters.offsetWidth,x=Math.round(e.doc.height+ca(e.display));return{clientHeight:l.scroller.clientHeight,viewHeight:l.wrapper.clientHeight,scrollWidth:l.scroller.scrollWidth,clientWidth:l.scroller.clientWidth,viewWidth:l.wrapper.clientWidth,barLeft:e.options.fixedGutter?w:0,docHeight:x,scrollHeight:x+ar(e)+l.barHeight,nativeBarWidth:l.nativeBarWidth,gutterWidth:w}}var Br=function(e,l,w){this.cm=w;var x=this.vert=g("div",[g("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),D=this.horiz=g("div",[g("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");x.tabIndex=D.tabIndex=-1,e(x),e(D),Ge(x,"scroll",function(){x.clientHeight&&l(x.scrollTop,"vertical")}),Ge(D,"scroll",function(){D.clientWidth&&l(D.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&b<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var l=e.scrollWidth>e.clientWidth+1,w=e.scrollHeight>e.clientHeight+1,x=e.nativeBarWidth;if(w){this.vert.style.display="block",this.vert.style.bottom=l?x+"px":"0";var D=e.viewHeight-(l?x:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+D)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(l){this.horiz.style.display="block",this.horiz.style.right=w?x+"px":"0",this.horiz.style.left=e.barLeft+"px";var X=e.viewWidth-e.barLeft-(w?x:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+X)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(x==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:w?x:0,bottom:l?x: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=f&&!a?"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,l,w){e.style.pointerEvents="auto";function x(){var D=e.getBoundingClientRect(),X=w=="vert"?document.elementFromPoint(D.right-1,(D.top+D.bottom)/2):document.elementFromPoint((D.right+D.left)/2,D.bottom-1);X!=e?e.style.pointerEvents="none":l.set(1e3,x)}l.set(1e3,x)},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,l){l||(l=En(e));var w=e.display.barWidth,x=e.display.barHeight;xs(e,l);for(var D=0;D<4&&w!=e.display.barWidth||x!=e.display.barHeight;D++)w!=e.display.barWidth&&e.options.lineWrapping&&zn(e),xs(e,En(e)),w=e.display.barWidth,x=e.display.barHeight}function xs(e,l){var w=e.display,x=w.scrollbars.update(l);w.sizer.style.paddingRight=(w.barWidth=x.right)+"px",w.sizer.style.paddingBottom=(w.barHeight=x.bottom)+"px",w.heightForcer.style.borderBottom=x.bottom+"px solid transparent",x.right&&x.bottom?(w.scrollbarFiller.style.display="block",w.scrollbarFiller.style.height=x.bottom+"px",w.scrollbarFiller.style.width=x.right+"px"):w.scrollbarFiller.style.display="",x.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(w.gutterFiller.style.display="block",w.gutterFiller.style.height=x.bottom+"px",w.gutterFiller.style.width=l.gutterWidth+"px"):w.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(l){e.display.wrapper.insertBefore(l,e.display.scrollbarFiller),Ge(l,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),l.setAttribute("cm-not-content","true")},function(l,w){w=="horizontal"?Ur(e,l):xn(e,l)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var $o=0;function Kr(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},Zi(e.curOp)}function Hr(e){var l=e.curOp;l&&ko(l,function(w){for(var x=0;x<w.ops.length;x++)w.ops[x].cm.curOp=null;Jo(w)})}function Jo(e){for(var l=e.ops,w=0;w<l.length;w++)el(l[w]);for(var x=0;x<l.length;x++)tl(l[x]);for(var D=0;D<l.length;D++)il(l[D]);for(var X=0;X<l.length;X++)rl(l[X]);for(var Z=0;Z<l.length;Z++)nl(l[Z])}function el(e){var l=e.cm,w=l.display;sl(l),e.updateMaxLine&&Kn(l),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<w.viewFrom||e.scrollToPos.to.line>=w.viewTo)||w.maxLineChanged&&l.options.lineWrapping,e.update=e.mustUpdate&&new Yn(l,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 l=e.cm,w=l.display;e.updatedDisplay&&zn(l),e.barMeasure=En(l),w.maxLineChanged&&!l.options.lineWrapping&&(e.adjustWidthTo=ts(l,w.maxLine,w.maxLine.text.length).left+3,l.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(w.scroller.clientWidth,w.sizer.offsetLeft+e.adjustWidthTo+ar(l)+l.display.barWidth),e.maxScrollLeft=Math.max(0,w.sizer.offsetLeft+e.adjustWidthTo-Mr(l))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=w.input.prepareSelection())}function rl(e){var l=e.cm;e.adjustWidthTo!=null&&(l.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<l.doc.scrollLeft&&Ur(l,Math.min(l.display.scroller.scrollLeft,e.maxScrollLeft),!0),l.display.maxLineChanged=!1);var w=e.focus&&e.focus==W();e.preparedSelection&&l.display.input.showSelection(e.preparedSelection,w),(e.updatedDisplay||e.startHeight!=l.doc.height)&&$r(l,e.barMeasure),e.updatedDisplay&&La(l,e.barMeasure),e.selectionChanged&&Ea(l),l.state.focused&&e.updateInput&&l.display.input.reset(e.typing),w&&gs(e.cm)}function nl(e){var l=e.cm,w=l.display,x=l.doc;if(e.updatedDisplay&&Ss(l,e.update),w.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(w.wheelStartX=w.wheelStartY=null),e.scrollTop!=null&&bs(l,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ur(l,e.scrollLeft,!0,!0),e.scrollToPos){var D=Qo(l,B(x,e.scrollToPos.from),B(x,e.scrollToPos.to),e.scrollToPos.margin);Yo(l,D)}var X=e.maybeHiddenMarkers,Z=e.maybeUnhiddenMarkers;if(X)for(var ie=0;ie<X.length;++ie)X[ie].lines.length||Me(X[ie],"hide");if(Z)for(var ae=0;ae<Z.length;++ae)Z[ae].lines.length&&Me(Z[ae],"unhide");w.wrapper.offsetHeight&&(x.scrollTop=l.display.scroller.scrollTop),e.changeObjs&&Me(l,"changes",l,e.changeObjs),e.update&&e.update.finish()}function Wi(e,l){if(e.curOp)return l();Kr(e);try{return l()}finally{Hr(e)}}function vi(e,l){return function(){if(e.curOp)return l.apply(e,arguments);Kr(e);try{return l.apply(e,arguments)}finally{Hr(e)}}}function Oi(e){return function(){if(this.curOp)return e.apply(this,arguments);Kr(this);try{return e.apply(this,arguments)}finally{Hr(this)}}}function _i(e){return function(){var l=this.cm;if(!l||l.curOp)return e.apply(this,arguments);Kr(l);try{return e.apply(this,arguments)}finally{Hr(l)}}}function Sn(e,l){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(l,U(al,e))}function al(e){var l=e.doc;if(l.highlightFrontier>=e.display.viewTo)return;var w=+new Date+e.options.workTime,x=ft(e,l.highlightFrontier),D=[];l.iter(x.line,Math.min(l.first+l.size,e.display.viewTo+500),function(X){if(x.line>=e.display.viewFrom){var Z=X.styles,ie=X.text.length>e.options.maxHighlightLength?Ot(l.mode,x.state):null,ae=Be(e,X,x,!0);ie&&(x.state=ie),X.styles=ae.styles;var he=X.styleClasses,De=ae.classes;De?X.styleClasses=De:he&&(X.styleClasses=null);for(var Ue=!Z||Z.length!=X.styles.length||he!=De&&(!he||!De||he.bgClass!=De.bgClass||he.textClass!=De.textClass),$e=0;!Ue&&$e<Z.length;++$e)Ue=Z[$e]!=X.styles[$e];Ue&&D.push(x.line),X.stateAfter=x.save(),x.nextLine()}else X.text.length<=e.options.maxHighlightLength&&St(e,X.text,x),X.stateAfter=x.line%5==0?x.save():null,x.nextLine();if(+new Date>w)return Sn(e,e.options.workDelay),!0}),l.highlightFrontier=x.line,l.modeFrontier=Math.max(l.modeFrontier,x.line),D.length&&Wi(e,function(){for(var X=0;X<D.length;X++)wr(e,D[X],"text")})}var Yn=function(e,l,w){var x=e.display;this.viewport=l,this.visible=Gn(x,e.doc,l),this.editorIsHidden=!x.wrapper.offsetWidth,this.wrapperHeight=x.wrapper.clientHeight,this.wrapperWidth=x.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=w,this.dims=ya(e),this.events=[]};Yn.prototype.signal=function(e,l){_e(e,l)&&this.events.push(arguments)},Yn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Me.apply(null,this.events[e])};function sl(e){var l=e.display;!l.scrollbarsClipped&&l.scroller.offsetWidth&&(l.nativeBarWidth=l.scroller.offsetWidth-l.scroller.clientWidth,l.heightForcer.style.height=ar(e)+"px",l.sizer.style.marginBottom=-l.nativeBarWidth+"px",l.sizer.style.borderRightWidth=ar(e)+"px",l.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var l=W();if(!l||!N(e.display.lineDiv,l))return null;var w={activeElt:l};if(window.getSelection){var x=window.getSelection();x.anchorNode&&x.extend&&N(e.display.lineDiv,x.anchorNode)&&(w.anchorNode=x.anchorNode,w.anchorOffset=x.anchorOffset,w.focusNode=x.focusNode,w.focusOffset=x.focusOffset)}return w}function ll(e){if(!e||!e.activeElt||e.activeElt==W())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&N(document.body,e.anchorNode)&&N(document.body,e.focusNode)){var l=window.getSelection(),w=document.createRange();w.setEnd(e.anchorNode,e.anchorOffset),w.collapse(!1),l.removeAllRanges(),l.addRange(w),l.extend(e.focusNode,e.focusOffset)}}function Ca(e,l){var w=e.display,x=e.doc;if(l.editorIsHidden)return Sr(e),!1;if(!l.force&&l.visible.from>=w.viewFrom&&l.visible.to<=w.viewTo&&(w.updateLineNumbers==null||w.updateLineNumbers>=w.viewTo)&&w.renderedView==w.view&&fs(e)==0)return!1;Cs(e)&&(Sr(e),l.dims=ya(e));var D=x.first+x.size,X=Math.max(l.visible.from-e.options.viewportMargin,x.first),Z=Math.min(D,l.visible.to+e.options.viewportMargin);w.viewFrom<X&&X-w.viewFrom<20&&(X=Math.max(x.first,w.viewFrom)),w.viewTo>Z&&w.viewTo-Z<20&&(Z=Math.min(D,w.viewTo)),mi&&(X=dn(e.doc,X),Z=Er(e.doc,Z));var ie=X!=w.viewFrom||Z!=w.viewTo||w.lastWrapHeight!=l.wrapperHeight||w.lastWrapWidth!=l.wrapperWidth;Go(e,X,Z),w.viewOffset=Ji(xt(e.doc,w.viewFrom)),e.display.mover.style.top=w.viewOffset+"px";var ae=fs(e);if(!ie&&ae==0&&!l.force&&w.renderedView==w.view&&(w.updateLineNumbers==null||w.updateLineNumbers>=w.viewTo))return!1;var he=ol(e);return ae>4&&(w.lineDiv.style.display="none"),ul(e,w.updateLineNumbers,l.dims),ae>4&&(w.lineDiv.style.display=""),w.renderedView=w.view,ll(he),T(w.cursorDiv),T(w.selectionDiv),w.gutters.style.height=w.sizer.style.minHeight=0,ie&&(w.lastWrapHeight=l.wrapperHeight,w.lastWrapWidth=l.wrapperWidth,Sn(e,400)),w.updateLineNumbers=null,!0}function Ss(e,l){for(var w=l.viewport,x=!0;;x=!1){if(!x||!e.options.lineWrapping||l.oldDisplayWidth==Mr(e)){if(w&&w.top!=null&&(w={top:Math.min(e.doc.height+ca(e.display)-da(e),w.top)}),l.visible=Gn(e.display,e.doc,w),l.visible.from>=e.display.viewFrom&&l.visible.to<=e.display.viewTo)break}else x&&(l.visible=Gn(e.display,e.doc,w));if(!Ca(e,l))break;zn(e);var D=En(e);yn(e),$r(e,D),La(e,D),l.force=!1}l.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(l.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,l){var w=new Yn(e,l);if(Ca(e,w)){zn(e),Ss(e,w);var x=En(e);yn(e),$r(e,x),La(e,x),w.finish()}}function ul(e,l,w){var x=e.display,D=e.options.lineNumbers,X=x.lineDiv,Z=X.firstChild;function ie(rt){var lt=rt.nextSibling;return i&&f&&e.display.currentWheelTarget==rt?rt.style.display="none":rt.parentNode.removeChild(rt),lt}for(var ae=x.view,he=x.viewFrom,De=0;De<ae.length;De++){var Ue=ae[De];if(!Ue.hidden)if(!Ue.node||Ue.node.parentNode!=X){var $e=No(e,Ue,he,w);X.insertBefore($e,Z)}else{for(;Z!=Ue.node;)Z=ie(Z);var Ye=D&&l!=null&&l<=he&&Ue.lineNumber;Ue.changes&&(de(Ue.changes,"gutter")>-1&&(Ye=!1),Ya(e,Ue,he,w)),Ye&&(T(Ue.lineNumber),Ue.lineNumber.appendChild(document.createTextNode(Yi(e.options,he)))),Z=Ue.node.nextSibling}he+=Ue.size}for(;Z;)Z=ie(Z)}function Ra(e){var l=e.gutters.offsetWidth;e.sizer.style.marginLeft=l+"px"}function La(e,l){e.display.sizer.style.minHeight=l.docHeight+"px",e.display.heightForcer.style.top=l.docHeight+"px",e.display.gutters.style.height=l.docHeight+e.display.barHeight+ar(e)+"px"}function Ts(e){var l=e.display,w=l.view;if(!l.alignWidgets&&(!l.gutters.firstChild||!e.options.fixedGutter))return;for(var x=ba(l)-l.scroller.scrollLeft+e.doc.scrollLeft,D=l.gutters.offsetWidth,X=x+"px",Z=0;Z<w.length;Z++)if(!w[Z].hidden){e.options.fixedGutter&&(w[Z].gutter&&(w[Z].gutter.style.left=X),w[Z].gutterBackground&&(w[Z].gutterBackground.style.left=X));var ie=w[Z].alignable;if(ie)for(var ae=0;ae<ie.length;ae++)ie[ae].style.left=X}e.options.fixedGutter&&(l.gutters.style.left=x+D+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var l=e.doc,w=Yi(e.options,l.first+l.size-1),x=e.display;if(w.length!=x.lineNumChars){var D=x.measure.appendChild(g("div",[g("div",w)],"CodeMirror-linenumber CodeMirror-gutter-elt")),X=D.firstChild.offsetWidth,Z=D.offsetWidth-X;return x.lineGutter.style.width="",x.lineNumInnerWidth=Math.max(X,x.lineGutter.offsetWidth-Z)+1,x.lineNumWidth=x.lineNumInnerWidth+Z,x.lineNumChars=x.lineNumInnerWidth?w.length:-1,x.lineGutter.style.width=x.lineNumWidth+"px",Ra(e.display),!0}return!1}function Oa(e,l){for(var w=[],x=!1,D=0;D<e.length;D++){var X=e[D],Z=null;if(typeof X!="string"&&(Z=X.style,X=X.className),X=="CodeMirror-linenumbers")if(l)x=!0;else continue;w.push({className:X,style:Z})}return l&&!x&&w.push({className:"CodeMirror-linenumbers",style:null}),w}function As(e){var l=e.gutters,w=e.gutterSpecs;T(l),e.lineGutter=null;for(var x=0;x<w.length;++x){var D=w[x],X=D.className,Z=D.style,ie=l.appendChild(g("div",null,"CodeMirror-gutter "+X));Z&&(ie.style.cssText=Z),X=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}l.style.display=w.length?"":"none",Ra(e)}function Tn(e){As(e.display),Pi(e),Ts(e)}function hl(e,l,w,x){var D=this;this.input=w,D.scrollbarFiller=g("div",null,"CodeMirror-scrollbar-filler"),D.scrollbarFiller.setAttribute("cm-not-content","true"),D.gutterFiller=g("div",null,"CodeMirror-gutter-filler"),D.gutterFiller.setAttribute("cm-not-content","true"),D.lineDiv=F("div",null,"CodeMirror-code"),D.selectionDiv=g("div",null,null,"position: relative; z-index: 1"),D.cursorDiv=g("div",null,"CodeMirror-cursors"),D.measure=g("div",null,"CodeMirror-measure"),D.lineMeasure=g("div",null,"CodeMirror-measure"),D.lineSpace=F("div",[D.measure,D.lineMeasure,D.selectionDiv,D.cursorDiv,D.lineDiv],null,"position: relative; outline: none");var X=F("div",[D.lineSpace],"CodeMirror-lines");D.mover=g("div",[X],null,"position: relative"),D.sizer=g("div",[D.mover],"CodeMirror-sizer"),D.sizerWidth=null,D.heightForcer=g("div",null,null,"position: absolute; height: "+be+"px; width: 1px;"),D.gutters=g("div",null,"CodeMirror-gutters"),D.lineGutter=null,D.scroller=g("div",[D.sizer,D.heightForcer,D.gutters],"CodeMirror-scroll"),D.scroller.setAttribute("tabIndex","-1"),D.wrapper=g("div",[D.scrollbarFiller,D.gutterFiller,D.scroller],"CodeMirror"),E&&b<8&&(D.gutters.style.zIndex=-1,D.scroller.style.paddingRight=0),!i&&!(I&&u)&&(D.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(D.wrapper):e(D.wrapper)),D.viewFrom=D.viewTo=l.first,D.reportedViewFrom=D.reportedViewTo=l.first,D.view=[],D.renderedView=null,D.externalMeasured=null,D.viewOffset=0,D.lastWrapHeight=D.lastWrapWidth=0,D.updateLineNumbers=null,D.nativeBarWidth=D.barHeight=D.barWidth=0,D.scrollbarsClipped=!1,D.lineNumWidth=D.lineNumInnerWidth=D.lineNumChars=null,D.alignWidgets=!1,D.cachedCharWidth=D.cachedTextHeight=D.cachedPaddingH=null,D.maxLine=null,D.maxLineLength=0,D.maxLineChanged=!1,D.wheelDX=D.wheelDY=D.wheelStartX=D.wheelStartY=null,D.shift=!1,D.selForContextMenu=null,D.activeTouch=null,D.gutterSpecs=Oa(x.gutters,x.lineNumbers),As(D),w.init(D)}var Qn=0,Gi=null;E?Gi=-.53:I?Gi=15:o?Gi=-.7:n&&(Gi=-1/3);function Rs(e){var l=e.wheelDeltaX,w=e.wheelDeltaY;return l==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(l=e.detail),w==null&&e.detail&&e.axis==e.VERTICAL_AXIS?w=e.detail:w==null&&(w=e.wheelDelta),{x:l,y:w}}function cl(e){var l=Rs(e);return l.x*=Gi,l.y*=Gi,l}function Ls(e,l){var w=Rs(l),x=w.x,D=w.y,X=e.display,Z=X.scroller,ie=Z.scrollWidth>Z.clientWidth,ae=Z.scrollHeight>Z.clientHeight;if(!(x&&ie||D&&ae))return;if(D&&f&&i){e:for(var he=l.target,De=X.view;he!=Z;he=he.parentNode)for(var Ue=0;Ue<De.length;Ue++)if(De[Ue].node==he){e.display.currentWheelTarget=he;break e}}if(x&&!I&&!h&&Gi!=null){D&&ae&&xn(e,Math.max(0,Z.scrollTop+D*Gi)),Ur(e,Math.max(0,Z.scrollLeft+x*Gi)),(!D||D&&ae)&&ee(l),X.wheelStartX=null;return}if(D&&Gi!=null){var $e=D*Gi,Ye=e.doc.scrollTop,rt=Ye+X.wrapper.clientHeight;$e<0?Ye=Math.max(0,Ye+$e-50):rt=Math.min(e.doc.height,rt+$e+50),Aa(e,{top:Ye,bottom:rt})}Qn<20&&(X.wheelStartX==null?(X.wheelStartX=Z.scrollLeft,X.wheelStartY=Z.scrollTop,X.wheelDX=x,X.wheelDY=D,setTimeout(function(){if(X.wheelStartX==null)return;var lt=Z.scrollLeft-X.wheelStartX,ct=Z.scrollTop-X.wheelStartY,gt=ct&&X.wheelDY&&ct/X.wheelDY||lt&&X.wheelDX&&lt/X.wheelDX;if(X.wheelStartX=X.wheelStartY=null,!gt)return;Gi=(Gi*Qn+gt)/(Qn+1),++Qn},200)):(X.wheelDX+=x,X.wheelDY+=D))}var Vi=function(e,l){this.ranges=e,this.primIndex=l};Vi.prototype.primary=function(){return this.ranges[this.primIndex]},Vi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var l=0;l<this.ranges.length;l++){var w=this.ranges[l],x=e.ranges[l];if(!pr(w.anchor,x.anchor)||!pr(w.head,x.head))return!1}return!0},Vi.prototype.deepCopy=function(){for(var e=[],l=0;l<this.ranges.length;l++)e[l]=new Yt(mr(this.ranges[l].anchor),mr(this.ranges[l].head));return new Vi(e,this.primIndex)},Vi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Vi.prototype.contains=function(e,l){l||(l=e);for(var w=0;w<this.ranges.length;w++){var x=this.ranges[w];if(Dt(l,x.from())>=0&&Dt(e,x.to())<=0)return w}return-1};var Yt=function(e,l){this.anchor=e,this.head=l};Yt.prototype.from=function(){return vr(this.anchor,this.head)},Yt.prototype.to=function(){return gr(this.anchor,this.head)},Yt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tr(e,l,w){var x=e&&e.options.selectionsMayTouch,D=l[w];l.sort(function($e,Ye){return Dt($e.from(),Ye.from())}),w=de(l,D);for(var X=1;X<l.length;X++){var Z=l[X],ie=l[X-1],ae=Dt(ie.to(),Z.from());if(x&&!Z.empty()?ae>0:ae>=0){var he=vr(ie.from(),Z.from()),De=gr(ie.to(),Z.to()),Ue=ie.empty()?Z.from()==Z.head:ie.from()==ie.head;X<=w&&--w,l.splice(--X,2,new Yt(Ue?De:he,Ue?he:De))}}return new Vi(l,w)}function Tr(e,l){return new Vi([new Yt(e,l||e)],0)}function Cr(e){return e.text?ut(e.from.line+e.text.length-1,ue(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Os(e,l){if(Dt(e,l.from)<0)return e;if(Dt(e,l.to)<=0)return Cr(l);var w=e.line+l.text.length-(l.to.line-l.from.line)-1,x=e.ch;return e.line==l.to.line&&(x+=Cr(l).ch-l.to.ch),ut(w,x)}function ka(e,l){for(var w=[],x=0;x<e.sel.ranges.length;x++){var D=e.sel.ranges[x];w.push(new Yt(Os(D.anchor,l),Os(D.head,l)))}return tr(e.cm,w,e.sel.primIndex)}function ks(e,l,w){return e.line==l.line?ut(w.line,e.ch-l.ch+w.ch):ut(w.line+(e.line-l.line),e.ch)}function dl(e,l,w){for(var x=[],D=ut(e.first,0),X=D,Z=0;Z<l.length;Z++){var ie=l[Z],ae=ks(ie.from,D,X),he=ks(Cr(ie),D,X);if(D=ie.to,X=he,w=="around"){var De=e.sel.ranges[Z],Ue=Dt(De.head,De.anchor)<0;x[Z]=new Yt(Ue?he:ae,Ue?ae:he)}else x[Z]=new Yt(ae,ae)}return new Vi(x,e.sel.primIndex)}function Ia(e){e.doc.mode=$t(e.options,e.doc.modeOption),Cn(e)}function Cn(e){e.doc.iter(function(l){l.stateAfter&&(l.stateAfter=null),l.styles&&(l.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Sn(e,100),e.state.modeGen++,e.curOp&&Pi(e)}function Is(e,l){return l.from.ch==0&&l.to.ch==0&&ue(l.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Da(e,l,w,x){function D(yt){return w?w[yt]:null}function X(yt,vt,Et){ua(yt,vt,Et,x),Ei(yt,"change",yt,l)}function Z(yt,vt){for(var Et=[],It=yt;It<vt;++It)Et.push(new Dr(he[It],D(It),x));return Et}var ie=l.from,ae=l.to,he=l.text,De=xt(e,ie.line),Ue=xt(e,ae.line),$e=ue(he),Ye=D(he.length-1),rt=ae.line-ie.line;if(l.full)e.insert(0,Z(0,he.length)),e.remove(he.length,e.size-he.length);else if(Is(e,l)){var lt=Z(0,he.length-1);X(Ue,Ue.text,Ye),rt&&e.remove(ie.line,rt),lt.length&&e.insert(ie.line,lt)}else if(De==Ue)if(he.length==1)X(De,De.text.slice(0,ie.ch)+$e+De.text.slice(ae.ch),Ye);else{var ct=Z(1,he.length-1);ct.push(new Dr($e+De.text.slice(ae.ch),Ye,x)),X(De,De.text.slice(0,ie.ch)+he[0],D(0)),e.insert(ie.line+1,ct)}else if(he.length==1)X(De,De.text.slice(0,ie.ch)+he[0]+Ue.text.slice(ae.ch),D(0)),e.remove(ie.line+1,rt);else{X(De,De.text.slice(0,ie.ch)+he[0],D(0)),X(Ue,$e+Ue.text.slice(ae.ch),Ye);var gt=Z(1,he.length-1);rt>1&&e.remove(ie.line+1,rt-1),e.insert(ie.line+1,gt)}Ei(e,"change",e,l)}function Ar(e,l,w){function x(D,X,Z){if(D.linked)for(var ie=0;ie<D.linked.length;++ie){var ae=D.linked[ie];if(ae.doc==X)continue;var he=Z&&ae.sharedHist;if(w&&!he)continue;l(ae.doc,he),x(ae.doc,D,he)}}x(e,null,!0)}function Ds(e,l){if(l.cm)throw new Error("This document is already in use.");e.doc=l,l.cm=e,xa(e),Ia(e),Ms(e),e.options.lineWrapping||Kn(e),e.options.mode=l.modeOption,Pi(e)}function Ms(e){(e.doc.direction=="rtl"?j:y)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wi(e,function(){Ms(e),Pi(e)})}function Zn(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ma(e,l){var w={from:mr(l.from),to:Cr(l),text:Ki(e,l.from,l.to)};return Fs(e,w,l.from.line,l.to.line+1),Ar(e,function(x){return Fs(x,w,l.from.line,l.to.line+1)},!0),w}function Ps(e){for(;e.length;){var l=ue(e);if(l.ranges)e.pop();else break}}function pl(e,l){if(l)return Ps(e.done),ue(e.done);if(e.done.length&&!ue(e.done).ranges)return ue(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ue(e.done)}function Ns(e,l,w,x){var D=e.history;D.undone.length=0;var X=+new Date,Z,ie;if((D.lastOp==x||D.lastOrigin==l.origin&&l.origin&&(l.origin.charAt(0)=="+"&&D.lastModTime>X-(e.cm?e.cm.options.historyEventDelay:500)||l.origin.charAt(0)=="*"))&&(Z=pl(D,D.lastOp==x)))ie=ue(Z.changes),Dt(l.from,l.to)==0&&Dt(l.from,ie.to)==0?ie.to=Cr(l):Z.changes.push(Ma(e,l));else{var ae=ue(D.done);for((!ae||!ae.ranges)&&qn(e.sel,D.done),Z={changes:[Ma(e,l)],generation:D.generation},D.done.push(Z);D.done.length>D.undoDepth;)D.done.shift(),D.done[0].ranges||D.done.shift()}D.done.push(w),D.generation=++D.maxGeneration,D.lastModTime=D.lastSelTime=X,D.lastOp=D.lastSelOp=x,D.lastOrigin=D.lastSelOrigin=l.origin,ie||Me(e,"historyAdded")}function ml(e,l,w,x){var D=l.charAt(0);return D=="*"||D=="+"&&w.ranges.length==x.ranges.length&&w.somethingSelected()==x.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,l,w,x){var D=e.history,X=x&&x.origin;w==D.lastSelOp||X&&D.lastSelOrigin==X&&(D.lastModTime==D.lastSelTime&&D.lastOrigin==X||ml(e,X,ue(D.done),l))?D.done[D.done.length-1]=l:qn(l,D.done),D.lastSelTime=+new Date,D.lastSelOrigin=X,D.lastSelOp=w,x&&x.clearRedo!==!1&&Ps(D.undone)}function qn(e,l){var w=ue(l);w&&w.ranges&&w.equals(e)||l.push(e)}function Fs(e,l,w,x){var D=l["spans_"+e.id],X=0;e.iter(Math.max(e.first,w),Math.min(e.first+e.size,x),function(Z){Z.markedSpans&&((D||(D=l["spans_"+e.id]={}))[X]=Z.markedSpans),++X})}function vl(e){if(!e)return null;for(var l,w=0;w<e.length;++w)e[w].marker.explicitlyCleared?l||(l=e.slice(0,w)):l&&l.push(e[w]);return l?l.length?l:null:e}function _l(e,l){var w=l["spans_"+e.id];if(!w)return null;for(var x=[],D=0;D<l.text.length;++D)x.push(vl(w[D]));return x}function Us(e,l){var w=_l(e,l),x=$i(e,l);if(!w)return x;if(!x)return w;for(var D=0;D<w.length;++D){var X=w[D],Z=x[D];if(X&&Z){e:for(var ie=0;ie<Z.length;++ie){for(var ae=Z[ie],he=0;he<X.length;++he)if(X[he].marker==ae.marker)continue e;X.push(ae)}}else Z&&(w[D]=Z)}return w}function Jr(e,l,w){for(var x=[],D=0;D<e.length;++D){var X=e[D];if(X.ranges){x.push(w?Vi.prototype.deepCopy.call(X):X);continue}var Z=X.changes,ie=[];x.push({changes:ie});for(var ae=0;ae<Z.length;++ae){var he=Z[ae],De=void 0;if(ie.push({from:he.from,to:he.to,text:he.text}),l)for(var Ue in he)(De=Ue.match(/^spans_(\d+)$/))&&(de(l,Number(De[1]))>-1&&(ue(ie)[Ue]=he[Ue],delete he[Ue]))}}return x}function Pa(e,l,w,x){if(x){var D=e.anchor;if(w){var X=Dt(l,D)<0;X!=Dt(w,D)<0?(D=l,l=w):X!=Dt(l,w)<0&&(l=w)}return new Yt(D,l)}else return new Yt(w||l,l)}function $n(e,l,w,x,D){D==null&&(D=e.cm&&(e.cm.display.shift||e.extend)),Ai(e,new Vi([Pa(e.sel.primary(),l,w,D)],0),x)}function Bs(e,l,w){for(var x=[],D=e.cm&&(e.cm.display.shift||e.extend),X=0;X<e.sel.ranges.length;X++)x[X]=Pa(e.sel.ranges[X],l[X],null,D);var Z=tr(e.cm,x,e.sel.primIndex);Ai(e,Z,w)}function Na(e,l,w,x){var D=e.sel.ranges.slice(0);D[l]=w,Ai(e,tr(e.cm,D,e.sel.primIndex),x)}function Ks(e,l,w,x){Ai(e,Tr(l,w),x)}function yl(e,l,w){var x={ranges:l.ranges,update:function(D){this.ranges=[];for(var X=0;X<D.length;X++)this.ranges[X]=new Yt(B(e,D[X].anchor),B(e,D[X].head))},origin:w&&w.origin};return Me(e,"beforeSelectionChange",e,x),e.cm&&Me(e.cm,"beforeSelectionChange",e.cm,x),x.ranges!=l.ranges?tr(e.cm,x.ranges,x.ranges.length-1):l}function Hs(e,l,w){var x=e.history.done,D=ue(x);D&&D.ranges?(x[x.length-1]=l,Jn(e,l,w)):Ai(e,l,w)}function Ai(e,l,w){Jn(e,l,w),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,w)}function Jn(e,l,w){(_e(e,"beforeSelectionChange")||e.cm&&_e(e.cm,"beforeSelectionChange"))&&(l=yl(e,l,w));var x=w&&w.bias||(Dt(l.primary().head,e.sel.primary().head)<0?-1:1);js(e,Xs(e,l,x,!0)),!(w&&w.scroll===!1)&&e.cm&&qr(e.cm)}function js(e,l){if(l.equals(e.sel))return;e.sel=l,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ce(e.cm)),Ei(e,"cursorActivity",e)}function Ws(e){js(e,Xs(e,e.sel,null,!1))}function Xs(e,l,w,x){for(var D,X=0;X<l.ranges.length;X++){var Z=l.ranges[X],ie=l.ranges.length==e.sel.ranges.length&&e.sel.ranges[X],ae=ea(e,Z.anchor,ie&&ie.anchor,w,x),he=ea(e,Z.head,ie&&ie.head,w,x);(D||ae!=Z.anchor||he!=Z.head)&&(D||(D=l.ranges.slice(0,X)),D[X]=new Yt(ae,he))}return D?tr(e.cm,D,l.primIndex):l}function en(e,l,w,x,D){var X=xt(e,l.line);if(X.markedSpans)for(var Z=0;Z<X.markedSpans.length;++Z){var ie=X.markedSpans[Z],ae=ie.marker,he="selectLeft"in ae?!ae.selectLeft:ae.inclusiveLeft,De="selectRight"in ae?!ae.selectRight:ae.inclusiveRight;if((ie.from==null||(he?ie.from<=l.ch:ie.from<l.ch))&&(ie.to==null||(De?ie.to>=l.ch:ie.to>l.ch))){if(D&&(Me(ae,"beforeCursorEnter"),ae.explicitlyCleared))if(X.markedSpans){--Z;continue}else break;if(!ae.atomic)continue;if(w){var Ue=ae.find(x<0?1:-1),$e=void 0;if((x<0?De:he)&&(Ue=zs(e,Ue,-x,Ue&&Ue.line==l.line?X:null)),Ue&&Ue.line==l.line&&($e=Dt(Ue,w))&&(x<0?$e<0:$e>0))return en(e,Ue,l,x,D)}var Ye=ae.find(x<0?-1:1);return(x<0?he:De)&&(Ye=zs(e,Ye,x,Ye.line==l.line?X:null)),Ye?en(e,Ye,l,x,D):null}}return l}function ea(e,l,w,x,D){var X=x||1,Z=en(e,l,w,X,D)||!D&&en(e,l,w,X,!0)||en(e,l,w,-X,D)||!D&&en(e,l,w,-X,!0);return Z||(e.cantEdit=!0,ut(e.first,0))}function zs(e,l,w,x){return w<0&&l.ch==0?l.line>e.first?B(e,ut(l.line-1)):null:w>0&&l.ch==(x||xt(e,l.line)).text.length?l.line<e.first+e.size-1?ut(l.line+1,0):null:new ut(l.line,l.ch+w)}function Gs(e){e.setSelection(ut(e.firstLine(),0),ut(e.lastLine()),Ne)}function Vs(e,l,w){var x={canceled:!1,from:l.from,to:l.to,text:l.text,origin:l.origin,cancel:function(){return x.canceled=!0}};return w&&(x.update=function(D,X,Z,ie){D&&(x.from=B(e,D)),X&&(x.to=B(e,X)),Z&&(x.text=Z),ie!==void 0&&(x.origin=ie)}),Me(e,"beforeChange",e,x),e.cm&&Me(e.cm,"beforeChange",e.cm,x),x.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:x.from,to:x.to,text:x.text,origin:x.origin}}function tn(e,l,w){if(e.cm){if(!e.cm.curOp)return vi(e.cm,tn)(e,l,w);if(e.cm.state.suppressEdits)return}if((_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"))&&(l=Vs(e,l,!0),!l))return;var x=kr&&!w&&yr(e,l.from,l.to);if(x)for(var D=x.length-1;D>=0;--D)Ys(e,{from:x[D].from,to:x[D].to,text:D?[""]:l.text,origin:l.origin});else Ys(e,l)}function Ys(e,l){if(l.text.length==1&&l.text[0]==""&&Dt(l.from,l.to)==0)return;var w=ka(e,l);Ns(e,l,w,e.cm?e.cm.curOp.id:NaN),An(e,l,w,$i(e,l));var x=[];Ar(e,function(D,X){!X&&de(x,D.history)==-1&&($s(D.history,l),x.push(D.history)),An(D,l,null,$i(D,l))})}function ta(e,l,w){var x=e.cm&&e.cm.state.suppressEdits;if(x&&!w)return;for(var D=e.history,X,Z=e.sel,ie=l=="undo"?D.done:D.undone,ae=l=="undo"?D.undone:D.done,he=0;he<ie.length&&!(X=ie[he],w?X.ranges&&!X.equals(e.sel):!X.ranges);he++);if(he==ie.length)return;for(D.lastOrigin=D.lastSelOrigin=null;;)if(X=ie.pop(),X.ranges){if(qn(X,ae),w&&!X.equals(e.sel)){Ai(e,X,{clearRedo:!1});return}Z=X}else if(x){ie.push(X);return}else break;var De=[];qn(Z,ae),ae.push({changes:De,generation:D.generation}),D.generation=X.generation||++D.maxGeneration;for(var Ue=_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"),$e=function(lt){var ct=X.changes[lt];if(ct.origin=l,Ue&&!Vs(e,ct,!1))return ie.length=0,{};De.push(Ma(e,ct));var gt=lt?ka(e,ct):ue(ie);An(e,ct,gt,Us(e,ct)),!lt&&e.cm&&e.cm.scrollIntoView({from:ct.from,to:Cr(ct)});var yt=[];Ar(e,function(vt,Et){!Et&&de(yt,vt.history)==-1&&($s(vt.history,ct),yt.push(vt.history)),An(vt,ct,null,Us(vt,ct))})},Ye=X.changes.length-1;Ye>=0;--Ye){var rt=$e(Ye);if(rt)return rt.v}}function Qs(e,l){if(l==0)return;if(e.first+=l,e.sel=new Vi(Ae(e.sel.ranges,function(D){return new Yt(ut(D.anchor.line+l,D.anchor.ch),ut(D.head.line+l,D.head.ch))}),e.sel.primIndex),e.cm){Pi(e.cm,e.first,e.first-l,l);for(var w=e.cm.display,x=w.viewFrom;x<w.viewTo;x++)wr(e.cm,x,"gutter")}}function An(e,l,w,x){if(e.cm&&!e.cm.curOp)return vi(e.cm,An)(e,l,w,x);if(l.to.line<e.first){Qs(e,l.text.length-1-(l.to.line-l.from.line));return}if(l.from.line>e.lastLine())return;if(l.from.line<e.first){var D=l.text.length-1-(e.first-l.from.line);Qs(e,D),l={from:ut(e.first,0),to:ut(l.to.line+D,l.to.ch),text:[ue(l.text)],origin:l.origin}}var X=e.lastLine();l.to.line>X&&(l={from:l.from,to:ut(X,xt(e,X).text.length),text:[l.text[0]],origin:l.origin}),l.removed=Ki(e,l.from,l.to),w||(w=ka(e,l)),e.cm?bl(e.cm,l,x):Da(e,l,x),Jn(e,w,Ne),e.cantEdit&&ea(e,ut(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,l,w){var x=e.doc,D=e.display,X=l.from,Z=l.to,ie=!1,ae=X.line;e.options.lineWrapping||(ae=Ut(Li(xt(x,X.line))),x.iter(ae,Z.line+1,function(Ye){if(Ye==D.maxLine)return ie=!0,!0})),x.sel.contains(l.from,l.to)>-1&&Ce(e),Da(x,l,w,ds(e)),e.options.lineWrapping||(x.iter(ae,X.line+l.text.length,function(Ye){var rt=pn(Ye);rt>D.maxLineLength&&(D.maxLine=Ye,D.maxLineLength=rt,D.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),qi(x,X.line),Sn(e,400);var he=l.text.length-(Z.line-X.line)-1;l.full?Pi(e):X.line==Z.line&&l.text.length==1&&!Is(e.doc,l)?wr(e,X.line,"text"):Pi(e,X.line,Z.line+1,he);var De=_e(e,"changes"),Ue=_e(e,"change");if(Ue||De){var $e={from:X,to:Z,text:l.text,removed:l.removed,origin:l.origin};Ue&&Ei(e,"change",e,$e),De&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push($e)}e.display.selForContextMenu=null}function rn(e,l,w,x,D){var X;x||(x=w),Dt(x,w)<0&&(X=[x,w],w=X[0],x=X[1]),typeof l=="string"&&(l=e.splitLines(l)),tn(e,{from:w,to:x,text:l,origin:D})}function Zs(e,l,w,x){w<e.line?e.line+=x:l<e.line&&(e.line=l,e.ch=0)}function qs(e,l,w,x){for(var D=0;D<e.length;++D){var X=e[D],Z=!0;if(X.ranges){X.copied||(X=e[D]=X.deepCopy(),X.copied=!0);for(var ie=0;ie<X.ranges.length;ie++)Zs(X.ranges[ie].anchor,l,w,x),Zs(X.ranges[ie].head,l,w,x);continue}for(var ae=0;ae<X.changes.length;++ae){var he=X.changes[ae];if(w<he.from.line)he.from=ut(he.from.line+x,he.from.ch),he.to=ut(he.to.line+x,he.to.ch);else if(l<=he.to.line){Z=!1;break}}Z||(e.splice(0,D+1),D=0)}}function $s(e,l){var w=l.from.line,x=l.to.line,D=l.text.length-(x-w)-1;qs(e.done,w,x,D),qs(e.undone,w,x,D)}function Rn(e,l,w,x){var D=l,X=l;return typeof l=="number"?X=xt(e,J(e,l)):D=Ut(l),D==null?null:(x(X,D)&&e.cm&&wr(e.cm,D,w),X)}function Ln(e){this.lines=e,this.parent=null;for(var l=0,w=0;w<e.length;++w)e[w].parent=this,l+=e[w].height;this.height=l}Ln.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,l){for(var w=e,x=e+l;w<x;++w){var D=this.lines[w];this.height-=D.height,Tt(D),Ei(D,"delete")}this.lines.splice(e,l)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,l,w){this.height+=w,this.lines=this.lines.slice(0,e).concat(l).concat(this.lines.slice(e));for(var x=0;x<l.length;++x)l[x].parent=this},iterN:function(e,l,w){for(var x=e+l;e<x;++e)if(w(this.lines[e]))return!0}};function On(e){this.children=e;for(var l=0,w=0,x=0;x<e.length;++x){var D=e[x];l+=D.chunkSize(),w+=D.height,D.parent=this}this.size=l,this.height=w,this.parent=null}On.prototype={chunkSize:function(){return this.size},removeInner:function(e,l){this.size-=l;for(var w=0;w<this.children.length;++w){var x=this.children[w],D=x.chunkSize();if(e<D){var X=Math.min(l,D-e),Z=x.height;if(x.removeInner(e,X),this.height-=Z-x.height,D==X&&(this.children.splice(w--,1),x.parent=null),(l-=X)==0)break;e=0}else e-=D}if(this.size-l<25&&(this.children.length>1||!(this.children[0]instanceof Ln))){var ie=[];this.collapse(ie),this.children=[new Ln(ie)],this.children[0].parent=this}},collapse:function(e){for(var l=0;l<this.children.length;++l)this.children[l].collapse(e)},insertInner:function(e,l,w){this.size+=l.length,this.height+=w;for(var x=0;x<this.children.length;++x){var D=this.children[x],X=D.chunkSize();if(e<=X){if(D.insertInner(e,l,w),D.lines&&D.lines.length>50){for(var Z=D.lines.length%25+25,ie=Z;ie<D.lines.length;){var ae=new Ln(D.lines.slice(ie,ie+=25));D.height-=ae.height,this.children.splice(++x,0,ae),ae.parent=this}D.lines=D.lines.slice(0,Z),this.maybeSpill()}break}e-=X}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var l=e.children.splice(e.children.length-5,5),w=new On(l);if(e.parent){e.size-=w.size,e.height-=w.height;var D=de(e.parent.children,e);e.parent.children.splice(D+1,0,w)}else{var x=new On(e.children);x.parent=e,e.children=[x,w],e=x}w.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,l,w){for(var x=0;x<this.children.length;++x){var D=this.children[x],X=D.chunkSize();if(e<X){var Z=Math.min(l,X-e);if(D.iterN(e,Z,w))return!0;if((l-=Z)==0)break;e=0}else e-=X}}};var kn=function(e,l,w){if(w)for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);this.doc=e,this.node=l};kn.prototype.clear=function(){var e=this.doc.cm,l=this.line.widgets,w=this.line,x=Ut(w);if(x==null||!l)return;for(var D=0;D<l.length;++D)l[D]==this&&l.splice(D--,1);l.length||(w.widgets=null);var X=vn(this);ri(w,Math.max(0,w.height-X)),e&&(Wi(e,function(){Js(e,w,-X),wr(e,x,"widget")}),Ei(e,"lineWidgetCleared",e,this,x))},kn.prototype.changed=function(){var e=this,l=this.height,w=this.doc.cm,x=this.line;this.height=null;var D=vn(this)-l;if(!D)return;nr(this.doc,x)||ri(x,x.height+D),w&&Wi(w,function(){w.curOp.forceUpdate=!0,Js(w,x,D),Ei(w,"lineWidgetChanged",w,e,Ut(x))})},Ee(kn);function Js(e,l,w){Ji(l)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ta(e,w)}function xl(e,l,w,x){var D=new kn(e,w,x),X=e.cm;return X&&D.noHScroll&&(X.display.alignWidgets=!0),Rn(e,l,"widget",function(Z){var ie=Z.widgets||(Z.widgets=[]);if(D.insertAt==null?ie.push(D):ie.splice(Math.min(ie.length-1,Math.max(0,D.insertAt)),0,D),D.line=Z,X&&!nr(e,Z)){var ae=Ji(Z)<e.scrollTop;ri(Z,Z.height+vn(D)),ae&&Ta(X,D.height),X.curOp.forceUpdate=!0}return!0}),X&&Ei(X,"lineWidgetAdded",X,D,typeof l=="number"?l:Ut(l)),D}var eo=0,Rr=function(e,l){this.lines=[],this.type=l,this.doc=e,this.id=++eo};Rr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,l=e&&!e.curOp;if(l&&Kr(e),_e(this,"clear")){var w=this.find();w&&Ei(this,"clear",w.from,w.to)}for(var x=null,D=null,X=0;X<this.lines.length;++X){var Z=this.lines[X],ie=ji(Z.markedSpans,this);e&&!this.collapsed?wr(e,Ut(Z),"text"):e&&(ie.to!=null&&(D=Ut(Z)),ie.from!=null&&(x=Ut(Z))),Z.markedSpans=Ir(Z.markedSpans,ie),ie.from==null&&this.collapsed&&!nr(this.doc,Z)&&e&&ri(Z,Yr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ae=0;ae<this.lines.length;++ae){var he=Li(this.lines[ae]),De=pn(he);De>e.display.maxLineLength&&(e.display.maxLine=he,e.display.maxLineLength=De,e.display.maxLineChanged=!0)}x!=null&&e&&this.collapsed&&Pi(e,x,D+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ws(e.doc)),e&&Ei(e,"markerCleared",e,this,x,D),l&&Hr(e),this.parent&&this.parent.clear()},Rr.prototype.find=function(e,l){e==null&&this.type=="bookmark"&&(e=1);for(var w,x,D=0;D<this.lines.length;++D){var X=this.lines[D],Z=ji(X.markedSpans,this);if(Z.from!=null&&(w=ut(l?X:Ut(X),Z.from),e==-1))return w;if(Z.to!=null&&(x=ut(l?X:Ut(X),Z.to),e==1))return x}return w&&{from:w,to:x}},Rr.prototype.changed=function(){var e=this,l=this.find(-1,!0),w=this,x=this.doc.cm;if(!l||!x)return;Wi(x,function(){var D=l.line,X=Ut(l.line),Z=fa(x,X);if(Z&&(ns(Z),x.curOp.selectionChanged=x.curOp.forceUpdate=!0),x.curOp.updateMaxLine=!0,!nr(w.doc,D)&&w.height!=null){var ie=w.height;w.height=null;var ae=vn(w)-ie;ae&&ri(D,D.height+ae)}Ei(x,"markerChanged",x,e)})},Rr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var l=this.doc.cm.curOp;(!l.maybeHiddenMarkers||de(l.maybeHiddenMarkers,this)==-1)&&(l.maybeUnhiddenMarkers||(l.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Rr.prototype.detachLine=function(e){if(this.lines.splice(de(this.lines,e),1),!this.lines.length&&this.doc.cm){var l=this.doc.cm.curOp;(l.maybeHiddenMarkers||(l.maybeHiddenMarkers=[])).push(this)}},Ee(Rr);function nn(e,l,w,x,D){if(x&&x.shared)return El(e,l,w,x,D);if(e.cm&&!e.cm.curOp)return vi(e.cm,nn)(e,l,w,x,D);var X=new Rr(e,D),Z=Dt(l,w);if(x&&O(x,X,!1),Z>0||Z==0&&X.clearWhenEmpty!==!1)return X;if(X.replacedWith&&(X.collapsed=!0,X.widgetNode=F("span",[X.replacedWith],"CodeMirror-widget"),x.handleMouseEvents||X.widgetNode.setAttribute("cm-ignore-events","true"),x.insertLeft&&(X.widgetNode.insertLeft=!0)),X.collapsed){if(gi(e,l.line,l,w,X)||l.line!=w.line&&gi(e,w.line,l,w,X))throw new Error("Inserting collapsed marker partially overlapping an existing one");lr()}X.addToHistory&&Ns(e,{from:l,to:w,origin:"markText"},e.sel,NaN);var ie=l.line,ae=e.cm,he;if(e.iter(ie,w.line+1,function(Ue){ae&&X.collapsed&&!ae.options.lineWrapping&&Li(Ue)==ae.display.maxLine&&(he=!0),X.collapsed&&ie!=l.line&&ri(Ue,0),_r(Ue,new ur(X,ie==l.line?l.ch:null,ie==w.line?w.ch:null)),++ie}),X.collapsed&&e.iter(l.line,w.line+1,function(Ue){nr(e,Ue)&&ri(Ue,0)}),X.clearOnEnter&&Ge(X,"beforeCursorEnter",function(){return X.clear()}),X.readOnly&&(zi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),X.collapsed&&(X.id=++eo,X.atomic=!0),ae){if(he&&(ae.curOp.updateMaxLine=!0),X.collapsed)Pi(ae,l.line,w.line+1);else if(X.className||X.startStyle||X.endStyle||X.css||X.attributes||X.title)for(var De=l.line;De<=w.line;De++)wr(ae,De,"text");X.atomic&&Ws(ae.doc),Ei(ae,"markerAdded",ae,X)}return X}var In=function(e,l){this.markers=e,this.primary=l;for(var w=0;w<e.length;++w)e[w].parent=this};In.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ei(this,"clear")},In.prototype.find=function(e,l){return this.primary.find(e,l)},Ee(In);function El(e,l,w,x,D){x=O(x),x.shared=!1;var X=[nn(e,l,w,x,D)],Z=X[0],ie=x.widgetNode;return Ar(e,function(ae){ie&&(x.widgetNode=ie.cloneNode(!0)),X.push(nn(ae,B(ae,l),B(ae,w),x,D));for(var he=0;he<ae.linked.length;++he)if(ae.linked[he].isParent)return;Z=ue(X)}),new In(X,Z)}function to(e){return e.findMarks(ut(e.first,0),e.clipPos(ut(e.lastLine())),function(l){return l.parent})}function wl(e,l){for(var w=0;w<l.length;w++){var x=l[w],D=x.find(),X=e.clipPos(D.from),Z=e.clipPos(D.to);if(Dt(X,Z)){var ie=nn(e,X,Z,x.primary,x.primary.type);x.markers.push(ie),ie.parent=x}}}function Sl(e){for(var l=function(x){var D=e[x],X=[D.primary.doc];Ar(D.primary.doc,function(ae){return X.push(ae)});for(var Z=0;Z<D.markers.length;Z++){var ie=D.markers[Z];de(X,ie.doc)==-1&&(ie.parent=null,D.markers.splice(Z--,1))}},w=0;w<e.length;w++)l(w)}var Tl=0,Ni=function(e,l,w,x,D){if(!(this instanceof Ni))return new Ni(e,l,w,x,D);w==null&&(w=0),On.call(this,[new Ln([new Dr("",null)])]),this.first=w,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=w;var X=ut(w,0);this.sel=Tr(X),this.history=new Zn(null),this.id=++Tl,this.modeOption=l,this.lineSep=x,this.direction=D=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Da(this,{from:X,to:X,text:e}),Ai(this,Tr(X),Ne)};Ni.prototype=Qe(On.prototype,{constructor:Ni,iter:function(e,l,w){w?this.iterN(e-this.first,l-e,w):this.iterN(this.first,this.first+this.size,e)},insert:function(e,l){for(var w=0,x=0;x<l.length;++x)w+=l[x].height;this.insertInner(e-this.first,l,w)},remove:function(e,l){this.removeInner(e-this.first,l)},getValue:function(e){var l=Jt(this,this.first,this.first+this.size);return e===!1?l:l.join(e||this.lineSeparator())},setValue:_i(function(e){var l=ut(this.first,0),w=this.first+this.size-1;tn(this,{from:l,to:ut(w,xt(this,w).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&bn(this.cm,0,0),Ai(this,Tr(l),Ne)}),replaceRange:function(e,l,w,x){l=B(this,l),w=w?B(this,w):l,rn(this,e,l,w,x)},getRange:function(e,l,w){var x=Ki(this,B(this,e),B(this,l));return w===!1?x:x.join(w||this.lineSeparator())},getLine:function(e){var l=this.getLineHandle(e);return l&&l.text},getLineHandle:function(e){if(Ii(this,e))return xt(this,e)},getLineNumber:function(e){return Ut(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=xt(this,e)),Li(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return B(this,e)},getCursor:function(e){var l=this.sel.primary(),w;return e==null||e=="head"?w=l.head:e=="anchor"?w=l.anchor:e=="end"||e=="to"||e===!1?w=l.to():w=l.from(),w},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_i(function(e,l,w){Ks(this,B(this,typeof e=="number"?ut(e,l||0):e),null,w)}),setSelection:_i(function(e,l,w){Ks(this,B(this,e),B(this,l||e),w)}),extendSelection:_i(function(e,l,w){$n(this,B(this,e),l&&B(this,l),w)}),extendSelections:_i(function(e,l){Bs(this,Y(this,e),l)}),extendSelectionsBy:_i(function(e,l){var w=Ae(this.sel.ranges,e);Bs(this,Y(this,w),l)}),setSelections:_i(function(e,l,w){if(!e.length)return;for(var x=[],D=0;D<e.length;D++)x[D]=new Yt(B(this,e[D].anchor),B(this,e[D].head));l==null&&(l=Math.min(e.length-1,this.sel.primIndex)),Ai(this,tr(this.cm,x,l),w)}),addSelection:_i(function(e,l,w){var x=this.sel.ranges.slice(0);x.push(new Yt(B(this,e),B(this,l||e))),Ai(this,tr(this.cm,x,x.length-1),w)}),getSelection:function(e){for(var l=this.sel.ranges,w,x=0;x<l.length;x++){var D=Ki(this,l[x].from(),l[x].to());w=w?w.concat(D):D}return e===!1?w:w.join(e||this.lineSeparator())},getSelections:function(e){for(var l=[],w=this.sel.ranges,x=0;x<w.length;x++){var D=Ki(this,w[x].from(),w[x].to());e!==!1&&(D=D.join(e||this.lineSeparator())),l[x]=D}return l},replaceSelection:function(e,l,w){for(var x=[],D=0;D<this.sel.ranges.length;D++)x[D]=e;this.replaceSelections(x,l,w||"+input")},replaceSelections:_i(function(e,l,w){for(var x=[],D=this.sel,X=0;X<D.ranges.length;X++){var Z=D.ranges[X];x[X]={from:Z.from(),to:Z.to(),text:this.splitLines(e[X]),origin:w}}for(var ie=l&&l!="end"&&dl(this,x,l),ae=x.length-1;ae>=0;ae--)tn(this,x[ae]);ie?Hs(this,ie):this.cm&&qr(this.cm)}),undo:_i(function(){ta(this,"undo")}),redo:_i(function(){ta(this,"redo")}),undoSelection:_i(function(){ta(this,"undo",!0)}),redoSelection:_i(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,l=0,w=0,x=0;x<e.done.length;x++)e.done[x].ranges||++l;for(var D=0;D<e.undone.length;D++)e.undone[D].ranges||++w;return{undo:l,redo:w}},clearHistory:function(){var e=this;this.history=new Zn(this.history.maxGeneration),Ar(this,function(l){return l.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Jr(this.history.done),undone:Jr(this.history.undone)}},setHistory:function(e){var l=this.history=new Zn(this.history.maxGeneration);l.done=Jr(e.done.slice(0),null,!0),l.undone=Jr(e.undone.slice(0),null,!0)},setGutterMarker:_i(function(e,l,w){return Rn(this,e,"gutter",function(x){var D=x.gutterMarkers||(x.gutterMarkers={});return D[l]=w,!w&&pe(D)&&(x.gutterMarkers=null),!0})}),clearGutter:_i(function(e){var l=this;this.iter(function(w){w.gutterMarkers&&w.gutterMarkers[e]&&Rn(l,w,"gutter",function(){return w.gutterMarkers[e]=null,pe(w.gutterMarkers)&&(w.gutterMarkers=null),!0})})}),lineInfo:function(e){var l;if(typeof e=="number"){if(!Ii(this,e))return null;if(l=e,e=xt(this,e),!e)return null}else if(l=Ut(e),l==null)return null;return{line:l,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:_i(function(e,l,w){return Rn(this,e,l=="gutter"?"gutter":"class",function(x){var D=l=="text"?"textClass":l=="background"?"bgClass":l=="gutter"?"gutterClass":"wrapClass";if(!x[D])x[D]=w;else{if(_(w).test(x[D]))return!1;x[D]+=" "+w}return!0})}),removeLineClass:_i(function(e,l,w){return Rn(this,e,l=="gutter"?"gutter":"class",function(x){var D=l=="text"?"textClass":l=="background"?"bgClass":l=="gutter"?"gutterClass":"wrapClass",X=x[D];if(X)if(w==null)x[D]=null;else{var Z=X.match(_(w));if(!Z)return!1;var ie=Z.index+Z[0].length;x[D]=X.slice(0,Z.index)+(!Z.index||ie==X.length?"":" ")+X.slice(ie)||null}else return!1;return!0})}),addLineWidget:_i(function(e,l,w){return xl(this,e,l,w)}),removeLineWidget:function(e){e.clear()},markText:function(e,l,w){return nn(this,B(this,e),B(this,l),w,w&&w.type||"range")},setBookmark:function(e,l){var w={replacedWith:l&&(l.nodeType==null?l.widget:l),insertLeft:l&&l.insertLeft,clearWhenEmpty:!1,shared:l&&l.shared,handleMouseEvents:l&&l.handleMouseEvents};return e=B(this,e),nn(this,e,e,w,"bookmark")},findMarksAt:function(e){e=B(this,e);var l=[],w=xt(this,e.line).markedSpans;if(w)for(var x=0;x<w.length;++x){var D=w[x];(D.from==null||D.from<=e.ch)&&(D.to==null||D.to>=e.ch)&&l.push(D.marker.parent||D.marker)}return l},findMarks:function(e,l,w){e=B(this,e),l=B(this,l);var x=[],D=e.line;return this.iter(e.line,l.line+1,function(X){var Z=X.markedSpans;if(Z)for(var ie=0;ie<Z.length;ie++){var ae=Z[ie];!(ae.to!=null&&D==e.line&&e.ch>=ae.to||ae.from==null&&D!=e.line||ae.from!=null&&D==l.line&&ae.from>=l.ch)&&(!w||w(ae.marker))&&x.push(ae.marker.parent||ae.marker)}++D}),x},getAllMarks:function(){var e=[];return this.iter(function(l){var w=l.markedSpans;if(w)for(var x=0;x<w.length;++x)w[x].from!=null&&e.push(w[x].marker)}),e},posFromIndex:function(e){var l,w=this.first,x=this.lineSeparator().length;return this.iter(function(D){var X=D.text.length+x;if(X>e)return l=e,!0;e-=X,++w}),B(this,ut(w,l))},indexFromPos:function(e){e=B(this,e);var l=e.ch;if(e.line<this.first||e.ch<0)return 0;var w=this.lineSeparator().length;return this.iter(this.first,e.line,function(x){l+=x.text.length+w}),l},copy:function(e){var l=new Ni(Jt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return l.scrollTop=this.scrollTop,l.scrollLeft=this.scrollLeft,l.sel=this.sel,l.extend=!1,e&&(l.history.undoDepth=this.history.undoDepth,l.setHistory(this.getHistory())),l},linkedDoc:function(e){e||(e={});var l=this.first,w=this.first+this.size;e.from!=null&&e.from>l&&(l=e.from),e.to!=null&&e.to<w&&(w=e.to);var x=new Ni(Jt(this,l,w),e.mode||this.modeOption,l,this.lineSep,this.direction);return e.sharedHist&&(x.history=this.history),(this.linked||(this.linked=[])).push({doc:x,sharedHist:e.sharedHist}),x.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(x,to(this)),x},unlinkDoc:function(e){if(e instanceof ni&&(e=e.doc),this.linked)for(var l=0;l<this.linked.length;++l){var w=this.linked[l];if(w.doc!=e)continue;this.linked.splice(l,1),e.unlinkDoc(this),Sl(to(this));break}if(e.history==this.history){var x=[e.id];Ar(e,function(D){return x.push(D.id)},!0),e.history=new Zn(null),e.history.done=Jr(this.history.done,x),e.history.undone=Jr(this.history.undone,x)}},iterLinkedDocs:function(e){Ar(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ot(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:_i(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(l){return l.order=null}),this.cm&&fl(this.cm)})}),Ni.prototype.eachLine=Ni.prototype.iter;var io=0;function Cl(e){var l=this;if(ro(l),Fe(l,e)||cr(l.display,e))return;ee(e),E&&(io=+new Date);var w=Nr(l,e,!0),x=e.dataTransfer.files;if(!w||l.isReadOnly())return;if(x&&x.length&&window.FileReader&&window.File)for(var D=x.length,X=Array(D),Z=0,ie=function(){++Z==D&&vi(l,function(){w=B(l.doc,w);var Ye={from:w,to:w,text:l.doc.splitLines(X.filter(function(rt){return rt!=null}).join(l.doc.lineSeparator())),origin:"paste"};tn(l.doc,Ye),Hs(l.doc,Tr(B(l.doc,w),B(l.doc,Cr(Ye))))})()},ae=function(Ye,rt){if(l.options.allowDropFileTypes&&de(l.options.allowDropFileTypes,Ye.type)==-1){ie();return}var lt=new FileReader;lt.onerror=function(){return ie()},lt.onload=function(){var ct=lt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ct)){ie();return}X[rt]=ct,ie()},lt.readAsText(Ye)},he=0;he<x.length;he++)ae(x[he],he);else{if(l.state.draggingText&&l.doc.sel.contains(w)>-1){l.state.draggingText(e),setTimeout(function(){return l.display.input.focus()},20);return}try{var De=e.dataTransfer.getData("Text");if(De){var Ue;if(l.state.draggingText&&!l.state.draggingText.copy&&(Ue=l.listSelections()),Jn(l.doc,Tr(w,w)),Ue)for(var $e=0;$e<Ue.length;++$e)rn(l.doc,"",Ue[$e].anchor,Ue[$e].head,"drag");l.replaceSelection(De,"around","paste"),l.display.input.focus()}}catch(Ye){}}}function Al(e,l){if(E&&(!e.state.draggingText||+new Date-io<100)){me(l);return}if(Fe(e,l)||cr(e.display,l))return;if(l.dataTransfer.setData("Text",e.getSelection()),l.dataTransfer.effectAllowed="copyMove",l.dataTransfer.setDragImage&&!n){var w=g("img",null,null,"position: fixed; left: 0; top: 0;");w.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(w.width=w.height=1,e.display.wrapper.appendChild(w),w._top=w.offsetTop),l.dataTransfer.setDragImage(w,0,0),h&&w.parentNode.removeChild(w)}}function Rl(e,l){var w=Nr(e,l);if(!w)return;var x=document.createDocumentFragment();ms(e,w,x),e.display.dragCursor||(e.display.dragCursor=g("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),k(e.display.dragCursor,x)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function no(e){if(!document.getElementsByClassName)return;for(var l=document.getElementsByClassName("CodeMirror"),w=[],x=0;x<l.length;x++){var D=l[x].CodeMirror;D&&w.push(D)}w.length&&w[0].operation(function(){for(var X=0;X<w.length;X++)e(w[X])})}var ao=!1;function Ll(){if(ao)return;Ol(),ao=!0}function Ol(){var e;Ge(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,no(kl)},100))}),Ge(window,"blur",function(){return no(Zr)})}function kl(e){var l=e.display;l.cachedCharWidth=l.cachedTextHeight=l.cachedPaddingH=null,l.scrollbarsClipped=!1,e.setSize()}for(var Lr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Dn=0;Dn<10;Dn++)Lr[Dn+48]=Lr[Dn+96]=String(Dn);for(var ia=65;ia<=90;ia++)Lr[ia]=String.fromCharCode(ia);for(var Mn=1;Mn<=12;Mn++)Lr[Mn+111]=Lr[Mn+63235]="F"+Mn;var dr={};dr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},dr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},dr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},dr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},dr.default=f?dr.macDefault:dr.pcDefault;function Il(e){var l=e.split(/-(?!$)/);e=l[l.length-1];for(var w,x,D,X,Z=0;Z<l.length-1;Z++){var ie=l[Z];if(/^(cmd|meta|m)$/i.test(ie))X=!0;else if(/^a(lt)?$/i.test(ie))w=!0;else if(/^(c|ctrl|control)$/i.test(ie))x=!0;else if(/^s(hift)?$/i.test(ie))D=!0;else throw new Error("Unrecognized modifier name: "+ie)}return w&&(e="Alt-"+e),x&&(e="Ctrl-"+e),X&&(e="Cmd-"+e),D&&(e="Shift-"+e),e}function Dl(e){var l={};for(var w in e)if(e.hasOwnProperty(w)){var x=e[w];if(/^(name|fallthrough|(de|at)tach)$/.test(w))continue;if(x=="..."){delete e[w];continue}for(var D=Ae(w.split(" "),Il),X=0;X<D.length;X++){var Z=void 0,ie=void 0;X==D.length-1?(ie=D.join(" "),Z=x):(ie=D.slice(0,X+1).join(" "),Z="...");var ae=l[ie];if(!ae)l[ie]=Z;else if(ae!=Z)throw new Error("Inconsistent bindings for "+ie)}delete e[w]}for(var he in l)e[he]=l[he];return e}function an(e,l,w,x){l=ra(l);var D=l.call?l.call(e,x):l[e];if(D===!1)return"nothing";if(D==="...")return"multi";if(D!=null&&w(D))return"handled";if(l.fallthrough){if(Object.prototype.toString.call(l.fallthrough)!="[object Array]")return an(e,l.fallthrough,w,x);for(var X=0;X<l.fallthrough.length;X++){var Z=an(e,l.fallthrough[X],w,x);if(Z)return Z}}}function so(e){var l=typeof e=="string"?e:Lr[e.keyCode];return l=="Ctrl"||l=="Alt"||l=="Shift"||l=="Mod"}function oo(e,l,w){var x=e;return l.altKey&&x!="Alt"&&(e="Alt-"+e),(S?l.metaKey:l.ctrlKey)&&x!="Ctrl"&&(e="Ctrl-"+e),(S?l.ctrlKey:l.metaKey)&&x!="Mod"&&(e="Cmd-"+e),!w&&l.shiftKey&&x!="Shift"&&(e="Shift-"+e),e}function lo(e,l){if(h&&e.keyCode==34&&e.char)return!1;var w=Lr[e.keyCode];return w==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(w=e.code),oo(w,e,l))}function ra(e){return typeof e=="string"?dr[e]:e}function sn(e,l){for(var w=e.doc.sel.ranges,x=[],D=0;D<w.length;D++){for(var X=l(w[D]);x.length&&Dt(X.from,ue(x).to)<=0;){var Z=x.pop();if(Dt(Z.from,X.from)<0){X.from=Z.from;break}}x.push(X)}Wi(e,function(){for(var ie=x.length-1;ie>=0;ie--)rn(e.doc,"",x[ie].from,x[ie].to,"+delete");qr(e)})}function Fa(e,l,w){var x=Se(e.text,l+w,w);return x<0||x>e.text.length?null:x}function Ua(e,l,w){var x=Fa(e,l.ch,w);return x==null?null:new ut(l.line,x,w<0?"after":"before")}function Ba(e,l,w,x,D){if(e){l.doc.direction=="rtl"&&(D=-D);var X=Ze(w,l.doc.direction);if(X){var Z=D<0?ue(X):X[0],ie=D<0==(Z.level==1),ae=ie?"after":"before",he;if(Z.level>0||l.doc.direction=="rtl"){var De=Vr(l,w);he=D<0?w.text.length-1:0;var Ue=sr(l,De,he).top;he=Le(function($e){return sr(l,De,$e).top==Ue},D<0==(Z.level==1)?Z.from:Z.to-1,he),ae=="before"&&(he=Fa(w,he,1))}else he=D<0?Z.to:Z.from;return new ut(x,he,ae)}}return new ut(x,D<0?w.text.length:0,D<0?"before":"after")}function Ml(e,l,w,x){var D=Ze(l,e.doc.direction);if(!D)return Ua(l,w,x);w.ch>=l.text.length?(w.ch=l.text.length,w.sticky="before"):w.ch<=0&&(w.ch=0,w.sticky="after");var X=se(D,w.ch,w.sticky),Z=D[X];if(e.doc.direction=="ltr"&&Z.level%2==0&&(x>0?Z.to>w.ch:Z.from<w.ch))return Ua(l,w,x);var ie=function(gt,yt){return Fa(l,gt instanceof ut?gt.ch:gt,yt)},ae,he=function(gt){return e.options.lineWrapping?(ae=ae||Vr(e,l),cs(e,l,ae,gt)):{begin:0,end:l.text.length}},De=he(w.sticky=="before"?ie(w,-1):w.ch);if(e.doc.direction=="rtl"||Z.level==1){var Ue=Z.level==1==x<0,$e=ie(w,Ue?1:-1);if($e!=null&&(Ue?$e<=Z.to&&$e<=De.end:$e>=Z.from&&$e>=De.begin)){var Ye=Ue?"before":"after";return new ut(w.line,$e,Ye)}}var rt=function(gt,yt,vt){for(var Et=function(ti,yi){return yi?new ut(w.line,ie(ti,1),"before"):new ut(w.line,ti,"after")};gt>=0&&gt<D.length;gt+=yt){var It=D[gt],At=yt>0==(It.level!=1),Bt=At?vt.begin:ie(vt.end,-1);if(It.from<=Bt&&Bt<It.to)return Et(Bt,At);if(Bt=At?It.from:ie(It.to,-1),vt.begin<=Bt&&Bt<vt.end)return Et(Bt,At)}},lt=rt(X+x,x,De);if(lt)return lt;var ct=x>0?De.end:ie(De.begin,-1);return ct!=null&&!(x>0&&ct==l.text.length)&&(lt=rt(x>0?0:D.length-1,x,he(ct)),lt)?lt:null}var Pn={selectAll:Gs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return sn(e,function(l){if(l.empty()){var w=xt(e.doc,l.head.line).text.length;return l.head.ch==w&&l.head.line<e.lastLine()?{from:l.head,to:ut(l.head.line+1,0)}:{from:l.head,to:ut(l.head.line,w)}}else return{from:l.from(),to:l.to()}})},deleteLine:function(e){return sn(e,function(l){return{from:ut(l.from().line,0),to:B(e.doc,ut(l.to().line+1,0))}})},delLineLeft:function(e){return sn(e,function(l){return{from:ut(l.from().line,0),to:l.from()}})},delWrappedLineLeft:function(e){return sn(e,function(l){var w=e.charCoords(l.head,"div").top+5,x=e.coordsChar({left:0,top:w},"div");return{from:x,to:l.from()}})},delWrappedLineRight:function(e){return sn(e,function(l){var w=e.charCoords(l.head,"div").top+5,x=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:w},"div");return{from:l.from(),to:x}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ut(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ut(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(l){return uo(e,l.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(l){return ho(e,l.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(l){return Pl(e,l.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(l){var w=e.cursorCoords(l.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:w},"div")},Ke)},goLineLeft:function(e){return e.extendSelectionsBy(function(l){var w=e.cursorCoords(l.head,"div").top+5;return e.coordsChar({left:0,top:w},"div")},Ke)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(l){var w=e.cursorCoords(l.head,"div").top+5,x=e.coordsChar({left:0,top:w},"div");return x.ch<e.getLine(x.line).search(/\S/)?ho(e,l.head):x},Ke)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var l=[],w=e.listSelections(),x=e.options.tabSize,D=0;D<w.length;D++){var X=w[D].from(),Z=z(e.getLine(X.line),X.ch,x);l.push(we(x-Z%x))}e.replaceSelections(l)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wi(e,function(){for(var l=e.listSelections(),w=[],x=0;x<l.length;x++){if(!l[x].empty())continue;var D=l[x].head,X=xt(e.doc,D.line).text;if(X){if(D.ch==X.length&&(D=new ut(D.line,D.ch-1)),D.ch>0)D=new ut(D.line,D.ch+1),e.replaceRange(X.charAt(D.ch-1)+X.charAt(D.ch-2),ut(D.line,D.ch-2),D,"+transpose");else if(D.line>e.doc.first){var Z=xt(e.doc,D.line-1).text;Z&&(D=new ut(D.line,1),e.replaceRange(X.charAt(0)+e.doc.lineSeparator()+Z.charAt(Z.length-1),ut(D.line-1,Z.length-1),D,"+transpose"))}}w.push(new Yt(D,D))}e.setSelections(w)})},newlineAndIndent:function(e){return Wi(e,function(){for(var l=e.listSelections(),w=l.length-1;w>=0;w--)e.replaceRange(e.doc.lineSeparator(),l[w].anchor,l[w].head,"+input");l=e.listSelections();for(var x=0;x<l.length;x++)e.indentLine(l[x].from().line,null,!0);qr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,l){var w=xt(e.doc,l),x=Li(w);return x!=w&&(l=Ut(x)),Ba(!0,e,x,l,1)}function Pl(e,l){var w=xt(e.doc,l),x=Gr(w);return x!=w&&(l=Ut(x)),Ba(!0,e,w,l,-1)}function ho(e,l){var w=uo(e,l.line),x=xt(e.doc,w.line),D=Ze(x,e.doc.direction);if(!D||D[0].level==0){var X=Math.max(w.ch,x.text.search(/\S/)),Z=l.line==w.line&&l.ch<=X&&l.ch;return ut(w.line,Z?0:X,w.sticky)}return w}function na(e,l,w){if(typeof l=="string"&&(l=Pn[l],!l))return!1;e.display.input.ensurePolled();var x=e.display.shift,D=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),w&&(e.display.shift=!1),D=l(e)!=je}finally{e.display.shift=x,e.state.suppressEdits=!1}return D}function Nl(e,l,w){for(var x=0;x<e.state.keyMaps.length;x++){var D=an(l,e.state.keyMaps[x],w,e);if(D)return D}return e.options.extraKeys&&an(l,e.options.extraKeys,w,e)||an(l,e.options.keyMap,w,e)}var Fl=new te;function Nn(e,l,w,x){var D=e.state.keySeq;if(D){if(so(l))return"handled";if(/\'$/.test(l)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==D&&(e.state.keySeq=null,e.display.input.reset())}),co(e,D+" "+l,w,x))return!0}return co(e,l,w,x)}function co(e,l,w,x){var D=Nl(e,l,x);return D=="multi"&&(e.state.keySeq=l),D=="handled"&&Ei(e,"keyHandled",e,l,w),(D=="handled"||D=="multi")&&(ee(w),Ea(e)),!!D}function fo(e,l){var w=lo(l,!0);return w?l.shiftKey&&!e.state.keySeq?Nn(e,"Shift-"+w,l,function(x){return na(e,x,!0)})||Nn(e,w,l,function(x){if(typeof x=="string"?/^go[A-Z]/.test(x):x.motion)return na(e,x)}):Nn(e,w,l,function(x){return na(e,x)}):!1}function Ul(e,l,w){return Nn(e,"'"+w+"'",l,function(x){return na(e,x,!0)})}var Ka=null;function po(e){var l=this;if(e.target&&e.target!=l.display.input.getField())return;if(l.curOp.focus=W(),Fe(l,e))return;E&&b<11&&e.keyCode==27&&(e.returnValue=!1);var w=e.keyCode;l.display.shift=w==16||e.shiftKey;var x=fo(l,e);h&&(Ka=x?w:null,!x&&w==88&&!at&&(f?e.metaKey:e.ctrlKey)&&l.replaceSelection("",null,"cut")),I&&!f&&!x&&w==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),w==18&&!/\bCodeMirror-crosshair\b/.test(l.display.lineDiv.className)&&Bl(l)}function Bl(e){var l=e.display.lineDiv;j(l,"CodeMirror-crosshair");function w(x){(x.keyCode==18||!x.altKey)&&(y(l,"CodeMirror-crosshair"),ce(document,"keyup",w),ce(document,"mouseover",w))}Ge(document,"keyup",w),Ge(document,"mouseover",w)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Fe(this,e)}function go(e){var l=this;if(e.target&&e.target!=l.display.input.getField())return;if(cr(l.display,e)||Fe(l,e)||e.ctrlKey&&!e.altKey||f&&e.metaKey)return;var w=e.keyCode,x=e.charCode;if(h&&w==Ka){Ka=null,ee(e);return}if(h&&(!e.which||e.which<10)&&fo(l,e))return;var D=String.fromCharCode(x==null?w:x);if(D=="\b")return;if(Ul(l,e,D))return;l.display.input.onKeyPress(e)}var Kl=400,Ha=function(e,l,w){this.time=e,this.pos=l,this.button=w};Ha.prototype.compare=function(e,l,w){return this.time+Kl>e&&Dt(l,this.pos)==0&&w==this.button};var Fn,Un;function Hl(e,l){var w=+new Date;return Un&&Un.compare(w,e,l)?(Fn=Un=null,"triple"):Fn&&Fn.compare(w,e,l)?(Un=new Ha(w,e,l),Fn=null,"double"):(Fn=new Ha(w,e,l),Un=null,"single")}function vo(e){var l=this,w=l.display;if(Fe(l,e)||w.activeTouch&&w.input.supportsTouch())return;if(w.input.ensurePolled(),w.shift=e.shiftKey,cr(w,e)){i||(w.scroller.draggable=!1,setTimeout(function(){return w.scroller.draggable=!0},100));return}if(ja(l,e))return;var x=Nr(l,e),D=V(e),X=x?Hl(x,D):"single";if(window.focus(),D==1&&l.state.selectingText&&l.state.selectingText(e),x&&jl(l,D,x,X,e))return;D==1?x?Xl(l,x,X,e):Ie(e)==w.scroller&&ee(e):D==2?(x&&$n(l.doc,x),setTimeout(function(){return w.input.focus()},20)):D==3&&(C?l.display.input.onContextMenu(e):vs(l))}function jl(e,l,w,x,D){var X="Click";return x=="double"?X="Double"+X:x=="triple"&&(X="Triple"+X),X=(l==1?"Left":l==2?"Middle":"Right")+X,Nn(e,oo(X,D),D,function(Z){if(typeof Z=="string"&&(Z=Pn[Z]),!Z)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=Z(e,w)!=je}finally{e.state.suppressEdits=!1}return ie})}function Wl(e,l,w){var x=e.getOption("configureMouse"),D=x?x(e,l,w):{};if(D.unit==null){var X=d?w.shiftKey&&w.metaKey:w.altKey;D.unit=X?"rectangle":l=="single"?"char":l=="double"?"word":"line"}return(D.extend==null||e.doc.extend)&&(D.extend=e.doc.extend||w.shiftKey),D.addNew==null&&(D.addNew=f?w.metaKey:w.ctrlKey),D.moveOnDrag==null&&(D.moveOnDrag=!(f?w.altKey:w.ctrlKey)),D}function Xl(e,l,w,x){E?setTimeout(U(gs,e),0):e.curOp.focus=W();var D=Wl(e,w,x),X=e.doc.sel,Z;e.options.dragDrop&&Re&&!e.isReadOnly()&&w=="single"&&(Z=X.contains(l))>-1&&(Dt((Z=X.ranges[Z]).from(),l)<0||l.xRel>0)&&(Dt(Z.to(),l)>0||l.xRel<0)?zl(e,x,l,D):Gl(e,x,l,D)}function zl(e,l,w,x){var D=e.display,X=!1,Z=vi(e,function(he){i&&(D.scroller.draggable=!1),e.state.draggingText=!1,ce(D.wrapper.ownerDocument,"mouseup",Z),ce(D.wrapper.ownerDocument,"mousemove",ie),ce(D.scroller,"dragstart",ae),ce(D.scroller,"drop",Z),X||(ee(he),x.addNew||$n(e.doc,w,null,null,x.extend),i&&!n||E&&b==9?setTimeout(function(){D.wrapper.ownerDocument.body.focus({preventScroll:!0}),D.input.focus()},20):D.input.focus())}),ie=function(he){X=X||Math.abs(l.clientX-he.clientX)+Math.abs(l.clientY-he.clientY)>=10},ae=function(){return X=!0};i&&(D.scroller.draggable=!0),e.state.draggingText=Z,Z.copy=!x.moveOnDrag,D.scroller.dragDrop&&D.scroller.dragDrop(),Ge(D.wrapper.ownerDocument,"mouseup",Z),Ge(D.wrapper.ownerDocument,"mousemove",ie),Ge(D.scroller,"dragstart",ae),Ge(D.scroller,"drop",Z),vs(e),setTimeout(function(){return D.input.focus()},20)}function _o(e,l,w){if(w=="char")return new Yt(l,l);if(w=="word")return e.findWordAt(l);if(w=="line")return new Yt(ut(l.line,0),B(e.doc,ut(l.line+1,0)));var x=w(e,l);return new Yt(x.from,x.to)}function Gl(e,l,w,x){var D=e.display,X=e.doc;ee(l);var Z,ie,ae=X.sel,he=ae.ranges;if(x.addNew&&!x.extend?(ie=X.sel.contains(w),ie>-1?Z=he[ie]:Z=new Yt(w,w)):(Z=X.sel.primary(),ie=X.sel.primIndex),x.unit=="rectangle")x.addNew||(Z=new Yt(w,w)),w=Nr(e,l,!0,!0),ie=-1;else{var De=_o(e,w,x.unit);x.extend?Z=Pa(Z,De.anchor,De.head,x.extend):Z=De}x.addNew?ie==-1?(ie=he.length,Ai(X,tr(e,he.concat([Z]),ie),{scroll:!1,origin:"*mouse"})):he.length>1&&he[ie].empty()&&x.unit=="char"&&!x.extend?(Ai(X,tr(e,he.slice(0,ie).concat(he.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),ae=X.sel):Na(X,ie,Z,Oe):(ie=0,Ai(X,new Vi([Z],0),Oe),ae=X.sel);var Ue=w;function $e(vt){if(Dt(Ue,vt)==0)return;if(Ue=vt,x.unit=="rectangle"){for(var Et=[],It=e.options.tabSize,At=z(xt(X,w.line).text,w.ch,It),Bt=z(xt(X,vt.line).text,vt.ch,It),ti=Math.min(At,Bt),yi=Math.max(At,Bt),ai=Math.min(w.line,vt.line),Xi=Math.min(e.lastLine(),Math.max(w.line,vt.line));ai<=Xi;ai++){var Fi=xt(X,ai).text,hi=We(Fi,ti,It);ti==yi?Et.push(new Yt(ut(ai,hi),ut(ai,hi))):Fi.length>hi&&Et.push(new Yt(ut(ai,hi),ut(ai,We(Fi,yi,It))))}Et.length||Et.push(new Yt(w,w)),Ai(X,tr(e,ae.ranges.slice(0,ie).concat(Et),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(vt)}else{var Ui=Z,wi=_o(e,vt,x.unit),pi=Ui.anchor,ci;Dt(wi.anchor,pi)>0?(ci=wi.head,pi=vr(Ui.from(),wi.anchor)):(ci=wi.anchor,pi=gr(Ui.to(),wi.head));var si=ae.ranges.slice(0);si[ie]=Vl(e,new Yt(B(X,pi),ci)),Ai(X,tr(e,si,ie),Oe)}}var Ye=D.wrapper.getBoundingClientRect(),rt=0;function lt(vt){var Et=++rt,It=Nr(e,vt,!0,x.unit=="rectangle");if(!It)return;if(Dt(It,Ue)!=0){e.curOp.focus=W(),$e(It);var At=Gn(D,X);(It.line>=At.to||It.line<At.from)&&setTimeout(vi(e,function(){rt==Et&&lt(vt)}),150)}else{var Bt=vt.clientY<Ye.top?-20:vt.clientY>Ye.bottom?20:0;Bt&&setTimeout(vi(e,function(){if(rt!=Et)return;D.scroller.scrollTop+=Bt,lt(vt)}),50)}}function ct(vt){e.state.selectingText=!1,rt=Infinity,vt&&(ee(vt),D.input.focus()),ce(D.wrapper.ownerDocument,"mousemove",gt),ce(D.wrapper.ownerDocument,"mouseup",yt),X.history.lastSelOrigin=null}var gt=vi(e,function(vt){vt.buttons===0||!V(vt)?ct(vt):lt(vt)}),yt=vi(e,ct);e.state.selectingText=yt,Ge(D.wrapper.ownerDocument,"mousemove",gt),Ge(D.wrapper.ownerDocument,"mouseup",yt)}function Vl(e,l){var w=l.anchor,x=l.head,D=xt(e.doc,w.line);if(Dt(w,x)==0&&w.sticky==x.sticky)return l;var X=Ze(D);if(!X)return l;var Z=se(X,w.ch,w.sticky),ie=X[Z];if(ie.from!=w.ch&&ie.to!=w.ch)return l;var ae=Z+(ie.from==w.ch==(ie.level!=1)?0:1);if(ae==0||ae==X.length)return l;var he;if(x.line!=w.line)he=(x.line-w.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var De=se(X,x.ch,x.sticky),Ue=De-Z||(x.ch-w.ch)*(ie.level==1?-1:1);De==ae-1||De==ae?he=Ue<0:he=Ue>0}var $e=X[ae+(he?-1:0)],Ye=he==($e.level==1),rt=Ye?$e.from:$e.to,lt=Ye?"after":"before";return w.ch==rt&&w.sticky==lt?l:new Yt(new ut(w.line,rt,lt),x)}function yo(e,l,w,x){var D,X;if(l.touches)D=l.touches[0].clientX,X=l.touches[0].clientY;else try{D=l.clientX,X=l.clientY}catch($e){return!1}if(D>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;x&&ee(l);var Z=e.display,ie=Z.lineDiv.getBoundingClientRect();if(X>ie.bottom||!_e(e,w))return q(l);X-=ie.top-Z.viewOffset;for(var ae=0;ae<e.display.gutterSpecs.length;++ae){var he=Z.gutters.childNodes[ae];if(he&&he.getBoundingClientRect().right>=D){var De=di(e.doc,X),Ue=e.display.gutterSpecs[ae];return Me(e,w,e,De,Ue.className,l),q(l)}}}function ja(e,l){return yo(e,l,"gutterClick",!0)}function bo(e,l){if(cr(e.display,l)||Yl(e,l))return;if(Fe(e,l,"contextmenu"))return;C||e.display.input.onContextMenu(l)}function Yl(e,l){return _e(e,"gutterContextMenu")?yo(e,l,"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 l=e.optionHandlers;function w(x,D,X,Z){e.defaults[x]=D,X&&(l[x]=Z?function(ie,ae,he){he!=on&&X(ie,ae,he)}:X)}e.defineOption=w,e.Init=on,w("value","",function(x,D){return x.setValue(D)},!0),w("mode",null,function(x,D){x.doc.modeOption=D,Ia(x)},!0),w("indentUnit",2,Ia,!0),w("indentWithTabs",!1),w("smartIndent",!0),w("tabSize",4,function(x){Cn(x),_n(x),Pi(x)},!0),w("lineSeparator",null,function(x,D){if(x.doc.lineSep=D,!D)return;var X=[],Z=x.doc.first;x.doc.iter(function(ae){for(var he=0;;){var De=ae.text.indexOf(D,he);if(De==-1)break;he=De+D.length,X.push(ut(Z,De))}Z++});for(var ie=X.length-1;ie>=0;ie--)rn(x.doc,D,X[ie],ut(X[ie].line,X[ie].ch+D.length))}),w("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(x,D,X){x.state.specialChars=new RegExp(D.source+(D.test(" ")?"":"| "),"g"),X!=on&&x.refresh()}),w("specialCharPlaceholder",ei,function(x){return x.refresh()},!0),w("electricChars",!0),w("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),w("spellcheck",!1,function(x,D){return x.getInputField().spellcheck=D},!0),w("autocorrect",!1,function(x,D){return x.getInputField().autocorrect=D},!0),w("autocapitalize",!1,function(x,D){return x.getInputField().autocapitalize=D},!0),w("rtlMoveVisually",!v),w("wholeLineUpdateBefore",!0),w("theme","default",function(x){xo(x),Tn(x)},!0),w("keyMap","default",function(x,D,X){var Z=ra(D),ie=X!=on&&ra(X);ie&&ie.detach&&ie.detach(x,Z),Z.attach&&Z.attach(x,ie||null)}),w("extraKeys",null),w("configureMouse",null),w("lineWrapping",!1,ql,!0),w("gutters",[],function(x,D){x.display.gutterSpecs=Oa(D,x.options.lineNumbers),Tn(x)},!0),w("fixedGutter",!0,function(x,D){x.display.gutters.style.left=D?ba(x.display)+"px":"0",x.refresh()},!0),w("coverGutterNextToScrollbar",!1,function(x){return $r(x)},!0),w("scrollbarStyle","native",function(x){ws(x),$r(x),x.display.scrollbars.setScrollTop(x.doc.scrollTop),x.display.scrollbars.setScrollLeft(x.doc.scrollLeft)},!0),w("lineNumbers",!1,function(x,D){x.display.gutterSpecs=Oa(x.options.gutters,D),Tn(x)},!0),w("firstLineNumber",1,Tn,!0),w("lineNumberFormatter",function(x){return x},Tn,!0),w("showCursorWhenSelecting",!1,yn,!0),w("resetSelectionOnContextMenu",!0),w("lineWiseCopyCut",!0),w("pasteLinesPerSelection",!0),w("selectionsMayTouch",!1),w("readOnly",!1,function(x,D){D=="nocursor"&&(Zr(x),x.display.input.blur()),x.display.input.readOnlyChanged(D)}),w("screenReaderLabel",null,function(x,D){D=D===""?null:D,x.display.input.screenReaderLabelChanged(D)}),w("disableInput",!1,function(x,D){D||x.display.input.reset()},!0),w("dragDrop",!0,Zl),w("allowDropFileTypes",null),w("cursorBlinkRate",530),w("cursorScrollMargin",0),w("cursorHeight",1,yn,!0),w("singleCursorHeightPerLine",!0,yn,!0),w("workTime",100),w("workDelay",100),w("flattenSpans",!0,Cn,!0),w("addModeClass",!1,Cn,!0),w("pollInterval",100),w("undoDepth",200,function(x,D){return x.doc.history.undoDepth=D}),w("historyEventDelay",1250),w("viewportMargin",10,function(x){return x.refresh()},!0),w("maxHighlightLength",1e4,Cn,!0),w("moveInputWithCursor",!0,function(x,D){D||x.display.input.resetPosition()}),w("tabindex",null,function(x,D){return x.display.input.getField().tabIndex=D||""}),w("autofocus",null),w("direction","ltr",function(x,D){return x.doc.setDirection(D)},!0),w("phrases",null)}function Zl(e,l,w){var x=w&&w!=on;if(!l!=!x){var D=e.display.dragFunctions,X=l?Ge:ce;X(e.display.scroller,"dragstart",D.start),X(e.display.scroller,"dragenter",D.enter),X(e.display.scroller,"dragover",D.over),X(e.display.scroller,"dragleave",D.leave),X(e.display.scroller,"drop",D.drop)}}function ql(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),Kn(e)),xa(e),Pi(e),_n(e),setTimeout(function(){return $r(e)},100)}function ni(e,l){var w=this;if(!(this instanceof ni))return new ni(e,l);this.options=l=l?O(l):{},O(Eo,l,!1);var x=l.value;typeof x=="string"?x=new Ni(x,l.mode,null,l.lineSeparator,l.direction):l.mode&&(x.modeOption=l.mode),this.doc=x;var D=new ni.inputStyles[l.inputStyle](this),X=this.display=new hl(e,x,D,l);X.wrapper.CodeMirror=this,xo(this),l.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},l.autofocus&&!u&&X.input.focus(),E&&b<11&&setTimeout(function(){return w.display.input.reset(!0)},20),$l(this),Ll(),Kr(this),this.curOp.forceUpdate=!0,Ds(this,x),l.autofocus&&!u||this.hasFocus()?setTimeout(function(){w.hasFocus()&&!w.state.focused&&wa(w)},20):Zr(this);for(var Z in aa)aa.hasOwnProperty(Z)&&aa[Z](this,l[Z],on);Cs(this),l.finishInit&&l.finishInit(this);for(var ie=0;ie<Wa.length;++ie)Wa[ie](this);Hr(this),i&&l.lineWrapping&&getComputedStyle(X.lineDiv).textRendering=="optimizelegibility"&&(X.lineDiv.style.textRendering="auto")}ni.defaults=Eo,ni.optionHandlers=aa;function $l(e){var l=e.display;Ge(l.scroller,"mousedown",vi(e,vo)),E&&b<11?Ge(l.scroller,"dblclick",vi(e,function(ae){if(Fe(e,ae))return;var he=Nr(e,ae);if(!he||ja(e,ae)||cr(e.display,ae))return;ee(ae);var De=e.findWordAt(he);$n(e.doc,De.anchor,De.head)})):Ge(l.scroller,"dblclick",function(ae){return Fe(e,ae)||ee(ae)}),Ge(l.scroller,"contextmenu",function(ae){return bo(e,ae)}),Ge(l.input.getField(),"contextmenu",function(ae){l.scroller.contains(ae.target)||bo(e,ae)});var w,x={end:0};function D(){l.activeTouch&&(w=setTimeout(function(){return l.activeTouch=null},1e3),x=l.activeTouch,x.end=+new Date)}function X(ae){if(ae.touches.length!=1)return!1;var he=ae.touches[0];return he.radiusX<=1&&he.radiusY<=1}function Z(ae,he){if(he.left==null)return!0;var De=he.left-ae.left,Ue=he.top-ae.top;return De*De+Ue*Ue>20*20}Ge(l.scroller,"touchstart",function(ae){if(!Fe(e,ae)&&!X(ae)&&!ja(e,ae)){l.input.ensurePolled(),clearTimeout(w);var he=+new Date;l.activeTouch={start:he,moved:!1,prev:he-x.end<=300?x:null},ae.touches.length==1&&(l.activeTouch.left=ae.touches[0].pageX,l.activeTouch.top=ae.touches[0].pageY)}}),Ge(l.scroller,"touchmove",function(){l.activeTouch&&(l.activeTouch.moved=!0)}),Ge(l.scroller,"touchend",function(ae){var he=l.activeTouch;if(he&&!cr(l,ae)&&he.left!=null&&!he.moved&&new Date-he.start<300){var De=e.coordsChar(l.activeTouch,"page"),Ue;!he.prev||Z(he,he.prev)?Ue=new Yt(De,De):!he.prev.prev||Z(he,he.prev.prev)?Ue=e.findWordAt(De):Ue=new Yt(ut(De.line,0),B(e.doc,ut(De.line+1,0))),e.setSelection(Ue.anchor,Ue.head),e.focus(),ee(ae)}D()}),Ge(l.scroller,"touchcancel",D),Ge(l.scroller,"scroll",function(){l.scroller.clientHeight&&(xn(e,l.scroller.scrollTop),Ur(e,l.scroller.scrollLeft,!0),Me(e,"scroll",e))}),Ge(l.scroller,"mousewheel",function(ae){return Ls(e,ae)}),Ge(l.scroller,"DOMMouseScroll",function(ae){return Ls(e,ae)}),Ge(l.wrapper,"scroll",function(){return l.wrapper.scrollTop=l.wrapper.scrollLeft=0}),l.dragFunctions={enter:function(ae){Fe(e,ae)||me(ae)},over:function(ae){Fe(e,ae)||(Rl(e,ae),me(ae))},start:function(ae){return Al(e,ae)},drop:vi(e,Cl),leave:function(ae){Fe(e,ae)||ro(e)}};var ie=l.input.getField();Ge(ie,"keyup",function(ae){return mo.call(e,ae)}),Ge(ie,"keydown",vi(e,po)),Ge(ie,"keypress",vi(e,go)),Ge(ie,"focus",function(ae){return wa(e,ae)}),Ge(ie,"blur",function(ae){return Zr(e,ae)})}var Wa=[];ni.defineInitHook=function(e){return Wa.push(e)};function Bn(e,l,w,x){var D=e.doc,X;w==null&&(w="add"),w=="smart"&&(D.mode.indent?X=ft(e,l).state:w="prev");var Z=e.options.tabSize,ie=xt(D,l),ae=z(ie.text,null,Z);ie.stateAfter&&(ie.stateAfter=null);var he=ie.text.match(/^\s*/)[0],De;if(!x&&!/\S/.test(ie.text))De=0,w="not";else if(w=="smart"&&(De=D.mode.indent(X,ie.text.slice(he.length),ie.text),De==je||De>150)){if(!x)return;w="prev"}w=="prev"?l>D.first?De=z(xt(D,l-1).text,null,Z):De=0:w=="add"?De=ae+e.options.indentUnit:w=="subtract"?De=ae-e.options.indentUnit:typeof w=="number"&&(De=ae+w),De=Math.max(0,De);var Ue="",$e=0;if(e.options.indentWithTabs)for(var Ye=Math.floor(De/Z);Ye;--Ye)$e+=Z,Ue+=" ";if($e<De&&(Ue+=we(De-$e)),Ue!=he)return rn(D,Ue,ut(l,0),ut(l,he.length),"+input"),ie.stateAfter=null,!0;for(var rt=0;rt<D.sel.ranges.length;rt++){var lt=D.sel.ranges[rt];if(lt.head.line==l&&lt.head.ch<he.length){var ct=ut(l,he.length);Na(D,rt,new Yt(ct,ct));break}}}var ir=null;function sa(e){ir=e}function Xa(e,l,w,x,D){var X=e.doc;e.display.shift=!1,x||(x=X.sel);var Z=+new Date-200,ie=D=="paste"||e.state.pasteIncoming>Z,ae=ot(l),he=null;if(ie&&x.ranges.length>1)if(ir&&ir.text.join(`
`)==l){if(x.ranges.length%ir.text.length==0){he=[];for(var De=0;De<ir.text.length;De++)he.push(X.splitLines(ir.text[De]))}}else ae.length==x.ranges.length&&e.options.pasteLinesPerSelection&&(he=Ae(ae,function(gt){return[gt]}));for(var Ue=e.curOp.updateInput,$e=x.ranges.length-1;$e>=0;$e--){var Ye=x.ranges[$e],rt=Ye.from(),lt=Ye.to();Ye.empty()&&(w&&w>0?rt=ut(rt.line,rt.ch-w):e.state.overwrite&&!ie?lt=ut(lt.line,Math.min(xt(X,lt.line).text.length,lt.ch+ue(ae).length)):ie&&ir&&ir.lineWise&&ir.text.join(`
`)==ae.join(`
`)&&(rt=lt=ut(rt.line,0)));var ct={from:rt,to:lt,text:he?he[$e%he.length]:ae,origin:D||(ie?"paste":e.state.cutIncoming>Z?"cut":"+input")};tn(e.doc,ct),Ei(e,"inputRead",e,ct)}l&&!ie&&So(e,l),qr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ue),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function wo(e,l){var w=e.clipboardData&&e.clipboardData.getData("Text");if(w)return e.preventDefault(),!l.isReadOnly()&&!l.options.disableInput&&Wi(l,function(){return Xa(l,w,0,null,"paste")}),!0}function So(e,l){if(!e.options.electricChars||!e.options.smartIndent)return;for(var w=e.doc.sel,x=w.ranges.length-1;x>=0;x--){var D=w.ranges[x];if(D.head.ch>100||x&&w.ranges[x-1].head.line==D.head.line)continue;var X=e.getModeAt(D.head),Z=!1;if(X.electricChars){for(var ie=0;ie<X.electricChars.length;ie++)if(l.indexOf(X.electricChars.charAt(ie))>-1){Z=Bn(e,D.head.line,"smart");break}}else X.electricInput&&(X.electricInput.test(xt(e.doc,D.head.line).text.slice(0,D.head.ch))&&(Z=Bn(e,D.head.line,"smart")));Z&&Ei(e,"electricInput",e,D.head.line)}}function To(e){for(var l=[],w=[],x=0;x<e.doc.sel.ranges.length;x++){var D=e.doc.sel.ranges[x].head.line,X={anchor:ut(D,0),head:ut(D+1,0)};w.push(X),l.push(e.getRange(X.anchor,X.head))}return{text:l,ranges:w}}function Co(e,l,w,x){e.setAttribute("autocorrect",w?"":"off"),e.setAttribute("autocapitalize",x?"":"off"),e.setAttribute("spellcheck",!!l)}function Ao(){var e=g("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),l=g("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return i?e.style.width="1000px":e.setAttribute("wrap","off"),r&&(e.style.border="1px solid black"),Co(e),l}function Jl(e){var l=e.optionHandlers,w=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(x,D){var X=this.options,Z=X[x];if(X[x]==D&&x!="mode")return;X[x]=D,l.hasOwnProperty(x)&&vi(this,l[x])(this,D,Z),Me(this,"optionChange",this,x)},getOption:function(x){return this.options[x]},getDoc:function(){return this.doc},addKeyMap:function(x,D){this.state.keyMaps[D?"push":"unshift"](ra(x))},removeKeyMap:function(x){for(var D=this.state.keyMaps,X=0;X<D.length;++X)if(D[X]==x||D[X].name==x)return D.splice(X,1),!0},addOverlay:Oi(function(x,D){var X=x.token?x:e.getMode(this.options,x);if(X.startState)throw new Error("Overlays may not be stateful.");ge(this.state.overlays,{mode:X,modeSpec:x,opaque:D&&D.opaque,priority:D&&D.priority||0},function(Z){return Z.priority}),this.state.modeGen++,Pi(this)}),removeOverlay:Oi(function(x){for(var D=this.state.overlays,X=0;X<D.length;++X){var Z=D[X].modeSpec;if(Z==x||typeof x=="string"&&Z.name==x){D.splice(X,1),this.state.modeGen++,Pi(this);return}}}),indentLine:Oi(function(x,D,X){typeof D!="string"&&typeof D!="number"&&(D==null?D=this.options.smartIndent?"smart":"prev":D=D?"add":"subtract"),Ii(this.doc,x)&&Bn(this,x,D,X)}),indentSelection:Oi(function(x){for(var D=this.doc.sel.ranges,X=-1,Z=0;Z<D.length;Z++){var ie=D[Z];if(ie.empty())ie.head.line>X&&(Bn(this,ie.head.line,x,!0),X=ie.head.line,Z==this.doc.sel.primIndex&&qr(this));else{var ae=ie.from(),he=ie.to(),De=Math.max(X,ae.line);X=Math.min(this.lastLine(),he.line-(he.ch?0:1))+1;for(var Ue=De;Ue<X;++Ue)Bn(this,Ue,x);var $e=this.doc.sel.ranges;ae.ch==0&&D.length==$e.length&&$e[Z].from().ch>0&&Na(this.doc,Z,new Yt(ae,$e[Z].to()),Ne)}}}),getTokenAt:function(x,D){return ii(this,x,D)},getLineTokens:function(x,D){return ii(this,ut(x),D,!0)},getTokenTypeAt:function(x){x=B(this.doc,x);var D=nt(this,xt(this.doc,x.line)),X=0,Z=(D.length-1)/2,ie=x.ch,ae;if(ie==0)ae=D[2];else for(;;){var he=X+Z>>1;if((he?D[he*2-1]:0)>=ie)Z=he;else if(D[he*2+1]<ie)X=he+1;else{ae=D[he*2+2];break}}var De=ae?ae.indexOf("overlay "):-1;return De<0?ae:De==0?null:ae.slice(0,De-1)},getModeAt:function(x){var D=this.doc.mode;return D.innerMode?e.innerMode(D,this.getTokenAt(x).state).mode:D},getHelper:function(x,D){return this.getHelpers(x,D)[0]},getHelpers:function(x,D){var X=[];if(!w.hasOwnProperty(D))return X;var Z=w[D],ie=this.getModeAt(x);if(typeof ie[D]=="string")Z[ie[D]]&&X.push(Z[ie[D]]);else if(ie[D])for(var ae=0;ae<ie[D].length;ae++){var he=Z[ie[D][ae]];he&&X.push(he)}else ie.helperType&&Z[ie.helperType]?X.push(Z[ie.helperType]):Z[ie.name]&&X.push(Z[ie.name]);for(var De=0;De<Z._global.length;De++){var Ue=Z._global[De];Ue.pred(ie,this)&&de(X,Ue.val)==-1&&X.push(Ue.val)}return X},getStateAfter:function(x,D){var X=this.doc;return x=J(X,x==null?X.first+X.size-1:x),ft(this,x+1,D).state},cursorCoords:function(x,D){var X,Z=this.doc.sel.primary();return x==null?X=Z.head:typeof x=="object"?X=B(this.doc,x):X=x?Z.from():Z.to(),er(this,X,D||"page")},charCoords:function(x,D){return ma(this,B(this.doc,x),D||"page")},coordsChar:function(x,D){return x=ls(this,x,D||"page"),va(this,x.left,x.top)},lineAtHeight:function(x,D){return x=ls(this,{top:x,left:0},D||"page").top,di(this.doc,x+this.display.viewOffset)},heightAtLine:function(x,D,X){var Z=!1,ie;if(typeof x=="number"){var ae=this.doc.first+this.doc.size-1;x<this.doc.first?x=this.doc.first:x>ae&&(x=ae,Z=!0),ie=xt(this.doc,x)}else ie=x;return jn(this,ie,{top:0,left:0},D||"page",X||Z).top+(Z?this.doc.height-Ji(ie):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(x,D,X,Z,ie){var ae=this.display;x=er(this,B(this.doc,x));var he=x.bottom,De=x.left;if(D.style.position="absolute",D.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(D),ae.sizer.appendChild(D),Z=="over")he=x.top;else if(Z=="above"||Z=="near"){var Ue=Math.max(ae.wrapper.clientHeight,this.doc.height),$e=Math.max(ae.sizer.clientWidth,ae.lineSpace.clientWidth);(Z=="above"||x.bottom+D.offsetHeight>Ue)&&x.top>D.offsetHeight?he=x.top-D.offsetHeight:x.bottom+D.offsetHeight<=Ue&&(he=x.bottom),De+D.offsetWidth>$e&&(De=$e-D.offsetWidth)}D.style.top=he+"px",D.style.left=D.style.right="",ie=="right"?(De=ae.sizer.clientWidth-D.offsetWidth,D.style.right="0px"):(ie=="left"?De=0:ie=="middle"&&(De=(ae.sizer.clientWidth-D.offsetWidth)/2),D.style.left=De+"px"),X&&Zo(this,{left:De,top:he,right:De+D.offsetWidth,bottom:he+D.offsetHeight})},triggerOnKeyDown:Oi(po),triggerOnKeyPress:Oi(go),triggerOnKeyUp:mo,triggerOnMouseDown:Oi(vo),execCommand:function(x){if(Pn.hasOwnProperty(x))return Pn[x].call(null,this)},triggerElectric:Oi(function(x){So(this,x)}),findPosH:function(x,D,X,Z){var ie=1;D<0&&(ie=-1,D=-D);for(var ae=B(this.doc,x),he=0;he<D&&!(ae=za(this.doc,ae,ie,X,Z),ae.hitSide);++he);return ae},moveH:Oi(function(x,D){var X=this;this.extendSelectionsBy(function(Z){return X.display.shift||X.doc.extend||Z.empty()?za(X.doc,Z.head,x,D,X.options.rtlMoveVisually):x<0?Z.from():Z.to()},Ke)}),deleteH:Oi(function(x,D){var X=this.doc.sel,Z=this.doc;X.somethingSelected()?Z.replaceSelection("",null,"+delete"):sn(this,function(ie){var ae=za(Z,ie.head,x,D,!1);return x<0?{from:ae,to:ie.head}:{from:ie.head,to:ae}})}),findPosV:function(x,D,X,Z){var ie=1,ae=Z;D<0&&(ie=-1,D=-D);for(var he=B(this.doc,x),De=0;De<D;++De){var Ue=er(this,he,"div");if(ae==null?ae=Ue.left:Ue.left=ae,he=Ro(this,Ue,ie,X),he.hitSide)break}return he},moveV:Oi(function(x,D){var X=this,Z=this.doc,ie=[],ae=!this.display.shift&&!Z.extend&&Z.sel.somethingSelected();if(Z.extendSelectionsBy(function(De){if(ae)return x<0?De.from():De.to();var Ue=er(X,De.head,"div");De.goalColumn!=null&&(Ue.left=De.goalColumn),ie.push(Ue.left);var $e=Ro(X,Ue,x,D);return D=="page"&&De==Z.sel.primary()&&Ta(X,ma(X,$e,"div").top-Ue.top),$e},Ke),ie.length)for(var he=0;he<Z.sel.ranges.length;he++)Z.sel.ranges[he].goalColumn=ie[he]}),findWordAt:function(x){var D=this.doc,X=xt(D,x.line).text,Z=x.ch,ie=x.ch;if(X){var ae=this.getHelper(x,"wordChars");(x.sticky=="before"||ie==X.length)&&Z?--Z:++ie;for(var he=X.charAt(Z),De=Je(he,ae)?function(Ue){return Je(Ue,ae)}:/\s/.test(he)?function(Ue){return/\s/.test(Ue)}:function(Ue){return!/\s/.test(Ue)&&!Je(Ue)};Z>0&&De(X.charAt(Z-1));)--Z;for(;ie<X.length&&De(X.charAt(ie));)++ie}return new Yt(ut(x.line,Z),ut(x.line,ie))},toggleOverwrite:function(x){if(x!=null&&x==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):y(this.display.cursorDiv,"CodeMirror-overwrite"),Me(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Oi(function(x,D){bn(this,x,D)}),getScrollInfo:function(){var x=this.display.scroller;return{left:x.scrollLeft,top:x.scrollTop,height:x.scrollHeight-ar(this)-this.display.barHeight,width:x.scrollWidth-ar(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Mr(this)}},scrollIntoView:Oi(function(x,D){x==null?(x={from:this.doc.sel.primary().head,to:null},D==null&&(D=this.options.cursorScrollMargin)):typeof x=="number"?x={from:ut(x,0),to:null}:x.from==null&&(x={from:x,to:null}),x.to||(x.to=x.from),x.margin=D||0,x.from.line!=null?qo(this,x):ys(this,x.from,x.to,x.margin)}),setSize:Oi(function(x,D){var X=this,Z=function(ae){return typeof ae=="number"||/^\d+$/.test(String(ae))?ae+"px":ae};x!=null&&(this.display.wrapper.style.width=Z(x)),D!=null&&(this.display.wrapper.style.height=Z(D)),this.options.lineWrapping&&as(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(ae){if(ae.widgets){for(var he=0;he<ae.widgets.length;he++)if(ae.widgets[he].noHScroll){wr(X,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,Me(this,"refresh",this)}),operation:function(x){return Wi(this,x)},startOperation:function(){return Kr(this)},endOperation:function(){return Hr(this)},refresh:Oi(function(){var x=this.display.cachedTextHeight;Pi(this),this.curOp.forceUpdate=!0,_n(this),bn(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(x==null||Math.abs(x-Yr(this.display))>.5||this.options.lineWrapping)&&xa(this),Me(this,"refresh",this)}),swapDoc:Oi(function(x){var D=this.doc;return D.cm=null,this.state.selectingText&&this.state.selectingText(),Ds(this,x),_n(this),this.display.input.reset(),bn(this,x.scrollLeft,x.scrollTop),this.curOp.forceScroll=!0,Ei(this,"swapDoc",this,D),D}),phrase:function(x){var D=this.options.phrases;return D&&Object.prototype.hasOwnProperty.call(D,x)?D[x]:x},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}},Ee(e),e.registerHelper=function(x,D,X){w.hasOwnProperty(x)||(w[x]=e[x]={_global:[]}),w[x][D]=X},e.registerGlobalHelper=function(x,D,X,Z){e.registerHelper(x,D,Z),w[x]._global.push({pred:X,val:Z})}}function za(e,l,w,x,D){var X=l,Z=w,ie=xt(e,l.line),ae=D&&e.direction=="rtl"?-w:w;function he(){var yt=l.line+ae;return yt<e.first||yt>=e.first+e.size?!1:(l=new ut(yt,l.ch,l.sticky),ie=xt(e,yt))}function De(yt){var vt;if(x=="codepoint"){var Et=ie.text.charCodeAt(l.ch+(x>0?0:-1));isNaN(Et)?vt=null:vt=new ut(l.line,Math.max(0,Math.min(ie.text.length,l.ch+w*(Et>=55296&&Et<56320?2:1))),-w)}else D?vt=Ml(e.cm,ie,l,w):vt=Ua(ie,l,w);if(vt==null)if(!yt&&he())l=Ba(D,e.cm,ie,l.line,ae);else return!1;else l=vt;return!0}if(x=="char"||x=="codepoint")De();else if(x=="column")De(!0);else if(x=="word"||x=="group")for(var Ue=null,$e=x=="group",Ye=e.cm&&e.cm.getHelper(l,"wordChars"),rt=!0;!(w<0&&!De(!rt));rt=!1){var lt=ie.text.charAt(l.ch)||`
`,ct=Je(lt,Ye)?"w":$e&&lt==`
`?"n":!$e||/\s/.test(lt)?null:"p";if($e&&!rt&&!ct&&(ct="s"),Ue&&Ue!=ct){w<0&&(w=1,De(),l.sticky="after");break}if(ct&&(Ue=ct),w>0&&!De(!rt))break}var gt=ea(e,l,X,Z,!0);return pr(X,gt)&&(gt.hitSide=!0),gt}function Ro(e,l,w,x){var D=e.doc,X=l.left,Z;if(x=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ae=Math.max(ie-.5*Yr(e.display),3);Z=(w>0?l.bottom:l.top)+w*ae}else x=="line"&&(Z=w>0?l.bottom+3:l.top-3);for(var he;!(he=va(e,X,Z),!he.outside);){if(w<0?Z<=0:Z>=D.height){he.hitSide=!0;break}Z+=w*5}return he}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 l=this,w=this,x=w.cm,D=w.div=e.lineDiv;Co(D,x.options.spellcheck,x.options.autocorrect,x.options.autocapitalize);function X(ie){for(var ae=ie.target;ae;ae=ae.parentNode){if(ae==D)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ae.className))break}return!1}Ge(D,"paste",function(ie){if(!X(ie)||Fe(x,ie)||wo(ie,x))return;b<=11&&setTimeout(vi(x,function(){return l.updateFromDOM()}),20)}),Ge(D,"compositionstart",function(ie){l.composing={data:ie.data,done:!1}}),Ge(D,"compositionupdate",function(ie){l.composing||(l.composing={data:ie.data,done:!1})}),Ge(D,"compositionend",function(ie){l.composing&&(ie.data!=l.composing.data&&l.readFromDOMSoon(),l.composing.done=!0)}),Ge(D,"touchstart",function(){return w.forceCompositionEnd()}),Ge(D,"input",function(){l.composing||l.readFromDOMSoon()});function Z(ie){if(!X(ie)||Fe(x,ie))return;if(x.somethingSelected())sa({lineWise:!1,text:x.getSelections()}),ie.type=="cut"&&x.replaceSelection("",null,"cut");else if(x.options.lineWiseCopyCut){var ae=To(x);sa({lineWise:!0,text:ae.text}),ie.type=="cut"&&x.operation(function(){x.setSelections(ae.ranges,0,Ne),x.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var he=ir.text.join(`
`);if(ie.clipboardData.setData("Text",he),ie.clipboardData.getData("Text")==he){ie.preventDefault();return}}var De=Ao(),Ue=De.firstChild;x.display.lineSpace.insertBefore(De,x.display.lineSpace.firstChild),Ue.value=ir.text.join(`
`);var $e=document.activeElement;K(Ue),setTimeout(function(){x.display.lineSpace.removeChild(De),$e.focus(),$e==D&&w.showPrimarySelection()},50)}Ge(D,"copy",Z),Ge(D,"cut",Z)},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,l){if(!e||!this.cm.display.view.length)return;(e.focus||l)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),l=this.cm,w=l.doc.sel.primary(),x=w.from(),D=w.to();if(l.display.viewTo==l.display.viewFrom||x.line>=l.display.viewTo||D.line<l.display.viewFrom){e.removeAllRanges();return}var X=oa(l,e.anchorNode,e.anchorOffset),Z=oa(l,e.focusNode,e.focusOffset);if(X&&!X.bad&&Z&&!Z.bad&&Dt(vr(X,Z),x)==0&&Dt(gr(X,Z),D)==0)return;var ie=l.display.view,ae=x.line>=l.display.viewFrom&&Lo(l,x)||{node:ie[0].measure.map[2],offset:0},he=D.line<l.display.viewTo&&Lo(l,D);if(!he){var De=ie[ie.length-1].measure,Ue=De.maps?De.maps[De.maps.length-1]:De.map;he={node:Ue[Ue.length-1],offset:Ue[Ue.length-2]-Ue[Ue.length-3]}}if(!ae||!he){e.removeAllRanges();return}var $e=e.rangeCount&&e.getRangeAt(0),Ye;try{Ye=P(ae.node,ae.offset,he.offset,he.node)}catch(rt){}Ye&&(!I&&l.state.focused?(e.collapse(ae.node,ae.offset),Ye.collapsed||(e.removeAllRanges(),e.addRange(Ye))):(e.removeAllRanges(),e.addRange(Ye)),$e&&e.anchorNode==null?e.addRange($e):I&&this.startGracePeriod()),this.rememberSelection()},Zt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Zt.prototype.showMultipleSelections=function(e){k(this.cm.display.cursorDiv,e.cursors),k(this.cm.display.selectionDiv,e.selection)},Zt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Zt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var l=e.getRangeAt(0).commonAncestorContainer;return N(this.div,l)},Zt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Zt.prototype.blur=function(){this.div.blur()},Zt.prototype.getField=function(){return this.div},Zt.prototype.supportsTouch=function(){return!0},Zt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function l(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,l))}this.polling.set(this.cm.options.pollInterval,l)},Zt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Zt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),l=this.cm;if(s&&o&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var w=oa(l,e.anchorNode,e.anchorOffset),x=oa(l,e.focusNode,e.focusOffset);w&&x&&Wi(l,function(){Ai(l.doc,Tr(w,x),Ne),(w.bad||x.bad)&&(l.curOp.selectionChanged=!0)})},Zt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,l=e.display,w=e.doc.sel.primary(),x=w.from(),D=w.to();if(x.ch==0&&x.line>e.firstLine()&&(x=ut(x.line-1,xt(e.doc,x.line-1).length)),D.ch==xt(e.doc,D.line).text.length&&D.line<e.lastLine()&&(D=ut(D.line+1,0)),x.line<l.viewFrom||D.line>l.viewTo-1)return!1;var X,Z,ie;x.line==l.viewFrom||(X=Fr(e,x.line))==0?(Z=Ut(l.view[0].line),ie=l.view[0].node):(Z=Ut(l.view[X].line),ie=l.view[X-1].node.nextSibling);var ae=Fr(e,D.line),he,De;if(ae==l.view.length-1?(he=l.viewTo-1,De=l.lineDiv.lastChild):(he=Ut(l.view[ae+1].line)-1,De=l.view[ae+1].node.previousSibling),!ie)return!1;for(var Ue=e.doc.splitLines(tu(e,ie,De,Z,he)),$e=Ki(e.doc,ut(Z,0),ut(he,xt(e.doc,he).text.length));Ue.length>1&&$e.length>1;)if(ue(Ue)==ue($e))Ue.pop(),$e.pop(),he--;else if(Ue[0]==$e[0])Ue.shift(),$e.shift(),Z++;else break;for(var Ye=0,rt=0,lt=Ue[0],ct=$e[0],gt=Math.min(lt.length,ct.length);Ye<gt&&lt.charCodeAt(Ye)==ct.charCodeAt(Ye);)++Ye;for(var yt=ue(Ue),vt=ue($e),Et=Math.min(yt.length-(Ue.length==1?Ye:0),vt.length-($e.length==1?Ye:0));rt<Et&&yt.charCodeAt(yt.length-rt-1)==vt.charCodeAt(vt.length-rt-1);)++rt;if(Ue.length==1&&$e.length==1&&Z==x.line)for(;Ye&&Ye>x.ch&&yt.charCodeAt(yt.length-rt-1)==vt.charCodeAt(vt.length-rt-1);)Ye--,rt++;Ue[Ue.length-1]=yt.slice(0,yt.length-rt).replace(/^\u200b+/,""),Ue[0]=Ue[0].slice(Ye).replace(/\u200b+$/,"");var It=ut(Z,Ye),At=ut(he,$e.length?ue($e).length-rt:0);if(Ue.length>1||Ue[0]||Dt(It,At))return rn(e.doc,Ue,It,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())&&Wi(this.cm,function(){return Pi(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()||vi(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,l){var w=fa(e,l.line);if(!w||w.hidden)return null;var x=xt(e.doc,l.line),D=es(w,x,l.line),X=Ze(x,e.doc.direction),Z="left";if(X){var ie=se(X,l.ch);Z=ie%2?"right":"left"}var ae=rs(D.map,l.ch,Z);return ae.offset=ae.collapse=="right"?ae.end:ae.start,ae}function eu(e){for(var l=e;l;l=l.parentNode)if(/CodeMirror-gutter-wrapper/.test(l.className))return!0;return!1}function ln(e,l){return l&&(e.bad=!0),e}function tu(e,l,w,x,D){var X="",Z=!1,ie=e.doc.lineSeparator(),ae=!1;function he(Ye){return function(rt){return rt.id==Ye}}function De(){Z&&(X+=ie,ae&&(X+=ie),Z=ae=!1)}function Ue(Ye){Ye&&(De(),X+=Ye)}function $e(Ye){if(Ye.nodeType==1){var rt=Ye.getAttribute("cm-text");if(rt){Ue(rt);return}var lt=Ye.getAttribute("cm-marker"),ct;if(lt){var gt=e.findMarks(ut(x,0),ut(D+1,0),he(+lt));gt.length&&(ct=gt[0].find(0))&&Ue(Ki(e.doc,ct.from,ct.to).join(ie));return}if(Ye.getAttribute("contenteditable")=="false")return;var yt=/^(pre|div|p|li|table|br)$/i.test(Ye.nodeName);if(!/^br$/i.test(Ye.nodeName)&&Ye.textContent.length==0)return;yt&&De();for(var vt=0;vt<Ye.childNodes.length;vt++)$e(Ye.childNodes[vt]);/^(pre|p)$/i.test(Ye.nodeName)&&(ae=!0),yt&&(Z=!0)}else Ye.nodeType==3&&Ue(Ye.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!($e(l),l==w);)l=l.nextSibling,ae=!1;return X}function oa(e,l,w){var x;if(l==e.display.lineDiv){if(x=e.display.lineDiv.childNodes[w],!x)return ln(e.clipPos(ut(e.display.viewTo-1)),!0);l=null,w=0}else for(x=l;;x=x.parentNode){if(!x||x==e.display.lineDiv)return null;if(x.parentNode&&x.parentNode==e.display.lineDiv)break}for(var D=0;D<e.display.view.length;D++){var X=e.display.view[D];if(X.node==x)return iu(X,l,w)}}function iu(e,l,w){var x=e.text.firstChild,D=!1;if(!l||!N(x,l))return ln(ut(Ut(e.line),0),!0);if(l==x&&(D=!0,l=x.childNodes[w],w=0,!l)){var X=e.rest?ue(e.rest):e.line;return ln(ut(Ut(X),X.text.length),D)}var Z=l.nodeType==3?l:null,ie=l;for(!Z&&l.childNodes.length==1&&l.firstChild.nodeType==3&&(Z=l.firstChild,w&&(w=Z.nodeValue.length));ie.parentNode!=x;)ie=ie.parentNode;var ae=e.measure,he=ae.maps;function De(ct,gt,yt){for(var vt=-1;vt<(he?he.length:0);vt++)for(var Et=vt<0?ae.map:he[vt],It=0;It<Et.length;It+=3){var At=Et[It+2];if(At==ct||At==gt){var Bt=Ut(vt<0?e.line:e.rest[vt]),ti=Et[It]+yt;return(yt<0||At!=ct)&&(ti=Et[It+(yt?1:0)]),ut(Bt,ti)}}}var Ue=De(Z,ie,w);if(Ue)return ln(Ue,D);for(var $e=ie.nextSibling,Ye=Z?Z.nodeValue.length-w:0;$e;$e=$e.nextSibling){if(Ue=De($e,$e.firstChild,0),Ue)return ln(ut(Ue.line,Ue.ch-Ye),D);Ye+=$e.textContent.length}for(var rt=ie.previousSibling,lt=w;rt;rt=rt.previousSibling){if(Ue=De(rt,rt.firstChild,-1),Ue)return ln(ut(Ue.line,Ue.ch+lt),D);lt+=rt.textContent.length}}var li=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};li.prototype.init=function(e){var l=this,w=this,x=this.cm;this.createField(e);var D=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),r&&(D.style.width="0px"),Ge(D,"input",function(){E&&b>=9&&l.hasSelection&&(l.hasSelection=null),w.poll()}),Ge(D,"paste",function(Z){if(Fe(x,Z)||wo(Z,x))return;x.state.pasteIncoming=+new Date,w.fastPoll()});function X(Z){if(Fe(x,Z))return;if(x.somethingSelected())sa({lineWise:!1,text:x.getSelections()});else if(x.options.lineWiseCopyCut){var ie=To(x);sa({lineWise:!0,text:ie.text}),Z.type=="cut"?x.setSelections(ie.ranges,null,Ne):(w.prevInput="",D.value=ie.text.join(`
`),K(D))}else return;Z.type=="cut"&&(x.state.cutIncoming=+new Date)}Ge(D,"cut",X),Ge(D,"copy",X),Ge(e.scroller,"paste",function(Z){if(cr(e,Z)||Fe(x,Z))return;if(!D.dispatchEvent){x.state.pasteIncoming=+new Date,w.focus();return}var ie=new Event("paste");ie.clipboardData=Z.clipboardData,D.dispatchEvent(ie)}),Ge(e.lineSpace,"selectstart",function(Z){cr(e,Z)||ee(Z)}),Ge(D,"compositionstart",function(){var Z=x.getCursor("from");w.composing&&w.composing.range.clear(),w.composing={start:Z,range:x.markText(Z,x.getCursor("to"),{className:"CodeMirror-composing"})}}),Ge(D,"compositionend",function(){w.composing&&(w.poll(),w.composing.range.clear(),w.composing=null)})},li.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},li.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},li.prototype.prepareSelection=function(){var e=this.cm,l=e.display,w=e.doc,x=ps(e);if(e.options.moveInputWithCursor){var D=er(e,w.sel.primary().head,"div"),X=l.wrapper.getBoundingClientRect(),Z=l.lineDiv.getBoundingClientRect();x.teTop=Math.max(0,Math.min(l.wrapper.clientHeight-10,D.top+Z.top-X.top)),x.teLeft=Math.max(0,Math.min(l.wrapper.clientWidth-10,D.left+Z.left-X.left))}return x},li.prototype.showSelection=function(e){var l=this.cm,w=l.display;k(w.cursorDiv,e.cursors),k(w.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},li.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var l=this.cm;if(l.somethingSelected()){this.prevInput="";var w=l.getSelection();this.textarea.value=w,l.state.focused&&K(this.textarea),E&&b>=9&&(this.hasSelection=w)}else e||(this.prevInput=this.textarea.value="",E&&b>=9&&(this.hasSelection=null))},li.prototype.getField=function(){return this.textarea},li.prototype.supportsTouch=function(){return!1},li.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},li.prototype.blur=function(){this.textarea.blur()},li.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},li.prototype.receivedFocus=function(){this.slowPoll()},li.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()})},li.prototype.fastPoll=function(){var e=!1,l=this;l.pollingFast=!0;function w(){var x=l.poll();!x&&!e?(e=!0,l.polling.set(60,w)):(l.pollingFast=!1,l.slowPoll())}l.polling.set(20,w)},li.prototype.poll=function(){var e=this,l=this.cm,w=this.textarea,x=this.prevInput;if(this.contextMenuPending||!l.state.focused||tt(w)&&!x&&!this.composing||l.isReadOnly()||l.options.disableInput||l.state.keySeq)return!1;var D=w.value;if(D==x&&!l.somethingSelected())return!1;if(E&&b>=9&&this.hasSelection===D||f&&/[\uf700-\uf7ff]/.test(D))return l.display.input.reset(),!1;if(l.doc.sel==l.display.selForContextMenu){var X=D.charCodeAt(0);if(X==8203&&!x&&(x="\u200B"),X==8666)return this.reset(),this.cm.execCommand("undo")}for(var Z=0,ie=Math.min(x.length,D.length);Z<ie&&x.charCodeAt(Z)==D.charCodeAt(Z);)++Z;return Wi(l,function(){Xa(l,D.slice(Z),x.length-Z,null,e.composing?"*compose":null),D.length>1e3||D.indexOf(`
`)>-1?w.value=e.prevInput="":e.prevInput=D,e.composing&&(e.composing.range.clear(),e.composing.range=l.markText(e.composing.start,l.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},li.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},li.prototype.onKeyPress=function(){E&&b>=9&&(this.hasSelection=null),this.fastPoll()},li.prototype.onContextMenu=function(e){var l=this,w=l.cm,x=w.display,D=l.textarea;l.contextMenuPending&&l.contextMenuPending();var X=Nr(w,e),Z=x.scroller.scrollTop;if(!X||h)return;var ie=w.options.resetSelectionOnContextMenu;ie&&w.doc.sel.contains(X)==-1&&vi(w,Ai)(w.doc,Tr(X),Ne);var ae=D.style.cssText,he=l.wrapper.style.cssText,De=l.wrapper.offsetParent.getBoundingClientRect();l.wrapper.style.cssText="position: static",D.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-De.top-5)+"px; left: "+(e.clientX-De.left-5)+`px;
z-index: 1000; background: `+(E?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ue;i&&(Ue=window.scrollY),x.input.focus(),i&&window.scrollTo(null,Ue),x.input.reset(),w.somethingSelected()||(D.value=l.prevInput=" "),l.contextMenuPending=Ye,x.selForContextMenu=w.doc.sel,clearTimeout(x.detectingSelectAll);function $e(){if(D.selectionStart!=null){var lt=w.somethingSelected(),ct="\u200B"+(lt?D.value:"");D.value="\u21DA",D.value=ct,l.prevInput=lt?"":"\u200B",D.selectionStart=1,D.selectionEnd=ct.length,x.selForContextMenu=w.doc.sel}}function Ye(){if(l.contextMenuPending!=Ye)return;if(l.contextMenuPending=!1,l.wrapper.style.cssText=he,D.style.cssText=ae,E&&b<9&&x.scrollbars.setScrollTop(x.scroller.scrollTop=Z),D.selectionStart!=null){(!E||E&&b<9)&&$e();var lt=0,ct=function(){x.selForContextMenu==w.doc.sel&&D.selectionStart==0&&D.selectionEnd>0&&l.prevInput=="\u200B"?vi(w,Gs)(w):lt++<10?x.detectingSelectAll=setTimeout(ct,500):(x.selForContextMenu=null,x.input.reset())};x.detectingSelectAll=setTimeout(ct,200)}}if(E&&b>=9&&$e(),C){me(e);var rt=function(){ce(window,"mouseup",rt),setTimeout(Ye,20)};Ge(window,"mouseup",rt)}else setTimeout(Ye,50)},li.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},li.prototype.setUneditable=function(){},li.prototype.needsContentAttribute=!1;function ru(e,l){if(l=l?O(l):{},l.value=e.value,!l.tabindex&&e.tabIndex&&(l.tabindex=e.tabIndex),!l.placeholder&&e.placeholder&&(l.placeholder=e.placeholder),l.autofocus==null){var w=W();l.autofocus=w==e||e.getAttribute("autofocus")!=null&&w==document.body}function x(){e.value=ie.getValue()}var D;if(e.form&&(Ge(e.form,"submit",x),!l.leaveSubmitMethodAlone)){var X=e.form;D=X.submit;try{var Z=X.submit=function(){x(),X.submit=D,X.submit(),X.submit=Z}}catch(ae){}}l.finishInit=function(ae){ae.save=x,ae.getTextArea=function(){return e},ae.toTextArea=function(){ae.toTextArea=isNaN,x(),e.parentNode.removeChild(ae.getWrapperElement()),e.style.display="",e.form&&(ce(e.form,"submit",x),!l.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=D))}},e.style.display="none";var ie=ni(function(ae){return e.parentNode.insertBefore(ae,e.nextSibling)},l);return ie}function nu(e){e.off=ce,e.on=Ge,e.wheelEventPixels=cl,e.Doc=Ni,e.splitLines=ot,e.countColumn=z,e.findColumn=We,e.isWordChar=qe,e.Pass=je,e.signal=Me,e.Line=Dr,e.changeEnd=Cr,e.scrollbarModel=Es,e.Pos=ut,e.cmpPos=Dt,e.modes=bt,e.mimeModes=dt,e.resolveMode=mt,e.getMode=$t,e.modeExtensions=wt,e.extendMode=_t,e.copyState=Ot,e.startState=qt,e.innerMode=Nt,e.commands=Pn,e.keyMap=dr,e.keyName=lo,e.isModifierKey=so,e.lookupKey=an,e.normalizeKeyMap=Dl,e.StringStream=Pt,e.SharedTextMarker=In,e.TextMarker=Rr,e.LineWidget=kn,e.e_preventDefault=ee,e.e_stopPropagation=oe,e.e_stop=me,e.addClass=j,e.contains=N,e.rmClass=y,e.keyNames=Lr}Ql(ni),Jl(ni);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Ni.prototype)Ni.prototype.hasOwnProperty(la)&&de(au,la)<0&&(ni.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ni.prototype[la]));return Ee(Ni),ni.inputStyles={textarea:li,contenteditable:Zt},ni.defineMode=function(e){!ni.defaults.mode&&e!="null"&&(ni.defaults.mode=e),kt.apply(this,arguments)},ni.defineMIME=Ft,ni.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ni.defineMIME("text/plain","null"),ni.defineExtension=function(e,l){ni.prototype[e]=l},ni.defineDocExtension=function(e,l){Ni.prototype[e]=l},ni.fromTextArea=ru,nu(ni),ni.version="5.58.2",ni})},Y1PL:function(it,re,Q){"use strict";Q.r(re),Q.d(re,"ResizableTextArea",function(){return de});var G=Q("wx14"),R=Q("1OyB"),I=Q("vuIU"),L=Q("Ji7U"),M=Q("LK+K"),p=Q("q1tI"),E=Q("VTBJ"),b=Q("rePB"),i=Q("Zm9Q"),c=Q("Kwbf"),o=Q("c+Xe"),h=Q("m+aA"),n=Q("bdgK"),a=new Map;function t(Ne){Ne.forEach(function(Oe){var Ke,We=Oe.target;(Ke=a.get(We))===null||Ke===void 0||Ke.forEach(function(Te){return Te(We)})})}var r=new n.default(t),s=null,u=null;function f(Ne,Oe){a.has(Ne)||(a.set(Ne,new Set),r.observe(Ne)),a.get(Ne).add(Oe)}function d(Ne,Oe){a.has(Ne)&&(a.get(Ne).delete(Oe),a.get(Ne).size||(r.unobserve(Ne),a.delete(Ne)))}var v=function(Ne){Object(L.a)(Ke,Ne);var Oe=Object(M.a)(Ke);function Ke(){return Object(R.a)(this,Ke),Oe.apply(this,arguments)}return Object(I.a)(Ke,[{key:"render",value:function(){return this.props.children}}]),Ke}(p.Component),m=p.createContext(null);function S(Ne){var Oe=Ne.children,Ke=Ne.onBatchResize,We=p.useRef(0),Te=p.useRef([]),we=p.useContext(m),ue=p.useCallback(function(Ae,ge,Ve){We.current+=1;var Qe=We.current;Te.current.push({size:Ae,element:ge,data:Ve}),Promise.resolve().then(function(){Qe===We.current&&(Ke==null||Ke(Te.current),Te.current=[])}),we==null||we(Ae,ge,Ve)},[Ke,we]);return p.createElement(m.Provider,{value:ue},Oe)}function C(Ne){var Oe=Ne.children,Ke=Ne.disabled,We=p.useRef(null),Te=p.useRef(null),we=p.useContext(m),ue=p.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ae=p.isValidElement(Oe)&&Object(o.c)(Oe),ge=Ae?Oe.ref:null,Ve=p.useMemo(function(){return Object(o.a)(ge,We)},[ge,We]),Qe=p.useRef(Ne);Qe.current=Ne;var ze=p.useCallback(function(qe){var Je=Qe.current,pe=Je.onResize,ve=Je.data,xe=qe.getBoundingClientRect(),Se=xe.width,Le=xe.height,ne=qe.offsetWidth,ye=qe.offsetHeight,se=Math.floor(Se),Pe=Math.floor(Le);if(ue.current.width!==se||ue.current.height!==Pe||ue.current.offsetWidth!==ne||ue.current.offsetHeight!==ye){var Ze={width:se,height:Pe,offsetWidth:ne,offsetHeight:ye};ue.current=Ze;var et=ne===Math.round(Se)?Se:ne,Ge=ye===Math.round(Le)?Le:ye,ht=Object(E.a)(Object(E.a)({},Ze),{},{offsetWidth:et,offsetHeight:Ge});we==null||we(ht,qe,ve),pe&&Promise.resolve().then(function(){pe(ht,qe)})}},[]);return p.useEffect(function(){var qe=Object(h.a)(We.current)||Object(h.a)(Te.current);return qe&&!Ke&&f(qe,ze),function(){return d(qe,ze)}},[We.current,Ke]),p.createElement(v,{ref:Te},Ae?p.cloneElement(Oe,{ref:Ve}):Oe)}var _="rc-observer-key";function y(Ne){var Oe=Ne.children,Ke=Object(i.a)(Oe);return Ke.map(function(We,Te){var we=(We==null?void 0:We.key)||"".concat(_,"-").concat(Te);return p.createElement(C,Object(G.a)({},Ne,{key:we}),We)})}y.Collection=S;var T=y,k=Q("bT9E"),g=Q("TSYQ"),F=Q.n(g),P=`
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
`,N=["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"],W={},j;function A(Ne){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=Ne.getAttribute("id")||Ne.getAttribute("data-reactid")||Ne.getAttribute("name");if(Oe&&W[Ke])return W[Ke];var We=window.getComputedStyle(Ne),Te=We.getPropertyValue("box-sizing")||We.getPropertyValue("-moz-box-sizing")||We.getPropertyValue("-webkit-box-sizing"),we=parseFloat(We.getPropertyValue("padding-bottom"))+parseFloat(We.getPropertyValue("padding-top")),ue=parseFloat(We.getPropertyValue("border-bottom-width"))+parseFloat(We.getPropertyValue("border-top-width")),Ae=N.map(function(Ve){return"".concat(Ve,":").concat(We.getPropertyValue(Ve))}).join(";"),ge={sizingStyle:Ae,paddingSize:we,borderSize:ue,boxSizing:Te};return Oe&&Ke&&(W[Ke]=ge),ge}function K(Ne){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,We=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),Ne.getAttribute("wrap")?j.setAttribute("wrap",Ne.getAttribute("wrap")):j.removeAttribute("wrap");var Te=A(Ne,Oe),we=Te.paddingSize,ue=Te.borderSize,Ae=Te.boxSizing,ge=Te.sizingStyle;j.setAttribute("style","".concat(ge,";").concat(P)),j.value=Ne.value||Ne.placeholder||"";var Ve=Number.MIN_SAFE_INTEGER,Qe=Number.MAX_SAFE_INTEGER,ze=j.scrollHeight,qe;if(Ae==="border-box"?ze+=ue:Ae==="content-box"&&(ze-=we),Ke!==null||We!==null){j.value=" ";var Je=j.scrollHeight-we;Ke!==null&&(Ve=Je*Ke,Ae==="border-box"&&(Ve=Ve+we+ue),ze=Math.max(Ve,ze)),We!==null&&(Qe=Je*We,Ae==="border-box"&&(Qe=Qe+we+ue),qe=ze>Qe?"":"hidden",ze=Math.min(Qe,ze))}return{height:ze,minHeight:Ve,maxHeight:Qe,overflowY:qe,resize:"none"}}var U=Q("Gytx"),O=Q.n(U),z;(function(Ne){Ne[Ne.NONE=0]="NONE",Ne[Ne.RESIZING=1]="RESIZING",Ne[Ne.RESIZED=2]="RESIZED"})(z||(z={}));var te=function(Ne){Object(L.a)(Ke,Ne);var Oe=Object(M.a)(Ke);function Ke(We){var Te;return Object(R.a)(this,Ke),Te=Oe.call(this,We),Te.nextFrameActionId=void 0,Te.resizeFrameId=void 0,Te.textArea=void 0,Te.saveTextArea=function(we){Te.textArea=we},Te.handleResize=function(we){var ue=Te.state.resizeStatus,Ae=Te.props,ge=Ae.autoSize,Ve=Ae.onResize;if(ue!==z.NONE)return;typeof Ve=="function"&&Ve(we),ge&&Te.resizeOnNextFrame()},Te.resizeOnNextFrame=function(){cancelAnimationFrame(Te.nextFrameActionId),Te.nextFrameActionId=requestAnimationFrame(Te.resizeTextarea)},Te.resizeTextarea=function(){var we=Te.props.autoSize;if(!we||!Te.textArea)return;var ue=we.minRows,Ae=we.maxRows,ge=K(Te.textArea,!1,ue,Ae);Te.setState({textareaStyles:ge,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(Te.resizeFrameId),Te.resizeFrameId=requestAnimationFrame(function(){Te.setState({resizeStatus:z.RESIZED},function(){Te.resizeFrameId=requestAnimationFrame(function(){Te.setState({resizeStatus:z.NONE}),Te.fixFirefoxAutoScroll()})})})})},Te.renderTextArea=function(){var we=Te.props,ue=we.prefixCls,Ae=ue===void 0?"rc-textarea":ue,ge=we.autoSize,Ve=we.onResize,Qe=we.className,ze=we.disabled,qe=Te.state,Je=qe.textareaStyles,pe=qe.resizeStatus,ve=Object(k.a)(Te.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=F()(Ae,Qe,Object(b.a)({},"".concat(Ae,"-disabled"),ze));"value"in ve&&(ve.value=ve.value||"");var Se=Object(E.a)(Object(E.a)(Object(E.a)({},Te.props.style),Je),pe===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return p.createElement(T,{onResize:Te.handleResize,disabled:!(ge||Ve)},p.createElement("textarea",Object(G.a)({},ve,{className:xe,style:Se,ref:Te.saveTextArea})))},Te.state={textareaStyles:{},resizeStatus:z.NONE},Te}return Object(I.a)(Ke,[{key:"componentDidUpdate",value:function(Te){(Te.value!==this.props.value||!O()(Te.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var Te=this.textArea.selectionStart,we=this.textArea.selectionEnd;this.textArea.setSelectionRange(Te,we)}}catch(ue){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ke}(p.Component),de=te,be=function(Ne){Object(L.a)(Ke,Ne);var Oe=Object(M.a)(Ke);function Ke(We){var Te;Object(R.a)(this,Ke),Te=Oe.call(this,We),Te.resizableTextArea=void 0,Te.focus=function(){Te.resizableTextArea.textArea.focus()},Te.saveTextArea=function(ue){Te.resizableTextArea=ue},Te.handleChange=function(ue){var Ae=Te.props.onChange;Te.setValue(ue.target.value,function(){Te.resizableTextArea.resizeTextarea()}),Ae&&Ae(ue)},Te.handleKeyDown=function(ue){var Ae=Te.props,ge=Ae.onPressEnter,Ve=Ae.onKeyDown;ue.keyCode===13&&ge&&ge(ue),Ve&&Ve(ue)};var we=typeof We.value=="undefined"||We.value===null?We.defaultValue:We.value;return Te.state={value:we},Te}return Object(I.a)(Ke,[{key:"setValue",value:function(Te,we){"value"in this.props||this.setState({value:Te},we)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return p.createElement(de,Object(G.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Te){return"value"in Te?{value:Te.value}:null}}]),Ke}(p.Component),je=re.default=be},YJ9k:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function R(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&R(M.prototype,p),E&&R(M,E),M}var L=function(){function M(){G(this,M),this._listeners=new Map}return I(M,[{key:"addEventListener",value:function(E,b){this._listeners.has(E)||this._listeners.set(E,new Set),this._listeners.get(E).add(b)}},{key:"removeEventListener",value:function(E,b){this._listeners.has(E)&&this._listeners.get(E).delete(b)}},{key:"dispatchEvent",value:function(E){var b=this;return this._listeners.has(E.type)?(this._listeners.get(E.type).forEach(function(i){return i.call(b,E)}),!E.defaultPrevented):!0}}]),M}();re.default=L},ZW9T:function(it,re,Q){"use strict";Q.d(re,"a",function(){return U});var G=Q("k1fw"),R=Q("oBTY"),I=Q("miYZ"),L=Q("tsqr"),M=Q("rAM+"),p=Q("tJVT"),E=Q("PpiC"),b=Q("q1tI"),i=Q.n(b),c=Q("bdgK"),o=Q("9og8"),h=Q("WmNS"),n=Q.n(h),a={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},t={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},r={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},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(`
`)}]},u=Q("5VLF"),f=Q.n(u),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"]}},v=function(z,te){return te.map(function(de){return{label:de,kind:z.languages.CompletionItemKind.Keyword,insertText:de}})},m=function(z){return Object.keys(d.tables).map(function(te){return{label:te,kind:z.languages.CompletionItemKind.Variable,insertText:te}})},S=function(z,te){var de=d.tables[z];return de?de.map(function(be){return{label:be,kind:te.languages.CompletionItemKind.Field,insertText:be}}):[]};function C(O,z,te,de,be){var je=z.getWordUntilPosition(te),Ne={startLineNumber:te.lineNumber,endLineNumber:te.lineNumber,startColumn:je.startColumn,endColumn:je.endColumn},Oe=de.map(function(Ke){return{label:Ke,kind:O.languages.CompletionItemKind.Keyword,insertText:Ke,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne}});return be.map(function(Ke){Oe.push(Object(G.a)(Object(G.a)({},Ke),{},{range:Ne}))}),Oe}var _=function(O){d.languages.map(function(be){return O.languages.registerDocumentFormattingEditProvider(be,{provideDocumentFormattingEdits:function(Ne,Oe,Ke){return Object(o.a)(n.a.mark(function We(){var Te;return n.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return Te=f()(Ne.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}),ue.abrupt("return",[{range:Ne.getFullModelRange(),text:Te}]);case 2:case"end":return ue.stop()}},We)}))()}}),be});var z=r.quickKey.map(function(be){return{label:be.label,kind:O.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=s.quickKey.map(function(be){return{label:be.label,kind:O.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),de=t.quickKey.map(function(be){return{label:be.label,kind:O.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(je,Ne){var Oe=je.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},We=je.getLineContent(Ne.lineNumber).substring(Oe.startColumn-2,Oe.endColumn);return{suggestions:[].concat(Object(R.a)(r.keywords.map(function(Te){return{label:Te,kind:O.languages.CompletionItemKind.Function,documentation:Te,insertText:Te,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})),Object(R.a)(r.quickKey.map(function(Te){return{label:Te.label,kind:O.languages.CompletionItemKind.Function,documentation:Te.content,insertText:We.startsWith("#")?Te.content.replace(/#/,""):Te.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(je,Ne){var Oe=je.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn};return{suggestions:Object(R.a)(a.keywords.map(function(We){return{label:We,kind:O.languages.CompletionItemKind.Function,documentation:We,insertText:We,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(je,Ne){var Oe=je.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},We=je.getLineContent(Ne.lineNumber).substring(Oe.startColumn-2,Oe.endColumn);return{suggestions:[].concat(Object(R.a)(t.keywords.map(function(Te){return{label:Te,kind:O.languages.CompletionItemKind.Function,documentation:Te,insertText:Te,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})),Object(R.a)(t.quickKey.map(function(Te){return{label:Te.label,kind:O.languages.CompletionItemKind.Function,documentation:Te.content,insertText:We.startsWith("#")?Te.content.replace(/#/,""):Te.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(je,Ne){var Oe=je.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},We=je.getLineContent(Ne.lineNumber).substring(Oe.startColumn-2,Oe.endColumn);return{suggestions:[].concat(Object(R.a)(s.keywords.map(function(Te){return{label:Te,kind:O.languages.CompletionItemKind.Function,documentation:Te,insertText:Te,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})),Object(R.a)(s.quickKey.map(function(Te){return{label:Te.label,kind:O.languages.CompletionItemKind.Function,documentation:Te.content,insertText:We.startsWith("#")?Te.content.replace(/#/,""):Te.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})))}}})},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=Q("fjLI"),k=Q("LvDl"),g=Q("+ua5");function F(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function P(){}var N=!1,W={"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 O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],z=O;if(Array.isArray(O)){for(var te=0;te<O.length;te++){var de=W[O[te]];if(de)return de}return z[0]}return W[z]||z}var A=null,K=re.b=function(O){var z=O.width,te=z===void 0?"100%":z,de=O.height,be=de===void 0?"100%":de,je=O.value,Ne=O.language,Oe=Ne===void 0?"javascript":Ne,Ke=O.style,We=Ke===void 0?{}:Ke,Te=O.options,we=Te===void 0?{}:Te,ue=O.overrideServices,Ae=ue===void 0?{}:ue,ge=O.theme,Ve=ge===void 0?"vs-dark":ge,Qe=O.onEditBlur,ze=O.onSave,qe=O.autoHeight,Je=qe===void 0?!1:qe,pe=O.forbidCopy,ve=pe===void 0?!1:pe,xe=O.onChange,Se=xe===void 0?P:xe,Le=O.editorDidMount,ne=Le===void 0?P:Le,ye=O.onFocus,se=ye===void 0?P:ye,Pe=O.filename,Ze=Pe===void 0?"educoder.txt":Pe,et=O.errorLine,Ge=O.errorContent,ht=Ge===void 0?"":Ge,ce=Object(E.a)(O,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Me=Object(b.useRef)(),Fe=Object(b.useRef)({}),Ce=Object(b.useRef)(),_e=Object(b.useRef)(),Ee=Object(b.useRef)(!1),ee=Object(b.useRef)(),oe=Object(b.useState)(!1),q=Object(p.a)(oe,2),me=q[0],Ie=q[1];function V(){var wt;return Me.current&&(wt=new c.default(function(_t){var Ot=Object(M.a)(_t),Nt;try{for(Ot.s();!(Nt=Ot.n()).done;){var qt=Nt.value;(qt.target.offsetHeight>0||qt.target.offsetWidth>0)&&Fe.current.instance.layout()}}catch(Pt){Ot.e(Pt)}finally{Ot.f()}}),wt.observe(Me.current)),wt}function Re(){L.b.warn(decodeURIComponent(y))}var He=function(){var _t=Fe.current.instance;if(je!=null&&_t&&me){var Ot=_t.getModel();Ot&&je!==Ot.getValue()&&(N=!0,Ot.setValue(je),_t.layout(),N=!1)}};Object(b.useEffect)(function(){_e.current&&clearTimeout(_e.current),_e.current=setTimeout(function(){He()},500)},[je,me,Fe.current]),Object(b.useEffect)(function(){if(et&&Fe.current&&Fe.current.instance){var wt=Fe.current.instance;wt.changeViewZones(function(Ot){var Nt=document.createElement("div");Nt.style.padding="10px 20px",Nt.style.width="calc(100% - 20px)",Nt.className="my-error-line-wrp",Nt.innerHTML=ht,Ot.addZone({afterLineNumber:et||11,heightInLines:3,domNode:Nt})});var _t={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};wt.addOverlayWidget(_t),wt.revealPositionInCenter({lineNumber:20,column:1})}},[et,Fe.current,me]);function fe(){var wt=Fe.current.instance;if(wt){var _t=wt.getSelection(),Ot=Fe.current.pastePos||{},Nt=new A.Range(Ot.startLineNumber||_t.endLineNumber,Ot.startColumn||_t.endColumn,Ot.endLineNumber||_t.endLineNumber,Ot.endColumn||_t.endColumn);setTimeout(function(){wt.executeEdits("",[{range:Nt,text:""}])},300)}}function ke(wt){(window.navigator.platform.match("Mac")?wt.metaKey:wt.ctrlKey)&&wt.keyCode==83&&(wt.preventDefault(),ze())}var Xe=function(){if(Je&&Fe.current.instance){var _t=Fe.current.instance.getContentHeight();mt(_t<be?be:_t)}else mt(be)};function ot(wt){var _t=document.createEvent("MouseEvents");_t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),wt.dispatchEvent(_t)}function tt(wt,_t){var Ot=window.URL||window.webkitURL||window,Nt=new Blob([_t]),qt=document.createElementNS("http://www.w3.org/1999/xhtml","a");qt.href=Ot.createObjectURL(Nt),qt.download=wt,ot(qt)}Object(b.useEffect)(function(){Xe()},[Xe]),Object(b.useEffect)(function(){Me.current&&!me&&Promise.all([Q.e(16),Q.e(28)]).then(Q.t.bind(null,"M/lh",7)).then(function(wt){try{A=wt,Fe.current.instance=A.editor.create(Me.current,{value:je,language:j(Oe),theme:Ve,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ae);var _t=Fe.current.instance,Ot=T.d._menuItems,Nt=Object(R.a)(Ot).find(function(Jt){return Jt[0]._debugName=="EditorContext"}),qt=Nt[1],Pt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],xt=function(ri,Ut){var di=ri._first;do{var Ii,Yi,ut=Ut.includes((Ii=di.element)===null||Ii===void 0||((Yi=Ii.command)===null||Yi===void 0)?void 0:Yi.id);ut&&ri._remove(di)}while(di=di.next)};if(ne(_t,A),setTimeout(function(){Xe(),Fe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){tt(Ze||"educoder.txt",_t.getValue())}}),_t.getDomNode().addEventListener("input",function(){Ce.current.autoFormat&&_t.getAction("editor.action.formatDocument").run()})},500),Fe.current.subscription=_t.onDidChangeModelContent(function(Jt){Ee.current?clearTimeout(ee.current):(Xe(),Se(_t.getValue(),Jt)),ee.current=setTimeout(function(){Ee.current=!1},500)}),window.Monaco||_(A,j(Oe)),ve&&(xt(qt,Pt),Me.current.classList.add("noCopyPaste"),_t.onKeyDown(function(Jt){var ri=Jt.keyCode,Ut=Jt.ctrlKey,di=Jt.metaKey;(ri===33||ri===52)&&(di||Ut)&&(Re(),Jt.preventDefault())})),window.Monaco=A,Qe&&_t.onDidBlurEditorWidget(function(){Qe(_t.getValue())}),se&&_t.onDidFocusEditorText(function(){se(_t.getValue())}),ve){_t.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Re(),null}),_t.onDidPaste(function(Jt){Fe.current.pastePos=Jt});try{window.addEventListener("paste",fe)}catch(Jt){}}var Ki=V();return Ie(!0),function(){var Jt=Fe.current.instance;Jt.dispose();var ri=Jt.getModel();ri&&ri.dispose(),Fe.current.subscription&&Fe.current.subscription.dispose(),ve&&window.removeEventListener("paste",fe),Ki.unobserve(Me.current)}}catch(Jt){}})},[]),Object(b.useEffect)(function(){var wt=Fe.current.instance;if(wt&&me)return document.addEventListener("keydown",ke,!1),function(){document.removeEventListener("keydown",ke)}},[ze,me]),Object(b.useEffect)(function(){var wt=Fe.current.instance;if(wt&&me){var _t=j(Oe);A.editor.setModelLanguage(wt.getModel(),_t),console.log("language:",Oe,wt.getModel(),_t)}},[Oe,me]),Object(b.useEffect)(function(){var wt=Fe.current.instance;wt&&me&&A.editor.setTheme(Ve)},[Ve,me]),Object(b.useEffect)(function(){var wt=Fe.current.instance;Ce.current=we,wt&&me&&(wt.updateOptions(Object(G.a)({},we)),setTimeout(function(){wt.getModel().updateOptions(Object(G.a)({},we))},200))},[JSON.stringify(we),me]),Object(b.useEffect)(function(){var wt=Fe.current.instance;wt&&me&&wt.layout()},[te,be,me]);var at=Object(b.useState)(F(te)),pt=Object(p.a)(at,2),Ct=pt[0],bt=pt[1],dt=Object(b.useState)(F(be)),kt=Object(p.a)(dt,2),Ft=kt[0],mt=kt[1],$t=Object(G.a)(Object(G.a)({},We),{},{width:Ct,height:Ft});return i.a.createElement("div",{className:"my-monaco-editor",ref:Me,style:$t})};function U(O){var z=O.width,te=z===void 0?"100%":z,de=O.height,be=de===void 0?"100%":de,je=O.original,Ne=O.modified,Oe=O.language,Ke=O.options,We=Ke===void 0?{}:Ke,Te=Object(b.useRef)(),we=Object(b.useState)(null),ue=Object(p.a)(we,2),Ae=ue[0],ge=ue[1];function Ve(Je){var pe;return Te.current&&(pe=new c.default(function(ve){var xe=Object(M.a)(ve),Se;try{for(xe.s();!(Se=xe.n()).done;){var Le=Se.value;(Le.target.offsetHeight>0||Le.target.offsetWidth>0)&&Je.layout()}}catch(ne){xe.e(ne)}finally{xe.f()}}),pe.observe(Te.current)),pe}Object(b.useEffect)(function(){Te.current&&Promise.all([Q.e(16),Q.e(28)]).then(Q.t.bind(null,"M/lh",7)).then(function(Je){A=Je;var pe=A.editor.createDiffEditor(Te.current,Object(G.a)(Object(G.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},We),{},{wordWrap:!0}));ge(pe);var ve=Ve(pe);return function(){pe.dispose();var xe=pe.getModel();xe&&xe.dispose(),ve.unobserve(Te.current)}})},[]),Object(b.useEffect)(function(){Ae&&Ae.setModel({original:A.editor.createModel(je,Oe),modified:A.editor.createModel(Ne,Oe)})},[je,Ne,Oe,Ae]);var Qe=F(te),ze=F(be),qe={width:Qe,height:ze};return i.a.createElement("div",{className:"my-diff-editor",ref:Te,style:qe})}},ZpRC:function(it,re,Q){"use strict";function G(o){return typeof o=="object"&&o!=null&&o.nodeType===1}function R(o,h){return(!h||o!=="hidden")&&o!=="visible"&&o!=="clip"}function I(o,h){if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){var n=getComputedStyle(o,null);return R(n.overflowY,h)||R(n.overflowX,h)||function(a){var t=function(r){if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch(s){return null}}(a);return!!t&&(t.clientHeight<a.scrollHeight||t.clientWidth<a.scrollWidth)}(o)}return!1}function L(o,h,n,a,t,r,s,u){return r<o&&s>h||r>o&&s<h?0:r<=o&&u<=n||s>=h&&u>=n?r-o-a:s>h&&u<n||r<o&&u>n?s-h+t:0}var M=function(o,h){var n=window,a=h.scrollMode,t=h.block,r=h.inline,s=h.boundary,u=h.skipOverflowHiddenElements,f=typeof s=="function"?s:function(Je){return Je!==s};if(!G(o))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,v=[],m=o;G(m)&&f(m);){if((m=m.parentElement)===d){v.push(m);break}m!=null&&m===document.body&&I(m)&&!I(document.documentElement)||m!=null&&I(m,u)&&v.push(m)}for(var S=n.visualViewport?n.visualViewport.width:innerWidth,C=n.visualViewport?n.visualViewport.height:innerHeight,_=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,T=o.getBoundingClientRect(),k=T.height,g=T.width,F=T.top,P=T.right,N=T.bottom,W=T.left,j=t==="start"||t==="nearest"?F:t==="end"?N:F+k/2,A=r==="center"?W+g/2:r==="end"?P:W,K=[],U=0;U<v.length;U++){var O=v[U],z=O.getBoundingClientRect(),te=z.height,de=z.width,be=z.top,je=z.right,Ne=z.bottom,Oe=z.left;if(a==="if-needed"&&F>=0&&W>=0&&N<=C&&P<=S&&F>=be&&N<=Ne&&W>=Oe&&P<=je)return K;var Ke=getComputedStyle(O),We=parseInt(Ke.borderLeftWidth,10),Te=parseInt(Ke.borderTopWidth,10),we=parseInt(Ke.borderRightWidth,10),ue=parseInt(Ke.borderBottomWidth,10),Ae=0,ge=0,Ve="offsetWidth"in O?O.offsetWidth-O.clientWidth-We-we:0,Qe="offsetHeight"in O?O.offsetHeight-O.clientHeight-Te-ue:0;if(d===O)Ae=t==="start"?j:t==="end"?j-C:t==="nearest"?L(y,y+C,C,Te,ue,y+j,y+j+k,k):j-C/2,ge=r==="start"?A:r==="center"?A-S/2:r==="end"?A-S:L(_,_+S,S,We,we,_+A,_+A+g,g),Ae=Math.max(0,Ae+y),ge=Math.max(0,ge+_);else{Ae=t==="start"?j-be-Te:t==="end"?j-Ne+ue+Qe:t==="nearest"?L(be,Ne,te,Te,ue+Qe,j,j+k,k):j-(be+te/2)+Qe/2,ge=r==="start"?A-Oe-We:r==="center"?A-(Oe+de/2)+Ve/2:r==="end"?A-je+we+Ve:L(Oe,je,de,We,we+Ve,A,A+g,g);var ze=O.scrollLeft,qe=O.scrollTop;j+=qe-(Ae=Math.max(0,Math.min(qe+Ae,O.scrollHeight-te+Qe))),A+=ze-(ge=Math.max(0,Math.min(ze+ge,O.scrollWidth-de+Ve)))}K.push({el:O,top:Ae,left:ge})}return K};function p(o){return o===Object(o)&&Object.keys(o).length!==0}function E(o,h){h===void 0&&(h="auto");var n="scrollBehavior"in document.body.style;o.forEach(function(a){var t=a.el,r=a.top,s=a.left;t.scroll&&n?t.scroll({top:r,left:s,behavior:h}):(t.scrollTop=r,t.scrollLeft=s)})}function b(o){return o===!1?{block:"end",inline:"nearest"}:p(o)?o:{block:"start",inline:"nearest"}}function i(o,h){var n=!o.ownerDocument.documentElement.contains(o);if(p(h)&&typeof h.behavior=="function")return h.behavior(n?[]:M(o,h));if(n)return;var a=b(h);return E(M(o,a),a.behavior)}var c=re.a=i},Zss7:function(it,re,Q){var G;(function(R){var I=/^\s+/,L=/\s+$/,M=0,p=R.round,E=R.min,b=R.max,i=R.random;function c(ue,Ae){if(ue=ue||"",Ae=Ae||{},ue instanceof c)return ue;if(!(this instanceof c))return new c(ue,Ae);var ge=o(ue);this._originalInput=ue,this._r=ge.r,this._g=ge.g,this._b=ge.b,this._a=ge.a,this._roundA=p(100*this._a)/100,this._format=Ae.format||ge.format,this._gradientType=Ae.gradientType,this._r<1&&(this._r=p(this._r)),this._g<1&&(this._g=p(this._g)),this._b<1&&(this._b=p(this._b)),this._ok=ge.ok,this._tc_id=M++}c.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 ue=this.toRgb();return(ue.r*299+ue.g*587+ue.b*114)/1e3},getLuminance:function(){var ue=this.toRgb(),Ae,ge,Ve,Qe,ze,qe;return Ae=ue.r/255,ge=ue.g/255,Ve=ue.b/255,Ae<=.03928?Qe=Ae/12.92:Qe=R.pow((Ae+.055)/1.055,2.4),ge<=.03928?ze=ge/12.92:ze=R.pow((ge+.055)/1.055,2.4),Ve<=.03928?qe=Ve/12.92:qe=R.pow((Ve+.055)/1.055,2.4),.2126*Qe+.7152*ze+.0722*qe},setAlpha:function(ue){return this._a=K(ue),this._roundA=p(100*this._a)/100,this},toHsv:function(){var ue=t(this._r,this._g,this._b);return{h:ue.h*360,s:ue.s,v:ue.v,a:this._a}},toHsvString:function(){var ue=t(this._r,this._g,this._b),Ae=p(ue.h*360),ge=p(ue.s*100),Ve=p(ue.v*100);return this._a==1?"hsv("+Ae+", "+ge+"%, "+Ve+"%)":"hsva("+Ae+", "+ge+"%, "+Ve+"%, "+this._roundA+")"},toHsl:function(){var ue=n(this._r,this._g,this._b);return{h:ue.h*360,s:ue.s,l:ue.l,a:this._a}},toHslString:function(){var ue=n(this._r,this._g,this._b),Ae=p(ue.h*360),ge=p(ue.s*100),Ve=p(ue.l*100);return this._a==1?"hsl("+Ae+", "+ge+"%, "+Ve+"%)":"hsla("+Ae+", "+ge+"%, "+Ve+"%, "+this._roundA+")"},toHex:function(ue){return s(this._r,this._g,this._b,ue)},toHexString:function(ue){return"#"+this.toHex(ue)},toHex8:function(ue){return u(this._r,this._g,this._b,this._a,ue)},toHex8String:function(ue){return"#"+this.toHex8(ue)},toRgb:function(){return{r:p(this._r),g:p(this._g),b:p(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+p(this._r)+", "+p(this._g)+", "+p(this._b)+")":"rgba("+p(this._r)+", "+p(this._g)+", "+p(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:p(U(this._r,255)*100)+"%",g:p(U(this._g,255)*100)+"%",b:p(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+p(U(this._r,255)*100)+"%, "+p(U(this._g,255)*100)+"%, "+p(U(this._b,255)*100)+"%)":"rgba("+p(U(this._r,255)*100)+"%, "+p(U(this._g,255)*100)+"%, "+p(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:j[s(this._r,this._g,this._b,!0)]||!1},toFilter:function(ue){var Ae="#"+f(this._r,this._g,this._b,this._a),ge=Ae,Ve=this._gradientType?"GradientType = 1, ":"";if(ue){var Qe=c(ue);ge="#"+f(Qe._r,Qe._g,Qe._b,Qe._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ve+"startColorstr="+Ae+",endColorstr="+ge+")"},toString:function(ue){var Ae=!!ue;ue=ue||this._format;var ge=!1,Ve=this._a<1&&this._a>=0,Qe=!Ae&&Ve&&(ue==="hex"||ue==="hex6"||ue==="hex3"||ue==="hex4"||ue==="hex8"||ue==="name");return Qe?ue==="name"&&this._a===0?this.toName():this.toRgbString():(ue==="rgb"&&(ge=this.toRgbString()),ue==="prgb"&&(ge=this.toPercentageRgbString()),(ue==="hex"||ue==="hex6")&&(ge=this.toHexString()),ue==="hex3"&&(ge=this.toHexString(!0)),ue==="hex4"&&(ge=this.toHex8String(!0)),ue==="hex8"&&(ge=this.toHex8String()),ue==="name"&&(ge=this.toName()),ue==="hsl"&&(ge=this.toHslString()),ue==="hsv"&&(ge=this.toHsvString()),ge||this.toHexString())},clone:function(){return c(this.toString())},_applyModification:function(ue,Ae){var ge=ue.apply(null,[this].concat([].slice.call(Ae)));return this._r=ge._r,this._g=ge._g,this._b=ge._b,this.setAlpha(ge._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(C,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(ue,Ae){return ue.apply(null,[this].concat([].slice.call(Ae)))},analogous:function(){return this._applyCombination(P,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(N,arguments)},splitcomplement:function(){return this._applyCombination(F,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},c.fromRatio=function(ue,Ae){if(typeof ue=="object"){var ge={};for(var Ve in ue)ue.hasOwnProperty(Ve)&&(Ve==="a"?ge[Ve]=ue[Ve]:ge[Ve]=je(ue[Ve]));ue=ge}return c(ue,Ae)};function o(ue){var Ae={r:0,g:0,b:0},ge=1,Ve=null,Qe=null,ze=null,qe=!1,Je=!1;return typeof ue=="string"&&(ue=Te(ue)),typeof ue=="object"&&(We(ue.r)&&We(ue.g)&&We(ue.b)?(Ae=h(ue.r,ue.g,ue.b),qe=!0,Je=String(ue.r).substr(-1)==="%"?"prgb":"rgb"):We(ue.h)&&We(ue.s)&&We(ue.v)?(Ve=je(ue.s),Qe=je(ue.v),Ae=r(ue.h,Ve,Qe),qe=!0,Je="hsv"):We(ue.h)&&We(ue.s)&&We(ue.l)&&(Ve=je(ue.s),ze=je(ue.l),Ae=a(ue.h,Ve,ze),qe=!0,Je="hsl"),ue.hasOwnProperty("a")&&(ge=ue.a)),ge=K(ge),{ok:qe,format:ue.format||Je,r:E(255,b(Ae.r,0)),g:E(255,b(Ae.g,0)),b:E(255,b(Ae.b,0)),a:ge}}function h(ue,Ae,ge){return{r:U(ue,255)*255,g:U(Ae,255)*255,b:U(ge,255)*255}}function n(ue,Ae,ge){ue=U(ue,255),Ae=U(Ae,255),ge=U(ge,255);var Ve=b(ue,Ae,ge),Qe=E(ue,Ae,ge),ze,qe,Je=(Ve+Qe)/2;if(Ve==Qe)ze=qe=0;else{var pe=Ve-Qe;qe=Je>.5?pe/(2-Ve-Qe):pe/(Ve+Qe);switch(Ve){case ue:ze=(Ae-ge)/pe+(Ae<ge?6:0);break;case Ae:ze=(ge-ue)/pe+2;break;case ge:ze=(ue-Ae)/pe+4;break}ze/=6}return{h:ze,s:qe,l:Je}}function a(ue,Ae,ge){var Ve,Qe,ze;ue=U(ue,360),Ae=U(Ae,100),ge=U(ge,100);function qe(ve,xe,Se){return Se<0&&(Se+=1),Se>1&&(Se-=1),Se<1/6?ve+(xe-ve)*6*Se:Se<1/2?xe:Se<2/3?ve+(xe-ve)*(2/3-Se)*6:ve}if(Ae===0)Ve=Qe=ze=ge;else{var Je=ge<.5?ge*(1+Ae):ge+Ae-ge*Ae,pe=2*ge-Je;Ve=qe(pe,Je,ue+1/3),Qe=qe(pe,Je,ue),ze=qe(pe,Je,ue-1/3)}return{r:Ve*255,g:Qe*255,b:ze*255}}function t(ue,Ae,ge){ue=U(ue,255),Ae=U(Ae,255),ge=U(ge,255);var Ve=b(ue,Ae,ge),Qe=E(ue,Ae,ge),ze,qe,Je=Ve,pe=Ve-Qe;if(qe=Ve===0?0:pe/Ve,Ve==Qe)ze=0;else{switch(Ve){case ue:ze=(Ae-ge)/pe+(Ae<ge?6:0);break;case Ae:ze=(ge-ue)/pe+2;break;case ge:ze=(ue-Ae)/pe+4;break}ze/=6}return{h:ze,s:qe,v:Je}}function r(ue,Ae,ge){ue=U(ue,360)*6,Ae=U(Ae,100),ge=U(ge,100);var Ve=R.floor(ue),Qe=ue-Ve,ze=ge*(1-Ae),qe=ge*(1-Qe*Ae),Je=ge*(1-(1-Qe)*Ae),pe=Ve%6,ve=[ge,qe,ze,ze,Je,ge][pe],xe=[Je,ge,ge,qe,ze,ze][pe],Se=[ze,ze,Je,ge,ge,qe][pe];return{r:ve*255,g:xe*255,b:Se*255}}function s(ue,Ae,ge,Ve){var Qe=[be(p(ue).toString(16)),be(p(Ae).toString(16)),be(p(ge).toString(16))];return Ve&&Qe[0].charAt(0)==Qe[0].charAt(1)&&Qe[1].charAt(0)==Qe[1].charAt(1)&&Qe[2].charAt(0)==Qe[2].charAt(1)?Qe[0].charAt(0)+Qe[1].charAt(0)+Qe[2].charAt(0):Qe.join("")}function u(ue,Ae,ge,Ve,Qe){var ze=[be(p(ue).toString(16)),be(p(Ae).toString(16)),be(p(ge).toString(16)),be(Ne(Ve))];return Qe&&ze[0].charAt(0)==ze[0].charAt(1)&&ze[1].charAt(0)==ze[1].charAt(1)&&ze[2].charAt(0)==ze[2].charAt(1)&&ze[3].charAt(0)==ze[3].charAt(1)?ze[0].charAt(0)+ze[1].charAt(0)+ze[2].charAt(0)+ze[3].charAt(0):ze.join("")}function f(ue,Ae,ge,Ve){var Qe=[be(Ne(Ve)),be(p(ue).toString(16)),be(p(Ae).toString(16)),be(p(ge).toString(16))];return Qe.join("")}c.equals=function(ue,Ae){return!ue||!Ae?!1:c(ue).toRgbString()==c(Ae).toRgbString()},c.random=function(){return c.fromRatio({r:i(),g:i(),b:i()})};function d(ue,Ae){Ae=Ae===0?0:Ae||10;var ge=c(ue).toHsl();return ge.s-=Ae/100,ge.s=O(ge.s),c(ge)}function v(ue,Ae){Ae=Ae===0?0:Ae||10;var ge=c(ue).toHsl();return ge.s+=Ae/100,ge.s=O(ge.s),c(ge)}function m(ue){return c(ue).desaturate(100)}function S(ue,Ae){Ae=Ae===0?0:Ae||10;var ge=c(ue).toHsl();return ge.l+=Ae/100,ge.l=O(ge.l),c(ge)}function C(ue,Ae){Ae=Ae===0?0:Ae||10;var ge=c(ue).toRgb();return ge.r=b(0,E(255,ge.r-p(255*-(Ae/100)))),ge.g=b(0,E(255,ge.g-p(255*-(Ae/100)))),ge.b=b(0,E(255,ge.b-p(255*-(Ae/100)))),c(ge)}function _(ue,Ae){Ae=Ae===0?0:Ae||10;var ge=c(ue).toHsl();return ge.l-=Ae/100,ge.l=O(ge.l),c(ge)}function y(ue,Ae){var ge=c(ue).toHsl(),Ve=(ge.h+Ae)%360;return ge.h=Ve<0?360+Ve:Ve,c(ge)}function T(ue){var Ae=c(ue).toHsl();return Ae.h=(Ae.h+180)%360,c(Ae)}function k(ue){var Ae=c(ue).toHsl(),ge=Ae.h;return[c(ue),c({h:(ge+120)%360,s:Ae.s,l:Ae.l}),c({h:(ge+240)%360,s:Ae.s,l:Ae.l})]}function g(ue){var Ae=c(ue).toHsl(),ge=Ae.h;return[c(ue),c({h:(ge+90)%360,s:Ae.s,l:Ae.l}),c({h:(ge+180)%360,s:Ae.s,l:Ae.l}),c({h:(ge+270)%360,s:Ae.s,l:Ae.l})]}function F(ue){var Ae=c(ue).toHsl(),ge=Ae.h;return[c(ue),c({h:(ge+72)%360,s:Ae.s,l:Ae.l}),c({h:(ge+216)%360,s:Ae.s,l:Ae.l})]}function P(ue,Ae,ge){Ae=Ae||6,ge=ge||30;var Ve=c(ue).toHsl(),Qe=360/ge,ze=[c(ue)];for(Ve.h=(Ve.h-(Qe*Ae>>1)+720)%360;--Ae;)Ve.h=(Ve.h+Qe)%360,ze.push(c(Ve));return ze}function N(ue,Ae){Ae=Ae||6;for(var ge=c(ue).toHsv(),Ve=ge.h,Qe=ge.s,ze=ge.v,qe=[],Je=1/Ae;Ae--;)qe.push(c({h:Ve,s:Qe,v:ze})),ze=(ze+Je)%1;return qe}c.mix=function(ue,Ae,ge){ge=ge===0?0:ge||50;var Ve=c(ue).toRgb(),Qe=c(Ae).toRgb(),ze=ge/100,qe={r:(Qe.r-Ve.r)*ze+Ve.r,g:(Qe.g-Ve.g)*ze+Ve.g,b:(Qe.b-Ve.b)*ze+Ve.b,a:(Qe.a-Ve.a)*ze+Ve.a};return c(qe)},c.readability=function(ue,Ae){var ge=c(ue),Ve=c(Ae);return(R.max(ge.getLuminance(),Ve.getLuminance())+.05)/(R.min(ge.getLuminance(),Ve.getLuminance())+.05)},c.isReadable=function(ue,Ae,ge){var Ve=c.readability(ue,Ae),Qe,ze;ze=!1,Qe=we(ge);switch(Qe.level+Qe.size){case"AAsmall":case"AAAlarge":ze=Ve>=4.5;break;case"AAlarge":ze=Ve>=3;break;case"AAAsmall":ze=Ve>=7;break}return ze},c.mostReadable=function(ue,Ae,ge){var Ve=null,Qe=0,ze,qe,Je,pe;ge=ge||{},qe=ge.includeFallbackColors,Je=ge.level,pe=ge.size;for(var ve=0;ve<Ae.length;ve++)ze=c.readability(ue,Ae[ve]),ze>Qe&&(Qe=ze,Ve=c(Ae[ve]));return c.isReadable(ue,Ve,{level:Je,size:pe})||!qe?Ve:(ge.includeFallbackColors=!1,c.mostReadable(ue,["#fff","#000"],ge))};var W=c.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"},j=c.hexNames=A(W);function A(ue){var Ae={};for(var ge in ue)ue.hasOwnProperty(ge)&&(Ae[ue[ge]]=ge);return Ae}function K(ue){return ue=parseFloat(ue),(isNaN(ue)||ue<0||ue>1)&&(ue=1),ue}function U(ue,Ae){te(ue)&&(ue="100%");var ge=de(ue);return ue=E(Ae,b(0,parseFloat(ue))),ge&&(ue=parseInt(ue*Ae,10)/100),R.abs(ue-Ae)<1e-6?1:ue%Ae/parseFloat(Ae)}function O(ue){return E(1,b(0,ue))}function z(ue){return parseInt(ue,16)}function te(ue){return typeof ue=="string"&&ue.indexOf(".")!=-1&&parseFloat(ue)===1}function de(ue){return typeof ue=="string"&&ue.indexOf("%")!=-1}function be(ue){return ue.length==1?"0"+ue:""+ue}function je(ue){return ue<=1&&(ue=ue*100+"%"),ue}function Ne(ue){return R.round(parseFloat(ue)*255).toString(16)}function Oe(ue){return z(ue)/255}var Ke=function(){var ue="[-\\+]?\\d+%?",Ae="[-\\+]?\\d*\\.\\d+%?",ge="(?:"+Ae+")|(?:"+ue+")",Ve="[\\s|\\(]+("+ge+")[,|\\s]+("+ge+")[,|\\s]+("+ge+")\\s*\\)?",Qe="[\\s|\\(]+("+ge+")[,|\\s]+("+ge+")[,|\\s]+("+ge+")[,|\\s]+("+ge+")\\s*\\)?";return{CSS_UNIT:new RegExp(ge),rgb:new RegExp("rgb"+Ve),rgba:new RegExp("rgba"+Qe),hsl:new RegExp("hsl"+Ve),hsla:new RegExp("hsla"+Qe),hsv:new RegExp("hsv"+Ve),hsva:new RegExp("hsva"+Qe),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 We(ue){return!!Ke.CSS_UNIT.exec(ue)}function Te(ue){ue=ue.replace(I,"").replace(L,"").toLowerCase();var Ae=!1;if(W[ue])ue=W[ue],Ae=!0;else if(ue=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ge;return(ge=Ke.rgb.exec(ue))?{r:ge[1],g:ge[2],b:ge[3]}:(ge=Ke.rgba.exec(ue))?{r:ge[1],g:ge[2],b:ge[3],a:ge[4]}:(ge=Ke.hsl.exec(ue))?{h:ge[1],s:ge[2],l:ge[3]}:(ge=Ke.hsla.exec(ue))?{h:ge[1],s:ge[2],l:ge[3],a:ge[4]}:(ge=Ke.hsv.exec(ue))?{h:ge[1],s:ge[2],v:ge[3]}:(ge=Ke.hsva.exec(ue))?{h:ge[1],s:ge[2],v:ge[3],a:ge[4]}:(ge=Ke.hex8.exec(ue))?{r:z(ge[1]),g:z(ge[2]),b:z(ge[3]),a:Oe(ge[4]),format:Ae?"name":"hex8"}:(ge=Ke.hex6.exec(ue))?{r:z(ge[1]),g:z(ge[2]),b:z(ge[3]),format:Ae?"name":"hex"}:(ge=Ke.hex4.exec(ue))?{r:z(ge[1]+""+ge[1]),g:z(ge[2]+""+ge[2]),b:z(ge[3]+""+ge[3]),a:Oe(ge[4]+""+ge[4]),format:Ae?"name":"hex8"}:(ge=Ke.hex3.exec(ue))?{r:z(ge[1]+""+ge[1]),g:z(ge[2]+""+ge[2]),b:z(ge[3]+""+ge[3]),format:Ae?"name":"hex"}:!1}function we(ue){var Ae,ge;return ue=ue||{level:"AA",size:"small"},Ae=(ue.level||"AA").toUpperCase(),ge=(ue.size||"small").toLowerCase(),Ae!=="AA"&&Ae!=="AAA"&&(Ae="AA"),ge!=="small"&&ge!=="large"&&(ge="small"),{level:Ae,size:ge}}it.exports?it.exports=c:!(G=function(){return c}.call(re,Q,re,it),G!==void 0&&(it.exports=G))})(Math)},bT9E:function(it,re,Q){"use strict";Q.d(re,"a",function(){return R});var G=Q("VTBJ");function R(I,L){var M=Object(G.a)({},I);return Array.isArray(L)&&L.forEach(function(p){delete M[p]}),M}},c5Ni:function(it,re,Q){},c5fP:function(it,re,Q){"use strict";function G(ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(Fe){return typeof Fe}:G=function(Fe){return Fe&&typeof Symbol=="function"&&Fe.constructor===Symbol&&Fe!==Symbol.prototype?"symbol":typeof Fe},G(ce)}Object.defineProperty(re,"__esModule",{value:!0}),re._tr_init=Pe,re._tr_stored_block=Ze,re._tr_flush_block=Ge,re._tr_tally=ht,re._tr_align=et;var R=L(Q("6BzB"));function I(){if(typeof WeakMap!="function")return null;var ce=new WeakMap;return I=function(){return ce},ce}function L(ce){if(ce&&ce.__esModule)return ce;if(ce===null||G(ce)!=="object"&&typeof ce!="function")return{default:ce};var Me=I();if(Me&&Me.has(ce))return Me.get(ce);var Fe={},Ce=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _e in ce)if(Object.prototype.hasOwnProperty.call(ce,_e)){var Ee=Ce?Object.getOwnPropertyDescriptor(ce,_e):null;Ee&&(Ee.get||Ee.set)?Object.defineProperty(Fe,_e,Ee):Fe[_e]=ce[_e]}return Fe.default=ce,Me&&Me.set(ce,Fe),Fe}var M=4,p=0,E=1,b=2;function i(ce){for(var Me=ce.length;--Me>=0;)ce[Me]=0}var c=0,o=1,h=2,n=3,a=258,t=29,r=256,s=r+1+t,u=30,f=19,d=2*s+1,v=15,m=16,S=7,C=256,_=16,y=17,T=18,k=[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],g=[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],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],N=512,W=new Array((s+2)*2);i(W);var j=new Array(u*2);i(j);var A=new Array(N);i(A);var K=new Array(a-n+1);i(K);var U=new Array(t);i(U);var O=new Array(u);i(O);function z(ce,Me,Fe,Ce,_e){this.static_tree=ce,this.extra_bits=Me,this.extra_base=Fe,this.elems=Ce,this.max_length=_e,this.has_stree=ce&&ce.length}var te,de,be;function je(ce,Me){this.dyn_tree=ce,this.max_code=0,this.stat_desc=Me}function Ne(ce){return ce<256?A[ce]:A[256+(ce>>>7)]}function Oe(ce,Me){ce.pending_buf[ce.pending++]=Me&255,ce.pending_buf[ce.pending++]=Me>>>8&255}function Ke(ce,Me,Fe){ce.bi_valid>m-Fe?(ce.bi_buf|=Me<<ce.bi_valid&65535,Oe(ce,ce.bi_buf),ce.bi_buf=Me>>m-ce.bi_valid,ce.bi_valid+=Fe-m):(ce.bi_buf|=Me<<ce.bi_valid&65535,ce.bi_valid+=Fe)}function We(ce,Me,Fe){Ke(ce,Fe[Me*2],Fe[Me*2+1])}function Te(ce,Me){var Fe=0;do Fe|=ce&1,ce>>>=1,Fe<<=1;while(--Me>0);return Fe>>>1}function we(ce){ce.bi_valid===16?(Oe(ce,ce.bi_buf),ce.bi_buf=0,ce.bi_valid=0):ce.bi_valid>=8&&(ce.pending_buf[ce.pending++]=ce.bi_buf&255,ce.bi_buf>>=8,ce.bi_valid-=8)}function ue(ce,Me){var Fe=Me.dyn_tree,Ce=Me.max_code,_e=Me.stat_desc.static_tree,Ee=Me.stat_desc.has_stree,ee=Me.stat_desc.extra_bits,oe=Me.stat_desc.extra_base,q=Me.stat_desc.max_length,me,Ie,V,Re,He,fe,ke=0;for(Re=0;Re<=v;Re++)ce.bl_count[Re]=0;for(Fe[ce.heap[ce.heap_max]*2+1]=0,me=ce.heap_max+1;me<d;me++){if(Ie=ce.heap[me],Re=Fe[Fe[Ie*2+1]*2+1]+1,Re>q&&(Re=q,ke++),Fe[Ie*2+1]=Re,Ie>Ce)continue;ce.bl_count[Re]++,He=0,Ie>=oe&&(He=ee[Ie-oe]),fe=Fe[Ie*2],ce.opt_len+=fe*(Re+He),Ee&&(ce.static_len+=fe*(_e[Ie*2+1]+He))}if(ke===0)return;do{for(Re=q-1;ce.bl_count[Re]===0;)Re--;ce.bl_count[Re]--,ce.bl_count[Re+1]+=2,ce.bl_count[q]--,ke-=2}while(ke>0);for(Re=q;Re!==0;Re--)for(Ie=ce.bl_count[Re];Ie!==0;){if(V=ce.heap[--me],V>Ce)continue;Fe[V*2+1]!==Re&&(ce.opt_len+=(Re-Fe[V*2+1])*Fe[V*2],Fe[V*2+1]=Re),Ie--}}function Ae(ce,Me,Fe){var Ce=new Array(v+1),_e=0,Ee,ee;for(Ee=1;Ee<=v;Ee++)Ce[Ee]=_e=_e+Fe[Ee-1]<<1;for(ee=0;ee<=Me;ee++){var oe=ce[ee*2+1];if(oe===0)continue;ce[ee*2]=Te(Ce[oe]++,oe)}}function ge(){var ce,Me,Fe,Ce,_e,Ee=new Array(v+1);for(Fe=0,Ce=0;Ce<t-1;Ce++)for(U[Ce]=Fe,ce=0;ce<1<<k[Ce];ce++)K[Fe++]=Ce;for(K[Fe-1]=Ce,_e=0,Ce=0;Ce<16;Ce++)for(O[Ce]=_e,ce=0;ce<1<<g[Ce];ce++)A[_e++]=Ce;for(_e>>=7;Ce<u;Ce++)for(O[Ce]=_e<<7,ce=0;ce<1<<g[Ce]-7;ce++)A[256+_e++]=Ce;for(Me=0;Me<=v;Me++)Ee[Me]=0;for(ce=0;ce<=143;)W[ce*2+1]=8,ce++,Ee[8]++;for(;ce<=255;)W[ce*2+1]=9,ce++,Ee[9]++;for(;ce<=279;)W[ce*2+1]=7,ce++,Ee[7]++;for(;ce<=287;)W[ce*2+1]=8,ce++,Ee[8]++;for(Ae(W,s+1,Ee),ce=0;ce<u;ce++)j[ce*2+1]=5,j[ce*2]=Te(ce,5);te=new z(W,k,r+1,s,v),de=new z(j,g,0,u,v),be=new z(new Array(0),F,0,f,S)}function Ve(ce){var Me;for(Me=0;Me<s;Me++)ce.dyn_ltree[Me*2]=0;for(Me=0;Me<u;Me++)ce.dyn_dtree[Me*2]=0;for(Me=0;Me<f;Me++)ce.bl_tree[Me*2]=0;ce.dyn_ltree[C*2]=1,ce.opt_len=ce.static_len=0,ce.last_lit=ce.matches=0}function Qe(ce){ce.bi_valid>8?Oe(ce,ce.bi_buf):ce.bi_valid>0&&(ce.pending_buf[ce.pending++]=ce.bi_buf),ce.bi_buf=0,ce.bi_valid=0}function ze(ce,Me,Fe,Ce){Qe(ce),Ce&&(Oe(ce,Fe),Oe(ce,~Fe)),R.arraySet(ce.pending_buf,ce.window,Me,Fe,ce.pending),ce.pending+=Fe}function qe(ce,Me,Fe,Ce){var _e=Me*2,Ee=Fe*2;return ce[_e]<ce[Ee]||ce[_e]===ce[Ee]&&Ce[Me]<=Ce[Fe]}function Je(ce,Me,Fe){for(var Ce=ce.heap[Fe],_e=Fe<<1;_e<=ce.heap_len&&!(_e<ce.heap_len&&qe(Me,ce.heap[_e+1],ce.heap[_e],ce.depth)&&_e++,qe(Me,Ce,ce.heap[_e],ce.depth));)ce.heap[Fe]=ce.heap[_e],Fe=_e,_e<<=1;ce.heap[Fe]=Ce}function pe(ce,Me,Fe){var Ce,_e,Ee=0,ee,oe;if(ce.last_lit!==0)do Ce=ce.pending_buf[ce.d_buf+Ee*2]<<8|ce.pending_buf[ce.d_buf+Ee*2+1],_e=ce.pending_buf[ce.l_buf+Ee],Ee++,Ce===0?We(ce,_e,Me):(ee=K[_e],We(ce,ee+r+1,Me),oe=k[ee],oe!==0&&(_e-=U[ee],Ke(ce,_e,oe)),Ce--,ee=Ne(Ce),We(ce,ee,Fe),oe=g[ee],oe!==0&&(Ce-=O[ee],Ke(ce,Ce,oe)));while(Ee<ce.last_lit);We(ce,C,Me)}function ve(ce,Me){var Fe=Me.dyn_tree,Ce=Me.stat_desc.static_tree,_e=Me.stat_desc.has_stree,Ee=Me.stat_desc.elems,ee,oe,q=-1,me;for(ce.heap_len=0,ce.heap_max=d,ee=0;ee<Ee;ee++)Fe[ee*2]!==0?(ce.heap[++ce.heap_len]=q=ee,ce.depth[ee]=0):Fe[ee*2+1]=0;for(;ce.heap_len<2;)me=ce.heap[++ce.heap_len]=q<2?++q:0,Fe[me*2]=1,ce.depth[me]=0,ce.opt_len--,_e&&(ce.static_len-=Ce[me*2+1]);for(Me.max_code=q,ee=ce.heap_len>>1;ee>=1;ee--)Je(ce,Fe,ee);me=Ee;do ee=ce.heap[1],ce.heap[1]=ce.heap[ce.heap_len--],Je(ce,Fe,1),oe=ce.heap[1],ce.heap[--ce.heap_max]=ee,ce.heap[--ce.heap_max]=oe,Fe[me*2]=Fe[ee*2]+Fe[oe*2],ce.depth[me]=(ce.depth[ee]>=ce.depth[oe]?ce.depth[ee]:ce.depth[oe])+1,Fe[ee*2+1]=Fe[oe*2+1]=me,ce.heap[1]=me++,Je(ce,Fe,1);while(ce.heap_len>=2);ce.heap[--ce.heap_max]=ce.heap[1],ue(ce,Me),Ae(Fe,q,ce.bl_count)}function xe(ce,Me,Fe){var Ce,_e=-1,Ee,ee=Me[0*2+1],oe=0,q=7,me=4;for(ee===0&&(q=138,me=3),Me[(Fe+1)*2+1]=65535,Ce=0;Ce<=Fe;Ce++){if(Ee=ee,ee=Me[(Ce+1)*2+1],++oe<q&&Ee===ee)continue;oe<me?ce.bl_tree[Ee*2]+=oe:Ee!==0?(Ee!==_e&&ce.bl_tree[Ee*2]++,ce.bl_tree[_*2]++):oe<=10?ce.bl_tree[y*2]++:ce.bl_tree[T*2]++,oe=0,_e=Ee,ee===0?(q=138,me=3):Ee===ee?(q=6,me=3):(q=7,me=4)}}function Se(ce,Me,Fe){var Ce,_e=-1,Ee,ee=Me[0*2+1],oe=0,q=7,me=4;for(ee===0&&(q=138,me=3),Ce=0;Ce<=Fe;Ce++){if(Ee=ee,ee=Me[(Ce+1)*2+1],++oe<q&&Ee===ee)continue;if(oe<me)do We(ce,Ee,ce.bl_tree);while(--oe!==0);else Ee!==0?(Ee!==_e&&(We(ce,Ee,ce.bl_tree),oe--),We(ce,_,ce.bl_tree),Ke(ce,oe-3,2)):oe<=10?(We(ce,y,ce.bl_tree),Ke(ce,oe-3,3)):(We(ce,T,ce.bl_tree),Ke(ce,oe-11,7));oe=0,_e=Ee,ee===0?(q=138,me=3):Ee===ee?(q=6,me=3):(q=7,me=4)}}function Le(ce){var Me;for(xe(ce,ce.dyn_ltree,ce.l_desc.max_code),xe(ce,ce.dyn_dtree,ce.d_desc.max_code),ve(ce,ce.bl_desc),Me=f-1;Me>=3&&!(ce.bl_tree[P[Me]*2+1]!==0);Me--);return ce.opt_len+=3*(Me+1)+5+5+4,Me}function ne(ce,Me,Fe,Ce){var _e;for(Ke(ce,Me-257,5),Ke(ce,Fe-1,5),Ke(ce,Ce-4,4),_e=0;_e<Ce;_e++)Ke(ce,ce.bl_tree[P[_e]*2+1],3);Se(ce,ce.dyn_ltree,Me-1),Se(ce,ce.dyn_dtree,Fe-1)}function ye(ce){var Me=4093624447,Fe;for(Fe=0;Fe<=31;Fe++,Me>>>=1)if(Me&1&&ce.dyn_ltree[Fe*2]!==0)return p;if(ce.dyn_ltree[9*2]!==0||ce.dyn_ltree[10*2]!==0||ce.dyn_ltree[13*2]!==0)return E;for(Fe=32;Fe<r;Fe++)if(ce.dyn_ltree[Fe*2]!==0)return E;return p}var se=!1;function Pe(ce){se||(ge(),se=!0),ce.l_desc=new je(ce.dyn_ltree,te),ce.d_desc=new je(ce.dyn_dtree,de),ce.bl_desc=new je(ce.bl_tree,be),ce.bi_buf=0,ce.bi_valid=0,Ve(ce)}function Ze(ce,Me,Fe,Ce){Ke(ce,(c<<1)+(Ce?1:0),3),ze(ce,Me,Fe,!0)}function et(ce){Ke(ce,o<<1,3),We(ce,C,W),we(ce)}function Ge(ce,Me,Fe,Ce){var _e,Ee,ee=0;ce.level>0?(ce.strm.data_type===b&&(ce.strm.data_type=ye(ce)),ve(ce,ce.l_desc),ve(ce,ce.d_desc),ee=Le(ce),_e=ce.opt_len+3+7>>>3,Ee=ce.static_len+3+7>>>3,Ee<=_e&&(_e=Ee)):_e=Ee=Fe+5,Fe+4<=_e&&Me!==-1?Ze(ce,Me,Fe,Ce):ce.strategy===M||Ee===_e?(Ke(ce,(o<<1)+(Ce?1:0),3),pe(ce,W,j)):(Ke(ce,(h<<1)+(Ce?1:0),3),ne(ce,ce.l_desc.max_code+1,ce.d_desc.max_code+1,ee+1),pe(ce,ce.dyn_ltree,ce.dyn_dtree)),Ve(ce),Ce&&Qe(ce)}function ht(ce,Me,Fe){return ce.pending_buf[ce.d_buf+ce.last_lit*2]=Me>>>8&255,ce.pending_buf[ce.d_buf+ce.last_lit*2+1]=Me&255,ce.pending_buf[ce.l_buf+ce.last_lit]=Fe&255,ce.last_lit++,Me===0?ce.dyn_ltree[Fe*2]++:(ce.matches++,Me--,ce.dyn_ltree[(K[Fe]+r+1)*2]++,ce.dyn_dtree[Ne(Me)*2]++),ce.last_lit===ce.lit_bufsize-1}},dejd:function(it,re,Q){},dmUQ:function(it,re,Q){"use strict";var G=Q("Ff2n"),R=Q("rePB"),I=Q("1OyB"),L=Q("vuIU"),M=Q("Ji7U"),p=Q("md7G"),E=Q("foSv"),b=Q("q1tI"),i=Q.n(b),c=Q("TSYQ"),o=Q.n(c),h=Q("4IlW");function n(k,g){var F=Object.keys(k);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(k);g&&(P=P.filter(function(N){return Object.getOwnPropertyDescriptor(k,N).enumerable})),F.push.apply(F,P)}return F}function a(k){for(var g=1;g<arguments.length;g++){var F=arguments[g]!=null?arguments[g]:{};g%2?n(Object(F),!0).forEach(function(P){Object(R.a)(k,P,F[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(F)):n(Object(F)).forEach(function(P){Object.defineProperty(k,P,Object.getOwnPropertyDescriptor(F,P))})}return k}function t(k){var g=r();return function(){var P=Object(E.a)(k),N;if(g){var W=Object(E.a)(this).constructor;N=Reflect.construct(P,arguments,W)}else N=P.apply(this,arguments);return Object(p.a)(this,N)}}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(k){return!1}}function s(){}function u(k){k.preventDefault()}var f=function(g){return g.replace(/[^\w.-]+/g,"")},d=200,v=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(g){return g!=null},C=function(g,F){return F===g||typeof F=="number"&&typeof g=="number"&&isNaN(F)&&isNaN(g)},_=function(k){Object(M.a)(F,k);var g=t(F);function F(P){var N;Object(I.a)(this,F),N=g.call(this,P),N.onKeyDown=function(A){var K=N.props,U=K.onKeyDown,O=K.onPressEnter;if(A.keyCode===h.a.UP){var z=N.getRatio(A);N.up(A,z,null),N.stop()}else if(A.keyCode===h.a.DOWN){var te=N.getRatio(A);N.down(A,te,null),N.stop()}else A.keyCode===h.a.ENTER&&O&&O(A);if(N.recordCursorPosition(),N.lastKeyCode=A.keyCode,U){for(var de=arguments.length,be=new Array(de>1?de-1:0),je=1;je<de;je++)be[je-1]=arguments[je];U.apply(void 0,[A].concat(be))}},N.onKeyUp=function(A){var K=N.props.onKeyUp;if(N.stop(),N.recordCursorPosition(),K){for(var U=arguments.length,O=new Array(U>1?U-1:0),z=1;z<U;z++)O[z-1]=arguments[z];K.apply(void 0,[A].concat(O))}},N.onChange=function(A){var K=N.props.onChange;N.state.focused&&(N.inputting=!0),N.rawInput=N.props.parser(N.getValueFromEvent(A)),N.setState({inputValue:N.rawInput}),K(N.toNumber(N.rawInput))},N.onMouseUp=function(){var A=N.props.onMouseUp;N.recordCursorPosition(),A&&A.apply(void 0,arguments)},N.onFocus=function(){var A;N.setState({focused:!0}),(A=N.props).onFocus.apply(A,arguments)},N.onBlur=function(){var A=N.props.onBlur;N.inputting=!1,N.setState({focused:!1});var K=N.getCurrentValidValue(N.state.inputValue),U=N.setValue(K,s);if(A){var O=N.input.value,z=N.getInputDisplayValue({focus:!1,value:U});N.input.value=z&&Number(z),A.apply(void 0,arguments),N.input.value=O}},N.getRatio=function(A){var K=1;return A.metaKey||A.ctrlKey?K=.1:A.shiftKey&&(K=10),K},N.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},N.getPrecision=function(A){if(S(N.props.precision))return N.props.precision;var K=String(A);if(K.indexOf("e-")>=0)return parseInt(K.slice(K.indexOf("e-")+2),10);var U=0;return K.indexOf(".")>=0&&(U=K.length-K.indexOf(".")-1),U},N.getInputDisplayValue=function(A){var K=A||N.state,U=K.focused,O=K.inputValue,z=K.value,te;U?te=O:te=N.toPrecisionAsStep(z),te==null&&(te="");var de=N.formatWrapper(te);return S(N.props.decimalSeparator)&&(de=de.toString().replace(".",N.props.decimalSeparator)),de},N.recordCursorPosition=function(){try{N.cursorStart=N.input.selectionStart,N.cursorEnd=N.input.selectionEnd,N.currentValue=N.input.value,N.cursorBefore=N.input.value.substring(0,N.cursorStart),N.cursorAfter=N.input.value.substring(N.cursorEnd)}catch(A){}},N.restoreByAfter=function(A){if(A===void 0)return!1;var K=N.input.value,U=K.lastIndexOf(A);if(U===-1)return!1;var O=N.cursorBefore.length;return N.lastKeyCode===h.a.DELETE&&N.cursorBefore.charAt(O-1)===A[0]?(N.fixCaret(O,O),!0):U+A.length===K.length?(N.fixCaret(U,U),!0):!1},N.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(K,U){var O=A.substring(U);return N.restoreByAfter(O)})},N.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},N.stop=function(){N.autoStepTimer&&clearTimeout(N.autoStepTimer)},N.down=function(A,K,U){N.pressingUpOrDown=!0,N.step("down",A,K,U)},N.up=function(A,K,U){N.pressingUpOrDown=!0,N.step("up",A,K,U)},N.saveInput=function(A){N.input=A};var W=P.value;W===void 0&&(W=P.defaultValue),N.state={focused:P.autoFocus};var j=N.getValidValue(N.toNumber(W));return N.state=a(a({},N.state),{},{inputValue:N.toPrecisionAsStep(j),value:j}),N}return Object(L.a)(F,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(N){var W=this.props,j=W.value,A=W.onChange,K=W.max,U=W.min,O=this.state.focused;if(N){if(!C(N.value,j)||!C(N.max,K)||!C(N.min,U)){var z=O?j:this.getValidValue(j),te;this.pressingUpOrDown?te=z:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:te})}var de="value"in this.props?j:this.state.value;"max"in this.props&&N.max!==K&&typeof de=="number"&&de>K&&A&&A(K),"min"in this.props&&N.min!==U&&typeof de=="number"&&de<U&&A&&A(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var be=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===h.a.BACKSPACE?be=this.cursorStart-1:this.lastKeyCode===h.a.DELETE&&(be=this.cursorStart):be=this.input.value.length,this.fixCaret(be,be)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case h.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case h.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(je){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(N){var W=N;return W===""?W="":this.isNotCompleteNumber(parseFloat(W))?W=this.state.value:W=this.getValidValue(W),this.toNumber(W)}},{key:"getValueFromEvent",value:function(N){var W=N.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(W=W.replace(this.props.decimalSeparator,".")),W}},{key:"getValidValue",value:function(N){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(N);return isNaN(A)?N:(A<W&&(A=W),A>j&&(A=j),A)}},{key:"setValue",value:function(N,W){var j=this.props.precision,A=this.isNotCompleteNumber(parseFloat(N))?null:parseFloat(N),K=this.state.value,U=K===void 0?null:K,O=this.state.inputValue,z=O===void 0?null:O,te=typeof A=="number"?A.toFixed(j):"".concat(A),de=A!==U||te!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},W)):this.setState({value:A,inputValue:this.toPrecisionAsStep(N)},W),de&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(N){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,A=j.precision,K=j.step;if(S(A))return A;var U=this.getPrecision(W),O=this.getPrecision(K),z=this.getPrecision(N);return N?Math.max(z,U+O):U+O}},{key:"getPrecisionFactor",value:function(N){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(N,W);return Math.pow(10,j)}},{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(N){return this.props.formatter?this.props.formatter(N):N}},{key:"toPrecisionAsStep",value:function(N){if(this.isNotCompleteNumber(N)||N==="")return N;var W=Math.abs(this.getMaxPrecision(N));return isNaN(W)?N.toString():Number(N).toFixed(W)}},{key:"toNumber",value:function(N){var W=this.props.precision,j=this.state.focused,A=N&&N.length>16&&j;return this.isNotCompleteNumber(N)||A?N:S(W)?Math.round(N*Math.pow(10,W))/Math.pow(10,W):Number(N)}},{key:"upStep",value:function(N,W){var j=this.props.step,A=this.getPrecisionFactor(N,W),K=Math.abs(this.getMaxPrecision(N,W)),U=((A*N+A*j*W)/A).toFixed(K);return this.toNumber(U)}},{key:"downStep",value:function(N,W){var j=this.props.step,A=this.getPrecisionFactor(N,W),K=Math.abs(this.getMaxPrecision(N,W)),U=((A*N-A*j*W)/A).toFixed(K);return this.toNumber(U)}},{key:"step",value:function(N,W){var j=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,K=arguments.length>3?arguments[3]:void 0;this.stop(),W&&(W.persist(),W.preventDefault());var U=this.props;if(U.disabled)return;var O=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(O))return;var z=this["".concat(N,"Step")](O,A),te=z>U.max||z<U.min;if(z>U.max?z=U.max:z<U.min&&(z=U.min),this.setValue(z,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){j[N](W,A,!0)},K?d:v)}},{key:"fixCaret",value:function(N,W){if(N===void 0||W===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,A=this.input.selectionEnd;(N!==j||W!==A)&&this.input.setSelectionRange(N,W)}catch(K){}}},{key:"render",value:function(){var N,W=this.props,j=W.prefixCls,A=W.disabled,K=W.readOnly,U=W.useTouch,O=W.autoComplete,z=W.upHandler,te=W.downHandler,de=W.className,be=W.max,je=W.min,Ne=W.style,Oe=W.title,Ke=W.onMouseEnter,We=W.onMouseLeave,Te=W.onMouseOver,we=W.onMouseOut,ue=W.required,Ae=W.onClick,ge=W.tabIndex,Ve=W.type,Qe=W.placeholder,ze=W.id,qe=W.inputMode,Je=W.pattern,pe=W.step,ve=W.maxLength,xe=W.autoFocus,Se=W.name,Le=W.onPaste,ne=W.onInput,ye=Object(G.a)(W,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),se=this.state,Pe=se.value,Ze=se.focused,et=o()(j,(N={},Object(R.a)(N,de,!!de),Object(R.a)(N,"".concat(j,"-disabled"),A),Object(R.a)(N,"".concat(j,"-focused"),Ze),N)),Ge={};Object.keys(ye).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Ge[me]=ye[me])});var ht=!K&&!A,ce=this.getInputDisplayValue(null),Me=(Pe||Pe===0)&&(isNaN(Pe)||Number(Pe)>=be),Fe=(Pe||Pe===0)&&(isNaN(Pe)||Number(Pe)<=je),Ce=Me||A||K,_e=Fe||A||K,Ee=o()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(R.a)({},"".concat(j,"-handler-up-disabled"),Ce)),ee=o()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(R.a)({},"".concat(j,"-handler-down-disabled"),_e)),oe=U?{onTouchStart:Ce?s:this.up,onTouchEnd:this.stop}:{onMouseDown:Ce?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},q=U?{onTouchStart:_e?s:this.down,onTouchEnd:this.stop}:{onMouseDown:_e?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return i.a.createElement("div",{className:et,style:Ne,title:Oe,onMouseEnter:Ke,onMouseLeave:We,onMouseOver:Te,onMouseOut:we,onFocus:function(){return null},onBlur:function(){return null}},i.a.createElement("div",{className:"".concat(j,"-handler-wrap")},i.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":Ce,className:Ee}),z||i.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:u})),i.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Decrease Value","aria-disabled":_e,className:ee}),te||i.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:u}))),i.a.createElement("div",{className:"".concat(j,"-input-wrap")},i.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":je,"aria-valuemax":be,"aria-valuenow":Pe,required:ue,type:Ve,placeholder:Qe,onPaste:Le,onClick:Ae,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:ge,autoComplete:O,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ht?this.onKeyDown:s,onKeyUp:ht?this.onKeyUp:s,autoFocus:xe,maxLength:ve,readOnly:K,disabled:A,max:be,min:je,step:pe,name:Se,title:Oe,id:ze,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ce),pattern:Je,inputMode:qe,onInput:ne},Ge))))}}]),F}(i.a.Component);_.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:f,required:!1,autoComplete:"off"};var y=_,T=re.a=y},eP3c:function(it,re,Q){"use strict";function G(ee){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(q){return typeof q}:G=function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},G(ee)}Object.defineProperty(re,"__esModule",{value:!0}),re.inflateReset=ne,re.inflateReset2=ye,re.inflateResetKeep=Le,re.inflateInit=Pe,re.inflateInit2=se,re.inflate=Me,re.inflateEnd=Fe,re.inflateGetHeader=Ce,re.inflateSetDictionary=_e,re.inflateInfo=re.Z_DEFLATED=re.Z_BUF_ERROR=re.Z_MEM_ERROR=re.Z_DATA_ERROR=re.Z_STREAM_ERROR=re.Z_NEED_DICT=re.Z_STREAM_END=re.Z_OK=re.Z_TREES=re.Z_BLOCK=re.Z_FINISH=void 0;var R=i(Q("6BzB")),I=E(Q("xlC8")),L=E(Q("QV2g")),M=E(Q("sjKO")),p=E(Q("JSwD"));function E(ee){return ee&&ee.__esModule?ee:{default:ee}}function b(){if(typeof WeakMap!="function")return null;var ee=new WeakMap;return b=function(){return ee},ee}function i(ee){if(ee&&ee.__esModule)return ee;if(ee===null||G(ee)!=="object"&&typeof ee!="function")return{default:ee};var oe=b();if(oe&&oe.has(ee))return oe.get(ee);var q={},me=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ie in ee)if(Object.prototype.hasOwnProperty.call(ee,Ie)){var V=me?Object.getOwnPropertyDescriptor(ee,Ie):null;V&&(V.get||V.set)?Object.defineProperty(q,Ie,V):q[Ie]=ee[Ie]}return q.default=ee,oe&&oe.set(ee,q),q}var c=0,o=1,h=2,n=4;re.Z_FINISH=n;var a=5;re.Z_BLOCK=a;var t=6;re.Z_TREES=t;var r=0;re.Z_OK=r;var s=1;re.Z_STREAM_END=s;var u=2;re.Z_NEED_DICT=u;var f=-2;re.Z_STREAM_ERROR=f;var d=-3;re.Z_DATA_ERROR=d;var v=-4;re.Z_MEM_ERROR=v;var m=-5;re.Z_BUF_ERROR=m;var S=8;re.Z_DEFLATED=S;var C=1,_=2,y=3,T=4,k=5,g=6,F=7,P=8,N=9,W=10,j=11,A=12,K=13,U=14,O=15,z=16,te=17,de=18,be=19,je=20,Ne=21,Oe=22,Ke=23,We=24,Te=25,we=26,ue=27,Ae=28,ge=29,Ve=30,Qe=31,ze=32,qe=852,Je=592,pe=15,ve=pe;function xe(ee){return(ee>>>24&255)+(ee>>>8&65280)+((ee&65280)<<8)+((ee&255)<<24)}function Se(){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 R.Buf16(320),this.work=new R.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Le(ee){var oe;return!ee||!ee.state?f:(oe=ee.state,ee.total_in=ee.total_out=oe.total=0,ee.msg="",oe.wrap&&(ee.adler=oe.wrap&1),oe.mode=C,oe.last=0,oe.havedict=0,oe.dmax=32768,oe.head=null,oe.hold=0,oe.bits=0,oe.lencode=oe.lendyn=new R.Buf32(qe),oe.distcode=oe.distdyn=new R.Buf32(Je),oe.sane=1,oe.back=-1,r)}function ne(ee){var oe;return!ee||!ee.state?f:(oe=ee.state,oe.wsize=0,oe.whave=0,oe.wnext=0,Le(ee))}function ye(ee,oe){var q,me;return!ee||!ee.state?f:(me=ee.state,oe<0?(q=0,oe=-oe):(q=(oe>>4)+1,oe<48&&(oe&=15)),oe&&(oe<8||oe>15)?f:(me.window!==null&&me.wbits!==oe&&(me.window=null),me.wrap=q,me.wbits=oe,ne(ee)))}function se(ee,oe){var q,me;return ee?(me=new Se,ee.state=me,me.window=null,q=ye(ee,oe),q!==r&&(ee.state=null),q):f}function Pe(ee){return se(ee,ve)}var Ze=!0,et,Ge;function ht(ee){if(Ze){var oe;for(et=new R.Buf32(512),Ge=new R.Buf32(32),oe=0;oe<144;)ee.lens[oe++]=8;for(;oe<256;)ee.lens[oe++]=9;for(;oe<280;)ee.lens[oe++]=7;for(;oe<288;)ee.lens[oe++]=8;for((0,p.default)(o,ee.lens,0,288,et,0,ee.work,{bits:9}),oe=0;oe<32;)ee.lens[oe++]=5;(0,p.default)(h,ee.lens,0,32,Ge,0,ee.work,{bits:5}),Ze=!1}ee.lencode=et,ee.lenbits=9,ee.distcode=Ge,ee.distbits=5}function ce(ee,oe,q,me){var Ie,V=ee.state;return V.window===null&&(V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new R.Buf8(V.wsize)),me>=V.wsize?(R.arraySet(V.window,oe,q-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):(Ie=V.wsize-V.wnext,Ie>me&&(Ie=me),R.arraySet(V.window,oe,q-me,Ie,V.wnext),me-=Ie,me?(R.arraySet(V.window,oe,q-me,me,0),V.wnext=me,V.whave=V.wsize):(V.wnext+=Ie,V.wnext===V.wsize&&(V.wnext=0),V.whave<V.wsize&&(V.whave+=Ie))),0}function Me(ee,oe){var q,me,Ie,V,Re,He,fe,ke,Xe,ot,tt,at,pt,Ct,bt=0,dt,kt,Ft,mt,$t,wt,_t,Ot,Nt=new R.Buf8(4),qt,Pt,xt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ee||!ee.state||!ee.output||!ee.input&&ee.avail_in!==0)return f;q=ee.state,q.mode===A&&(q.mode=K),Re=ee.next_out,Ie=ee.output,fe=ee.avail_out,V=ee.next_in,me=ee.input,He=ee.avail_in,ke=q.hold,Xe=q.bits,ot=He,tt=fe,Ot=r;e:for(;;)switch(q.mode){case C:if(q.wrap===0){q.mode=K;break}for(;Xe<16;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(q.wrap&2&&ke===35615){q.check=0,Nt[0]=ke&255,Nt[1]=ke>>>8&255,q.check=(0,L.default)(q.check,Nt,2,0),ke=0,Xe=0,q.mode=_;break}if(q.flags=0,q.head&&(q.head.done=!1),!(q.wrap&1)||(((ke&255)<<8)+(ke>>8))%31){ee.msg="incorrect header check",q.mode=Ve;break}if((ke&15)!==S){ee.msg="unknown compression method",q.mode=Ve;break}if(ke>>>=4,Xe-=4,_t=(ke&15)+8,q.wbits===0)q.wbits=_t;else if(_t>q.wbits){ee.msg="invalid window size",q.mode=Ve;break}q.dmax=1<<_t,ee.adler=q.check=1,q.mode=ke&512?W:A,ke=0,Xe=0;break;case _:for(;Xe<16;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(q.flags=ke,(q.flags&255)!==S){ee.msg="unknown compression method",q.mode=Ve;break}if(q.flags&57344){ee.msg="unknown header flags set",q.mode=Ve;break}q.head&&(q.head.text=ke>>8&1),q.flags&512&&(Nt[0]=ke&255,Nt[1]=ke>>>8&255,q.check=(0,L.default)(q.check,Nt,2,0)),ke=0,Xe=0,q.mode=y;case y:for(;Xe<32;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}q.head&&(q.head.time=ke),q.flags&512&&(Nt[0]=ke&255,Nt[1]=ke>>>8&255,Nt[2]=ke>>>16&255,Nt[3]=ke>>>24&255,q.check=(0,L.default)(q.check,Nt,4,0)),ke=0,Xe=0,q.mode=T;case T:for(;Xe<16;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}q.head&&(q.head.xflags=ke&255,q.head.os=ke>>8),q.flags&512&&(Nt[0]=ke&255,Nt[1]=ke>>>8&255,q.check=(0,L.default)(q.check,Nt,2,0)),ke=0,Xe=0,q.mode=k;case k:if(q.flags&1024){for(;Xe<16;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}q.length=ke,q.head&&(q.head.extra_len=ke),q.flags&512&&(Nt[0]=ke&255,Nt[1]=ke>>>8&255,q.check=(0,L.default)(q.check,Nt,2,0)),ke=0,Xe=0}else q.head&&(q.head.extra=null);q.mode=g;case g:if(q.flags&1024&&(at=q.length,at>He&&(at=He),at&&(q.head&&(_t=q.head.extra_len-q.length,q.head.extra||(q.head.extra=new Array(q.head.extra_len)),R.arraySet(q.head.extra,me,V,at,_t)),q.flags&512&&(q.check=(0,L.default)(q.check,me,at,V)),He-=at,V+=at,q.length-=at),q.length))break e;q.length=0,q.mode=F;case F:if(q.flags&2048){if(He===0)break e;at=0;do _t=me[V+at++],q.head&&_t&&q.length<65536&&(q.head.name+=String.fromCharCode(_t));while(_t&&at<He);if(q.flags&512&&(q.check=(0,L.default)(q.check,me,at,V)),He-=at,V+=at,_t)break e}else q.head&&(q.head.name=null);q.length=0,q.mode=P;case P:if(q.flags&4096){if(He===0)break e;at=0;do _t=me[V+at++],q.head&&_t&&q.length<65536&&(q.head.comment+=String.fromCharCode(_t));while(_t&&at<He);if(q.flags&512&&(q.check=(0,L.default)(q.check,me,at,V)),He-=at,V+=at,_t)break e}else q.head&&(q.head.comment=null);q.mode=N;case N:if(q.flags&512){for(;Xe<16;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(ke!==(q.check&65535)){ee.msg="header crc mismatch",q.mode=Ve;break}ke=0,Xe=0}q.head&&(q.head.hcrc=q.flags>>9&1,q.head.done=!0),ee.adler=q.check=0,q.mode=A;break;case W:for(;Xe<32;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}ee.adler=q.check=xe(ke),ke=0,Xe=0,q.mode=j;case j:if(q.havedict===0)return ee.next_out=Re,ee.avail_out=fe,ee.next_in=V,ee.avail_in=He,q.hold=ke,q.bits=Xe,u;ee.adler=q.check=1,q.mode=A;case A:if(oe===a||oe===t)break e;case K:if(q.last){ke>>>=Xe&7,Xe-=Xe&7,q.mode=ue;break}for(;Xe<3;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}q.last=ke&1,ke>>>=1,Xe-=1;switch(ke&3){case 0:q.mode=U;break;case 1:if(ht(q),q.mode=je,oe===t){ke>>>=2,Xe-=2;break e}break;case 2:q.mode=te;break;case 3:ee.msg="invalid block type",q.mode=Ve}ke>>>=2,Xe-=2;break;case U:for(ke>>>=Xe&7,Xe-=Xe&7;Xe<32;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if((ke&65535)!==(ke>>>16^65535)){ee.msg="invalid stored block lengths",q.mode=Ve;break}if(q.length=ke&65535,ke=0,Xe=0,q.mode=O,oe===t)break e;case O:q.mode=z;case z:if(at=q.length,at){if(at>He&&(at=He),at>fe&&(at=fe),at===0)break e;R.arraySet(Ie,me,V,at,Re),He-=at,V+=at,fe-=at,Re+=at,q.length-=at;break}q.mode=A;break;case te:for(;Xe<14;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(q.nlen=(ke&31)+257,ke>>>=5,Xe-=5,q.ndist=(ke&31)+1,ke>>>=5,Xe-=5,q.ncode=(ke&15)+4,ke>>>=4,Xe-=4,q.nlen>286||q.ndist>30){ee.msg="too many length or distance symbols",q.mode=Ve;break}q.have=0,q.mode=de;case de:for(;q.have<q.ncode;){for(;Xe<3;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}q.lens[xt[q.have++]]=ke&7,ke>>>=3,Xe-=3}for(;q.have<19;)q.lens[xt[q.have++]]=0;if(q.lencode=q.lendyn,q.lenbits=7,qt={bits:q.lenbits},Ot=(0,p.default)(c,q.lens,0,19,q.lencode,0,q.work,qt),q.lenbits=qt.bits,Ot){ee.msg="invalid code lengths set",q.mode=Ve;break}q.have=0,q.mode=be;case be:for(;q.have<q.nlen+q.ndist;){for(;!(bt=q.lencode[ke&(1<<q.lenbits)-1],dt=bt>>>24,kt=bt>>>16&255,Ft=bt&65535,dt<=Xe);){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(Ft<16)ke>>>=dt,Xe-=dt,q.lens[q.have++]=Ft;else{if(Ft===16){for(Pt=dt+2;Xe<Pt;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(ke>>>=dt,Xe-=dt,q.have===0){ee.msg="invalid bit length repeat",q.mode=Ve;break}_t=q.lens[q.have-1],at=3+(ke&3),ke>>>=2,Xe-=2}else if(Ft===17){for(Pt=dt+3;Xe<Pt;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}ke>>>=dt,Xe-=dt,_t=0,at=3+(ke&7),ke>>>=3,Xe-=3}else{for(Pt=dt+7;Xe<Pt;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}ke>>>=dt,Xe-=dt,_t=0,at=11+(ke&127),ke>>>=7,Xe-=7}if(q.have+at>q.nlen+q.ndist){ee.msg="invalid bit length repeat",q.mode=Ve;break}for(;at--;)q.lens[q.have++]=_t}}if(q.mode===Ve)break;if(q.lens[256]===0){ee.msg="invalid code -- missing end-of-block",q.mode=Ve;break}if(q.lenbits=9,qt={bits:q.lenbits},Ot=(0,p.default)(o,q.lens,0,q.nlen,q.lencode,0,q.work,qt),q.lenbits=qt.bits,Ot){ee.msg="invalid literal/lengths set",q.mode=Ve;break}if(q.distbits=6,q.distcode=q.distdyn,qt={bits:q.distbits},Ot=(0,p.default)(h,q.lens,q.nlen,q.ndist,q.distcode,0,q.work,qt),q.distbits=qt.bits,Ot){ee.msg="invalid distances set",q.mode=Ve;break}if(q.mode=je,oe===t)break e;case je:q.mode=Ne;case Ne:if(He>=6&&fe>=258){ee.next_out=Re,ee.avail_out=fe,ee.next_in=V,ee.avail_in=He,q.hold=ke,q.bits=Xe,(0,M.default)(ee,tt),Re=ee.next_out,Ie=ee.output,fe=ee.avail_out,V=ee.next_in,me=ee.input,He=ee.avail_in,ke=q.hold,Xe=q.bits,q.mode===A&&(q.back=-1);break}for(q.back=0;!(bt=q.lencode[ke&(1<<q.lenbits)-1],dt=bt>>>24,kt=bt>>>16&255,Ft=bt&65535,dt<=Xe);){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(kt&&(kt&240)===0){for(mt=dt,$t=kt,wt=Ft;!(bt=q.lencode[wt+((ke&(1<<mt+$t)-1)>>mt)],dt=bt>>>24,kt=bt>>>16&255,Ft=bt&65535,mt+dt<=Xe);){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}ke>>>=mt,Xe-=mt,q.back+=mt}if(ke>>>=dt,Xe-=dt,q.back+=dt,q.length=Ft,kt===0){q.mode=we;break}if(kt&32){q.back=-1,q.mode=A;break}if(kt&64){ee.msg="invalid literal/length code",q.mode=Ve;break}q.extra=kt&15,q.mode=Oe;case Oe:if(q.extra){for(Pt=q.extra;Xe<Pt;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}q.length+=ke&(1<<q.extra)-1,ke>>>=q.extra,Xe-=q.extra,q.back+=q.extra}q.was=q.length,q.mode=Ke;case Ke:for(;!(bt=q.distcode[ke&(1<<q.distbits)-1],dt=bt>>>24,kt=bt>>>16&255,Ft=bt&65535,dt<=Xe);){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if((kt&240)===0){for(mt=dt,$t=kt,wt=Ft;!(bt=q.distcode[wt+((ke&(1<<mt+$t)-1)>>mt)],dt=bt>>>24,kt=bt>>>16&255,Ft=bt&65535,mt+dt<=Xe);){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}ke>>>=mt,Xe-=mt,q.back+=mt}if(ke>>>=dt,Xe-=dt,q.back+=dt,kt&64){ee.msg="invalid distance code",q.mode=Ve;break}q.offset=Ft,q.extra=kt&15,q.mode=We;case We:if(q.extra){for(Pt=q.extra;Xe<Pt;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}q.offset+=ke&(1<<q.extra)-1,ke>>>=q.extra,Xe-=q.extra,q.back+=q.extra}if(q.offset>q.dmax){ee.msg="invalid distance too far back",q.mode=Ve;break}q.mode=Te;case Te:if(fe===0)break e;if(at=tt-fe,q.offset>at){if(at=q.offset-at,at>q.whave&&q.sane){ee.msg="invalid distance too far back",q.mode=Ve;break}at>q.wnext?(at-=q.wnext,pt=q.wsize-at):pt=q.wnext-at,at>q.length&&(at=q.length),Ct=q.window}else Ct=Ie,pt=Re-q.offset,at=q.length;at>fe&&(at=fe),fe-=at,q.length-=at;do Ie[Re++]=Ct[pt++];while(--at);q.length===0&&(q.mode=Ne);break;case we:if(fe===0)break e;Ie[Re++]=q.length,fe--,q.mode=Ne;break;case ue:if(q.wrap){for(;Xe<32;){if(He===0)break e;He--,ke|=me[V++]<<Xe,Xe+=8}if(tt-=fe,ee.total_out+=tt,q.total+=tt,tt&&(ee.adler=q.check=q.flags?(0,L.default)(q.check,Ie,tt,Re-tt):(0,I.default)(q.check,Ie,tt,Re-tt)),tt=fe,(q.flags?ke:xe(ke))!==q.check){ee.msg="incorrect data check",q.mode=Ve;break}ke=0,Xe=0}q.mode=Ae;case Ae:if(q.wrap&&q.flags){for(;Xe<32;){if(He===0)break e;He--,ke+=me[V++]<<Xe,Xe+=8}if(ke!==(q.total&4294967295)){ee.msg="incorrect length check",q.mode=Ve;break}ke=0,Xe=0}q.mode=ge;case ge:Ot=s;break e;case Ve:Ot=d;break e;case Qe:return v;case ze:default:return f}return ee.next_out=Re,ee.avail_out=fe,ee.next_in=V,ee.avail_in=He,q.hold=ke,q.bits=Xe,(q.wsize||tt!==ee.avail_out&&q.mode<Ve&&(q.mode<ue||oe!==n))&&ce(ee,ee.output,ee.next_out,tt-ee.avail_out)?(q.mode=Qe,v):(ot-=ee.avail_in,tt-=ee.avail_out,ee.total_in+=ot,ee.total_out+=tt,q.total+=tt,q.wrap&&tt&&(ee.adler=q.check=q.flags?(0,L.default)(q.check,Ie,tt,ee.next_out-tt):(0,I.default)(q.check,Ie,tt,ee.next_out-tt)),ee.data_type=q.bits+(q.last?64:0)+(q.mode===A?128:0)+(q.mode===je||q.mode===O?256:0),(ot===0&&tt===0||oe===n)&&Ot===r&&(Ot=m),Ot)}function Fe(ee){if(!ee||!ee.state)return f;var oe=ee.state;return oe.window&&(oe.window=null),ee.state=null,r}function Ce(ee,oe){var q;return!ee||!ee.state?f:(q=ee.state,(q.wrap&2)===0?f:(q.head=oe,oe.done=!1,r))}function _e(ee,oe){var q=oe.length,me,Ie,V;return!ee||!ee.state?f:(me=ee.state,me.wrap!==0&&me.mode!==j?f:me.mode===j&&(Ie=1,Ie=(0,I.default)(Ie,oe,q,0),Ie!==me.check)?d:(V=ce(ee,oe,q,q),V?(me.mode=Qe,v):(me.havedict=1,r)))}var Ee="pako inflate (from Nodeca project)";re.inflateInfo=Ee},fjLI:function(it,re,Q){"use strict";Q.d(re,"f",function(){return n}),Q.d(re,"b",function(){return a}),Q.d(re,"a",function(){return t}),Q.d(re,"d",function(){return r}),Q.d(re,"e",function(){return s}),Q.d(re,"c",function(){return u});var G=Q("8HAY"),R=Q("Vhoy"),I=Q("MI8n"),L=Q("JYp7"),M=Q("pmY6"),p=Q("24hK"),E=Q("nnTU"),b=Q("T8No"),i=Q("Cg/j"),c=Q("t9D7"),o=function(f,d,v,m){var S=arguments.length,C=S<3?d:m===null?m=Object.getOwnPropertyDescriptor(d,v):m,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(f,d,v,m);else for(var y=f.length-1;y>=0;y--)(_=f[y])&&(C=(S<3?_(C):S>3?_(d,v,C):_(d,v))||C);return S>3&&C&&Object.defineProperty(d,v,C),C},h=function(f,d){return function(v,m){d(v,m,f)}};function n(f){return f.command!==void 0}class a{constructor(f){this.id=a._idPool++,this._debugName=f}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const t=Object(i.c)("menuService"),r=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new I.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:f=>f===a.CommandPalette}}addCommand(f){return this.addCommands(L.a.single(f))}addCommands(f){for(const d of f)this._commands.set(d.id,d);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(M.i)(()=>{let d=!1;for(const v of f)d=this._commands.delete(v.id)||d;d&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(f){return this._commands.get(f)}getCommands(){const f=new Map;return this._commands.forEach((d,v)=>f.set(v,d)),f}appendMenuItem(f,d){return this.appendMenuItems(L.a.single({id:f,item:d}))}appendMenuItems(f){const d=new Set,v=new p.a;for(const{id:m,item:S}of f){let C=this._menuItems.get(m);C||(C=new p.a,this._menuItems.set(m,C)),v.push(C.push(S)),d.add(m)}return this._onDidChangeMenu.fire(d),Object(M.i)(()=>{if(v.size>0){for(let m of v)m();this._onDidChangeMenu.fire(d),v.clear()}})}getMenuItems(f){let d;return this._menuItems.has(f)?d=[...this._menuItems.get(f)]:d=[],f===a.CommandPalette&&this._appendImplicitItems(d),d}_appendImplicitItems(f){const d=new Set;for(const v of f)n(v)&&(d.add(v.command.id),v.alt&&d.add(v.alt.id));this._commands.forEach((v,m)=>{d.has(m)||f.push({command:v})})}};class s extends G.e{constructor(f,d,v,m){super(`submenuitem.${f.submenu.id}`,typeof f.title=="string"?f.title:f.title.value,[],"submenu");this.item=f,this._menuService=d,this._contextKeyService=v,this._options=m}get actions(){const f=[],d=this._menuService.createMenu(this.item.submenu,this._contextKeyService),v=d.getActions(this._options);d.dispose();for(const[,m]of v)m.length>0&&(f.push(...m),f.push(new G.d));return f.length&&f.pop(),f}}let u=class f{constructor(d,v,m,S,C){var _,y;if(this._commandService=C,this.id=d.id,this.label=(m==null?void 0:m.renderShortTitle)&&d.shortTitle?typeof d.shortTitle=="string"?d.shortTitle:d.shortTitle.value:typeof d.title=="string"?d.title:d.title.value,this.tooltip=(y=typeof d.tooltip=="string"?d.tooltip:(_=d.tooltip)===null||_===void 0?void 0:_.value)!==null&&y!==void 0?y:"",this.enabled=!d.precondition||S.contextMatchesRules(d.precondition),this.checked=void 0,d.toggled){const T=d.toggled.condition?d.toggled:{condition:d.toggled};this.checked=S.contextMatchesRules(T.condition),this.checked&&T.tooltip&&(this.tooltip=typeof T.tooltip=="string"?T.tooltip:T.tooltip.value),T.title&&(this.label=typeof T.title=="string"?T.title:T.title.value)}this.item=d,this.alt=v?new f(v,void 0,m,S,C):void 0,this._options=m,c.d.isThemeIcon(d.icon)&&(this.class=R.a.asClassName(d.icon))}dispose(){}run(...d){var v,m;let S=[];return((v=this._options)===null||v===void 0?void 0:v.arg)&&(S=[...S,this._options.arg]),((m=this._options)===null||m===void 0?void 0:m.shouldForwardArgs)&&(S=[...S,...d]),this._commandService.executeCommand(this.id,...S)}};u=o([h(3,b.b),h(4,E.b)],u)},gIYZ:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={Backspace:"Backspace",AltLeft:"Alt",AltRight:"Alt",CapsLock:"CapsLock",ContextMenu:"ContextMenu",ControlLeft:"Control",ControlRight:"Control",Enter:"Enter",MetaLeft:"Meta",MetaRight:"Meta",ShiftLeft:"Shift",ShiftRight:"Shift",Tab:"Tab",Delete:"Delete",End:"End",Help:"Help",Home:"Home",Insert:"Insert",PageDown:"PageDown",PageUp:"PageUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",NumLock:"NumLock",NumpadBackspace:"Backspace",NumpadClear:"Clear",Escape:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",F13:"F13",F14:"F14",F15:"F15",F16:"F16",F17:"F17",F18:"F18",F19:"F19",F20:"F20",F21:"F21",F22:"F22",F23:"F23",F24:"F24",F25:"F25",F26:"F26",F27:"F27",F28:"F28",F29:"F29",F30:"F30",F31:"F31",F32:"F32",F33:"F33",F34:"F34",F35:"F35",PrintScreen:"PrintScreen",ScrollLock:"ScrollLock",Pause:"Pause",BrowserBack:"BrowserBack",BrowserFavorites:"BrowserFavorites",BrowserForward:"BrowserForward",BrowserHome:"BrowserHome",BrowserRefresh:"BrowserRefresh",BrowserSearch:"BrowserSearch",BrowserStop:"BrowserStop",Eject:"Eject",LaunchApp1:"LaunchMyComputer",LaunchApp2:"LaunchCalendar",LaunchMail:"LaunchMail",MediaPlayPause:"MediaPlay",MediaStop:"MediaStop",MediaTrackNext:"MediaTrackNext",MediaTrackPrevious:"MediaTrackPrevious",Power:"Power",Sleep:"Sleep",AudioVolumeDown:"AudioVolumeDown",AudioVolumeMute:"AudioVolumeMute",AudioVolumeUp:"AudioVolumeUp",WakeUp:"WakeUp"};re.default=G},h78n:function(it,re,Q){"use strict";Q.d(re,"a",function(){return N});var G=Q("q1tI"),R=Q.n(G),I=Q("TSYQ"),L=Q.n(I),M={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},p=function(A){var K=A.map(function(){return Object(G.useRef)()}),U=Object(G.useRef)();return Object(G.useEffect)(function(){var O=Date.now(),z=!1;Object.keys(K).forEach(function(te){var de=K[te].current;if(!de)return;z=!0;var be=de.style;be.transitionDuration=".3s, .3s, .3s, .06s",U.current&&O-U.current<100&&(be.transitionDuration="0s, 0s")}),z&&(U.current=Date.now())}),[K]};function E(){return E=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var K=arguments[A];for(var U in K)Object.prototype.hasOwnProperty.call(K,U)&&(j[U]=K[U])}return j},E.apply(this,arguments)}function b(j,A){return n(j)||h(j,A)||c(j,A)||i()}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(j,A){if(!j)return;if(typeof j=="string")return o(j,A);var K=Object.prototype.toString.call(j).slice(8,-1);if(K==="Object"&&j.constructor&&(K=j.constructor.name),K==="Map"||K==="Set")return Array.from(j);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return o(j,A)}function o(j,A){(A==null||A>j.length)&&(A=j.length);for(var K=0,U=new Array(A);K<A;K++)U[K]=j[K];return U}function h(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var K=[],U=!0,O=!1,z=void 0;try{for(var te=j[Symbol.iterator](),de;!(U=(de=te.next()).done)&&!(K.push(de.value),A&&K.length===A);U=!0);}catch(be){O=!0,z=be}finally{try{!U&&te.return!=null&&te.return()}finally{if(O)throw z}}return K}function n(j){if(Array.isArray(j))return j}function a(j,A){if(j==null)return{};var K=t(j,A),U,O;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(j);for(O=0;O<z.length;O++){if(U=z[O],A.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,U))continue;K[U]=j[U]}}return K}function t(j,A){if(j==null)return{};var K={},U=Object.keys(j),O,z;for(z=0;z<U.length;z++){if(O=U[z],A.indexOf(O)>=0)continue;K[O]=j[O]}return K}var r=function(A){var K=A.className,U=A.percent,O=A.prefixCls,z=A.strokeColor,te=A.strokeLinecap,de=A.strokeWidth,be=A.style,je=A.trailColor,Ne=A.trailWidth,Oe=A.transition,Ke=a(A,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ke.gapPosition;var We=Array.isArray(U)?U:[U],Te=Array.isArray(z)?z:[z],we=p(We),ue=b(we,1),Ae=ue[0],ge=de/2,Ve=100-de/2,Qe="M ".concat(te==="round"?ge:0,",").concat(ge,`
L `).concat(te==="round"?Ve:100,",").concat(ge),ze="0 0 100 ".concat(de),qe=0;return R.a.createElement("svg",E({className:L()("".concat(O,"-line"),K),viewBox:ze,preserveAspectRatio:"none",style:be},Ke),R.a.createElement("path",{className:"".concat(O,"-line-trail"),d:Qe,strokeLinecap:te,stroke:je,strokeWidth:Ne||de,fillOpacity:"0"}),We.map(function(Je,pe){var ve={strokeDasharray:"".concat(Je,"px, 100px"),strokeDashoffset:"-".concat(qe,"px"),transition:Oe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},xe=Te[pe]||Te[Te.length-1];return qe+=Je,R.a.createElement("path",{key:pe,className:"".concat(O,"-line-path"),d:Qe,strokeLinecap:te,stroke:xe,strokeWidth:de,fillOpacity:"0",ref:Ae[pe],style:ve})}))};r.defaultProps=M;var s=r;function u(){return u=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var K=arguments[A];for(var U in K)Object.prototype.hasOwnProperty.call(K,U)&&(j[U]=K[U])}return j},u.apply(this,arguments)}function f(j,A){return C(j)||S(j,A)||v(j,A)||d()}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(j,A){if(!j)return;if(typeof j=="string")return m(j,A);var K=Object.prototype.toString.call(j).slice(8,-1);if(K==="Object"&&j.constructor&&(K=j.constructor.name),K==="Map"||K==="Set")return Array.from(j);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return m(j,A)}function m(j,A){(A==null||A>j.length)&&(A=j.length);for(var K=0,U=new Array(A);K<A;K++)U[K]=j[K];return U}function S(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var K=[],U=!0,O=!1,z=void 0;try{for(var te=j[Symbol.iterator](),de;!(U=(de=te.next()).done)&&!(K.push(de.value),A&&K.length===A);U=!0);}catch(be){O=!0,z=be}finally{try{!U&&te.return!=null&&te.return()}finally{if(O)throw z}}return K}function C(j){if(Array.isArray(j))return j}function _(j,A){if(j==null)return{};var K=y(j,A),U,O;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(j);for(O=0;O<z.length;O++){if(U=z[O],A.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,U))continue;K[U]=j[U]}}return K}function y(j,A){if(j==null)return{};var K={},U=Object.keys(j),O,z;for(z=0;z<U.length;z++){if(O=U[z],A.indexOf(O)>=0)continue;K[O]=j[O]}return K}var T=0;function k(j){return+j.replace("%","")}function g(j){return Array.isArray(j)?j:[j]}function F(j,A,K,U){var O=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,z=arguments.length>5?arguments[5]:void 0,te=50-U/2,de=0,be=-te,je=0,Ne=-2*te;switch(z){case"left":de=-te,be=0,je=2*te,Ne=0;break;case"right":de=te,be=0,je=-2*te,Ne=0;break;case"bottom":be=te,Ne=2*te;break;default:}var Oe="M 50,50 m ".concat(de,",").concat(be,`
a `).concat(te,",").concat(te," 0 1 1 ").concat(je,",").concat(-Ne,`
a `).concat(te,",").concat(te," 0 1 1 ").concat(-je,",").concat(Ne),Ke=Math.PI*2*te,We={stroke:K,strokeDasharray:"".concat(A/100*(Ke-O),"px ").concat(Ke,"px"),strokeDashoffset:"-".concat(O/2+j/100*(Ke-O),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Oe,pathStyle:We}}var P=function(A){var K=A.prefixCls,U=A.strokeWidth,O=A.trailWidth,z=A.gapDegree,te=A.gapPosition,de=A.trailColor,be=A.strokeLinecap,je=A.style,Ne=A.className,Oe=A.strokeColor,Ke=A.percent,We=_(A,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Te=Object(G.useMemo)(function(){return T+=1,T},[]),we=F(0,100,de,U,z,te),ue=we.pathString,Ae=we.pathStyle,ge=g(Ke),Ve=g(Oe),Qe=Ve.find(function(ve){return Object.prototype.toString.call(ve)==="[object Object]"}),ze=p(ge),qe=f(ze,1),Je=qe[0],pe=function(){var xe=0;return ge.map(function(Se,Le){var ne=Ve[Le]||Ve[Ve.length-1],ye=Object.prototype.toString.call(ne)==="[object Object]"?"url(#".concat(K,"-gradient-").concat(Te,")"):"",se=F(xe,Se,ne,U,z,te);return xe+=Se,R.a.createElement("path",{key:Le,className:"".concat(K,"-circle-path"),d:se.pathString,stroke:ye,strokeLinecap:be,strokeWidth:U,opacity:Se===0?0:1,fillOpacity:"0",style:se.pathStyle,ref:Je[Le]})})};return R.a.createElement("svg",u({className:L()("".concat(K,"-circle"),Ne),viewBox:"0 0 100 100",style:je},We),Qe&&R.a.createElement("defs",null,R.a.createElement("linearGradient",{id:"".concat(K,"-gradient-").concat(Te),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Qe).sort(function(ve,xe){return k(ve)-k(xe)}).map(function(ve,xe){return R.a.createElement("stop",{key:xe,offset:ve,stopColor:Qe[ve]})}))),R.a.createElement("path",{className:"".concat(K,"-circle-trail"),d:ue,stroke:de,strokeLinecap:be,strokeWidth:O||U,fillOpacity:"0",style:Ae}),pe().reverse())};P.defaultProps=M;var N=P,W={Line:s,Circle:N}},hXwI:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function R(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&R(M.prototype,p),E&&R(M,E),M}var L=function(){function M(){G(this,M)}return I(M,[{key:"decodeRect",value:function(E,b,i,c,o,h,n){if(o.rQwait("COPYRECT",4))return!1;var a=o.rQshift16(),t=o.rQshift16();return h.copyImage(a,t,E,b,i,c),!0}}]),M}();re.default=L},iJb0:function(it,re,Q){"use strict";Q.r(re);var G=Q("+L6B"),R=Q("2/Rp"),I=Q("miYZ"),L=Q("tsqr"),M=Q("14J3"),p=Q("BMrR"),E=Q("jCWc"),b=Q("kPKH"),i=Q("k1fw"),c=Q("9og8"),o=Q("2qtc"),h=Q("kLXV"),n=Q("tJVT"),a=Q("PpiC"),t=Q("aHsQ"),r=Q("sGsY"),s=Q("WmNS"),u=Q.n(s),f=Q("q1tI"),d=Q.n(f),v=Q("9kvl"),m=Q("Lmeb"),S=Q("Ot1p"),C=Q("Dqnf"),_=Q("dhSg"),y=Q("MXD1"),T=Q("CFYs"),k=Q("rAM+"),g=Q("IxHN"),F=Q("bdgK"),P=Q("M8RZ"),N=Q("Ty5D"),W=Q("1dTM"),j=Q.n(W),A=Q("HBuW"),K=Q("VaU+"),U=Q.n(K),O=Q("ye1Q"),z=d.a.createElement(O.a,{style:{fontSize:24},spin:!0});function te(ue){return ue.replace(/\\u([\dA-Za-z]{4})/g,function(Ae,ge){return String.fromCharCode(parseInt("0x"+ge))})}function de(ue){ue||(ue=window.location.search);var Ae=ue.substr(1),ge={};return Ae.split("&").forEach(function(Ve){var Qe=Ve.split("=");ge[Qe[0]]=decodeURIComponent(Qe[1])}),ge}var be={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"\u5B9E\u9A8C\u73AF\u5883\u51C6\u5907\u4E2D"},je;(function(ue){ue[ue.SET_LOADING=0]="SET_LOADING",ue[ue.SET_IS_LARGE=1]="SET_IS_LARGE",ue[ue.SET_MES=2]="SET_MES",ue[ue.SET_STATE=3]="SET_STATE",ue[ue.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",ue[ue.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"})(je||(je={}));function Ne(ue,Ae){switch(Ae.type){case je.SET_LOADING:return Object(i.a)(Object(i.a)({},ue),{},{loading:Ae.payload});case je.SET_IS_LARGE:return Object(i.a)(Object(i.a)({},ue),{},{isLarge:Ae.payload});case je.SET_MES:return Object(i.a)(Object(i.a)({},ue),{},{mes:Ae.payload});case je.SET_STATE:return Object(i.a)(Object(i.a)({},ue),Ae.payload);case je.SET_TRANSFER_CONTENT:return Object(i.a)(Object(i.a)({},ue),{},{transferContent:Ae.payload});case je.SHOW_CLIPBOARD_BOX:return Object(i.a)(Object(i.a)({},ue),{},{showClipBoardBox:Ae.payload});default:throw new Error}}var Oe=function(ue){var Ae=ue.vnc_url,ge=ue.window_vnc_url,Ve=ue.taskId,Qe=Object(f.useRef)(),ze=Object(f.useRef)(),qe=Object(f.useReducer)(Ne,be),Je=Object(n.a)(qe,2),pe=Je[0],ve=Je[1],xe=Object(f.useState)(0),Se=Object(n.a)(xe,2),Le=Se[0],ne=Se[1],ye=pe.mes,se=pe.loading,Pe=pe.showClipBoardBox,Ze=pe.isLarge,et=pe.transferContent,Ge=Object(f.useState)(0),ht=Object(n.a)(Ge,2),ce=ht[0],Me=ht[1],Fe,Ce=Object(f.useRef)(),_e=Object(N.i)();function Ee(){ve({type:je.SHOW_CLIPBOARD_BOX,payload:!1})}function ee(){ve({type:je.SET_IS_LARGE,payload:!Ze})}function oe(V){var Re;return Qe.current&&(Re=new F.default(function(He){var fe=Object(k.a)(He),ke;try{for(fe.s();!(ke=fe.n()).done;){var Xe=ke.value;(Xe.target.offsetHeight>0||Xe.target.offsetWidth>0)&&V._eventHandlers.windowResize()}}catch(ot){fe.e(ot)}finally{fe.f()}}),Re.observe(Qe.current)),Re}var q=function(){var V=Object(c.a)(u.a.mark(function Re(){var He;return u.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return ke.next=2,Object(A.sb)(Object(i.a)({},_e));case 2:if(He=ke.sent,!((He==null?void 0:He.status)===-3)){ke.next=5;break}return ke.abrupt("return",new Promise(function(){var Xe=Object(c.a)(u.a.mark(function ot(tt,at){return u.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:h.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 bt=Object(c.a)(u.a.mark(function kt(){return u.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return clearTimeout(Fe),Me(0),q(),mt.abrupt("return");case 4:case"end":return mt.stop()}},kt)}));function dt(){return bt.apply(this,arguments)}return dt}()});case 1:case"end":return Ct.stop()}},ot)}));return function(ot,tt){return Xe.apply(this,arguments)}}()));case 5:if(!((He==null?void 0:He.status)===-1)){ke.next=7;break}throw new String(He==null?void 0:He.message);case 7:return _.a.publish("update-windows-time",He==null?void 0:He.data),ke.abrupt("return",He);case 9:case"end":return ke.stop()}},Re)}));return function(){return V.apply(this,arguments)}}();Object(f.useEffect)(function(){return Ce.current=setTimeout(function(){h.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(){_.a.publish("delayed-time",1),ne(Le+1)}})},1e3*60*60),function(){clearTimeout(Ce.current)}},[]),Object(f.useEffect)(function(){var V,Re;function He(at){ge&&(L.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"),ve({type:je.SET_LOADING,payload:!0}),ne(Le+1))}function fe(){clearTimeout(Fe),Me(100),setTimeout(function(){ve({type:je.SET_LOADING,payload:!1})},1300),_.a.subscribe("send-ctrl-alt-delete",function(){var at;(at=V)===null||at===void 0||at.sendCtrlAltDel()})}function ke(at){var pt=te(at.detail.text);ve({type:je.SET_TRANSFER_CONTENT,payload:pt})}if((ge||Ae)&&Qe.current){new Promise(Object(c.a)(u.a.mark(function at(){var pt,Ct,bt,dt,kt,Ft,mt,$t,wt,_t;return u.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return pt=de(),Ct="",Nt.next=4,q();case 4:dt=Nt.sent,ge?(bt="Edu123",Ct=decodeURIComponent(dt==null||((kt=dt.data)===null||kt===void 0)?void 0:kt.vnc_url)):(mt=new URL(dt==null||((Ft=dt.data)===null||Ft===void 0)?void 0:Ft.vnc_url),$t=mt.protocol,wt=mt.searchParams,_t=mt.host,bt=wt.get("password"),Ct="".concat($t==="https:"?"wss":"ws","://").concat(_t,"/").concat(pt.path||"websockify")),V=new j.a(Qe.current,Ct,{credentials:{password:bt},wsProtocols:["binary"]}),Re=oe(V),V.viewOnly=pt.view_only||!1,ge?V.scaleViewport=!0:V.scaleViewport=pt.scale||!1,V.scaleViewport=pt.scale||!0,V.resizeSession=!0,ze.current=V,V.addEventListener("disconnect",He),V.addEventListener("connect",fe),V.addEventListener("clipboard",ke);case 16:case"end":return Nt.stop()}},at)})));var Xe=_.a.subscribe("vnc-reseting",function(){ve({type:je.SET_STATE,payload:{loading:!0,mes:"\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"}})}),ot=_.a.subscribe("vnc-enlarge",function(){ve({type:je.SET_IS_LARGE,payload:!0})}),tt=_.a.subscribe("show-clipboard-box",function(){ve({type:je.SHOW_CLIPBOARD_BOX,payload:!0})});return Me(0),function(){var at,pt,Ct,bt;(at=V)===null||at===void 0||at.removeEventListener("disconnect",He),(pt=V)===null||pt===void 0||pt.removeEventListener("connect",fe),(Ct=V)===null||Ct===void 0||Ct.removeEventListener("clipboard",ke),Xe(),ot(),tt(),(bt=Re)===null||bt===void 0||bt.unobserve(Qe.current)}}},[Ae,ge,Le]);function me(V){var Re;(Re=ze.current)===null||Re===void 0||Re.clipboardPasteFrom(V),ve({type:je.SET_TRANSFER_CONTENT,payload:V}),L.b.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9"),Ee()}Object(f.useEffect)(function(){ce==0&&Ie()},[ce]);var Ie=function V(){ce>99?ce=99:(ce=ce+1,Fe=setTimeout(function(){V()},1500)),ce<100&&Me(ce)};return d.a.createElement(f.Fragment,null,d.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(ge?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(Ze?"full-screen":"")},d.a.createElement("a",{className:"btn-vnc-resize",onClick:ee},d.a.createElement("i",{className:"iconfont ".concat(Ze?"icon-tuichuquanping1":"icon-quanping1")})),se?d.a.createElement(g.a,{className:U.a.spin,message:ye,style:{color:"#0152d9"}},d.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},d.a.createElement(T.a,{percent:ce,format:function(Re){return d.a.createElement("span",{className:"c-white"},Re,"%")}}))):null,d.a.createElement("div",{ref:Qe,className:"vnc-panel ".concat(se?"hide":"animated fadeIn")})),d.a.createElement(P.a,null))},Ke=Q("m3rI"),We=r.a.Countdown,Te=function(Ae){var ge,Ve,Qe=Ae.shixunsDetail,ze=Ae.globalSetting,qe=Ae.loading,Je=Ae.dispatch,pe=Ae.user,ve=Ae.history,xe=Object(a.a)(Ae,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),Se=Object(f.useState)({}),Le=Object(n.a)(Se,2),ne=Le[0],ye=Le[1],se=Object(f.useState)(400),Pe=Object(n.a)(se,2),Ze=Pe[0],et=Pe[1],Ge=Object(f.useState)(!1),ht=Object(n.a)(Ge,2),ce=ht[0],Me=ht[1],Fe=Object(f.useState)(""),Ce=Object(n.a)(Fe,2),_e=Ce[0],Ee=Ce[1],ee=Object(f.useState)(Date.now()+1e3*60*60),oe=Object(n.a)(ee,2),q=oe[0],me=oe[1],Ie=xe.match.params,V=xe.location.query,Re=Object(f.useState)(!1),He=Object(n.a)(Re,2),fe=He[0],ke=He[1],Xe=Qe.mirrorApplies,ot=Object(f.useRef)();Object(f.useEffect)(function(){return Je({type:"globalSetting/headerFooterToggle",payload:!1}),at(),pt(),window.addEventListener("resize",at),_.a.subscribe("delayed-time",function(){me(Date.now()+1e3*60*60)}),function(){window.removeEventListener("resize",at),clearTimeout(ot.current),Je({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(f.useEffect)(function(){ne.host&&setTimeout(function(){_.a.publish("create-socket",1)},1500)},[ne]),Object(f.useEffect)(function(){Xe.webssh&&(tt(),ot.current=setTimeout(function(){h.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(){_.a.publish("ssh-add-connect-time",{}),_.a.publish("delayed-time",1)}})},1e3*60*60)),Xe.id&&at()},[Xe]);var tt=function(){var Ct=Object(c.a)(u.a.mark(function bt(){var dt;return u.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Object(A.tb)(Object(i.a)({},Ie));case 2:dt=Ft.sent,ye(Object(i.a)({},dt));case 4:case"end":return Ft.stop()}},bt)}));return function(){return Ct.apply(this,arguments)}}(),at=function(){var bt=window.innerHeight;et(bt-(Xe.audit_remark?400:270))},pt=function(){var Ct=Object(c.a)(u.a.mark(function bt(){return u.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:Je({type:"shixunsDetail/getMirrorApplies",payload:Object(i.a)({},Ie)});case 1:case"end":return kt.stop()}},bt)}));return function(){return Ct.apply(this,arguments)}}();return console.log(pe==null?void 0:pe.userInfo),d.a.createElement("section",{className:U.a.wrp},d.a.createElement("header",{className:U.a.header},d.a.createElement(p.a,{align:"middle"},d.a.createElement(b.a,{flex:"1"},d.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"40",src:"".concat(Ke.a.IMG_SERVER,"/images/").concat(pe==null||((ge=pe.userInfo)===null||ge===void 0)?void 0:ge.image_url),width:"40",style:{borderRadius:"50%"}}),d.a.createElement("span",{className:"ml10"},pe==null||((Ve=pe.userInfo)===null||Ve===void 0)?void 0:Ve.real_name)),d.a.createElement(b.a,{flex:"1"},d.a.createElement("span",{className:"mr10 font18"},Xe.name)),d.a.createElement(b.a,null,d.a.createElement("span",null,"\u5269\u4F59\u65F6\u957F:",d.a.createElement(We,{className:U.a.cuttDown,value:q,format:"mm:ss",valueStyle:{color:"#FFF"}})),d.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){h.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 dt;ve.push("/users/".concat((dt=pe.userInfo)===null||dt===void 0?void 0:dt.login,"/experiment-img"))}})}})))),d.a.createElement("aside",{className:U.a.container},d.a.createElement(p.a,null,d.a.createElement(b.a,{style:{position:"relative",width:fe?"0%":"40%"}},d.a.createElement("section",{className:"".concat(U.a.info," ml40 mr40"),style:{display:fe?"none":"flex"}},d.a.createElement("aside",null,d.a.createElement(p.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},d.a.createElement(b.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:Ze,defaultValue:Xe.description||"",onChange:function(bt){return Ee(bt)}}),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(p.a,{justify:"center",gutter:[20,20],className:U.a.buttons},d.a.createElement(b.a,null,d.a.createElement(R.a,{type:"primary",size:"large",loading:ce,onClick:Object(c.a)(u.a.mark(function Ct(){var bt;return u.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return Me(!0),h.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(A.vb)(Object(i.a)(Object(i.a)({},Ie),{},{description:_e}));case 4:bt=kt.sent,(bt==null?void 0:bt.status)===0&&L.b.success("\u4FDD\u5B58\u6210\u529F"),Me(!1);case 7:case"end":return kt.stop()}},Ct)}))},"\u4FDD\u5B58")),d.a.createElement(b.a,null,d.a.createElement(R.a,{type:"primary",ghost:!0,size:"large",onClick:Object(c.a)(u.a.mark(function Ct(){return u.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:h.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(c.a)(u.a.mark(function mt(){var $t,wt;return u.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:return Ot.next=2,Object(A.ub)(Object(i.a)(Object(i.a)({},Ie),{},{description:_e}));case 2:$t=Ot.sent,($t==null?void 0:$t.status)===0&&(ve.push("/users/".concat((wt=pe.userInfo)===null||wt===void 0?void 0:wt.login,"/experiment-img")),L.b.success("\u7533\u8BF7\u53D1\u5E03\u6210\u529F"));case 4:case"end":return Ot.stop()}},mt)}));function Ft(){return kt.apply(this,arguments)}return Ft}()});case 1:case"end":return dt.stop()}},Ct)}))},"\u7533\u8BF7\u53D1\u5E03")))))),d.a.createElement("div",{className:fe?U.a.elseShrink:U.a.shrink,onClick:function(){return ke(!fe)}},d.a.createElement("i",{className:"iconfont icon-cela"}))),d.a.createElement(b.a,{style:{background:"#000",width:fe?"100%":"60%"}},d.a.createElement("div",null,d.a.createElement("aside",{className:U.a.fullBtn},d.a.createElement("span",{className:"icon-quanping"})),Xe.webssh&&d.a.createElement(C.a,{sshConfigData:ne,sid:1}),((Xe==null?void 0:Xe.vnc)||(Xe==null?void 0:Xe.windows))&&d.a.createElement(Oe,{taskId:Xe.type==="windows"?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:Xe.vnc,window_vnc_url:Xe.windows}))))))},we=re.default=Object(v.a)(function(ue){var Ae=ue.shixunsDetail,ge=ue.loading,Ve=ue.user,Qe=ue.globalSetting;return{shixunsDetail:Ae,globalSetting:Qe,user:Ve,loading:ge.models.shixunsDetail}})(Te)},iUHT:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(m,S){if(!(m instanceof S))throw new TypeError("Cannot call a class as a function")}function R(m,S){for(var C=0;C<S.length;C++){var _=S[C];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}function I(m,S,C){return S&&R(m.prototype,S),C&&R(m,C),m}var L=[13,16,10,23,0,4,2,27,14,5,20,9,22,18,11,3,25,7,15,6,26,19,12,1,40,51,30,36,46,54,29,39,50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31],M=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],p=0,E,b,i,c,o,h;E=1<<16,b=1<<24,i=E|b,c=1<<2,o=1<<10,h=c|o;var n=[i|o,p|p,E|p,i|h,i|c,E|h,p|c,E|p,p|o,i|o,i|h,p|o,b|h,i|c,b|p,p|c,p|h,b|o,b|o,E|o,E|o,i|p,i|p,b|h,E|c,b|c,b|c,E|c,p|p,p|h,E|h,b|p,E|p,i|h,p|c,i|p,i|o,b|p,b|p,p|o,i|c,E|p,E|o,b|c,p|o,p|c,b|h,E|h,i|h,E|c,i|p,b|h,b|c,p|h,E|h,i|o,p|h,b|o,b|o,p|p,E|c,E|o,p|p,i|c];E=1<<20,b=1<<31,i=E|b,c=1<<5,o=1<<15,h=c|o;var a=[i|h,b|o,p|o,E|h,E|p,p|c,i|c,b|h,b|c,i|h,i|o,b|p,b|o,E|p,p|c,i|c,E|o,E|c,b|h,p|p,b|p,p|o,E|h,i|p,E|c,b|c,p|p,E|o,p|h,i|o,i|p,p|h,p|p,E|h,i|c,E|p,b|h,i|p,i|o,p|o,i|p,b|o,p|c,i|h,E|h,p|c,p|o,b|p,p|h,i|o,E|p,b|c,E|c,b|h,b|c,E|c,E|o,p|p,b|o,p|h,b|p,i|c,i|h,E|o];E=1<<17,b=1<<27,i=E|b,c=1<<3,o=1<<9,h=c|o;var t=[p|h,i|o,p|p,i|c,b|o,p|p,E|h,b|o,E|c,b|c,b|c,E|p,i|h,E|c,i|p,p|h,b|p,p|c,i|o,p|o,E|o,i|p,i|c,E|h,b|h,E|o,E|p,b|h,p|c,i|h,p|o,b|p,i|o,b|p,E|c,p|h,E|p,i|o,b|o,p|p,p|o,E|c,i|h,b|o,b|c,p|o,p|p,i|c,b|h,E|p,b|p,i|h,p|c,E|h,E|o,b|c,i|p,b|h,p|h,i|p,E|h,p|c,i|c,E|o];E=1<<13,b=1<<23,i=E|b,c=1<<0,o=1<<7,h=c|o;var r=[i|c,E|h,E|h,p|o,i|o,b|h,b|c,E|c,p|p,i|p,i|p,i|h,p|h,p|p,b|o,b|c,p|c,E|p,b|p,i|c,p|o,b|p,E|c,E|o,b|h,p|c,E|o,b|o,E|p,i|o,i|h,p|h,b|o,b|c,i|p,i|h,p|h,p|p,p|p,i|p,E|o,b|o,b|h,p|c,i|c,E|h,E|h,p|o,i|h,p|h,p|c,E|p,b|c,E|c,i|o,b|h,E|c,E|o,b|p,i|c,p|o,b|p,E|p,i|o];E=1<<25,b=1<<30,i=E|b,c=1<<8,o=1<<19,h=c|o;var s=[p|c,E|h,E|o,i|c,p|o,p|c,b|p,E|o,b|h,p|o,E|c,b|h,i|c,i|o,p|h,b|p,E|p,b|o,b|o,p|p,b|c,i|h,i|h,E|c,i|o,b|c,p|p,i|p,E|h,E|p,i|p,p|h,p|o,i|c,p|c,E|p,b|p,E|o,i|c,b|h,E|c,b|p,i|o,E|h,b|h,p|c,E|p,i|o,i|h,p|h,i|p,i|h,E|o,p|p,b|o,i|p,p|h,E|c,b|c,p|o,p|p,b|o,E|h,b|c];E=1<<22,b=1<<29,i=E|b,c=1<<4,o=1<<14,h=c|o;var u=[b|c,i|p,p|o,i|h,i|p,p|c,i|h,E|p,b|o,E|h,E|p,b|c,E|c,b|o,b|p,p|h,p|p,E|c,b|h,p|o,E|o,b|h,p|c,i|c,i|c,p|p,E|h,i|o,p|h,E|o,i|o,b|p,b|o,p|c,i|c,E|o,i|h,E|p,p|h,b|c,E|p,b|o,b|p,p|h,b|c,i|h,E|o,i|p,E|h,i|o,p|p,i|c,p|c,p|o,i|p,E|h,p|o,E|c,b|h,p|p,i|o,b|p,E|c,b|h];E=1<<21,b=1<<26,i=E|b,c=1<<1,o=1<<11,h=c|o;var f=[E|p,i|c,b|h,p|p,p|o,b|h,E|h,i|o,i|h,E|p,p|p,b|c,p|c,b|p,i|c,p|h,b|o,E|h,E|c,b|o,b|c,i|p,i|o,E|c,i|p,p|o,p|h,i|h,E|o,p|c,b|p,E|o,b|p,E|o,E|p,b|h,b|h,i|c,i|c,p|c,E|c,b|p,b|o,E|p,i|o,p|h,E|h,i|o,p|h,b|c,i|h,i|p,E|o,p|p,p|c,i|h,p|p,E|h,i|p,p|o,b|c,b|o,p|o,E|c];E=1<<18,b=1<<28,i=E|b,c=1<<6,o=1<<12,h=c|o;var d=[b|h,p|o,E|p,i|h,b|p,b|h,p|c,b|p,E|c,i|p,i|h,E|o,i|o,E|h,p|o,p|c,i|p,b|c,b|o,p|h,E|o,E|c,i|c,i|o,p|h,p|p,p|p,i|c,b|c,b|o,E|h,E|p,E|h,E|p,i|o,p|o,p|c,i|c,p|o,E|h,b|o,p|c,b|c,i|p,i|c,b|p,E|p,b|h,p|p,i|h,E|c,b|c,i|p,b|o,b|h,p|p,i|h,E|o,E|o,p|h,p|h,E|c,b|p,i|o],v=function(){function m(S){G(this,m),this.keys=[];for(var C=[],_=[],y=[],T=0,k=56;T<56;++T,k-=8){k+=k<-5?65:k<-3?31:k<-1?63:k===27?35:0;var g=k&7;C[T]=(S[k>>>3]&1<<g)!==0?1:0}for(var F=0;F<16;++F){var P=F<<1,N=P+1;y[P]=y[N]=0;for(var W=28;W<59;W+=28)for(var j=W-28;j<W;++j){var A=j+M[F];_[j]=A<W?C[A]:C[A-28]}for(var K=0;K<24;++K)_[L[K]]!==0&&(y[P]|=1<<23-K),_[L[K+24]]!==0&&(y[N]|=1<<23-K)}for(var U=0,O=0,z=0;U<16;++U){var te=y[O++],de=y[O++];this.keys[z]=(te&16515072)<<6,this.keys[z]|=(te&4032)<<10,this.keys[z]|=(de&16515072)>>>10,this.keys[z]|=(de&4032)>>>6,++z,this.keys[z]=(te&258048)<<12,this.keys[z]|=(te&63)<<16,this.keys[z]|=(de&258048)>>>4,this.keys[z]|=de&63,++z}}return I(m,[{key:"enc8",value:function(C){var _=C.slice(),y=0,T,k,g;T=_[y++]<<24|_[y++]<<16|_[y++]<<8|_[y++],k=_[y++]<<24|_[y++]<<16|_[y++]<<8|_[y++],g=(T>>>4^k)&252645135,k^=g,T^=g<<4,g=(T>>>16^k)&65535,k^=g,T^=g<<16,g=(k>>>2^T)&858993459,T^=g,k^=g<<2,g=(k>>>8^T)&16711935,T^=g,k^=g<<8,k=k<<1|k>>>31&1,g=(T^k)&2863311530,T^=g,k^=g,T=T<<1|T>>>31&1;for(var F=0,P=0;F<8;++F){g=k<<28|k>>>4,g^=this.keys[P++];var N=f[g&63];N|=s[g>>>8&63],N|=t[g>>>16&63],N|=n[g>>>24&63],g=k^this.keys[P++],N|=d[g&63],N|=u[g>>>8&63],N|=r[g>>>16&63],N|=a[g>>>24&63],T^=N,g=T<<28|T>>>4,g^=this.keys[P++],N=f[g&63],N|=s[g>>>8&63],N|=t[g>>>16&63],N|=n[g>>>24&63],g=T^this.keys[P++],N|=d[g&63],N|=u[g>>>8&63],N|=r[g>>>16&63],N|=a[g>>>24&63],k^=N}for(k=k<<31|k>>>1,g=(T^k)&2863311530,T^=g,k^=g,T=T<<31|T>>>1,g=(T>>>8^k)&16711935,k^=g,T^=g<<8,g=(T>>>2^k)&858993459,k^=g,T^=g<<2,g=(k>>>16^T)&65535,T^=g,k^=g<<16,g=(k>>>4^T)&252645135,T^=g,k^=g<<4,g=[k,T],y=0;y<8;y++)_[y]=(g[y>>>2]>>>8*(3-y%4))%256,_[y]<0&&(_[y]+=256);return _}},{key:"encrypt",value:function(C){return this.enc8(C.slice(0,8)).concat(this.enc8(C.slice(8,16)))}}]),m}();re.default=v},ic2d:function(it,re,Q){"use strict";Q.d(re,"a",function(){return L});var G=Q("FWmy"),R=Q("746U");class I{constructor(){this.data=new Map}add(M,p){G.a(R.l(M)),G.a(R.k(p)),G.a(!this.data.has(M),"There is already an extension with this id"),this.data.set(M,p)}as(M){return this.data.get(M)||null}}const L=new I},kSUc:function(it,re,Q){},lNSK:function(it,re,Q){"use strict";function G(V){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(He){return typeof He}:G=function(He){return He&&typeof Symbol=="function"&&He.constructor===Symbol&&He!==Symbol.prototype?"symbol":typeof He},G(V)}Object.defineProperty(re,"__esModule",{value:!0}),re.deflateInit=ee,re.deflateInit2=Ee,re.deflateReset=Ce,re.deflateResetKeep=Fe,re.deflateSetHeader=_e,re.deflate=oe,re.deflateEnd=q,re.deflateSetDictionary=me,re.deflateInfo=re.Z_DEFLATED=re.Z_UNKNOWN=re.Z_DEFAULT_STRATEGY=re.Z_FIXED=re.Z_RLE=re.Z_HUFFMAN_ONLY=re.Z_FILTERED=re.Z_DEFAULT_COMPRESSION=re.Z_BUF_ERROR=re.Z_DATA_ERROR=re.Z_STREAM_ERROR=re.Z_STREAM_END=re.Z_OK=re.Z_BLOCK=re.Z_FINISH=re.Z_FULL_FLUSH=re.Z_PARTIAL_FLUSH=re.Z_NO_FLUSH=void 0;var R=i(Q("6BzB")),I=i(Q("c5fP")),L=E(Q("xlC8")),M=E(Q("QV2g")),p=E(Q("xSIq"));function E(V){return V&&V.__esModule?V:{default:V}}function b(){if(typeof WeakMap!="function")return null;var V=new WeakMap;return b=function(){return V},V}function i(V){if(V&&V.__esModule)return V;if(V===null||G(V)!=="object"&&typeof V!="function")return{default:V};var Re=b();if(Re&&Re.has(V))return Re.get(V);var He={},fe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ke in V)if(Object.prototype.hasOwnProperty.call(V,ke)){var Xe=fe?Object.getOwnPropertyDescriptor(V,ke):null;Xe&&(Xe.get||Xe.set)?Object.defineProperty(He,ke,Xe):He[ke]=V[ke]}return He.default=V,Re&&Re.set(V,He),He}var c=0;re.Z_NO_FLUSH=c;var o=1;re.Z_PARTIAL_FLUSH=o;var h=3;re.Z_FULL_FLUSH=h;var n=4;re.Z_FINISH=n;var a=5;re.Z_BLOCK=a;var t=0;re.Z_OK=t;var r=1;re.Z_STREAM_END=r;var s=-2;re.Z_STREAM_ERROR=s;var u=-3;re.Z_DATA_ERROR=u;var f=-5;re.Z_BUF_ERROR=f;var d=-1;re.Z_DEFAULT_COMPRESSION=d;var v=1;re.Z_FILTERED=v;var m=2;re.Z_HUFFMAN_ONLY=m;var S=3;re.Z_RLE=S;var C=4;re.Z_FIXED=C;var _=0;re.Z_DEFAULT_STRATEGY=_;var y=2;re.Z_UNKNOWN=y;var T=8;re.Z_DEFLATED=T;var k=9,g=15,F=8,P=29,N=256,W=N+1+P,j=30,A=19,K=2*W+1,U=15,O=3,z=258,te=z+O+1,de=32,be=42,je=69,Ne=73,Oe=91,Ke=103,We=113,Te=666,we=1,ue=2,Ae=3,ge=4,Ve=3;function Qe(V,Re){return V.msg=p.default[Re],Re}function ze(V){return(V<<1)-(V>4?9:0)}function qe(V){for(var Re=V.length;--Re>=0;)V[Re]=0}function Je(V){var Re=V.state,He=Re.pending;if(He>V.avail_out&&(He=V.avail_out),He===0)return;R.arraySet(V.output,Re.pending_buf,Re.pending_out,He,V.next_out),V.next_out+=He,Re.pending_out+=He,V.total_out+=He,V.avail_out-=He,Re.pending-=He,Re.pending===0&&(Re.pending_out=0)}function pe(V,Re){I._tr_flush_block(V,V.block_start>=0?V.block_start:-1,V.strstart-V.block_start,Re),V.block_start=V.strstart,Je(V.strm)}function ve(V,Re){V.pending_buf[V.pending++]=Re}function xe(V,Re){V.pending_buf[V.pending++]=Re>>>8&255,V.pending_buf[V.pending++]=Re&255}function Se(V,Re,He,fe){var ke=V.avail_in;return ke>fe&&(ke=fe),ke===0?0:(V.avail_in-=ke,R.arraySet(Re,V.input,V.next_in,ke,He),V.state.wrap===1?V.adler=(0,L.default)(V.adler,Re,ke,He):V.state.wrap===2&&(V.adler=(0,M.default)(V.adler,Re,ke,He)),V.next_in+=ke,V.total_in+=ke,ke)}function Le(V,Re){var He=V.max_chain_length,fe=V.strstart,ke,Xe,ot=V.prev_length,tt=V.nice_match,at=V.strstart>V.w_size-te?V.strstart-(V.w_size-te):0,pt=V.window,Ct=V.w_mask,bt=V.prev,dt=V.strstart+z,kt=pt[fe+ot-1],Ft=pt[fe+ot];V.prev_length>=V.good_match&&(He>>=2),tt>V.lookahead&&(tt=V.lookahead);do{if(ke=Re,pt[ke+ot]!==Ft||pt[ke+ot-1]!==kt||pt[ke]!==pt[fe]||pt[++ke]!==pt[fe+1])continue;fe+=2,ke++;do;while(pt[++fe]===pt[++ke]&&pt[++fe]===pt[++ke]&&pt[++fe]===pt[++ke]&&pt[++fe]===pt[++ke]&&pt[++fe]===pt[++ke]&&pt[++fe]===pt[++ke]&&pt[++fe]===pt[++ke]&&pt[++fe]===pt[++ke]&&fe<dt);if(Xe=z-(dt-fe),fe=dt-z,Xe>ot){if(V.match_start=Re,ot=Xe,Xe>=tt)break;kt=pt[fe+ot-1],Ft=pt[fe+ot]}}while((Re=bt[Re&Ct])>at&&--He!==0);return ot<=V.lookahead?ot:V.lookahead}function ne(V){var Re=V.w_size,He,fe,ke,Xe,ot;do{if(Xe=V.window_size-V.lookahead-V.strstart,V.strstart>=Re+(Re-te)){R.arraySet(V.window,V.window,Re,Re,0),V.match_start-=Re,V.strstart-=Re,V.block_start-=Re,fe=V.hash_size,He=fe;do ke=V.head[--He],V.head[He]=ke>=Re?ke-Re:0;while(--fe);fe=Re,He=fe;do ke=V.prev[--He],V.prev[He]=ke>=Re?ke-Re:0;while(--fe);Xe+=Re}if(V.strm.avail_in===0)break;if(fe=Se(V.strm,V.window,V.strstart+V.lookahead,Xe),V.lookahead+=fe,V.lookahead+V.insert>=O)for(ot=V.strstart-V.insert,V.ins_h=V.window[ot],V.ins_h=(V.ins_h<<V.hash_shift^V.window[ot+1])&V.hash_mask;V.insert&&!(V.ins_h=(V.ins_h<<V.hash_shift^V.window[ot+O-1])&V.hash_mask,V.prev[ot&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=ot,ot++,V.insert--,V.lookahead+V.insert<O););}while(V.lookahead<te&&V.strm.avail_in!==0)}function ye(V,Re){var He=65535;for(He>V.pending_buf_size-5&&(He=V.pending_buf_size-5);;){if(V.lookahead<=1){if(ne(V),V.lookahead===0&&Re===c)return we;if(V.lookahead===0)break}V.strstart+=V.lookahead,V.lookahead=0;var fe=V.block_start+He;if((V.strstart===0||V.strstart>=fe)&&(V.lookahead=V.strstart-fe,V.strstart=fe,pe(V,!1),V.strm.avail_out===0))return we;if(V.strstart-V.block_start>=V.w_size-te&&(pe(V,!1),V.strm.avail_out===0))return we}return V.insert=0,Re===n?(pe(V,!0),V.strm.avail_out===0?Ae:ge):(V.strstart>V.block_start&&(pe(V,!1),V.strm.avail_out===0),we)}function se(V,Re){for(var He,fe;;){if(V.lookahead<te){if(ne(V),V.lookahead<te&&Re===c)return we;if(V.lookahead===0)break}if(He=0,V.lookahead>=O&&(V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+O-1])&V.hash_mask,He=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart),He!==0&&V.strstart-He<=V.w_size-te&&(V.match_length=Le(V,He)),V.match_length>=O)if(fe=I._tr_tally(V,V.strstart-V.match_start,V.match_length-O),V.lookahead-=V.match_length,V.match_length<=V.max_lazy_match&&V.lookahead>=O){V.match_length--;do V.strstart++,V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+O-1])&V.hash_mask,He=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart;while(--V.match_length!==0);V.strstart++}else V.strstart+=V.match_length,V.match_length=0,V.ins_h=V.window[V.strstart],V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+1])&V.hash_mask;else fe=I._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++;if(fe&&(pe(V,!1),V.strm.avail_out===0))return we}return V.insert=V.strstart<O-1?V.strstart:O-1,Re===n?(pe(V,!0),V.strm.avail_out===0?Ae:ge):V.last_lit&&(pe(V,!1),V.strm.avail_out===0)?we:ue}function Pe(V,Re){for(var He,fe,ke;;){if(V.lookahead<te){if(ne(V),V.lookahead<te&&Re===c)return we;if(V.lookahead===0)break}if(He=0,V.lookahead>=O&&(V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+O-1])&V.hash_mask,He=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart),V.prev_length=V.match_length,V.prev_match=V.match_start,V.match_length=O-1,He!==0&&V.prev_length<V.max_lazy_match&&V.strstart-He<=V.w_size-te&&(V.match_length=Le(V,He),V.match_length<=5&&(V.strategy===v||V.match_length===O&&V.strstart-V.match_start>4096)&&(V.match_length=O-1)),V.prev_length>=O&&V.match_length<=V.prev_length){ke=V.strstart+V.lookahead-O,fe=I._tr_tally(V,V.strstart-1-V.prev_match,V.prev_length-O),V.lookahead-=V.prev_length-1,V.prev_length-=2;do++V.strstart<=ke&&(V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+O-1])&V.hash_mask,He=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart);while(--V.prev_length!==0);if(V.match_available=0,V.match_length=O-1,V.strstart++,fe&&(pe(V,!1),V.strm.avail_out===0))return we}else if(V.match_available){if(fe=I._tr_tally(V,0,V.window[V.strstart-1]),fe&&pe(V,!1),V.strstart++,V.lookahead--,V.strm.avail_out===0)return we}else V.match_available=1,V.strstart++,V.lookahead--}return V.match_available&&(fe=I._tr_tally(V,0,V.window[V.strstart-1]),V.match_available=0),V.insert=V.strstart<O-1?V.strstart:O-1,Re===n?(pe(V,!0),V.strm.avail_out===0?Ae:ge):V.last_lit&&(pe(V,!1),V.strm.avail_out===0)?we:ue}function Ze(V,Re){for(var He,fe,ke,Xe,ot=V.window;;){if(V.lookahead<=z){if(ne(V),V.lookahead<=z&&Re===c)return we;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=O&&V.strstart>0&&(ke=V.strstart-1,fe=ot[ke],fe===ot[++ke]&&fe===ot[++ke]&&fe===ot[++ke])){Xe=V.strstart+z;do;while(fe===ot[++ke]&&fe===ot[++ke]&&fe===ot[++ke]&&fe===ot[++ke]&&fe===ot[++ke]&&fe===ot[++ke]&&fe===ot[++ke]&&fe===ot[++ke]&&ke<Xe);V.match_length=z-(Xe-ke),V.match_length>V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=O?(He=I._tr_tally(V,1,V.match_length-O),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(He=I._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),He&&(pe(V,!1),V.strm.avail_out===0))return we}return V.insert=0,Re===n?(pe(V,!0),V.strm.avail_out===0?Ae:ge):V.last_lit&&(pe(V,!1),V.strm.avail_out===0)?we:ue}function et(V,Re){for(var He;;){if(V.lookahead===0&&(ne(V),V.lookahead===0)){if(Re===c)return we;break}if(V.match_length=0,He=I._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,He&&(pe(V,!1),V.strm.avail_out===0))return we}return V.insert=0,Re===n?(pe(V,!0),V.strm.avail_out===0?Ae:ge):V.last_lit&&(pe(V,!1),V.strm.avail_out===0)?we:ue}function Ge(V,Re,He,fe,ke){this.good_length=V,this.max_lazy=Re,this.nice_length=He,this.max_chain=fe,this.func=ke}var ht;ht=[new Ge(0,0,0,0,ye),new Ge(4,4,8,4,se),new Ge(4,5,16,8,se),new Ge(4,6,32,32,se),new Ge(4,4,16,16,Pe),new Ge(8,16,32,32,Pe),new Ge(8,16,128,128,Pe),new Ge(8,32,128,256,Pe),new Ge(32,128,258,1024,Pe),new Ge(32,258,258,4096,Pe)];function ce(V){V.window_size=2*V.w_size,qe(V.head),V.max_lazy_match=ht[V.level].max_lazy,V.good_match=ht[V.level].good_length,V.nice_match=ht[V.level].nice_length,V.max_chain_length=ht[V.level].max_chain,V.strstart=0,V.block_start=0,V.lookahead=0,V.insert=0,V.match_length=V.prev_length=O-1,V.match_available=0,V.ins_h=0}function Me(){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 R.Buf16(K*2),this.dyn_dtree=new R.Buf16((2*j+1)*2),this.bl_tree=new R.Buf16((2*A+1)*2),qe(this.dyn_ltree),qe(this.dyn_dtree),qe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(U+1),this.heap=new R.Buf16(2*W+1),qe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*W+1),qe(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 Fe(V){var Re;return!V||!V.state?Qe(V,s):(V.total_in=V.total_out=0,V.data_type=y,Re=V.state,Re.pending=0,Re.pending_out=0,Re.wrap<0&&(Re.wrap=-Re.wrap),Re.status=Re.wrap?be:We,V.adler=Re.wrap===2?0:1,Re.last_flush=c,I._tr_init(Re),t)}function Ce(V){var Re=Fe(V);return Re===t&&ce(V.state),Re}function _e(V,Re){return!V||!V.state||V.state.wrap!==2?s:(V.state.gzhead=Re,t)}function Ee(V,Re,He,fe,ke,Xe){if(!V)return s;var ot=1;if(Re===d&&(Re=6),fe<0?(ot=0,fe=-fe):fe>15&&(ot=2,fe-=16),ke<1||ke>k||He!==T||fe<8||fe>15||Re<0||Re>9||Xe<0||Xe>C)return Qe(V,s);fe===8&&(fe=9);var tt=new Me;return V.state=tt,tt.strm=V,tt.wrap=ot,tt.gzhead=null,tt.w_bits=fe,tt.w_size=1<<tt.w_bits,tt.w_mask=tt.w_size-1,tt.hash_bits=ke+7,tt.hash_size=1<<tt.hash_bits,tt.hash_mask=tt.hash_size-1,tt.hash_shift=~~((tt.hash_bits+O-1)/O),tt.window=new R.Buf8(tt.w_size*2),tt.head=new R.Buf16(tt.hash_size),tt.prev=new R.Buf16(tt.w_size),tt.lit_bufsize=1<<ke+6,tt.pending_buf_size=tt.lit_bufsize*4,tt.pending_buf=new R.Buf8(tt.pending_buf_size),tt.d_buf=1*tt.lit_bufsize,tt.l_buf=(1+2)*tt.lit_bufsize,tt.level=Re,tt.strategy=Xe,tt.method=He,Ce(V)}function ee(V,Re){return Ee(V,Re,T,g,F,_)}function oe(V,Re){var He,fe,ke,Xe;if(!V||!V.state||Re>a||Re<0)return V?Qe(V,s):s;if(fe=V.state,!V.output||!V.input&&V.avail_in!==0||fe.status===Te&&Re!==n)return Qe(V,V.avail_out===0?f:s);if(fe.strm=V,He=fe.last_flush,fe.last_flush=Re,fe.status===be)if(fe.wrap===2)V.adler=0,ve(fe,31),ve(fe,139),ve(fe,8),fe.gzhead?(ve(fe,(fe.gzhead.text?1:0)+(fe.gzhead.hcrc?2:0)+(fe.gzhead.extra?4:0)+(fe.gzhead.name?8:0)+(fe.gzhead.comment?16:0)),ve(fe,fe.gzhead.time&255),ve(fe,fe.gzhead.time>>8&255),ve(fe,fe.gzhead.time>>16&255),ve(fe,fe.gzhead.time>>24&255),ve(fe,fe.level===9?2:fe.strategy>=m||fe.level<2?4:0),ve(fe,fe.gzhead.os&255),fe.gzhead.extra&&fe.gzhead.extra.length&&(ve(fe,fe.gzhead.extra.length&255),ve(fe,fe.gzhead.extra.length>>8&255)),fe.gzhead.hcrc&&(V.adler=(0,M.default)(V.adler,fe.pending_buf,fe.pending,0)),fe.gzindex=0,fe.status=je):(ve(fe,0),ve(fe,0),ve(fe,0),ve(fe,0),ve(fe,0),ve(fe,fe.level===9?2:fe.strategy>=m||fe.level<2?4:0),ve(fe,Ve),fe.status=We);else{var ot=T+(fe.w_bits-8<<4)<<8,tt=-1;fe.strategy>=m||fe.level<2?tt=0:fe.level<6?tt=1:fe.level===6?tt=2:tt=3,ot|=tt<<6,fe.strstart!==0&&(ot|=de),ot+=31-ot%31,fe.status=We,xe(fe,ot),fe.strstart!==0&&(xe(fe,V.adler>>>16),xe(fe,V.adler&65535)),V.adler=1}if(fe.status===je)if(fe.gzhead.extra){for(ke=fe.pending;fe.gzindex<(fe.gzhead.extra.length&65535)&&!(fe.pending===fe.pending_buf_size&&(fe.gzhead.hcrc&&fe.pending>ke&&(V.adler=(0,M.default)(V.adler,fe.pending_buf,fe.pending-ke,ke)),Je(V),ke=fe.pending,fe.pending===fe.pending_buf_size));)ve(fe,fe.gzhead.extra[fe.gzindex]&255),fe.gzindex++;fe.gzhead.hcrc&&fe.pending>ke&&(V.adler=(0,M.default)(V.adler,fe.pending_buf,fe.pending-ke,ke)),fe.gzindex===fe.gzhead.extra.length&&(fe.gzindex=0,fe.status=Ne)}else fe.status=Ne;if(fe.status===Ne)if(fe.gzhead.name){ke=fe.pending;do{if(fe.pending===fe.pending_buf_size&&(fe.gzhead.hcrc&&fe.pending>ke&&(V.adler=(0,M.default)(V.adler,fe.pending_buf,fe.pending-ke,ke)),Je(V),ke=fe.pending,fe.pending===fe.pending_buf_size)){Xe=1;break}fe.gzindex<fe.gzhead.name.length?Xe=fe.gzhead.name.charCodeAt(fe.gzindex++)&255:Xe=0,ve(fe,Xe)}while(Xe!==0);fe.gzhead.hcrc&&fe.pending>ke&&(V.adler=(0,M.default)(V.adler,fe.pending_buf,fe.pending-ke,ke)),Xe===0&&(fe.gzindex=0,fe.status=Oe)}else fe.status=Oe;if(fe.status===Oe)if(fe.gzhead.comment){ke=fe.pending;do{if(fe.pending===fe.pending_buf_size&&(fe.gzhead.hcrc&&fe.pending>ke&&(V.adler=(0,M.default)(V.adler,fe.pending_buf,fe.pending-ke,ke)),Je(V),ke=fe.pending,fe.pending===fe.pending_buf_size)){Xe=1;break}fe.gzindex<fe.gzhead.comment.length?Xe=fe.gzhead.comment.charCodeAt(fe.gzindex++)&255:Xe=0,ve(fe,Xe)}while(Xe!==0);fe.gzhead.hcrc&&fe.pending>ke&&(V.adler=(0,M.default)(V.adler,fe.pending_buf,fe.pending-ke,ke)),Xe===0&&(fe.status=Ke)}else fe.status=Ke;if(fe.status===Ke&&(fe.gzhead.hcrc?(fe.pending+2>fe.pending_buf_size&&Je(V),fe.pending+2<=fe.pending_buf_size&&(ve(fe,V.adler&255),ve(fe,V.adler>>8&255),V.adler=0,fe.status=We)):fe.status=We),fe.pending!==0){if(Je(V),V.avail_out===0)return fe.last_flush=-1,t}else if(V.avail_in===0&&ze(Re)<=ze(He)&&Re!==n)return Qe(V,f);if(fe.status===Te&&V.avail_in!==0)return Qe(V,f);if(V.avail_in!==0||fe.lookahead!==0||Re!==c&&fe.status!==Te){var at=fe.strategy===m?et(fe,Re):fe.strategy===S?Ze(fe,Re):ht[fe.level].func(fe,Re);if((at===Ae||at===ge)&&(fe.status=Te),at===we||at===Ae)return V.avail_out===0&&(fe.last_flush=-1),t;if(at===ue&&(Re===o?I._tr_align(fe):Re!==a&&(I._tr_stored_block(fe,0,0,!1),Re===h&&(qe(fe.head),fe.lookahead===0&&(fe.strstart=0,fe.block_start=0,fe.insert=0))),Je(V),V.avail_out===0))return fe.last_flush=-1,t}return Re!==n?t:fe.wrap<=0?r:(fe.wrap===2?(ve(fe,V.adler&255),ve(fe,V.adler>>8&255),ve(fe,V.adler>>16&255),ve(fe,V.adler>>24&255),ve(fe,V.total_in&255),ve(fe,V.total_in>>8&255),ve(fe,V.total_in>>16&255),ve(fe,V.total_in>>24&255)):(xe(fe,V.adler>>>16),xe(fe,V.adler&65535)),Je(V),fe.wrap>0&&(fe.wrap=-fe.wrap),fe.pending!==0?t:r)}function q(V){var Re;return!V||!V.state?s:(Re=V.state.status,Re!==be&&Re!==je&&Re!==Ne&&Re!==Oe&&Re!==Ke&&Re!==We&&Re!==Te?Qe(V,s):(V.state=null,Re===We?Qe(V,u):t))}function me(V,Re){var He=Re.length,fe,ke,Xe,ot,tt,at,pt,Ct;if(!V||!V.state)return s;if(fe=V.state,ot=fe.wrap,ot===2||ot===1&&fe.status!==be||fe.lookahead)return s;for(ot===1&&(V.adler=(0,L.default)(V.adler,Re,He,0)),fe.wrap=0,He>=fe.w_size&&(ot===0&&(qe(fe.head),fe.strstart=0,fe.block_start=0,fe.insert=0),Ct=new R.Buf8(fe.w_size),R.arraySet(Ct,Re,He-fe.w_size,fe.w_size,0),Re=Ct,He=fe.w_size),tt=V.avail_in,at=V.next_in,pt=V.input,V.avail_in=He,V.next_in=0,V.input=Re,ne(fe);fe.lookahead>=O;){ke=fe.strstart,Xe=fe.lookahead-(O-1);do fe.ins_h=(fe.ins_h<<fe.hash_shift^fe.window[ke+O-1])&fe.hash_mask,fe.prev[ke&fe.w_mask]=fe.head[fe.ins_h],fe.head[fe.ins_h]=ke,ke++;while(--Xe);fe.strstart=ke,fe.lookahead=O-1,ne(fe)}return fe.strstart+=fe.lookahead,fe.block_start=fe.strstart,fe.insert=fe.lookahead,fe.lookahead=0,fe.match_length=fe.prev_length=O-1,fe.match_available=0,V.next_in=at,V.input=pt,V.avail_in=tt,fe.wrap=ot,t}var Ie="pako deflate (from Nodeca project)";re.deflateInfo=Ie},lZu9:function(it,re,Q){(function(G){G(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(G){"use strict";G.defineMode("markdown",function(R,I){var L=G.getMode(R,"text/html"),M=L.name=="null";function p(U){if(G.findModeByName){var O=G.findModeByName(U);O&&(U=O.mime||O.mimes[0])}var z=G.getMode(R,U);return z.name=="null"?null:z}I.highlightFormatting===void 0&&(I.highlightFormatting=!1),I.maxBlockquoteDepth===void 0&&(I.maxBlockquoteDepth=0),I.taskLists===void 0&&(I.taskLists=!1),I.strikethrough===void 0&&(I.strikethrough=!1),I.emoji===void 0&&(I.emoji=!1),I.fencedCodeBlockHighlighting===void 0&&(I.fencedCodeBlockHighlighting=!0),I.fencedCodeBlockDefaultMode===void 0&&(I.fencedCodeBlockDefaultMode="text/plain"),I.xml===void 0&&(I.xml=!0),I.tokenTypeOverrides===void 0&&(I.tokenTypeOverrides={});var E={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var b in E)E.hasOwnProperty(b)&&I.tokenTypeOverrides[b]&&(E[b]=I.tokenTypeOverrides[b]);var i=/^([*\-_])(?:\s*\1){2,}\s*$/,c=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,o=/^\[(x| )\](?=\s)/i,h=I.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,n=/^ {0,3}(?:\={1,}|-{2,})\s*$/,a=/^[^#!\[\]*_\\<>` "'(~:]+/,t=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,r=/^\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]/,u=" ";function f(U,O,z){return O.f=O.inline=z,z(U,O)}function d(U,O,z){return O.f=O.block=z,z(U,O)}function v(U){return!U||!/\S/.test(U.string)}function m(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==C){var O=M;if(!O){var z=G.innerMode(L,U.htmlState);O=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}O&&(U.f=k,U.block=S,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function S(U,O){var z=U.column()===O.indentation,te=v(O.prevLine.stream),de=O.indentedCode,be=O.prevLine.hr,je=O.list!==!1,Ne=(O.listStack[O.listStack.length-1]||0)+3;O.indentedCode=!1;var Oe=O.indentation;if(O.indentationDiff===null&&(O.indentationDiff=O.indentation,je)){for(O.list=null;Oe<O.listStack[O.listStack.length-1];)O.listStack.pop(),O.listStack.length?O.indentation=O.listStack[O.listStack.length-1]:O.list=!1;O.list!==!1&&(O.indentationDiff=Oe-O.listStack[O.listStack.length-1])}var Ke=!te&&!be&&!O.prevLine.header&&(!je||!de)&&!O.prevLine.fencedCodeEnd,We=(O.list===!1||be||te)&&O.indentation<=Ne&&U.match(i),Te=null;if(O.indentationDiff>=4&&(de||O.prevLine.fencedCodeEnd||O.prevLine.header||te))return U.skipToEnd(),O.indentedCode=!0,E.code;if(U.eatSpace())return null;if(z&&O.indentation<=Ne&&(Te=U.match(h))&&Te[1].length<=6)return O.quote=0,O.header=Te[1].length,O.thisLine.header=!0,I.highlightFormatting&&(O.formatting="header"),O.f=O.inline,y(O);if(O.indentation<=Ne&&U.eat(">"))return O.quote=z?1:O.quote+1,I.highlightFormatting&&(O.formatting="quote"),U.eatSpace(),y(O);if(!We&&!O.setext&&z&&O.indentation<=Ne&&(Te=U.match(c))){var we=Te[1]?"ol":"ul";return O.indentation=Oe+U.current().length,O.list=!0,O.quote=0,O.listStack.push(O.indentation),O.em=!1,O.strong=!1,O.code=!1,O.strikethrough=!1,I.taskLists&&U.match(o,!1)&&(O.taskList=!0),O.f=O.inline,I.highlightFormatting&&(O.formatting=["list","list-"+we]),y(O)}else{if(z&&O.indentation<=Ne&&(Te=U.match(t,!0)))return O.quote=0,O.fencedEndRE=new RegExp(Te[1]+"+ *$"),O.localMode=I.fencedCodeBlockHighlighting&&p(Te[2]||I.fencedCodeBlockDefaultMode),O.localMode&&(O.localState=G.startState(O.localMode)),O.f=O.block=_,I.highlightFormatting&&(O.formatting="code-block"),O.code=-1,y(O);if(O.setext||(!Ke||!je)&&!O.quote&&O.list===!1&&!O.code&&!We&&!r.test(U.string)&&(Te=U.lookAhead(1))&&(Te=Te.match(n)))return O.setext?(O.header=O.setext,O.setext=0,U.skipToEnd(),I.highlightFormatting&&(O.formatting="header")):(O.header=Te[0].charAt(0)=="="?1:2,O.setext=O.header),O.thisLine.header=!0,O.f=O.inline,y(O);if(We)return U.skipToEnd(),O.hr=!0,O.thisLine.hr=!0,E.hr;if(U.peek()==="[")return f(U,O,W)}return f(U,O,O.inline)}function C(U,O){var z=L.token(U,O.htmlState);if(!M){var te=G.innerMode(L,O.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||O.md_inside&&U.current().indexOf(">")>-1)&&(O.f=k,O.block=S,O.htmlState=null)}return z}function _(U,O){var z=O.listStack[O.listStack.length-1]||0,te=O.indentation<z,de=z+3;if(O.fencedEndRE&&O.indentation<=de&&(te||U.match(O.fencedEndRE))){I.highlightFormatting&&(O.formatting="code-block");var be;return te||(be=y(O)),O.localMode=O.localState=null,O.block=S,O.f=k,O.fencedEndRE=null,O.code=0,O.thisLine.fencedCodeEnd=!0,te?d(U,O,O.block):be}else return O.localMode?O.localMode.token(U,O.localState):(U.skipToEnd(),E.code)}function y(U){var O=[];if(U.formatting){O.push(E.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var z=0;z<U.formatting.length;z++)O.push(E.formatting+"-"+U.formatting[z]),U.formatting[z]==="header"&&O.push(E.formatting+"-"+U.formatting[z]+"-"+U.header),U.formatting[z]==="quote"&&(!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?O.push(E.formatting+"-"+U.formatting[z]+"-"+U.quote):O.push("error"))}if(U.taskOpen)return O.push("meta"),O.length?O.join(" "):null;if(U.taskClosed)return O.push("property"),O.length?O.join(" "):null;if(U.linkHref?O.push(E.linkHref,"url"):(U.strong&&O.push(E.strong),U.em&&O.push(E.em),U.strikethrough&&O.push(E.strikethrough),U.emoji&&O.push(E.emoji),U.linkText&&O.push(E.linkText),U.code&&O.push(E.code),U.image&&O.push(E.image),U.imageAltText&&O.push(E.imageAltText,"link"),U.imageMarker&&O.push(E.imageMarker)),U.header&&O.push(E.header,E.header+"-"+U.header),U.quote&&(O.push(E.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?O.push(E.quote+"-"+U.quote):O.push(E.quote+"-"+I.maxBlockquoteDepth)),U.list!==!1){var te=(U.listStack.length-1)%3;te?te===1?O.push(E.list2):O.push(E.list3):O.push(E.list1)}return U.trailingSpaceNewLine?O.push("trailing-space-new-line"):U.trailingSpace&&O.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),O.length?O.join(" "):null}function T(U,O){return U.match(a,!0)?y(O):void 0}function k(U,O){var z=O.text(U,O);if(typeof z!="undefined")return z;if(O.list)return O.list=null,y(O);if(O.taskList){var te=U.match(o,!0)[1]===" ";return te?O.taskOpen=!0:O.taskClosed=!0,I.highlightFormatting&&(O.formatting="task"),O.taskList=!1,y(O)}if(O.taskOpen=!1,O.taskClosed=!1,O.header&&U.match(/^#+$/,!0))return I.highlightFormatting&&(O.formatting="header"),y(O);var de=U.next();if(O.linkTitle){O.linkTitle=!1;var be=de;de==="("&&(be=")"),be=(be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var je="^\\s*(?:[^"+be+"\\\\]+|\\\\\\\\|\\\\.)"+be;if(U.match(new RegExp(je),!0))return E.linkHref}if(de==="`"){var Ne=O.formatting;I.highlightFormatting&&(O.formatting="code"),U.eatWhile("`");var Oe=U.current().length;if(O.code==0&&(!O.quote||Oe==1))return O.code=Oe,y(O);if(Oe==O.code){var Ke=y(O);return O.code=0,Ke}else return O.formatting=Ne,y(O)}else if(O.code)return y(O);if(de==="\\"&&(U.next(),I.highlightFormatting)){var We=y(O),Te=E.formatting+"-escape";return We?We+" "+Te:Te}if(de==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return O.imageMarker=!0,O.image=!0,I.highlightFormatting&&(O.formatting="image"),y(O);if(de==="["&&O.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return O.imageMarker=!1,O.imageAltText=!0,I.highlightFormatting&&(O.formatting="image"),y(O);if(de==="]"&&O.imageAltText){I.highlightFormatting&&(O.formatting="image");var We=y(O);return O.imageAltText=!1,O.image=!1,O.inline=O.f=F,We}if(de==="["&&!O.image)return O.linkText&&U.match(/^.*?\]/)||(O.linkText=!0,I.highlightFormatting&&(O.formatting="link")),y(O);if(de==="]"&&O.linkText){I.highlightFormatting&&(O.formatting="link");var We=y(O);return O.linkText=!1,O.inline=O.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?F:k,We}if(de==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=g,I.highlightFormatting&&(O.formatting="link");var We=y(O);return We?We+=" ":We="",We+E.linkInline}if(de==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=g,I.highlightFormatting&&(O.formatting="link");var We=y(O);return We?We+=" ":We="",We+E.linkEmail}if(I.xml&&de==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var we=U.string.indexOf(">",U.pos);if(we!=-1){var ue=U.string.substring(U.start,we);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ue)&&(O.md_inside=!0)}return U.backUp(1),O.htmlState=G.startState(L),d(U,O,C)}if(I.xml&&de==="<"&&U.match(/^\/\w*?>/))return O.md_inside=!1,"tag";if(de==="*"||de==="_"){for(var Ae=1,ge=U.pos==1?" ":U.string.charAt(U.pos-2);Ae<3&&U.eat(de);)Ae++;var Ve=U.peek()||" ",Qe=!/\s/.test(Ve)&&(!s.test(Ve)||/\s/.test(ge)||s.test(ge)),ze=!/\s/.test(ge)&&(!s.test(ge)||/\s/.test(Ve)||s.test(Ve)),qe=null,Je=null;if(Ae%2&&(!O.em&&Qe&&(de==="*"||!ze||s.test(ge))?qe=!0:O.em==de&&ze&&(de==="*"||!Qe||s.test(Ve))&&(qe=!1)),Ae>1&&(!O.strong&&Qe&&(de==="*"||!ze||s.test(ge))?Je=!0:O.strong==de&&ze&&(de==="*"||!Qe||s.test(Ve))&&(Je=!1)),Je!=null||qe!=null){I.highlightFormatting&&(O.formatting=qe==null?"strong":Je==null?"em":"strong em"),qe===!0&&(O.em=de),Je===!0&&(O.strong=de);var Ke=y(O);return qe===!1&&(O.em=!1),Je===!1&&(O.strong=!1),Ke}}else if(de===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return y(O);U.backUp(1)}if(I.strikethrough){if(de==="~"&&U.eatWhile(de)){if(O.strikethrough){I.highlightFormatting&&(O.formatting="strikethrough");var Ke=y(O);return O.strikethrough=!1,Ke}else if(U.match(/^[^\s]/,!1))return O.strikethrough=!0,I.highlightFormatting&&(O.formatting="strikethrough"),y(O)}else if(de===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return y(O);U.backUp(2)}}if(I.emoji&&de===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){O.emoji=!0,I.highlightFormatting&&(O.formatting="emoji");var pe=y(O);return O.emoji=!1,pe}return de===" "&&(U.match(/^ +$/,!1)?O.trailingSpace++:O.trailingSpace&&(O.trailingSpaceNewLine=!0)),y(O)}function g(U,O){var z=U.next();if(z===">"){O.f=O.inline=k,I.highlightFormatting&&(O.formatting="link");var te=y(O);return te?te+=" ":te="",te+E.linkInline}return U.match(/^[^>]+/,!0),E.linkInline}function F(U,O){if(U.eatSpace())return null;var z=U.next();return z==="("||z==="["?(O.f=O.inline=N(z==="("?")":"]"),I.highlightFormatting&&(O.formatting="link-string"),O.linkHref=!0,y(O)):"error"}var P={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function N(U){return function(O,z){var te=O.next();if(te===U){z.f=z.inline=k,I.highlightFormatting&&(z.formatting="link-string");var de=y(z);return z.linkHref=!1,de}return O.match(P[U]),z.linkHref=!0,y(z)}}function W(U,O){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(O.f=j,U.next(),I.highlightFormatting&&(O.formatting="link"),O.linkText=!0,y(O)):f(U,O,k)}function j(U,O){if(U.match(/^\]:/,!0)){O.f=O.inline=A,I.highlightFormatting&&(O.formatting="link");var z=y(O);return O.linkText=!1,z}return U.match(/^([^\]\\]|\\.)+/,!0),E.linkText}function A(U,O){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?O.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),O.f=O.inline=k,E.linkHref+" url")}var K={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:k,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(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&G.copyState(L,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?G.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,O){if(O.formatting=!1,U!=O.thisLine.stream){if(O.header=0,O.hr=!1,U.match(/^\s*$/,!0))return m(O),null;if(O.prevLine=O.thisLine,O.thisLine={stream:U},O.taskList=!1,O.trailingSpace=0,O.trailingSpaceNewLine=!1,!O.localState&&(O.f=O.block,O.f!=C)){var z=U.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(O.indentation=z,O.indentationDiff=null,z>0)return null}}return O.f(U,O)},innerMode:function(U){return U.block==C?{state:U.htmlState,mode:L}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:K}},indent:function(U,O,z){return U.block==C&&L.indent?L.indent(U.htmlState,O,z):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,O,z):G.Pass},blankLine:m,getType:y,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return K},"xml"),G.defineMIME("text/markdown","markdown"),G.defineMIME("text/x-markdown","markdown")})},mHUz:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={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};re.default=G},mTgk:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G=R(Q("mHUz"));function R(b){return b&&b.__esModule?b:{default:b}}var I={};function L(b,i){if(i===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(b in I)throw new Error('Duplicate entry for key "'+b+'"');I[b]=[i,i,i,i]}function M(b,i,c){if(i===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(c===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(b in I)throw new Error('Duplicate entry for key "'+b+'"');I[b]=[i,i,c,i]}function p(b,i,c){if(i===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(c===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(b in I)throw new Error('Duplicate entry for key "'+b+'"');I[b]=[i,i,i,c]}M("Alt",G.default.XK_Alt_L,G.default.XK_Alt_R),L("AltGraph",G.default.XK_ISO_Level3_Shift),L("CapsLock",G.default.XK_Caps_Lock),M("Control",G.default.XK_Control_L,G.default.XK_Control_R),M("Meta",G.default.XK_Super_L,G.default.XK_Super_R),L("NumLock",G.default.XK_Num_Lock),L("ScrollLock",G.default.XK_Scroll_Lock),M("Shift",G.default.XK_Shift_L,G.default.XK_Shift_R),p("Enter",G.default.XK_Return,G.default.XK_KP_Enter),L("Tab",G.default.XK_Tab),p(" ",G.default.XK_space,G.default.XK_KP_Space),p("ArrowDown",G.default.XK_Down,G.default.XK_KP_Down),p("ArrowUp",G.default.XK_Up,G.default.XK_KP_Up),p("ArrowLeft",G.default.XK_Left,G.default.XK_KP_Left),p("ArrowRight",G.default.XK_Right,G.default.XK_KP_Right),p("End",G.default.XK_End,G.default.XK_KP_End),p("Home",G.default.XK_Home,G.default.XK_KP_Home),p("PageDown",G.default.XK_Next,G.default.XK_KP_Next),p("PageUp",G.default.XK_Prior,G.default.XK_KP_Prior),L("Backspace",G.default.XK_BackSpace),p("Clear",G.default.XK_Clear,G.default.XK_KP_Begin),L("Copy",G.default.XF86XK_Copy),L("Cut",G.default.XF86XK_Cut),p("Delete",G.default.XK_Delete,G.default.XK_KP_Delete),p("Insert",G.default.XK_Insert,G.default.XK_KP_Insert),L("Paste",G.default.XF86XK_Paste),L("Redo",G.default.XK_Redo),L("Undo",G.default.XK_Undo),L("Cancel",G.default.XK_Cancel),L("ContextMenu",G.default.XK_Menu),L("Escape",G.default.XK_Escape),L("Execute",G.default.XK_Execute),L("Find",G.default.XK_Find),L("Help",G.default.XK_Help),L("Pause",G.default.XK_Pause),L("Select",G.default.XK_Select),L("ZoomIn",G.default.XF86XK_ZoomIn),L("ZoomOut",G.default.XF86XK_ZoomOut),L("BrightnessDown",G.default.XF86XK_MonBrightnessDown),L("BrightnessUp",G.default.XF86XK_MonBrightnessUp),L("Eject",G.default.XF86XK_Eject),L("LogOff",G.default.XF86XK_LogOff),L("Power",G.default.XF86XK_PowerOff),L("PowerOff",G.default.XF86XK_PowerDown),L("PrintScreen",G.default.XK_Print),L("Hibernate",G.default.XF86XK_Hibernate),L("Standby",G.default.XF86XK_Standby),L("WakeUp",G.default.XF86XK_WakeUp),L("AllCandidates",G.default.XK_MultipleCandidate),L("Alphanumeric",G.default.XK_Eisu_Shift),L("CodeInput",G.default.XK_Codeinput),L("Compose",G.default.XK_Multi_key),L("Convert",G.default.XK_Henkan),L("GroupFirst",G.default.XK_ISO_First_Group),L("GroupLast",G.default.XK_ISO_Last_Group),L("GroupNext",G.default.XK_ISO_Next_Group),L("GroupPrevious",G.default.XK_ISO_Prev_Group),L("NonConvert",G.default.XK_Muhenkan),L("PreviousCandidate",G.default.XK_PreviousCandidate),L("SingleCandidate",G.default.XK_SingleCandidate),L("HangulMode",G.default.XK_Hangul),L("HanjaMode",G.default.XK_Hangul_Hanja),L("JunjuaMode",G.default.XK_Hangul_Jeonja),L("Eisu",G.default.XK_Eisu_toggle),L("Hankaku",G.default.XK_Hankaku),L("Hiragana",G.default.XK_Hiragana),L("HiraganaKatakana",G.default.XK_Hiragana_Katakana),L("KanaMode",G.default.XK_Kana_Shift),L("KanjiMode",G.default.XK_Kanji),L("Katakana",G.default.XK_Katakana),L("Romaji",G.default.XK_Romaji),L("Zenkaku",G.default.XK_Zenkaku),L("ZenkakuHanaku",G.default.XK_Zenkaku_Hankaku),L("F1",G.default.XK_F1),L("F2",G.default.XK_F2),L("F3",G.default.XK_F3),L("F4",G.default.XK_F4),L("F5",G.default.XK_F5),L("F6",G.default.XK_F6),L("F7",G.default.XK_F7),L("F8",G.default.XK_F8),L("F9",G.default.XK_F9),L("F10",G.default.XK_F10),L("F11",G.default.XK_F11),L("F12",G.default.XK_F12),L("F13",G.default.XK_F13),L("F14",G.default.XK_F14),L("F15",G.default.XK_F15),L("F16",G.default.XK_F16),L("F17",G.default.XK_F17),L("F18",G.default.XK_F18),L("F19",G.default.XK_F19),L("F20",G.default.XK_F20),L("F21",G.default.XK_F21),L("F22",G.default.XK_F22),L("F23",G.default.XK_F23),L("F24",G.default.XK_F24),L("F25",G.default.XK_F25),L("F26",G.default.XK_F26),L("F27",G.default.XK_F27),L("F28",G.default.XK_F28),L("F29",G.default.XK_F29),L("F30",G.default.XK_F30),L("F31",G.default.XK_F31),L("F32",G.default.XK_F32),L("F33",G.default.XK_F33),L("F34",G.default.XK_F34),L("F35",G.default.XK_F35),L("Close",G.default.XF86XK_Close),L("MailForward",G.default.XF86XK_MailForward),L("MailReply",G.default.XF86XK_Reply),L("MailSend",G.default.XF86XK_Send),L("MediaFastForward",G.default.XF86XK_AudioForward),L("MediaPause",G.default.XF86XK_AudioPause),L("MediaPlay",G.default.XF86XK_AudioPlay),L("MediaRecord",G.default.XF86XK_AudioRecord),L("MediaRewind",G.default.XF86XK_AudioRewind),L("MediaStop",G.default.XF86XK_AudioStop),L("MediaTrackNext",G.default.XF86XK_AudioNext),L("MediaTrackPrevious",G.default.XF86XK_AudioPrev),L("New",G.default.XF86XK_New),L("Open",G.default.XF86XK_Open),L("Print",G.default.XK_Print),L("Save",G.default.XF86XK_Save),L("SpellCheck",G.default.XF86XK_Spell),L("AudioVolumeDown",G.default.XF86XK_AudioLowerVolume),L("AudioVolumeUp",G.default.XF86XK_AudioRaiseVolume),L("AudioVolumeMute",G.default.XF86XK_AudioMute),L("MicrophoneVolumeMute",G.default.XF86XK_AudioMicMute),L("LaunchApplication1",G.default.XF86XK_MyComputer),L("LaunchApplication2",G.default.XF86XK_Calculator),L("LaunchCalendar",G.default.XF86XK_Calendar),L("LaunchMail",G.default.XF86XK_Mail),L("LaunchMediaPlayer",G.default.XF86XK_AudioMedia),L("LaunchMusicPlayer",G.default.XF86XK_Music),L("LaunchPhone",G.default.XF86XK_Phone),L("LaunchScreenSaver",G.default.XF86XK_ScreenSaver),L("LaunchSpreadsheet",G.default.XF86XK_Excel),L("LaunchWebBrowser",G.default.XF86XK_WWW),L("LaunchWebCam",G.default.XF86XK_WebCam),L("LaunchWordProcessor",G.default.XF86XK_Word),L("BrowserBack",G.default.XF86XK_Back),L("BrowserFavorites",G.default.XF86XK_Favorites),L("BrowserForward",G.default.XF86XK_Forward),L("BrowserHome",G.default.XF86XK_HomePage),L("BrowserRefresh",G.default.XF86XK_Refresh),L("BrowserSearch",G.default.XF86XK_Search),L("BrowserStop",G.default.XF86XK_Stop),L("Dimmer",G.default.XF86XK_BrightnessAdjust),L("MediaAudioTrack",G.default.XF86XK_AudioCycleTrack),L("RandomToggle",G.default.XF86XK_AudioRandomPlay),L("SplitScreenToggle",G.default.XF86XK_SplitScreen),L("Subtitle",G.default.XF86XK_Subtitle),L("VideoModeNext",G.default.XF86XK_Next_VMode),p("=",G.default.XK_equal,G.default.XK_KP_Equal),p("+",G.default.XK_plus,G.default.XK_KP_Add),p("-",G.default.XK_minus,G.default.XK_KP_Subtract),p("*",G.default.XK_asterisk,G.default.XK_KP_Multiply),p("/",G.default.XK_slash,G.default.XK_KP_Divide),p(".",G.default.XK_period,G.default.XK_KP_Decimal),p(",",G.default.XK_comma,G.default.XK_KP_Separator),p("0",G.default.XK_0,G.default.XK_KP_0),p("1",G.default.XK_1,G.default.XK_KP_1),p("2",G.default.XK_2,G.default.XK_KP_2),p("3",G.default.XK_3,G.default.XK_KP_3),p("4",G.default.XK_4,G.default.XK_KP_4),p("5",G.default.XK_5,G.default.XK_KP_5),p("6",G.default.XK_6,G.default.XK_KP_6),p("7",G.default.XK_7,G.default.XK_KP_7),p("8",G.default.XK_8,G.default.XK_KP_8),p("9",G.default.XK_9,G.default.XK_KP_9);var E=I;re.default=E},mdZa:function(it,re,Q){"use strict";typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(R,I){"use strict";if(R==null)throw new TypeError("Cannot convert undefined or null to object");for(var L=Object(R),M=1;M<arguments.length;M++){var p=arguments[M];if(p!=null)for(var E in p)Object.prototype.hasOwnProperty.call(p,E)&&(L[E]=p[E])}return L},writable:!0,configurable:!0}),function(){function G(R,I){I=I||{bubbles:!1,cancelable:!1,detail:void 0};var L=document.createEvent("CustomEvent");return L.initCustomEvent(R,I.bubbles,I.cancelable,I.detail),L}G.prototype=window.Event.prototype,typeof window.CustomEvent!="function"&&(window.CustomEvent=G)}(),Number.isInteger=Number.isInteger||function(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}},nEHx:function(it,re,Q){"use strict";Q.d(re,"a",function(){return G});var G;(function(R){R.DARK="dark",R.LIGHT="light",R.HIGH_CONTRAST="hc"})(G||(G={}))},nnTU:function(it,re,Q){"use strict";Q.d(re,"b",function(){return E}),Q.d(re,"a",function(){return b});var G=Q("MI8n"),R=Q("JYp7"),I=Q("pmY6"),L=Q("24hK"),M=Q("746U"),p=Q("Cg/j");const E=Object(p.c)("commandService"),b=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new G.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,c){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!c)throw new Error("invalid command");return this.registerCommand({id:i,handler:c})}if(i.description){const t=[];for(let s of i.description.args)t.push(s.constraint);const r=i.handler;i.handler=function(s,...u){return Object(M.o)(u,t),r(s,...u)}}const{id:o}=i;let h=this._commands.get(o);h||(h=new L.a,this._commands.set(o,h));let n=h.unshift(i),a=Object(I.i)(()=>{n();const t=this._commands.get(o);(t==null?void 0:t.isEmpty())&&this._commands.delete(o)});return this._onDidRegisterCommand.fire(o),a}registerCommandAlias(i,c){return b.registerCommand(i,(o,...h)=>o.get(E).executeCommand(c,...h))}getCommand(i){const c=this._commands.get(i);return!c||c.isEmpty()?void 0:R.a.first(c)}getCommands(){const i=new Map;for(const c of this._commands.keys()){const o=this.getCommand(c);o&&i.set(c,o)}return i}};b.registerCommand("noop",()=>{})},osHv:function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){"use strict";var R=G.Pos;function I(s,u){return s.line-u.line||s.ch-u.ch}var L="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",M=L+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+L+"]["+M+"]*)","g");function E(s,u,f,d){this.line=u,this.ch=f,this.cm=s,this.text=s.getLine(u),this.min=d?Math.max(d.from,s.firstLine()):s.firstLine(),this.max=d?Math.min(d.to-1,s.lastLine()):s.lastLine()}function b(s,u){var f=s.cm.getTokenTypeAt(R(s.line,u));return f&&/\btag\b/.test(f)}function i(s){return s.line>=s.max?void 0:(s.ch=0,s.text=s.cm.getLine(++s.line),!0)}function c(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 u=s.text.indexOf(">",s.ch);if(u==-1){if(i(s))continue;return}if(!b(s,u+1)){s.ch=u+1;continue}var f=s.text.lastIndexOf("/",u),d=f>-1&&!/\S/.test(s.text.slice(f+1,u));return s.ch=u+1,d?"selfClose":"regular"}}function h(s){for(;;){var u=s.ch?s.text.lastIndexOf("<",s.ch-1):-1;if(u==-1){if(c(s))continue;return}if(!b(s,u+1)){s.ch=u;continue}p.lastIndex=u,s.ch=u;var f=p.exec(s.text);if(f&&f.index==u)return f}}function n(s){for(;;){p.lastIndex=s.ch;var u=p.exec(s.text);if(!u){if(i(s))continue;return}if(!b(s,u.index+1)){s.ch=u.index+1;continue}return s.ch=u.index+u[0].length,u}}function a(s){for(;;){var u=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(u==-1){if(c(s))continue;return}if(!b(s,u+1)){s.ch=u;continue}var f=s.text.lastIndexOf("/",u),d=f>-1&&!/\S/.test(s.text.slice(f+1,u));return s.ch=u+1,d?"selfClose":"regular"}}function t(s,u){for(var f=[];;){var d=n(s),v,m=s.line,S=s.ch-(d?d[0].length:0);if(!d||!(v=o(s)))return;if(v=="selfClose")continue;if(d[1]){for(var C=f.length-1;C>=0;--C)if(f[C]==d[2]){f.length=C;break}if(C<0&&(!u||u==d[2]))return{tag:d[2],from:R(m,S),to:R(s.line,s.ch)}}else f.push(d[2])}}function r(s,u){for(var f=[];;){var d=a(s);if(!d)return;if(d=="selfClose"){h(s);continue}var v=s.line,m=s.ch,S=h(s);if(!S)return;if(S[1])f.push(S[2]);else{for(var C=f.length-1;C>=0;--C)if(f[C]==S[2]){f.length=C;break}if(C<0&&(!u||u==S[2]))return{tag:S[2],from:R(s.line,s.ch),to:R(v,m)}}}}G.registerHelper("fold","xml",function(s,u){for(var f=new E(s,u.line,0);;){var d=n(f);if(!d||f.line!=u.line)return;var v=o(f);if(!v)return;if(!d[1]&&v!="selfClose"){var m=R(f.line,f.ch),S=t(f,d[2]);return S&&I(S.from,m)>0?{from:m,to:S.from}:null}}}),G.findMatchingTag=function(s,u,f){var d=new E(s,u.line,u.ch,f);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var v=o(d),m=v&&R(d.line,d.ch),S=v&&h(d);if(!v||!S||I(d,u)>0)return;var C={from:R(d.line,d.ch),to:m,tag:S[2]};return v=="selfClose"?{open:C,close:null,at:"open"}:S[1]?{open:r(d,S[2]),close:C,at:"close"}:(d=new E(s,m.line,m.ch,f),{open:C,close:t(d,S[2]),at:"open"})},G.findEnclosingTag=function(s,u,f,d){for(var v=new E(s,u.line,u.ch,f);;){var m=r(v,d);if(!m)break;var S=new E(s,u.line,u.ch,f),C=t(S,m.tag);if(C)return{open:m,close:C}}},G.scanForClosingTag=function(s,u,f,d){var v=new E(s,u.line,u.ch,d?{from:0,to:d}:null);return t(v,f)}})},p5ED:function(it,re,Q){"use strict";var G=Q("+L6B"),R=Q("2/Rp"),I=Q("5Dmo"),L=Q("3S7+"),M=Q("k1fw"),p=Q("9og8"),E=Q("tJVT"),b=Q("WmNS"),i=Q.n(b),c=Q("q1tI"),o=Q.n(c),h=Q("vHTk"),n=Q.n(h),a=Q("yEEn"),t=Q("ZW9T"),r=Q("1vsH"),s=Q("V0Rq"),u=Q("m3rI");re.a=function(f){var d,v,m,S,C,_,y,T=f.editOffice,k=T===void 0?"view":T,g=f.data,F=f.theme,P=f.type,N=f.filename,W=f.monacoEditor,j=f.className,A=f.style,K=f.close,U=f.onClose,O=f.hasMask,z=f.disabledDownload,te=Object(c.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),de=Object(E.a)(te,2),be=de[0],je=de[1],Ne=Object(c.useState)(""),Oe=Object(E.a)(Ne,2),Ke=Oe[0],We=Oe[1],Te=Object(c.useState)(),we=Object(E.a)(Te,2),ue=we[0],Ae=we[1],ge=window.ENV==="build"?"/react/build":"",Ve=u.a.PROXY_SERVER||location.origin,Qe,ze=1024*1024,qe=10*ze,Je=Object(c.useRef)();(d=g)!==null&&d!==void 0&&d.startsWith("/api")&&P!=="txt"&&(g=u.a.API_SERVER+g),P==="office"&&(Qe=Object(r.T)(g).filesize,Qe>qe&&(P="other")),N&&W&&(W.filename=N),Object(c.useEffect)(function(){var Se,Le,ne=(Se=document.cookie)===null||Se===void 0||((Le=Se.replace(/\s/g,""))===null||Le===void 0)?void 0:Le.split(";");ne==null||ne.map(function(ye){var se=ye.split("=");se[0]==="_educoder_session"&&We(se[1])})},[]),Object(c.useEffect)(function(){P==="office"&&pe()},[P,g]);var pe=function(){var Se=Object(p.a)(i.a.mark(function Le(){var ne,ye,se;return i.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return console.log("data:",g),ne=g,g.startsWith("http")||(ne=location.origin+ne),ye=new URL(ne).pathname.split("/").pop(),Ze.next=6,Object(s.V)({attachment_id:ye});case 6:se=Ze.sent,Ae(se);case 8:case"end":return Ze.stop()}},Le)}));return function(){return Se.apply(this,arguments)}}(),ve=function(){if(g.startsWith("http")||g.startsWith("blob:")){xe();return}Object(r.z)(N||"educoder",g,N)},xe=function(){Object(r.x)(N||"educoder",decodeURIComponent(g))};return o.a.createElement("div",{style:Object(M.a)({},A||{}),className:"".concat(O&&n.a.bgBlack," ").concat(P?n.a.wrp:"hide")},K&&o.a.createElement("div",{className:n.a.close,ref:Je},!z&&o.a.createElement(L.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Je.current}},o.a.createElement("span",{onClick:xe},o.a.createElement("i",{className:"icon-quxiaozhiding"}))),o.a.createElement(L.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Je.current}},o.a.createElement("span",{className:"",onClick:U},o.a.createElement("i",{className:"icon-guanbi1"})))),o.a.createElement("div",{className:"".concat(n.a[j]," ").concat(j," ").concat(n.a.monaco," ").concat(P==="txt"?"show":"hide")},P==="txt"&&o.a.createElement(t.b,W)),P==="audio"&&o.a.createElement("audio",{src:"".concat(((v=g)===null||v===void 0?void 0:v.indexOf("http://"))>-1||((m=g)===null||m===void 0?void 0:m.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(g),autoPlay:!0}),P==="video"&&o.a.createElement(o.a.Fragment,null,((S=g)===null||S===void 0?void 0:S.indexOf("http"))>-1?o.a.createElement("video",{controls:!0,src:"".concat(g),autoPlay:!0}):o.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(g),autoPlay:!0})),P==="office"&&ue&&o.a.createElement("iframe",{src:"".concat(ge,"/office.html?key=").concat(ue.key,"&url=").concat(Ve+ue.url,"&callbackUrl=").concat(Ve+ue.callbackUrl,"&fileType=").concat(ue.fileType,"&title=").concat(ue.title,"&model=").concat(k,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!z)}),P==="html"&&o.a.createElement("iframe",{src:g+"&disposition=inline"}),P==="pdf"&&o.a.createElement("iframe",{src:"".concat(ge,"/js/pdfview/index.html?url=").concat(g,"&disabledDownload=").concat(!!z)}),P==="image"&&o.a.createElement("img",{src:"".concat(((C=g)===null||C===void 0?void 0:C.indexOf("http://"))>-1||((_=g)===null||_===void 0?void 0:_.indexOf("https://"))>-1||(y=g)!==null&&y!==void 0&&y.startsWith("/api")?"":"data:image/png;base64,").concat(g)}),P==="other"&&o.a.createElement("div",null,o.a.createElement(R.a,{type:"primary",size:"large",onClick:ve},o.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),P==="download"&&o.a.createElement(R.a,{type:"primary",size:"large",onClick:ve},o.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(it,re,Q){},pmY6:function(it,re,Q){"use strict";Q.d(re,"h",function(){return c}),Q.d(re,"g",function(){return h}),Q.d(re,"f",function(){return n}),Q.d(re,"e",function(){return a}),Q.d(re,"i",function(){return t}),Q.d(re,"b",function(){return r}),Q.d(re,"a",function(){return s}),Q.d(re,"d",function(){return u}),Q.d(re,"c",function(){return f});var G=Q("C/vA"),R=Q("JYp7");const I=!1;let L=null;function M(d){L=d}if(I){const d="__is_disposable_tracked__";M(new class{trackDisposable(v){const m=new Error("Potentially leaked disposable").stack;setTimeout(()=>{v[d]||console.log(m)},3e3)}setParent(v,m){if(v&&v!==s.None)try{v[d]=!0}catch(S){}}markAsDisposed(v){if(v&&v!==s.None)try{v[d]=!0}catch(m){}}markAsSingleton(v){}})}function p(d){return L==null||L.trackDisposable(d),d}function E(d){L==null||L.markAsDisposed(d)}function b(d,v){L==null||L.setParent(d,v)}function i(d,v){if(!L)return;for(const m of d)L.setParent(m,v)}function c(d){return L==null||L.markAsSingleton(d),d}class o extends Error{constructor(d){super(`Encountered errors while disposing of store. Errors: [${d.join(", ")}]`);this.errors=d}}function h(d){return typeof d.dispose=="function"&&d.dispose.length===0}function n(d){if(R.a.is(d)){let v=[];for(const m of d)if(m)try{m.dispose()}catch(S){v.push(S)}if(v.length===1)throw v[0];if(v.length>1)throw new o(v);return Array.isArray(d)?[]:d}else if(d)return d.dispose(),d}function a(...d){const v=t(()=>n(d));return i(d,v),v}function t(d){const v=p({dispose:Object(G.a)(()=>{E(v),d()})});return v}class r{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){if(this._isDisposed)return;E(this),this._isDisposed=!0,this.clear()}clear(){try{n(this._toDispose.values())}finally{this._toDispose.clear()}}add(d){if(!d)return d;if(d===this)throw new Error("Cannot register a disposable on itself!");return b(d,this),this._isDisposed?r.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(d),d}}r.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new r,p(this),b(this._store,this)}dispose(){E(this),this._store.dispose()}_register(d){if(d===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(d)}}s.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;if(this._isDisposed||d===this._value)return;(v=this._value)===null||v===void 0||v.dispose(),d&&b(d,this),this._value=d}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,E(this),(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}clearAndLeak(){const d=this._value;return this._value=void 0,d&&b(d,null),d}}class f{constructor(d){this.object=d}dispose(){}}},psGv:function(it,re,Q){var G,R;(function(){var I;(function(){"use strict";var E=[,,function(o){function h(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=[]}h.prototype.clone_empty=function(){var t=new h(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},h.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},h.prototype.has_match=function(t){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(t))return!0;return!1},h.prototype.set_indent=function(t,r){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=r||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 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},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(t){this.__items.push(t);var r=t.lastIndexOf(`
`);r!==-1?this.__character_count=t.length-r:this.__character_count+=t.length},h.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},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 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 n(t,r){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)),r=r||"",t.indent_level>0&&(r=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}n.prototype.get_indent_size=function(t,r){var s=this.__base_string_length;return r=r||0,t<0&&(s=0),s+=t*this.__indent_size,s+=r,s},n.prototype.get_indent_string=function(t,r){var s=this.__base_string;return r=r||0,t<0&&(t=0,s=""),r+=t*this.__indent_size,this.__ensure_cache(r),s+=this.__cache[r],s},n.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,r=0,s="";this.__indent_size&&t>=this.__indent_size&&(r=Math.floor(t/this.__indent_size),t-=r*this.__indent_size,s=new Array(r+1).join(this.__indent_string)),t&&(s+=new Array(t+1).join(" ")),this.__cache.push(s)};function a(t,r){this.__indent_cache=new n(t,r),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 h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(t,r){return this.__indent_cache.get_indent_string(t,r)},a.prototype.get_indent_size=function(t,r){return this.__indent_cache.get_indent_size(t,r)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(t){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return t!==`
`&&(s=s.replace(/[\n]/g,t)),s},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(t,r){return t=t||0,r=r||0,this.next_line.set_indent(t,r),this.__lines.length>1?(this.current_line.set_indent(t,r),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(t){for(var r=0;r<t.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},a.prototype.remove_indent=function(t){for(var r=this.__lines.length;t<r;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(t){for(t=t===void 0?!1:t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(t,r){for(var s=this.__lines.length-2;s>=0;){var u=this.__lines[s];if(u.is_empty())break;if(u.item(0).indexOf(t)!==0&&u.item(-1)!==r){this.__lines.splice(s+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},o.exports.Output=a},function(o){function h(n,a,t,r){this.type=n,this.text=a,this.comments_before=null,this.newlines=t||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}o.exports.Token=h},,,function(o){function h(t,r){this.raw_options=n(t,r),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(t,r){var s=this.raw_options[t],u=r||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(u=s.concat()):typeof s=="string"&&(u=s.split(/[^a-zA-Z0-9_\/\-]+/)),u},h.prototype._get_boolean=function(t,r){var s=this.raw_options[t],u=s===void 0?!!r:!!s;return u},h.prototype._get_characters=function(t,r){var s=this.raw_options[t],u=r||"";return typeof s=="string"&&(u=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},h.prototype._get_number=function(t,r){var s=this.raw_options[t];r=parseInt(r,10),isNaN(r)&&(r=0);var u=parseInt(s,10);return isNaN(u)&&(u=r),u},h.prototype._get_selection=function(t,r,s){var u=this._get_selection_list(t,r,s);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+t+`' can only be one of the following values:
`+r+`
You passed in: '`+this.raw_options[t]+"'");return u[0]},h.prototype._get_selection_list=function(t,r,s){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[r[0]],!this._is_valid_selection(s,r))throw new Error("Invalid Default Value!");var u=this._get_array(t,s);if(!this._is_valid_selection(u,r))throw new Error("Invalid Option Value: The option '"+t+`' can contain only the following values:
`+r+`
You passed in: '`+this.raw_options[t]+"'");return u},h.prototype._is_valid_selection=function(t,r){return t.length&&r.length&&!t.some(function(s){return r.indexOf(s)===-1})};function n(t,r){var s={};t=a(t);var u;for(u in t)u!==r&&(s[u]=t[u]);if(r&&t[r])for(u in t[r])s[u]=t[r][u];return s}function a(t){var r={},s;for(s in t){var u=s.replace(/-/g,"_");r[u]=t[s]}return r}o.exports.Options=h,o.exports.normalizeOpts=a,o.exports.mergeOpts=n},,function(o){var h=RegExp.prototype.hasOwnProperty("sticky");function n(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},n.prototype.peek=function(a){var t=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(t=this.__input.charAt(a)),t},n.prototype.__match=function(a,t){a.lastIndex=t;var r=a.exec(this.__input);return r&&!(h&&a.sticky)&&(r.index!==t&&(r=null)),r},n.prototype.test=function(a,t){return t=t||0,t+=this.__position,t>=0&&t<this.__input_length?!!this.__match(a,t):!1},n.prototype.testChar=function(a,t){var r=this.peek(t);return a.lastIndex=0,r!==null&&a.test(r)},n.prototype.match=function(a){var t=this.__match(a,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(a,t,r){var s="",u;return a&&(u=this.match(a),u&&(s+=u[0])),t&&(u||!a)&&(s+=this.readUntil(t,r)),s},n.prototype.readUntil=function(a,t){var r="",s=this.__position;a.lastIndex=this.__position;var u=a.exec(this.__input);return u?(s=u.index,t&&(s+=u[0].length)):s=this.__input_length,r=this.__input.substring(this.__position,s),this.__position=s,r},n.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},n.prototype.get_regexp=function(a,t){var r=null,s="g";return t&&h&&(s="y"),typeof a=="string"&&a!==""?r=new RegExp(a,s):a&&(r=new RegExp(a.source,s)),r},n.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(a){var t=this.__position,r=this.readUntilAfter(a);return this.__position=t,r},n.prototype.lookBack=function(a){var t=this.__position-1;return t>=a.length&&this.__input.substring(t-a.length,t).toLowerCase()===a},o.exports.InputScanner=n},function(o,h,n){var a=n(8).InputScanner,t=n(3).Token,r=n(10).TokenStream,s=n(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},f=function(d,v){this._input=new a(d),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};f.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var d,v=new t(u.START,""),m=null,S=[],C=new r;v.type!==u.EOF;){for(d=this._get_next_token(v,m);this._is_comment(d);)C.add(d),d=this._get_next_token(v,m);C.isEmpty()||(d.comments_before=C,C=new r),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=v,v.next=d,this.__tokens.add(d),v=d}return this.__tokens},f.prototype._is_first_token=function(){return this.__tokens.isEmpty()},f.prototype._reset=function(){},f.prototype._get_next_token=function(d,v){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(u.RAW,m):this._create_token(u.EOF,"")},f.prototype._is_comment=function(d){return!1},f.prototype._is_opening=function(d){return!1},f.prototype._is_closing=function(d,v){return!1},f.prototype._create_token=function(d,v){var m=new t(d,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},f.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},o.exports.Tokenizer=f,o.exports.TOKEN=u},function(o){function h(n){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=n}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var n=null;return this.hasNext()&&(n=this.__tokens[this.__position],this.__position+=1),n},h.prototype.peek=function(n){var a=null;return n=n||0,n+=this.__position,n>=0&&n<this.__tokens_length&&(a=this.__tokens[n]),a},h.prototype.add=function(n){this.__parent_token&&(n.parent=this.__parent_token),this.__tokens.push(n),this.__tokens_length+=1},o.exports.TokenStream=h},function(o,h,n){var a=n(12).Pattern;function t(r,s){a.call(this,r,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}t.prototype=new a,t.prototype.__set_whitespace_patterns=function(r,s){r+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var r=this._input.read(this._match_pattern);if(r===" ")this.whitespace_before_token=" ";else if(r){var s=this.__split(this._newline_regexp,r);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return r},t.prototype.matching=function(r,s){var u=this._create();return u.__set_whitespace_patterns(r,s),u._update(),u},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(r,s){r.lastIndex=0;for(var u=0,f=[],d=r.exec(s);d;)f.push(s.substring(u,d.index)),u=d.index+d[0].length,d=r.exec(s);return u<s.length?f.push(s.substring(u,s.length)):f.push(""),f},o.exports.WhitespacePattern=t},function(o){function h(n,a){this._input=n,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}h.prototype.read=function(){var n=this._input.read(this._starting_pattern);return(!this._starting_pattern||n)&&(n+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),n},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(n){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(n),a._update(),a},h.prototype.until=function(n){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(n),a._update(),a},h.prototype.starting_with=function(n){var a=this._create();return a._starting_pattern=this._input.get_regexp(n,!0),a._update(),a},h.prototype.matching=function(n){var a=this._create();return a._match_pattern=this._input.get_regexp(n,!0),a._update(),a},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},o.exports.Pattern=h},function(o){function h(n,a){n=typeof n=="string"?n:n.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(n+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(n+/\sbeautify\signore:end\s/.source+a,"g")}h.prototype.get_directives=function(n){if(!n.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var t=this.__directive_pattern.exec(n);t;)a[t[1]]=t[2],t=this.__directive_pattern.exec(n);return a},h.prototype.readIgnored=function(n){return n.readUntilAfter(this.__directives_end_ignore_pattern)},o.exports.Directives=h},function(o,h,n){var a=n(12).Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(s,u){a.call(this,s,u),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var f=new a(s);this.__patterns={handlebars_comment:f.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:f.starting_with(/{{{/).until_after(/}}}/),handlebars:f.starting_with(/{{/).until_after(/}}/),php:f.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:f.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:f.starting_with(/{%/).until_after(/%}/),django_value:f.starting_with(/{{/).until_after(/}}/),django_comment:f.starting_with(/{#/).until_after(/#}/),smarty:f.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:f.starting_with(/{\*/).until_after(/\*}/),smarty_literal:f.starting_with(/{literal}/).until_after(/{\/literal}/)}}r.prototype=new a,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(s){var u=this._create();return u._disabled[s]=!0,u._update(),u},r.prototype.read_options=function(s){var u=this._create();for(var f in t)u._disabled[f]=s.templating.indexOf(f)===-1;return u._update(),u},r.prototype.exclude=function(s){var u=this._create();return u._excluded[s]=!0,u._update(),u},r.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 u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),s+=u,u=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},r.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("|")+")")},r.prototype._read_template=function(){var s="",u=this._input.peek();if(u==="<"){var f=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&f==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&f==="%"&&(s=s||this.__patterns.erb.read())}else u==="{"&&(!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=r},,,,function(o,h,n){var a=n(19).Beautifier,t=n(20).Options;function r(s,u,f,d){var v=new a(s,u,f,d);return v.beautify()}o.exports=r,o.exports.defaultOptions=function(){return new t}},function(o,h,n){var a=n(20).Options,t=n(2).Output,r=n(21).Tokenizer,s=n(21).TOKEN,u=/\r\n|[\r\n]/,f=/\r\n|[\r\n]/g,d=function(F,P){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=F.max_preserve_newlines,this.preserve_newlines=F.preserve_newlines,this._output=new t(F,P)};d.prototype.current_line_has_match=function(F){return this._output.current_line.has_match(F)},d.prototype.set_space_before_token=function(F,P){this._output.space_before_token=F,this._output.non_breaking_space=P},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(F){this._output.add_raw_token(F)},d.prototype.print_preserved_newlines=function(F){var P=0;F.type!==s.TEXT&&F.previous.type!==s.TEXT&&(P=F.newlines?1:0),this.preserve_newlines&&(P=F.newlines<this.max_preserve_newlines+1?F.newlines:this.max_preserve_newlines+1);for(var N=0;N<P;N++)this.print_newline(N>0);return P!==0},d.prototype.traverse_whitespace=function(F){return F.whitespace_before||F.newlines?(this.print_preserved_newlines(F)||(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(F){this._output.add_new_line(F)},d.prototype.print_token=function(F){F.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(F.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(F){return F=this.indent_level+(F||0),F<1?"":this._output.get_indent_string(F)};var v=function(F){for(var P=null,N=F.next;N.type!==s.EOF&&F.closed!==N;){if(N.type===s.ATTRIBUTE&&N.text==="type"){N.next&&N.next.type===s.EQUALS&&N.next.next&&N.next.next.type===s.VALUE&&(P=N.next.next.text);break}N=N.next}return P},m=function(F,P){var N=null,W=null;return P.closed?(F==="script"?N="text/javascript":F==="style"&&(N="text/css"),N=v(P)||N,N.search("text/css")>-1?W="css":N.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?W="javascript":N.search(/(text|application|dojo)\/(x-)?(html)/)>-1?W="html":N.search(/test\/null/)>-1&&(W="null"),W):null};function S(F,P){return P.indexOf(F)!==-1}function C(F,P,N){this.parent=F||null,this.tag=P?P.tag_name:"",this.indent_level=N||0,this.parser_token=P||null}function _(F){this._printer=F,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(F){var P=new C(this._current_frame,F,this._printer.indent_level);this._current_frame=P},_.prototype._try_pop_frame=function(F){var P=null;return F&&(P=F.parser_token,this._printer.indent_level=F.indent_level,this._current_frame=F.parent),P},_.prototype._get_frame=function(F,P){for(var N=this._current_frame;N&&!(F.indexOf(N.tag)!==-1);){if(P&&P.indexOf(N.tag)!==-1){N=null;break}N=N.parent}return N},_.prototype.try_pop=function(F,P){var N=this._get_frame([F],P);return this._try_pop_frame(N)},_.prototype.indent_to_tag=function(F){var P=this._get_frame(F);P&&(this._printer.indent_level=P.indent_level)};function y(F,P,N,W){this._source_text=F||"",P=P||{},this._js_beautify=N,this._css_beautify=W,this._tag_stack=null;var j=new a(P,"html");this._options=j,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 F=this._source_text,P=this._options.eol;this._options.eol==="auto"&&(P=`
`,F&&u.test(F)&&(P=F.match(u)[0])),F=F.replace(f,`
`);var N=F.match(/^[\t ]*/)[0],W={text:"",type:""},j=new T,A=new d(this._options,N),K=new r(F,this._options).tokenize();this._tag_stack=new _(A);for(var U=null,O=K.next();O.type!==s.EOF;)O.type===s.TAG_OPEN||O.type===s.COMMENT?(U=this._handle_tag_open(A,O,j,W),j=U):O.type===s.ATTRIBUTE||O.type===s.EQUALS||O.type===s.VALUE||O.type===s.TEXT&&!j.tag_complete?U=this._handle_inside_tag(A,O,j,K):O.type===s.TAG_CLOSE?U=this._handle_tag_close(A,O,j):O.type===s.TEXT?U=this._handle_text(A,O,j):A.add_raw_token(O),W=U,O=K.next();var z=A._output.get_code(P);return z},y.prototype._handle_tag_close=function(F,P,N){var W={text:P.text,type:P.type};return F.alignment_size=0,N.tag_complete=!0,F.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),N.is_unformatted?F.add_raw_token(P):(N.tag_start_char==="<"&&(F.set_space_before_token(P.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&N.has_wrapped_attrs&&F.print_newline(!1)),F.print_token(P)),N.indent_content&&!(N.is_unformatted||N.is_content_unformatted)&&(F.indent(),N.indent_content=!1),!N.is_inline_element&&!(N.is_unformatted||N.is_content_unformatted)&&F.set_wrap_point(),W},y.prototype._handle_inside_tag=function(F,P,N,W){var j=N.has_wrapped_attrs,A={text:P.text,type:P.type};if(F.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),N.is_unformatted)F.add_raw_token(P);else if(N.tag_start_char==="{"&&P.type===s.TEXT)F.print_preserved_newlines(P)?(P.newlines=0,F.add_raw_token(P)):F.print_token(P);else{if(P.type===s.ATTRIBUTE?(F.set_space_before_token(!0),N.attr_count+=1):(P.type===s.EQUALS||P.type===s.VALUE&&P.previous.type===s.EQUALS)&&F.set_space_before_token(!1),P.type===s.ATTRIBUTE&&N.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(F.traverse_whitespace(P),j=j||P.newlines!==0),this._is_wrap_attributes_force)){var K=N.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&N.attr_count===1){var U=!0,O=0,z;do{if(z=W.peek(O),z.type===s.ATTRIBUTE){U=!1;break}O+=1}while(O<4&&z.type!==s.EOF&&z.type!==s.TAG_CLOSE);K=!U}K&&(F.print_newline(!1),j=!0)}F.print_token(P),j=j||F.previous_token_wrapped(),N.has_wrapped_attrs=j}return A},y.prototype._handle_text=function(F,P,N){var W={text:P.text,type:"TK_CONTENT"};return N.custom_beautifier_name?this._print_custom_beatifier_text(F,P,N):N.is_unformatted||N.is_content_unformatted?F.add_raw_token(P):(F.traverse_whitespace(P),F.print_token(P)),W},y.prototype._print_custom_beatifier_text=function(F,P,N){var W=this;if(P.text!==""){var j=P.text,A,K=1,U="",O="";N.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:N.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:N.custom_beautifier_name==="html"&&(A=function(Ne,Oe){var Ke=new y(Ne,Oe,W._js_beautify,W._css_beautify);return Ke.beautify()}),this._options.indent_scripts==="keep"?K=0:this._options.indent_scripts==="separate"&&(K=-F.indent_level);var z=F.get_full_indent(K);if(j=j.replace(/\n[ \t]*$/,""),N.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(<!--|<!\[CDATA\[)/)){var te=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(j);if(!te){F.add_raw_token(P);return}U=z+te[1]+`
`,j=te[4],te[5]&&(O=z+te[5]),j=j.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(`
`)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(P.whitespace_before=te[0]))}if(j)if(A){var de=function(){this.eol=`
`};de.prototype=this._options.raw_options;var be=new de;j=A(z+j,be)}else{var je=P.whitespace_before;je&&(j=j.replace(new RegExp(`
(`+je+")?","g"),`
`)),j=z+j.replace(/\n/g,`
`+z)}U&&(j?j=U+j+`
`+O:j=U+O),F.print_newline(!1),j&&(P.text=j,P.whitespace_before="",P.newlines=0,F.add_raw_token(P),F.print_newline(!0))}},y.prototype._handle_tag_open=function(F,P,N,W){var j=this._get_tag_open_token(P);return(N.is_unformatted||N.is_content_unformatted)&&!N.is_empty_element&&P.type===s.TAG_OPEN&&P.text.indexOf("</")===0?(F.add_raw_token(P),j.start_tag_token=this._tag_stack.try_pop(j.tag_name)):(F.traverse_whitespace(P),this._set_tag_position(F,P,j,N,W),j.is_inline_element||F.set_wrap_point(),F.print_token(P)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(j.alignment_size=P.text.length+1),!j.tag_complete&&!j.is_unformatted&&(F.alignment_size=j.alignment_size),j};var T=function(F,P){if(this.parent=F||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!P)this.tag_complete=!0;else{var N;this.tag_start_char=P.text[0],this.text=P.text,this.tag_start_char==="<"?(N=P.text.match(/^<([^\s>]*)/),this.tag_check=N?N[1]:""):(N=P.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=N?N[1]:"",(P.text.startsWith("{{#>")||P.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&P.next!==null?this.tag_check=P.next.text.split(" ")[0]:this.tag_check=P.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),P.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||P.closed&&P.closed.text==="/>";var W=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(W=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(W)))}};y.prototype._get_tag_open_token=function(F){var P=new T(this._tag_stack.get_parser_token(),F);return P.alignment_size=this._options.wrap_attributes_indent_size,P.is_end_tag=P.is_end_tag||S(P.tag_check,this._options.void_elements),P.is_empty_element=P.tag_complete||P.is_start_tag&&P.is_end_tag,P.is_unformatted=!P.tag_complete&&S(P.tag_check,this._options.unformatted),P.is_content_unformatted=!P.is_empty_element&&S(P.tag_check,this._options.content_unformatted),P.is_inline_element=S(P.tag_name,this._options.inline)||P.tag_name.includes("-")||P.tag_start_char==="{",P},y.prototype._set_tag_position=function(F,P,N,W,j){if(N.is_empty_element||(N.is_end_tag?N.start_tag_token=this._tag_stack.try_pop(N.tag_name):(this._do_optional_end_element(N)&&(N.is_inline_element||F.print_newline(!1)),this._tag_stack.record_tag(N),(N.tag_name==="script"||N.tag_name==="style")&&!(N.is_unformatted||N.is_content_unformatted)&&(N.custom_beautifier_name=m(N.tag_check,P)))),S(N.tag_check,this._options.extra_liners)&&(F.print_newline(!1),F._output.just_added_blankline()||F.print_newline(!0)),N.is_empty_element){if(N.tag_start_char==="{"&&N.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),N.indent_content=!0;var A=F.current_line_has_match(/{{#if/);A||F.print_newline(!1)}N.tag_name==="!--"&&j.type===s.TAG_CLOSE&&W.is_end_tag&&N.text.indexOf(`
`)===-1||(N.is_inline_element||N.is_unformatted||F.print_newline(!1),this._calcluate_parent_multiline(F,N))}else if(N.is_end_tag){var K=!1;K=N.start_tag_token&&N.start_tag_token.multiline_content,K=K||!N.is_inline_element&&!(W.is_inline_element||W.is_unformatted)&&!(j.type===s.TAG_CLOSE&&N.start_tag_token===W)&&j.type!=="TK_CONTENT",(N.is_content_unformatted||N.is_unformatted)&&(K=!1),K&&F.print_newline(!1)}else N.indent_content=!N.custom_beautifier_name,N.tag_start_char==="<"&&(N.tag_name==="html"?N.indent_content=this._options.indent_inner_html:N.tag_name==="head"?N.indent_content=this._options.indent_head_inner_html:N.tag_name==="body"&&(N.indent_content=this._options.indent_body_inner_html)),!(N.is_inline_element||N.is_unformatted)&&(j.type!=="TK_CONTENT"||N.is_content_unformatted)&&F.print_newline(!1),this._calcluate_parent_multiline(F,N)},y.prototype._calcluate_parent_multiline=function(F,P){P.parent&&F._output.just_added_newline()&&!((P.is_inline_element||P.is_unformatted)&&P.parent.is_inline_element)&&(P.parent.multiline_content=!0)};var k=["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"],g=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(F){var P=null;if(F.is_empty_element||!F.is_start_tag||!F.parent)return;if(F.tag_name==="body")P=P||this._tag_stack.try_pop("head");else if(F.tag_name==="li")P=P||this._tag_stack.try_pop("li",["ol","ul"]);else if(F.tag_name==="dd"||F.tag_name==="dt")P=P||this._tag_stack.try_pop("dt",["dl"]),P=P||this._tag_stack.try_pop("dd",["dl"]);else if(F.parent.tag_name==="p"&&k.indexOf(F.tag_name)!==-1){var N=F.parent.parent;(!N||g.indexOf(N.tag_name)===-1)&&(P=P||this._tag_stack.try_pop("p"))}else F.tag_name==="rp"||F.tag_name==="rt"?(P=P||this._tag_stack.try_pop("rt",["ruby","rtc"]),P=P||this._tag_stack.try_pop("rp",["ruby","rtc"])):F.tag_name==="optgroup"?P=P||this._tag_stack.try_pop("optgroup",["select"]):F.tag_name==="option"?P=P||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):F.tag_name==="colgroup"?P=P||this._tag_stack.try_pop("caption",["table"]):F.tag_name==="thead"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"])):F.tag_name==="tbody"||F.tag_name==="tfoot"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("thead",["table"]),P=P||this._tag_stack.try_pop("tbody",["table"])):F.tag_name==="tr"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(F.tag_name==="th"||F.tag_name==="td")&&(P=P||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),P=P||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return F.parent=this._tag_stack.get_parser_token(),P},o.exports.Beautifier=y},function(o,h,n){var a=n(6).Options;function t(r){a.call(this,r,"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 a,o.exports.Options=t},function(o,h,n){var a=n(9).Tokenizer,t=n(9).TOKEN,r=n(13).Directives,s=n(14).TemplatablePattern,u=n(12).Pattern,f={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 r(/<\!--/,/-->/),v=function(m,S){a.call(this,m,S),this._current_tag_name="";var C=new s(this._input).read_options(this._options),_=new u(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:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.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=_.matching(y).until_after(y)}};v.prototype=new a,v.prototype._is_comment=function(m){return!1},v.prototype._is_opening=function(m){return m.type===f.TAG_OPEN},v.prototype._is_closing=function(m,S){return m.type===f.TAG_CLOSE&&S&&((m.text===">"||m.text==="/>")&&S.text[0]==="<"||m.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.prototype._get_next_token=function(m,S){var C=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(f.EOF,""):(C=C||this._read_open_handlebars(_,S),C=C||this._read_attribute(_,m,S),C=C||this._read_close(_,S),C=C||this._read_raw_content(_,m,S),C=C||this._read_content_word(_),C=C||this._read_comment_or_cdata(_),C=C||this._read_processing(_),C=C||this._read_open(_,S),C=C||this._create_token(f.UNKNOWN,this._input.next()),C)},v.prototype._read_comment_or_cdata=function(m){var S=null,C=null,_=null;if(m==="<"){var y=this._input.peek(1);y==="!"&&(C=this.__patterns.comment.read(),C?(_=d.get_directives(C),_&&_.ignore==="start"&&(C+=d.readIgnored(this._input))):C=this.__patterns.cdata.read()),C&&(S=this._create_token(f.COMMENT,C),S.directives=_)}return S},v.prototype._read_processing=function(m){var S=null,C=null,_=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(f.COMMENT,C),S.directives=_)}return S},v.prototype._read_open=function(m,S){var C=null,_=null;return S||m==="<"&&(C=this._input.next(),this._input.peek()==="/"&&(C+=this._input.next()),C+=this.__patterns.element_name.read(),_=this._create_token(f.TAG_OPEN,C)),_},v.prototype._read_open_handlebars=function(m,S){var C=null,_=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(),_=this._create_token(f.COMMENT,C)):(C=this.__patterns.handlebars_open.read(),_=this._create_token(f.TAG_OPEN,C))),_},v.prototype._read_close=function(m,S){var C=null,_=null;return S&&(S.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(C=this._input.next(),m==="/"&&(C+=this._input.next()),_=this._create_token(f.TAG_CLOSE,C)):S.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(f.TAG_CLOSE,"}}"))),_},v.prototype._read_attribute=function(m,S,C){var _=null,y="";if(C&&C.text[0]==="<")if(m==="=")_=this._create_token(f.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(),_=this._create_token(f.VALUE,T)}else y=this.__patterns.attribute.read(),y&&(S.type===f.EQUALS?_=this._create_token(f.VALUE,y):_=this._create_token(f.ATTRIBUTE,y));return _},v.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)},v.prototype._read_raw_content=function(m,S,C){var _="";if(C&&C.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(S.type===f.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=f.TEXT,T;_=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(_=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(f.TEXT,_):null},v.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(f.TEXT,S)},o.exports.Tokenizer=v,o.exports.TOKEN=f}],b={};function i(o){var h=b[o];if(h!==void 0)return h.exports;var n=b[o]={exports:{}};return E[o](n,n.exports,i),n.exports}var c=i(18);I=c})();var L=I;if(!0)!(G=[Q,Q("6UM0"),Q("TXwP")],R=function(E){var b=Q("6UM0"),i=Q("TXwP");return{html_beautify:function(c,o){return L(c,o,b.js_beautify,i.css_beautify)}}}.apply(re,G),R!==void 0&&(it.exports=R));else var M,p})()},q7KB:function(it,re,Q){},"rAM+":function(it,re,Q){"use strict";Q.d(re,"a",function(){return R});var G=Q("Qw5x");function R(I,L){var M;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(M=Object(G.a)(I))||L&&I&&typeof I.length=="number"){M&&(I=M);var p=0,E=function(){};return{s:E,n:function(){return p>=I.length?{done:!0}:{done:!1,value:I[p++]}},e:function(h){throw h},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 b=!0,i=!1,c;return{s:function(){M=I[Symbol.iterator]()},n:function(){var h=M.next();return b=h.done,h},e:function(h){i=!0,c=h},f:function(){try{!b&&M.return!=null&&M.return()}finally{if(i)throw c}}}}},rUJ1:function(it,re){const Q=/[&<>"']/,G=/[&<>"']/g,R=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M=_=>L[_];function p(_,y){if(y){if(Q.test(_))return _.replace(G,M)}else if(R.test(_))return _.replace(I,M);return _}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b(_){return _.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 i=/(^|[^\[])\^/g;function c(_,y){_=_.source||_,y=y||"";const T={replace:(k,g)=>(g=g.source||g,g=g.replace(i,"$1"),_=_.replace(k,g),T),getRegex:()=>new RegExp(_,y)};return T}const o=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function n(_,y,T){if(_){let k;try{k=decodeURIComponent(b(T)).replace(o,"").toLowerCase()}catch(g){return null}if(k.indexOf("javascript:")===0||k.indexOf("vbscript:")===0||k.indexOf("data:")===0)return null}y&&!h.test(T)&&(T=u(y,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(k){return null}return T}const a={},t=/^[^:]+:\/*[^/]*$/,r=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(_,y){a[" "+_]||(t.test(_)?a[" "+_]=_+"/":a[" "+_]=m(_,"/",!0)),_=a[" "+_];const T=_.indexOf(":")===-1;return y.substring(0,2)==="//"?T?y:_.replace(r,"$1")+y:y.charAt(0)==="/"?T?y:_.replace(s,"$1")+y:_+y}const f={exec:function(){}};function d(_){let y=1,T,k;for(;y<arguments.length;y++){T=arguments[y];for(k in T)Object.prototype.hasOwnProperty.call(T,k)&&(_[k]=T[k])}return _}function v(_,y){const T=_.replace(/\|/g,(F,P,N)=>{let W=!1,j=P;for(;--j>=0&&N[j]==="\\";)W=!W;return W?"|":" |"}),k=T.split(/ \|/);let g=0;if(k.length>y)k.splice(y);else for(;k.length<y;)k.push("");for(;g<k.length;g++)k[g]=k[g].trim().replace(/\\\|/g,"|");return k}function m(_,y,T){const k=_.length;if(k===0)return"";let g=0;for(;g<k;){const F=_.charAt(k-g-1);if(F===y&&!T)g++;else if(F!==y&&T)g++;else break}return _.substr(0,k-g)}function S(_,y){if(_.indexOf(y[1])===-1)return-1;const T=_.length;let k=0,g=0;for(;g<T;g++)if(_[g]==="\\")g++;else if(_[g]===y[0])k++;else if(_[g]===y[1]&&(k--,k<0))return g;return-1}function C(_){_&&_.sanitize&&!_.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}it.exports={escape:p,unescape:b,edit:c,cleanUrl:n,resolveUrl:u,noopTest:f,merge:d,splitCells:v,rtrim:m,findClosingBracket:S,checkSanitizeDeprecation:C}},rwxt:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G=Q("GdRQ");function R(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function I(E,b){for(var i=0;i<b.length;i++){var c=b[i];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(E,c.key,c)}}function L(E,b,i){return b&&I(E.prototype,b),i&&I(E,i),E}var M=!G.supportsCursorURIs||G.isTouchDevice,p=function(){function E(){R(this,E),this._target=null,this._canvas=document.createElement("canvas"),M&&(this._canvas.style.position="fixed",this._canvas.style.zIndex="65535",this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden"),this._position={x:0,y:0},this._hotSpot={x:0,y:0},this._eventHandlers={mouseover:this._handleMouseOver.bind(this),mouseleave:this._handleMouseLeave.bind(this),mousemove:this._handleMouseMove.bind(this),mouseup:this._handleMouseUp.bind(this)}}return L(E,[{key:"attach",value:function(i){if(this._target&&this.detach(),this._target=i,M){document.body.appendChild(this._canvas);var c={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,c),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,c),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,c),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,c)}this.clear()}},{key:"detach",value:function(){if(!this._target)return;if(M){var i={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,i),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,i),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,i),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,i),document.body.removeChild(this._canvas)}this._target=null}},{key:"change",value:function(i,c,o,h,n){if(h===0||n===0){this.clear();return}this._position.x=this._position.x+this._hotSpot.x-c,this._position.y=this._position.y+this._hotSpot.y-o,this._hotSpot.x=c,this._hotSpot.y=o;var a=this._canvas.getContext("2d");this._canvas.width=h,this._canvas.height=n;var t;try{t=new ImageData(new Uint8ClampedArray(i),h,n)}catch(s){t=a.createImageData(h,n),t.data.set(new Uint8ClampedArray(i))}if(a.clearRect(0,0,h,n),a.putImageData(t,0,0),M)this._updatePosition();else{var r=this._canvas.toDataURL();this._target.style.cursor="url("+r+")"+c+" "+o+", default"}}},{key:"clear",value:function(){this._target.style.cursor="none",this._canvas.width=0,this._canvas.height=0,this._position.x=this._position.x+this._hotSpot.x,this._position.y=this._position.y+this._hotSpot.y,this._hotSpot.x=0,this._hotSpot.y=0}},{key:"move",value:function(i,c){if(!M)return;window.visualViewport?(this._position.x=i+window.visualViewport.offsetLeft,this._position.y=c+window.visualViewport.offsetTop):(this._position.x=i,this._position.y=c),this._updatePosition();var o=document.elementFromPoint(i,c);this._updateVisibility(o)}},{key:"_handleMouseOver",value:function(i){this._handleMouseMove(i)}},{key:"_handleMouseLeave",value:function(i){this._updateVisibility(i.relatedTarget)}},{key:"_handleMouseMove",value:function(i){this._updateVisibility(i.target),this._position.x=i.clientX-this._hotSpot.x,this._position.y=i.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(i){var c=this,o=document.elementFromPoint(i.clientX,i.clientY);this._updateVisibility(o),this._captureIsActive()&&window.setTimeout(function(){if(!c._target)return;o=document.elementFromPoint(i.clientX,i.clientY),c._updateVisibility(o)},0)}},{key:"_showCursor",value:function(){this._canvas.style.visibility==="hidden"&&(this._canvas.style.visibility="")}},{key:"_hideCursor",value:function(){this._canvas.style.visibility!=="hidden"&&(this._canvas.style.visibility="hidden")}},{key:"_shouldShowCursor",value:function(i){return i?i===this._target?!0:this._target.contains(i)?!(window.getComputedStyle(i).cursor!=="none"):!1:!1}},{key:"_updateVisibility",value:function(i){this._captureIsActive()&&(i=document.captureElement),this._shouldShowCursor(i)?this._showCursor():this._hideCursor()}},{key:"_updatePosition",value:function(){this._canvas.style.left=this._position.x+"px",this._canvas.style.top=this._position.y+"px"}},{key:"_captureIsActive",value:function(){return document.captureElement&&document.documentElement.contains(document.captureElement)}}]),E}();re.default=p},sjKO:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=I;var G=30,R=12;function I(L,M){var p,E,b,i,c,o,h,n,a,t,r,s,u,f,d,v,m,S,C,_,y,T,k,g,F;p=L.state,E=L.next_in,g=L.input,b=E+(L.avail_in-5),i=L.next_out,F=L.output,c=i-(M-L.avail_out),o=i+(L.avail_out-257),h=p.dmax,n=p.wsize,a=p.whave,t=p.wnext,r=p.window,s=p.hold,u=p.bits,f=p.lencode,d=p.distcode,v=(1<<p.lenbits)-1,m=(1<<p.distbits)-1;e:do{u<15&&(s+=g[E++]<<u,u+=8,s+=g[E++]<<u,u+=8),S=f[s&v];t:for(;;){if(C=S>>>24,s>>>=C,u-=C,C=S>>>16&255,C===0)F[i++]=S&65535;else if(C&16){_=S&65535,C&=15,C&&(u<C&&(s+=g[E++]<<u,u+=8),_+=s&(1<<C)-1,s>>>=C,u-=C),u<15&&(s+=g[E++]<<u,u+=8,s+=g[E++]<<u,u+=8),S=d[s&m];i:for(;;){if(C=S>>>24,s>>>=C,u-=C,C=S>>>16&255,C&16){if(y=S&65535,C&=15,u<C&&(s+=g[E++]<<u,u+=8,u<C&&(s+=g[E++]<<u,u+=8)),y+=s&(1<<C)-1,y>h){L.msg="invalid distance too far back",p.mode=G;break e}if(s>>>=C,u-=C,C=i-c,y>C){if(C=y-C,C>a&&p.sane){L.msg="invalid distance too far back",p.mode=G;break e}if(T=0,k=r,t===0){if(T+=n-C,C<_){_-=C;do F[i++]=r[T++];while(--C);T=i-y,k=F}}else if(t<C){if(T+=n+t-C,C-=t,C<_){_-=C;do F[i++]=r[T++];while(--C);if(T=0,t<_){C=t,_-=C;do F[i++]=r[T++];while(--C);T=i-y,k=F}}}else if(T+=t-C,C<_){_-=C;do F[i++]=r[T++];while(--C);T=i-y,k=F}for(;_>2;)F[i++]=k[T++],F[i++]=k[T++],F[i++]=k[T++],_-=3;_&&(F[i++]=k[T++],_>1&&(F[i++]=k[T++]))}else{T=i-y;do F[i++]=F[T++],F[i++]=F[T++],F[i++]=F[T++],_-=3;while(_>2);_&&(F[i++]=F[T++],_>1&&(F[i++]=F[T++]))}}else if((C&64)===0){S=d[(S&65535)+(s&(1<<C)-1)];continue i}else{L.msg="invalid distance code",p.mode=G;break e}break}}else if((C&64)===0){S=f[(S&65535)+(s&(1<<C)-1)];continue t}else if(C&32){p.mode=R;break e}else{L.msg="invalid literal/length code",p.mode=G;break e}break}}while(E<b&&i<o);_=u>>3,E-=_,u-=_<<3,s&=(1<<u)-1,L.next_in=E,L.next_out=i,L.avail_in=E<b?5+(b-E):5-(E-b),L.avail_out=i<o?257+(o-i):257-(i-o),p.hold=s,p.bits=u;return}},t9D7:function(it,re,Q){"use strict";Q.d(re,"b",function(){return E}),Q.d(re,"g",function(){return i}),Q.d(re,"d",function(){return c}),Q.d(re,"e",function(){return o}),Q.d(re,"a",function(){return h}),Q.d(re,"f",function(){return t}),Q.d(re,"c",function(){return r});var G=Q("Vhoy"),R=Q("MI8n"),I=Q("pmY6"),L=Q("Cg/j"),M=Q("ic2d"),p=Q("nEHx");const E=Object(L.c)("themeService");var b;(function(s){function u(f){return f&&typeof f=="object"&&typeof f.id=="string"}s.isThemeColor=u})(b||(b={}));function i(s){return{id:s}}var c;(function(s){function u(C){return C&&typeof C=="object"&&typeof C.id=="string"&&(typeof C.color=="undefined"||b.isThemeColor(C.color))}s.isThemeIcon=u;const f=new RegExp(`^\\$\\((${G.a.iconNameExpression}(?:${G.a.iconModifierExpression})?)\\)$`);function d(C){const _=f.exec(C);if(!_)return;let[,y]=_;return{id:y}}s.fromString=d;function v(C,_){let y=C.id;const T=y.lastIndexOf("~");return T!==-1&&(y=y.substring(0,T)),_&&(y=`${y}~${_}`),{id:y}}s.modify=v;function m(C,_){var y,T;return C.id===_.id&&((y=C.color)===null||y===void 0?void 0:y.id)===((T=_.color)===null||T===void 0?void 0:T.id)}s.isEqual=m;function S(C,_){return{id:C.id,color:_?i(_):void 0}}s.asThemeIcon=S,s.asClassNameArray=G.a.asClassNameArray,s.asClassName=G.a.asClassName,s.asCSSSelector=G.a.asCSSSelector})(c||(c={}));function o(s){switch(s){case p.a.DARK:return"vs-dark";case p.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const h={ThemingContribution:"base.contributions.theming"};class n{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new R.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(I.i)(()=>{const u=this.themingParticipants.indexOf(s);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new n;M.a.add(h.ThemingContribution,a);function t(s){return a.onColorThemeChange(s)}class r extends I.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(it,re,Q){typeof window!="undefined"&&function(R,I){it.exports=I()}(this,function(){return function(G){var R={};function I(L){if(R[L])return R[L].exports;var M=R[L]={i:L,l:!1,exports:{}};return G[L].call(M.exports,M,M.exports,I),M.l=!0,M.exports}return I.m=G,I.c=R,I.d=function(L,M,p){I.o(L,M)||Object.defineProperty(L,M,{enumerable:!0,get:p})},I.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})},I.t=function(L,M){if(M&1&&(L=I(L)),M&8)return L;if(M&4&&typeof L=="object"&&L&&L.__esModule)return L;var p=Object.create(null);if(I.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:L}),M&2&&typeof L!="string")for(var E in L)I.d(p,E,function(b){return L[b]}.bind(null,E));return p},I.n=function(L){var M=L&&L.__esModule?function(){return L.default}:function(){return L};return I.d(M,"a",M),M},I.o=function(L,M){return Object.prototype.hasOwnProperty.call(L,M)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(G,R,I){"use strict";var L=Object.prototype.hasOwnProperty,M="~";function p(){}Object.create&&(p.prototype=Object.create(null),new p().__proto__||(M=!1));function E(o,h,n){this.fn=o,this.context=h,this.once=n||!1}function b(o,h,n,a,t){if(typeof n!="function")throw new TypeError("The listener must be a function");var r=new E(n,a||o,t),s=M?M+h:h;return o._events[s]?o._events[s].fn?o._events[s]=[o._events[s],r]:o._events[s].push(r):(o._events[s]=r,o._eventsCount++),o}function i(o,h){--o._eventsCount===0?o._events=new p:delete o._events[h]}function c(){this._events=new p,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],n,a;if(this._eventsCount===0)return h;for(a in n=this._events)L.call(n,a)&&h.push(M?a.slice(1):a);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(n)):h},c.prototype.listeners=function(h){var n=M?M+h:h,a=this._events[n];if(!a)return[];if(a.fn)return[a.fn];for(var t=0,r=a.length,s=new Array(r);t<r;t++)s[t]=a[t].fn;return s},c.prototype.listenerCount=function(h){var n=M?M+h:h,a=this._events[n];return a?a.fn?1:a.length:0},c.prototype.emit=function(h,n,a,t,r,s){var u=M?M+h:h;if(!this._events[u])return!1;var f=this._events[u],d=arguments.length,v,m;if(f.fn){f.once&&this.removeListener(h,f.fn,void 0,!0);switch(d){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,n),!0;case 3:return f.fn.call(f.context,n,a),!0;case 4:return f.fn.call(f.context,n,a,t),!0;case 5:return f.fn.call(f.context,n,a,t,r),!0;case 6:return f.fn.call(f.context,n,a,t,r,s),!0}for(m=1,v=new Array(d-1);m<d;m++)v[m-1]=arguments[m];f.fn.apply(f.context,v)}else{var S=f.length,C;for(m=0;m<S;m++){f[m].once&&this.removeListener(h,f[m].fn,void 0,!0);switch(d){case 1:f[m].fn.call(f[m].context);break;case 2:f[m].fn.call(f[m].context,n);break;case 3:f[m].fn.call(f[m].context,n,a);break;case 4:f[m].fn.call(f[m].context,n,a,t);break;default:if(!v)for(C=1,v=new Array(d-1);C<d;C++)v[C-1]=arguments[C];f[m].fn.apply(f[m].context,v)}}}return!0},c.prototype.on=function(h,n,a){return b(this,h,n,a,!1)},c.prototype.once=function(h,n,a){return b(this,h,n,a,!0)},c.prototype.removeListener=function(h,n,a,t){var r=M?M+h:h;if(!this._events[r])return this;if(!n)return i(this,r),this;var s=this._events[r];if(s.fn)s.fn===n&&(!t||s.once)&&(!a||s.context===a)&&i(this,r);else{for(var u=0,f=[],d=s.length;u<d;u++)(s[u].fn!==n||t&&!s[u].once||a&&s[u].context!==a)&&f.push(s[u]);f.length?this._events[r]=f.length===1?f[0]:f:i(this,r)}return this},c.prototype.removeAllListeners=function(h){var n;return h?(n=M?M+h:h,this._events[n]&&i(this,n)):(this._events=new p,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=M,c.EventEmitter=c,G.exports=c},"./node_modules/url-toolkit/src/url-toolkit.js":function(G,R,I){(function(L){var M=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,p=/^([^\/?#]*)([^]*)$/,E=/(?:\/|^)\.(?=\/)/g,b=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,i={buildAbsoluteURL:function(c,o,h){if(h=h||{},c=c.trim(),o=o.trim(),!o){if(!h.alwaysNormalize)return c;var n=i.parseURL(c);if(!n)throw new Error("Error trying to parse base URL.");return n.path=i.normalizePath(n.path),i.buildURLFromParts(n)}var a=i.parseURL(o);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return h.alwaysNormalize?(a.path=i.normalizePath(a.path),i.buildURLFromParts(a)):o;var t=i.parseURL(c);if(!t)throw new Error("Error trying to parse base URL.");if(!t.netLoc&&t.path&&t.path[0]!=="/"){var r=p.exec(t.path);t.netLoc=r[1],t.path=r[2]}t.netLoc&&!t.path&&(t.path="/");var s={scheme:t.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(s.netLoc=t.netLoc,a.path[0]!=="/"))if(!a.path)s.path=t.path,a.params||(s.params=t.params,a.query||(s.query=t.query));else{var u=t.path,f=u.substring(0,u.lastIndexOf("/")+1)+a.path;s.path=i.normalizePath(f)}return s.path===null&&(s.path=h.alwaysNormalize?i.normalizePath(a.path):a.path),i.buildURLFromParts(s)},parseURL:function(c){var o=M.exec(c);return o?{scheme:o[1]||"",netLoc:o[2]||"",path:o[3]||"",params:o[4]||"",query:o[5]||"",fragment:o[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(E,"");c.length!==(c=c.replace(b,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};G.exports=i})(this)},"./node_modules/webworkify-webpack/index.js":function(G,R,I){function L(h){var n={};function a(r){if(n[r])return n[r].exports;var s=n[r]={i:r,l:!1,exports:{}};return h[r].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=h,a.c=n,a.i=function(r){return r},a.d=function(r,s,u){a.o(r,s)||Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:u})},a.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},a.n=function(r){var s=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(s,"a",s),s},a.o=function(r,s){return Object.prototype.hasOwnProperty.call(r,s)},a.p="/",a.oe=function(r){throw console.error(r),r};var t=a(a.s=ENTRY_MODULE);return t.default||t}var M="[\\.|\\-|\\+|\\w|/|@]+",p="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+M+").*?\\)";function E(h){return(h+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function b(h){return!isNaN(1*h)}function i(h,n,a){var t={};t[a]=[];var r=n.toString(),s=r.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return t;for(var u=s[1],f=new RegExp("(\\\\n|\\W)"+E(u)+p,"g"),d;d=f.exec(r);){if(d[3]==="dll-reference")continue;t[a].push(d[3])}for(f=new RegExp("\\("+E(u)+'\\("(dll-reference\\s('+M+'))"\\)\\)'+p,"g");d=f.exec(r);)h[d[2]]||(t[a].push(d[1]),h[d[2]]=I(d[1]).m),t[d[2]]=t[d[2]]||[],t[d[2]].push(d[4]);for(var v=Object.keys(t),m=0;m<v.length;m++)for(var S=0;S<t[v[m]].length;S++)b(t[v[m]][S])&&(t[v[m]][S]=1*t[v[m]][S]);return t}function c(h){var n=Object.keys(h);return n.reduce(function(a,t){return a||h[t].length>0},!1)}function o(h,n){for(var a={main:[n]},t={main:[]},r={main:{}};c(a);)for(var s=Object.keys(a),u=0;u<s.length;u++){var f=s[u],d=a[f],v=d.pop();if(r[f]=r[f]||{},r[f][v]||!h[f][v])continue;r[f][v]=!0,t[f]=t[f]||[],t[f].push(v);for(var m=i(h,h[f][v],f),S=Object.keys(m),C=0;C<S.length;C++)a[S[C]]=a[S[C]]||[],a[S[C]]=a[S[C]].concat(m[S[C]])}return t}G.exports=function(h,n){n=n||{};var a={main:I.m},t=n.all?{main:Object.keys(a.main)}:o(a,h),r="";Object.keys(t).filter(function(v){return v!=="main"}).forEach(function(v){for(var m=0;t[v][m];)m++;t[v].push(m),a[v][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",r=r+"var "+v+" = ("+L.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+t[v].map(function(S){return""+JSON.stringify(S)+": "+a[v][S].toString()}).join(",")+`});
`}),r=r+"new (("+L.toString().replace("ENTRY_MODULE",JSON.stringify(h))+")({"+t.main.map(function(v){return""+JSON.stringify(v)+": "+a.main[v].toString()}).join(",")+"}))(self);";var s=new window.Blob([r],{type:"text/javascript"});if(n.bare)return s;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,f=u.createObjectURL(s),d=new window.Worker(f);return d.objectURL=f,d}},"./src/config.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"hlsDefaultConfig",function(){return C}),I.d(R,"mergeConfig",function(){return y}),I.d(R,"enableStreamingMode",function(){return T});var L=I("./src/controller/abr-controller.ts"),M=I("./src/controller/audio-stream-controller.ts"),p=I("./src/controller/audio-track-controller.ts"),E=I("./src/controller/subtitle-stream-controller.ts"),b=I("./src/controller/subtitle-track-controller.ts"),i=I("./src/controller/buffer-controller.ts"),c=I("./src/controller/timeline-controller.ts"),o=I("./src/controller/cap-level-controller.ts"),h=I("./src/controller/fps-controller.ts"),n=I("./src/controller/eme-controller.ts"),a=I("./src/controller/cmcd-controller.ts"),t=I("./src/utils/xhr-loader.ts"),r=I("./src/utils/fetch-loader.ts"),s=I("./src/utils/cues.ts"),u=I("./src/utils/mediakeys-helper.ts"),f=I("./src/utils/logger.ts");function d(){return d=Object.assign||function(k){for(var g=1;g<arguments.length;g++){var F=arguments[g];for(var P in F)Object.prototype.hasOwnProperty.call(F,P)&&(k[P]=F[P])}return k},d.apply(this,arguments)}function v(k,g){var F=Object.keys(k);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(k);g&&(P=P.filter(function(N){return Object.getOwnPropertyDescriptor(k,N).enumerable})),F.push.apply(F,P)}return F}function m(k){for(var g=1;g<arguments.length;g++){var F=arguments[g]!=null?arguments[g]:{};g%2?v(Object(F),!0).forEach(function(P){S(k,P,F[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(F)):v(Object(F)).forEach(function(P){Object.defineProperty(k,P,Object.getOwnPropertyDescriptor(F,P))})}return k}function S(k,g,F){return g in k?Object.defineProperty(k,g,{value:F,enumerable:!0,configurable:!0,writable:!0}):k[g]=F,k}var C=m(m({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:t.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:L.default,bufferController:i.default,capLevelController:o.default,fpsController:h.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:E.SubtitleStreamController,subtitleTrackController:b.default,timelineController:c.TimelineController,audioStreamController:M.default,audioTrackController:p.default,emeController:n.default,cmcdController:a.default});function _(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function y(k,g){if((g.liveSyncDurationCount||g.liveMaxLatencyDurationCount)&&(g.liveSyncDuration||g.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(g.liveMaxLatencyDurationCount!==void 0&&(g.liveSyncDurationCount===void 0||g.liveMaxLatencyDurationCount<=g.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(g.liveMaxLatencyDuration!==void 0&&(g.liveSyncDuration===void 0||g.liveMaxLatencyDuration<=g.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},k,g)}function T(k){var g=k.loader;if(g!==r.default&&g!==t.default)f.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),k.progressive=!1;else{var F=Object(r.fetchSupported)();F&&(k.loader=r.default,k.progressive=!0,k.enableSoftwareAES=!0,f.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/polyfills/number.ts"),M=I("./src/utils/ewma-bandwidth-estimator.ts"),p=I("./src/events.ts"),E=I("./src/utils/buffer-helper.ts"),b=I("./src/errors.ts"),i=I("./src/types/loader.ts"),c=I("./src/utils/logger.ts");function o(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function h(a,t,r){return t&&o(a.prototype,t),r&&o(a,r),a}var n=function(){function a(r){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=r;var s=r.config;this.bwEstimator=new M.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var t=a.prototype;return t.registerListeners=function(){var s=this.hls;s.on(p.Events.FRAG_LOADING,this.onFragLoading,this),s.on(p.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(p.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(p.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(p.Events.FRAG_LOADING,this.onFragLoading,this),s.off(p.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(p.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(p.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},t.onFragLoading=function(s,u){var f=u.frag;if(f.type===i.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=f,this.partCurrent=(d=u.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},t.onLevelLoaded=function(s,u){var f=this.hls.config;u.details.live?this.bwEstimator.update(f.abrEwmaSlowLive,f.abrEwmaFastLive):this.bwEstimator.update(f.abrEwmaSlowVoD,f.abrEwmaFastVoD)},t._abandonRulesCheck=function(){var s=this.fragCurrent,u=this.partCurrent,f=this.hls,d=f.autoLevelEnabled,v=f.config,m=f.media;if(!s||!m)return;var S=u?u.stats:s.stats,C=u?u.duration:s.duration;if(S.aborted){c.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||m.paused||!m.playbackRate||!m.readyState)return;var _=performance.now()-S.loading.start,y=Math.abs(m.playbackRate);if(_<=500*C/y)return;var T=f.levels,k=f.minAutoLevel,g=T[s.level],F=S.total||Math.max(S.loaded,Math.round(C*g.maxBitrate/8)),P=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/_),N=(F-S.loaded)/P,W=m.currentTime,j=(E.BufferHelper.bufferInfo(m,W,v.maxBufferHole).end-W)/y;if(j>=2*C/y||N<=j)return;var A=Number.POSITIVE_INFINITY,K;for(K=s.level-1;K>k;K--){var U=T[K].maxBitrate;if(A=C*U/(8*.8*P),A<j)break}if(A>=N)return;var O=this.bwEstimator.getEstimate();c.logger.warn("Fragment "+s.sn+(u?" part "+u.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+K+`
Current BW estimate: `+(Object(L.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+N.toFixed(3)+` s
Estimated load time for the next fragment: `+A.toFixed(3)+` s
Time to underbuffer: `+j.toFixed(3)+" s"),f.nextLoadLevel=K,this.bwEstimator.sample(_,S.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),f.trigger(p.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:u,stats:S})},t.onFragLoaded=function(s,u){var f=u.frag,d=u.part;if(f.type===i.PlaylistLevelType.MAIN&&Object(L.isFiniteNumber)(f.sn)){var v=d?d.stats:f.stats,m=d?d.duration:f.duration;if(this.clearTimer(),this.lastLoadedFragLevel=f.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[f.level],C=(S.loaded?S.loaded.bytes:0)+v.loaded,_=(S.loaded?S.loaded.duration:0)+m;S.loaded={bytes:C,duration:_},S.realBitrate=Math.round(8*C/_)}if(f.bitrateTest){var y={stats:v,frag:f,part:d,id:f.type};this.onFragBuffered(p.Events.FRAG_BUFFERED,y),f.bitrateTest=!1}}},t.onFragBuffered=function(s,u){var f=u.frag,d=u.part,v=d?d.stats:f.stats;if(v.aborted)return;if(f.type!==i.PlaylistLevelType.MAIN||f.sn==="initSegment")return;var m=v.parsing.end-v.loading.start;this.bwEstimator.sample(m,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),f.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},t.onError=function(s,u){switch(u.details){case b.ErrorDetails.FRAG_LOAD_ERROR:case b.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,u=this.partCurrent,f=this.hls,d=f.maxAutoLevel,v=f.config,m=f.minAutoLevel,S=f.media,C=u?u.duration:s?s.duration:0,_=S?S.currentTime:0,y=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,k=(E.BufferHelper.bufferInfo(S,_,v.maxBufferHole).end-_)/y,g=this.findBestLevel(T,m,d,k,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(g>=0)return g;c.logger.trace((k?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var F=C?Math.min(C,v.maxStarvationDelay):v.maxStarvationDelay,P=v.abrBandWidthFactor,N=v.abrBandWidthUpFactor;if(!k){var W=this.bitrateTestDelay;if(W){var j=C?Math.min(C,v.maxLoadingDelay):v.maxLoadingDelay;F=j-W,c.logger.trace("bitrate test took "+Math.round(1e3*W)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*F)+" ms"),P=N=1}}return g=this.findBestLevel(T,m,d,k+F,P,N),Math.max(g,0)},t.findBestLevel=function(s,u,f,d,v,m){for(var S,C=this.fragCurrent,_=this.partCurrent,y=this.lastLoadedFragLevel,T=this.hls.levels,k=T[y],g=!!(k!=null&&(S=k.details)!==null&&S!==void 0&&S.live),F=k==null?void 0:k.codecSet,P=_?_.duration:C?C.duration:0,N=f;N>=u;N--){var W=T[N];if(!W||F&&W.codecSet!==F)continue;var j=W.details,A=(_?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||P,K=void 0;N<=y?K=v*s:K=m*s;var U=T[N].maxBitrate,O=U*A/K;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+N+"/"+Math.round(K)+"/"+U+"/"+A+"/"+d+"/"+O),K>U&&(!O||g&&!this.bitrateTestDelay||O<d))return N}return-1},h(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,u=this.bwEstimator;if(s!==-1&&(!u||!u.canEstimate()))return s;var f=this.getNextABRAutoLevel();return s!==-1&&(f=Math.min(s,f)),f},set:function(s){this._nextAutoLevel=s}}]),a}();R.default=n},"./src/controller/audio-stream-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/polyfills/number.ts"),M=I("./src/controller/base-stream-controller.ts"),p=I("./src/events.ts"),E=I("./src/utils/buffer-helper.ts"),b=I("./src/controller/fragment-tracker.ts"),i=I("./src/types/level.ts"),c=I("./src/types/loader.ts"),o=I("./src/loader/fragment.ts"),h=I("./src/demux/chunk-cache.ts"),n=I("./src/demux/transmuxer-interface.ts"),a=I("./src/types/transmuxer.ts"),t=I("./src/controller/fragment-finders.ts"),r=I("./src/utils/discontinuities.ts"),s=I("./src/errors.ts"),u=I("./src/utils/logger.ts");function f(){return f=Object.assign||function(C){for(var _=1;_<arguments.length;_++){var y=arguments[_];for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&(C[T]=y[T])}return C},f.apply(this,arguments)}function d(C,_){C.prototype=Object.create(_.prototype),C.prototype.constructor=C,v(C,_)}function v(C,_){return v=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},v(C,_)}var m=100,S=function(C){d(_,C);function _(T,k){var g;return g=C.call(this,T,k,"[audio-stream-controller]")||this,g.videoBuffer=null,g.videoTrackCC=-1,g.waitingVideoCC=-1,g.audioSwitch=!1,g.trackId=-1,g.waitingData=null,g.mainDetails=null,g.bufferFlushed=!1,g._registerListeners(),g}var y=_.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var k=this.hls;k.on(p.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.on(p.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.on(p.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.on(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.on(p.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),k.on(p.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),k.on(p.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),k.on(p.Events.ERROR,this.onError,this),k.on(p.Events.BUFFER_RESET,this.onBufferReset,this),k.on(p.Events.BUFFER_CREATED,this.onBufferCreated,this),k.on(p.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),k.on(p.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),k.on(p.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var k=this.hls;k.off(p.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.off(p.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.off(p.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.off(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.off(p.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),k.off(p.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),k.off(p.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),k.off(p.Events.ERROR,this.onError,this),k.off(p.Events.BUFFER_RESET,this.onBufferReset,this),k.off(p.Events.BUFFER_CREATED,this.onBufferCreated,this),k.off(p.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),k.off(p.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),k.off(p.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(k,g){var F=g.frag,P=g.id,N=g.initPTS;if(P==="main"){var W=F.cc;this.initPTS[F.cc]=N,this.log("InitPTS for cc: "+W+" found from main: "+N),this.videoTrackCC=W,this.state===M.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(k){if(!this.levels){this.startPosition=k,this.state=M.State.STOPPED;return}var g=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,g>0&&k===-1?(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),this.state=M.State.IDLE):(this.loadedmetadata=!1,this.state=M.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=k,this.tick()},y.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_TRACK:{var k,g=this.levels,F=this.trackId,P=g==null||((k=g[F])===null||k===void 0)?void 0:k.details;if(P){if(this.waitForCdnTuneIn(P))break;this.state=M.State.WAITING_INIT_PTS}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var N,W=performance.now(),j=this.retryDate;(!j||W>=j||(N=this.media)!==null&&N!==void 0&&N.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=M.State.IDLE);break}case M.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var K=A.frag,U=A.part,O=A.cache,z=A.complete;if(this.initPTS[K.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.FRAG_LOADING;var te=O.flush(),de={frag:K,part:U,payload:te,networkDetails:null};this._handleFragmentLoadProgress(de),z&&C.prototype._handleFragmentLoadComplete.call(this,de)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+K.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var be=this.getLoadPosition(),je=E.BufferHelper.bufferInfo(this.mediaBuffer,be,this.config.maxBufferHole),Ne=Object(t.fragmentWithinToleranceTest)(je.end,this.config.maxFragLookUpTolerance,K);Ne<0&&(u.logger.log("Waiting fragment cc ("+K.cc+") @ "+K.start+" cancelled because another fragment at "+je.end+" is needed"),this.clearWaitingFragment())}}else this.state=M.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var k=this.waitingData;k&&(this.fragmentTracker.removeFragment(k.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.IDLE)},y.onTickEnd=function(){var k=this.media;if(!k||!k.readyState)return;var g=this.mediaBuffer?this.mediaBuffer:k,F=g.buffered;!this.loadedmetadata&&F.length&&(this.loadedmetadata=!0),this.lastCurrentTime=k.currentTime},y.doTickIdle=function(){var k,g,F=this.hls,P=this.levels,N=this.media,W=this.trackId,j=F.config;if(!P||!P[W])return;if(!N&&(this.startFragRequested||!j.startFragPrefetch))return;var A=P[W],K=A.details;if(!K||K.live&&this.levelLastLoaded!==W||this.waitForCdnTuneIn(K)){this.state=M.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,o.ElementaryStreamTypes.AUDIO,c.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,c.PlaylistLevelType.AUDIO);if(U===null)return;var O=U.len,z=this.getMaxBufferLength(),te=this.audioSwitch;if(O>=z&&!te)return;if(!te&&this._streamEnded(U,K)){F.trigger(p.Events.BUFFER_EOS,{type:"audio"}),this.state=M.State.ENDED;return}var de=K.fragments,be=de[0].start,je=U.end;if(te){var Ne=this.getLoadPosition();je=Ne,K.PTSKnown&&Ne<be&&((U.end>be||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),N.currentTime=be+.05))}var Oe=this.getNextFragment(je,K);if(!Oe){this.bufferFlushed=!0;return}((k=Oe.decryptdata)===null||k===void 0?void 0:k.keyFormat)==="identity"&&!((g=Oe.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(Oe,K):this.loadFragment(Oe,K,je)},y.getMaxBufferLength=function(){var k=C.prototype.getMaxBufferLength.call(this),g=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);return g===null?k:Math.max(k,g.len)},y.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(k,g){var F=g.audioTracks;this.resetTransmuxer(),this.levels=F.map(function(P){return new i.Level(P)})},y.onAudioTrackSwitching=function(k,g){var F=!!g.url;this.trackId=g.id;var P=this.fragCurrent;P!=null&&P.loader&&P.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),F?this.setInterval(m):this.resetTransmuxer(),F?(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(k,g){this.mainDetails=g.details},y.onAudioTrackLoaded=function(k,g){var F,P=this.levels,N=g.details,W=g.id;if(!P){this.warn("Audio tracks were reset while loading level "+W);return}this.log("Track "+W+" loaded ["+N.startSN+","+N.endSN+"],duration:"+N.totalduration);var j=P[W],A=0;if(N.live||(F=j.details)!==null&&F!==void 0&&F.live){var K=this.mainDetails;if(N.fragments[0]||(N.deltaUpdateFailed=!0),N.deltaUpdateFailed||!K)return;!j.details&&N.hasProgramDateTime&&K.hasProgramDateTime?(Object(r.alignMediaPlaylistByPDT)(N,K),A=N.fragments[0].start):A=this.alignPlaylists(N,j.details)}j.details=N,this.levelLastLoaded=W,!this.startFragRequested&&(this.mainDetails||!N.live)&&this.setStartPosition(j.details,A),this.state===M.State.WAITING_TRACK&&!this.waitForCdnTuneIn(N)&&(this.state=M.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(k){var g,F=k.frag,P=k.part,N=k.payload,W=this.config,j=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+F.sn+" of level "+F.level+" will not be buffered");return}var K=A[j];console.assert(K,"Audio track is defined on fragment load progress");var U=K.details;console.assert(U,"Audio track details are defined on fragment load progress");var O=W.defaultAudioCodec||K.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new n.default(this.hls,c.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[F.cc],de=(g=F.initSegment)===null||g===void 0?void 0:g.data;if(te!==void 0){var be=!1,je=P?P.index:-1,Ne=je!==-1,Oe=new a.ChunkMetadata(F.level,F.sn,F.stats.chunkCount,N.byteLength,je,Ne);z.push(N,de,O,"",F,P,U.totalduration,be,Oe,te)}else{u.logger.log("Unknown video PTS for cc "+F.cc+", waiting for video PTS before demuxing audio frag "+F.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+j);var Ke=this.waitingData=this.waitingData||{frag:F,part:P,cache:new h.default,complete:!1},We=Ke.cache;We.push(new Uint8Array(N)),this.waitingVideoCC=this.videoTrackCC,this.state=M.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(k){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,k)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(k,g){var F=g.tracks.audio;F&&(this.mediaBuffer=F.buffer),g.tracks.video&&(this.videoBuffer=g.tracks.video.buffer)},y.onFragBuffered=function(k,g){var F=g.frag,P=g.part;if(F.type!==c.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(F)){this.warn("Fragment "+F.sn+(P?" p: "+P.index:"")+" of level "+F.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}F.sn!=="initSegment"&&(this.fragPrevious=F,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(p.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(F,P)},y.onError=function(k,g){switch(g.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(c.PlaylistLevelType.AUDIO,g);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=g.fatal?M.State.ERROR:M.State.IDLE,this.warn(g.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="audio"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var F=!0,P=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);P&&P.len>.5&&(F=!this.reduceMaxBufferLength(P.len)),F&&(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(k,g){var F=g.type;F===o.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(k){var g,F="audio",P=this.hls,N=k.remuxResult,W=k.chunkMeta,j=this.getCurrentContext(W);if(!j){this.warn("The loading context changed while buffering fragment "+W.sn+" of level "+W.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(W.level);return}var A=j.frag,K=j.part,U=N.audio,O=N.text,z=N.id3,te=N.initSegment;if(this.fragContextChanged(A))return;if(this.state=M.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,A,W),P.trigger(p.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:F,tracks:te.tracks})),U){var de=U.startPTS,be=U.endPTS,je=U.startDTS,Ne=U.endDTS;K&&(K.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:be,startDTS:je,endDTS:Ne}),A.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,de,be,je,Ne),this.bufferFragmentData(U,A,K,W)}if(z!=null&&(g=z.samples)!==null&&g!==void 0&&g.length){var Oe=f({frag:A,id:F},z);P.trigger(p.Events.FRAG_PARSING_METADATA,Oe)}if(O){var Ke=f({frag:A,id:F},O);P.trigger(p.Events.FRAG_PARSING_USERDATA,Ke)}},y._bufferInitSegment=function(k,g,F){if(this.state!==M.State.PARSING)return;k.video&&delete k.video;var P=k.audio;if(!P)return;P.levelCodec=P.codec,P.id="audio",this.log("Init audio buffer, container:"+P.container+", codecs[parsed]=["+P.codec+"]"),this.hls.trigger(p.Events.BUFFER_CODECS,k);var N=P.initSegment;if(N!=null&&N.byteLength){var W={type:"audio",frag:g,part:null,chunkMeta:F,parent:g.type,data:N};this.hls.trigger(p.Events.BUFFER_APPENDING,W)}this.tick()},y.loadFragment=function(k,g,F){var P=this.fragmentTracker.getState(k);this.fragCurrent=k,(this.audioSwitch||P===b.FragmentState.NOT_LOADED||P===b.FragmentState.PARTIAL)&&(k.sn==="initSegment"?this._loadInitSegment(k):g.live&&!Object(L.isFiniteNumber)(this.initPTS[k.cc])?(this.log("Waiting for video PTS in continuity counter "+k.cc+" of live stream before loading audio fragment "+k.sn+" of level "+this.trackId),this.state=M.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,k,g,F)))},y.completeAudioSwitch=function(){var k=this.hls,g=this.media,F=this.trackId;g&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,k.trigger(p.Events.AUDIO_TRACK_SWITCHED,{id:F})},_}(M.default);R.default=S},"./src/controller/audio-track-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/controller/base-playlist-controller.ts"),E=I("./src/types/loader.ts");function b(n,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function i(n,a,t){return a&&b(n.prototype,a),t&&b(n,t),n}function c(n,a){n.prototype=Object.create(a.prototype),n.prototype.constructor=n,o(n,a)}function o(n,a){return o=Object.setPrototypeOf||function(r,s){return r.__proto__=s,r},o(n,a)}var h=function(n){c(a,n);function a(r){var s;return s=n.call(this,r,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var t=a.prototype;return t.registerListeners=function(){var s=this.hls;s.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(L.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(L.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,n.prototype.destroy.call(this)},t.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},t.onManifestParsed=function(s,u){this.tracks=u.audioTracks||[]},t.onAudioTrackLoaded=function(s,u){var f=u.id,d=u.details,v=this.tracksInGroup[f];if(!v){this.warn("Invalid audio track id "+f);return}var m=v.details;v.details=u.details,this.log("audioTrack "+f+" loaded ["+d.startSN+"-"+d.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,u,m))},t.onLevelLoading=function(s,u){this.switchLevel(u.level)},t.onLevelSwitching=function(s,u){this.switchLevel(u.level)},t.switchLevel=function(s){var u=this.hls.levels[s];if(!(u!=null&&u.audioGroupIds))return;var f=u.audioGroupIds[u.urlId];if(this.groupId!==f){this.groupId=f;var d=this.tracks.filter(function(m){return!f||m.groupId===f});this.selectDefaultTrack&&!d.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var v={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(L.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},t.onError=function(s,u){if(n.prototype.onError.call(this,s,u),u.fatal||!u.context)return;u.context.type===E.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},t.setAudioTrack=function(s){var u=this.tracksInGroup;if(s<0||s>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var f=u[this.trackId];this.log("Now switching to audio-track index "+s);var d=u[s],v=d.id,m=d.groupId,S=m===void 0?"":m,C=d.name,_=d.type,y=d.url;if(this.trackId=s,this.trackName=C,this.selectDefaultTrack=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:S,name:C,type:_,url:y}),d.details&&!d.details.live)return;var T=this.switchParams(d.url,f==null?void 0:f.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 u=this.trackName,f=this.findTrackId(u)||this.findTrackId();f!==-1?this.setAudioTrack(f):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},t.findTrackId=function(s){for(var u=this.tracksInGroup,f=0;f<u.length;f++){var d=u[f];if((!this.selectDefaultTrack||d.default)&&(!s||s===d.name))return d.id}return-1},t.loadPlaylist=function(s){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var f=u.id,d=u.groupId,v=u.url;if(s)try{v=s.addDirectives(v)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+f),this.clearTimer(),this.hls.trigger(L.Events.AUDIO_TRACK_LOADING,{url:v,id:f,groupId:d,deliveryDirectives:s||null})}},i(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),a}(p.default);R.default=h},"./src/controller/base-playlist-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return i});var L=I("./src/polyfills/number.ts"),M=I("./src/types/level.ts"),p=I("./src/controller/level-helper.ts"),E=I("./src/utils/logger.ts"),b=I("./src/errors.ts"),i=function(){function c(h,n){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=E.logger.log.bind(E.logger,n+":"),this.warn=E.logger.warn.bind(E.logger,n+":"),this.hls=h}var o=c.prototype;return o.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},o.onError=function(n,a){a.fatal&&a.type===b.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},o.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},o.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},o.stopLoad=function(){this.canLoad=!1,this.clearTimer()},o.switchParams=function(n,a){var t=a==null?void 0:a.renditionReports;if(t)for(var r=0;r<t.length;r++){var s=t[r],u=""+s.URI;if(u===n.substr(-u.length)){var f=parseInt(s["LAST-MSN"]),d=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var v=Math.min(a.age-a.partTarget,a.targetduration);d!==void 0&&v>a.partTarget&&(d+=1)}if(Object(L.isFiniteNumber)(f))return new M.HlsUrlParameters(f,Object(L.isFiniteNumber)(d)?d:void 0,M.HlsSkip.No)}}},o.loadPlaylist=function(n){},o.shouldLoadTrack=function(n){return this.canLoad&&n&&!!n.url&&(!n.details||n.details.live)},o.playlistLoaded=function(n,a,t){var r=this,s=a.details,u=a.stats,f=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(s.advancedDateTime=Date.now()-f,s.live||t!=null&&t.live){if(s.reloaded(t),t&&this.log("live playlist "+n+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),t&&s.fragments.length>0&&Object(p.mergeDetails)(t,s),!this.canLoad||!s.live)return;var d,v=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var S=this.hls.config.lowLatencyMode,C=s.lastPartSn,_=s.endSN,y=s.lastPartIndex,T=y!==-1,k=C===_,g=S?0:y;T?(v=k?_+1:C,m=k?g:y+1):v=_+1;var F=s.age,P=F+s.ageHeader,N=Math.min(P-s.partTarget,s.targetduration*1.5);if(N>0){if(t&&N>t.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+t.tuneInGoal+" to: "+N+" with playlist age: "+s.age),N=0;else{var W=Math.floor(N/s.targetduration);if(v+=W,m!==void 0){var j=Math.round(N%s.targetduration/s.partTarget);m+=j}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+F.toFixed(2)+"s goal: "+N+" skip sn "+W+" to part "+m)}s.tuneInGoal=N}if(d=this.getDeliveryDirectives(s,a.deliveryDirectives,v,m),S||!k){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(s,a.deliveryDirectives,v,m);var A=Object(p.computeReloadInterval)(s,u);v!==void 0&&s.canBlockReload&&(A-=s.partTarget||1),this.log("reload live playlist "+n+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return r.loadPlaylist(d)},A)}else this.clearTimer()},o.getDeliveryDirectives=function(n,a,t,r){var s=Object(M.getSkipValue)(n,t);return a!=null&&a.skip&&n.deltaUpdateFailed&&(t=a.msn,r=a.part,s=M.HlsSkip.No),new M.HlsUrlParameters(t,r,s)},o.retryLoadingOrFail=function(n){var a=this,t=this.hls.config,r=this.retryCount<t.levelLoadingMaxRetry;if(r){var s;if(this.retryCount++,n.details.indexOf("LoadTimeOut")>-1&&(s=n.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+n.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*t.levelLoadingRetryDelay,t.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+n.details+'"')}}else this.warn('cannot recover from error "'+n.details+'"'),this.clearTimer(),n.fatal=!0;return r},c}()},"./src/controller/base-stream-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"State",function(){return _}),I.d(R,"default",function(){return y});var L=I("./src/polyfills/number.ts"),M=I("./src/task-loop.ts"),p=I("./src/controller/fragment-tracker.ts"),E=I("./src/utils/buffer-helper.ts"),b=I("./src/utils/logger.ts"),i=I("./src/events.ts"),c=I("./src/errors.ts"),o=I("./src/types/transmuxer.ts"),h=I("./src/utils/mp4-tools.ts"),n=I("./src/utils/discontinuities.ts"),a=I("./src/controller/fragment-finders.ts"),t=I("./src/controller/level-helper.ts"),r=I("./src/loader/fragment-loader.ts"),s=I("./src/crypt/decrypter.ts"),u=I("./src/utils/time-ranges.ts"),f=I("./src/types/loader.ts");function d(T,k){for(var g=0;g<k.length;g++){var F=k[g];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(T,F.key,F)}}function v(T,k,g){return k&&d(T.prototype,k),g&&d(T,g),T}function m(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function S(T,k){T.prototype=Object.create(k.prototype),T.prototype.constructor=T,C(T,k)}function C(T,k){return C=Object.setPrototypeOf||function(F,P){return F.__proto__=P,F},C(T,k)}var _={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},y=function(T){S(k,T);function k(F,P,N){var W;return W=T.call(this)||this,W.hls=void 0,W.fragPrevious=null,W.fragCurrent=null,W.fragmentTracker=void 0,W.transmuxer=null,W._state=_.STOPPED,W.media=void 0,W.mediaBuffer=void 0,W.config=void 0,W.bitrateTest=!1,W.lastCurrentTime=0,W.nextLoadPosition=0,W.startPosition=0,W.loadedmetadata=!1,W.fragLoadError=0,W.retryDate=0,W.levels=null,W.fragmentLoader=void 0,W.levelLastLoaded=null,W.startFragRequested=!1,W.decrypter=void 0,W.initPTS=[],W.onvseeking=null,W.onvended=null,W.logPrefix="",W.log=void 0,W.warn=void 0,W.logPrefix=N,W.log=b.logger.log.bind(b.logger,N+":"),W.warn=b.logger.warn.bind(b.logger,N+":"),W.hls=F,W.fragmentLoader=new r.default(F.config),W.fragmentTracker=P,W.config=F.config,W.decrypter=new s.default(F,F.config),F.on(i.Events.KEY_LOADED,W.onKeyLoaded,m(W)),W}var g=k.prototype;return g.doTick=function(){this.onTickEnd()},g.onTickEnd=function(){},g.startLoad=function(P){},g.stopLoad=function(){this.fragmentLoader.abort();var P=this.fragCurrent;P&&this.fragmentTracker.removeFragment(P),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},g._streamEnded=function(P,N){var W=this.fragCurrent,j=this.fragmentTracker;if(!N.live&&W&&W.sn===N.endSN&&!P.nextStart){var A=j.getState(W);return A===p.FragmentState.PARTIAL||A===p.FragmentState.OK}return!1},g.onMediaAttached=function(P,N){var W=this.media=this.mediaBuffer=N.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),W.addEventListener("seeking",this.onvseeking),W.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(j.startPosition)},g.onMediaDetaching=function(){var P=this.media;P!=null&&P.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),P&&(P.removeEventListener("seeking",this.onvseeking),P.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},g.onMediaSeeking=function(){var P=this.config,N=this.fragCurrent,W=this.media,j=this.mediaBuffer,A=this.state,K=W?W.currentTime:0,U=E.BufferHelper.bufferInfo(j||W,K,P.maxBufferHole);if(this.log("media seeking to "+(Object(L.isFiniteNumber)(K)?K.toFixed(3):K)+", state: "+A),A===_.ENDED)this.resetLoadingState();else if(N&&!U.len){var O=P.maxFragLookUpTolerance,z=N.start-O,te=N.start+N.duration+O,de=K>te;(K<z||de)&&(de&&N.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),N.loader.abort()),this.resetLoadingState())}W&&(this.lastCurrentTime=K),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=K),this.tickImmediate()},g.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},g.onKeyLoaded=function(P,N){if(this.state!==_.KEY_LOADING||N.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var W=this.levels[N.frag.level].details;W&&this.loadFragment(N.frag,W,N.frag.start)},g.onHandlerDestroying=function(){this.stopLoad(),T.prototype.onHandlerDestroying.call(this)},g.onHandlerDestroyed=function(){this.state=_.STOPPED,this.hls.off(i.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,T.prototype.onHandlerDestroyed.call(this)},g.loadKey=function(P,N){this.log("Loading key for "+P.sn+" of ["+N.startSN+"-"+N.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+P.level),this.state=_.KEY_LOADING,this.fragCurrent=P,this.hls.trigger(i.Events.KEY_LOADING,{frag:P})},g.loadFragment=function(P,N,W){this._loadFragForPlayback(P,N,W)},g._loadFragForPlayback=function(P,N,W){var j=this,A=function(U){if(j.fragContextChanged(P)){j.warn("Fragment "+P.sn+(U.part?" p: "+U.part.index:"")+" of level "+P.level+" was dropped during download."),j.fragmentTracker.removeFragment(P);return}P.stats.chunkCount++,j._handleFragmentLoadProgress(U)};this._doFragLoad(P,N,W,A).then(function(K){if(!K)return;j.fragLoadError=0;var U=j.state;if(j.fragContextChanged(P)){(U===_.FRAG_LOADING||U===_.BACKTRACKING||!j.fragCurrent&&U===_.PARSING)&&(j.fragmentTracker.removeFragment(P),j.state=_.IDLE);return}if("payload"in K&&(j.log("Loaded fragment "+P.sn+" of level "+P.level),j.hls.trigger(i.Events.FRAG_LOADED,K),j.state===_.BACKTRACKING)){j.fragmentTracker.backtrack(P,K),j.resetFragmentLoading(P);return}j._handleFragmentLoadComplete(K)}).catch(function(K){j.warn(K),j.resetFragmentLoading(P)})},g.flushMainBuffer=function(P,N,W){if(W===void 0&&(W=null),!(P-N))return;var j={startOffset:P,endOffset:N,type:W};this.fragLoadError=0,this.hls.trigger(i.Events.BUFFER_FLUSHING,j)},g._loadInitSegment=function(P){var N=this;this._doFragLoad(P).then(function(W){if(!W||N.fragContextChanged(P)||!N.levels)throw new Error("init load aborted");return W}).then(function(W){var j=N.hls,A=W.payload,K=P.decryptdata;if(A&&A.byteLength>0&&K&&K.key&&K.iv&&K.method==="AES-128"){var U=self.performance.now();return N.decrypter.webCryptoDecrypt(new Uint8Array(A),K.key.buffer,K.iv.buffer).then(function(O){var z=self.performance.now();return j.trigger(i.Events.FRAG_DECRYPTED,{frag:P,payload:O,stats:{tstart:U,tdecrypt:z}}),W.payload=O,W})}return W}).then(function(W){var j=N.fragCurrent,A=N.hls,K=N.levels;if(!K)throw new Error("init load aborted, missing levels");var U=K[P.level].details;console.assert(U,"Level details are defined when init segment is loaded");var O=P.stats;N.state=_.IDLE,N.fragLoadError=0,P.data=new Uint8Array(W.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),W.frag===j&&A.trigger(i.Events.FRAG_BUFFERED,{stats:O,frag:j,part:null,id:P.type}),N.tick()}).catch(function(W){N.warn(W),N.resetFragmentLoading(P)})},g.fragContextChanged=function(P){var N=this.fragCurrent;return!P||!N||P.level!==N.level||P.sn!==N.sn||P.urlId!==N.urlId},g.fragBufferedComplete=function(P,N){var W=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+P.type+" sn: "+P.sn+(N?" part: "+N.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+P.level+" "+u.default.toString(E.BufferHelper.getBuffered(W))),this.state=_.IDLE,this.tick()},g._handleFragmentLoadComplete=function(P){var N=this.transmuxer;if(!N)return;var W=P.frag,j=P.part,A=P.partsLoaded,K=!A||A.length===0||A.some(function(O){return!O}),U=new o.ChunkMetadata(W.level,W.sn,W.stats.chunkCount+1,0,j?j.index:-1,!K);N.flush(U)},g._handleFragmentLoadProgress=function(P){},g._doFragLoad=function(P,N,W,j){var A=this;if(W===void 0&&(W=null),!this.levels)throw new Error("frag load aborted, missing levels");if(W=Math.max(P.start,W||0),this.config.lowLatencyMode&&N){var K=N.partList;if(K&&j){W>P.end&&N.fragmentHint&&(P=N.fragmentHint);var U=this.getNextPart(K,P,W);if(U>-1){var O=K[U];return this.log("Loading part sn: "+P.sn+" p: "+O.index+" cc: "+P.cc+" of playlist ["+N.startSN+"-"+N.endSN+"] parts [0-"+U+"-"+(K.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+P.level+", target: "+parseFloat(W.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=_.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:P,part:K[U],targetBufferTime:W}),this.doFragPartsLoad(P,K,U,j).catch(function(z){return A.handleFragLoadError(z)})}else if(!P.url||this.loadedEndOfParts(K,W))return Promise.resolve(null)}}return this.log("Loading fragment "+P.sn+" cc: "+P.cc+" "+(N?"of ["+N.startSN+"-"+N.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+P.level+", target: "+parseFloat(W.toFixed(3))),Object(L.isFiniteNumber)(P.sn)&&!this.bitrateTest&&(this.nextLoadPosition=P.start+P.duration),this.state=_.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:P,targetBufferTime:W}),this.fragmentLoader.load(P,j).catch(function(z){return A.handleFragLoadError(z)})},g.doFragPartsLoad=function(P,N,W,j){var A=this;return new Promise(function(K,U){var O=[],z=function te(de){var be=N[de];A.fragmentLoader.loadPart(P,be,j).then(function(je){O[be.index]=je;var Ne=je.part;A.hls.trigger(i.Events.FRAG_LOADED,je);var Oe=N[de+1];if(Oe&&Oe.fragment===P)te(de+1);else return K({frag:P,part:Ne,partsLoaded:O})}).catch(U)};z(W)})},g.handleFragLoadError=function(P){var N=P.data;return N&&N.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(N.frag,N.part):this.hls.trigger(i.Events.ERROR,N),null},g._handleTransmuxerFlush=function(P){var N=this.getCurrentContext(P);if(!N||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var W=N.frag,j=N.part,A=N.level,K=self.performance.now();W.stats.parsing.end=K,j&&(j.stats.parsing.end=K),this.updateLevelTiming(W,j,A,P.partial)},g.getCurrentContext=function(P){var N=this.levels,W=P.level,j=P.sn,A=P.part;if(!N||!N[W])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+W+". The current chunk will not be buffered."),null;var K=N[W],U=A>-1?Object(t.getPartWith)(K,j,A):null,O=U?U.fragment:Object(t.getFragmentWithSN)(K,j,this.fragCurrent);return O?{frag:O,part:U,level:K}:null},g.bufferFragmentData=function(P,N,W,j){if(!P||this.state!==_.PARSING)return;var A=P.data1,K=P.data2,U=A;if(A&&K&&(U=Object(h.appendUint8Array)(A,K)),!U||!U.length)return;var O={type:P.type,frag:N,part:W,chunkMeta:j,parent:N.type,data:U};this.hls.trigger(i.Events.BUFFER_APPENDING,O),P.dropped&&P.independent&&!W&&this.flushBufferGap(N)},g.flushBufferGap=function(P){var N=this.media;if(!N)return;if(!E.BufferHelper.isBuffered(N,N.currentTime)){this.flushMainBuffer(0,P.start);return}var W=N.currentTime,j=E.BufferHelper.bufferInfo(N,W,0),A=P.duration,K=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),U=Math.max(Math.min(P.start-K,j.end-K),W+K);P.start-U>K&&this.flushMainBuffer(U,P.start)},g.getFwdBufferInfo=function(P,N){var W=this.config,j=this.getLoadPosition();if(!Object(L.isFiniteNumber)(j))return null;var A=E.BufferHelper.bufferInfo(P,j,W.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var K=this.fragmentTracker.getBufferedFrag(j,N);if(K&&A.nextStart<K.end)return E.BufferHelper.bufferInfo(P,j,Math.max(A.nextStart,W.maxBufferHole))}return A},g.getMaxBufferLength=function(P){var N=this.config,W;return P?W=Math.max(8*N.maxBufferSize/P,N.maxBufferLength):W=N.maxBufferLength,Math.min(W,N.maxMaxBufferLength)},g.reduceMaxBufferLength=function(P){var N=this.config,W=P||N.maxBufferLength;return N.maxMaxBufferLength>=W?(N.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+N.maxMaxBufferLength+"s"),!0):!1},g.getNextFragment=function(P,N){var W,j,A=N.fragments,K=A.length;if(!K)return null;var U=this.config,O=A[0].start,z;if(N.live){var te=U.initialLiveManifestSize;if(K<te)return this.warn("Not enough fragments to start playback (have: "+K+", need: "+te+")"),null;!N.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(N,A),this.startPosition=z?this.hls.liveSyncPosition||z.start:P)}else P<=O&&(z=A[0]);if(!z){var de=U.lowLatencyMode?N.partEnd:N.fragmentEnd;z=this.getFragmentAtPosition(P,de,N)}return(W=z)!==null&&W!==void 0&&W.initSegment&&!((j=z)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},g.getNextPart=function(P,N,W){for(var j=-1,A=!1,K=!0,U=0,O=P.length;U<O;U++){var z=P[U];if(K=K&&!z.independent,j>-1&&W<z.start)break;var te=z.loaded;!te&&(A||z.independent||K)&&z.fragment===N&&(j=U),A=te}return j},g.loadedEndOfParts=function(P,N){var W=P[P.length-1];return W&&N>W.start&&W.loaded},g.getInitialLiveFragment=function(P,N){var W=this.fragPrevious,j=null;if(W){if(P.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+W.programDateTime),j=Object(a.findFragmentByPDT)(N,W.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var A=W.sn+1;if(A>=P.startSN&&A<=P.endSN){var K=N[A-P.startSN];W.cc===K.cc&&(j=K,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(a.findFragWithCC)(N,W.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(j=this.getFragmentAtPosition(U,this.bitrateTest?P.fragmentEnd:P.edge,P))}return j},g.getFragmentAtPosition=function(P,N,W){var j=this.config,A=this.fragPrevious,K=W.fragments,U=W.endSN,O=W.fragmentHint,z=j.maxFragLookUpTolerance,te=!!(j.lowLatencyMode&&W.partList&&O);te&&O&&!this.bitrateTest&&(K=K.concat(O),U=O.sn);var de;if(P<N){var be=P>N-z?0:z;de=Object(a.findFragmentByPTS)(A,K,P,be)}else de=K[K.length-1];if(de){var je=de.sn-W.startSN,Ne=A&&de.level===A.level,Oe=K[je+1],Ke=this.fragmentTracker.getState(de);if(Ke===p.FragmentState.BACKTRACKED){de=null;for(var We=je;K[We]&&this.fragmentTracker.getState(K[We])===p.FragmentState.BACKTRACKED;)A?de=K[We--]:de=K[--We];de||(de=Oe)}else A&&de.sn===A.sn&&!te&&(Ne&&(de.sn<U&&this.fragmentTracker.getState(Oe)!==p.FragmentState.OK?(this.log("SN "+de.sn+" just loaded, load next one: "+Oe.sn),de=Oe):de=null))}return de},g.synchronizeToLiveEdge=function(P){var N=this.config,W=this.media;if(!W)return;var j=this.hls.liveSyncPosition,A=W.currentTime,K=P.fragments[0].start,U=P.edge,O=A>=K-N.maxFragLookUpTolerance&&A<=U;if(j!==null&&W.duration>j&&(A<j||!O)){var z=N.liveMaxLatencyDuration!==void 0?N.liveMaxLatencyDuration:N.liveMaxLatencyDurationCount*P.targetduration;(!O&&W.readyState<4||A<U-z)&&(this.loadedmetadata||(this.nextLoadPosition=j),W.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+j.toFixed(3)),W.currentTime=j))}},g.alignPlaylists=function(P,N){var W=this.levels,j=this.levelLastLoaded,A=this.fragPrevious,K=j!==null?W[j]:null,U=P.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var O=P.fragments[0].start,z=!N,te=P.alignedSliding&&Object(L.isFiniteNumber)(O);if(z||!te&&!O){Object(n.alignStream)(A,K,P);var de=P.fragments[0].start;return this.log("Live playlist sliding: "+de.toFixed(2)+" start-sn: "+(N?N.startSN:"na")+"->"+P.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+U),de}return O},g.waitForCdnTuneIn=function(P){var N=3;return P.live&&P.canBlockReload&&P.tuneInGoal>Math.max(P.partHoldBack,P.partTarget*N)},g.setStartPosition=function(P,N){var W=this.startPosition;if(W<N&&(W=-1),W===-1||this.lastCurrentTime===-1){var j=P.startTimeOffset;Object(L.isFiniteNumber)(j)?(W=N+j,j<0&&(W+=P.totalduration),W=Math.min(Math.max(N,W),N+P.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+W),this.startPosition=W):P.live?W=this.hls.liveSyncPosition||N:this.startPosition=W=0,this.lastCurrentTime=W}this.nextLoadPosition=W},g.getLoadPosition=function(){var P=this.media,N=0;return this.loadedmetadata&&P?N=P.currentTime:this.nextLoadPosition&&(N=this.nextLoadPosition),N},g.handleFragLoadAborted=function(P,N){this.transmuxer&&P.sn!=="initSegment"&&P.stats.aborted&&(this.warn("Fragment "+P.sn+(N?" part"+N.index:"")+" of level "+P.level+" was aborted"),this.resetFragmentLoading(P))},g.resetFragmentLoading=function(P){(!this.fragCurrent||!this.fragContextChanged(P))&&(this.state=_.IDLE)},g.onFragmentOrKeyLoadError=function(P,N){if(N.fatal)return;var W=N.frag;if(!W||W.type!==P)return;var j=this.fragCurrent;console.assert(j&&W.sn===j.sn&&W.level===j.level&&W.urlId===j.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(W.level))return;var K=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+W.sn+" of "+P+" "+W.level+" failed to load, retrying in "+K+"ms"),this.retryDate=self.performance.now()+K,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else N.levelRetry?(P===f.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(b.logger.error(N.details+" reaches max retry, redispatch as fatal ..."),N.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},g.afterBufferFlushed=function(P,N,W){if(!P)return;var j=E.BufferHelper.getBuffered(P);this.fragmentTracker.detectEvictedFragments(N,j,W),this.state===_.ENDED&&this.resetLoadingState()},g.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},g.resetLiveStartWhenNotLoaded=function(P){if(!this.loadedmetadata){this.startFragRequested=!1;var N=this.levels?this.levels[P].details:null;if(N!=null&&N.live)return this.startPosition=-1,this.setStartPosition(N,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},g.updateLevelTiming=function(P,N,W,j){var A=this,K=W.details;console.assert(!!K,"level.details must be defined");var U=Object.keys(P.elementaryStreams).reduce(function(O,z){var te=P.elementaryStreams[z];if(te){var de=te.endPTS-te.startPTS;if(de<=0)return A.warn("Could not parse fragment "+P.sn+" "+z+" duration reliably ("+de+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),O||!1;var be=j?0:Object(t.updateFragPTSDTS)(K,P,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return A.hls.trigger(i.Events.LEVEL_PTS_UPDATED,{details:K,level:W,drift:be,type:z,frag:P,start:te.startPTS,end:te.endPTS}),!0}return O},!1);U?(this.state=_.PARSED,this.hls.trigger(i.Events.FRAG_PARSED,{frag:P,part:N})):this.resetLoadingState()},g.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(k,[{key:"state",get:function(){return this._state},set:function(P){var N=this._state;N!==P&&(this._state=P,this.log(N+"->"+P))}}]),k}(M.default)},"./src/controller/buffer-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return a});var L=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),p=I("./src/utils/logger.ts"),E=I("./src/errors.ts"),b=I("./src/utils/buffer-helper.ts"),i=I("./src/utils/mediasource-helper.ts"),c=I("./src/loader/fragment.ts"),o=I("./src/controller/buffer-operation-queue.ts"),h=Object(i.getMediaSource)(),n=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function t(s){var u=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 f=u.hls,d=u.media,v=u.mediaSource;p.logger.log("[buffer-controller]: Media source opened"),d&&(u.updateMediaElementDuration(),f.trigger(M.Events.MEDIA_ATTACHED,{media:d})),v&&v.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){p.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){p.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var r=t.prototype;return r.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},r.destroy=function(){this.unregisterListeners(),this.details=null},r.registerListeners=function(){var u=this.hls;u.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(M.Events.BUFFER_RESET,this.onBufferReset,this),u.on(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(M.Events.BUFFER_EOS,this.onBufferEos,this),u.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(M.Events.FRAG_PARSED,this.onFragParsed,this),u.on(M.Events.FRAG_CHANGED,this.onFragChanged,this)},r.unregisterListeners=function(){var u=this.hls;u.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(M.Events.BUFFER_RESET,this.onBufferReset,this),u.off(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(M.Events.BUFFER_EOS,this.onBufferEos,this),u.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(M.Events.FRAG_PARSED,this.onFragParsed,this),u.off(M.Events.FRAG_CHANGED,this.onFragChanged,this)},r._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new o.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},r.onManifestParsed=function(u,f){var d=2;(f.audio&&!f.video||!f.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,p.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.onMediaAttaching=function(u,f){var d=this.media=f.media;if(d&&h){var v=this.mediaSource=new h;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(v),this._objectUrl=d.src}},r.onMediaDetaching=function(){var u=this.media,f=this.mediaSource,d=this._objectUrl;if(f){if(p.logger.log("[buffer-controller]: media source detaching"),f.readyState==="open")try{f.endOfStream()}catch(v){p.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),f.removeEventListener("sourceopen",this._onMediaSourceOpen),f.removeEventListener("sourceended",this._onMediaSourceEnded),f.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(d&&self.URL.revokeObjectURL(d),u.src===d?(u.removeAttribute("src"),u.load()):p.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)},r.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(f){var d=u.sourceBuffer[f];try{d&&(u.removeBufferListeners(f),u.mediaSource&&u.mediaSource.removeSourceBuffer(d),u.sourceBuffer[f]=void 0)}catch(v){p.logger.warn("[buffer-controller]: Failed to reset the "+f+" buffer",v)}}),this._initSourceBuffer()},r.onBufferCodecs=function(u,f){var d=this,v=this.getSourceBufferTypes().length;if(Object.keys(f).forEach(function(m){if(v){var S=d.tracks[m];if(S&&typeof S.buffer.changeType=="function"){var C=f[m],_=C.codec,y=C.levelCodec,T=C.container,k=(S.levelCodec||S.codec).replace(n,"$1"),g=(y||_).replace(n,"$1");if(k!==g){var F=T+";codecs="+(y||_);d.appendChangeType(m,F)}}}else d.pendingTracks[m]=f[m]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},r.appendChangeType=function(u,f){var d=this,v=this.operationQueue,m={execute:function(){var C=d.sourceBuffer[u];C&&(p.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+f),C.changeType(f)),v.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(C){p.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",C)}};v.append(m,u)},r.onBufferAppending=function(u,f){var d=this,v=this.hls,m=this.operationQueue,S=this.tracks,C=f.data,_=f.type,y=f.frag,T=f.part,k=f.chunkMeta,g=k.buffering[_],F=self.performance.now();g.start=F;var P=y.stats.buffering,N=T?T.stats.buffering:null;P.start===0&&(P.start=F),N&&N.start===0&&(N.start=F);var W=S.audio,j=_==="audio"&&k.id===1&&(W==null?void 0:W.container)==="audio/mpeg",A={execute:function(){if(g.executeStart=self.performance.now(),j){var U=d.sourceBuffer[_];if(U){var O=y.start-U.timestampOffset;Math.abs(O)>=.1&&(p.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+O+") sn: "+y.sn+")"),U.timestampOffset=y.start)}}d.appendExecutor(C,_)},onStart:function(){},onComplete:function(){var U=self.performance.now();g.executeEnd=g.end=U,P.first===0&&(P.first=U),N&&N.first===0&&(N.first=U);var O=d.sourceBuffer,z={};for(var te in O)z[te]=b.BufferHelper.getBuffered(O[te]);d.appendError=0,d.hls.trigger(M.Events.BUFFER_APPENDED,{type:_,frag:y,part:T,chunkMeta:k,parent:y.type,timeRanges:z})},onError:function(U){p.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",U);var O={type:E.ErrorTypes.MEDIA_ERROR,parent:y.type,details:E.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=E.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,O.details=E.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>v.config.appendErrorMaxRetry&&(p.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),v.trigger(M.Events.ERROR,O)}};m.append(A,_)},r.onBufferFlushing=function(u,f){var d=this,v=this.operationQueue,m=function(C){return{execute:d.removeExecutor.bind(d,C,f.startOffset,f.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(M.Events.BUFFER_FLUSHED,{type:C})},onError:function(y){p.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",y)}}};f.type?v.append(m(f.type),f.type):this.getSourceBufferTypes().forEach(function(S){v.append(m(S),S)})},r.onFragParsed=function(u,f){var d=this,v=f.frag,m=f.part,S=[],C=m?m.elementaryStreams:v.elementaryStreams;C[c.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(C[c.ElementaryStreamTypes.AUDIO]&&S.push("audio"),C[c.ElementaryStreamTypes.VIDEO]&&S.push("video"));var _=function(){var T=self.performance.now();v.stats.buffering.end=T,m&&(m.stats.buffering.end=T);var k=m?m.stats:v.stats;d.hls.trigger(M.Events.FRAG_BUFFERED,{frag:v,part:m,stats:k,id:v.type})};S.length===0&&p.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(_,S)},r.onFragChanged=function(u,f){this.flushBackBuffer()},r.onBufferEos=function(u,f){var d=this,v=this.getSourceBufferTypes().reduce(function(m,S){var C=d.sourceBuffer[S];return(!f.type||f.type===S)&&(C&&!C.ended&&(C.ended=!0,p.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),m&&!!(!C||C.ended)},!0);v&&this.blockBuffers(function(){var m=d.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},r.onLevelUpdated=function(u,f){var d=f.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},r.flushBackBuffer=function(){var u=this.hls,f=this.details,d=this.media,v=this.sourceBuffer;if(!d||f===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var S=f.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(L.isFiniteNumber)(S)||S<0)return;var C=d.currentTime,_=f.levelTargetDuration,y=Math.max(S,_),T=Math.floor(C/_)*_-y;m.forEach(function(k){var g=v[k];if(g){var F=b.BufferHelper.getBuffered(g);F.length>0&&T>F.start(0)&&(u.trigger(M.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),f.live&&u.trigger(M.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),u.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:k}))}})},r.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,f=this.hls,d=this.media,v=this.mediaSource,m=u.fragments[0].start+u.totalduration,S=d.duration,C=Object(L.isFiniteNumber)(v.duration)?v.duration:0;u.live&&f.config.liveDurationInfinity?(p.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(u)):(m>C&&m>S||!Object(L.isFiniteNumber)(S))&&(p.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),v.duration=m)},r.updateSeekableRange=function(u){var f=this.mediaSource,d=u.fragments,v=d.length;if(v&&u.live&&f!==null&&f!==void 0&&f.setLiveSeekableRange){var m=Math.max(0,d[0].start),S=Math.max(m,m+u.totalduration);f.setLiveSeekableRange(m,S)}},r.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,f=this.operationQueue,d=this.pendingTracks,v=Object.keys(d).length;if(v&&!u||v===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){f.executeNext(S)})}},r.createSourceBuffers=function(u){var f=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var m in u)if(!f[m]){var S=u[m];if(!S)throw Error("source buffer exists for track "+m+", however track does not");var C=S.levelCodec||S.codec,_=S.container+";codecs="+C;p.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var y=f[m]=d.addSourceBuffer(_),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},v++}catch(k){p.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+k.message),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:k,mimeType:_})}}v&&this.hls.trigger(M.Events.BUFFER_CREATED,{tracks:this.tracks})},r._onSBUpdateStart=function(u){var f=this.operationQueue,d=f.current(u);d.onStart()},r._onSBUpdateEnd=function(u){var f=this.operationQueue,d=f.current(u);d.onComplete(),f.shiftAndExecuteNext(u)},r._onSBUpdateError=function(u,f){p.logger.error("[buffer-controller]: "+u+" SourceBuffer error",f),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(u);d&&d.onError(f)},r.removeExecutor=function(u,f,d){var v=this.media,m=this.mediaSource,S=this.operationQueue,C=this.sourceBuffer,_=C[u];if(!v||!m||!_){p.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var y=Object(L.isFiniteNumber)(v.duration)?v.duration:Infinity,T=Object(L.isFiniteNumber)(m.duration)?m.duration:Infinity,k=Math.max(0,f),g=Math.min(d,y,T);g>k?(p.logger.log("[buffer-controller]: Removing ["+k+","+g+"] from the "+u+" SourceBuffer"),console.assert(!_.updating,u+" sourceBuffer must not be updating"),_.remove(k,g)):S.shiftAndExecuteNext(u)},r.appendExecutor=function(u,f){var d=this.operationQueue,v=this.sourceBuffer,m=v[f];if(!m){p.logger.warn("[buffer-controller]: Attempting to append to the "+f+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(f);return}m.ended=!1,console.assert(!m.updating,f+" sourceBuffer must not be updating"),m.appendBuffer(u)},r.blockBuffers=function(u,f){var d=this;if(f===void 0&&(f=this.getSourceBufferTypes()),!f.length){p.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var v=this.operationQueue,m=f.map(function(S){return v.appendBlocker(S)});Promise.all(m).then(function(){u(),f.forEach(function(S){var C=d.sourceBuffer[S];(!C||!C.updating)&&v.shiftAndExecuteNext(S)})})},r.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},r.addBufferListener=function(u,f,d){var v=this.sourceBuffer[u];if(!v)return;var m=d.bind(this,u);this.listeners[u].push({event:f,listener:m}),v.addEventListener(f,m)},r.removeBufferListeners=function(u){var f=this.sourceBuffer[u];if(!f)return;this.listeners[u].forEach(function(d){f.removeEventListener(d.event,d.listener)})},t}()},"./src/controller/buffer-operation-queue.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return M});var L=I("./src/utils/logger.ts"),M=function(){function p(b){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=b}var E=p.prototype;return E.append=function(i,c){var o=this.queues[c];o.push(i),o.length===1&&this.buffers[c]&&this.executeNext(c)},E.insertAbort=function(i,c){var o=this.queues[c];o.unshift(i),this.executeNext(c)},E.appendBlocker=function(i){var c,o=new Promise(function(n){c=n}),h={execute:c,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(h,i),o},E.executeNext=function(i){var c=this.buffers,o=this.queues,h=c[i],n=o[i];if(n.length){var a=n[0];try{a.execute()}catch(t){L.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(t),(!h||!h.updating)&&(n.shift(),this.executeNext(i))}}},E.shiftAndExecuteNext=function(i){this.queues[i].shift(),this.executeNext(i)},E.current=function(i){return this.queues[i][0]},p}()},"./src/controller/cap-level-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/events.ts");function M(b,i){for(var c=0;c<i.length;c++){var o=i[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(b,o.key,o)}}function p(b,i,c){return i&&M(b.prototype,i),c&&M(b,c),b}var E=function(){function b(c){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=c,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var i=b.prototype;return i.setStreamController=function(o){this.streamController=o},i.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},i.registerListeners=function(){var o=this.hls;o.on(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.unregisterListener=function(){var o=this.hls;o.off(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.onFpsDropLevelCapping=function(o,h){b.isLevelAllowed(h.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(h.droppedLevel)},i.onMediaAttaching=function(o,h){this.media=h.media instanceof HTMLVideoElement?h.media:null},i.onManifestParsed=function(o,h){var n=this.hls;this.restrictedLevels=[],this.firstLevel=h.firstLevel,n.config.capLevelToPlayerSize&&h.video&&this.startCapping()},i.onBufferCodecs=function(o,h){var n=this.hls;n.config.capLevelToPlayerSize&&h.video&&this.startCapping()},i.onMediaDetaching=function(){this.stopCapping()},i.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var o=this.hls.levels;if(o.length){var h=this.hls;h.autoLevelCapping=this.getMaxLevel(o.length-1),h.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=h.autoLevelCapping}}},i.getMaxLevel=function(o){var h=this,n=this.hls.levels;if(!n.length)return-1;var a=n.filter(function(t,r){return b.isLevelAllowed(r,h.restrictedLevels)&&r<=o});return this.clientRect=null,b.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},i.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()},i.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},i.getDimensions=function(){if(this.clientRect)return this.clientRect;var o=this.media,h={width:0,height:0};if(o){var n=o.getBoundingClientRect();h.width=n.width,h.height=n.height,!h.width&&!h.height&&(h.width=n.right-n.left||o.width||0,h.height=n.bottom-n.top||o.height||0)}return this.clientRect=h,h},b.isLevelAllowed=function(o,h){return h===void 0&&(h=[]),h.indexOf(o)===-1},b.getMaxLevelByMediaSize=function(o,h,n){if(!o||!o.length)return-1;for(var a=function(f,d){return d?f.width!==d.width||f.height!==d.height:!0},t=o.length-1,r=0;r<o.length;r+=1){var s=o[r];if((s.width>=h||s.height>=n)&&a(s,o[r+1])){t=r;break}}return t},p(b,[{key:"mediaWidth",get:function(){return this.getDimensions().width*b.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*b.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var o=1;try{o=self.devicePixelRatio}catch(h){}return o}}]),b}();R.default=E},"./src/controller/cmcd-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return a});var L=I("./src/events.ts"),M=I("./src/types/cmcd.ts"),p=I("./src/utils/buffer-helper.ts"),E=I("./src/utils/logger.ts");function b(t,r){for(var s=0;s<r.length;s++){var u=r[s];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,u.key,u)}}function i(t,r,s){return r&&b(t.prototype,r),s&&b(t,s),t}function c(t,r){var s=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=o(t))||r&&t&&typeof t.length=="number"){s&&(t=s);var u=0;return function(){return u>=t.length?{done:!0}:{done:!1,value:t[u++]}}}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,r){if(!t)return;if(typeof t=="string")return h(t,r);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 h(t,r)}function h(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,u=new Array(r);s<r;s++)u[s]=t[s];return u}function n(){return n=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(t[u]=s[u])}return t},n.apply(this,arguments)}var a=function(){function t(s){var u=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(v){try{u.apply(v,{ot:M.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(m){E.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(v){try{var m=v.frag,S=u.hls.levels[m.level],C=u.getObjectType(m),_={d:m.duration*1e3,ot:C};(C===M.CMCDObjectType.VIDEO||C===M.CMCDObjectType.AUDIO||C==M.CMCDObjectType.MUXED)&&(_.br=S.bitrate/1e3,_.tb=u.getTopBandwidth(C),_.bl=u.getBufferLength(C)),u.apply(v,_)}catch(y){E.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=s;var f=this.config=s.config,d=f.cmcd;d!=null&&(f.pLoader=this.createPlaylistLoader(),f.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||t.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var r=t.prototype;return r.registerListeners=function(){var u=this.hls;u.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this)},r.unregisterListeners=function(){var u=this.hls;u.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},r.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},r.onMediaAttached=function(u,f){this.media=f.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},r.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},r.onBufferCreated=function(u,f){var d,v;this.audioBuffer=(d=f.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(v=f.tracks.video)===null||v===void 0?void 0:v.buffer},r.createData=function(){var u;return{v:M.CMCDVersion,sf:M.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},r.apply=function(u,f){f===void 0&&(f={}),n(f,this.createData());var d=f.ot===M.CMCDObjectType.INIT||f.ot===M.CMCDObjectType.VIDEO||f.ot===M.CMCDObjectType.MUXED;if(this.starved&&d&&(f.bs=!0,f.su=!0,this.starved=!1),f.su==null&&(f.su=this.buffering),this.useHeaders){var v=t.toHeaders(f);if(!Object.keys(v).length)return;u.headers||(u.headers={}),n(u.headers,v)}else{var m=t.toQuery(f);if(!m)return;u.url=t.appendQueryToUri(u.url,m)}},r.getObjectType=function(u){var f=u.type;return f==="subtitle"?M.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?M.CMCDObjectType.INIT:f==="audio"?M.CMCDObjectType.AUDIO:f==="main"?this.hls.audioTracks.length?M.CMCDObjectType.VIDEO:M.CMCDObjectType.MUXED:void 0},r.getTopBandwidth=function(u){for(var f=0,d=u===M.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=c(d),m;!(m=v()).done;){var S=m.value;S.bitrate>f&&(f=S.bitrate)}return f>0?f:NaN},r.getBufferLength=function(u){var f=this.hls.media,d=u===M.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!f)return NaN;var v=p.BufferHelper.bufferInfo(d,f.currentTime,this.config.maxBufferHole);return v.len*1e3},r.createPlaylistLoader=function(){var u=this.config.pLoader,f=this.applyPlaylistData,d=u||this.config.loader;return function(){function v(S){this.loader=void 0,this.loader=new d(S)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,_,y){f(C),this.loader.load(C,_,y)},i(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},r.createFragmentLoader=function(){var u=this.config.fLoader,f=this.applyFragmentData,d=u||this.config.loader;return function(){function v(S){this.loader=void 0,this.loader=new d(S)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,_,y){f(C),this.loader.load(C,_,y)},i(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},t.uuid=function(){var u=URL.createObjectURL(new Blob),f=u.toString();return URL.revokeObjectURL(u),f.substr(f.lastIndexOf("/")+1)},t.serialize=function(u){for(var f=[],d=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},v=function(j){return Math.round(j)},m=function(j){return v(j/100)*100},S=function(j){return encodeURIComponent(j)},C={br:v,d:v,bl:m,dl:m,mtp:m,nor:S,rtp:m,tb:v},_=Object.keys(u||{}).sort(),y=c(_),T;!(T=y()).done;){var k=T.value,g=u[k];if(!d(g))continue;if(k==="v"&&g===1)continue;if(k=="pr"&&g===1)continue;var F=C[k];F&&(g=F(g));var P=typeof g,N=void 0;k==="ot"||k==="sf"||k==="st"?N=k+"="+g:P==="boolean"?N=k:P==="number"?N=k+"="+g:N=k+"="+JSON.stringify(g),f.push(N)}return f.join(",")},t.toHeaders=function(u){for(var f=Object.keys(u),d={},v=["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,_=f;C<_.length;C++){var y=_[C],T=S[y]!=null?S[y]:1;m[T][y]=u[y]}for(var k=0;k<m.length;k++){var g=t.serialize(m[k]);g&&(d["CMCD-"+v[k]]=g)}return d},t.toQuery=function(u){return"CMCD="+encodeURIComponent(t.serialize(u))},t.appendQueryToUri=function(u,f){if(!f)return u;var d=u.includes("?")?"&":"?";return""+u+d+f},t}()},"./src/controller/eme-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/utils/logger.ts"),E=I("./src/utils/mediakeys-helper.ts");function b(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function i(a,t,r){return t&&b(a.prototype,t),r&&b(a,r),a}var c=3,o=function(t,r,s){var u={audioCapabilities:[],videoCapabilities:[]};return t.forEach(function(f){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+f+'"',robustness:s.audioRobustness||""})}),r.forEach(function(f){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+f+'"',robustness:s.videoRobustness||""})}),[u]},h=function(t,r,s,u){switch(t){case E.KeySystems.WIDEVINE:return o(r,s,u);default:throw new Error("Unknown key-system: "+t)}},n=function(){function a(r){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=r,this._config=r.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var t=a.prototype;return t.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},t._registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t._unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t.getLicenseServerUrl=function(s){switch(s){case E.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},t._attemptKeySystemAccess=function(s,u,f){var d=this,v=h(s,u,f,this._drmSystemOptions);p.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,v);this.mediaKeysPromise=m.then(function(S){return d._onMediaKeySystemAccessObtained(s,S)}),m.catch(function(S){p.logger.error('Failed to obtain key-system "'+s+'" access:',S)})},t._onMediaKeySystemAccessObtained=function(s,u){var f=this;p.logger.log('Access for key-system "'+s+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:s};this._mediaKeysList.push(d);var v=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(m){return d.mediaKeys=m,p.logger.log('Media-keys created for key-system "'+s+'"'),f._onMediaKeysCreated(),m});return v.catch(function(m){p.logger.error("Failed to create media-keys:",m)}),v},t._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),s._onNewMediaKeySession(u.mediaKeysSession))})},t._onNewMediaKeySession=function(s){var u=this;p.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(f){u._onKeySessionMessage(s,f.message)},!1)},t._onKeySessionMessage=function(s,u){p.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(f){p.logger.log("Received license data (length: "+(f&&f.byteLength)+"), updating key-session"),s.update(f)})},t.onMediaEncrypted=function(s){var u=this;if(p.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){p.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var f=function(v){if(!u._media)return;u._attemptSetMediaKeys(v),u._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(f).catch(f)},t._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){p.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}p.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},t._generateRequestWithPreferredKeySession=function(s,u){var f=this,d=this._mediaKeysList[0];if(!d){p.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){p.logger.warn("Key-Session already initialized but requested again");return}var v=d.mediaKeysSession;if(!v){p.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){p.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}p.logger.log('Generating key-session request for "'+s+'" init data type'),d.mediaKeysSessionInitialized=!0,v.generateRequest(s,u).then(function(){p.logger.debug("Key-session generation succeeded")}).catch(function(m){p.logger.error("Error generating key-session request:",m),f.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},t._createLicenseXhr=function(s,u,f){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,s,u,f);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,d,s),v=void 0}catch(m){p.logger.error(m)}try{d.readyState||d.open("POST",s,!0),v&&v.call(this.hls,d,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return d},t._onLicenseRequestReadyStageChange=function(s,u,f,d){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,p.logger.log("License request succeeded");var v=s.response,m=this._licenseResponseCallback;if(m)try{v=m.call(this.hls,s,u)}catch(C){p.logger.error(C)}d(v)}else{if(p.logger.error("License Request XHR failed ("+u+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c){this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=c-this._requestLicenseFailureCount+1;p.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(f,d)}break}},t._generateLicenseRequestChallenge=function(s,u){switch(s.mediaKeySystemDomain){case E.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},t._requestLicense=function(s,u){p.logger.log("Requesting content license for key-system");var f=this._mediaKeysList[0];if(!f){p.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(f.mediaKeySystemDomain),v=this._createLicenseXhr(d,s,u);p.logger.log("Sending license request to URL: "+d);var m=this._generateLicenseRequestChallenge(f,s);v.send(m)}catch(S){p.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},t.onMediaAttached=function(s,u){if(!this._emeEnabled)return;var f=u.media;this._media=f,f.addEventListener("encrypted",this._onMediaEncrypted)},t.onMediaDetached=function(){var s=this._media,u=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(f){if(f.mediaKeysSession)return f.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},t.onManifestParsed=function(s,u){if(!this._emeEnabled)return;var f=u.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),d=u.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(E.KeySystems.WIDEVINE,f,d)},i(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();R.default=n},"./src/controller/fps-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/events.ts"),M=I("./src/utils/logger.ts"),p=function(){function E(i){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=i,this.registerListeners()}var b=E.prototype;return b.setStreamController=function(c){this.streamController=c},b.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},b.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching)},b.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},b.onMediaAttaching=function(c,o){var h=this.hls.config;if(h.capLevelOnFPSDrop){var n=o.media instanceof self.HTMLVideoElement?o.media:null;this.media=n,n&&typeof n.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),h.fpsDroppedMonitoringPeriod)}},b.checkFPS=function(c,o,h){var n=performance.now();if(o){if(this.lastTime){var a=n-this.lastTime,t=h-this.lastDroppedFrames,r=o-this.lastDecodedFrames,s=1e3*t/a,u=this.hls;if(u.trigger(L.Events.FPS_DROP,{currentDropped:t,currentDecoded:r,totalDroppedFrames:h}),s>0&&t>u.config.fpsDroppedMonitoringThreshold*r){var f=u.currentLevel;M.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=f)&&(f=f-1,u.trigger(L.Events.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:u.currentLevel}),u.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=h,this.lastDecodedFrames=o}},b.checkFPSInterval=function(){var c=this.media;if(c)if(this.isVideoPlaybackQualityAvailable){var o=c.getVideoPlaybackQuality();this.checkFPS(c,o.totalVideoFrames,o.droppedVideoFrames)}else this.checkFPS(c,c.webkitDecodedFrameCount,c.webkitDroppedFrameCount)},E}();R.default=p},"./src/controller/fragment-finders.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"findFragmentByPDT",function(){return p}),I.d(R,"findFragmentByPTS",function(){return E}),I.d(R,"fragmentWithinToleranceTest",function(){return b}),I.d(R,"pdtWithinToleranceTest",function(){return i}),I.d(R,"findFragWithCC",function(){return c});var L=I("./src/polyfills/number.ts"),M=I("./src/utils/binary-search.ts");function p(o,h,n){if(h===null||!Array.isArray(o)||!o.length||!Object(L.isFiniteNumber)(h))return null;var a=o[0].programDateTime;if(h<(a||0))return null;var t=o[o.length-1].endProgramDateTime;if(h>=(t||0))return null;n=n||0;for(var r=0;r<o.length;++r){var s=o[r];if(i(h,n,s))return s}return null}function E(o,h,n,a){n===void 0&&(n=0),a===void 0&&(a=0);var t=null;if(o?t=h[o.sn-h[0].sn+1]||null:n===0&&h[0].start===0&&(t=h[0]),t&&b(n,a,t)===0)return t;var r=M.default.search(h,b.bind(null,n,a));return r||t}function b(o,h,n){o===void 0&&(o=0),h===void 0&&(h=0);var a=Math.min(h,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-a<=o?1:n.start-a>o&&n.start?-1:0}function i(o,h,n){var a=Math.min(h,n.duration+(n.deltaPTS?n.deltaPTS:0))*1e3,t=n.endProgramDateTime||0;return t-a>o}function c(o,h){return M.default.search(o,function(n){return n.cc<h?1:n.cc>h?-1:0})}},"./src/controller/fragment-tracker.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"FragmentState",function(){return p}),I.d(R,"FragmentTracker",function(){return E});var L=I("./src/events.ts"),M=I("./src/types/loader.ts"),p;(function(c){c.NOT_LOADED="NOT_LOADED",c.BACKTRACKED="BACKTRACKED",c.APPENDING="APPENDING",c.PARTIAL="PARTIAL",c.OK="OK"})(p||(p={}));var E=function(){function c(h){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=h,this._registerListeners()}var o=c.prototype;return o._registerListeners=function(){var n=this.hls;n.on(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.on(L.Events.FRAG_LOADED,this.onFragLoaded,this)},o._unregisterListeners=function(){var n=this.hls;n.off(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.off(L.Events.FRAG_LOADED,this.onFragLoaded,this)},o.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},o.getAppendedFrag=function(n,a){if(a===M.PlaylistLevelType.MAIN){var t=this.activeFragment,r=this.activeParts;if(!t)return null;if(r)for(var s=r.length;s--;){var u=r[s],f=u?u.end:t.appendedPTS;if(u.start<=n&&f!==void 0&&n<=f)return s>9&&(this.activeParts=r.slice(s-9)),u}else if(t.start<=n&&t.appendedPTS!==void 0&&n<=t.appendedPTS)return t}return this.getBufferedFrag(n,a)},o.getBufferedFrag=function(n,a){for(var t=this.fragments,r=Object.keys(t),s=r.length;s--;){var u=t[r[s]];if((u==null?void 0:u.body.type)===a&&u.buffered){var f=u.body;if(f.start<=n&&n<=f.end)return f}}return null},o.detectEvictedFragments=function(n,a,t){var r=this;Object.keys(this.fragments).forEach(function(s){var u=r.fragments[s];if(!u)return;if(!u.buffered){u.body.type===t&&r.removeFragment(u.body);return}var f=u.range[n];if(!f)return;f.time.some(function(d){var v=!r.isTimeBuffered(d.startPTS,d.endPTS,a);return v&&r.removeFragment(u.body),v})})},o.detectPartialFragments=function(n){var a=this,t=this.timeRanges,r=n.frag,s=n.part;if(!t||r.sn==="initSegment")return;var u=i(r),f=this.fragments[u];if(!f)return;Object.keys(t).forEach(function(d){var v=r.elementaryStreams[d];if(!v)return;var m=t[d],S=s!==null||v.partial===!0;f.range[d]=a.getBufferedTimes(r,s,S,m)}),f.backtrack=f.loaded=null,Object.keys(f.range).length?f.buffered=!0:this.removeFragment(f.body)},o.fragBuffered=function(n){var a=i(n),t=this.fragments[a];t&&(t.backtrack=t.loaded=null,t.buffered=!0)},o.getBufferedTimes=function(n,a,t,r){for(var s={time:[],partial:t},u=a?a.start:n.start,f=a?a.end:n.end,d=n.minEndPTS||f,v=n.maxStartPTS||u,m=0;m<r.length;m++){var S=r.start(m)-this.bufferPadding,C=r.end(m)+this.bufferPadding;if(v>=S&&d<=C){s.time.push({startPTS:Math.max(u,r.start(m)),endPTS:Math.min(f,r.end(m))});break}else if(u<C&&f>S)s.partial=!0,s.time.push({startPTS:Math.max(u,r.start(m)),endPTS:Math.min(f,r.end(m))});else if(f<=S)break}return s},o.getPartialFragment=function(n){var a=null,t,r,s,u=0,f=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(v){var m=d[v];if(!m)return;b(m)&&(r=m.body.start-f,s=m.body.end+f,n>=r&&n<=s&&(t=Math.min(n-r,s-n),u<=t&&(a=m.body,u=t)))}),a},o.getState=function(n){var a=i(n),t=this.fragments[a];return t?t.buffered?b(t)?p.PARTIAL:p.OK:t.backtrack?p.BACKTRACKED:p.APPENDING:p.NOT_LOADED},o.backtrack=function(n,a){var t=i(n),r=this.fragments[t];if(!r||r.backtrack)return null;var s=r.backtrack=a||r.loaded;return r.loaded=null,s},o.getBacktrackData=function(n){var a=i(n),t=this.fragments[a];if(t){var r,s=t.backtrack;if(s!=null&&(r=s.payload)!==null&&r!==void 0&&r.byteLength)return s;this.removeFragment(n)}return null},o.isTimeBuffered=function(n,a,t){for(var r,s,u=0;u<t.length;u++){if(r=t.start(u)-this.bufferPadding,s=t.end(u)+this.bufferPadding,n>=r&&a<=s)return!0;if(a<=r)return!1}return!1},o.onFragLoaded=function(n,a){var t=a.frag,r=a.part;if(t.sn==="initSegment"||t.bitrateTest||r)return;var s=i(t);this.fragments[s]={body:t,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},o.onBufferAppended=function(n,a){var t=this,r=a.frag,s=a.part,u=a.timeRanges;if(r.type===M.PlaylistLevelType.MAIN)if(this.activeFragment=r,s){var f=this.activeParts;f||(this.activeParts=f=[]),f.push(s)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(d){var v=u[d];if(t.detectEvictedFragments(d,v),!s)for(var m=0;m<v.length;m++)r.appendedPTS=Math.max(v.end(m),r.appendedPTS||0)})},o.onFragBuffered=function(n,a){this.detectPartialFragments(a)},o.hasFragment=function(n){var a=i(n);return!!this.fragments[a]},o.removeFragmentsInRange=function(n,a,t){var r=this;Object.keys(this.fragments).forEach(function(s){var u=r.fragments[s];if(!u)return;if(u.buffered){var f=u.body;f.type===t&&f.start<a&&f.end>n&&r.removeFragment(f)}})},o.removeFragment=function(n){var a=i(n);n.stats.loaded=0,n.clearElementaryStreamInfo(),delete this.fragments[a]},o.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},c}();function b(c){var o,h;return c.buffered&&(((o=c.range.video)===null||o===void 0?void 0:o.partial)||((h=c.range.audio)===null||h===void 0?void 0:h.partial))}function i(c){return c.type+"_"+c.level+"_"+c.urlId+"_"+c.sn}},"./src/controller/gap-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"STALL_MINIMUM_DURATION_MS",function(){return b}),I.d(R,"MAX_START_GAP_JUMP",function(){return i}),I.d(R,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return c}),I.d(R,"SKIP_BUFFER_RANGE_START",function(){return o}),I.d(R,"default",function(){return h});var L=I("./src/utils/buffer-helper.ts"),M=I("./src/errors.ts"),p=I("./src/events.ts"),E=I("./src/utils/logger.ts"),b=250,i=2,c=.1,o=.05,h=function(){function n(t,r,s,u){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=r,this.fragmentTracker=s,this.hls=u}var a=n.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(r){var s=this.config,u=this.media,f=this.stalled,d=u.currentTime,v=u.seeking,m=this.seeking&&!v,S=!this.seeking&&v;if(this.seeking=v,d!==r){if(this.moved=!0,f!==null){if(this.stallReported){var C=self.performance.now()-f;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),u.paused||u.ended||u.playbackRate===0||!L.BufferHelper.getBuffered(u).length)return;var _=L.BufferHelper.bufferInfo(u,d,0),y=_.len>0,T=_.nextStart||0;if(!y&&!T)return;if(v){var k=_.len>i,g=!T||T-d>i&&!this.fragmentTracker.getPartialFragment(d);if(k||g)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var F,P=Math.max(T,_.start||0)-d,N=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,W=N==null||((F=N.details)===null||F===void 0)?void 0:F.live,j=W?N.details.targetduration*2:i;if(P>0&&P<=j){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(f===null){this.stalled=A;return}var K=A-f;!v&&K>=b&&this._reportStall(_.len);var U=L.BufferHelper.bufferInfo(u,d,s.maxBufferHole);this._tryFixBufferStall(U,K)},a._tryFixBufferStall=function(r,s){var u=this.config,f=this.fragmentTracker,d=this.media,v=d.currentTime,m=f.getPartialFragment(v);if(m){var S=this._trySkipBufferHole(m);if(S)return}r.len>u.maxBufferHole&&s>u.highBufferWatchdogPeriod*1e3&&(E.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(r){var s=this.hls,u=this.media,f=this.stallReported;f||(this.stallReported=!0,E.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+r+")"),s.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:r}))},a._trySkipBufferHole=function(r){for(var s=this.config,u=this.hls,f=this.media,d=f.currentTime,v=0,m=L.BufferHelper.getBuffered(f),S=0;S<m.length;S++){var C=m.start(S);if(d+s.maxBufferHole>=v&&d<C){var _=Math.max(C+o,f.currentTime+c);return E.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+_),this.moved=!0,this.stalled=null,f.currentTime=_,r&&u.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+_,frag:r}),_}v=m.end(S)}return 0},a._tryNudgeBuffer=function(){var r=this.config,s=this.hls,u=this.media,f=u.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<r.nudgeMaxRetry){var v=f+d*r.nudgeOffset;E.logger.warn("Nudging 'currentTime' from "+f+" to "+v),u.currentTime=v,s.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else E.logger.error("Playhead still not moving while enough data buffered @"+f+" after "+r.nudgeMaxRetry+" nudges"),s.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},n}()},"./src/controller/id3-track-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/events.ts"),M=I("./src/utils/texttrack-utils.ts"),p=I("./src/demux/id3.ts"),E=.25,b=function(){function i(o){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=o,this._registerListeners()}var c=i.prototype;return c.destroy=function(){this._unregisterListeners()},c._registerListeners=function(){var h=this.hls;h.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c._unregisterListeners=function(){var h=this.hls;h.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c.onMediaAttached=function(h,n){this.media=n.media},c.onMediaDetaching=function(){if(!this.id3Track)return;Object(M.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},c.getID3Track=function(h){if(!this.media)return;for(var n=0;n<h.length;n++){var a=h[n];if(a.kind==="metadata"&&a.label==="id3")return Object(M.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},c.onFragParsingMetadata=function(h,n){if(!this.media)return;var a=n.frag,t=n.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var r=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<t.length;s++){var u=p.getID3Frames(t[s].data);if(u){var f=t[s].pts,d=s<t.length-1?t[s+1].pts:a.end,v=d-f;v<=0&&(d=f+E);for(var m=0;m<u.length;m++){var S=u[m];if(!p.isTimeStampFrame(S)){var C=new r(f,d,"");C.value=S,this.id3Track.addCue(C)}}}}},c.onBufferFlushing=function(h,n){var a=n.startOffset,t=n.endOffset,r=n.type;if(!r||r==="audio"){var s=this.id3Track;s&&Object(M.removeCuesInRange)(s,a,t)}},i}();R.default=b},"./src/controller/latency-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return i});var L=I("./src/errors.ts"),M=I("./src/events.ts"),p=I("./src/utils/logger.ts");function E(c,o){for(var h=0;h<o.length;h++){var n=o[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(c,n.key,n)}}function b(c,o,h){return o&&E(c.prototype,o),h&&E(c,h),c}var i=function(){function c(h){var n=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return n.timeupdate()},this.hls=h,this.config=h.config,this.registerListeners()}var o=c.prototype;return o.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},o.registerListeners=function(){this.hls.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(M.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(M.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(M.Events.ERROR,this.onError)},o.onMediaAttached=function(n,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},o.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},o.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},o.onLevelUpdated=function(n,a){var t=a.details;this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},o.onError=function(n,a){if(a.details!==L.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,p.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},o.timeupdate=function(){var n=this.media,a=this.levelDetails;if(!n||!a)return;this.currentTime=n.currentTime;var t=this.computeLatency();if(t===null)return;this._latency=t;var r=this.config,s=r.lowLatencyMode,u=r.maxLiveSyncPlaybackRate;if(!s||u===1)return;var f=this.targetLatency;if(f===null)return;var d=t-f,v=Math.min(this.maxLatency,f+a.targetduration),m=d<v;if(a.live&&m&&d>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),C=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;n.playbackRate=Math.min(S,Math.max(1,C))}else n.playbackRate!==1&&n.playbackRate!==0&&(n.playbackRate=1)},o.estimateLiveEdge=function(){var n=this.levelDetails;return n===null?null:n.edge+n.age},o.computeLatency=function(){var n=this.estimateLiveEdge();return n===null?null:n-this.currentTime},b(c,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var n=this.config,a=this.levelDetails;return n.liveMaxLatencyDuration!==void 0?n.liveMaxLatencyDuration:a?n.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var n=this.levelDetails;if(n===null)return null;var a=n.holdBack,t=n.partHoldBack,r=n.targetduration,s=this.config,u=s.liveSyncDuration,f=s.liveSyncDurationCount,d=s.lowLatencyMode,v=this.hls.userConfig,m=d&&t||a;(v.liveSyncDuration||v.liveSyncDurationCount||m===0)&&(m=u!==void 0?u:f*r);var S=r,C=1;return m+Math.min(this.stallCount*C,S)}},{key:"liveSyncPosition",get:function(){var n=this.estimateLiveEdge(),a=this.targetLatency,t=this.levelDetails;if(n===null||a===null||t===null)return null;var r=t.edge,s=n-a-this.edgeStalled,u=r-t.totalduration,f=r-(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.min(Math.max(u,s),f)}},{key:"drift",get:function(){var n=this.levelDetails;return n===null?1:n.drift}},{key:"edgeStalled",get:function(){var n=this.levelDetails;if(n===null)return 0;var a=(this.config.lowLatencyMode&&n.partTarget||n.targetduration)*3;return Math.max(n.age-a,0)}},{key:"forwardBufferLength",get:function(){var n=this.media,a=this.levelDetails;if(!n||!a)return 0;var t=n.buffered.length;return t?n.buffered.end(t-1):a.edge-this.currentTime}}]),c}()},"./src/controller/level-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return s});var L=I("./src/types/level.ts"),M=I("./src/events.ts"),p=I("./src/errors.ts"),E=I("./src/utils/codecs.ts"),b=I("./src/controller/level-helper.ts"),i=I("./src/controller/base-playlist-controller.ts"),c=I("./src/types/loader.ts");function o(){return o=Object.assign||function(u){for(var f=1;f<arguments.length;f++){var d=arguments[f];for(var v in d)Object.prototype.hasOwnProperty.call(d,v)&&(u[v]=d[v])}return u},o.apply(this,arguments)}function h(u,f){for(var d=0;d<f.length;d++){var v=f[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(u,v.key,v)}}function n(u,f,d){return f&&h(u.prototype,f),d&&h(u,d),u}function a(u,f){u.prototype=Object.create(f.prototype),u.prototype.constructor=u,t(u,f)}function t(u,f){return t=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},t(u,f)}var r=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(u){a(f,u);function f(v){var m;return m=u.call(this,v,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var d=f.prototype;return d._registerListeners=function(){var m=this.hls;m.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(M.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var m=this.hls;m.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(M.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},d.startLoad=function(){var m=this._levels;m.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},d.onManifestLoaded=function(m,S){var C=[],_=[],y=[],T,k={},g,F=!1,P=!1,N=!1;if(S.levels.forEach(function(K){var U=K.attrs;F=F||!!(K.width&&K.height),P=P||!!K.videoCodec,N=N||!!K.audioCodec,r&&K.audioCodec&&K.audioCodec.indexOf("mp4a.40.34")!==-1&&(K.audioCodec=void 0);var O=K.bitrate+"-"+K.attrs.RESOLUTION+"-"+K.attrs.CODECS;g=k[O],g?g.url.push(K.url):(g=new L.Level(K),k[O]=g,C.push(g)),U&&(U.AUDIO&&Object(b.addGroupId)(g,"audio",U.AUDIO),U.SUBTITLES&&Object(b.addGroupId)(g,"text",U.SUBTITLES))}),(F||P)&&N&&(C=C.filter(function(K){var U=K.videoCodec,O=K.width,z=K.height;return!!U||!!(O&&z)})),C=C.filter(function(K){var U=K.audioCodec,O=K.videoCodec;return(!U||Object(E.isCodecSupportedInMp4)(U,"audio"))&&(!O||Object(E.isCodecSupportedInMp4)(O,"video"))}),S.audioTracks&&(_=S.audioTracks.filter(function(K){return!K.audioCodec||Object(E.isCodecSupportedInMp4)(K.audioCodec,"audio")}),Object(b.assignTrackIdsByGroup)(_)),S.subtitles&&(y=S.subtitles,Object(b.assignTrackIdsByGroup)(y)),C.length>0){T=C[0].bitrate,C.sort(function(K,U){return K.bitrate-U.bitrate}),this._levels=C;for(var W=0;W<C.length;W++)if(C[W].bitrate===T){this._firstLevel=W,this.log("manifest loaded, "+C.length+" level(s) found, first bitrate: "+T);break}var j=N&&!P,A={levels:C,audioTracks:_,subtitleTracks:y,firstLevel:this._firstLevel,stats:S.stats,audio:N,video:P,altAudio:!j&&_.some(function(K){return!!K.url})};this.hls.trigger(M.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(M.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(m,S){if(u.prototype.onError.call(this,m,S),S.fatal)return;var C=S.context,_=this._levels[this.currentLevelIndex];if(C&&(C.type===c.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&C.groupId===_.audioGroupIds[_.urlId]||C.type===c.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&C.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,T=!0,k;switch(S.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var g=this._levels[S.frag.level];g?(g.fragmentError++,g.fragmentError>this.hls.config.fragLoadingMaxRetry&&(k=S.frag.level)):k=S.frag.level}break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:C&&(C.deliveryDirectives&&(T=!1),k=C.level),y=!0;break;case p.ErrorDetails.REMUX_ALLOC_ERROR:k=S.level,y=!0;break}k!==void 0&&this.recoverLevel(S,k,y,T)},d.recoverLevel=function(m,S,C,_){var y=m.details,T=this._levels[S];if(T.loadError++,C){var k=this.retryLoadingOrFail(m);if(k)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var g=T.url.length;if(g>1&&T.loadError<g)m.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var F=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==F&&this._levels[F].loadError===0&&(this.warn(y+": switch to "+F),m.levelRetry=!0,this.hls.nextAutoLevel=F)}}},d.redundantFailover=function(m){var S=this._levels[m],C=S.url.length;if(C>1){var _=(S.urlId+1)%C;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(y){y.urlId=_}),this.level=m}},d.onFragLoaded=function(m,S){var C=S.frag;if(C!==void 0&&C.type===c.PlaylistLevelType.MAIN){var _=this._levels[C.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},d.onLevelLoaded=function(m,S){var C,_=S.level,y=S.details,T=this._levels[_];if(!T){var k;this.warn("Invalid level index "+_),(k=S.deliveryDirectives)!==null&&k!==void 0&&k.skip&&(y.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(_,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 _=-1,y=this.hls.audioTracks[S.id].groupId,T=0;T<C.audioGroupIds.length;T++)if(C.audioGroupIds[T]===y){_=T;break}_!==C.urlId&&(C.urlId=_,this.startLoad())}},d.loadPlaylist=function(m){var S=this.currentLevelIndex,C=this._levels[S];if(this.canLoad&&C&&C.url.length>0){var _=C.urlId,y=C.url[_];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 "+_+" "+y),this.clearTimer(),this.hls.trigger(M.Events.LEVEL_LOADING,{url:y,level:S,id:_,deliveryDirectives:m||null})}},d.removeLevel=function(m,S){var C=function(T,k){return k!==S},_=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 k=y.details;return k!=null&&k.fragments&&k.fragments.forEach(function(g){g.level=T}),y});this._levels=_,this.hls.trigger(M.Events.LEVELS_UPDATED,{levels:_})},n(f,[{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 _=m<0;if(this.hls.trigger(M.Events.ERROR,{type:p.ErrorTypes.OTHER_ERROR,details:p.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:_,reason:"invalid level idx"}),_)return;m=Math.min(m,C.length-1)}this.clearTimer();var y=this.currentLevelIndex,T=C[y],k=C[m];this.log("switching to level "+m+" from "+y),this.currentLevelIndex=m;var g=o({},k,{level:m,maxBitrate:k.maxBitrate,uri:k.uri,urlId:k.urlId});delete g._urlId,this.hls.trigger(M.Events.LEVEL_SWITCHING,g);var F=k.details;if(!F||F.live){var P=this.switchParams(k.uri,T==null?void 0:T.details);this.loadPlaylist(P)}}},{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)}}]),f}(i.default)},"./src/controller/level-helper.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"addGroupId",function(){return p}),I.d(R,"assignTrackIdsByGroup",function(){return E}),I.d(R,"updatePTS",function(){return b}),I.d(R,"updateFragPTSDTS",function(){return c}),I.d(R,"mergeDetails",function(){return o}),I.d(R,"mapPartIntersection",function(){return h}),I.d(R,"mapFragmentIntersection",function(){return n}),I.d(R,"adjustSliding",function(){return a}),I.d(R,"addSliding",function(){return t}),I.d(R,"computeReloadInterval",function(){return r}),I.d(R,"getFragmentWithSN",function(){return s}),I.d(R,"getPartWith",function(){return u});var L=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts");function p(f,d,v){switch(d){case"audio":f.audioGroupIds||(f.audioGroupIds=[]),f.audioGroupIds.push(v);break;case"text":f.textGroupIds||(f.textGroupIds=[]),f.textGroupIds.push(v);break}}function E(f){var d={};f.forEach(function(v){var m=v.groupId||"";v.id=d[m]=d[m]||0,d[m]++})}function b(f,d,v){var m=f[d],S=f[v];i(m,S)}function i(f,d){var v=d.startPTS;if(Object(L.isFiniteNumber)(v)){var m=0,S;d.sn>f.sn?(m=v-f.start,S=f):(m=f.start-v,S=d),S.duration!==m&&(S.duration=m)}else if(d.sn>f.sn){var C=f.cc===d.cc;C&&f.minEndPTS?d.start=f.start+(f.minEndPTS-f.start):d.start=f.start+f.duration}else d.start=Math.max(f.start-d.duration,0)}function c(f,d,v,m,S,C){var _=m-v;_<=0&&(M.logger.warn("Fragment should have a positive duration",d),m=v+d.duration,C=S+d.duration);var y=v,T=m,k=d.startPTS,g=d.endPTS;if(Object(L.isFiniteNumber)(k)){var F=Math.abs(k-v);Object(L.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(F,d.deltaPTS):d.deltaPTS=F,y=Math.max(v,k),v=Math.min(v,k),S=Math.min(S,d.startDTS),T=Math.min(m,g),m=Math.max(m,g),C=Math.max(C,d.endDTS)}d.duration=m-v;var P=v-d.start;d.appendedPTS=m,d.start=d.startPTS=v,d.maxStartPTS=y,d.startDTS=S,d.endPTS=m,d.minEndPTS=T,d.endDTS=C;var N=d.sn;if(!f||N<f.startSN||N>f.endSN)return 0;var W,j=N-f.startSN,A=f.fragments;for(A[j]=d,W=j;W>0;W--)i(A[W],A[W-1]);for(W=j;W<A.length-1;W++)i(A[W],A[W+1]);return f.fragmentHint&&i(A[A.length-1],f.fragmentHint),f.PTSKnown=f.alignedSliding=!0,P}function o(f,d){for(var v=null,m=f.fragments,S=m.length-1;S>=0;S--){var C=m[S].initSegment;if(C){v=C;break}}f.fragmentHint&&delete f.fragmentHint.endPTS;var _=0,y;if(n(f,d,function(W,j){W.relurl&&(_=W.cc-j.cc),Object(L.isFiniteNumber)(W.startPTS)&&Object(L.isFiniteNumber)(W.endPTS)&&(j.start=j.startPTS=W.startPTS,j.startDTS=W.startDTS,j.appendedPTS=W.appendedPTS,j.maxStartPTS=W.maxStartPTS,j.endPTS=W.endPTS,j.endDTS=W.endDTS,j.minEndPTS=W.minEndPTS,j.duration=W.endPTS-W.startPTS,j.duration&&(y=j),d.PTSKnown=d.alignedSliding=!0),j.elementaryStreams=W.elementaryStreams,j.loader=W.loader,j.stats=W.stats,j.urlId=W.urlId,W.initSegment&&(j.initSegment=W.initSegment,v=W.initSegment)}),v){var T=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;T.forEach(function(W){var j;(!W.initSegment||W.initSegment.relurl===((j=v)===null||j===void 0?void 0:j.relurl))&&(W.initSegment=v)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(W){return!W}),d.deltaUpdateFailed)){M.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var k=d.skippedSegments;k--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var g=d.fragments;if(_){M.logger.warn("discontinuity sliding from playlist, take drift into account");for(var F=0;F<g.length;F++)g[F].cc+=_}d.skippedSegments&&(d.startCC=d.fragments[0].cc),h(f.partList,d.partList,function(W,j){j.elementaryStreams=W.elementaryStreams,j.stats=W.stats}),y?c(d,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):a(f,d),g.length&&(d.totalduration=d.edge-g[0].start),d.driftStartTime=f.driftStartTime,d.driftStart=f.driftStart;var P=d.advancedDateTime;if(d.advanced&&P){var N=d.edge;d.driftStart||(d.driftStartTime=P,d.driftStart=N),d.driftEndTime=P,d.driftEnd=N}else d.driftEndTime=f.driftEndTime,d.driftEnd=f.driftEnd,d.advancedDateTime=f.advancedDateTime}function h(f,d,v){if(f&&d)for(var m=0,S=0,C=f.length;S<=C;S++){var _=f[S],y=d[S+m];_&&y&&_.index===y.index&&_.fragment.sn===y.fragment.sn?v(_,y):m--}}function n(f,d,v){for(var m=d.skippedSegments,S=Math.max(f.startSN,d.startSN)-d.startSN,C=(f.fragmentHint?1:0)+(m?d.endSN:Math.min(f.endSN,d.endSN))-d.startSN,_=d.startSN-f.startSN,y=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,T=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,k=S;k<=C;k++){var g=T[_+k],F=y[k];m&&!F&&k<m&&(F=d.fragments[k]=g),g&&F&&v(g,F)}}function a(f,d){var v=d.startSN+d.skippedSegments-f.startSN,m=f.fragments;if(v<0||v>=m.length)return;t(d,m[v].start)}function t(f,d){if(d){for(var v=f.fragments,m=f.skippedSegments;m<v.length;m++)v[m].start+=d;f.fragmentHint&&(f.fragmentHint.start+=d)}}function r(f,d){var v=1e3*f.levelTargetDuration,m=v/2,S=f.age,C=S>0&&S<v*3,_=d.loading.end-d.loading.start,y,T=f.availabilityDelay;if(f.updated===!1)if(C){var k=333*f.misses;y=Math.max(Math.min(m,_*2),k),f.availabilityDelay=(f.availabilityDelay||0)+y}else y=m;else C?(T=Math.min(T||v/2,S),f.availabilityDelay=T,y=T+v-S):y=v-_;return Math.round(y)}function s(f,d,v){if(!f||!f.details)return null;var m=f.details,S=m.fragments[d-m.startSN];return S||(S=m.fragmentHint,S&&S.sn===d?S:d<m.startSN&&v&&v.sn===d?v:null)}function u(f,d,v){if(!f||!f.details)return null;var m=f.details.partList;if(m)for(var S=m.length;S--;){var C=m[S];if(C.index===v&&C.fragment.sn===d)return C}return null}},"./src/controller/stream-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return m});var L=I("./src/polyfills/number.ts"),M=I("./src/controller/base-stream-controller.ts"),p=I("./src/is-supported.ts"),E=I("./src/events.ts"),b=I("./src/utils/buffer-helper.ts"),i=I("./src/controller/fragment-tracker.ts"),c=I("./src/types/loader.ts"),o=I("./src/loader/fragment.ts"),h=I("./src/demux/transmuxer-interface.ts"),n=I("./src/types/transmuxer.ts"),a=I("./src/controller/gap-controller.ts"),t=I("./src/errors.ts"),r=I("./src/utils/logger.ts");function s(S,C){for(var _=0;_<C.length;_++){var y=C[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}function u(S,C,_){return C&&s(S.prototype,C),_&&s(S,_),S}function f(S,C){S.prototype=Object.create(C.prototype),S.prototype.constructor=S,d(S,C)}function d(S,C){return d=Object.setPrototypeOf||function(y,T){return y.__proto__=T,y},d(S,C)}var v=100,m=function(S){f(C,S);function C(y,T){var k;return k=S.call(this,y,T,"[stream-controller]")||this,k.audioCodecSwap=!1,k.gapController=null,k.level=-1,k._forceStartLoad=!1,k.altAudio=!1,k.audioOnly=!1,k.fragPlaying=null,k.onvplaying=null,k.onvseeked=null,k.fragLastKbps=0,k.stalled=!1,k.couldBacktrack=!1,k.audioCodecSwitch=!1,k.videoBuffer=null,k._registerListeners(),k}var _=C.prototype;return _._registerListeners=function(){var T=this.hls;T.on(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.on(E.Events.LEVEL_LOADING,this.onLevelLoading,this),T.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.on(E.Events.ERROR,this.onError,this),T.on(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(E.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var T=this.hls;T.off(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.off(E.Events.ERROR,this.onError,this),T.off(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(E.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(T){if(this.levels){var k=this.lastCurrentTime,g=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var F=g.startLevel;F===-1&&(g.config.testBandwidth?(F=0,this.bitrateTest=!0):F=g.nextAutoLevel),this.level=g.nextLoadLevel=F,this.loadedmetadata=!1}k>0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+k.toFixed(3)),T=k),this.state=M.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=M.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_LEVEL:{var T,k=this.levels,g=this.level,F=k==null||((T=k[g])===null||T===void 0)?void 0:T.details;if(F&&(!F.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(F))break;this.state=M.State.IDLE;break}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var P,N=self.performance.now(),W=this.retryDate;(!W||N>=W||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=M.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var T,k,g=this.hls,F=this.levelLastLoaded,P=this.levels,N=this.media,W=g.config,j=g.nextLoadLevel;if(F===null||!N&&(this.startFragRequested||!W.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!P||!P[j])return;var A=P[j];this.level=g.nextLoadLevel=j;var K=A.details;if(!K||this.state===M.State.WAITING_LEVEL||K.live&&this.levelLastLoaded!==j){this.state=M.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:N,c.PlaylistLevelType.MAIN);if(U===null)return;var O=U.len,z=this.getMaxBufferLength(A.maxBitrate);if(O>=z)return;if(this._streamEnded(U,K)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(E.Events.BUFFER_EOS,te),this.state=M.State.ENDED;return}var de=U.end,be=this.getNextFragment(de,K);if(this.couldBacktrack&&!this.fragPrevious&&be&&be.sn!=="initSegment"){var je=be.sn-K.startSN;je>1&&(be=K.fragments[je-1],this.fragmentTracker.removeFragment(be))}if(be&&this.fragmentTracker.getState(be)===i.FragmentState.OK&&this.nextLoadPosition>de){var Ne=this.audioOnly&&!this.altAudio?o.ElementaryStreamTypes.AUDIO:o.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(N,Ne,c.PlaylistLevelType.MAIN),be=this.getNextFragment(this.nextLoadPosition,K)}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"&&!((k=be.decryptdata)!==null&&k!==void 0&&k.key)?this.loadKey(be,K):this.loadFragment(be,K,de)},_.loadFragment=function(T,k,g){var F,P=this.fragmentTracker.getState(T);if(this.fragCurrent=T,P===i.FragmentState.BACKTRACKED){var N=this.fragmentTracker.getBacktrackData(T);if(N){this._handleFragmentLoadProgress(N),this._handleFragmentLoadComplete(N);return}else P=i.FragmentState.NOT_LOADED}P===i.FragmentState.NOT_LOADED||P===i.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,k,g)):P===i.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((F=this.media)===null||F===void 0?void 0:F.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(T){var k=this.fragmentTracker.getAppendedFrag(T,c.PlaylistLevelType.MAIN);return k&&"fragment"in k?k.fragment:k},_.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,c.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var T=this.levels,k=this.media;if(k!=null&&k.readyState){var g,F=this.getAppendedFrag(k.currentTime);if(F&&F.start>1&&this.flushMainBuffer(0,F.start-1),!k.paused&&T){var P=this.hls.nextLoadLevel,N=T[P],W=this.fragLastKbps;W&&this.fragCurrent?g=this.fragCurrent.duration*N.maxBitrate/(1e3*W)+1:g=0}else g=0;var j=this.getBufferedFrag(k.currentTime+g);if(j){var A=this.followingBufferedFrag(j);if(A){this.abortCurrentFrag();var K=A.maxStartPTS?A.maxStartPTS:A.start,U=A.duration,O=Math.max(j.end,K+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},_.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()},_.flushMainBuffer=function(T,k){S.prototype.flushMainBuffer.call(this,T,k,this.altAudio?"video":null)},_.onMediaAttached=function(T,k){S.prototype.onMediaAttached.call(this,T,k);var g=k.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),g.addEventListener("playing",this.onvplaying),g.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,g,this.fragmentTracker,this.hls)},_.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)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var T=this.media,k=T?T.currentTime:null;Object(L.isFiniteNumber)(k)&&this.log("Media seeked to "+k.toFixed(3)),this.tick()},_.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},_.onManifestParsed=function(T,k){var g=!1,F=!1,P;k.levels.forEach(function(N){P=N.audioCodec,P&&(P.indexOf("mp4a.40.2")!==-1&&(g=!0),P.indexOf("mp4a.40.5")!==-1&&(F=!0))}),this.audioCodecSwitch=g&&F&&!Object(p.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=k.levels,this.startFragRequested=!1},_.onLevelLoading=function(T,k){var g=this.levels;if(!g||this.state!==M.State.IDLE)return;var F=g[k.level];(!F.details||F.details.live&&this.levelLastLoaded!==k.level||this.waitForCdnTuneIn(F.details))&&(this.state=M.State.WAITING_LEVEL)},_.onLevelLoaded=function(T,k){var g,F=this.levels,P=k.level,N=k.details,W=N.totalduration;if(!F){this.warn("Levels were reset while loading level "+P);return}this.log("Level "+P+" loaded ["+N.startSN+","+N.endSN+"], cc ["+N.startCC+", "+N.endCC+"] duration:"+W);var j=this.fragCurrent;j&&(this.state===M.State.FRAG_LOADING||this.state===M.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==k.level&&j.loader&&(this.state=M.State.IDLE,j.loader.abort()));var A=F[P],K=0;if(N.live||(g=A.details)!==null&&g!==void 0&&g.live){if(N.fragments[0]||(N.deltaUpdateFailed=!0),N.deltaUpdateFailed)return;K=this.alignPlaylists(N,A.details)}if(A.details=N,this.levelLastLoaded=P,this.hls.trigger(E.Events.LEVEL_UPDATED,{details:N,level:P}),this.state===M.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(N))return;this.state=M.State.IDLE}this.startFragRequested?N.live&&this.synchronizeToLiveEdge(N):this.setStartPosition(N,K),this.tick()},_._handleFragmentLoadProgress=function(T){var k,g=T.frag,F=T.part,P=T.payload,N=this.levels;if(!N){this.warn("Levels were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var W=N[g.level],j=W.details;if(!j){this.warn("Dropping fragment "+g.sn+" of level "+g.level+" after level details were reset");return}var A=W.videoCodec,K=j.PTSKnown||!j.live,U=(k=g.initSegment)===null||k===void 0?void 0:k.data,O=this._getAudioCodec(W),z=this.transmuxer=this.transmuxer||new h.default(this.hls,c.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=F?F.index:-1,de=te!==-1,be=new n.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,P.byteLength,te,de),je=this.initPTS[g.cc];z.push(P,U,O,A,g,F,j.totalduration,K,be,je)},_.onAudioTrackSwitching=function(T,k){var g=this.altAudio,F=!!k.url,P=k.id;if(!F){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var N=this.fragCurrent;N!=null&&N.loader&&(this.log("Switching to main audio track, cancel main fragment load"),N.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var W=this.hls;g&&W.trigger(E.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),W.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:P})}},_.onAudioTrackSwitched=function(T,k){var g=k.id,F=!!this.hls.audioTracks[g].url;if(F){var P=this.videoBuffer;P&&this.mediaBuffer!==P&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=P)}this.altAudio=F,this.tick()},_.onBufferCreated=function(T,k){var g=k.tracks,F,P,N=!1;for(var W in g){var j=g[W];if(j.id==="main"){if(P=W,F=j,W==="video"){var A=g[W];A&&(this.videoBuffer=A.buffer)}}else N=!0}N&&F?(this.log("Alternate track found, use "+P+".buffered to schedule main fragment loading"),this.mediaBuffer=F.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(T,k){var g=k.frag,F=k.part;if(g&&g.type!==c.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(F?" p: "+F.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state),this.state===M.State.PARSED&&(this.state=M.State.IDLE);return}var P=F?F.stats:g.stats;this.fragLastKbps=Math.round(8*P.total/(P.buffering.end-P.loading.first)),g.sn!=="initSegment"&&(this.fragPrevious=g),this.fragBufferedComplete(g,F)},_.onError=function(T,k){switch(k.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(c.PlaylistLevelType.MAIN,k);break;case t.ErrorDetails.LEVEL_LOAD_ERROR:case t.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==M.State.ERROR&&(k.fatal?(this.warn(""+k.details),this.state=M.State.ERROR):!k.levelRetry&&this.state===M.State.WAITING_LEVEL&&(this.state=M.State.IDLE));break;case t.ErrorDetails.BUFFER_FULL_ERROR:if(k.parent==="main"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var g=!0,F=this.getFwdBufferInfo(this.media,c.PlaylistLevelType.MAIN);F&&F.len>.5&&(g=!this.reduceMaxBufferLength(F.len)),g&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var T=this.media,k=this.gapController;if(!T||!k||!T.readyState)return;var g=b.BufferHelper.getBuffered(T);!this.loadedmetadata&&g.length?(this.loadedmetadata=!0,this.seekToStartPos()):k.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=M.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(T,k){var g=k.type;if(g!==o.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var F=(g===o.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(F,g,c.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(T,k){this.levels=k.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var T=this.media,k=T.currentTime,g=this.startPosition;if(g>=0&&k<g){if(T.seeking){r.logger.log("could not seek to "+g+", already seeking at "+k);return}var F=b.BufferHelper.getBuffered(T),P=F.length?F.start(0):0,N=P-g;N>0&&(N<this.config.maxBufferHole||N<this.config.maxFragLookUpTolerance)&&(r.logger.log("adjusting start position by "+N+" to match buffer start"),g+=N,this.startPosition=g),this.log("seek to target start position "+g+" from current time "+k),T.currentTime=g}},_._getAudioCodec=function(T){var k=this.config.defaultAudioCodec||T.audioCodec;return this.audioCodecSwap&&k&&(this.log("Swapping audio codec"),k.indexOf("mp4a.40.5")!==-1?k="mp4a.40.2":k="mp4a.40.5"),k},_._loadBitrateTestFrag=function(T){var k=this;this._doFragLoad(T).then(function(g){var F=k.hls;if(!g||F.nextLoadLevel||k.fragContextChanged(T))return;k.fragLoadError=0,k.state=M.State.IDLE,k.startFragRequested=!1,k.bitrateTest=!1;var P=T.stats;P.parsing.start=P.parsing.end=P.buffering.start=P.buffering.end=self.performance.now(),F.trigger(E.Events.FRAG_LOADED,g)})},_._handleTransmuxComplete=function(T){var k,g="main",F=this.hls,P=T.remuxResult,N=T.chunkMeta,W=this.getCurrentContext(N);if(!W){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var j=W.frag,A=W.part,K=W.level,U=P.video,O=P.text,z=P.id3,te=P.initSegment,de=this.altAudio?void 0:P.audio;if(this.fragContextChanged(j))return;if(this.state=M.State.PARSING,te){te.tracks&&(this._bufferInitSegment(K,te.tracks,j,N),F.trigger(E.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:g,tracks:te.tracks}));var be=te.initPTS,je=te.timescale;Object(L.isFiniteNumber)(be)&&(this.initPTS[j.cc]=be,F.trigger(E.Events.INIT_PTS_FOUND,{frag:j,id:g,initPTS:be,timescale:je}))}if(U&&P.independent!==!1){if(K.details){var Ne=U.startPTS,Oe=U.endPTS,Ke=U.startDTS,We=U.endDTS;if(A)A.elementaryStreams[U.type]={startPTS:Ne,endPTS:Oe,startDTS:Ke,endDTS:We};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var Te=this.getLoadPosition()+this.config.maxBufferHole;if(Te<Ne){this.backtrack(j);return}j.setElementaryStreamInfo(U.type,j.start,Oe,j.start,We,!0)}j.setElementaryStreamInfo(U.type,Ne,Oe,Ke,We),this.bufferFragmentData(U,j,A,N)}}else if(P.independent===!1){this.backtrack(j);return}if(de){var we=de.startPTS,ue=de.endPTS,Ae=de.startDTS,ge=de.endDTS;A&&(A.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:we,endPTS:ue,startDTS:Ae,endDTS:ge}),j.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,we,ue,Ae,ge),this.bufferFragmentData(de,j,A,N)}if(z!=null&&(k=z.samples)!==null&&k!==void 0&&k.length){var Ve={frag:j,id:g,samples:z.samples};F.trigger(E.Events.FRAG_PARSING_METADATA,Ve)}if(O){var Qe={frag:j,id:g,samples:O.samples};F.trigger(E.Events.FRAG_PARSING_USERDATA,Qe)}},_._bufferInitSegment=function(T,k,g,F){var P=this;if(this.state!==M.State.PARSING)return;this.audioOnly=!!k.audio&&!k.video,this.altAudio&&!this.audioOnly&&delete k.audio;var N=k.audio,W=k.video,j=k.audiovideo;if(N){var A=T.audioCodec,K=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),N.metadata.channelCount!==1&&K.indexOf("firefox")===-1&&(A="mp4a.40.5")),K.indexOf("android")!==-1&&N.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),T.audioCodec&&T.audioCodec!==A&&this.log('Swapping manifest audio codec "'+T.audioCodec+'" for "'+A+'"'),N.levelCodec=A,N.id="main",this.log("Init audio buffer, container:"+N.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(T.audioCodec||"")+"/"+N.codec+"]")}W&&(W.levelCodec=T.videoCodec,W.id="main",this.log("Init video buffer, container:"+W.container+", codecs[level/parsed]=["+(T.videoCodec||"")+"/"+W.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(T.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(E.Events.BUFFER_CODECS,k),Object.keys(k).forEach(function(U){var O=k[U],z=O.initSegment;z!=null&&z.byteLength&&P.hls.trigger(E.Events.BUFFER_APPENDING,{type:U,data:z,frag:g,part:null,chunkMeta:F,parent:g.type})}),this.tick()},_.backtrack=function(T){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(T);var k=this.fragmentTracker.backtrack(T);this.fragPrevious=null,this.nextLoadPosition=T.start,k?this.resetFragmentLoading(T):this.state=M.State.BACKTRACKING},_.checkFragmentChanged=function(){var T=this.media,k=null;if(T&&T.readyState>1&&T.seeking===!1){var g=T.currentTime;if(b.BufferHelper.isBuffered(T,g)?k=this.getAppendedFrag(g):b.BufferHelper.isBuffered(T,g+.1)&&(k=this.getAppendedFrag(g+.1)),k){var F=this.fragPlaying,P=k.level;(!F||k.sn!==F.sn||F.level!==P||k.urlId!==F.urlId)&&(this.hls.trigger(E.Events.FRAG_CHANGED,{frag:k}),(!F||F.level!==P)&&this.hls.trigger(E.Events.LEVEL_SWITCHED,{level:P}),this.fragPlaying=k)}}},u(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 k=this.getAppendedFrag(T.currentTime);if(k)return k.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var k=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(k)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),C}(M.default)},"./src/controller/subtitle-stream-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"SubtitleStreamController",function(){return f});var L=I("./src/events.ts"),M=I("./src/utils/logger.ts"),p=I("./src/utils/buffer-helper.ts"),E=I("./src/controller/fragment-finders.ts"),b=I("./src/utils/discontinuities.ts"),i=I("./src/controller/level-helper.ts"),c=I("./src/controller/fragment-tracker.ts"),o=I("./src/controller/base-stream-controller.ts"),h=I("./src/types/loader.ts"),n=I("./src/types/level.ts");function a(d,v){for(var m=0;m<v.length;m++){var S=v[m];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(d,S.key,S)}}function t(d,v,m){return v&&a(d.prototype,v),m&&a(d,m),d}function r(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,s(d,v)}function s(d,v){return s=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},s(d,v)}var u=500,f=function(d){r(v,d);function v(S,C){var _;return _=d.call(this,S,C,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var m=v.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var C=this.hls;C.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(L.Events.ERROR,this.onError,this),C.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.on(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.on(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var C=this.hls;C.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(L.Events.ERROR,this.onError,this),C.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.off(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.off(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=o.State.IDLE,this.setInterval(u),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(C,_){this.mainDetails=_.details},m.onSubtitleFragProcessed=function(C,_){var y=_.frag,T=_.success;if(this.fragPrevious=y,this.state=o.State.IDLE,!T)return;var k=this.tracksBuffered[this.currentTrackId];if(!k)return;for(var g,F=y.start,P=0;P<k.length;P++)if(F>=k[P].start&&F<=k[P].end){g=k[P];break}var N=y.start+y.duration;g?g.end=N:(g={start:F,end:N},k.push(g)),this.fragmentTracker.fragBuffered(y)},m.onBufferFlushing=function(C,_){var y=_.startOffset,T=_.endOffset;if(y===0&&T!==Number.POSITIVE_INFINITY){var k=this.currentTrackId,g=this.levels;if(!g.length||!g[k]||!g[k].details)return;var F=g[k].details,P=F.targetduration,N=T-P;if(N<=0)return;_.endOffsetSubtitles=Math.max(0,N),this.tracksBuffered.forEach(function(W){for(var j=0;j<W.length;){if(W[j].end<=N){W.shift();continue}else if(W[j].start<N)W[j].start=N;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(y,N,h.PlaylistLevelType.SUBTITLE)}},m.onError=function(C,_){var y,T=_.frag;if(!T||T.type!==h.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=o.State.IDLE},m.onSubtitleTracksUpdated=function(C,_){var y=this,T=_.subtitleTracks;this.tracksBuffered=[],this.levels=T.map(function(k){return new n.Level(k)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(k){y.tracksBuffered[k.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(C,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(u)},m.onSubtitleTrackLoaded=function(C,_){var y,T=_.details,k=_.id,g=this.currentTrackId,F=this.levels;if(!F.length)return;var P=F[g];if(k>=F.length||k!==g||!P)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(y=P.details)!==null&&y!==void 0&&y.live){var N=this.mainDetails;if(T.deltaUpdateFailed||!N)return;var W=N.fragments[0];if(!P.details)T.hasProgramDateTime&&N.hasProgramDateTime?Object(b.alignMediaPlaylistByPDT)(T,N):W&&Object(i.addSliding)(T,W.start);else{var j=this.alignPlaylists(T,P.details);j===0&&W&&Object(i.addSliding)(T,W.start)}}if(P.details=T,this.levelLastLoaded=k,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===o.State.IDLE){var A=Object(E.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),P.details=void 0)}},m._handleFragmentLoadComplete=function(C){var _=C.frag,y=C.payload,T=_.decryptdata,k=this.hls;if(this.fragContextChanged(_))return;if(y&&y.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var g=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),T.key.buffer,T.iv.buffer).then(function(F){var P=performance.now();k.trigger(L.Events.FRAG_DECRYPTED,{frag:_,payload:F,stats:{tstart:g,tdecrypt:P}})})}},m.doTick=function(){if(!this.media){this.state=o.State.IDLE;return}if(this.state===o.State.IDLE){var C,_=this.currentTrackId,y=this.levels;if(!y.length||!y[_]||!y[_].details)return;var T=y[_].details,k=T.targetduration,g=this.config,F=this.media,P=p.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,F.currentTime-k,g.maxBufferHole),N=P.end,W=P.len,j=this.getMaxBufferLength()+k;if(W>j)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var A=T.fragments,K=A.length,U=T.edge,O,z=this.fragPrevious;if(N<U){var te=g.maxFragLookUpTolerance;z&&T.hasProgramDateTime&&(O=Object(E.findFragmentByPDT)(A,z.endProgramDateTime,te)),O||(O=Object(E.findFragmentByPTS)(z,A,N,te),!O&&z&&z.start<A[0].start&&(O=A[0]))}else O=A[K-1];(C=O)!==null&&C!==void 0&&C.encrypted?(M.logger.log("Loading key for "+O.sn),this.state=o.State.KEY_LOADING,this.hls.trigger(L.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===c.FragmentState.NOT_LOADED&&this.loadFragment(O,T,N)}},m.loadFragment=function(C,_,y){this.fragCurrent=C,d.prototype.loadFragment.call(this,C,_,y)},t(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(o.default)},"./src/controller/subtitle-track-controller.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/events.ts"),M=I("./src/utils/texttrack-utils.ts"),p=I("./src/controller/base-playlist-controller.ts"),E=I("./src/types/loader.ts");function b(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function i(a,t,r){return t&&b(a.prototype,t),r&&b(a,r),a}function c(a,t){a.prototype=Object.create(t.prototype),a.prototype.constructor=a,o(a,t)}function o(a,t){return o=Object.setPrototypeOf||function(s,u){return s.__proto__=u,s},o(a,t)}var h=function(a){c(t,a);function t(s){var u;return u=a.call(this,s,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var r=t.prototype;return r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},r.registerListeners=function(){var u=this.hls;u.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(L.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var u=this.hls;u.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(L.Events.ERROR,this.onError,this)},r.onMediaAttached=function(u,f){if(this.media=f.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},r.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},r.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 u=n(this.media.textTracks);u.forEach(function(f){Object(M.clearCurrentCues)(f)}),this.subtitleTrack=-1,this.media=null},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},r.onManifestParsed=function(u,f){this.tracks=f.subtitleTracks},r.onSubtitleTrackLoaded=function(u,f){var d=f.id,v=f.details,m=this.trackId,S=this.tracksInGroup[m];if(!S){this.warn("Invalid subtitle track id "+d);return}var C=S.details;S.details=f.details,this.log("subtitle track "+d+" loaded ["+v.startSN+"-"+v.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,f,C))},r.onLevelLoading=function(u,f){this.switchLevel(f.level)},r.onLevelSwitching=function(u,f){this.switchLevel(f.level)},r.switchLevel=function(u){var f=this.hls.levels[u];if(!(f!=null&&f.textGroupIds))return;var d=f.textGroupIds[f.urlId];if(this.groupId!==d){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(_){return!d||_.groupId===d});this.tracksInGroup=m;var S=this.findTrackId(v==null?void 0:v.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(L.Events.SUBTITLE_TRACKS_UPDATED,C),S!==-1&&this.setSubtitleTrack(S,v)}},r.findTrackId=function(u){for(var f=this.tracksInGroup,d=0;d<f.length;d++){var v=f[d];if((!this.selectDefaultTrack||v.default)&&(!u||u===v.name))return v.id}return-1},r.onError=function(u,f){if(a.prototype.onError.call(this,u,f),f.fatal||!f.context)return;f.context.type===E.PlaylistContextType.SUBTITLE_TRACK&&f.context.id===this.trackId&&f.context.groupId===this.groupId&&this.retryLoadingOrFail(f)},r.loadPlaylist=function(u){var f=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(f)){var d=f.id,v=f.groupId,m=f.url;if(u)try{m=u.addDirectives(m)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADING,{url:m,id:d,groupId:v,deliveryDirectives:u||null})}},r.toggleTrackModes=function(u){var f=this,d=this.media,v=this.subtitleDisplay,m=this.trackId;if(!d)return;var S=n(d.textTracks),C=S.filter(function(T){return T.groupId===f.groupId});if(u===-1)[].slice.call(S).forEach(function(T){T.mode="disabled"});else{var _=C[m];_&&(_.mode="disabled")}var y=C[u];y&&(y.mode=v?"showing":"hidden")},r.setSubtitleTrack=function(u,f){var d,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(d=v[u])!==null&&d!==void 0&&d.details)||u<-1||u>=v.length)return;this.clearTimer();var m=v[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,m){var S=m.id,C=m.groupId,_=C===void 0?"":C,y=m.name,T=m.type,k=m.url;this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:_,name:y,type:T,url:k});var g=this.switchParams(m.url,f==null?void 0:f.details);this.loadPlaylist(g)}else this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:u})},r.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,f=n(this.media.textTracks),d=0;d<f.length;d++)if(f[d].mode==="hidden")u=d;else if(f[d].mode==="showing"){u=d;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},i(t,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var f=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,f)}}]),t}(p.default);function n(a){for(var t=[],r=0;r<a.length;r++){var s=a[r];s.kind==="subtitles"&&s.label&&t.push(a[r])}return t}R.default=h},"./src/controller/timeline-controller.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"TimelineController",function(){return n});var L=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),p=I("./src/utils/cea-608-parser.ts"),E=I("./src/utils/output-filter.ts"),b=I("./src/utils/webvtt-parser.ts"),i=I("./src/utils/texttrack-utils.ts"),c=I("./src/utils/imsc1-ttml-parser.ts"),o=I("./src/types/loader.ts"),h=I("./src/utils/logger.ts"),n=function(){function s(f){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=r(),this.captionsProperties=void 0,this.hls=f,this.config=f.config,this.Cues=f.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var d=new E.default(this,"textTrack1"),v=new E.default(this,"textTrack2"),m=new E.default(this,"textTrack3"),S=new E.default(this,"textTrack4");this.cea608Parser1=new p.default(1,d,v),this.cea608Parser2=new p.default(3,m,S)}f.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.on(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.on(M.Events.FRAG_LOADING,this.onFragLoading,this),f.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.on(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=s.prototype;return u.destroy=function(){var d=this.hls;d.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(M.Events.FRAG_LOADING,this.onFragLoading,this),d.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(d,v,m,S,C){for(var _=!1,y=C.length;y--;){var T=C[y],k=t(T[0],T[1],v,m);if(k>=0&&(T[0]=Math.min(T[0],v),T[1]=Math.max(T[1],m),_=!0,k/(m-v)>.5))return}if(_||C.push([v,m]),this.config.renderTextTracksNatively){var g=this.captionsTracks[d];this.Cues.newCue(g,v,m,S)}else{var F=this.Cues.newCue(null,v,m,S);this.hls.trigger(M.Events.CUES_PARSED,{type:"captions",cues:F,track:d})}},u.onInitPtsFound=function(d,v){var m=this,S=v.frag,C=v.id,_=v.initPTS,y=v.timescale,T=this.unparsedVttFrags;C==="main"&&(this.initPTS[S.cc]=_,this.timescale[S.cc]=y),T.length&&(this.unparsedVttFrags=[],T.forEach(function(k){m.onFragLoaded(M.Events.FRAG_LOADED,k)}))},u.getExistingTrack=function(d){var v=this.media;if(v)for(var m=0;m<v.textTracks.length;m++){var S=v.textTracks[m];if(S[d])return S}return null},u.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},u.createNativeTrack=function(d){if(this.captionsTracks[d])return;var v=this.captionsProperties,m=this.captionsTracks,S=this.media,C=v[d],_=C.label,y=C.languageCode,T=this.getExistingTrack(d);if(T)m[d]=T,Object(i.clearCurrentCues)(m[d]),Object(i.sendAddTrackEvent)(m[d],S);else{var k=this.createTextTrack("captions",_,y);k&&(k[d]=!0,m[d]=k)}},u.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var v=this.captionsProperties[d];if(!v)return;var m=v.label,S={_id:d,label:m,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[d]=S,this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(d,v,m){var S=this.media;return S?S.addTextTrack(d,v,m):void 0},u.onMediaAttaching=function(d,v){this.media=v.media,this._cleanTracks()},u.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(v){Object(i.clearCurrentCues)(d[v]),delete d[v]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=r(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var d=this.media;if(!d)return;var v=d.textTracks;if(v)for(var m=0;m<v.length;m++)Object(i.clearCurrentCues)(v[m])},u.onSubtitleTracksUpdated=function(d,v){var m=this;this.textTracks=[];var S=v.subtitleTracks||[],C=S.some(function(k){return k.textCodec===c.IMSC1_CODEC});if(this.config.enableWebVTT||C&&this.config.enableIMSC1){var _=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(k,g){var F;if(g<y.length){for(var P=null,N=0;N<y.length;N++)if(a(y[N],k)){P=y[N];break}P&&(F=P)}F?Object(i.clearCurrentCues)(F):(F=m.createTextTrack("subtitles",k.name,k.lang),F&&(F.mode="disabled")),F&&(F.groupId=k.groupId,m.textTracks.push(F))})}else if(!_&&this.tracks&&this.tracks.length){var T=this.tracks.map(function(k){return{label:k.name,kind:k.type.toLowerCase(),default:k.default,subtitleTrack:k}});this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:T})}}},u.onManifestLoaded=function(d,v){var m=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(S){var C=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!C)return;var _="textTrack"+C[1],y=m.captionsProperties[_];if(!y)return;y.label=S.name,S.lang&&(y.languageCode=S.lang),y.media=S})},u.onFragLoading=function(d,v){var m=this.cea608Parser1,S=this.cea608Parser2,C=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(m&&S))return;if(v.frag.type===o.PlaylistLevelType.MAIN){var y,T,k=v.frag.sn,g=(y=v==null||((T=v.part)===null||T===void 0)?void 0:T.index)!=null?y:-1;k===C+1||k===C&&g===_+1||(m.reset(),S.reset()),this.lastSn=k,this.lastPartIndex=g}},u.onFragLoaded=function(d,v){var m=v.frag,S=v.payload,C=this.initPTS,_=this.unparsedVttFrags;if(m.type===o.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(L.isFiniteNumber)(C[m.cc])){_.push(v),C.length&&this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var y=m.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var T=this.tracks[m.level],k=this.vttCCs;k[m.cc]||(k[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),T&&T.textCodec===c.IMSC1_CODEC?this._parseIMSC1(m,S):this._parseVTTs(m,S,k)}}else this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(d,v){var m=this,S=this.hls;Object(c.parseIMSC1)(v,this.initPTS[d.cc],this.timescale[d.cc],function(C){m._appendCues(C,d.level),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(C){h.logger.log("Failed to parse IMSC1: "+C),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:C})})},u._parseVTTs=function(d,v,m){var S=this,C=this.hls;Object(b.parseWebVTT)(v,this.initPTS[d.cc],this.timescale[d.cc],m,d.cc,d.start,function(_){S._appendCues(_,d.level),C.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(_){S._fallbackToIMSC1(d,v),h.logger.log("Failed to parse VTT cue: "+_),C.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:_})})},u._fallbackToIMSC1=function(d,v){var m=this,S=this.tracks[d.level];S.textCodec||Object(c.parseIMSC1)(v,this.initPTS[d.cc],this.timescale[d.cc],function(){S.textCodec=c.IMSC1_CODEC,m._parseIMSC1(d,v)},function(){S.textCodec="wvtt"})},u._appendCues=function(d,v){var m=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[v];if(S.mode==="disabled")return;d.forEach(function(y){return Object(i.addCueToTrack)(S,y)})}else{var C=this.tracks[v],_=C.default?"default":"subtitles"+v;m.trigger(M.Events.CUES_PARSED,{type:"subtitles",cues:d,track:_})}},u.onFragDecrypted=function(d,v){var m=v.frag;if(m.type===o.PlaylistLevelType.SUBTITLE){if(!Object(L.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(M.Events.FRAG_LOADED,v)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(d,v){var m=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(m&&S))return;for(var C=0;C<v.samples.length;C++){var _=v.samples[C].bytes;if(_){var y=this.extractCea608Data(_);m.addData(v.samples[C].pts,y[0]),S.addData(v.samples[C].pts,y[1])}}},u.onBufferFlushing=function(d,v){var m=v.startOffset,S=v.endOffset,C=v.endOffsetSubtitles,_=v.type,y=this.media;if(!y||y.currentTime<S)return;if(!_||_==="video"){var T=this.captionsTracks;Object.keys(T).forEach(function(g){return Object(i.removeCuesInRange)(T[g],m,S)})}if(this.config.renderTextTracksNatively&&(m===0&&C!==void 0)){var k=this.textTracks;Object.keys(k).forEach(function(g){return Object(i.removeCuesInRange)(k[g],m,C)})}},u.extractCea608Data=function(d){for(var v=d[0]&31,m=2,S=[[],[]],C=0;C<v;C++){var _=d[m++],y=127&d[m++],T=127&d[m++],k=(4&_)!==0,g=3&_;if(y===0&&T===0)continue;k&&((g===0||g===1)&&(S[g].push(y),S[g].push(T)))}return S},s}();function a(s,u){return s&&s.label===u.name&&!(s.textTrack1||s.textTrack2)}function t(s,u,f,d){return Math.min(u,d)-Math.max(s,f)}function r(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return L});var L=function(){function M(E,b){this.subtle=void 0,this.aesIV=void 0,this.subtle=E,this.aesIV=b}var p=M.prototype;return p.decrypt=function(b,i){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,b)},M}()},"./src/crypt/aes-decryptor.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"removePadding",function(){return M}),I.d(R,"default",function(){return p});var L=I("./src/utils/typed-array.ts");function M(E){var b=E.byteLength,i=b&&new DataView(E.buffer).getUint8(b-1);return i?Object(L.sliceUint8)(E,0,b-i):E}var p=function(){function E(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var b=E.prototype;return b.uint8ArrayToUint32Array_=function(c){for(var o=new DataView(c),h=new Uint32Array(4),n=0;n<4;n++)h[n]=o.getUint32(n*4);return h},b.initTable=function(){var c=this.sBox,o=this.invSBox,h=this.subMix,n=h[0],a=h[1],t=h[2],r=h[3],s=this.invSubMix,u=s[0],f=s[1],d=s[2],v=s[3],m=new Uint32Array(256),S=0,C=0,_=0;for(_=0;_<256;_++)_<128?m[_]=_<<1:m[_]=_<<1^283;for(_=0;_<256;_++){var y=C^C<<1^C<<2^C<<3^C<<4;y=y>>>8^y&255^99,c[S]=y,o[y]=S;var T=m[S],k=m[T],g=m[k],F=m[y]*257^y*16843008;n[S]=F<<24|F>>>8,a[S]=F<<16|F>>>16,t[S]=F<<8|F>>>24,r[S]=F,F=g*16843009^k*65537^T*257^S*16843008,u[y]=F<<24|F>>>8,f[y]=F<<16|F>>>16,d[y]=F<<8|F>>>24,v[y]=F,S?(S=T^m[m[m[g^T]]],C^=m[m[C]]):S=C=1}},b.expandKey=function(c){for(var o=this.uint8ArrayToUint32Array_(c),h=!0,n=0;n<o.length&&h;)h=o[n]===this.key[n],n++;if(h)return;this.key=o;var a=this.keySize=o.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var t=this.ksRows=(a+6+1)*4,r,s,u=this.keySchedule=new Uint32Array(t),f=this.invKeySchedule=new Uint32Array(t),d=this.sBox,v=this.rcon,m=this.invSubMix,S=m[0],C=m[1],_=m[2],y=m[3],T,k;for(r=0;r<t;r++){if(r<a){T=u[r]=o[r];continue}k=T,r%a===0?(k=k<<8|k>>>24,k=d[k>>>24]<<24|d[k>>>16&255]<<16|d[k>>>8&255]<<8|d[k&255],k^=v[r/a|0]<<24):a>6&&r%a===4&&(k=d[k>>>24]<<24|d[k>>>16&255]<<16|d[k>>>8&255]<<8|d[k&255]),u[r]=T=(u[r-a]^k)>>>0}for(s=0;s<t;s++)r=t-s,s&3?k=u[r]:k=u[r-4],s<4||r<=4?f[s]=k:f[s]=S[d[k>>>24]]^C[d[k>>>16&255]]^_[d[k>>>8&255]]^y[d[k&255]],f[s]=f[s]>>>0},b.networkToHostOrderSwap=function(c){return c<<24|(c&65280)<<8|(c&16711680)>>8|c>>>24},b.decrypt=function(c,o,h){for(var n=this.keySize+6,a=this.invKeySchedule,t=this.invSBox,r=this.invSubMix,s=r[0],u=r[1],f=r[2],d=r[3],v=this.uint8ArrayToUint32Array_(h),m=v[0],S=v[1],C=v[2],_=v[3],y=new Int32Array(c),T=new Int32Array(y.length),k,g,F,P,N,W,j,A,K,U,O,z,te,de,be=this.networkToHostOrderSwap;o<y.length;){for(K=be(y[o]),U=be(y[o+1]),O=be(y[o+2]),z=be(y[o+3]),N=K^a[0],W=z^a[1],j=O^a[2],A=U^a[3],te=4,de=1;de<n;de++)k=s[N>>>24]^u[W>>16&255]^f[j>>8&255]^d[A&255]^a[te],g=s[W>>>24]^u[j>>16&255]^f[A>>8&255]^d[N&255]^a[te+1],F=s[j>>>24]^u[A>>16&255]^f[N>>8&255]^d[W&255]^a[te+2],P=s[A>>>24]^u[N>>16&255]^f[W>>8&255]^d[j&255]^a[te+3],N=k,W=g,j=F,A=P,te=te+4;k=t[N>>>24]<<24^t[W>>16&255]<<16^t[j>>8&255]<<8^t[A&255]^a[te],g=t[W>>>24]<<24^t[j>>16&255]<<16^t[A>>8&255]<<8^t[N&255]^a[te+1],F=t[j>>>24]<<24^t[A>>16&255]<<16^t[N>>8&255]<<8^t[W&255]^a[te+2],P=t[A>>>24]<<24^t[N>>16&255]<<16^t[W>>8&255]<<8^t[j&255]^a[te+3],T[o]=be(k^m),T[o+1]=be(P^S),T[o+2]=be(F^C),T[o+3]=be(g^_),m=K,S=U,C=O,_=z,o=o+4}return T.buffer},E}()},"./src/crypt/decrypter.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return o});var L=I("./src/crypt/aes-crypto.ts"),M=I("./src/crypt/fast-aes-key.ts"),p=I("./src/crypt/aes-decryptor.ts"),E=I("./src/utils/logger.ts"),b=I("./src/utils/mp4-tools.ts"),i=I("./src/utils/typed-array.ts"),c=16,o=function(){function h(a,t,r){var s=r===void 0?{}:r,u=s.removePKCS7Padding,f=u===void 0?!0:u;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=a,this.config=t,this.removePKCS7Padding=f,f)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var n=h.prototype;return n.destroy=function(){this.observer=null},n.isSync=function(){return this.config.enableSoftwareAES},n.flush=function(){var t=this.currentResult;if(!t){this.reset();return}var r=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?Object(p.removePadding)(r):r},n.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},n.decrypt=function(t,r,s,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),r,s);var f=this.flush();f&&u(f.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),r,s).then(u)},n.softwareDecrypt=function(t,r,s){var u=this.currentIV,f=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(t=Object(b.appendUint8Array)(d,t),this.remainderData=null);var v=this.getValidChunk(t);if(!v.length)return null;u&&(s=u);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new p.default),m.expandKey(r);var S=f;return this.currentResult=m.decrypt(v.buffer,0,s),this.currentIV=Object(i.sliceUint8)(v,-16).buffer,S||null},n.webCryptoDecrypt=function(t,r,s){var u=this,f=this.subtle;return(this.key!==r||!this.fastAesKey)&&(this.key=r,this.fastAesKey=new M.default(f,r)),this.fastAesKey.expandKey().then(function(d){if(!f)return Promise.reject(new Error("web crypto not initialized"));var v=new L.default(f,s);return v.decrypt(t.buffer,d)}).catch(function(d){return u.onWebCryptoError(d,t,r,s)})},n.onWebCryptoError=function(t,r,s,u){return E.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(r,s,u)},n.getValidChunk=function(t){var r=t,s=t.length-t.length%c;return s!==t.length&&(r=Object(i.sliceUint8)(t,0,s),this.remainderData=Object(i.sliceUint8)(t,s)),r},n.logOnce=function(t){if(!this.logEnabled)return;E.logger.log("[decrypter.ts]: "+t),this.logEnabled=!1},h}()},"./src/crypt/fast-aes-key.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return L});var L=function(){function M(E,b){this.subtle=void 0,this.key=void 0,this.subtle=E,this.key=b}var p=M.prototype;return p.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},M}()},"./src/demux/aacdemuxer.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/demux/base-audio-demuxer.ts"),M=I("./src/demux/adts.ts"),p=I("./src/utils/logger.ts"),E=I("./src/demux/id3.ts");function b(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,i(o,h)}function i(o,h){return i=Object.setPrototypeOf||function(a,t){return a.__proto__=t,a},i(o,h)}var c=function(o){b(h,o);function h(a,t){var r;return r=o.call(this)||this,r.observer=void 0,r.config=void 0,r.observer=a,r.config=t,r}var n=h.prototype;return n.resetInitSegment=function(t,r,s){o.prototype.resetInitSegment.call(this,t,r,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},h.probe=function(t){if(!t)return!1;for(var r=E.getID3Data(t,0)||[],s=r.length,u=t.length;s<u;s++)if(M.probe(t,s))return p.logger.log("ADTS sync word found !"),!0;return!1},n.canParse=function(t,r){return M.canParse(t,r)},n.appendFrame=function(t,r,s){M.initTrackConfig(t,this.observer,r,s,t.manifestCodec);var u=M.appendFrame(t,r,s,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},h}(L.default);c.minProbeByteLength=9,R.default=c},"./src/demux/adts.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"getAudioConfig",function(){return E}),I.d(R,"isHeaderPattern",function(){return b}),I.d(R,"getHeaderLength",function(){return i}),I.d(R,"getFullFrameLength",function(){return c}),I.d(R,"canGetFrameLength",function(){return o}),I.d(R,"isHeader",function(){return h}),I.d(R,"canParse",function(){return n}),I.d(R,"probe",function(){return a}),I.d(R,"initTrackConfig",function(){return t}),I.d(R,"getFrameDuration",function(){return r}),I.d(R,"parseFrameHeader",function(){return s}),I.d(R,"appendFrame",function(){return u});var L=I("./src/utils/logger.ts"),M=I("./src/errors.ts"),p=I("./src/events.ts");function E(f,d,v,m){var S,C,_,y,T=navigator.userAgent.toLowerCase(),k=m,g=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((d[v+2]&192)>>>6)+1;var F=(d[v+2]&60)>>>2;if(F>g.length-1){f.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+F});return}return _=(d[v+2]&1)<<2,_|=(d[v+3]&192)>>>6,L.logger.log("manifest codec:"+m+", ADTS type:"+S+", samplingIndex:"+F),/firefox/i.test(T)?F>=6?(S=5,y=new Array(4),C=F-3):(S=2,y=new Array(2),C=F):T.indexOf("android")!==-1?(S=2,y=new Array(2),C=F):(S=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&F>=6?C=F-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(F>=6&&_===1||/vivaldi/i.test(T))||!m&&_===1)&&(S=2,y=new Array(2)),C=F)),y[0]=S<<3,y[0]|=(F&14)>>1,y[1]|=(F&1)<<7,y[1]|=_<<3,S===5&&(y[1]|=(C&14)>>1,y[2]=(C&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:g[F],channelCount:_,codec:"mp4a.40."+S,manifestCodec:k}}function b(f,d){return f[d]===255&&(f[d+1]&246)===240}function i(f,d){return f[d+1]&1?7:9}function c(f,d){return(f[d+3]&3)<<11|f[d+4]<<3|(f[d+5]&224)>>>5}function o(f,d){return d+5<f.length}function h(f,d){return d+1<f.length&&b(f,d)}function n(f,d){return o(f,d)&&b(f,d)&&c(f,d)<=f.length-d}function a(f,d){if(h(f,d)){var v=i(f,d);if(d+v>=f.length)return!1;var m=c(f,d);if(m<=v)return!1;var S=d+m;return S===f.length||h(f,S)}return!1}function t(f,d,v,m,S){if(!f.samplerate){var C=E(d,v,m,S);if(!C)return;f.config=C.config,f.samplerate=C.samplerate,f.channelCount=C.channelCount,f.codec=C.codec,f.manifestCodec=C.manifestCodec,L.logger.log("parsed codec:"+f.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function r(f){return 1024*9e4/f}function s(f,d,v,m,S){var C=i(f,d),_=c(f,d);if(_-=C,_>0){var y=v+m*S;return{headerLength:C,frameLength:_,stamp:y}}}function u(f,d,v,m,S){var C=r(f.samplerate),_=s(d,v,m,S,C);if(_){var y=_.frameLength,T=_.headerLength,k=_.stamp,g=T+y,F=Math.max(0,v+g-d.length),P;F?(P=new Uint8Array(g-T),P.set(d.subarray(v+T,d.length),0)):P=d.subarray(v+T,v+g);var N={unit:P,pts:k};return F||f.samples.push(N),{sample:N,length:g,missing:F}}}},"./src/demux/base-audio-demuxer.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"initPTSFn",function(){return c});var L=I("./src/polyfills/number.ts"),M=I("./src/demux/id3.ts"),p=I("./src/demux/dummy-demuxed-track.ts"),E=I("./src/utils/mp4-tools.ts"),b=I("./src/utils/typed-array.ts"),i=function(){function o(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var h=o.prototype;return h.resetInitSegment=function(a,t,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},h.resetTimeStamp=function(){},h.resetContiguity=function(){},h.canParse=function(a,t){return!1},h.appendFrame=function(a,t,r){},h.demux=function(a,t){this.cachedData&&(a=Object(E.appendUint8Array)(this.cachedData,a),this.cachedData=null);var r=M.getID3Data(a,0),s=r?r.length:0,u,f,d=this._audioTrack,v=this._id3Track,m=r?M.getTimeStamp(r):void 0,S=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=c(m,t)),r&&r.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:r}),f=this.initPTS;s<S;){if(this.canParse(a,s)){var C=this.appendFrame(d,a,s);C?(this.frameIndex++,f=C.sample.pts,s+=C.length,u=s):s=S}else M.canParse(a,s)?(r=M.getID3Data(a,s),v.samples.push({pts:f,dts:f,data:r}),s+=r.length,u=s):s++;if(s===S&&u!==S){var _=Object(b.sliceUint8)(a,u);this.cachedData?this.cachedData=Object(E.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:d,avcTrack:Object(p.dummyTrack)(),id3Track:v,textTrack:Object(p.dummyTrack)()}},h.demuxSampleAes=function(a,t,r){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},h.flush=function(a){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(p.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(p.dummyTrack)()}},h.destroy=function(){},o}(),c=function(h,n){return Object(L.isFiniteNumber)(h)?h*90:n*9e4};R.default=i},"./src/demux/chunk-cache.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return L});var L=function(){function p(){this.chunks=[],this.dataLength=0}var E=p.prototype;return E.push=function(i){this.chunks.push(i),this.dataLength+=i.length},E.flush=function(){var i=this.chunks,c=this.dataLength,o;if(i.length)i.length===1?o=i[0]:o=M(i,c);else return new Uint8Array(0);return this.reset(),o},E.reset=function(){this.chunks.length=0,this.dataLength=0},p}();function M(p,E){for(var b=new Uint8Array(E),i=0,c=0;c<p.length;c++){var o=p[c];b.set(o,i),i+=o.length}return b}},"./src/demux/dummy-demuxed-track.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"dummyTrack",function(){return L});function L(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/utils/logger.ts"),M=function(){function p(b){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=b,this.bytesAvailable=b.byteLength,this.word=0,this.bitsAvailable=0}var E=p.prototype;return E.loadWord=function(){var i=this.data,c=this.bytesAvailable,o=i.byteLength-c,h=new Uint8Array(4),n=Math.min(4,c);if(n===0)throw new Error("no bytes available");h.set(i.subarray(o,o+n)),this.word=new DataView(h.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n},E.skipBits=function(i){var c;this.bitsAvailable>i?(this.word<<=i,this.bitsAvailable-=i):(i-=this.bitsAvailable,c=i>>3,i-=c>>3,this.bytesAvailable-=c,this.loadWord(),this.word<<=i,this.bitsAvailable-=i)},E.readBits=function(i){var c=Math.min(this.bitsAvailable,i),o=this.word>>>32-c;return i>32&&L.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=c,this.bitsAvailable>0?this.word<<=c:this.bytesAvailable>0&&this.loadWord(),c=i-c,c>0&&this.bitsAvailable?o<<c|this.readBits(c):o},E.skipLZ=function(){var i;for(i=0;i<this.bitsAvailable;++i)if((this.word&2147483648>>>i)!==0)return this.word<<=i,this.bitsAvailable-=i,i;return this.loadWord(),i+this.skipLZ()},E.skipUEG=function(){this.skipBits(1+this.skipLZ())},E.skipEG=function(){this.skipBits(1+this.skipLZ())},E.readUEG=function(){var i=this.skipLZ();return this.readBits(i+1)-1},E.readEG=function(){var i=this.readUEG();return 1&i?1+i>>>1:-1*(i>>>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(i){for(var c=8,o=8,h,n=0;n<i;n++)o!==0&&(h=this.readEG(),o=(c+h+256)%256),c=o===0?c:o},E.readSPS=function(){var i=0,c=0,o=0,h=0,n,a,t,r=this.readUByte.bind(this),s=this.readBits.bind(this),u=this.readUEG.bind(this),f=this.readBoolean.bind(this),d=this.skipBits.bind(this),v=this.skipEG.bind(this),m=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);r();var C=r();if(s(5),d(3),r(),m(),C===100||C===110||C===122||C===244||C===44||C===83||C===86||C===118||C===128){var _=u();if(_===3&&d(1),m(),m(),d(1),f())for(a=_!==3?8:12,t=0;t<a;t++)f()&&(t<6?S(16):S(64))}m();var y=u();if(y===0)u();else if(y===1)for(d(1),v(),v(),n=u(),t=0;t<n;t++)v();m(),d(1);var T=u(),k=u(),g=s(1);g===0&&d(1),d(1),f()&&(i=u(),c=u(),o=u(),h=u());var F=[1,1];if(f()&&f()){var P=r();switch(P){case 1:F=[1,1];break;case 2:F=[12,11];break;case 3:F=[10,11];break;case 4:F=[16,11];break;case 5:F=[40,33];break;case 6:F=[24,11];break;case 7:F=[20,11];break;case 8:F=[32,11];break;case 9:F=[80,33];break;case 10:F=[18,11];break;case 11:F=[15,11];break;case 12:F=[64,33];break;case 13:F=[160,99];break;case 14:F=[4,3];break;case 15:F=[3,2];break;case 16:F=[2,1];break;case 255:{F=[r()<<8|r(),r()<<8|r()];break}}}return{width:Math.ceil((T+1)*16-i*2-c*2),height:(2-g)*(k+1)*16-(g?2:4)*(o+h),pixelRatio:F}},E.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},p}();R.default=M},"./src/demux/id3.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"isHeader",function(){return L}),I.d(R,"isFooter",function(){return M}),I.d(R,"getID3Data",function(){return p}),I.d(R,"canParse",function(){return b}),I.d(R,"getTimeStamp",function(){return i}),I.d(R,"isTimeStampFrame",function(){return c}),I.d(R,"getID3Frames",function(){return h}),I.d(R,"decodeFrame",function(){return n}),I.d(R,"utf8ArrayToStr",function(){return u}),I.d(R,"testables",function(){return f});var L=function(S,C){return C+10<=S.length&&(S[C]===73&&S[C+1]===68&&S[C+2]===51&&(S[C+3]<255&&S[C+4]<255&&(S[C+6]<128&&S[C+7]<128&&S[C+8]<128&&S[C+9]<128)))},M=function(S,C){return C+10<=S.length&&(S[C]===51&&S[C+1]===68&&S[C+2]===73&&(S[C+3]<255&&S[C+4]<255&&(S[C+6]<128&&S[C+7]<128&&S[C+8]<128&&S[C+9]<128)))},p=function(S,C){for(var _=C,y=0;L(S,C);){y+=10;var T=E(S,C+6);y+=T,M(S,C+10)&&(y+=10),C+=y}return y>0?S.subarray(_,_+y):void 0},E=function(S,C){var _=0;return _=(S[C]&127)<<21,_|=(S[C+1]&127)<<14,_|=(S[C+2]&127)<<7,_|=S[C+3]&127,_},b=function(S,C){return L(S,C)&&E(S,C+6)+10<=S.length-C},i=function(S){for(var C=h(S),_=0;_<C.length;_++){var y=C[_];if(c(y))return s(y)}return},c=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},o=function(S){var C=String.fromCharCode(S[0],S[1],S[2],S[3]),_=E(S,4),y=10;return{type:C,size:_,data:S.subarray(y,y+_)}},h=function(S){for(var C=0,_=[];L(S,C);){var y=E(S,C+6);C+=10;for(var T=C+y;C+8<T;){var k=o(S.subarray(C)),g=n(k);g&&_.push(g),C+=k.size+10}M(S,C)&&(C+=10)}return _},n=function(S){return S.type==="PRIV"?a(S):S.type[0]==="W"?r(S):t(S)},a=function(S){if(S.size<2)return;var C=u(S.data,!0),_=new Uint8Array(S.data.subarray(C.length+1));return{key:S.type,info:C,data:_.buffer}},t=function(S){if(S.size<2)return;if(S.type==="TXXX"){var C=1,_=u(S.data.subarray(C),!0);C+=_.length+1;var y=u(S.data.subarray(C));return{key:S.type,info:_,data:y}}var T=u(S.data.subarray(1));return{key:S.type,data:T}},r=function(S){if(S.type==="WXXX"){if(S.size<2)return;var C=1,_=u(S.data.subarray(C),!0);C+=_.length+1;var y=u(S.data.subarray(C));return{key:S.type,info:_,data:y}}var T=u(S.data);return{key:S.type,data:T}},s=function(S){if(S.data.byteLength===8){var C=new Uint8Array(S.data),_=C[3]&1,y=(C[4]<<23)+(C[5]<<15)+(C[6]<<7)+C[7];return y/=45,_&&(y+=4772185884e-2),Math.round(y)}return},u=function(S,C){C===void 0&&(C=!1);var _=v();if(_){var y=_.decode(S);if(C){var T=y.indexOf("\0");return T!==-1?y.substring(0,T):y}return y.replace(/\0/g,"")}for(var k=S.length,g,F,P,N="",W=0;W<k;){if(g=S[W++],g===0&&C)return N;if(g===0||g===3)continue;switch(g>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:N+=String.fromCharCode(g);break;case 12:case 13:F=S[W++],N+=String.fromCharCode((g&31)<<6|F&63);break;case 14:F=S[W++],P=S[W++],N+=String.fromCharCode((g&15)<<12|(F&63)<<6|(P&63)<<0);break;default:}}return N},f={decodeTextFrame:t},d;function v(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/demux/base-audio-demuxer.ts"),M=I("./src/demux/id3.ts"),p=I("./src/utils/logger.ts"),E=I("./src/demux/mpegaudio.ts");function b(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,i(o,h)}function i(o,h){return i=Object.setPrototypeOf||function(a,t){return a.__proto__=t,a},i(o,h)}var c=function(o){b(h,o);function h(){return o.apply(this,arguments)||this}var n=h.prototype;return n.resetInitSegment=function(t,r,s){o.prototype.resetInitSegment.call(this,t,r,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}},h.probe=function(t){if(!t)return!1;for(var r=M.getID3Data(t,0)||[],s=r.length,u=t.length;s<u;s++)if(E.probe(t,s))return p.logger.log("MPEG Audio sync word found !"),!0;return!1},n.canParse=function(t,r){return E.canParse(t,r)},n.appendFrame=function(t,r,s){return this.initPTS===null?void 0:E.appendFrame(t,r,s,this.initPTS,this.frameIndex)},h}(L.default);c.minProbeByteLength=4,R.default=c},"./src/demux/mp4demuxer.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/utils/mp4-tools.ts"),M=I("./src/demux/dummy-demuxed-track.ts"),p=function(){function E(i,c){this.remainderData=null,this.config=void 0,this.config=c}var b=E.prototype;return b.resetTimeStamp=function(){},b.resetInitSegment=function(){},b.resetContiguity=function(){},E.probe=function(c){return Object(L.findBox)({data:c,start:0,end:Math.min(c.length,16384)},["moof"]).length>0},b.demux=function(c){var o=c,h=Object(M.dummyTrack)();if(this.config.progressive){this.remainderData&&(o=Object(L.appendUint8Array)(this.remainderData,c));var n=Object(L.segmentValidRange)(o);this.remainderData=n.remainder,h.samples=n.valid||new Uint8Array}else h.samples=o;return{audioTrack:Object(M.dummyTrack)(),avcTrack:h,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},b.flush=function(){var c=Object(M.dummyTrack)();return c.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(M.dummyTrack)(),avcTrack:c,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},b.demuxSampleAes=function(c,o,h){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},b.destroy=function(){},E}();p.minProbeByteLength=1024,R.default=p},"./src/demux/mpegaudio.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"appendFrame",function(){return i}),I.d(R,"parseHeader",function(){return c}),I.d(R,"isHeaderPattern",function(){return o}),I.d(R,"isHeader",function(){return h}),I.d(R,"canParse",function(){return n}),I.d(R,"probe",function(){return a});var L=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],p=[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]],b=[0,1,1,4];function i(t,r,s,u,f){if(s+24>r.length)return;var d=c(r,s);if(d&&s+d.frameLength<=r.length){var v=d.samplesPerFrame*9e4/d.sampleRate,m=u+f*v,S={unit:r.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 c(t,r){var s=t[r+1]>>3&3,u=t[r+1]>>1&3,f=t[r+2]>>4&15,d=t[r+2]>>2&3;if(s!==1&&f!==0&&f!==15&&d!==3){var v=t[r+2]>>1&1,m=t[r+3]>>6,S=s===3?3-u:u===3?3:4,C=M[S*14+f-1]*1e3,_=s===3?0:s===2?1:2,y=p[_*3+d],T=m===3?1:2,k=E[s][u],g=b[u],F=k*8*g,P=Math.floor(k*C/y+v)*g;if(L===null){var N=navigator.userAgent||"",W=N.match(/Chrome\/(\d+)/i);L=W?parseInt(W[1]):0}var j=!!L&&L<=87;return j&&u===2&&C>=224e3&&m===0&&(t[r+3]=t[r+3]|128),{sampleRate:y,channelCount:T,frameLength:P,samplesPerFrame:F}}}function o(t,r){return t[r]===255&&(t[r+1]&224)===224&&(t[r+1]&6)!==0}function h(t,r){return r+1<t.length&&o(t,r)}function n(t,r){var s=4;return o(t,r)&&s<=t.length-r}function a(t,r){if(r+1<t.length&&o(t,r)){var s=4,u=c(t,r),f=s;u!=null&&u.frameLength&&(f=u.frameLength);var d=r+f;return d===t.length||h(t,d)}return!1}},"./src/demux/sample-aes.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/crypt/decrypter.ts"),M=I("./src/demux/tsdemuxer.ts"),p=function(){function E(i,c,o){this.keyData=void 0,this.decrypter=void 0,this.keyData=o,this.decrypter=new L.default(i,c,{removePKCS7Padding:!1})}var b=E.prototype;return b.decryptBuffer=function(c,o){this.decrypter.decrypt(c,this.keyData.key.buffer,this.keyData.iv.buffer,o)},b.decryptAacSample=function(c,o,h,n){var a=c[o].unit,t=a.subarray(16,a.length-a.length%16),r=t.buffer.slice(t.byteOffset,t.byteOffset+t.length),s=this;this.decryptBuffer(r,function(u){var f=new Uint8Array(u);a.set(f,16),n||s.decryptAacSamples(c,o+1,h)})},b.decryptAacSamples=function(c,o,h){for(;;o++){if(o>=c.length){h();return}if(c[o].unit.length<32)continue;var n=this.decrypter.isSync();if(this.decryptAacSample(c,o,h,n),!n)return}},b.getAvcEncryptedData=function(c){for(var o=Math.floor((c.length-48)/160)*16+16,h=new Int8Array(o),n=0,a=32;a<=c.length-16;a+=160,n+=16)h.set(c.subarray(a,a+16),n);return h},b.getAvcDecryptedUnit=function(c,o){for(var h=new Uint8Array(o),n=0,a=32;a<=c.length-16;a+=160,n+=16)c.set(h.subarray(n,n+16),a);return c},b.decryptAvcSample=function(c,o,h,n,a,t){var r=Object(M.discardEPB)(a.data),s=this.getAvcEncryptedData(r),u=this;this.decryptBuffer(s.buffer,function(f){a.data=u.getAvcDecryptedUnit(r,f),t||u.decryptAvcSamples(c,o,h+1,n)})},b.decryptAvcSamples=function(c,o,h,n){if(c instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;o++,h=0){if(o>=c.length){n();return}for(var a=c[o].units;!(h>=a.length);h++){var t=a[h];if(t.data.length<=48||t.type!==1&&t.type!==5)continue;var r=this.decrypter.isSync();if(this.decryptAvcSample(c,o,h,n,t,r),!r)return}}},E}();R.default=p},"./src/demux/transmuxer-interface.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return a});var L=I("./node_modules/webworkify-webpack/index.js"),M=I.n(L),p=I("./src/events.ts"),E=I("./src/demux/transmuxer.ts"),b=I("./src/utils/logger.ts"),i=I("./src/errors.ts"),c=I("./src/utils/mediasource-helper.ts"),o=I("./node_modules/eventemitter3/index.js"),h=I.n(o),n=Object(c.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function t(s,u,f,d){var v=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=u,this.onTransmuxComplete=f,this.onFlush=d;var m=s.config,S=function(k,g){g=g||{},g.frag=v.frag,g.id=v.id,s.trigger(k,g)};this.observer=new o.EventEmitter,this.observer.on(p.Events.FRAG_DECRYPTED,S),this.observer.on(p.Events.ERROR,S);var C={mp4:n.isTypeSupported("video/mp4"),mpeg:n.isTypeSupported("audio/mpeg"),mp3:n.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){b.logger.log("demuxing in webworker");var y;try{y=this.worker=L("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(T){s.trigger(p.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},y.postMessage({cmd:"init",typeSupported:C,vendor:_,id:u,config:JSON.stringify(m)})}catch(T){b.logger.warn("Error in worker:",T),b.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new E.default(this.observer,C,m,_,u),this.worker=null}}else this.transmuxer=new E.default(this.observer,C,m,_,u)}var r=t.prototype;return r.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var f=this.transmuxer;f&&(f.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},r.push=function(u,f,d,v,m,S,C,_,y,T){var k=this;y.transmuxing.start=self.performance.now();var g=this.transmuxer,F=this.worker,P=S?S.start:m.start,N=m.decryptdata,W=this.frag,j=!(W&&m.cc===W.cc),A=!(W&&y.level===W.level),K=W?y.sn-W.sn:-1,U=this.part?y.part-this.part.index:1,O=!A&&(K===1||K===0&&U===1),z=self.performance.now();(A||K||m.stats.parsing.start===0)&&(m.stats.parsing.start=z),S&&(U||!O)&&(S.stats.parsing.start=z);var te=new E.TransmuxState(j,O,_,A,P);if(!O||j){b.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
discontinuity: `+j+`
trackSwitch: `+A+`
contiguous: `+O+`
accurateTimeOffset: `+_+`
timeOffset: `+P);var de=new E.TransmuxConfig(d,v,f,C,T);this.configureTransmuxer(de)}if(this.frag=m,this.part=S,F)F.postMessage({cmd:"demux",data:u,decryptdata:N,chunkMeta:y,state:te},u instanceof ArrayBuffer?[u]:[]);else if(g){var be=g.push(u,N,y,te);Object(E.isPromise)(be)?be.then(function(je){k.handleTransmuxComplete(je)}):this.handleTransmuxComplete(be)}},r.flush=function(u){var f=this;u.transmuxing.start=self.performance.now();var d=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:u});else if(d){var m=d.flush(u);Object(E.isPromise)(m)?m.then(function(S){f.handleFlushResult(S,u)}):this.handleFlushResult(m,u)}},r.handleFlushResult=function(u,f){var d=this;u.forEach(function(v){d.handleTransmuxComplete(v)}),this.onFlush(f)},r.onWorkerMessage=function(u){var f=u.data,d=this.hls;switch(f.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}default:{f.data=f.data||{},f.data.frag=this.frag,f.data.id=this.id,d.trigger(f.event,f.data);break}}},r.configureTransmuxer=function(u){var f=this.worker,d=this.transmuxer;f?f.postMessage({cmd:"configure",config:u}):d&&d.configure(u)},r.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},t}()},"./src/demux/transmuxer-worker.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return i});var L=I("./src/demux/transmuxer.ts"),M=I("./src/events.ts"),p=I("./src/utils/logger.ts"),E=I("./node_modules/eventemitter3/index.js"),b=I.n(E);function i(a){var t=new E.EventEmitter,r=function(u,f){a.postMessage({event:u,data:f})};t.on(M.Events.FRAG_DECRYPTED,r),t.on(M.Events.ERROR,r),a.addEventListener("message",function(s){var u=s.data;switch(u.cmd){case"init":{var f=JSON.parse(u.config);a.transmuxer=new L.default(t,u.typeSupported,f,u.vendor,u.id),Object(p.enableLogs)(f.debug),r("init",null);break}case"configure":{a.transmuxer.configure(u.config);break}case"demux":{var d=a.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(L.isPromise)(d)?d.then(function(S){c(a,S)}):c(a,d);break}case"flush":{var v=u.chunkMeta,m=a.transmuxer.flush(v);Object(L.isPromise)(m)?m.then(function(S){h(a,S,v)}):h(a,m,v);break}default:break}})}function c(a,t){if(n(t.remuxResult))return;var r=[],s=t.remuxResult,u=s.audio,f=s.video;u&&o(r,u),f&&o(r,f),a.postMessage({event:"transmuxComplete",data:t},r)}function o(a,t){t.data1&&a.push(t.data1.buffer),t.data2&&a.push(t.data2.buffer)}function h(a,t,r){t.forEach(function(s){c(a,s)}),a.postMessage({event:"flush",data:r})}function n(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return f}),I.d(R,"isPromise",function(){return m}),I.d(R,"TransmuxConfig",function(){return S}),I.d(R,"TransmuxState",function(){return C});var L=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/crypt/decrypter.ts"),E=I("./src/demux/aacdemuxer.ts"),b=I("./src/demux/mp4demuxer.ts"),i=I("./src/demux/tsdemuxer.ts"),c=I("./src/demux/mp3demuxer.ts"),o=I("./src/remux/mp4-remuxer.ts"),h=I("./src/remux/passthrough-remuxer.ts"),n=I("./src/demux/chunk-cache.ts"),a=I("./src/utils/mp4-tools.ts"),t=I("./src/utils/logger.ts"),r;try{r=self.performance.now.bind(self.performance)}catch(_){t.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var s=[{demux:i.default,remux:o.default},{demux:b.default,remux:h.default},{demux:E.default,remux:o.default},{demux:c.default,remux:o.default}],u=1024;s.forEach(function(_){var y=_.demux;u=Math.max(u,y.minProbeByteLength)});var f=function(){function _(T,k,g,F,P){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 n.default,this.observer=T,this.typeSupported=k,this.config=g,this.vendor=F,this.id=P}var y=_.prototype;return y.configure=function(k){this.transmuxConfig=k,this.decrypter&&this.decrypter.reset()},y.push=function(k,g,F,P){var N=this,W=F.transmuxing;W.executeStart=r();var j=new Uint8Array(k),A=this.cache,K=this.config,U=this.currentTransmuxState,O=this.transmuxConfig;P&&(this.currentTransmuxState=P);var z=d(j,g);if(z&&z.method==="AES-128"){var te=this.getDecrypter();if(K.enableSoftwareAES){var de=te.softwareDecrypt(j,z.key.buffer,z.iv.buffer);if(!de)return W.executeEnd=r(),v(F);j=new Uint8Array(de)}else return this.decryptionPromise=te.webCryptoDecrypt(j,z.key.buffer,z.iv.buffer).then(function(qe){var Je=N.push(qe,null,F);return N.decryptionPromise=null,Je}),this.decryptionPromise}var be=P||U,je=be.contiguous,Ne=be.discontinuity,Oe=be.trackSwitch,Ke=be.accurateTimeOffset,We=be.timeOffset,Te=O.audioCodec,we=O.videoCodec,ue=O.defaultInitPts,Ae=O.duration,ge=O.initSegmentData;if((Ne||Oe)&&this.resetInitSegment(ge,Te,we,Ae),Ne&&this.resetInitialTimestamp(ue),je||this.resetContiguity(),this.needsProbing(j,Ne,Oe)){if(A.dataLength){var Ve=A.flush();j=Object(a.appendUint8Array)(Ve,j)}this.configureTransmuxer(j,O)}var Qe=this.transmux(j,z,We,Ke,F),ze=this.currentTransmuxState;return ze.contiguous=!0,ze.discontinuity=!1,ze.trackSwitch=!1,W.executeEnd=r(),Qe},y.flush=function(k){var g=this,F=k.transmuxing;F.executeStart=r();var P=this.decrypter,N=this.cache,W=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return g.flush(k)});var A=[],K=W.timeOffset;if(P){var U=P.flush();U&&A.push(this.push(U,null,k))}var O=N.dataLength;N.reset();var z=this.demuxer,te=this.remuxer;if(!z||!te)return O>=u&&this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),F.executeEnd=r(),[v(k)];var de=z.flush(K);return m(de)?de.then(function(be){return g.flushRemux(A,be,k),A}):(this.flushRemux(A,de,k),A)},y.flushRemux=function(k,g,F){var P=g.audioTrack,N=g.avcTrack,W=g.id3Track,j=g.textTrack,A=this.currentTransmuxState,K=A.accurateTimeOffset,U=A.timeOffset;t.logger.log("[transmuxer.ts]: Flushed fragment "+F.sn+(F.part>-1?" p: "+F.part:"")+" of level "+F.level);var O=this.remuxer.remux(P,N,W,j,U,K,!0,this.id);k.push({remuxResult:O,chunkMeta:F}),F.transmuxing.executeEnd=r()},y.resetInitialTimestamp=function(k){var g=this.demuxer,F=this.remuxer;if(!g||!F)return;g.resetTimeStamp(k),F.resetTimeStamp(k)},y.resetContiguity=function(){var k=this.demuxer,g=this.remuxer;if(!k||!g)return;k.resetContiguity(),g.resetNextTimestamp()},y.resetInitSegment=function(k,g,F,P){var N=this.demuxer,W=this.remuxer;if(!N||!W)return;N.resetInitSegment(g,F,P),W.resetInitSegment(k,g,F)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(k,g,F,P,N){var W;return g&&g.method==="SAMPLE-AES"?W=this.transmuxSampleAes(k,g,F,P,N):W=this.transmuxUnencrypted(k,F,P,N),W},y.transmuxUnencrypted=function(k,g,F,P){var N=this.demuxer.demux(k,g,!1,!this.config.progressive),W=N.audioTrack,j=N.avcTrack,A=N.id3Track,K=N.textTrack,U=this.remuxer.remux(W,j,A,K,g,F,!1,this.id);return{remuxResult:U,chunkMeta:P}},y.transmuxSampleAes=function(k,g,F,P,N){var W=this;return this.demuxer.demuxSampleAes(k,g,F).then(function(j){var A=W.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,F,P,!1,W.id);return{remuxResult:A,chunkMeta:N}})},y.configureTransmuxer=function(k,g){for(var F=this.config,P=this.observer,N=this.typeSupported,W=this.vendor,j=g.audioCodec,A=g.defaultInitPts,K=g.duration,U=g.initSegmentData,O=g.videoCodec,z,te=0,de=s.length;te<de;te++)if(s[te].demux.probe(k)){z=s[te];break}z||(t.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:b.default,remux:h.default});var be=this.demuxer,je=this.remuxer,Ne=z.remux,Oe=z.demux;(!je||!(je instanceof Ne))&&(this.remuxer=new Ne(P,F,N,W)),(!be||!(be instanceof Oe))&&(this.demuxer=new Oe(P,F,N),this.probe=Oe.probe),this.resetInitSegment(U,j,O,K),this.resetInitialTimestamp(A)},y.needsProbing=function(k,g,F){return!this.demuxer||!this.remuxer||g||F},y.getDecrypter=function(){var k=this.decrypter;return k||(k=this.decrypter=new p.default(this.observer,this.config)),k},_}();function d(_,y){var T=null;return _.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(T=y),T}var v=function(y){return{remuxResult:{},chunkMeta:y}};function m(_){return"then"in _&&_.then instanceof Function}var S=function(y,T,k,g,F){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=k,this.duration=g,this.defaultInitPts=F},C=function(y,T,k,g,F){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=k,this.trackSwitch=g,this.timeOffset=F}},"./src/demux/tsdemuxer.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"discardEPB",function(){return v});var L=I("./src/demux/adts.ts"),M=I("./src/demux/mpegaudio.ts"),p=I("./src/demux/exp-golomb.ts"),E=I("./src/demux/id3.ts"),b=I("./src/demux/sample-aes.ts"),i=I("./src/events.ts"),c=I("./src/utils/mp4-tools.ts"),o=I("./src/utils/logger.ts"),h=I("./src/errors.ts"),n={video:1,audio:2,id3:3,text:4},a=function(){function m(C,_,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=_,this.typeSupported=y}m.probe=function(_){var y=m.syncOffset(_);return y<0?!1:(y&&o.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},m.syncOffset=function(_){for(var y=Math.min(1e3,_.length-3*188),T=0;T<y;){if(_[T]===71&&_[T+188]===71&&_[T+2*188]===71)return T;T++}return-1},m.createTrack=function(_,y){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:n[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?y:void 0}};var S=m.prototype;return S.resetInitSegment=function(_,y,T){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",T),this._audioTrack=m.createTrack("audio",T),this._id3Track=m.createTrack("id3",T),this._txtTrack=m.createTrack("text",T),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=y,this._duration=T},S.resetTimeStamp=function(){},S.resetContiguity=function(){var _=this._audioTrack,y=this._avcTrack,T=this._id3Track;_&&(_.pesData=null),y&&(y.pesData=null),T&&(T.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(_,y,T,k){T===void 0&&(T=!1),k===void 0&&(k=!1),T||(this.sampleAes=null);var g,F=this._avcTrack,P=this._audioTrack,N=this._id3Track,W=F.pid,j=F.pesData,A=P.pid,K=N.pid,U=P.pesData,O=N.pesData,z=!1,te=this.pmtParsed,de=this._pmtId,be=_.length;if(this.remainderData&&(_=Object(c.appendUint8Array)(this.remainderData,_),be=_.length,this.remainderData=null),be<188&&!k)return this.remainderData=_,{audioTrack:P,avcTrack:F,id3Track:N,textTrack:this._txtTrack};var je=Math.max(0,m.syncOffset(_));be-=(be+je)%188,be<_.byteLength&&!k&&(this.remainderData=new Uint8Array(_.buffer,be,_.buffer.byteLength-be));for(var Ne=je;Ne<be;Ne+=188)if(_[Ne]===71){var Oe=!!(_[Ne+1]&64),Ke=((_[Ne+1]&31)<<8)+_[Ne+2],We=(_[Ne+3]&48)>>4,Te=void 0;if(We>1){if(Te=Ne+5+_[Ne+4],Te===Ne+188)continue}else Te=Ne+4;switch(Ke){case W:Oe&&(j&&(g=u(j))&&this.parseAVCPES(g,!1),j={data:[],size:0}),j&&(j.data.push(_.subarray(Te,Ne+188)),j.size+=Ne+188-Te);break;case A:Oe&&(U&&(g=u(U))&&(P.isAAC?this.parseAACPES(g):this.parseMPEGPES(g)),U={data:[],size:0}),U&&(U.data.push(_.subarray(Te,Ne+188)),U.size+=Ne+188-Te);break;case K:Oe&&(O&&(g=u(O))&&this.parseID3PES(g),O={data:[],size:0}),O&&(O.data.push(_.subarray(Te,Ne+188)),O.size+=Ne+188-Te);break;case 0:Oe&&(Te+=_[Te]+1),de=this._pmtId=r(_,Te);break;case de:{Oe&&(Te+=_[Te]+1);var we=s(_,Te,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);W=we.avc,W>0&&(F.pid=W),A=we.audio,A>0&&(P.pid=A,P.isAAC=we.isAAC),K=we.id3,K>0&&(N.pid=K),z&&!te&&(o.logger.log("reparse from beginning"),z=!1,Ne=je-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});F.pesData=j,P.pesData=U,N.pesData=O;var ue={audioTrack:P,avcTrack:F,id3Track:N,textTrack:this._txtTrack};return k&&this.extractRemainingSamples(ue),ue},S.flush=function(){var _=this.remainderData;this.remainderData=null;var y;return _?y=this.demux(_,-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(_){var y=_.audioTrack,T=_.avcTrack,k=_.id3Track,g=T.pesData,F=y.pesData,P=k.pesData,N;g&&(N=u(g))?(this.parseAVCPES(N,!0),T.pesData=null):T.pesData=g,F&&(N=u(F))?(y.isAAC?this.parseAACPES(N):this.parseMPEGPES(N),y.pesData=null):(F!=null&&F.size&&o.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=F),P&&(N=u(P))?(this.parseID3PES(N),k.pesData=null):k.pesData=P},S.demuxSampleAes=function(_,y,T){var k=this.demux(_,T,!0,!this.config.progressive),g=this.sampleAes=new b.default(this.observer,this.config,y);return this.decrypt(k,g)},S.decrypt=function(_,y){return new Promise(function(T){var k=_.audioTrack,g=_.avcTrack;k.samples&&k.isAAC?y.decryptAacSamples(k.samples,0,function(){g.samples?y.decryptAvcSamples(g.samples,0,0,function(){T(_)}):T(_)}):g.samples&&y.decryptAvcSamples(g.samples,0,0,function(){T(_)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(_,y){var T=this,k=this._avcTrack,g=this.parseAVCNALu(_.data),F=!1,P=this.avcSample,N,W=!1;_.data=null,P&&g.length&&!k.audFound&&(f(P,k),P=this.avcSample=t(!1,_.pts,_.dts,"")),g.forEach(function(j){switch(j.type){case 1:{N=!0,P||(P=T.avcSample=t(!0,_.pts,_.dts,"")),F&&(P.debug+="NDR "),P.frame=!0;var A=j.data;if(W&&A.length>4){var K=new p.default(A).readSliceType();(K===2||K===4||K===7||K===9)&&(P.key=!0)}break}case 5:N=!0,P||(P=T.avcSample=t(!0,_.pts,_.dts,"")),F&&(P.debug+="IDR "),P.key=!0,P.frame=!0;break;case 6:{N=!0,F&&P&&(P.debug+="SEI ");var U=new p.default(v(j.data));U.readUByte();for(var O=0,z=0,te=!1,de=0;!te&&U.bytesAvailable>1;){O=0;do de=U.readUByte(),O+=de;while(de===255);z=0;do de=U.readUByte(),z+=de;while(de===255);if(O===4&&U.bytesAvailable!==0){te=!0;var be=U.readUByte();if(be===181){var je=U.readUShort();if(je===49){var Ne=U.readUInt();if(Ne===1195456820){var Oe=U.readUByte();if(Oe===3){for(var Ke=U.readUByte(),We=U.readUByte(),Te=31&Ke,we=[Ke,We],ue=0;ue<Te;ue++)we.push(U.readUByte()),we.push(U.readUByte()),we.push(U.readUByte());d(T._txtTrack.samples,{type:3,pts:_.pts,bytes:we})}}}}}else if(O===5&&U.bytesAvailable!==0){if(te=!0,z>16){for(var Ae=[],ge=0;ge<16;ge++)Ae.push(U.readUByte().toString(16)),(ge===3||ge===5||ge===7||ge===9)&&Ae.push("-");for(var Ve=z-16,Qe=new Uint8Array(Ve),ze=0;ze<Ve;ze++)Qe[ze]=U.readUByte();d(T._txtTrack.samples,{pts:_.pts,payloadType:O,uuid:Ae.join(""),userData:Object(E.utf8ArrayToStr)(Qe),userDataBytes:Qe})}}else if(z<U.bytesAvailable)for(var qe=0;qe<z;qe++)U.readUByte()}break}case 7:if(N=!0,W=!0,F&&P&&(P.debug+="SPS "),!k.sps){var Je=new p.default(j.data),pe=Je.readSPS();k.width=pe.width,k.height=pe.height,k.pixelRatio=pe.pixelRatio,k.sps=[j.data],k.duration=T._duration;for(var ve=j.data.subarray(1,4),xe="avc1.",Se=0;Se<3;Se++){var Le=ve[Se].toString(16);Le.length<2&&(Le="0"+Le),xe+=Le}k.codec=xe}break;case 8:N=!0,F&&P&&(P.debug+="PPS "),k.pps||(k.pps=[j.data]);break;case 9:N=!1,k.audFound=!0,P&&f(P,k),P=T.avcSample=t(!1,_.pts,_.dts,F?"AUD ":"");break;case 12:N=!1;break;default:N=!1,P&&(P.debug+="unknown NAL "+j.type+" ");break}if(P&&N){var ne=P.units;ne.push(j)}}),y&&P&&(f(P,k),this.avcSample=null)},S.getLastNalUnit=function(){var _,y=this.avcSample,T;if(!y||y.units.length===0){var k=this._avcTrack.samples;y=k[k.length-1]}if((_=y)!==null&&_!==void 0&&_.units){var g=y.units;T=g[g.length-1]}return T},S.parseAVCNALu=function(_){var y=_.byteLength,T=this._avcTrack,k=T.naluState||0,g=k,F=[],P=0,N,W,j,A=-1,K=0;for(k===-1&&(A=0,K=_[0]&31,k=0,P=1);P<y;){if(N=_[P++],!k){k=N?0:1;continue}if(k===1){k=N?0:2;continue}if(!N)k=3;else if(N===1){if(A>=0){var U={data:_.subarray(A,P-k-1),type:K};F.push(U)}else{var O=this.getLastNalUnit();if(O&&(g&&P<=4-g&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-g))),W=P-k-1,W>0)){var z=new Uint8Array(O.data.byteLength+W);z.set(O.data,0),z.set(_.subarray(0,W),O.data.byteLength),O.data=z,O.state=0}}P<y?(j=_[P]&31,A=P,K=j,k=0):k=-1}else k=0}if(A>=0&&k>=0){var te={data:_.subarray(A,y),type:K,state:k};F.push(te)}if(F.length===0){var de=this.getLastNalUnit();if(de){var be=new Uint8Array(de.data.byteLength+_.byteLength);be.set(de.data,0),be.set(_,de.data.byteLength),de.data=be}}return T.naluState=k,F},S.parseAACPES=function(_){var y=0,T=this._audioTrack,k=this.aacOverFlow,g=_.data;if(k){this.aacOverFlow=null;var F=k.sample.unit.byteLength,P=Math.min(k.missing,F),N=F-P;k.sample.unit.set(g.subarray(0,P),N),T.samples.push(k.sample),y=k.missing}var W,j;for(W=y,j=g.length;W<j-1&&!L.isHeader(g,W);W++);if(W!==y){var A,K;if(W<j-1?(A="AAC PES did not start with ADTS header,offset:"+W,K=!1):(A="no ADTS header found in AAC PES",K=!0),o.logger.warn("parsing error:"+A),this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:K,reason:A}),K)return}L.initTrackConfig(T,this.observer,g,W,this.audioCodec);var U;if(_.pts!==void 0)U=_.pts;else if(k){var O=L.getFrameDuration(T.samplerate);U=k.sample.pts+O}else{o.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;W<j;)if(L.isHeader(g,W)){if(W+5<j){var te=L.appendFrame(T,g,W,U,z);if(te)if(te.missing)this.aacOverFlow=te;else{W+=te.length,z++;continue}}break}else W++},S.parseMPEGPES=function(_){var y=_.data,T=y.length,k=0,g=0,F=_.pts;if(F===void 0){o.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;g<T;)if(M.isHeader(y,g)){var P=M.appendFrame(this._audioTrack,y,g,F,k);if(P)g+=P.length,k++;else break}else g++},S.parseID3PES=function(_){if(_.pts===void 0){o.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},m}();a.minProbeByteLength=188;function t(m,S,C,_){return{key:m,frame:!1,pts:S,dts:C,units:[],debug:_,length:0}}function r(m,S){return(m[S+10]&31)<<8|m[S+11]}function s(m,S,C,_){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},T=(m[S+1]&15)<<8|m[S+2],k=S+3+T-4,g=(m[S+10]&15)<<8|m[S+11];for(S+=12+g;S<k;){var F=(m[S+1]&31)<<8|m[S+2];switch(m[S]){case 207:if(!_){o.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=F);break;case 21:y.id3===-1&&(y.id3=F);break;case 219:if(!_){o.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=F);break;case 3:case 4:C?y.audio===-1&&(y.audio=F,y.isAAC=!1):o.logger.log("MPEG audio found, not supported in this browser");break;case 36:o.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((m[S+3]&15)<<8|m[S+4])+5}return y}function u(m){var S=0,C,_,y,T,k,g=m.data;if(!m||m.size===0)return null;for(;g[0].length<19&&g.length>1;){var F=new Uint8Array(g[0].length+g[1].length);F.set(g[0]),F.set(g[1],g[0].length),g[0]=F,g.splice(1,1)}C=g[0];var P=(C[0]<<16)+(C[1]<<8)+C[2];if(P===1){if(_=(C[4]<<8)+C[5],_&&_>m.size-6)return null;var N=C[7];N&192&&(T=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,N&64?(k=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,T-k>60*9e4&&(o.logger.warn(Math.round((T-k)/9e4)+"s delta between PTS and DTS, align them"),T=k)):k=T),y=C[8];var W=y+9;if(m.size<=W)return null;m.size-=W;for(var j=new Uint8Array(m.size),A=0,K=g.length;A<K;A++){C=g[A];var U=C.byteLength;if(W)if(W>U){W-=U;continue}else C=C.subarray(W),U-=W,W=0;j.set(C,S),S+=U}return _&&(_-=y+3),{data:j,pts:T,dts:k,len:_}}return null}function f(m,S){if(m.units.length&&m.frame){if(m.pts===void 0){var C=S.samples,_=C.length;if(_){var y=C[_-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 _=C-1;_>=0;_--)if(S.pts<m[_].pts){m.splice(_,0,S);break}}else m.push(S)}function v(m){for(var S=m.byteLength,C=[],_=1;_<S-2;)m[_]===0&&m[_+1]===0&&m[_+2]===3?(C.push(_+2),_+=2):_++;if(C.length===0)return m;var y=S-C.length,T=new Uint8Array(y),k=0;for(_=0;_<y;k++,_++)k===C[0]&&(k++,C.shift()),T[_]=m[k];return T}R.default=a},"./src/errors.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"ErrorTypes",function(){return L}),I.d(R,"ErrorDetails",function(){return M});var L;(function(p){p.NETWORK_ERROR="networkError",p.MEDIA_ERROR="mediaError",p.KEY_SYSTEM_ERROR="keySystemError",p.MUX_ERROR="muxError",p.OTHER_ERROR="otherError"})(L||(L={}));var M;(function(p){p.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",p.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",p.KEY_SYSTEM_NO_SESSION="keySystemNoSession",p.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",p.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",p.MANIFEST_LOAD_ERROR="manifestLoadError",p.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",p.MANIFEST_PARSING_ERROR="manifestParsingError",p.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",p.LEVEL_EMPTY_ERROR="levelEmptyError",p.LEVEL_LOAD_ERROR="levelLoadError",p.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",p.LEVEL_SWITCH_ERROR="levelSwitchError",p.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",p.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",p.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",p.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",p.FRAG_LOAD_ERROR="fragLoadError",p.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",p.FRAG_DECRYPT_ERROR="fragDecryptError",p.FRAG_PARSING_ERROR="fragParsingError",p.REMUX_ALLOC_ERROR="remuxAllocError",p.KEY_LOAD_ERROR="keyLoadError",p.KEY_LOAD_TIMEOUT="keyLoadTimeOut",p.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",p.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",p.BUFFER_APPEND_ERROR="bufferAppendError",p.BUFFER_APPENDING_ERROR="bufferAppendingError",p.BUFFER_STALLED_ERROR="bufferStalledError",p.BUFFER_FULL_ERROR="bufferFullError",p.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",p.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",p.INTERNAL_EXCEPTION="internalException",p.INTERNAL_ABORTED="aborted",p.UNKNOWN="unknown"})(M||(M={}))},"./src/events.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"Events",function(){return L});var L;(function(M){M.MEDIA_ATTACHING="hlsMediaAttaching",M.MEDIA_ATTACHED="hlsMediaAttached",M.MEDIA_DETACHING="hlsMediaDetaching",M.MEDIA_DETACHED="hlsMediaDetached",M.BUFFER_RESET="hlsBufferReset",M.BUFFER_CODECS="hlsBufferCodecs",M.BUFFER_CREATED="hlsBufferCreated",M.BUFFER_APPENDING="hlsBufferAppending",M.BUFFER_APPENDED="hlsBufferAppended",M.BUFFER_EOS="hlsBufferEos",M.BUFFER_FLUSHING="hlsBufferFlushing",M.BUFFER_FLUSHED="hlsBufferFlushed",M.MANIFEST_LOADING="hlsManifestLoading",M.MANIFEST_LOADED="hlsManifestLoaded",M.MANIFEST_PARSED="hlsManifestParsed",M.LEVEL_SWITCHING="hlsLevelSwitching",M.LEVEL_SWITCHED="hlsLevelSwitched",M.LEVEL_LOADING="hlsLevelLoading",M.LEVEL_LOADED="hlsLevelLoaded",M.LEVEL_UPDATED="hlsLevelUpdated",M.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",M.LEVELS_UPDATED="hlsLevelsUpdated",M.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",M.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",M.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",M.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",M.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",M.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",M.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",M.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",M.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",M.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",M.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",M.CUES_PARSED="hlsCuesParsed",M.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",M.INIT_PTS_FOUND="hlsInitPtsFound",M.FRAG_LOADING="hlsFragLoading",M.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",M.FRAG_LOADED="hlsFragLoaded",M.FRAG_DECRYPTED="hlsFragDecrypted",M.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",M.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",M.FRAG_PARSING_METADATA="hlsFragParsingMetadata",M.FRAG_PARSED="hlsFragParsed",M.FRAG_BUFFERED="hlsFragBuffered",M.FRAG_CHANGED="hlsFragChanged",M.FPS_DROP="hlsFpsDrop",M.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",M.ERROR="hlsError",M.DESTROYING="hlsDestroying",M.KEY_LOADING="hlsKeyLoading",M.KEY_LOADED="hlsKeyLoaded",M.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",M.BACK_BUFFER_REACHED="hlsBackBufferReached"})(L||(L={}))},"./src/hls.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return m});var L=I("./node_modules/url-toolkit/src/url-toolkit.js"),M=I.n(L),p=I("./src/loader/playlist-loader.ts"),E=I("./src/loader/key-loader.ts"),b=I("./src/controller/id3-track-controller.ts"),i=I("./src/controller/latency-controller.ts"),c=I("./src/controller/level-controller.ts"),o=I("./src/controller/fragment-tracker.ts"),h=I("./src/controller/stream-controller.ts"),n=I("./src/is-supported.ts"),a=I("./src/utils/logger.ts"),t=I("./src/config.ts"),r=I("./node_modules/eventemitter3/index.js"),s=I.n(r),u=I("./src/events.ts"),f=I("./src/errors.ts");function d(S,C){for(var _=0;_<C.length;_++){var y=C[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}function v(S,C,_){return C&&d(S.prototype,C),_&&d(S,_),S}var m=function(){S.isSupported=function(){return Object(n.isSupported)()};function S(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new r.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var y=this.config=Object(t.mergeConfig)(S.DefaultConfig,_);this.userConfig=_,Object(a.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(t.enableStreamingMode)(y);var T=y.abrController,k=y.bufferController,g=y.capLevelController,F=y.fpsController,P=this.abrController=new T(this),N=this.bufferController=new k(this),W=this.capLevelController=new g(this),j=new F(this),A=new p.default(this),K=new E.default(this),U=new b.default(this),O=this.levelController=new c.default(this),z=new o.FragmentTracker(this),te=this.streamController=new h.default(this,z);W.setStreamController(te),j.setStreamController(te);var de=[O,te];this.networkControllers=de;var be=[A,K,P,N,W,j,U,z];this.audioTrackController=this.createController(y.audioTrackController,null,de),this.createController(y.audioStreamController,z,de),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,de),this.createController(y.subtitleStreamController,z,de),this.createController(y.timelineController,null,be),this.emeController=this.createController(y.emeController,null,be),this.cmcdController=this.createController(y.cmcdController,null,be),this.latencyController=this.createController(i.default,null,be),this.coreComponents=be}var C=S.prototype;return C.createController=function(y,T,k){if(y){var g=T?new y(this,T):new y(this);return k&&k.push(g),g}return null},C.on=function(y,T,k){k===void 0&&(k=this),this._emitter.on(y,T,k)},C.once=function(y,T,k){k===void 0&&(k=this),this._emitter.once(y,T,k)},C.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},C.off=function(y,T,k,g){k===void 0&&(k=this),this._emitter.off(y,T,k,g)},C.listeners=function(y){return this._emitter.listeners(y)},C.emit=function(y,T,k){return this._emitter.emit(y,T,k)},C.trigger=function(y,T){if(this.config.debug)return this.emit(y,y,T);try{return this.emit(y,y,T)}catch(k){a.logger.error("An internal error happened while handling event "+y+'. Error message: "'+k.message+'". Here is a stacktrace:',k),this.trigger(u.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:k})}return!1},C.listenerCount=function(y){return this._emitter.listenerCount(y)},C.destroy=function(){a.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},C.attachMedia=function(y){a.logger.log("attachMedia"),this._media=y,this.trigger(u.Events.MEDIA_ATTACHING,{media:y})},C.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},C.loadSource=function(y){this.stopLoad();var T=this.media,k=this.url,g=this.url=L.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});a.logger.log("loadSource:"+g),T&&k&&k!==g&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(T)),this.trigger(u.Events.MANIFEST_LOADING,{url:y})},C.startLoad=function(y){y===void 0&&(y=-1),a.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(T){T.startLoad(y)})},C.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},C.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},C.recoverMediaError=function(){a.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},C.removeLevel=function(y,T){T===void 0&&(T=0),this.levelController.removeLevel(y,T)},v(S,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){a.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){a.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){a.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){a.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){a.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var T=!!y;T!==this.config.capLevelToPlayerSize&&(T?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=T)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(a.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,T=this.config.minAutoBitrate;if(!y)return 0;for(var k=y.length,g=0;g<k;g++)if(y[g].maxBitrate>T)return g;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,T=this.autoLevelCapping,k;return T===-1&&y&&y.length?k=y.length-1:k=T,k}},{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 u.Events}},{key:"ErrorTypes",get:function(){return f.ErrorTypes}},{key:"ErrorDetails",get:function(){return f.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(G,R,I){"use strict";I.r(R),I.d(R,"isSupported",function(){return p}),I.d(R,"changeTypeSupported",function(){return E});var L=I("./src/utils/mediasource-helper.ts");function M(){return self.SourceBuffer||self.WebKitSourceBuffer}function p(){var b=Object(L.getMediaSource)();if(!b)return!1;var i=M(),c=b&&typeof b.isTypeSupported=="function"&&b.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!i||i.prototype&&typeof i.prototype.appendBuffer=="function"&&typeof i.prototype.remove=="function";return!!c&&!!o}function E(){var b,i=M();return typeof(i==null||((b=i.prototype)===null||b===void 0)?void 0:b.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return a}),I.d(R,"LoadError",function(){return r});var L=I("./src/polyfills/number.ts"),M=I("./src/errors.ts");function p(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,o(s,u)}function E(s){var u=typeof Map=="function"?new Map:void 0;return E=function(d){if(d===null||!c(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(d))return u.get(d);u.set(d,v)}function v(){return b(d,arguments,h(this).constructor)}return v.prototype=Object.create(d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),o(v,d)},E(s)}function b(s,u,f){return i()?b=Reflect.construct:b=function(v,m,S){var C=[null];C.push.apply(C,m);var _=Function.bind.apply(v,C),y=new _;return S&&o(y,S.prototype),y},b.apply(null,arguments)}function i(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function c(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function o(s,u){return o=Object.setPrototypeOf||function(d,v){return d.__proto__=v,d},o(s,u)}function h(s){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},h(s)}var n=Math.pow(2,17),a=function(){function s(f){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=f}var u=s.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(d,v){var m=this,S=d.url;if(!S)return Promise.reject(new r({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,_=C.fLoader,y=C.loader;return new Promise(function(T,k){m.loader&&m.loader.destroy();var g=m.loader=d.loader=_?new _(C):new y(C),F=t(d),P={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:n};d.stats=g.stats,g.load(F,P,{onSuccess:function(W,j,A,K){m.resetLoader(d,g),T({frag:d,part:null,payload:W.data,networkDetails:K})},onError:function(W,j,A){m.resetLoader(d,g),k(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:W,networkDetails:A}))},onAbort:function(W,j,A){m.resetLoader(d,g),k(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:A}))},onTimeout:function(W,j,A){m.resetLoader(d,g),k(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:A}))},onProgress:function(W,j,A,K){v&&v({frag:d,part:null,payload:A,networkDetails:K})}})})},u.loadPart=function(d,v,m){var S=this;this.abort();var C=this.config,_=C.fLoader,y=C.loader;return new Promise(function(T,k){S.loader&&S.loader.destroy();var g=S.loader=d.loader=_?new _(C):new y(C),F=t(d,v),P={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:n};v.stats=g.stats,g.load(F,P,{onSuccess:function(W,j,A,K){S.resetLoader(d,g),S.updateStatsFromPart(d,v);var U={frag:d,part:v,payload:W.data,networkDetails:K};m(U),T(U)},onError:function(W,j,A){S.resetLoader(d,g),k(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:v,response:W,networkDetails:A}))},onAbort:function(W,j,A){d.stats.aborted=v.stats.aborted,S.resetLoader(d,g),k(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:v,networkDetails:A}))},onTimeout:function(W,j,A){S.resetLoader(d,g),k(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:v,networkDetails:A}))}})})},u.updateStatsFromPart=function(d,v){var m=d.stats,S=v.stats,C=S.total;if(m.loaded+=S.loaded,C){var _=Math.round(d.duration/v.duration),y=Math.min(Math.round(m.loaded/C),_),T=_-y,k=T*Math.round(m.loaded/y);m.total=m.loaded+k}else m.total=Math.max(m.loaded,m.total);var g=m.loading,F=S.loading;g.start?g.first+=F.first-F.start:(g.start=F.start,g.first=F.first),g.end=F.end},u.resetLoader=function(d,v){d.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},s}();function t(s,u){u===void 0&&(u=null);var f=u||s,d={frag:s,part:u,responseType:"arraybuffer",url:f.url,headers:{},rangeStart:0,rangeEnd:0},v=f.byteRangeStartOffset,m=f.byteRangeEndOffset;return Object(L.isFiniteNumber)(v)&&Object(L.isFiniteNumber)(m)&&(d.rangeStart=v,d.rangeEnd=m),d}var r=function(s){p(u,s);function u(f){for(var d,v=arguments.length,m=new Array(v>1?v-1:0),S=1;S<v;S++)m[S-1]=arguments[S];return d=s.call.apply(s,[this].concat(m))||this,d.data=void 0,d.data=f,d}return u}(E(Error))},"./src/loader/fragment.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"ElementaryStreamTypes",function(){return a}),I.d(R,"BaseSegment",function(){return t}),I.d(R,"Fragment",function(){return r}),I.d(R,"Part",function(){return s});var L=I("./src/polyfills/number.ts"),M=I("./node_modules/url-toolkit/src/url-toolkit.js"),p=I.n(M),E=I("./src/utils/logger.ts"),b=I("./src/loader/level-key.ts"),i=I("./src/loader/load-stats.ts");function c(u,f){u.prototype=Object.create(f.prototype),u.prototype.constructor=u,o(u,f)}function o(u,f){return o=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},o(u,f)}function h(u,f){for(var d=0;d<f.length;d++){var v=f[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(u,v.key,v)}}function n(u,f,d){return f&&h(u.prototype,f),d&&h(u,d),u}var a;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(a||(a={}));var t=function(){function u(d){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[a.AUDIO]=null,v[a.VIDEO]=null,v[a.AUDIOVIDEO]=null,v),this.baseurl=d}var f=u.prototype;return f.setByteRange=function(v,m){var S=v.split("@",2),C=[];S.length===1?C[0]=m?m.byteRangeEndOffset:0:C[0]=parseInt(S[1]),C[1]=parseInt(S[0])+C[0],this._byteRange=C},n(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(M.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),u}(),r=function(u){c(f,u);function f(v,m){var S;return S=u.call(this,m)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new i.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=v,S}var d=f.prototype;return d.createInitializationVector=function(m){for(var S=new Uint8Array(16),C=12;C<16;C++)S[C]=m>>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=b.LevelKey.fromURI(m.uri),C.method=m.method,C.iv=this.createInitializationVector(S),C.keyFormat="identity"),C},d.setElementaryStreamInfo=function(m,S,C,_,y,T){T===void 0&&(T=!1);var k=this.elementaryStreams,g=k[m];if(!g){k[m]={startPTS:S,endPTS:C,startDTS:_,endDTS:y,partial:T};return}g.startPTS=Math.min(g.startPTS,S),g.endPTS=Math.max(g.endPTS,C),g.startDTS=Math.min(g.startDTS,_),g.endDTS=Math.max(g.endDTS,y)},d.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[a.AUDIO]=null,m[a.VIDEO]=null,m[a.AUDIOVIDEO]=null},n(f,[{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(L.isFiniteNumber)(this.programDateTime))return null;var m=Object(L.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)}}]),f}(t),s=function(u){c(f,u);function f(d,v,m,S,C){var _;_=u.call(this,m)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new i.LoadStats,_.duration=d.decimalFloatingPoint("DURATION"),_.gap=d.bool("GAP"),_.independent=d.bool("INDEPENDENT"),_.relurl=d.enumeratedString("URI"),_.fragment=v,_.index=S;var y=d.enumeratedString("BYTERANGE");return y&&_.setByteRange(y,C),C&&(_.fragOffset=C.fragOffset+C.duration),_}return n(f,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),f}(t)},"./src/loader/key-loader.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return E});var L=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/utils/logger.ts"),E=function(){function b(c){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=c,this._registerListeners()}var i=b.prototype;return i._registerListeners=function(){this.hls.on(L.Events.KEY_LOADING,this.onKeyLoading,this)},i._unregisterListeners=function(){this.hls.off(L.Events.KEY_LOADING,this.onKeyLoading)},i.destroy=function(){this._unregisterListeners();for(var o in this.loaders){var h=this.loaders[o];h&&h.destroy()}this.loaders={}},i.onKeyLoading=function(o,h){var n=h.frag,a=n.type,t=this.loaders[a];if(!n.decryptdata){p.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var r=n.decryptdata.uri;if(r!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(t&&(p.logger.warn("abort previous key loader for type:"+a),t.abort()),!r){p.logger.warn("key uri is falsy");return}var u=s.loader,f=n.loader=this.loaders[a]=new u(s);this.decrypturl=r,this.decryptkey=null;var d={url:r,frag:n,responseType:"arraybuffer"},v={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)};f.load(d,v,m)}else this.decryptkey&&(n.decryptdata.key=this.decryptkey,this.hls.trigger(L.Events.KEY_LOADED,{frag:n}))},i.loadsuccess=function(o,h,n){var a=n.frag;if(!a.decryptdata){p.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(o.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(L.Events.KEY_LOADED,{frag:a})},i.loaderror=function(o,h){var n=h.frag,a=n.loader;a&&a.abort(),delete this.loaders[n.type],this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:o})},i.loadtimeout=function(o,h){var n=h.frag,a=n.loader;a&&a.abort(),delete this.loaders[n.type],this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})},b}()},"./src/loader/level-details.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"LevelDetails",function(){return b});var L=I("./src/polyfills/number.ts");function M(i,c){for(var o=0;o<c.length;o++){var h=c[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(i,h.key,h)}}function p(i,c,o){return c&&M(i.prototype,c),o&&M(i,o),i}var E=10,b=function(){function i(o){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=o}var c=i.prototype;return c.reloaded=function(h){if(!h){this.advanced=!0,this.updated=!0;return}var n=this.lastPartSn-h.lastPartSn,a=this.lastPartIndex-h.lastPartIndex;this.updated=this.endSN!==h.endSN||!!a||!!n,this.advanced=this.endSN>h.endSN||n>0||n===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(h.misses*.6):this.misses=h.misses+1,this.availabilityDelay=h.availabilityDelay},p(i,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(L.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||E}},{key:"drift",get:function(){var h=this.driftEndTime-this.driftStartTime;if(h>0){var n=this.driftEnd-this.driftStart;return n*1e3/h}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var h;return(h=this.fragments)!==null&&h!==void 0&&h.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"LevelKey",function(){return b});var L=I("./node_modules/url-toolkit/src/url-toolkit.js"),M=I.n(L);function p(i,c){for(var o=0;o<c.length;o++){var h=c[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(i,h.key,h)}}function E(i,c,o){return c&&p(i.prototype,c),o&&p(i,o),i}var b=function(){i.fromURL=function(o,h){return new i(o,h)},i.fromURI=function(o){return new i(o)};function i(c,o){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,o?this._uri=Object(L.buildAbsoluteURL)(c,o,{alwaysNormalize:!0}):this._uri=c}return E(i,[{key:"uri",get:function(){return this._uri}}]),i}()},"./src/loader/load-stats.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"LoadStats",function(){return L});var L=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return f});var L=I("./src/polyfills/number.ts"),M=I("./node_modules/url-toolkit/src/url-toolkit.js"),p=I.n(M),E=I("./src/loader/fragment.ts"),b=I("./src/loader/level-details.ts"),i=I("./src/loader/level-key.ts"),c=I("./src/utils/attr-list.ts"),o=I("./src/utils/logger.ts"),h=I("./src/utils/codecs.ts"),n=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,t=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),r=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function u(C){var _,y;return s.test((_=(y=M.parseURL(C))===null||y===void 0?void 0:y.path)!=null?_:"")}var f=function(){function C(){}return C.findGroup=function(y,T){for(var k=0;k<y.length;k++){var g=y[k];if(g.id===T)return g}},C.convertAVC1ToAVCOTI=function(y){var T=y.split(".");if(T.length>2){var k=T.shift()+".";return k+=parseInt(T.shift()).toString(16),k+=("000"+parseInt(T.shift()).toString(16)).substr(-4),k}return y},C.resolve=function(y,T){return M.buildAbsoluteURL(T,y,{alwaysNormalize:!0})},C.parseMasterPlaylist=function(y,T){var k=[],g={},F=!1;n.lastIndex=0;for(var P;(P=n.exec(y))!=null;)if(P[1]){var N=new c.AttrList(P[1]),W={attrs:N,bitrate:N.decimalInteger("AVERAGE-BANDWIDTH")||N.decimalInteger("BANDWIDTH"),name:N.NAME,url:C.resolve(P[2],T)},j=N.decimalResolution("RESOLUTION");j&&(W.width=j.width,W.height=j.height),d((N.CODECS||"").split(/[ ,]+/).filter(function(K){return K}),W),W.videoCodec&&W.videoCodec.indexOf("avc1")!==-1&&(W.videoCodec=C.convertAVC1ToAVCOTI(W.videoCodec)),k.push(W)}else if(P[3]){var A=new c.AttrList(P[3]);A["DATA-ID"]&&(F=!0,g[A["DATA-ID"]]=A)}return{levels:k,sessionData:F?g:null}},C.parseMasterPlaylistMedia=function(y,T,k,g){g===void 0&&(g=[]);var F,P=[],N=0;for(a.lastIndex=0;(F=a.exec(y))!==null;){var W=new c.AttrList(F[1]);if(W.TYPE===k){var j={attrs:W,bitrate:0,id:N++,groupId:W["GROUP-ID"],instreamId:W["INSTREAM-ID"],name:W.NAME||W.LANGUAGE||"",type:k,default:W.bool("DEFAULT"),autoselect:W.bool("AUTOSELECT"),forced:W.bool("FORCED"),lang:W.LANGUAGE,url:W.URI?C.resolve(W.URI,T):""};if(g.length){var A=C.findGroup(g,j.groupId)||g[0];v(j,A,"audioCodec"),v(j,A,"textCodec")}P.push(j)}}return P},C.parseLevelPlaylist=function(y,T,k,g,F){var P=new b.LevelDetails(T),N=P.fragments,W=null,j=0,A=0,K=0,U=0,O=null,z=new E.Fragment(g,T),te,de,be,je=-1,Ne=!1;for(t.lastIndex=0,P.m3u8=y;(te=t.exec(y))!==null;){Ne&&(Ne=!1,z=new E.Fragment(g,T),z.start=K,z.sn=j,z.cc=U,z.level=k,W&&(z.initSegment=W,z.rawProgramDateTime=W.rawProgramDateTime));var Oe=te[1];if(Oe){z.duration=parseFloat(Oe);var Ke=(" "+te[2]).slice(1);z.title=Ke||null,z.tagList.push(Ke?["INF",Oe,Ke]:["INF",Oe])}else if(te[3])Object(L.isFiniteNumber)(z.duration)&&(z.start=K,be&&(z.levelkey=be),z.sn=j,z.level=k,z.cc=U,z.urlId=F,N.push(z),z.relurl=(" "+te[3]).slice(1),S(z,O),O=z,K+=z.duration,j++,A=0,Ne=!0);else if(te[4]){var We=(" "+te[4]).slice(1);O?z.setByteRange(We,O):z.setByteRange(We)}else if(te[5])z.rawProgramDateTime=(" "+te[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),je===-1&&(je=N.length);else{if(te=te[0].match(r),!te){o.logger.warn("No matches on slow regex match for level playlist!");continue}for(de=1;de<te.length&&!(typeof te[de]!="undefined");de++);var Te=(" "+te[de]).slice(1),we=(" "+te[de+1]).slice(1),ue=te[de+2]?(" "+te[de+2]).slice(1):"";switch(Te){case"PLAYLIST-TYPE":P.type=we.toUpperCase();break;case"MEDIA-SEQUENCE":j=P.startSN=parseInt(we);break;case"SKIP":{var Ae=new c.AttrList(we),ge=Ae.decimalInteger("SKIPPED-SEGMENTS");if(Object(L.isFiniteNumber)(ge)){P.skippedSegments=ge;for(var Ve=ge;Ve--;)N.unshift(null);j+=ge}var Qe=Ae.enumeratedString("RECENTLY-REMOVED-DATERANGES");Qe&&(P.recentlyRemovedDateranges=Qe.split(" "));break}case"TARGETDURATION":P.targetduration=parseFloat(we);break;case"VERSION":P.version=parseInt(we);break;case"EXTM3U":break;case"ENDLIST":P.live=!1;break;case"#":(we||ue)&&z.tagList.push(ue?[we,ue]:[we]);break;case"DIS":U++;case"GAP":z.tagList.push([Te]);break;case"BITRATE":z.tagList.push([Te,we]);break;case"DISCONTINUITY-SEQ":U=parseInt(we);break;case"KEY":{var ze,qe=new c.AttrList(we),Je=qe.enumeratedString("METHOD"),pe=qe.URI,ve=qe.hexadecimalInteger("IV"),xe=qe.enumeratedString("KEYFORMATVERSIONS"),Se=qe.enumeratedString("KEYID"),Le=(ze=qe.enumeratedString("KEYFORMAT"))!=null?ze:"identity",ne=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ne.indexOf(Le)>-1){o.logger.warn("Keyformat "+Le+" is not supported from the manifest");continue}else if(Le!=="identity")continue;Je&&(be=i.LevelKey.fromURL(T,pe),pe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Je)>=0&&(be.method=Je,be.keyFormat=Le,Se&&(be.keyID=Se),xe&&(be.keyFormatVersions=xe),be.iv=ve));break}case"START":{var ye=new c.AttrList(we),se=ye.decimalFloatingPoint("TIME-OFFSET");Object(L.isFiniteNumber)(se)&&(P.startTimeOffset=se);break}case"MAP":{var Pe=new c.AttrList(we);z.relurl=Pe.URI,Pe.BYTERANGE&&z.setByteRange(Pe.BYTERANGE),z.level=k,z.sn="initSegment",be&&(z.levelkey=be),z.initSegment=null,W=z,Ne=!0;break}case"SERVER-CONTROL":{var Ze=new c.AttrList(we);P.canBlockReload=Ze.bool("CAN-BLOCK-RELOAD"),P.canSkipUntil=Ze.optionalFloat("CAN-SKIP-UNTIL",0),P.canSkipDateRanges=P.canSkipUntil>0&&Ze.bool("CAN-SKIP-DATERANGES"),P.partHoldBack=Ze.optionalFloat("PART-HOLD-BACK",0),P.holdBack=Ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var et=new c.AttrList(we);P.partTarget=et.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ge=P.partList;Ge||(Ge=P.partList=[]);var ht=A>0?Ge[Ge.length-1]:void 0,ce=A++,Me=new E.Part(new c.AttrList(we),z,T,ce,ht);Ge.push(Me),z.duration+=Me.duration;break}case"PRELOAD-HINT":{var Fe=new c.AttrList(we);P.preloadHint=Fe;break}case"RENDITION-REPORT":{var Ce=new c.AttrList(we);P.renditionReports=P.renditionReports||[],P.renditionReports.push(Ce);break}default:o.logger.warn("line parsed but not handled: "+te);break}}}O&&!O.relurl?(N.pop(),K-=O.duration,P.partList&&(P.fragmentHint=O)):P.partList&&(S(z,O),z.cc=U,P.fragmentHint=z);var _e=N.length,Ee=N[0],ee=N[_e-1];if(K+=P.skippedSegments*P.targetduration,K>0&&_e&&ee){P.averagetargetduration=K/_e;var oe=ee.sn;P.endSN=oe!=="initSegment"?oe:0,Ee&&(P.startCC=Ee.cc,Ee.initSegment||P.fragments.every(function(q){return q.relurl&&u(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(g,T),z.relurl=ee.relurl,z.level=k,z.sn="initSegment",Ee.initSegment=z,P.needSidxRanges=!0))}else P.endSN=0,P.startCC=0;return P.fragmentHint&&(K+=P.fragmentHint.duration),P.totalduration=K,P.endCC=U,je>0&&m(N,je),P},C}();function d(C,_){["video","audio","text"].forEach(function(y){var T=C.filter(function(g){return Object(h.isCodecType)(g,y)});if(T.length){var k=T.filter(function(g){return g.lastIndexOf("avc1",0)===0||g.lastIndexOf("mp4a",0)===0});_[y+"Codec"]=k.length>0?k[0]:T[0],C=C.filter(function(g){return T.indexOf(g)===-1})}}),_.unknownCodecs=C}function v(C,_,y){var T=_[y];T&&(C[y]=T)}function m(C,_){for(var y=C[_],T=_;T--;){var k=C[T];if(!k)return;k.programDateTime=y.programDateTime-k.duration*1e3,y=k}}function S(C,_){C.rawProgramDateTime?C.programDateTime=Date.parse(C.rawProgramDateTime):_!=null&&_.programDateTime&&(C.programDateTime=_.endProgramDateTime),Object(L.isFiniteNumber)(C.programDateTime)||(C.programDateTime=null,C.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),p=I("./src/errors.ts"),E=I("./src/utils/logger.ts"),b=I("./src/utils/mp4-tools.ts"),i=I("./src/loader/m3u8-parser.ts"),c=I("./src/types/loader.ts"),o=I("./src/utils/attr-list.ts");function h(t){var r=t.type;switch(r){case c.PlaylistContextType.AUDIO_TRACK:return c.PlaylistLevelType.AUDIO;case c.PlaylistContextType.SUBTITLE_TRACK:return c.PlaylistLevelType.SUBTITLE;default:return c.PlaylistLevelType.MAIN}}function n(t,r){var s=t.url;return(s===void 0||s.indexOf("data:")===0)&&(s=r.url),s}var a=function(){function t(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var r=t.prototype;return r.registerListeners=function(){var u=this.hls;u.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.unregisterListeners=function(){var u=this.hls;u.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.createInternalLoader=function(u){var f=this.hls.config,d=f.pLoader,v=f.loader,m=d||v,S=new m(f);return u.loader=S,this.loaders[u.type]=S,S},r.getInternalLoader=function(u){return this.loaders[u.type]},r.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},r.destroyInternalLoaders=function(){for(var u in this.loaders){var f=this.loaders[u];f&&f.destroy(),this.resetInternalLoader(u)}},r.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},r.onManifestLoading=function(u,f){var d=f.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:c.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},r.onLevelLoading=function(u,f){var d=f.id,v=f.level,m=f.url,S=f.deliveryDirectives;this.load({id:d,groupId:null,level:v,responseType:"text",type:c.PlaylistContextType.LEVEL,url:m,deliveryDirectives:S})},r.onAudioTrackLoading=function(u,f){var d=f.id,v=f.groupId,m=f.url,S=f.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:c.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:S})},r.onSubtitleTrackLoading=function(u,f){var d=f.id,v=f.groupId,m=f.url,S=f.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:c.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:S})},r.load=function(u){var f,d=this.hls.config,v=this.getInternalLoader(u);if(v){var m=v.context;if(m&&m.url===u.url){E.logger.trace("[playlist-loader]: playlist request ongoing");return}E.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),v.abort()}var S,C,_,y;switch(u.type){case c.PlaylistContextType.MANIFEST:S=d.manifestLoadingMaxRetry,C=d.manifestLoadingTimeOut,_=d.manifestLoadingRetryDelay,y=d.manifestLoadingMaxRetryTimeout;break;case c.PlaylistContextType.LEVEL:case c.PlaylistContextType.AUDIO_TRACK:case c.PlaylistContextType.SUBTITLE_TRACK:S=0,C=d.levelLoadingTimeOut;break;default:S=d.levelLoadingMaxRetry,C=d.levelLoadingTimeOut,_=d.levelLoadingRetryDelay,y=d.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(u),(f=u.deliveryDirectives)!==null&&f!==void 0&&f.part){var T;if(u.type===c.PlaylistContextType.LEVEL&&u.level!==null?T=this.hls.levels[u.level].details:u.type===c.PlaylistContextType.AUDIO_TRACK&&u.id!==null?T=this.hls.audioTracks[u.id].details:u.type===c.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(T=this.hls.subtitleTracks[u.id].details),T){var k=T.partTarget,g=T.targetduration;k&&g&&(C=Math.min(Math.max(k*3,g*.8)*1e3,C))}}var F={timeout:C,maxRetry:S,retryDelay:_,maxRetryDelay:y,highWaterMark:0},P={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(u,F,P)},r.loadsuccess=function(u,f,d,v){if(v===void 0&&(v=null),d.isSidxRequest){this.handleSidxRequest(u,d),this.handlePlaylistLoaded(u,f,d,v);return}this.resetInternalLoader(d.type);var m=u.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,d,"no EXTM3U delimiter",v);return}f.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,f,d,v):this.handleMasterPlaylist(u,f,d,v)},r.loaderror=function(u,f,d){d===void 0&&(d=null),this.handleNetworkError(f,d,!1,u)},r.loadtimeout=function(u,f,d){d===void 0&&(d=null),this.handleNetworkError(f,d,!0)},r.handleMasterPlaylist=function(u,f,d,v){var m=this.hls,S=u.data,C=n(u,d),_=i.default.parseMasterPlaylist(S,C),y=_.levels,T=_.sessionData;if(!y.length){this.handleManifestParsingError(u,d,"no level found in manifest",v);return}var k=y.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),g=y.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),F=i.default.parseMasterPlaylistMedia(S,C,"AUDIO",k),P=i.default.parseMasterPlaylistMedia(S,C,"SUBTITLES",g),N=i.default.parseMasterPlaylistMedia(S,C,"CLOSED-CAPTIONS");if(F.length){var W=F.some(function(j){return!j.url});!W&&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"),F.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:F,subtitles:P,captions:N,url:C,stats:f,networkDetails:v,sessionData:T})},r.handleTrackOrLevelPlaylist=function(u,f,d,v){var m=this.hls,S=d.id,C=d.level,_=d.type,y=n(u,d),T=Object(L.isFiniteNumber)(S)?S:0,k=Object(L.isFiniteNumber)(C)?C:T,g=h(d),F=i.default.parseLevelPlaylist(u.data,y,k,g,T);if(!F.fragments.length){m.trigger(M.Events.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.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(_===c.PlaylistContextType.MANIFEST){var P={attrs:new o.AttrList({}),bitrate:0,details:F,name:"",url:y};m.trigger(M.Events.MANIFEST_LOADED,{levels:[P],audioTracks:[],url:y,stats:f,networkDetails:v,sessionData:null})}if(f.parsing.end=performance.now(),F.needSidxRanges){var N,W=(N=F.fragments[0].initSegment)===null||N===void 0?void 0:N.url;this.load({url:W,isSidxRequest:!0,type:_,level:C,levelDetails:F,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=F,this.handlePlaylistLoaded(u,f,d,v)},r.handleSidxRequest=function(u,f){var d=Object(b.parseSegmentIndex)(new Uint8Array(u.data));if(!d)return;var v=d.references,m=f.levelDetails;v.forEach(function(S,C){var _=S.info,y=m.fragments[C];y.byteRange.length===0&&y.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),y.initSegment&&y.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},r.handleManifestParsingError=function(u,f,d,v){this.hls.trigger(M.Events.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:f.type===c.PlaylistContextType.MANIFEST,url:u.url,reason:d,response:u,context:f,networkDetails:v})},r.handleNetworkError=function(u,f,d,v){d===void 0&&(d=!1),E.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var m=p.ErrorDetails.UNKNOWN,S=!1,C=this.getInternalLoader(u);switch(u.type){case c.PlaylistContextType.MANIFEST:m=d?p.ErrorDetails.MANIFEST_LOAD_TIMEOUT:p.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case c.PlaylistContextType.LEVEL:m=d?p.ErrorDetails.LEVEL_LOAD_TIMEOUT:p.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case c.PlaylistContextType.AUDIO_TRACK:m=d?p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case c.PlaylistContextType.SUBTITLE_TRACK:m=d?p.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:p.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}C&&this.resetInternalLoader(u.type);var _={type:p.ErrorTypes.NETWORK_ERROR,details:m,fatal:S,url:u.url,loader:C,context:u,networkDetails:f};v&&(_.response=v),this.hls.trigger(M.Events.ERROR,_)},r.handlePlaylistLoaded=function(u,f,d,v){var m=d.type,S=d.level,C=d.id,_=d.groupId,y=d.loader,T=d.levelDetails,k=d.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(u,d,"invalid target duration",v);return}if(!y)return;T.live&&(y.getCacheAge&&(T.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(m){case c.PlaylistContextType.MANIFEST:case c.PlaylistContextType.LEVEL:this.hls.trigger(M.Events.LEVEL_LOADED,{details:T,level:S||0,id:C||0,stats:f,networkDetails:v,deliveryDirectives:k});break;case c.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,{details:T,id:C||0,groupId:_||"",stats:f,networkDetails:v,deliveryDirectives:k});break;case c.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(M.Events.SUBTITLE_TRACK_LOADED,{details:T,id:C||0,groupId:_||"",stats:f,networkDetails:v,deliveryDirectives:k});break}},t}();R.default=a},"./src/polyfills/number.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"isFiniteNumber",function(){return L}),I.d(R,"MAX_SAFE_INTEGER",function(){return M});var L=Number.isFinite||function(p){return typeof p=="number"&&isFinite(p)},M=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(G,R,I){"use strict";I.r(R);var L=function(){function M(){}return M.getSilentFrame=function(E,b){switch(E){case"mp4a.40.2":if(b===1)return new Uint8Array([0,200,0,128,35,128]);if(b===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(b===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(b===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(b===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(b===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(b===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(b===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(b===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}();R.default=L},"./src/remux/mp4-generator.ts":function(G,R,I){"use strict";I.r(R);var L=Math.pow(2,32)-1,M=function(){function p(){}return p.init=function(){p.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 b;for(b in p.types)p.types.hasOwnProperty(b)&&(p.types[b]=[b.charCodeAt(0),b.charCodeAt(1),b.charCodeAt(2),b.charCodeAt(3)]);var i=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]),c=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]);p.HDLR_TYPES={video:i,audio:c};var o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h=new Uint8Array([0,0,0,0,0,0,0,0]);p.STTS=p.STSC=p.STCO=h,p.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),p.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),p.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),p.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var n=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),t=new Uint8Array([0,0,0,1]);p.FTYP=p.box(p.types.ftyp,n,t,n,a),p.DINF=p.box(p.types.dinf,p.box(p.types.dref,o))},p.box=function(b){for(var i=8,c=arguments.length,o=new Array(c>1?c-1:0),h=1;h<c;h++)o[h-1]=arguments[h];for(var n=o.length,a=n;n--;)i+=o[n].byteLength;var t=new Uint8Array(i);for(t[0]=i>>24&255,t[1]=i>>16&255,t[2]=i>>8&255,t[3]=i&255,t.set(b,4),n=0,i=8;n<a;n++)t.set(o[n],i),i+=o[n].byteLength;return t},p.hdlr=function(b){return p.box(p.types.hdlr,p.HDLR_TYPES[b])},p.mdat=function(b){return p.box(p.types.mdat,b)},p.mdhd=function(b,i){i*=b;var c=Math.floor(i/(L+1)),o=Math.floor(i%(L+1));return p.box(p.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,b&255,c>>24,c>>16&255,c>>8&255,c&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))},p.mdia=function(b){return p.box(p.types.mdia,p.mdhd(b.timescale,b.duration),p.hdlr(b.type),p.minf(b))},p.mfhd=function(b){return p.box(p.types.mfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255]))},p.minf=function(b){return b.type==="audio"?p.box(p.types.minf,p.box(p.types.smhd,p.SMHD),p.DINF,p.stbl(b)):p.box(p.types.minf,p.box(p.types.vmhd,p.VMHD),p.DINF,p.stbl(b))},p.moof=function(b,i,c){return p.box(p.types.moof,p.mfhd(b),p.traf(c,i))},p.moov=function(b){for(var i=b.length,c=[];i--;)c[i]=p.trak(b[i]);return p.box.apply(null,[p.types.moov,p.mvhd(b[0].timescale,b[0].duration)].concat(c).concat(p.mvex(b)))},p.mvex=function(b){for(var i=b.length,c=[];i--;)c[i]=p.trex(b[i]);return p.box.apply(null,[p.types.mvex].concat(c))},p.mvhd=function(b,i){i*=b;var c=Math.floor(i/(L+1)),o=Math.floor(i%(L+1)),h=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,b&255,c>>24,c>>16&255,c>>8&255,c&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 p.box(p.types.mvhd,h)},p.sdtp=function(b){var i=b.samples||[],c=new Uint8Array(4+i.length),o,h;for(o=0;o<i.length;o++)h=i[o].flags,c[o+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return p.box(p.types.sdtp,c)},p.stbl=function(b){return p.box(p.types.stbl,p.stsd(b),p.box(p.types.stts,p.STTS),p.box(p.types.stsc,p.STSC),p.box(p.types.stsz,p.STSZ),p.box(p.types.stco,p.STCO))},p.avc1=function(b){var i=[],c=[],o,h,n;for(o=0;o<b.sps.length;o++)h=b.sps[o],n=h.byteLength,i.push(n>>>8&255),i.push(n&255),i=i.concat(Array.prototype.slice.call(h));for(o=0;o<b.pps.length;o++)h=b.pps[o],n=h.byteLength,c.push(n>>>8&255),c.push(n&255),c=c.concat(Array.prototype.slice.call(h));var a=p.box(p.types.avcC,new Uint8Array([1,i[3],i[4],i[5],252|3,224|b.sps.length].concat(i).concat([b.pps.length]).concat(c))),t=b.width,r=b.height,s=b.pixelRatio[0],u=b.pixelRatio[1];return p.box(p.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,r>>8&255,r&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]),a,p.box(p.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),p.box(p.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,u>>24,u>>16&255,u>>8&255,u&255])))},p.esds=function(b){var i=b.config.length;return new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(b.config).concat([6,1,2]))},p.mp4a=function(b){var i=b.samplerate;return p.box(p.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]),p.box(p.types.esds,p.esds(b)))},p.mp3=function(b){var i=b.samplerate;return p.box(p.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]))},p.stsd=function(b){return b.type==="audio"?!b.isAAC&&b.codec==="mp3"?p.box(p.types.stsd,p.STSD,p.mp3(b)):p.box(p.types.stsd,p.STSD,p.mp4a(b)):p.box(p.types.stsd,p.STSD,p.avc1(b))},p.tkhd=function(b){var i=b.id,c=b.duration*b.timescale,o=b.width,h=b.height,n=Math.floor(c/(L+1)),a=Math.floor(c%(L+1));return p.box(p.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,a>>24,a>>16&255,a>>8&255,a&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,h>>8&255,h&255,0,0]))},p.traf=function(b,i){var c=p.sdtp(b),o=b.id,h=Math.floor(i/(L+1)),n=Math.floor(i%(L+1));return p.box(p.types.traf,p.box(p.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),p.box(p.types.tfdt,new Uint8Array([1,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,n>>24,n>>16&255,n>>8&255,n&255])),p.trun(b,c.length+16+20+8+16+8+8),c)},p.trak=function(b){return b.duration=b.duration||4294967295,p.box(p.types.trak,p.tkhd(b),p.mdia(b))},p.trex=function(b){var i=b.id;return p.box(p.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},p.trun=function(b,i){var c=b.samples||[],o=c.length,h=12+16*o,n=new Uint8Array(h),a,t,r,s,u,f;for(i+=8+h,n.set([0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),a=0;a<o;a++)t=c[a],r=t.duration,s=t.size,u=t.flags,f=t.cts,n.set([r>>>24&255,r>>>16&255,r>>>8&255,r&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,f>>>24&255,f>>>16&255,f>>>8&255,f&255],12+16*a);return p.box(p.types.trun,n)},p.initSegment=function(b){p.types||p.init();var i=p.moov(b),c=new Uint8Array(p.FTYP.byteLength+i.byteLength);return c.set(p.FTYP),c.set(i,p.FTYP.byteLength),c},p}();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,R.default=M},"./src/remux/mp4-remuxer.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return f}),I.d(R,"normalizePts",function(){return d});var L=I("./src/polyfills/number.ts"),M=I("./src/remux/aac-helper.ts"),p=I("./src/remux/mp4-generator.ts"),E=I("./src/events.ts"),b=I("./src/errors.ts"),i=I("./src/utils/logger.ts"),c=I("./src/types/loader.ts"),o=I("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign||function(C){for(var _=1;_<arguments.length;_++){var y=arguments[_];for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&(C[T]=y[T])}return C},h.apply(this,arguments)}var n=10*1e3,a=1024,t=1152,r=null,s=null,u=!1,f=function(){function C(y,T,k,g){if(g===void 0&&(g=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=y,this.config=T,this.typeSupported=k,this.ISGenerated=!1,r===null){var F=navigator.userAgent||"",P=F.match(/Chrome\/(\d+)/i);r=P?parseInt(P[1]):0}if(s===null){var N=navigator.userAgent.match(/Safari\/(\d+)/i);s=N?parseInt(N[1]):0}u=!!r&&r<75||!!s&&s<600}var _=C.prototype;return _.destroy=function(){},_.resetTimeStamp=function(T){i.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=T},_.resetNextTimestamp=function(){i.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){i.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(T){var k=!1,g=T.reduce(function(F,P){var N=P.pts-F;return N<-4294967296?(k=!0,d(F,P.pts)):N>0?F:P.pts},T[0].pts);return k&&i.logger.debug("PTS rollover detected"),g},_.remux=function(T,k,g,F,P,N,W,j){var A,K,U,O,z,te,de=P,be=P,je=T.pid>-1,Ne=k.pid>-1,Oe=k.samples.length,Ke=T.samples.length>0,We=Oe>1,Te=(!je||Ke)&&(!Ne||We)||this.ISGenerated||W;if(Te){this.ISGenerated||(U=this.generateIS(T,k,P));var we=this.isVideoContiguous,ue=-1;if(We&&(ue=v(k.samples),!we&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,ue>0){i.logger.warn("[mp4-remuxer]: Dropped "+ue+" out of "+Oe+" video samples due to a missing keyframe");var Ae=this.getVideoStartPts(k.samples);k.samples=k.samples.slice(ue),k.dropped+=ue,be+=(k.samples[0].pts-Ae)/(k.timescale||9e4)}else ue===-1&&(i.logger.warn("[mp4-remuxer]: No keyframe found out of "+Oe+" video samples"),te=!1);if(this.ISGenerated){if(Ke&&We){var ge=this.getVideoStartPts(k.samples),Ve=d(T.samples[0].pts,ge)-ge,Qe=Ve/k.inputTimeScale;de+=Math.max(0,Qe),be+=Math.max(0,-Qe)}if(Ke){if(T.samplerate||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(T,k,P)),K=this.remuxAudio(T,de,this.isAudioContiguous,N,Ne||We||j===c.PlaylistLevelType.AUDIO?be:void 0),We){var ze=K?K.endPTS-K.startPTS:0;k.inputTimeScale||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(T,k,P)),A=this.remuxVideo(k,be,we,ze)}}else We&&(A=this.remuxVideo(k,be,we,0));A&&(A.firstKeyFrame=ue,A.independent=ue!==-1)}}return this.ISGenerated&&(g.samples.length&&(z=this.remuxID3(g,P)),F.samples.length&&(O=this.remuxText(F,P))),{audio:K,video:A,initSegment:U,independent:te,text:O,id3:z}},_.generateIS=function(T,k,g){var F=T.samples,P=k.samples,N=this.typeSupported,W={},j=!Object(L.isFiniteNumber)(this._initPTS),A="audio/mp4",K,U,O;if(j&&(K=U=Infinity),T.config&&F.length&&(T.timescale=T.samplerate,T.isAAC||(N.mpeg?(A="audio/mpeg",T.codec=""):N.mp3&&(T.codec="mp3")),W.audio={id:"audio",container:A,codec:T.codec,initSegment:!T.isAAC&&N.mpeg?new Uint8Array(0):p.default.initSegment([T]),metadata:{channelCount:T.channelCount}},j&&(O=T.inputTimeScale,K=U=F[0].pts-Math.round(O*g))),k.sps&&k.pps&&P.length&&(k.timescale=k.inputTimeScale,W.video={id:"main",container:"video/mp4",codec:k.codec,initSegment:p.default.initSegment([k]),metadata:{width:k.width,height:k.height}},j)){O=k.inputTimeScale;var z=this.getVideoStartPts(P),te=Math.round(O*g);U=Math.min(U,d(P[0].dts,z)-te),K=Math.min(K,z-te)}if(Object.keys(W).length)return this.ISGenerated=!0,j&&(this._initPTS=K,this._initDTS=U),{tracks:W,initPTS:K,timescale:O}},_.remuxVideo=function(T,k,g,F){var P=T.inputTimeScale,N=T.samples,W=[],j=N.length,A=this._initPTS,K=this.nextAvcDts,U=8,O,z,te,de=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,je=0,Ne=!1;if(!g||K===null){var Oe=k*P,Ke=N[0].pts-d(N[0].dts,N[0].pts);K=Oe-Ke}for(var We=0;We<j;We++){var Te=N[We];if(Te.pts=d(Te.pts-A,K),Te.dts=d(Te.dts-A,K),Te.dts>Te.pts){var we=9e4*.2;je=Math.max(Math.min(je,Te.pts-Te.dts),-1*we)}Te.dts<N[We>0?We-1:We].dts&&(Ne=!0)}Ne&&N.sort(function(Xe,ot){var tt=Xe.dts-ot.dts,at=Xe.pts-ot.pts;return tt||at}),z=N[0].dts,te=N[N.length-1].dts;var ue=Math.round((te-z)/(j-1));if(je<0){if(je<ue*-2){i.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(o.toMsFromMpegTsClock)(-ue,!0)+" ms");for(var Ae=je,ge=0;ge<j;ge++)N[ge].dts=Ae=Math.max(Ae,N[ge].pts-ue),N[ge].pts=Math.max(Ae,N[ge].pts)}else{i.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(o.toMsFromMpegTsClock)(je,!0)+" ms to overcome this issue");for(var Ve=0;Ve<j;Ve++)N[Ve].dts=N[Ve].dts+je}z=N[0].dts}if(g){var Qe=z-K,ze=Qe>ue,qe=Qe<-1;if(ze||qe){ze?i.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(Qe,!0)+" ms ("+Qe+"dts) hole between fragments detected, filling it"):i.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(-Qe,!0)+" ms ("+Qe+"dts) overlapping between fragments detected"),z=K;var Je=N[0].pts-Qe;N[0].dts=z,N[0].pts=Je,i.logger.log("Video: First PTS/DTS adjusted: "+Object(o.toMsFromMpegTsClock)(Je,!0)+"/"+Object(o.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(o.toMsFromMpegTsClock)(Qe,!0)+" ms")}}u&&(z=Math.max(0,z));for(var pe=0,ve=0,xe=0;xe<j;xe++){for(var Se=N[xe],Le=Se.units,ne=Le.length,ye=0,se=0;se<ne;se++)ye+=Le[se].data.length;ve+=ye,pe+=ne,Se.length=ye,Se.dts=Math.max(Se.dts,z),Se.pts=Math.max(Se.pts,Se.dts,0),de=Math.min(Se.pts,de),be=Math.max(Se.pts,be)}te=N[j-1].dts;var Pe=ve+4*pe+8,Ze;try{Ze=new Uint8Array(Pe)}catch(Xe){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:b.ErrorTypes.MUX_ERROR,details:b.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Pe,reason:"fail allocating video mdat "+Pe});return}var et=new DataView(Ze.buffer);et.setUint32(0,Pe),Ze.set(p.default.types.mdat,4);for(var Ge=0;Ge<j;Ge++){for(var ht=N[Ge],ce=ht.units,Me=0,Fe=0,Ce=ce.length;Fe<Ce;Fe++){var _e=ce[Fe],Ee=_e.data,ee=_e.data.byteLength;et.setUint32(U,ee),U+=4,Ze.set(Ee,U),U+=ee,Me+=4+ee}if(Ge<j-1)O=N[Ge+1].dts-ht.dts;else{var oe=this.config,q=ht.dts-N[Ge>0?Ge-1:Ge].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(oe.maxBufferHole*P),Ie=(F?de+F*P:this.nextAudioPts)-ht.pts;Ie>me?(O=Ie-q,O<0&&(O=q),i.logger.log("[mp4-remuxer]: It is approximately "+Ie/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=q}else O=q}var V=Math.round(ht.pts-ht.dts);W.push(new m(ht.key,O,Me,V))}if(W.length&&r&&r<70){var Re=W[0].flags;Re.dependsOn=2,Re.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=K=te+O,this.isVideoContiguous=!0;var He=p.default.moof(T.sequenceNumber++,z,h({},T,{samples:W})),fe="video",ke={data1:He,data2:Ze,startPTS:de/P,endPTS:(be+O)/P,startDTS:z/P,endDTS:K/P,type:fe,hasAudio:!1,hasVideo:!0,nb:W.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(Ze.length,"MDAT length must not be zero"),ke},_.remuxAudio=function(T,k,g,F,P){var N=T.inputTimeScale,W=T.samplerate?T.samplerate:N,j=N/W,A=T.isAAC?a:t,K=A*j,U=this._initPTS,O=!T.isAAC&&this.typeSupported.mpeg,z=[],te=T.samples,de=O?0:8,be=this.nextAudioPts||-1,je=k*N;if(this.isAudioContiguous=g=g||te.length&&be>0&&(F&&Math.abs(je-be)<9e3||Math.abs(d(te[0].pts-U,je)-be)<20*K),te.forEach(function(Ee){Ee.pts=d(Ee.pts-U,je)}),!g||be<0){if(te=te.filter(function(Ee){return Ee.pts>=0}),!te.length)return;P===0?be=0:F?be=Math.max(0,je):be=te[0].pts}if(T.isAAC)for(var Ne=P!==void 0,Oe=this.config.maxAudioFramesDrift,Ke=0,We=be;Ke<te.length;Ke++){var Te=te[Ke],we=Te.pts,ue=we-We,Ae=Math.abs(1e3*ue/N);if(ue<=-Oe*K&&Ne)Ke===0&&(i.logger.warn("Audio frame @ "+(we/N).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ue/N)+" ms."),this.nextAudioPts=be=We=we);else if(ue>=Oe*K&&Ae<n&&Ne){var ge=Math.round(ue/K);We=we-ge*K,We<0&&(ge--,We+=K),Ke===0&&(this.nextAudioPts=be=We),i.logger.warn("[mp4-remuxer]: Injecting "+ge+" audio frame @ "+(We/N).toFixed(3)+"s due to "+Math.round(1e3*ue/N)+" ms gap.");for(var Ve=0;Ve<ge;Ve++){var Qe=Math.max(We,0),ze=M.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);ze||(i.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ze=Te.unit.subarray()),te.splice(Ke,0,{unit:ze,pts:Qe}),We+=K,Ke++}}Te.pts=We,We+=K}for(var qe=null,Je=null,pe,ve=0,xe=te.length;xe--;)ve+=te[xe].unit.byteLength;for(var Se=0,Le=te.length;Se<Le;Se++){var ne=te[Se],ye=ne.unit,se=ne.pts;if(Je!==null){var Pe=z[Se-1];Pe.duration=Math.round((se-Je)/j)}else if(g&&T.isAAC&&(se=be),qe=se,ve>0){ve+=de;try{pe=new Uint8Array(ve)}catch(Ee){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:b.ErrorTypes.MUX_ERROR,details:b.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ve,reason:"fail allocating audio mdat "+ve});return}if(!O){var Ze=new DataView(pe.buffer);Ze.setUint32(0,ve),pe.set(p.default.types.mdat,4)}}else return;pe.set(ye,de);var et=ye.byteLength;de+=et,z.push(new m(!0,A,et,0)),Je=se}var Ge=z.length;if(!Ge)return;var ht=z[z.length-1];this.nextAudioPts=be=Je+j*ht.duration;var ce=O?new Uint8Array(0):p.default.moof(T.sequenceNumber++,qe/j,h({},T,{samples:z}));T.samples=[];var Me=qe/N,Fe=be/N,Ce="audio",_e={data1:ce,data2:pe,startPTS:Me,endPTS:Fe,startDTS:Me,endDTS:Fe,type:Ce,hasAudio:!0,hasVideo:!1,nb:Ge};return this.isAudioContiguous=!0,console.assert(pe.length,"MDAT length must not be zero"),_e},_.remuxEmptyAudio=function(T,k,g,F){var P=T.inputTimeScale,N=T.samplerate?T.samplerate:P,W=P/N,j=this.nextAudioPts,A=(j!==null?j:F.startDTS*P)+this._initDTS,K=F.endDTS*P+this._initDTS,U=W*a,O=Math.ceil((K-A)/U),z=M.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(i.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){i.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],de=0;de<O;de++){var be=A+de*U;te.push({unit:z,pts:be,dts:be})}return T.samples=te,this.remuxAudio(T,k,g,!1)},_.remuxID3=function(T,k){var g=T.samples.length;if(!g)return;for(var F=T.inputTimeScale,P=this._initPTS,N=this._initDTS,W=0;W<g;W++){var j=T.samples[W];j.pts=d(j.pts-P,k*F)/F,j.dts=d(j.dts-N,k*F)/F}var A=T.samples;return T.samples=[],{samples:A}},_.remuxText=function(T,k){var g=T.samples.length;if(!g)return;for(var F=T.inputTimeScale,P=this._initPTS,N=0;N<g;N++){var W=T.samples[N];W.pts=d(W.pts-P,k*F)/F}T.samples.sort(function(A,K){return A.pts-K.pts});var j=T.samples;return T.samples=[],{samples:j}},C}();function d(C,_){var y;if(_===null)return C;for(_<C?y=-8589934592:y=8589934592;Math.abs(C-_)>4294967296;)C+=y;return C}function v(C){for(var _=0;_<C.length;_++)if(C[_].key)return _;return-1}var m=function(_,y,T,k){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=T,this.cts=k,this.flags=new S(_)},S=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/polyfills/number.ts"),M=I("./src/utils/mp4-tools.ts"),p=I("./src/loader/fragment.ts"),E=I("./src/utils/logger.ts"),b=function(){function o(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var h=o.prototype;return h.destroy=function(){},h.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},h.resetNextTimestamp=function(){this.lastEndDTS=null},h.resetInitSegment=function(a,t,r){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(a),this.emitInitSegment=!0},h.generateInitSegment=function(a){var t=this.audioCodec,r=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(M.parseInitSegment)(a);t||(t=c(s.audio,p.ElementaryStreamTypes.AUDIO)),r||(r=c(s.video,p.ElementaryStreamTypes.VIDEO));var u={};s.audio&&s.video?u.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:a,id:"main"}:s.audio?u.audio={container:"audio/mp4",codec:t,initSegment:a,id:"audio"}:s.video?u.video={container:"video/mp4",codec:r,initSegment:a,id:"main"}:E.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},h.remux=function(a,t,r,s,u){var f=this.initPTS,d=this.lastEndDTS,v={audio:void 0,video:void 0,text:s,id3:r,initSegment:void 0};Object(L.isFiniteNumber)(d)||(d=this.lastEndDTS=u||0);var m=t.samples;if(!m||!m.length)return v;var S={initPTS:void 0,timescale:1},C=this.initData;if((!C||!C.length)&&(this.generateInitSegment(m),C=this.initData),!C||!C.length)return E.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(L.isFiniteNumber)(f)||(this.initPTS=S.initPTS=f=i(C,m,d));var _=Object(M.getDuration)(m,C),y=d,T=_+y;Object(M.offsetStartDTS)(C,m,f),_>0?this.lastEndDTS=T:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var k=!!C.audio,g=!!C.video,F="";k&&(F+="audio"),g&&(F+="video");var P={data1:m,startPTS:y,startDTS:y,endPTS:T,endDTS:T,type:F,hasAudio:k,hasVideo:g,nb:1,dropped:0};return v.audio=P.type==="audio"?P:void 0,v.video=P.type!=="audio"?P:void 0,v.text=s,v.id3=r,v.initSegment=S,v},o}(),i=function(h,n,a){return Object(M.getStartDTS)(h,n)-a};function c(o,h){var n=o==null?void 0:o.codec;return n&&n.length>4?n:n==="hvc1"?"hvc1.1.c.L120.90":n==="av01"?"av01.0.04M.08":n==="avc1"||h===p.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}R.default=b},"./src/task-loop.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return L});var L=function(){function M(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var p=M.prototype;return p.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},p.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},p.onHandlerDestroyed=function(){},p.hasInterval=function(){return!!this._tickInterval},p.hasNextTick=function(){return!!this._tickTimer},p.setInterval=function(b){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,b),!0)},p.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},p.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},p.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},p.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},p.doTick=function(){},M}()},"./src/types/cmcd.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"CMCDVersion",function(){return L}),I.d(R,"CMCDObjectType",function(){return M}),I.d(R,"CMCDStreamingFormat",function(){return p}),I.d(R,"CMCDStreamType",function(){return E});var L=1,M;(function(b){b.MANIFEST="m",b.AUDIO="a",b.VIDEO="v",b.MUXED="av",b.INIT="i",b.CAPTION="c",b.TIMED_TEXT="tt",b.KEY="k",b.OTHER="o"})(M||(M={}));var p;(function(b){b.DASH="d",b.HLS="h",b.SMOOTH="s",b.OTHER="o"})(p||(p={}));var E;(function(b){b.VOD="v",b.LIVE="l"})(E||(E={}))},"./src/types/level.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"HlsSkip",function(){return p}),I.d(R,"getSkipValue",function(){return E}),I.d(R,"HlsUrlParameters",function(){return b}),I.d(R,"Level",function(){return i});function L(c,o){for(var h=0;h<o.length;h++){var n=o[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(c,n.key,n)}}function M(c,o,h){return o&&L(c.prototype,o),h&&L(c,h),c}var p;(function(c){c.No="",c.Yes="YES",c.v2="v2"})(p||(p={}));function E(c,o){var h=c.canSkipUntil,n=c.canSkipDateRanges,a=c.endSN,t=o!==void 0?o-a:0;return h&&t<h?n?p.v2:p.Yes:p.No}var b=function(){function c(h,n,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=h,this.part=n,this.skip=a}var o=c.prototype;return o.addDirectives=function(n){var a=new self.URL(n);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},c}(),i=function(){function c(o){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[o.url],this.attrs=o.attrs,this.bitrate=o.bitrate,o.details&&(this.details=o.details),this.id=o.id||0,this.name=o.name,this.width=o.width||0,this.height=o.height||0,this.audioCodec=o.audioCodec,this.videoCodec=o.videoCodec,this.unknownCodecs=o.unknownCodecs,this.codecSet=[o.videoCodec,o.audioCodec].filter(function(h){return h}).join(",").replace(/\.[^.,]+/g,"")}return M(c,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(h){var n=h%this.url.length;this._urlId!==n&&(this.details=void 0,this._urlId=n)}}]),c}()},"./src/types/loader.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"PlaylistContextType",function(){return L}),I.d(R,"PlaylistLevelType",function(){return M});var L;(function(p){p.MANIFEST="manifest",p.LEVEL="level",p.AUDIO_TRACK="audioTrack",p.SUBTITLE_TRACK="subtitleTrack"})(L||(L={}));var M;(function(p){p.MAIN="main",p.AUDIO="audio",p.SUBTITLE="subtitle"})(M||(M={}))},"./src/types/transmuxer.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"ChunkMetadata",function(){return L});var L=function(E,b,i,c,o,h){c===void 0&&(c=0),o===void 0&&(o=-1),h===void 0&&(h=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=M(),this.buffering={audio:M(),video:M(),audiovideo:M()},this.level=E,this.sn=b,this.id=i,this.size=c,this.part=o,this.partial=h};function M(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"AttrList",function(){return p});var L=/^(\d+)x(\d+)$/,M=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,p=function(){function E(i){typeof i=="string"&&(i=E.parseAttrList(i));for(var c in i)i.hasOwnProperty(c)&&(this[c]=i[c])}var b=E.prototype;return b.decimalInteger=function(c){var o=parseInt(this[c],10);return o>Number.MAX_SAFE_INTEGER?Infinity:o},b.hexadecimalInteger=function(c){if(this[c]){var o=(this[c]||"0x").slice(2);o=(o.length&1?"0":"")+o;for(var h=new Uint8Array(o.length/2),n=0;n<o.length/2;n++)h[n]=parseInt(o.slice(n*2,n*2+2),16);return h}else return null},b.hexadecimalIntegerAsNumber=function(c){var o=parseInt(this[c],16);return o>Number.MAX_SAFE_INTEGER?Infinity:o},b.decimalFloatingPoint=function(c){return parseFloat(this[c])},b.optionalFloat=function(c,o){var h=this[c];return h?parseFloat(h):o},b.enumeratedString=function(c){return this[c]},b.bool=function(c){return this[c]==="YES"},b.decimalResolution=function(c){var o=L.exec(this[c]);return o===null?void 0:{width:parseInt(o[1],10),height:parseInt(o[2],10)}},E.parseAttrList=function(c){var o,h={},n='"';for(M.lastIndex=0;(o=M.exec(c))!==null;){var a=o[2];a.indexOf(n)===0&&a.lastIndexOf(n)===a.length-1&&(a=a.slice(1,-1)),h[o[1]]=a}return h},E}()},"./src/utils/binary-search.ts":function(G,R,I){"use strict";I.r(R);var L={search:function(p,E){for(var b=0,i=p.length-1,c=null,o=null;b<=i;){c=(b+i)/2|0,o=p[c];var h=E(o);if(h>0)b=c+1;else if(h<0)i=c-1;else return o}return null}};R.default=L},"./src/utils/buffer-helper.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"BufferHelper",function(){return p});var L=I("./src/utils/logger.ts"),M={length:0,start:function(){return 0},end:function(){return 0}},p=function(){function E(){}return E.isBuffered=function(i,c){try{if(i){for(var o=E.getBuffered(i),h=0;h<o.length;h++)if(c>=o.start(h)&&c<=o.end(h))return!0}}catch(n){}return!1},E.bufferInfo=function(i,c,o){try{if(i){var h=E.getBuffered(i),n=[],a;for(a=0;a<h.length;a++)n.push({start:h.start(a),end:h.end(a)});return this.bufferedInfo(n,c,o)}}catch(t){}return{len:0,start:c,end:c,nextStart:void 0}},E.bufferedInfo=function(i,c,o){c=Math.max(0,c),i.sort(function(S,C){var _=S.start-C.start;return _||C.end-S.end});var h=[];if(o)for(var n=0;n<i.length;n++){var a=h.length;if(a){var t=h[a-1].end;i[n].start-t<o?i[n].end>t&&(h[a-1].end=i[n].end):h.push(i[n])}else h.push(i[n])}else h=i;for(var r=0,s,u=c,f=c,d=0;d<h.length;d++){var v=h[d].start,m=h[d].end;if(c+o>=v&&c<m)u=v,f=m,r=f-c;else if(c+o<v){s=v;break}}return{len:r,start:u||0,end:f||0,nextStart:s}},E.getBuffered=function(i){try{return i.buffered}catch(c){return L.logger.log("failed to get media.buffered",c),M}},E}()},"./src/utils/cea-608-parser.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"Row",function(){return f}),I.d(R,"CaptionScreen",function(){return d});var L=I("./src/utils/logger.ts"),M={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},p=function(T){var k=T;return M.hasOwnProperty(T)&&(k=M[T]),String.fromCharCode(k)},E=15,b=100,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},n=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(a||(a={}));var t=function(){function y(){this.time=null,this.verboseLevel=a.ERROR}var T=y.prototype;return T.log=function(g,F){this.verboseLevel>=g&&L.logger.log(this.time+" ["+g+"] "+F)},y}(),r=function(T){for(var k=[],g=0;g<T.length;g++)k.push(T[g].toString(16));return k},s=function(){function y(k,g,F,P,N){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=k||"white",this.underline=g||!1,this.italics=F||!1,this.background=P||"black",this.flash=N||!1}var T=y.prototype;return T.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},T.setStyles=function(g){for(var F=["foreground","underline","italics","background","flash"],P=0;P<F.length;P++){var N=F[P];g.hasOwnProperty(N)&&(this[N]=g[N])}},T.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},T.equals=function(g){return this.foreground===g.foreground&&this.underline===g.underline&&this.italics===g.italics&&this.background===g.background&&this.flash===g.flash},T.copy=function(g){this.foreground=g.foreground,this.underline=g.underline,this.italics=g.italics,this.background=g.background,this.flash=g.flash},T.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),u=function(){function y(k,g,F,P,N,W){this.uchar=void 0,this.penState=void 0,this.uchar=k||" ",this.penState=new s(g,F,P,N,W)}var T=y.prototype;return T.reset=function(){this.uchar=" ",this.penState.reset()},T.setChar=function(g,F){this.uchar=g,this.penState.copy(F)},T.setPenState=function(g){this.penState.copy(g)},T.equals=function(g){return this.uchar===g.uchar&&this.penState.equals(g.penState)},T.copy=function(g){this.uchar=g.uchar,this.penState.copy(g.penState)},T.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),f=function(){function y(k){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var g=0;g<b;g++)this.chars.push(new u);this.logger=k,this.pos=0,this.currPenState=new s}var T=y.prototype;return T.equals=function(g){for(var F=!0,P=0;P<b;P++)if(!this.chars[P].equals(g.chars[P])){F=!1;break}return F},T.copy=function(g){for(var F=0;F<b;F++)this.chars[F].copy(g.chars[F])},T.isEmpty=function(){for(var g=!0,F=0;F<b;F++)if(!this.chars[F].isEmpty()){g=!1;break}return g},T.setCursor=function(g){this.pos!==g&&(this.pos=g),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>b&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=b)},T.moveCursor=function(g){var F=this.pos+g;if(g>1)for(var P=this.pos+1;P<F+1;P++)this.chars[P].setPenState(this.currPenState);this.setCursor(F)},T.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},T.insertChar=function(g){g>=144&&this.backSpace();var F=p(g);if(this.pos>=b){this.logger.log(a.ERROR,"Cannot insert "+g.toString(16)+" ("+F+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(F,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(g){var F;for(F=g;F<b;F++)this.chars[F].reset()},T.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},T.clearToEndOfRow=function(){this.clearFromPos(this.pos)},T.getTextString=function(){for(var g=[],F=!0,P=0;P<b;P++){var N=this.chars[P].uchar;N!==" "&&(F=!1),g.push(N)}return F?"":g.join("")},T.setPenStyles=function(g){this.currPenState.setStyles(g);var F=this.chars[this.pos];F.setPenState(this.currPenState)},y}(),d=function(){function y(k){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var g=0;g<E;g++)this.rows.push(new f(k));this.logger=k,this.currRow=E-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var T=y.prototype;return T.reset=function(){for(var g=0;g<E;g++)this.rows[g].clear();this.currRow=E-1},T.equals=function(g){for(var F=!0,P=0;P<E;P++)if(!this.rows[P].equals(g.rows[P])){F=!1;break}return F},T.copy=function(g){for(var F=0;F<E;F++)this.rows[F].copy(g.rows[F])},T.isEmpty=function(){for(var g=!0,F=0;F<E;F++)if(!this.rows[F].isEmpty()){g=!1;break}return g},T.backSpace=function(){var g=this.rows[this.currRow];g.backSpace()},T.clearToEndOfRow=function(){var g=this.rows[this.currRow];g.clearToEndOfRow()},T.insertChar=function(g){var F=this.rows[this.currRow];F.insertChar(g)},T.setPen=function(g){var F=this.rows[this.currRow];F.setPenStyles(g)},T.moveCursor=function(g){var F=this.rows[this.currRow];F.moveCursor(g)},T.setCursor=function(g){this.logger.log(a.INFO,"setCursor: "+g);var F=this.rows[this.currRow];F.setCursor(g)},T.setPAC=function(g){this.logger.log(a.INFO,"pacData = "+JSON.stringify(g));var F=g.row-1;if(this.nrRollUpRows&&F<this.nrRollUpRows-1&&(F=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==F){for(var P=0;P<E;P++)this.rows[P].clear();var N=this.currRow+1-this.nrRollUpRows,W=this.lastOutputScreen;if(W){var j=W.rows[N].cueStartTime,A=this.logger.time;if(j&&A!==null&&j<A)for(var K=0;K<this.nrRollUpRows;K++)this.rows[F-this.nrRollUpRows+K+1].copy(W.rows[N+K])}}this.currRow=F;var U=this.rows[this.currRow];if(g.indent!==null){var O=g.indent,z=Math.max(O-1,0);U.setCursor(g.indent),g.color=U.chars[z].penState.foreground}var te={foreground:g.color,underline:g.underline,italics:g.italics,background:"black",flash:!1};this.setPen(te)},T.setBkgData=function(g){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(g)),this.backSpace(),this.setPen(g),this.insertChar(32)},T.setRollUpRows=function(g){this.nrRollUpRows=g},T.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var g=this.currRow+1-this.nrRollUpRows,F=this.rows.splice(g,1)[0];F.clear(),this.rows.splice(this.currRow,0,F),this.logger.log(a.INFO,"Rolling up")},T.getDisplayText=function(g){g=g||!1;for(var F=[],P="",N=-1,W=0;W<E;W++){var j=this.rows[W].getTextString();j&&(N=W+1,g?F.push("Row "+N+": '"+j+"'"):F.push(j.trim()))}return F.length>0&&(g?P="["+F.join(" | ")+"]":P=F.join(`
`)),P},T.getTextAndFormat=function(){return this.rows},y}(),v=function(){function y(k,g,F){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=k,this.outputFilter=g,this.mode=null,this.verbose=0,this.displayedMemory=new d(F),this.nonDisplayedMemory=new d(F),this.lastOutputScreen=new d(F),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=F}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(g){this.outputFilter=g},T.setPAC=function(g){this.writeScreen.setPAC(g)},T.setBkgData=function(g){this.writeScreen.setBkgData(g)},T.setMode=function(g){if(g===this.mode)return;this.mode=g,this.logger.log(a.INFO,"MODE="+g),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=g},T.insertChars=function(g){for(var F=0;F<g.length;F++)this.writeScreen.insertChar(g[F]);var P=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,P+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},T.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},T.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},T.ccAOF=function(){},T.ccAON=function(){},T.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},T.ccRU=function(g){this.logger.log(a.INFO,"RU("+g+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(g)},T.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},T.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},T.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},T.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},T.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},T.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},T.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},T.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var g=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=g,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},T.ccTO=function(g){this.logger.log(a.INFO,"TO("+g+") - Tab Offset"),this.writeScreen.moveCursor(g)},T.ccMIDROW=function(g){var F={flash:!1};if(F.underline=g%2===1,F.italics=g>=46,F.italics)F.foreground="white";else{var P=Math.floor(g/2)-16,N=["white","green","blue","cyan","red","yellow","magenta"];F.foreground=N[P]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(F)),this.writeScreen.setPen(F)},T.outputDataUpdate=function(g){g===void 0&&(g=!1);var F=this.logger.time;if(F===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=F:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,F,this.lastOutputScreen),g&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:F),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(g){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,g,this.displayedMemory),this.cueStartTime=g))},y}(),m=function(){function y(k,g,F){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var P=new t;this.channels=[null,new v(k,g,P),new v(k+1,F,P)],this.cmdHistory=_(),this.logger=P}var T=y.prototype;return T.getHandler=function(g){return this.channels[g].getHandler()},T.setHandler=function(g,F){this.channels[g].setHandler(F)},T.addData=function(g,F){var P,N,W,j=!1;this.logger.time=g;for(var A=0;A<F.length;A+=2){if(N=F[A]&127,W=F[A+1]&127,N===0&&W===0)continue;if(this.logger.log(a.DATA,"["+r([F[A],F[A+1]])+"] -> ("+r([N,W])+")"),P=this.parseCmd(N,W),P||(P=this.parseMidrow(N,W)),P||(P=this.parsePAC(N,W)),P||(P=this.parseBackgroundAttributes(N,W)),!P&&(j=this.parseChars(N,W),j)){var K=this.currentChannel;if(K&&K>0){var U=this.channels[K];U.insertChars(j)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!P&&!j&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+r([N,W])+" orig: "+r([F[A],F[A+1]]))}},T.parseCmd=function(g,F){var P=this.cmdHistory,N=(g===20||g===28||g===21||g===29)&&F>=32&&F<=47,W=(g===23||g===31)&&F>=33&&F<=35;if(!(N||W))return!1;if(C(g,F,P))return S(null,null,P),this.logger.log(a.DEBUG,"Repeated command ("+r([g,F])+") is dropped"),!0;var j=g===20||g===21||g===23?1:2,A=this.channels[j];return g===20||g===21||g===28||g===29?F===32?A.ccRCL():F===33?A.ccBS():F===34?A.ccAOF():F===35?A.ccAON():F===36?A.ccDER():F===37?A.ccRU(2):F===38?A.ccRU(3):F===39?A.ccRU(4):F===40?A.ccFON():F===41?A.ccRDC():F===42?A.ccTR():F===43?A.ccRTD():F===44?A.ccEDM():F===45?A.ccCR():F===46?A.ccENM():F===47&&A.ccEOC():A.ccTO(F-32),S(g,F,P),this.currentChannel=j,!0},T.parseMidrow=function(g,F){var P=0;if((g===17||g===25)&&F>=32&&F<=47){if(g===17?P=1:P=2,P!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var N=this.channels[P];return N?(N.ccMIDROW(F),this.logger.log(a.DEBUG,"MIDROW ("+r([g,F])+")"),!0):!1}return!1},T.parsePAC=function(g,F){var P,N=this.cmdHistory,W=(g>=17&&g<=23||g>=25&&g<=31)&&F>=64&&F<=127,j=(g===16||g===24)&&F>=64&&F<=95;if(!(W||j))return!1;if(C(g,F,N))return S(null,null,N),!0;var A=g<=23?1:2;F>=64&&F<=95?P=A===1?i[g]:o[g]:P=A===1?c[g]:h[g];var K=this.channels[A];return K?(K.setPAC(this.interpretPAC(P,F)),S(g,F,N),this.currentChannel=A,!0):!1},T.interpretPAC=function(g,F){var P,N={color:null,italics:!1,indent:null,underline:!1,row:g};return F>95?P=F-96:P=F-64,N.underline=(P&1)===1,P<=13?N.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(P/2)]:P<=15?(N.italics=!0,N.color="white"):N.indent=Math.floor((P-16)/2)*4,N},T.parseChars=function(g,F){var P,N=null,W=null;if(g>=25?(P=2,W=g-8):(P=1,W=g),W>=17&&W<=19){var j;W===17?j=F+80:W===18?j=F+112:j=F+144,this.logger.log(a.INFO,"Special char '"+p(j)+"' in channel "+P),N=[j]}else g>=32&&g<=127&&(N=F===0?[g]:[g,F]);if(N){var A=r(N);this.logger.log(a.DEBUG,"Char codes = "+A.join(",")),S(g,F,this.cmdHistory)}return N},T.parseBackgroundAttributes=function(g,F){var P=(g===16||g===24)&&F>=32&&F<=47,N=(g===23||g===31)&&F>=45&&F<=47;if(!(P||N))return!1;var W,j={};g===16||g===24?(W=Math.floor((F-32)/2),j.background=n[W],F%2===1&&(j.background=j.background+"_semi")):F===45?j.background="transparent":(j.foreground="black",F===47&&(j.underline=!0));var A=g<=23?1:2,K=this.channels[A];return K.setBkgData(j),S(g,F,this.cmdHistory),!0},T.reset=function(){for(var g=0;g<Object.keys(this.channels).length;g++){var F=this.channels[g];F&&F.reset()}this.cmdHistory=_()},T.cueSplitAtTime=function(g){for(var F=0;F<this.channels.length;F++){var P=this.channels[F];P&&P.cueSplitAtTime(g)}},y}();function S(y,T,k){k.a=y,k.b=T}function C(y,T,k){return k.a===y&&k.b===T}function _(){return{a:null,b:null}}R.default=m},"./src/utils/codecs.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"isCodecType",function(){return M}),I.d(R,"isCodecSupportedInMp4",function(){return p});var L={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function M(E,b){var i=L[b];return!!i&&i[E.slice(0,4)]===!0}function p(E,b){return MediaSource.isTypeSupported((b||"video")+'/mp4;codecs="'+E+'"')}},"./src/utils/cues.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/utils/vttparser.ts"),M=I("./src/utils/webvtt-parser.ts"),p=I("./src/utils/texttrack-utils.ts"),E=/\s/,b={newCue:function(c,o,h,n){for(var a=[],t,r,s,u,f,d=self.VTTCue||self.TextTrackCue,v=0;v<n.rows.length;v++)if(t=n.rows[v],s=!0,u=0,f="",!t.isEmpty()){for(var m=0;m<t.chars.length;m++)E.test(t.chars[m].uchar)&&s?u++:(f+=t.chars[m].uchar,s=!1);t.cueStartTime=o,o===h&&(h+=1e-4),u>=16?u--:u++;var S=Object(L.fixLineBreaks)(f.trim()),C=Object(M.generateCueId)(o,h,S);(!c||!c.cues||!c.cues.getCueById(C))&&(r=new d(o,h,S),r.id=C,r.line=v+1,r.align="left",r.position=10+Math.min(80,Math.floor(u*8/32)*10),a.push(r))}return c&&a.length&&(a.sort(function(_,y){return _.line==="auto"||y.line==="auto"?0:_.line>8&&y.line>8?y.line-_.line:_.line-y.line}),a.forEach(function(_){return Object(p.addCueToTrack)(c,_)})),a}};R.default=b},"./src/utils/discontinuities.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"findFirstFragWithCC",function(){return E}),I.d(R,"shouldAlignOnDiscontinuities",function(){return b}),I.d(R,"findDiscontinuousReferenceFrag",function(){return i}),I.d(R,"adjustSlidingStart",function(){return o}),I.d(R,"alignStream",function(){return h}),I.d(R,"alignPDT",function(){return a}),I.d(R,"alignFragmentByPDTDelta",function(){return t}),I.d(R,"alignMediaPlaylistByPDT",function(){return r});var L=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts"),p=I("./src/controller/level-helper.ts");function E(s,u){for(var f=null,d=0,v=s.length;d<v;d++){var m=s[d];if(m&&m.cc===u){f=m;break}}return f}function b(s,u,f){return!!(u.details&&(f.endCC>f.startCC||s&&s.cc<f.startCC))}function i(s,u){var f=s.fragments,d=u.fragments;if(!d.length||!f.length){M.logger.log("No fragments to align");return}var v=E(f,d[0].cc);if(!v||v&&!v.startPTS){M.logger.log("No frag in previous level to align on");return}return v}function c(s,u){if(s){var f=s.start+u;s.start=s.startPTS=f,s.endPTS=f+s.duration}}function o(s,u){for(var f=u.fragments,d=0,v=f.length;d<v;d++)c(f[d],s);u.fragmentHint&&c(u.fragmentHint,s),u.alignedSliding=!0}function h(s,u,f){if(!u)return;n(s,f,u),!f.alignedSliding&&u.details&&a(f,u.details),!f.alignedSliding&&u.details&&!f.skippedSegments&&Object(p.adjustSliding)(u.details,f)}function n(s,u,f){if(b(s,f,u)){var d=i(f.details,u);d&&Object(L.isFiniteNumber)(d.start)&&(M.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),o(d.start,u))}}function a(s,u){if(!u.fragments.length||!s.hasProgramDateTime||!u.hasProgramDateTime)return;var f=u.fragments[0].programDateTime,d=s.fragments[0].programDateTime,v=(d-f)/1e3+u.fragments[0].start;v&&Object(L.isFiniteNumber)(v)&&(M.logger.log("Adjusting PTS using programDateTime delta "+(d-f)+"ms, sliding:"+v.toFixed(3)+" "+s.url+" "),o(v,s))}function t(s,u){var f=s.programDateTime;if(!f)return;var d=(f-u)/1e3;s.start=s.startPTS=d,s.endPTS=d+s.duration}function r(s,u){if(!u.fragments.length||!s.hasProgramDateTime||!u.hasProgramDateTime)return;var f=u.fragments[0].programDateTime,d=u.fragments[0].start,v=f-d*1e3;s.fragments.forEach(function(m){t(m,v)}),s.fragmentHint&&t(s.fragmentHint,v),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/utils/ewma.ts"),M=function(){function p(b,i,c){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=c,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new L.default(b),this.fast_=new L.default(i)}var E=p.prototype;return E.update=function(i,c){var o=this.slow_,h=this.fast_;this.slow_.halfLife!==i&&(this.slow_=new L.default(i,o.getEstimate(),o.getTotalWeight())),this.fast_.halfLife!==c&&(this.fast_=new L.default(c,h.getEstimate(),h.getTotalWeight()))},E.sample=function(i,c){i=Math.max(i,this.minDelayMs_);var o=8*c,h=i/1e3,n=o/h;this.fast_.sample(h,n),this.slow_.sample(h,n)},E.canEstimate=function(){var i=this.fast_;return i&&i.getTotalWeight()>=this.minWeight_},E.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},E.destroy=function(){},p}();R.default=M},"./src/utils/ewma.ts":function(G,R,I){"use strict";I.r(R);var L=function(){function M(E,b,i){b===void 0&&(b=0),i===void 0&&(i=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_=b,this.totalWeight_=i}var p=M.prototype;return p.sample=function(b,i){var c=Math.pow(this.alpha_,b);this.estimate_=i*(1-c)+c*this.estimate_,this.totalWeight_+=b},p.getTotalWeight=function(){return this.totalWeight_},p.getEstimate=function(){if(this.alpha_){var b=1-Math.pow(this.alpha_,this.totalWeight_);if(b)return this.estimate_/b}return this.estimate_},M}();R.default=L},"./src/utils/fetch-loader.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"fetchSupported",function(){return t});var L=I("./src/polyfills/number.ts"),M=I("./src/loader/load-stats.ts"),p=I("./src/demux/chunk-cache.ts");function E(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,h(d,v)}function b(d){var v=typeof Map=="function"?new Map:void 0;return b=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 v!="undefined"){if(v.has(S))return v.get(S);v.set(S,C)}function C(){return i(S,arguments,n(this).constructor)}return C.prototype=Object.create(S.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),h(C,S)},b(d)}function i(d,v,m){return c()?i=Reflect.construct:i=function(C,_,y){var T=[null];T.push.apply(T,_);var k=Function.bind.apply(C,T),g=new k;return y&&h(g,y.prototype),g},i.apply(null,arguments)}function c(){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 h(d,v){return h=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},h(d,v)}function n(d){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},n(d)}function a(){return a=Object.assign||function(d){for(var v=1;v<arguments.length;v++){var m=arguments[v];for(var S in m)Object.prototype.hasOwnProperty.call(m,S)&&(d[S]=m[S])}return d},a.apply(this,arguments)}function t(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var r=function(){function d(m){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=m.fetchSetup||u,this.controller=new self.AbortController,this.stats=new M.LoadStats}var v=d.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(S,C,_){var y=this,T=this.stats;if(T.loading.start)throw new Error("Loader can only be used once.");T.loading.start=self.performance.now();var k=s(S,this.controller.signal),g=_.onProgress,F=S.responseType==="arraybuffer",P=F?"byteLength":"length";this.context=S,this.config=C,this.callbacks=_,this.request=this.fetchSetup(S,k),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),_.onTimeout(T,S,y.response)},C.timeout),self.fetch(this.request).then(function(N){if(y.response=y.loader=N,!N.ok){var W=N.status,j=N.statusText;throw new f(j||"fetch, bad network response",W,N)}return T.loading.first=Math.max(self.performance.now(),T.loading.start),T.total=parseInt(N.headers.get("Content-Length")||"0"),g&&Object(L.isFiniteNumber)(C.highWaterMark)?y.loadProgressively(N,T,S,C.highWaterMark,g):F?N.arrayBuffer():N.text()}).then(function(N){var W=y.response;self.clearTimeout(y.requestTimeout),T.loading.end=Math.max(self.performance.now(),T.loading.first),T.loaded=T.total=N[P];var j={url:W.url,data:N};g&&!Object(L.isFiniteNumber)(C.highWaterMark)&&g(T,S,N,W),_.onSuccess(j,T,S,W)}).catch(function(N){if(self.clearTimeout(y.requestTimeout),T.aborted)return;var W=N.code||0;_.onError({code:W,text:N.message},S,N.details)})},v.getCacheAge=function(){var S=null;if(this.response){var C=this.response.headers.get("age");S=C?parseFloat(C):null}return S},v.loadProgressively=function(S,C,_,y,T){y===void 0&&(y=0);var k=new p.default,g=S.body.getReader(),F=function P(){return g.read().then(function(N){if(N.done)return k.dataLength&&T(C,_,k.flush(),S),Promise.resolve(new ArrayBuffer(0));var W=N.value,j=W.length;return C.loaded+=j,j<y||k.dataLength?(k.push(W),k.dataLength>=y&&T(C,_,k.flush(),S)):T(C,_,W,S),P()}).catch(function(){return Promise.reject()})};return F()},d}();function s(d,v){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(a({},d.headers))};return d.rangeEnd&&m.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),m}function u(d,v){return new self.Request(d.url,v)}var f=function(d){E(v,d);function v(m,S,C){var _;return _=d.call(this,m)||this,_.code=void 0,_.details=void 0,_.code=S,_.details=C,_}return v}(b(Error));R.default=r},"./src/utils/imsc1-ttml-parser.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"IMSC1_CODEC",function(){return o}),I.d(R,"parseIMSC1",function(){return t});var L=I("./src/utils/mp4-tools.ts"),M=I("./src/utils/vttparser.ts"),p=I("./src/utils/vttcue.ts"),E=I("./src/demux/id3.ts"),b=I("./src/utils/timescale-conversion.ts"),i=I("./src/utils/webvtt-parser.ts");function c(){return c=Object.assign||function(y){for(var T=1;T<arguments.length;T++){var k=arguments[T];for(var g in k)Object.prototype.hasOwnProperty.call(k,g)&&(y[g]=k[g])}return y},c.apply(this,arguments)}var o="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,n=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function t(y,T,k,g,F){var P=Object(L.findBox)(new Uint8Array(y),["mdat"]);if(P.length===0){F(new Error("Could not parse IMSC1 mdat"));return}var N=P[0],W=Object(E.utf8ArrayToStr)(new Uint8Array(y,N.start,N.end-N.start)),j=Object(b.toTimescaleFromScale)(T,1,k);try{g(r(W,j))}catch(A){F(A)}}function r(y,T){var k=new DOMParser,g=k.parseFromString(y,"text/xml"),F=g.getElementsByTagName("tt")[0];if(!F)throw new Error("Invalid ttml");var P={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},N=Object.keys(P).reduce(function(U,O){return U[O]=F.getAttribute("ttp:"+O)||P[O],U},{}),W=F.getAttribute("xml:space")!=="preserve",j=u(s(F,"styling","style")),A=u(s(F,"layout","region")),K=s(F,"body","[begin]");return[].map.call(K,function(U){var O=f(U,W);if(!O||!U.hasAttribute("begin"))return null;var z=S(U.getAttribute("begin"),N),te=S(U.getAttribute("dur"),N),de=S(U.getAttribute("end"),N);if(z===null)throw m(U);if(de===null){if(te===null)throw m(U);de=z+te}var be=new p.default(z-T,de-T,O);be.id=Object(i.generateCueId)(be.startTime,be.endTime,be.text);var je=A[U.getAttribute("region")],Ne=j[U.getAttribute("style")];be.position=10,be.size=80;var Oe=d(je,Ne),Ke=Oe.textAlign;if(Ke){var We=a[Ke];We&&(be.lineAlign=We),be.align=Ke}return c(be,Oe),be}).filter(function(U){return U!==null})}function s(y,T,k){var g=y.getElementsByTagName(T)[0];return g?[].slice.call(g.querySelectorAll(k)):[]}function u(y){return y.reduce(function(T,k){var g=k.getAttribute("xml:id");return g&&(T[g]=k),T},{})}function f(y,T){return[].slice.call(y.childNodes).reduce(function(k,g,F){var P;return g.nodeName==="br"&&F?k+`
`:(P=g.childNodes)!==null&&P!==void 0&&P.length?f(g,T):T?k+g.textContent.trim().replace(/\s+/g," "):k+g.textContent},"")}function d(y,T){var k="http://www.w3.org/ns/ttml#styling",g=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return g.reduce(function(F,P){var N=v(T,k,P)||v(y,k,P);return N&&(F[P]=N),F},{})}function v(y,T,k){return y.hasAttributeNS(T,k)?y.getAttributeNS(T,k):null}function m(y){return new Error("Could not parse ttml timestamp "+y)}function S(y,T){if(!y)return null;var k=Object(M.parseTimeStamp)(y);return k===null&&(h.test(y)?k=C(y,T):n.test(y)&&(k=_(y,T))),k}function C(y,T){var k=h.exec(y),g=(k[4]|0)+(k[5]|0)/T.subFrameRate;return(k[1]|0)*3600+(k[2]|0)*60+(k[3]|0)+g/T.frameRate}function _(y,T){var k=n.exec(y),g=Number(k[1]),F=k[2];switch(F){case"h":return g*3600;case"m":return g*60;case"ms":return g*1e3;case"f":return g/T.frameRate;case"t":return g/T.tickRate}return g}},"./src/utils/logger.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"enableLogs",function(){return i}),I.d(R,"logger",function(){return c});var L=function(){},M={trace:L,debug:L,log:L,warn:L,info:L,error:L},p=M;function E(o){var h=self.console[o];return h?h.bind(self.console,"["+o+"] >"):L}function b(o){for(var h=arguments.length,n=new Array(h>1?h-1:0),a=1;a<h;a++)n[a-1]=arguments[a];n.forEach(function(t){p[t]=o[t]?o[t].bind(o):E(t)})}function i(o){if(self.console&&o===!0||typeof o=="object"){b(o,"debug","log","info","warn","error");try{p.log()}catch(h){p=M}}else p=M}var c=p},"./src/utils/mediakeys-helper.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"KeySystems",function(){return L}),I.d(R,"requestMediaKeySystemAccess",function(){return M});var L;(function(p){p.WIDEVINE="com.widevine.alpha",p.PLAYREADY="com.microsoft.playready"})(L||(L={}));var M=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"getMediaSource",function(){return L});function L(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"bin2str",function(){return b}),I.d(R,"readUint16",function(){return i}),I.d(R,"readUint32",function(){return c}),I.d(R,"writeUint32",function(){return o}),I.d(R,"findBox",function(){return h}),I.d(R,"parseSegmentIndex",function(){return n}),I.d(R,"parseInitSegment",function(){return a}),I.d(R,"getStartDTS",function(){return t}),I.d(R,"getDuration",function(){return r}),I.d(R,"computeRawDurationFromSamples",function(){return s}),I.d(R,"offsetStartDTS",function(){return u}),I.d(R,"segmentValidRange",function(){return f}),I.d(R,"appendUint8Array",function(){return d});var L=I("./src/utils/typed-array.ts"),M=I("./src/loader/fragment.ts"),p=Math.pow(2,32)-1,E=[].push;function b(v){return String.fromCharCode.apply(null,v)}function i(v,m){"data"in v&&(m+=v.start,v=v.data);var S=v[m]<<8|v[m+1];return S<0?65536+S:S}function c(v,m){"data"in v&&(m+=v.start,v=v.data);var S=v[m]<<24|v[m+1]<<16|v[m+2]<<8|v[m+3];return S<0?4294967296+S:S}function o(v,m,S){"data"in v&&(m+=v.start,v=v.data),v[m]=S>>24,v[m+1]=S>>16&255,v[m+2]=S>>8&255,v[m+3]=S&255}function h(v,m){var S=[];if(!m.length)return S;var C,_,y;"data"in v?(C=v.data,_=v.start,y=v.end):(C=v,_=0,y=C.byteLength);for(var T=_;T<y;){var k=c(C,T),g=b(C.subarray(T+4,T+8)),F=k>1?T+k:y;if(g===m[0])if(m.length===1)S.push({data:C,start:T+8,end:F});else{var P=h({data:C,start:T+8,end:F},m.slice(1));P.length&&E.apply(S,P)}T=F}return S}function n(v){var m=h(v,["moov"]),S=m[0],C=S?S.end:null,_=h(v,["sidx"]);if(!_||!_[0])return null;var y=[],T=_[0],k=T.data[0],g=k===0?8:16,F=c(T,g);g+=4;var P=0,N=0;k===0?g+=8:g+=16,g+=2;var W=T.end+N,j=i(T,g);g+=2;for(var A=0;A<j;A++){var K=g,U=c(T,K);K+=4;var O=U&2147483647,z=(U&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=c(T,K);K+=4,y.push({referenceSize:O,subsegmentDuration:te,info:{duration:te/F,start:W,end:W+O-1}}),W+=O,K+=4,g=K}return{earliestPresentationTime:P,timescale:F,version:k,referencesCount:j,references:y,moovEndOffset:C}}function a(v){for(var m=[],S=h(v,["moov","trak"]),C=0;C<S.length;C++){var _=S[C],y=h(_,["tkhd"])[0];if(y){var T=y.data[y.start],k=T===0?12:20,g=c(y,k),F=h(_,["mdia","mdhd"])[0];if(F){T=F.data[F.start],k=T===0?12:20;var P=c(F,k),N=h(_,["mdia","hdlr"])[0];if(N){var W=b(N.data.subarray(N.start+8,N.start+12)),j={soun:M.ElementaryStreamTypes.AUDIO,vide:M.ElementaryStreamTypes.VIDEO}[W];if(j){var A=h(_,["mdia","minf","stbl","stsd"])[0],K=void 0;A&&(K=b(A.data.subarray(A.start+12,A.start+16))),m[g]={timescale:P,type:j},m[j]={timescale:P,id:g,codec:K}}}}}}var U=h(v,["moov","mvex","trex"]);return U.forEach(function(O){var z=c(O,4),te=m[z];te&&(te.default={duration:c(O,12),flags:c(O,20)})}),m}function t(v,m){return h(m,["moof","traf"]).reduce(function(S,C){var _=h(C,["tfdt"])[0],y=_.data[_.start],T=h(C,["tfhd"]).reduce(function(k,g){var F=c(g,4),P=v[F];if(P){var N=c(_,4);y===1&&(N*=Math.pow(2,32),N+=c(_,8));var W=P.timescale||9e4,j=N/W;if(isFinite(j)&&(k===null||j<k))return j}return k},null);return T!==null&&isFinite(T)&&(S===null||T<S)?T:S},null)||0}function r(v,m){for(var S=0,C=0,_=0,y=h(v,["moof","traf"]),T=0;T<y.length;T++){var k=y[T],g=h(k,["tfhd"])[0],F=c(g,4),P=m[F];if(!P)continue;var N=P.default,W=c(g,0)|(N==null?void 0:N.flags),j=N==null?void 0:N.duration;W&8&&(W&2?j=c(g,12):j=c(g,8));for(var A=P.timescale||9e4,K=h(k,["trun"]),U=0;U<K.length;U++){if(j){var O=c(K[U],4);S=j*O}else S=s(K[U]);P.type===M.ElementaryStreamTypes.VIDEO?C+=S/A:P.type===M.ElementaryStreamTypes.AUDIO&&(_+=S/A)}}if(C===0&&_===0){var z=n(v);if(z!=null&&z.references)return z.references.reduce(function(te,de){return te+de.info.duration||0},0)}return C||_}function s(v){var m=c(v,0),S=8;m&1&&(S+=4),m&4&&(S+=4);for(var C=0,_=c(v,4),y=0;y<_;y++){if(m&256){var T=c(v,S);C+=T,S+=4}m&512&&(S+=4),m&1024&&(S+=4),m&2048&&(S+=4)}return C}function u(v,m,S){h(m,["moof","traf"]).forEach(function(C){h(C,["tfhd"]).forEach(function(_){var y=c(_,4),T=v[y];if(!T)return;var k=T.timescale||9e4;h(C,["tfdt"]).forEach(function(g){var F=g.data[g.start],P=c(g,4);if(F===0)o(g,4,P-S*k);else{P*=Math.pow(2,32),P+=c(g,8),P-=S*k,P=Math.max(P,0);var N=Math.floor(P/(p+1)),W=Math.floor(P%(p+1));o(g,4,N),o(g,8,W)}})})})}function f(v){var m={valid:null,remainder:null},S=h(v,["moof"]);if(S){if(S.length<2)return m.remainder=v,m}else return m;var C=S[S.length-1];return m.valid=Object(L.sliceUint8)(v,0,C.start-8),m.remainder=Object(L.sliceUint8)(v,C.start-8),m}function d(v,m){var S=new Uint8Array(v.length+m.length);return S.set(v),S.set(m,v.length),S}},"./src/utils/output-filter.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"default",function(){return L});var L=function(){function M(E,b){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=E,this.trackName=b}var p=M.prototype;return p.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},p.newCue=function(b,i,c){(this.startTime===null||this.startTime>b)&&(this.startTime=b),this.endTime=i,this.screen=c,this.timelineController.createCaptionsTrack(this.trackName)},p.reset=function(){this.cueRanges=[]},M}()},"./src/utils/texttrack-utils.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"sendAddTrackEvent",function(){return M}),I.d(R,"addCueToTrack",function(){return p}),I.d(R,"clearCurrentCues",function(){return E}),I.d(R,"removeCuesInRange",function(){return b}),I.d(R,"getCuesInRange",function(){return c});var L=I("./src/utils/logger.ts");function M(o,h){var n;try{n=new Event("addtrack")}catch(a){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=o,h.dispatchEvent(n)}function p(o,h){var n=o.mode;if(n==="disabled"&&(o.mode="hidden"),o.cues&&!o.cues.getCueById(h.id))try{if(o.addCue(h),!o.cues.getCueById(h.id))throw new Error("addCue is failed for: "+h)}catch(t){L.logger.debug("[texttrack-utils]: "+t);var a=new self.TextTrackCue(h.startTime,h.endTime,h.text);a.id=h.id,o.addCue(a)}n==="disabled"&&(o.mode=n)}function E(o){var h=o.mode;if(h==="disabled"&&(o.mode="hidden"),o.cues)for(var n=o.cues.length;n--;)o.removeCue(o.cues[n]);h==="disabled"&&(o.mode=h)}function b(o,h,n){var a=o.mode;if(a==="disabled"&&(o.mode="hidden"),o.cues&&o.cues.length>0)for(var t=c(o.cues,h,n),r=0;r<t.length;r++)o.removeCue(t[r]);a==="disabled"&&(o.mode=a)}function i(o,h){if(h<o[0].startTime)return 0;var n=o.length-1;if(h>o[n].endTime)return-1;for(var a=0,t=n;a<=t;){var r=Math.floor((t+a)/2);if(h<o[r].startTime)t=r-1;else if(h>o[r].startTime&&a<n)a=r+1;else return r}return o[a].startTime-h<h-o[t].startTime?a:t}function c(o,h,n){var a=[],t=i(o,h);if(t>-1)for(var r=t,s=o.length;r<s;r++){var u=o[r];if(u.startTime>=h&&u.endTime<=n)a.push(u);else if(u.startTime>n)return a}return a}},"./src/utils/time-ranges.ts":function(G,R,I){"use strict";I.r(R);var L={toString:function(p){for(var E="",b=p.length,i=0;i<b;i++)E+="["+p.start(i).toFixed(3)+","+p.end(i).toFixed(3)+"]";return E}};R.default=L},"./src/utils/timescale-conversion.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"toTimescaleFromBase",function(){return M}),I.d(R,"toTimescaleFromScale",function(){return p}),I.d(R,"toMsFromMpegTsClock",function(){return E}),I.d(R,"toMpegTsClockFromTimescale",function(){return b});var L=9e4;function M(i,c,o,h){o===void 0&&(o=1),h===void 0&&(h=!1);var n=i*c*o;return h?Math.round(n):n}function p(i,c,o,h){return o===void 0&&(o=1),h===void 0&&(h=!1),M(i,c,1/o,h)}function E(i,c){return c===void 0&&(c=!1),M(i,1e3,1/L,c)}function b(i,c){return c===void 0&&(c=1),M(i,L,1/c)}},"./src/utils/typed-array.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"sliceUint8",function(){return L});function L(M,p,E){return Uint8Array.prototype.slice?M.slice(p,E):new Uint8Array(Array.prototype.slice.call(M,p,E))}},"./src/utils/vttcue.ts":function(G,R,I){"use strict";I.r(R),R.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var L=["","lr","rl"],M=["start","middle","end","left","right"];function p(o,h){if(typeof h!="string")return!1;if(!Array.isArray(o))return!1;var n=h.toLowerCase();return~o.indexOf(n)?n:!1}function E(o){return p(L,o)}function b(o){return p(M,o)}function i(o){for(var h=arguments.length,n=new Array(h>1?h-1:0),a=1;a<h;a++)n[a-1]=arguments[a];for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)o[s]=r[s]}return o}function c(o,h,n){var a=this,t={enumerable:!0};a.hasBeenReset=!1;var r="",s=!1,u=o,f=h,d=n,v=null,m="",S=!0,C="auto",_="start",y=50,T="middle",k=50,g="middle";Object.defineProperty(a,"id",i({},t,{get:function(){return r},set:function(P){r=""+P}})),Object.defineProperty(a,"pauseOnExit",i({},t,{get:function(){return s},set:function(P){s=!!P}})),Object.defineProperty(a,"startTime",i({},t,{get:function(){return u},set:function(P){if(typeof P!="number")throw new TypeError("Start time must be set to a number.");u=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",i({},t,{get:function(){return f},set:function(P){if(typeof P!="number")throw new TypeError("End time must be set to a number.");f=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",i({},t,{get:function(){return d},set:function(P){d=""+P,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",i({},t,{get:function(){return v},set:function(P){v=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",i({},t,{get:function(){return m},set:function(P){var N=E(P);if(N===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=N,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",i({},t,{get:function(){return S},set:function(P){S=!!P,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",i({},t,{get:function(){return C},set:function(P){if(typeof P!="number"&&P!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");C=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",i({},t,{get:function(){return _},set:function(P){var N=b(P);if(!N)throw new SyntaxError("An invalid or illegal string was specified.");_=N,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",i({},t,{get:function(){return y},set:function(P){if(P<0||P>100)throw new Error("Position must be between 0 and 100.");y=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",i({},t,{get:function(){return T},set:function(P){var N=b(P);if(!N)throw new SyntaxError("An invalid or illegal string was specified.");T=N,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",i({},t,{get:function(){return k},set:function(P){if(P<0||P>100)throw new Error("Size must be between 0 and 100.");k=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",i({},t,{get:function(){return g},set:function(P){var N=b(P);if(!N)throw new SyntaxError("An invalid or illegal string was specified.");g=N,this.hasBeenReset=!0}})),a.displayState=void 0}return c.prototype.getCueAsHTML=function(){var o=self.WebVTT;return o.convertCueToDOMTree(self,this.text)},c}()},"./src/utils/vttparser.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"parseTimeStamp",function(){return p}),I.d(R,"fixLineBreaks",function(){return h}),I.d(R,"VTTParser",function(){return n});var L=I("./src/utils/vttcue.ts"),M=function(){function a(){}var t=a.prototype;return t.decode=function(s,u){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function p(a){function t(s,u,f,d){return(s|0)*3600+(u|0)*60+(f|0)+parseFloat(d||0)}var r=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}var E=function(){function a(){this.values=Object.create(null)}var t=a.prototype;return t.set=function(s,u){!this.get(s)&&u!==""&&(this.values[s]=u)},t.get=function(s,u,f){return f?this.has(s)?this.values[s]:u[f]:this.has(s)?this.values[s]:u},t.has=function(s){return s in this.values},t.alt=function(s,u,f){for(var d=0;d<f.length;++d)if(u===f[d]){this.set(s,u);break}},t.integer=function(s,u){/^-?\d+$/.test(u)&&this.set(s,parseInt(u,10))},t.percent=function(s,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var f=parseFloat(u);if(f>=0&&f<=100)return this.set(s,f),!0}return!1},a}();function b(a,t,r,s){var u=s?a.split(s):[a];for(var f in u){if(typeof u[f]!="string")continue;var d=u[f].split(r);if(d.length!==2)continue;var v=d[0],m=d[1];t(v,m)}}var i=new L.default(0,0,""),c=i.align==="middle"?"middle":"center";function o(a,t,r){var s=a;function u(){var v=p(a);if(v===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),v}function f(v,m){var S=new E;b(v,function(y,T){var k;switch(y){case"region":for(var g=r.length-1;g>=0;g--)if(r[g].id===T){S.set(y,r[g].region);break}break;case"vertical":S.alt(y,T,["rl","lr"]);break;case"line":k=T.split(","),S.integer(y,k[0]),S.percent(y,k[0])&&S.set("snapToLines",!1),S.alt(y,k[0],["auto"]),k.length===2&&S.alt("lineAlign",k[1],["start",c,"end"]);break;case"position":k=T.split(","),S.percent(y,k[0]),k.length===2&&S.alt("positionAlign",k[1],["start",c,"end","line-left","line-right","auto"]);break;case"size":S.percent(y,T);break;case"align":S.alt(y,T,["start",c,"end","left","right"]);break}},/:/,/\s/),m.region=S.get("region",null),m.vertical=S.get("vertical","");var C=S.get("line","auto");C==="auto"&&i.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",c);var _=S.get("position","auto");_==="auto"&&i.position===50&&(_=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=_}function d(){a=a.replace(/^\s+/,"")}if(d(),t.startTime=u(),d(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.substr(3),d(),t.endTime=u(),d(),f(a,t)}function h(a){return a.replace(/<br(?: \/)?>/gi,`
`)}var n=function(){function a(){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=a.prototype;return t.parse=function(s){var u=this;s&&(u.buffer+=u.decoder.decode(s,{stream:!0}));function f(){var _=u.buffer,y=0;for(_=h(_);y<_.length&&_[y]!=="\r"&&_[y]!==`
`;)++y;var T=_.substr(0,y);return _[y]==="\r"&&++y,_[y]===`
`&&++y,u.buffer=_.substr(y),T}function d(_){b(_,function(y,T){},/:/)}try{var v="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;v=f();var m=v.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:v=f();switch(u.state){case"HEADER":/:/.test(v)?d(v):v||(u.state="ID");continue;case"NOTE":v||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){u.state="NOTE";break}if(!v)continue;if(u.cue=new L.default(0,0,""),u.state="CUE",v.indexOf("-->")===-1){u.cue.id=v;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{o(v,u.cue,u.regionList)}catch(_){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var C=v.indexOf("-->")!==-1;if(!v||C&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
`),u.cue.text+=v}continue;case"BADCUE":v||(u.state="ID")}}}catch(_){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.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(u){s.onparsingerror&&s.onparsingerror(u)}return s.onflush&&s.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(G,R,I){"use strict";I.r(R),I.d(R,"generateCueId",function(){return n}),I.d(R,"parseWebVTT",function(){return t});var L=I("./src/polyfills/number.ts"),M=I("./src/utils/vttparser.ts"),p=I("./src/demux/id3.ts"),E=I("./src/utils/timescale-conversion.ts"),b=I("./src/remux/mp4-remuxer.ts"),i=/\r\n|\n\r|\n|\r/g,c=function(s,u,f){return f===void 0&&(f=0),s.substr(f,u.length)===u},o=function(s){var u=parseInt(s.substr(-3)),f=parseInt(s.substr(-6,2)),d=parseInt(s.substr(-9,2)),v=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(L.isFiniteNumber)(u)||!Object(L.isFiniteNumber)(f)||!Object(L.isFiniteNumber)(d)||!Object(L.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return u+=1e3*f,u+=60*1e3*d,u+=60*60*1e3*v,u},h=function(s){for(var u=5381,f=s.length;f;)u=u*33^s.charCodeAt(--f);return(u>>>0).toString()};function n(r,s,u){return h(r.toString())+h(s.toString())+h(u)}var a=function(s,u,f){var d=s[u],v=s[d.prevCC];if(!v||!v.new&&d.new){s.ccOffset=s.presentationOffset=d.start,d.new=!1;return}for(;(m=v)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=d.start-v.start,d.new=!1,d=v,v=s[d.prevCC]}s.presentationOffset=f};function t(r,s,u,f,d,v,m,S){var C=new M.VTTParser,_=Object(p.utf8ArrayToStr)(new Uint8Array(r)).trim().replace(i,`
`).split(`
`),y=[],T=Object(E.toMpegTsClockFromTimescale)(s,u),k="00:00.000",g=0,F=0,P,N=!0,W=!1;C.oncue=function(j){var A=f[d],K=f.ccOffset,U=(g-T)/9e4;if(A!=null&&A.new&&(F!==void 0?K=f.ccOffset=A.start:a(f,d,U)),U&&(K=U-f.presentationOffset),W){var O=j.endTime-j.startTime,z=Object(b.normalizePts)((j.startTime+K-F)*9e4,v*9e4)/9e4;j.startTime=z,j.endTime=z+O}var te=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(te)),j.id||(j.id=n(j.startTime,j.endTime,te)),j.endTime>0&&y.push(j)},C.onparsingerror=function(j){P=j},C.onflush=function(){if(P){S(P);return}m(y)},_.forEach(function(j){if(N)if(c(j,"X-TIMESTAMP-MAP=")){N=!1,W=!0,j.substr(16).split(",").forEach(function(A){c(A,"LOCAL:")?k=A.substr(6):c(A,"MPEGTS:")&&(g=parseInt(A.substr(7)))});try{F=o(k)/1e3}catch(A){W=!1,P=A}return}else j===""&&(N=!1);C.parse(j+`
`)}),C.flush()}},"./src/utils/xhr-loader.ts":function(G,R,I){"use strict";I.r(R);var L=I("./src/utils/logger.ts"),M=I("./src/loader/load-stats.ts"),p=/^age:\s*[\d.]+\s*$/m,E=function(){function b(c){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=c?c.xhrSetup:null,this.stats=new M.LoadStats,this.retryDelay=0}var i=b.prototype;return i.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},i.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()))},i.abort=function(){var o;this.abortInternal(),(o=this.callbacks)!==null&&o!==void 0&&o.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},i.load=function(o,h,n){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=h,this.callbacks=n,this.retryDelay=h.retryDelay,this.loadInternal()},i.loadInternal=function(){var o=this.config,h=this.context;if(!o)return;var n=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var t=this.xhrSetup;try{if(t)try{t(n,h.url)}catch(u){n.open("GET",h.url,!0),t(n,h.url)}n.readyState||n.open("GET",h.url,!0);var r=this.context.headers;if(r)for(var s in r)n.setRequestHeader(s,r[s])}catch(u){this.callbacks.onError({code:n.status,text:u.message},h,n);return}h.rangeEnd&&n.setRequestHeader("Range","bytes="+h.rangeStart+"-"+(h.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=h.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout),n.send()},i.readystatechange=function(){var o=this.context,h=this.loader,n=this.stats;if(!o||!h)return;var a=h.readyState,t=this.config;if(n.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start)),a===4){h.onreadystatechange=null,h.onprogress=null;var r=h.status;if(r>=200&&r<300){n.loading.end=Math.max(self.performance.now(),n.loading.first);var s,u;if(o.responseType==="arraybuffer"?(s=h.response,u=s.byteLength):(s=h.responseText,u=s.length),n.loaded=n.total=u,!this.callbacks)return;var f=this.callbacks.onProgress;if(f&&f(n,o,s,h),!this.callbacks)return;var d={url:h.responseURL,data:s};this.callbacks.onSuccess(d,n,o,h)}else n.retry>=t.maxRetry||r>=400&&r<499?(L.logger.error(r+" while loading "+o.url),this.callbacks.onError({code:r,text:h.statusText},o,h)):(L.logger.warn(r+" 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),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout)},i.loadtimeout=function(){L.logger.warn("timeout while loading "+this.context.url);var o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))},i.loadprogress=function(o){var h=this.stats;h.loaded=o.loaded,o.lengthComputable&&(h.total=o.total)},i.getCacheAge=function(){var o=null;if(this.loader&&p.test(this.loader.getAllResponseHeaders())){var h=this.loader.getResponseHeader("age");o=h?parseFloat(h):null}return o},b}();R.default=E}}).default})},vHTk:function(it,re,Q){it.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.getPointerEvent=G,re.stopEvent=R,re.setCapture=b,re.releaseCapture=i;function G(c){return c.changedTouches?c.changedTouches[0]:c.touches?c.touches[0]:c}function R(c){c.stopPropagation(),c.preventDefault()}var I=!1,L=null;document.captureElement=null;function M(c){if(I)return;var o=new c.constructor(c.type,c);I=!0,document.captureElement?document.captureElement.dispatchEvent(o):L.dispatchEvent(o),I=!1,c.stopPropagation(),o.defaultPrevented&&c.preventDefault(),c.type==="mouseup"&&i()}function p(){var c=document.getElementById("noVNC_mouse_capture_elem");c.style.cursor=window.getComputedStyle(document.captureElement).cursor}var E=new MutationObserver(p);function b(c){if(c.setCapture)c.setCapture(),document.captureElement=c,c.addEventListener("mouseup",i);else{i();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=c,E.observe(c,{attributes:!0}),p(),o.style.display="",window.addEventListener("mousemove",M),window.addEventListener("mouseup",M)}}function i(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;L=document.captureElement,document.captureElement=null,E.disconnect();var c=document.getElementById("noVNC_mouse_capture_elem");c.style.display="none",window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",M)}}},whVF:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G=Q("lNSK"),R=I(Q("1q3G"));function I(b){return b&&b.__esModule?b:{default:b}}function L(b,i){if(!(b instanceof i))throw new TypeError("Cannot call a class as a function")}function M(b,i){for(var c=0;c<i.length;c++){var o=i[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(b,o.key,o)}}function p(b,i,c){return i&&M(b.prototype,i),c&&M(b,c),b}var E=function(){function b(){L(this,b),this.strm=new R.default,this.chunkSize=1024*10*10,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,G.deflateInit)(this.strm,this.windowBits)}return p(b,[{key:"deflate",value:function(c){this.strm.input=c,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0,this.strm.output=this.outputBuffer,this.strm.avail_out=this.chunkSize,this.strm.next_out=0;var o=(0,G.deflate)(this.strm,G.Z_FULL_FLUSH),h=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(o<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){var n=[h],a=h.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,o=(0,G.deflate)(this.strm,G.Z_FULL_FLUSH),o<0)throw new Error("zlib deflate failed");var t=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);a+=t.length,n.push(t)}while(this.strm.avail_in>0);for(var r=new Uint8Array(a),s=0,u=0;u<n.length;u++)r.set(n[u],s),s+=n[u].length;h=r}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,h}}]),b}();re.default=E},xO64:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G=R(Q("8K/p"));function R(t){return t&&t.__esModule?t:{default:t}}function I(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(s){return typeof s}:I=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},I(t)}function L(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function M(t,r){for(var s=0;s<r.length;s++){var u=r[s];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,u.key,u)}}function p(t,r,s){return r&&M(t.prototype,r),s&&M(t,s),t}function E(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&b(t,r)}function b(t,r){return b=Object.setPrototypeOf||function(u,f){return u.__proto__=f,u},b(t,r)}function i(t){var r=h();return function(){var u=n(t),f;if(r){var d=n(this).constructor;f=Reflect.construct(u,arguments,d)}else f=u.apply(this,arguments);return c(this,f)}}function c(t,r){return r&&(I(r)==="object"||typeof r=="function")?r:o(t)}function o(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},n(t)}var a=function(t){E(s,t);var r=i(s);function s(){return L(this,s),r.apply(this,arguments)}return p(s,[{key:"_pngRect",value:function(f,d,v,m,S,C,_){var y=this._readData(S);return y===null?!1:(C.imageRect(f,d,v,m,"image/png",y),!0)}},{key:"_basicRect",value:function(f,d,v,m,S,C,_,y){throw new Error("BasicCompression received in TightPNG rect")}}]),s}(G.default);re.default=a},xSIq:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};re.default=G},xlC8:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=G;function G(R,I,L,M){for(var p=R&65535|0,E=R>>>16&65535|0,b=0;L!==0;){b=L>2e3?2e3:L,L-=b;do p=p+I[M++]|0,E=E+p|0;while(--b);p%=65521,E%=65521}return p|E<<16|0}}}]);