|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[223,5,6,7,17],{"+NIl":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/stex/stex.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){"use strict";e.defineMode("stex",(function(e,t){function r(e,t){e.cmdState.push(t)}function i(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function n(e,t,r){return function(){this.name=e,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 s={};function o(e,t){e.f=t}function a(e,t){var n;if(e.match(/^\\[a-zA-Z@]+/)){var a=e.current().slice(1);return r(t,n=new(n=s.hasOwnProperty(a)?s[a]:s.DEFAULT)),o(t,c),n.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return o(t,(function(e,t){return l(e,t,"\\]")})),"keyword";if(e.match("\\("))return o(t,(function(e,t){return l(e,t,"\\)")})),"keyword";if(e.match("$$"))return o(t,(function(e,t){return l(e,t,"$$")})),"keyword";if(e.match("$"))return o(t,(function(e,t){return l(e,t,"$")})),"keyword";var u=e.next();return"%"==u?(e.skipToEnd(),"comment"):"}"==u||"]"==u?(n=i(t))?(n.closeBracket(u),o(t,c),"bracket"):"error":"{"==u||"["==u?(r(t,n=new(n=s.DEFAULT)),"bracket"):/\d/.test(u)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(n=function(e){for(var t=e.cmdState,r=t.length-1;r>=0;r--){var i=t[r];if("DEFAULT"!=i.name)return i}return{styleIdentifier:function(){return null}}}(t)).name&&(n.argument=e.current()),n.styleIdentifier())}function l(e,t,r){if(e.eatSpace())return null;if(r&&e.match(r))return o(t,a),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=e.next();return"{"==i||"}"==i||"["==i||"]"==i||"("==i||")"==i?"bracket":"%"==i?(e.skipToEnd(),"comment"):"error"}function c(e,t){var r=e.peek();return"{"==r||"["==r?(i(t).openBracket(r),e.eat(r),o(t,a),"bracket"):/[ \t\r]/.test(r)?(e.eat(r),null):(o(t,a),function(e){var t=e.cmdState.pop();t&&t.closeBracket()}(t),a(e,t))}return s.importmodule=n("importmodule","tag",["string","builtin"]),s.documentclass=n("documentclass","tag",["","atom"]),s.usepackage=n("usepackage","tag",["atom"]),s.begin=n("begin","tag",["atom"]),s.end=n("end","tag",["atom"]),s.label=n("label","tag",["atom"]),s.ref=n("ref","tag",["atom"]),s.eqref=n("eqref","tag",["atom"]),s.cite=n("cite","tag",["atom"]),s.bibitem=n("bibitem","tag",["atom"]),s.Bibitem=n("Bibitem","tag",["atom"]),s.RBibitem=n("RBibitem","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return l(e,t)}:a}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=a,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(r(/*! ../../lib/codemirror */"VrN/"))},"/POA":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/xterm/lib/xterm.js ***!
|
|
|
\*****************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: Terminal */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){window,e.exports=function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=34)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0;var i=function(){function e(){this._listeners=[],this._disposed=!1}return Object.defineProperty(e.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(t){return e._listeners.push(t),{dispose:function(){if(!e._disposed)for(var r=0;r<e._listeners.length;r++)if(e._listeners[r]===t)return void e._listeners.splice(r,1)}}}),this._event},enumerable:!1,configurable:!0}),e.prototype.fire=function(e,t){for(var r=[],i=0;i<this._listeners.length;i++)r.push(this._listeners[i]);for(i=0;i<r.length;i++)r[i].call(void 0,e,t)},e.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},e}();t.EventEmitter=i,t.forwardEvent=function(e,t){return e((function(e){return t.fire(e)}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IUnicodeService=t.IOptionsService=t.ILogService=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;var i=r(14);t.IBufferService=i.createDecorator("BufferService"),t.ICoreMouseService=i.createDecorator("CoreMouseService"),t.ICoreService=i.createDecorator("CoreService"),t.ICharsetService=i.createDecorator("CharsetService"),t.IDirtyRowService=i.createDecorator("DirtyRowService"),t.IInstantiationService=i.createDecorator("InstantiationService"),t.ILogService=i.createDecorator("LogService"),t.IOptionsService=i.createDecorator("OptionsService"),t.IUnicodeService=i.createDecorator("UnicodeService")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.Disposable=void 0;var i=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0;for(var e=0,t=this._disposables;e<t.length;e++)t[e].dispose();this._disposables.length=0},e.prototype.register=function(e){return this._disposables.push(e),e},e.prototype.unregister=function(e){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)},e}();function n(e){for(var t=0,r=e;t<r.length;t++)r[t].dispose();e.length=0}t.Disposable=i,t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:function(){return n(e)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;var s=r(8),o=r(3),a=r(6),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.extended=new a.ExtendedAttrs,t.combinedData="",t}return n(t,e),t.fromCharData=function(e){var r=new t;return r.setFromCharData(e),r},t.prototype.isCombined=function(){return 2097152&this.content},t.prototype.getWidth=function(){return this.content>>22},t.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?s.stringFromCodePoint(2097151&this.content):""},t.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},t.prototype.setFromCharData=function(e){this.fg=e[o.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(e[o.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[o.CHAR_DATA_CHAR_INDEX].length){var r=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){var i=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(r-55296)+i-56320+65536|e[o.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[o.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[o.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[o.CHAR_DATA_WIDTH_INDEX]<<22)},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(a.AttributeData);t.CellData=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ISoundService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;var i=r(14);t.ICharSizeService=i.createDecorator("CharSizeService"),t.ICoreBrowserService=i.createDecorator("CoreBrowserService"),t.IMouseService=i.createDecorator("MouseService"),t.IRenderService=i.createDecorator("RenderService"),t.ISelectionService=i.createDecorator("SelectionService"),t.ISoundService=i.createDecorator("SoundService")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;var i=function(){function e(){this.fg=0,this.bg=0,this.extended=new n}return e.toColorRGB=function(e){return[e>>>16&255,e>>>8&255,255&e]},e.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},e.prototype.clone=function(){var t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t},e.prototype.isInverse=function(){return 67108864&this.fg},e.prototype.isBold=function(){return 134217728&this.fg},e.prototype.isUnderline=function(){return 268435456&this.fg},e.prototype.isBlink=function(){return 536870912&this.fg},e.prototype.isInvisible=function(){return 1073741824&this.fg},e.prototype.isItalic=function(){return 67108864&this.bg},e.prototype.isDim=function(){return 134217728&this.bg},e.prototype.getFgColorMode=function(){return 50331648&this.fg},e.prototype.getBgColorMode=function(){return 50331648&this.bg},e.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},e.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},e.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},e.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},e.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},e.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},e.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},e.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},e.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},e.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},e.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},e.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()},e.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},e.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()},e.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()},e.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()},e.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},e}();t.AttributeData=i;var n=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=-1),this.underlineStyle=e,this.underlineColor=t}return e.prototype.clone=function(){return new e(this.underlineStyle,this.underlineColor)},e.prototype.isEmpty=function(){return 0===this.underlineStyle},e}();t.ExtendedAttrs=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,r,i){e.addEventListener(t,r,i);var n=!1;return{dispose:function(){n||(n=!0,e.removeEventListener(t,r,i))}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length);for(var i="",n=t;n<r;++n){var s=e[n];s>65535?(s-=65536,i+=String.fromCharCode(55296+(s>>10))+String.fromCharCode(s%1024+56320)):i+=String.fromCharCode(s)}return i};var i=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i=0,n=0;this._interim&&(56320<=(a=e.charCodeAt(n++))&&a<=57343?t[i++]=1024*(this._interim-55296)+a-56320+65536:(t[i++]=this._interim,t[i++]=a),this._interim=0);for(var s=n;s<r;++s){var o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=r)return this._interim=o,i;var a;56320<=(a=e.charCodeAt(s))&&a<=57343?t[i++]=1024*(o-55296)+a-56320+65536:(t[i++]=o,t[i++]=a)}else t[i++]=o}return i},e}();t.StringToUtf32=i;var n=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i,n,s,o,a=0,l=0,c=0;if(this.interim[0]){var u=!1,h=this.interim[0];h&=192==(224&h)?31:224==(240&h)?15:7;for(var d=0,f=void 0;(f=63&this.interim[++d])&&d<4;)h<<=6,h|=f;for(var p=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,g=p-d;c<g;){if(c>=r)return 0;if(128!=(192&(f=e[c++]))){c--,u=!0;break}this.interim[d++]=f,h<<=6,h|=63&f}u||(2===p?h<128?c--:t[a++]=h:3===p?h<2048||h>=55296&&h<=57343||(t[a++]=h):h<65536||h>1114111||(t[a++]=h)),this.interim.fill(0)}for(var v=r-4,m=c;m<r;){for(;!(!(m<v)||128&(i=e[m])||128&(n=e[m+1])||128&(s=e[m+2])||128&(o=e[m+3]));)t[a++]=i,t[a++]=n,t[a++]=s,t[a++]=o,m+=4;if((i=e[m++])<128)t[a++]=i;else if(192==(224&i)){if(m>=r)return this.interim[0]=i,a;if(128!=(192&(n=e[m++]))){m--;continue}if((l=(31&i)<<6|63&n)<128){m--;continue}t[a++]=l}else if(224==(240&i)){if(m>=r)return this.interim[0]=i,a;if(128!=(192&(n=e[m++]))){m--;continue}if(m>=r)return this.interim[0]=i,this.interim[1]=n,a;if(128!=(192&(s=e[m++]))){m--;continue}if((l=(15&i)<<12|(63&n)<<6|63&s)<2048||l>=55296&&l<=57343)continue;t[a++]=l}else if(240==(248&i)){if(m>=r)return this.interim[0]=i,a;if(128!=(192&(n=e[m++]))){m--;continue}if(m>=r)return this.interim[0]=i,this.interim[1]=n,a;if(128!=(192&(s=e[m++]))){m--;continue}if(m>=r)return this.interim[0]=i,this.interim[1]=n,this.interim[2]=s,a;if(128!=(192&(o=e[m++]))){m--;continue}if((l=(7&i)<<18|(63&n)<<12|(63&s)<<6|63&o)<65536||l>1114111)continue;t[a++]=l}}return a},e}();t.Utf8ToUtf32=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR_ATLAS_CELL_SPACING=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0,t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,r){"use strict";var i,n,s,o;function a(e){var t=e.toString(16);return t.length<2?"0"+t:t}function l(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,function(e){e.toCss=function(e,t,r,i){return void 0!==i?"#"+a(e)+a(t)+a(r)+a(i):"#"+a(e)+a(t)+a(r)},e.toRgba=function(e,t,r,i){return void 0===i&&(i=255),(e<<24|t<<16|r<<8|i)>>>0}}(i=t.channels||(t.channels={})),(n=t.color||(t.color={})).blend=function(e,t){var r=(255&t.rgba)/255;if(1===r)return{css:t.css,rgba:t.rgba};var n=t.rgba>>24&255,s=t.rgba>>16&255,o=t.rgba>>8&255,a=e.rgba>>24&255,l=e.rgba>>16&255,c=e.rgba>>8&255,u=a+Math.round((n-a)*r),h=l+Math.round((s-l)*r),d=c+Math.round((o-c)*r);return{css:i.toCss(u,h,d),rgba:i.toRgba(u,h,d)}},n.isOpaque=function(e){return 255==(255&e.rgba)},n.ensureContrastRatio=function(e,t,r){var i=o.ensureContrastRatio(e.rgba,t.rgba,r);if(i)return o.toColor(i>>24&255,i>>16&255,i>>8&255)},n.opaque=function(e){var t=(255|e.rgba)>>>0,r=o.toChannels(t),n=r[0],s=r[1],a=r[2];return{css:i.toCss(n,s,a),rgba:t}},n.opacity=function(e,t){var r=Math.round(255*t),n=o.toChannels(e.rgba),s=n[0],a=n[1],l=n[2];return{css:i.toCss(s,a,l,r),rgba:i.toRgba(s,a,l,r)}},(t.css||(t.css={})).toColor=function(e){switch(e.length){case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,r){var i=e/255,n=t/255,s=r/255;return.2126*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(s=t.rgb||(t.rgb={})),function(e){function t(e,t,r){for(var i=e>>24&255,n=e>>16&255,o=e>>8&255,a=t>>24&255,c=t>>16&255,u=t>>8&255,h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(i,n,o));h<r&&(a>0||c>0||u>0);)a-=Math.max(0,Math.ceil(.1*a)),c-=Math.max(0,Math.ceil(.1*c)),u-=Math.max(0,Math.ceil(.1*u)),h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(i,n,o));return(a<<24|c<<16|u<<8|255)>>>0}function r(e,t,r){for(var i=e>>24&255,n=e>>16&255,o=e>>8&255,a=t>>24&255,c=t>>16&255,u=t>>8&255,h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(i,n,o));h<r&&(a<255||c<255||u<255);)a=Math.min(255,a+Math.ceil(.1*(255-a))),c=Math.min(255,c+Math.ceil(.1*(255-c))),u=Math.min(255,u+Math.ceil(.1*(255-u))),h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(i,n,o));return(a<<24|c<<16|u<<8|255)>>>0}e.ensureContrastRatio=function(e,i,n){var o=s.relativeLuminance(e>>8),a=s.relativeLuminance(i>>8);if(l(o,a)<n)return a<o?t(e,i,n):r(e,i,n)},e.reduceLuminance=t,e.increaseLuminance=r,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,r){return{css:i.toCss(e,t,r),rgba:i.toRgba(e,t,r)}}}(o=t.rgba||(t.rgba={})),t.toPaddedHex=a,t.contrastRatio=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isFirefox=void 0;var i="undefined"==typeof navigator,n=i?"node":navigator.userAgent,s=i?"node":navigator.platform;function o(e,t){return e.indexOf(t)>=0}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMac=o(["Macintosh","MacIntel","MacPPC","Mac68K"],s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=o(["Windows","Win16","Win32","WinCE"],s),t.isLinux=s.indexOf("Linux")>=0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(t.C0||(t.C0={})),function(e){e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""}(t.C1||(t.C1={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;var i=r(3),n=r(9),s=r(25),o=r(6),a=r(28),l=r(10),c=r(17),u=function(){function e(e,t,r,i,n,s,o,a){this._container=e,this._alpha=i,this._colors=n,this._rendererId=s,this._bufferService=o,this._optionsService=a,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-"+t+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){var e;c.removeElementFromParent(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()},e.prototype._initCanvas=function(){this._ctx=a.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},e.prototype.onOptionsChanged=function(){},e.prototype.onBlur=function(){},e.prototype.onFocus=function(){},e.prototype.onCursorMove=function(){},e.prototype.onGridChanged=function(e,t){},e.prototype.onSelectionChanged=function(e,t,r){void 0===r&&(r=!1)},e.prototype.setColors=function(e){this._refreshCharAtlas(e)},e.prototype._setTransparency=function(e){if(e!==this._alpha){var t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},e.prototype._refreshCharAtlas=function(e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=s.acquireCharAtlas(this._optionsService.options,this._rendererId,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},e.prototype._fillCells=function(e,t,r,i){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight)},e.prototype._fillBottomLineAtCells=function(e,t,r){void 0===r&&(r=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},e.prototype._fillLeftLineAtCell=function(e,t,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*r,this._scaledCellHeight)},e.prototype._strokeRectAtCell=function(e,t,r,i){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,i*this._scaledCellHeight-window.devicePixelRatio)},e.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))},e.prototype._clearCells=function(e,t,r,i){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight))},e.prototype._fillCharTrueColor=function(e,t,r){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(r),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype._drawChars=function(e,t,r){var s,o,a=this._getContrastColor(e);a||e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(e,t,r,a):(e.isInverse()?(s=e.isBgDefault()?n.INVERTED_DEFAULT_COLOR:e.getBgColor(),o=e.isFgDefault()?n.INVERTED_DEFAULT_COLOR:e.getFgColor()):(o=e.isBgDefault()?i.DEFAULT_COLOR:e.getBgColor(),s=e.isFgDefault()?i.DEFAULT_COLOR:e.getFgColor()),s+=this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&s<8?8:0,this._currentGlyphIdentifier.chars=e.getChars()||i.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||i.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=o,this._currentGlyphIdentifier.fg=s,this._currentGlyphIdentifier.bold=!!e.isBold(),this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,r))},e.prototype._drawUncachedChars=function(e,t,r,i){if(this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse())if(i)this._ctx.fillStyle=i.css;else if(e.isBgDefault())this._ctx.fillStyle=l.color.opaque(this._colors.background).css;else if(e.isBgRGB())this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var s=e.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}else if(i)this._ctx.fillStyle=i.css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var a=e.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&a<8&&(a+=8),this._ctx.fillStyle=this._colors.ansi[a].css}this._clipRow(r),e.isDim()&&(this._ctx.globalAlpha=n.DIM_OPACITY),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t){return(t?"italic":"")+" "+(e?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},e.prototype._getContrastColor=function(e){if(1!==this._optionsService.options.minimumContrastRatio){var t=this._colors.contrastCache.getColor(e.bg,e.fg);if(void 0!==t)return t||void 0;var r=e.getFgColor(),i=e.getFgColorMode(),n=e.getBgColor(),s=e.getBgColorMode(),o=!!e.isInverse(),a=!!e.isInverse();if(o){var c=r;r=n,n=c;var u=i;i=s,s=u}var h=this._resolveBackgroundRgba(s,n,o),d=this._resolveForegroundRgba(i,r,o,a),f=l.rgba.ensureContrastRatio(h,d,this._optionsService.options.minimumContrastRatio);if(f){var p={css:l.channels.toCss(f>>24&255,f>>16&255,f>>8&255),rgba:f};return this._colors.contrastCache.setColor(e.bg,e.fg,p),p}this._colors.contrastCache.setColor(e.bg,e.fg,null)}},e.prototype._resolveBackgroundRgba=function(e,t,r){switch(e){case 16777216:case 33554432:return this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return r?this._colors.foreground.rgba:this._colors.background.rgba}},e.prototype._resolveForegroundRgba=function(e,t,r,i){switch(e){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&i&&t<8&&(t+=8),this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return r?this._colors.background.rgba:this._colors.foreground.rgba}},e}();t.BaseRenderLayer=u},function(e,t,r){"use strict";function i(e,t,r){t.di$target===t?t.di$dependencies.push({id:e,index:r}):(t.di$dependencies=[{id:e,index:r}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);var r=function(e,t,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i(r,e,n)};return r.toString=function(){return e},t.serviceRegistry.set(e,r),r}},function(e,t,r){"use strict";function i(e,t,r,i){if(void 0===r&&(r=0),void 0===i&&(i=e.length),r>=e.length)return e;r=(e.length+r)%e.length,i=i>=e.length?e.length:(e.length+i)%e.length;for(var n=r;n<i;++n)e[n]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,r,n){return e.fill?e.fill(t,r,n):i(e,t,r,n)},t.fillFallback=i,t.concat=function(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;var i=r(8),n=r(3),s=r(4),o=r(6);t.DEFAULT_ATTR_DATA=Object.freeze(new o.AttributeData);var a=function(){function e(e,t,r){void 0===r&&(r=!1),this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);for(var i=t||s.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),o=0;o<e;++o)this.setCell(o,i);this.length=e}return e.prototype.get=function(e){var t=this._data[3*e+0],r=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:r?i.stringFromCodePoint(r):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):r]},e.prototype.set=function(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[3*e+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},e.prototype.getFg=function(e){return this._data[3*e+1]},e.prototype.getBg=function(e){return this._data[3*e+2]},e.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},e.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},e.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?i.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var r=3*e;return t.content=this._data[r+0],t.fg=this._data[r+1],t.bg=this._data[r+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,r,i,n,s){268435456&n&&(this._extendedAttrs[e]=s),this._data[3*e+0]=t|r<<22,this._data[3*e+1]=i,this._data[3*e+2]=n},e.prototype.addCodepointToCell=function(e,t){var r=this._data[3*e+0];2097152&r?this._combined[e]+=i.stringFromCodePoint(t):(2097151&r?(this._combined[e]=i.stringFromCodePoint(2097151&r)+i.stringFromCodePoint(t),r&=-2097152,r|=2097152):r=t|1<<22,this._data[3*e+0]=r)},e.prototype.insertCells=function(e,t,r,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new o.ExtendedAttrs),t<this.length-e){for(var n=new s.CellData,a=this.length-e-t-1;a>=0;--a)this.setCell(e+t+a,this.loadCell(e+a,n));for(a=0;a<t;++a)this.setCell(e+a,r)}else for(a=e;a<this.length;++a)this.setCell(a,r);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new o.ExtendedAttrs)},e.prototype.deleteCells=function(e,t,r,i){if(e%=this.length,t<this.length-e){for(var n=new s.CellData,a=0;a<this.length-e-t;++a)this.setCell(e+a,this.loadCell(e+t+a,n));for(a=this.length-t;a<this.length;++a)this.setCell(a,r)}else for(a=e;a<this.length;++a)this.setCell(a,r);e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new o.ExtendedAttrs),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new o.ExtendedAttrs)},e.prototype.replaceCells=function(e,t,r,i){for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new o.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new o.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,r)},e.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var r=new Uint32Array(3*e);this.length&&(3*e<this._data.length?r.set(this._data.subarray(0,3*e)):r.set(this._data)),this._data=r;for(var i=this.length;i<e;++i)this.setCell(i,t)}else if(e){(r=new Uint32Array(3*e)).set(this._data.subarray(0,3*e)),this._data=r;var n=Object.keys(this._combined);for(i=0;i<n.length;i++){var s=parseInt(n[i],10);s>=e&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={},this._extendedAttrs={};for(var t=0;t<this.length;++t)this.setCell(t,e)},e.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];for(var t in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped},e.prototype.clone=function(){var t=new e(0);for(var r in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[r]=this._combined[r];for(var r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t},e.prototype.getTrimmedLength=function(){for(var e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,r,i,n){var s=e._data;if(n)for(var o=i-1;o>=0;o--)for(var a=0;a<3;a++)this._data[3*(r+o)+a]=s[3*(t+o)+a];else for(o=0;o<i;o++)for(a=0;a<3;a++)this._data[3*(r+o)+a]=s[3*(t+o)+a];var l=Object.keys(e._combined);for(a=0;a<l.length;a++){var c=parseInt(l[a],10);c>=t&&(this._combined[c-t+r]=e._combined[c])}},e.prototype.translateToString=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===r&&(r=this.length),e&&(r=Math.min(r,this.getTrimmedLength()));for(var s="";t<r;){var o=this._data[3*t+0],a=2097151&o;s+=2097152&o?this._combined[t]:a?i.stringFromCodePoint(a):n.WHITESPACE_CELL_CHAR,t+=o>>22||1}return s},e}();t.BufferLine=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var i=0,n=t;i<n.length;i++){var s=n[i];null===(e=null==s?void 0:s.parentElement)||void 0===e||e.removeChild(s)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;var s,o=r(12),a=r(20),l=r(39),c=r(2),u=r(15),h=r(8),d=r(16),f=r(0),p=r(3),g=r(4),v=r(6),m=r(22),_=r(24),y={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function b(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(s=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));var S=function(){function e(e,t,r,i){this._bufferService=e,this._coreService=t,this._logService=r,this._optionsService=i,this._data=new Uint32Array(0)}return e.prototype.hook=function(e){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,r){this._data=u.concat(this._data,e.subarray(t,r))},e.prototype.unhook=function(e){if(e){var t=h.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':return this._coreService.triggerDataEvent(o.C0.ESC+'P1$r0"q'+o.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(o.C0.ESC+'P1$r61;1"p'+o.C0.ESC+"\\");case"r":var r=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(o.C0.ESC+"P1$r"+r+o.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(o.C0.ESC+"P1$r0m"+o.C0.ESC+"\\");case" q":var i={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return i-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(o.C0.ESC+"P1$r"+i+" q"+o.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",t),this._coreService.triggerDataEvent(o.C0.ESC+"P0$r"+o.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},e}(),w=function(e){function t(t,r,i,n,s,c,u,p,v){void 0===v&&(v=new l.EscapeSequenceParser);var _=e.call(this)||this;_._bufferService=t,_._charsetService=r,_._coreService=i,_._dirtyRowService=n,_._logService=s,_._optionsService=c,_._coreMouseService=u,_._unicodeService=p,_._parser=v,_._parseBuffer=new Uint32Array(4096),_._stringDecoder=new h.StringToUtf32,_._utf8Decoder=new h.Utf8ToUtf32,_._workCell=new g.CellData,_._windowTitle="",_._iconName="",_._windowTitleStack=[],_._iconNameStack=[],_._curAttrData=d.DEFAULT_ATTR_DATA.clone(),_._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),_._onRequestBell=new f.EventEmitter,_._onRequestRefreshRows=new f.EventEmitter,_._onRequestReset=new f.EventEmitter,_._onRequestScroll=new f.EventEmitter,_._onRequestSyncScrollBar=new f.EventEmitter,_._onRequestWindowsOptionsReport=new f.EventEmitter,_._onA11yChar=new f.EventEmitter,_._onA11yTab=new f.EventEmitter,_._onCursorMove=new f.EventEmitter,_._onLineFeed=new f.EventEmitter,_._onScroll=new f.EventEmitter,_._onTitleChange=new f.EventEmitter,_.register(_._parser),_._parser.setCsiHandlerFallback((function(e,t){_._logService.debug("Unknown CSI code: ",{identifier:_._parser.identToString(e),params:t.toArray()})})),_._parser.setEscHandlerFallback((function(e){_._logService.debug("Unknown ESC code: ",{identifier:_._parser.identToString(e)})})),_._parser.setExecuteHandlerFallback((function(e){_._logService.debug("Unknown EXECUTE code: ",{code:e})})),_._parser.setOscHandlerFallback((function(e,t,r){_._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:r})})),_._parser.setDcsHandlerFallback((function(e,t,r){"HOOK"===t&&(r=r.toArray()),_._logService.debug("Unknown DCS code: ",{identifier:_._parser.identToString(e),action:t,payload:r})})),_._parser.setPrintHandler((function(e,t,r){return _.print(e,t,r)})),_._parser.setCsiHandler({final:"@"},(function(e){return _.insertChars(e)})),_._parser.setCsiHandler({intermediates:" ",final:"@"},(function(e){return _.scrollLeft(e)})),_._parser.setCsiHandler({final:"A"},(function(e){return _.cursorUp(e)})),_._parser.setCsiHandler({intermediates:" ",final:"A"},(function(e){return _.scrollRight(e)})),_._parser.setCsiHandler({final:"B"},(function(e){return _.cursorDown(e)})),_._parser.setCsiHandler({final:"C"},(function(e){return _.cursorForward(e)})),_._parser.setCsiHandler({final:"D"},(function(e){return _.cursorBackward(e)})),_._parser.setCsiHandler({final:"E"},(function(e){return _.cursorNextLine(e)})),_._parser.setCsiHandler({final:"F"},(function(e){return _.cursorPrecedingLine(e)})),_._parser.setCsiHandler({final:"G"},(function(e){return _.cursorCharAbsolute(e)})),_._parser.setCsiHandler({final:"H"},(function(e){return _.cursorPosition(e)})),_._parser.setCsiHandler({final:"I"},(function(e){return _.cursorForwardTab(e)})),_._parser.setCsiHandler({final:"J"},(function(e){return _.eraseInDisplay(e)})),_._parser.setCsiHandler({prefix:"?",final:"J"},(function(e){return _.eraseInDisplay(e)})),_._parser.setCsiHandler({final:"K"},(function(e){return _.eraseInLine(e)})),_._parser.setCsiHandler({prefix:"?",final:"K"},(function(e){return _.eraseInLine(e)})),_._parser.setCsiHandler({final:"L"},(function(e){return _.insertLines(e)})),_._parser.setCsiHandler({final:"M"},(function(e){return _.deleteLines(e)})),_._parser.setCsiHandler({final:"P"},(function(e){return _.deleteChars(e)})),_._parser.setCsiHandler({final:"S"},(function(e){return _.scrollUp(e)})),_._parser.setCsiHandler({final:"T"},(function(e){return _.scrollDown(e)})),_._parser.setCsiHandler({final:"X"},(function(e){return _.eraseChars(e)})),_._parser.setCsiHandler({final:"Z"},(function(e){return _.cursorBackwardTab(e)})),_._parser.setCsiHandler({final:"`"},(function(e){return _.charPosAbsolute(e)})),_._parser.setCsiHandler({final:"a"},(function(e){return _.hPositionRelative(e)})),_._parser.setCsiHandler({final:"b"},(function(e){return _.repeatPrecedingCharacter(e)})),_._parser.setCsiHandler({final:"c"},(function(e){return _.sendDeviceAttributesPrimary(e)})),_._parser.setCsiHandler({prefix:">",final:"c"},(function(e){return _.sendDeviceAttributesSecondary(e)})),_._parser.setCsiHandler({final:"d"},(function(e){return _.linePosAbsolute(e)})),_._parser.setCsiHandler({final:"e"},(function(e){return _.vPositionRelative(e)})),_._parser.setCsiHandler({final:"f"},(function(e){return _.hVPosition(e)})),_._parser.setCsiHandler({final:"g"},(function(e){return _.tabClear(e)})),_._parser.setCsiHandler({final:"h"},(function(e){return _.setMode(e)})),_._parser.setCsiHandler({prefix:"?",final:"h"},(function(e){return _.setModePrivate(e)})),_._parser.setCsiHandler({final:"l"},(function(e){return _.resetMode(e)})),_._parser.setCsiHandler({prefix:"?",final:"l"},(function(e){return _.resetModePrivate(e)})),_._parser.setCsiHandler({final:"m"},(function(e){return _.charAttributes(e)})),_._parser.setCsiHandler({final:"n"},(function(e){return _.deviceStatus(e)})),_._parser.setCsiHandler({prefix:"?",final:"n"},(function(e){return _.deviceStatusPrivate(e)})),_._parser.setCsiHandler({intermediates:"!",final:"p"},(function(e){return _.softReset(e)})),_._parser.setCsiHandler({intermediates:" ",final:"q"},(function(e){return _.setCursorStyle(e)})),_._parser.setCsiHandler({final:"r"},(function(e){return _.setScrollRegion(e)})),_._parser.setCsiHandler({final:"s"},(function(e){return _.saveCursor(e)})),_._parser.setCsiHandler({final:"t"},(function(e){return _.windowOptions(e)})),_._parser.setCsiHandler({final:"u"},(function(e){return _.restoreCursor(e)})),_._parser.setCsiHandler({intermediates:"'",final:"}"},(function(e){return _.insertColumns(e)})),_._parser.setCsiHandler({intermediates:"'",final:"~"},(function(e){return _.deleteColumns(e)})),_._parser.setExecuteHandler(o.C0.BEL,(function(){return _.bell()})),_._parser.setExecuteHandler(o.C0.LF,(function(){return _.lineFeed()})),_._parser.setExecuteHandler(o.C0.VT,(function(){return _.lineFeed()})),_._parser.setExecuteHandler(o.C0.FF,(function(){return _.lineFeed()})),_._parser.setExecuteHandler(o.C0.CR,(function(){return _.carriageReturn()})),_._parser.setExecuteHandler(o.C0.BS,(function(){return _.backspace()})),_._parser.setExecuteHandler(o.C0.HT,(function(){return _.tab()})),_._parser.setExecuteHandler(o.C0.SO,(function(){return _.shiftOut()})),_._parser.setExecuteHandler(o.C0.SI,(function(){return _.shiftIn()})),_._parser.setExecuteHandler(o.C1.IND,(function(){return _.index()})),_._parser.setExecuteHandler(o.C1.NEL,(function(){return _.nextLine()})),_._parser.setExecuteHandler(o.C1.HTS,(function(){return _.tabSet()})),_._parser.setOscHandler(0,new m.OscHandler((function(e){_.setTitle(e),_.setIconName(e)}))),_._parser.setOscHandler(1,new m.OscHandler((function(e){return _.setIconName(e)}))),_._parser.setOscHandler(2,new m.OscHandler((function(e){return _.setTitle(e)}))),_._parser.setEscHandler({final:"7"},(function(){return _.saveCursor()})),_._parser.setEscHandler({final:"8"},(function(){return _.restoreCursor()})),_._parser.setEscHandler({final:"D"},(function(){return _.index()})),_._parser.setEscHandler({final:"E"},(function(){return _.nextLine()})),_._parser.setEscHandler({final:"H"},(function(){return _.tabSet()})),_._parser.setEscHandler({final:"M"},(function(){return _.reverseIndex()})),_._parser.setEscHandler({final:"="},(function(){return _.keypadApplicationMode()})),_._parser.setEscHandler({final:">"},(function(){return _.keypadNumericMode()})),_._parser.setEscHandler({final:"c"},(function(){return _.fullReset()})),_._parser.setEscHandler({final:"n"},(function(){return _.setgLevel(2)})),_._parser.setEscHandler({final:"o"},(function(){return _.setgLevel(3)})),_._parser.setEscHandler({final:"|"},(function(){return _.setgLevel(3)})),_._parser.setEscHandler({final:"}"},(function(){return _.setgLevel(2)})),_._parser.setEscHandler({final:"~"},(function(){return _.setgLevel(1)})),_._parser.setEscHandler({intermediates:"%",final:"@"},(function(){return _.selectDefaultCharset()})),_._parser.setEscHandler({intermediates:"%",final:"G"},(function(){return _.selectDefaultCharset()}));var y=function(e){b._parser.setEscHandler({intermediates:"(",final:e},(function(){return _.selectCharset("("+e)})),b._parser.setEscHandler({intermediates:")",final:e},(function(){return _.selectCharset(")"+e)})),b._parser.setEscHandler({intermediates:"*",final:e},(function(){return _.selectCharset("*"+e)})),b._parser.setEscHandler({intermediates:"+",final:e},(function(){return _.selectCharset("+"+e)})),b._parser.setEscHandler({intermediates:"-",final:e},(function(){return _.selectCharset("-"+e)})),b._parser.setEscHandler({intermediates:".",final:e},(function(){return _.selectCharset("."+e)})),b._parser.setEscHandler({intermediates:"/",final:e},(function(){return _.selectCharset("/"+e)}))},b=this;for(var w in a.CHARSETS)y(w);return _._parser.setEscHandler({intermediates:"#",final:"8"},(function(){return _.screenAlignmentPattern()})),_._parser.setErrorHandler((function(e){return _._logService.error("Parsing error: ",e),e})),_._parser.setDcsHandler({intermediates:"$",final:"q"},new S(_._bufferService,_._coreService,_._logService,_._optionsService)),_}return n(t,e),Object.defineProperty(t.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.parse=function(e){var t=this._bufferService.buffer,r=t.x,i=t.y;if(this._logService.debug("parsing data",e),this._parseBuffer.length<e.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(e.length,131072))),this._dirtyRowService.clearRange(),e.length>131072)for(var n=0;n<e.length;n+=131072){var s=n+131072<e.length?n+131072:e.length,o="string"==typeof e?this._stringDecoder.decode(e.substring(n,s),this._parseBuffer):this._utf8Decoder.decode(e.subarray(n,s),this._parseBuffer);this._parser.parse(this._parseBuffer,o)}else o="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer),this._parser.parse(this._parseBuffer,o);(t=this._bufferService.buffer).x===r&&t.y===i||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},t.prototype.print=function(e,t,r){var i,n,s=this._bufferService.buffer,o=this._charsetService.charset,a=this._optionsService.options.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData,f=s.lines.get(s.ybase+s.y);this._dirtyRowService.markDirty(s.y),s.x&&r-t>0&&2===f.getWidth(s.x-1)&&f.setCellFromCodePoint(s.x-1,0,1,d.fg,d.bg,d.extended);for(var g=t;g<r;++g){if(i=e[g],n=this._unicodeService.wcwidth(i),i<127&&o){var v=o[String.fromCharCode(i)];v&&(i=v.charCodeAt(0))}if(a&&this._onA11yChar.fire(h.stringFromCodePoint(i)),n||!s.x){if(s.x+n-1>=l)if(c){for(;s.x<l;)f.setCellFromCodePoint(s.x++,0,1,d.fg,d.bg,d.extended);s.x=0,s.y++,s.y===s.scrollBottom+1?(s.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(s.y>=this._bufferService.rows&&(s.y=this._bufferService.rows-1),s.lines.get(s.ybase+s.y).isWrapped=!0),f=s.lines.get(s.ybase+s.y)}else if(s.x=l-1,2===n)continue;if(u&&(f.insertCells(s.x,n,s.getNullCell(d),d),2===f.getWidth(l-1)&&f.setCellFromCodePoint(l-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,d.fg,d.bg,d.extended)),f.setCellFromCodePoint(s.x++,i,n,d.fg,d.bg,d.extended),n>0)for(;--n;)f.setCellFromCodePoint(s.x++,0,0,d.fg,d.bg,d.extended)}else f.getWidth(s.x-1)?f.addCodepointToCell(s.x-1,i):f.addCodepointToCell(s.x-2,i)}r-t>0&&(f.loadCell(s.x-1,this._workCell),2===this._workCell.getWidth()||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),s.x<l&&r-t>0&&0===f.getWidth(s.x)&&!f.hasContent(s.x)&&f.setCellFromCodePoint(s.x,0,1,d.fg,d.bg,d.extended),this._dirtyRowService.markDirty(s.y)},t.prototype.addCsiHandler=function(e,t){var r=this;return"t"!==e.final||e.prefix||e.intermediates?this._parser.addCsiHandler(e,t):this._parser.addCsiHandler(e,(function(e){return!b(e.params[0],r._optionsService.options.windowOptions)||t(e)}))},t.prototype.addDcsHandler=function(e,t){return this._parser.addDcsHandler(e,new _.DcsHandler(t))},t.prototype.addEscHandler=function(e,t){return this._parser.addEscHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,new m.OscHandler(t))},t.prototype.bell=function(){this._onRequestBell.fire()},t.prototype.lineFeed=function(){var e=this._bufferService.buffer;this._dirtyRowService.markDirty(e.y),this._optionsService.options.convertEol&&(e.x=0),e.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire()},t.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},t.prototype.backspace=function(){var e,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(0===t.x&&t.y>t.scrollTop&&t.y<=t.scrollBottom&&(null===(e=t.lines.get(t.ybase+t.y))||void 0===e?void 0:e.isWrapped)){t.lines.get(t.ybase+t.y).isWrapped=!1,t.y--,t.x=this._bufferService.cols-1;var r=t.lines.get(t.ybase+t.y);r.hasWidth(t.x)&&!r.hasContent(t.x)&&t.x--}this._restrictCursor()},t.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var e=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-e)}},t.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},t.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},t.prototype._restrictCursor=function(e){void 0===e&&(e=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(e,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)},t.prototype._setCursor=function(e,t){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=e,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+t):(this._bufferService.buffer.x=e,this._bufferService.buffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},t.prototype.cursorUp=function(e){var t=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1))},t.prototype.cursorDown=function(e){var t=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1)},t.prototype.cursorForward=function(e){this._moveCursor(e.params[0]||1,0)},t.prototype.cursorBackward=function(e){this._moveCursor(-(e.params[0]||1),0)},t.prototype.cursorNextLine=function(e){this.cursorDown(e),this._bufferService.buffer.x=0},t.prototype.cursorPrecedingLine=function(e){this.cursorUp(e),this._bufferService.buffer.x=0},t.prototype.cursorCharAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},t.prototype.cursorPosition=function(e){this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1)},t.prototype.charPosAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},t.prototype.hPositionRelative=function(e){this._moveCursor(e.params[0]||1,0)},t.prototype.linePosAbsolute=function(e){this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1)},t.prototype.vPositionRelative=function(e){this._moveCursor(0,e.params[0]||1)},t.prototype.hVPosition=function(e){this.cursorPosition(e)},t.prototype.tabClear=function(e){var t=e.params[0];0===t?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===t&&(this._bufferService.buffer.tabs={})},t.prototype.cursorForwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1;t--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},t.prototype.cursorBackwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1,r=this._bufferService.buffer;t--;)r.x=r.prevStop()},t.prototype._eraseInBufferLine=function(e,t,r,i){void 0===i&&(i=!1);var n=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);n.replaceCells(t,r,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i&&(n.isWrapped=!1)},t.prototype._resetBufferLine=function(e){var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);t.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),t.isWrapped=!1},t.prototype.eraseInDisplay=function(e){var t;switch(this._restrictCursor(),e.params[0]){case 0:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t++,this._bufferService.buffer.x,this._bufferService.cols,0===this._bufferService.buffer.x);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 r=this._bufferService.buffer.lines.length-this._bufferService.rows;r>0&&(this._bufferService.buffer.lines.trimStart(r),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-r,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-r,0),this._onScroll.fire(0))}},t.prototype.eraseInLine=function(e){switch(this._restrictCursor(),e.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)},t.prototype.insertLines=function(e){this._restrictCursor();var t=e.params[0]||1,r=this._bufferService.buffer;if(!(r.y>r.scrollBottom||r.y<r.scrollTop)){for(var i=r.ybase+r.y,n=this._bufferService.rows-1-r.scrollBottom,s=this._bufferService.rows-1+r.ybase-n+1;t--;)r.lines.splice(s-1,1),r.lines.splice(i,0,r.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(r.y,r.scrollBottom),r.x=0}},t.prototype.deleteLines=function(e){this._restrictCursor();var t=e.params[0]||1,r=this._bufferService.buffer;if(!(r.y>r.scrollBottom||r.y<r.scrollTop)){var i,n=r.ybase+r.y;for(i=this._bufferService.rows-1-r.scrollBottom,i=this._bufferService.rows-1+r.ybase-i;t--;)r.lines.splice(n,1),r.lines.splice(i,0,r.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(r.y,r.scrollBottom),r.x=0}},t.prototype.insertChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.insertCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.deleteChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.deleteCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.scrollUp=function(e){for(var t=e.params[0]||1,r=this._bufferService.buffer;t--;)r.lines.splice(r.ybase+r.scrollTop,1),r.lines.splice(r.ybase+r.scrollBottom,0,r.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(r.scrollTop,r.scrollBottom)},t.prototype.scrollDown=function(e){for(var t=e.params[0]||1,r=this._bufferService.buffer;t--;)r.lines.splice(r.ybase+r.scrollBottom,1),r.lines.splice(r.ybase+r.scrollTop,0,r.getBlankLine(d.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(r.scrollTop,r.scrollBottom)},t.prototype.scrollLeft=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=t.lines.get(t.ybase+i);n.deleteCells(0,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.scrollRight=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=t.lines.get(t.ybase+i);n.insertCells(0,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.insertColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=this._bufferService.buffer.lines.get(t.ybase+i);n.insertCells(t.x,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.deleteColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=t.lines.get(t.ybase+i);n.deleteCells(t.x,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.eraseChars=function(e){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+(e.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.repeatPrecedingCharacter=function(e){if(this._parser.precedingCodepoint){for(var t=e.params[0]||1,r=new Uint32Array(t),i=0;i<t;++i)r[i]=this._parser.precedingCodepoint;this.print(r,0,r.length)}},t.prototype.sendDeviceAttributesPrimary=function(e){e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c"))},t.prototype.sendDeviceAttributesSecondary=function(e){e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c"))},t.prototype._is=function(e){return 0===(this._optionsService.options.termName+"").indexOf(e)},t.prototype.setMode=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0}},t.prototype.setModePrivate=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,a.DEFAULT_CHARSET),this._charsetService.setgCharset(1,a.DEFAULT_CHARSET),this._charsetService.setgCharset(2,a.DEFAULT_CHARSET),this._charsetService.setgCharset(3,a.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}},t.prototype.resetMode=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1}},t.prototype.resetModePrivate=function(e){for(var t=0;t<e.length;t++)switch(e.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(),1049===e.params[t]&&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}},t.prototype._updateAttrColor=function(e,t,r,i,n){return 2===t?(e|=50331648,e&=-16777216,e|=v.AttributeData.fromColorRGB([r,i,n])):5===t&&(e&=-50331904,e|=33554432|255&r),e},t.prototype._extractColor=function(e,t,r){var i=[0,0,-1,0,0,0],n=0,s=0;do{if(i[s+n]=e.params[t+s],e.hasSubParams(t+s)){var o=e.getSubParams(t+s),a=0;do{5===i[1]&&(n=1),i[s+a+1+n]=o[a]}while(++a<o.length&&a+s+1+n<i.length);break}if(5===i[1]&&s+n>=2||2===i[1]&&s+n>=5)break;i[1]&&(n=1)}while(++s+t<e.length&&s+n<i.length);for(a=2;a<i.length;++a)-1===i[a]&&(i[a]=0);switch(i[0]){case 38:r.fg=this._updateAttrColor(r.fg,i[1],i[3],i[4],i[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,i[1],i[3],i[4],i[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,i[1],i[3],i[4],i[5])}return s},t.prototype._processUnderline=function(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()},t.prototype.charAttributes=function(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=d.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=d.DEFAULT_ATTR_DATA.bg);for(var t,r=e.length,i=this._curAttrData,n=0;n<r;n++)(t=e.params[n])>=30&&t<=37?(i.fg&=-50331904,i.fg|=16777216|t-30):t>=40&&t<=47?(i.bg&=-50331904,i.bg|=16777216|t-40):t>=90&&t<=97?(i.fg&=-50331904,i.fg|=16777224|t-90):t>=100&&t<=107?(i.bg&=-50331904,i.bg|=16777224|t-100):0===t?(i.fg=d.DEFAULT_ATTR_DATA.fg,i.bg=d.DEFAULT_ATTR_DATA.bg):1===t?i.fg|=134217728:3===t?i.bg|=67108864:4===t?(i.fg|=268435456,this._processUnderline(e.hasSubParams(n)?e.getSubParams(n)[0]:1,i)):5===t?i.fg|=536870912:7===t?i.fg|=67108864:8===t?i.fg|=1073741824:2===t?i.bg|=134217728:21===t?this._processUnderline(2,i):22===t?(i.fg&=-134217729,i.bg&=-134217729):23===t?i.bg&=-67108865:24===t?i.fg&=-268435457:25===t?i.fg&=-536870913:27===t?i.fg&=-67108865:28===t?i.fg&=-1073741825:39===t?(i.fg&=-67108864,i.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):49===t?(i.bg&=-67108864,i.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):38===t||48===t||58===t?n+=this._extractColor(e,n,i):59===t?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):100===t?(i.fg&=-67108864,i.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,i.bg&=-67108864,i.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",t)},t.prototype.deviceStatus=function(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(o.C0.ESC+"[0n");break;case 6:var t=this._bufferService.buffer.y+1,r=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(o.C0.ESC+"["+t+";"+r+"R")}},t.prototype.deviceStatusPrivate=function(e){switch(e.params[0]){case 6:var t=this._bufferService.buffer.y+1,r=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(o.C0.ESC+"[?"+t+";"+r+"R")}},t.prototype.softReset=function(e){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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},t.prototype.setCursorStyle=function(e){var t=e.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 r=t%2==1;this._optionsService.options.cursorBlink=r},t.prototype.setScrollRegion=function(e){var t,r=e.params[0]||1;(e.length<2||(t=e.params[1])>this._bufferService.rows||0===t)&&(t=this._bufferService.rows),t>r&&(this._bufferService.buffer.scrollTop=r-1,this._bufferService.buffer.scrollBottom=t-1,this._setCursor(0,0))},t.prototype.windowOptions=function(e){if(b(e.params[0],this._optionsService.options.windowOptions)){var t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(s.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(s.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(o.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},t.prototype.saveCursor=function(e){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},t.prototype.restoreCursor=function(e){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()},t.prototype.setTitle=function(e){this._windowTitle=e,this._onTitleChange.fire(e)},t.prototype.setIconName=function(e){this._iconName=e},t.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},t.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},t.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},t.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,a.DEFAULT_CHARSET)},t.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._charsetService.setgCharset(y[e[0]],a.CHARSETS[e[1]]||a.DEFAULT_CHARSET):this.selectDefaultCharset()},t.prototype.index=function(){this._restrictCursor();var e=this._bufferService.buffer;this._bufferService.buffer.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),this._restrictCursor()},t.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},t.prototype.reverseIndex=function(){this._restrictCursor();var e=this._bufferService.buffer;if(e.y===e.scrollTop){var t=e.scrollBottom-e.scrollTop;e.lines.shiftElements(e.ybase+e.y,t,1),e.lines.set(e.ybase+e.y,e.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(e.scrollTop,e.scrollBottom)}else e.y--,this._restrictCursor()},t.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},t.prototype.reset=function(){this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()},t.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},t.prototype.setgLevel=function(e){this._charsetService.setgLevel(e)},t.prototype.screenAlignmentPattern=function(){var e=new g.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg;var t=this._bufferService.buffer;this._setCursor(0,0);for(var r=0;r<this._bufferService.rows;++r){var i=t.ybase+t.y+r,n=t.lines.get(i);n&&(n.fill(e),n.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},t}(c.Disposable);t.InputHandler=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;var i=function(){function e(e,t){if(void 0===e&&(e=32),void 0===t&&(t=32),this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return e.fromArray=function(t){var r=new e;if(!t.length)return r;for(var i=t[0]instanceof Array?1:0;i<t.length;++i){var n=t[i];if(n instanceof Array)for(var s=0;s<n.length;++s)r.addSubParam(n[s]);else r.addParam(n)}return r},e.prototype.clone=function(){var t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t},e.prototype.toArray=function(){for(var e=[],t=0;t<this.length;++t){e.push(this.params[t]);var r=this._subParamsIdx[t]>>8,i=255&this._subParamsIdx[t];i-r>0&&e.push(Array.prototype.slice.call(this._subParams,r,i))}return e},e.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},e.prototype.addParam=function(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>2147483647?2147483647:e}},e.prototype.addSubParam=function(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>2147483647?2147483647:e,this._subParamsIdx[this.length-1]++}},e.prototype.hasSubParams=function(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0},e.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];return r-t>0?this._subParams.subarray(t,r):null},e.prototype.getSubParamsAll=function(){for(var e={},t=0;t<this.length;++t){var r=this._subParamsIdx[t]>>8,i=255&this._subParamsIdx[t];i-r>0&&(e[t]=this._subParams.slice(r,i))}return e},e.prototype.addDigit=function(e){var t;if(!(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,2147483647):e}},e}();t.Params=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;var i=r(23),n=r(8),s=function(){function e(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return e.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var r=this._handlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},e.prototype.setHandler=function(e,t){this._handlers[e]=[t]},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},e.prototype.reset=function(){2===this._state&&this.end(!1),this._id=-1,this._state=0},e.prototype._start=function(){var e=this._handlers[this._id];if(e)for(var t=e.length-1;t>=0;t--)e[t].start();else this._handlerFb(this._id,"START")},e.prototype._put=function(e,t,r){var i=this._handlers[this._id];if(i)for(var s=i.length-1;s>=0;s--)i[s].put(e,t,r);else this._handlerFb(this._id,"PUT",n.utf32ToString(e,t,r))},e.prototype._end=function(e){var t=this._handlers[this._id];if(t){for(var r=t.length-1;r>=0&&!1===t[r].end(e);r--);for(r--;r>=0;r--)t[r].end(!1)}else this._handlerFb(this._id,"END",e)},e.prototype.start=function(){this.reset(),this._id=-1,this._state=1},e.prototype.put=function(e,t,r){if(3!==this._state){if(1===this._state)for(;t<r;){var i=e[t++];if(59===i){this._state=2,this._start();break}if(i<48||57<i)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+i-48}2===this._state&&r-t>0&&this._put(e,t,r)}},e.prototype.end=function(e){0!==this._state&&(3!==this._state&&(1===this._state&&this._start(),this._end(e)),this._id=-1,this._state=0)},e}();t.OscParser=s;var o=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.start=function(){this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,r){this._hitLimit||(this._data+=n.utf32ToString(e,t,r),this._data.length>i.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.end=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data)),this._data="",this._hitLimit=!1,t},e}();t.OscHandler=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;var i=r(8),n=r(21),s=r(23),o=[],a=function(){function e(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=function(){}}return e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},e.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var r=this._handlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},e.prototype.setHandler=function(e,t){this._handlers[e]=[t]},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=o,this._ident=0},e.prototype.hook=function(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(var r=this._active.length-1;r>=0;r--)this._active[r].hook(t);else this._handlerFb(this._ident,"HOOK",t)},e.prototype.put=function(e,t,r){if(this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r);else this._handlerFb(this._ident,"PUT",i.utf32ToString(e,t,r))},e.prototype.unhook=function(e){if(this._active.length){for(var t=this._active.length-1;t>=0&&!1===this._active[t].unhook(e);t--);for(t--;t>=0;t--)this._active[t].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",e);this._active=o,this._ident=0},e}();t.DcsParser=a;var l=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.hook=function(e){this._params=e.clone(),this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,r){this._hitLimit||(this._data+=i.utf32ToString(e,t,r),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.unhook=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data,this._params||new n.Params)),this._params=void 0,this._data="",this._hitLimit=!1,t},e}();t.DcsHandler=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireCharAtlas=void 0;var i=r(26),n=r(43),s=[];t.acquireCharAtlas=function(e,t,r,o,a){for(var l=i.generateConfig(o,a,e,r),c=0;c<s.length;c++){var u=(h=s[c]).ownedBy.indexOf(t);if(u>=0){if(i.configEquals(h.config,l))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),s.splice(c,1)):h.ownedBy.splice(u,1);break}}for(c=0;c<s.length;c++){var h=s[c];if(i.configEquals(h.config,l))return h.ownedBy.push(t),h.atlas}var d={atlas:new n.DynamicCharAtlas(document,l),config:l,ownedBy:[t]};return s.push(d),d.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<s.length;t++){var r=s[t].ownedBy.indexOf(e);if(-1!==r){1===s[t].ownedBy.length?(s[t].atlas.dispose(),s.splice(t,1)):s[t].ownedBy.splice(r,1);break}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;var i=r(3);t.generateConfig=function(e,t,r,i){var n={foreground:i.foreground,background:i.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:i.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,colors:n}},t.configEquals=function(e,t){for(var r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==t.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<i.DEFAULT_COLOR}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorManager=t.DEFAULT_ANSI_COLORS=void 0;var i=r(10),n=r(45),s=i.css.toColor("#ffffff"),o=i.css.toColor("#000000"),a=i.css.toColor("#ffffff"),l=i.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=function(){for(var e=[i.css.toColor("#2e3436"),i.css.toColor("#cc0000"),i.css.toColor("#4e9a06"),i.css.toColor("#c4a000"),i.css.toColor("#3465a4"),i.css.toColor("#75507b"),i.css.toColor("#06989a"),i.css.toColor("#d3d7cf"),i.css.toColor("#555753"),i.css.toColor("#ef2929"),i.css.toColor("#8ae234"),i.css.toColor("#fce94f"),i.css.toColor("#729fcf"),i.css.toColor("#ad7fa8"),i.css.toColor("#34e2e2"),i.css.toColor("#eeeeec")],t=[0,95,135,175,215,255],r=0;r<216;r++){var n=t[r/36%6|0],s=t[r/6%6|0],o=t[r%6];e.push({css:i.channels.toCss(n,s,o),rgba:i.channels.toRgba(n,s,o)})}for(r=0;r<24;r++){var a=8+10*r;e.push({css:i.channels.toCss(a,a,a),rgba:i.channels.toRgba(a,a,a)})}return e}();var u=function(){function e(e,r){this.allowTransparency=r;var u=e.createElement("canvas");u.width=1,u.height=1;var h=u.getContext("2d");if(!h)throw new Error("Could not get rendering context");this._ctx=h,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new n.ColorContrastCache,this.colors={foreground:s,background:o,cursor:a,cursorAccent:l,selectionTransparent:c,selectionOpaque:i.color.blend(o,c),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return e.prototype.onOptionsChange=function(e){"minimumContrastRatio"===e&&this._contrastCache.clear()},e.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,s),this.colors.background=this._parseColor(e.background,o),this.colors.cursor=this._parseColor(e.cursor,a,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,l,!0),this.colors.selectionTransparent=this._parseColor(e.selection,c,!0),this.colors.selectionOpaque=i.color.blend(this.colors.background,this.colors.selectionTransparent),i.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=i.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},e.prototype._parseColor=function(e,t,r){if(void 0===r&&(r=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;if(255!==n[3]){if(!r)return console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t;var s=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map((function(e){return Number(e)})),o=s[0],a=s[1],l=s[2],c=s[3],u=Math.round(255*c);return{rgba:i.channels.toRgba(o,a,l,u),css:e}}return{css:this._ctx.fillStyle,rgba:i.channels.toRgba(n[0],n[1],n[2],n[3])}},e}();t.ColorManager=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e}},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerRegistry=t.JoinedCellData=void 0;var s=r(6),o=r(3),a=r(4),l=function(e){function t(t,r,i){var n=e.call(this)||this;return n.content=0,n.combinedData="",n.fg=t.fg,n.bg=t.bg,n.combinedData=r,n._width=i,n}return n(t,e),t.prototype.isCombined=function(){return 2097152},t.prototype.getWidth=function(){return this._width},t.prototype.getChars=function(){return this.combinedData},t.prototype.getCode=function(){return 2097151},t.prototype.setFromCharData=function(e){throw new Error("not implemented")},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(s.AttributeData);t.JoinedCellData=l;var c=function(){function e(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},e.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];for(var r=[],i=t.translateToString(!0),n=0,s=0,a=0,l=t.getFg(0),c=t.getBg(0),u=0;u<t.getTrimmedLength();u++)if(t.loadCell(u,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==c){if(u-n>1)for(var h=this._getJoinedRanges(i,a,s,t,n),d=0;d<h.length;d++)r.push(h[d]);n=u,a=s,l=this._workCell.fg,c=this._workCell.bg}s+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-n>1)for(h=this._getJoinedRanges(i,a,s,t,n),d=0;d<h.length;d++)r.push(h[d]);return r},e.prototype._getJoinedRanges=function(t,r,i,n,s){for(var o=t.substring(r,i),a=this._characterJoiners[0].handler(o),l=1;l<this._characterJoiners.length;l++)for(var c=this._characterJoiners[l].handler(o),u=0;u<c.length;u++)e._mergeRanges(a,c[u]);return this._stringRangesToCellRanges(a,n,s),a},e.prototype._stringRangesToCellRanges=function(e,t,r){var i=0,n=!1,s=0,a=e[i];if(a){for(var l=r;l<this._bufferService.cols;l++){var c=t.getWidth(l),u=t.getString(l).length||o.WHITESPACE_CELL_CHAR.length;if(0!==c){if(!n&&a[0]<=s&&(a[0]=l,n=!0),a[1]<=s){if(a[1]=l,!(a=e[++i]))break;a[0]<=s?(a[0]=l,n=!0):n=!1}s+=u}}a&&(a[1]=this._bufferService.cols)}},e._mergeRanges=function(e,t){for(var r=!1,i=0;i<e.length;i++){var n=e[i];if(r){if(t[1]<=n[0])return e[i-1][1]=t[1],e;if(t[1]<=n[1])return e[i-1][1]=Math.max(t[1],n[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=n[0])return e.splice(i,0,t),e;if(t[1]<=n[1])return n[0]=Math.min(t[0],n[0]),e;t[0]<n[1]&&(n[0]=Math.min(t[0],n[0]),r=!0)}}return r?e[e.length-1][1]=t[1]:e.push(t),e},e}();t.CharacterJoinerRegistry=c},function(e,t,r){"use strict";function i(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left,e.clientY-r.top]}Object.defineProperty(t,"__esModule",{value:!0}),t.getRawByteCoords=t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=i,t.getCoords=function(e,t,r,n,s,o,a,l){if(s){var c=i(e,t);if(c)return c[0]=Math.ceil((c[0]+(l?o/2:0))/o),c[1]=Math.ceil(c[1]/a),c[0]=Math.min(Math.max(c[0],1),r+(l?1:0)),c[1]=Math.min(Math.max(c[1],1),n),c}},t.getRawByteCoords=function(e){if(e)return{x:e[0]+32,y:e[1]+32}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0;var i=function(){function e(e){this._renderCallback=e}return e.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.refresh=function(e,t,r){var i=this;this._rowCount=r,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){return i._innerRefresh()})))},e.prototype._innerRefresh=function(){if(void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount){var e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(e,t)}},e}();t.RenderDebouncer=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}return n(t,e),t.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.clearListener()},t.prototype._updateDpr=function(){var e;this._outerListener&&(null===(e=this._resolutionMediaMatchList)||void 0===e||e.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},t.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)},t}(r(2).Disposable);t.ScreenDprMonitor=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,r){if(void 0===r&&(r=5),"object"!=typeof t)return t;var i=Array.isArray(t)?[]:{};for(var n in t)i[n]=r<=1?t[n]:t[n]?e(t[n],r-1):t[n];return i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var i=r(4),n=r(35),s=r(18),o=r(0),a=r(83),l=function(){function e(e){this._core=new n.Terminal(e),this._addonManager=new a.AddonManager}return e.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(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new d(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unicode",{get:function(){return this._checkProposedApi(),new f(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._checkProposedApi(),new u(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.resize=function(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.registerLinkMatcher=function(e,t,r){return this._checkProposedApi(),this._core.registerLinkMatcher(e,t,r)},e.prototype.deregisterLinkMatcher=function(e){this._checkProposedApi(),this._core.deregisterLinkMatcher(e)},e.prototype.registerLinkProvider=function(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)},e.prototype.registerCharacterJoiner=function(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)},e.prototype.registerMarker=function(e){return this._checkProposedApi(),this._verifyIntegers(e),this._core.addMarker(e)},e.prototype.addMarker=function(e){return this.registerMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)},e.prototype.getSelection=function(){return this._core.getSelection()},e.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},e.prototype.clearSelection=function(){this._core.clearSelection()},e.prototype.selectAll=function(){this._core.selectAll()},e.prototype.selectLines=function(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.scrollLines=function(e){this._verifyIntegers(e),this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._verifyIntegers(e),this._core.scrollPages(e)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(e){this._verifyIntegers(e),this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e,t){this._core.write(e,t)},e.prototype.writeUtf8=function(e,t){this._core.write(e,t)},e.prototype.writeln=function(e,t){this._core.write(e),this._core.write("\r\n",t)},e.prototype.paste=function(e){this._core.paste(e)},e.prototype.getOption=function(e){return this._core.optionsService.getOption(e)},e.prototype.setOption=function(e,t){this._core.optionsService.setOption(e,t)},e.prototype.refresh=function(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(e,"strings",{get:function(){return s},enumerable:!1,configurable:!0}),e.prototype._verifyIntegers=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,i=e;r<i.length;r++){var n=i[r];if(n===1/0||isNaN(n)||n%1!=0)throw new Error("This API only accepts integers")}},e}();t.Terminal=l;var c=function(){function e(e,t){this._buffer=e,this.type=t}return e.prototype.init=function(e){return this._buffer=e,this},Object.defineProperty(e.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),e.prototype.getLine=function(e){var t=this._buffer.lines.get(e);if(t)return new h(t)},e.prototype.getNullCell=function(){return new i.CellData},e}(),u=function(){function e(e){var t=this;this._buffers=e,this._onBufferChange=new o.EventEmitter,this._normal=new c(this._buffers.normal,"normal"),this._alternate=new c(this._buffers.alt,"alternate"),this._buffers.onBufferActivate((function(){return t._onBufferChange.fire(t.active)}))}return Object.defineProperty(e.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),e}(),h=function(){function e(e){this._line=e}return Object.defineProperty(e.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),e.prototype.getCell=function(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new i.CellData)},e.prototype.translateToString=function(e,t,r){return this._line.translateToString(e,t,r)},e}(),d=function(){function e(e){this._core=e}return e.prototype.registerCsiHandler=function(e,t){return this._core.addCsiHandler(e,(function(e){return t(e.toArray())}))},e.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},e.prototype.registerDcsHandler=function(e,t){return this._core.addDcsHandler(e,(function(e,r){return t(e,r.toArray())}))},e.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},e.prototype.registerEscHandler=function(e,t){return this._core.addEscHandler(e,t)},e.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},e.prototype.registerOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},e}(),f=function(){function e(e){this._core=e}return e.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(e.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!1,configurable:!0}),e}()},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var s=r(36),o=r(37),a=r(38),l=r(12),c=r(19),u=r(40),h=r(50),d=r(51),f=r(11),p=r(7),g=r(18),v=r(54),m=r(55),_=r(56),y=r(57),b=r(59),S=r(0),w=r(16),C=r(27),E=r(60),k=r(5),x=r(61),T=r(62),L=r(63),A=r(64),D=r(65),O="undefined"!=typeof window?window.document:null,R=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.browser=f,r._keyDownHandled=!1,r._onCursorMove=new S.EventEmitter,r._onKey=new S.EventEmitter,r._onRender=new S.EventEmitter,r._onSelectionChange=new S.EventEmitter,r._onTitleChange=new S.EventEmitter,r._onFocus=new S.EventEmitter,r._onBlur=new S.EventEmitter,r._onA11yCharEmitter=new S.EventEmitter,r._onA11yTabEmitter=new S.EventEmitter,r._setup(),r.linkifier=r._instantiationService.createInstance(h.Linkifier),r.linkifier2=r.register(r._instantiationService.createInstance(L.Linkifier2)),r.register(r._inputHandler.onRequestBell((function(){return r.bell()}))),r.register(r._inputHandler.onRequestRefreshRows((function(e,t){return r.refresh(e,t)}))),r.register(r._inputHandler.onRequestReset((function(){return r.reset()}))),r.register(r._inputHandler.onRequestScroll((function(e,t){return r.scroll(e,t||void 0)}))),r.register(r._inputHandler.onRequestWindowsOptionsReport((function(e){return r._reportWindowsOptions(e)}))),r.register(S.forwardEvent(r._inputHandler.onCursorMove,r._onCursorMove)),r.register(S.forwardEvent(r._inputHandler.onTitleChange,r._onTitleChange)),r.register(S.forwardEvent(r._inputHandler.onA11yChar,r._onA11yCharEmitter)),r.register(S.forwardEvent(r._inputHandler.onA11yTab,r._onA11yTabEmitter)),r.register(r._bufferService.onResize((function(e){return r._afterResize(e.cols,e.rows)}))),r}return n(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var t,r,i;this._isDisposed||(e.prototype.dispose.call(this),null===(t=this._renderService)||void 0===t||t.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},null===(i=null===(r=this.element)||void 0===r?void 0:r.parentNode)||void 0===i||i.removeChild(this.element))},t.prototype._setup=function(){e.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),t.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},t.prototype._updateOptions=function(t){var r,i,n,s;switch(e.prototype._updateOptions.call(this,t),t){case"fontFamily":case"fontSize":null===(r=this._renderService)||void 0===r||r.clear(),null===(i=this._charSizeService)||void 0===i||i.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":null===(n=this.viewport)||void 0===n||n.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)):(null===(s=this._accessibilityManager)||void 0===s||s.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},t.prototype._onTextAreaFocus=function(e){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(l.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},t.prototype.blur=function(){var e;return null===(e=this.textarea)||void 0===e?void 0:e.blur()},t.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(l.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},t.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var e=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),t=this._bufferService.buffer.y*e,r=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=r+"px",this.textarea.style.top=t+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=e+"px",this.textarea.style.lineHeight=e+"px",this.textarea.style.zIndex="-5"}},t.prototype._initGlobal=function(){var e=this;this._bindKeys(),this.register(p.addDisposableDomListener(this.element,"copy",(function(t){e.hasSelection()&&a.copyHandler(t,e._selectionService)})));var t=function(t){return a.handlePasteEvent(t,e.textarea,e._coreService)};this.register(p.addDisposableDomListener(this.textarea,"paste",t)),this.register(p.addDisposableDomListener(this.element,"paste",t)),f.isFirefox?this.register(p.addDisposableDomListener(this.element,"mousedown",(function(t){2===t.button&&a.rightClickHandler(t,e.textarea,e.screenElement,e._selectionService,e.options.rightClickSelectsWord)}))):this.register(p.addDisposableDomListener(this.element,"contextmenu",(function(t){a.rightClickHandler(t,e.textarea,e.screenElement,e._selectionService,e.options.rightClickSelectsWord)}))),f.isLinux&&this.register(p.addDisposableDomListener(this.element,"auxclick",(function(t){1===t.button&&a.moveTextAreaUnderMouseCursor(t,e.textarea,e.screenElement)})))},t.prototype._bindKeys=function(){var e=this;this.register(p.addDisposableDomListener(this.textarea,"keyup",(function(t){return e._keyUp(t)}),!0)),this.register(p.addDisposableDomListener(this.textarea,"keydown",(function(t){return e._keyDown(t)}),!0)),this.register(p.addDisposableDomListener(this.textarea,"keypress",(function(t){return e._keyPress(t)}),!0)),this.register(p.addDisposableDomListener(this.textarea,"compositionstart",(function(){return e._compositionHelper.compositionstart()}))),this.register(p.addDisposableDomListener(this.textarea,"compositionupdate",(function(t){return e._compositionHelper.compositionupdate(t)}))),this.register(p.addDisposableDomListener(this.textarea,"compositionend",(function(){return e._compositionHelper.compositionend()}))),this.register(this.onRender((function(){return e._compositionHelper.updateCompositionElements()}))),this.register(this.onRender((function(t){return e._queueLinkification(t.start,t.end)})))},t.prototype.open=function(e){var t=this;if(!e)throw new Error("Terminal requires a parent element.");O.body.contains(e)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.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"),e.appendChild(this.element);var r=O.createDocumentFragment();this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this._viewportScrollArea=O.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=O.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=O.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.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(p.addDisposableDomListener(this.textarea,"focus",(function(e){return t._onTextAreaFocus(e)}))),this.register(p.addDisposableDomListener(this.textarea,"blur",(function(){return t._onTextAreaBlur()}))),this._helperContainer.appendChild(this.textarea);var i=this._instantiationService.createInstance(A.CoreBrowserService,this.textarea);this._instantiationService.setService(k.ICoreBrowserService,i),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._compositionView=O.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(r),this._theme=this.options.theme||this._theme,this._colorManager=new C.ColorManager(O,this.options.allowTransparency),this.register(this.optionsService.onOptionChange((function(e){return t._colorManager.onOptionsChange(e)}))),this._colorManager.setTheme(this._theme);var n=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,n,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange((function(e){return t._onRender.fire(e)}))),this.onResize((function(e){return t._renderService.resize(e.cols,e.rows)})),this._soundService=this._instantiationService.createInstance(v.SoundService),this._instantiationService.setService(k.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(T.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(o.Viewport,(function(e,r){return t.scrollLines(e,r)}),this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar((function(){return t.viewport.syncScrollArea()}))),this.register(this.viewport),this.register(this.onCursorMove((function(){t._renderService.onCursorMove(),t._syncTextArea()}))),this.register(this.onResize((function(){return t._renderService.onResize(t.cols,t.rows)}))),this.register(this.onBlur((function(){return t._renderService.onBlur()}))),this.register(this.onFocus((function(){return t._renderService.onFocus()}))),this.register(this._renderService.onDimensionsChange((function(){return t.viewport.syncScrollArea()}))),this._selectionService=this.register(this._instantiationService.createInstance(d.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((function(e){return t.scrollLines(e.amount,e.suppressScrollEvent)}))),this.register(this._selectionService.onSelectionChange((function(){return t._onSelectionChange.fire()}))),this.register(this._selectionService.onRequestRedraw((function(e){return t._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode)}))),this.register(this._selectionService.onLinuxMouseSelection((function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()}))),this.register(this.onScroll((function(){t.viewport.syncScrollArea(),t._selectionService.refresh()}))),this.register(p.addDisposableDomListener(this._viewportElement,"scroll",(function(){return t._selectionService.refresh()}))),this._mouseZoneManager=this._instantiationService.createInstance(m.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll((function(){return t._mouseZoneManager.clearAll()}))),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(p.addDisposableDomListener(this.element,"mousedown",(function(e){return t._selectionService.onMouseDown(e)}))),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},t.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(u.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(y.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},t.prototype._setTheme=function(e){var t,r,i;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(r=this._renderService)||void 0===r||r.setColors(this._colorManager.colors),null===(i=this.viewport)||void 0===i||i.onThemeChange(this._colorManager.colors)},t.prototype.bindMouse=function(){var e=this,t=this,r=this.element;function i(e){var r,i,n=t._mouseService.getRawByteCoords(e,t.screenElement,t.cols,t.rows);if(!n)return!1;switch(e.overrideType||e.type){case"mousemove":i=32,void 0===e.buttons?(r=3,void 0!==e.button&&(r=e.button<3?e.button:3)):r=1&e.buttons?0:4&e.buttons?1:2&e.buttons?2:3;break;case"mouseup":i=0,r=e.button<3?e.button:3;break;case"mousedown":i=1,r=e.button<3?e.button:3;break;case"wheel":0!==e.deltaY&&(i=e.deltaY<0?0:1),r=4;break;default:return!1}return!(void 0===i||void 0===r||r>4)&&t._coreMouseService.triggerMouseEvent({col:n.x-33,row:n.y-33,button:r,action:i,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey})}var n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s=function(t){return i(t),t.buttons||(e._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&e._document.removeEventListener("mousemove",n.mousedrag)),e.cancel(t)},o=function(t){return i(t),t.preventDefault(),e.cancel(t)},a=function(e){e.buttons&&i(e)},c=function(e){e.buttons||i(e)};this.register(this._coreMouseService.onProtocolChange((function(t){t?("debug"===e.optionsService.options.logLevel&&e._logService.debug("Binding to mouse events:",e._coreMouseService.explainEvents(t)),e.element.classList.add("enable-mouse-events"),e._selectionService.disable()):(e._logService.debug("Unbinding from mouse events."),e.element.classList.remove("enable-mouse-events"),e._selectionService.enable()),8&t?n.mousemove||(r.addEventListener("mousemove",c),n.mousemove=c):(r.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&t?n.wheel||(r.addEventListener("wheel",o,{passive:!1}),n.wheel=o):(r.removeEventListener("wheel",n.wheel),n.wheel=null),2&t?n.mouseup||(n.mouseup=s):(e._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&t?n.mousedrag||(n.mousedrag=a):(e._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)}))),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(p.addDisposableDomListener(r,"mousedown",(function(t){if(t.preventDefault(),e.focus(),e._coreMouseService.areMouseEventsActive&&!e._selectionService.shouldForceSelection(t))return i(t),n.mouseup&&e._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&e._document.addEventListener("mousemove",n.mousedrag),e.cancel(t)}))),this.register(p.addDisposableDomListener(r,"wheel",(function(t){if(n.wheel);else if(!e.buffer.hasScrollback){var r=e.viewport.getLinesScrolled(t);if(0===r)return;for(var i=l.C0.ESC+(e._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(t.deltaY<0?"A":"B"),s="",o=0;o<Math.abs(r);o++)s+=i;e._coreService.triggerDataEvent(s,!0)}}),{passive:!0})),this.register(p.addDisposableDomListener(r,"wheel",(function(t){if(!n.wheel)return e.viewport.onWheel(t)?void 0:e.cancel(t)}),{passive:!1})),this.register(p.addDisposableDomListener(r,"touchstart",(function(t){if(!e._coreMouseService.areMouseEventsActive)return e.viewport.onTouchStart(t),e.cancel(t)}),{passive:!0})),this.register(p.addDisposableDomListener(r,"touchmove",(function(t){if(!e._coreMouseService.areMouseEventsActive)return e.viewport.onTouchMove(t)?void 0:e.cancel(t)}),{passive:!1}))},t.prototype.refresh=function(e,t){var r;null===(r=this._renderService)||void 0===r||r.refreshRows(e,t)},t.prototype._queueLinkification=function(e,t){var r;null===(r=this.linkifier)||void 0===r||r.linkifyRows(e,t)},t.prototype.updateCursorStyle=function(e){this._selectionService&&this._selectionService.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},t.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},t.prototype.scrollLines=function(t,r){e.prototype.scrollLines.call(this,t,r),this.refresh(0,this.rows-1)},t.prototype.paste=function(e){a.paste(e,this.textarea,this._coreService)},t.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},t.prototype.registerLinkMatcher=function(e,t,r){var i=this.linkifier.registerLinkMatcher(e,t,r);return this.refresh(0,this.rows-1),i},t.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},t.prototype.registerLinkProvider=function(e){return this.linkifier2.registerLinkProvider(e)},t.prototype.registerCharacterJoiner=function(e){var t=this._renderService.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},t.prototype.deregisterCharacterJoiner=function(e){this._renderService.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(t.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),t.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},t.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},t.prototype.select=function(e,t,r){this._selectionService.setSelection(e,t,r)},t.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},t.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]}},t.prototype.clearSelection=function(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()},t.prototype.selectAll=function(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()},t.prototype.selectLines=function(e,t){var r;null===(r=this._selectionService)||void 0===r||r.selectLines(e,t)},t.prototype._keyDown=function(e){if(this._keyDownHandled=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=b.evaluateKeyboardEvent(e,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===t.type||2===t.type){var r=this.rows-1;return this.scrollLines(2===t.type?-r:r),this.cancel(e,!0)}return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(t.key!==l.C0.ETX&&t.key!==l.C0.CR||(this.textarea.value=""),this._onKey.fire({key:t.key,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0)))},t.prototype._isThirdLevelShift=function(e,t){var r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?r:r&&(!t.keyCode||t.keyCode>47)},t.prototype._keyUp=function(e){this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e))},t.prototype._keyPress=function(e){var t;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t,!0),0))},t.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},t.prototype.resize=function(t,r){t!==this.cols||r!==this.rows?e.prototype.resize.call(this,t,r):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},t.prototype._afterResize=function(e,t){var r,i;null===(r=this._charSizeService)||void 0===r||r.measure(),null===(i=this.viewport)||void 0===i||i.syncScrollArea(!0)},t.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(w.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},t.prototype.reset=function(){var t,r;this.options.rows=this.rows,this.options.cols=this.cols;var i=this._customKeyEventHandler;this._setup(),e.prototype.reset.call(this),null===(t=this._selectionService)||void 0===t||t.reset(),this._customKeyEventHandler=i,this.refresh(0,this.rows-1),null===(r=this.viewport)||void 0===r||r.syncScrollArea()},t.prototype._reportWindowsOptions=function(e){if(this._renderService)switch(e){case c.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var t=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),r=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(l.C0.ESC+"[4;"+r+";"+t+"t");break;case c.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var i=this._renderService.dimensions.scaledCellWidth.toFixed(0),n=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(l.C0.ESC+"[6;"+n+";"+i+"t")}},t.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},t.prototype._visualBell=function(){return!1},t.prototype._soundBell=function(){return"sound"===this.options.bellStyle},t}(D.CoreTerminal);t.Terminal=R},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;var s=r(5),o=r(1),a=function(){function e(e,t,r,i,n,s){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=i,this._charSizeService=n,this._coreService=s,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(e.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((function(){t._compositionPosition.end=t._textarea.value.length}),0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){var r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((function(){var e;t._isSendingComposition&&(t._isSendingComposition=!1,e=t._isComposing?t._textarea.value.substring(r.start,r.end):t._textarea.value.substring(r.start),t._coreService.triggerDataEvent(e,!0))}),0)}else{this._isSendingComposition=!1;var i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout((function(){if(!e._isComposing){var r=e._textarea.value.replace(t,"");r.length>0&&e._coreService.triggerDataEvent(r,!0)}}),0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var r=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),i=this._bufferService.buffer.y*r,n=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var s=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=i+"px",this._textarea.style.width=s.width+"px",this._textarea.style.height=s.height+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout((function(){return t.updateCompositionElements(!0)}),0)}},i([n(2,o.IBufferService),n(3,o.IOptionsService),n(4,s.ICharSizeService),n(5,o.ICoreService)],e)}();t.CompositionHelper=a},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;var a=r(2),l=r(7),c=r(5),u=r(1),h=function(e){function t(t,r,i,n,s,o,a){var c=e.call(this)||this;return c._scrollLines=t,c._viewportElement=r,c._scrollArea=i,c._bufferService=n,c._optionsService=s,c._charSizeService=o,c._renderService=a,c.scrollBarWidth=0,c._currentRowHeight=0,c._lastRecordedBufferLength=0,c._lastRecordedViewportHeight=0,c._lastRecordedBufferHeight=0,c._lastTouchY=0,c._lastScrollTop=0,c._wheelPartialScroll=0,c._refreshAnimationFrame=null,c._ignoreNextScrollEvent=!1,c.scrollBarWidth=c._viewportElement.offsetWidth-c._scrollArea.offsetWidth||15,c.register(l.addDisposableDomListener(c._viewportElement,"scroll",c._onScroll.bind(c))),setTimeout((function(){return c.syncScrollArea()}),0),c}return n(t,e),t.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(e){var t=this;if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame((function(){return t._innerRefresh()})))},t.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(e){if(void 0===e&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)}else this._refresh(e)},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t,!0)}},t.prototype._bubbleScroll=function(e,t){var r=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&r<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)},t.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},t.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t},t.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t},t.prototype._applyScrollModifier=function(e,t){var r=this._optionsService.options.fastScrollModifier;return"alt"===r&&t.altKey||"ctrl"===r&&t.ctrlKey||"shift"===r&&t.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},s([o(3,u.IBufferService),o(4,u.IOptionsService),o(5,c.ICharSizeService),o(6,c.IRenderService)],t)}(a.Disposable);t.Viewport=h},function(e,t,r){"use strict";function i(e){return e.replace(/\r?\n/g,"\r")}function n(e,t){return t?"[200~"+e+"[201~":e}function s(e,t,r){e=n(e=i(e),r.decPrivateModes.bracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function o(e,t,r){var i=r.getBoundingClientRect(),n=e.clientX-i.left-10,s=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=n+"px",t.style.top=s+"px",t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=i,t.bracketTextForPaste=n,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,r){e.stopPropagation(),e.clipboardData&&s(e.clipboardData.getData("text/plain"),t,r)},t.paste=s,t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,r,i,n){o(e,t,r),n&&!i.isClickInSelection(e)&&i.selectWordAtCursor(e),t.value=i.selectionText,t.select()}},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;var s=r(2),o=r(15),a=r(21),l=r(22),c=r(24),u=function(){function e(e){this.table=new Uint8Array(e)}return e.prototype.setDefault=function(e,t){o.fill(this.table,e<<4|t)},e.prototype.add=function(e,t,r,i){this.table[t<<8|e]=r<<4|i},e.prototype.addMany=function(e,t,r,i){for(var n=0;n<e.length;n++)this.table[t<<8|e[n]]=r<<4|i},e}();t.TransitionTable=u,t.VT500_TRANSITION_TABLE=function(){var e=new u(4095),t=Array.apply(null,Array(256)).map((function(e,t){return t})),r=function(e,r){return t.slice(e,r)},i=r(32,127),n=r(0,24);n.push(25),n.push.apply(n,r(28,32));var s,o=r(0,14);for(s in e.setDefault(1,0),e.addMany(i,0,2,0),o)e.addMany([24,26,153,154],s,3,0),e.addMany(r(128,144),s,3,0),e.addMany(r(144,152),s,3,0),e.add(156,s,0,0),e.add(27,s,11,1),e.add(157,s,4,8),e.addMany([152,158,159],s,0,7),e.add(155,s,11,3),e.add(144,s,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(n,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(n,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(n,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(n,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(n,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(n,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();var h=function(e){function r(r){void 0===r&&(r=t.VT500_TRANSITION_TABLE);var i=e.call(this)||this;return i._transitions=r,i.initialState=0,i.currentState=i.initialState,i._params=new a.Params,i._params.addParam(0),i._collect=0,i.precedingCodepoint=0,i._printHandlerFb=function(e,t,r){},i._executeHandlerFb=function(e){},i._csiHandlerFb=function(e,t){},i._escHandlerFb=function(e){},i._errorHandlerFb=function(e){return e},i._printHandler=i._printHandlerFb,i._executeHandlers=Object.create(null),i._csiHandlers=Object.create(null),i._escHandlers=Object.create(null),i._oscParser=new l.OscParser,i._dcsParser=new c.DcsParser,i._errorHandler=i._errorHandlerFb,i.setEscHandler({final:"\\"},(function(){})),i}return n(r,e),r.prototype._identifier=function(e,t){void 0===t&&(t=[64,126]);var r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if((r=e.prefix.charCodeAt(0))&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var i=0;i<e.intermediates.length;++i){var n=e.intermediates.charCodeAt(i);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=n}}if(1!==e.final.length)throw new Error("final must be a single byte");var s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error("final must be in range "+t[0]+" .. "+t[1]);return(r<<=8)|s},r.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},r.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},r.prototype.setPrintHandler=function(e){this._printHandler=e},r.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},r.prototype.addEscHandler=function(e,t){var r=this._identifier(e,[48,126]);void 0===this._escHandlers[r]&&(this._escHandlers[r]=[]);var i=this._escHandlers[r];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},r.prototype.setEscHandler=function(e,t){this._escHandlers[this._identifier(e,[48,126])]=[t]},r.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},r.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},r.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},r.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},r.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},r.prototype.addCsiHandler=function(e,t){var r=this._identifier(e);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);var i=this._csiHandlers[r];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},r.prototype.setCsiHandler=function(e,t){this._csiHandlers[this._identifier(e)]=[t]},r.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},r.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},r.prototype.addDcsHandler=function(e,t){return this._dcsParser.addHandler(this._identifier(e),t)},r.prototype.setDcsHandler=function(e,t){this._dcsParser.setHandler(this._identifier(e),t)},r.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},r.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},r.prototype.addOscHandler=function(e,t){return this._oscParser.addHandler(e,t)},r.prototype.setOscHandler=function(e,t){this._oscParser.setHandler(e,t)},r.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},r.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},r.prototype.setErrorHandler=function(e){this._errorHandler=e},r.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},r.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},r.prototype.parse=function(e,t){for(var r=0,i=0,n=this.currentState,s=this._oscParser,o=this._dcsParser,a=this._collect,l=this._params,c=this._transitions.table,u=0;u<t;++u){switch((i=c[n<<8|((r=e[u])<160?r:160)])>>4){case 2:for(var h=u+1;;++h){if(h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:r,currentState:n,collect:a,params:l,abort:!1}).abort)return;break;case 7:for(var d=this._csiHandlers[a<<8|r],f=d?d.length-1:-1;f>=0&&!1===d[f](l);f--);f<0&&this._csiHandlerFb(a<<8|r,l),this.precedingCodepoint=0;break;case 8:do{switch(r){case 59:l.addParam(0);break;case 58:l.addSubParam(-1);break;default:l.addDigit(r-48)}}while(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:a<<=8,a|=r;break;case 10:for(var p=this._escHandlers[a<<8|r],g=p?p.length-1:-1;g>=0&&!1===p[g]();g--);g<0&&this._escHandlerFb(a<<8|r),this.precedingCodepoint=0;break;case 11:l.reset(),l.addParam(0),a=0;break;case 12:o.hook(a<<8|r,l);break;case 13:for(var v=u+1;;++v)if(v>=t||24===(r=e[v])||26===r||27===r||r>127&&r<160){o.put(e,u,v),u=v-1;break}break;case 14:o.unhook(24!==r&&26!==r),27===r&&(i|=1),l.reset(),l.addParam(0),a=0,this.precedingCodepoint=0;break;case 4:s.start();break;case 5:for(var m=u+1;;m++)if(m>=t||(r=e[m])<32||r>127&&r<=159){s.put(e,u,m),u=m-1;break}break;case 6:s.end(24!==r&&26!==r),27===r&&(i|=1),l.reset(),l.addParam(0),a=0,this.precedingCodepoint=0}n=15&i}this._collect=a,this.currentState=n},r}(s.Disposable);t.EscapeSequenceParser=h},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;var a=r(41),l=r(47),c=r(48),u=r(49),h=r(29),d=r(2),f=r(5),p=r(1),g=r(25),v=r(0),m=1,_=function(e){function t(t,r,i,n,s,o,d,f,p){var g=e.call(this)||this;g._colors=t,g._screenElement=r,g._bufferService=s,g._charSizeService=o,g._optionsService=d,g._id=m++,g._onRequestRedraw=new v.EventEmitter;var _=g._optionsService.options.allowTransparency;return g._characterJoinerRegistry=new h.CharacterJoinerRegistry(g._bufferService),g._renderLayers=[new a.TextRenderLayer(g._screenElement,0,g._colors,g._characterJoinerRegistry,_,g._id,g._bufferService,d),new l.SelectionRenderLayer(g._screenElement,1,g._colors,g._id,g._bufferService,d),new u.LinkRenderLayer(g._screenElement,2,g._colors,g._id,i,n,g._bufferService,d),new c.CursorRenderLayer(g._screenElement,3,g._colors,g._id,g._onRequestRedraw,g._bufferService,d,f,p)],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._devicePixelRatio=window.devicePixelRatio,g._updateDimensions(),g.onOptionsChanged(),g}return n(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){for(var t=0,r=this._renderLayers;t<r.length;t++)r[t].dispose();e.prototype.dispose.call(this),g.removeTerminalFromCache(this._id)},t.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},t.prototype.setColors=function(e){this._colors=e;for(var t=0,r=this._renderLayers;t<r.length;t++){var i=r[t];i.setColors(this._colors),i.reset()}},t.prototype.onResize=function(e,t){this._updateDimensions();for(var r=0,i=this._renderLayers;r<i.length;r++)i[r].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},t.prototype.onBlur=function(){this._runOperation((function(e){return e.onBlur()}))},t.prototype.onFocus=function(){this._runOperation((function(e){return e.onFocus()}))},t.prototype.onSelectionChanged=function(e,t,r){void 0===r&&(r=!1),this._runOperation((function(i){return i.onSelectionChanged(e,t,r)}))},t.prototype.onCursorMove=function(){this._runOperation((function(e){return e.onCursorMove()}))},t.prototype.onOptionsChanged=function(){this._runOperation((function(e){return e.onOptionsChanged()}))},t.prototype.clear=function(){this._runOperation((function(e){return e.reset()}))},t.prototype._runOperation=function(e){for(var t=0,r=this._renderLayers;t<r.length;t++)e(r[t])},t.prototype.renderRows=function(e,t){for(var r=0,i=this._renderLayers;r<i.length;r++)i[r].onGridChanged(e,t)},t.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=1===this._optionsService.options.lineHeight?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)},t.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},s([o(4,p.IBufferService),o(5,f.ICharSizeService),o(6,p.IOptionsService),o(7,p.ICoreService),o(8,f.ICoreBrowserService)],t)}(d.Disposable);t.Renderer=_},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;var s=r(42),o=r(13),a=r(6),l=r(3),c=r(29),u=r(4),h=function(e){function t(t,r,i,n,o,a,l,c){var h=e.call(this,t,"text",r,o,i,a,l,c)||this;return h._characterWidth=0,h._characterFont="",h._characterOverlapCache={},h._workCell=new u.CellData,h._state=new s.GridCache,h._characterJoinerRegistry=n,h}return n(t,e),t.prototype.resize=function(t){e.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)},t.prototype.reset=function(){this._state.clear(),this._clearAll()},t.prototype._forEachCell=function(e,t,r,i){for(var n=e;n<=t;n++)for(var s=n+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.lines.get(s),a=r?r.getJoinedCharacters(s):[],u=0;u<this._bufferService.cols;u++){o.loadCell(u,this._workCell);var h=this._workCell,d=!1,f=u;if(0!==h.getWidth()){if(a.length>0&&u===a[0][0]){d=!0;var p=a.shift();h=new c.JoinedCellData(this._workCell,o.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1}!d&&this._isOverlapping(h)&&f<o.length-1&&o.getCodePoint(f+1)===l.NULL_CELL_CODE&&(h.content&=-12582913,h.content|=2<<22),i(h,u,n),u=f}}},t.prototype._drawBackground=function(e,t){var r=this,i=this._ctx,n=this._bufferService.cols,s=0,o=0,l=null;i.save(),this._forEachCell(e,t,null,(function(e,t,c){var u=null;e.isInverse()?u=e.isFgDefault()?r._colors.foreground.css:e.isFgRGB()?"rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":r._colors.ansi[e.getFgColor()].css:e.isBgRGB()?u="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":e.isBgPalette()&&(u=r._colors.ansi[e.getBgColor()].css),null===l&&(s=t,o=c),c!==o?(i.fillStyle=l||"",r._fillCells(s,o,n-s,1),s=t,o=c):l!==u&&(i.fillStyle=l||"",r._fillCells(s,o,t-s,1),s=t,o=c),l=u})),null!==l&&(i.fillStyle=l,this._fillCells(s,o,n-s,1)),i.restore()},t.prototype._drawForeground=function(e,t){var r=this;this._forEachCell(e,t,this._characterJoinerRegistry,(function(e,t,i){if(!e.isInvisible()&&(r._drawChars(e,t,i),e.isUnderline())){if(r._ctx.save(),e.isInverse())if(e.isBgDefault())r._ctx.fillStyle=r._colors.background.css;else if(e.isBgRGB())r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var n=e.getBgColor();r._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),r._ctx.fillStyle=r._colors.ansi[n].css}else if(e.isFgDefault())r._ctx.fillStyle=r._colors.foreground.css;else if(e.isFgRGB())r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var s=e.getFgColor();r._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&s<8&&(s+=8),r._ctx.fillStyle=r._colors.ansi[s].css}r._fillBottomLineAtCells(t,i,e.getWidth()),r._ctx.restore()}}))},t.prototype.onGridChanged=function(e,t){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))},t.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},t.prototype._isOverlapping=function(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;var t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var r=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=r,r},t}(o.BaseRenderLayer);t.TextRenderLayer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0;var i=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var r=0;r<e;r++){this.cache.length<=r&&this.cache.push([]);for(var i=this.cache[r].length;i<t;i++)this.cache[r].push(void 0);this.cache[r].length=t}this.cache.length=e},e.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=void 0},e}();t.GridCache=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.NoneCharAtlas=t.DynamicCharAtlas=t.getGlyphCacheKey=void 0;var s=r(9),o=r(44),a=r(27),l=r(46),c=r(11),u=r(28),h=r(10),d={css:"rgba(0, 0, 0, 0)",rgba:0};function f(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=f;var p=function(e){function t(t,r){var i=e.call(this)||this;i._config=r,i._drawToCacheCount=0,i._glyphsWaitingOnBitmap=[],i._bitmapCommitTimeout=null,i._bitmap=null,i._cacheCanvas=t.createElement("canvas"),i._cacheCanvas.width=1024,i._cacheCanvas.height=1024,i._cacheCtx=u.throwIfFalsy(i._cacheCanvas.getContext("2d",{alpha:!0}));var n=t.createElement("canvas");n.width=i._config.scaledCharWidth,n.height=i._config.scaledCharHeight,i._tmpCtx=u.throwIfFalsy(n.getContext("2d",{alpha:i._config.allowTransparency})),i._width=Math.floor(1024/i._config.scaledCharWidth),i._height=Math.floor(1024/i._config.scaledCharHeight);var s=i._width*i._height;return i._cacheMap=new l.LRUMap(s),i._cacheMap.prealloc(s),i}return n(t,e),t.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},t.prototype.beginFrame=function(){this._drawToCacheCount=0},t.prototype.draw=function(e,t,r,i){if(32===t.code)return!0;if(!this._canCache(t))return!1;var n=f(t),s=this._cacheMap.get(n);if(null!=s)return this._drawFromCache(e,s,r,i),!0;if(this._drawToCacheCount<100){var o;o=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,o);return this._cacheMap.set(n,a),this._drawFromCache(e,a,r,i),!0}return!1},t.prototype._canCache=function(e){return e.code<256},t.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},t.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},t.prototype._drawFromCache=function(e,t,r,i){if(!t.isEmpty){var n=this._toCoordinateX(t.index),s=this._toCoordinateY(t.index);e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,n,s,this._config.scaledCharWidth,this._config.scaledCharHeight,r,i,this._config.scaledCharWidth,this._config.scaledCharHeight)}},t.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:a.DEFAULT_ANSI_COLORS[e]},t.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?d:e.bg===s.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},t.prototype._getForegroundColor=function(e){return e.fg===s.INVERTED_DEFAULT_COLOR?h.color.opaque(this._config.colors.background):e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},t.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var r=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=r.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var i=e.bold?this._config.fontWeightBold:this._config.fontWeight,n=e.italic?"italic":"";this._tmpCtx.font=n+" "+i+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=s.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var o=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),a=!1;this._config.allowTransparency||(a=function(e,t){for(var r=!0,i=t.rgba>>>24,n=t.rgba>>>16&255,s=t.rgba>>>8&255,o=0;o<e.data.length;o+=4)e.data[o]===i&&e.data[o+1]===n&&e.data[o+2]===s?e.data[o+3]=0:r=!1;return r}(o,r));var l=this._toCoordinateX(t),c=this._toCoordinateY(t);this._cacheCtx.putImageData(o,l,c);var u={index:t,isEmpty:a,inBitmap:!1};return this._addGlyphToBitmap(u),u},t.prototype._addGlyphToBitmap=function(e){var t=this;!("createImageBitmap"in window)||c.isFirefox||c.isSafari||(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout((function(){return t._generateBitmap()}),100)))},t.prototype._generateBitmap=function(){var e=this,t=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then((function(r){e._bitmap=r;for(var i=0;i<t.length;i++)t[i].inBitmap=!0})),this._bitmapCommitTimeout=null},t}(o.BaseCharAtlas);t.DynamicCharAtlas=p;var g=function(e){function t(t,r){return e.call(this)||this}return n(t,e),t.prototype.draw=function(e,t,r,i){return!1},t}(o.BaseCharAtlas);t.NoneCharAtlas=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCharAtlas=void 0;var i=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.BaseCharAtlas=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;var i=function(){function e(){this._color={},this._rgba={}}return e.prototype.clear=function(){this._color={},this._rgba={}},e.prototype.setCss=function(e,t,r){this._rgba[e]||(this._rgba[e]={}),this._rgba[e][t]=r},e.prototype.getCss=function(e,t){return this._rgba[e]?this._rgba[e][t]:void 0},e.prototype.setColor=function(e,t,r){this._color[e]||(this._color[e]={}),this._color[e][t]=r},e.prototype.getColor=function(e,t){return this._color[e]?this._color[e][t]:void 0},e}();t.ColorContrastCache=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUMap=void 0;var i=function(){function e(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return e.prototype._unlinkNode=function(e){var t=e.prev,r=e.next;e===this._head&&(this._head=r),e===this._tail&&(this._tail=t),null!==t&&(t.next=r),null!==r&&(r.prev=t)},e.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},e.prototype.prealloc=function(e){for(var t=this._nodePool,r=0;r<e;r++)t.push({prev:null,next:null,key:null,value:null})},e.prototype.get=function(e){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},e.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},e.prototype.peek=function(){var e=this._head;return null===e?null:e.value},e.prototype.set=function(e,t){var r=this._map[e];if(void 0!==r)r=this._map[e],this._unlinkNode(r),r.value=t;else if(this.size>=this.capacity)r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=e,r.value=t,this._map[e]=r;else{var i=this._nodePool;i.length>0?((r=i.pop()).key=e,r.value=t):r={prev:null,next:null,key:e,value:t},this._map[e]=r,this.size++}this._appendNode(r)},e}();t.LRUMap=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;var s=function(e){function t(t,r,i,n,s,o){var a=e.call(this,t,"selection",r,!0,i,n,s,o)||this;return a._clearState(),a}return n(t,e),t.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._clearState()},t.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},t.prototype.onSelectionChanged=function(e,t,r){if(this._didStateChange(e,t,r,this._bufferService.buffer.ydisp))if(this._clearAll(),e&&t){var i=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,s=Math.max(i,0),o=Math.min(n,this._bufferService.rows-1);if(!(s>=this._bufferService.rows||o<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,r){var a=e[0],l=t[0]-a,c=o-s+1;this._fillCells(a,s,l,c)}else{a=i===s?e[0]:0;var u=s===o?t[0]:this._bufferService.cols;this._fillCells(a,s,u-a,1);var h=Math.max(o-s-1,0);if(this._fillCells(0,s+1,this._bufferService.cols,h),s!==o){var d=n===o?t[0]:this._bufferService.cols;this._fillCells(0,o,d,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=r,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,r,i){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||r!==this._state.columnSelectMode||i!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},t}(r(13).BaseRenderLayer);t.SelectionRenderLayer=s},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;var s=r(13),o=r(4),a=function(e){function t(t,r,i,n,s,a,l,c,u){var h=e.call(this,t,"cursor",r,!0,i,n,a,l)||this;return h._onRequestRedraw=s,h._coreService=c,h._coreBrowserService=u,h._cell=new o.CellData,h._state={x:0,y:0,isFocused:!1,style:"",width:0},h._cursorRenderers={bar:h._renderBarCursor.bind(h),block:h._renderBlockCursor.bind(h),underline:h._renderUnderlineCursor.bind(h)},h}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},t.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},t.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onOptionsChanged=function(){var e,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(this._coreBrowserService.isFocused,(function(){t._render(!0)}))):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype.onGridChanged=function(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype._render=function(e){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,r=t-this._bufferService.buffer.ydisp;if(r<0||r>=this._bufferService.rows)this._clearCursor();else{var i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(i,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var n=this._optionsService.options.cursorStyle;return n&&"block"!==n?this._cursorRenderers[n](i,r,this._cell):this._renderBlurCursor(i,r,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=r,this._state.isFocused=!1,this._state.style=n,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===r&&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"](i,r,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=r,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},t.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})},t.prototype._renderBarCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.options.cursorWidth),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,t,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(r,e,t),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,t,r.getWidth(),1),this._ctx.restore()},t}(s.BaseRenderLayer);t.CursorRenderLayer=a;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),e.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)},e.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){e._renderCallback(),e._animationFrame=void 0}))))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout((function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0})),t._blinkInterval=window.setInterval((function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=void 0,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0}))}),600)}),e)},e.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)},e.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},e}()},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;var s=r(13),o=r(9),a=r(26),l=function(e){function t(t,r,i,n,s,o,a,l){var c=e.call(this,t,"link",r,!0,i,n,a,l)||this;return s.onShowLinkUnderline((function(e){return c._onShowLinkUnderline(e)})),s.onHideLinkUnderline((function(e){return c._onHideLinkUnderline(e)})),o.onShowLinkUnderline((function(e){return c._onShowLinkUnderline(e)})),o.onHideLinkUnderline((function(e){return c._onHideLinkUnderline(e)})),c}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state=void 0},t.prototype.reset=function(){this._clearCurrentLink()},t.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},t.prototype._onShowLinkUnderline=function(e){if(e.fg===o.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:e.fg&&a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},t.prototype._onHideLinkUnderline=function(e){this._clearCurrentLink()},t}(s.BaseRenderLayer);t.LinkRenderLayer=l},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZone=t.Linkifier=void 0;var s=r(0),o=r(1),a=function(){function e(e,t,r){this._bufferService=e,this._logService=t,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new s.EventEmitter,this._onHideLinkUnderline=new s.EventEmitter,this._onLinkTooltip=new s.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(e.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),e.prototype.attachToDom=function(e,t){this._element=e,this._mouseZoneManager=t},e.prototype.linkifyRows=function(t,r){var i=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=r):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,r)),this._mouseZoneManager.clearAll(t,r),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout((function(){return i._linkifyRows()}),e._timeBeforeLatency))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var e=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var r=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,i=Math.ceil(2e3/this._bufferService.cols),n=this._bufferService.buffer.iterator(!1,t,r,i,i);n.hasNext();)for(var s=n.next(),o=0;o<this._linkMatchers.length;o++)this._doLinkifyRow(s.range.first,s.content,this._linkMatchers[o]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},e.prototype.registerLinkMatcher=function(e,t,r){if(void 0===r&&(r={}),!t)throw new Error("handler must be defined");var i={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:r.matchIndex,validationCallback:r.validationCallback,hoverTooltipCallback:r.tooltipCallback,hoverLeaveCallback:r.leaveCallback,willLinkActivate:r.willLinkActivate,priority:r.priority||0};return this._addLinkMatcherToList(i),i.id},e.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;t>=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},e.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},e.prototype._doLinkifyRow=function(e,t,r){for(var i,n=this,s=new RegExp(r.regex.source,(r.regex.flags||"")+"g"),o=-1,a=function(){var a=i["number"!=typeof r.matchIndex?0:r.matchIndex];if(!a)return l._logService.debug("match found without corresponding matchIndex",i,r),"break";if(o=t.indexOf(a,o+1),s.lastIndex=o+a.length,o<0)return"break";var c=l._bufferService.buffer.stringIndexToBufferIndex(e,o);if(c[0]<0)return"break";var u=l._bufferService.buffer.lines.get(c[0]);if(!u)return"break";var h=u.getFg(c[1]),d=h?h>>9&511:void 0;r.validationCallback?r.validationCallback(a,(function(e){n._rowsTimeoutId||e&&n._addLink(c[1],c[0]-n._bufferService.buffer.ydisp,a,r,d)})):l._addLink(c[1],c[0]-l._bufferService.buffer.ydisp,a,r,d)},l=this;null!==(i=s.exec(t))&&"break"!==a(););},e.prototype._addLink=function(e,t,r,i,n){var s=this;if(this._mouseZoneManager&&this._element){var o=this._unicodeService.getStringCellWidth(r),a=e%this._bufferService.cols,c=t+Math.floor(e/this._bufferService.cols),u=(a+o)%this._bufferService.cols,h=c+Math.floor((a+o)/this._bufferService.cols);0===u&&(u=this._bufferService.cols,h--),this._mouseZoneManager.add(new l(a+1,c+1,u+1,h+1,(function(e){if(i.handler)return i.handler(e,r);var t=window.open();t?(t.opener=null,t.location.href=r):console.warn("Opening link blocked as opener could not be cleared")}),(function(){s._onShowLinkUnderline.fire(s._createLinkHoverEvent(a,c,u,h,n)),s._element.classList.add("xterm-cursor-pointer")}),(function(e){s._onLinkTooltip.fire(s._createLinkHoverEvent(a,c,u,h,n)),i.hoverTooltipCallback&&i.hoverTooltipCallback(e,r,{start:{x:a,y:c},end:{x:u,y:h}})}),(function(){s._onHideLinkUnderline.fire(s._createLinkHoverEvent(a,c,u,h,n)),s._element.classList.remove("xterm-cursor-pointer"),i.hoverLeaveCallback&&i.hoverLeaveCallback()}),(function(e){return!i.willLinkActivate||i.willLinkActivate(e,r)})))}},e.prototype._createLinkHoverEvent=function(e,t,r,i,n){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:n}},e._timeBeforeLatency=200,e=i([n(0,o.IBufferService),n(1,o.ILogService),n(2,o.IUnicodeService)],e)}();t.Linkifier=a;var l=function(e,t,r,i,n,s,o,a,l){this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.clickCallback=n,this.hoverCallback=s,this.tooltipCallback=o,this.leaveCallback=a,this.willLinkActivate=l};t.MouseZone=l},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;var a=r(11),l=r(52),c=r(4),u=r(0),h=r(5),d=r(1),f=r(30),p=r(53),g=r(2),v=String.fromCharCode(160),m=new RegExp(v,"g"),_=function(e){function t(t,r,i,n,s,o,a){var h=e.call(this)||this;return h._element=t,h._screenElement=r,h._bufferService=i,h._coreService=n,h._mouseService=s,h._optionsService=o,h._renderService=a,h._dragScrollAmount=0,h._enabled=!0,h._workCell=new c.CellData,h._mouseDownTimeStamp=0,h._onLinuxMouseSelection=h.register(new u.EventEmitter),h._onRedrawRequest=h.register(new u.EventEmitter),h._onSelectionChange=h.register(new u.EventEmitter),h._onRequestScrollLines=h.register(new u.EventEmitter),h._mouseMoveListener=function(e){return h._onMouseMove(e)},h._mouseUpListener=function(e){return h._onMouseUp(e)},h._coreService.onUserInput((function(){h.hasSelection&&h.clearSelection()})),h._trimListener=h._bufferService.buffer.lines.onTrim((function(e){return h._onTrim(e)})),h.register(h._bufferService.buffers.onBufferActivate((function(e){return h._onBufferActivate(e)}))),h.enable(),h._model=new l.SelectionModel(h._bufferService),h._activeSelectionMode=0,h}return n(t,e),Object.defineProperty(t.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._removeMouseDownListeners()},t.prototype.reset=function(){this.clearSelection()},t.prototype.disable=function(){this.clearSelection(),this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var r=this._bufferService.buffer,i=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var n=e[1];n<=t[1];n++){var s=r.translateBufferLineToString(n,!0,e[0],t[0]);i.push(s)}}else{var o=e[1]===t[1]?t[0]:void 0;for(i.push(r.translateBufferLineToString(e[1],!0,e[0],o)),n=e[1]+1;n<=t[1]-1;n++){var l=r.lines.get(n);s=r.translateBufferLineToString(n,!0),l&&l.isWrapped?i[i.length-1]+=s:i.push(s)}e[1]!==t[1]&&(l=r.lines.get(t[1]),s=r.translateBufferLineToString(t[1],!0,0,t[0]),l&&l.isWrapped?i[i.length-1]+=s:i.push(s))}return i.map((function(e){return e.replace(m," ")})).join(a.isWindows?"\r\n":"\n")},enumerable:!1,configurable:!0}),t.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},t.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame((function(){return t._refresh()}))),a.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},t.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},t.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!!(r&&i&&t)&&this._areCoordsInSelection(t,r,i)},t.prototype._areCoordsInSelection=function(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]},t.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=void 0,this.refresh(!0))},t.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},t.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()},t.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},t.prototype._getMouseBufferCoords=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t},t.prototype._getMouseEventScrollAmount=function(e){var t=f.getCoordsRelativeToElement(e,this._screenElement)[1],r=this._renderService.dimensions.canvasHeight;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},t.prototype.shouldForceSelection=function(e){return a.isMac?e.altKey&&this._optionsService.options.macOptionClickForcesSelection:e.shiftKey},t.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},t.prototype._addMouseDownListeners=function(){var e=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval((function(){return e._dragScroll()}),50)},t.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},t.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},t.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart){this._model.selectionEnd=void 0;var t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}},t.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},t.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},t.prototype.shouldColumnSelect=function(e){return e.altKey&&!(a.isMac&&this._optionsService.options.macOptionClickForcesSelection)},t.prototype._onMouseMove=function(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){var i=r.lines.get(this._model.selectionEnd[1]);i&&0===i.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},t.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}},t.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&void 0!==r[0]&&void 0!==r[1]){var i=p.moveToCellSequence(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},t.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((function(e){return t._onTrim(e)}))},t.prototype._convertViewportColToCharacterIndex=function(e,t){for(var r=t[0],i=0;t[0]>=i;i++){var n=e.loadCell(i,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:n>1&&t[0]!==i&&(r+=n-1)}return r},t.prototype.setSelection=function(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh()},t.prototype._getWordAt=function(e,t,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),!(e[0]>=this._bufferService.cols)){var n=this._bufferService.buffer,s=n.lines.get(e[1]);if(s){var o=n.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(s,e),l=a,c=e[0]-a,u=0,h=0,d=0,f=0;if(" "===o.charAt(a)){for(;a>0&&" "===o.charAt(a-1);)a--;for(;l<o.length&&" "===o.charAt(l+1);)l++}else{var p=e[0],g=e[0];0===s.getWidth(p)&&(u++,p--),2===s.getWidth(g)&&(h++,g++);var v=s.getString(g).length;for(v>1&&(f+=v-1,l+=v-1);p>0&&a>0&&!this._isCharWordSeparator(s.loadCell(p-1,this._workCell));){s.loadCell(p-1,this._workCell);var m=this._workCell.getChars().length;0===this._workCell.getWidth()?(u++,p--):m>1&&(d+=m-1,a-=m-1),a--,p--}for(;g<s.length&&l+1<o.length&&!this._isCharWordSeparator(s.loadCell(g+1,this._workCell));){s.loadCell(g+1,this._workCell);var _=this._workCell.getChars().length;2===this._workCell.getWidth()?(h++,g++):_>1&&(f+=_-1,l+=_-1),l++,g++}}l++;var y=a+c-u+d,b=Math.min(this._bufferService.cols,l-a+u+h-d-f);if(t||""!==o.slice(a,l).trim()){if(r&&0===y&&32!==s.getCodePoint(0)){var S=n.lines.get(e[1]-1);if(S&&s.isWrapped&&32!==S.getCodePoint(this._bufferService.cols-1)){var w=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(w){var C=this._bufferService.cols-w.start;y-=C,b+=C}}}if(i&&y+b===this._bufferService.cols&&32!==s.getCodePoint(this._bufferService.cols-1)){var E=n.lines.get(e[1]+1);if(E&&E.isWrapped&&32!==E.getCodePoint(0)){var k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(b+=k.length)}}return{start:y,length:b}}}}},t.prototype._selectWordAt=function(e,t){var r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}},t.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var r=e[1];t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}},t.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&this._optionsService.options.wordSeparator.indexOf(e.getChars())>=0},t.prototype._selectLineAt=function(e){var t=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._bufferService.cols,t.last],this._model.selectionStartLength=0},s([o(2,d.IBufferService),o(3,d.ICoreService),o(4,h.IMouseService),o(5,d.IOptionsService),o(6,h.IRenderService)],t)}(g.Disposable);t.SelectionService=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0;var i=function(){function e(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}return e.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.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(e.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 e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,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}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;var i=r(12);function n(e,t,r,i){var n=e-s(r,e),a=t-s(r,t);return c(Math.abs(n-a)-function(e,t,r){for(var i=0,n=e-s(r,e),a=t-s(r,t),l=0;l<Math.abs(n-a);l++){var c="A"===o(e,t)?-1:1,u=r.buffer.lines.get(n+c*l);u&&u.isWrapped&&i++}return i}(e,t,r),l(o(e,t),i))}function s(e,t){for(var r=0,i=e.buffer.lines.get(t),n=i&&i.isWrapped;n&&t>=0&&t<e.rows;)r++,n=(i=e.buffer.lines.get(--t))&&i.isWrapped;return r}function o(e,t){return e>t?"A":"B"}function a(e,t,r,i,n,s){for(var o=e,a=t,l="";o!==r||a!==i;)o+=n?1:-1,n&&o>s.cols-1?(l+=s.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!n&&o<0&&(l+=s.buffer.translateBufferLineToString(a,!1,0,e+1),e=o=s.cols-1,a--);return l+s.buffer.translateBufferLineToString(a,!1,e,o)}function l(e,t){var r=t?"O":"[";return i.C0.ESC+r+e}function c(e,t){e=Math.floor(e);for(var r="",i=0;i<e;i++)r+=t;return r}t.moveToCellSequence=function(e,t,r,i){var o,u=r.buffer.x,h=r.buffer.y;if(!r.buffer.hasScrollback)return function(e,t,r,i,o,u){return 0===n(t,i,o,u).length?"":c(a(e,t,e,t-s(o,t),!1,o).length,l("D",u))}(u,h,0,t,r,i)+n(h,t,r,i)+function(e,t,r,i,o,u){var h;h=n(t,i,o,u).length>0?i-s(o,i):t;var d=i,f=function(e,t,r,i,o,a){var l;return l=n(r,i,o,a).length>0?i-s(o,i):t,e<r&&l<=i||e>=r&&l<i?"C":"D"}(e,t,r,i,o,u);return c(a(e,h,r,d,"C"===f,o).length,l(f,u))}(u,h,e,t,r,i);if(h===t)return o=u>e?"D":"C",c(Math.abs(u-e),l(o,i));o=h>t?"D":"C";var d=Math.abs(h-t);return c(function(e,t){return t.cols-e}(h>t?e:u,r)+(d-1)*r.cols+1+((h>t?u:e)-1),l(o,i))}},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SoundService=void 0;var s=r(1),o=function(){function e(e){this._optionsService=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!1,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var r=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),(function(e){r.buffer=e,r.connect(t.destination),r.start(0)}))}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),r=t.length,i=new Uint8Array(r),n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer},e.prototype._removeMimeType=function(e){return e.split(",")[1]},e=i([n(0,s.IOptionsService)],e)}();t.SoundService=o},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZoneManager=void 0;var a=r(2),l=r(7),c=r(5),u=r(1),h=function(e){function t(t,r,i,n,s,o){var a=e.call(this)||this;return a._element=t,a._screenElement=r,a._bufferService=i,a._mouseService=n,a._selectionService=s,a._optionsService=o,a._zones=[],a._areZonesActive=!1,a._lastHoverCoords=[void 0,void 0],a._initialSelectionLength=0,a.register(l.addDisposableDomListener(a._element,"mousedown",(function(e){return a._onMouseDown(e)}))),a._mouseMoveListener=function(e){return a._onMouseMove(e)},a._mouseLeaveListener=function(e){return a._onMouseLeave(e)},a._clickListener=function(e){return a._onClick(e)},a}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){e&&t||(e=0,t=this._bufferService.rows-1);for(var r=0;r<this._zones.length;r++){var i=this._zones[r];(i.y1>e&&i.y1<=t+1||i.y2>e&&i.y2<=t+1||i.y1<e&&i.y2>t+1)&&(this._currentZone&&this._currentZone===i&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(r--,1))}0===this._zones.length&&this._deactivate()}},t.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))},t.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))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,r=this._findZoneEventAt(e);r!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),r&&(this._currentZone=r,r.hoverCallback&&r.hoverCallback(e),this._tooltipTimeout=window.setTimeout((function(){return t._onTooltip(e)}),this._optionsService.options.linkTooltipHoverDuration)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var t=this._findZoneEventAt(e);(null==t?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),r=this._getSelectionLength();t&&r===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},t.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var r=t[0],i=t[1],n=0;n<this._zones.length;n++){var s=this._zones[n];if(s.y1===s.y2){if(i===s.y1&&r>=s.x1&&r<s.x2)return s}else if(i===s.y1&&r>=s.x1||i===s.y2&&r<s.x2||i>s.y1&&i<s.y2)return s}},s([o(2,u.IBufferService),o(3,c.IMouseService),o(4,c.ISelectionService),o(5,u.IOptionsService)],t)}(a.Disposable);t.MouseZoneManager=h},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;var s=r(18),o=r(11),a=r(31),l=r(7),c=r(2),u=r(32),h=r(17),d=function(e){function t(t,r){var i=e.call(this)||this;i._terminal=t,i._renderService=r,i._liveRegionLineCount=0,i._charsToConsume=[],i._charsToAnnounce="",i._accessibilityTreeRoot=document.createElement("div"),i._accessibilityTreeRoot.classList.add("xterm-accessibility"),i._rowContainer=document.createElement("div"),i._rowContainer.classList.add("xterm-accessibility-tree"),i._rowContainer.setAttribute("role","list"),i._rowElements=[];for(var n=0;n<i._terminal.rows;n++)i._rowElements[n]=i._createAccessibilityTreeNode(),i._rowContainer.appendChild(i._rowElements[n]);if(i._topBoundaryFocusListener=function(e){return i._onBoundaryFocus(e,0)},i._bottomBoundaryFocusListener=function(e){return i._onBoundaryFocus(e,1)},i._rowElements[0].addEventListener("focus",i._topBoundaryFocusListener),i._rowElements[i._rowElements.length-1].addEventListener("focus",i._bottomBoundaryFocusListener),i._refreshRowsDimensions(),i._accessibilityTreeRoot.appendChild(i._rowContainer),i._renderRowsDebouncer=new a.RenderDebouncer(i._renderRows.bind(i)),i._refreshRows(),i._liveRegion=document.createElement("div"),i._liveRegion.classList.add("live-region"),i._liveRegion.setAttribute("aria-live","assertive"),i._accessibilityTreeRoot.appendChild(i._liveRegion),!i._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return i._terminal.element.insertAdjacentElement("afterbegin",i._accessibilityTreeRoot),i.register(i._renderRowsDebouncer),i.register(i._terminal.onResize((function(e){return i._onResize(e.rows)}))),i.register(i._terminal.onRender((function(e){return i._refreshRows(e.start,e.end)}))),i.register(i._terminal.onScroll((function(){return i._refreshRows()}))),i.register(i._terminal.onA11yChar((function(e){return i._onChar(e)}))),i.register(i._terminal.onLineFeed((function(){return i._onChar("\n")}))),i.register(i._terminal.onA11yTab((function(e){return i._onTab(e)}))),i.register(i._terminal.onKey((function(e){return i._onKey(e.key)}))),i.register(i._terminal.onBlur((function(){return i._clearLiveRegion()}))),i.register(i._renderService.onDimensionsChange((function(){return i._refreshRowsDimensions()}))),i._screenDprMonitor=new u.ScreenDprMonitor,i.register(i._screenDprMonitor),i._screenDprMonitor.setListener((function(){return i._refreshRowsDimensions()})),i.register(l.addDisposableDomListener(window,"resize",(function(){return i._refreshRowsDimensions()}))),i}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),h.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(e,t){var r=e.target,i=this._rowElements[0===t?1:this._rowElements.length-2];if(r.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===i){var n,s;if(0===t?(n=r,s=this._rowElements.pop(),this._rowContainer.removeChild(s)):(n=this._rowElements.shift(),s=r,this._rowContainer.removeChild(n)),n.removeEventListener("focus",this._topBoundaryFocusListener),s.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var o=this._createAccessibilityTreeNode();this._rowElements.unshift(o),this._rowContainer.insertAdjacentElement("afterbegin",o)}else o=this._createAccessibilityTreeNode(),this._rowElements.push(o),this._rowContainer.appendChild(o);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}},t.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},t.prototype._onChar=function(e){var t=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=s.tooMuchOutput)),o.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)}),0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,o.isMac&&h.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var r=this._terminal.buffer,i=r.lines.length.toString(),n=e;n<=t;n++){var s=r.translateBufferLineToString(r.ydisp+n,!0),o=(r.ydisp+n+1).toString(),a=this._rowElements[n];a&&(0===s.length?a.innerHTML=" ":a.textContent=s,a.setAttribute("aria-posinset",o),a.setAttribute("aria-setsize",i))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},t.prototype._refreshRowDimensions=function(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(c.Disposable);t.AccessibilityManager=d},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;var a=r(58),l=r(9),c=r(2),u=r(5),h=r(1),d=r(0),f=r(10),p=r(17),g=1,v=function(e){function t(t,r,i,n,s,o,l,c,u){var h=e.call(this)||this;return h._colors=t,h._element=r,h._screenElement=i,h._viewportElement=n,h._linkifier=s,h._linkifier2=o,h._charSizeService=l,h._optionsService=c,h._bufferService=u,h._terminalClass=g++,h._rowElements=[],h._rowContainer=document.createElement("div"),h._rowContainer.classList.add("xterm-rows"),h._rowContainer.style.lineHeight="normal",h._rowContainer.setAttribute("aria-hidden","true"),h._refreshRowElements(h._bufferService.cols,h._bufferService.rows),h._selectionContainer=document.createElement("div"),h._selectionContainer.classList.add("xterm-selection"),h._selectionContainer.setAttribute("aria-hidden","true"),h.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},h._updateDimensions(),h._injectCss(),h._rowFactory=new a.DomRendererRowFactory(document,h._optionsService,h._colors),h._element.classList.add("xterm-dom-renderer-owner-"+h._terminalClass),h._screenElement.appendChild(h._rowContainer),h._screenElement.appendChild(h._selectionContainer),h._linkifier.onShowLinkUnderline((function(e){return h._onLinkHover(e)})),h._linkifier.onHideLinkUnderline((function(e){return h._onLinkLeave(e)})),h._linkifier2.onShowLinkUnderline((function(e){return h._onLinkHover(e)})),h._linkifier2.onHideLinkUnderline((function(e){return h._onLinkLeave(e)})),h}return n(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return(new d.EventEmitter).event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),p.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.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 e=0,t=this._rowElements;e<t.length;e++){var r=t[e];r.style.width=this.dimensions.canvasWidth+"px",r.style.height=this.dimensions.actualCellHeight+"px",r.style.lineHeight=this.dimensions.actualCellHeight+"px",r.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var i=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.setColors=function(e){this._colors=e,this._injectCss()},t.prototype._injectCss=function(){var e=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var t=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";t+=this._terminalSelector+" span:not(."+a.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+a.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+a.ITALIC_CLASS+" { font-style: italic;}",t+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",t+="@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+"; }}",t+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_BLINK_CLASS+":not(."+a.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_BLINK_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",t+=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(r,i){t+=e._terminalSelector+" .xterm-fg-"+i+" { color: "+r.css+"; }"+e._terminalSelector+" .xterm-bg-"+i+" { background-color: "+r.css+"; }"})),t+=this._terminalSelector+" .xterm-fg-"+l.INVERTED_DEFAULT_COLOR+" { color: "+f.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+l.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=t},t.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},t.prototype._refreshRowElements=function(e,t){for(var r=this._rowElements.length;r<=t;r++){var i=document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},t.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},t.prototype.onSelectionChanged=function(e,t,r){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var i=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,s=Math.max(i,0),o=Math.min(n,this._bufferService.rows-1);if(!(s>=this._bufferService.rows||o<0)){var a=document.createDocumentFragment();if(r)a.appendChild(this._createSelectionElement(s,e[0],t[0],o-s+1));else{var l=i===s?e[0]:0,c=s===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,l,c));var u=o-s-1;if(a.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,u)),s!==o){var h=n===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,h))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,r,i){void 0===i&&(i=1);var n=document.createElement("div");return n.style.height=i*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(r-t)+"px",n},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},t.prototype.clear=function(){for(var e=0,t=this._rowElements;e<t.length;e++)t[e].innerHTML=""},t.prototype.renderRows=function(e,t){for(var r=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._optionsService.options.cursorBlink,s=e;s<=t;s++){var o=this._rowElements[s];o.innerHTML="";var a=s+this._bufferService.buffer.ydisp,l=this._bufferService.buffer.lines.get(a),c=this._optionsService.options.cursorStyle;o.appendChild(this._rowFactory.createRow(l,a===r,c,i,n,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(t.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},t.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},t.prototype._setCellUnderline=function(e,t,r,i,n,s){for(;e!==t||r!==i;){var o=this._rowElements[r];if(!o)return;var a=o.children[e];a&&(a.style.textDecoration=s?"underline":"none"),++e>=n&&(e=0,r++)}},s([o(6,u.ICharSizeService),o(7,h.IOptionsService),o(8,h.IBufferService)],t)}(c.Disposable);t.DomRenderer=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;var i=r(9),n=r(3),s=r(4),o=r(10);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var a=function(){function e(e,t,r){this._document=e,this._optionsService=t,this._colors=r,this._workCell=new s.CellData}return e.prototype.setColors=function(e){this._colors=e},e.prototype.createRow=function(e,r,s,a,c,u,h){for(var d=this._document.createDocumentFragment(),f=0,p=Math.min(e.length,h)-1;p>=0;p--)if(e.loadCell(p,this._workCell).getCode()!==n.NULL_CELL_CODE||r&&p===a){f=p+1;break}for(p=0;p<f;p++){e.loadCell(p,this._workCell);var g=this._workCell.getWidth();if(0!==g){var v=this._document.createElement("span");if(g>1&&(v.style.width=u*g+"px"),r&&p===a)switch(v.classList.add(t.CURSOR_CLASS),c&&v.classList.add(t.CURSOR_BLINK_CLASS),s){case"bar":v.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":v.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:v.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&v.classList.add(t.BOLD_CLASS),this._workCell.isItalic()&&v.classList.add(t.ITALIC_CLASS),this._workCell.isDim()&&v.classList.add(t.DIM_CLASS),this._workCell.isUnderline()&&v.classList.add(t.UNDERLINE_CLASS),this._workCell.isInvisible()?v.textContent=n.WHITESPACE_CELL_CHAR:v.textContent=this._workCell.getChars()||n.WHITESPACE_CELL_CHAR;var m=this._workCell.getFgColor(),_=this._workCell.getFgColorMode(),y=this._workCell.getBgColor(),b=this._workCell.getBgColorMode(),S=!!this._workCell.isInverse();if(S){var w=m;m=y,y=w;var C=_;_=b,b=C}switch(_){case 16777216:case 33554432:this._workCell.isBold()&&m<8&&this._optionsService.options.drawBoldTextInBrightColors&&(m+=8),this._applyMinimumContrast(v,this._colors.background,this._colors.ansi[m])||v.classList.add("xterm-fg-"+m);break;case 50331648:var E=o.rgba.toColor(m>>16&255,m>>8&255,255&m);this._applyMinimumContrast(v,this._colors.background,E)||this._addStyle(v,"color:#"+l(m.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(v,this._colors.background,this._colors.foreground)||S&&v.classList.add("xterm-fg-"+i.INVERTED_DEFAULT_COLOR)}switch(b){case 16777216:case 33554432:v.classList.add("xterm-bg-"+y);break;case 50331648:this._addStyle(v,"background-color:#"+l(y.toString(16),"0",6));break;case 0:default:S&&v.classList.add("xterm-bg-"+i.INVERTED_DEFAULT_COLOR)}d.appendChild(v)}}return d},e.prototype._applyMinimumContrast=function(e,t,r){if(1===this._optionsService.options.minimumContrastRatio)return!1;var i=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===i&&(i=o.color.ensureContrastRatio(t,r,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=i?i:null)),!!i&&(this._addStyle(e,"color:"+i.css),!0)},e.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},e}();function l(e,t,r){for(;e.length<r;)e=t+e;return e}t.DomRendererRowFactory=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;var i=r(12),n={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:["'",'"']};t.evaluateKeyboardEvent=function(e,t,r,s){var o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?i.C0.ESC+"OA":i.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?i.C0.ESC+"OD":i.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?i.C0.ESC+"OC":i.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?i.C0.ESC+"OB":i.C0.ESC+"[B");break;case 8:if(e.shiftKey){o.key=i.C0.BS;break}if(e.altKey){o.key=i.C0.ESC+i.C0.DEL;break}o.key=i.C0.DEL;break;case 9:if(e.shiftKey){o.key=i.C0.ESC+"[Z";break}o.key=i.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?i.C0.ESC+i.C0.CR:i.C0.CR,o.cancel=!0;break;case 27:o.key=i.C0.ESC,e.altKey&&(o.key=i.C0.ESC+i.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?(o.key=i.C0.ESC+"[1;"+(a+1)+"D",o.key===i.C0.ESC+"[1;3D"&&(o.key=i.C0.ESC+(r?"b":"[1;5D"))):o.key=t?i.C0.ESC+"OD":i.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(o.key=i.C0.ESC+"[1;"+(a+1)+"C",o.key===i.C0.ESC+"[1;3C"&&(o.key=i.C0.ESC+(r?"f":"[1;5C"))):o.key=t?i.C0.ESC+"OC":i.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(o.key=i.C0.ESC+"[1;"+(a+1)+"A",r||o.key!==i.C0.ESC+"[1;3A"||(o.key=i.C0.ESC+"[1;5A")):o.key=t?i.C0.ESC+"OA":i.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(o.key=i.C0.ESC+"[1;"+(a+1)+"B",r||o.key!==i.C0.ESC+"[1;3B"||(o.key=i.C0.ESC+"[1;5B")):o.key=t?i.C0.ESC+"OB":i.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=i.C0.ESC+"[2~");break;case 46:o.key=a?i.C0.ESC+"[3;"+(a+1)+"~":i.C0.ESC+"[3~";break;case 36:o.key=a?i.C0.ESC+"[1;"+(a+1)+"H":t?i.C0.ESC+"OH":i.C0.ESC+"[H";break;case 35:o.key=a?i.C0.ESC+"[1;"+(a+1)+"F":t?i.C0.ESC+"OF":i.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:o.key=i.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:o.key=i.C0.ESC+"[6~";break;case 112:o.key=a?i.C0.ESC+"[1;"+(a+1)+"P":i.C0.ESC+"OP";break;case 113:o.key=a?i.C0.ESC+"[1;"+(a+1)+"Q":i.C0.ESC+"OQ";break;case 114:o.key=a?i.C0.ESC+"[1;"+(a+1)+"R":i.C0.ESC+"OR";break;case 115:o.key=a?i.C0.ESC+"[1;"+(a+1)+"S":i.C0.ESC+"OS";break;case 116:o.key=a?i.C0.ESC+"[15;"+(a+1)+"~":i.C0.ESC+"[15~";break;case 117:o.key=a?i.C0.ESC+"[17;"+(a+1)+"~":i.C0.ESC+"[17~";break;case 118:o.key=a?i.C0.ESC+"[18;"+(a+1)+"~":i.C0.ESC+"[18~";break;case 119:o.key=a?i.C0.ESC+"[19;"+(a+1)+"~":i.C0.ESC+"[19~";break;case 120:o.key=a?i.C0.ESC+"[20;"+(a+1)+"~":i.C0.ESC+"[20~";break;case 121:o.key=a?i.C0.ESC+"[21;"+(a+1)+"~":i.C0.ESC+"[21~";break;case 122:o.key=a?i.C0.ESC+"[23;"+(a+1)+"~":i.C0.ESC+"[23~";break;case 123:o.key=a?i.C0.ESC+"[24;"+(a+1)+"~":i.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(r&&!s||!e.altKey||e.metaKey)r&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(o.key=i.C0.US);else{var l=n[e.keyCode],c=l&&l[e.shiftKey?1:0];if(c)o.key=i.C0.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){var u=e.ctrlKey?e.keyCode-64:e.keyCode+32;o.key=i.C0.ESC+String.fromCharCode(u)}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=i.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=i.C0.DEL:219===e.keyCode?o.key=i.C0.ESC:220===e.keyCode?o.key=i.C0.FS:221===e.keyCode&&(o.key=i.C0.GS)}return o}},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;var a=r(31),l=r(0),c=r(2),u=r(32),h=r(7),d=r(1),f=r(5),p=function(e){function t(t,r,i,n,s,o){var c=e.call(this)||this;if(c._renderer=t,c._rowCount=r,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 l.EventEmitter,c._onRender=new l.EventEmitter,c._onRefreshRequest=new l.EventEmitter,c.register({dispose:function(){return c._renderer.dispose()}}),c._renderDebouncer=new a.RenderDebouncer((function(e,t){return c._renderRows(e,t)})),c.register(c._renderDebouncer),c._screenDprMonitor=new u.ScreenDprMonitor,c._screenDprMonitor.setListener((function(){return c.onDevicePixelRatioChange()})),c.register(c._screenDprMonitor),c.register(o.onResize((function(e){return c._fullRefresh()}))),c.register(n.onOptionChange((function(){return c._renderer.onOptionsChanged()}))),c.register(s.onCharSizeChange((function(){return c.onCharSizeChanged()}))),c._renderer.onRequestRedraw((function(e){return c.refreshRows(e.start,e.end,!0)})),c.register(h.addDisposableDomListener(window,"resize",(function(){return c.onDevicePixelRatioChange()}))),"IntersectionObserver"in window){var d=new IntersectionObserver((function(e){return c._onIntersectionChange(e[e.length-1])}),{threshold:0});d.observe(i),c.register({dispose:function(){return d.disconnect()}})}return c}return n(t,e),Object.defineProperty(t.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),t.prototype._onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},t.prototype.refreshRows=function(e,t,r){void 0===r&&(r=!1),this._isPaused?this._needsFullRefresh=!0:(r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))},t.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0},t.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},t.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},t.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.setRenderer=function(e){var t=this;this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw((function(e){return t.refreshRows(e.start,e.end,!0)})),this._needsSelectionRefresh=!0,this._fullRefresh()},t.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},t.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},t.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},t.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},t.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},t.prototype.onBlur=function(){this._renderer.onBlur()},t.prototype.onFocus=function(){this._renderer.onFocus()},t.prototype.onSelectionChanged=function(e,t,r){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,this._renderer.onSelectionChanged(e,t,r)},t.prototype.onCursorMove=function(){this._renderer.onCursorMove()},t.prototype.clear=function(){this._renderer.clear()},t.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},s([o(3,d.IOptionsService),o(4,f.ICharSizeService),o(5,d.IBufferService)],t)}(c.Disposable);t.RenderService=p},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;var s=r(1),o=r(0),a=function(){function e(e,t,r){this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=new o.EventEmitter,this._measureStrategy=new l(e,t,this._optionsService)}return Object.defineProperty(e.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),e.prototype.measure=function(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())},i([n(2,s.IOptionsService)],e)}();t.CharSizeService=a;var l=function(){function e(e,t,r){this._document=e,this._parentElement=t,this._optionsService=r,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return e.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result},e}()},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;var s=r(5),o=r(30),a=function(){function e(e,t){this._renderService=e,this._charSizeService=t}return e.prototype.getCoords=function(e,t,r,i,n){return o.getCoords(e,t,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,n)},e.prototype.getRawByteCoords=function(e,t,r,i){var n=this.getCoords(e,t,r,i);return o.getRawByteCoords(n)},i([n(0,s.IRenderService),n(1,s.ICharSizeService)],e)}();t.MouseService=a},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;var a=r(1),l=r(0),c=r(2),u=r(7),h=function(e){function t(t){var r=e.call(this)||this;return r._bufferService=t,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new l.EventEmitter),r._onHideLinkUnderline=r.register(new l.EventEmitter),r.register(c.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return n(t,e),Object.defineProperty(t.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),t.prototype.registerLinkProvider=function(e){var t=this;return this._linkProviders.push(e),{dispose:function(){var r=t._linkProviders.indexOf(e);-1!==r&&t._linkProviders.splice(r,1)}}},t.prototype.attachToDom=function(e,t,r){var i=this;this._element=e,this._mouseService=t,this._renderService=r,this.register(u.addDisposableDomListener(this._element,"mouseleave",(function(){i._isMouseOut=!0,i._clearCurrentLink()}))),this.register(u.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(u.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},t.prototype._onMouseMove=function(e){if(this._lastMouseEvent=e,this._element&&this._mouseService){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(t){this._isMouseOut=!1;for(var r=e.composedPath(),i=0;i<r.length;i++){var n=r[i];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._onHover(t),this._lastBufferCell=t)}}},t.prototype._onHover=function(e){if(this._activeLine!==e.y)return this._clearCurrentLink(),void this._askForLink(e,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))},t.prototype._askForLink=function(e,t){var r=this;this._activeProviderReplies&&t||(this._activeProviderReplies=new Map,this._activeLine=e.y);var i=!1;this._linkProviders.forEach((function(n,s){var o;t?(null===(o=r._activeProviderReplies)||void 0===o?void 0:o.get(s))&&(i=r._checkLinkProviderResult(s,e,i)):n.provideLinks(e.y,(function(t){var n,o;if(!r._isMouseOut){var a=null==t?void 0:t.map((function(e){return{link:e}}));null===(n=r._activeProviderReplies)||void 0===n||n.set(s,a),i=r._checkLinkProviderResult(s,e,i),(null===(o=r._activeProviderReplies)||void 0===o?void 0:o.size)===r._linkProviders.length&&r._removeIntersectingLinks(e.y,r._activeProviderReplies)}}))}))},t.prototype._removeIntersectingLinks=function(e,t){for(var r=new Set,i=0;i<t.size;i++){var n=t.get(i);if(n)for(var s=0;s<n.length;s++)for(var o=n[s],a=o.link.range.start.y<e?0:o.link.range.start.x,l=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x,c=a;c<=l;c++){if(r.has(c)){n.splice(s--,1);break}r.add(c)}}},t.prototype._checkLinkProviderResult=function(e,t,r){var i,n=this;if(!this._activeProviderReplies)return r;for(var s=this._activeProviderReplies.get(e),o=!1,a=0;a<e;a++)this._activeProviderReplies.has(a)&&!this._activeProviderReplies.get(a)||(o=!0);if(!o&&s){var l=s.find((function(e){return n._linkAtPosition(e.link,t)}));l&&(r=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviders.length&&!r)for(a=0;a<this._activeProviderReplies.size;a++){var c=null===(i=this._activeProviderReplies.get(a))||void 0===i?void 0:i.find((function(e){return n._linkAtPosition(e.link,t)}));if(c){r=!0,this._handleNewLink(c);break}}return r},t.prototype._onClick=function(e){if(this._element&&this._mouseService&&this._currentLink){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}},t.prototype._clearCurrentLink=function(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,c.disposeArray(this._linkCacheDisposables))},t.prototype._handleNewLink=function(e){var t=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(e.link,r)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:function(){var e,r;return null===(r=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===r?void 0:r.decorations.pointerCursor},set:function(e){var r,i;(null===(r=t._currentLink)||void 0===r?void 0:r.state)&&t._currentLink.state.decorations.pointerCursor!==e&&(t._currentLink.state.decorations.pointerCursor=e,t._currentLink.state.isHovered&&(null===(i=t._element)||void 0===i||i.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:function(){var e,r;return null===(r=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===r?void 0:r.decorations.underline},set:function(r){var i,n,s;(null===(i=t._currentLink)||void 0===i?void 0:i.state)&&(null===(s=null===(n=t._currentLink)||void 0===n?void 0:n.state)||void 0===s?void 0:s.decorations.underline)!==r&&(t._currentLink.state.decorations.underline=r,t._currentLink.state.isHovered&&t._fireUnderlineEvent(e.link,r))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange((function(e){var r=0===e.start?0:e.start+1+t._bufferService.buffer.ydisp;t._clearCurrentLink(r,e.end+1+t._bufferService.buffer.ydisp)}))))}},t.prototype._linkHover=function(e,t,r){var i;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)},t.prototype._fireUnderlineEvent=function(e,t){var r=e.range,i=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-i-1,r.end.x,r.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)},t.prototype._linkLeave=function(e,t,r){var i;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)},t.prototype._linkAtPosition=function(e,t){var r=e.range.start.y===e.range.end.y,i=e.range.start.y<t.y,n=e.range.end.y>t.y;return(r&&e.range.start.x<=t.x&&e.range.end.x>=t.x||i&&e.range.end.x>=t.x||n&&e.range.start.x<=t.x||i&&n)&&e.range.start.y<=t.y&&e.range.end.y>=t.y},t.prototype._positionFromMouseEvent=function(e,t,r){var i=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}},t.prototype._createLinkUnderlineEvent=function(e,t,r,i,n){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:n}},s([o(0,a.IBufferService)],t)}(c.Disposable);t.Linkifier2=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;var i=function(){function e(e){this._textarea=e}return Object.defineProperty(e.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),e}();t.CoreBrowserService=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;var s=r(2),o=r(1),a=r(66),l=r(67),c=r(68),u=r(74),h=r(75),d=r(0),f=r(76),p=r(77),g=r(78),v=r(80),m=r(81),_=r(19),y=r(82),b=function(e){function t(t){var r=e.call(this)||this;return r._onBinary=new d.EventEmitter,r._onData=new d.EventEmitter,r._onLineFeed=new d.EventEmitter,r._onResize=new d.EventEmitter,r._onScroll=new d.EventEmitter,r._instantiationService=new a.InstantiationService,r.optionsService=new u.OptionsService(t),r._instantiationService.setService(o.IOptionsService,r.optionsService),r._bufferService=r.register(r._instantiationService.createInstance(c.BufferService)),r._instantiationService.setService(o.IBufferService,r._bufferService),r._logService=r._instantiationService.createInstance(l.LogService),r._instantiationService.setService(o.ILogService,r._logService),r._coreService=r.register(r._instantiationService.createInstance(h.CoreService,(function(){return r.scrollToBottom()}))),r._instantiationService.setService(o.ICoreService,r._coreService),r._coreMouseService=r._instantiationService.createInstance(f.CoreMouseService),r._instantiationService.setService(o.ICoreMouseService,r._coreMouseService),r._dirtyRowService=r._instantiationService.createInstance(p.DirtyRowService),r._instantiationService.setService(o.IDirtyRowService,r._dirtyRowService),r.unicodeService=r._instantiationService.createInstance(g.UnicodeService),r._instantiationService.setService(o.IUnicodeService,r.unicodeService),r._charsetService=r._instantiationService.createInstance(v.CharsetService),r._instantiationService.setService(o.ICharsetService,r._charsetService),r._inputHandler=new _.InputHandler(r._bufferService,r._charsetService,r._coreService,r._dirtyRowService,r._logService,r.optionsService,r._coreMouseService,r.unicodeService),r.register(d.forwardEvent(r._inputHandler.onLineFeed,r._onLineFeed)),r.register(r._inputHandler),r.register(d.forwardEvent(r._bufferService.onResize,r._onResize)),r.register(d.forwardEvent(r._coreService.onData,r._onData)),r.register(d.forwardEvent(r._coreService.onBinary,r._onBinary)),r.register(r.optionsService.onOptionChange((function(e){return r._updateOptions(e)}))),r._writeBuffer=new y.WriteBuffer((function(e){return r._inputHandler.parse(e)})),r}return n(t,e),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var t;this._isDisposed||(e.prototype.dispose.call(this),null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)},t.prototype.write=function(e,t){this._writeBuffer.write(e,t)},t.prototype.writeSync=function(e){this._writeBuffer.writeSync(e)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,c.MINIMUM_COLS),t=Math.max(t,c.MINIMUM_ROWS),this._bufferService.resize(e,t))},t.prototype.scroll=function(e,t){void 0===t&&(t=!1);var r,i=this._bufferService.buffer;(r=this._cachedBlankLine)&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=i.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;var n=i.ybase+i.scrollTop,s=i.ybase+i.scrollBottom;if(0===i.scrollTop){var o=i.lines.isFull;s===i.lines.length-1?o?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(s+1,0,r.clone()),o?this._bufferService.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this._bufferService.isUserScrolling||i.ydisp++)}else{var a=s-n+1;i.lines.shiftElements(n+1,a-1,-1),i.lines.set(s,r.clone())}this._bufferService.isUserScrolling||(i.ydisp=i.ybase),this._dirtyRowService.markRangeDirty(i.scrollTop,i.scrollBottom),this._onScroll.fire(i.ydisp)},t.prototype.scrollLines=function(e,t){var r=this._bufferService.buffer;if(e<0){if(0===r.ydisp)return;this._bufferService.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this._bufferService.isUserScrolling=!1);var i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))},t.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},t.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},t.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},t.prototype.scrollToLine=function(e){var t=e-this._bufferService.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},t.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},t.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},t.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},t.prototype._updateOptions=function(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}},t.prototype._enableWindowsMode=function(){var e=this;if(!this._windowsMode){var t=[];t.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.addCsiHandler({final:"H"},(function(){return m.updateWindowsModeWrappedState(e._bufferService),!1}))),this._windowsMode={dispose:function(){for(var e=0,r=t;e<r.length;e++)r[e].dispose()}}}},t}(s.Disposable);t.CoreTerminal=b},function(e,t,r){"use strict";var i=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=Array(e),n=0;for(t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i};Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;var n=r(1),s=r(14),o=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._entries=new Map;for(var r=0,i=e;r<i.length;r++){var n=i[r],s=n[0],o=n[1];this.set(s,o)}}return e.prototype.set=function(e,t){var r=this._entries.get(e);return this._entries.set(e,t),r},e.prototype.forEach=function(e){this._entries.forEach((function(t,r){return e(r,t)}))},e.prototype.has=function(e){return this._entries.has(e)},e.prototype.get=function(e){return this._entries.get(e)},e}();t.ServiceCollection=o;var a=function(){function e(){this._services=new o,this._services.set(n.IInstantiationService,this)}return e.prototype.setService=function(e,t){this._services.set(e,t)},e.prototype.getService=function(e){return this._services.get(e)},e.prototype.createInstance=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=s.getServiceDependencies(e).sort((function(e,t){return e.index-t.index})),o=[],a=0,l=n;a<l.length;a++){var c=l[a],u=this._services.get(c.id);if(!u)throw new Error("[createInstance] "+e.name+" depends on UNKNOWN service "+c.id+".");o.push(u)}var h=n.length>0?n[0].index:t.length;if(t.length!==h)throw new Error("[createInstance] First service dependency of "+e.name+" at position "+(h+1)+" conflicts with "+t.length+" static arguments");return new(e.bind.apply(e,i([void 0],i(t,o))))},e}();t.InstantiationService=a},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}},s=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=Array(e),n=0;for(t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=t.LogLevel=void 0;var o,a=r(1);!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.OFF=4]="OFF"}(o=t.LogLevel||(t.LogLevel={}));var l={debug:o.DEBUG,info:o.INFO,warn:o.WARN,error:o.ERROR,off:o.OFF},c=function(){function e(e){var t=this;this._optionsService=e,this._updateLogLevel(),this._optionsService.onOptionChange((function(e){"logLevel"===e&&t._updateLogLevel()}))}return e.prototype._updateLogLevel=function(){this._logLevel=l[this._optionsService.options.logLevel]},e.prototype._evalLazyOptionalParams=function(e){for(var t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())},e.prototype._log=function(e,t,r){this._evalLazyOptionalParams(r),e.call.apply(e,s([console,"xterm.js: "+t],r))},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=o.DEBUG&&this._log(console.log,e,t)},e.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=o.INFO&&this._log(console.info,e,t)},e.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=o.WARN&&this._log(console.warn,e,t)},e.prototype.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=o.ERROR&&this._log(console.error,e,t)},i([n(0,a.IOptionsService)],e)}();t.LogService=c},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;var a=r(1),l=r(69),c=r(0),u=r(2);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;var h=function(e){function r(r){var i=e.call(this)||this;return i._optionsService=r,i.isUserScrolling=!1,i._onResize=new c.EventEmitter,i.cols=Math.max(r.options.cols,t.MINIMUM_COLS),i.rows=Math.max(r.options.rows,t.MINIMUM_ROWS),i.buffers=new l.BufferSet(r,i),i}return n(r,e),Object.defineProperty(r.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),r.prototype.dispose=function(){e.prototype.dispose.call(this),this.buffers.dispose()},r.prototype.resize=function(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})},r.prototype.reset=function(){this.buffers.dispose(),this.buffers=new l.BufferSet(this._optionsService,this),this.isUserScrolling=!1},s([o(0,a.IOptionsService)],r)}(u.Disposable);t.BufferService=h},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;var s=r(70),o=r(0),a=function(e){function t(t,r){var i=e.call(this)||this;return i._onBufferActivate=i.register(new o.EventEmitter),i._normal=new s.Buffer(!0,t,r),i._normal.fillViewportRows(),i._alt=new s.Buffer(!1,t,r),i._activeBuffer=i._normal,i.setupTabStops(),i}return n(t,e),Object.defineProperty(t.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),t.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}))},t.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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}))},t.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},t.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},t}(r(2).Disposable);t.BufferSet=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;var i=r(71),n=r(16),s=r(4),o=r(3),a=r(72),l=r(73),c=r(20),u=r(6);t.MAX_BUFFER_SIZE=4294967295;var h=function(){function e(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=n.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=s.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=s.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new n.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!1,configurable:!0}),e.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var r=e+this._optionsService.options.scrollback;return r>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:r},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=n.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var r=this.getNullCell(n.DEFAULT_ATTR_DATA),i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(var s=0;s<this.lines.length;s++)this.lines.get(s).resize(e,r);var o=0;if(this._rows<t)for(var a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new n.BufferLine(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new n.BufferLine(e,r)));else for(a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){var l=this.lines.length-i;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(s=0;s<this.lines.length;s++)this.lines.get(s).resize(e,r);this._cols=e,this._rows=t},Object.defineProperty(e.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),e.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var r=a.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(n.DEFAULT_ATTR_DATA));if(r.length>0){var i=a.reflowLargerCreateNewLayout(this.lines,r);a.reflowLargerApplyNewLayout(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,t,r){for(var i=this.getNullCell(n.DEFAULT_ATTR_DATA),s=r;s-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new n.BufferLine(e,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)},e.prototype._reflowSmaller=function(e,t){for(var r=this.getNullCell(n.DEFAULT_ATTR_DATA),i=[],s=0,o=this.lines.length-1;o>=0;o--){var l=this.lines.get(o);if(!(!l||!l.isWrapped&&l.getTrimmedLength()<=e)){for(var c=[l];l.isWrapped&&o>0;)l=this.lines.get(--o),c.unshift(l);var u=this.ybase+this.y;if(!(u>=o&&u<o+c.length)){var h,d=c[c.length-1].getTrimmedLength(),f=a.reflowSmallerGetNewLineLengths(c,this._cols,e),p=f.length-c.length;h=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+p):Math.max(0,this.lines.length-this.lines.maxLength+p);for(var g=[],v=0;v<p;v++){var m=this.getBlankLine(n.DEFAULT_ATTR_DATA,!0);g.push(m)}g.length>0&&(i.push({start:o+c.length+s,newLines:g}),s+=g.length),c.push.apply(c,g);var _=f.length-1,y=f[_];0===y&&(y=f[--_]);for(var b=c.length-p-1,S=d;b>=0;){var w=Math.min(S,y);if(c[_].copyCellsFrom(c[b],S-w,y-w,w,!0),0==(y-=w)&&(y=f[--_]),0==(S-=w)){b--;var C=Math.max(b,0);S=a.getWrappedLineTrimmedLength(c,C,this._cols)}}for(v=0;v<c.length;v++)f[v]<e&&c[v].setCell(f[v],r);for(var E=p-h;E-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}}}if(i.length>0){var k=[],x=[];for(v=0;v<this.lines.length;v++)x.push(this.lines.get(v));var T=this.lines.length,L=T-1,A=0,D=i[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);var O=0;for(v=Math.min(this.lines.maxLength-1,T+s-1);v>=0;v--)if(D&&D.start>L+O){for(var R=D.newLines.length-1;R>=0;R--)this.lines.set(v--,D.newLines[R]);v++,k.push({index:L+1,amount:D.newLines.length}),O+=D.newLines.length,D=i[++A]}else this.lines.set(v,x[L--]);var M=0;for(v=k.length-1;v>=0;v--)k[v].index+=M,this.lines.onInsertEmitter.fire(k[v]),M+=k[v].amount;var I=Math.max(0,T+s-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}},e.prototype.stringIndexToBufferIndex=function(e,t,r){for(void 0===r&&(r=!1);t;){var i=this.lines.get(e);if(!i)return[-1,-1];for(var n=r?i.getTrimmedLength():i.length,s=0;s<n;++s)if(i.get(s)[o.CHAR_DATA_WIDTH_INDEX]&&(t-=i.get(s)[o.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,s];e++}return[e,0]},e.prototype.translateBufferLineToString=function(e,t,r,i){void 0===r&&(r=0);var n=this.lines.get(e);return n?n.translateToString(t,r,i):""},e.prototype.getWrappedRangeForLine=function(e){for(var t=e,r=e;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}},e.prototype.setupTabStops=function(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.options.tabStopWidth)this.tabs[e]=!0},e.prototype.prevStop=function(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,r=new l.Marker(e);return this.markers.push(r),r.register(this.lines.onTrim((function(e){r.line-=e,r.line<0&&r.dispose()}))),r.register(this.lines.onInsert((function(e){r.line>=e.index&&(r.line+=e.amount)}))),r.register(this.lines.onDelete((function(e){r.line>=e.index&&r.line<e.index+e.amount&&r.dispose(),r.line>e.index&&(r.line-=e.amount)}))),r.register(r.onDispose((function(){return t._removeMarker(r)}))),r},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,r,i,n){return new d(this,e,t,r,i,n)},e}();t.Buffer=h;var d=function(){function e(e,t,r,i,n,s){void 0===r&&(r=0),void 0===i&&(i=e.lines.length),void 0===n&&(n=0),void 0===s&&(s=0),this._buffer=e,this._trimRight=t,this._startIndex=r,this._endIndex=i,this._startOverscan=n,this._endOverscan=s,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._current<this._endIndex},e.prototype.next=function(){var e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",r=e.first;r<=e.last;++r)t+=this._buffer.translateBufferLineToString(r,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;var i=r(0),n=function(){function e(e){this._maxLength=e,this.onDeleteEmitter=new i.EventEmitter,this.onInsertEmitter=new i.EventEmitter,this.onTrimEmitter=new i.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(e.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!1,configurable:!0}),e.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},e.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},e.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++},e.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(e.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),e.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},e.prototype.splice=function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t){for(var n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t}for(n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(this._length+r.length>this._maxLength){var s=this._length+r.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=r.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},e.prototype.shiftElements=function(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(var i=t-1;i>=0;i--)this.set(e+i+r,this.get(e+i));var n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(i=0;i<t;i++)this.set(e+i+r,this.get(e+i))}},e.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},e}();t.CircularList=n},function(e,t,r){"use strict";function i(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();var i=!e[t].hasContent(r-1)&&1===e[t].getWidth(r-1),n=2===e[t+1].getWidth(0);return i&&n?r-1:r}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,r,n,s){for(var o=[],a=0;a<e.length-1;a++){var l=a,c=e.get(++l);if(c.isWrapped){for(var u=[e.get(a)];l<e.length&&c.isWrapped;)u.push(c),c=e.get(++l);if(n>=a&&n<l)a+=u.length-1;else{for(var h=0,d=i(u,h,t),f=1,p=0;f<u.length;){var g=i(u,f,t),v=g-p,m=r-d,_=Math.min(v,m);u[h].copyCellsFrom(u[f],p,d,_,!1),(d+=_)===r&&(h++,d=0),(p+=_)===g&&(f++,p=0),0===d&&0!==h&&2===u[h-1].getWidth(r-1)&&(u[h].copyCellsFrom(u[h-1],r-1,d++,1,!1),u[h-1].setCell(r-1,s))}u[h].replaceCells(d,r,s);for(var y=0,b=u.length-1;b>0&&(b>h||0===u[b].getTrimmedLength());b--)y++;y>0&&(o.push(a+u.length-y),o.push(y)),a+=u.length-1}}}return o},t.reflowLargerCreateNewLayout=function(e,t){for(var r=[],i=0,n=t[i],s=0,o=0;o<e.length;o++)if(n===o){var a=t[++i];e.onDeleteEmitter.fire({index:o-s,amount:a}),o+=a-1,s+=a,n=t[++i]}else r.push(o);return{layout:r,countRemoved:s}},t.reflowLargerApplyNewLayout=function(e,t){for(var r=[],i=0;i<t.length;i++)r.push(e.get(t[i]));for(i=0;i<r.length;i++)e.set(i,r[i]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){for(var n=[],s=e.map((function(r,n){return i(e,n,t)})).reduce((function(e,t){return e+t})),o=0,a=0,l=0;l<s;){if(s-l<r){n.push(s-l);break}o+=r;var c=i(e,a,t);o>c&&(o-=c,a++);var u=2===e[a].getWidth(o-1);u&&o--;var h=u?r-1:r;n.push(h),l+=h}return n},t.getWrappedLineTrimmedLength=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;var s=r(0),o=function(e){function t(r){var i=e.call(this)||this;return i.line=r,i._id=t._nextId++,i.isDisposed=!1,i._onDispose=new s.EventEmitter,i}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},t._nextId=1,t}(r(2).Disposable);t.Marker=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=t.DEFAULT_BELL_SOUND=void 0;var i=r(0),n=r(11),s=r(33);t.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",t.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:t.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:n.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var o=["cols","rows"],a=function(){function e(e){this._onOptionChange=new i.EventEmitter,this.options=s.clone(t.DEFAULT_OPTIONS);for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(o in this.options){var a=e[o];this.options[o]=a}}}return Object.defineProperty(e.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),e.prototype.setOption=function(e,r){if(!(e in t.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');if(-1!==o.indexOf(e))throw new Error('Option "'+e+'" can only be set in the constructor');this.options[e]!==r&&(r=this._sanitizeAndValidateOption(e,r),this.options[e]!==r&&(this.options[e]=r,this._onOptionChange.fire(e)))},e.prototype._sanitizeAndValidateOption=function(e,r){switch(e){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":r||(r=t.DEFAULT_OPTIONS[e]);break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(e+" cannot be less than 1, value: "+r);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(e+" cannot be less than 0, value: "+r);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(e+" cannot be less than or equal to 0, value: "+r)}return r},e.prototype.getOption=function(e){if(!(e in t.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');return this.options[e]},e}();t.OptionsService=a},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;var a=r(1),l=r(0),c=r(33),u=r(2),h=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),f=function(e){function t(t,r,i,n){var s=e.call(this)||this;return s._bufferService=r,s._logService=i,s._optionsService=n,s.isCursorInitialized=!1,s.isCursorHidden=!1,s._onData=s.register(new l.EventEmitter),s._onUserInput=s.register(new l.EventEmitter),s._onBinary=s.register(new l.EventEmitter),s._scrollToBottom=t,s.register({dispose:function(){return s._scrollToBottom=void 0}}),s.modes=c.clone(h),s.decPrivateModes=c.clone(d),s}return n(t,e),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.modes=c.clone(h),this.decPrivateModes=c.clone(d)},t.prototype.triggerDataEvent=function(e,t){if(void 0===t&&(t=!1),!this._optionsService.options.disableStdin){var r=this._bufferService.buffer;r.ybase!==r.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug('sending data "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onData.fire(e)}},t.prototype.triggerBinaryEvent=function(e){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onBinary.fire(e))},s([o(1,a.IBufferService),o(2,a.ILogService),o(3,a.IOptionsService)],t)}(u.Disposable);t.CoreService=f},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;var s=r(1),o=r(0),a={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(e){return 4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)}},VT200:{events:19,restrict:function(e){return 32!==e.action}},DRAG:{events:23,restrict:function(e){return 32!==e.action||3!==e.button}},ANY:{events:31,restrict:function(e){return!0}}};function l(e,t){var r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(r|=64,r|=e.action):(r|=3&e.button,4&e.button&&(r|=64),8&e.button&&(r|=128),32===e.action?r|=32:0!==e.action||t||(r|=3)),r}var c=String.fromCharCode,u={DEFAULT:function(e){var t=[l(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":"[M"+c(t[0])+c(t[1])+c(t[2])},SGR:function(e){var t=0===e.action&&4!==e.button?"m":"M";return"[<"+l(e,!0)+";"+e.col+";"+e.row+t}},h=function(){function e(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new o.EventEmitter,this._lastEvent=null;for(var r=0,i=Object.keys(a);r<i.length;r++){var n=i[r];this.addProtocol(n,a[n])}for(var s=0,l=Object.keys(u);s<l.length;s++){var c=l[s];this.addEncoding(c,u[c])}this.reset()}return e.prototype.addProtocol=function(e,t){this._protocols[e]=t},e.prototype.addEncoding=function(e,t){this._encodings[e]=t},Object.defineProperty(e.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(e){if(!this._protocols[e])throw new Error('unknown protocol "'+e+'"');this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"areMouseEventsActive",{get:function(){return 0!==this._protocols[this._activeProtocol].events},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(e){if(!this._encodings[e])throw new Error('unknown encoding "'+e+'"');this._activeEncoding=e},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(e.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),e.prototype.triggerMouseEvent=function(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._compareEvents(this._lastEvent,e))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;var t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0},e.prototype.explainEvents=function(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}},e.prototype._compareEvents=function(e,t){return e.col===t.col&&e.row===t.row&&e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift},i([n(0,s.IBufferService),n(1,s.ICoreService)],e)}();t.CoreMouseService=h},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0;var s=r(1),o=function(){function e(e){this._bufferService=e,this.clearRange()}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),e.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},e.prototype.markDirty=function(e){e<this._start?this._start=e:e>this._end&&(this._end=e)},e.prototype.markRangeDirty=function(e,t){if(e>t){var r=e;e=t,t=r}e<this._start&&(this._start=e),t>this._end&&(this._end=t)},e.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},i([n(0,s.IBufferService)],e)}();t.DirtyRowService=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;var i=r(0),n=r(79),s=function(){function e(){this._providers=Object.create(null),this._active="",this._onChange=new i.EventEmitter;var e=new n.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}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(e){if(!this._providers[e])throw new Error('unknown Unicode version "'+e+'"');this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)},enumerable:!1,configurable:!0}),e.prototype.register=function(e){this._providers[e.version]=e},e.prototype.wcwidth=function(e){return this._activeProvider.wcwidth(e)},e.prototype.getStringCellWidth=function(e){for(var t=0,r=e.length,i=0;i<r;++i){var n=e.charCodeAt(i);if(55296<=n&&n<=56319){if(++i>=r)return t+this.wcwidth(n);var s=e.charCodeAt(i);56320<=s&&s<=57343?n=1024*(n-55296)+s-56320+65536:t+=this.wcwidth(s)}t+=this.wcwidth(n)}return t},e}();t.UnicodeService=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;var i,n=r(15),s=[[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]],o=[[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]],a=function(){function e(){if(this.version="6",!i){i=new Uint8Array(65536),n.fill(i,1),i[0]=0,n.fill(i,0,1,32),n.fill(i,0,127,160),n.fill(i,2,4352,4448),i[9001]=2,i[9002]=2,n.fill(i,2,11904,42192),i[12351]=1,n.fill(i,2,44032,55204),n.fill(i,2,63744,64256),n.fill(i,2,65040,65050),n.fill(i,2,65072,65136),n.fill(i,2,65280,65377),n.fill(i,2,65504,65511);for(var e=0;e<s.length;++e)n.fill(i,0,s[e][0],s[e][1]+1)}}return e.prototype.wcwidth=function(e){return e<32?0:e<127?1:e<65536?i[e]:function(e,t){var r,i=0,n=t.length-1;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=i;)if(e>t[r=i+n>>1][1])i=r+1;else{if(!(e<t[r][0]))return!0;n=r-1}return!1}(e,o)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1},e}();t.UnicodeV6=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0;var i=function(){function e(){this.glevel=0,this._charsets=[]}return e.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},e.prototype.setgLevel=function(e){this.glevel=e,this.charset=this._charsets[e]},e.prototype.setgCharset=function(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)},e}();t.CharsetService=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;var i=r(3);t.updateWindowsModeWrappedState=function(e){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),r=null==t?void 0:t.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&r&&(n.isWrapped=r[i.CHAR_DATA_CODE_INDEX]!==i.NULL_CELL_CODE&&r[i.CHAR_DATA_CODE_INDEX]!==i.WHITESPACE_CELL_CODE)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;var i=function(){function e(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return e.prototype.writeSync=function(e){if(this._writeBuffer.length){for(var t=this._bufferOffset;t<this._writeBuffer.length;++t){var r=this._writeBuffer[t],i=this._callbacks[t];this._action(r),i&&i()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(e)},e.prototype.write=function(e,t){var r=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 r._innerWrite()}))),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)},e.prototype._innerWrite=function(){for(var e=this,t=Date.now();this._writeBuffer.length>this._bufferOffset;){var r=this._writeBuffer[this._bufferOffset],i=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(r),this._pendingData-=r.length,i&&i(),Date.now()-t>=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 e._innerWrite()}),0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},e}();t.WriteBuffer=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0;var i=function(){function e(){this._addons=[]}return e.prototype.dispose=function(){for(var e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()},e.prototype.loadAddon=function(e,t){var r=this,i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=function(){return r._wrappedAddonDispose(i)},t.activate(e)},e.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},e}();t.AddonManager=i}])},"07cG":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./src/components/Spinner/index.less?modules ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){e.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/display/placeholder.js ***!
|
|
|
\**************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function r(e){t(e);var r=e.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=e.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),r.appendChild(i),e.display.lineSpace.insertBefore(r,e.display.lineSpace.firstChild)}function i(e){s(e)&&r(e)}function n(e){var i=e.getWrapperElement(),n=s(e);i.className=i.className.replace(" CodeMirror-empty","")+(n?" CodeMirror-empty":""),n?r(e):t(e)}function s(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(s,o,a){var l=a&&a!=e.Init;if(o&&!l)s.on("blur",i),s.on("change",n),s.on("swapDoc",n),e.on(s.getInputField(),"compositionupdate",s.state.placeholderCompose=function(){!function(e){setTimeout((function(){var i=!1,n=e.getInputField();"TEXTAREA"==n.nodeName?i=!n.value:1==e.lineCount()&&(i=!/[^\u200b]/.test(n.querySelector(".CodeMirror-line").textContent)),i?r(e):t(e)}),20)}(s)}),n(s);else if(!o&&l){s.off("blur",i),s.off("change",n),s.off("swapDoc",n),e.off(s.getInputField(),"compositionupdate",s.state.placeholderCompose),t(s);var c=s.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}o&&!s.hasFocus()&&i(s)}))}(r(/*! ../../lib/codemirror */"VrN/"))},"1dTM":
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/rfb.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(/*! ./util/int.js */"GQ8N"),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==A(e)&&"function"!=typeof e)return{default:e};var t=L();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=i?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(r,n,s):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r(/*! ./util/logging.js */"Lo0S")),s=r(/*! ./util/strings.js */"VSMT"),o=r(/*! ./util/browser.js */"GdRQ"),a=r(/*! ./util/element.js */"SZEN"),l=r(/*! ./util/events.js */"vewr"),c=T(r(/*! ./util/eventtarget.js */"YJ9k")),u=T(r(/*! ./display.js */"MZdM")),h=T(r(/*! ./inflator.js */"ItS6")),d=T(r(/*! ./deflator.js */"whVF")),f=T(r(/*! ./input/keyboard.js */"Fv0C")),p=T(r(/*! ./input/gesturehandler.js */"LCi9")),g=T(r(/*! ./util/cursor.js */"rwxt")),v=T(r(/*! ./websock.js */"Mmt2")),m=T(r(/*! ./des.js */"iUHT")),_=T(r(/*! ./input/keysym.js */"mHUz")),y=T(r(/*! ./input/xtscancodes.js */"P2ho")),b=r(/*! ./encodings.js */"NBmB");r(/*! ./util/polyfill.js */"mdZa");var S=T(r(/*! ./decoders/raw.js */"34/K")),w=T(r(/*! ./decoders/copyrect.js */"hXwI")),C=T(r(/*! ./decoders/rre.js */"SgaC")),E=T(r(/*! ./decoders/hextile.js */"3690")),k=T(r(/*! ./decoders/tight.js */"8K/p")),x=T(r(/*! ./decoders/tightpng.js */"xO64"));function T(e){return e&&e.__esModule?e:{default:e}}function L(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return L=function(){return e},e}function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=F(e);if(t){var n=F(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return M(this,r)}}function M(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?I(e):t}function I(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(T,e);var t,r,c,d=R(T);function T(e,t,r){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,T),!e)throw new Error("Must specify target");if(!t)throw new Error("Must specify URL");(i=d.call(this))._target=e,i._url=t,r=r||{},i._rfbCredentials=r.credentials||{},i._shared=!("shared"in r)||!!r.shared,i._repeaterID=r.repeaterID||"",i._wsProtocols=r.wsProtocols||[],i._rfbConnectionState="",i._rfbInitState="",i._rfbAuthScheme=-1,i._rfbCleanDisconnect=!0,i._rfbVersion=0,i._rfbMaxVersion=3.8,i._rfbTightVNC=!1,i._rfbVeNCryptState=0,i._rfbXvpVer=0,i._fbWidth=0,i._fbHeight=0,i._fbName="",i._capabilities={power:!1},i._supportsFence=!1,i._supportsContinuousUpdates=!1,i._enabledContinuousUpdates=!1,i._supportsSetDesktopSize=!1,i._screenID=0,i._screenFlags=0,i._qemuExtKeyEventSupported=!1,i._clipboardText=null,i._clipboardServerCapabilitiesActions={},i._clipboardServerCapabilitiesFormats={},i._sock=null,i._display=null,i._flushing=!1,i._keyboard=null,i._gestures=null,i._disconnTimer=null,i._resizeTimeout=null,i._mouseMoveTimer=null,i._decoders={},i._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},i._mousePos={},i._mouseButtonMask=0,i._mouseLastMoveTime=0,i._viewportDragging=!1,i._viewportDragPos={},i._viewportHasMoved=!1,i._accumulatedWheelDeltaX=0,i._accumulatedWheelDeltaY=0,i._gestureLastTapTime=null,i._gestureFirstDoubleTapEv=null,i._gestureLastMagnitudeX=0,i._gestureLastMagnitudeY=0,i._eventHandlers={focusCanvas:i._focusCanvas.bind(I(i)),windowResize:i._windowResize.bind(I(i)),handleMouse:i._handleMouse.bind(I(i)),handleWheel:i._handleWheel.bind(I(i)),handleGesture:i._handleGesture.bind(I(i))},n.Debug(">> RFB.constructor"),i._screen=document.createElement("div"),i._screen.style.display="flex",i._screen.style.width="100%",i._screen.style.height="100%",i._screen.style.overflow="auto",i._screen.style.background="rgb(40, 40, 40)",i._canvas=document.createElement("canvas"),i._canvas.style.margin="auto",i._canvas.style.outline="none",i._canvas.style.flexShrink="0",i._canvas.width=0,i._canvas.height=0,i._canvas.tabIndex=-1,i._screen.appendChild(i._canvas),i._cursor=new g.default,i._cursorImage=T.cursors.none,i._decoders[b.encodings.encodingRaw]=new S.default,i._decoders[b.encodings.encodingCopyRect]=new w.default,i._decoders[b.encodings.encodingRRE]=new C.default,i._decoders[b.encodings.encodingHextile]=new E.default,i._decoders[b.encodings.encodingTight]=new k.default,i._decoders[b.encodings.encodingTightPNG]=new x.default;try{i._display=new u.default(i._canvas)}catch(e){throw n.Error("Display exception: "+e),e}return i._display.onflush=i._onFlush.bind(I(i)),i._keyboard=new f.default(i._canvas),i._keyboard.onkeyevent=i._handleKeyEvent.bind(I(i)),i._gestures=new p.default,i._sock=new v.default,i._sock.on("message",(function(){i._handleMessage()})),i._sock.on("open",(function(){"connecting"===i._rfbConnectionState&&""===i._rfbInitState?(i._rfbInitState="ProtocolVersion",n.Debug("Starting VNC handshake")):i._fail("Unexpected server connection while "+i._rfbConnectionState)})),i._sock.on("close",(function(e){n.Debug("WebSocket on-close event");var t="";switch(e.code&&(t="(code: "+e.code,e.reason&&(t+=", reason: "+e.reason),t+=")"),i._rfbConnectionState){case"connecting":i._fail("Connection closed "+t);break;case"connected":i._updateConnectionState("disconnecting"),i._updateConnectionState("disconnected");break;case"disconnecting":i._updateConnectionState("disconnected");break;case"disconnected":i._fail("Unexpected server disconnect when already disconnected "+t);break;default:i._fail("Unexpected server disconnect before connecting "+t)}i._sock.off("close")})),i._sock.on("error",(function(e){return n.Warn("WebSocket on-error event")})),setTimeout(i._updateConnectionState.bind(I(i),"connecting")),n.Debug("<< RFB.constructor"),i.dragViewport=!1,i.focusOnClick=!0,i._viewOnly=!1,i._clipViewport=!1,i._scaleViewport=!1,i._resizeSession=!1,i._showDotCursor=!1,void 0!==r.showDotCursor&&(n.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),i._showDotCursor=r.showDotCursor),i._qualityLevel=6,i._compressionLevel=2,i}return t=T,c=[{key:"genDES",value:function(e,t){var r=e.split("").map((function(e){return e.charCodeAt(0)}));return new m.default(r).encrypt(t)}}],(r=[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(e){this._rfbCredentials=e,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){"connected"!==this._rfbConnectionState||this._viewOnly||(n.Info("Sending Ctrl-Alt-Del"),this.sendKey(_.default.XK_Control_L,"ControlLeft",!0),this.sendKey(_.default.XK_Alt_L,"AltLeft",!0),this.sendKey(_.default.XK_Delete,"Delete",!0),this.sendKey(_.default.XK_Delete,"Delete",!1),this.sendKey(_.default.XK_Alt_L,"AltLeft",!1),this.sendKey(_.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(e,t,r){if("connected"===this._rfbConnectionState&&!this._viewOnly){if(void 0===r)return this.sendKey(e,t,!0),void this.sendKey(e,t,!1);var i=y.default[t];if(this._qemuExtKeyEventSupported&&i)e=e||0,n.Info("Sending key ("+(r?"down":"up")+"): keysym "+e+", scancode "+i),T.messages.QEMUExtendedKeyEvent(this._sock,e,r,i);else{if(!e)return;n.Info("Sending keysym ("+(r?"down":"up")+"): "+e),T.messages.keyEvent(this._sock,e,r?1:0)}}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(e){if("connected"===this._rfbConnectionState&&!this._viewOnly)if(this._clipboardServerCapabilitiesFormats[1]&&this._clipboardServerCapabilitiesActions[1<<27])this._clipboardText=e,T.messages.extendedClipboardNotify(this._sock,[1]);else{for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);T.messages.clientCutText(this._sock,t)}}},{key:"_connect",value:function(){n.Debug(">> RFB.connect"),n.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(e){"SyntaxError"===e.name?this._fail("Invalid host or port ("+e+")"):this._fail("Error when opening socket ("+e+")")}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),n.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){n.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(e){if("NotFoundError"!==e.name)throw e}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),n.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(e){this.focusOnClick&&this.focus()}},{key:"_setDesktopName",value:function(e){this._fbName=e,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(e){var t=this;window.requestAnimationFrame((function(){t._updateClip(),t._updateScale()})),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var e=this._display.clipViewport,t=this._clipViewport;if(this._scaleViewport&&(t=!1),e!==t&&(this._display.clipViewport=t),t){var r=this._screenSize();this._display.viewportChangeSize(r.w,r.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(this._scaleViewport){var e=this._screenSize();this._display.autoscale(e.w,e.h)}else this._display.scale=1;this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,this._resizeSession&&!this._viewOnly&&this._supportsSetDesktopSize){var e=this._screenSize();T.messages.setDesktopSize(this._sock,Math.floor(e.w),Math.floor(e.h),this._screenID,this._screenFlags),n.Debug("Requested new desktop size: "+e.w+"x"+e.h)}}},{key:"_screenSize",value:function(){var e=this._screen.getBoundingClientRect();return{w:e.width,h:e.height}}},{key:"_fixScrollbars",value:function(){var e=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=e}},{key:"_updateConnectionState",value:function(e){var t=this,r=this._rfbConnectionState;if(e!==r)if("disconnected"!==r){switch(e){case"connected":if("connecting"!==r)return void n.Error("Bad transition to connected state, previous connection state: "+r);break;case"disconnected":if("disconnecting"!==r)return void n.Error("Bad transition to disconnected state, previous connection state: "+r);break;case"connecting":if(""!==r)return void n.Error("Bad transition to connecting state, previous connection state: "+r);break;case"disconnecting":if("connected"!==r&&"connecting"!==r)return void n.Error("Bad transition to disconnecting state, previous connection state: "+r);break;default:return void n.Error("Unknown connection state: "+e)}switch(this._rfbConnectionState=e,n.Debug("New state '"+e+"', was '"+r+"'."),this._disconnTimer&&"disconnecting"!==e&&(n.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close")),e){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout((function(){n.Error("Disconnection timed out."),t._updateConnectionState("disconnected")}),3e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}))}}else n.Error("Tried changing state of a disconnected RFB object");else n.Debug("Already in state '"+e+"', ignoring")}},{key:"_fail",value:function(e){switch(this._rfbConnectionState){case"disconnecting":n.Error("Failed when disconnecting: "+e);break;case"connected":n.Error("Failed while connected: "+e);break;case"connecting":n.Error("Failed when connecting: "+e);break;default:n.Error("RFB failure: "+e)}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(e,t){this._capabilities[e]=t,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(0!==this._sock.rQlen)switch(this._rfbConnectionState){case"disconnected":n.Error("Got data while disconnected");break;case"connected":for(;!this._flushing&&this._normalMsg()&&0!==this._sock.rQlen;);break;default:this._initMsg()}else n.Warn("handleMessage called on an empty receive queue")}},{key:"_handleKeyEvent",value:function(e,t,r){this.sendKey(e,t,r)}},{key:"_handleMouse",value:function(e){if(("click"!==e.type||e.target===this._canvas)&&(e.stopPropagation(),e.preventDefault(),"click"!==e.type&&"contextmenu"!==e.type)){var t=(0,a.clientToElement)(e.clientX,e.clientY,this._canvas);switch(e.type){case"mousedown":(0,l.setCapture)(this._canvas),this._handleMouseButton(t.x,t.y,!0,1<<e.button);break;case"mouseup":this._handleMouseButton(t.x,t.y,!1,1<<e.button);break;case"mousemove":this._handleMouseMove(t.x,t.y)}}}},{key:"_handleMouseButton",value:function(e,t,r,i){if(this.dragViewport){if(r&&!this._viewportDragging)return this._viewportDragging=!0,this._viewportDragPos={x:e,y:t},void(this._viewportHasMoved=!1);if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(e,t,i)}null!==this._mouseMoveTimer&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(e,t,this._mouseButtonMask)),r?this._mouseButtonMask|=i:this._mouseButtonMask&=~i,this._sendMouse(e,t,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function(e,t){var r=this;if(this._viewportDragging){var i=this._viewportDragPos.x-e,n=this._viewportDragPos.y-t;(this._viewportHasMoved||Math.abs(i)>o.dragThreshold||Math.abs(n)>o.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:e,y:t},this._display.viewportChangePos(i,n))}else if(this._mousePos={x:e,y:t},null==this._mouseMoveTimer){var s=Date.now()-this._mouseLastMoveTime;s>17?(this._sendMouse(e,t,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout((function(){r._handleDelayedMouseMove()}),17-s)}}},{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(e,t,r){"connected"===this._rfbConnectionState&&(this._viewOnly||T.messages.pointerEvent(this._sock,this._display.absX(e),this._display.absY(t),r))}},{key:"_handleWheel",value:function(e){if("connected"===this._rfbConnectionState&&!this._viewOnly){e.stopPropagation(),e.preventDefault();var t=(0,a.clientToElement)(e.clientX,e.clientY,this._canvas),r=e.deltaX,i=e.deltaY;0!==e.deltaMode&&(r*=19,i*=19),this._accumulatedWheelDeltaX+=r,this._accumulatedWheelDeltaY+=i,Math.abs(this._accumulatedWheelDeltaX)>=50&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(t.x,t.y,!0,32),this._handleMouseButton(t.x,t.y,!1,32)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(t.x,t.y,!0,64),this._handleMouseButton(t.x,t.y,!1,64)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=50&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(t.x,t.y,!0,8),this._handleMouseButton(t.x,t.y,!1,8)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(t.x,t.y,!0,16),this._handleMouseButton(t.x,t.y,!1,16)),this._accumulatedWheelDeltaY=0)}}},{key:"_fakeMouseMove",value:function(e,t,r){this._handleMouseMove(t,r),this._cursor.move(e.detail.clientX,e.detail.clientY)}},{key:"_handleTapEvent",value:function(e,t){var r=(0,a.clientToElement)(e.detail.clientX,e.detail.clientY,this._canvas);if(null!==this._gestureLastTapTime&&Date.now()-this._gestureLastTapTime<1e3&&this._gestureFirstDoubleTapEv.detail.type===e.detail.type){var i=this._gestureFirstDoubleTapEv.detail.clientX-e.detail.clientX,n=this._gestureFirstDoubleTapEv.detail.clientY-e.detail.clientY;Math.hypot(i,n)<50?r=(0,a.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=e}else this._gestureFirstDoubleTapEv=e;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,r.x,r.y),this._handleMouseButton(r.x,r.y,!0,t),this._handleMouseButton(r.x,r.y,!1,t)}},{key:"_handleGesture",value:function(e){var t,r=(0,a.clientToElement)(e.detail.clientX,e.detail.clientY,this._canvas);switch(e.type){case"gesturestart":switch(e.detail.type){case"onetap":this._handleTapEvent(e,1);break;case"twotap":this._handleTapEvent(e,4);break;case"threetap":this._handleTapEvent(e,2);break;case"drag":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!0,1);break;case"longpress":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=e.detail.magnitudeX,this._gestureLastMagnitudeY=e.detail.magnitudeY,this._fakeMouseMove(e,r.x,r.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),this._fakeMouseMove(e,r.x,r.y)}break;case"gesturemove":switch(e.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(e,r.x,r.y);break;case"twodrag":for(this._fakeMouseMove(e,r.x,r.y);e.detail.magnitudeY-this._gestureLastMagnitudeY>50;)this._handleMouseButton(r.x,r.y,!0,8),this._handleMouseButton(r.x,r.y,!1,8),this._gestureLastMagnitudeY+=50;for(;e.detail.magnitudeY-this._gestureLastMagnitudeY<-50;)this._handleMouseButton(r.x,r.y,!0,16),this._handleMouseButton(r.x,r.y,!1,16),this._gestureLastMagnitudeY-=50;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX>50;)this._handleMouseButton(r.x,r.y,!0,32),this._handleMouseButton(r.x,r.y,!1,32),this._gestureLastMagnitudeX+=50;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX<-50;)this._handleMouseButton(r.x,r.y,!0,64),this._handleMouseButton(r.x,r.y,!1,64),this._gestureLastMagnitudeX-=50;break;case"pinch":if(this._fakeMouseMove(e,r.x,r.y),t=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),Math.abs(t-this._gestureLastMagnitudeX)>75){for(this._handleKeyEvent(_.default.XK_Control_L,"ControlLeft",!0);t-this._gestureLastMagnitudeX>75;)this._handleMouseButton(r.x,r.y,!0,8),this._handleMouseButton(r.x,r.y,!1,8),this._gestureLastMagnitudeX+=75;for(;t-this._gestureLastMagnitudeX<-75;)this._handleMouseButton(r.x,r.y,!0,16),this._handleMouseButton(r.x,r.y,!1,16),this._gestureLastMagnitudeX-=75}this._handleKeyEvent(_.default.XK_Control_L,"ControlLeft",!1)}break;case"gestureend":switch(e.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!1,1);break;case"longpress":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!1,4)}}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var e=this._sock.rQshiftStr(12).substr(4,7);n.Info("Server ProtocolVersion: "+e);var t=0;switch(e){case"000.000":t=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 "+e)}if(t){for(var r="ID:"+this._repeaterID;r.length<250;)r+="\0";return this._sock.sendString(r),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var i="00"+parseInt(this._rfbVersion,10)+".00"+10*this._rfbVersion%10;this._sock.sendString("RFB "+i+"\n"),n.Debug("Sent ProtocolVersion: "+i),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function e(e,t){for(var r=0;r<t.length;r++)if(t[r]===e)return!0;return!1}if(this._rfbVersion>=3.7){var t=this._sock.rQshift8();if(this._sock.rQwait("security type",t,1))return!1;if(0===t)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var r=this._sock.rQshiftBytes(t);if(n.Debug("Server security types: "+r),e(1,r))this._rfbAuthScheme=1;else if(e(22,r))this._rfbAuthScheme=22;else if(e(16,r))this._rfbAuthScheme=16;else if(e(2,r))this._rfbAuthScheme=2;else{if(!e(19,r))return this._fail("Unsupported security types (types: "+r+")");this._rfbAuthScheme=19}this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),0==this._rfbAuthScheme)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",n.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var e=this._sock.rQshift32(),t="";if(e>0){if(this._sock.rQwait("reason",e,4))return!1;t=this._sock.rQshiftStr(e)}return""!==t?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:t}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+t+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}},{key:"_negotiateXvpAuth",value:function(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password||void 0===this._rfbCredentials.target)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;var e=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(e),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(0==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt version",2))return!1;var e=this._sock.rQshift8(),t=this._sock.rQshift8();if(0!=e||2!=t)return this._fail("Unsupported VeNCrypt version "+e+"."+t);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(1==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt ack",1))return!1;var r=this._sock.rQshift8();if(0!=r)return this._fail("VeNCrypt failure "+r);this._rfbVeNCryptState=2}if(2==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var i=this._sock.rQshift8();if(i<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=i,this._rfbVeNCryptState=3}if(3==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var n=[],o=0;o<this._rfbVeNCryptSubtypesLength;o++)n.push(this._sock.rQshift32());if(-1==n.indexOf(256))return this._fail("VeNCrypt Plain subtype not offered by server");this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4}if(4==this._rfbVeNCryptState){if(!this._rfbCredentials.username||!this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;var a=(0,s.encodeUTF8)(this._rfbCredentials.username),l=(0,s.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,a.length]),this._sock.send([0,0,0,l.length]),this._sock.sendString(a),this._sock.sendString(l),this._rfbInitState="SecurityResult",!0}}},{key:"_negotiateStdVNCAuth",value:function(){if(this._sock.rQwait("auth challenge",16))return!1;if(void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;var e=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),t=T.genDES(this._rfbCredentials.password,e);return this._sock.send(t),this._rfbInitState="SecurityResult",!0}},{key:"_negotiateTightUnixAuth",value:function(){return void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password?(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(e){for(var t={vendor:"TGHT",signature:"NOTUNNEL"},r={},i=0;i<e;i++){var s=this._sock.rQshift32(),o=this._sock.rQshiftStr(4),a=this._sock.rQshiftStr(8);r[s]={vendor:o,signature:a}}return n.Debug("Server Tight tunnel types: "+r),r[1]&&"SICR"===r[1].vendor&&"SCHANNEL"===r[1].signature&&(n.Debug("Detected Siemens server. Assuming NOTUNNEL support."),r[0]={vendor:"TGHT",signature:"NOTUNNEL"}),r[0]?r[0].vendor!=t.vendor||r[0].signature!=t.signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(n.Debug("Selected tunnel type: "+t),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 e=this._sock.rQshift32();if(e>0&&this._sock.rQwait("tunnel capabilities",16*e,4))return!1;if(this._rfbTightVNC=!0,e>0)return this._negotiateTightTunnels(e),!1}if(this._sock.rQwait("sub auth count",4))return!1;var t=this._sock.rQshift32();if(0===t)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*t,4))return!1;for(var r={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},i=[],s=0;s<t;s++){this._sock.rQshift32();var o=this._sock.rQshiftStr(12);i.push(o)}for(var a in n.Debug("Server Tight authentication types: "+i),r)if(-1!=i.indexOf(a))switch(this._sock.send([0,0,0,r[a]]),n.Debug("Selected authentication type: "+a),a){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: "+a+")")}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 e=this._sock.rQshift32();return 0===e?(this._rfbInitState="ClientInitialisation",n.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=e,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:e}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var e=this._sock.rQshift16(),t=this._sock.rQshift16(),r=this._sock.rQshift8(),i=this._sock.rQshift8(),o=this._sock.rQshift8(),a=this._sock.rQshift8(),l=this._sock.rQshift16(),c=this._sock.rQshift16(),u=this._sock.rQshift16(),h=this._sock.rQshift8(),d=this._sock.rQshift8(),f=this._sock.rQshift8();this._sock.rQskipBytes(3);var p=this._sock.rQshift32();if(this._sock.rQwait("server init name",p,24))return!1;var g=this._sock.rQshiftStr(p);if(g=(0,s.decodeUTF8)(g,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+p))return!1;var v=this._sock.rQshift16(),m=this._sock.rQshift16(),_=this._sock.rQshift16();this._sock.rQskipBytes(2);var y=16*(v+m+_);if(this._sock.rQwait("TightVNC extended server init header",y,32+p))return!1;this._sock.rQskipBytes(16*v),this._sock.rQskipBytes(16*m),this._sock.rQskipBytes(16*_)}return n.Info("Screen: "+e+"x"+t+", bpp: "+r+", depth: "+i+", bigEndian: "+o+", trueColor: "+a+", redMax: "+l+", greenMax: "+c+", blueMax: "+u+", redShift: "+h+", greenShift: "+d+", blueShift: "+f),this._setDesktopName(g),this._resize(e,t),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(n.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),T.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),T.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var e=[];e.push(b.encodings.encodingCopyRect),24==this._fbDepth&&(e.push(b.encodings.encodingTight),e.push(b.encodings.encodingTightPNG),e.push(b.encodings.encodingHextile),e.push(b.encodings.encodingRRE)),e.push(b.encodings.encodingRaw),e.push(b.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),e.push(b.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),e.push(b.encodings.pseudoEncodingDesktopSize),e.push(b.encodings.pseudoEncodingLastRect),e.push(b.encodings.pseudoEncodingQEMUExtendedKeyEvent),e.push(b.encodings.pseudoEncodingExtendedDesktopSize),e.push(b.encodings.pseudoEncodingXvp),e.push(b.encodings.pseudoEncodingFence),e.push(b.encodings.pseudoEncodingContinuousUpdates),e.push(b.encodings.pseudoEncodingDesktopName),e.push(b.encodings.pseudoEncodingExtendedClipboard),24==this._fbDepth&&(e.push(b.encodings.pseudoEncodingVMwareCursor),e.push(b.encodings.pseudoEncodingCursor)),T.messages.clientEncodings(this._sock,e)}},{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 n.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(n.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var e=this._sock.rQshift32();if(e=(0,i.toSigned32bit)(e),this._sock.rQwait("ServerCutText content",Math.abs(e),8))return!1;if(e>=0){var t=this._sock.rQshiftStr(e);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:t}}))}else{e=Math.abs(e);var r=this._sock.rQshift32(),o=65535&r,a=4278190080&r;if(a&1<<24){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var l=0;l<=15;l++){var c=1<<l;o&c&&(this._clipboardServerCapabilitiesFormats[c]=!0,this._sock.rQshift32())}for(var u=24;u<=31;u++){var d=1<<u;this._clipboardServerCapabilitiesActions[d]=!!(a&d)}var f=[1<<24,1<<25,1<<26,1<<27,1<<28];T.messages.extendedClipboardCaps(this._sock,f,{extendedClipboardFormatText:0})}else if(a===1<<25){if(this._viewOnly)return!0;null!=this._clipboardText&&this._clipboardServerCapabilitiesActions[1<<28]&&1&o&&T.messages.extendedClipboardProvide(this._sock,[1],[this._clipboardText])}else if(a===1<<26){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[1<<27]&&(null!=this._clipboardText?T.messages.extendedClipboardNotify(this._sock,[1]):T.messages.extendedClipboardNotify(this._sock,[]))}else if(a===1<<27){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[1<<25]&&1&o&&T.messages.extendedClipboardRequest(this._sock,[1])}else{if(a!==1<<28)return this._fail("Unexpected action in extended clipboard message: "+a);if(this._viewOnly)return!0;if(!(1&o))return!0;this._clipboardText=null;var p=this._sock.rQshiftBytes(e-4),g=new h.default,v=null;g.setInput(p);for(var m=0;m<=15;m++){var _=1<<m;if(o&_){var y=0,b=g.inflate(4);y|=b[0]<<24,y|=b[1]<<16,y|=b[2]<<8,y|=b[3];var S=g.inflate(y);1===_&&(v=S)}}if(g.setInput(null),null!==v){for(var w="",C=0;C<v.length;C++)w+=String.fromCharCode(v[C]);v=w,(v=(0,s.decodeUTF8)(v)).length>0&&"\0"===v.charAt(v.length-1)&&(v=v.slice(0,-1)),v=v.replace("\r\n","\n"),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:v}}))}}}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var e=this._sock.rQshift32(),t=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",t,9))return!1;t>64&&(n.Warn("Bad payload length ("+t+") in fence response"),t=64);var r=this._sock.rQshiftStr(t);return this._supportsFence=!0,e&1<<31?(e&=3,T.messages.clientFence(this._sock,e,r),!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 e=this._sock.rQshift8(),t=this._sock.rQshift8();switch(t){case 0:n.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=e,n.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+t+")")}return!0}},{key:"_normalMsg",value:function(){var e,t,r;switch(e=this._FBU.rects>0?0:this._sock.rQshift8()){case 0:return(r=this._framebufferUpdate())&&!this._enabledContinuousUpdates&&T.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),r;case 1:return this._handleSetColourMapMsg();case 2:return n.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return t=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,t&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),n.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+e+")"),n.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(0===this._FBU.rects){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(null===this._FBU.encoding){if(this._sock.rQwait("rect header",12))return!1;var e=this._sock.rQshiftBytes(12);this._FBU.x=(e[0]<<8)+e[1],this._FBU.y=(e[2]<<8)+e[3],this._FBU.width=(e[4]<<8)+e[5],this._FBU.height=(e[6]<<8)+e[7],this._FBU.encoding=parseInt((e[8]<<24)+(e[9]<<16)+(e[10]<<8)+e[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 b.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case b.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case b.encodings.pseudoEncodingCursor:return this._handleCursor();case b.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{void 0!==document.createEvent("keyboardEvent").code&&(this._qemuExtKeyEventSupported=!0)}catch(e){}return!0;case b.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case b.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case b.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var e=this._FBU.x,t=this._FBU.y,r=this._FBU.width,i=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var s,o=this._sock.rQshift8();if(this._sock.rQshift8(),0==o){if(s=new Array(r*i*4),this._sock.rQwait("VMware cursor classic encoding",r*i*4*2,2))return!1;for(var a=new Array(r*i),l=0;l<r*i;l++)a[l]=this._sock.rQshift32();for(var c=new Array(r*i),u=0;u<r*i;u++)c[u]=this._sock.rQshift32();for(var h=0;h<r*i;h++)if(0==a[h]){var d=c[h],f=d>>8&255,p=d>>16&255,g=d>>24&255;s[4*h]=f,s[4*h+1]=p,s[4*h+2]=g,s[4*h+3]=255}else-256==(-256&a[h])?0==c[h]?(s[4*h]=0,s[4*h+1]=0,s[4*h+2]=0,s[4*h+3]=0):(c[h],s[4*h]=0,s[4*h+1]=0,s[4*h+2]=0,s[4*h+3]=255):(s[4*h]=0,s[4*h+1]=0,s[4*h+2]=0,s[4*h+3]=255)}else{if(1!=o)return n.Warn("The given cursor type is not supported: "+o+" given."),!1;if(this._sock.rQwait("VMware cursor alpha encoding",r*i*4,2))return!1;s=new Array(r*i*4);for(var v=0;v<r*i;v++){var m=this._sock.rQshift32();s[4*v]=m>>24&255,s[4*v+1]=m>>16&255,s[4*v+2]=m>>8&255,s[4*v+3]=255&m}}return this._updateCursor(s,e,t,r,i),!0}},{key:"_handleCursor",value:function(){var e=this._FBU.x,t=this._FBU.y,r=this._FBU.width,i=this._FBU.height,n=r*i*4,s=Math.ceil(r/8)*i,o=n+s;if(this._sock.rQwait("cursor encoding",o))return!1;for(var a=this._sock.rQshiftBytes(n),l=this._sock.rQshiftBytes(s),c=new Uint8Array(r*i*4),u=0,h=0;h<i;h++)for(var d=0;d<r;d++){var f=l[h*Math.ceil(r/8)+Math.floor(d/8)]<<d%8&128?255:0;c[u]=a[u+2],c[u+1]=a[u+1],c[u+2]=a[u],c[u+3]=f,u+=4}return this._updateCursor(c,e,t,r,i),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var e=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",e,4))return!1;var t=this._sock.rQshiftStr(e);return t=(0,s.decodeUTF8)(t,!0),this._setDesktopName(t),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var e=this._sock.rQpeek8(),t=4+16*e;if(this._sock.rQwait("ExtendedDesktopSize",t))return!1;var r=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,r&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var i=0;i<e;i+=1)0===i?(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(1===this._FBU.x&&0!==this._FBU.y){var s="";switch(this._FBU.y){case 1:s="Resize is administratively prohibited";break;case 2:s="Out of resources";break;case 3:s="Invalid screen layout";break;default:s="Unknown reason"}n.Warn("Server did not accept the resize request: "+s)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var e=this._decoders[this._FBU.encoding];if(!e)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return e.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(e){return this._fail("Error decoding rect: "+e),!1}}},{key:"_updateContinuousUpdates",value:function(){this._enabledContinuousUpdates&&T.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function(e,t){this._fbWidth=e,this._fbHeight=t,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function(e,t){this._rfbXvpVer<e||(n.Info("Sending XVP operation "+t+" (version "+e+")"),T.messages.xvpOp(this._sock,e,t))}},{key:"_updateCursor",value:function(e,t,r,i,n){this._cursorImage={rgbaPixels:e,hotx:t,hoty:r,w:i,h:n},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var e=3;e<this._cursorImage.rgbaPixels.length;e+=4)if(this._cursorImage.rgbaPixels[e])return!1;return!0}},{key:"_refreshCursor",value:function(){if("connecting"===this._rfbConnectionState||"connected"===this._rfbConnectionState){var e=this._shouldShowDotCursor()?T.cursors.dot:this._cursorImage;this._cursor.change(e.rgbaPixels,e.hotx,e.hoty,e.w,e.h)}}},{key:"viewOnly",get:function(){return this._viewOnly},set:function(e){this._viewOnly=e,"connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState||(e?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function(e){n.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(e){this._clipViewport=e,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function(e){this._scaleViewport=e,e&&this._clipViewport&&this._updateClip(),this._updateScale(),!e&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function(e){this._resizeSession=e,e&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function(e){this._showDotCursor=e,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function(e){this._screen.style.background=e}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function(e){!Number.isInteger(e)||e<0||e>9?n.Error("qualityLevel must be an integer between 0 and 9"):this._qualityLevel!==e&&(this._qualityLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(e){!Number.isInteger(e)||e<0||e>9?n.Error("compressionLevel must be an integer between 0 and 9"):this._compressionLevel!==e&&(this._compressionLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}}])&&D(t.prototype,r),c&&D(t,c),T}(c.default);t.default=P,P.messages={keyEvent:function(e,t,r){var i=e._sQ,n=e._sQlen;i[n]=4,i[n+1]=r,i[n+2]=0,i[n+3]=0,i[n+4]=t>>24,i[n+5]=t>>16,i[n+6]=t>>8,i[n+7]=t,e._sQlen+=8,e.flush()},QEMUExtendedKeyEvent:function(e,t,r,i){var n=e._sQ,s=e._sQlen;n[s]=255,n[s+1]=0,n[s+2]=r>>8,n[s+3]=r,n[s+4]=t>>24,n[s+5]=t>>16,n[s+6]=t>>8,n[s+7]=t;var o,a,l=(o=i,a=255&i,224==i>>8&&a<127?128|a:o);n[s+8]=l>>24,n[s+9]=l>>16,n[s+10]=l>>8,n[s+11]=l,e._sQlen+=12,e.flush()},pointerEvent:function(e,t,r,i){var n=e._sQ,s=e._sQlen;n[s]=5,n[s+1]=i,n[s+2]=t>>8,n[s+3]=t,n[s+4]=r>>8,n[s+5]=r,e._sQlen+=6,e.flush()},_buildExtendedClipboardFlags:function(e,t){for(var r=new Uint8Array(4),i=0,n=0,s=0;s<e.length;s++)n|=e[s];for(var o=0;o<t.length;o++)i|=t[o];return r[0]=n>>24,r[1]=0,r[2]=0,r[3]=i,r},extendedClipboardProvide:function(e,t,r){for(var i=new d.default,n=[],o=0;o<t.length;o++){if(1!=t[o])throw new Error("Unsupported extended clipboard format for Provide message.");r[o]=r[o].replace(/\r\n|\r|\n/gm,"\r\n");var a=(0,s.encodeUTF8)(r[o]+"\0");n.push(a.length>>24&255,a.length>>16&255,a.length>>8&255,255&a.length);for(var l=0;l<a.length;l++)n.push(a.charCodeAt(l))}var c=i.deflate(new Uint8Array(n)),u=new Uint8Array(4+c.length);u.set(P.messages._buildExtendedClipboardFlags([1<<28],t)),u.set(c,4),P.messages.clientCutText(e,u,!0)},extendedClipboardNotify:function(e,t){var r=P.messages._buildExtendedClipboardFlags([1<<27],t);P.messages.clientCutText(e,r,!0)},extendedClipboardRequest:function(e,t){var r=P.messages._buildExtendedClipboardFlags([1<<25],t);P.messages.clientCutText(e,r,!0)},extendedClipboardCaps:function(e,t,r){var i=Object.keys(r),n=new Uint8Array(4+4*i.length);i.map((function(e){return parseInt(e)})),i.sort((function(e,t){return e-t})),n.set(P.messages._buildExtendedClipboardFlags(t,[]));for(var s=4,o=0;o<i.length;o++)n[s]=r[i[o]]>>24,n[s+1]=r[i[o]]>>16,n[s+2]=r[i[o]]>>8,n[s+3]=r[i[o]]>>0,s+=4,n[3]|=1<<i[o];P.messages.clientCutText(e,n,!0)},clientCutText:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=e._sQ,o=e._sQlen;s[o]=6,s[o+1]=0,s[o+2]=0,s[o+3]=0,r=n?(0,i.toUnsigned32bit)(-t.length):t.length,s[o+4]=r>>24,s[o+5]=r>>16,s[o+6]=r>>8,s[o+7]=r,e._sQlen+=8;for(var a=0,l=t.length;l>0;){for(var c=Math.min(l,e._sQbufferSize-e._sQlen),u=0;u<c;u++)s[e._sQlen+u]=t[a+u];e._sQlen+=c,e.flush(),l-=c,a+=c}},setDesktopSize:function(e,t,r,i,n){var s=e._sQ,o=e._sQlen;s[o]=251,s[o+1]=0,s[o+2]=t>>8,s[o+3]=t,s[o+4]=r>>8,s[o+5]=r,s[o+6]=1,s[o+7]=0,s[o+8]=i>>24,s[o+9]=i>>16,s[o+10]=i>>8,s[o+11]=i,s[o+12]=0,s[o+13]=0,s[o+14]=0,s[o+15]=0,s[o+16]=t>>8,s[o+17]=t,s[o+18]=r>>8,s[o+19]=r,s[o+20]=n>>24,s[o+21]=n>>16,s[o+22]=n>>8,s[o+23]=n,e._sQlen+=24,e.flush()},clientFence:function(e,t,r){var i=e._sQ,n=e._sQlen;i[n]=248,i[n+1]=0,i[n+2]=0,i[n+3]=0,i[n+4]=t>>24,i[n+5]=t>>16,i[n+6]=t>>8,i[n+7]=t;var s=r.length;i[n+8]=s;for(var o=0;o<s;o++)i[n+9+o]=r.charCodeAt(o);e._sQlen+=9+s,e.flush()},enableContinuousUpdates:function(e,t,r,i,n,s){var o=e._sQ,a=e._sQlen;o[a]=150,o[a+1]=t,o[a+2]=r>>8,o[a+3]=r,o[a+4]=i>>8,o[a+5]=i,o[a+6]=n>>8,o[a+7]=n,o[a+8]=s>>8,o[a+9]=s,e._sQlen+=10,e.flush()},pixelFormat:function(e,t,r){var i,n=e._sQ,s=e._sQlen;i=t>16?32:t>8?16:8;var o=Math.floor(t/3);n[s]=0,n[s+1]=0,n[s+2]=0,n[s+3]=0,n[s+4]=i,n[s+5]=t,n[s+6]=0,n[s+7]=r?1:0,n[s+8]=0,n[s+9]=(1<<o)-1,n[s+10]=0,n[s+11]=(1<<o)-1,n[s+12]=0,n[s+13]=(1<<o)-1,n[s+14]=2*o,n[s+15]=1*o,n[s+16]=0*o,n[s+17]=0,n[s+18]=0,n[s+19]=0,e._sQlen+=20,e.flush()},clientEncodings:function(e,t){var r=e._sQ,i=e._sQlen;r[i]=2,r[i+1]=0,r[i+2]=t.length>>8,r[i+3]=t.length;for(var n=i+4,s=0;s<t.length;s++){var o=t[s];r[n]=o>>24,r[n+1]=o>>16,r[n+2]=o>>8,r[n+3]=o,n+=4}e._sQlen+=n-i,e.flush()},fbUpdateRequest:function(e,t,r,i,n,s){var o=e._sQ,a=e._sQlen;void 0===r&&(r=0),void 0===i&&(i=0),o[a]=3,o[a+1]=t?1:0,o[a+2]=r>>8&255,o[a+3]=255&r,o[a+4]=i>>8&255,o[a+5]=255&i,o[a+6]=n>>8&255,o[a+7]=255&n,o[a+8]=s>>8&255,o[a+9]=255&s,e._sQlen+=10,e.flush()},xvpOp:function(e,t,r){var i=e._sQ,n=e._sQlen;i[n]=250,i[n+1]=0,i[n+2]=t,i[n+3]=r,e._sQlen+=4,e.flush()}},P.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":
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/xml/xml.js ***!
|
|
|
\*************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){"use strict";var t={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},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(i,n){var s,o,a=i.indentUnit,l={},c=n.htmlMode?t:r;for(var u in c)l[u]=c[u];for(var u in n)l[u]=n[u];function h(e,t){function r(r){return t.tokenize=r,r(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(f("atom","]]>")):null:e.match("--")?r(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(function e(t){return function(r,i){for(var n;null!=(n=r.next());){if("<"==n)return i.tokenize=e(t+1),i.tokenize(r,i);if(">"==n){if(1==t){i.tokenize=h;break}return i.tokenize=e(t-1),i.tokenize(r,i)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(s=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var r,i,n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=h,s=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return s="equals",null;if("<"==n){t.tokenize=h,t.state=m,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=(r=n,(i=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=d;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=h;break}r.next()}return e}}function p(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!l.contextGrabbers.hasOwnProperty(r)||!l.contextGrabbers[r].hasOwnProperty(t))return;g(e)}}function m(e,t,r){return"openTag"==e?(r.tagStart=t.column(),_):"closeTag"==e?y:m}function _(e,t,r){return"word"==e?(r.tagName=t.current(),o="tag",w):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",w(e,0,r)):(o="error",_)}function y(e,t,r){if("word"==e){var i=t.current();return r.context&&r.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(r.context.tagName)&&g(r),r.context&&r.context.tagName==i||!1===l.matchClosing?(o="tag",b):(o="tag error",S)}return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,0,r)):(o="error",S)}function b(e,t,r){return"endTag"!=e?(o="error",b):(g(r),m)}function S(e,t,r){return o="error",b(e,0,r)}function w(e,t,r){if("word"==e)return o="attribute",C;if("endTag"==e||"selfcloseTag"==e){var i=r.tagName,n=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(i)?v(r,i):(v(r,i),r.context=new p(r,i,n==r.indented)),m}return o="error",w}function C(e,t,r){return"equals"==e?E:(l.allowMissing||(o="error"),w(e,0,r))}function E(e,t,r){return"string"==e?k:"word"==e&&l.allowUnquoted?(o="string",w):(o="error",w(e,0,r))}function k(e,t,r){return"string"==e?k:w(e,0,r)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:m,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;s=null;var r=t.tokenize(e,t);return(r||s)&&"comment"!=r&&(o=null,t.state=t.state(s||r,e,t),o&&(r="error"==o?r+" error":o)),r},indent:function(t,r,i){var n=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(n&&n.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var s=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(s&&s[1])for(;n;){if(n.tagName==s[2]){n=n.prev;break}if(!l.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(s)for(;n;){var o=l.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(s[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=w)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)r.tagName&&t.push(r.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(r(/*! ../../lib/codemirror */"VrN/"))},"1q3G":
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/zstream.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},"34/K":
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/raw.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._lines=0}var t,r,n;return t=e,(r=[{key:"decodeRect",value:function(e,t,r,i,n,s,o){0===this._lines&&(this._lines=i);var a=r*(8==o?1:4);if(n.rQwait("RAW",a))return!1;var l=t+(i-this._lines),c=Math.min(this._lines,Math.floor(n.rQlen/a)),u=n.rQ,h=n.rQi;if(8==o){for(var d=r*c,f=new Uint8Array(4*d),p=0;p<d;p++)f[4*p+0]=255*(u[h+p]>>0&3)/3,f[4*p+1]=255*(u[h+p]>>2&3)/3,f[4*p+2]=255*(u[h+p]>>4&3)/3,f[4*p+4]=0;u=f,h=0}return s.blitImage(e,l,r,c,u,h),n.rQskipBytes(c*a),this._lines-=c,!(this._lines>0)}}])&&i(t.prototype,r),n&&i(t,n),e}();t.default=n},3690:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/hextile.js ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(/*! ../util/logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._tiles=0,this._lastsubencoding=0}var t,r,i;return t=e,(r=[{key:"decodeRect",value:function(e,t,r,i,s,o,a){for(0===this._tiles&&(this._tilesX=Math.ceil(r/16),this._tilesY=Math.ceil(i/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var l=1;if(s.rQwait("HEXTILE",l))return!1;var c=s.rQ,u=s.rQi,h=c[u];if(h>30)throw new Error("Illegal hextile subencoding (subencoding: "+h+")");var d=this._totalTiles-this._tiles,f=e+d%this._tilesX*16,p=t+16*Math.floor(d/this._tilesX),g=Math.min(16,e+r-f),v=Math.min(16,t+i-p);if(1&h)l+=g*v*4;else if(2&h&&(l+=4),4&h&&(l+=4),8&h){if(l++,s.rQwait("HEXTILE",l))return!1;var m=c[u+l-1];l+=16&h?6*m:2*m}if(s.rQwait("HEXTILE",l))return!1;if(u++,0===h)1&this._lastsubencoding?n.Debug(" Ignoring blank after RAW"):o.fillRect(f,p,g,v,this._background);else if(1&h)o.blitImage(f,p,g,v,c,u),u+=l-1;else{if(2&h&&(this._background=[c[u],c[u+1],c[u+2],c[u+3]],u+=4),4&h&&(this._foreground=[c[u],c[u+1],c[u+2],c[u+3]],u+=4),o.startTile(f,p,g,v,this._background),8&h){var _=c[u];u++;for(var y=0;y<_;y++){var b=void 0;16&h?(b=[c[u],c[u+1],c[u+2],c[u+3]],u+=4):b=this._foreground;var S=c[u],w=S>>4,C=15&S,E=c[++u];u++;var k=1+(E>>4),x=1+(15&E);o.subTile(w,C,k,x,b)}}o.finishTile()}s.rQi=u,this._lastsubencoding=h,this._tiles--}return!0}}])&&o(t.prototype,r),i&&o(t,i),e}();t.default=a},"6BzB":
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/utils/common.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shrinkBuf=function(e,t){if(e.length===t)return e;if(e.subarray)return e.subarray(0,t);return e.length=t,e},t.arraySet=function(e,t,r,i,n){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+i),n);for(var s=0;s<i;s++)e[n+s]=t[r+s]},t.flattenChunks=function(e){var t,r,i,n,s,o;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(o=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)s=e[t],o.set(s,n),n+=s.length;return o},t.Buf32=t.Buf16=t.Buf8=void 0;var i=Uint8Array;t.Buf8=i;var n=Uint16Array;t.Buf16=n;var s=Int32Array;t.Buf32=s},"6Qwc":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/vkeys.js ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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"}},"7ahc":
|
|
|
/*!*************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
|
|
|
\*************************************************************/
|
|
|
/*! exports provided: default, MyCodeMirror */
|
|
|
/*! exports used: MyCodeMirror, default */function(e,t,r){"use strict";r.d(t,"a",(function(){return v}));var i=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),n=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),s=(r(/*! antd/es/button/style */"+L6B"),r(/*! antd/es/button */"2/Rp")),o=(r(/*! antd/es/form/style */"y8nQ"),r(/*! antd/es/form */"Vl3Y")),a=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(r(/*! antd/es/select/style */"OaEy"),r(/*! antd/es/select */"2fM7")),c=r(/*! react */"q1tI"),u=r.n(c),h=r(/*! codemirror */"VrN/"),d=r.n(h),f=(r(/*! codemirror/lib/codemirror.css */"p77/"),r(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),p={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};function v(e){var t=e.value,r=e.onChange,n=e.mode,s=e.options,o=void 0===s?{}:s,l=Object(c.useRef)(),h=Object(c.useState)(),f=Object(a.a)(h,2),p=f[0],g=f[1];return Object(c.useEffect)((function(){if(p){function e(e){var t=e.getValue();r&&r(t)}return p.on("change",e),function(){p.off("change",e)}}}),[p,r]),Object(c.useEffect)((function(){p&&p.setOption("mode",n)}),[p,n]),Object(c.useEffect)((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||" ")}),300))}),[p,t]),Object(c.useEffect)((function(){if(l.current&&!p){var e=d.a.fromTextArea(l.current,Object(i.a)({mode:n,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},o));g(e)}}),[l.current,p]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}t.b=function(e){var t=e.callback,r=e.onCancel,i=Object(c.useState)("python"),h=Object(a.a)(i,2),d=h[0],m=h[1];return u.a.createElement(o.a,Object(n.a)({},p,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),u.a.createElement(o.a.Item,{label:"代码语言",name:"language"},u.a.createElement(l.a,{onChange:function(e){m(g[e][1])}},Object.keys(g).map((function(e){return u.a.createElement(f,{key:e,value:e},g[e][0])})))),u.a.createElement(o.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(v,{mode:d})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(s.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(s.a,{type:"ghost",onClick:r},"取消")))}},"7ixt":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/rc-tooltip/es/placements.js ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: placements, default */
|
|
|
/*! exports used: placements */function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var i={adjustX:1,adjustY:1},n=[0,0],s={left:{points:["cr","cl"],overflow:i,offset:[-4,0],targetOffset:n},right:{points:["cl","cr"],overflow:i,offset:[4,0],targetOffset:n},top:{points:["bc","tc"],overflow:i,offset:[0,-4],targetOffset:n},bottom:{points:["tc","bc"],overflow:i,offset:[0,4],targetOffset:n},topLeft:{points:["bl","tl"],overflow:i,offset:[0,-4],targetOffset:n},leftTop:{points:["tr","tl"],overflow:i,offset:[-4,0],targetOffset:n},topRight:{points:["br","tr"],overflow:i,offset:[0,-4],targetOffset:n},rightTop:{points:["tl","tr"],overflow:i,offset:[4,0],targetOffset:n},bottomRight:{points:["tr","br"],overflow:i,offset:[0,4],targetOffset:n},rightBottom:{points:["bl","br"],overflow:i,offset:[4,0],targetOffset:n},bottomLeft:{points:["tl","bl"],overflow:i,offset:[0,4],targetOffset:n},leftBottom:{points:["br","bl"],overflow:i,offset:[-4,0],targetOffset:n}}},"8+yF":
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/keysymdef.js ***!
|
|
|
\**********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={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},n={lookup:function(e){if(e>=32&&e<=255)return e;var t=i[e];return void 0!==t?t:16777216|e}};t.default=n},"8CQX":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/util.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getKeycode=d,t.getKey=f,t.getKeysym=function(e){var t=f(e);if("Unidentified"===t)return null;if(t in l.default){var r=e.location;if("Meta"===t&&0===r&&(r=2),"Clear"===t&&3===r)"NumLock"===d(e)&&(r=0);if((void 0===r||r>3)&&(r=0),"Meta"===t){var i=d(e);if("AltLeft"===i)return n.default.XK_Meta_L;if("AltRight"===i)return n.default.XK_Meta_R}if("Clear"===t)if("NumLock"===d(e))return n.default.XK_Num_Lock;return l.default[t][r]}if(1!==t.length)return null;var o=t.charCodeAt();if(o)return s.default.lookup(o);return null};var n=h(r(/*! ./keysym.js */"mHUz")),s=h(r(/*! ./keysymdef.js */"8+yF")),o=h(r(/*! ./vkeys.js */"6Qwc")),a=h(r(/*! ./fixedkeys.js */"gIYZ")),l=h(r(/*! ./domkeytable.js */"mTgk")),c=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(/*! ../util/browser.js */"GdRQ"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){return e&&e.__esModule?e:{default:e}}function d(e){if(e.code){switch(e.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return e.code}if("keypress"!==e.type&&e.keyCode in o.default){var t=o.default[e.keyCode];if(c.isMac()&&"ContextMenu"===t&&(t="MetaRight"),2===e.location)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(3===e.location)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 f(e){if(void 0!==e.key){switch(e.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 e.char}switch(e.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(e.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if("\0"===e.key&&"NumpadDecimal"===e.code)return"Delete";if(!c.isIE()&&!c.isEdge())return e.key;if(1!==e.key.length&&"Unidentified"!==e.key)return e.key}var t=d(e);return t in a.default?a.default[t]:e.charCode?String.fromCharCode(e.charCode):"Unidentified"}},"8EBN":
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/meta.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){"use strict";e.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 t=0;t<e.modeInfo.length;t++){var r=e.modeInfo[t];r.mimes&&(r.mime=r.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var i=e.modeInfo[r];if(i.mime==t)return i;if(i.mimes)for(var n=0;n<i.mimes.length;n++)if(i.mimes[n]==t)return i}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var i=e.modeInfo[r];if(i.ext)for(var n=0;n<i.ext.length;n++)if(i.ext[n]==t)return i}},e.findModeByFileName=function(t){for(var r=0;r<e.modeInfo.length;r++){var i=e.modeInfo[r];if(i.file&&i.file.test(t))return i}var n=t.lastIndexOf("."),s=n>-1&&t.substring(n+1,t.length);if(s)return e.findModeByExtension(s)},e.findModeByName=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var i=e.modeInfo[r];if(i.name.toLowerCase()==t)return i;if(i.alias)for(var n=0;n<i.alias.length;n++)if(i.alias[n].toLowerCase()==t)return i}}}(r(/*! ../lib/codemirror */"VrN/"))},"8K/p":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/tight.js ***!
|
|
|
\*********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(/*! ../util/logging.js */"Lo0S")),o=(n=r(/*! ../inflator.js */"ItS6"))&&n.__esModule?n:{default:n};function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(var t=0;t<4;t++)this._zlibs[t]=new o.default}var t,r,i;return t=e,(r=[{key:"decodeRect",value:function(e,t,r,i,n,o,a){if(null===this._ctl){if(n.rQwait("TIGHT compression-control",1))return!1;this._ctl=n.rQshift8();for(var l=0;l<4;l++)this._ctl>>l&1&&(this._zlibs[l].reset(),s.Info("Reset zlib stream "+l));this._ctl=this._ctl>>4}var c;if(8===this._ctl)c=this._fillRect(e,t,r,i,n,o,a);else if(9===this._ctl)c=this._jpegRect(e,t,r,i,n,o,a);else if(10===this._ctl)c=this._pngRect(e,t,r,i,n,o,a);else{if(0!=(128&this._ctl))throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");c=this._basicRect(this._ctl,e,t,r,i,n,o,a)}return c&&(this._ctl=null),c}},{key:"_fillRect",value:function(e,t,r,i,n,s,o){if(n.rQwait("TIGHT",3))return!1;var a=n.rQi,l=n.rQ;return s.fillRect(e,t,r,i,[l[a+2],l[a+1],l[a]],!1),n.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(e,t,r,i,n,s,o){var a=this._readData(n);return null!==a&&(s.imageRect(e,t,r,i,"image/jpeg",a),!0)}},{key:"_pngRect",value:function(e,t,r,i,n,s,o){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(e,t,r,i,n,s,o,a){if(null===this._filter)if(4&e){if(s.rQwait("TIGHT",1))return!1;this._filter=s.rQshift8()}else this._filter=0;var l,c=3&e;switch(this._filter){case 0:l=this._copyFilter(c,t,r,i,n,s,o,a);break;case 1:l=this._paletteFilter(c,t,r,i,n,s,o,a);break;case 2:l=this._gradientFilter(c,t,r,i,n,s,o,a);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return l&&(this._filter=null),l}},{key:"_copyFilter",value:function(e,t,r,i,n,s,o,a){var l,c=i*n*3;if(c<12){if(s.rQwait("TIGHT",c))return!1;l=s.rQshiftBytes(c)}else{if(null===(l=this._readData(s)))return!1;this._zlibs[e].setInput(l),l=this._zlibs[e].inflate(c),this._zlibs[e].setInput(null)}return o.blitRgbImage(t,r,i,n,l,0,!1),!0}},{key:"_paletteFilter",value:function(e,t,r,i,n,s,o,a){if(0===this._numColors){if(s.rQwait("TIGHT palette",1))return!1;var l=s.rQpeek8()+1,c=3*l;if(s.rQwait("TIGHT palette",1+c))return!1;this._numColors=l,s.rQskipBytes(1),s.rQshiftTo(this._palette,c)}var u,h=this._numColors<=2?1:8,d=Math.floor((i*h+7)/8)*n;if(d<12){if(s.rQwait("TIGHT",d))return!1;u=s.rQshiftBytes(d)}else{if(null===(u=this._readData(s)))return!1;this._zlibs[e].setInput(u),u=this._zlibs[e].inflate(d),this._zlibs[e].setInput(null)}return 2==this._numColors?this._monoRect(t,r,i,n,u,this._palette,o):this._paletteRect(t,r,i,n,u,this._palette,o),this._numColors=0,!0}},{key:"_monoRect",value:function(e,t,r,i,n,s,o){for(var a=this._getScratchBuffer(r*i*4),l=Math.floor((r+7)/8),c=Math.floor(r/8),u=0;u<i;u++){var h=void 0,d=void 0,f=void 0;for(f=0;f<c;f++)for(var p=7;p>=0;p--)h=4*(u*r+8*f+7-p),d=3*(n[u*l+f]>>p&1),a[h]=s[d],a[h+1]=s[d+1],a[h+2]=s[d+2],a[h+3]=255;for(var g=7;g>=8-r%8;g--)h=4*(u*r+8*f+7-g),d=3*(n[u*l+f]>>g&1),a[h]=s[d],a[h+1]=s[d+1],a[h+2]=s[d+2],a[h+3]=255}o.blitRgbxImage(e,t,r,i,a,0,!1)}},{key:"_paletteRect",value:function(e,t,r,i,n,s,o){for(var a=this._getScratchBuffer(r*i*4),l=r*i*4,c=0,u=0;c<l;c+=4,u++){var h=3*n[u];a[c]=s[h],a[c+1]=s[h+1],a[c+2]=s[h+2],a[c+3]=255}o.blitRgbxImage(e,t,r,i,a,0,!1)}},{key:"_gradientFilter",value:function(e,t,r,i,n,s,o,a){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(e){if(0===this._len){if(e.rQwait("TIGHT",3))return null;var t;t=e.rQshift8(),this._len=127&t,128&t&&(t=e.rQshift8(),this._len|=(127&t)<<7,128&t&&(t=e.rQshift8(),this._len|=t<<14))}if(e.rQwait("TIGHT",this._len))return null;var r=e.rQshiftBytes(this._len);return this._len=0,r}},{key:"_getScratchBuffer",value:function(e){return(!this._scratchBuffer||this._scratchBuffer.length<e)&&(this._scratchBuffer=new Uint8Array(e)),this._scratchBuffer}}])&&l(t.prototype,r),i&&l(t,i),e}();t.default=c},"9Bee":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/RenderHtml/index.tsx + 1 modules ***!
|
|
|
\*********************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/PreviewAll/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hls.js/dist/hls.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/katex/dist/katex.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/lib/marked.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/src/helpers.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,r){"use strict";var i=r("k1fw"),n=r("tJVT"),s=r("q1tI"),o=r.n(s),a=(r("vg9a"),r("DlQD")),l=r.n(a),c=r("rUJ1");var u=[],h=["<ul>"],d=new l.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){u.length=0,h=["<ul>"]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function v(){return function e(t,r,i,n){if(r>=t.length||t[r].level<=i)return r;var s=t[r];n.push("<li><a href='#"+s.anchor+"'>"+s.text+"</a>");var o=[];return r=e(t,++r,s.level,o),o.length>0&&(n.push("<ul>"),o.forEach((function(e){n.push(e)})),n.push("</ul>")),n.push("</li>"),r=e(t,r,i,n)}(u,0,0,h),h.push("</ul>"),h.join("")}var m={heading:function(e){var t=f.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var r=t[0],i=function(e,t){var r=e.match(/^(\s+)(?:```)/);if(null===r)return t;var i=r[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Object(n.a)(t,1)[0].length>=i.length?e.slice(i.length):e})).join("\n")}(r,t[3]||""),s=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(s)>=0){var o=b(),a=i;i=o,S[o]={type:"block",expression:a}}return{type:"code",raw:r,lang:s,text:i}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,y=0,b=function(){return"__special_katext_id_".concat(y++,"__")},S={};function w(){y=0,S={}}function C(e){return e=e.replace(_,(function(e,t){var r=b();return S[r]={type:"inline",expression:t},r}))}var E=d.listitem;d.listitem=function(e){return E(C(e))};var k=d.paragraph;d.paragraph=function(e){return k(C(e))};var x=d.tablecell;d.tablecell=function(e,t){return x(C(e),t)},d.code=function(e,t,r){var i=(t||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(r?e:Object(c.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(r?e:Object(c.escape)(e,!0))+"</code></pre>"},d.heading=function(e,t,r){var i=this.options.headerPrefix+r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:i,level:t,text:e}),"<h"+t+' id="'+i+'">'+e+"</h"+t+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:m,renderer:d});var T=l.a,L=(r("SJMd"),r("ulZh")),A=r.n(L),D=r("m3rI"),O=r("Oy/b"),R=r("p5ED"),M=/<pre[^>]*>/g;t.a=function(e){var t=e.value,r=void 0===t?"":t,a=e.className,l=e.showTextOnly,c=e.showLines,u=e.style,h=void 0===u?{}:u,d=e.stylesPrev,f=void 0===d?{}:d,m=String(r),_=Object(s.useState)(""),y=Object(n.a)(_,2),b=y[0],C=y[1],E=Object(s.useMemo)((function(){try{m=(m=m.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+D.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+D.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+D.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,"\n")).replace(new RegExp("(?<!\\n)\\n(?!\\n)","g")," \n")}catch(e){}var e=T(m),t=S;if(m.match(/\[TOC\]/)&&(e=e.replace("<p>[TOC]</p>",v()),p()),e=(e=e.replace(/(__special_katext_id_\d+__)/g,(function(e,r){var i=t[r],n=i.type,s=i.expression;return Object(O.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(s)||"",{displayMode:"block"===n,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),w(),l){var r=document.createElement("div");return r.innerHTML=e,r.innerText}return setTimeout((function(){return L()}),500),e}),[m]),k=Object(s.useRef)();function x(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var r=t.getAttribute("href");if(r.indexOf("office")>-1)e.preventDefault(),C(r);else if(r.startsWith("#")){e.preventDefault();var i=document.getElementById(r.replace("#",""));i&&i.scrollIntoView(!0)}}}g.WebkitLineClamp=c,c&&(h=Object(i.a)(Object(i.a)({},h),g));var L=function(){var e,t=null===(e=k.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(A.a.isSupported()){var t=new A.a;t.loadSource(e.src),t.attachMedia(e)}}))};return Object(s.useEffect)((function(){if(k.current&&E&&E.match(M)&&window.PR.prettyPrint(),k.current)return k.current.addEventListener("click",x),function(){k.current.removeEventListener("click",x),w(),p()}}),[E,k.current,x]),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{ref:k,style:Object(i.a)({},h),className:"".concat(a||""," markdown-body "),dangerouslySetInnerHTML:{__html:E}}),o.a.createElement(R.a,{close:!0,data:b,type:null!=b&&b.length?"office":"",style:Object(i.a)({},f),onClose:function(){return C("")}}))}},"9VGf":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/components/useInterval.tsx ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var i=r(/*! react */"q1tI");function n(e,t){var r=Object(i.useRef)();Object(i.useEffect)((function(){r.current=e})),Object(i.useEffect)((function(){if(null!==t){var e=setInterval((function(){r.current()}),t);return function(){return clearInterval(e)}}}),[t])}},BU3w:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: injectCSS, updateCSS */
|
|
|
/*! exports used: updateCSS */function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var i=r(/*! ./canUseDom */"MNnm");function n(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(i.a)())return null;var s,o=document.createElement("style");(null===(t=r.csp)||void 0===t?void 0:t.nonce)&&(o.nonce=null===(s=r.csp)||void 0===s?void 0:s.nonce);o.innerHTML=e;var a=n(r),l=a.firstChild;return r.prepend&&a.prepend?a.prepend(o):r.prepend&&l?a.insertBefore(o,l):a.appendChild(o),o}var o=new Map;function a(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n(r);if(!o.has(i)){var a=s("",r),l=a.parentNode;o.set(i,l),l.removeChild(a)}var c=Array.from(o.get(i).children).find((function(e){return"STYLE"===e.tagName&&e["rc-util-key"]===t}));if(c){var u,h,d;if((null===(u=r.csp)||void 0===u?void 0:u.nonce)&&c.nonce!==(null===(h=r.csp)||void 0===h?void 0:h.nonce))c.nonce=null===(d=r.csp)||void 0===d?void 0:d.nonce;return c.innerHTML!==e&&(c.innerHTML=e),c}var f=s(e,r);return f["rc-util-key"]=t,f}},Bd2K:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/edit/closetag.js ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){e.defineOption("autoCloseTags",!1,(function(o,a,l){if(l!=e.Init&&l&&o.removeKeyMap("autoCloseTags"),a){var c={name:"autoCloseTags"};"object"==typeof a&&!1===a.whenClosing||(c["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:i(t,!0)}(t)}),"object"==typeof a&&!1===a.whenOpening||(c["'>'"]=function(i){return function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=i.getOption("autoCloseTags"),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var u=o[c].head,h=i.getTokenAt(u),d=e.innerMode(i.getMode(),h.state),f=d.state,p=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(f),g=p&&p.name;if(!g)return e.Pass;var v="html"==d.mode.configuration,m="object"==typeof l&&l.dontCloseTags||v&&t,_="object"==typeof l&&l.indentTags||v&&r;h.end>u.ch&&(g=g.slice(0,g.length-h.end+u.ch));var y=g.toLowerCase();if(!g||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&p.close||h.string.indexOf("/")==u.ch-h.start-1||m&&n(m,y)>-1||s(i,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f)||[],g,u,!0))return e.Pass;var b="object"==typeof l&&l.emptyTags;if(b&&n(b,g)>-1)a[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var S=_&&n(_,y)>-1;a[c]={indent:S,text:">"+(S?"\n\n":"")+"</"+g+">",newPos:S?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var w="object"==typeof l&&l.dontIndentOnAutoClose;for(c=o.length-1;c>=0;c--){var C=a[c];i.replaceRange(C.text,o[c].head,o[c].anchor,"+insert");var E=i.listSelections().slice(0);E[c]={head:C.newPos,anchor:C.newPos},i.setSelections(E),!w&&C.indent&&(i.indentLine(C.newPos.line,null,!0),i.indentLine(C.newPos.line+1,null,!0))}}(i)}),o.addKeyMap(c)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],r=["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 i(t,r){for(var i=t.listSelections(),n=[],o=r?"/":"</",a=t.getOption("autoCloseTags"),l="object"==typeof a&&a.dontIndentOnSlash,c=0;c<i.length;c++){if(!i[c].empty())return e.Pass;var u=i[c].head,h=t.getTokenAt(u),d=e.innerMode(t.getMode(),h.state),f=d.state;if(r&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=u.ch-1))return e.Pass;var p,g="xml"!=d.mode.name&&"htmlmixed"==t.getMode().name;if(g&&"javascript"==d.mode.name)p=o+"script";else if(g&&"css"==d.mode.name)p=o+"style";else{var v=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f);if(!v||v.length&&s(t,v,v[v.length-1],u))return e.Pass;p=o+v[v.length-1]}">"!=t.getLine(u.line).charAt(h.end)&&(p+=">"),n[c]=p}if(t.replaceSelections(n),i=t.listSelections(),!l)for(c=0;c<i.length;c++)(c==i.length-1||i[c].head.line<i[c+1].head.line)&&t.indentLine(i[c].head.line)}function n(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;++r)if(e[r]==t)return r;return-1}function s(t,r,i,n,s){if(!e.scanForClosingTag)return!1;var o=Math.min(t.lastLine()+1,n.line+500),a=e.scanForClosingTag(t,n,null,o);if(!a||a.tag!=i)return!1;for(var l=s?1:0,c=r.length-1;c>=0&&r[c]==i;c--)++l;for(n=a.to,c=1;c<l;c++){var u=e.scanForClosingTag(t,n,null,o);if(!u||u.tag!=i)return!1;n=u.to}return!0}e.commands.closeTag=function(e){return i(e)}}(r(/*! ../../lib/codemirror */"VrN/"),r(/*! ../fold/xml-fold */"osHv"))},BjJ7:
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/pages/tasks/util.js ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: isCompileOk, getTreeData, processTreeData, debounce, isProd, apiPref */
|
|
|
/*! exports used: apiPref, debounce, getTreeData, isCompileOk, processTreeData */function(e,t,r){"use strict";function i(e){var t=!0;if(e.length>0){for(var r=0;r<e.length;r++)if(0==e[r].compile_success||!e[r].compile_success){t=!1;break}}else t=!1;return t}function n(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=[],i=0;i<e.length;i++){var n=e[i],s=t?"".concat(t,"/").concat(n.name):"".concat(n.name);r.push({title:n.name,isLeaf:"tree"!==n.type,key:s})}return r}function s(e,t,r){for(var i=0;i<e.length;i++){var n=e[i];if(n.key===t){n.children=r;break}n.children&&s(n.children,t,r)}return e}function o(e,t,r){var i;return function(){var n=this,s=arguments,o=function(){i=null,r||e.apply(n,s)},a=r&&!i;clearTimeout(i),i=setTimeout(o,t),a&&e.apply(n,s)}}r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return n})),r.d(t,"e",(function(){return s})),r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var a=r(/*! @/utils/env */"m3rI").a.API_SERVER},"C+DQ":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/css/iconfont.css ***!
|
|
|
\*********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},DlQD:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/marked/lib/marked.js ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){e.exports=function(){"use strict";function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function r(e,r){var i;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(i=function(e,r){if(e){if("string"==typeof e)return t(e,r);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=e[Symbol.iterator]()).next.bind(i)}var i=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){function t(){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}}e.exports={defaults:{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},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),n=(i.defaults,i.getDefaults,i.changeDefaults,/[&<>"']/),s=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return l[e]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var d=/(^|[^\[])\^/g,f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,g={},v=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,_=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(e,t){g[" "+e]||(v.test(e)?g[" "+e]=e+"/":g[" "+e]=b(e,"/",!0));var r=-1===(e=g[" "+e]).indexOf(":");return"//"===t.substring(0,2)?r?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?r?t:e.replace(_,"$1")+t:e+t}function b(e,t,r){var i=e.length;if(0===i)return"";for(var n=0;n<i;){var s=e.charAt(i-n-1);if(s!==t||r){if(s===t||!r)break;n++}else n++}return e.substr(0,i-n)}var S=function(e,t){if(t){if(n.test(e))return e.replace(s,c)}else if(o.test(e))return e.replace(a,c);return e},w=h,C=function(e,t){e=e.source||e,t=t||"";var r={replace:function(t,i){return i=(i=i.source||i).replace(d,"$1"),e=e.replace(t,i),r},getRegex:function(){return new RegExp(e,t)}};return r},E=function(e,t,r){if(e){var i;try{i=decodeURIComponent(h(r)).replace(f,"").toLowerCase()}catch(e){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!p.test(r)&&(r=y(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch(e){return null}return r},k={exec:function(){}},x=function(e){for(var t,r,i=1;i<arguments.length;i++)for(r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},T=function(e,t){var r=e.replace(/\|/g,(function(e,t,r){for(var i=!1,n=t;--n>=0&&"\\"===r[n];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r},L=b,A=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var r=e.length,i=0,n=0;n<r;n++)if("\\"===e[n])n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&--i<0)return n;return-1},D=function(e){e&&e.sanitize&&!e.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")},O=i.defaults,R=L,M=T,I=S,F=A;function P(e,t,r){var i=t.href,n=t.title?I(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:r,href:i,title:n,text:s}:{type:"image",raw:r,href:i,title:n,text:I(s)}}var N=function(){function e(e){this.options=e||O}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var r=this.rules.block.code.exec(e);if(r){var i=t[t.length-1];if(i&&"paragraph"===i.type)return{raw:r[0],text:r[0].trimRight()};var n=r[0].replace(/^ {4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:R(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var r=t[0],i=function(e,t){var r=e.match(/^(\s+)(?:```)/);if(null===r)return t;var i=r[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e})).join("\n")}(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var r={type:"table",header:M(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(r.header.length===r.align.length){var i,n=r.align.length;for(i=0;i<n;i++)/^ *-+: *$/.test(r.align[i])?r.align[i]="right":/^ *:-+: *$/.test(r.align[i])?r.align[i]="center":/^ *:-+ *$/.test(r.align[i])?r.align[i]="left":r.align[i]=null;for(n=r.cells.length,i=0;i<n;i++)r.cells[i]=M(r.cells[i],r.header.length);return r}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var r=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:r}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var r,i,n,s,o,a,l,c=t[0],u=t[2],h=u.length>1,d=")"===u[u.length-1],f={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},p=t[0].match(this.rules.block.item),g=!1,v=p.length,m=0;m<v;m++)c=r=p[m],i=r.length,~(r=r.replace(/^ *([*+-]|\d+[.)]) */,"")).indexOf("\n ")&&(i-=r.length,r=this.options.pedantic?r.replace(/^ {1,4}/gm,""):r.replace(new RegExp("^ {1,"+i+"}","gm"),"")),m!==v-1&&(n=this.rules.block.bullet.exec(p[m+1])[0],(h?1===n.length||!d&&")"===n[n.length-1]:n.length>1||this.options.smartLists&&n!==u)&&(s=p.slice(m+1).join("\n"),f.raw=f.raw.substring(0,f.raw.length-s.length),m=v-1)),o=g||/\n\n(?!\s*$)/.test(r),m!==v-1&&(g="\n"===r.charAt(r.length-1),o||(o=g)),o&&(f.loose=!0),l=void 0,(a=/^\[[ xX]\] /.test(r))&&(l=" "!==r[1],r=r.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:c,task:a,checked:l,loose:o,text:r});return f}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):I(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var r={type:"table",header:M(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(r.header.length===r.align.length){r.raw=t[0];var i,n=r.align.length;for(i=0;i<n;i++)/^ *-+: *$/.test(r.align[i])?r.align[i]="right":/^ *:-+: *$/.test(r.align[i])?r.align[i]="center":/^ *:-+ *$/.test(r.align[i])?r.align[i]="left":r.align[i]=null;for(n=r.cells.length,i=0;i<n;i++)r.cells[i]=M(r.cells[i].replace(/^ *\| *| *\| *$/g,""),r.header.length);return r}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e,t){var r=this.rules.block.text.exec(e);if(r){var i=t[t.length-1];return i&&"text"===i.type?{raw:r[0],text:r[0]}:{type:"text",raw:r[0],text:r[0]}}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:I(t[1])}},t.tag=function(e,t,r){var i=this.rules.inline.tag.exec(e);if(i)return!t&&/^<a /i.test(i[0])?t=!0:t&&/^<\/a>/i.test(i[0])&&(t=!1),!r&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?r=!0:r&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(r=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:r,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):I(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var r=F(t[2],"()");if(r>-1){var i=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,i).trim(),t[3]=""}var n=t[2],s="";if(this.options.pedantic){var o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);o?(n=o[1],s=o[3]):s=""}else s=t[3]?t[3].slice(1,-1):"";return P(t,{href:(n=n.trim().replace(/^<([\s\S]*)>$/,"$1"))?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0])}},t.reflink=function(e,t){var r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){var i=(r[2]||r[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var n=r[0].charAt(0);return{type:"text",raw:n,text:n}}return P(r,i,r[0])}},t.strong=function(e,t,r){void 0===r&&(r="");var i=this.rules.inline.strong.start.exec(e);if(i&&(!i[1]||i[1]&&(""===r||this.rules.inline.punctuation.exec(r)))){t=t.slice(-1*e.length);var n,s="**"===i[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(s.lastIndex=0;null!=(i=s.exec(t));)if(n=this.rules.inline.strong.middle.exec(t.slice(0,i.index+3)))return{type:"strong",raw:e.slice(0,n[0].length),text:e.slice(2,n[0].length-2)}}},t.em=function(e,t,r){void 0===r&&(r="");var i=this.rules.inline.em.start.exec(e);if(i&&(!i[1]||i[1]&&(""===r||this.rules.inline.punctuation.exec(r)))){t=t.slice(-1*e.length);var n,s="*"===i[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(s.lastIndex=0;null!=(i=s.exec(t));)if(n=this.rules.inline.em.middle.exec(t.slice(0,i.index+2)))return{type:"em",raw:e.slice(0,n[0].length),text:e.slice(1,n[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var r=t[2].replace(/\n/g," "),i=/[^ ]/.test(r),n=r.startsWith(" ")&&r.endsWith(" ");return i&&n&&(r=r.substring(1,r.length-1)),r=I(r,!0),{type:"codespan",raw:t[0],text:r}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}},t.autolink=function(e,t){var r,i,n=this.rules.inline.autolink.exec(e);if(n)return i="@"===n[2]?"mailto:"+(r=I(this.options.mangle?t(n[1]):n[1])):r=I(n[1]),{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}},t.url=function(e,t){var r;if(r=this.rules.inline.url.exec(e)){var i,n;if("@"===r[2])n="mailto:"+(i=I(this.options.mangle?t(r[0]):r[0]));else{var s;do{s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0]}while(s!==r[0]);i=I(r[0]),n="www."===r[1]?"http://"+i:i}return{type:"link",raw:r[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,r){var i,n=this.rules.inline.text.exec(e);if(n)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):I(n[0]):n[0]:I(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:i}},e}(),B=k,K=C,j=x,U={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:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};U.def=K(U.def).replace("label",U._label).replace("title",U._title).getRegex(),U.bullet=/(?:[*+-]|\d{1,9}[.)])/,U.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,U.item=K(U.item,"gm").replace(/bull/g,U.bullet).getRegex(),U.list=K(U.list).replace(/bull/g,U.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+U.def.source+")").getRegex(),U._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",U._comment=/<!--(?!-?>)[\s\S]*?-->/,U.html=K(U.html,"i").replace("comment",U._comment).replace("tag",U._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),U.paragraph=K(U._paragraph).replace("hr",U.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",U._tag).getRegex(),U.blockquote=K(U.blockquote).replace("paragraph",U.paragraph).getRegex(),U.normal=j({},U),U.gfm=j({},U.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*|$)"}),U.gfm.nptable=K(U.gfm.nptable).replace("hr",U.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",U._tag).getRegex(),U.gfm.table=K(U.gfm.table).replace("hr",U.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",U._tag).getRegex(),U.pedantic=j({},U.normal,{html:K("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",U._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:B,paragraph:K(U.normal._paragraph).replace("hr",U.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",U.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,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:B,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};H.punctuation=K(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex(),H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",H.em.start=K(H.em.start).replace(/punctuation/g,H._punctuation).getRegex(),H.em.middle=K(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex(),H.em.endAst=K(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.em.endUnd=K(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.start=K(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex(),H.strong.middle=K(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/blockSkip/g,H._blockSkip).getRegex(),H.strong.endAst=K(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.endUnd=K(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.blockSkip=K(H._blockSkip,"g").getRegex(),H.overlapSkip=K(H._overlapSkip,"g").getRegex(),H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,H._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])?)+(?![-_])/,H.autolink=K(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex(),H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,H.tag=K(H.tag).replace("comment",U._comment).replace("attribute",H._attribute).getRegex(),H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,H.link=K(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex(),H.reflink=K(H.reflink).replace("label",H._label).getRegex(),H.reflinkSearch=K(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex(),H.normal=j({},H),H.pedantic=j({},H.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:K(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:K(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()}),H.gfm=j({},H.normal,{escape:K(H.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),H.gfm.url=K(H.gfm.url,"i").replace("email",H.gfm._extended_email).getRegex(),H.breaks=j({},H.gfm,{br:K(H.br).replace("{2,}","*").getRegex(),text:K(H.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var X={block:U,inline:H},W=i.defaults,z=X.block,G=X.inline;function V(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function q(e){var t,r,i="",n=e.length;for(t=0;t<n;t++)r=e.charCodeAt(t),Math.random()>.5&&(r="x"+r.toString(16)),i+="&#"+r+";";return i}var Q=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||W,this.options.tokenizer=this.options.tokenizer||new N,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:z.normal,inline:G.normal};this.options.pedantic?(t.block=z.pedantic,t.inline=G.pedantic):this.options.gfm&&(t.block=z.gfm,this.options.breaks?t.inline=G.breaks:t.inline=G.gfm),this.tokenizer.rules=t}t.lex=function(e,r){return new t(r).lex(e)};var r,i,n,s=t.prototype;return s.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},s.blockTokens=function(e,t,r){var i,n,s,o;for(void 0===t&&(t=[]),void 0===r&&(r=!0),e=e.replace(/^ +$/gm,"");e;)if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),i.type&&t.push(i);else if(i=this.tokenizer.code(e,t))e=e.substring(i.raw.length),i.type?t.push(i):((o=t[t.length-1]).raw+="\n"+i.raw,o.text+="\n"+i.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.nptable(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],r),t.push(i);else if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),s=i.items.length,n=0;n<s;n++)i.items[n].tokens=this.blockTokens(i.items[n].text,[],!1);t.push(i)}else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(r&&(i=this.tokenizer.def(e)))e=e.substring(i.raw.length),this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(r&&(i=this.tokenizer.paragraph(e)))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.text(e,t))e=e.substring(i.raw.length),i.type?t.push(i):((o=t[t.length-1]).raw+="\n"+i.raw,o.text+="\n"+i.text);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return t},s.inline=function(e){var t,r,i,n,s,o,a=e.length;for(t=0;t<a;t++)switch((o=e[t]).type){case"paragraph":case"text":case"heading":o.tokens=[],this.inlineTokens(o.text,o.tokens);break;case"table":for(o.tokens={header:[],cells:[]},n=o.header.length,r=0;r<n;r++)o.tokens.header[r]=[],this.inlineTokens(o.header[r],o.tokens.header[r]);for(n=o.cells.length,r=0;r<n;r++)for(s=o.cells[r],o.tokens.cells[r]=[],i=0;i<s.length;i++)o.tokens.cells[r][i]=[],this.inlineTokens(s[i],o.tokens.cells[r][i]);break;case"blockquote":this.inline(o.tokens);break;case"list":for(n=o.items.length,r=0;r<n;r++)this.inline(o.items[r].tokens)}return e},s.inlineTokens=function(e,t,r,i,n){var s;void 0===t&&(t=[]),void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===n&&(n="");var o,a=e;if(this.tokens.links){var l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(a));)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(s=this.tokenizer.escape(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.tag(e,r,i))e=e.substring(s.raw.length),r=s.inLink,i=s.inRawBlock,t.push(s);else if(s=this.tokenizer.link(e))e=e.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,i)),t.push(s);else if(s=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,i)),t.push(s);else if(s=this.tokenizer.strong(e,a,n))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],r,i),t.push(s);else if(s=this.tokenizer.em(e,a,n))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],r,i),t.push(s);else if(s=this.tokenizer.codespan(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.br(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.del(e))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],r,i),t.push(s);else if(s=this.tokenizer.autolink(e,q))e=e.substring(s.raw.length),t.push(s);else if(r||!(s=this.tokenizer.url(e,q))){if(s=this.tokenizer.inlineText(e,i,V))e=e.substring(s.raw.length),n=s.raw.slice(-1),t.push(s);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(s.raw.length),t.push(s);return t},r=t,n=[{key:"rules",get:function(){return{block:z,inline:G}}}],(i=null)&&e(r.prototype,i),n&&e(r,n),t}(),Y=i.defaults,Z=E,$=S,J=function(){function e(e){this.options=e||Y}var t=e.prototype;return t.code=function(e,t,r){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var n=this.options.highlight(e,i);null!=n&&n!==e&&(r=!0,e=n)}return i?'<pre><code class="'+this.options.langPrefix+$(i,!0)+'">'+(r?e:$(e,!0))+"</code></pre>\n":"<pre><code>"+(r?e:$(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,r,i){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+i.slug(r)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,r){var i=t?"ol":"ul";return"<"+i+(t&&1!==r?' start="'+r+'"':"")+">\n"+e+"</"+i+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var r=t.header?"th":"td";return(t.align?"<"+r+' align="'+t.align+'">':"<"+r+">")+e+"</"+r+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,r){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return r;var i='<a href="'+$(e)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+r+"</a>"},t.image=function(e,t,r){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return r;var i='<img src="'+e+'" alt="'+r+'"';return t&&(i+=' title="'+t+'"'),i+=this.options.xhtml?"/>":">"},t.text=function(e){return e},e}(),ee=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,r){return""+r},t.image=function(e,t,r){return""+r},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var r=t;do{this.seen[r]++,t=r+"-"+this.seen[r]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),re=i.defaults,ie=w,ne=function(){function e(e){this.options=e||re,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,r){return new e(r).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var r,i,n,s,o,a,l,c,u,h,d,f,p,g,v,m,_,y,b="",S=e.length;for(r=0;r<S;r++)switch((h=e[r]).type){case"space":continue;case"hr":b+=this.renderer.hr();continue;case"heading":b+=this.renderer.heading(this.parseInline(h.tokens),h.depth,ie(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":b+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(c="",l="",s=h.header.length,i=0;i<s;i++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[i]),{header:!0,align:h.align[i]});for(c+=this.renderer.tablerow(l),u="",s=h.cells.length,i=0;i<s;i++){for(l="",o=(a=h.tokens.cells[i]).length,n=0;n<o;n++)l+=this.renderer.tablecell(this.parseInline(a[n]),{header:!1,align:h.align[n]});u+=this.renderer.tablerow(l)}b+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(h.tokens),b+=this.renderer.blockquote(u);continue;case"list":for(d=h.ordered,f=h.start,p=h.loose,s=h.items.length,u="",i=0;i<s;i++)m=(v=h.items[i]).checked,_=v.task,g="",v.task&&(y=this.renderer.checkbox(m),p?v.tokens.length>0&&"text"===v.tokens[0].type?(v.tokens[0].text=y+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&"text"===v.tokens[0].tokens[0].type&&(v.tokens[0].tokens[0].text=y+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:y}):g+=y),g+=this.parse(v.tokens,p),u+=this.renderer.listitem(g,_,m);b+=this.renderer.list(u,d,f);continue;case"html":b+=this.renderer.html(h.text);continue;case"paragraph":b+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;r+1<S&&"text"===e[r+1].type;)u+="\n"+((h=e[++r]).tokens?this.parseInline(h.tokens):h.text);b+=t?this.renderer.paragraph(u):u;continue;default:var w='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(w);throw new Error(w)}return b},t.parseInline=function(e,t){t=t||this.renderer;var r,i,n="",s=e.length;for(r=0;r<s;r++)switch((i=e[r]).type){case"escape":n+=t.text(i.text);break;case"html":n+=t.html(i.text);break;case"link":n+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":n+=t.image(i.href,i.title,i.text);break;case"strong":n+=t.strong(this.parseInline(i.tokens,t));break;case"em":n+=t.em(this.parseInline(i.tokens,t));break;case"codespan":n+=t.codespan(i.text);break;case"br":n+=t.br();break;case"del":n+=t.del(this.parseInline(i.tokens,t));break;case"text":n+=t.text(i.text);break;default:var o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(o);throw new Error(o)}return n},e}(),se=x,oe=D,ae=S,le=i.getDefaults,ce=i.changeDefaults,ue=i.defaults;function he(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(r=t,t=null),t=se({},he.defaults,t||{}),oe(t),r){var i,n=t.highlight;try{i=Q.lex(e,t)}catch(e){return r(e)}var s=function(e){var s;if(!e)try{s=ne.parse(i,t)}catch(t){e=t}return t.highlight=n,e?r(e):r(null,s)};if(!n||n.length<3)return s();if(delete t.highlight,!i.length)return s();var o=0;return he.walkTokens(i,(function(e){"code"===e.type&&(o++,setTimeout((function(){n(e.text,e.lang,(function(t,r){if(t)return s(t);null!=r&&r!==e.text&&(e.text=r,e.escaped=!0),0==--o&&s()}))}),0))})),void(0===o&&s())}try{var a=Q.lex(e,t);return t.walkTokens&&he.walkTokens(a,t.walkTokens),ne.parse(a,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+ae(e.message+"",!0)+"</pre>";throw e}}return he.options=he.setOptions=function(e){return se(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=se({},e);if(e.renderer&&function(){var r=he.defaults.renderer||new J,i=function(t){var i=r[t];r[t]=function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];var a=e.renderer[t].apply(r,s);return!1===a&&(a=i.apply(r,s)),a}};for(var n in e.renderer)i(n);t.renderer=r}(),e.tokenizer&&function(){var r=he.defaults.tokenizer||new N,i=function(t){var i=r[t];r[t]=function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];var a=e.tokenizer[t].apply(r,s);return!1===a&&(a=i.apply(r,s)),a}};for(var n in e.tokenizer)i(n);t.tokenizer=r}(),e.walkTokens){var r=he.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),r&&r(t)}}he.setOptions(t)},he.walkTokens=function(e,t){for(var i,n=r(e);!(i=n()).done;){var s=i.value;switch(t(s),s.type){case"table":for(var o,a=r(s.tokens.header);!(o=a()).done;){var l=o.value;he.walkTokens(l,t)}for(var c,u=r(s.tokens.cells);!(c=u()).done;)for(var h,d=r(c.value);!(h=d()).done;){var f=h.value;he.walkTokens(f,t)}break;case"list":he.walkTokens(s.items,t);break;default:s.tokens&&he.walkTokens(s.tokens,t)}}},he.Parser=ne,he.parser=ne.parse,he.Renderer=J,he.TextRenderer=ee,he.Lexer=Q,he.lexer=Q.lex,he.Tokenizer=N,he.Slugger=te,he.parse=he,he}()},Dqnf:
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/pages/tasks/xterm-panel/index.jsx ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";var i=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),n=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper */"rAM+"),o=r(/*! react */"q1tI"),a=r.n(o),l=r(/*! js-base64 */"J66h"),c=r(/*! xterm */"/POA"),u=(r(/*! xterm/css/xterm.css */"q7KB"),r(/*! ./index.less?modules */"ER/M")),h=r.n(u),d=r(/*! @/components/mediator */"dhSg"),f=r(/*! resize-observer-polyfill */"bdgK");function p(e,t,r){var i=r._core._renderService.dimensions.actualCellWidth||9.5,n=r._core._renderService.dimensions.actualCellHeight||18,s=Math.floor(t/n);return[Math.floor(e/i),s]}t.a=function(e){var t=e.sshConfigData,r=e.sid,u=Object(o.useState)(null),g=Object(n.a)(u,2),v=g[0],m=g[1],_=t.ws_url,y=t.password,b=t.port,S=Object(o.useRef)(),w=Object(o.useRef)(),C=Object(o.useRef)(!1);return Object(o.useEffect)((function(){if(S.current&&_){var e=new c.Terminal({fontSize:16,rendererType:"dom"});e.open(S.current),e.onData((function(e){w.current&&1===w.current.readyState&&(w.current.send(JSON.stringify({tp:"client",data:e})),d.a.publish("on-operating-ssh"))})),e.write("Connecting..."),m(e);var t=function(e,t){var r=new f.default((function(t){var r,i=Object(s.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.target.offsetHeight>0||o.target.offsetWidth>0){var a=p(o.target.offsetWidth,o.target.offsetHeight,e),c=Object(n.a)(a,2),u=c[0],h=c[1];console.log("cols, rows",u,h),d.a.publish("ssh-xterm-resize",{columns:u,rows:h,width:o.target.offsetWidth,height:o.target.offsetHeight}),e.resize(u,h);var f=l.Base64.decode("IA=="),g=l.Base64.decode("CBtbSw==");e.write(f),e.write(g)}}}catch(e){i.e(e)}finally{i.f()}}));return r.observe(t),r}(e,S.current);return function(){e.dispose(),t.unobserve(S.current)}}}),[_,S.current]),Object(o.useEffect)((function(){if(v&&_){var e=setInterval((function(){w.current&&w.current.send(JSON.stringify({tp:"h"}))}),3e4),n=d.a.subscribe("create-socket",(function(n){var s;r==n&&(w.current&&1===w.current.readyState?v.focus():(s=new WebSocket(_),w.current=s,s.onopen=function(){var e=v.element.parentElement;if(e){var r=e.offsetWidth,n=e.offsetHeight;console.log("init",{tp:"init",data:Object(i.a)(Object(i.a)({},t),{},{secret:y,width:r,height:n,rows:v.rows,columns:v.cols})}),s.send(JSON.stringify({tp:"init",data:Object(i.a)(Object(i.a)({},t),{},{secret:y,width:r,height:n,rows:v.rows,columns:v.cols})}))}v.focus()},s.onerror=function(e){console.log("------in socket error----",e,s,_)},s.onmessage=function(e){C.current||(v.write("\r"),setTimeout((function(){}),1e3)),C.current=!0,console.log("event:",e);var t=l.Base64.decode(e.data.toString()),r=v._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",t,r,v),v.write(t)},s.onclose=function(t){e&&clearInterval(e),v.write("\r\nconnection closed")}),v.focus())})),s=d.a.subscribe("close-socket",(function(e){r===e&&(w.current&&(w.current.close(),C.current=!1,v.clear()),w.current=null)})),o=d.a.subscribe("ssh-xterm-resize",(function(e){w.current&&1===w.current.readyState&&w.current.send(JSON.stringify({tp:"resize",data:Object(i.a)({},e)}))})),a=d.a.subscribe("ssh-add-connect-time",(function(){w.current&&1===w.current.readyState&&w.current.send(JSON.stringify({tp:"overtime"}))}));return function(){s(),n(),o(),a(),w.current&&(w.current.close(),C.current=!1)}}}),[v,_,b]),a.a.createElement("div",{ref:S,className:h.a["xterm-panel"]},_?null:a.a.createElement("p",{style:{color:"#fff"}},"正在连接命令行服务..."))}},ELLl:
|
|
|
/*!*************************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/edit/closebrackets.js ***!
|
|
|
\*************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},r=e.Pos;function i(e,r){return"pairs"==r&&"string"==typeof e?e:"object"==typeof e&&null!=e[r]?e[r]:t[r]}e.defineOption("autoCloseBrackets",!1,(function(t,r,o){o&&o!=e.Init&&(t.removeKeyMap(n),t.state.closeBrackets=null),r&&(s(i(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(n))}));var n={Backspace:function(t){var n=a(t);if(!n||t.getOption("disableInput"))return e.Pass;for(var s=i(n,"pairs"),o=t.listSelections(),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var u=l(t,o[c].head);if(!u||s.indexOf(u)%2!=0)return e.Pass}for(c=o.length-1;c>=0;c--){var h=o[c].head;t.replaceRange("",r(h.line,h.ch-1),r(h.line,h.ch+1),"+delete")}},Enter:function(t){var r=a(t),n=r&&i(r,"explode");if(!n||t.getOption("disableInput"))return e.Pass;for(var s=t.listSelections(),o=0;o<s.length;o++){if(!s[o].empty())return e.Pass;var c=l(t,s[o].head);if(!c||n.indexOf(c)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),s=t.listSelections();for(var r=0;r<s.length;r++){var i=s[r].head.line;t.indentLine(i,null,!0),t.indentLine(i+1,null,!0)}}))}};function s(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),i="'"+r+"'";n[i]||(n[i]=o(r))}}function o(t){return function(n){return function(t,n){var s=a(t);if(!s||t.getOption("disableInput"))return e.Pass;var o=i(s,"pairs"),l=o.indexOf(n);if(-1==l)return e.Pass;for(var u,h=i(s,"closeBefore"),d=i(s,"triples"),f=o.charAt(l+1)==n,p=t.listSelections(),g=l%2==0,v=0;v<p.length;v++){var m,_=p[v],y=_.head,b=t.getRange(y,r(y.line,y.ch+1));if(g&&!_.empty())m="surround";else if(!f&&g||b!=n)if(f&&y.ch>1&&d.indexOf(n)>=0&&t.getRange(r(y.line,y.ch-2),y)==n+n){if(y.ch>2&&/\bstring/.test(t.getTokenTypeAt(r(y.line,y.ch-2))))return e.Pass;m="addFour"}else if(f){var S=0==y.ch?" ":t.getRange(r(y.line,y.ch-1),y);if(e.isWordChar(b)||S==n||e.isWordChar(S))return e.Pass;m="both"}else{if(!g||!(0===b.length||/\s/.test(b)||h.indexOf(b)>-1))return e.Pass;m="both"}else m=f&&c(t,y)?"both":d.indexOf(n)>=0&&t.getRange(y,r(y.line,y.ch+3))==n+n+n?"skipThree":"skip";if(u){if(u!=m)return e.Pass}else u=m}var w=l%2?o.charAt(l-1):n,C=l%2?n:o.charAt(l+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var i=0;i<3;i++)t.execCommand("goCharRight");else if("surround"==u){var n=t.getSelections();for(i=0;i<n.length;i++)n[i]=w+n[i]+C;for(t.replaceSelections(n,"around"),n=t.listSelections().slice(),i=0;i<n.length;i++)n[i]=(s=n[i],o=void 0,o=e.cmpPos(s.anchor,s.head)>0,{anchor:new r(s.anchor.line,s.anchor.ch+(o?-1:1)),head:new r(s.head.line,s.head.ch+(o?1:-1))});t.setSelections(n)}else"both"==u?(t.replaceSelection(w+C,null),t.triggerElectric(w+C),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(w+w+w+w,"before"),t.execCommand("goCharRight"));var s,o}))}(n,t)}}function a(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var i=e.getRange(r(t.line,t.ch-1),r(t.line,t.ch+1));return 2==i.length?i:null}function c(e,t){var i=e.getTokenAt(r(t.line,t.ch+1));return/\bstring/.test(i.type)&&i.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}s(t.pairs+"`")}(r(/*! ../../lib/codemirror */"VrN/"))},"ER/M":
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./src/pages/tasks/xterm-panel/index.less?modules ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){e.exports={"xterm-panel":"xterm-panel___2r2xx"}},Fv0C:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/keyboard.js ***!
|
|
|
\*********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s=h(r(/*! ../util/logging.js */"Lo0S")),o=r(/*! ../util/events.js */"vewr"),a=h(r(/*! ./util.js */"8CQX")),l=(n=r(/*! ./keysym.js */"mHUz"))&&n.__esModule?n:{default:n},c=h(r(/*! ../util/browser.js */"GdRQ"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}function d(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),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(){}}var t,r,i;return t=e,(r=[{key:"_sendKeyEvent",value:function(e,t,r){if(r)this._keyDownList[t]=e;else{if(!(t in this._keyDownList))return;delete this._keyDownList[t]}s.Debug("onkeyevent "+(r?"down":"up")+", keysym: "+e,", code: "+t),this.onkeyevent(e,t,r)}},{key:"_getKeyCode",value:function(e){var t=a.getKeycode(e);if("Unidentified"!==t)return t;if(e.keyCode&&"keypress"!==e.type&&229!==e.keyCode)return"Platform"+e.keyCode;if(e.keyIdentifier){if("U+"!==e.keyIdentifier.substr(0,2))return e.keyIdentifier;var r=parseInt(e.keyIdentifier.substr(2),16);return"Platform"+String.fromCharCode(r).toUpperCase().charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(e){var t=this._getKeyCode(e),r=a.getKeysym(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===t&&e.timeStamp-this._altGrCtrlTime<50?r=l.default.XK_ISO_Level3_Shift:this._sendKeyEvent(l.default.XK_Control_L,"ControlLeft",!0)),"Unidentified"===t)return r&&(this._sendKeyEvent(r,t,!0),this._sendKeyEvent(r,t,!1)),void(0,o.stopEvent)(e);if(c.isMac()||c.isIOS())switch(r){case l.default.XK_Super_L:r=l.default.XK_Alt_L;break;case l.default.XK_Super_R:r=l.default.XK_Super_L;break;case l.default.XK_Alt_L:r=l.default.XK_Mode_switch;break;case l.default.XK_Alt_R:r=l.default.XK_ISO_Level3_Shift}return t in this._keyDownList&&(r=this._keyDownList[t]),(c.isMac()||c.isIOS())&&"CapsLock"===t?(this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!1),void(0,o.stopEvent)(e)):r||e.key&&!c.isIE()&&!c.isEdge()?(this._pendingKey=null,(0,o.stopEvent)(e),"ControlLeft"===t&&c.isWindows()&&!("ControlLeft"in this._keyDownList)?(this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),void(this._altGrCtrlTime=e.timeStamp)):void this._sendKeyEvent(r,t,!0)):(this._pendingKey=t,void setTimeout(this._handleKeyPressTimeout.bind(this),10,e))}},{key:"_handleKeyPress",value:function(e){if((0,o.stopEvent)(e),null!==this._pendingKey){var t=this._getKeyCode(e),r=a.getKeysym(e);"Unidentified"!==t&&t!=this._pendingKey||(t=this._pendingKey,this._pendingKey=null,r?this._sendKeyEvent(r,t,!0):s.Info("keypress with no keysym:",e))}}},{key:"_handleKeyPressTimeout",value:function(e){if(null!==this._pendingKey){var t,r=this._pendingKey;if(this._pendingKey=null,e.keyCode>=48&&e.keyCode<=57)t=e.keyCode;else if(e.keyCode>=65&&e.keyCode<=90){var i=String.fromCharCode(e.keyCode);t=(i=e.shiftKey?i.toUpperCase():i.toLowerCase()).charCodeAt()}else t=0;this._sendKeyEvent(t,r,!0)}}},{key:"_handleKeyUp",value:function(e){(0,o.stopEvent)(e);var t=this._getKeyCode(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(l.default.XK_Control_L,"ControlLeft",!0)),(c.isMac()||c.isIOS())&&"CapsLock"===t)return this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!0),void this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!1);this._sendKeyEvent(this._keyDownList[t],t,!1),!c.isWindows()||"ShiftLeft"!==t&&"ShiftRight"!==t||("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(l.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){for(var e in s.Debug(">> Keyboard.allKeysUp"),this._keyDownList)this._sendKeyEvent(this._keyDownList[e],e,!1);s.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(e){if(!e.skipCheckAlt&&!e.altKey){var t=this._target,r=this._keyDownList;["AltLeft","AltRight"].forEach((function(e){if(e in r){var i=new KeyboardEvent("keyup",{key:r[e],code:e});i.skipCheckAlt=!0,t.dispatchEvent(i)}}))}}},{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),c.isWindows()&&c.isFirefox()){var e=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((function(t){return document.addEventListener(t,e,{capture:!0,passive:!0})}))}}},{key:"ungrab",value:function(){if(c.isWindows()&&c.isFirefox()){var e=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((function(t){return document.removeEventListener(t,e)}))}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()}}])&&d(t.prototype,r),i&&d(t,i),e}();t.default=f},GQ8N:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/int.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUnsigned32bit=function(e){return e>>>0},t.toSigned32bit=function(e){return 0|e}},GdRQ:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/browser.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isMac=function(){return navigator&&!!/mac/i.exec(navigator.platform)},t.isWindows=function(){return navigator&&!!/win/i.exec(navigator.platform)},t.isIOS=function(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))},t.isSafari=function(){return navigator&&-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")},t.isIE=function(){return navigator&&!!/trident/i.exec(navigator.userAgent)},t.isEdge=function(){return navigator&&!!/edge/i.exec(navigator.userAgent)},t.isFirefox=function(){return navigator&&!!/firefox/i.exec(navigator.userAgent)},t.hasScrollbarGutter=t.supportsImageMetadata=t.supportsCursorURIs=t.dragThreshold=t.isTouchDevice=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(/*! ./logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var o="ontouchstart"in document.documentElement||void 0!==document.ontouchstart||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;t.isTouchDevice=o,window.addEventListener("touchstart",(function e(){t.isTouchDevice=o=!0,window.removeEventListener("touchstart",e,!1)}),!1);var a=10*(window.devicePixelRatio||1);t.dragThreshold=a;var l=!1;try{var c=document.createElement("canvas");c.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',0===c.style.cursor.indexOf("url")?(n.Info("Data URI scheme cursor supported"),l=!0):n.Warn("Data URI scheme cursor not supported")}catch(e){n.Error("Data URI scheme cursor test exception: "+e)}var u=l;t.supportsCursorURIs=u;var h=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),h=!0}catch(e){}var d=h;t.supportsImageMetadata=d;var f=!0;try{var p=document.createElement("div");p.style.visibility="hidden",p.style.overflow="scroll",document.body.appendChild(p);var g=document.createElement("div");p.appendChild(g);var v=p.offsetWidth-g.offsetWidth;p.parentNode.removeChild(p),f=0!=v}catch(e){n.Error("Scrollbar test exception: "+e)}var m=f;t.hasScrollbarGutter=m},Gytx:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/shallowequal/index.js ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e,t,r,i){var n=r?r.call(i,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var c=s[l];if(!a(c))return!1;var u=e[c],h=t[c];if(!1===(n=r?r.call(i,u,h,c):void 0)||void 0===n&&u!==h)return!1}return!0}},HmJG:
|
|
|
/*!****************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/upload-image/index.less ***!
|
|
|
\****************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},ItS6:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/inflator.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=r(/*! ../lib/vendor/pako/lib/zlib/inflate.js */"eP3c"),s=(i=r(/*! ../lib/vendor/pako/lib/zlib/zstream.js */"1q3G"))&&i.__esModule?i:{default:i};function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strm=new s.default,this.chunkSize=102400,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,n.inflateInit)(this.strm,this.windowBits)}var t,r,i;return t=e,(r=[{key:"setInput",value:function(e){e?(this.strm.input=e,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(e){if(e>this.chunkSize&&(this.chunkSize=e,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=e,(0,n.inflate)(this.strm,0)<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=e)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,n.inflateReset)(this.strm)}}])&&o(t.prototype,r),i&&o(t,i),e}();t.default=a},IxHN:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/components/Spinner/index.tsx ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";var i=r(/*! react */"q1tI"),n=r.n(i),s=r(/*! ./index.less?modules */"07cG"),o=r.n(s);t.a=function(e){var t=e.message,r=e.className,i=e.children,s=e.style,a=void 0===s?{}:s;return n.a.createElement("div",{className:"".concat(o.a.idsRingWrapper," ").concat(r)},n.a.createElement("div",{className:o.a.ldsRing},n.a.createElement("div",null),n.a.createElement("div",null),n.a.createElement("div",null),n.a.createElement("div",null)),t?n.a.createElement("p",{style:a},t):null,i)}},J66h:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/js-base64/base64.js ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: Base64 */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){(function(r){var i;!function(r,n){e.exports=function(r){"use strict";var n,s=(r=r||{}).Base64,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},r=0,i=e.length;r<i;r++)t[e.charAt(r)]=r;return t}(o),l=String.fromCharCode,c=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?l(192|t>>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(e){return e.replace(u,c)},d=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[o.charAt(r>>>18),o.charAt(r>>>12&63),t>=2?"=":o.charAt(r>>>6&63),t>=1?"=":o.charAt(63&r)].join("")},f=r.btoa&&"function"==typeof r.btoa?function(e){return r.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,d)},p=function(e){return f(h(String(e)))},g=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},v=function(e,t){return t?g(p(e)):p(e)};r.Uint8Array&&(n=function(e,t){for(var r="",i=0,n=e.length;i<n;i+=3){var s=e[i],a=e[i+1],l=e[i+2],c=s<<16|a<<8|l;r+=o.charAt(c>>>18)+o.charAt(c>>>12&63)+(void 0!==a?o.charAt(c>>>6&63):"=")+(void 0!==l?o.charAt(63&c):"=")}return t?g(r):r});var m,_=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,y=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return l(55296+(t>>>10))+l(56320+(1023&t));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},b=function(e){return e.replace(_,y)},S=function(e){var t=e.length,r=t%4,i=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),n=[l(i>>>16),l(i>>>8&255),l(255&i)];return n.length-=[0,0,2,1][r],n.join("")},w=r.atob&&"function"==typeof r.atob?function(e){return r.atob(e)}:function(e){return e.replace(/\S{1,4}/g,S)},C=function(e){return w(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},E=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},k=function(e){return function(e){return b(w(e))}(E(e))};r.Uint8Array&&(m=function(e){return Uint8Array.from(C(E(e)),(function(e){return e.charCodeAt(0)}))});var x=function(){var e=r.Base64;return r.Base64=s,e};if(r.Base64={VERSION:"2.6.4",atob:C,btoa:f,fromBase64:k,toBase64:v,utob:h,encode:v,encodeURI:function(e){return v(e,!0)},btou:b,decode:k,noConflict:x,fromUint8Array:n,toUint8Array:m},"function"==typeof Object.defineProperty){var T=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};r.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",T((function(){return k(this)}))),Object.defineProperty(String.prototype,"toBase64",T((function(e){return v(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",T((function(){return v(this,!0)})))}}r.Meteor&&(Base64=r.Base64);e.exports?e.exports.Base64=r.Base64:void 0===(i=function(){return r.Base64}.apply(t,[]))||(e.exports=i);return{Base64:r.Base64}}(r)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:this)}).call(this,r(/*! ./../@umijs/deps/compiled/webpack/4/global.js */"IyRk"))},JSwD:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inftrees.js ***!
|
|
|
\************************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,i,s,u,h,d){var f,p,g,v,m,_,y,b,S,w=d.bits,C=0,E=0,k=0,x=0,T=0,L=0,A=0,D=0,O=0,R=0,M=null,I=0,F=new n.Buf16(16),P=new n.Buf16(16),N=null,B=0;for(C=0;C<=15;C++)F[C]=0;for(E=0;E<i;E++)F[t[r+E]]++;for(T=w,x=15;x>=1&&0===F[x];x--);T>x&&(T=x);if(0===x)return s[u++]=20971520,s[u++]=20971520,d.bits=1,0;for(k=1;k<x&&0===F[k];k++);T<k&&(T=k);for(D=1,C=1;C<=15;C++)if(D<<=1,(D-=F[C])<0)return-1;if(D>0&&(0===e||1!==x))return-1;for(P[1]=0,C=1;C<15;C++)P[C+1]=P[C]+F[C];for(E=0;E<i;E++)0!==t[r+E]&&(h[P[t[r+E]]++]=E);0===e?(M=N=h,_=19):1===e?(M=o,I-=257,N=a,B-=257,_=256):(M=l,N=c,_=-1);if(R=0,E=0,C=k,m=u,L=T,A=0,g=-1,v=(O=1<<T)-1,1===e&&O>852||2===e&&O>592)return 1;for(;;){y=C-A,h[E]<_?(b=0,S=h[E]):h[E]>_?(b=N[B+h[E]],S=M[I+h[E]]):(b=96,S=0),f=1<<C-A,k=p=1<<L;do{s[m+(R>>A)+(p-=f)]=y<<24|b<<16|S|0}while(0!==p);for(f=1<<C-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,E++,0==--F[C]){if(C===x)break;C=t[r+h[E]]}if(C>T&&(R&v)!==g){for(0===A&&(A=T),m+=k,D=1<<(L=C-A);L+A<x&&!((D-=F[L+A])<=0);)L++,D<<=1;if(O+=1<<L,1===e&&O>852||2===e&&O>592)return 1;s[g=R&v]=T<<24|L<<16|m-u|0}}0!==R&&(s[m+R]=C-A<<24|64<<16|0);return d.bits=T,0};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(/*! ../utils/common.js */"6BzB"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var 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],a=[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],l=[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],c=[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]},LCi9:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/gesturehandler.js ***!
|
|
|
\***************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=null,this._state=127,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}var t,r,n;return t=e,(r=[{key:"attach",value:function(e){this.detach(),this._target=e,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(){this._target&&(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(e){var t;switch(e.stopPropagation(),e.preventDefault(),e.type){case"touchstart":t=this._touchStart;break;case"touchmove":t=this._touchMove;break;case"touchend":case"touchcancel":t=this._touchEnd}for(var r=0;r<e.changedTouches.length;r++){var i=e.changedTouches[r];t.call(this,i.identifier,i.clientX,i.clientY)}}},{key:"_touchStart",value:function(e,t,r){if(this._hasDetectedGesture()||0===this._state)this._ignored.push(e);else{if(this._tracked.length>0&&Date.now()-this._tracked[0].started>250)return this._state=0,void this._ignored.push(e);if(this._waitingRelease)return this._state=0,void this._ignored.push(e);switch(this._tracked.push({id:e,started:Date.now(),active:!0,firstX:t,firstY:r,lastX:t,lastY:r,angle:0}),this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=-26,this._stopLongpressTimeout();break;case 3:this._state&=-99;break;default:this._state=0}}}},{key:"_touchMove",value:function(e,t,r){var i=this._tracked.find((function(t){return t.id===e}));if(void 0!==i){i.lastX=t,i.lastY=r;var n=t-i.firstX,s=r-i.firstY;if(i.firstX===i.lastX&&i.firstY===i.lastY||(i.angle=180*Math.atan2(s,n)/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(n,s)<50)return;if(this._state&=-24,this._stopLongpressTimeout(),1!==this._tracked.length&&(this._state&=-9),2!==this._tracked.length&&(this._state&=-97),2===this._tracked.length){var o=this._tracked.find((function(t){return t.id!==e}));if(Math.hypot(o.firstX-o.lastX,o.firstY-o.lastY)>50){var a=Math.abs(i.angle-o.angle);a=Math.abs((a+180)%360-180),this._state&=a>90?-33:-65,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}}},{key:"_touchEnd",value:function(e,t,r){if(-1!==this._ignored.indexOf(e))return this._ignored.splice(this._ignored.indexOf(e),1),void(0===this._ignored.length&&0===this._tracked.length&&(this._state=127,this._waitingRelease=!1));if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=0),!this._hasDetectedGesture()&&(this._state&=-105,this._state&=-17,this._stopLongpressTimeout(),!this._waitingRelease))switch(this._releaseStart=Date.now(),this._waitingRelease=!0,this._tracked.length){case 1:this._state&=-7;break;case 2:this._state&=-6}if(this._waitingRelease)if(Date.now()-this._releaseStart>250&&(this._state=0),this._tracked.some((function(e){return Date.now()-e.started>1e3}))&&(this._state=0),this._tracked.find((function(t){return t.id===e})).active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(0!==this._state)return;this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var i=0;i<this._tracked.length;i++)this._tracked[i].active&&this._ignored.push(this._tracked[i].id);this._tracked=[],this._state=0,-1!==this._ignored.indexOf(e)&&this._ignored.splice(this._ignored.indexOf(e),1),0===this._ignored.length&&(this._state=127,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return!(0===this._state||this._state&this._state-1||7&this._state&&this._tracked.some((function(e){return e.active})))}},{key:"_startLongpressTimeout",value:function(){var e=this;this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout((function(){return e._longpressTimeout()}),1e3)}},{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=16,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var e=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout((function(){return e._twoTouchTimeout()}),50)}},{key:"_stopTwoTouchTimeout",value:function(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}},{key:"_isTwoTouchTimeoutRunning",value:function(){return null!==this._twoTouchTimeoutId}},{key:"_twoTouchTimeout",value:function(){if(0===this._tracked.length)throw new Error("A pinch or two drag gesture failed, no tracked touches");var e=this._getAverageMovement(),t=Math.abs(e.x),r=Math.abs(e.y),i=this._getAverageDistance(),n=Math.abs(Math.hypot(i.first.x,i.first.y)-Math.hypot(i.last.x,i.last.y));this._state=r<n&&t<n?64:32,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(e){var t={type:this._stateToGesture(this._state)},r=this._getPosition(),i=r.last;switch("gesturestart"===e&&(i=r.first),this._state){case 32:case 64:i=r.first}if(t.clientX=i.x,t.clientY=i.y,64===this._state){var n=this._getAverageDistance();"gesturestart"===e?(t.magnitudeX=n.first.x,t.magnitudeY=n.first.y):(t.magnitudeX=n.last.x,t.magnitudeY=n.last.y)}else if(32===this._state)if("gesturestart"===e)t.magnitudeX=0,t.magnitudeY=0;else{var s=this._getAverageMovement();t.magnitudeX=s.x,t.magnitudeY=s.y}var o=new CustomEvent(e,{detail:t});this._target.dispatchEvent(o)}},{key:"_stateToGesture",value:function(e){switch(e){case 1:return"onetap";case 2:return"twotap";case 4:return"threetap";case 8:return"drag";case 16:return"longpress";case 32:return"twodrag";case 64:return"pinch"}throw new Error("Unknown gesture state: "+e)}},{key:"_getPosition",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture position, no tracked touches");for(var e=this._tracked.length,t=0,r=0,i=0,n=0,s=0;s<this._tracked.length;s++)t+=this._tracked[s].firstX,r+=this._tracked[s].firstY,i+=this._tracked[s].lastX,n+=this._tracked[s].lastY;return{first:{x:t/e,y:r/e},last:{x:i/e,y:n/e}}}},{key:"_getAverageMovement",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture movement, no tracked touches");var e,t;e=t=0;for(var r=this._tracked.length,i=0;i<this._tracked.length;i++)e+=this._tracked[i].lastX-this._tracked[i].firstX,t+=this._tracked[i].lastY-this._tracked[i].firstY;return{x:e/r,y:t/r}}},{key:"_getAverageDistance",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture distance, no tracked touches");var e=this._tracked[0],t=this._tracked[this._tracked.length-1];return{first:{x:Math.abs(t.firstX-e.firstX),y:Math.abs(t.firstY-e.firstY)},last:{x:Math.abs(t.lastX-e.lastX),y:Math.abs(t.lastY-e.lastY)}}}}])&&i(t.prototype,r),n&&i(t,n),e}();t.default=n},LdHM:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/rc-select/es/index.js + 6 modules ***!
|
|
|
\********************************************************/
|
|
|
/*! exports provided: Option, OptGroup, default */
|
|
|
/*! exports used: OptGroup, Option, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/TransBtn.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/generate.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/commonUtil.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/valueUtil.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMemo.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/pickAttrs.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-virtual-list/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,r){"use strict";r.d(t,"b",(function(){return S})),r.d(t,"a",(function(){return C}));var i=r("1OyB"),n=r("vuIU"),s=r("Ji7U"),o=r("LK+K"),a=r("q1tI"),l=r("rePB"),c=r("Ff2n"),u=r("ODXe"),h=r("4IlW"),d=r("bX4T"),f=r("YrtM"),p=r("TSYQ"),g=r.n(p),v=r("+nKL"),m=r("8OUc"),_=a.forwardRef((function(e,t){var r=e.prefixCls,i=e.id,n=e.flattenOptions,s=e.childrenAsData,o=e.values,p=e.searchValue,_=e.multiple,y=e.defaultActiveFirstOption,b=e.height,S=e.itemHeight,w=e.notFoundContent,C=e.open,E=e.menuItemSelectedIcon,k=e.virtual,x=e.onSelect,T=e.onToggleOpen,L=e.onActiveValue,A=e.onScroll,D=e.onMouseEnter,O="".concat(r,"-item"),R=Object(f.a)((function(){return n}),[C,n],(function(e,t){return t[0]&&e[1]!==t[1]})),M=a.useRef(null),I=function(e){e.preventDefault()},F=function(e){M.current&&M.current.scrollTo({index:e})},P=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=R.length,i=0;i<r;i+=1){var n=(e+i*t+r)%r,s=R[n],o=s.group,a=s.data;if(!o&&!a.disabled)return n}return-1},N=a.useState((function(){return P(0)})),B=Object(u.a)(N,2),K=B[0],j=B[1],U=function(e){j(e);var t=R[e];t?L(t.data.value,e):L(null,-1)};a.useEffect((function(){U(!1!==y?P(0):-1)}),[R.length,p]),a.useEffect((function(){var e=setTimeout((function(){if(!_&&C&&1===o.size){var e=Array.from(o)[0],t=R.findIndex((function(t){return t.data.value===e}));U(t),F(t)}}));return function(){return clearTimeout(e)}}),[C]);var H=function(e){void 0!==e&&x(e,{selected:!o.has(e)}),_||T(!1)};if(a.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which;switch(t){case h.a.UP:case h.a.DOWN:var r=0;if(t===h.a.UP?r=-1:t===h.a.DOWN&&(r=1),0!==r){var i=P(K+r,r);F(i),U(i)}break;case h.a.ENTER:var n=R[K];n&&!n.data.disabled?H(n.data.value):H(void 0),C&&e.preventDefault();break;case h.a.ESC:T(!1)}},onKeyUp:function(){},scrollTo:function(e){F(e)}}})),0===R.length)return a.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(O,"-empty"),onMouseDown:I},w);function X(e){var t=R[e];if(!t)return null;var r=t.data||{},n=r.value,l=r.label,c=r.children,u=Object(d.a)(r,!0),h=s?c:l;return t?a.createElement("div",Object.assign({"aria-label":"string"==typeof h?h:null},u,{key:e,role:"option",id:"".concat(i,"_list_").concat(e),"aria-selected":o.has(n)}),n):null}return a.createElement(a.Fragment,null,a.createElement("div",{role:"listbox",id:"".concat(i,"_list"),style:{height:0,width:0,overflow:"hidden"}},X(K-1),X(K),X(K+1)),a.createElement(v.a,{itemKey:"key",ref:M,data:R,height:b,itemHeight:S,fullHeight:!1,onMouseDown:I,onScroll:A,virtual:k,onMouseEnter:D},(function(e,t){var r,i=e.group,n=e.groupOption,u=e.data,h=u.label,d=u.key;if(i)return a.createElement("div",{className:g()(O,"".concat(O,"-group"))},void 0!==h?h:d);var f=u.disabled,p=u.value,v=u.title,_=u.children,y=u.style,b=u.className,S=Object(c.a)(u,["disabled","value","title","children","style","className"]),w=o.has(p),C="".concat(O,"-option"),k=g()(O,C,b,(r={},Object(l.a)(r,"".concat(C,"-grouped"),n),Object(l.a)(r,"".concat(C,"-active"),K===t&&!f),Object(l.a)(r,"".concat(C,"-disabled"),f),Object(l.a)(r,"".concat(C,"-selected"),w),r)),x=s?_:h,T=!E||"function"==typeof E||w;return a.createElement("div",Object.assign({},S,{"aria-selected":w,className:k,title:v,onMouseMove:function(){K===t||f||U(t)},onClick:function(){f||H(p)},style:y}),a.createElement("div",{className:"".concat(C,"-content")},x||p),a.isValidElement(E)||w,T&&a.createElement(m.a,{className:"".concat(O,"-option-state"),customizeIcon:E,customizeIconProps:{isSelected:w}},w?"✓":null))})))}));_.displayName="OptionList";var y=_,b=function(){return null};b.isSelectOption=!0;var S=b,w=function(){return null};w.isSelectOptGroup=!0;var C=w,E=r("VTBJ"),k=r("Zm9Q");function x(e){var t=e.key,r=e.props,i=r.children,n=r.value,s=Object(c.a)(r,["children","value"]);return Object(E.a)({key:t,value:void 0!==n?n:t,children:i},s)}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(k.a)(e).map((function(e,r){if(!a.isValidElement(e)||!e.type)return null;var i=e.type.isSelectOptGroup,n=e.key,s=e.props,o=s.children,l=Object(c.a)(s,["children"]);return t||!i?x(e):Object(E.a)(Object(E.a)({key:"__RC_SELECT_GRP__".concat(null===n?r:n,"__"),label:n},l),{},{options:T(o)})})).filter((function(e){return e}))}var L=r("2Qr1"),A=r("qNPg"),D=r("U8pU"),O=r("Kwbf"),R=r("WKfj");var M=function(e){var t=e.mode,r=e.options,i=e.children,n=e.backfill,s=e.allowClear,o=e.placeholder,l=e.getInputElement,c=e.showSearch,u=e.onSearch,h=e.defaultOpen,d=e.autoFocus,f=e.labelInValue,p=e.value,g=e.inputValue,v=e.optionLabelProp,m="multiple"===t||"tags"===t,_=void 0!==c?c:m||"combobox"===t,y=r||T(i);if(Object(O.a)("tags"!==t||y.every((function(e){return!e.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===t||"combobox"===t){var b=y.some((function(e){return e.options?e.options.some((function(e){return"number"==typeof("value"in e?e.value:e.key)})):"number"==typeof("value"in e?e.value:e.key)}));Object(O.a)(!b,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(O.a)("combobox"!==t||!v,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(O.a)("combobox"===t||!n,"`backfill` only works with `combobox` mode."),Object(O.a)("combobox"===t||!l,"`getInputElement` only work with `combobox` mode."),Object(O.b)("combobox"!==t||!l||!s||!o,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!_&&"combobox"!==t&&"tags"!==t&&Object(O.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(O.b)(!h||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=p){var S=Object(R.d)(p);Object(O.a)(!f||S.every((function(e){return"object"===Object(D.a)(e)&&("key"in e||"value"in e)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(O.a)(!m||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(i){var w=null;Object(k.a)(i).some((function(e){if(!a.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(k.a)(e.props.children).every((function(t){return!(a.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(w=t.type,!1)})):(w=t,!0))})),w&&Object(O.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(w.displayName||w.name||w,"`.")),Object(O.a)(void 0===g,"`inputValue` is deprecated, please use `searchValue` instead.")}},I=Object(A.a)({prefixCls:"rc-select",components:{optionList:y},convertChildrenToData:T,flattenOptions:L.d,getLabeledValue:L.e,filterOptions:L.b,isValueDisabled:L.g,findValueOption:L.c,warningProps:M,fillOptionsWithMissingValue:L.a}),F=function(e){Object(s.a)(r,e);var t=Object(o.a)(r);function r(){var e;return Object(i.a)(this,r),(e=t.apply(this,arguments)).selectRef=a.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(n.a)(r,[{key:"render",value:function(){return a.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),r}(a.Component);F.Option=S,F.OptGroup=C;var P=F;t.c=P},Lmeb:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/pages/tasks/vnc-view/index.less ***!
|
|
|
\*********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},Lo0S:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/logging.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initLogging=l,t.getLogging=function(){return i},t.Error=t.Warn=t.Info=t.Debug=void 0;var i="warn",n=function(){};t.Debug=n;var s=function(){};t.Info=s;var o=function(){};t.Warn=o;var a=function(){};function l(e){if(void 0===e?e=i:i=e,t.Debug=n=t.Info=s=t.Warn=o=t.Error=a=function(){},void 0!==window.console)switch(e){case"debug":t.Debug=n=console.debug.bind(window.console);case"info":t.Info=s=console.info.bind(window.console);case"warn":t.Warn=o=console.warn.bind(window.console);case"error":t.Error=a=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+e+"'")}}t.Error=a,l()},M8RZ:
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/components/modal.tsx ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var i=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),n=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),s=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),o=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),a=r(/*! react */"q1tI"),l=r.n(a),c=r(/*! react-dom */"i8i4"),u=function(e){Object(s.a)(r,e);var t=Object(o.a)(r);function r(e){var n;Object(i.a)(this,r),n=t.call(this,e);var s=window.document;return n.node=s.createElement("div"),s.body.appendChild(n.node),n}return Object(n.a)(r,[{key:"render",value:function(){var e=this.props.children;return Object(c.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),r}(l.a.Component)},MZdM:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/display.js ***!
|
|
|
\**************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(/*! ./util/logging.js */"Lo0S")),o=(n=r(/*! ./base64.js */"N/zr"))&&n.__esModule?n:{default:n},a=r(/*! ./util/browser.js */"GdRQ"),l=r(/*! ./util/int.js */"GQ8N");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var h=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),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,s.Debug(">> Display.constructor"),this._target=t,!this._target)throw new Error("Target must be set");if("string"==typeof this._target)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},s.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),s.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}var t,r,i;return t=e,(r=[{key:"viewportChangePos",value:function(e,t){var r=this._viewportLoc;e=Math.floor(e),t=Math.floor(t),this._clipViewport||(e=-r.w,t=-r.h);var i=r.x+r.w-1,n=r.y+r.h-1;e<0&&r.x+e<0&&(e=-r.x),i+e>=this._fbWidth&&(e-=i+e-this._fbWidth+1),r.y+t<0&&(t=-r.y),n+t>=this._fbHeight&&(t-=n+t-this._fbHeight+1),0===e&&0===t||(s.Debug("viewportChange deltaX: "+e+", deltaY: "+t),r.x+=e,r.y+=t,this._damage(r.x,r.y,r.w,r.h),this.flip())}},{key:"viewportChangeSize",value:function(e,t){this._clipViewport&&void 0!==e&&void 0!==t||(s.Debug("Setting viewport to full display region"),e=this._fbWidth,t=this._fbHeight),e=Math.floor(e),t=Math.floor(t),e>this._fbWidth&&(e=this._fbWidth),t>this._fbHeight&&(t=this._fbHeight);var r=this._viewportLoc;if(r.w!==e||r.h!==t){r.w=e,r.h=t;var i=this._target;i.width=e,i.height=t,this.viewportChangePos(0,0),this._damage(r.x,r.y,r.w,r.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(e){return 0===this._scale?0:(0,l.toSigned32bit)(e/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(e){return 0===this._scale?0:(0,l.toSigned32bit)(e/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(e,t){this._prevDrawStyle="",this._fbWidth=e,this._fbHeight=t;var r=this._backbuffer;if(r.width!==e||r.height!==t){var i=null;r.width>0&&r.height>0&&(i=this._drawCtx.getImageData(0,0,r.width,r.height)),r.width!==e&&(r.width=e),r.height!==t&&(r.height=t),i&&this._drawCtx.putImageData(i,0,0)}var n=this._viewportLoc;this.viewportChangeSize(n.w,n.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(e,t,r,i){e<this._damageBounds.left&&(this._damageBounds.left=e),t<this._damageBounds.top&&(this._damageBounds.top=t),e+r>this._damageBounds.right&&(this._damageBounds.right=e+r),t+i>this._damageBounds.bottom&&(this._damageBounds.bottom=t+i)}},{key:"flip",value:function(e){if(0===this._renderQ.length||e){var t=this._damageBounds.left,r=this._damageBounds.top,i=this._damageBounds.right-t,n=this._damageBounds.bottom-r,s=t-this._viewportLoc.x,o=r-this._viewportLoc.y;s<0&&(i+=s,t-=s,s=0),o<0&&(n+=o,r-=o,o=0),s+i>this._viewportLoc.w&&(i=this._viewportLoc.w-s),o+n>this._viewportLoc.h&&(n=this._viewportLoc.h-o),i>0&&n>0&&this._targetCtx.drawImage(this._backbuffer,t,r,i,n,s,o,i,n),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}else this._renderQPush({type:"flip"})}},{key:"pending",value:function(){return this._renderQ.length>0}},{key:"flush",value:function(){0===this._renderQ.length?this.onflush():this._flushing=!0}},{key:"fillRect",value:function(e,t,r,i,n,s){0===this._renderQ.length||s?(this._setFillColor(n),this._drawCtx.fillRect(e,t,r,i),this._damage(e,t,r,i)):this._renderQPush({type:"fill",x:e,y:t,width:r,height:i,color:n})}},{key:"copyImage",value:function(e,t,r,i,n,s,o){0===this._renderQ.length||o?(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,e,t,n,s,r,i,n,s),this._damage(r,i,n,s)):this._renderQPush({type:"copy",oldX:e,oldY:t,x:r,y:i,width:n,height:s})}},{key:"imageRect",value:function(e,t,r,i,n,s){if(0!==r&&0!==i){var a=new Image;a.src="data: "+n+";base64,"+o.default.encode(s),this._renderQPush({type:"img",img:a,x:e,y:t,width:r,height:i})}}},{key:"startTile",value:function(e,t,r,i,n){this._tileX=e,this._tileY=t,this._tile=16===r&&16===i?this._tile16x16:this._drawCtx.createImageData(r,i);for(var s=n[2],o=n[1],a=n[0],l=this._tile.data,c=0;c<r*i*4;c+=4)l[c]=s,l[c+1]=o,l[c+2]=a,l[c+3]=255}},{key:"subTile",value:function(e,t,r,i,n){for(var s=n[2],o=n[1],a=n[0],l=e+r,c=t+i,u=this._tile.data,h=this._tile.width,d=t;d<c;d++)for(var f=e;f<l;f++){var p=4*(f+d*h);u[p]=s,u[p+1]=o,u[p+2]=a,u[p+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(e,t,r,i,n,s,o){if(0===this._renderQ.length||o)this._bgrxImageData(e,t,r,i,n,s);else{var a=new Uint8Array(r*i*4);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blit",data:a,x:e,y:t,width:r,height:i})}}},{key:"blitRgbImage",value:function(e,t,r,i,n,s,o){if(0===this._renderQ.length||o)this._rgbImageData(e,t,r,i,n,s);else{var a=new Uint8Array(r*i*3);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blitRgb",data:a,x:e,y:t,width:r,height:i})}}},{key:"blitRgbxImage",value:function(e,t,r,i,n,s,o){if(0===this._renderQ.length||o)this._rgbxImageData(e,t,r,i,n,s);else{var a=new Uint8Array(r*i*4);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blitRgbx",data:a,x:e,y:t,width:r,height:i})}}},{key:"drawImage",value:function(e,t,r){this._drawCtx.drawImage(e,t,r),this._damage(t,r,e.width,e.height)}},{key:"autoscale",value:function(e,t){var r;if(0===e||0===t)r=0;else{var i=this._viewportLoc,n=e/t;r=i.w/i.h>=n?e/i.w:t/i.h}this._rescale(r)}},{key:"_rescale",value:function(e){this._scale=e;var t=this._viewportLoc,r=e*t.w+"px",i=e*t.h+"px";this._target.style.width===r&&this._target.style.height===i||(this._target.style.width=r,this._target.style.height=i)}},{key:"_setFillColor",value:function(e){var t="rgb("+e[2]+","+e[1]+","+e[0]+")";t!==this._prevDrawStyle&&(this._drawCtx.fillStyle=t,this._prevDrawStyle=t)}},{key:"_rgbImageData",value:function(e,t,r,i,n,s){for(var o=this._drawCtx.createImageData(r,i),a=o.data,l=0,c=s;l<r*i*4;l+=4,c+=3)a[l]=n[c],a[l+1]=n[c+1],a[l+2]=n[c+2],a[l+3]=255;this._drawCtx.putImageData(o,e,t),this._damage(e,t,o.width,o.height)}},{key:"_bgrxImageData",value:function(e,t,r,i,n,s){for(var o=this._drawCtx.createImageData(r,i),a=o.data,l=0,c=s;l<r*i*4;l+=4,c+=4)a[l]=n[c+2],a[l+1]=n[c+1],a[l+2]=n[c],a[l+3]=255;this._drawCtx.putImageData(o,e,t),this._damage(e,t,o.width,o.height)}},{key:"_rgbxImageData",value:function(e,t,r,i,n,s){var o;a.supportsImageMetadata?o=new ImageData(new Uint8ClampedArray(n.buffer,n.byteOffset,r*i*4),r,i):(o=this._drawCtx.createImageData(r,i)).data.set(new Uint8ClampedArray(n.buffer,n.byteOffset,r*i*4)),this._drawCtx.putImageData(o,e,t),this._damage(e,t,o.width,o.height)}},{key:"_renderQPush",value:function(e){this._renderQ.push(e),1===this._renderQ.length&&this._scanRenderQ()}},{key:"_resumeRenderQ",value:function(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}},{key:"_scanRenderQ",value:function(){for(var e=!0;e&&this._renderQ.length>0;){var t=this._renderQ[0];switch(t.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(t.oldX,t.oldY,t.x,t.y,t.width,t.height,!0);break;case"fill":this.fillRect(t.x,t.y,t.width,t.height,t.color,!0);break;case"blit":this.blitImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"blitRgb":this.blitRgbImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"img":if(t.img.complete&&0!==t.img.width&&0!==t.img.height){if(t.img.width!==t.width||t.img.height!==t.height)return void s.Error("Decoded image has incorrect dimensions. Got "+t.img.width+"x"+t.img.height+". Expected "+t.width+"x"+t.height+".");this.drawImage(t.img,t.x,t.y)}else t.img._noVNCDisplay=this,t.img.addEventListener("load",this._resumeRenderQ),e=!1}e&&this._renderQ.shift()}0===this._renderQ.length&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(e){this._rescale(e)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(e){this._clipViewport=e;var t=this._viewportLoc;this.viewportChangeSize(t.w,t.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}])&&u(t.prototype,r),i&&u(t,i),e}();t.default=h},Mmt2:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/websock.js ***!
|
|
|
\**************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(/*! ./util/logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=4194304,this._rQ=null,this._sQbufferSize=10240,this._sQlen=0,this._sQ=null,this._eventHandlers={message:function(){},open:function(){},close:function(){},error:function(){}}}var t,r,i;return t=e,(r=[{key:"rQpeek8",value:function(){return this._rQ[this._rQi]}},{key:"rQskipBytes",value:function(e){this._rQi+=e}},{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(e){for(var t=0,r=e-1;r>=0;r--)t+=this._rQ[this._rQi++]<<8*r;return t}},{key:"rQshiftStr",value:function(e){void 0===e&&(e=this.rQlen);for(var t="",r=0;r<e;r+=4096){var i=this.rQshiftBytes(Math.min(4096,e-r));t+=String.fromCharCode.apply(null,i)}return t}},{key:"rQshiftBytes",value:function(e){return void 0===e&&(e=this.rQlen),this._rQi+=e,new Uint8Array(this._rQ.buffer,this._rQi-e,e)}},{key:"rQshiftTo",value:function(e,t){void 0===t&&(t=this.rQlen),e.set(new Uint8Array(this._rQ.buffer,this._rQi,t)),this._rQi+=t}},{key:"rQslice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+e,t-e)}},{key:"rQwait",value:function(e,t,r){if(this.rQlen<t){if(r){if(this._rQi<r)throw new Error("rQwait cannot backup "+r+" bytes");this._rQi-=r}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(e){this._sQ.set(e,this._sQlen),this._sQlen+=e.length,this.flush()}},{key:"sendString",value:function(e){this.send(e.split("").map((function(e){return e.charCodeAt(0)})))}},{key:"off",value:function(e){this._eventHandlers[e]=function(){}}},{key:"on",value:function(e,t){this._eventHandlers[e]=t}},{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(e,t){var r=this;this.init(),this._websocket=new WebSocket(e,t),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){n.Debug(">> WebSock.onopen"),r._websocket.protocol&&n.Info("Server choose sub-protocol: "+r._websocket.protocol),r._eventHandlers.open(),n.Debug("<< WebSock.onopen")},this._websocket.onclose=function(e){n.Debug(">> WebSock.onclose"),r._eventHandlers.close(e),n.Debug("<< WebSock.onclose")},this._websocket.onerror=function(e){n.Debug(">> WebSock.onerror: "+e),r._eventHandlers.error(e),n.Debug("<< WebSock.onerror: "+e)}}},{key:"close",value:function(){this._websocket&&(this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(n.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(e){var t=8*(this._rQlen-this._rQi+e),r=this._rQbufferSize<t;if(r&&(this._rQbufferSize=Math.max(2*this._rQbufferSize,t)),this._rQbufferSize>41943040&&(this._rQbufferSize=41943040,this._rQbufferSize-this.rQlen<e))throw new Error("Receive Queue buffer exceeded 41943040 bytes, and the new message could not fit");if(r){var i=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(i,this._rQi,this._rQlen-this._rQi))}else 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(e){var t=new Uint8Array(e);t.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(t.length),this._rQ.set(t,this._rQlen),this._rQlen+=t.length}},{key:"_recvMessage",value:function(e){this._DecodeMessage(e.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):n.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(e){this._rQi=e}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}])&&o(t.prototype,r),i&&o(t,i),e}();t.default=a},"N/zr":
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/base64.js ***!
|
|
|
\*************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(/*! ./util/logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var o={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(e){for(var t="",r=e.length,i=r%3,n=0;n<r-2;n+=3)t+=this.toBase64Table[e[n]>>2],t+=this.toBase64Table[((3&e[n])<<4)+(e[n+1]>>4)],t+=this.toBase64Table[((15&e[n+1])<<2)+(e[n+2]>>6)],t+=this.toBase64Table[63&e[n+2]];var s=r-i;return 2===i?(t+=this.toBase64Table[e[s]>>2],t+=this.toBase64Table[((3&e[s])<<4)+(e[s+1]>>4)],t+=this.toBase64Table[(15&e[s+1])<<2],t+=this.toBase64Table[64]):1===i&&(t+=this.toBase64Table[e[s]>>2],t+=this.toBase64Table[(3&e[s])<<4],t+=this.toBase64Table[64],t+=this.toBase64Table[64]),t},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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.indexOf("=")-t;r<0&&(r=e.length-t);for(var i=3*(r>>2)+Math.floor(r%4/1.5),s=new Array(i),o=0,a=0,l=0,c=t;c<e.length;c++){var u=this.toBinaryTable[127&e.charCodeAt(c)],h=e.charAt(c)===this.base64Pad;-1!==u?(a=a<<6|u,(o+=6)>=8&&(o-=8,h||(s[l++]=a>>o&255),a&=(1<<o)-1)):n.Error("Illegal character code "+e.charCodeAt(c)+" at position "+c)}if(o){var d=new Error("Corrupted base64 string");throw d.name="Base64-Error",d}return s}};t.default=o},NBmB:
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/encodings.js ***!
|
|
|
\****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodingName=function(e){switch(e){case i.encodingRaw:return"Raw";case i.encodingCopyRect:return"CopyRect";case i.encodingRRE:return"RRE";case i.encodingHextile:return"Hextile";case i.encodingTight:return"Tight";case i.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+e+"]"}},t.encodings=void 0;var i={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};t.encodings=i},OLES:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***!
|
|
|
\*********************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,r){"use strict";var i=r("U8pU"),n=r("VTBJ"),s=r("Ff2n"),o=r("q1tI"),a=r("uciX"),l=r("7ixt"),c=function(e){var t=e.overlay,r=e.prefixCls,i=e.id,n=e.overlayInnerStyle;return o.createElement("div",{className:"".concat(r,"-inner"),id:i,role:"tooltip",style:n},"function"==typeof t?t():t)},u=Object(o.forwardRef)((function(e,t){var r=e.overlayClassName,u=e.trigger,h=void 0===u?["hover"]:u,d=e.mouseEnterDelay,f=void 0===d?0:d,p=e.mouseLeaveDelay,g=void 0===p?.1:p,v=e.overlayStyle,m=e.prefixCls,_=void 0===m?"rc-tooltip":m,y=e.children,b=e.onVisibleChange,S=e.afterVisibleChange,w=e.transitionName,C=e.animation,E=e.placement,k=void 0===E?"right":E,x=e.align,T=void 0===x?{}:x,L=e.destroyTooltipOnHide,A=void 0!==L&&L,D=e.defaultVisible,O=e.getTooltipContainer,R=e.overlayInnerStyle,M=Object(s.a)(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),I=Object(o.useRef)(null);Object(o.useImperativeHandle)(t,(function(){return I.current}));var F=Object(n.a)({},M);"visible"in e&&(F.popupVisible=e.visible);var P=!1,N=!1;if("boolean"==typeof A)P=A;else if(A&&"object"===Object(i.a)(A)){var B=A.keepParent;P=!0===B,N=!1===B}return o.createElement(a.a,Object.assign({popupClassName:r,prefixCls:_,popup:function(){var t=e.arrowContent,r=void 0===t?null:t,i=e.overlay,n=e.id;return[o.createElement("div",{className:"".concat(_,"-arrow"),key:"arrow"},r),o.createElement(c,{key:"content",prefixCls:_,id:n,overlay:i,overlayInnerStyle:R})]},action:h,builtinPlacements:l.a,popupPlacement:k,ref:I,popupAlign:T,getPopupContainer:O,onPopupVisibleChange:b,afterPopupVisibleChange:S,popupTransitionName:w,popupAnimation:C,defaultPopupVisible:D,destroyPopupOnHide:P,autoDestroy:N,mouseLeaveDelay:g,popupStyle:v,mouseEnterDelay:f},F),y)}));t.a=u},Ot1p:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/index.tsx + 6 modules ***!
|
|
|
\**************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/code-block/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/useInterval.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/util.js because of ./src/pages/tasks/index.jsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/codemirror/lib/codemirror.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(e,t,r){"use strict";r("2qtc");var i=r("kLXV"),n=r("rAM+"),s=(r("miYZ"),r("tsqr")),o=r("tJVT"),a=r("jrin"),l=r("q1tI"),c=r.n(l),u=r("VrN/"),h=r.n(u),d=r("bdgK"),f=(r("p77/"),r("Bd2K"),r("ELLl"),r("19Vz"),r("lZu9"),r("+NIl"),r("kSUc"),r("9Bee")),p=function(e){var t=e.value,r=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,Object(l.useMemo)((function(){return""}),[r]));return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{dangerouslySetInnerHTML:{__html:i}}))},g=r("0Owb"),v=(r("dejd"),r("C+DQ"),[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}]);function m(e){var t=e.onActionCallback,r=e.title,i=e.icon,n=e.actionName,s=e.className,o=void 0===s?"":s,a=e.children;return c.a.createElement("a",{title:r,className:o,onClick:function(){t(n)}},c.a.createElement("i",{className:"md-iconfont ".concat(i)}),a)}var _=function(e){var t=e.watch,r=e.showNullButton,i=e.onActionCallback,n=e.fullScreen,s=e.insertTemp,o=e.hidetoolBar,a=[].concat(v,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return c.a.createElement("ul",{className:"markdown-toolbar-container"},!o&&a.map((function(e,t){return c.a.createElement("li",{key:t},e.actionName?c.a.createElement(m,Object(g.a)({},e,{onActionCallback:i})):c.a.createElement("span",{className:"v-line"}))})),r?c.a.createElement("li",null,c.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:i},c.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,s&&c.a.createElement("li",null,c.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(s),onActionCallback:i},c.a.createElement("span",{className:"fill-tip"},"插入模板"))),c.a.createElement("li",{className:"btn-full-screen"},c.a.createElement(m,{icon:"".concat(n?"icon-shrink":"icon-enlarge"),title:n?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:i})))},y=r("M8RZ"),b=(r("+L6B"),r("2/Rp")),S=(r("y8nQ"),r("Vl3Y")),w=(r("5NDa"),r("5rEg")),C={labelCol:{span:4},wrapperCol:{span:20}},E=function(e){var t=e.callback,r=e.onCancel;return c.a.createElement(S.a,Object(g.a)({},C,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)}}),c.a.createElement(S.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},c.a.createElement(w.a,null)),c.a.createElement(S.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},c.a.createElement(w.a,null)),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(b.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(b.a,{type:"ghost",onClick:r},"取消")))},k=r("7ahc"),x=(r("HmJG"),r("BjJ7")),T=S.a.useForm,L={width:280,marginRight:10},A={labelCol:{span:5},wrapperCol:{span:19}},D=function(e){var t=e.callback,r=e.onCancel,i=T(),n=Object(o.a)(i,1)[0];function s(e,t){n.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type})}return c.a.createElement(S.a,Object(g.a)({form:n},A,{className:"upload-image-panel",onFinish:function(e){t(e)}}),c.a.createElement(S.a.Item,{label:"图片地址",required:!0},c.a.createElement("div",{className:"flex-container"},c.a.createElement(S.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}]},c.a.createElement(w.a,{style:L})),c.a.createElement(O,{onFileChange:function(e){R(e.target.files[0],s)}}))),c.a.createElement(S.a.Item,{label:"图片描述",name:"alt",rules:[{required:!0,message:"请输入图片描述"}]},c.a.createElement(w.a,{style:{width:264}})),c.a.createElement(S.a.Item,{style:{textAlign:"right"}},c.a.createElement(b.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(b.a,{type:"ghost",onClick:r},"取消")))};function O(e){var t=e.onFileChange;return c.a.createElement("a",{className:"upload-button"},"本地上传",c.a.createElement("input",{type:"file",onChange:t}))}function R(e,t){if(!e)throw new String("没有文件");var r=new FormData;r.append("editormd-image-file",e),r.append("file_param_name","editormd-image-file"),r.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(r){t(JSON.parse(r.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(x.a,"/api/attachments.json")),i.send(r)}r("giR+");var M,I,F=r("fyUT"),P=(r("7Kak"),r("9yH6")),N=P.a.Group,B={margin:"0 8px"},K=function(e){var t=e.callback,r=e.onCancel;return c.a.createElement(S.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)}},c.a.createElement("div",{className:"flex-container"},c.a.createElement("span",{style:B},"单元格数:"),c.a.createElement("span",{style:B},"行数"),c.a.createElement(S.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},c.a.createElement(F.a,null)),c.a.createElement("span",{style:B},"列数"),c.a.createElement(S.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},c.a.createElement(F.a,null))),c.a.createElement("div",{className:"flex-container",style:{marginTop:12}},c.a.createElement("span",{style:B},"对齐方式:"),c.a.createElement(S.a.Item,{name:"align"},c.a.createElement(N,null,c.a.createElement(P.a,{value:"default"},c.a.createElement("i",{className:"fa fa-align-justify"})),c.a.createElement(P.a,{value:"left"},c.a.createElement("i",{className:"fa fa-align-left"})),c.a.createElement(P.a,{value:"center"},c.a.createElement("i",{className:"fa fa-align-center"})),c.a.createElement(P.a,{value:"right"},c.a.createElement("i",{className:"fa fa-align-right"}))))),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(b.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(b.a,{type:"ghost",onClick:r},"取消")))},j=r("m3rI"),U="------------",H={default:U,left:":".concat(U),center:":".concat(U,":"),right:"".concat(U,":")},X=r("9VGf");function W(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var z=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",G=(M={},Object(a.a)(M,z+"-B","bold"),Object(a.a)(M,z+"-I","italic"),M),V=(I={},Object(a.a)(I,"link","添加链接"),Object(a.a)(I,"code-block","添加代码块"),Object(a.a)(I,"upload-image","添加图片"),Object(a.a)(I,"add-table","添加表格"),I);t.a=function(e){var t=e.defaultValue,r=void 0===t?"":t,u=e.onChange,g=e.width,v=void 0===g?"100%":g,m=e.height,b=void 0===m?400:m,S=e.miniToolbar,w=void 0!==S&&S,C=e.isFocus,x=void 0!==C&&C,T=e.watch,L=e.insertTemp,A=e.mode,O=void 0===A?"markdown":A,M=e.id,I=void 0===M?"markdown-editor-id":M,F=e.showResizeBar,P=void 0!==F&&F,N=e.noStorage,B=void 0!==N&&N,U=e.showNullButton,z=void 0!==U&&U,q=e.hidetoolBar,Q=void 0!==q&&q,Y=e.fullScreen,Z=void 0!==Y&&Y,$=e.onBlur,J=e.onCMBeforeChange,ee=e.onFullScreen,te=e.className,re=void 0===te?"":te,ie=e.disablePaste,ne=void 0!==ie&&ie,se=e.placeholder,oe=void 0===se?"":se,ae=e.values,le=void 0===ae?"":ae,ce=Object(l.useState)(null),ue=Object(o.a)(ce,2),he=ue[0],de=ue[1],fe=Object(l.useState)(r),pe=Object(o.a)(fe,2),ge=pe[0],ve=pe[1],me=Object(l.useState)(T),_e=Object(o.a)(me,2),ye=_e[0],be=_e[1],Se=Object(l.useState)(Z),we=Object(o.a)(Se,2),Ce=we[0],Ee=we[1],ke=Object(l.useState)(""),xe=Object(o.a)(ke,2),Te=xe[0],Le=xe[1],Ae=Object(l.useState)(0),De=Object(o.a)(Ae,2),Oe=De[0],Re=De[1],Me=Object(l.useState)(b),Ie=Object(o.a)(Me,2),Fe=Ie[0],Pe=Ie[1],Ne=Object(l.useState)(!1),Be=Object(o.a)(Ne,2),Ke=(Be[0],Be[1]),je=Object(l.useRef)(),Ue=Object(l.useRef)(),He=Object(l.useRef)(),Xe=Object(l.useRef)();Object(l.useEffect)((function(){ve(le),null==he||he.setValue(le)}),[le]),Object(l.useEffect)((function(){null==ee||ee(Ce)}),[Ce]),Object(l.useEffect)((function(){if(je.current){var e=h.a.fromTextArea(je.current,{mode:O,lineNumbers:!w,lineWrapping:!0,value:r,autoCloseTags:!0,autoCloseBrackets:!0});function t(t,r){if(!ne){var i=r.clipboardData;if(i){var n=i.types.toString(),o=i.items,a=["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"];if("Files"===n||i.types.indexOf("Files")>-1){if(r.preventDefault(),"stex"==O)return;try{var l,c=o[1];"file"===(null===(l=o[0])||void 0===l?void 0:l.kind)&&(c=o[0]);var u=c.getAsFile(),h=u.name.split(".").pop();R(u,(function(t){var r,i,n;t.id?(null==u||null===(r=u.type)||void 0===r?void 0:r.indexOf("image"))>-1?e.replaceSelection(".concat(t.content_type,")")):(null==u||null===(i=u.type)||void 0===i?void 0:i.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==u||null===(n=u.type)||void 0===n?void 0:n.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(u.type,'&disposition=inline" target="_blank">').concat(u.name,"</a>")):a.includes(h)?e.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(u.name,"</a>")):e.replaceSelection("[".concat(u.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))}catch(r){s.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}r.preventDefault()}return x&&e.focus(),e.on("paste",t),de(e),function(){e.off("paste",t)}}}),[]);var We=Object(l.useCallback)((function(){Ue.current}),[Fe,Ue,Ce]);Object(l.useEffect)((function(){if(he){var e=function(){var e=new d.default((function(e){var t,r=Object(n.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(We(),he.setSize("100%","100%"),he.refresh())}}catch(e){r.e(e)}finally{r.f()}}));return e.observe(je.current.parentElement),e}();return function(){e.unobserve(je.current.parentElement)}}}),[he,We]),Object(l.useEffect)((function(){if(he){for(var e=[],t=function(){var t=i[r],n=(s=Object(o.a)(t,2))[0],l=s[1],c=Object(a.a)({},n,(function(){ze(l)}));e.push(c),he.addKeyMap(c)},r=0,i=Object.entries(G);r<i.length;r++){var s;t()}return function(){var t,r=Object(n.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;he.removeKeyMap(i)}}catch(e){r.e(e)}finally{r.f()}}}}),[he]),Object(l.useEffect)((function(){Z!==Ce&&Ee(Z)}),[Z]),Object(X.a)((function(){if(!B&&Oe>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(I);e>=Oe+1e4&&(!t||t!==ge)&&(window.sessionStorage.setItem(I,ge),Ke(!0))}}),1e4),Object(l.useEffect)((function(){be(T)}),[he,T]),Object(l.useEffect)((function(){he&&x&&he.focus()}),[he,x]),Object(l.useEffect)((function(){if(ye&&he){var e=he.getScrollerElement();function t(e){var t=e.target;if(Xe.current){var r=t.scrollTop/t.scrollHeight;Xe.current.scrollTop=Xe.current.scrollHeight*r}}return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[he,ye]),Object(l.useEffect)((function(){if(he&&J){function e(e,t){J(e,t)}return he.on("beforeChange",e),function(){he.off("beforeChange",e)}}}),[he,J]),Object(l.useEffect)((function(){if(he&&$){function e(){$(he.getValue())}return he.on("blur",e),function(){he.off("blur",e)}}}),[he,$]),Object(l.useEffect)((function(){if(he){function e(e){var t=e.getValue();ve(t),Re((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),u&&u(t)}return he.on("change",e),function(){he.off("change",e)}}}),[he,u]),Object(l.useEffect)((function(){he&&(null==r?(he.setValue(""),ve("")):r!==he.getValue()&&(he.setValue(r),ve(r),he.setCursor(he.lineCount(),0)))}),[he,r]);var ze=Object(l.useCallback)((function(e){var t=he.getCursor(),r=he.getSelection(),i=r.split("\n");switch(e){case"bold":return he.replaceSelection("**"+r+"**"),""===r&&he.setCursor(t.line,t.ch+2),he.focus();case"italic":return he.replaceSelection("*"+r+"*"),""===r&&he.setCursor(t.line,t.ch+1),he.focus();case"code":return he.replaceSelection("`"+r+"`"),""===r&&he.setCursor(t.line,t.ch+1),he.focus();case"inline-latex":return he.replaceSelection("`$$"+r+"$$`"),""===r&&he.setCursor(t.line,t.ch+3),he.focus();case"latex":return he.replaceSelection("```latex\n"+r+"\n```"),he.setCursor(t.line+1,r.length+1),he.focus();case"line-break":return he.replaceSelection("<br/>\n"),he.focus();case"list-ul":return""===r?he.replaceSelection("- "+r):he.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),he.focus();case"list-ol":return""===r?he.replaceSelection("1. "+r):he.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),he.focus();case"add-null-ch":return""===r&&he.setCursor(t.line,t.ch+1),he.replaceSelection("▁"),he.focus();case"inster-template-1":return""===r&&he.setCursor(t.line,t.ch),he.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),he.focus();case"eraser":return he.setValue(""),he.focus();case"trigger-watch":return be(!ye),he.focus();case"trigger-full-screen":return Ee(!Ce),he.focus();case"link":return void Le("link");case"code-block":return void Le("code-block");case"upload-image":return void Le("upload-image");case"add-table":return void Le("add-table");default:throw new Error}}),[he,ye,Ce]),Ge=Object(l.useCallback)((function(e){switch(Le(""),Te){case"link":var t=e.title,r=e.link;return he.replaceSelection("[".concat(t,"](").concat(r,")")),he.focus();case"code-block":var i=e.language,n=e.content;return he.replaceSelection(["```"+i,n,"```"].join("\n")),he.focus();case"upload-image":var s=e.src,o=e.alt;return he.replaceSelection(".concat(s,' "').concat(o,'" )')),he.focus();case"add-table":for(var a=e.row,l=e.col,c=e.align,u="\n",h=0;h<a;h++){for(var d=[],f=[],p=0;p<l;p++)1===h&&f.push(H[c]),d.push(" ");1===h&&(u+="| ".concat(f.join(" | ")," |\n")),u+="| ".concat(d.join(1===l?"":" | ")," |\n")}return he.replaceSelection(u+"\n"),he.focus();default:throw new Error}}),[he,Te]),Ve=Object(l.useMemo)((function(){switch(Te){case"link":return c.a.createElement(E,{callback:Ge,onCancel:qe});case"code-block":return c.a.createElement(k.b,{callback:Ge,onCancel:qe});case"upload-image":return c.a.createElement(D,{callback:Ge,onCancel:qe});case"add-table":return c.a.createElement(K,{callback:Ge,onCancel:qe});default:return null}}),[Te]);function qe(){Le("")}Object(l.useEffect)((function(){if(He.current){var e=He.current,t=!1,r=0;function i(e){t=!0,r=e.pageY}function n(){t=!1}function s(e){if(t){var i=e.pageY-r;i<0&&(i=0),i>300&&(i=300),Pe(b+i+"px")}}return e.addEventListener("mousedown",i),document.addEventListener("mousemove",s),document.addEventListener("mouseup",n),function(){e.removeEventListener("mousedown",i),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",n)}}}),[he,He]),Object(l.useEffect)((function(){Pe(b)}),[b]);var Qe={width:W(v),height:W(Fe)};Object(l.useMemo)((function(){if(Oe){var e=new Date(Oe),t=e.getHours(),r=e.getMinutes(),i=e.getSeconds();return r=r<10?"0"+r:r,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(r,":").concat(i)}return 0}),[Oe]);return c.a.createElement(l.Fragment,null,c.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ue},c.a.createElement("div",{className:"markdown-editor-container ".concat(re," ").concat(ye?"on-preview":""," ").concat(w?"mini":""," ").concat(Ce?"full-screen":""),style:Qe},c.a.createElement(_,{insertTemp:L,watch:ye,fullScreen:Ce,showNullButton:z,onActionCallback:ze,hidetoolBar:Q}),c.a.createElement("div",{className:"markdown-editor-body"},c.a.createElement("div",{className:"codemirror-container"},c.a.createElement("textarea",{ref:je,placeholder:oe})),ye?c.a.createElement("div",{ref:Xe,className:"preview-container"},"stex"===O&&c.a.createElement(p,{value:ge}),"stex"!==O&&c.a.createElement(f.a,{value:ge})):null))),P?c.a.createElement("a",{ref:He,className:"editor-resize"}):null,c.a.createElement(y.a,null,V[Te]?c.a.createElement(i.a,{centered:!0,title:V[Te],visible:!0,onCancel:qe,footer:null},Ve):null))}},P2ho:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/xtscancodes.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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}},QV2g:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/crc32.js ***!
|
|
|
\*********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;i()},SJMd:
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./node_modules/code-prettify/src/prettify.js ***!
|
|
|
\****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var e=window,t=["break,continue,do,else,for,if,return,while"],r=[[t,"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"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],i=[r,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],n=[r,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],s=[r,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o=[r,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",l=[t,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[t,"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"],u=[t,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function d(e,t,r,i,n){if(r){var s={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:r,spans:null,basePos:t,decorations:null};i(s),n.push.apply(n,s.decorations)}}var f=/\S/;function p(e){for(var t=void 0,r=e.firstChild;r;r=r.nextSibling){var i=r.nodeType;t=1===i?t?e:r:3===i&&f.test(r.nodeValue)?e:t}return t===e?void 0:t}function g(e,t){var r,i={};!function(){for(var n=e.concat(t),s=[],o={},a=0,l=n.length;a<l;++a){var c=n[a],u=c[3];if(u)for(var h=u.length;--h>=0;)i[u.charAt(h)]=c;var d=c[1],f=""+d;o.hasOwnProperty(f)||(s.push(d),o[f]=null)}s.push(/[\0-\uffff]/),r=function(e){for(var t=0,r=!1,i=!1,n=0,s=e.length;n<s;++n){if((d=e[n]).ignoreCase)i=!0;else if(/[a-z]/i.test(d.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){r=!0,i=!1;break}}var o={b:8,t:9,n:10,v:11,f:12,r:13};function a(e){var t=e.charCodeAt(0);if(92!==t)return t;var r=e.charAt(1);return(t=o[r])||("0"<=r&&r<="7"?parseInt(e.substring(1),8):"u"===r||"x"===r?parseInt(e.substring(2),16):e.charCodeAt(1))}function l(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return"\\"===t||"-"===t||"]"===t||"^"===t?"\\"+t:t}function c(e){var t=e.substring(1,e.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")),r=[],i="^"===t[0],n=["["];i&&n.push("^");for(var s=i?1:0,o=t.length;s<o;++s){var c=t[s];if(/\\[bdsw]/i.test(c))n.push(c);else{var u,h=a(c);s+2<o&&"-"===t[s+1]?(u=a(t[s+2]),s+=2):u=h,r.push([h,u]),u<65||h>122||(u<65||h>90||r.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||r.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}r.sort((function(e,t){return e[0]-t[0]||t[1]-e[1]}));var d=[],f=[];for(s=0;s<r.length;++s){(p=r[s])[0]<=f[1]+1?f[1]=Math.max(f[1],p[1]):d.push(f=p)}for(s=0;s<d.length;++s){var p=d[s];n.push(l(p[0])),p[1]>p[0]&&(p[1]+1>p[0]&&n.push("-"),n.push(l(p[1])))}return n.push("]"),n.join("")}function u(e){for(var i=e.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")),n=i.length,s=[],o=0,a=0;o<n;++o){if("("===(h=i[o]))++a;else if("\\"===h.charAt(0)){(u=+h.substring(1))&&(u<=a?s[u]=-1:i[o]=l(u))}}for(o=1;o<s.length;++o)-1===s[o]&&(s[o]=++t);for(o=0,a=0;o<n;++o){if("("===(h=i[o]))s[++a]||(i[o]="(?:");else if("\\"===h.charAt(0)){var u;(u=+h.substring(1))&&u<=a&&(i[o]="\\"+s[u])}}for(o=0;o<n;++o)"^"===i[o]&&"^"!==i[o+1]&&(i[o]="");if(e.ignoreCase&&r)for(o=0;o<n;++o){var h,d=(h=i[o]).charAt(0);h.length>=2&&"["===d?i[o]=c(h):"\\"!==d&&(i[o]=h.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return i.join("")}var h=[];for(n=0,s=e.length;n<s;++n){var d;if((d=e[n]).global||d.multiline)throw new Error(""+d);h.push("(?:"+u(d)+")")}return new RegExp(h.join("|"),i?"gi":"g")}(s)}();var n=t.length,s=function(e){for(var o=e.sourceCode,a=e.basePos,l=e.sourceNode,c=[a,"pln"],u=0,h=o.match(r)||[],f={},p=0,g=h.length;p<g;++p){var v,m=h[p],_=f[m],y=void 0;if("string"==typeof _)v=!1;else{var b=i[m.charAt(0)];if(b)y=m.match(b[1]),_=b[0];else{for(var w=0;w<n;++w)if(b=t[w],y=m.match(b[1])){_=b[0];break}y||(_="pln")}!(v=_.length>=5&&"lang-"===_.substring(0,5))||y&&"string"==typeof y[1]||(v=!1,_="src"),v||(f[m]=_)}var C=u;if(u+=m.length,v){var E=y[1],k=m.indexOf(E),x=k+E.length;y[2]&&(k=(x=m.length-y[2].length)-E.length);var T=_.substring(5);d(l,a+C,m.substring(0,k),s,c),d(l,a+C+k,E,S(T,E),c),d(l,a+C+x,m.substring(x),s,c)}else c.push(a+C,_)}e.decorations=c};return s}function v(e){var t=[],r=[];e.tripleQuotedStrings?t.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&r.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var i=e.hashComments;i&&(e.cStyleComments?(i>1?t.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),r.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push(["com",/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(r.push(["com",/^\/\/[^\r\n]*/,null]),r.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var n=e.regexLiterals;if(n){var s=n>1?"":"\n\r",o=s?".":"[\\S\\s]",a="/(?=[^/*"+s+"])(?:[^/\\x5B\\x5C"+s+"]|\\x5C"+o+"|\\x5B(?:[^\\x5C\\x5D"+s+"]|\\x5C"+o+")*(?:\\x5D|$))+/";r.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+a+")")])}var l=e.types;l&&r.push(["typ",l]);var c=(""+e.keywords).replace(/^ | $/g,"");c.length&&r.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(u+="(?!s*/)"),r.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(u),null]),g(t,r)}var m=v({keywords:[i,s,n,o,a,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function _(e,t,r){for(var i=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,s=e.ownerDocument,o=s.createElement("li");e.firstChild;)o.appendChild(e.firstChild);var a=[o];function l(e){var t=e.nodeType;if(1!=t||i.test(e.className)){if((3==t||4==t)&&r){var o=e.nodeValue,a=o.match(n);if(a){var u=o.substring(0,a.index);e.nodeValue=u;var h=o.substring(a.index+a[0].length);if(h)e.parentNode.insertBefore(s.createTextNode(h),e.nextSibling);c(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)c(e),e.parentNode&&e.parentNode.removeChild(e);else for(var d=e.firstChild;d;d=d.nextSibling)l(d)}function c(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,r=function e(t,r){var i=r?t.cloneNode(!1):t,n=t.parentNode;if(n){var s=e(n,1),o=t.nextSibling;s.appendChild(i);for(var a=o;a;a=o)o=a.nextSibling,s.appendChild(a)}return i}(e.nextSibling,0);(t=r.parentNode)&&1===t.nodeType;)r=t;a.push(r)}for(var u=0;u<a.length;++u)l(a[u]);t===(0|t)&&a[0].setAttribute("value",t);var h=s.createElement("ol");h.className="linenums";for(var d=Math.max(0,t-1|0)||0,f=(u=0,a.length);u<f;++u)(o=a[u]).className="L"+(u+d)%10,o.firstChild||o.appendChild(s.createTextNode(" ")),h.appendChild(o);e.appendChild(h)}var y={};function b(t,r){for(var i=r.length;--i>=0;){var n=r[i];y.hasOwnProperty(n)?e.console&&console.warn("cannot override language handler %s",n):y[n]=t}}function S(e,t){return e&&y.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),y[e]}function w(t){var r,i,n,s,o,a,l,c=t.langExtension;try{var u=(r=t.sourceNode,i=t.pre,n=/(?:^|\s)nocode(?:\s|$)/,s=[],o=0,a=[],l=0,function e(t){var r=t.nodeType;if(1==r){if(n.test(t.className))return;for(var c=t.firstChild;c;c=c.nextSibling)e(c);var u=t.nodeName.toLowerCase();"br"!==u&&"li"!==u||(s[l]="\n",a[l<<1]=o++,a[l++<<1|1]=t)}else if(3==r||4==r){var h=t.nodeValue;h.length&&(h=i?h.replace(/\r\n?/g,"\n"):h.replace(/[ \t\r\n]+/g," "),s[l]=h,a[l<<1]=o,o+=h.length,a[l++<<1|1]=t)}}(r),{sourceCode:s.join("").replace(/\n$/,""),spans:a}),h=u.sourceCode;t.sourceCode=h,t.spans=u.spans,t.basePos=0,S(c,h)(t),function(e){var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent);t=t&&+t[1]<=8;var r,i,n=/\n/g,s=e.sourceCode,o=s.length,a=0,l=e.spans,c=l.length,u=0,h=e.decorations,d=h.length,f=0;for(h[d]=o,i=r=0;i<d;)h[i]!==h[i+2]?(h[r++]=h[i++],h[r++]=h[i++]):i+=2;for(d=r,i=r=0;i<d;){for(var p=h[i],g=h[i+1],v=i+2;v+2<=d&&h[v+1]===g;)v+=2;h[r++]=p,h[r++]=g,i=v}d=h.length=r;var m=e.sourceNode,_="";m&&(_=m.style.display,m.style.display="none");try{for(;u<c;){l[u];var y,b=l[u+2]||o,S=h[f+2]||o,w=(v=Math.min(b,S),l[u+1]);if(1!==w.nodeType&&(y=s.substring(a,v))){t&&(y=y.replace(n,"\r")),w.nodeValue=y;var C=w.ownerDocument,E=C.createElement("span");E.className=h[f+1];var k=w.parentNode;k.replaceChild(E,w),E.appendChild(w),a<b&&(l[u+1]=w=C.createTextNode(s.substring(v,b)),k.insertBefore(w,E.nextSibling))}(a=v)>=b&&(u+=2),a>=S&&(f+=2)}}finally{m&&(m.style.display=_)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function C(e,t,r){var i=r||!1,n=t||null,s=document.createElement("div");return s.innerHTML="<pre>"+e+"</pre>",s=s.firstChild,i&&_(s,i,!0),w({langExtension:n,numberLines:i,sourceNode:s,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),s.innerHTML}function E(t,r){var i=r||document.body,n=i.ownerDocument||document;function s(e){return i.getElementsByTagName(e)}for(var o=[s("pre"),s("code"),s("xmp")],a=[],l=0;l<o.length;++l)for(var c=0,u=o[l].length;c<u;++c)a.push(o[l][c]);o=null;var h=Date;h.now||(h={now:function(){return+new Date}});var d=0,f=/\blang(?:uage)?-([\w.]+)(?!\S)/,g=/\bprettyprint\b/,v=/\bprettyprinted\b/,m=/pre|xmp/i,y=/^code$/i,b=/^(?:pre|code|xmp)$/i,S={};!function r(){for(var i=e.PR_SHOULD_USE_CONTINUATION?h.now()+250:1/0;d<a.length&&h.now()<i;d++){for(var s=a[d],o=S,l=s;l=l.previousSibling;){var c=l.nodeType,u=(7===c||8===c)&&l.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==c||/\S/.test(l.nodeValue))break;if(u){o={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(e,t,r){o[t]=r}));break}}var C=s.className;if((o!==S||g.test(C))&&!v.test(C)){for(var E=!1,k=s.parentNode;k;k=k.parentNode){var x=k.tagName;if(b.test(x)&&k.className&&g.test(k.className)){E=!0;break}}if(!E){s.className+=" prettyprinted";var T,L,A=o.lang;if(!A)!(A=C.match(f))&&(T=p(s))&&y.test(T.tagName)&&(A=T.className.match(f)),A&&(A=A[1]);if(m.test(s.tagName))L=1;else{var D=s.currentStyle,O=n.defaultView,R=D?D.whiteSpace:O&&O.getComputedStyle?O.getComputedStyle(s,null).getPropertyValue("white-space"):0;L=R&&"pre"===R.substring(0,3)}var M=o.linenums;(M="true"===M||+M)||(M=!!(M=C.match(/\blinenums\b(?::(\d+))?/))&&(!M[1]||!M[1].length||+M[1])),M&&_(s,M,L),w({langExtension:A,sourceNode:s,numberLines:M,pre:L,sourceCode:null,basePos:null,spans:null,decorations:null})}}}d<a.length?e.setTimeout(r,250):"function"==typeof t&&t()}()}b(m,["default-code"]),b(g([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["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"]),b(g([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["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"]),b(g([],[["atv",/^[\s\S]+/]]),["uq.val"]),b(v({keywords:i,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),b(v({keywords:"null,true,false"}),["json"]),b(v({keywords:s,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),b(v({keywords:n,cStyleComments:!0}),["java"]),b(v({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),b(v({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),b(v({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),b(v({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),b(v({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),b(v({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),b(g([],[["str",/^[\s\S]+/]]),["regex"]);var k=e.PR={createSimpleLexer:g,registerLangHandler:b,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:C,prettyPrint:E},x=e.define;"function"==typeof x&&x.amd&&x("google-code-prettify",[],(function(){return k}))}()},SZEN:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/element.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clientToElement=function(e,t,r){var i=r.getBoundingClientRect(),n={x:0,y:0};e<i.left?n.x=0:e>=i.right?n.x=i.width-1:n.x=e-i.left;t<i.top?n.y=0:t>=i.bottom?n.y=i.height-1:n.y=t-i.top;return n}},SgaC:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/rre.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._subrects=0}var t,r,n;return t=e,(r=[{key:"decodeRect",value:function(e,t,r,i,n,s,o){if(0===this._subrects){if(n.rQwait("RRE",8))return!1;this._subrects=n.rQshift32();var a=n.rQshiftBytes(4);s.fillRect(e,t,r,i,a)}for(;this._subrects>0;){if(n.rQwait("RRE",12))return!1;var l=n.rQshiftBytes(4),c=n.rQshift16(),u=n.rQshift16(),h=n.rQshift16(),d=n.rQshift16();s.fillRect(e+c,t+u,h,d,l),this._subrects--}return!0}}])&&i(t.prototype,r),n&&i(t,n),e}();t.default=n},VSMT:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/strings.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUTF8=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return decodeURIComponent(escape(e))}catch(r){if(r instanceof URIError&&t)return e;throw r}},t.encodeUTF8=function(e){return unescape(encodeURIComponent(e))}},"VaU+":
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./src/pages/Shixuns/New/ImagePreview/index.less?modules ***!
|
|
|
\***************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){e.exports={wrp:"wrp___1lJPu",header:"header___2p05v",cuttDown:"cuttDown___1-ls7",container:"container___1Nx55",info:"info___2lI6e",buttons:"buttons___3Q0yr",fullBtn:"fullBtn___18HVx",shrink:"shrink___367DS",elseShrink:"elseShrink___3Anw7",spin:"spin___3h9s3"}},"VrN/":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/codemirror/lib/codemirror.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),s=/Edge\/(\d+)/.exec(e),o=i||n||s,a=o&&(i?document.documentMode||6:+(s||n)[1]),l=!s&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!s&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!s&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),_=g||/Mac/.test(t),y=/\bCrOS\b/.test(e),b=/win/i.test(t),S=h&&e.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(h=!1,l=!0);var w=_&&(c||h&&(null==S||S<12.11)),C=r||o&&a>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,x=function(e,t){var r=e.className,i=E(t).exec(r);if(i){var n=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(n?i[1]+n:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function L(e,t){return T(e).appendChild(t)}function A(e,t,r,i){var n=document.createElement(e);if(r&&(n.className=r),i&&(n.style.cssText=i),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)n.appendChild(t[s]);return n}function D(e,t,r,i){var n=A(e,t,r,i);return n.setAttribute("role","presentation"),n}function O(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function R(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function M(e,t){var r=e.className;E(t).test(r)||(e.className+=(r?" ":"")+t)}function I(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!E(r[i]).test(t)&&(t+=" "+r[i]);return t}k=document.createRange?function(e,t,r,i){var n=document.createRange();return n.setEnd(i||e,r),n.setStart(e,t),n}:function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};var F=function(e){e.select()};function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function N(e,t,r){for(var i in t||(t={}),e)!e.hasOwnProperty(i)||!1===r&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function B(e,t,r,i,n){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var s=i||0,o=n||0;;){var a=e.indexOf("\t",s);if(a<0||a>=t)return o+(t-s);o+=a-s,o+=r-o%r,s=a+1}}g?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(F=function(e){try{e.select()}catch(e){}});var K=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function j(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}K.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},K.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var U={toString:function(){return"CodeMirror.Pass"}},H={scroll:!1},X={origin:"*mouse"},W={origin:"+move"};function z(e,t,r){for(var i=0,n=0;;){var s=e.indexOf("\t",i);-1==s&&(s=e.length);var o=s-i;if(s==e.length||n+o>=t)return i+Math.min(o,t-n);if(n+=s-i,i=s+1,(n+=r-n%r)>=t)return i}}var G=[""];function V(e){for(;G.length<=e;)G.push(q(G)+" ");return G[e]}function q(e){return e[e.length-1]}function Q(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function Y(){}function Z(e,t){var r;return Object.create?r=Object.create(e):(Y.prototype=e,r=new Y),t&&N(t,r),r}var $=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||$.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&re.test(e)}function ne(e,t,r){for(;(r<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function se(e,t,r){for(var i=t>r?-1:1;;){if(t==r)return t;var n=(t+r)/2,s=i<0?Math.ceil(n):Math.floor(n);if(s==t)return e(s)?t:r;e(s)?r=s:t=s+i}}var oe=null;function ae(e,t,r){var i;oe=null;for(var n=0;n<e.length;++n){var s=e[n];if(s.from<t&&s.to>t)return n;s.to==t&&(s.from!=s.to&&"before"==r?i=n:oe=n),s.from==t&&(s.from!=s.to&&"before"!=r?i=n:oe=n)}return null!=i?i:oe}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,i=/[Lb1n]/,n=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(o,a){var l="ltr"==a?"L":"R";if(0==o.length||"ltr"==a&&!e.test(o))return!1;for(var c,u=o.length,h=[],d=0;d<u;++d)h.push((c=o.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var f=0,p=l;f<u;++f){var g=h[f];"m"==g?h[f]=p:p=g}for(var v=0,m=l;v<u;++v){var _=h[v];"1"==_&&"r"==m?h[v]="n":r.test(_)&&(m=_,"r"==_&&(h[v]="R"))}for(var y=1,b=h[0];y<u-1;++y){var S=h[y];"+"==S&&"1"==b&&"1"==h[y+1]?h[y]="1":","!=S||b!=h[y+1]||"1"!=b&&"n"!=b||(h[y]=b),b=S}for(var w=0;w<u;++w){var C=h[w];if(","==C)h[w]="N";else if("%"==C){var E=void 0;for(E=w+1;E<u&&"%"==h[E];++E);for(var k=w&&"!"==h[w-1]||E<u&&"1"==h[E]?"1":"N",x=w;x<E;++x)h[x]=k;w=E-1}}for(var T=0,L=l;T<u;++T){var A=h[T];"L"==L&&"1"==A?h[T]="L":r.test(A)&&(L=A)}for(var D=0;D<u;++D)if(t.test(h[D])){var O=void 0;for(O=D+1;O<u&&t.test(h[O]);++O);for(var R="L"==(D?h[D-1]:l),M=R==("L"==(O<u?h[O]:l))?R?"L":"R":l,I=D;I<O;++I)h[I]=M;D=O-1}for(var F,P=[],N=0;N<u;)if(i.test(h[N])){var B=N;for(++N;N<u&&i.test(h[N]);++N);P.push(new s(0,B,N))}else{var K=N,j=P.length,U="rtl"==a?1:0;for(++N;N<u&&"L"!=h[N];++N);for(var H=K;H<N;)if(n.test(h[H])){K<H&&(P.splice(j,0,new s(1,K,H)),j+=U);var X=H;for(++H;H<N&&n.test(h[H]);++H);P.splice(j,0,new s(2,X,H)),j+=U,K=H}else++H;K<N&&P.splice(j,0,new s(1,K,N))}return"ltr"==a&&(1==P[0].level&&(F=o.match(/^\s+/))&&(P[0].from=F[0].length,P.unshift(new s(0,0,F[0].length))),1==q(P).level&&(F=o.match(/\s+$/))&&(q(P).to-=F[0].length,P.push(new s(0,u-F[0].length,u)))),"rtl"==a?P.reverse():P}}();function ce(e,t){var r=e.order;return null==r&&(r=e.order=le(e.text,t)),r}var ue=[],he=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||ue).concat(r)}};function de(e,t){return e._handlers&&e._handlers[t]||ue}function fe(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var i=e._handlers,n=i&&i[t];if(n){var s=j(n,r);s>-1&&(i[t]=n.slice(0,s).concat(n.slice(s+1)))}}}function pe(e,t){var r=de(e,t);if(r.length)for(var i=Array.prototype.slice.call(arguments,2),n=0;n<r.length;++n)r[n].apply(null,i)}function ge(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,r||t.type,e,t),Se(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==j(r,t[i])&&r.push(t[i])}function me(e,t){return de(e,t).length>0}function _e(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function be(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function we(e){ye(e),be(e)}function Ce(e){return e.target||e.srcElement}function Ee(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),_&&e.ctrlKey&&1==t&&(t=3),t}var ke,xe,Te=function(){if(o&&a<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Le(e){if(null==ke){var t=A("span","");L(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ke=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&a<8))}var r=ke?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ae(e){if(null!=xe)return xe;var t=L(e,document.createTextNode("AخA")),r=k(t,0,1).getBoundingClientRect(),i=k(t,1,2).getBoundingClientRect();return T(e),!(!r||r.left==r.right)&&(xe=i.right-r.right<3)}var De,Oe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],i=e.length;t<=i;){var n=e.indexOf("\n",t);-1==n&&(n=e.length);var s=e.slice(t,"\r"==e.charAt(n-1)?n-1:n),o=s.indexOf("\r");-1!=o?(r.push(s.slice(0,o)),t+=o+1):(r.push(s),t=n+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Re=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Me="oncopy"in(De=A("div"))||(De.setAttribute("oncopy","return;"),"function"==typeof De.oncopy),Ie=null,Fe={},Pe={};function Ne(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fe[e]=t}function Be(e){if("string"==typeof e&&Pe.hasOwnProperty(e))e=Pe[e];else if(e&&"string"==typeof e.name&&Pe.hasOwnProperty(e.name)){var t=Pe[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ke(e,t){t=Be(t);var r=Fe[t.name];if(!r)return Ke(e,"text/plain");var i=r(e,t);if(je.hasOwnProperty(t.name)){var n=je[t.name];for(var s in n)n.hasOwnProperty(s)&&(i.hasOwnProperty(s)&&(i["_"+s]=i[s]),i[s]=n[s])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)i[o]=t.modeProps[o];return i}var je={};function Ue(e,t){N(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function He(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var n=t[i];n instanceof Array&&(n=n.concat([])),r[i]=n}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function We(e,t,r){return!e.startState||e.startState(t,r)}var ze=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var i=0;;++i){var n=r.children[i],s=n.chunkSize();if(t<s){r=n;break}t-=s}return r.lines[t]}function Ve(e,t,r){var i=[],n=t.line;return e.iter(t.line,r.line+1,(function(e){var s=e.text;n==r.line&&(s=s.slice(0,r.ch)),n==t.line&&(s=s.slice(t.ch)),i.push(s),++n})),i}function qe(e,t,r){var i=[];return e.iter(t,r,(function(e){i.push(e.text)})),i}function Qe(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,r=j(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var n=0;i.children[n]!=t;++n)r+=i.children[n].chunkSize();return r+t.first}function Ze(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var n=e.children[i],s=n.height;if(t<s){e=n;continue e}t-=s,r+=n.chunkSize()}return r}while(!e.lines);for(var o=0;o<e.lines.length;++o){var a=e.lines[o].height;if(t<a)break;t-=a}return r+o}function $e(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,r){if(void 0===r&&(r=null),!(this instanceof et))return new et(e,t,r);this.line=e,this.ch=t,this.sticky=r}function tt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function it(e){return et(e.line,e.ch)}function nt(e,t){return tt(e,t)<0?t:e}function st(e,t){return tt(e,t)<0?e:t}function ot(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function at(e,t){if(t.line<e.first)return et(e.first,0);var r=e.first+e.size-1;return t.line>r?et(r,Ge(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?et(e.line,t):r<0?et(e.line,0):e}(t,Ge(e,t.line).text.length)}function lt(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=at(e,t[i]);return r}ze.prototype.eol=function(){return this.pos>=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ze.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},ze.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},ze.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},ze.prototype.match=function(e,t,r){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var n=function(e){return r?e.toLowerCase():e};if(n(this.string.substr(this.pos,e.length))==n(e))return!1!==t&&(this.pos+=e.length),!0},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,r,i){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,r,i){var n=[e.state.modeGen],s={};bt(e,t.text,e.doc.mode,r,(function(e,t){return n.push(e,t)}),s,i);for(var o=r.state,a=function(i){r.baseTokens=n;var a=e.state.overlays[i],l=1,c=0;r.state=!0,bt(e,t.text,a.mode,r,(function(e,t){for(var r=l;c<e;){var i=n[l];i>e&&n.splice(l,1,e,n[l+1],i),l+=2,c=Math.min(e,i)}if(t)if(a.opaque)n.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var s=n[r+1];n[r+1]=(s?s+" ":"")+"overlay "+t}}),s),r.state=o,r.baseTokens=null,r.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)a(l);return{styles:n,classes:s.bgClass||s.textClass?s:null}}function dt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=ft(e,Ye(t)),n=t.text.length>e.options.maxHighlightLength&&He(e.doc.mode,i.state),s=ht(e,t,i);n&&(i.state=n),t.stateAfter=i.save(!n),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ft(e,t,r){var i=e.doc,n=e.display;if(!i.mode.startState)return new ut(i,!0,t);var s=function(e,t,r){for(var i,n,s=e.doc,o=r?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>o;--a){if(a<=s.first)return s.first;var l=Ge(s,a-1),c=l.stateAfter;if(c&&(!r||a+(c instanceof ct?c.lookAhead:0)<=s.modeFrontier))return a;var u=B(l.text,null,e.options.tabSize);(null==n||i>u)&&(n=a-1,i=u)}return n}(e,t,r),o=s>i.first&&Ge(i,s-1).stateAfter,a=o?ut.fromSaved(i,o,s):new ut(i,We(i.mode),s);return i.iter(s,t,(function(r){pt(e,r.text,a);var i=a.line;r.stateAfter=i==t-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?a.save():null,a.nextLine()})),r&&(i.modeFrontier=a.line),a}function pt(e,t,r,i){var n=e.doc.mode,s=new ze(t,e.options.tabSize,r);for(s.start=s.pos=i||0,""==t&>(n,r.state);!s.eol();)vt(n,s,r.state),s.start=s.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Xe(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function vt(e,t,r,i){for(var n=0;n<10;n++){i&&(i[0]=Xe(e,r).mode);var s=e.token(t,r);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,r){return t instanceof ct?new ut(e,He(e.mode,t.state),r,t.lookAhead):new ut(e,He(e.mode,t),r)},ut.prototype.save=function(e){var t=!1!==e?He(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var mt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function _t(e,t,r,i){var n,s,o=e.doc,a=o.mode,l=Ge(o,(t=at(o,t)).line),c=ft(e,t.line,r),u=new ze(l.text,e.options.tabSize,c);for(i&&(s=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,n=vt(a,u,c.state),i&&s.push(new mt(u,n,He(o.mode,c.state)));return i?s:new mt(u,n,c.state)}function yt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";null==t[i]?t[i]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+r[2])}return e}function bt(e,t,r,i,n,s,o){var a=r.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,c=0,u=null,h=new ze(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&yt(gt(r,i.state),s);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,o&&pt(e,t,i,h.pos),h.pos=t.length,l=null):l=yt(vt(r,h,i.state,d),s),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c<h.start;)n(c=Math.min(h.start,c+5e3),u);u=l}h.start=h.pos}for(;c<h.pos;){var p=Math.min(h.pos,c+5e3);n(p,u),c=p}}var St=!1,wt=!1;function Ct(e,t,r){this.marker=e,this.from=t,this.to=r}function Et(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function kt(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r||(r=[])).push(e[i]);return r}function xt(e,t){if(t.full)return null;var r=$e(e,t.from.line)&&Ge(e,t.from.line).markedSpans,i=$e(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!r&&!i)return null;var n=t.from.ch,s=t.to.ch,o=0==tt(t.from,t.to),a=function(e,t,r){var i;if(e)for(var n=0;n<e.length;++n){var s=e[n],o=s.marker;if(null==s.from||(o.inclusiveLeft?s.from<=t:s.from<t)||s.from==t&&"bookmark"==o.type&&(!r||!s.marker.insertLeft)){var a=null==s.to||(o.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push(new Ct(o,s.from,a?null:s.to))}}return i}(r,n,o),l=function(e,t,r){var i;if(e)for(var n=0;n<e.length;++n){var s=e[n],o=s.marker;if(null==s.to||(o.inclusiveRight?s.to>=t:s.to>t)||s.from==t&&"bookmark"==o.type&&(!r||s.marker.insertLeft)){var a=null==s.from||(o.inclusiveLeft?s.from<=t:s.from<t);(i||(i=[])).push(new Ct(o,a?null:s.from-t,null==s.to?null:s.to-t))}}return i}(i,s,o),c=1==t.text.length,u=q(t.text).length+(c?n:0);if(a)for(var h=0;h<a.length;++h){var d=a[h];if(null==d.to){var f=Et(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=n}}if(l)for(var p=0;p<l.length;++p){var g=l[p];null!=g.to&&(g.to+=u),null==g.from?Et(a,g.marker)||(g.from=u,c&&(a||(a=[])).push(g)):(g.from+=u,c&&(a||(a=[])).push(g))}a&&(a=Tt(a)),l&&l!=a&&(l=Tt(l));var v=[a];if(!c){var m,_=t.text.length-2;if(_>0&&a)for(var y=0;y<a.length;++y)null==a[y].to&&(m||(m=[])).push(new Ct(a[y].marker,null,null));for(var b=0;b<_;++b)v.push(m);v.push(l)}return v}function Tt(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Lt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Dt(e){return e.inclusiveLeft?-1:0}function Ot(e){return e.inclusiveRight?1:0}function Rt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var i=e.find(),n=t.find(),s=tt(i.from,n.from)||Dt(e)-Dt(t);if(s)return-s;var o=tt(i.to,n.to)||Ot(e)-Ot(t);return o||t.id-e.id}function Mt(e,t){var r,i=wt&&e.markedSpans;if(i)for(var n=void 0,s=0;s<i.length;++s)(n=i[s]).marker.collapsed&&null==(t?n.from:n.to)&&(!r||Rt(r,n.marker)<0)&&(r=n.marker);return r}function It(e){return Mt(e,!0)}function Ft(e){return Mt(e,!1)}function Pt(e,t){var r,i=wt&&e.markedSpans;if(i)for(var n=0;n<i.length;++n){var s=i[n];s.marker.collapsed&&(null==s.from||s.from<t)&&(null==s.to||s.to>t)&&(!r||Rt(r,s.marker)<0)&&(r=s.marker)}return r}function Nt(e,t,r,i,n){var s=Ge(e,t),o=wt&&s.markedSpans;if(o)for(var a=0;a<o.length;++a){var l=o[a];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,r)||Dt(l.marker)-Dt(n),h=tt(c.to,i)||Ot(l.marker)-Ot(n);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?tt(c.to,r)>=0:tt(c.to,r)>0)||u>=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?tt(c.from,i)<=0:tt(c.from,i)<0)))return!0}}}function Bt(e){for(var t;t=It(e);)e=t.find(-1,!0).line;return e}function Kt(e,t){var r=Ge(e,t),i=Bt(r);return r==i?t:Ye(i)}function jt(e,t){if(t>e.lastLine())return t;var r,i=Ge(e,t);if(!Ut(e,i))return t;for(;r=Ft(i);)i=r.find(1,!0).line;return Ye(i)+1}function Ut(e,t){var r=wt&&t.markedSpans;if(r)for(var i=void 0,n=0;n<r.length;++n)if((i=r[n]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&Ht(e,t,i))return!0}}function Ht(e,t,r){if(null==r.to){var i=r.marker.find(1,!0);return Ht(e,i.line,Et(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var n=void 0,s=0;s<t.markedSpans.length;++s)if((n=t.markedSpans[s]).marker.collapsed&&!n.marker.widgetNode&&n.from==r.to&&(null==n.to||n.to!=r.from)&&(n.marker.inclusiveLeft||r.marker.inclusiveRight)&&Ht(e,t,n))return!0}function Xt(e){for(var t=0,r=(e=Bt(e)).parent,i=0;i<r.lines.length;++i){var n=r.lines[i];if(n==e)break;t+=n.height}for(var s=r.parent;s;s=(r=s).parent)for(var o=0;o<s.children.length;++o){var a=s.children[o];if(a==r)break;t+=a.height}return t}function Wt(e){if(0==e.height)return 0;for(var t,r=e.text.length,i=e;t=It(i);){var n=t.find(0,!0);i=n.from.line,r+=n.from.ch-n.to.ch}for(i=e;t=Ft(i);){var s=t.find(0,!0);r-=i.text.length-s.from.ch,r+=(i=s.to.line).text.length-s.to.ch}return r}function zt(e){var t=e.display,r=e.doc;t.maxLine=Ge(r,r.first),t.maxLineLength=Wt(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Wt(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Gt=function(e,t,r){this.text=e,At(this,t),this.height=r?r(this):1};function Vt(e){e.parent=null,Lt(e)}Gt.prototype.lineNo=function(){return Ye(this)},_e(Gt);var qt={},Qt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Qt:qt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var r=D("span",null,null,l?"padding-right: .1px":null),i={pre:D("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var s=n?t.rest[n-1]:t.line,o=void 0;i.pos=0,i.addToken=Jt,Ae(e.display.measure)&&(o=ce(s,e.doc.direction))&&(i.addToken=er(i.addToken,o)),i.map=[],rr(s,i,dt(e,s,t!=e.display.externalMeasured&&Ye(s))),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=I(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=I(s.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Le(e.display.measure))),0==n?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=i.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=I(i.pre.className,i.textClass||"")),i}function $t(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,r,i,n,s,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,i="",n=0;n<e.length;n++){var s=e.charAt(n);" "!=s||!r||n!=e.length-1&&32!=e.charCodeAt(n+1)||(s=" "),i+=s,r=" "==s}return i}(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){c=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(t),g=p?p.index-f:t.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));o&&a<9?c.appendChild(A("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;f+=g+1;var m=void 0;if("\t"==p[0]){var _=e.cm.options.tabSize,y=_-e.col%_;(m=c.appendChild(A("span",V(y),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=y}else"\r"==p[0]||"\n"==p[0]?((m=c.appendChild(A("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((m=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),o&&a<9?c.appendChild(A("span",[m])):c.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),o&&a<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||i||n||d||s||l){var b=r||"";i&&(b+=i),n&&(b+=n);var S=A("span",[c],b,s);if(l)for(var w in l)l.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&S.setAttribute(w,l[w]);return e.content.appendChild(S)}e.content.appendChild(c)}}function er(e,t){return function(r,i,n,s,o,a,l){n=n?n+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+i.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>c&&h.from<=c);d++);if(h.to>=u)return e(r,i,n,s,o,a,l);e(r,i.slice(0,h.to-c),n,s,null,a,l),s=null,i=i.slice(h.to-c),c=h.to}}}function tr(e,t,r,i){var n=!i&&r.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!i&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",r.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var i=e.markedSpans,n=e.text,s=0;if(i)for(var o,a,l,c,u,h,d,f=n.length,p=0,g=1,v="",m=0;;){if(m==p){l=c=u=a="",d=null,h=null,m=1/0;for(var _=[],y=void 0,b=0;b<i.length;++b){var S=i[b],w=S.marker;if("bookmark"==w.type&&S.from==p&&w.widgetNode)_.push(w);else if(S.from<=p&&(null==S.to||S.to>p||w.collapsed&&S.to==p&&S.from==p)){if(null!=S.to&&S.to!=p&&m>S.to&&(m=S.to,c=""),w.className&&(l+=" "+w.className),w.css&&(a=(a?a+";":"")+w.css),w.startStyle&&S.from==p&&(u+=" "+w.startStyle),w.endStyle&&S.to==m&&(y||(y=[])).push(w.endStyle,S.to),w.title&&((d||(d={})).title=w.title),w.attributes)for(var C in w.attributes)(d||(d={}))[C]=w.attributes[C];w.collapsed&&(!h||Rt(h.marker,w)<0)&&(h=S)}else S.from>p&&m>S.from&&(m=S.from)}if(y)for(var E=0;E<y.length;E+=2)y[E+1]==m&&(c+=" "+y[E]);if(!h||h.from==p)for(var k=0;k<_.length;++k)tr(t,0,_[k]);if(h&&(h.from||0)==p){if(tr(t,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var x=Math.min(f,m);;){if(v){var T=p+v.length;if(!h){var L=T>x?v.slice(0,x-p):v;t.addToken(t,L,o?o+l:l,u,p+L.length==m?c:"",a,d)}if(T>=x){v=v.slice(x-p),p=x;break}p=T,u=""}v=n.slice(s,s=r[g++]),o=Yt(r[g++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,n.slice(s,s=r[A]),Yt(r[A+1],t.cm.options))}function ir(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Ft(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?Ye(q(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function nr(e,t,r){for(var i,n=[],s=t;s<r;s=i){var o=new ir(e.doc,Ge(e.doc,s),s);i=s+o.size,n.push(o)}return n}var sr=null,or=null;function ar(e,t){var r=de(e,t);if(r.length){var i,n=Array.prototype.slice.call(arguments,2);sr?i=sr.delayedCallbacks:or?i=or:(i=or=[],setTimeout(lr,0));for(var s=function(e){i.push((function(){return r[e].apply(null,n)}))},o=0;o<r.length;++o)s(o)}}function lr(){var e=or;or=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,i){for(var n=0;n<t.changes.length;n++){var s=t.changes[n];"text"==s?dr(e,t):"gutter"==s?pr(e,t,r,i):"class"==s?fr(e,t):"widget"==s&&gr(e,t,i)}t.changes=null}function ur(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&a<8&&(e.node.style.zIndex=2)),e.node}function hr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Zt(e,t)}function dr(e,t){var r=t.text.className,i=hr(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,fr(e,t)):r&&(t.text.className=r)}function fr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=ur(t);t.background=i.insertBefore(A("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ur(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function pr(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var n=ur(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var o=ur(t),a=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),o.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||s&&s["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(A("div",Je(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=s.hasOwnProperty(c)&&s[c];u&&a.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function gr(e,t,r){t.alignable&&(t.alignable=null);for(var i=E("CodeMirror-linewidget"),n=t.node.firstChild,s=void 0;n;n=s)s=n.nextSibling,i.test(n.className)&&t.node.removeChild(n);mr(e,t,r)}function vr(e,t,r,i){var n=hr(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),fr(e,t),pr(e,t,r,i),mr(e,t,i),t.node}function mr(e,t,r){if(_r(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)_r(e,t.rest[i],t,r,!1)}function _r(e,t,r,i,n){if(t.widgets)for(var s=ur(r),o=0,a=t.widgets;o<a.length;++o){var l=a[o],c=A("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),yr(l,c,r,i),e.display.input.setUneditable(c),n&&l.above?s.insertBefore(c,r.gutter||r.text):s.appendChild(c),ar(l,"redraw")}}function yr(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var n=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(n-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function br(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),L(t.display.measure,A("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Sr(e,t){for(var r=Ce(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function wr(e){return e.lineSpace.offsetTop}function Cr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Er(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=L(e.measure,A("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function kr(e){return 50-e.display.nativeBarWidth}function xr(e){return e.display.scroller.clientWidth-kr(e)-e.display.barWidth}function Tr(e){return e.display.scroller.clientHeight-kr(e)-e.display.barHeight}function Lr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var n=0;n<e.rest.length;n++)if(Ye(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Ar(e,t,r,i){return Rr(e,Or(e,t),r,i)}function Dr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ci(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Or(e,t){var r=Ye(t),i=Dr(e,r);i&&!i.text?i=null:i&&i.changes&&(cr(e,i,r,ni(e)),e.curOp.forceUpdate=!0),i||(i=function(e,t){var r=Ye(t=Bt(t)),i=e.display.externalMeasured=new ir(e.doc,t,r);i.lineN=r;var n=i.built=Zt(e,i);return i.text=n.pre,L(e.display.lineMeasure,n.pre),i}(e,t));var n=Lr(i,t,r);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Rr(e,t,r,i,n){t.before&&(r=-1);var s,l=r+(i||"");return t.cache.hasOwnProperty(l)?s=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var i=e.options.lineWrapping,n=i&&xr(e);if(!t.measure.heights||i&&t.measure.width!=n){var s=t.measure.heights=[];if(i){t.measure.width=n;for(var o=t.text.firstChild.getClientRects(),a=0;a<o.length-1;a++){var l=o[a],c=o[a+1];Math.abs(l.bottom-c.bottom)>2&&s.push((l.bottom+c.top)/2-r.top)}}s.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(s=function(e,t,r,i){var n,s=Fr(t.map,r,i),l=s.node,c=s.start,u=s.end,h=s.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&ie(t.line.text.charAt(s.coverStart+c));)--c;for(;s.coverStart+u<s.coverEnd&&ie(t.line.text.charAt(s.coverStart+u));)++u;if((n=o&&a<9&&0==c&&u==s.coverEnd-s.coverStart?l.parentNode.getBoundingClientRect():Pr(k(l,c,u).getClientRects(),i)).left||n.right||0==c)break;u=c,c-=1,h="right"}o&&a<11&&(n=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ie)return Ie;var t=L(e,A("span","x")),r=t.getBoundingClientRect(),i=k(t,0,1).getBoundingClientRect();return Ie=Math.abs(r.left-i.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,n))}else{var f;c>0&&(h=i="right"),n=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(o&&a<9&&!c&&(!n||!n.left&&!n.right)){var p=l.parentNode.getClientRects()[0];n=p?{left:p.left,right:p.left+ii(e.display),top:p.top,bottom:p.bottom}:Ir}for(var g=n.top-t.rect.top,v=n.bottom-t.rect.top,m=(g+v)/2,_=t.view.measure.heights,y=0;y<_.length-1&&!(m<_[y]);y++);var b=y?_[y-1]:0,S=_[y],w={left:("right"==h?n.right:n.left)-t.rect.left,right:("left"==h?n.left:n.right)-t.rect.left,top:b,bottom:S};return n.left||n.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=g,w.rbottom=v),w}(e,t,r,i)).bogus||(t.cache[l]=s)),{left:s.left,right:s.right,top:n?s.rtop:s.top,bottom:n?s.rbottom:s.bottom}}var Mr,Ir={left:0,right:0,top:0,bottom:0};function Fr(e,t,r){for(var i,n,s,o,a,l,c=0;c<e.length;c+=3)if(a=e[c],l=e[c+1],t<a?(n=0,s=1,o="left"):t<l?s=1+(n=t-a):(c==e.length-3||t==l&&e[c+3]>t)&&(n=(s=l-a)-1,t>=l&&(o="right")),null!=n){if(i=e[c+2],a==l&&r==(i.insertLeft?"left":"right")&&(o=r),"left"==r&&0==n)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[2+(c-=3)],o="left";if("right"==r&&n==l-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)i=e[(c+=3)+2],o="right";break}return{node:i,start:n,end:s,collapse:o,coverStart:a,coverEnd:l}}function Pr(e,t){var r=Ir;if("left"==t)for(var i=0;i<e.length&&(r=e[i]).left==r.right;i++);else for(var n=e.length-1;n>=0&&(r=e[n]).left==r.right;n--);return r}function Nr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Br(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Nr(e.display.view[t])}function Kr(e){Br(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function jr(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ur(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=br(e.widgets[r]));return t}function Xr(e,t,r,i,n){if(!n){var s=Hr(t);r.top+=s,r.bottom+=s}if("line"==i)return r;i||(i="local");var o=Xt(t);if("local"==i?o+=wr(e.display):o-=e.display.viewOffset,"page"==i||"window"==i){var a=e.display.lineSpace.getBoundingClientRect();o+=a.top+("window"==i?0:Ur());var l=a.left+("window"==i?0:jr());r.left+=l,r.right+=l}return r.top+=o,r.bottom+=o,r}function Wr(e,t,r){if("div"==r)return t;var i=t.left,n=t.top;if("page"==r)i-=jr(),n-=Ur();else if("local"==r||!r){var s=e.display.sizer.getBoundingClientRect();i+=s.left,n+=s.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:i-o.left,top:n-o.top}}function zr(e,t,r,i,n){return i||(i=Ge(e.doc,t.line)),Xr(e,i,Ar(e,i,t.ch,n),r)}function Gr(e,t,r,i,n,s){function o(t,o){var a=Rr(e,n,t,o?"right":"left",s);return o?a.left=a.right:a.right=a.left,Xr(e,i,a,r)}i=i||Ge(e.doc,t.line),n||(n=Or(e,i));var a=ce(i,e.doc.direction),l=t.ch,c=t.sticky;if(l>=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return o("before"==c?l-1:l,"before"==c);function u(e,t,r){return o(r?e-1:e,1==a[t].level!=r)}var h=ae(a,l,c),d=oe,f=u(l,h,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Vr(e,t){var r=0;t=at(e.doc,t),e.options.lineWrapping||(r=ii(e.display)*t.ch);var i=Ge(e.doc,t.line),n=Xt(i)+wr(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function qr(e,t,r,i,n){var s=et(e,t,r);return s.xRel=n,i&&(s.outside=i),s}function Qr(e,t,r){var i=e.doc;if((r+=e.display.viewOffset)<0)return qr(i.first,0,null,-1,-1);var n=Ze(i,r),s=i.first+i.size-1;if(n>s)return qr(i.first+i.size-1,Ge(i,s).text.length,null,1,1);t<0&&(t=0);for(var o=Ge(i,n);;){var a=Jr(e,o,n,t,r),l=Pt(o,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==n)return c;o=Ge(i,n=c.line)}}function Yr(e,t,r,i){i-=Hr(t);var n=t.text.length,s=se((function(t){return Rr(e,r,t-1).bottom<=i}),n,0);return{begin:s,end:n=se((function(t){return Rr(e,r,t).top>i}),s,n)}}function Zr(e,t,r,i){return r||(r=Or(e,t)),Yr(e,t,r,Xr(e,t,Rr(e,r,i),"line").top)}function $r(e,t,r,i){return!(e.bottom<=r)&&(e.top>r||(i?e.left:e.right)>t)}function Jr(e,t,r,i,n){n-=Xt(t);var s=Or(e,t),o=Hr(t),a=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var h=(e.options.lineWrapping?ti:ei)(e,t,r,s,u,i,n);a=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,f,p=null,g=null,v=se((function(t){var r=Rr(e,s,t);return r.top+=o,r.bottom+=o,!!$r(r,i,n,!1)&&(r.top<=n&&r.left<=i&&(p=t,g=r),!0)}),a,l),m=!1;if(g){var _=i-g.left<g.right-i,y=_==c;v=p+(y?0:1),f=y?"after":"before",d=_?g.left:g.right}else{c||v!=l&&v!=a||v++,f=0==v?"after":v==t.text.length?"before":Rr(e,s,v-(c?1:0)).bottom+o<=n==c?"after":"before";var b=Gr(e,et(r,v,f),"line",t,s);d=b.left,m=n<b.top?-1:n>=b.bottom?1:0}return qr(r,v=ne(t.text,v,1),f,m,i-d)}function ei(e,t,r,i,n,s,o){var a=se((function(a){var l=n[a],c=1!=l.level;return $r(Gr(e,et(r,c?l.to:l.from,c?"before":"after"),"line",t,i),s,o,!0)}),0,n.length-1),l=n[a];if(a>0){var c=1!=l.level,u=Gr(e,et(r,c?l.from:l.to,c?"after":"before"),"line",t,i);$r(u,s,o,!0)&&u.top>o&&(l=n[a-1])}return l}function ti(e,t,r,i,n,s,o){var a=Yr(e,t,i,o),l=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<n.length;d++){var f=n[d];if(!(f.from>=c||f.to<=l)){var p=Rr(e,i,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=p<s?s-p+1e9:p-s;(!u||h>g)&&(u=f,h=g)}}return u||(u=n[n.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function ri(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mr){Mr=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mr.appendChild(document.createTextNode("x")),Mr.appendChild(A("br"));Mr.appendChild(document.createTextNode("x"))}L(e.measure,Mr);var r=Mr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),T(e.measure),r||1}function ii(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),r=A("pre",[t],"CodeMirror-line-like");L(e.measure,r);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function ni(e){for(var t=e.display,r={},i={},n=t.gutters.clientLeft,s=t.gutters.firstChild,o=0;s;s=s.nextSibling,++o){var a=e.display.gutterSpecs[o].className;r[a]=s.offsetLeft+s.clientLeft+n,i[a]=s.clientWidth}return{fixedPos:si(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function si(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function oi(e){var t=ri(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/ii(e.display)-3);return function(n){if(Ut(e.doc,n))return 0;var s=0;if(n.widgets)for(var o=0;o<n.widgets.length;o++)n.widgets[o].height&&(s+=n.widgets[o].height);return r?s+(Math.ceil(n.text.length/i)||1)*t:s+t}}function ai(e){var t=e.doc,r=oi(e);t.iter((function(e){var t=r(e);t!=e.height&&Qe(e,t)}))}function li(e,t,r,i){var n=e.display;if(!r&&"true"==Ce(t).getAttribute("cm-not-content"))return null;var s,o,a=n.lineSpace.getBoundingClientRect();try{s=t.clientX-a.left,o=t.clientY-a.top}catch(e){return null}var l,c=Qr(e,s,o);if(i&&c.xRel>0&&(l=Ge(e.doc,c.line).text).length==c.ch){var u=B(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((s-Er(e.display).left)/ii(e.display))-u))}return c}function ci(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,i=0;i<r.length;i++)if((t-=r[i].size)<0)return i}function ui(e,t,r,i){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),i||(i=0);var n=e.display;if(i&&r<n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)wt&&Kt(e.doc,t)<n.viewTo&&di(e);else if(r<=n.viewFrom)wt&&jt(e.doc,r+i)>n.viewFrom?di(e):(n.viewFrom+=i,n.viewTo+=i);else if(t<=n.viewFrom&&r>=n.viewTo)di(e);else if(t<=n.viewFrom){var s=fi(e,r,r+i,1);s?(n.view=n.view.slice(s.index),n.viewFrom=s.lineN,n.viewTo+=i):di(e)}else if(r>=n.viewTo){var o=fi(e,t,t,-1);o?(n.view=n.view.slice(0,o.index),n.viewTo=o.lineN):di(e)}else{var a=fi(e,t,t,-1),l=fi(e,r,r+i,1);a&&l?(n.view=n.view.slice(0,a.index).concat(nr(e,a.lineN,l.lineN)).concat(n.view.slice(l.index)),n.viewTo+=i):di(e)}var c=n.externalMeasured;c&&(r<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(n.externalMeasured=null))}function hi(e,t,r){e.curOp.viewChanged=!0;var i=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var s=i.view[ci(e,t)];if(null!=s.node){var o=s.changes||(s.changes=[]);-1==j(o,r)&&o.push(r)}}}function di(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fi(e,t,r,i){var n,s=ci(e,t),o=e.display.view;if(!wt||r==e.doc.first+e.doc.size)return{index:s,lineN:r};for(var a=e.display.viewFrom,l=0;l<s;l++)a+=o[l].size;if(a!=t){if(i>0){if(s==o.length-1)return null;n=a+o[s].size-t,s++}else n=a-t;t+=n,r+=n}for(;Kt(e.doc,r)!=r;){if(s==(i<0?0:o.length-1))return null;r+=i*o[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:r}}function pi(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var n=t[i];n.hidden||n.node&&!n.changes||++r}return r}function gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vi(e,t){void 0===t&&(t=!0);for(var r=e.doc,i={},n=i.cursors=document.createDocumentFragment(),s=i.selection=document.createDocumentFragment(),o=0;o<r.sel.ranges.length;o++)if(t||o!=r.sel.primIndex){var a=r.sel.ranges[o];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&mi(e,a.head,n),l||yi(e,a,s)}}return i}function mi(e,t,r){var i=Gr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=r.appendChild(A("div"," ","CodeMirror-cursor"));if(n.style.left=i.left+"px",n.style.top=i.top+"px",n.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var s=r.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=i.other.left+"px",s.style.top=i.other.top+"px",s.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function _i(e,t){return e.top-t.top||e.left-t.left}function yi(e,t,r){var i=e.display,n=e.doc,s=document.createDocumentFragment(),o=Er(e.display),a=o.left,l=Math.max(i.sizerWidth,xr(e)-i.sizer.offsetLeft)-o.right,c="ltr"==n.direction;function u(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?l-e:r)+"px;\n height: "+(i-t)+"px"))}function h(t,r,i){var s,o,h=Ge(n,t),d=h.text.length;function f(r,i){return zr(e,et(t,r),"div",h,i)}function p(t,r,i){var n=Zr(e,h,null,t),s="ltr"==r==("after"==i)?"left":"right";return f("after"==i?n.begin:n.end-(/\s/.test(h.text.charAt(n.end-1))?2:1),s)[s]}var g=ce(h,n.direction);return function(e,t,r,i){if(!e)return i(t,r,"ltr",0);for(var n=!1,s=0;s<e.length;++s){var o=e[s];(o.from<r&&o.to>t||t==r&&o.to==t)&&(i(Math.max(o.from,t),Math.min(o.to,r),1==o.level?"rtl":"ltr",s),n=!0)}n||i(t,r,"ltr")}(g,r||0,null==i?d:i,(function(e,t,n,h){var v="ltr"==n,m=f(e,v?"left":"right"),_=f(t-1,v?"right":"left"),y=null==r&&0==e,b=null==i&&t==d,S=0==h,w=!g||h==g.length-1;if(_.top-m.top<=3){var C=(c?b:y)&&w,E=(c?y:b)&&S?a:(v?m:_).left,k=C?l:(v?_:m).right;u(E,m.top,k-E,m.bottom)}else{var x,T,L,A;v?(x=c&&y&&S?a:m.left,T=c?l:p(e,n,"before"),L=c?a:p(t,n,"after"),A=c&&b&&w?l:_.right):(x=c?p(e,n,"before"):a,T=!c&&y&&S?l:m.right,L=!c&&b&&w?a:_.left,A=c?p(t,n,"after"):l),u(x,m.top,T-x,m.bottom),m.bottom<_.top&&u(a,m.bottom,null,_.top),u(L,_.top,A-L,_.bottom)}(!s||_i(m,s)<0)&&(s=m),_i(_,s)<0&&(s=_),(!o||_i(m,o)<0)&&(o=m),_i(_,o)<0&&(o=_)})),{start:s,end:o}}var d=t.from(),f=t.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Ge(n,d.line),g=Ge(n,f.line),v=Bt(p)==Bt(g),m=h(d.line,d.ch,v?p.text.length+1:null).end,_=h(f.line,v?0:null,f.ch).start;v&&(m.top<_.top-2?(u(m.right,m.top,null,m.bottom),u(a,_.top,_.left,_.bottom)):u(m.right,m.top,_.left-m.right,m.bottom)),m.bottom<_.top&&u(a,m.bottom,null,_.top)}r.appendChild(s)}function bi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Ei(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Si(e){e.state.focused||(e.display.input.focus(),Ci(e))}function wi(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ei(e))}),100)}function Ci(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,M(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),bi(e))}function Ei(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ki(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var n=t.view[i],s=e.options.lineWrapping,l=void 0,c=0;if(!n.hidden){if(o&&a<8){var u=n.node.offsetTop+n.node.offsetHeight;l=u-r,r=u}else{var h=n.node.getBoundingClientRect();l=h.bottom-h.top,!s&&n.text.firstChild&&(c=n.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=n.line.height-l;if((d>.005||d<-.005)&&(Qe(n.line,l),xi(n.line),n.rest))for(var f=0;f<n.rest.length;f++)xi(n.rest[f]);if(c>e.display.sizerWidth){var p=Math.ceil(c/ii(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}}}function xi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;i&&(r.height=i.offsetHeight)}}function Ti(e,t,r){var i=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;i=Math.floor(i-wr(e));var n=r&&null!=r.bottom?r.bottom:i+e.wrapper.clientHeight,s=Ze(t,i),o=Ze(t,n);if(r&&r.ensure){var a=r.ensure.from.line,l=r.ensure.to.line;a<s?(s=a,o=Ze(t,Xt(Ge(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=o&&(s=Ze(t,Xt(Ge(t,l))-e.wrapper.clientHeight),o=l)}return{from:s,to:Math.max(o,s+1)}}function Li(e,t){var r=e.display,i=ri(e.display);t.top<0&&(t.top=0);var n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,s=Tr(e),o={};t.bottom-t.top>s&&(t.bottom=t.top+s);var a=e.doc.height+Cr(r),l=t.top<i,c=t.bottom>a-i;if(t.top<n)o.scrollTop=l?0:t.top;else if(t.bottom>n+s){var u=Math.min(t.top,(c?a:t.bottom)-s);u!=n&&(o.scrollTop=u)}var h=e.options.fixedGutter?0:r.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-h,f=xr(e)-r.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?o.scrollLeft=0:t.left<d?o.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>f+d-3&&(o.scrollLeft=t.right+(p?0:10)-f),o}function Ai(e,t){null!=t&&(Ri(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Di(e){Ri(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Oi(e,t,r){null==t&&null==r||Ri(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Ri(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mi(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function Mi(e,t,r,i){var n=Li(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});Oi(e,n.scrollLeft,n.scrollTop)}function Ii(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||ln(e,{top:t}),Fi(e,t,!0),r&&ln(e),rn(e,100))}function Fi(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pi(e,t,r,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,hn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ni(e){var t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+Cr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:i,scrollHeight:i+kr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Bi=function(e,t,r){this.cm=r;var i=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=n.tabIndex=-1,e(i),e(n),he(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),he(n,"scroll",(function(){n.clientWidth&&t(n.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var n=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(r?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?i:0,bottom:t?i:0}},Bi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bi.prototype.zeroWidthHack=function(){var e=_&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new K,this.disableVert=new K},Bi.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function i(){var n=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}))},Bi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ki=function(){};function ji(e,t){t||(t=Ni(e));var r=e.display.barWidth,i=e.display.barHeight;Ui(e,t);for(var n=0;n<4&&r!=e.display.barWidth||i!=e.display.barHeight;n++)r!=e.display.barWidth&&e.options.lineWrapping&&ki(e),Ui(e,Ni(e)),r=e.display.barWidth,i=e.display.barHeight}function Ui(e,t){var r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Ki.prototype.update=function(){return{bottom:0,right:0}},Ki.prototype.setScrollLeft=function(){},Ki.prototype.setScrollTop=function(){},Ki.prototype.clear=function(){};var Hi={native:Bi,null:Ki};function Xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Hi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Pi(e,t):Ii(e,t)}),e),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)}var Wi=0;function zi(e){var t;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:++Wi},t=e.curOp,sr?sr.ops.push(t):t.ownsGroup=sr={ops:[t],delayedCallbacks:[]}}function Gi(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var i=0;i<e.ops.length;i++){var n=e.ops[i];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(r<t.length)}(r)}finally{sr=null,t(r)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Vi(t[r]);for(var i=0;i<t.length;i++)qi(t[i]);for(var n=0;n<t.length;n++)Qi(t[n]);for(var s=0;s<t.length;s++)Yi(t[s]);for(var o=0;o<t.length;o++)Zi(t[o])}(e)}))}function Vi(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=kr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=kr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&zt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new sn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qi(e){e.updatedDisplay=e.mustUpdate&&on(e.cm,e.update)}function Qi(e){var t=e.cm,r=t.display;e.updatedDisplay&&ki(t),e.barMeasure=Ni(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ar(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+kr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-xr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Yi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==R();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ji(t,e.barMeasure),e.updatedDisplay&&un(t,e.barMeasure),e.selectionChanged&&bi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Si(e.cm)}function Zi(e){var t=e.cm,r=t.display,i=t.doc;e.updatedDisplay&&an(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Fi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Pi(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),n=null;if(t.top+i.top<0?n=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),null!=n&&!p){var s=A("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-wr(e.display))+"px;\n height: "+(t.bottom-t.top+kr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(n),e.display.lineSpace.removeChild(s)}}}(t,function(e,t,r,i){var n;null==i&&(i=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var o=!1,a=Gr(e,t),l=r&&r!=t?Gr(e,r):a,c=Li(e,n={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i}),u=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=c.scrollTop&&(Ii(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=c.scrollLeft&&(Pi(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(o=!0)),!o)break}return n}(t,at(i,e.scrollToPos.from),at(i,e.scrollToPos.to),e.scrollToPos.margin));var n=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(n)for(var o=0;o<n.length;++o)n[o].lines.length||pe(n[o],"hide");if(s)for(var a=0;a<s.length;++a)s[a].lines.length&&pe(s[a],"unhide");r.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function $i(e,t){if(e.curOp)return t();zi(e);try{return t()}finally{Gi(e)}}function Ji(e,t){return function(){if(e.curOp)return t.apply(e,arguments);zi(e);try{return t.apply(e,arguments)}finally{Gi(e)}}}function en(e){return function(){if(this.curOp)return e.apply(this,arguments);zi(this);try{return e.apply(this,arguments)}finally{Gi(this)}}}function tn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);zi(t);try{return e.apply(this,arguments)}finally{Gi(t)}}}function rn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(nn,e))}function nn(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,i=ft(e,t.highlightFrontier),n=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(s){if(i.line>=e.display.viewFrom){var o=s.styles,a=s.text.length>e.options.maxHighlightLength?He(t.mode,i.state):null,l=ht(e,s,i,!0);a&&(i.state=a),s.styles=l.styles;var c=s.styleClasses,u=l.classes;u?s.styleClasses=u:c&&(s.styleClasses=null);for(var h=!o||o.length!=s.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<o.length;++d)h=o[d]!=s.styles[d];h&&n.push(i.line),s.stateAfter=i.save(),i.nextLine()}else s.text.length<=e.options.maxHighlightLength&&pt(e,s.text,i),s.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>r)return rn(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),n.length&&$i(e,(function(){for(var t=0;t<n.length;t++)hi(e,n[t],"text")}))}}var sn=function(e,t,r){var i=e.display;this.viewport=t,this.visible=Ti(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=xr(e),this.force=r,this.dims=ni(e),this.events=[]};function on(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return di(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==pi(e))return!1;dn(e)&&(di(e),t.dims=ni(e));var n=i.first+i.size,s=Math.max(t.visible.from-e.options.viewportMargin,i.first),o=Math.min(n,t.visible.to+e.options.viewportMargin);r.viewFrom<s&&s-r.viewFrom<20&&(s=Math.max(i.first,r.viewFrom)),r.viewTo>o&&r.viewTo-o<20&&(o=Math.min(n,r.viewTo)),wt&&(s=Kt(e.doc,s),o=jt(e.doc,o));var a=s!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var i=e.display;0==i.view.length||t>=i.viewTo||r<=i.viewFrom?(i.view=nr(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=nr(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ci(e,t))),i.viewFrom=t,i.viewTo<r?i.view=i.view.concat(nr(e,i.viewTo,r)):i.viewTo>r&&(i.view=i.view.slice(0,ci(e,r)))),i.viewTo=r}(e,s,o),r.viewOffset=Xt(Ge(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var c=pi(e);if(!a&&0==c&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=R();if(!t||!O(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&O(e.display.lineDiv,i.anchorNode)&&(r.anchorNode=i.anchorNode,r.anchorOffset=i.anchorOffset,r.focusNode=i.focusNode,r.focusOffset=i.focusOffset)}return r}(e);return c>4&&(r.lineDiv.style.display="none"),function(e,t,r){var i=e.display,n=e.options.lineNumbers,s=i.lineDiv,o=s.firstChild;function a(t){var r=t.nextSibling;return l&&_&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var c=i.view,u=i.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==s){for(;o!=d.node;)o=a(o);var f=n&&null!=t&&t<=u&&d.lineNumber;d.changes&&(j(d.changes,"gutter")>-1&&(f=!1),cr(e,d,u,r)),f&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Je(e.options,u)))),o=d.node.nextSibling}else{var p=vr(e,d,u,r);s.insertBefore(p,o)}u+=d.size}for(;o;)o=a(o)}(e,r.updateLineNumbers,t.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=R()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(u),T(r.cursorDiv),T(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,a&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,rn(e,400)),r.updateLineNumbers=null,!0}function an(e,t){for(var r=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=xr(e))i&&(t.visible=Ti(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Cr(e.display)-Tr(e),r.top)}),t.visible=Ti(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!on(e,t))break;ki(e);var n=Ni(e);gi(e),ji(e,n),un(e,n),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ln(e,t){var r=new sn(e,t);if(on(e,r)){ki(e),an(e,r);var i=Ni(e);gi(e),ji(e,i),un(e,i),r.finish()}}function cn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function un(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+kr(e)+"px"}function hn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=si(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,s=i+"px",o=0;o<r.length;o++)if(!r[o].hidden){e.options.fixedGutter&&(r[o].gutter&&(r[o].gutter.style.left=s),r[o].gutterBackground&&(r[o].gutterBackground.style.left=s));var a=r[o].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=i+n+"px")}}function dn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Je(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var n=i.measure.appendChild(A("div",[A("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=n.firstChild.offsetWidth,o=n.offsetWidth-s;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(s,i.lineGutter.offsetWidth-o)+1,i.lineNumWidth=i.lineNumInnerWidth+o,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",cn(e.display),!0}return!1}function fn(e,t){for(var r=[],i=!1,n=0;n<e.length;n++){var s=e[n],o=null;if("string"!=typeof s&&(o=s.style,s=s.className),"CodeMirror-linenumbers"==s){if(!t)continue;i=!0}r.push({className:s,style:o})}return t&&!i&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function pn(e){var t=e.gutters,r=e.gutterSpecs;T(t),e.lineGutter=null;for(var i=0;i<r.length;++i){var n=r[i],s=n.className,o=n.style,a=t.appendChild(A("div",null,"CodeMirror-gutter "+s));o&&(a.style.cssText=o),"CodeMirror-linenumbers"==s&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",cn(e)}function gn(e){pn(e.display),ui(e),hn(e)}function vn(e,t,i,n){var s=this;this.input=i,s.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=D("div",null,"CodeMirror-code"),s.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=A("div",null,"CodeMirror-cursors"),s.measure=A("div",null,"CodeMirror-measure"),s.lineMeasure=A("div",null,"CodeMirror-measure"),s.lineSpace=D("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var c=D("div",[s.lineSpace],"CodeMirror-lines");s.mover=A("div",[c],null,"position: relative"),s.sizer=A("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=A("div",null,null,"position: absolute; height: 50px; width: 1px;"),s.gutters=A("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=A("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=A("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),o&&a<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),l||r&&m||(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=fn(n.gutters,n.lineNumbers),pn(s),i.init(s)}sn.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},sn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var mn=0,_n=null;function yn(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function bn(e){var t=yn(e);return t.x*=_n,t.y*=_n,t}function Sn(e,t){var i=yn(t),n=i.x,s=i.y,o=e.display,a=o.scroller,c=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(n&&c||s&&u){if(s&&_&&l)e:for(var d=t.target,f=o.view;d!=a;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){e.display.currentWheelTarget=d;break e}if(n&&!r&&!h&&null!=_n)return s&&u&&Ii(e,Math.max(0,a.scrollTop+s*_n)),Pi(e,Math.max(0,a.scrollLeft+n*_n)),(!s||s&&u)&&ye(t),void(o.wheelStartX=null);if(s&&null!=_n){var g=s*_n,v=e.doc.scrollTop,m=v+o.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(e.doc.height,m+g+50),ln(e,{top:v,bottom:m})}mn<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=s,setTimeout((function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(_n=(_n*mn+r)/(mn+1),++mn)}}),200)):(o.wheelDX+=n,o.wheelDY+=s))}}o?_n=-.53:r?_n=15:u?_n=-.7:d&&(_n=-1/3);var wn=function(e,t){this.ranges=e,this.primIndex=t};wn.prototype.primary=function(){return this.ranges[this.primIndex]},wn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],i=e.ranges[t];if(!rt(r.anchor,i.anchor)||!rt(r.head,i.head))return!1}return!0},wn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Cn(it(this.ranges[t].anchor),it(this.ranges[t].head));return new wn(e,this.primIndex)},wn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},wn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(tt(t,i.from())>=0&&tt(e,i.to())<=0)return r}return-1};var Cn=function(e,t){this.anchor=e,this.head=t};function En(e,t,r){var i=e&&e.options.selectionsMayTouch,n=t[r];t.sort((function(e,t){return tt(e.from(),t.from())})),r=j(t,n);for(var s=1;s<t.length;s++){var o=t[s],a=t[s-1],l=tt(a.to(),o.from());if(i&&!o.empty()?l>0:l>=0){var c=st(a.from(),o.from()),u=nt(a.to(),o.to()),h=a.empty()?o.from()==o.head:a.from()==a.head;s<=r&&--r,t.splice(--s,2,new Cn(h?u:c,h?c:u))}}return new wn(t,r)}function kn(e,t){return new wn([new Cn(e,t||e)],0)}function xn(e){return e.text?et(e.from.line+e.text.length-1,q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Tn(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return xn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=xn(t).ch-t.to.ch),et(r,i)}function Ln(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var n=e.sel.ranges[i];r.push(new Cn(Tn(n.anchor,t),Tn(n.head,t)))}return En(e.cm,r,e.sel.primIndex)}function An(e,t,r){return e.line==t.line?et(r.line,e.ch-t.ch+r.ch):et(r.line+(e.line-t.line),e.ch)}function Dn(e){e.doc.mode=Ke(e.options,e.doc.modeOption),On(e)}function On(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,rn(e,100),e.state.modeGen++,e.curOp&&ui(e)}function Rn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==q(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mn(e,t,r,i){function n(e){return r?r[e]:null}function s(e,r,n){!function(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Lt(e),At(e,r);var n=i?i(e):1;n!=e.height&&Qe(e,n)}(e,r,n,i),ar(e,"change",e,t)}function o(e,t){for(var r=[],s=e;s<t;++s)r.push(new Gt(c[s],n(s),i));return r}var a=t.from,l=t.to,c=t.text,u=Ge(e,a.line),h=Ge(e,l.line),d=q(c),f=n(c.length-1),p=l.line-a.line;if(t.full)e.insert(0,o(0,c.length)),e.remove(c.length,e.size-c.length);else if(Rn(e,t)){var g=o(0,c.length-1);s(h,h.text,f),p&&e.remove(a.line,p),g.length&&e.insert(a.line,g)}else if(u==h)if(1==c.length)s(u,u.text.slice(0,a.ch)+d+u.text.slice(l.ch),f);else{var v=o(1,c.length-1);v.push(new Gt(d+u.text.slice(l.ch),f,i)),s(u,u.text.slice(0,a.ch)+c[0],n(0)),e.insert(a.line+1,v)}else if(1==c.length)s(u,u.text.slice(0,a.ch)+c[0]+h.text.slice(l.ch),n(0)),e.remove(a.line+1,p);else{s(u,u.text.slice(0,a.ch)+c[0],n(0)),s(h,d+h.text.slice(l.ch),f);var m=o(1,c.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}ar(e,"change",e,t)}function In(e,t,r){!function e(i,n,s){if(i.linked)for(var o=0;o<i.linked.length;++o){var a=i.linked[o];if(a.doc!=n){var l=s&&a.sharedHist;r&&!l||(t(a.doc,l),e(a.doc,i,l))}}}(e,null,!0)}function Fn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ai(e),Dn(e),Pn(e),e.options.lineWrapping||zt(e),e.options.mode=t.modeOption,ui(e)}function Pn(e){("rtl"==e.doc.direction?M:x)(e.display.lineDiv,"CodeMirror-rtl")}function Nn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Bn(e,t){var r={from:it(t.from),to:xn(t),text:Ve(e,t.from,t.to)};return Xn(e,r,t.from.line,t.to.line+1),In(e,(function(e){return Xn(e,r,t.from.line,t.to.line+1)}),!0),r}function Kn(e){for(;e.length&&q(e).ranges;)e.pop()}function jn(e,t,r,i){var n=e.history;n.undone.length=0;var s,o,a=+new Date;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&n.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(s=function(e,t){return t?(Kn(e.done),q(e.done)):e.done.length&&!q(e.done).ranges?q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),q(e.done)):void 0}(n,n.lastOp==i)))o=q(s.changes),0==tt(t.from,t.to)&&0==tt(t.from,o.to)?o.to=xn(t):s.changes.push(Bn(e,t));else{var l=q(n.done);for(l&&l.ranges||Hn(e.sel,n.done),s={changes:[Bn(e,t)],generation:n.generation},n.done.push(s);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(r),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=a,n.lastOp=n.lastSelOp=i,n.lastOrigin=n.lastSelOrigin=t.origin,o||pe(e,"historyAdded")}function Un(e,t,r,i){var n=e.history,s=i&&i.origin;r==n.lastSelOp||s&&n.lastSelOrigin==s&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==s||function(e,t,r,i){var n=t.charAt(0);return"*"==n||"+"==n&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,s,q(n.done),t))?n.done[n.done.length-1]=t:Hn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=s,n.lastSelOp=r,i&&!1!==i.clearRedo&&Kn(n.undone)}function Hn(e,t){var r=q(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Xn(e,t,r,i){var n=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),(function(r){r.markedSpans&&((n||(n=t["spans_"+e.id]={}))[s]=r.markedSpans),++s}))}function Wn(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function zn(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=[],n=0;n<t.text.length;++n)i.push(Wn(r[n]));return i}(e,t),i=xt(e,t);if(!r)return i;if(!i)return r;for(var n=0;n<r.length;++n){var s=r[n],o=i[n];if(s&&o)e:for(var a=0;a<o.length;++a){for(var l=o[a],c=0;c<s.length;++c)if(s[c].marker==l.marker)continue e;s.push(l)}else o&&(r[n]=o)}return r}function Gn(e,t,r){for(var i=[],n=0;n<e.length;++n){var s=e[n];if(s.ranges)i.push(r?wn.prototype.deepCopy.call(s):s);else{var o=s.changes,a=[];i.push({changes:a});for(var l=0;l<o.length;++l){var c=o[l],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&j(t,Number(u[1]))>-1&&(q(a)[h]=c[h],delete c[h])}}}return i}function Vn(e,t,r,i){if(i){var n=e.anchor;if(r){var s=tt(t,n)<0;s!=tt(r,n)<0?(n=t,t=r):s!=tt(t,r)<0&&(t=r)}return new Cn(n,t)}return new Cn(r||t,t)}function qn(e,t,r,i,n){null==n&&(n=e.cm&&(e.cm.display.shift||e.extend)),Jn(e,new wn([Vn(e.sel.primary(),t,r,n)],0),i)}function Qn(e,t,r){for(var i=[],n=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)i[s]=Vn(e.sel.ranges[s],t[s],null,n);Jn(e,En(e.cm,i,e.sel.primIndex),r)}function Yn(e,t,r,i){var n=e.sel.ranges.slice(0);n[t]=r,Jn(e,En(e.cm,n,e.sel.primIndex),i)}function Zn(e,t,r,i){Jn(e,kn(t,r),i)}function $n(e,t,r){var i=e.history.done,n=q(i);n&&n.ranges?(i[i.length-1]=t,es(e,t,r)):Jn(e,t,r)}function Jn(e,t,r){es(e,t,r),Un(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function es(e,t,r){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Cn(at(e,t[r].anchor),at(e,t[r].head))},origin:r&&r.origin};return pe(e,"beforeSelectionChange",e,i),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?En(e.cm,i.ranges,i.ranges.length-1):t}(e,t,r));var i=r&&r.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ts(e,is(e,t,i,!0)),r&&!1===r.scroll||!e.cm||Di(e.cm)}function ts(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),ar(e,"cursorActivity",e))}function rs(e){ts(e,is(e,e.sel,null,!1))}function is(e,t,r,i){for(var n,s=0;s<t.ranges.length;s++){var o=t.ranges[s],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],l=ss(e,o.anchor,a&&a.anchor,r,i),c=ss(e,o.head,a&&a.head,r,i);(n||l!=o.anchor||c!=o.head)&&(n||(n=t.ranges.slice(0,s)),n[s]=new Cn(l,c))}return n?En(e.cm,n,t.primIndex):t}function ns(e,t,r,i,n){var s=Ge(e,t.line);if(s.markedSpans)for(var o=0;o<s.markedSpans.length;++o){var a=s.markedSpans[o],l=a.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(u?a.to>=t.ch:a.to>t.ch))){if(n&&(pe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(s.markedSpans){--o;continue}break}if(!l.atomic)continue;if(r){var h=l.find(i<0?1:-1),d=void 0;if((i<0?u:c)&&(h=os(e,h,-i,h&&h.line==t.line?s:null)),h&&h.line==t.line&&(d=tt(h,r))&&(i<0?d<0:d>0))return ns(e,h,t,i,n)}var f=l.find(i<0?-1:1);return(i<0?c:u)&&(f=os(e,f,i,f.line==t.line?s:null)),f?ns(e,f,t,i,n):null}}return t}function ss(e,t,r,i,n){var s=i||1,o=ns(e,t,r,s,n)||!n&&ns(e,t,r,s,!0)||ns(e,t,r,-s,n)||!n&&ns(e,t,r,-s,!0);return o||(e.cantEdit=!0,et(e.first,0))}function os(e,t,r,i){return r<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:r>0&&t.ch==(i||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+r)}function as(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),H)}function ls(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return r&&(i.update=function(t,r,n,s){t&&(i.from=at(e,t)),r&&(i.to=at(e,r)),n&&(i.text=n),void 0!==s&&(i.origin=s)}),pe(e,"beforeChange",e,i),e.cm&&pe(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function cs(e,t,r){if(e.cm){if(!e.cm.curOp)return Ji(e.cm,cs)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))||(t=ls(e,t,!0))){var i=St&&!r&&function(e,t,r){var i=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||i&&-1!=j(i,r)||(i||(i=[])).push(r)}})),!i)return null;for(var n=[{from:t,to:r}],s=0;s<i.length;++s)for(var o=i[s],a=o.find(0),l=0;l<n.length;++l){var c=n[l];if(!(tt(c.to,a.from)<0||tt(c.from,a.to)>0)){var u=[l,1],h=tt(c.from,a.from),d=tt(c.to,a.to);(h<0||!o.inclusiveLeft&&!h)&&u.push({from:c.from,to:a.from}),(d>0||!o.inclusiveRight&&!d)&&u.push({from:a.to,to:c.to}),n.splice.apply(n,u),l+=u.length-3}}return n}(e,t.from,t.to);if(i)for(var n=i.length-1;n>=0;--n)us(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin});else us(e,t)}}function us(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var r=Ln(e,t);jn(e,t,r,e.cm?e.cm.curOp.id:NaN),fs(e,t,r,xt(e,t));var i=[];In(e,(function(e,r){r||-1!=j(i,e.history)||(ms(e.history,t),i.push(e.history)),fs(e,t,null,xt(e,t))}))}}function hs(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(!i||r){for(var n,s=e.history,o=e.sel,a="undo"==t?s.done:s.undone,l="undo"==t?s.undone:s.done,c=0;c<a.length&&(n=a[c],r?!n.ranges||n.equals(e.sel):n.ranges);c++);if(c!=a.length){for(s.lastOrigin=s.lastSelOrigin=null;;){if(!(n=a.pop()).ranges){if(i)return void a.push(n);break}if(Hn(n,l),r&&!n.equals(e.sel))return void Jn(e,n,{clearRedo:!1});o=n}var u=[];Hn(o,l),l.push({changes:u,generation:s.generation}),s.generation=n.generation||++s.maxGeneration;for(var h=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),d=function(r){var i=n.changes[r];if(i.origin=t,h&&!ls(e,i,!1))return a.length=0,{};u.push(Bn(e,i));var s=r?Ln(e,i):q(a);fs(e,i,s,zn(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:xn(i)});var o=[];In(e,(function(e,t){t||-1!=j(o,e.history)||(ms(e.history,i),o.push(e.history)),fs(e,i,null,zn(e,i))}))},f=n.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.v}}}}function ds(e,t){if(0!=t&&(e.first+=t,e.sel=new wn(Q(e.sel.ranges,(function(e){return new Cn(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){ui(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)hi(e.cm,i,"gutter")}}function fs(e,t,r,i){if(e.cm&&!e.cm.curOp)return Ji(e.cm,fs)(e,t,r,i);if(t.to.line<e.first)ds(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);ds(e,n),t={from:et(e.first,0),to:et(t.to.line+n,t.to.ch),text:[q(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:et(s,Ge(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ve(e,t.from,t.to),r||(r=Ln(e,t)),e.cm?function(e,t,r){var i=e.doc,n=e.display,s=t.from,o=t.to,a=!1,l=s.line;e.options.lineWrapping||(l=Ye(Bt(Ge(i,s.line))),i.iter(l,o.line+1,(function(e){if(e==n.maxLine)return a=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ve(e),Mn(i,t,r,oi(e)),e.options.lineWrapping||(i.iter(l,s.line+t.text.length,(function(e){var t=Wt(e);t>n.maxLineLength&&(n.maxLine=e,n.maxLineLength=t,n.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,i=t-1;i>r;i--){var n=Ge(e,i).stateAfter;if(n&&(!(n instanceof ct)||i+n.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(i,s.line),rn(e,400);var c=t.text.length-(o.line-s.line)-1;t.full?ui(e):s.line!=o.line||1!=t.text.length||Rn(e.doc,t)?ui(e,s.line,o.line+1,c):hi(e,s.line,"text");var u=me(e,"changes"),h=me(e,"change");if(h||u){var d={from:s,to:o,text:t.text,removed:t.removed,origin:t.origin};h&&ar(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,i):Mn(e,t,i),es(e,r,H),e.cantEdit&&ss(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function ps(e,t,r,i,n){var s;i||(i=r),tt(i,r)<0&&(r=(s=[i,r])[0],i=s[1]),"string"==typeof t&&(t=e.splitLines(t)),cs(e,{from:r,to:i,text:t,origin:n})}function gs(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function vs(e,t,r,i){for(var n=0;n<e.length;++n){var s=e[n],o=!0;if(s.ranges){s.copied||((s=e[n]=s.deepCopy()).copied=!0);for(var a=0;a<s.ranges.length;a++)gs(s.ranges[a].anchor,t,r,i),gs(s.ranges[a].head,t,r,i)}else{for(var l=0;l<s.changes.length;++l){var c=s.changes[l];if(r<c.from.line)c.from=et(c.from.line+i,c.from.ch),c.to=et(c.to.line+i,c.to.ch);else if(t<=c.to.line){o=!1;break}}o||(e.splice(0,n+1),n=0)}}}function ms(e,t){var r=t.from.line,i=t.to.line,n=t.text.length-(i-r)-1;vs(e.done,r,i,n),vs(e.undone,r,i,n)}function _s(e,t,r,i){var n=t,s=t;return"number"==typeof t?s=Ge(e,ot(e,t)):n=Ye(t),null==n?null:(i(s,n)&&e.cm&&hi(e.cm,n,r),s)}function ys(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function bs(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var n=e[i];t+=n.chunkSize(),r+=n.height,n.parent=this}this.size=t,this.height=r,this.parent=null}Cn.prototype.from=function(){return st(this.anchor,this.head)},Cn.prototype.to=function(){return nt(this.anchor,this.head)},Cn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ys.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;r<i;++r){var n=this.lines[r];this.height-=n.height,Vt(n),ar(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;e<i;++e)if(r(this.lines[e]))return!0}},bs.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],n=i.chunkSize();if(e<n){var s=Math.min(t,n-e),o=i.height;if(i.removeInner(e,s),this.height-=o-i.height,n==s&&(this.children.splice(r--,1),i.parent=null),0==(t-=s))break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ys))){var a=[];this.collapse(a),this.children=[new ys(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var n=this.children[i],s=n.chunkSize();if(e<=s){if(n.insertInner(e,t,r),n.lines&&n.lines.length>50){for(var o=n.lines.length%25+25,a=o;a<n.lines.length;){var l=new ys(n.lines.slice(a,a+=25));n.height-=l.height,this.children.splice(++i,0,l),l.parent=this}n.lines=n.lines.slice(0,o),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new bs(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=j(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var i=new bs(e.children);i.parent=e,e.children=[i,t],e=i}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var n=this.children[i],s=n.chunkSize();if(e<s){var o=Math.min(t,s-e);if(n.iterN(e,o,r))return!0;if(0==(t-=o))break;e=0}else e-=s}}};var Ss=function(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t};function ws(e,t,r){Xt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ai(e,r)}Ss.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=Ye(r);if(null!=i&&t){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(r.widgets=null);var s=br(this);Qe(r,Math.max(0,r.height-s)),e&&($i(e,(function(){ws(e,r,-s),hi(e,i,"widget")})),ar(e,"lineWidgetCleared",e,this,i))}},Ss.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var n=br(this)-t;n&&(Ut(this.doc,i)||Qe(i,i.height+n),r&&$i(r,(function(){r.curOp.forceUpdate=!0,ws(r,i,n),ar(r,"lineWidgetChanged",r,e,Ye(i))})))},_e(Ss);var Cs=0,Es=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Cs};function ks(e,t,r,i,n){if(i&&i.shared)return function(e,t,r,i,n){(i=N(i)).shared=!1;var s=[ks(e,t,r,i,n)],o=s[0],a=i.widgetNode;return In(e,(function(e){a&&(i.widgetNode=a.cloneNode(!0)),s.push(ks(e,at(e,t),at(e,r),i,n));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;o=q(s)})),new xs(s,o)}(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return Ji(e.cm,ks)(e,t,r,i,n);var s=new Es(e,n),o=tt(t,r);if(i&&N(i,s,!1),o>0||0==o&&!1!==s.clearWhenEmpty)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=D("span",[s.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Nt(e,t.line,t,r,s)||t.line!=r.line&&Nt(e,r.line,t,r,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");wt=!0}s.addToHistory&&jn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a,l=t.line,c=e.cm;if(e.iter(l,r.line+1,(function(e){c&&s.collapsed&&!c.options.lineWrapping&&Bt(e)==c.display.maxLine&&(a=!0),s.collapsed&&l!=t.line&&Qe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Ct(s,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l})),s.collapsed&&e.iter(t.line,r.line+1,(function(t){Ut(e,t)&&Qe(t,0)})),s.clearOnEnter&&he(s,"beforeCursorEnter",(function(){return s.clear()})),s.readOnly&&(St=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Cs,s.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),s.collapsed)ui(c,t.line,r.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var u=t.line;u<=r.line;u++)hi(c,u,"text");s.atomic&&rs(c.doc),ar(c,"markerAdded",c,s)}return s}Es.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&zi(e),me(this,"clear")){var r=this.find();r&&ar(this,"clear",r.from,r.to)}for(var i=null,n=null,s=0;s<this.lines.length;++s){var o=this.lines[s],a=Et(o.markedSpans,this);e&&!this.collapsed?hi(e,Ye(o),"text"):e&&(null!=a.to&&(n=Ye(o)),null!=a.from&&(i=Ye(o))),o.markedSpans=kt(o.markedSpans,a),null==a.from&&this.collapsed&&!Ut(this.doc,o)&&e&&Qe(o,ri(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Bt(this.lines[l]),u=Wt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&ui(e,i,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&rs(e.doc)),e&&ar(e,"markerCleared",e,this,i,n),t&&Gi(e),this.parent&&this.parent.clear()}},Es.prototype.find=function(e,t){var r,i;null==e&&"bookmark"==this.type&&(e=1);for(var n=0;n<this.lines.length;++n){var s=this.lines[n],o=Et(s.markedSpans,this);if(null!=o.from&&(r=et(t?s:Ye(s),o.from),-1==e))return r;if(null!=o.to&&(i=et(t?s:Ye(s),o.to),1==e))return i}return r&&{from:r,to:i}},Es.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;t&&i&&$i(i,(function(){var n=t.line,s=Ye(t.line),o=Dr(i,s);if(o&&(Nr(o),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Ut(r.doc,n)&&null!=r.height){var a=r.height;r.height=null;var l=br(r)-a;l&&Qe(n,n.height+l)}ar(i,"markerChanged",i,e)}))},Es.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=j(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Es.prototype.detachLine=function(e){if(this.lines.splice(j(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},_e(Es);var xs=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Ts(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ls(e){for(var t=function(t){var r=e[t],i=[r.primary.doc];In(r.primary.doc,(function(e){return i.push(e)}));for(var n=0;n<r.markers.length;n++){var s=r.markers[n];-1==j(i,s.doc)&&(s.parent=null,r.markers.splice(n--,1))}},r=0;r<e.length;r++)t(r)}xs.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ar(this,"clear")}},xs.prototype.find=function(e,t){return this.primary.find(e,t)},_e(xs);var As=0,Ds=function(e,t,r,i,n){if(!(this instanceof Ds))return new Ds(e,t,r,i,n);null==r&&(r=0),bs.call(this,[new ys([new Gt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var s=et(r,0);this.sel=kn(s),this.history=new Nn(null),this.id=++As,this.modeOption=t,this.lineSep=i,this.direction="rtl"==n?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mn(this,{from:s,to:s,text:e}),Jn(this,kn(s),H)};Ds.prototype=Z(bs.prototype,{constructor:Ds,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:tn((function(e){var t=et(this.first,0),r=this.first+this.size-1;cs(this,{from:t,to:et(r,Ge(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Oi(this.cm,0,0),Jn(this,kn(t),H)})),replaceRange:function(e,t,r,i){ps(this,e,t=at(this,t),r=r?at(this,r):t,i)},getRange:function(e,t,r){var i=Ve(this,at(this,e),at(this,t));return!1===r?i:i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if($e(this,e))return Ge(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),Bt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return at(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:tn((function(e,t,r){Zn(this,at(this,"number"==typeof e?et(e,t||0):e),null,r)})),setSelection:tn((function(e,t,r){Zn(this,at(this,e),at(this,t||e),r)})),extendSelection:tn((function(e,t,r){qn(this,at(this,e),t&&at(this,t),r)})),extendSelections:tn((function(e,t){Qn(this,lt(this,e),t)})),extendSelectionsBy:tn((function(e,t){Qn(this,lt(this,Q(this.sel.ranges,e)),t)})),setSelections:tn((function(e,t,r){if(e.length){for(var i=[],n=0;n<e.length;n++)i[n]=new Cn(at(this,e[n].anchor),at(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Jn(this,En(this.cm,i,t),r)}})),addSelection:tn((function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new Cn(at(this,e),at(this,t||e))),Jn(this,En(this.cm,i,i.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,i=0;i<r.length;i++){var n=Ve(this,r[i].from(),r[i].to());t=t?t.concat(n):n}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var n=Ve(this,r[i].from(),r[i].to());!1!==e&&(n=n.join(e||this.lineSeparator())),t[i]=n}return t},replaceSelection:function(e,t,r){for(var i=[],n=0;n<this.sel.ranges.length;n++)i[n]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:tn((function(e,t,r){for(var i=[],n=this.sel,s=0;s<n.ranges.length;s++){var o=n.ranges[s];i[s]={from:o.from(),to:o.to(),text:this.splitLines(e[s]),origin:r}}for(var a=t&&"end"!=t&&function(e,t,r){for(var i=[],n=et(e.first,0),s=n,o=0;o<t.length;o++){var a=t[o],l=An(a.from,n,s),c=An(xn(a),n,s);if(n=a.to,s=c,"around"==r){var u=e.sel.ranges[o],h=tt(u.head,u.anchor)<0;i[o]=new Cn(h?c:l,h?l:c)}else i[o]=new Cn(l,l)}return new wn(i,e.sel.primIndex)}(this,i,t),l=i.length-1;l>=0;l--)cs(this,i[l]);a?$n(this,a):this.cm&&Di(this.cm)})),undo:tn((function(){hs(this,"undo")})),redo:tn((function(){hs(this,"redo")})),undoSelection:tn((function(){hs(this,"undo",!0)})),redoSelection:tn((function(){hs(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Nn(this.history.maxGeneration),In(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Gn(this.history.done),undone:Gn(this.history.undone)}},setHistory:function(e){var t=this.history=new Nn(this.history.maxGeneration);t.done=Gn(e.done.slice(0),null,!0),t.undone=Gn(e.undone.slice(0),null,!0)},setGutterMarker:tn((function(e,t,r){return _s(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=r,!r&&te(i)&&(e.gutterMarkers=null),!0}))})),clearGutter:tn((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&_s(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,te(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!$e(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Ye(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:tn((function(e,t,r){return _s(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(E(r).test(e[i]))return!1;e[i]+=" "+r}else e[i]=r;return!0}))})),removeLineClass:tn((function(e,t,r){return _s(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",n=e[i];if(!n)return!1;if(null==r)e[i]=null;else{var s=n.match(E(r));if(!s)return!1;var o=s.index+s[0].length;e[i]=n.slice(0,s.index)+(s.index&&o!=n.length?" ":"")+n.slice(o)||null}return!0}))})),addLineWidget:tn((function(e,t,r){return function(e,t,r,i){var n=new Ss(e,r,i),s=e.cm;return s&&n.noHScroll&&(s.display.alignWidgets=!0),_s(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==n.insertAt?r.push(n):r.splice(Math.min(r.length-1,Math.max(0,n.insertAt)),0,n),n.line=t,s&&!Ut(e,t)){var i=Xt(t)<e.scrollTop;Qe(t,t.height+br(n)),i&&Ai(s,n.height),s.curOp.forceUpdate=!0}return!0})),s&&ar(s,"lineWidgetAdded",s,n,"number"==typeof t?t:Ye(t)),n}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ks(this,at(this,e),at(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return ks(this,e=at(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Ge(this,(e=at(this,e)).line).markedSpans;if(r)for(var i=0;i<r.length;++i){var n=r[i];(null==n.from||n.from<=e.ch)&&(null==n.to||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,r){e=at(this,e),t=at(this,t);var i=[],n=e.line;return this.iter(e.line,t.line+1,(function(s){var o=s.markedSpans;if(o)for(var a=0;a<o.length;a++){var l=o[a];null!=l.to&&n==e.line&&e.ch>=l.to||null==l.from&&n!=e.line||null!=l.from&&n==t.line&&l.from>=t.ch||r&&!r(l.marker)||i.push(l.marker.parent||l.marker)}++n})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)null!=r[i].from&&e.push(r[i].marker)})),e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;return this.iter((function(n){var s=n.text.length+i;if(s>e)return t=e,!0;e-=s,++r})),at(this,et(r,t))},indexFromPos:function(e){var t=(e=at(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Ds(qe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var i=new Ds(qe(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=i.find(),s=e.clipPos(n.from),o=e.clipPos(n.to);if(tt(s,o)){var a=ks(e,s,o,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}(i,Ts(this)),i},unlinkDoc:function(e){if(e instanceof To&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ls(Ts(this));break}if(e.history==this.history){var r=[e.id];In(e,(function(e){return r.push(e.id)}),!0),e.history=new Nn(null),e.history.done=Gn(this.history.done,r),e.history.undone=Gn(this.history.undone,r)}},iterLinkedDocs:function(e){In(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Oe(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:tn((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&$i(t=this.cm,(function(){Pn(t),ui(t)})))}))}),Ds.prototype.eachLine=Ds.prototype.iter;var Os=0;function Rs(e){var t=this;if(Ms(t),!ge(t,e)&&!Sr(t.display,e)){ye(e),o&&(Os=+new Date);var r=li(t,e,!0),i=e.dataTransfer.files;if(r&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var n=i.length,s=Array(n),a=0,l=function(){++a==n&&Ji(t,(function(){var e={from:r=at(t.doc,r),to:r,text:t.doc.splitLines(s.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};cs(t.doc,e),$n(t.doc,kn(at(t.doc,r),at(t.doc,xn(e))))}))()},c=function(e,r){if(t.options.allowDropFileTypes&&-1==j(t.options.allowDropFileTypes,e.type))l();else{var i=new FileReader;i.onerror=function(){return l()},i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(s[r]=e),l()},i.readAsText(e)}},u=0;u<i.length;u++)c(i[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),es(t.doc,kn(r,r)),d)for(var f=0;f<d.length;++f)ps(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ms(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Is(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],i=0;i<t.length;i++){var n=t[i].CodeMirror;n&&r.push(n)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Fs=!1;function Ps(){var e;Fs||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Is(Ns)}),100))})),he(window,"blur",(function(){return Is(Ei)})),Fs=!0)}function Ns(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Bs={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"},Ks=0;Ks<10;Ks++)Bs[Ks+48]=Bs[Ks+96]=String(Ks);for(var js=65;js<=90;js++)Bs[js]=String.fromCharCode(js);for(var Us=1;Us<=12;Us++)Bs[Us+111]=Bs[Us+63235]="F"+Us;var Hs={};function Xs(e){var t,r,i,n,s=e.split(/-(?!$)/);e=s[s.length-1];for(var o=0;o<s.length-1;o++){var a=s[o];if(/^(cmd|meta|m)$/i.test(a))n=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),n&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ws(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==i){delete e[r];continue}for(var n=Q(r.split(" "),Xs),s=0;s<n.length;s++){var o=void 0,a=void 0;s==n.length-1?(a=n.join(" "),o=i):(a=n.slice(0,s+1).join(" "),o="...");var l=t[a];if(l){if(l!=o)throw new Error("Inconsistent bindings for "+a)}else t[a]=o}delete e[r]}for(var c in t)e[c]=t[c];return e}function zs(e,t,r,i){var n=(t=Qs(t)).call?t.call(e,i):t[e];if(!1===n)return"nothing";if("..."===n)return"multi";if(null!=n&&r(n))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return zs(e,t.fallthrough,r,i);for(var s=0;s<t.fallthrough.length;s++){var o=zs(e,t.fallthrough[s],r,i);if(o)return o}}}function Gs(e){var t="string"==typeof e?e:Bs[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Vs(e,t,r){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function qs(e,t){if(h&&34==e.keyCode&&e.char)return!1;var r=Bs[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Vs(r,e,t))}function Qs(e){return"string"==typeof e?Hs[e]:e}function Ys(e,t){for(var r=e.doc.sel.ranges,i=[],n=0;n<r.length;n++){for(var s=t(r[n]);i.length&&tt(s.from,q(i).to)<=0;){var o=i.pop();if(tt(o.from,s.from)<0){s.from=o.from;break}}i.push(s)}$i(e,(function(){for(var t=i.length-1;t>=0;t--)ps(e.doc,"",i[t].from,i[t].to,"+delete");Di(e)}))}function Zs(e,t,r){var i=ne(e.text,t+r,r);return i<0||i>e.text.length?null:i}function $s(e,t,r){var i=Zs(e,t.ch,r);return null==i?null:new et(t.line,i,r<0?"after":"before")}function Js(e,t,r,i,n){if(e){"rtl"==t.doc.direction&&(n=-n);var s=ce(r,t.doc.direction);if(s){var o,a=n<0?q(s):s[0],l=n<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=Or(t,r);o=n<0?r.text.length-1:0;var u=Rr(t,c,o).top;o=se((function(e){return Rr(t,c,e).top==u}),n<0==(1==a.level)?a.from:a.to-1,o),"before"==l&&(o=Zs(r,o,1))}else o=n<0?a.to:a.from;return new et(i,o,l)}}return new et(i,n<0?r.text.length:0,n<0?"before":"after")}Hs.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"},Hs.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"},Hs.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"},Hs.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"]},Hs.default=_?Hs.macDefault:Hs.pcDefault;var eo={selectAll:as,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return Ys(e,(function(t){if(t.empty()){var r=Ge(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Ys(e,(function(t){return{from:et(t.from().line,0),to:at(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Ys(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Ys(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Ys(e,(function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}}))},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(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return to(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ro(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Ge(e.doc,t),i=function(e){for(var t;t=Ft(e);)e=t.find(1,!0).line;return e}(r);return i!=r&&(t=Ye(i)),Js(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),W)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),W)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?ro(e,t.head):i}),W)},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("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),i=e.options.tabSize,n=0;n<r.length;n++){var s=r[n].from(),o=B(e.getLine(s.line),s.ch,i);t.push(V(i-o%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return $i(e,(function(){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++)if(t[i].empty()){var n=t[i].head,s=Ge(e.doc,n.line).text;if(s)if(n.ch==s.length&&(n=new et(n.line,n.ch-1)),n.ch>0)n=new et(n.line,n.ch+1),e.replaceRange(s.charAt(n.ch-1)+s.charAt(n.ch-2),et(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var o=Ge(e.doc,n.line-1).text;o&&(n=new et(n.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),et(n.line-1,o.length-1),n,"+transpose"))}r.push(new Cn(n,n))}e.setSelections(r)}))},newlineAndIndent:function(e){return $i(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Di(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function to(e,t){var r=Ge(e.doc,t),i=Bt(r);return i!=r&&(t=Ye(i)),Js(!0,e,i,t,1)}function ro(e,t){var r=to(e,t.line),i=Ge(e.doc,r.line),n=ce(i,e.doc.direction);if(!n||0==n[0].level){var s=Math.max(r.ch,i.text.search(/\S/)),o=t.line==r.line&&t.ch<=s&&t.ch;return et(r.line,o?0:s,r.sticky)}return r}function io(e,t,r){if("string"==typeof t&&!(t=eo[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),n=t(e)!=U}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}var no=new K;function so(e,t,r,i){var n=e.state.keySeq;if(n){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:no.set(50,(function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())})),oo(e,n+" "+t,r,i))return!0}return oo(e,t,r,i)}function oo(e,t,r,i){var n=function(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var n=zs(t,e.state.keyMaps[i],r,e);if(n)return n}return e.options.extraKeys&&zs(t,e.options.extraKeys,r,e)||zs(t,e.options.keyMap,r,e)}(e,t,i);return"multi"==n&&(e.state.keySeq=t),"handled"==n&&ar(e,"keyHandled",e,t,r),"handled"!=n&&"multi"!=n||(ye(r),bi(e)),!!n}function ao(e,t){var r=qs(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?so(e,"Shift-"+r,t,(function(t){return io(e,t,!0)}))||so(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return io(e,t)})):so(e,r,t,(function(t){return io(e,t)})))}var lo=null;function co(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=R(),ge(t,e)))){o&&a<11&&27==e.keyCode&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=16==i||e.shiftKey;var n=ao(t,e);h&&(lo=n?i:null,n||88!=i||Me||!(_?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),r&&!_&&!n&&46==i&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(x(t,"CodeMirror-crosshair"),fe(document,"keyup",r),fe(document,"mouseover",r))}M(t,"CodeMirror-crosshair"),he(document,"keyup",r),he(document,"mouseover",r)}(t)}}function uo(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function ho(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Sr(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||_&&e.metaKey)){var r=e.keyCode,i=e.charCode;if(h&&r==lo)return lo=null,void ye(e);if(!h||e.which&&!(e.which<10)||!ao(t,e)){var n=String.fromCharCode(null==i?r:i);"\b"!=n&&(function(e,t,r){return so(e,"'"+r+"'",t,(function(t){return io(e,t,!0)}))}(t,e,n)||t.display.input.onKeyPress(e))}}}var fo,po,go=function(e,t,r){this.time=e,this.pos=t,this.button=r};function vo(e){var t=this,r=t.display;if(!(ge(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,Sr(r,e))l||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!yo(t,e)){var i=li(t,e),n=Ee(e),s=i?function(e,t){var r=+new Date;return po&&po.compare(r,e,t)?(fo=po=null,"triple"):fo&&fo.compare(r,e,t)?(po=new go(r,e,t),fo=null,"double"):(fo=new go(r,e,t),po=null,"single")}(i,n):"single";window.focus(),1==n&&t.state.selectingText&&t.state.selectingText(e),i&&function(e,t,r,i,n){var s="Click";return"double"==i?s="Double"+s:"triple"==i&&(s="Triple"+s),so(e,Vs(s=(1==t?"Left":2==t?"Middle":"Right")+s,n),n,(function(t){if("string"==typeof t&&(t=eo[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,r)!=U}finally{e.state.suppressEdits=!1}return i}))}(t,n,i,s,e)||(1==n?i?function(e,t,r,i){o?setTimeout(P(Si,e),0):e.curOp.focus=R();var n,s=function(e,t,r){var i=e.getOption("configureMouse"),n=i?i(e,t,r):{};if(null==n.unit){var s=y?r.shiftKey&&r.metaKey:r.altKey;n.unit=s?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==n.extend||e.doc.extend)&&(n.extend=e.doc.extend||r.shiftKey),null==n.addNew&&(n.addNew=_?r.metaKey:r.ctrlKey),null==n.moveOnDrag&&(n.moveOnDrag=!(_?r.altKey:r.ctrlKey)),n}(e,r,i),c=e.doc.sel;e.options.dragDrop&&Te&&!e.isReadOnly()&&"single"==r&&(n=c.contains(t))>-1&&(tt((n=c.ranges[n]).from(),t)<0||t.xRel>0)&&(tt(n.to(),t)>0||t.xRel<0)?function(e,t,r,i){var n=e.display,s=!1,c=Ji(e,(function(t){l&&(n.scroller.draggable=!1),e.state.draggingText=!1,fe(n.wrapper.ownerDocument,"mouseup",c),fe(n.wrapper.ownerDocument,"mousemove",u),fe(n.scroller,"dragstart",h),fe(n.scroller,"drop",c),s||(ye(t),i.addNew||qn(e.doc,r,null,null,i.extend),l&&!d||o&&9==a?setTimeout((function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()}),20):n.input.focus())})),u=function(e){s=s||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return s=!0};l&&(n.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),he(n.wrapper.ownerDocument,"mouseup",c),he(n.wrapper.ownerDocument,"mousemove",u),he(n.scroller,"dragstart",h),he(n.scroller,"drop",c),wi(e),setTimeout((function(){return n.input.focus()}),20)}(e,i,t,s):function(e,t,r,i){var n=e.display,s=e.doc;ye(t);var o,a,l=s.sel,c=l.ranges;if(i.addNew&&!i.extend?(a=s.sel.contains(r),o=a>-1?c[a]:new Cn(r,r)):(o=s.sel.primary(),a=s.sel.primIndex),"rectangle"==i.unit)i.addNew||(o=new Cn(r,r)),r=li(e,t,!0,!0),a=-1;else{var u=mo(e,r,i.unit);o=i.extend?Vn(o,u.anchor,u.head,i.extend):u}i.addNew?-1==a?(a=c.length,Jn(s,En(e,c.concat([o]),a),{scroll:!1,origin:"*mouse"})):c.length>1&&c[a].empty()&&"char"==i.unit&&!i.extend?(Jn(s,En(e,c.slice(0,a).concat(c.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=s.sel):Yn(s,a,o,X):(a=0,Jn(s,new wn([o],0),X),l=s.sel);var h=r;function d(t){if(0!=tt(h,t))if(h=t,"rectangle"==i.unit){for(var n=[],c=e.options.tabSize,u=B(Ge(s,r.line).text,r.ch,c),d=B(Ge(s,t.line).text,t.ch,c),f=Math.min(u,d),p=Math.max(u,d),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var m=Ge(s,g).text,_=z(m,f,c);f==p?n.push(new Cn(et(g,_),et(g,_))):m.length>_&&n.push(new Cn(et(g,_),et(g,z(m,p,c))))}n.length||n.push(new Cn(r,r)),Jn(s,En(e,l.ranges.slice(0,a).concat(n),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,b=o,S=mo(e,t,i.unit),w=b.anchor;tt(S.anchor,w)>0?(y=S.head,w=st(b.from(),S.anchor)):(y=S.anchor,w=nt(b.to(),S.head));var C=l.ranges.slice(0);C[a]=function(e,t){var r=t.anchor,i=t.head,n=Ge(e.doc,r.line);if(0==tt(r,i)&&r.sticky==i.sticky)return t;var s=ce(n);if(!s)return t;var o=ae(s,r.ch,r.sticky),a=s[o];if(a.from!=r.ch&&a.to!=r.ch)return t;var l,c=o+(a.from==r.ch==(1!=a.level)?0:1);if(0==c||c==s.length)return t;if(i.line!=r.line)l=(i.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ae(s,i.ch,i.sticky),h=u-o||(i.ch-r.ch)*(1==a.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=s[c+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return r.ch==p&&r.sticky==g?t:new Cn(new et(r.line,p,g),i)}(e,new Cn(at(s,w),y)),Jn(s,En(e,C,a),X)}}var f=n.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,t&&(ye(t),n.input.focus()),fe(n.wrapper.ownerDocument,"mousemove",v),fe(n.wrapper.ownerDocument,"mouseup",m),s.history.lastSelOrigin=null}var v=Ji(e,(function(t){0!==t.buttons&&Ee(t)?function t(r){var o=++p,a=li(e,r,!0,"rectangle"==i.unit);if(a)if(0!=tt(a,h)){e.curOp.focus=R(),d(a);var l=Ti(n,s);(a.line>=l.to||a.line<l.from)&&setTimeout(Ji(e,(function(){p==o&&t(r)})),150)}else{var c=r.clientY<f.top?-20:r.clientY>f.bottom?20:0;c&&setTimeout(Ji(e,(function(){p==o&&(n.scroller.scrollTop+=c,t(r))})),50)}}(t):g(t)})),m=Ji(e,g);e.state.selectingText=m,he(n.wrapper.ownerDocument,"mousemove",v),he(n.wrapper.ownerDocument,"mouseup",m)}(e,i,t,s)}(t,i,s,e):Ce(e)==r.scroller&&ye(e):2==n?(i&&qn(t.doc,i),setTimeout((function(){return r.input.focus()}),20)):3==n&&(C?t.display.input.onContextMenu(e):wi(t)))}}function mo(e,t,r){if("char"==r)return new Cn(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Cn(et(t.line,0),at(e.doc,et(t.line+1,0)));var i=r(e,t);return new Cn(i.from,i.to)}function _o(e,t,r,i){var n,s;if(t.touches)n=t.touches[0].clientX,s=t.touches[0].clientY;else try{n=t.clientX,s=t.clientY}catch(e){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ye(t);var o=e.display,a=o.lineDiv.getBoundingClientRect();if(s>a.bottom||!me(e,r))return Se(t);s-=a.top-o.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=o.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=n)return pe(e,r,e,Ze(e.doc,s),e.display.gutterSpecs[l].className,t),Se(t)}}function yo(e,t){return _o(e,t,"gutterClick",!0)}function bo(e,t){Sr(e.display,t)||function(e,t){return!!me(e,"gutterContextMenu")&&_o(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function So(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Kr(e)}go.prototype.compare=function(e,t,r){return this.time+400>e&&0==tt(t,this.pos)&&r==this.button};var wo={toString:function(){return"CodeMirror.Init"}},Co={},Eo={};function ko(e,t,r){if(!t!=!(r&&r!=wo)){var i=e.display.dragFunctions,n=t?he:fe;n(e.display.scroller,"dragstart",i.start),n(e.display.scroller,"dragenter",i.enter),n(e.display.scroller,"dragover",i.over),n(e.display.scroller,"dragleave",i.leave),n(e.display.scroller,"drop",i.drop)}}function xo(e){e.options.lineWrapping?(M(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),zt(e)),ai(e),ui(e),Kr(e),setTimeout((function(){return ji(e)}),100)}function To(e,t){var r=this;if(!(this instanceof To))return new To(e,t);this.options=t=t?N(t):{},N(Co,t,!1);var i=t.value;"string"==typeof i?i=new Ds(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var n=new To.inputStyles[t.inputStyle](this),s=this.display=new vn(e,i,n,t);for(var c in s.wrapper.CodeMirror=this,So(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Xi(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 K,keySeq:null,specialChars:null},t.autofocus&&!m&&s.input.focus(),o&&a<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",Ji(e,vo)),he(t.scroller,"dblclick",o&&a<11?Ji(e,(function(t){if(!ge(e,t)){var r=li(e,t);if(r&&!yo(e,t)&&!Sr(e.display,t)){ye(t);var i=e.findWordAt(r);qn(e.doc,i.anchor,i.head)}}})):function(t){return ge(e,t)||ye(t)}),he(t.scroller,"contextmenu",(function(t){return bo(e,t)})),he(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||bo(e,r)}));var r,i={end:0};function n(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return!0;var r=t.left-e.left,i=t.top-e.top;return r*r+i*i>400}he(t.scroller,"touchstart",(function(n){if(!ge(e,n)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(n)&&!yo(e,n)){t.input.ensurePolled(),clearTimeout(r);var s=+new Date;t.activeTouch={start:s,moved:!1,prev:s-i.end<=300?i:null},1==n.touches.length&&(t.activeTouch.left=n.touches[0].pageX,t.activeTouch.top=n.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(r){var i=t.activeTouch;if(i&&!Sr(t,r)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!i.prev||s(i,i.prev)?new Cn(a,a):!i.prev.prev||s(i,i.prev.prev)?e.findWordAt(a):new Cn(et(a.line,0),at(e.doc,et(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ye(r)}n()})),he(t.scroller,"touchcancel",n),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ii(e,t.scroller.scrollTop),Pi(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return Sn(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return Sn(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||we(t)},over:function(t){ge(e,t)||(function(e,t){var r=li(e,t);if(r){var i=document.createDocumentFragment();mi(e,r,i),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),L(e.display.dragCursor,i)}}(e,t),we(t))},start:function(t){return function(e,t){if(o&&(!e.state.draggingText||+new Date-Os<100))we(t);else if(!ge(e,t)&&!Sr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var r=A("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),h&&r.parentNode.removeChild(r)}}(e,t)},drop:Ji(e,Rs),leave:function(t){ge(e,t)||Ms(e)}};var l=t.input.getField();he(l,"keyup",(function(t){return uo.call(e,t)})),he(l,"keydown",Ji(e,co)),he(l,"keypress",Ji(e,ho)),he(l,"focus",(function(t){return Ci(e,t)})),he(l,"blur",(function(t){return Ei(e,t)}))}(this),Ps(),zi(this),this.curOp.forceUpdate=!0,Fn(this,i),t.autofocus&&!m||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&Ci(r)}),20):Ei(this),Eo)Eo.hasOwnProperty(c)&&Eo[c](this,t[c],wo);dn(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Lo.length;++u)Lo[u](this);Gi(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(s.lineDiv).textRendering&&(s.lineDiv.style.textRendering="auto")}To.defaults=Co,To.optionHandlers=Eo;var Lo=[];function Ao(e,t,r,i){var n,s=e.doc;null==r&&(r="add"),"smart"==r&&(s.mode.indent?n=ft(e,t).state:r="prev");var o=e.options.tabSize,a=Ge(s,t),l=B(a.text,null,o);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==r&&((c=s.mode.indent(n,a.text.slice(u.length),a.text))==U||c>150)){if(!i)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>s.first?B(Ge(s,t-1).text,null,o):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/o);f;--f)d+=o,h+="\t";if(d<c&&(h+=V(c-d)),h!=u)return ps(s,h,et(t,0),et(t,u.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<s.sel.ranges.length;p++){var g=s.sel.ranges[p];if(g.head.line==t&&g.head.ch<u.length){var v=et(t,u.length);Yn(s,p,new Cn(v,v));break}}}To.defineInitHook=function(e){return Lo.push(e)};var Do=null;function Oo(e){Do=e}function Ro(e,t,r,i,n){var s=e.doc;e.display.shift=!1,i||(i=s.sel);var o=+new Date-200,a="paste"==n||e.state.pasteIncoming>o,l=Oe(t),c=null;if(a&&i.ranges.length>1)if(Do&&Do.text.join("\n")==t){if(i.ranges.length%Do.text.length==0){c=[];for(var u=0;u<Do.text.length;u++)c.push(s.splitLines(Do.text[u]))}}else l.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(c=Q(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=i.ranges.length-1;d>=0;d--){var f=i.ranges[d],p=f.from(),g=f.to();f.empty()&&(r&&r>0?p=et(p.line,p.ch-r):e.state.overwrite&&!a?g=et(g.line,Math.min(Ge(s,g.line).text.length,g.ch+q(l).length)):a&&Do&&Do.lineWise&&Do.text.join("\n")==l.join("\n")&&(p=g=et(p.line,0)));var v={from:p,to:g,text:c?c[d%c.length]:l,origin:n||(a?"paste":e.state.cutIncoming>o?"cut":"+input")};cs(e.doc,v),ar(e,"inputRead",e,v)}t&&!a&&Io(e,t),Di(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Mo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||$i(t,(function(){return Ro(t,r,0,null,"paste")})),!0}function Io(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,i=r.ranges.length-1;i>=0;i--){var n=r.ranges[i];if(!(n.head.ch>100||i&&r.ranges[i-1].head.line==n.head.line)){var s=e.getModeAt(n.head),o=!1;if(s.electricChars){for(var a=0;a<s.electricChars.length;a++)if(t.indexOf(s.electricChars.charAt(a))>-1){o=Ao(e,n.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(Ge(e.doc,n.head.line).text.slice(0,n.head.ch))&&(o=Ao(e,n.head.line,"smart"));o&&ar(e,"electricInput",e,n.head.line)}}}function Fo(e){for(var t=[],r=[],i=0;i<e.doc.sel.ranges.length;i++){var n=e.doc.sel.ranges[i].head.line,s={anchor:et(n,0),head:et(n+1,0)};r.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:r}}function Po(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function No(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Po(e),t}function Bo(e,t,r,i,n){var s=t,o=r,a=Ge(e,t.line),l=n&&"rtl"==e.direction?-r:r;function c(s){var o,c;if("codepoint"==i){var u=a.text.charCodeAt(t.ch+(i>0?0:-1));o=isNaN(u)?null:new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+r*(u>=55296&&u<56320?2:1))),-r)}else o=n?function(e,t,r,i){var n=ce(t,e.doc.direction);if(!n)return $s(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var s=ae(n,r.ch,r.sticky),o=n[s];if("ltr"==e.doc.direction&&o.level%2==0&&(i>0?o.to>r.ch:o.from<r.ch))return $s(t,r,i);var a,l=function(e,r){return Zs(t,e instanceof et?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(a=a||Or(e,t),Zr(e,t,a,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?l(r,-1):r.ch);if("rtl"==e.doc.direction||1==o.level){var h=1==o.level==i<0,d=l(r,h?1:-1);if(null!=d&&(h?d<=o.to&&d<=u.end:d>=o.from&&d>=u.begin)){var f=h?"before":"after";return new et(r.line,d,f)}}var p=function(e,t,i){for(var s=function(e,t){return t?new et(r.line,l(e,1),"before"):new et(r.line,e,"after")};e>=0&&e<n.length;e+=t){var o=n[e],a=t>0==(1!=o.level),c=a?i.begin:l(i.end,-1);if(o.from<=c&&c<o.to)return s(c,a);if(c=a?o.from:l(o.to,-1),i.begin<=c&&c<i.end)return s(c,a)}},g=p(s+i,i,u);if(g)return g;var v=i>0?u.end:l(u.begin,-1);return null==v||i>0&&v==t.text.length||!(g=p(i>0?0:n.length-1,i,c(v)))?null:g}(e.cm,a,t,r):$s(a,t,r);if(null==o){if(s||(c=t.line+l)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(a=Ge(e,c))))return!1;t=Js(n,e.cm,a,t.line,l)}else t=o;return!0}if("char"==i||"codepoint"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var u=null,h="group"==i,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||c(!f);f=!1){var p=a.text.charAt(t.ch)||"\n",g=ee(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||g||(g="s"),u&&u!=g){r<0&&(r=1,c(),t.sticky="after");break}if(g&&(u=g),r>0&&!c(!f))break}var v=ss(e,t,s,o,!0);return rt(s,v)&&(v.hitSide=!0),v}function Ko(e,t,r,i){var n,s,o=e.doc,a=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ri(e.display),3);n=(r>0?t.bottom:t.top)+r*c}else"line"==i&&(n=r>0?t.bottom+3:t.top-3);for(;(s=Qr(e,a,n)).outside;){if(r<0?n<=0:n>=o.height){s.hitSide=!0;break}n+=5*r}return s}var jo=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new K,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Uo(e,t){var r=Dr(e,t.line);if(!r||r.hidden)return null;var i=Ge(e.doc,t.line),n=Lr(r,i,t.line),s=ce(i,e.doc.direction),o="left";s&&(o=ae(s,t.ch)%2?"right":"left");var a=Fr(n.map,t.ch,o);return a.offset="right"==a.collapse?a.end:a.start,a}function Ho(e,t){return t&&(e.bad=!0),e}function Xo(e,t,r){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[r]))return Ho(e.clipPos(et(e.display.viewTo-1)),!0);t=null,r=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var s=e.display.view[n];if(s.node==i)return Wo(s,t,r)}}function Wo(e,t,r){var i=e.text.firstChild,n=!1;if(!t||!O(i,t))return Ho(et(Ye(e.line),0),!0);if(t==i&&(n=!0,t=i.childNodes[r],r=0,!t)){var s=e.rest?q(e.rest):e.line;return Ho(et(Ye(s),s.text.length),n)}var o=3==t.nodeType?t:null,a=t;for(o||1!=t.childNodes.length||3!=t.firstChild.nodeType||(o=t.firstChild,r&&(r=o.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var l=e.measure,c=l.maps;function u(t,r,i){for(var n=-1;n<(c?c.length:0);n++)for(var s=n<0?l.map:c[n],o=0;o<s.length;o+=3){var a=s[o+2];if(a==t||a==r){var u=Ye(n<0?e.line:e.rest[n]),h=s[o]+i;return(i<0||a!=t)&&(h=s[o+(i?1:0)]),et(u,h)}}}var h=u(o,a,r);if(h)return Ho(h,n);for(var d=a.nextSibling,f=o?o.nodeValue.length-r:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return Ho(et(h.line,h.ch-f),n);f+=d.textContent.length}for(var p=a.previousSibling,g=r;p;p=p.previousSibling){if(h=u(p,p.firstChild,-1))return Ho(et(h.line,h.ch+g),n);g+=p.textContent.length}}jo.prototype.init=function(e){var t=this,r=this,i=r.cm,n=r.div=e.lineDiv;function s(e){for(var t=e.target;t;t=t.parentNode){if(t==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function o(e){if(s(e)&&!ge(i,e)){if(i.somethingSelected())Oo({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Fo(i);Oo({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,H),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Do.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=No(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Do.text.join("\n");var c=document.activeElement;F(l),setTimeout((function(){i.display.lineSpace.removeChild(a),c.focus(),c==n&&r.showPrimarySelection()}),50)}}Po(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),he(n,"paste",(function(e){!s(e)||ge(i,e)||Mo(e,i)||a<=11&&setTimeout(Ji(i,(function(){return t.updateFromDOM()})),20)})),he(n,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(n,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(n,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(n,"touchstart",(function(){return r.forceCompositionEnd()})),he(n,"input",(function(){t.composing||t.readFromDOMSoon()})),he(n,"copy",o),he(n,"cut",o)},jo.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},jo.prototype.prepareSelection=function(){var e=vi(this.cm,!1);return e.focus=document.activeElement==this.div,e},jo.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},jo.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},jo.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),s=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||s.line<t.display.viewFrom)e.removeAllRanges();else{var o=Xo(t,e.anchorNode,e.anchorOffset),a=Xo(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=tt(st(o,a),n)||0!=tt(nt(o,a),s)){var l=t.display.view,c=n.line>=t.display.viewFrom&&Uo(t,n)||{node:l[0].measure.map[2],offset:0},u=s.line<t.display.viewTo&&Uo(t,s);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var f,p=e.rangeCount&&e.getRangeAt(0);try{f=k(c.node,c.offset,u.offset,u.node)}catch(e){}f&&(!r&&t.state.focused?(e.collapse(c.node,c.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},jo.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)},jo.prototype.showMultipleSelections=function(e){L(this.cm.display.cursorDiv,e.cursors),L(this.cm.display.selectionDiv,e.selection)},jo.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},jo.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},jo.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},jo.prototype.blur=function(){this.div.blur()},jo.prototype.getField=function(){return this.div},jo.prototype.supportsTouch=function(){return!0},jo.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():$i(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},jo.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},jo.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Xo(t,e.anchorNode,e.anchorOffset),i=Xo(t,e.focusNode,e.focusOffset);r&&i&&$i(t,(function(){Jn(t.doc,kn(r,i),H),(r.bad||i.bad)&&(t.curOp.selectionChanged=!0)}))}}},jo.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,i=this.cm,n=i.display,s=i.doc.sel.primary(),o=s.from(),a=s.to();if(0==o.ch&&o.line>i.firstLine()&&(o=et(o.line-1,Ge(i.doc,o.line-1).length)),a.ch==Ge(i.doc,a.line).text.length&&a.line<i.lastLine()&&(a=et(a.line+1,0)),o.line<n.viewFrom||a.line>n.viewTo-1)return!1;o.line==n.viewFrom||0==(e=ci(i,o.line))?(t=Ye(n.view[0].line),r=n.view[0].node):(t=Ye(n.view[e].line),r=n.view[e-1].node.nextSibling);var l,c,u=ci(i,a.line);if(u==n.view.length-1?(l=n.viewTo-1,c=n.lineDiv.lastChild):(l=Ye(n.view[u+1].line)-1,c=n.view[u+1].node.previousSibling),!r)return!1;for(var h=i.doc.splitLines(function(e,t,r,i,n){var s="",o=!1,a=e.doc.lineSeparator(),l=!1;function c(){o&&(s+=a,l&&(s+=a),o=l=!1)}function u(e){e&&(c(),s+=e)}function h(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void u(r);var s,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(et(i,0),et(n+1,0),(v=+d,function(e){return e.id==v}));return void(f.length&&(s=f[0].find(0))&&u(Ve(e.doc,s.from,s.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),p&&(o=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;h(t),t!=r;)t=t.nextSibling,l=!1;return s}(i,r,c,t,l)),d=Ve(i.doc,et(t,0),et(l,Ge(i.doc,l).text.length));h.length>1&&d.length>1;)if(q(h)==q(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,g=h[0],v=d[0],m=Math.min(g.length,v.length);f<m&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var _=q(h),y=q(d),b=Math.min(_.length-(1==h.length?f:0),y.length-(1==d.length?f:0));p<b&&_.charCodeAt(_.length-p-1)==y.charCodeAt(y.length-p-1);)++p;if(1==h.length&&1==d.length&&t==o.line)for(;f&&f>o.ch&&_.charCodeAt(_.length-p-1)==y.charCodeAt(y.length-p-1);)f--,p++;h[h.length-1]=_.slice(0,_.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var S=et(t,f),w=et(l,d.length?q(d).length-p:0);return h.length>1||h[0]||tt(S,w)?(ps(i.doc,h,S,w,"+input"),!0):void 0},jo.prototype.ensurePolled=function(){this.forceCompositionEnd()},jo.prototype.reset=function(){this.forceCompositionEnd()},jo.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},jo.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},jo.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||$i(this.cm,(function(){return ui(e.cm)}))},jo.prototype.setUneditable=function(e){e.contentEditable="false"},jo.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ji(this.cm,Ro)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},jo.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},jo.prototype.onContextMenu=function(){},jo.prototype.resetPosition=function(){},jo.prototype.needsContentAttribute=!0;var zo=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new K,this.hasSelection=!1,this.composing=null};zo.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var n=this.textarea;function s(e){if(!ge(i,e)){if(i.somethingSelected())Oo({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Fo(i);Oo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,H):(r.prevInput="",n.value=t.text.join("\n"),F(n))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(n.style.width="0px"),he(n,"input",(function(){o&&a>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),he(n,"paste",(function(e){ge(i,e)||Mo(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())})),he(n,"cut",s),he(n,"copy",s),he(e.scroller,"paste",(function(t){if(!Sr(e,t)&&!ge(i,t)){if(!n.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var s=new Event("paste");s.clipboardData=t.clipboardData,n.dispatchEvent(s)}})),he(e.lineSpace,"selectstart",(function(t){Sr(e,t)||ye(t)})),he(n,"compositionstart",(function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),he(n,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},zo.prototype.createField=function(e){this.wrapper=No(),this.textarea=this.wrapper.firstChild},zo.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},zo.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,i=vi(e);if(e.options.moveInputWithCursor){var n=Gr(e,r.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+o.top-s.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+o.left-s.left))}return i},zo.prototype.showSelection=function(e){var t=this.cm.display;L(t.cursorDiv,e.cursors),L(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},zo.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&F(this.textarea),o&&a>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",o&&a>=9&&(this.hasSelection=null))}},zo.prototype.getField=function(){return this.textarea},zo.prototype.supportsTouch=function(){return!1},zo.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||R()!=this.textarea))try{this.textarea.focus()}catch(e){}},zo.prototype.blur=function(){this.textarea.blur()},zo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},zo.prototype.receivedFocus=function(){this.slowPoll()},zo.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},zo.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},zo.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Re(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=r.value;if(n==i&&!t.somethingSelected())return!1;if(o&&a>=9&&this.hasSelection===n||_&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=n.charCodeAt(0);if(8203!=s||i||(i=""),8666==s)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,n.length);l<c&&i.charCodeAt(l)==n.charCodeAt(l);)++l;return $i(t,(function(){Ro(t,n.slice(l),i.length-l,null,e.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},zo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zo.prototype.onKeyPress=function(){o&&a>=9&&(this.hasSelection=null),this.fastPoll()},zo.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=li(r,e),c=i.scroller.scrollTop;if(s&&!h){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(s)&&Ji(r,Jn)(r.doc,kn(s),H);var u,d=n.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),i.input.focus(),l&&window.scrollTo(null,u),i.input.reset(),r.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=m,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll),o&&a>=9&&v(),C){we(e);var g=function(){fe(window,"mouseup",g),setTimeout(m,20)};he(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=n.selectionStart){var e=r.somethingSelected(),s=""+(e?n.value:"");n.value="⇚",n.value=s,t.prevInput=e?"":"",n.selectionStart=1,n.selectionEnd=s.length,i.selForContextMenu=r.doc.sel}}function m(){if(t.contextMenuPending==m&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,n.style.cssText=d,o&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=n.selectionStart)){(!o||o&&a<9)&&v();var e=0,s=function(){i.selForContextMenu==r.doc.sel&&0==n.selectionStart&&n.selectionEnd>0&&""==t.prevInput?Ji(r,as)(r):e++<10?i.detectingSelectAll=setTimeout(s,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(s,200)}}},zo.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},zo.prototype.setUneditable=function(){},zo.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,i,n,s){e.defaults[r]=i,n&&(t[r]=s?function(e,t,r){r!=wo&&n(e,t,r)}:n)}e.defineOption=r,e.Init=wo,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Dn(e)}),!0),r("indentUnit",2,Dn,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){On(e),Kr(e),ui(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],i=e.doc.first;e.doc.iter((function(e){for(var n=0;;){var s=e.text.indexOf(t,n);if(-1==s)break;n=s+t.length,r.push(et(i,s))}i++}));for(var n=r.length-1;n>=0;n--)ps(e.doc,t,r[n],et(r[n].line,r[n].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=wo&&e.refresh()})),r("specialCharPlaceholder",$t,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!b),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){So(e),gn(e)}),!0),r("keyMap","default",(function(e,t,r){var i=Qs(t),n=r!=wo&&Qs(r);n&&n.detach&&n.detach(e,i),i.attach&&i.attach(e,n||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,xo,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=fn(t,e.options.lineNumbers),gn(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?si(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return ji(e)}),!0),r("scrollbarStyle","native",(function(e){Xi(e),ji(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fn(e.options.gutters,t),gn(e)}),!0),r("firstLineNumber",1,gn,!0),r("lineNumberFormatter",(function(e){return e}),gn,!0),r("showCursorWhenSelecting",!1,gi,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(Ei(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,ko),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,gi,!0),r("singleCursorHeightPerLine",!0,gi,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,On,!0),r("addModeClass",!1,On,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,On,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(To),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var i=this.options,n=i[e];i[e]==r&&"mode"!=e||(i[e]=r,t.hasOwnProperty(e)&&Ji(this,t[e])(this,r,n),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Qs(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:en((function(t,r){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var i=0,n=r(t);i<e.length&&r(e[i])<=n;)i++;e.splice(i,0,t)}(this.state.overlays,{mode:i,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,ui(this)})),removeOverlay:en((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var i=t[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(r,1),this.state.modeGen++,void ui(this)}})),indentLine:en((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),$e(this.doc,e)&&Ao(this,e,t,r)})),indentSelection:en((function(e){for(var t=this.doc.sel.ranges,r=-1,i=0;i<t.length;i++){var n=t[i];if(n.empty())n.head.line>r&&(Ao(this,n.head.line,e,!0),r=n.head.line,i==this.doc.sel.primIndex&&Di(this));else{var s=n.from(),o=n.to(),a=Math.max(r,s.line);r=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=a;l<r;++l)Ao(this,l,e);var c=this.doc.sel.ranges;0==s.ch&&t.length==c.length&&c[i].from().ch>0&&Yn(this.doc,i,new Cn(s,c[i].to()),H)}}})),getTokenAt:function(e,t){return _t(this,e,t)},getLineTokens:function(e,t){return _t(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,r=dt(this,Ge(this.doc,e.line)),i=0,n=(r.length-1)/2,s=e.ch;if(0==s)t=r[2];else for(;;){var o=i+n>>1;if((o?r[2*o-1]:0)>=s)n=o;else{if(!(r[2*o+1]<s)){t=r[2*o+2];break}i=o+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!r.hasOwnProperty(t))return i;var n=r[t],s=this.getModeAt(e);if("string"==typeof s[t])n[s[t]]&&i.push(n[s[t]]);else if(s[t])for(var o=0;o<s[t].length;o++){var a=n[s[t][o]];a&&i.push(a)}else s.helperType&&n[s.helperType]?i.push(n[s.helperType]):n[s.name]&&i.push(n[s.name]);for(var l=0;l<n._global.length;l++){var c=n._global[l];c.pred(s,this)&&-1==j(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(e,t){var r=this.doc;return ft(this,(e=ot(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Gr(this,null==e?r.head:"object"==typeof e?at(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return zr(this,at(this.doc,e),t||"page")},coordsChar:function(e,t){return Qr(this,(e=Wr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Wr(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var i,n=!1;if("number"==typeof e){var s=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>s&&(e=s,n=!0),i=Ge(this.doc,e)}else i=e;return Xr(this,i,{top:0,left:0},t||"page",r||n).top+(n?this.doc.height-Xt(i):0)},defaultTextHeight:function(){return ri(this.display)},defaultCharWidth:function(){return ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,i,n){var s,o,a,l=this.display,c=(e=Gr(this,at(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==i)c=e.top;else if("above"==i||"near"==i){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==n?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?u=0:"middle"==n&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(s=this,o={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(a=Li(s,o)).scrollTop&&Ii(s,a.scrollTop),null!=a.scrollLeft&&Pi(s,a.scrollLeft))},triggerOnKeyDown:en(co),triggerOnKeyPress:en(ho),triggerOnKeyUp:uo,triggerOnMouseDown:en(vo),execCommand:function(e){if(eo.hasOwnProperty(e))return eo[e].call(null,this)},triggerElectric:en((function(e){Io(this,e)})),findPosH:function(e,t,r,i){var n=1;t<0&&(n=-1,t=-t);for(var s=at(this.doc,e),o=0;o<t&&!(s=Bo(this.doc,s,n,r,i)).hitSide;++o);return s},moveH:en((function(e,t){var r=this;this.extendSelectionsBy((function(i){return r.display.shift||r.doc.extend||i.empty()?Bo(r.doc,i.head,e,t,r.options.rtlMoveVisually):e<0?i.from():i.to()}),W)})),deleteH:en((function(e,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):Ys(this,(function(r){var n=Bo(i,r.head,e,t,!1);return e<0?{from:n,to:r.head}:{from:r.head,to:n}}))})),findPosV:function(e,t,r,i){var n=1,s=i;t<0&&(n=-1,t=-t);for(var o=at(this.doc,e),a=0;a<t;++a){var l=Gr(this,o,"div");if(null==s?s=l.left:l.left=s,(o=Ko(this,l,n,r)).hitSide)break}return o},moveV:en((function(e,t){var r=this,i=this.doc,n=[],s=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(o){if(s)return e<0?o.from():o.to();var a=Gr(r,o.head,"div");null!=o.goalColumn&&(a.left=o.goalColumn),n.push(a.left);var l=Ko(r,a,e,t);return"page"==t&&o==i.sel.primary()&&Ai(r,zr(r,l,"div").top-a.top),l}),W),n.length)for(var o=0;o<i.sel.ranges.length;o++)i.sel.ranges[o].goalColumn=n[o]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,r=e.ch,i=e.ch;if(t){var n=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!r?++i:--r;for(var s=t.charAt(r),o=ee(s,n)?function(e){return ee(e,n)}:/\s/.test(s)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&o(t.charAt(r-1));)--r;for(;i<t.length&&o(t.charAt(i));)++i}return new Cn(et(e.line,r),et(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?M(this.display.cursorDiv,"CodeMirror-overwrite"):x(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==R()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:en((function(e,t){Oi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-kr(this)-this.display.barHeight,width:e.scrollWidth-kr(this)-this.display.barWidth,clientHeight:Tr(this),clientWidth:xr(this)}},scrollIntoView:en((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Ri(e),e.curOp.scrollToPos=t}(this,e):Mi(this,e.from,e.to,e.margin)})),setSize:en((function(e,t){var r=this,i=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&Br(this);var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){hi(r,n,"widget");break}++n})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return $i(this,e)},startOperation:function(){return zi(this)},endOperation:function(){return Gi(this)},refresh:en((function(){var e=this.display.cachedTextHeight;ui(this),this.curOp.forceUpdate=!0,Kr(this),Oi(this,this.doc.scrollLeft,this.doc.scrollTop),cn(this.display),(null==e||Math.abs(e-ri(this.display))>.5||this.options.lineWrapping)&&ai(this),pe(this,"refresh",this)})),swapDoc:en((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Fn(this,e),Kr(this),this.display.input.reset(),Oi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ar(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},_e(e),e.registerHelper=function(t,i,n){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][i]=n},e.registerGlobalHelper=function(t,i,n,s){e.registerHelper(t,i,s),r[t]._global.push({pred:n,val:s})}}(To);var Go="iter insert remove copy getEditor constructor".split(" ");for(var Vo in Ds.prototype)Ds.prototype.hasOwnProperty(Vo)&&j(Go,Vo)<0&&(To.prototype[Vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ds.prototype[Vo]));return _e(Ds),To.inputStyles={textarea:zo,contenteditable:jo},To.defineMode=function(e){To.defaults.mode||"null"==e||(To.defaults.mode=e),Ne.apply(this,arguments)},To.defineMIME=function(e,t){Pe[e]=t},To.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),To.defineMIME("text/plain","null"),To.defineExtension=function(e,t){To.prototype[e]=t},To.defineDocExtension=function(e,t){Ds.prototype[e]=t},To.fromTextArea=function(e,t){if((t=t?N(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=R();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function i(){e.value=a.getValue()}var n;if(e.form&&(he(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var s=e.form;n=s.submit;try{var o=s.submit=function(){i(),s.submit=n,s.submit(),s.submit=o}}catch(e){}}t.finishInit=function(r){r.save=i,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,i(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=n))}},e.style.display="none";var a=To((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=fe,e.on=he,e.wheelEventPixels=bn,e.Doc=Ds,e.splitLines=Oe,e.countColumn=B,e.findColumn=z,e.isWordChar=J,e.Pass=U,e.signal=pe,e.Line=Gt,e.changeEnd=xn,e.scrollbarModel=Hi,e.Pos=et,e.cmpPos=tt,e.modes=Fe,e.mimeModes=Pe,e.resolveMode=Be,e.getMode=Ke,e.modeExtensions=je,e.extendMode=Ue,e.copyState=He,e.startState=We,e.innerMode=Xe,e.commands=eo,e.keyMap=Hs,e.keyName=qs,e.isModifierKey=Gs,e.lookupKey=zs,e.normalizeKeyMap=Ws,e.StringStream=ze,e.SharedTextMarker=xs,e.TextMarker=Es,e.LineWidget=Ss,e.e_preventDefault=ye,e.e_stopPropagation=be,e.e_stop=we,e.addClass=M,e.contains=O,e.rmClass=x,e.keyNames=Bs}(To),To.version="5.58.2",To}()},Y1PL:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: ResizableTextArea, default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(e,t,r){"use strict";r.r(t),r.d(t,"ResizableTextArea",(function(){return M}));var i=r("wx14"),n=r("1OyB"),s=r("vuIU"),o=r("Ji7U"),a=r("LK+K"),l=r("q1tI"),c=r("VTBJ"),u=r("rePB"),h=r("Zm9Q"),d=(r("Kwbf"),r("c+Xe")),f=r("m+aA"),p=r("bdgK"),g=new Map;var v=new p.default((function(e){e.forEach((function(e){var t,r=e.target;null===(t=g.get(r))||void 0===t||t.forEach((function(e){return e(r)}))}))}));var m=function(e){Object(o.a)(r,e);var t=Object(a.a)(r);function r(){return Object(n.a)(this,r),t.apply(this,arguments)}return Object(s.a)(r,[{key:"render",value:function(){return this.props.children}}]),r}(l.Component),_=l.createContext(null);function y(e){var t=e.children,r=e.disabled,i=l.useRef(null),n=l.useRef(null),s=l.useContext(_),o=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),a=l.isValidElement(t)&&Object(d.c)(t),u=a?t.ref:null,h=l.useMemo((function(){return Object(d.a)(u,i)}),[u,i]),p=l.useRef(e);p.current=e;var y=l.useCallback((function(e){var t=p.current,r=t.onResize,i=t.data,n=e.getBoundingClientRect(),a=n.width,l=n.height,u=e.offsetWidth,h=e.offsetHeight,d=Math.floor(a),f=Math.floor(l);if(o.current.width!==d||o.current.height!==f||o.current.offsetWidth!==u||o.current.offsetHeight!==h){var g={width:d,height:f,offsetWidth:u,offsetHeight:h};o.current=g;var v=u===Math.round(a)?a:u,m=h===Math.round(l)?l:h,_=Object(c.a)(Object(c.a)({},g),{},{offsetWidth:v,offsetHeight:m});null==s||s(_,e,i),r&&Promise.resolve().then((function(){r(_,e)}))}}),[]);return l.useEffect((function(){var e,t,s=Object(f.a)(i.current)||Object(f.a)(n.current);return s&&!r&&(e=s,t=y,g.has(e)||(g.set(e,new Set),v.observe(e)),g.get(e).add(t)),function(){return function(e,t){g.has(e)&&(g.get(e).delete(t),g.get(e).size||(v.unobserve(e),g.delete(e)))}(s,y)}}),[i.current,r]),l.createElement(m,{ref:n},a?l.cloneElement(t,{ref:h}):t)}function b(e){var t=e.children;return Object(h.a)(t).map((function(t,r){var n=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(r);return l.createElement(y,Object(i.a)({},e,{key:n}),t)}))}b.Collection=function(e){var t=e.children,r=e.onBatchResize,i=l.useRef(0),n=l.useRef([]),s=l.useContext(_),o=l.useCallback((function(e,t,o){i.current+=1;var a=i.current;n.current.push({size:e,element:t,data:o}),Promise.resolve().then((function(){a===i.current&&(null==r||r(n.current),n.current=[])})),null==s||s(e,t,o)}),[r,s]);return l.createElement(_.Provider,{value:o},t)};var S,w=b,C=r("bT9E"),E=r("TSYQ"),k=r.n(E),x="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",T=["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"],L={};function A(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&L[r])return L[r];var i=window.getComputedStyle(e),n=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),s=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),o=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),a=T.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),l={sizingStyle:a,paddingSize:s,borderSize:o,boxSizing:n};return t&&r&&(L[r]=l),l}var D,O=r("Gytx"),R=r.n(O);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(D||(D={}));var M=function(e){Object(o.a)(r,e);var t=Object(a.a)(r);function r(e){var s;return Object(n.a)(this,r),(s=t.call(this,e)).nextFrameActionId=void 0,s.resizeFrameId=void 0,s.textArea=void 0,s.saveTextArea=function(e){s.textArea=e},s.handleResize=function(e){var t=s.state.resizeStatus,r=s.props,i=r.autoSize,n=r.onResize;t===D.NONE&&("function"==typeof n&&n(e),i&&s.resizeOnNextFrame())},s.resizeOnNextFrame=function(){cancelAnimationFrame(s.nextFrameActionId),s.nextFrameActionId=requestAnimationFrame(s.resizeTextarea)},s.resizeTextarea=function(){var e=s.props.autoSize;if(e&&s.textArea){var t=e.minRows,r=e.maxRows,i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;S||((S=document.createElement("textarea")).setAttribute("tab-index","-1"),S.setAttribute("aria-hidden","true"),document.body.appendChild(S)),e.getAttribute("wrap")?S.setAttribute("wrap",e.getAttribute("wrap")):S.removeAttribute("wrap");var n=A(e,t),s=n.paddingSize,o=n.borderSize,a=n.boxSizing,l=n.sizingStyle;S.setAttribute("style","".concat(l,";").concat(x)),S.value=e.value||e.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=S.scrollHeight;if("border-box"===a?d+=o:"content-box"===a&&(d-=s),null!==r||null!==i){S.value=" ";var f=S.scrollHeight-s;null!==r&&(u=f*r,"border-box"===a&&(u=u+s+o),d=Math.max(u,d)),null!==i&&(h=f*i,"border-box"===a&&(h=h+s+o),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(s.textArea,!1,t,r);s.setState({textareaStyles:i,resizeStatus:D.RESIZING},(function(){cancelAnimationFrame(s.resizeFrameId),s.resizeFrameId=requestAnimationFrame((function(){s.setState({resizeStatus:D.RESIZED},(function(){s.resizeFrameId=requestAnimationFrame((function(){s.setState({resizeStatus:D.NONE}),s.fixFirefoxAutoScroll()}))}))}))}))}},s.renderTextArea=function(){var e=s.props,t=e.prefixCls,r=void 0===t?"rc-textarea":t,n=e.autoSize,o=e.onResize,a=e.className,h=e.disabled,d=s.state,f=d.textareaStyles,p=d.resizeStatus,g=Object(C.a)(s.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),v=k()(r,a,Object(u.a)({},"".concat(r,"-disabled"),h));"value"in g&&(g.value=g.value||"");var m=Object(c.a)(Object(c.a)(Object(c.a)({},s.props.style),f),p===D.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(w,{onResize:s.handleResize,disabled:!(n||o)},l.createElement("textarea",Object(i.a)({},g,{className:v,style:m,ref:s.saveTextArea})))},s.state={textareaStyles:{},resizeStatus:D.NONE},s}return Object(s.a)(r,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&R()(e.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 e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),r}(l.Component),I=function(e){Object(o.a)(r,e);var t=Object(a.a)(r);function r(e){var i;Object(n.a)(this,r),(i=t.call(this,e)).resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(e){i.resizableTextArea=e},i.handleChange=function(e){var t=i.props.onChange;i.setValue(e.target.value,(function(){i.resizableTextArea.resizeTextarea()})),t&&t(e)},i.handleKeyDown=function(e){var t=i.props,r=t.onPressEnter,n=t.onKeyDown;13===e.keyCode&&r&&r(e),n&&n(e)};var s=void 0===e.value||null===e.value?e.defaultValue:e.value;return i.state={value:s},i}return Object(s.a)(r,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(M,Object(i.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),r}(l.Component);t.default=I},YJ9k:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/eventtarget.js ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners=new Map}var t,r,n;return t=e,(r=[{key:"addEventListener",value:function(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}},{key:"removeEventListener",value:function(e,t){this._listeners.has(e)&&this._listeners.get(e).delete(t)}},{key:"dispatchEvent",value:function(e){var t=this;return!this._listeners.has(e.type)||(this._listeners.get(e.type).forEach((function(r){return r.call(t,e)})),!e.defaultPrevented)}}])&&i(t.prototype,r),n&&i(t,n),e}();t.default=n},ZW9T:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/components/monaco-editor/index.jsx + 1 modules ***!
|
|
|
\************************************************************/
|
|
|
/*! exports provided: getLanguageByMirrorName, default, DiffEditor */
|
|
|
/*! exports used: DiffEditor, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var i=r("k1fw"),n=(r("miYZ"),r("tsqr")),s=r("rAM+"),o=r("tJVT"),a=r("PpiC"),l=r("q1tI"),c=r.n(l),u=r("bdgK");function h(e,t,r,n,s){var o=t.getWordUntilPosition(r),a={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},l=n.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a}}));return s.map((function(e){l.push(Object(i.a)(Object(i.a)({},e),{},{range:a}))})),l}r("LvDl");function d(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function f(){}var p={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var r=0;r<e.length;r++){var i=p[e[r]];if(i)return i}return t[0]}return p[t]||t}var v=null;t.b=function(e){var t=e.width,p=void 0===t?"100%":t,m=e.height,_=void 0===m?"100%":m,y=e.value,b=e.language,S=void 0===b?"javascript":b,w=e.style,C=void 0===w?{}:w,E=e.options,k=void 0===E?{}:E,x=e.overrideServices,T=void 0===x?{}:x,L=e.theme,A=void 0===L?"vs-dark":L,D=e.onEditBlur,O=e.onSave,R=e.autoHeight,M=void 0!==R&&R,I=e.forbidCopy,F=void 0!==I&&I,P=e.onChange,N=void 0===P?f:P,B=e.editorDidMount,K=void 0===B?f:B,j=e.onFocus,U=void 0===j?f:j,H=e.filename,X=void 0===H?"educoder.txt":H,W=(Object(a.a)(e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Object(l.useRef)()),z=Object(l.useRef)({}),G=Object(l.useRef)(),V=Object(l.useRef)(!1),q=Object(l.useRef)(),Q=Object(l.useState)(!1),Y=Object(o.a)(Q,2),Z=Y[0],$=Y[1];function J(){n.b.warn(decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"))}function ee(){var e=z.current.instance;if(e){var t=e.getSelection(),r=z.current.pastePos||{},i=new v.Range(r.startLineNumber||t.endLineNumber,r.startColumn||t.endColumn,r.endLineNumber||t.endLineNumber,r.endColumn||t.endColumn);setTimeout((function(){e.executeEdits("",[{range:i,text:""}])}),300)}}function te(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),O())}Object(l.useEffect)((function(){G.current&&clearTimeout(G.current),G.current=setTimeout((function(){!function(){var e=z.current.instance;if(null!=y&&e&&Z){var t=e.getModel();t&&y!==t.getValue()&&(!0,t.setValue(y),e.layout(),!1)}}()}),500)}),[y,Z,z.current]);var re=function(){if(M&&z.current.instance){var e=z.current.instance.getContentHeight();ue(e<_?_:e)}else ue(_)};function ie(e,t){var r,i,n=window.URL||window.webkitURL||window,s=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=n.createObjectURL(s),o.download=e,r=o,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(i)}Object(l.useEffect)((function(){re()}),[re]),Object(l.useEffect)((function(){W.current&&!Z&&r.e(/*! import() | monaco-editor */26).then(r.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){try{v=e,z.current.instance=v.editor.create(W.current,{value:y,language:g(S),theme:A,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},T);var t=z.current.instance;if(K(t,v),setTimeout((function(){re(),z.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ie(X||"educoder.txt",t.getValue())}})}),500),z.current.subscription=t.onDidChangeModelContent((function(e){V.current?clearTimeout(q.current):(re(),N(t.getValue(),e)),q.current=setTimeout((function(){V.current=!1}),500)})),window.Monaco||function(e){var t={label:"ifelse",kind:e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},r=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(i,n){return{suggestions:h(e,i,n,r,[t])}}});var i=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(t,r){var n=[{label:"print",kind:e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,t,r,i,n)}}});var n=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(r,i){var s=[t,{label:"main",kind:e.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {","\t$0","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:e.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,r,i,n,s)}}})}(v),F&&(t.addCommand(v.KeyMod.CtrlCmd|v.KeyMod.Shift|v.KeyCode.KEY_V,(function(){return J(),null})),t.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KEY_C,(function(){return J(),null}))),window.Monaco=v,D&&t.onDidBlurEditorWidget((function(){D(t.getValue())})),U&&t.onDidFocusEditorText((function(){U(t.getValue())})),F){t.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KEY_V,(function(){return J(),null})),t.onDidPaste((function(e){z.current.pastePos=e}));try{window.addEventListener("paste",ee)}catch(e){}}var r=function(){var e;return W.current&&(e=new u.default((function(e){var t,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&z.current.instance.layout()}}catch(e){r.e(e)}finally{r.f()}}))).observe(W.current),e}();return $(!0),function(){var e=z.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),z.current.subscription&&z.current.subscription.dispose(),F&&window.removeEventListener("paste",ee),r.unobserve(W.current)}}catch(e){}}))}),[]),Object(l.useEffect)((function(){if(z.current.instance&&Z)return document.addEventListener("keydown",te,!1),function(){document.removeEventListener("keydown",te)}}),[O,Z]),Object(l.useEffect)((function(){var e=z.current.instance;if(e&&Z){var t=g(S);v.editor.setModelLanguage(e.getModel(),t),console.log("language:",S,e.getModel(),t)}}),[S,Z]),Object(l.useEffect)((function(){z.current.instance&&Z&&v.editor.setTheme(A)}),[A,Z]),Object(l.useEffect)((function(){var e=z.current.instance;e&&Z&&(e.updateOptions(Object(i.a)({},k)),setTimeout((function(){e.getModel().updateOptions(Object(i.a)({},k))}),200))}),[JSON.stringify(k),Z]),Object(l.useEffect)((function(){var e=z.current.instance;e&&Z&&e.layout()}),[p,_,Z]);var ne=Object(l.useState)(d(p)),se=Object(o.a)(ne,2),oe=se[0],ae=(se[1],Object(l.useState)(d(_))),le=Object(o.a)(ae,2),ce=le[0],ue=le[1],he=Object(i.a)(Object(i.a)({},C),{},{width:oe,height:ce});return c.a.createElement("div",{className:"my-monaco-editor",ref:W,style:he})};function m(e){var t=e.width,n=void 0===t?"100%":t,a=e.height,h=void 0===a?"100%":a,f=e.original,p=e.modified,g=e.language,m=e.options,_=void 0===m?{}:m,y=Object(l.useRef)(),b=Object(l.useState)(null),S=Object(o.a)(b,2),w=S[0],C=S[1];Object(l.useEffect)((function(){y.current&&r.e(/*! import() | monaco-editor */26).then(r.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){var t=(v=e).editor.createDiffEditor(y.current,Object(i.a)(Object(i.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},_),{},{wordWrap:!0}));C(t);var r=function(e){var t;return y.current&&(t=new u.default((function(t){var r,i=Object(s.a)(t);try{for(i.s();!(r=i.n()).done;){var n=r.value;(n.target.offsetHeight>0||n.target.offsetWidth>0)&&e.layout()}}catch(e){i.e(e)}finally{i.f()}}))).observe(y.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),r.unobserve(y.current)}}))}),[]),Object(l.useEffect)((function(){w&&w.setModel({original:v.editor.createModel(f,g),modified:v.editor.createModel(p,g)})}),[f,p,g,w]);var E={width:d(n),height:d(h)};return c.a.createElement("div",{className:"my-diff-editor",ref:y,style:E})}},ZpRC:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***!
|
|
|
\*************************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";function i(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function n(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function s(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return n(r.overflowY,t)||n(r.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function o(e,t,r,i,n,s,o,a){return s<e&&o>t||s>e&&o<t?0:s<=e&&a<=r||o>=t&&a>=r?s-e-i:o>t&&a<r||s<e&&a>r?o-t+n:0}var a=function(e,t){var r=window,n=t.scrollMode,a=t.block,l=t.inline,c=t.boundary,u=t.skipOverflowHiddenElements,h="function"==typeof c?c:function(e){return e!==c};if(!i(e))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,f=[],p=e;i(p)&&h(p);){if((p=p.parentElement)===d){f.push(p);break}null!=p&&p===document.body&&s(p)&&!s(document.documentElement)||null!=p&&s(p,u)&&f.push(p)}for(var g=r.visualViewport?r.visualViewport.width:innerWidth,v=r.visualViewport?r.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),b=y.height,S=y.width,w=y.top,C=y.right,E=y.bottom,k=y.left,x="start"===a||"nearest"===a?w:"end"===a?E:w+b/2,T="center"===l?k+S/2:"end"===l?C:k,L=[],A=0;A<f.length;A++){var D=f[A],O=D.getBoundingClientRect(),R=O.height,M=O.width,I=O.top,F=O.right,P=O.bottom,N=O.left;if("if-needed"===n&&w>=0&&k>=0&&E<=v&&C<=g&&w>=I&&E<=P&&k>=N&&C<=F)return L;var B=getComputedStyle(D),K=parseInt(B.borderLeftWidth,10),j=parseInt(B.borderTopWidth,10),U=parseInt(B.borderRightWidth,10),H=parseInt(B.borderBottomWidth,10),X=0,W=0,z="offsetWidth"in D?D.offsetWidth-D.clientWidth-K-U:0,G="offsetHeight"in D?D.offsetHeight-D.clientHeight-j-H:0;if(d===D)X="start"===a?x:"end"===a?x-v:"nearest"===a?o(_,_+v,v,j,H,_+x,_+x+b,b):x-v/2,W="start"===l?T:"center"===l?T-g/2:"end"===l?T-g:o(m,m+g,g,K,U,m+T,m+T+S,S),X=Math.max(0,X+_),W=Math.max(0,W+m);else{X="start"===a?x-I-j:"end"===a?x-P+H+G:"nearest"===a?o(I,P,R,j,H+G,x,x+b,b):x-(I+R/2)+G/2,W="start"===l?T-N-K:"center"===l?T-(N+M/2)+z/2:"end"===l?T-F+U+z:o(N,F,M,K,U+z,T,T+S,S);var V=D.scrollLeft,q=D.scrollTop;x+=q-(X=Math.max(0,Math.min(q+X,D.scrollHeight-R+G))),T+=V-(W=Math.max(0,Math.min(V+W,D.scrollWidth-M+z)))}L.push({el:D,top:X,left:W})}return L};function l(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var r=!e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(r?[]:a(e,t));if(!r){var i=function(e){return!1===e?{block:"end",inline:"nearest"}:l(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var r="scrollBehavior"in document.body.style;e.forEach((function(e){var i=e.el,n=e.top,s=e.left;i.scroll&&r?i.scroll({top:n,left:s,behavior:t}):(i.scrollTop=n,i.scrollLeft=s)}))}(a(e,i),i.behavior)}}},Zss7:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/tinycolor2/tinycolor.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){var i;!function(n){var s=/^\s+/,o=/\s+$/,a=0,l=n.round,c=n.min,u=n.max,h=n.random;function d(e,t){if(t=t||{},(e=e||"")instanceof d)return e;if(!(this instanceof d))return new d(e,t);var r=function(e){var t={r:0,g:0,b:0},r=1,i=null,a=null,l=null,h=!1,d=!1;"string"==typeof e&&(e=function(e){e=e.replace(s,"").replace(o,"").toLowerCase();var t,r=!1;if(D[e])e=D[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=X.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=X.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=X.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=X.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=X.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=X.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=X.hex8.exec(e))return{r:F(t[1]),g:F(t[2]),b:F(t[3]),a:K(t[4]),format:r?"name":"hex8"};if(t=X.hex6.exec(e))return{r:F(t[1]),g:F(t[2]),b:F(t[3]),format:r?"name":"hex"};if(t=X.hex4.exec(e))return{r:F(t[1]+""+t[1]),g:F(t[2]+""+t[2]),b:F(t[3]+""+t[3]),a:K(t[4]+""+t[4]),format:r?"name":"hex8"};if(t=X.hex3.exec(e))return{r:F(t[1]+""+t[1]),g:F(t[2]+""+t[2]),b:F(t[3]+""+t[3]),format:r?"name":"hex"};return!1}(e));"object"==typeof e&&(W(e.r)&&W(e.g)&&W(e.b)?(f=e.r,p=e.g,g=e.b,t={r:255*M(f,255),g:255*M(p,255),b:255*M(g,255)},h=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):W(e.h)&&W(e.s)&&W(e.v)?(i=N(e.s),a=N(e.v),t=function(e,t,r){e=6*M(e,360),t=M(t,100),r=M(r,100);var i=n.floor(e),s=e-i,o=r*(1-t),a=r*(1-s*t),l=r*(1-(1-s)*t),c=i%6;return{r:255*[r,a,o,o,l,r][c],g:255*[l,r,r,a,o,o][c],b:255*[o,o,l,r,r,a][c]}}(e.h,i,a),h=!0,d="hsv"):W(e.h)&&W(e.s)&&W(e.l)&&(i=N(e.s),l=N(e.l),t=function(e,t,r){var i,n,s;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=M(e,360),t=M(t,100),r=M(r,100),0===t)i=n=s=r;else{var a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;i=o(l,a,e+1/3),n=o(l,a,e),s=o(l,a,e-1/3)}return{r:255*i,g:255*n,b:255*s}}(e.h,i,l),h=!0,d="hsl"),e.hasOwnProperty("a")&&(r=e.a));var f,p,g;return r=R(r),{ok:h,format:e.format||d,r:c(255,u(t.r,0)),g:c(255,u(t.g,0)),b:c(255,u(t.b,0)),a:r}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=a++}function f(e,t,r){e=M(e,255),t=M(t,255),r=M(r,255);var i,n,s=u(e,t,r),o=c(e,t,r),a=(s+o)/2;if(s==o)i=n=0;else{var l=s-o;switch(n=a>.5?l/(2-s-o):l/(s+o),s){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4}i/=6}return{h:i,s:n,l:a}}function p(e,t,r){e=M(e,255),t=M(t,255),r=M(r,255);var i,n,s=u(e,t,r),o=c(e,t,r),a=s,l=s-o;if(n=0===s?0:l/s,s==o)i=0;else{switch(s){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4}i/=6}return{h:i,s:n,v:a}}function g(e,t,r,i){var n=[P(l(e).toString(16)),P(l(t).toString(16)),P(l(r).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function v(e,t,r,i){return[P(B(i)),P(l(e).toString(16)),P(l(t).toString(16)),P(l(r).toString(16))].join("")}function m(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.s-=t/100,r.s=I(r.s),d(r)}function _(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.s+=t/100,r.s=I(r.s),d(r)}function y(e){return d(e).desaturate(100)}function b(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.l+=t/100,r.l=I(r.l),d(r)}function S(e,t){t=0===t?0:t||10;var r=d(e).toRgb();return r.r=u(0,c(255,r.r-l(-t/100*255))),r.g=u(0,c(255,r.g-l(-t/100*255))),r.b=u(0,c(255,r.b-l(-t/100*255))),d(r)}function w(e,t){t=0===t?0:t||10;var r=d(e).toHsl();return r.l-=t/100,r.l=I(r.l),d(r)}function C(e,t){var r=d(e).toHsl(),i=(r.h+t)%360;return r.h=i<0?360+i:i,d(r)}function E(e){var t=d(e).toHsl();return t.h=(t.h+180)%360,d(t)}function k(e){var t=d(e).toHsl(),r=t.h;return[d(e),d({h:(r+120)%360,s:t.s,l:t.l}),d({h:(r+240)%360,s:t.s,l:t.l})]}function x(e){var t=d(e).toHsl(),r=t.h;return[d(e),d({h:(r+90)%360,s:t.s,l:t.l}),d({h:(r+180)%360,s:t.s,l:t.l}),d({h:(r+270)%360,s:t.s,l:t.l})]}function T(e){var t=d(e).toHsl(),r=t.h;return[d(e),d({h:(r+72)%360,s:t.s,l:t.l}),d({h:(r+216)%360,s:t.s,l:t.l})]}function L(e,t,r){t=t||6,r=r||30;var i=d(e).toHsl(),n=360/r,s=[d(e)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,s.push(d(i));return s}function A(e,t){t=t||6;for(var r=d(e).toHsv(),i=r.h,n=r.s,s=r.v,o=[],a=1/t;t--;)o.push(d({h:i,s:n,v:s})),s=(s+a)%1;return o}d.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,i=this.toRgb();return e=i.r/255,t=i.g/255,r=i.b/255,.2126*(e<=.03928?e/12.92:n.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:n.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=R(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),i=l(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+i+"%)":"hsva("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=f(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),i=l(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+i+"%)":"hsla("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return g(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,i,n){var s=[P(l(e).toString(16)),P(l(t).toString(16)),P(l(r).toString(16)),P(B(i))];if(n&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1))return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0);return s.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*M(this._r,255))+"%",g:l(100*M(this._g,255))+"%",b:l(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%)":"rgba("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(O[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+v(this._r,this._g,this._b,this._a),r=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var n=d(e);r="#"+v(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0;return t||!i||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(_,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(C,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]="a"===i?e[i]:N(e[i]));e=r}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:h(),g:h(),b:h()})},d.mix=function(e,t,r){r=0===r?0:r||50;var i=d(e).toRgb(),n=d(t).toRgb(),s=r/100;return d({r:(n.r-i.r)*s+i.r,g:(n.g-i.g)*s+i.g,b:(n.b-i.b)*s+i.b,a:(n.a-i.a)*s+i.a})},d.readability=function(e,t){var r=d(e),i=d(t);return(n.max(r.getLuminance(),i.getLuminance())+.05)/(n.min(r.getLuminance(),i.getLuminance())+.05)},d.isReadable=function(e,t,r){var i,n,s=d.readability(e,t);switch(n=!1,(i=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+i.size){case"AAsmall":case"AAAlarge":n=s>=4.5;break;case"AAlarge":n=s>=3;break;case"AAAsmall":n=s>=7}return n},d.mostReadable=function(e,t,r){var i,n,s,o,a=null,l=0;n=(r=r||{}).includeFallbackColors,s=r.level,o=r.size;for(var c=0;c<t.length;c++)(i=d.readability(e,t[c]))>l&&(l=i,a=d(t[c]));return d.isReadable(e,a,{level:s,size:o})||!n?a:(r.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],r))};var D=d.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"},O=d.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(D);function R(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=c(t,u(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),n.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function I(e){return c(1,u(0,e))}function F(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function B(e){return n.round(255*parseFloat(e)).toString(16)}function K(e){return F(e)/255}var j,U,H,X=(U="[\\s|\\(]+("+(j="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",H="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+H),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 W(e){return!!X.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(i=function(){return d}.call(t,r,t,e))||(e.exports=i)}(Math)},bT9E:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/omit.js ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var i=r(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function n(e,t){var r=Object(i.a)({},e);return Array.isArray(t)&&t.forEach((function(e){delete r[e]})),r}},c5Ni:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/codemirror/theme/blackboard.css ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},c5fP:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/trees.js ***!
|
|
|
\*********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t._tr_init=function(e){P||(!function(){var e,t,r,i,n,s=new Array(16);for(r=0,i=0;i<28;i++)for(g[i]=r,e=0;e<1<<a[i];e++)p[r++]=i;for(p[r-1]=i,n=0,i=0;i<16;i++)for(y[i]=n,e=0;e<1<<l[i];e++)f[n++]=i;for(n>>=7;i<30;i++)for(y[i]=n<<7,e=0;e<1<<l[i]-7;e++)f[256+n++]=i;for(t=0;t<=15;t++)s[t]=0;e=0;for(;e<=143;)h[2*e+1]=8,e++,s[8]++;for(;e<=255;)h[2*e+1]=9,e++,s[9]++;for(;e<=279;)h[2*e+1]=7,e++,s[7]++;for(;e<=287;)h[2*e+1]=8,e++,s[8]++;for(T(h,287,s),e=0;e<30;e++)d[2*e+1]=5,d[2*e]=x(e,5);v=new b(h,a,257,286,15),m=new b(d,l,0,30,15),_=new b(new Array(0),c,0,19,7)}(),P=!0);e.l_desc=new S(e.dyn_ltree,v),e.d_desc=new S(e.dyn_dtree,m),e.bl_desc=new S(e.bl_tree,_),e.bi_buf=0,e.bi_valid=0,L(e)},t._tr_stored_block=N,t._tr_flush_block=function(e,t,r,i){var n,s,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),M(e,e.l_desc),M(e,e.d_desc),o=function(e){var t;for(I(e,e.dyn_ltree,e.l_desc.max_code),I(e,e.dyn_dtree,e.d_desc.max_code),M(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*u[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5;r+4<=n&&-1!==t?N(e,t,r,i):4===e.strategy||s===n?(E(e,2+(i?1:0),3),R(e,h,d)):(E(e,4+(i?1:0),3),function(e,t,r,i){var n;for(E(e,t-257,5),E(e,r-1,5),E(e,i-4,4),n=0;n<i;n++)E(e,e.bl_tree[2*u[n]+1],3);F(e,e.dyn_ltree,t-1),F(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),R(e,e.dyn_ltree,e.dyn_dtree));L(e),i&&A(e)},t._tr_tally=function(e,t,r){e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(p[r]+256+1)]++,e.dyn_dtree[2*w(t)]++);return e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){E(e,2,3),k(e,256,h),function(e){16===e.bi_valid?(C(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(/*! ../utils/common.js */"6BzB"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function o(e){for(var t=e.length;--t>=0;)e[t]=0}var a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[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],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);o(h);var d=new Array(60);o(d);var f=new Array(512);o(f);var p=new Array(256);o(p);var g=new Array(29);o(g);var v,m,_,y=new Array(30);function b(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}function S(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function w(e){return e<256?f[e]:f[256+(e>>>7)]}function C(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function E(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,C(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function k(e,t,r){E(e,r[2*t],r[2*t+1])}function x(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function T(e,t,r){var i,n,s=new Array(16),o=0;for(i=1;i<=15;i++)s[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=x(s[a]++,a))}}function L(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function A(e){e.bi_valid>8?C(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function D(e,t,r,i){var n=2*t,s=2*r;return e[n]<e[s]||e[n]===e[s]&&i[t]<=i[r]}function O(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&D(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!D(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function R(e,t,r){var i,n,s,o,c=0;if(0!==e.last_lit)do{i=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],n=e.pending_buf[e.l_buf+c],c++,0===i?k(e,n,t):(k(e,(s=p[n])+256+1,t),0!==(o=a[s])&&E(e,n-=g[s],o),k(e,s=w(--i),r),0!==(o=l[s])&&E(e,i-=y[s],o))}while(c<e.last_lit);k(e,256,t)}function M(e,t){var r,i,n,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<l;r++)0!==s[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(n=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[n]=0,e.opt_len--,a&&(e.static_len-=o[2*n+1]);for(t.max_code=c,r=e.heap_len>>1;r>=1;r--)O(e,s,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],O(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,s[2*n]=s[2*r]+s[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,s[2*r+1]=s[2*i+1]=n,e.heap[1]=n++,O(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,s,o,a,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,h=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(s=0;s<=15;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(s=l[2*l[2*(i=e.heap[r])+1]+1]+1)>p&&(s=p,g++),l[2*i+1]=s,i>c||(e.bl_count[s]++,o=0,i>=f&&(o=d[i-f]),a=l[2*i],e.opt_len+=a*(s+o),h&&(e.static_len+=a*(u[2*i+1]+o)));if(0!==g){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(i=e.bl_count[s];0!==i;)(n=e.heap[--r])>c||(l[2*n+1]!==s&&(e.opt_len+=(s-l[2*n+1])*l[2*n],l[2*n+1]=s),i--)}}(e,t),T(s,c,e.bl_count)}function I(e,t,r){var i,n,s=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=t[2*(i+1)+1],++a<l&&n===o||(a<c?e.bl_tree[2*n]+=a:0!==n?(n!==s&&e.bl_tree[2*n]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,s=n,0===o?(l=138,c=3):n===o?(l=6,c=3):(l=7,c=4))}function F(e,t,r){var i,n,s=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),i=0;i<=r;i++)if(n=o,o=t[2*(i+1)+1],!(++a<l&&n===o)){if(a<c)do{k(e,n,e.bl_tree)}while(0!=--a);else 0!==n?(n!==s&&(k(e,n,e.bl_tree),a--),k(e,16,e.bl_tree),E(e,a-3,2)):a<=10?(k(e,17,e.bl_tree),E(e,a-3,3)):(k(e,18,e.bl_tree),E(e,a-11,7));a=0,s=n,0===o?(l=138,c=3):n===o?(l=6,c=3):(l=7,c=4)}}o(y);var P=!1;function N(e,t,r,i){E(e,0+(i?1:0),3),function(e,t,r,i){A(e),i&&(C(e,r),C(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}},dejd:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/toolbar/index.less ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},dmUQ:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/rc-input-number/es/index.js + 1 modules ***!
|
|
|
\**************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,r){"use strict";var i=r("Ff2n"),n=r("rePB"),s=r("1OyB"),o=r("vuIU"),a=r("Ji7U"),l=r("md7G"),c=r("foSv"),u=r("q1tI"),h=r.n(u),d=r("TSYQ"),f=r.n(d),p=r("4IlW");function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=Object(c.a)(e);if(t){var n=Object(c.a)(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Object(l.a)(this,r)}}function _(){}function y(e){e.preventDefault()}var b=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(e){return null!=e},w=function(e,t){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},C=function(e){Object(a.a)(r,e);var t=m(r);function r(e){var i;Object(s.a)(this,r),(i=t.call(this,e)).onKeyDown=function(e){var t=i.props,r=t.onKeyDown,n=t.onPressEnter;if(e.keyCode===p.a.UP){var s=i.getRatio(e);i.up(e,s,null),i.stop()}else if(e.keyCode===p.a.DOWN){var o=i.getRatio(e);i.down(e,o,null),i.stop()}else e.keyCode===p.a.ENTER&&n&&n(e);if(i.recordCursorPosition(),i.lastKeyCode=e.keyCode,r){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];r.apply(void 0,[e].concat(l))}},i.onKeyUp=function(e){var t=i.props.onKeyUp;if(i.stop(),i.recordCursorPosition(),t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];t.apply(void 0,[e].concat(n))}},i.onChange=function(e){var t=i.props.onChange;i.state.focused&&(i.inputting=!0),i.rawInput=i.props.parser(i.getValueFromEvent(e)),i.setState({inputValue:i.rawInput}),t(i.toNumber(i.rawInput))},i.onMouseUp=function(){var e=i.props.onMouseUp;i.recordCursorPosition(),e&&e.apply(void 0,arguments)},i.onFocus=function(){var e;i.setState({focused:!0}),(e=i.props).onFocus.apply(e,arguments)},i.onBlur=function(){var e=i.props.onBlur;i.inputting=!1,i.setState({focused:!1});var t=i.getCurrentValidValue(i.state.inputValue),r=i.setValue(t,_);if(e){var n=i.input.value,s=i.getInputDisplayValue({focus:!1,value:r});i.input.value=s?Number(s):s,e.apply(void 0,arguments),i.input.value=n}},i.getRatio=function(e){var t=1;return e.metaKey||e.ctrlKey?t=.1:e.shiftKey&&(t=10),t},i.getFullNum=function(e){return isNaN(e)?e:/e/i.test(String(e))?Number(e).toFixed(18).replace(/\.?0+$/,""):e},i.getPrecision=function(e){if(S(i.props.precision))return i.props.precision;var t=String(e);if(t.indexOf("e-")>=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var r=0;return t.indexOf(".")>=0&&(r=t.length-t.indexOf(".")-1),r},i.getInputDisplayValue=function(e){var t,r=e||i.state,n=r.focused,s=r.inputValue,o=r.value;null==(t=n?s:i.toPrecisionAsStep(o))&&(t="");var a=i.formatWrapper(t);return S(i.props.decimalSeparator)&&(a=a.toString().replace(".",i.props.decimalSeparator)),a},i.recordCursorPosition=function(){try{i.cursorStart=i.input.selectionStart,i.cursorEnd=i.input.selectionEnd,i.currentValue=i.input.value,i.cursorBefore=i.input.value.substring(0,i.cursorStart),i.cursorAfter=i.input.value.substring(i.cursorEnd)}catch(e){}},i.restoreByAfter=function(e){if(void 0===e)return!1;var t=i.input.value,r=t.lastIndexOf(e);if(-1===r)return!1;var n=i.cursorBefore.length;return i.lastKeyCode===p.a.DELETE&&i.cursorBefore.charAt(n-1)===e[0]?(i.fixCaret(n,n),!0):r+e.length===t.length&&(i.fixCaret(r,r),!0)},i.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,r){var n=e.substring(r);return i.restoreByAfter(n)}))},i.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},i.stop=function(){i.autoStepTimer&&clearTimeout(i.autoStepTimer)},i.down=function(e,t,r){i.pressingUpOrDown=!0,i.step("down",e,t,r)},i.up=function(e,t,r){i.pressingUpOrDown=!0,i.step("up",e,t,r)},i.saveInput=function(e){i.input=e};var n=e.value;void 0===n&&(n=e.defaultValue),i.state={focused:e.autoFocus};var o=i.getValidValue(i.toNumber(n));return i.state=v(v({},i.state),{},{inputValue:i.toPrecisionAsStep(o),value:o}),i}return Object(o.a)(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.value,i=t.onChange,n=t.max,s=t.min,o=this.state.focused;if(e){if(!w(e.value,r)||!w(e.max,n)||!w(e.min,s)){var a,l=o?r:this.getValidValue(r);a=this.pressingUpOrDown?l:this.inputting?this.rawInput:this.toPrecisionAsStep(l),this.setState({value:l,inputValue:a})}var c="value"in this.props?r:this.state.value;"max"in this.props&&e.max!==n&&"number"==typeof c&&c>n&&i&&i(n),"min"in this.props&&e.min!==s&&"number"==typeof c&&c<s&&i&&i(s)}try{if(void 0!==this.cursorStart&&this.state.focused)if(this.partRestoreByAfter(this.cursorAfter)||this.state.value===this.props.value){if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1)}}else{var u=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?u=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(u=this.cursorStart):u=this.input.value.length,this.fixCaret(u,u)}}catch(e){}this.lastKeyCode=null,this.pressingUpOrDown&&this.props.focusOnUpDown&&this.state.focused&&document.activeElement!==this.input&&this.focus()}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(e){var t=e;return t=""===t?"":this.isNotCompleteNumber(parseFloat(t))?this.state.value:this.getValidValue(t),this.toNumber(t)}},{key:"getValueFromEvent",value:function(e){var t=e.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(t=t.replace(this.props.decimalSeparator,".")),t}},{key:"getValidValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.min,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.max,i=parseFloat(e);return isNaN(i)?e:(i<t&&(i=t),i>r&&(i=r),i)}},{key:"setValue",value:function(e,t){var r=this.props.precision,i=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),n=this.state.value,s=void 0===n?null:n,o=this.state.inputValue,a=void 0===o?null:o,l="number"==typeof i?i.toFixed(r):"".concat(i),c=i!==s||l!=="".concat(a);return"value"in this.props?(a=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:a},t)):this.setState({value:i,inputValue:this.toPrecisionAsStep(e)},t),c&&this.props.onChange(i),i}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.props,i=r.precision,n=r.step;if(S(i))return i;var s=this.getPrecision(t),o=this.getPrecision(n),a=this.getPrecision(e);return e?Math.max(a,s+o):s+o}},{key:"getPrecisionFactor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.getMaxPrecision(e,t);return Math.pow(10,r)}},{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(e){return this.props.formatter?this.props.formatter(e):e}},{key:"toPrecisionAsStep",value:function(e){if(this.isNotCompleteNumber(e)||""===e)return e;var t=Math.abs(this.getMaxPrecision(e));return isNaN(t)?e.toString():Number(e).toFixed(t)}},{key:"toNumber",value:function(e){var t=this.props.precision,r=this.state.focused,i=e&&e.length>16&&r;return this.isNotCompleteNumber(e)||i?e:S(t)?Math.round(e*Math.pow(10,t))/Math.pow(10,t):Number(e)}},{key:"upStep",value:function(e,t){var r=this.props.step,i=this.getPrecisionFactor(e,t),n=Math.abs(this.getMaxPrecision(e,t)),s=((i*e+i*r*t)/i).toFixed(n);return this.toNumber(s)}},{key:"downStep",value:function(e,t){var r=this.props.step,i=this.getPrecisionFactor(e,t),n=Math.abs(this.getMaxPrecision(e,t)),s=((i*e-i*r*t)/i).toFixed(n);return this.toNumber(s)}},{key:"step",value:function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3?arguments[3]:void 0;this.stop(),t&&(t.persist(),t.preventDefault());var s=this.props;if(!s.disabled){var o=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(o)){var a=this["".concat(e,"Step")](o,i),l=a>s.max||a<s.min;a>s.max?a=s.max:a<s.min&&(a=s.min),this.setValue(a,null),this.setState({focused:!0},(function(){r.pressingUpOrDown=!1})),l||(this.autoStepTimer=setTimeout((function(){r[e](t,i,!0)}),n?200:600))}}}},{key:"fixCaret",value:function(e,t){if(void 0!==e&&void 0!==t&&this.input&&this.input.value)try{var r=this.input.selectionStart,i=this.input.selectionEnd;e===r&&t===i||this.input.setSelectionRange(e,t)}catch(e){}}},{key:"render",value:function(){var e,t=this.props,r=t.prefixCls,s=t.disabled,o=t.readOnly,a=t.useTouch,l=t.autoComplete,c=t.upHandler,u=t.downHandler,d=t.className,p=t.max,g=t.min,v=t.style,m=t.title,b=t.onMouseEnter,S=t.onMouseLeave,w=t.onMouseOver,C=t.onMouseOut,E=t.required,k=t.onClick,x=t.tabIndex,T=t.type,L=t.placeholder,A=t.id,D=t.inputMode,O=t.pattern,R=t.step,M=t.maxLength,I=t.autoFocus,F=t.name,P=t.onPaste,N=t.onInput,B=Object(i.a)(t,["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"]),K=this.state,j=K.value,U=K.focused,H=f()(r,(e={},Object(n.a)(e,d,!!d),Object(n.a)(e,"".concat(r,"-disabled"),s),Object(n.a)(e,"".concat(r,"-focused"),U),e)),X={};Object.keys(B).forEach((function(e){"data-"!==e.substr(0,5)&&"aria-"!==e.substr(0,5)&&"role"!==e||(X[e]=B[e])}));var W=!o&&!s,z=this.getInputDisplayValue(null),G=(j||0===j)&&(isNaN(j)||Number(j)>=p)||s||o,V=(j||0===j)&&(isNaN(j)||Number(j)<=g)||s||o,q=f()("".concat(r,"-handler"),"".concat(r,"-handler-up"),Object(n.a)({},"".concat(r,"-handler-up-disabled"),G)),Q=f()("".concat(r,"-handler"),"".concat(r,"-handler-down"),Object(n.a)({},"".concat(r,"-handler-down-disabled"),V)),Y=a?{onTouchStart:G?_:this.up,onTouchEnd:this.stop}:{onMouseDown:G?_:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=a?{onTouchStart:V?_:this.down,onTouchEnd:this.stop}:{onMouseDown:V?_:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:H,style:v,title:m,onMouseEnter:b,onMouseLeave:S,onMouseOver:w,onMouseOut:C,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(r,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},Y,{role:"button","aria-label":"Increase Value","aria-disabled":G,className:q}),c||h.a.createElement("span",{unselectable:"on",className:"".concat(r,"-handler-up-inner"),onClick:y})),h.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":V,className:Q}),u||h.a.createElement("span",{unselectable:"on",className:"".concat(r,"-handler-down-inner"),onClick:y}))),h.a.createElement("div",{className:"".concat(r,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":g,"aria-valuemax":p,"aria-valuenow":j,required:E,type:T,placeholder:L,onPaste:P,onClick:k,onMouseUp:this.onMouseUp,className:"".concat(r,"-input"),tabIndex:x,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:W?this.onKeyDown:_,onKeyUp:W?this.onKeyUp:_,autoFocus:I,maxLength:M,readOnly:o,disabled:s,max:p,min:g,step:R,name:F,title:m,id:A,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(z),pattern:O,inputMode:D,onInput:N},X))))}}]),r}(h.a.Component);C.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:b,min:-b,step:1,style:{},onChange:_,onKeyDown:_,onPressEnter:_,onFocus:_,onBlur:_,parser:function(e){return e.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var E=C;t.a=E},eP3c:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inflate.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.inflateReset=p,t.inflateReset2=g,t.inflateResetKeep=f,t.inflateInit=function(e){return v(e,15)},t.inflateInit2=v,t.inflate=function(e,t){var r,i,c,u,d,f,p,g,v,m,_,y,w,C,E,k,x,T,L,A,D,O,R,M,I=0,F=new n.Buf8(4),P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(r=e.state).mode&&(r.mode=13);d=e.next_out,c=e.output,p=e.avail_out,u=e.next_in,i=e.input,f=e.avail_in,g=r.hold,v=r.bits,m=f,_=p,O=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;v<16;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(2&r.wrap&&35615===g){r.check=0,F[0]=255&g,F[1]=g>>>8&255,r.check=(0,o.default)(r.check,F,2,0),g=0,v=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(v-=4,D=8+(15&(g>>>=4)),0===r.wbits)r.wbits=D;else if(D>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<D,e.adler=r.check=1,r.mode=512&g?10:12,g=0,v=0;break;case 2:for(;v<16;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=(0,o.default)(r.check,F,2,0)),g=0,v=0,r.mode=3;case 3:for(;v<32;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}r.head&&(r.head.time=g),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=(0,o.default)(r.check,F,4,0)),g=0,v=0,r.mode=4;case 4:for(;v<16;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=(0,o.default)(r.check,F,2,0)),g=0,v=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=(0,o.default)(r.check,F,2,0)),g=0,v=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((y=r.length)>f&&(y=f),y&&(r.head&&(D=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,i,u,y,D)),512&r.flags&&(r.check=(0,o.default)(r.check,i,y,u)),f-=y,u+=y,r.length-=y),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===f)break e;y=0;do{D=i[u+y++],r.head&&D&&r.length<65536&&(r.head.name+=String.fromCharCode(D))}while(D&&y<f);if(512&r.flags&&(r.check=(0,o.default)(r.check,i,y,u)),f-=y,u+=y,D)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===f)break e;y=0;do{D=i[u+y++],r.head&&D&&r.length<65536&&(r.head.comment+=String.fromCharCode(D))}while(D&&y<f);if(512&r.flags&&(r.check=(0,o.default)(r.check,i,y,u)),f-=y,u+=y,D)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;v<16;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}g=0,v=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}e.adler=r.check=h(g),g=0,v=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=d,e.avail_out=p,e.next_in=u,e.avail_in=f,r.hold=g,r.bits=v,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}switch(r.last=1&g,v-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(b(r),r.mode=20,6===t){g>>>=2,v-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,v=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(y=r.length){if(y>f&&(y=f),y>p&&(y=p),0===y)break e;n.arraySet(c,i,u,y,d),f-=y,u+=y,p-=y,d+=y,r.length-=y;break}r.mode=12;break;case 17:for(;v<14;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(r.nlen=257+(31&g),g>>>=5,v-=5,r.ndist=1+(31&g),g>>>=5,v-=5,r.ncode=4+(15&g),g>>>=4,v-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;v<3;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}r.lens[P[r.have++]]=7&g,g>>>=3,v-=3}for(;r.have<19;)r.lens[P[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},O=(0,l.default)(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,O){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;I=r.lencode[g&(1<<r.lenbits)-1],k=I>>>16&255,x=65535&I,!((E=I>>>24)<=v);){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(x<16)g>>>=E,v-=E,r.lens[r.have++]=x;else{if(16===x){for(M=E+2;v<M;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(g>>>=E,v-=E,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}D=r.lens[r.have-1],y=3+(3&g),g>>>=2,v-=2}else if(17===x){for(M=E+3;v<M;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}v-=E,D=0,y=3+(7&(g>>>=E)),g>>>=3,v-=3}else{for(M=E+7;v<M;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}v-=E,D=0,y=11+(127&(g>>>=E)),g>>>=7,v-=7}if(r.have+y>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;y--;)r.lens[r.have++]=D}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},O=(0,l.default)(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,O){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},O=(0,l.default)(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,O){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(f>=6&&p>=258){e.next_out=d,e.avail_out=p,e.next_in=u,e.avail_in=f,r.hold=g,r.bits=v,(0,a.default)(e,_),d=e.next_out,c=e.output,p=e.avail_out,u=e.next_in,i=e.input,f=e.avail_in,g=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;I=r.lencode[g&(1<<r.lenbits)-1],k=I>>>16&255,x=65535&I,!((E=I>>>24)<=v);){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(k&&0==(240&k)){for(T=E,L=k,A=x;I=r.lencode[A+((g&(1<<T+L)-1)>>T)],k=I>>>16&255,x=65535&I,!(T+(E=I>>>24)<=v);){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}g>>>=T,v-=T,r.back+=T}if(g>>>=E,v-=E,r.back+=E,r.length=x,0===k){r.mode=26;break}if(32&k){r.back=-1,r.mode=12;break}if(64&k){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&k,r.mode=22;case 22:if(r.extra){for(M=r.extra;v<M;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;I=r.distcode[g&(1<<r.distbits)-1],k=I>>>16&255,x=65535&I,!((E=I>>>24)<=v);){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(0==(240&k)){for(T=E,L=k,A=x;I=r.distcode[A+((g&(1<<T+L)-1)>>T)],k=I>>>16&255,x=65535&I,!(T+(E=I>>>24)<=v);){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}g>>>=T,v-=T,r.back+=T}if(g>>>=E,v-=E,r.back+=E,64&k){e.msg="invalid distance code",r.mode=30;break}r.offset=x,r.extra=15&k,r.mode=24;case 24:if(r.extra){for(M=r.extra;v<M;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break e;if(y=_-p,r.offset>y){if((y=r.offset-y)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}y>r.wnext?(y-=r.wnext,w=r.wsize-y):w=r.wnext-y,y>r.length&&(y=r.length),C=r.window}else C=c,w=d-r.offset,y=r.length;y>p&&(y=p),p-=y,r.length-=y;do{c[d++]=C[w++]}while(--y);0===r.length&&(r.mode=21);break;case 26:if(0===p)break e;c[d++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;v<32;){if(0===f)break e;f--,g|=i[u++]<<v,v+=8}if(_-=p,e.total_out+=_,r.total+=_,_&&(e.adler=r.check=r.flags?(0,o.default)(r.check,c,_,d-_):(0,s.default)(r.check,c,_,d-_)),_=p,(r.flags?g:h(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}g=0,v=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;v<32;){if(0===f)break e;f--,g+=i[u++]<<v,v+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}g=0,v=0}r.mode=29;case 29:O=1;break e;case 30:O=-3;break e;case 31:return-4;case 32:default:return-2}if(e.next_out=d,e.avail_out=p,e.next_in=u,e.avail_in=f,r.hold=g,r.bits=v,(r.wsize||_!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&S(e,e.output,e.next_out,_-e.avail_out))return r.mode=31,-4;m-=e.avail_in,_-=e.avail_out,e.total_in+=m,e.total_out+=_,r.total+=_,r.wrap&&_&&(e.adler=r.check=r.flags?(0,o.default)(r.check,c,_,e.next_out-_):(0,s.default)(r.check,c,_,e.next_out-_));e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===m&&0===_||4===t)&&0===O&&(O=-5);return O},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;t.window&&(t.window=null);return e.state=null,0},t.inflateGetHeader=function(e,t){var r;if(!e||!e.state)return-2;if(0==(2&(r=e.state).wrap))return-2;return r.head=t,t.done=!1,0},t.inflateSetDictionary=function(e,t){var r,i,n=t.length;if(!e||!e.state)return-2;if(0!==(r=e.state).wrap&&11!==r.mode)return-2;if(11===r.mode&&(i=1,(i=(0,s.default)(i,t,n,0))!==r.check))return-3;if(S(e,t,n,n))return r.mode=31,-4;return r.havedict=1,0},t.inflateInfo=t.Z_DEFLATED=t.Z_BUF_ERROR=t.Z_MEM_ERROR=t.Z_DATA_ERROR=t.Z_STREAM_ERROR=t.Z_NEED_DICT=t.Z_STREAM_END=t.Z_OK=t.Z_TREES=t.Z_BLOCK=t.Z_FINISH=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(/*! ../utils/common.js */"6BzB")),s=c(r(/*! ./adler32.js */"xlC8")),o=c(r(/*! ./crc32.js */"QV2g")),a=c(r(/*! ./inffast.js */"sjKO")),l=c(r(/*! ./inftrees.js */"JSwD"));function c(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}t.Z_FINISH=4;t.Z_BLOCK=5;t.Z_TREES=6;t.Z_OK=0;t.Z_STREAM_END=1;t.Z_NEED_DICT=2;t.Z_STREAM_ERROR=-2;t.Z_DATA_ERROR=-3;t.Z_MEM_ERROR=-4;t.Z_BUF_ERROR=-5;t.Z_DEFLATED=8;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function d(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,f(e)):-2}function g(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,p(e))):-2}function v(e,t){var r,i;return e?(i=new d,e.state=i,i.window=null,0!==(r=g(e,t))&&(e.state=null),r):-2}var m,_,y=!0;function b(e){if(y){var t;for(m=new n.Buf32(512),_=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for((0,l.default)(1,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;(0,l.default)(2,e.lens,0,32,_,0,e.work,{bits:5}),y=!1}e.lencode=m,e.lenbits=9,e.distcode=_,e.distbits=5}function S(e,t,r,i){var s,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),i>=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>i&&(s=i),n.arraySet(o.window,t,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}t.inflateInfo="pako inflate (from Nodeca project)"},gIYZ:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/fixedkeys.js ***!
|
|
|
\**********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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"}},h78n:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/rc-progress/es/index.js + 3 modules ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: Line, Circle, default */
|
|
|
/*! exports used: Circle */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,r){"use strict";r.d(t,"a",(function(){return C}));var i=r("q1tI"),n=r.n(i),s=r("TSYQ"),o=r.n(s),a={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},l=function(e){var t=e.map((function(){return Object(i.useRef)()})),r=Object(i.useRef)();return Object(i.useEffect)((function(){var e=Date.now(),i=!1;Object.keys(t).forEach((function(n){var s=t[n].current;if(s){i=!0;var o=s.style;o.transitionDuration=".3s, .3s, .3s, .06s",r.current&&e-r.current<100&&(o.transitionDuration="0s, 0s")}})),i&&(r.current=Date.now())})),[t]};function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],i=!0,n=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(i=(o=a.next()).done)&&(r.push(o.value),!t||r.length!==t);i=!0);}catch(e){n=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(n)throw s}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function d(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r,i,n={},s=Object.keys(e);for(i=0;i<s.length;i++)r=s[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var f=function(e){var t=e.className,r=e.percent,i=e.prefixCls,s=e.strokeColor,a=e.strokeLinecap,h=e.strokeWidth,f=e.style,p=e.trailColor,g=e.trailWidth,v=e.transition,m=d(e,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete m.gapPosition;var _=Array.isArray(r)?r:[r],y=Array.isArray(s)?s:[s],b=u(l(_),1)[0],S=h/2,w=100-h/2,C="M ".concat("round"===a?S:0,",").concat(S,"\n L ").concat("round"===a?w:100,",").concat(S),E="0 0 100 ".concat(h),k=0;return n.a.createElement("svg",c({className:o()("".concat(i,"-line"),t),viewBox:E,preserveAspectRatio:"none",style:f},m),n.a.createElement("path",{className:"".concat(i,"-line-trail"),d:C,strokeLinecap:a,stroke:p,strokeWidth:g||h,fillOpacity:"0"}),_.map((function(e,t){var r={strokeDasharray:"".concat(e,"px, 100px"),strokeDashoffset:"-".concat(k,"px"),transition:v||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},s=y[t]||y[y.length-1];return k+=e,n.a.createElement("path",{key:t,className:"".concat(i,"-line-path"),d:C,strokeLinecap:a,stroke:s,strokeWidth:h,fillOpacity:"0",ref:b[t],style:r})})))};f.defaultProps=a;function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],i=!0,n=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(i=(o=a.next()).done)&&(r.push(o.value),!t||r.length!==t);i=!0);}catch(e){n=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(n)throw s}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function m(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r,i,n={},s=Object.keys(e);for(i=0;i<s.length;i++)r=s[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var _=0;function y(e){return+e.replace("%","")}function b(e){return Array.isArray(e)?e:[e]}function S(e,t,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5?arguments[5]:void 0,o=50-i/2,a=0,l=-o,c=0,u=-2*o;switch(s){case"left":a=-o,l=0,c=2*o,u=0;break;case"right":a=o,l=0,c=-2*o,u=0;break;case"bottom":l=o,u=2*o}var h="M 50,50 m ".concat(a,",").concat(l,"\n a ").concat(o,",").concat(o," 0 1 1 ").concat(c,",").concat(-u,"\n a ").concat(o,",").concat(o," 0 1 1 ").concat(-c,",").concat(u),d=2*Math.PI*o,f={stroke:r,strokeDasharray:"".concat(t/100*(d-n),"px ").concat(d,"px"),strokeDashoffset:"-".concat(n/2+e/100*(d-n),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:h,pathStyle:f}}var w=function(e){var t,r=e.prefixCls,s=e.strokeWidth,a=e.trailWidth,c=e.gapDegree,u=e.gapPosition,h=e.trailColor,d=e.strokeLinecap,f=e.style,v=e.className,w=e.strokeColor,C=e.percent,E=m(e,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),k=Object(i.useMemo)((function(){return _+=1}),[]),x=S(0,100,h,s,c,u),T=x.pathString,L=x.pathStyle,A=b(C),D=b(w),O=D.find((function(e){return"[object Object]"===Object.prototype.toString.call(e)})),R=g(l(A),1)[0];return n.a.createElement("svg",p({className:o()("".concat(r,"-circle"),v),viewBox:"0 0 100 100",style:f},E),O&&n.a.createElement("defs",null,n.a.createElement("linearGradient",{id:"".concat(r,"-gradient-").concat(k),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(O).sort((function(e,t){return y(e)-y(t)})).map((function(e,t){return n.a.createElement("stop",{key:t,offset:e,stopColor:O[e]})})))),n.a.createElement("path",{className:"".concat(r,"-circle-trail"),d:T,stroke:h,strokeLinecap:d,strokeWidth:a||s,fillOpacity:"0",style:L}),(t=0,A.map((function(e,i){var o=D[i]||D[D.length-1],a="[object Object]"===Object.prototype.toString.call(o)?"url(#".concat(r,"-gradient-").concat(k,")"):"",l=S(t,e,o,s,c,u);return t+=e,n.a.createElement("path",{key:i,className:"".concat(r,"-circle-path"),d:l.pathString,stroke:a,strokeLinecap:d,strokeWidth:s,opacity:0===e?0:1,fillOpacity:"0",style:l.pathStyle,ref:R[i]})}))).reverse())};w.defaultProps=a;var C=w},hXwI:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/copyrect.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n;return t=e,(r=[{key:"decodeRect",value:function(e,t,r,i,n,s,o){if(n.rQwait("COPYRECT",4))return!1;var a=n.rQshift16(),l=n.rQshift16();return s.copyImage(a,l,e,t,r,i),!0}}])&&i(t.prototype,r),n&&i(t,n),e}();t.default=n},iJb0:
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./src/pages/Shixuns/New/ImagePreview/index.tsx + 1 modules ***!
|
|
|
\******************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/LoadingOutlined.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@novnc/novnc/lib/rfb.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Shixuns/New/ImagePreview/index.less?modules (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/.umi-production/core/umiExports.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/Spinner/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/mediator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/xterm-panel/index.jsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/service/shixuns.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/col/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/col/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/progress/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/progress/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/row/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/row/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/statistic/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/statistic/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router/esm/react-router.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(e,t,r){"use strict";r.r(t);r("+L6B");var i=r("2/Rp"),n=(r("miYZ"),r("tsqr")),s=(r("14J3"),r("BMrR")),o=(r("jCWc"),r("kPKH")),a=r("k1fw"),l=r("9og8"),c=(r("2qtc"),r("kLXV")),u=r("tJVT"),h=r("PpiC"),d=(r("aHsQ"),r("sGsY")),f=r("WmNS"),p=r.n(f),g=r("q1tI"),v=r.n(g),m=r("9kvl"),_=(r("Lmeb"),r("Ot1p")),y=r("Dqnf"),b=r("dhSg"),S=(r("MXD1"),r("CFYs")),w=r("rAM+"),C=r("IxHN"),E=r("bdgK"),k=r("M8RZ"),x=r("Ty5D"),T=r("1dTM"),L=r.n(T),A=r("HBuW"),D=r("VaU+"),O=r.n(D),R=r("ye1Q");R.a;function M(e){e||(e=window.location.search);var t=e.substr(1),r={};return t.split("&").forEach((function(e){var t=e.split("=");r[t[0]]=decodeURIComponent(t[1])})),r}var I,F={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"实验环境准备中"};function P(e,t){switch(t.type){case I.SET_LOADING:return Object(a.a)(Object(a.a)({},e),{},{loading:t.payload});case I.SET_IS_LARGE:return Object(a.a)(Object(a.a)({},e),{},{isLarge:t.payload});case I.SET_MES:return Object(a.a)(Object(a.a)({},e),{},{mes:t.payload});case I.SET_STATE:return Object(a.a)(Object(a.a)({},e),t.payload);case I.SET_TRANSFER_CONTENT:return Object(a.a)(Object(a.a)({},e),{},{transferContent:t.payload});case I.SHOW_CLIPBOARD_BOX:return Object(a.a)(Object(a.a)({},e),{},{showClipBoardBox:t.payload});default:throw new Error}}!function(e){e[e.SET_LOADING=0]="SET_LOADING",e[e.SET_IS_LARGE=1]="SET_IS_LARGE",e[e.SET_MES=2]="SET_MES",e[e.SET_STATE=3]="SET_STATE",e[e.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",e[e.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"}(I||(I={}));var N=function(e){var t,r=e.vnc_url,i=e.window_vnc_url,s=(e.taskId,Object(g.useRef)()),o=Object(g.useRef)(),h=Object(g.useReducer)(P,F),d=Object(u.a)(h,2),f=d[0],m=d[1],_=Object(g.useState)(0),y=Object(u.a)(_,2),T=y[0],D=y[1],R=f.mes,N=f.loading,B=(f.showClipBoardBox,f.isLarge),K=(f.transferContent,Object(g.useState)(0)),j=Object(u.a)(K,2),U=j[0],H=j[1],X=Object(g.useRef)(),W=Object(x.i)();function z(e){var t;return s.current&&(t=new E.default((function(t){var r,i=Object(w.a)(t);try{for(i.s();!(r=i.n()).done;){var n=r.value;(n.target.offsetHeight>0||n.target.offsetWidth>0)&&e._eventHandlers.windowResize()}}catch(e){i.e(e)}finally{i.f()}}))).observe(s.current),t}var G=function(){var e=Object(l.a)(p.a.mark((function e(){var r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(A.mb)(Object(a.a)({},W));case 2:if(-3!==(null==(r=e.sent)?void 0:r.status)){e.next=5;break}return e.abrupt("return",new Promise(function(){var e=Object(l.a)(p.a.mark((function e(r,i){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.a.confirm({content:"检测到您已经开启了其他windows环境,请先关闭环境后,再连接",okText:"立即关闭",cancelText:"稍后关闭",onOk:function(){var e=Object(l.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(t),H(0),G(),e.abrupt("return");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 5:if(-1!==(null==r?void 0:r.status)){e.next=7;break}throw new String(null==r?void 0:r.message);case 7:return b.a.publish("update-windows-time",null==r?void 0:r.data),e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(g.useEffect)((function(){return X.current=setTimeout((function(){c.a.confirm({title:v.a.createElement(v.a.Fragment,null,"实验环境延时提醒"),content:"当前实验环境将于 5 分钟后关闭,需要延长使用时间吗?",okText:"立即延长",cancelText:"不需要",onOk:function(){b.a.publish("delayed-time",1),D(T+1)}})}),36e5),function(){clearTimeout(X.current)}}),[]),Object(g.useEffect)((function(){var e,a;function c(e){i&&(n.b.warn("由于长时间未操作,连接失效,正在重新连接Windows VNC服务"),m({type:I.SET_LOADING,payload:!0}),D(T+1))}function u(){clearTimeout(t),H(100),setTimeout((function(){m({type:I.SET_LOADING,payload:!1})}),1300),b.a.subscribe("send-ctrl-alt-delete",(function(){var t;null===(t=e)||void 0===t||t.sendCtrlAltDel()}))}function h(e){var t=e.detail.text.replace(/\\u([\dA-Za-z]{4})/g,(function(e,t){return String.fromCharCode(parseInt("0x"+t))}));m({type:I.SET_TRANSFER_CONTENT,payload:t})}if((i||r)&&s.current){new Promise(Object(l.a)(p.a.mark((function t(){var r,n,l,d,f,g,v,m,_,y;return p.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=M(),n="",t.next=4,G();case 4:d=t.sent,i?(l="Edu123",n=decodeURIComponent(null==d||null===(f=d.data)||void 0===f?void 0:f.vnc_url)):(v=new URL(null==d||null===(g=d.data)||void 0===g?void 0:g.vnc_url),m=v.protocol,_=v.searchParams,y=v.host,l=_.get("password"),n="".concat("https:"===m?"wss":"ws","://").concat(y,"/").concat(r.path||"websockify")),e=new L.a(s.current,n,{credentials:{password:l},wsProtocols:["binary"]}),a=z(e),e.viewOnly=r.view_only||!1,e.scaleViewport=!!i||(r.scale||!1),e.scaleViewport=r.scale||!0,e.resizeSession=!0,o.current=e,e.addEventListener("disconnect",c),e.addEventListener("connect",u),e.addEventListener("clipboard",h);case 16:case"end":return t.stop()}}),t)}))));var d=b.a.subscribe("vnc-reseting",(function(){m({type:I.SET_STATE,payload:{loading:!0,mes:"实验环境重置中"}})})),f=b.a.subscribe("vnc-enlarge",(function(){m({type:I.SET_IS_LARGE,payload:!0})})),g=b.a.subscribe("show-clipboard-box",(function(){m({type:I.SHOW_CLIPBOARD_BOX,payload:!0})}));return H(0),function(){var t,r,i,n;null===(t=e)||void 0===t||t.removeEventListener("disconnect",c),null===(r=e)||void 0===r||r.removeEventListener("connect",u),null===(i=e)||void 0===i||i.removeEventListener("clipboard",h),d(),f(),g(),null===(n=a)||void 0===n||n.unobserve(s.current)}}}),[r,i,T]),Object(g.useEffect)((function(){0==U&&V()}),[U]);var V=function e(){U>99?U=99:(U+=1,t=setTimeout((function(){e()}),1500)),U<100&&H(U)};return v.a.createElement(g.Fragment,null,v.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(i?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(B?"full-screen":"")},v.a.createElement("a",{className:"btn-vnc-resize",onClick:function(){m({type:I.SET_IS_LARGE,payload:!B})}},v.a.createElement("i",{className:"iconfont ".concat(B?"icon-tuichuquanping1":"icon-quanping1")})),N?v.a.createElement(C.a,{className:O.a.spin,message:R,style:{color:"#0152d9"}},v.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},v.a.createElement(S.a,{percent:U,format:function(e){return v.a.createElement("span",{className:"c-white"},e,"%")}}))):null,v.a.createElement("div",{ref:s,className:"vnc-panel ".concat(N?"hide":"animated fadeIn")})),v.a.createElement(k.a,null))},B=r("m3rI"),K=d.a.Countdown;t.default=Object(m.a)((function(e){var t=e.shixunsDetail,r=e.loading,i=e.user;return{shixunsDetail:t,globalSetting:e.globalSetting,user:i,loading:r.models.shixunsDetail}}))((function(e){var t,r,d=e.shixunsDetail,f=(e.globalSetting,e.loading,e.dispatch),m=e.user,S=e.history,w=Object(h.a)(e,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),C=Object(g.useState)({}),E=Object(u.a)(C,2),k=E[0],x=E[1],T=Object(g.useState)(400),L=Object(u.a)(T,2),D=L[0],R=L[1],M=Object(g.useState)(!1),I=Object(u.a)(M,2),F=I[0],P=I[1],j=Object(g.useState)(""),U=Object(u.a)(j,2),H=U[0],X=U[1],W=Object(g.useState)(Date.now()+36e5),z=Object(u.a)(W,2),G=z[0],V=z[1],q=w.match.params,Q=(w.location.query,Object(g.useState)(!1)),Y=Object(u.a)(Q,2),Z=Y[0],$=Y[1],J=d.mirrorApplies,ee=Object(g.useRef)();Object(g.useEffect)((function(){return f({type:"globalSetting/headerFooterToggle",payload:!1}),re(),ie(),window.addEventListener("resize",re),b.a.subscribe("delayed-time",(function(){V(Date.now()+36e5)})),function(){window.removeEventListener("resize",re),clearTimeout(ee.current),f({type:"globalSetting/headerFooterToggle",payload:!0})}}),[]),Object(g.useEffect)((function(){k.host&&setTimeout((function(){b.a.publish("create-socket",1)}),1500)}),[k]),Object(g.useEffect)((function(){J.webssh&&(te(),ee.current=setTimeout((function(){c.a.confirm({title:v.a.createElement(v.a.Fragment,null,"实验环境延时提醒"),content:"当前实验环境将于 15 分钟后关闭,需要延长使用时间吗?",okText:"立即延长",cancelText:"不需要",onOk:function(){b.a.publish("ssh-add-connect-time",{}),b.a.publish("delayed-time",1)}})}),36e5)),J.id&&re()}),[J]);var te=function(){var e=Object(l.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(A.nb)(Object(a.a)({},q));case 2:t=e.sent,x(Object(a.a)({},t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=window.innerHeight;R(e-(J.audit_remark?400:270))},ie=function(){var e=Object(l.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f({type:"shixunsDetail/getMirrorApplies",payload:Object(a.a)({},q)});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return console.log(null==m?void 0:m.userInfo),v.a.createElement("section",{className:O.a.wrp},v.a.createElement("header",{className:O.a.header},v.a.createElement(s.a,{align:"middle"},v.a.createElement(o.a,{flex:"1"},v.a.createElement("img",{alt:"用户头像",height:"40",src:"".concat(B.a.IMG_SERVER,"/images/").concat(null==m||null===(t=m.userInfo)||void 0===t?void 0:t.image_url),width:"40",style:{borderRadius:"50%"}}),v.a.createElement("span",{className:"ml10"},null==m||null===(r=m.userInfo)||void 0===r?void 0:r.real_name)),v.a.createElement(o.a,{flex:"1"},v.a.createElement("span",{className:"mr10 font18"},J.name)),v.a.createElement(o.a,null,v.a.createElement("span",null,"剩余时长:",v.a.createElement(K,{className:O.a.cuttDown,value:G,format:"mm:ss",valueStyle:{color:"#FFF"}})),v.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){c.a.confirm({title:"退出镜像",content:"你确定要退出镜像吗?",okText:"确定",cancelText:"取消",onOk:function(){var e;S.push("/users/".concat(null===(e=m.userInfo)||void 0===e?void 0:e.login,"/experiment-img"))}})}})))),v.a.createElement("aside",{className:O.a.container},v.a.createElement(s.a,null,v.a.createElement(o.a,{style:{position:"relative",width:Z?"0%":"40%"}},v.a.createElement("section",{className:"".concat(O.a.info," ml40 mr40"),style:{display:Z?"none":"flex"}},v.a.createElement("aside",null,v.a.createElement(s.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},v.a.createElement(o.a,{className:"font18"},"实验环境说明 ",v.a.createElement("span",{className:"font16 ml20 c-grey-999"},"请按模板填写实验环境说明"))),v.a.createElement("aside",{className:"mt30 flex1"},v.a.createElement(_.a,{height:D,defaultValue:J.description||"",onChange:function(e){return X(e)}}),J.audit_remark&&v.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"审核不通过原因:",v.a.createElement("span",{className:"c-red"},J.audit_remark))),v.a.createElement("aside",{className:"mb20"},v.a.createElement(s.a,{justify:"center",gutter:[20,20],className:O.a.buttons},v.a.createElement(o.a,null,v.a.createElement(i.a,{type:"primary",size:"large",loading:F,onClick:Object(l.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P(!0),c.a.info({title:"保存镜像",centered:!0,content:"临时镜像系统默认只保存30天,过期将会自动清理。请尽快申请发布。",okText:"我知道了",onOk:function(){}}),e.next=4,Object(A.pb)(Object(a.a)(Object(a.a)({},q),{},{description:H}));case 4:0===(null==(t=e.sent)?void 0:t.status)&&n.b.success("保存成功"),P(!1);case 7:case"end":return e.stop()}}),e)})))},"保存")),v.a.createElement(o.a,null,v.a.createElement(i.a,{type:"primary",ghost:!0,size:"large",onClick:Object(l.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.a.confirm({title:"申请发布",centered:!0,content:"你确定要申请发布该镜像?",okText:"确定",cancelText:"取消",onOk:function(){var e=Object(l.a)(p.a.mark((function e(){var t,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(A.ob)(Object(a.a)(Object(a.a)({},q),{},{description:H}));case 2:0===(null==(t=e.sent)?void 0:t.status)&&(S.push("/users/".concat(null===(r=m.userInfo)||void 0===r?void 0:r.login,"/experiment-img")),n.b.success("申请发布成功"));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})))},"申请发布")))))),v.a.createElement("div",{className:Z?O.a.elseShrink:O.a.shrink,onClick:function(){return $(!Z)}},v.a.createElement("i",{className:"iconfont icon-cela"}))),v.a.createElement(o.a,{style:{background:"#000",width:Z?"100%":"60%"}},v.a.createElement("div",null,v.a.createElement("aside",{className:O.a.fullBtn},v.a.createElement("span",{className:"icon-quanping"})),J.webssh&&v.a.createElement(y.a,{sshConfigData:k,sid:1}),((null==J?void 0:J.vnc)||(null==J?void 0:J.windows))&&v.a.createElement(N,{taskId:"windows"===J.type?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:J.vnc,window_vnc_url:J.windows}))))))}))},iUHT:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/des.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s,o,a,l,c,u=[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],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[(o=(n=65536)|(s=1<<24))|(l=1024),0,0|n,o|(c=(a=4)|l),o|a,n|c,0|a,0|n,0|l,o|l,o|c,0|l,s|c,o|a,0|s,0|a,0|c,s|l,s|l,n|l,n|l,0|o,0|o,s|c,n|a,s|a,s|a,n|a,0,0|c,n|c,0|s,0|n,o|c,0|a,0|o,o|l,0|s,0|s,0|l,o|a,0|n,n|l,s|a,0|l,0|a,s|c,n|c,o|c,n|a,0|o,s|c,s|a,0|c,n|c,o|l,0|c,s|l,s|l,0,n|a,n|l,0,o|a],f=[(o=(n=1<<20)|(s=1<<31))|(c=(a=32)|(l=32768)),s|l,0|l,n|c,0|n,0|a,o|a,s|c,s|a,o|c,o|l,0|s,s|l,0|n,0|a,o|a,n|l,n|a,s|c,0,0|s,0|l,n|c,0|o,n|a,s|a,0,n|l,0|c,o|l,0|o,0|c,0,n|c,o|a,0|n,s|c,0|o,o|l,0|l,0|o,s|l,0|a,o|c,n|c,0|a,0|l,0|s,0|c,o|l,0|n,s|a,n|a,s|c,s|a,n|a,n|l,0,s|l,0|c,0|s,o|a,o|c,n|l],p=[0|(c=(a=8)|(l=512)),(o=(n=1<<17)|(s=1<<27))|l,0,o|a,s|l,0,n|c,s|l,n|a,s|a,s|a,0|n,o|c,n|a,0|o,0|c,0|s,0|a,o|l,0|l,n|l,0|o,o|a,n|c,s|c,n|l,0|n,s|c,0|a,o|c,0|l,0|s,o|l,0|s,n|a,0|c,0|n,o|l,s|l,0,0|l,n|a,o|c,s|l,s|a,0|l,0,o|a,s|c,0|n,0|s,o|c,0|a,n|c,n|l,s|a,0|o,s|c,0|c,0|o,n|c,0|a,o|a,n|l],g=[(o=(n=8192)|(s=1<<23))|(a=1),n|(c=a|(l=128)),n|c,0|l,o|l,s|c,s|a,n|a,0,0|o,0|o,o|c,0|c,0,s|l,s|a,0|a,0|n,0|s,o|a,0|l,0|s,n|a,n|l,s|c,0|a,n|l,s|l,0|n,o|l,o|c,0|c,s|l,s|a,0|o,o|c,0|c,0,0,0|o,n|l,s|l,s|c,0|a,o|a,n|c,n|c,0|l,o|c,0|c,0|a,0|n,s|a,n|a,o|l,s|c,n|a,n|l,0|s,o|a,0|l,0|s,0|n,o|l],v=[0|(a=256),(n=1<<25)|(c=a|(l=1<<19)),n|l,(o=n|(s=1<<30))|a,0|l,0|a,0|s,n|l,s|c,0|l,n|a,s|c,o|a,o|l,0|c,0|s,0|n,s|l,s|l,0,s|a,o|c,o|c,n|a,o|l,s|a,0,0|o,n|c,0|n,0|o,0|c,0|l,o|a,0|a,0|n,0|s,n|l,o|a,s|c,n|a,0|s,o|l,n|c,s|c,0|a,0|n,o|l,o|c,0|c,0|o,o|c,n|l,0,s|l,0|o,0|c,n|a,s|a,0|l,0,s|l,n|c,s|a],m=[(s=1<<29)|(a=16),0|(o=(n=1<<22)|s),0|(l=16384),o|(c=a|l),0|o,0|a,o|c,0|n,s|l,n|c,0|n,s|a,n|a,s|l,0|s,0|c,0,n|a,s|c,0|l,n|l,s|c,0|a,o|a,o|a,0,n|c,o|l,0|c,n|l,o|l,0|s,s|l,0|a,o|a,n|l,o|c,0|n,0|c,s|a,0|n,s|l,0|s,0|c,s|a,o|c,n|l,0|o,n|c,o|l,0,o|a,0|a,0|l,0|o,n|c,0|l,n|a,s|c,0,o|l,0|s,n|a,s|c],_=[0|(n=1<<21),(o=n|(s=1<<26))|(a=2),s|(c=a|(l=2048)),0,0|l,s|c,n|c,o|l,o|c,0|n,0,s|a,0|a,0|s,o|a,0|c,s|l,n|c,n|a,s|l,s|a,0|o,o|l,n|a,0|o,0|l,0|c,o|c,n|l,0|a,0|s,n|l,0|s,n|l,0|n,s|c,s|c,o|a,o|a,0|a,n|a,0|s,s|l,0|n,o|l,0|c,n|c,o|l,0|c,s|a,o|c,0|o,n|l,0,0|a,o|c,0,n|c,0|o,0|l,s|a,s|l,0|l,n|a],y=[(s=1<<28)|(c=(a=64)|(l=4096)),0|l,0|(n=1<<18),(o=n|s)|c,0|s,s|c,0|a,0|s,n|a,0|o,o|c,n|l,o|l,n|c,0|l,0|a,0|o,s|a,s|l,0|c,n|l,n|a,o|a,o|l,0|c,0,0,o|a,s|a,s|l,n|c,0|n,n|c,0|n,o|l,0|l,0|a,o|a,0|l,n|c,s|l,0|a,s|a,0|o,o|a,0|s,0|n,s|c,0,o|c,n|a,s|a,0|o,s|l,s|c,0,o|c,n|l,n|l,0|c,0|c,n|a,0|s,o|l],b=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keys=[];for(var r=[],i=[],n=[],s=0,o=56;s<56;++s,o-=8){var a=7&(o+=o<-5?65:o<-3?31:o<-1?63:27===o?35:0);r[s]=0!=(t[o>>>3]&1<<a)?1:0}for(var l=0;l<16;++l){var c=l<<1,d=c+1;n[c]=n[d]=0;for(var f=28;f<59;f+=28)for(var p=f-28;p<f;++p){var g=p+h[l];i[p]=g<f?r[g]:r[g-28]}for(var v=0;v<24;++v)0!==i[u[v]]&&(n[c]|=1<<23-v),0!==i[u[v+24]]&&(n[d]|=1<<23-v)}for(var m=0,_=0,y=0;m<16;++m){var b=n[_++],S=n[_++];this.keys[y]=(16515072&b)<<6,this.keys[y]|=(4032&b)<<10,this.keys[y]|=(16515072&S)>>>10,this.keys[y]|=(4032&S)>>>6,++y,this.keys[y]=(258048&b)<<12,this.keys[y]|=(63&b)<<16,this.keys[y]|=(258048&S)>>>4,this.keys[y]|=63&S,++y}}var t,r,n;return t=e,(r=[{key:"enc8",value:function(e){var t,r,i,n=e.slice(),s=0;t=n[s++]<<24|n[s++]<<16|n[s++]<<8|n[s++],r=n[s++]<<24|n[s++]<<16|n[s++]<<8|n[s++],r^=i=252645135&(t>>>4^r),r^=i=65535&((t^=i<<4)>>>16^r),r^=(i=858993459&(r>>>2^(t^=i<<16)))<<2,r=(r^=(i=16711935&(r>>>8^(t^=i)))<<8)<<1|r>>>31&1,r^=i=2863311530&((t^=i)^r),t=(t^=i)<<1|t>>>31&1;for(var o=0,a=0;o<8;++o){i=r<<28|r>>>4,i^=this.keys[a++];var l=_[63&i];l|=v[i>>>8&63],l|=p[i>>>16&63],l|=d[i>>>24&63],i=r^this.keys[a++],l|=y[63&i],l|=m[i>>>8&63],l|=g[i>>>16&63],i=(t^=l|=f[i>>>24&63])<<28|t>>>4,i^=this.keys[a++],l=_[63&i],l|=v[i>>>8&63],l|=p[i>>>16&63],l|=d[i>>>24&63],i=t^this.keys[a++],l|=y[63&i],l|=m[i>>>8&63],l|=g[i>>>16&63],r^=l|=f[i>>>24&63]}for(r=r<<31|r>>>1,r^=i=2863311530&(t^r),r^=i=16711935&((t=(t^=i)<<31|t>>>1)>>>8^r),r^=i=858993459&((t^=i<<8)>>>2^r),r^=(i=65535&(r>>>16^(t^=i<<2)))<<16,i=[r^=(i=252645135&(r>>>4^(t^=i)))<<4,t^=i],s=0;s<8;s++)n[s]=(i[s>>>2]>>>8*(3-s%4))%256,n[s]<0&&(n[s]+=256);return n}},{key:"encrypt",value:function(e){return this.enc8(e.slice(0,8)).concat(this.enc8(e.slice(8,16)))}}])&&i(t.prototype,r),n&&i(t,n),e}();t.default=b},kSUc:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/index.less ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},lNSK:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/deflate.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.deflateInit=function(e,t){return L(e,t,8,15,8,0)},t.deflateInit2=L,t.deflateReset=T,t.deflateResetKeep=x,t.deflateSetHeader=function(e,t){if(!e||!e.state)return-2;if(2!==e.state.wrap)return-2;return e.state.gzhead=t,0},t.deflate=function(e,t){var r,i,n,o;if(!e||!e.state||t>5||t<0)return e?f(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return f(e,0===e.avail_out?-5:-2);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,_(i,31),_(i,139),_(i,8),i.gzhead?(_(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),_(i,255&i.gzhead.time),_(i,i.gzhead.time>>8&255),_(i,i.gzhead.time>>16&255),_(i,i.gzhead.time>>24&255),_(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),_(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(_(i,255&i.gzhead.extra.length),_(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(_(i,0),_(i,0),_(i,0),_(i,0),_(i,0),_(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),_(i,3),i.status=113);else{var l=8+(i.w_bits-8<<4)<<8,c=-1;c=i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3,l|=c<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=113,y(i,l),0!==i.strstart&&(y(i,e.adler>>>16),y(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),v(e),n=i.pending,i.pending!==i.pending_buf_size));)_(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),v(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,_(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),0===o&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),v(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,_(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),0===o&&(i.status=103)}else i.status=103;103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&v(e),i.pending+2<=i.pending_buf_size&&(_(i,255&e.adler),_(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113);if(0!==i.pending){if(v(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(r)&&4!==t)return f(e,-5);if(666===i.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var u=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(S(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(m(e,!1),0===e.strm.avail_out))return 1}if(e.insert=0,4===t)return m(e,!0),0===e.strm.avail_out?3:4;if(e.last_lit&&(m(e,!1),0===e.strm.avail_out))return 1;return 2}(i,t):3===i.strategy?function(e,t){for(var r,i,n,o,a=e.window;;){if(e.lookahead<=258){if(S(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,(i=a[n])===a[++n]&&i===a[++n]&&i===a[++n])){o=e.strstart+258;do{}while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<o);e.match_length=258-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=s._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(m(e,!1),0===e.strm.avail_out))return 1}if(e.insert=0,4===t)return m(e,!0),0===e.strm.avail_out?3:4;if(e.last_lit&&(m(e,!1),0===e.strm.avail_out))return 1;return 2}(i,t):d[i.level].func(i,t);if(3!==u&&4!==u||(i.status=666),1===u||3===u)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===u&&(1===t?s._tr_align(i):5!==t&&(s._tr_stored_block(i,0,0,!1),3===t&&(g(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),v(e),0===e.avail_out))return i.last_flush=-1,0}if(4!==t)return 0;if(i.wrap<=0)return 1;2===i.wrap?(_(i,255&e.adler),_(i,e.adler>>8&255),_(i,e.adler>>16&255),_(i,e.adler>>24&255),_(i,255&e.total_in),_(i,e.total_in>>8&255),_(i,e.total_in>>16&255),_(i,e.total_in>>24&255)):(y(i,e.adler>>>16),y(i,65535&e.adler));v(e),i.wrap>0&&(i.wrap=-i.wrap);return 0!==i.pending?0:1},t.deflateEnd=function(e){var t;if(!e||!e.state)return-2;if(42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t)return f(e,-2);return e.state=null,113===t?f(e,-3):0},t.deflateSetDictionary=function(e,t){var r,i,s,a,l,c,u,h,d=t.length;if(!e||!e.state)return-2;if(r=e.state,2===(a=r.wrap)||1===a&&42!==r.status||r.lookahead)return-2;1===a&&(e.adler=(0,o.default)(e.adler,t,d,0));r.wrap=0,d>=r.w_size&&(0===a&&(g(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new n.Buf8(r.w_size),n.arraySet(h,t,d-r.w_size,r.w_size,0),t=h,d=r.w_size);l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=d,e.next_in=0,e.input=t,S(r);for(;r.lookahead>=3;){i=r.strstart,s=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+3-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--s);r.strstart=i,r.lookahead=2,S(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=c,e.input=u,e.avail_in=l,r.wrap=a,0},t.deflateInfo=t.Z_DEFLATED=t.Z_UNKNOWN=t.Z_DEFAULT_STRATEGY=t.Z_FIXED=t.Z_RLE=t.Z_HUFFMAN_ONLY=t.Z_FILTERED=t.Z_DEFAULT_COMPRESSION=t.Z_BUF_ERROR=t.Z_DATA_ERROR=t.Z_STREAM_ERROR=t.Z_STREAM_END=t.Z_OK=t.Z_BLOCK=t.Z_FINISH=t.Z_FULL_FLUSH=t.Z_PARTIAL_FLUSH=t.Z_NO_FLUSH=void 0;var n=h(r(/*! ../utils/common.js */"6BzB")),s=h(r(/*! ./trees.js */"c5fP")),o=c(r(/*! ./adler32.js */"xlC8")),a=c(r(/*! ./crc32.js */"QV2g")),l=c(r(/*! ./messages.js */"xSIq"));function c(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}return r.default=e,t&&t.set(e,r),r}t.Z_NO_FLUSH=0;t.Z_PARTIAL_FLUSH=1;t.Z_FULL_FLUSH=3;t.Z_FINISH=4;t.Z_BLOCK=5;t.Z_OK=0;t.Z_STREAM_END=1;t.Z_STREAM_ERROR=-2;t.Z_DATA_ERROR=-3;t.Z_BUF_ERROR=-5;t.Z_DEFAULT_COMPRESSION=-1;t.Z_FILTERED=1;t.Z_HUFFMAN_ONLY=2;t.Z_RLE=3;t.Z_FIXED=4;t.Z_DEFAULT_STRATEGY=0;t.Z_UNKNOWN=2;t.Z_DEFLATED=8;var d;function f(e,t){return e.msg=l.default[t],t}function p(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function v(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function m(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,v(e.strm)}function _(e,t){e.pending_buf[e.pending++]=t}function y(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function b(e,t){var r,i,n=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,c=e.window,u=e.w_mask,h=e.prev,d=e.strstart+258,f=c[s+o-1],p=c[s+o];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(r=t)+o]===p&&c[r+o-1]===f&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&s<d);if(i=258-(d-s),s=d-258,i>o){if(e.match_start=t,o=i,i>=a)break;f=c[s+o-1],p=c[s+o]}}}while((t=h[t&u])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function S(e){var t,r,i,s,l,c,u,h,d,f,p=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-262)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{i=e.head[--t],e.head[t]=i>=p?i-p:0}while(--r);t=r=p;do{i=e.prev[--t],e.prev[t]=i>=p?i-p:0}while(--r);s+=p}if(0===e.strm.avail_in)break;if(c=e.strm,u=e.window,h=e.strstart+e.lookahead,d=s,f=void 0,(f=c.avail_in)>d&&(f=d),r=0===f?0:(c.avail_in-=f,n.arraySet(u,c.input,c.next_in,f,h),1===c.state.wrap?c.adler=(0,o.default)(c.adler,u,f,h):2===c.state.wrap&&(c.adler=(0,a.default)(c.adler,u,f,h)),c.next_in+=f,c.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function w(e,t){for(var r,i;;){if(e.lookahead<262){if(S(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-262&&(e.match_length=b(e,r)),e.match_length>=3)if(i=s._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function C(e,t){for(var r,i,n;;){if(e.lookahead<262){if(S(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=b(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,i=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(m(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((i=s._tr_tally(e,0,e.window[e.strstart-1]))&&m(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function E(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}function k(){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=8,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 n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),g(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 x(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,s._tr_init(t),0):f(e,-2)}function T(e){var t,r=x(e);return 0===r&&((t=e.state).window_size=2*t.w_size,g(t.head),t.max_lazy_match=d[t.level].max_lazy,t.good_match=d[t.level].good_length,t.nice_match=d[t.level].nice_length,t.max_chain_length=d[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function L(e,t,r,i,s,o){if(!e)return-2;var a=1;if(-1===t&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>9||8!==r||i<8||i>15||t<0||t>9||o<0||o>4)return f(e,-2);8===i&&(i=9);var l=new k;return e.state=l,l.strm=e,l.wrap=a,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=s+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new n.Buf8(2*l.w_size),l.head=new n.Buf16(l.hash_size),l.prev=new n.Buf16(l.w_size),l.lit_bufsize=1<<s+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new n.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=r,T(e)}d=[new E(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(S(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,m(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(m(e,!1),e.strm.avail_out),1)})),new E(4,4,8,4,w),new E(4,5,16,8,w),new E(4,6,32,32,w),new E(4,4,16,16,C),new E(8,16,32,32,C),new E(8,16,128,128,C),new E(8,32,128,256,C),new E(32,128,258,1024,C),new E(32,258,258,4096,C)];t.deflateInfo="pako deflate (from Nodeca project)"},lZu9:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/markdown/markdown.js ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){"use strict";e.defineMode("markdown",(function(t,r){var i=e.getMode(t,"text/html"),n="null"==i.name;void 0===r.highlightFormatting&&(r.highlightFormatting=!1),void 0===r.maxBlockquoteDepth&&(r.maxBlockquoteDepth=0),void 0===r.taskLists&&(r.taskLists=!1),void 0===r.strikethrough&&(r.strikethrough=!1),void 0===r.emoji&&(r.emoji=!1),void 0===r.fencedCodeBlockHighlighting&&(r.fencedCodeBlockHighlighting=!0),void 0===r.fencedCodeBlockDefaultMode&&(r.fencedCodeBlockDefaultMode="text/plain"),void 0===r.xml&&(r.xml=!0),void 0===r.tokenTypeOverrides&&(r.tokenTypeOverrides={});var s={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 o in s)s.hasOwnProperty(o)&&r.tokenTypeOverrides[o]&&(s[o]=r.tokenTypeOverrides[o]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,u=r.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/;function v(e,t,r){return t.f=t.inline=r,r(e,t)}function m(e,t,r){return t.f=t.block=r,r(e,t)}function _(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==b){var r=n;if(!r){var s=e.innerMode(i,t.htmlState);r="xml"==s.mode.name&&null===s.state.tagStart&&!s.state.context&&s.state.tokenize.isInText}r&&(t.f=E,t.block=y,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function y(i,n){var o,d=i.column()===n.indentation,g=!(o=n.prevLine.stream)||!/\S/.test(o.string),m=n.indentedCode,_=n.prevLine.hr,y=!1!==n.list,b=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var C=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,y)){for(n.list=null;C<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=C-n.listStack[n.listStack.length-1])}var E=!(g||_||n.prevLine.header||y&&m||n.prevLine.fencedCodeEnd),k=(!1===n.list||_||g)&&n.indentation<=b&&i.match(a),x=null;if(n.indentationDiff>=4&&(m||n.prevLine.fencedCodeEnd||n.prevLine.header||g))return i.skipToEnd(),n.indentedCode=!0,s.code;if(i.eatSpace())return null;if(d&&n.indentation<=b&&(x=i.match(u))&&x[1].length<=6)return n.quote=0,n.header=x[1].length,n.thisLine.header=!0,r.highlightFormatting&&(n.formatting="header"),n.f=n.inline,w(n);if(n.indentation<=b&&i.eat(">"))return n.quote=d?1:n.quote+1,r.highlightFormatting&&(n.formatting="quote"),i.eatSpace(),w(n);if(!k&&!n.setext&&d&&n.indentation<=b&&(x=i.match(l))){var T=x[1]?"ol":"ul";return n.indentation=C+i.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,r.taskLists&&i.match(c,!1)&&(n.taskList=!0),n.f=n.inline,r.highlightFormatting&&(n.formatting=["list","list-"+T]),w(n)}return d&&n.indentation<=b&&(x=i.match(f,!0))?(n.quote=0,n.fencedEndRE=new RegExp(x[1]+"+ *$"),n.localMode=r.fencedCodeBlockHighlighting&&function(r){if(e.findModeByName){var i=e.findModeByName(r);i&&(r=i.mime||i.mimes[0])}var n=e.getMode(t,r);return"null"==n.name?null:n}(x[2]||r.fencedCodeBlockDefaultMode),n.localMode&&(n.localState=e.startState(n.localMode)),n.f=n.block=S,r.highlightFormatting&&(n.formatting="code-block"),n.code=-1,w(n)):n.setext||!(E&&y||n.quote||!1!==n.list||n.code||k||p.test(i.string))&&(x=i.lookAhead(1))&&(x=x.match(h))?(n.setext?(n.header=n.setext,n.setext=0,i.skipToEnd(),r.highlightFormatting&&(n.formatting="header")):(n.header="="==x[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,w(n)):k?(i.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,s.hr):"["===i.peek()?v(i,n,L):v(i,n,n.inline)}function b(t,r){var s=i.token(t,r.htmlState);if(!n){var o=e.innerMode(i,r.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||r.md_inside&&t.current().indexOf(">")>-1)&&(r.f=E,r.block=y,r.htmlState=null)}return s}function S(e,t){var i,n=t.listStack[t.listStack.length-1]||0,o=t.indentation<n,a=n+3;return t.fencedEndRE&&t.indentation<=a&&(o||e.match(t.fencedEndRE))?(r.highlightFormatting&&(t.formatting="code-block"),o||(i=w(t)),t.localMode=t.localState=null,t.block=y,t.f=E,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?m(e,t,t.block):i):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),s.code)}function w(e){var t=[];if(e.formatting){t.push(s.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)t.push(s.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&t.push(s.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(s.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(s.linkHref,"url"):(e.strong&&t.push(s.strong),e.em&&t.push(s.em),e.strikethrough&&t.push(s.strikethrough),e.emoji&&t.push(s.emoji),e.linkText&&t.push(s.linkText),e.code&&t.push(s.code),e.image&&t.push(s.image),e.imageAltText&&t.push(s.imageAltText,"link"),e.imageMarker&&t.push(s.imageMarker)),e.header&&t.push(s.header,s.header+"-"+e.header),e.quote&&(t.push(s.quote),!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(s.quote+"-"+e.quote):t.push(s.quote+"-"+r.maxBlockquoteDepth)),!1!==e.list){var n=(e.listStack.length-1)%3;n?1===n?t.push(s.list2):t.push(s.list3):t.push(s.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function C(e,t){if(e.match(d,!0))return w(t)}function E(t,n){var o=n.text(t,n);if(void 0!==o)return o;if(n.list)return n.list=null,w(n);if(n.taskList)return" "===t.match(c,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,r.highlightFormatting&&(n.formatting="task"),n.taskList=!1,w(n);if(n.taskOpen=!1,n.taskClosed=!1,n.header&&t.match(/^#+$/,!0))return r.highlightFormatting&&(n.formatting="header"),w(n);var a=t.next();if(n.linkTitle){n.linkTitle=!1;var l=a;"("===a&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(u),!0))return s.linkHref}if("`"===a){var h=n.formatting;r.highlightFormatting&&(n.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=n.code||n.quote&&1!=d){if(d==n.code){var f=w(n);return n.code=0,f}return n.formatting=h,w(n)}return n.code=d,w(n)}if(n.code)return w(n);if("\\"===a&&(t.next(),r.highlightFormatting)){var p=w(n),v=s.formatting+"-escape";return p?p+" "+v:v}if("!"===a&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.imageMarker=!0,n.image=!0,r.highlightFormatting&&(n.formatting="image"),w(n);if("["===a&&n.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return n.imageMarker=!1,n.imageAltText=!0,r.highlightFormatting&&(n.formatting="image"),w(n);if("]"===a&&n.imageAltText){r.highlightFormatting&&(n.formatting="image");var p=w(n);return n.imageAltText=!1,n.image=!1,n.inline=n.f=x,p}if("["===a&&!n.image)return n.linkText&&t.match(/^.*?\]/)||(n.linkText=!0,r.highlightFormatting&&(n.formatting="link")),w(n);if("]"===a&&n.linkText){r.highlightFormatting&&(n.formatting="link");var p=w(n);return n.linkText=!1,n.inline=n.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?x:E,p}if("<"===a&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=k,r.highlightFormatting&&(n.formatting="link"),(p=w(n))?p+=" ":p="",p+s.linkInline;if("<"===a&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=k,r.highlightFormatting&&(n.formatting="link"),(p=w(n))?p+=" ":p="",p+s.linkEmail;if(r.xml&&"<"===a&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=t.string.indexOf(">",t.pos);if(-1!=_){var y=t.string.substring(t.start,_);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(n.md_inside=!0)}return t.backUp(1),n.htmlState=e.startState(i),m(t,n,b)}if(r.xml&&"<"===a&&t.match(/^\/\w*?>/))return n.md_inside=!1,"tag";if("*"===a||"_"===a){for(var S=1,C=1==t.pos?" ":t.string.charAt(t.pos-2);S<3&&t.eat(a);)S++;var T=t.peek()||" ",L=!/\s/.test(T)&&(!g.test(T)||/\s/.test(C)||g.test(C)),A=!/\s/.test(C)&&(!g.test(C)||/\s/.test(T)||g.test(T)),D=null,O=null;if(S%2&&(n.em||!L||"*"!==a&&A&&!g.test(C)?n.em!=a||!A||"*"!==a&&L&&!g.test(T)||(D=!1):D=!0),S>1&&(n.strong||!L||"*"!==a&&A&&!g.test(C)?n.strong!=a||!A||"*"!==a&&L&&!g.test(T)||(O=!1):O=!0),null!=O||null!=D)return r.highlightFormatting&&(n.formatting=null==D?"strong":null==O?"em":"strong em"),!0===D&&(n.em=a),!0===O&&(n.strong=a),f=w(n),!1===D&&(n.em=!1),!1===O&&(n.strong=!1),f}else if(" "===a&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return w(n);t.backUp(1)}if(r.strikethrough)if("~"===a&&t.eatWhile(a)){if(n.strikethrough)return r.highlightFormatting&&(n.formatting="strikethrough"),f=w(n),n.strikethrough=!1,f;if(t.match(/^[^\s]/,!1))return n.strikethrough=!0,r.highlightFormatting&&(n.formatting="strikethrough"),w(n)}else if(" "===a&&t.match(/^~~/,!0)){if(" "===t.peek())return w(n);t.backUp(2)}if(r.emoji&&":"===a&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){n.emoji=!0,r.highlightFormatting&&(n.formatting="emoji");var R=w(n);return n.emoji=!1,R}return" "===a&&(t.match(/^ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),w(n)}function k(e,t){if(">"===e.next()){t.f=t.inline=E,r.highlightFormatting&&(t.formatting="link");var i=w(t);return i?i+=" ":i="",i+s.linkInline}return e.match(/^[^>]+/,!0),s.linkInline}function x(e,t){if(e.eatSpace())return null;var i,n=e.next();return"("===n||"["===n?(t.f=t.inline=(i="("===n?")":"]",function(e,t){if(e.next()===i){t.f=t.inline=E,r.highlightFormatting&&(t.formatting="link-string");var n=w(t);return t.linkHref=!1,n}return e.match(T[i]),t.linkHref=!0,w(t)}),r.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,w(t)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function L(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=A,e.next(),r.highlightFormatting&&(t.formatting="link"),t.linkText=!0,w(t)):v(e,t,E)}function A(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=D,r.highlightFormatting&&(t.formatting="link");var i=w(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),s.linkText}function D(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=E,s.linkHref+" url")}var O={startState:function(){return{f:y,prevLine:{stream:null},thisLine:{stream:null},block:y,htmlState:null,indentation:0,inline:E,text:C,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return _(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=b)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==b?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:O}},indent:function(t,r,n){return t.block==b&&i.indent?i.indent(t.htmlState,r,n):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,r,n):e.Pass},blankLine:_,getType:w,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return O}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(r(/*! ../../lib/codemirror */"VrN/"),r(/*! ../xml/xml */"1eCo"),r(/*! ../meta */"8EBN"))},mHUz:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/keysym.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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}},mTgk:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/domkeytable.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=(i=r(/*! ./keysym.js */"mHUz"))&&i.__esModule?i:{default:i};var s={};function o(e,t){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(e in s)throw new Error('Duplicate entry for key "'+e+'"');s[e]=[t,t,t,t]}function a(e,t,r){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===r)throw new Error('Undefined keysym for key "'+e+'"');if(e in s)throw new Error('Duplicate entry for key "'+e+'"');s[e]=[t,t,r,t]}function l(e,t,r){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===r)throw new Error('Undefined keysym for key "'+e+'"');if(e in s)throw new Error('Duplicate entry for key "'+e+'"');s[e]=[t,t,t,r]}a("Alt",n.default.XK_Alt_L,n.default.XK_Alt_R),o("AltGraph",n.default.XK_ISO_Level3_Shift),o("CapsLock",n.default.XK_Caps_Lock),a("Control",n.default.XK_Control_L,n.default.XK_Control_R),a("Meta",n.default.XK_Super_L,n.default.XK_Super_R),o("NumLock",n.default.XK_Num_Lock),o("ScrollLock",n.default.XK_Scroll_Lock),a("Shift",n.default.XK_Shift_L,n.default.XK_Shift_R),l("Enter",n.default.XK_Return,n.default.XK_KP_Enter),o("Tab",n.default.XK_Tab),l(" ",n.default.XK_space,n.default.XK_KP_Space),l("ArrowDown",n.default.XK_Down,n.default.XK_KP_Down),l("ArrowUp",n.default.XK_Up,n.default.XK_KP_Up),l("ArrowLeft",n.default.XK_Left,n.default.XK_KP_Left),l("ArrowRight",n.default.XK_Right,n.default.XK_KP_Right),l("End",n.default.XK_End,n.default.XK_KP_End),l("Home",n.default.XK_Home,n.default.XK_KP_Home),l("PageDown",n.default.XK_Next,n.default.XK_KP_Next),l("PageUp",n.default.XK_Prior,n.default.XK_KP_Prior),o("Backspace",n.default.XK_BackSpace),l("Clear",n.default.XK_Clear,n.default.XK_KP_Begin),o("Copy",n.default.XF86XK_Copy),o("Cut",n.default.XF86XK_Cut),l("Delete",n.default.XK_Delete,n.default.XK_KP_Delete),l("Insert",n.default.XK_Insert,n.default.XK_KP_Insert),o("Paste",n.default.XF86XK_Paste),o("Redo",n.default.XK_Redo),o("Undo",n.default.XK_Undo),o("Cancel",n.default.XK_Cancel),o("ContextMenu",n.default.XK_Menu),o("Escape",n.default.XK_Escape),o("Execute",n.default.XK_Execute),o("Find",n.default.XK_Find),o("Help",n.default.XK_Help),o("Pause",n.default.XK_Pause),o("Select",n.default.XK_Select),o("ZoomIn",n.default.XF86XK_ZoomIn),o("ZoomOut",n.default.XF86XK_ZoomOut),o("BrightnessDown",n.default.XF86XK_MonBrightnessDown),o("BrightnessUp",n.default.XF86XK_MonBrightnessUp),o("Eject",n.default.XF86XK_Eject),o("LogOff",n.default.XF86XK_LogOff),o("Power",n.default.XF86XK_PowerOff),o("PowerOff",n.default.XF86XK_PowerDown),o("PrintScreen",n.default.XK_Print),o("Hibernate",n.default.XF86XK_Hibernate),o("Standby",n.default.XF86XK_Standby),o("WakeUp",n.default.XF86XK_WakeUp),o("AllCandidates",n.default.XK_MultipleCandidate),o("Alphanumeric",n.default.XK_Eisu_Shift),o("CodeInput",n.default.XK_Codeinput),o("Compose",n.default.XK_Multi_key),o("Convert",n.default.XK_Henkan),o("GroupFirst",n.default.XK_ISO_First_Group),o("GroupLast",n.default.XK_ISO_Last_Group),o("GroupNext",n.default.XK_ISO_Next_Group),o("GroupPrevious",n.default.XK_ISO_Prev_Group),o("NonConvert",n.default.XK_Muhenkan),o("PreviousCandidate",n.default.XK_PreviousCandidate),o("SingleCandidate",n.default.XK_SingleCandidate),o("HangulMode",n.default.XK_Hangul),o("HanjaMode",n.default.XK_Hangul_Hanja),o("JunjuaMode",n.default.XK_Hangul_Jeonja),o("Eisu",n.default.XK_Eisu_toggle),o("Hankaku",n.default.XK_Hankaku),o("Hiragana",n.default.XK_Hiragana),o("HiraganaKatakana",n.default.XK_Hiragana_Katakana),o("KanaMode",n.default.XK_Kana_Shift),o("KanjiMode",n.default.XK_Kanji),o("Katakana",n.default.XK_Katakana),o("Romaji",n.default.XK_Romaji),o("Zenkaku",n.default.XK_Zenkaku),o("ZenkakuHanaku",n.default.XK_Zenkaku_Hankaku),o("F1",n.default.XK_F1),o("F2",n.default.XK_F2),o("F3",n.default.XK_F3),o("F4",n.default.XK_F4),o("F5",n.default.XK_F5),o("F6",n.default.XK_F6),o("F7",n.default.XK_F7),o("F8",n.default.XK_F8),o("F9",n.default.XK_F9),o("F10",n.default.XK_F10),o("F11",n.default.XK_F11),o("F12",n.default.XK_F12),o("F13",n.default.XK_F13),o("F14",n.default.XK_F14),o("F15",n.default.XK_F15),o("F16",n.default.XK_F16),o("F17",n.default.XK_F17),o("F18",n.default.XK_F18),o("F19",n.default.XK_F19),o("F20",n.default.XK_F20),o("F21",n.default.XK_F21),o("F22",n.default.XK_F22),o("F23",n.default.XK_F23),o("F24",n.default.XK_F24),o("F25",n.default.XK_F25),o("F26",n.default.XK_F26),o("F27",n.default.XK_F27),o("F28",n.default.XK_F28),o("F29",n.default.XK_F29),o("F30",n.default.XK_F30),o("F31",n.default.XK_F31),o("F32",n.default.XK_F32),o("F33",n.default.XK_F33),o("F34",n.default.XK_F34),o("F35",n.default.XK_F35),o("Close",n.default.XF86XK_Close),o("MailForward",n.default.XF86XK_MailForward),o("MailReply",n.default.XF86XK_Reply),o("MailSend",n.default.XF86XK_Send),o("MediaFastForward",n.default.XF86XK_AudioForward),o("MediaPause",n.default.XF86XK_AudioPause),o("MediaPlay",n.default.XF86XK_AudioPlay),o("MediaRecord",n.default.XF86XK_AudioRecord),o("MediaRewind",n.default.XF86XK_AudioRewind),o("MediaStop",n.default.XF86XK_AudioStop),o("MediaTrackNext",n.default.XF86XK_AudioNext),o("MediaTrackPrevious",n.default.XF86XK_AudioPrev),o("New",n.default.XF86XK_New),o("Open",n.default.XF86XK_Open),o("Print",n.default.XK_Print),o("Save",n.default.XF86XK_Save),o("SpellCheck",n.default.XF86XK_Spell),o("AudioVolumeDown",n.default.XF86XK_AudioLowerVolume),o("AudioVolumeUp",n.default.XF86XK_AudioRaiseVolume),o("AudioVolumeMute",n.default.XF86XK_AudioMute),o("MicrophoneVolumeMute",n.default.XF86XK_AudioMicMute),o("LaunchApplication1",n.default.XF86XK_MyComputer),o("LaunchApplication2",n.default.XF86XK_Calculator),o("LaunchCalendar",n.default.XF86XK_Calendar),o("LaunchMail",n.default.XF86XK_Mail),o("LaunchMediaPlayer",n.default.XF86XK_AudioMedia),o("LaunchMusicPlayer",n.default.XF86XK_Music),o("LaunchPhone",n.default.XF86XK_Phone),o("LaunchScreenSaver",n.default.XF86XK_ScreenSaver),o("LaunchSpreadsheet",n.default.XF86XK_Excel),o("LaunchWebBrowser",n.default.XF86XK_WWW),o("LaunchWebCam",n.default.XF86XK_WebCam),o("LaunchWordProcessor",n.default.XF86XK_Word),o("BrowserBack",n.default.XF86XK_Back),o("BrowserFavorites",n.default.XF86XK_Favorites),o("BrowserForward",n.default.XF86XK_Forward),o("BrowserHome",n.default.XF86XK_HomePage),o("BrowserRefresh",n.default.XF86XK_Refresh),o("BrowserSearch",n.default.XF86XK_Search),o("BrowserStop",n.default.XF86XK_Stop),o("Dimmer",n.default.XF86XK_BrightnessAdjust),o("MediaAudioTrack",n.default.XF86XK_AudioCycleTrack),o("RandomToggle",n.default.XF86XK_AudioRandomPlay),o("SplitScreenToggle",n.default.XF86XK_SplitScreen),o("Subtitle",n.default.XF86XK_Subtitle),o("VideoModeNext",n.default.XF86XK_Next_VMode),l("=",n.default.XK_equal,n.default.XK_KP_Equal),l("+",n.default.XK_plus,n.default.XK_KP_Add),l("-",n.default.XK_minus,n.default.XK_KP_Subtract),l("*",n.default.XK_asterisk,n.default.XK_KP_Multiply),l("/",n.default.XK_slash,n.default.XK_KP_Divide),l(".",n.default.XK_period,n.default.XK_KP_Decimal),l(",",n.default.XK_comma,n.default.XK_KP_Separator),l("0",n.default.XK_0,n.default.XK_KP_0),l("1",n.default.XK_1,n.default.XK_KP_1),l("2",n.default.XK_2,n.default.XK_KP_2),l("3",n.default.XK_3,n.default.XK_KP_3),l("4",n.default.XK_4,n.default.XK_KP_4),l("5",n.default.XK_5,n.default.XK_KP_5),l("6",n.default.XK_6,n.default.XK_KP_6),l("7",n.default.XK_7,n.default.XK_KP_7),l("8",n.default.XK_8,n.default.XK_KP_8),l("9",n.default.XK_9,n.default.XK_KP_9);var c=s;t.default=c},mdZa:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/polyfill.js ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},writable:!0,configurable:!0}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r}e.prototype=window.Event.prototype,"function"!=typeof window.CustomEvent&&(window.CustomEvent=e)}(),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},osHv:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/fold/xml-fold.js ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){"use strict";var t=e.Pos;function r(e,t){return e.line-t.line||e.ch-t.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function s(e,t,r,i){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function o(e,r){var i=e.cm.getTokenTypeAt(t(e.line,r));return i&&/\btag\b/.test(i)}function a(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(a(e))continue;return}if(o(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(o(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function h(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(a(e))continue;return}if(o(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(o(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}function f(e,r){for(var i=[];;){var n,s=h(e),o=e.line,a=e.ch-(s?s[0].length:0);if(!s||!(n=c(e)))return;if("selfClose"!=n)if(s[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==s[2]){i.length=l;break}if(l<0&&(!r||r==s[2]))return{tag:s[2],from:t(o,a),to:t(e.line,e.ch)}}else i.push(s[2])}}function p(e,r){for(var i=[];;){var n=d(e);if(!n)return;if("selfClose"!=n){var s=e.line,o=e.ch,a=u(e);if(!a)return;if(a[1])i.push(a[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==a[2]){i.length=l;break}if(l<0&&(!r||r==a[2]))return{tag:a[2],from:t(e.line,e.ch),to:t(s,o)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,i){for(var n=new s(e,i.line,0);;){var o=h(n);if(!o||n.line!=i.line)return;var a=c(n);if(!a)return;if(!o[1]&&"selfClose"!=a){var l=t(n.line,n.ch),u=f(n,o[2]);return u&&r(u.from,l)>0?{from:l,to:u.from}:null}}})),e.findMatchingTag=function(e,i,n){var o=new s(e,i.line,i.ch,n);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var a=c(o),l=a&&t(o.line,o.ch),h=a&&u(o);if(a&&h&&!(r(o,i)>0)){var d={from:t(o.line,o.ch),to:l,tag:h[2]};return"selfClose"==a?{open:d,close:null,at:"open"}:h[1]?{open:p(o,h[2]),close:d,at:"close"}:{open:d,close:f(o=new s(e,l.line,l.ch,n),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,i){for(var n=new s(e,t.line,t.ch,r);;){var o=p(n,i);if(!o)break;var a=f(new s(e,t.line,t.ch,r),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,r,i){return f(new s(e,t.line,t.ch,i?{from:0,to:i}:null),r)}}(r(/*! ../../lib/codemirror */"VrN/"))},p5ED:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.tsx ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";r(/*! antd/es/button/style */"+L6B");var i=r(/*! antd/es/button */"2/Rp"),n=(r(/*! antd/es/tooltip/style */"5Dmo"),r(/*! antd/es/tooltip */"3S7+")),s=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),o=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),a=r(/*! react */"q1tI"),l=r.n(a),c=r(/*! ./index.less?modules */"vHTk"),u=r.n(c),h=r(/*! @ant-design/icons */"yEEn"),d=r(/*! @/components/monaco-editor */"ZW9T"),f=r(/*! @/utils/util */"1vsH");t.a=function(e){var t=e.name,r=e.data,c=(e.theme,e.type),p=e.filename,g=e.monacoEditor,v=e.className,m=e.style,_=e.close,y=e.onClose,b=e.hasMask,S=Object(a.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),w=Object(o.a)(S,2),C=(w[0],w[1],Object(a.useState)("")),E=Object(o.a)(C,2),k=(E[0],E[1]),x=Object(a.useRef)();p&&(g.filename=p),Object(a.useEffect)((function(){var e,t,r=null===(e=document.cookie)||void 0===e||null===(t=e.replace(/\s/g,""))||void 0===t?void 0:t.split(";");null==r||r.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&k(t[1])}))}),[]);var T=function(){r.startsWith("http")||r.startsWith("/")?L():Object(f.x)(p||"educoder",r,p)},L=function(){Object(f.v)(p||t,r)};return l.a.createElement("div",{style:Object(s.a)({},m||{}),className:"".concat(b&&u.a.bgBlack," ").concat(c?u.a.wrp:"hide")},_&&l.a.createElement("div",{className:u.a.close,ref:x},l.a.createElement(n.a,{title:"点击下载此文件",getPopupContainer:function(){return x.current}},l.a.createElement("span",{onClick:L},l.a.createElement("i",{className:"icon-quxiaozhiding"}))),l.a.createElement(n.a,{title:"关闭",getPopupContainer:function(){return x.current}},l.a.createElement("span",{className:"",onClick:y},l.a.createElement("i",{className:"icon-guanbi1"})))),l.a.createElement("div",{className:"".concat(u.a[v]," ").concat(v," ").concat(u.a.monaco," ").concat("txt"===c?"show":"hide")},"txt"===c&&l.a.createElement(d.b,g)),"audio"===c&&l.a.createElement("audio",{src:"".concat(null!=r&&r.startsWith("/")||(null==r?void 0:r.indexOf("https://"))>-1?r:"data:audio/mp3;base64,").concat(r),autoPlay:!0}),"video"===c&&l.a.createElement(l.a.Fragment,null,null!=r&&r.startsWith("/")?l.a.createElement("video",{controls:!0,src:"".concat(r),autoPlay:!0}):l.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(r),autoPlay:!0})),"pdf"===c&&l.a.createElement("embed",{className:u.a.embed,src:r}),"image"===c&&l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:"".concat(null!=r&&r.startsWith("/")||(null==r?void 0:r.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(r)})),"other"===c&&l.a.createElement("div",null,l.a.createElement(i.a,{type:"primary",size:"large",onClick:T},l.a.createElement(h.a,null),"点击下载")),("download"===c||"office"===c)&&l.a.createElement(i.a,{type:"primary",size:"large",onClick:T},l.a.createElement(h.a,null),"点击下载"))}},"p77/":
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./node_modules/codemirror/lib/codemirror.css ***!
|
|
|
\****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},q7KB:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/xterm/css/xterm.css ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},"rAM+":
|
|
|
/*!*******************************************************************************************************************!*\
|
|
|
!*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***!
|
|
|
\*******************************************************************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var i=r(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function n(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=Object(i.a)(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,s=function(){};return{s:s,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}},rUJ1:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/marked/src/helpers.js ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: escape */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){const r=/[&<>"']/,i=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const f={},p=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function m(e,t){f[" "+e]||(p.test(e)?f[" "+e]=e+"/":f[" "+e]=_(e,"/",!0));const r=-1===(e=f[" "+e]).indexOf(":");return"//"===t.substring(0,2)?r?t:e.replace(g,"$1")+t:"/"===t.charAt(0)?r?t:e.replace(v,"$1")+t:e+t}function _(e,t,r){const i=e.length;if(0===i)return"";let n=0;for(;n<i;){const s=e.charAt(i-n-1);if(s!==t||r){if(s===t||!r)break;n++}else n++}return e.substr(0,i-n)}e.exports={escape:function(e,t){if(t){if(r.test(e))return e.replace(i,a)}else if(n.test(e))return e.replace(s,a);return e},unescape:c,edit:function(e,t){e=e.source||e,t=t||"";const r={replace:(t,i)=>(i=(i=i.source||i).replace(u,"$1"),e=e.replace(t,i),r),getRegex:()=>new RegExp(e,t)};return r},cleanUrl:function(e,t,r){if(e){let e;try{e=decodeURIComponent(c(r)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!d.test(r)&&(r=m(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch(e){return null}return r},resolveUrl:m,noopTest:{exec:function(){}},merge:function(e){let t,r,i=1;for(;i<arguments.length;i++)for(r in t=arguments[i],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},splitCells:function(e,t){const r=e.replace(/\|/g,(e,t,r)=>{let i=!1,n=t;for(;--n>=0&&"\\"===r[n];)i=!i;return i?"|":" |"}).split(/ \|/);let i=0;if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r},rtrim:_,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const r=e.length;let i=0,n=0;for(;n<r;n++)if("\\"===e[n])n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.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")}}},rwxt:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/cursor.js ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(/*! ./browser.js */"GdRQ");function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=!i.supportsCursorURIs||i.isTouchDevice,o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=null,this._canvas=document.createElement("canvas"),s&&(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)}}var t,r,i;return t=e,(r=[{key:"attach",value:function(e){if(this._target&&this.detach(),this._target=e,s){document.body.appendChild(this._canvas);var t={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,t),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,t),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,t),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,t)}this.clear()}},{key:"detach",value:function(){if(this._target){if(s){var e={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,e),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,e),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,e),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,e),document.body.removeChild(this._canvas)}this._target=null}}},{key:"change",value:function(e,t,r,i,n){if(0!==i&&0!==n){this._position.x=this._position.x+this._hotSpot.x-t,this._position.y=this._position.y+this._hotSpot.y-r,this._hotSpot.x=t,this._hotSpot.y=r;var o,a=this._canvas.getContext("2d");this._canvas.width=i,this._canvas.height=n;try{o=new ImageData(new Uint8ClampedArray(e),i,n)}catch(t){(o=a.createImageData(i,n)).data.set(new Uint8ClampedArray(e))}if(a.clearRect(0,0,i,n),a.putImageData(o,0,0),s)this._updatePosition();else{var l=this._canvas.toDataURL();this._target.style.cursor="url("+l+")"+t+" "+r+", default"}}else this.clear()}},{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(e,t){if(s){window.visualViewport?(this._position.x=e+window.visualViewport.offsetLeft,this._position.y=t+window.visualViewport.offsetTop):(this._position.x=e,this._position.y=t),this._updatePosition();var r=document.elementFromPoint(e,t);this._updateVisibility(r)}}},{key:"_handleMouseOver",value:function(e){this._handleMouseMove(e)}},{key:"_handleMouseLeave",value:function(e){this._updateVisibility(e.relatedTarget)}},{key:"_handleMouseMove",value:function(e){this._updateVisibility(e.target),this._position.x=e.clientX-this._hotSpot.x,this._position.y=e.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(e){var t=this,r=document.elementFromPoint(e.clientX,e.clientY);this._updateVisibility(r),this._captureIsActive()&&window.setTimeout((function(){t._target&&(r=document.elementFromPoint(e.clientX,e.clientY),t._updateVisibility(r))}),0)}},{key:"_showCursor",value:function(){"hidden"===this._canvas.style.visibility&&(this._canvas.style.visibility="")}},{key:"_hideCursor",value:function(){"hidden"!==this._canvas.style.visibility&&(this._canvas.style.visibility="hidden")}},{key:"_shouldShowCursor",value:function(e){return!!e&&(e===this._target||!!this._target.contains(e)&&"none"===window.getComputedStyle(e).cursor)}},{key:"_updateVisibility",value:function(e){this._captureIsActive()&&(e=document.captureElement),this._shouldShowCursor(e)?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)}}])&&n(t.prototype,r),i&&n(t,i),e}();t.default=o},sjKO:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inffast.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,i,n,s,o,a,l,c,u,h,d,f,p,g,v,m,_,y,b,S,w,C,E,k,x;r=e.state,i=e.next_in,k=e.input,n=i+(e.avail_in-5),s=e.next_out,x=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),l=r.dmax,c=r.wsize,u=r.whave,h=r.wnext,d=r.window,f=r.hold,p=r.bits,g=r.lencode,v=r.distcode,m=(1<<r.lenbits)-1,_=(1<<r.distbits)-1;e:do{p<15&&(f+=k[i++]<<p,p+=8,f+=k[i++]<<p,p+=8),y=g[f&m];t:for(;;){if(f>>>=b=y>>>24,p-=b,0===(b=y>>>16&255))x[s++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=g[(65535&y)+(f&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&y,(b&=15)&&(p<b&&(f+=k[i++]<<p,p+=8),S+=f&(1<<b)-1,f>>>=b,p-=b),p<15&&(f+=k[i++]<<p,p+=8,f+=k[i++]<<p,p+=8),y=v[f&_];r:for(;;){if(f>>>=b=y>>>24,p-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=v[(65535&y)+(f&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(w=65535&y,p<(b&=15)&&(f+=k[i++]<<p,(p+=8)<b&&(f+=k[i++]<<p,p+=8)),(w+=f&(1<<b)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(f>>>=b,p-=b,w>(b=s-o)){if((b=w-b)>u&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(C=0,E=d,0===h){if(C+=c-b,b<S){S-=b;do{x[s++]=d[C++]}while(--b);C=s-w,E=x}}else if(h<b){if(C+=c+h-b,(b-=h)<S){S-=b;do{x[s++]=d[C++]}while(--b);if(C=0,h<S){S-=b=h;do{x[s++]=d[C++]}while(--b);C=s-w,E=x}}}else if(C+=h-b,b<S){S-=b;do{x[s++]=d[C++]}while(--b);C=s-w,E=x}for(;S>2;)x[s++]=E[C++],x[s++]=E[C++],x[s++]=E[C++],S-=3;S&&(x[s++]=E[C++],S>1&&(x[s++]=E[C++]))}else{C=s-w;do{x[s++]=x[C++],x[s++]=x[C++],x[s++]=x[C++],S-=3}while(S>2);S&&(x[s++]=x[C++],S>1&&(x[s++]=x[C++]))}break}}break}}while(i<n&&s<a);return i-=S=p>>3,f&=(1<<(p-=S<<3))-1,e.next_in=i,e.next_out=s,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=s<a?a-s+257:257-(s-a),r.hold=f,void(r.bits=p)}},ulZh:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/hls.js/dist/hls.js ***!
|
|
|
\*****************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){var i;"undefined"!=typeof window&&(i=function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/eventemitter3/index.js ***!
|
|
|
\*********************************************/
|
|
|
/*! no static exports found */function(e,t,r){"use strict";var i=Object.prototype.hasOwnProperty,n="~";function s(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function c(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)i.call(e,t)&&r.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i<s;i++)o[i]=r[i].fn;return o},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,i,s,o){var a=n?n+e:e;if(!this._events[a])return!1;var l,c,u=this._events[a],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,i),!0;case 5:return u.fn.call(u.context,t,r,i,s),!0;case 6:return u.fn.call(u.context,t,r,i,s,o),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,i);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},c.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},c.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},c.prototype.removeListener=function(e,t,r,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return l(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||i&&!o.once||r&&o.context!==r||l(this,s);else{for(var a=0,c=[],u=o.length;a<u;a++)(o[a].fn!==t||i&&!o[a].once||r&&o[a].context!==r)&&c.push(o[a]);c.length?this._events[s]=1===c.length?c[0]:c:l(this,s)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&l(this,t)):(this._events=new s,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c},"./node_modules/url-toolkit/src/url-toolkit.js":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/url-toolkit/src/url-toolkit.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! no static exports found */function(e,t,r){var i,n,s,o,a;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=a.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=a.normalizePath(i.path),a.buildURLFromParts(i)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return r.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=n.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(c.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var u=o.path,h=u.substring(0,u.lastIndexOf("/")+1)+s.path;c.path=a.normalizePath(h)}else c.path=o.path,s.params||(c.params=o.params,s.query||(c.query=o.query));return null===c.path&&(c.path=r.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(c)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(s,"");e.length!==(e=e.replace(o,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a},"./node_modules/webworkify-webpack/index.js":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/webworkify-webpack/index.js ***!
|
|
|
\**************************************************/
|
|
|
/*! no static exports found */function(e,t,r){function i(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var i=r(r.s=ENTRY_MODULE);return i.default||i}function n(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,i){var s={};s[i]=[];var o=t.toString(),a=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return s;for(var l,c=a[1],u=new RegExp("(\\\\n|\\W)"+n(c)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=u.exec(o);)"dll-reference"!==l[3]&&s[i].push(l[3]);for(u=new RegExp("\\("+n(c)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=u.exec(o);)e[l[2]]||(s[i].push(l[1]),e[l[2]]=r(l[1]).m),s[l[2]]=s[l[2]]||[],s[l[2]].push(l[4]);for(var h,d=Object.keys(s),f=0;f<d.length;f++)for(var p=0;p<s[d[f]].length;p++)h=s[d[f]][p],isNaN(1*h)||(s[d[f]][p]=1*s[d[f]][p]);return s}function o(e){return Object.keys(e).reduce((function(t,r){return t||e[r].length>0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},a=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},i={main:[]},n={main:{}};o(r);)for(var a=Object.keys(r),l=0;l<a.length;l++){var c=a[l],u=r[c].pop();if(n[c]=n[c]||{},!n[c][u]&&e[c][u]){n[c][u]=!0,i[c]=i[c]||[],i[c].push(u);for(var h=s(e,e[c][u],c),d=Object.keys(h),f=0;f<d.length;f++)r[d[f]]=r[d[f]]||[],r[d[f]]=r[d[f]].concat(h[d[f]])}}return i}(n,e),l="";Object.keys(a).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;a[e][t];)t++;a[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+e+" = ("+i.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a[e].map((function(t){return JSON.stringify(t)+": "+n[e][t].toString()})).join(",")+"});\n"})),l=l+"new (("+i.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+a.main.map((function(e){return JSON.stringify(e)+": "+n.main[e].toString()})).join(",")+"}))(self);";var c=new window.Blob([l],{type:"text/javascript"});if(t.bare)return c;var u=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(c),h=new window.Worker(u);return h.objectURL=u,h}},"./src/config.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/config.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: hlsDefaultConfig, mergeConfig, enableStreamingMode */function(e,t,r){"use strict";r.r(t),r.d(t,"hlsDefaultConfig",(function(){return C})),r.d(t,"mergeConfig",(function(){return E})),r.d(t,"enableStreamingMode",(function(){return k}));var i=r(/*! ./controller/abr-controller */"./src/controller/abr-controller.ts"),n=r(/*! ./controller/audio-stream-controller */"./src/controller/audio-stream-controller.ts"),s=r(/*! ./controller/audio-track-controller */"./src/controller/audio-track-controller.ts"),o=r(/*! ./controller/subtitle-stream-controller */"./src/controller/subtitle-stream-controller.ts"),a=r(/*! ./controller/subtitle-track-controller */"./src/controller/subtitle-track-controller.ts"),l=r(/*! ./controller/buffer-controller */"./src/controller/buffer-controller.ts"),c=r(/*! ./controller/timeline-controller */"./src/controller/timeline-controller.ts"),u=r(/*! ./controller/cap-level-controller */"./src/controller/cap-level-controller.ts"),h=r(/*! ./controller/fps-controller */"./src/controller/fps-controller.ts"),d=r(/*! ./controller/eme-controller */"./src/controller/eme-controller.ts"),f=r(/*! ./controller/cmcd-controller */"./src/controller/cmcd-controller.ts"),p=r(/*! ./utils/xhr-loader */"./src/utils/xhr-loader.ts"),g=r(/*! ./utils/fetch-loader */"./src/utils/fetch-loader.ts"),v=r(/*! ./utils/cues */"./src/utils/cues.ts"),m=r(/*! ./utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts"),_=r(/*! ./utils/logger */"./src/utils/logger.ts");function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var C=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,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:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:i.default,bufferController:l.default,capLevelController:u.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:m.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},{cueHandler:v.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}),{},{subtitleStreamController:o.SubtitleStreamController,subtitleTrackController:a.default,timelineController:c.TimelineController,audioStreamController:n.default,audioTrackController:s.default,emeController:d.default,cmcdController:f.default});function E(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return y({},e,t)}function k(e){var t=e.loader;t!==g.default&&t!==p.default?(_.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):Object(g.fetchSupported)()&&(e.loader=g.default,e.progressive=!0,e.enableSoftwareAES=!0,_.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}},"./src/controller/abr-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/abr-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../utils/ewma-bandwidth-estimator */"./src/utils/ewma-bandwidth-estimator.ts"),s=r(/*! ../events */"./src/events.ts"),o=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=r(/*! ../errors */"./src/errors.ts"),l=r(/*! ../types/loader */"./src/types/loader.ts"),c=r(/*! ../utils/logger */"./src/utils/logger.ts");function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var h=function(){function e(e){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=e;var t=e.config;this.bwEstimator=new n.default(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}var t,r,h,d=e.prototype;return d.registerListeners=function(){var e=this.hls;e.on(s.Events.FRAG_LOADING,this.onFragLoading,this),e.on(s.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(s.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var e=this.hls;e.off(s.Events.FRAG_LOADING,this.onFragLoading,this),e.off(s.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(s.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},d.onFragLoading=function(e,t){var r,i=t.frag;i.type===l.PlaylistLevelType.MAIN&&(this.timer||(this.fragCurrent=i,this.partCurrent=null!=(r=t.part)?r:null,this.timer=self.setInterval(this.onCheck,100)))},d.onLevelLoaded=function(e,t){var r=this.hls.config;t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},d._abandonRulesCheck=function(){var e=this.fragCurrent,t=this.partCurrent,r=this.hls,n=r.autoLevelEnabled,a=r.config,l=r.media;if(e&&l){var u=t?t.stats:e.stats,h=t?t.duration:e.duration;if(u.aborted)return c.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);if(n&&!l.paused&&l.playbackRate&&l.readyState){var d=performance.now()-u.loading.start,f=Math.abs(l.playbackRate);if(!(d<=500*h/f)){var p=r.levels,g=r.minAutoLevel,v=p[e.level],m=u.total||Math.max(u.loaded,Math.round(h*v.maxBitrate/8)),_=Math.max(1,u.bwEstimate?u.bwEstimate/8:1e3*u.loaded/d),y=(m-u.loaded)/_,b=l.currentTime,S=(o.BufferHelper.bufferInfo(l,b,a.maxBufferHole).end-b)/f;if(!(S>=2*h/f||y<=S)){var w,C=Number.POSITIVE_INFINITY;for(w=e.level-1;w>g&&!((C=h*p[w].maxBitrate/(6.4*_))<S);w--);if(!(C>=y)){var E=this.bwEstimator.getEstimate();c.logger.warn("Fragment "+e.sn+(t?" part "+t.index:"")+" of level "+e.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+w+"\n Current BW estimate: "+(Object(i.isFiniteNumber)(E)?(E/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+y.toFixed(3)+" s\n Estimated load time for the next fragment: "+C.toFixed(3)+" s\n Time to underbuffer: "+S.toFixed(3)+" s"),r.nextLoadLevel=w,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),e.loader&&(this.fragCurrent=this.partCurrent=null,e.loader.abort()),r.trigger(s.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:u})}}}}}},d.onFragLoaded=function(e,t){var r=t.frag,n=t.part;if(r.type===l.PlaylistLevelType.MAIN&&Object(i.isFiniteNumber)(r.sn)){var o=n?n.stats:r.stats,a=n?n.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var c=this.hls.levels[r.level],u=(c.loaded?c.loaded.bytes:0)+o.loaded,h=(c.loaded?c.loaded.duration:0)+a;c.loaded={bytes:u,duration:h},c.realBitrate=Math.round(8*u/h)}if(r.bitrateTest){var d={stats:o,frag:r,part:n,id:r.type};this.onFragBuffered(s.Events.FRAG_BUFFERED,d),r.bitrateTest=!1}}},d.onFragBuffered=function(e,t){var r=t.frag,i=t.part,n=i?i.stats:r.stats;if(!n.aborted&&r.type===l.PlaylistLevelType.MAIN&&"initSegment"!==r.sn){var s=n.parsing.end-n.loading.start;this.bwEstimator.sample(s,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}},d.onError=function(e,t){switch(t.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},d.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},d.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,r=this.hls,i=r.maxAutoLevel,n=r.config,s=r.minAutoLevel,a=r.media,l=t?t.duration:e?e.duration:0,u=a?a.currentTime:0,h=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,f=(o.BufferHelper.bufferInfo(a,u,n.maxBufferHole).end-u)/h,p=this.findBestLevel(d,s,i,f,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(p>=0)return p;c.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=l?Math.min(l,n.maxStarvationDelay):n.maxStarvationDelay,v=n.abrBandWidthFactor,m=n.abrBandWidthUpFactor;if(!f){var _=this.bitrateTestDelay;_&&(g=(l?Math.min(l,n.maxLoadingDelay):n.maxLoadingDelay)-_,c.logger.trace("bitrate test took "+Math.round(1e3*_)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),v=m=1)}return p=this.findBestLevel(d,s,i,f+g,v,m),Math.max(p,0)},d.findBestLevel=function(e,t,r,i,n,s){for(var o,a=this.fragCurrent,l=this.partCurrent,u=this.lastLoadedFragLevel,h=this.hls.levels,d=h[u],f=!(null==d||null===(o=d.details)||void 0===o||!o.live),p=null==d?void 0:d.codecSet,g=l?l.duration:a?a.duration:0,v=r;v>=t;v--){var m=h[v];if(m&&(!p||m.codecSet===p)){var _=m.details,y=(l?null==_?void 0:_.partTarget:null==_?void 0:_.averagetargetduration)||g,b=void 0;b=v<=u?n*e:s*e;var S=h[v].maxBitrate,w=S*y/b;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(b)+"/"+S+"/"+y+"/"+i+"/"+w),b>S&&(!w||f&&!this.bitrateTestDelay||w<i))return v}}return-1},t=e,(r=[{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this.bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var r=this.getNextABRAutoLevel();return-1!==e&&(r=Math.min(e,r)),r},set:function(e){this._nextAutoLevel=e}}])&&u(t.prototype,r),h&&u(t,h),e}();t.default=h},"./src/controller/audio-stream-controller.ts":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./src/controller/audio-stream-controller.ts ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),s=r(/*! ../events */"./src/events.ts"),o=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),l=r(/*! ../types/level */"./src/types/level.ts"),c=r(/*! ../types/loader */"./src/types/loader.ts"),u=r(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=r(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts"),d=r(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),f=r(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),p=r(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),g=r(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),v=r(/*! ../errors */"./src/errors.ts"),m=r(/*! ../utils/logger */"./src/utils/logger.ts");function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b=function(e){var t,r;function b(t,r){var i;return(i=e.call(this,t,r,"[audio-stream-controller]")||this).videoBuffer=null,i.videoTrackCC=-1,i.waitingVideoCC=-1,i.audioSwitch=!1,i.trackId=-1,i.waitingData=null,i.mainDetails=null,i.bufferFlushed=!1,i._registerListeners(),i}r=e,(t=b).prototype=Object.create(r.prototype),t.prototype.constructor=t,y(t,r);var S=b.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var e=this.hls;e.on(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(s.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(s.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(s.Events.ERROR,this.onError,this),e.on(s.Events.BUFFER_RESET,this.onBufferReset,this),e.on(s.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(s.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var e=this.hls;e.off(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(s.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(s.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(s.Events.ERROR,this.onError,this),e.off(s.Events.BUFFER_RESET,this.onBufferReset,this),e.off(s.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(s.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onInitPtsFound=function(e,t){var r=t.frag,i=t.id,s=t.initPTS;if("main"===i){var o=r.cc;this.initPTS[r.cc]=s,this.log("InitPTS for cc: "+o+" found from main: "+s),this.videoTrackCC=o,this.state===n.State.WAITING_INIT_PTS&&this.tick()}},S.startLoad=function(e){if(!this.levels)return this.startPosition=e,void(this.state=n.State.STOPPED);var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,t>0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=n.State.IDLE):(this.loadedmetadata=!1,this.state=n.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},S.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_TRACK:var t,r=this.levels,i=this.trackId,s=null==r||null===(t=r[i])||void 0===t?void 0:t.details;if(s){if(this.waitForCdnTuneIn(s))break;this.state=n.State.WAITING_INIT_PTS}break;case n.State.FRAG_LOADING_WAITING_RETRY:var a,l=performance.now(),c=this.retryDate;(!c||l>=c||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=n.State.IDLE);break;case n.State.WAITING_INIT_PTS:var u=this.waitingData;if(u){var h=u.frag,d=u.part,f=u.cache,g=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.FRAG_LOADING;var v={frag:h,part:d,payload:f.flush(),networkDetails:null};this._handleFragmentLoadProgress(v),g&&e.prototype._handleFragmentLoadComplete.call(this,v)}else if(this.videoTrackCC!==this.waitingVideoCC)m.logger.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var _=this.getLoadPosition(),y=o.BufferHelper.bufferInfo(this.mediaBuffer,_,this.config.maxBufferHole);Object(p.fragmentWithinToleranceTest)(y.end,this.config.maxFragLookUpTolerance,h)<0&&(m.logger.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+y.end+" is needed"),this.clearWaitingFragment())}}else this.state=n.State.IDLE}this.onTickEnd()},S.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.IDLE)},S.onTickEnd=function(){var e=this.media;if(e&&e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length&&(this.loadedmetadata=!0),this.lastCurrentTime=e.currentTime}},S.doTickIdle=function(){var e,t,r=this.hls,i=this.levels,o=this.media,a=this.trackId,l=r.config;if(i&&i[a]&&(o||!this.startFragRequested&&l.startFragPrefetch)){var h=i[a].details;if(!h||h.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(h))this.state=n.State.WAITING_TRACK;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.ElementaryStreamTypes.AUDIO,c.PlaylistLevelType.AUDIO));var d=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,c.PlaylistLevelType.AUDIO);if(null!==d){var f=d.len,p=this.getMaxBufferLength(),g=this.audioSwitch;if(!(f>=p)||g){if(!g&&this._streamEnded(d,h))return r.trigger(s.Events.BUFFER_EOS,{type:"audio"}),void(this.state=n.State.ENDED);var v=h.fragments[0].start,m=d.end;if(g){var _=this.getLoadPosition();m=_,h.PTSKnown&&_<v&&(d.end>v||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=v+.05)}var y=this.getNextFragment(m,h);y?"identity"!==(null===(e=y.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=y.decryptdata)&&void 0!==t&&t.key?this.loadFragment(y,h,m):this.loadKey(y,h):this.bufferFlushed=!0}}}}},S.getMaxBufferLength=function(){var t=e.prototype.getMaxBufferLength.call(this),r=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);return null===r?t:Math.max(t,r.len)},S.onMediaDetaching=function(){this.videoBuffer=null,e.prototype.onMediaDetaching.call(this)},S.onAudioTracksUpdated=function(e,t){var r=t.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(e){return new l.Level(e)}))},S.onAudioTrackSwitching=function(e,t){var r=!!t.url;this.trackId=t.id;var i=this.fragCurrent;null!=i&&i.loader&&i.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=n.State.IDLE):this.state=n.State.STOPPED,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},S.onLevelLoaded=function(e,t){this.mainDetails=t.details},S.onAudioTrackLoaded=function(e,t){var r,i=this.levels,s=t.details,o=t.id;if(i){this.log("Track "+o+" loaded ["+s.startSN+","+s.endSN+"],duration:"+s.totalduration);var a=i[o],l=0;if(s.live||null!==(r=a.details)&&void 0!==r&&r.live){var c=this.mainDetails;if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed||!c)return;!a.details&&s.hasProgramDateTime&&c.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(s,c),l=s.fragments[0].start):l=this.alignPlaylists(s,a.details)}a.details=s,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&s.live||this.setStartPosition(a.details,l),this.state!==n.State.WAITING_TRACK||this.waitForCdnTuneIn(s)||(this.state=n.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+o)},S._handleFragmentLoadProgress=function(e){var t,r=e.frag,i=e.part,s=e.payload,o=this.config,a=this.trackId,l=this.levels;if(l){var u=l[a];console.assert(u,"Audio track is defined on fragment load progress");var p=u.details;console.assert(p,"Audio track details are defined on fragment load progress");var g=o.defaultAudioCodec||u.audioCodec||"mp4a.40.2",v=this.transmuxer;v||(v=this.transmuxer=new d.default(this.hls,c.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var _=this.initPTS[r.cc],y=null===(t=r.initSegment)||void 0===t?void 0:t.data;if(void 0!==_){var b=i?i.index:-1,S=-1!==b,w=new f.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,s.byteLength,b,S);v.push(s,y,g,"",r,i,p.totalduration,!1,w,_)}else m.logger.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+p.startSN+" ,"+p.endSN+"],track "+a),(this.waitingData=this.waitingData||{frag:r,part:i,cache:new h.default,complete:!1}).cache.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=n.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},S._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},S.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},S.onBufferCreated=function(e,t){var r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},S.onFragBuffered=function(e,t){var r=t.frag,i=t.part;r.type===c.PlaylistLevelType.AUDIO&&(this.fragContextChanged(r)?this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==r.sn&&(this.fragPrevious=r,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(r,i)))},S.onError=function(t,r){switch(r.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,r);break;case v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==n.State.ERROR&&this.state!==n.State.STOPPED&&(this.state=r.fatal?n.State.ERROR:n.State.IDLE,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var i=!0,s=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);s&&s.len>.5&&(i=!this.reduceMaxBufferLength(s.len)),i&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},S.onBufferFlushed=function(e,t){t.type===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},S._handleTransmuxComplete=function(e){var t,r="audio",i=this.hls,o=e.remuxResult,a=e.chunkMeta,l=this.getCurrentContext(a);if(!l)return this.warn("The loading context changed while buffering fragment "+a.sn+" of level "+a.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(a.level);var c=l.frag,h=l.part,d=o.audio,f=o.text,p=o.id3,g=o.initSegment;if(!this.fragContextChanged(c)){if(this.state=n.State.PARSING,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,c,a),i.trigger(s.Events.FRAG_PARSING_INIT_SEGMENT,{frag:c,id:r,tracks:g.tracks})),d){var v=d.startPTS,m=d.endPTS,y=d.startDTS,b=d.endDTS;h&&(h.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:v,endPTS:m,startDTS:y,endDTS:b}),c.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,v,m,y,b),this.bufferFragmentData(d,c,h,a)}if(null!=p&&null!==(t=p.samples)&&void 0!==t&&t.length){var S=_({frag:c,id:r},p);i.trigger(s.Events.FRAG_PARSING_METADATA,S)}if(f){var w=_({frag:c,id:r},f);i.trigger(s.Events.FRAG_PARSING_USERDATA,w)}}},S._bufferInitSegment=function(e,t,r){if(this.state===n.State.PARSING){e.video&&delete e.video;var i=e.audio;if(i){i.levelCodec=i.codec,i.id="audio",this.log("Init audio buffer, container:"+i.container+", codecs[parsed]=["+i.codec+"]"),this.hls.trigger(s.Events.BUFFER_CODECS,e);var o=i.initSegment;if(null!=o&&o.byteLength){var a={type:"audio",frag:t,part:null,chunkMeta:r,parent:t.type,data:o};this.hls.trigger(s.Events.BUFFER_APPENDING,a)}this.tick()}}},S.loadFragment=function(t,r,s){var o=this.fragmentTracker.getState(t);this.fragCurrent=t,(this.audioSwitch||o===a.FragmentState.NOT_LOADED||o===a.FragmentState.PARTIAL)&&("initSegment"===t.sn?this._loadInitSegment(t):r.live&&!Object(i.isFiniteNumber)(this.initPTS[t.cc])?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=n.State.WAITING_INIT_PTS):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,r,s)))},S.completeAudioSwitch=function(){var t=this.hls,r=this.media,i=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,t.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:i})},b}(n.default);t.default=b},"./src/controller/audio-track-controller.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/audio-track-controller.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),o=r(/*! ../types/loader */"./src/types/loader.ts");function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,r;function s(t){var r;return(r=e.call(this,t,"[audio-track-controller]")||this).tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}r=e,(t=s).prototype=Object.create(r.prototype),t.prototype.constructor=t,l(t,r);var c,u,h,d=s.prototype;return d.registerListeners=function(){var e=this.hls;e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(i.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(i.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var e=this.hls;e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(i.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(i.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,e.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(e,t){this.tracks=t.audioTracks||[]},d.onAudioTrackLoaded=function(e,t){var r=t.id,i=t.details,n=this.tracksInGroup[r];if(n){var s=n.details;n.details=t.details,this.log("audioTrack "+r+" loaded ["+i.startSN+"-"+i.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,t,s))}else this.warn("Invalid audio track id "+r)},d.onLevelLoading=function(e,t){this.switchLevel(t.level)},d.onLevelSwitching=function(e,t){this.switchLevel(t.level)},d.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.audioGroupIds){var r=t.audioGroupIds[t.urlId];if(this.groupId!==r){this.groupId=r;var n=this.tracks.filter((function(e){return!r||e.groupId===r}));this.selectDefaultTrack&&!n.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var s={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(i.Events.AUDIO_TRACKS_UPDATED,s),this.selectInitialTrack()}}},d.onError=function(t,r){e.prototype.onError.call(this,t,r),!r.fatal&&r.context&&r.context.type===o.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},d.setAudioTrack=function(e){var t=this.tracksInGroup;if(e<0||e>=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=t[this.trackId];this.log("Now switching to audio-track index "+e);var n=t[e],s=n.id,o=n.groupId,a=void 0===o?"":o,l=n.name,c=n.type,u=n.url;if(this.trackId=e,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(i.Events.AUDIO_TRACK_SWITCHING,{id:s,groupId:a,name:l,type:c,url:u}),!n.details||n.details.live){var h=this.switchParams(n.url,null==r?void 0:r.details);this.loadPlaylist(h)}}},d.selectInitialTrack=function(){var e=this.tracksInGroup;console.assert(e.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,r=this.findTrackId(t)||this.findTrackId();-1!==r?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r<t.length;r++){var i=t[r];if((!this.selectDefaultTrack||i.default)&&(!e||e===i.name))return i.id}return-1},d.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var r=t.id,n=t.groupId,s=t.url;if(e)try{s=e.addDirectives(s)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(i.Events.AUDIO_TRACK_LOADING,{url:s,id:r,groupId:n,deliveryDirectives:e||null})}},c=s,(u=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}}])&&a(c.prototype,u),h&&a(c,h),s}(s.default);t.default=c},"./src/controller/base-playlist-controller.ts":
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./src/controller/base-playlist-controller.ts ***!
|
|
|
\****************************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return l}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../types/level */"./src/types/level.ts"),s=r(/*! ./level-helper */"./src/controller/level-helper.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=r(/*! ../errors */"./src/errors.ts"),l=function(){function e(e,t){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=o.logger.log.bind(o.logger,t+":"),this.warn=o.logger.warn.bind(o.logger,t+":"),this.hls=e}var t=e.prototype;return t.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},t.onError=function(e,t){t.fatal&&t.type===a.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},t.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},t.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},t.stopLoad=function(){this.canLoad=!1,this.clearTimer()},t.switchParams=function(e,t){var r=null==t?void 0:t.renditionReports;if(r)for(var s=0;s<r.length;s++){var o=r[s],a=""+o.URI;if(a===e.substr(-a.length)){var l=parseInt(o["LAST-MSN"]),c=parseInt(o["LAST-PART"]);if(t&&this.hls.config.lowLatencyMode){var u=Math.min(t.age-t.partTarget,t.targetduration);void 0!==c&&u>t.partTarget&&(c+=1)}if(Object(i.isFiniteNumber)(l))return new n.HlsUrlParameters(l,Object(i.isFiniteNumber)(c)?c:void 0,n.HlsSkip.No)}}},t.loadPlaylist=function(e){},t.shouldLoadTrack=function(e){return this.canLoad&&e&&!!e.url&&(!e.details||e.details.live)},t.playlistLoaded=function(e,t,r){var i=this,n=t.details,o=t.stats,a=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(n.advancedDateTime=Date.now()-a,n.live||null!=r&&r.live){if(n.reloaded(r),r&&this.log("live playlist "+e+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),r&&n.fragments.length>0&&Object(s.mergeDetails)(r,n),!this.canLoad||!n.live)return;var l,c=void 0,u=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var h=this.hls.config.lowLatencyMode,d=n.lastPartSn,f=n.endSN,p=n.lastPartIndex,g=d===f;-1!==p?(c=g?f+1:d,u=g?h?0:p:p+1):c=f+1;var v=n.age,m=v+n.ageHeader,_=Math.min(m-n.partTarget,1.5*n.targetduration);if(_>0){if(r&&_>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+_+" with playlist age: "+n.age),_=0;else{var y=Math.floor(_/n.targetduration);c+=y,void 0!==u&&(u+=Math.round(_%n.targetduration/n.partTarget)),this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+_+" skip sn "+y+" to part "+u)}n.tuneInGoal=_}if(l=this.getDeliveryDirectives(n,t.deliveryDirectives,c,u),h||!g)return void this.loadPlaylist(l)}else l=this.getDeliveryDirectives(n,t.deliveryDirectives,c,u);var b=Object(s.computeReloadInterval)(n,o);void 0!==c&&n.canBlockReload&&(b-=n.partTarget||1),this.log("reload live playlist "+e+" in "+Math.round(b)+" ms"),this.timer=self.setTimeout((function(){return i.loadPlaylist(l)}),b)}else this.clearTimer()},t.getDeliveryDirectives=function(e,t,r,i){var s=Object(n.getSkipValue)(e,r);return null!=t&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,i=t.part,s=n.HlsSkip.No),new n.HlsUrlParameters(r,i,s)},t.retryLoadingOrFail=function(e){var t,r=this,i=this.hls.config,n=this.retryCount<i.levelLoadingMaxRetry;if(n)if(this.retryCount++,e.details.indexOf("LoadTimeOut")>-1&&null!==(t=e.context)&&void 0!==t&&t.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+e.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return r.loadPlaylist()}),s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+e.details+'"')}else this.warn('cannot recover from error "'+e.details+'"'),this.clearTimer(),e.fatal=!0;return n},e}()},"./src/controller/base-stream-controller.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/base-stream-controller.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: State, default */function(e,t,r){"use strict";r.r(t),r.d(t,"State",(function(){return S})),r.d(t,"default",(function(){return w}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../task-loop */"./src/task-loop.ts"),s=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),o=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=r(/*! ../utils/logger */"./src/utils/logger.ts"),l=r(/*! ../events */"./src/events.ts"),c=r(/*! ../errors */"./src/errors.ts"),u=r(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),h=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),d=r(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),f=r(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),p=r(/*! ./level-helper */"./src/controller/level-helper.ts"),g=r(/*! ../loader/fragment-loader */"./src/loader/fragment-loader.ts"),v=r(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),m=r(/*! ../utils/time-ranges */"./src/utils/time-ranges.ts"),_=r(/*! ../types/loader */"./src/types/loader.ts");function y(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var S={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"},w=function(e){var t,r;function n(t,r,i){var n;return(n=e.call(this)||this).hls=void 0,n.fragPrevious=null,n.fragCurrent=null,n.fragmentTracker=void 0,n.transmuxer=null,n._state=S.STOPPED,n.media=void 0,n.mediaBuffer=void 0,n.config=void 0,n.bitrateTest=!1,n.lastCurrentTime=0,n.nextLoadPosition=0,n.startPosition=0,n.loadedmetadata=!1,n.fragLoadError=0,n.retryDate=0,n.levels=null,n.fragmentLoader=void 0,n.levelLastLoaded=null,n.startFragRequested=!1,n.decrypter=void 0,n.initPTS=[],n.onvseeking=null,n.onvended=null,n.logPrefix="",n.log=void 0,n.warn=void 0,n.logPrefix=i,n.log=a.logger.log.bind(a.logger,i+":"),n.warn=a.logger.warn.bind(a.logger,i+":"),n.hls=t,n.fragmentLoader=new g.default(t.config),n.fragmentTracker=r,n.config=t.config,n.decrypter=new v.default(t,t.config),t.on(l.Events.KEY_LOADED,n.onKeyLoaded,function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,b(t,r);var w,C,E,k=n.prototype;return k.doTick=function(){this.onTickEnd()},k.onTickEnd=function(){},k.startLoad=function(e){},k.stopLoad=function(){this.fragmentLoader.abort();var e=this.fragCurrent;e&&this.fragmentTracker.removeFragment(e),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},k._streamEnded=function(e,t){var r=this.fragCurrent,i=this.fragmentTracker;if(!t.live&&r&&r.sn===t.endSN&&!e.nextStart){var n=i.getState(r);return n===s.FragmentState.PARTIAL||n===s.FragmentState.OK}return!1},k.onMediaAttached=function(e,t){var r=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("ended",this.onvended);var i=this.config;this.levels&&i.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(i.startPosition)},k.onMediaDetaching=function(){var e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},k.onMediaSeeking=function(){var e=this.config,t=this.fragCurrent,r=this.media,n=this.mediaBuffer,s=this.state,a=r?r.currentTime:0,l=o.BufferHelper.bufferInfo(n||r,a,e.maxBufferHole);if(this.log("media seeking to "+(Object(i.isFiniteNumber)(a)?a.toFixed(3):a)+", state: "+s),s===S.ENDED)this.resetLoadingState();else if(t&&!l.len){var c=e.maxFragLookUpTolerance,u=t.start-c,h=a>t.start+t.duration+c;(a<u||h)&&(h&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.loader.abort()),this.resetLoadingState())}r&&(this.lastCurrentTime=a),this.loadedmetadata||l.len||(this.nextLoadPosition=this.startPosition=a),this.tickImmediate()},k.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},k.onKeyLoaded=function(e,t){if(this.state===S.KEY_LOADING&&t.frag===this.fragCurrent&&this.levels){this.state=S.IDLE;var r=this.levels[t.frag.level].details;r&&this.loadFragment(t.frag,r,t.frag.start)}},k.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this)},k.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(l.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,e.prototype.onHandlerDestroyed.call(this)},k.loadKey=function(e,t){this.log("Loading key for "+e.sn+" of ["+t.startSN+"-"+t.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level),this.state=S.KEY_LOADING,this.fragCurrent=e,this.hls.trigger(l.Events.KEY_LOADING,{frag:e})},k.loadFragment=function(e,t,r){this._loadFragForPlayback(e,t,r)},k._loadFragForPlayback=function(e,t,r){var i=this;this._doFragLoad(e,t,r,(function(t){if(i.fragContextChanged(e))return i.warn("Fragment "+e.sn+(t.part?" p: "+t.part.index:"")+" of level "+e.level+" was dropped during download."),void i.fragmentTracker.removeFragment(e);e.stats.chunkCount++,i._handleFragmentLoadProgress(t)})).then((function(t){if(t){i.fragLoadError=0;var r=i.state;if(!i.fragContextChanged(e))return"payload"in t&&(i.log("Loaded fragment "+e.sn+" of level "+e.level),i.hls.trigger(l.Events.FRAG_LOADED,t),i.state===S.BACKTRACKING)?(i.fragmentTracker.backtrack(e,t),void i.resetFragmentLoading(e)):void i._handleFragmentLoadComplete(t);(r===S.FRAG_LOADING||r===S.BACKTRACKING||!i.fragCurrent&&r===S.PARSING)&&(i.fragmentTracker.removeFragment(e),i.state=S.IDLE)}})).catch((function(t){i.warn(t),i.resetFragmentLoading(e)}))},k.flushMainBuffer=function(e,t,r){if(void 0===r&&(r=null),e-t){var i={startOffset:e,endOffset:t,type:r};this.fragLoadError=0,this.hls.trigger(l.Events.BUFFER_FLUSHING,i)}},k._loadInitSegment=function(e){var t=this;this._doFragLoad(e).then((function(r){if(!r||t.fragContextChanged(e)||!t.levels)throw new Error("init load aborted");return r})).then((function(r){var i=t.hls,n=r.payload,s=e.decryptdata;if(n&&n.byteLength>0&&s&&s.key&&s.iv&&"AES-128"===s.method){var o=self.performance.now();return t.decrypter.webCryptoDecrypt(new Uint8Array(n),s.key.buffer,s.iv.buffer).then((function(t){var n=self.performance.now();return i.trigger(l.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:o,tdecrypt:n}}),r.payload=t,r}))}return r})).then((function(r){var i=t.fragCurrent,n=t.hls,s=t.levels;if(!s)throw new Error("init load aborted, missing levels");var o=s[e.level].details;console.assert(o,"Level details are defined when init segment is loaded");var a=e.stats;t.state=S.IDLE,t.fragLoadError=0,e.data=new Uint8Array(r.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),r.frag===i&&n.trigger(l.Events.FRAG_BUFFERED,{stats:a,frag:i,part:null,id:e.type}),t.tick()})).catch((function(r){t.warn(r),t.resetFragmentLoading(e)}))},k.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},k.fragBufferedComplete=function(e,t){var r=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level+" "+m.default.toString(o.BufferHelper.getBuffered(r))),this.state=S.IDLE,this.tick()},k._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var r=e.frag,i=e.part,n=e.partsLoaded,s=!n||0===n.length||n.some((function(e){return!e})),o=new u.ChunkMetadata(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(o)}},k._handleFragmentLoadProgress=function(e){},k._doFragLoad=function(e,t,r,n){var s=this;if(void 0===r&&(r=null),!this.levels)throw new Error("frag load aborted, missing levels");if(r=Math.max(e.start,r||0),this.config.lowLatencyMode&&t){var o=t.partList;if(o&&n){r>e.end&&t.fragmentHint&&(e=t.fragmentHint);var a=this.getNextPart(o,e,r);if(a>-1){var c=o[a];return this.log("Loading part sn: "+e.sn+" p: "+c.index+" cc: "+e.cc+" of playlist ["+t.startSN+"-"+t.endSN+"] parts [0-"+a+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=c.start+c.duration,this.state=S.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,part:o[a],targetBufferTime:r}),this.doFragPartsLoad(e,o,a,n).catch((function(e){return s.handleFragLoadError(e)}))}if(!e.url||this.loadedEndOfParts(o,r))return Promise.resolve(null)}}return this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(t?"of ["+t.startSN+"-"+t.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(r.toFixed(3))),Object(i.isFiniteNumber)(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=S.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragmentLoader.load(e,n).catch((function(e){return s.handleFragLoadError(e)}))},k.doFragPartsLoad=function(e,t,r,i){var n=this;return new Promise((function(s,o){var a=[];!function r(c){var u=t[c];n.fragmentLoader.loadPart(e,u,i).then((function(i){a[u.index]=i;var o=i.part;n.hls.trigger(l.Events.FRAG_LOADED,i);var h=t[c+1];if(!h||h.fragment!==e)return s({frag:e,part:o,partsLoaded:a});r(c+1)})).catch(o)}(r)}))},k.handleFragLoadError=function(e){var t=e.data;return t&&t.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(l.Events.ERROR,t),null},k._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(t&&this.state===S.PARSING){var r=t.frag,i=t.part,n=t.level,s=self.performance.now();r.stats.parsing.end=s,i&&(i.stats.parsing.end=s),this.updateLevelTiming(r,i,n,e.partial)}else this.fragCurrent||(this.state=S.IDLE)},k.getCurrentContext=function(e){var t=this.levels,r=e.level,i=e.sn,n=e.part;if(!t||!t[r])return this.warn("Levels object was unset while buffering fragment "+i+" of level "+r+". The current chunk will not be buffered."),null;var s=t[r],o=n>-1?Object(p.getPartWith)(s,i,n):null,a=o?o.fragment:Object(p.getFragmentWithSN)(s,i,this.fragCurrent);return a?{frag:a,part:o,level:s}:null},k.bufferFragmentData=function(e,t,r,i){if(e&&this.state===S.PARSING){var n=e.data1,s=e.data2,o=n;if(n&&s&&(o=Object(h.appendUint8Array)(n,s)),o&&o.length){var a={type:e.type,frag:t,part:r,chunkMeta:i,parent:t.type,data:o};this.hls.trigger(l.Events.BUFFER_APPENDING,a),e.dropped&&e.independent&&!r&&this.flushBufferGap(t)}}},k.flushBufferGap=function(e){var t=this.media;if(t)if(o.BufferHelper.isBuffered(t,t.currentTime)){var r=t.currentTime,i=o.BufferHelper.bufferInfo(t,r,0),n=e.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*n),a=Math.max(Math.min(e.start-s,i.end-s),r+s);e.start-a>s&&this.flushMainBuffer(a,e.start)}else this.flushMainBuffer(0,e.start)},k.getFwdBufferInfo=function(e,t){var r=this.config,n=this.getLoadPosition();if(!Object(i.isFiniteNumber)(n))return null;var s=o.BufferHelper.bufferInfo(e,n,r.maxBufferHole);if(0===s.len&&void 0!==s.nextStart){var a=this.fragmentTracker.getBufferedFrag(n,t);if(a&&s.nextStart<a.end)return o.BufferHelper.bufferInfo(e,n,Math.max(s.nextStart,r.maxBufferHole))}return s},k.getMaxBufferLength=function(e){var t,r=this.config;return t=e?Math.max(8*r.maxBufferSize/e,r.maxBufferLength):r.maxBufferLength,Math.min(t,r.maxMaxBufferLength)},k.reduceMaxBufferLength=function(e){var t=this.config,r=e||t.maxBufferLength;return t.maxMaxBufferLength>=r&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},k.getNextFragment=function(e,t){var r,i,n=t.fragments,s=n.length;if(!s)return null;var o,a=this.config,l=n[0].start;if(t.live){var c=a.initialLiveManifestSize;if(s<c)return this.warn("Not enough fragments to start playback (have: "+s+", need: "+c+")"),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(o=this.getInitialLiveFragment(t,n),this.startPosition=o?this.hls.liveSyncPosition||o.start:e)}else e<=l&&(o=n[0]);if(!o){var u=a.lowLatencyMode?t.partEnd:t.fragmentEnd;o=this.getFragmentAtPosition(e,u,t)}return null===(r=o)||void 0===r||!r.initSegment||null!==(i=o)&&void 0!==i&&i.initSegment.data||this.bitrateTest||(o=o.initSegment),o},k.getNextPart=function(e,t,r){for(var i=-1,n=!1,s=!0,o=0,a=e.length;o<a;o++){var l=e[o];if(s=s&&!l.independent,i>-1&&r<l.start)break;var c=l.loaded;!c&&(n||l.independent||s)&&l.fragment===t&&(i=o),n=c}return i},k.loadedEndOfParts=function(e,t){var r=e[e.length-1];return r&&t>r.start&&r.loaded},k.getInitialLiveFragment=function(e,t){var r=this.fragPrevious,i=null;if(r){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),i=Object(f.findFragmentByPDT)(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){var n=r.sn+1;if(n>=e.startSN&&n<=e.endSN){var s=t[n-e.startSN];r.cc===s.cc&&(i=s,this.log("Live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=Object(f.findFragWithCC)(t,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+i.sn)}}else{var o=this.hls.liveSyncPosition;null!==o&&(i=this.getFragmentAtPosition(o,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i},k.getFragmentAtPosition=function(e,t,r){var i,n=this.config,o=this.fragPrevious,a=r.fragments,l=r.endSN,c=r.fragmentHint,u=n.maxFragLookUpTolerance,h=!!(n.lowLatencyMode&&r.partList&&c);if(h&&c&&!this.bitrateTest&&(a=a.concat(c),l=c.sn),e<t){var d=e>t-u?0:u;i=Object(f.findFragmentByPTS)(o,a,e,d)}else i=a[a.length-1];if(i){var p=i.sn-r.startSN,g=o&&i.level===o.level,v=a[p+1];if(this.fragmentTracker.getState(i)===s.FragmentState.BACKTRACKED){i=null;for(var m=p;a[m]&&this.fragmentTracker.getState(a[m])===s.FragmentState.BACKTRACKED;)i=o?a[m--]:a[--m];i||(i=v)}else o&&i.sn===o.sn&&!h&&g&&(i.sn<l&&this.fragmentTracker.getState(v)!==s.FragmentState.OK?(this.log("SN "+i.sn+" just loaded, load next one: "+v.sn),i=v):i=null)}return i},k.synchronizeToLiveEdge=function(e){var t=this.config,r=this.media;if(r){var i=this.hls.liveSyncPosition,n=r.currentTime,s=e.fragments[0].start,o=e.edge,a=n>=s-t.maxFragLookUpTolerance&&n<=o;if(null!==i&&r.duration>i&&(n<i||!a)){var l=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!a&&r.readyState<4||n<o-l)&&(this.loadedmetadata||(this.nextLoadPosition=i),r.readyState&&(this.warn("Playback: "+n.toFixed(3)+" is located too far from the end of live sliding playlist: "+o+", reset currentTime to : "+i.toFixed(3)),r.currentTime=i))}}},k.alignPlaylists=function(e,t){var r=this.levels,n=this.levelLastLoaded,s=this.fragPrevious,o=null!==n?r[n]:null,a=e.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;var l=e.fragments[0].start,c=!t,u=e.alignedSliding&&Object(i.isFiniteNumber)(l);if(c||!u&&!l){Object(d.alignStream)(s,o,e);var h=e.fragments[0].start;return this.log("Live playlist sliding: "+h.toFixed(2)+" start-sn: "+(t?t.startSN:"na")+"->"+e.startSN+" prev-sn: "+(s?s.sn:"na")+" fragments: "+a),h}return l},k.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},k.setStartPosition=function(e,t){var r=this.startPosition;if(r<t&&(r=-1),-1===r||-1===this.lastCurrentTime){var n=e.startTimeOffset;Object(i.isFiniteNumber)(n)?(r=t+n,n<0&&(r+=e.totalduration),r=Math.min(Math.max(t,r),t+e.totalduration),this.log("Start time offset "+n+" found in playlist, adjust startPosition to "+r),this.startPosition=r):e.live?r=this.hls.liveSyncPosition||t:this.startPosition=r=0,this.lastCurrentTime=r}this.nextLoadPosition=r},k.getLoadPosition=function(){var e=this.media,t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t},k.handleFragLoadAborted=function(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn("Fragment "+e.sn+(t?" part"+t.index:"")+" of level "+e.level+" was aborted"),this.resetFragmentLoading(e))},k.resetFragmentLoading=function(e){this.fragCurrent&&this.fragContextChanged(e)||(this.state=S.IDLE)},k.onFragmentOrKeyLoadError=function(e,t){if(!t.fatal){var r=t.frag;if(r&&r.type===e){var i=this.fragCurrent;console.assert(i&&r.sn===i.sn&&r.level===i.level&&r.urlId===i.urlId,"Frag load error must match current frag to retry");var n=this.config;if(this.fragLoadError+1<=n.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(r.level))return;var s=Math.min(Math.pow(2,this.fragLoadError)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);this.warn("Fragment "+r.sn+" of "+e+" "+r.level+" failed to load, retrying in "+s+"ms"),this.retryDate=self.performance.now()+s,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else t.levelRetry?(e===_.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(a.logger.error(t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)}}},k.afterBufferFlushed=function(e,t,r){if(e){var i=o.BufferHelper.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,r),this.state===S.ENDED&&this.resetLoadingState()}},k.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},k.resetLiveStartWhenNotLoaded=function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=this.levels?this.levels[e].details:null;if(null!=t&&t.live)return this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},k.updateLevelTiming=function(e,t,r,i){var n=this,s=r.details;console.assert(!!s,"level.details must be defined"),Object.keys(e.elementaryStreams).reduce((function(t,o){var a=e.elementaryStreams[o];if(a){var c=a.endPTS-a.startPTS;if(c<=0)return n.warn("Could not parse fragment "+e.sn+" "+o+" duration reliably ("+c+") resetting transmuxer to fallback to playlist timing"),n.resetTransmuxer(),t||!1;var u=i?0:Object(p.updateFragPTSDTS)(s,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return n.hls.trigger(l.Events.LEVEL_PTS_UPDATED,{details:s,level:r,drift:u,type:o,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t}),!1)?(this.state=S.PARSED,this.hls.trigger(l.Events.FRAG_PARSED,{frag:e,part:t})):this.resetLoadingState()},k.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w=n,(C=[{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"->"+e))}}])&&y(w.prototype,C),E&&y(w,E),n}(n.default)},"./src/controller/buffer-controller.ts":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/controller/buffer-controller.ts ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return f}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=r(/*! ../errors */"./src/errors.ts"),a=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=r(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=r(/*! ../loader/fragment */"./src/loader/fragment.ts"),u=r(/*! ./buffer-operation-queue */"./src/controller/buffer-operation-queue.ts"),h=Object(l.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function e(e){var t=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 e=t.hls,r=t.media,i=t.mediaSource;s.logger.log("[buffer-controller]: Media source opened"),r&&(t.updateMediaElementDuration(),e.trigger(n.Events.MEDIA_ATTACHED,{media:r})),i&&i.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){s.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){s.logger.log("[buffer-controller]: Media source ended")},this.hls=e,this._initSourceBuffer(),this.registerListeners()}var t=e.prototype;return t.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},t.destroy=function(){this.unregisterListeners(),this.details=null},t.registerListeners=function(){var e=this.hls;e.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(n.Events.BUFFER_RESET,this.onBufferReset,this),e.on(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(n.Events.BUFFER_EOS,this.onBufferEos,this),e.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(n.Events.FRAG_PARSED,this.onFragParsed,this),e.on(n.Events.FRAG_CHANGED,this.onFragChanged,this)},t.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(n.Events.BUFFER_RESET,this.onBufferReset,this),e.off(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(n.Events.BUFFER_EOS,this.onBufferEos,this),e.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(n.Events.FRAG_PARSED,this.onFragParsed,this),e.off(n.Events.FRAG_CHANGED,this.onFragChanged,this)},t._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},t.onManifestParsed=function(e,t){var r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,s.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var r=this.media=t.media;if(r&&h){var i=this.mediaSource=new h;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(i),this._objectUrl=r.src}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,r=this._objectUrl;if(t){if(s.logger.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){s.logger.warn("[buffer-controller]: onMediaDetaching: "+e.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):s.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(n.Events.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var r=e.sourceBuffer[t];try{r&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(r),e.sourceBuffer[t]=void 0)}catch(e){s.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",e)}})),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var r=this,i=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(i){var n=r.tracks[e];if(n&&"function"==typeof n.buffer.changeType){var s=t[e],o=s.codec,a=s.levelCodec,l=s.container;if((n.levelCodec||n.codec).replace(d,"$1")!==(a||o).replace(d,"$1")){var c=l+";codecs="+(a||o);r.appendChangeType(e,c)}}}else r.pendingTracks[e]=t[e]})),i||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var r=this,i=this.operationQueue,n={execute:function(){var n=r.sourceBuffer[e];n&&(s.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),n.changeType(t)),i.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){s.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}};i.append(n,e)},t.onBufferAppending=function(e,t){var r=this,i=this.hls,l=this.operationQueue,c=this.tracks,u=t.data,h=t.type,d=t.frag,f=t.part,p=t.chunkMeta,g=p.buffering[h],v=self.performance.now();g.start=v;var m=d.stats.buffering,_=f?f.stats.buffering:null;0===m.start&&(m.start=v),_&&0===_.start&&(_.start=v);var y=c.audio,b="audio"===h&&1===p.id&&"audio/mpeg"===(null==y?void 0:y.container),S={execute:function(){if(g.executeStart=self.performance.now(),b){var e=r.sourceBuffer[h];if(e){var t=d.start-e.timestampOffset;Math.abs(t)>=.1&&(s.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+t+") sn: "+d.sn+")"),e.timestampOffset=d.start)}}r.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var e=self.performance.now();g.executeEnd=g.end=e,0===m.first&&(m.first=e),_&&0===_.first&&(_.first=e);var t=r.sourceBuffer,i={};for(var s in t)i[s]=a.BufferHelper.getBuffered(t[s]);r.appendError=0,r.hls.trigger(n.Events.BUFFER_APPENDED,{type:h,frag:d,part:f,chunkMeta:p,parent:d.type,timeRanges:i})},onError:function(e){s.logger.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",e);var t={type:o.ErrorTypes.MEDIA_ERROR,parent:d.type,details:o.ErrorDetails.BUFFER_APPEND_ERROR,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=o.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,t.details=o.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>i.config.appendErrorMaxRetry&&(s.logger.error("[buffer-controller]: Failed "+i.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0)),i.trigger(n.Events.ERROR,t)}};l.append(S,h)},t.onBufferFlushing=function(e,t){var r=this,i=this.operationQueue,o=function(e){return{execute:r.removeExecutor.bind(r,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(n.Events.BUFFER_FLUSHED,{type:e})},onError:function(t){s.logger.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?i.append(o(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){i.append(o(e),e)}))},t.onFragParsed=function(e,t){var r=this,i=t.frag,o=t.part,a=[],l=o?o.elementaryStreams:i.elementaryStreams;l[c.ElementaryStreamTypes.AUDIOVIDEO]?a.push("audiovideo"):(l[c.ElementaryStreamTypes.AUDIO]&&a.push("audio"),l[c.ElementaryStreamTypes.VIDEO]&&a.push("video")),0===a.length&&s.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+i.type+" level: "+i.level+" sn: "+i.sn),this.blockBuffers((function(){var e=self.performance.now();i.stats.buffering.end=e,o&&(o.stats.buffering.end=e);var t=o?o.stats:i.stats;r.hls.trigger(n.Events.FRAG_BUFFERED,{frag:i,part:o,stats:t,id:i.type})}),a)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var r=this;this.getSourceBufferTypes().reduce((function(e,i){var n=r.sourceBuffer[i];return t.type&&t.type!==i||n&&!n.ended&&(n.ended=!0,s.logger.log("[buffer-controller]: "+i+" sourceBuffer now EOS")),e&&!(n&&!n.ended)}),!0)&&this.blockBuffers((function(){var e=r.mediaSource;e&&"open"===e.readyState&&e.endOfStream()}))},t.onLevelUpdated=function(e,t){var r=t.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,r=this.media,s=this.sourceBuffer;if(r&&null!==t){var o=this.getSourceBufferTypes();if(o.length){var l=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(Object(i.isFiniteNumber)(l)&&!(l<0)){var c=r.currentTime,u=t.levelTargetDuration,h=Math.max(l,u),d=Math.floor(c/u)*u-h;o.forEach((function(r){var i=s[r];if(i){var o=a.BufferHelper.getBuffered(i);o.length>0&&d>o.start(0)&&(e.trigger(n.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),t.live&&e.trigger(n.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),e.trigger(n.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:r}))}}))}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,r=this.media,n=this.mediaSource,o=e.fragments[0].start+e.totalduration,a=r.duration,l=Object(i.isFiniteNumber)(n.duration)?n.duration:0;e.live&&t.config.liveDurationInfinity?(s.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),n.duration=1/0,this.updateSeekableRange(e)):(o>l&&o>a||!Object(i.isFiniteNumber)(a))&&(s.logger.log("[buffer-controller]: Updating Media Source duration to "+o.toFixed(3)),n.duration=o)}},t.updateSeekableRange=function(e){var t=this.mediaSource,r=e.fragments;if(r.length&&e.live&&null!=t&&t.setLiveSeekableRange){var i=Math.max(0,r[0].start),n=Math.max(i,i+e.totalduration);t.setLiveSeekableRange(i,n)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,r=this.pendingTracks,i=Object.keys(r).length;if(i&&!e||2===i){this.createSourceBuffers(r),this.pendingTracks={};var s=this.getSourceBufferTypes();if(0===s.length)return void this.hls.trigger(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});s.forEach((function(e){t.executeNext(e)}))}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var i=0;for(var a in e)if(!t[a]){var l=e[a];if(!l)throw Error("source buffer exists for track "+a+", however track does not");var c=l.levelCodec||l.codec,u=l.container+";codecs="+c;s.logger.log("[buffer-controller]: creating sourceBuffer("+u+")");try{var h=t[a]=r.addSourceBuffer(u),d=a;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[a]={buffer:h,codec:c,container:l.container,levelCodec:l.levelCodec,id:l.id},i++}catch(e){s.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+e.message),this.hls.trigger(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:u})}}i&&this.hls.trigger(n.Events.BUFFER_CREATED,{tracks:this.tracks})},t._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},t._onSBUpdateEnd=function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)},t._onSBUpdateError=function(e,t){s.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(e);r&&r.onError(t)},t.removeExecutor=function(e,t,r){var n=this.media,o=this.mediaSource,a=this.operationQueue,l=this.sourceBuffer[e];if(!n||!o||!l)return s.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void a.shiftAndExecuteNext(e);var c=Object(i.isFiniteNumber)(n.duration)?n.duration:1/0,u=Object(i.isFiniteNumber)(o.duration)?o.duration:1/0,h=Math.max(0,t),d=Math.min(r,c,u);d>h?(s.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+e+" SourceBuffer"),console.assert(!l.updating,e+" sourceBuffer must not be updating"),l.remove(h,d)):a.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var r=this.operationQueue,i=this.sourceBuffer[t];if(!i)return s.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(t);i.ended=!1,console.assert(!i.updating,t+" sourceBuffer must not be updating"),i.appendBuffer(e)},t.blockBuffers=function(e,t){var r=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length)return s.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(e);var i=this.operationQueue,n=t.map((function(e){return i.appendBlocker(e)}));Promise.all(n).then((function(){e(),t.forEach((function(e){var t=r.sourceBuffer[e];t&&t.updating||i.shiftAndExecuteNext(e)}))}))},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,r){var i=this.sourceBuffer[e];if(i){var n=r.bind(this,e);this.listeners[e].push({event:t,listener:n}),i.addEventListener(t,n)}},t.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))},e}()},"./src/controller/buffer-operation-queue.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/buffer-operation-queue.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return n}));var i=r(/*! ../utils/logger */"./src/utils/logger.ts"),n=function(){function e(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}var t=e.prototype;return t.append=function(e,t){var r=this.queues[t];r.push(e),1===r.length&&this.buffers[t]&&this.executeNext(t)},t.insertAbort=function(e,t){this.queues[t].unshift(e),this.executeNext(t)},t.appendBlocker=function(e){var t,r=new Promise((function(e){t=e})),i={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(i,e),r},t.executeNext=function(e){var t=this.buffers,r=this.queues,n=t[e],s=r[e];if(s.length){var o=s[0];try{o.execute()}catch(t){i.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(t),n&&n.updating||(s.shift(),this.executeNext(e))}}},t.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},t.current=function(e){return this.queues[e][0]},e}()},"./src/controller/cap-level-controller.ts":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./src/controller/cap-level-controller.ts ***!
|
|
|
\************************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../events */"./src/events.ts");function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=function(){function e(e){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=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var t,r,s,o=e.prototype;return o.setStreamController=function(e){this.streamController=e},o.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},o.registerListeners=function(){var e=this.hls;e.on(i.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.unregisterListener=function(){var e=this.hls;e.off(i.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.onFpsDropLevelCapping=function(t,r){e.isLevelAllowed(r.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(r.droppedLevel)},o.onMediaAttaching=function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null},o.onManifestParsed=function(e,t){var r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()},o.onBufferCodecs=function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()},o.onMediaDetaching=function(){this.stopCapping()},o.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},o.getMaxLevel=function(t){var r=this,i=this.hls.levels;if(!i.length)return-1;var n=i.filter((function(i,n){return e.isLevelAllowed(n,r.restrictedLevels)&&n<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},o.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},o.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},o.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t},e.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},e.getMaxLevelByMediaSize=function(e,t,r){if(!e||!e.length)return-1;for(var i,n,s=e.length-1,o=0;o<e.length;o+=1){var a=e[o];if((a.width>=t||a.height>=r)&&(i=a,!(n=e[o+1])||i.width!==n.width||i.height!==n.height)){s=o;break}}return s},t=e,s=[{key:"contentScaleFactor",get:function(){var e=1;try{e=self.devicePixelRatio}catch(e){}return e}}],(r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*e.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*e.contentScaleFactor}}])&&n(t.prototype,r),s&&n(t,s),e}();t.default=s},"./src/controller/cmcd-controller.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/controller/cmcd-controller.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return d}));var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../types/cmcd */"./src/types/cmcd.ts"),s=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts");function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}function c(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}var d=function(){function e(t){var r=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(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(e){try{r.apply(e,{ot:n.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(e){o.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=function(e){try{var t=e.frag,i=r.hls.levels[t.level],s=r.getObjectType(t),a={d:1e3*t.duration,ot:s};s!==n.CMCDObjectType.VIDEO&&s!==n.CMCDObjectType.AUDIO&&s!=n.CMCDObjectType.MUXED||(a.br=i.bitrate/1e3,a.tb=r.getTopBandwidth(s),a.bl=r.getBufferLength(s)),r.apply(e,a)}catch(e){o.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=t;var i=this.config=t.config,s=i.cmcd;null!=s&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||e.uuid(),this.cid=s.contentId,this.useHeaders=!0===s.useHeaders,this.registerListeners())}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(i.Events.BUFFER_CREATED,this.onBufferCreated,this)},t.unregisterListeners=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(i.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},t.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var r,i;this.audioBuffer=null===(r=t.tracks.audio)||void 0===r?void 0:r.buffer,this.videoBuffer=null===(i=t.tracks.video)||void 0===i?void 0:i.buffer},t.createData=function(){var e;return{v:n.CMCDVersion,sf:n.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:null===(e=this.media)||void 0===e?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},t.apply=function(t,r){void 0===r&&(r={}),h(r,this.createData());var i=r.ot===n.CMCDObjectType.INIT||r.ot===n.CMCDObjectType.VIDEO||r.ot===n.CMCDObjectType.MUXED;if(this.starved&&i&&(r.bs=!0,r.su=!0,this.starved=!1),null==r.su&&(r.su=this.buffering),this.useHeaders){var s=e.toHeaders(r);if(!Object.keys(s).length)return;t.headers||(t.headers={}),h(t.headers,s)}else{var o=e.toQuery(r);if(!o)return;t.url=e.appendQueryToUri(t.url,o)}},t.getObjectType=function(e){var t=e.type;return"subtitle"===t?n.CMCDObjectType.TIMED_TEXT:"initSegment"===e.sn?n.CMCDObjectType.INIT:"audio"===t?n.CMCDObjectType.AUDIO:"main"===t?this.hls.audioTracks.length?n.CMCDObjectType.VIDEO:n.CMCDObjectType.MUXED:void 0},t.getTopBandwidth=function(e){for(var t,r=0,i=c(e===n.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels);!(t=i()).done;){var s=t.value;s.bitrate>r&&(r=s.bitrate)}return r>0?r:NaN},t.getBufferLength=function(e){var t=this.hls.media,r=e===n.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return r&&t?1e3*s.BufferHelper.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var i=e.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(e,r,i){t(e),this.loader.load(e,r,i)},l(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var i=e.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(e,r,i){t(e),this.loader.load(e,r,i)},l(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},e.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)},e.serialize=function(e){for(var t,r=[],i=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},n=function(e){return Math.round(e)},s=function(e){return 100*n(e/100)},o={br:n,d:n,bl:s,dl:s,mtp:s,nor:function(e){return encodeURIComponent(e)},rtp:s,tb:n},a=c(Object.keys(e||{}).sort());!(t=a()).done;){var l=t.value,u=e[l];if(i(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=o[l];h&&(u=h(u));var d=typeof u,f=void 0;f="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),r.push(f)}}return r.join(",")},e.toHeaders=function(t){for(var r={},i=["Object","Request","Session","Status"],n=[{},{},{},{}],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},o=0,a=Object.keys(t);o<a.length;o++){var l=a[o];n[null!=s[l]?s[l]:1][l]=t[l]}for(var c=0;c<n.length;c++){var u=e.serialize(n[c]);u&&(r["CMCD-"+i[c]]=u)}return r},e.toQuery=function(t){return"CMCD="+encodeURIComponent(e.serialize(t))},e.appendQueryToUri=function(e,t){if(!t)return e;var r=e.includes("?")?"&":"?";return""+e+r+t},e}()},"./src/controller/eme-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/eme-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=r(/*! ../utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts");function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var l=function(){function e(e){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=e,this._config=e.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,r,l,c=e.prototype;return c.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},c._registerListeners=function(){this.hls.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c._unregisterListeners=function(){this.hls.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c.getLicenseServerUrl=function(e){switch(e){case o.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+e+'"')},c._attemptKeySystemAccess=function(e,t,r){var i=this,n=function(e,t,r,i){switch(e){case o.KeySystems.WIDEVINE:return function(e,t,r){var i={audioCapabilities:[],videoCapabilities:[]};return e.forEach((function(e){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+e+'"',robustness:r.audioRobustness||""})})),t.forEach((function(e){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+e+'"',robustness:r.videoRobustness||""})})),[i]}(t,r,i);default:throw new Error("Unknown key-system: "+e)}}(e,t,r,this._drmSystemOptions);s.logger.log("Requesting encrypted media key-system access");var a=this.requestMediaKeySystemAccess(e,n);this.mediaKeysPromise=a.then((function(t){return i._onMediaKeySystemAccessObtained(e,t)})),a.catch((function(t){s.logger.error('Failed to obtain key-system "'+e+'" access:',t)}))},c._onMediaKeySystemAccessObtained=function(e,t){var r=this;s.logger.log('Access for key-system "'+e+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:e};this._mediaKeysList.push(i);var n=Promise.resolve().then((function(){return t.createMediaKeys()})).then((function(t){return i.mediaKeys=t,s.logger.log('Media-keys created for key-system "'+e+'"'),r._onMediaKeysCreated(),t}));return n.catch((function(e){s.logger.error("Failed to create media-keys:",e)})),n},c._onMediaKeysCreated=function(){var e=this;this._mediaKeysList.forEach((function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),e._onNewMediaKeySession(t.mediaKeysSession))}))},c._onNewMediaKeySession=function(e){var t=this;s.logger.log("New key-system session "+e.sessionId),e.addEventListener("message",(function(r){t._onKeySessionMessage(e,r.message)}),!1)},c._onKeySessionMessage=function(e,t){s.logger.log("Got EME message event, creating license request"),this._requestLicense(t,(function(t){s.logger.log("Received license data (length: "+(t?t.byteLength:t)+"), updating key-session"),e.update(t)}))},c.onMediaEncrypted=function(e){var t=this;if(s.logger.log('Media is encrypted using "'+e.initDataType+'" init data type'),!this.mediaKeysPromise)return s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),void this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});var r=function(r){t._media&&(t._attemptSetMediaKeys(r),t._generateRequestWithPreferredKeySession(e.initDataType,e.initData))};this.mediaKeysPromise.then(r).catch(r)},c._attemptSetMediaKeys=function(e){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys)return s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});s.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(e,t){var r=this,o=this._mediaKeysList[0];if(!o)return s.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(o.mediaKeysSessionInitialized)s.logger.warn("Key-Session already initialized but requested again");else{var a=o.mediaKeysSession;if(!a)return s.logger.error("Fatal: Media is encrypted but no key-session existing"),void this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});if(!t)return s.logger.warn("Fatal: initData required for generating a key session is null"),void this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});s.logger.log('Generating key-session request for "'+e+'" init data type'),o.mediaKeysSessionInitialized=!0,a.generateRequest(e,t).then((function(){s.logger.debug("Key-session generation succeeded")})).catch((function(e){s.logger.error("Error generating key-session request:",e),r.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},c._createLicenseXhr=function(e,t,r){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,e,t,r);var n=this._licenseXhrSetup;if(n)try{n.call(this.hls,i,e),n=void 0}catch(e){s.logger.error(e)}try{i.readyState||i.open("POST",e,!0),n&&n.call(this.hls,i,e)}catch(e){throw new Error("issue setting up KeySystem license XHR "+e)}return i},c._onLicenseRequestReadyStageChange=function(e,t,r,o){switch(e.readyState){case 4:if(200===e.status){this._requestLicenseFailureCount=0,s.logger.log("License request succeeded");var a=e.response,l=this._licenseResponseCallback;if(l)try{a=l.call(this.hls,e,t)}catch(e){s.logger.error(e)}o(a)}else{if(s.logger.error("License Request XHR failed ("+t+"). Status: "+e.status+" ("+e.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3)return void this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var c=3-this._requestLicenseFailureCount+1;s.logger.warn("Retrying license request, "+c+" attempts left"),this._requestLicense(r,o)}}},c._generateLicenseRequestChallenge=function(e,t){switch(e.mediaKeySystemDomain){case o.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+e.mediaKeySystemDomain)},c._requestLicense=function(e,t){s.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return s.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var o=this.getLicenseServerUrl(r.mediaKeySystemDomain),a=this._createLicenseXhr(o,e,t);s.logger.log("Sending license request to URL: "+o);var l=this._generateLicenseRequestChallenge(r,e);a.send(l)}catch(e){s.logger.error("Failure requesting DRM license: "+e),this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},c.onMediaAttached=function(e,t){if(this._emeEnabled){var r=t.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)}},c.onMediaDetached=function(){var e=this._media,t=this._mediaKeysList;e&&(e.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map((function(e){if(e.mediaKeysSession)return e.mediaKeysSession.close().catch((function(){}))}))).then((function(){return e.setMediaKeys(null)})).catch((function(){})))},c.onManifestParsed=function(e,t){if(this._emeEnabled){var r=t.levels.map((function(e){return e.audioCodec})).filter((function(e){return!!e})),i=t.levels.map((function(e){return e.videoCodec})).filter((function(e){return!!e}));this._attemptKeySystemAccess(o.KeySystems.WIDEVINE,r,i)}},t=e,(r=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&a(t.prototype,r),l&&a(t,l),e}();t.default=l},"./src/controller/fps-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/fps-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../utils/logger */"./src/utils/logger.ts"),s=function(){function e(e){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=e,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var r=this.hls.config;if(r.capLevelOnFPSDrop){var i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&"function"==typeof i.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},t.checkFPS=function(e,t,r){var s=performance.now();if(t){if(this.lastTime){var o=s-this.lastTime,a=r-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*a/o,u=this.hls;if(u.trigger(i.Events.FPS_DROP,{currentDropped:a,currentDecoded:l,totalDroppedFrames:r}),c>0&&a>u.config.fpsDroppedMonitoringThreshold*l){var h=u.currentLevel;n.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>=h)&&(h-=1,u.trigger(i.Events.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},t.checkFPSInterval=function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e}();t.default=s},"./src/controller/fragment-finders.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/fragment-finders.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: findFragmentByPDT, findFragmentByPTS, fragmentWithinToleranceTest, pdtWithinToleranceTest, findFragWithCC */function(e,t,r){"use strict";r.r(t),r.d(t,"findFragmentByPDT",(function(){return s})),r.d(t,"findFragmentByPTS",(function(){return o})),r.d(t,"fragmentWithinToleranceTest",(function(){return a})),r.d(t,"pdtWithinToleranceTest",(function(){return l})),r.d(t,"findFragWithCC",(function(){return c}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../utils/binary-search */"./src/utils/binary-search.ts");function s(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!Object(i.isFiniteNumber)(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;r=r||0;for(var n=0;n<e.length;++n){var s=e[n];if(l(t,r,s))return s}return null}function o(e,t,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var s=null;if(e?s=t[e.sn-t[0].sn+1]||null:0===r&&0===t[0].start&&(s=t[0]),s&&0===a(r,i,s))return s;var o=n.default.search(t,a.bind(null,r,i));return o||s}function a(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0);var i=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=e?1:r.start-i>e&&r.start?-1:0}function l(e,t,r){var i=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-i>e}function c(e,t){return n.default.search(e,(function(e){return e.cc<t?1:e.cc>t?-1:0}))}},"./src/controller/fragment-tracker.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/fragment-tracker.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: FragmentState, FragmentTracker */function(e,t,r){"use strict";r.r(t),r.d(t,"FragmentState",(function(){return i})),r.d(t,"FragmentTracker",(function(){return o}));var i,n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../types/loader */"./src/types/loader.ts");!function(e){e.NOT_LOADED="NOT_LOADED",e.BACKTRACKED="BACKTRACKED",e.APPENDING="APPENDING",e.PARTIAL="PARTIAL",e.OK="OK"}(i||(i={}));var o=function(){function e(e){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=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(n.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.on(n.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(n.Events.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(n.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.off(n.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(n.Events.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){if(t===s.PlaylistLevelType.MAIN){var r=this.activeFragment,i=this.activeParts;if(!r)return null;if(i)for(var n=i.length;n--;){var o=i[n],a=o?o.end:r.appendedPTS;if(o.start<=e&&void 0!==a&&e<=a)return n>9&&(this.activeParts=i.slice(n-9)),o}else if(r.start<=e&&void 0!==r.appendedPTS&&e<=r.appendedPTS)return r}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var r=this.fragments,i=Object.keys(r),n=i.length;n--;){var s=r[i[n]];if((null==s?void 0:s.body.type)===t&&s.buffered){var o=s.body;if(o.start<=e&&e<=o.end)return o}}return null},t.detectEvictedFragments=function(e,t,r){var i=this;Object.keys(this.fragments).forEach((function(n){var s=i.fragments[n];if(s)if(s.buffered){var o=s.range[e];o&&o.time.some((function(e){var r=!i.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&i.removeFragment(s.body),r}))}else s.body.type===r&&i.removeFragment(s.body)}))},t.detectPartialFragments=function(e){var t=this,r=this.timeRanges,i=e.frag,n=e.part;if(r&&"initSegment"!==i.sn){var s=l(i),o=this.fragments[s];o&&(Object.keys(r).forEach((function(e){var s=i.elementaryStreams[e];if(s){var a=r[e],l=null!==n||!0===s.partial;o.range[e]=t.getBufferedTimes(i,n,l,a)}})),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body))}},t.fragBuffered=function(e){var t=l(e),r=this.fragments[t];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},t.getBufferedTimes=function(e,t,r,i){for(var n={time:[],partial:r},s=t?t.start:e.start,o=t?t.end:e.end,a=e.minEndPTS||o,l=e.maxStartPTS||s,c=0;c<i.length;c++){var u=i.start(c)-this.bufferPadding,h=i.end(c)+this.bufferPadding;if(l>=u&&a<=h){n.time.push({startPTS:Math.max(s,i.start(c)),endPTS:Math.min(o,i.end(c))});break}if(s<h&&o>u)n.partial=!0,n.time.push({startPTS:Math.max(s,i.start(c)),endPTS:Math.min(o,i.end(c))});else if(o<=u)break}return n},t.getPartialFragment=function(e){var t,r,i,n=null,s=0,o=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach((function(c){var u=l[c];u&&a(u)&&(r=u.body.start-o,i=u.body.end+o,e>=r&&e<=i&&(t=Math.min(e-r,i-e),s<=t&&(n=u.body,s=t)))})),n},t.getState=function(e){var t=l(e),r=this.fragments[t];return r?r.buffered?a(r)?i.PARTIAL:i.OK:r.backtrack?i.BACKTRACKED:i.APPENDING:i.NOT_LOADED},t.backtrack=function(e,t){var r=l(e),i=this.fragments[r];if(!i||i.backtrack)return null;var n=i.backtrack=t||i.loaded;return i.loaded=null,n},t.getBacktrackData=function(e){var t=l(e),r=this.fragments[t];if(r){var i,n=r.backtrack;if(null!=n&&null!==(i=n.payload)&&void 0!==i&&i.byteLength)return n;this.removeFragment(e)}return null},t.isTimeBuffered=function(e,t,r){for(var i,n,s=0;s<r.length;s++){if(i=r.start(s)-this.bufferPadding,n=r.end(s)+this.bufferPadding,e>=i&&t<=n)return!0;if(t<=i)return!1}return!1},t.onFragLoaded=function(e,t){var r=t.frag,i=t.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!i){var n=l(r);this.fragments[n]={body:r,loaded:t,backtrack:null,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var r=this,i=t.frag,n=t.part,o=t.timeRanges;if(i.type===s.PlaylistLevelType.MAIN)if(this.activeFragment=i,n){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(n)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach((function(e){var t=o[e];if(r.detectEvictedFragments(e,t),!n)for(var s=0;s<t.length;s++)i.appendedPTS=Math.max(t.end(s),i.appendedPTS||0)}))},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){var t=l(e);return!!this.fragments[t]},t.removeFragmentsInRange=function(e,t,r){var i=this;Object.keys(this.fragments).forEach((function(n){var s=i.fragments[n];if(s&&s.buffered){var o=s.body;o.type===r&&o.start<t&&o.end>e&&i.removeFragment(o)}}))},t.removeFragment=function(e){var t=l(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),delete this.fragments[t]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},e}();function a(e){var t,r;return e.buffered&&((null===(t=e.range.video)||void 0===t?void 0:t.partial)||(null===(r=e.range.audio)||void 0===r?void 0:r.partial))}function l(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn}},"./src/controller/gap-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/gap-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: STALL_MINIMUM_DURATION_MS, MAX_START_GAP_JUMP, SKIP_BUFFER_HOLE_STEP_SECONDS, SKIP_BUFFER_RANGE_START, default */function(e,t,r){"use strict";r.r(t),r.d(t,"STALL_MINIMUM_DURATION_MS",(function(){return a})),r.d(t,"MAX_START_GAP_JUMP",(function(){return l})),r.d(t,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return c})),r.d(t,"SKIP_BUFFER_RANGE_START",(function(){return u})),r.d(t,"default",(function(){return h}));var i=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),n=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ../events */"./src/events.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=250,l=2,c=.1,u=.05,h=function(){function e(e,t,r,i){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=e,this.media=t,this.fragmentTracker=r,this.hls=i}var t=e.prototype;return t.destroy=function(){this.hls=this.fragmentTracker=this.media=null},t.poll=function(e){var t=this.config,r=this.media,n=this.stalled,s=r.currentTime,c=r.seeking,u=this.seeking&&!c,h=!this.seeking&&c;if(this.seeking=c,s===e){if((h||u)&&(this.stalled=null),!r.paused&&!r.ended&&0!==r.playbackRate&&i.BufferHelper.getBuffered(r).length){var d=i.BufferHelper.bufferInfo(r,s,0),f=d.len>0,p=d.nextStart||0;if(f||p){if(c){var g=d.len>l,v=!p||p-s>l&&!this.fragmentTracker.getPartialFragment(s);if(g||v)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var m,_=Math.max(p,d.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,b=(null==y||null===(m=y.details)||void 0===m?void 0:m.live)?2*y.details.targetduration:l;if(_>0&&_<=b)return void this._trySkipBufferHole(null)}var S=self.performance.now();if(null!==n){var w=S-n;!c&&w>=a&&this._reportStall(d.len);var C=i.BufferHelper.bufferInfo(r,s,t.maxBufferHole);this._tryFixBufferStall(C,w)}else this.stalled=S}}}else if(this.moved=!0,null!==n){if(this.stallReported){var E=self.performance.now()-n;o.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},t._tryFixBufferStall=function(e,t){var r=this.config,i=this.fragmentTracker,n=this.media.currentTime,s=i.getPartialFragment(n);s&&this._trySkipBufferHole(s)||e.len>r.maxBufferHole&&t>1e3*r.highBufferWatchdogPeriod&&(o.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},t._reportStall=function(e){var t=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,o.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+e+")"),t.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},t._trySkipBufferHole=function(e){for(var t=this.config,r=this.hls,a=this.media,l=a.currentTime,h=0,d=i.BufferHelper.getBuffered(a),f=0;f<d.length;f++){var p=d.start(f);if(l+t.maxBufferHole>=h&&l<p){var g=Math.max(p+u,a.currentTime+c);return o.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+g),this.moved=!0,this.stalled=null,a.currentTime=g,e&&r.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+g,frag:e}),g}h=d.end(f)}return 0},t._tryNudgeBuffer=function(){var e=this.config,t=this.hls,r=this.media,i=r.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<e.nudgeMaxRetry){var l=i+a*e.nudgeOffset;o.logger.warn("Nudging 'currentTime' from "+i+" to "+l),r.currentTime=l,t.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+e.nudgeMaxRetry+" nudges"),t.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},e}()},"./src/controller/id3-track-controller.ts":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./src/controller/id3-track-controller.ts ***!
|
|
|
\************************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),s=r(/*! ../demux/id3 */"./src/demux/id3.ts"),o=function(){function e(e){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=e,this._registerListeners()}var t=e.prototype;return t.destroy=function(){this._unregisterListeners()},t._registerListeners=function(){var e=this.hls;e.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},t._unregisterListeners=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},t.onMediaAttached=function(e,t){this.media=t.media},t.onMediaDetaching=function(){this.id3Track&&(Object(n.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null)},t.getID3Track=function(e){if(this.media){for(var t=0;t<e.length;t++){var r=e[t];if("metadata"===r.kind&&"id3"===r.label)return Object(n.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")}},t.onFragParsingMetadata=function(e,t){if(this.media){var r=t.frag,i=t.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<i.length;o++){var a=s.getID3Frames(i[o].data);if(a){var l=i[o].pts,c=o<i.length-1?i[o+1].pts:r.end;c-l<=0&&(c=l+.25);for(var u=0;u<a.length;u++){var h=a[u];if(!s.isTimeStampFrame(h)){var d=new n(l,c,"");d.value=h,this.id3Track.addCue(d)}}}}}},t.onBufferFlushing=function(e,t){var r=t.startOffset,i=t.endOffset,s=t.type;if(!s||"audio"===s){var o=this.id3Track;o&&Object(n.removeCuesInRange)(o,r,i)}},e}();t.default=o},"./src/controller/latency-controller.ts":
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./src/controller/latency-controller.ts ***!
|
|
|
\**********************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return a}));var i=r(/*! ../errors */"./src/errors.ts"),n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts");function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(e){var t=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 t.timeupdate()},this.hls=e,this.config=e.config,this.registerListeners()}var t,r,a,l=e.prototype;return l.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},l.registerListeners=function(){this.hls.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(n.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){this.hls.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(n.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(n.Events.ERROR,this.onError)},l.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},l.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},l.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},l.onLevelUpdated=function(e,t){var r=t.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},l.onError=function(e,t){t.details===i.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,s.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},l.timeupdate=function(){var e=this.media,t=this.levelDetails;if(e&&t){this.currentTime=e.currentTime;var r=this.computeLatency();if(null!==r){this._latency=r;var i=this.config,n=i.lowLatencyMode,s=i.maxLiveSyncPlaybackRate;if(n&&1!==s){var o=this.targetLatency;if(null!==o){var a=r-o,l=a<Math.min(this.maxLatency,o+t.targetduration);if(t.live&&l&&a>.05&&this.forwardBufferLength>1){var c=Math.min(2,Math.max(1,s)),u=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,u))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}},l.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},l.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},t=e,(r=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,r=e.partHoldBack,i=e.targetduration,n=this.config,s=n.liveSyncDuration,o=n.liveSyncDurationCount,a=n.lowLatencyMode,l=this.hls.userConfig,c=a&&r||t;(l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==s?s:o*i);var u=i;return c+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,r=this.levelDetails;if(null===e||null===t||null===r)return null;var i=r.edge,n=e-t-this.edgeStalled,s=i-r.totalduration,o=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(s,n),o)}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var r=e.buffered.length;return r?e.buffered.end(r-1):t.edge-this.currentTime}}])&&o(t.prototype,r),a&&o(t,a),e}()},"./src/controller/level-controller.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/level-controller.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return p}));var i=r(/*! ../types/level */"./src/types/level.ts"),n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../errors */"./src/errors.ts"),o=r(/*! ../utils/codecs */"./src/utils/codecs.ts"),a=r(/*! ./level-helper */"./src/controller/level-helper.ts"),l=r(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),c=r(/*! ../types/loader */"./src/types/loader.ts");function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}function h(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),p=function(e){var t,r;function l(t){var r;return(r=e.call(this,t,"[level-controller]")||this)._levels=[],r._firstLevel=-1,r._startLevel=void 0,r.currentLevelIndex=-1,r.manualLevelIndex=-1,r.onParsedComplete=void 0,r._registerListeners(),r}r=e,(t=l).prototype=Object.create(r.prototype),t.prototype.constructor=t,d(t,r);var p,g,v,m=l.prototype;return m._registerListeners=function(){var e=this.hls;e.on(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(n.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(n.Events.ERROR,this.onError,this)},m._unregisterListeners=function(){var e=this.hls;e.off(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(n.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(n.Events.ERROR,this.onError,this)},m.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},m.startLoad=function(){this._levels.forEach((function(e){e.loadError=0})),e.prototype.startLoad.call(this)},m.onManifestLoaded=function(e,t){var r,l,c=[],u=[],h=[],d={},p=!1,g=!1,v=!1;if(t.levels.forEach((function(e){var t=e.attrs;p=p||!(!e.width||!e.height),g=g||!!e.videoCodec,v=v||!!e.audioCodec,f&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0);var r=e.bitrate+"-"+e.attrs.RESOLUTION+"-"+e.attrs.CODECS;(l=d[r])?l.url.push(e.url):(l=new i.Level(e),d[r]=l,c.push(l)),t&&(t.AUDIO&&Object(a.addGroupId)(l,"audio",t.AUDIO),t.SUBTITLES&&Object(a.addGroupId)(l,"text",t.SUBTITLES))})),(p||g)&&v&&(c=c.filter((function(e){var t=e.videoCodec,r=e.width,i=e.height;return!!t||!(!r||!i)}))),c=c.filter((function(e){var t=e.audioCodec,r=e.videoCodec;return(!t||Object(o.isCodecSupportedInMp4)(t,"audio"))&&(!r||Object(o.isCodecSupportedInMp4)(r,"video"))})),t.audioTracks&&(u=t.audioTracks.filter((function(e){return!e.audioCodec||Object(o.isCodecSupportedInMp4)(e.audioCodec,"audio")})),Object(a.assignTrackIdsByGroup)(u)),t.subtitles&&(h=t.subtitles,Object(a.assignTrackIdsByGroup)(h)),c.length>0){r=c[0].bitrate,c.sort((function(e,t){return e.bitrate-t.bitrate})),this._levels=c;for(var m=0;m<c.length;m++)if(c[m].bitrate===r){this._firstLevel=m,this.log("manifest loaded, "+c.length+" level(s) found, first bitrate: "+r);break}var _=v&&!g,y={levels:c,audioTracks:u,subtitleTracks:h,firstLevel:this._firstLevel,stats:t.stats,audio:v,video:g,altAudio:!_&&u.some((function(e){return!!e.url}))};this.hls.trigger(n.Events.MANIFEST_PARSED,y),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(n.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,reason:"no level with compatible codecs found in manifest"})},m.onError=function(t,r){if(e.prototype.onError.call(this,t,r),!r.fatal){var i=r.context,n=this._levels[this.currentLevelIndex];if(i&&(i.type===c.PlaylistContextType.AUDIO_TRACK&&n.audioGroupIds&&i.groupId===n.audioGroupIds[n.urlId]||i.type===c.PlaylistContextType.SUBTITLE_TRACK&&n.textGroupIds&&i.groupId===n.textGroupIds[n.urlId]))this.redundantFailover(this.currentLevelIndex);else{var o,a=!1,l=!0;switch(r.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:if(r.frag){var u=this._levels[r.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(o=r.frag.level)):o=r.frag.level}break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:i&&(i.deliveryDirectives&&(l=!1),o=i.level),a=!0;break;case s.ErrorDetails.REMUX_ALLOC_ERROR:o=r.level,a=!0}void 0!==o&&this.recoverLevel(r,o,a,l)}}},m.recoverLevel=function(e,t,r,i){var n=e.details,s=this._levels[t];if(s.loadError++,r){if(!this.retryLoadingOrFail(e))return void(this.currentLevelIndex=-1);e.levelRetry=!0}if(i){var o=s.url.length;if(o>1&&s.loadError<o)e.levelRetry=!0,this.redundantFailover(t);else if(-1===this.manualLevelIndex){var a=0===t?this._levels.length-1:t-1;this.currentLevelIndex!==a&&0===this._levels[a].loadError&&(this.warn(n+": switch to "+a),e.levelRetry=!0,this.hls.nextAutoLevel=a)}}},m.redundantFailover=function(e){var t=this._levels[e],r=t.url.length;if(r>1){var i=(t.urlId+1)%r;this.warn("Switching to redundant URL-id "+i),this._levels.forEach((function(e){e.urlId=i})),this.level=e}},m.onFragLoaded=function(e,t){var r=t.frag;if(void 0!==r&&r.type===c.PlaylistLevelType.MAIN){var i=this._levels[r.level];void 0!==i&&(i.fragmentError=0,i.loadError=0)}},m.onLevelLoaded=function(e,t){var r,i,n=t.level,s=t.details,o=this._levels[n];if(!o)return this.warn("Invalid level index "+n),void(null!==(i=t.deliveryDirectives)&&void 0!==i&&i.skip&&(s.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===o.fragmentError&&(o.loadError=0,this.retryCount=0),this.playlistLoaded(n,t,o.details)):null!==(r=t.deliveryDirectives)&&void 0!==r&&r.skip&&(s.deltaUpdateFailed=!0)},m.onAudioTrackSwitched=function(e,t){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var i=-1,n=this.hls.audioTracks[t.id].groupId,s=0;s<r.audioGroupIds.length;s++)if(r.audioGroupIds[s]===n){i=s;break}i!==r.urlId&&(r.urlId=i,this.startLoad())}},m.loadPlaylist=function(e){var t=this.currentLevelIndex,r=this._levels[t];if(this.canLoad&&r&&r.url.length>0){var i=r.urlId,s=r.url[i];if(e)try{s=e.addDirectives(s)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("Attempt loading level index "+t+(e?" at sn "+e.msn+" part "+e.part:"")+" with URL-id "+i+" "+s),this.clearTimer(),this.hls.trigger(n.Events.LEVEL_LOADING,{url:s,level:t,id:i,deliveryDirectives:e||null})}},m.removeLevel=function(e,t){var r=function(e,r){return r!==t},i=this._levels.filter((function(i,n){return n!==e||i.url.length>1&&void 0!==t&&(i.url=i.url.filter(r),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(r)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(r)),i.urlId=0,!0)})).map((function(e,t){var r=e.details;return null!=r&&r.fragments&&r.fragments.forEach((function(e){e.level=t})),e}));this._levels=i,this.hls.trigger(n.Events.LEVELS_UPDATED,{levels:i})},p=l,(g=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==e||null===(t=r[e])||void 0===t||!t.details)){if(e<0||e>=r.length){var i=e<0;if(this.hls.trigger(n.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:i,reason:"invalid level idx"}),i)return;e=Math.min(e,r.length-1)}this.clearTimer();var o=this.currentLevelIndex,a=r[o],l=r[e];this.log("switching to level "+e+" from "+o),this.currentLevelIndex=e;var c=u({},l,{level:e,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete c._urlId,this.hls.trigger(n.Events.LEVEL_SWITCHING,c);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==a?void 0:a.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}])&&h(p.prototype,g),v&&h(p,v),l}(l.default)},"./src/controller/level-helper.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/controller/level-helper.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: addGroupId, assignTrackIdsByGroup, updatePTS, updateFragPTSDTS, mergeDetails, mapPartIntersection, mapFragmentIntersection, adjustSliding, addSliding, computeReloadInterval, getFragmentWithSN, getPartWith */function(e,t,r){"use strict";r.r(t),r.d(t,"addGroupId",(function(){return s})),r.d(t,"assignTrackIdsByGroup",(function(){return o})),r.d(t,"updatePTS",(function(){return a})),r.d(t,"updateFragPTSDTS",(function(){return c})),r.d(t,"mergeDetails",(function(){return u})),r.d(t,"mapPartIntersection",(function(){return h})),r.d(t,"mapFragmentIntersection",(function(){return d})),r.d(t,"adjustSliding",(function(){return f})),r.d(t,"addSliding",(function(){return p})),r.d(t,"computeReloadInterval",(function(){return g})),r.d(t,"getFragmentWithSN",(function(){return v})),r.d(t,"getPartWith",(function(){return m}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../utils/logger */"./src/utils/logger.ts");function s(e,t,r){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(r);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(r)}}function o(e){var t={};e.forEach((function(e){var r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++}))}function a(e,t,r){l(e[t],e[r])}function l(e,t){var r=t.startPTS;if(Object(i.isFiniteNumber)(r)){var n,s=0;t.sn>e.sn?(s=r-e.start,n=e):(s=e.start-r,n=t),n.duration!==s&&(n.duration=s)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function c(e,t,r,s,o,a){s-r<=0&&(n.logger.warn("Fragment should have a positive duration",t),s=r+t.duration,a=o+t.duration);var c=r,u=s,h=t.startPTS,d=t.endPTS;if(Object(i.isFiniteNumber)(h)){var f=Math.abs(h-r);Object(i.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(f,t.deltaPTS):t.deltaPTS=f,c=Math.max(r,h),r=Math.min(r,h),o=Math.min(o,t.startDTS),u=Math.min(s,d),s=Math.max(s,d),a=Math.max(a,t.endDTS)}t.duration=s-r;var p=r-t.start;t.appendedPTS=s,t.start=t.startPTS=r,t.maxStartPTS=c,t.startDTS=o,t.endPTS=s,t.minEndPTS=u,t.endDTS=a;var g,v=t.sn;if(!e||v<e.startSN||v>e.endSN)return 0;var m=v-e.startSN,_=e.fragments;for(_[m]=t,g=m;g>0;g--)l(_[g],_[g-1]);for(g=m;g<_.length-1;g++)l(_[g],_[g+1]);return e.fragmentHint&&l(_[_.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,p}function u(e,t){for(var r=null,s=e.fragments,o=s.length-1;o>=0;o--){var a=s[o].initSegment;if(a){r=a;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var l,u=0;if(d(e,t,(function(e,n){e.relurl&&(u=e.cc-n.cc),Object(i.isFiniteNumber)(e.startPTS)&&Object(i.isFiniteNumber)(e.endPTS)&&(n.start=n.startPTS=e.startPTS,n.startDTS=e.startDTS,n.appendedPTS=e.appendedPTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.duration=e.endPTS-e.startPTS,n.duration&&(l=n),t.PTSKnown=t.alignedSliding=!0),n.elementaryStreams=e.elementaryStreams,n.loader=e.loader,n.stats=e.stats,n.urlId=e.urlId,e.initSegment&&(n.initSegment=e.initSegment,r=e.initSegment)})),r&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){var t;e.initSegment&&e.initSegment.relurl!==(null===(t=r)||void 0===t?void 0:t.relurl)||(e.initSegment=r)})),t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some((function(e){return!e})),t.deltaUpdateFailed)){n.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=t.skippedSegments;p--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var g=t.fragments;if(u){n.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<g.length;v++)g[v].cc+=u}t.skippedSegments&&(t.startCC=t.fragments[0].cc),h(e.partList,t.partList,(function(e,t){t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),l?c(t,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):f(e,t),g.length&&(t.totalduration=t.edge-g[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;var m=t.advancedDateTime;if(t.advanced&&m){var _=t.edge;t.driftStart||(t.driftStartTime=m,t.driftStart=_),t.driftEndTime=m,t.driftEnd=_}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function h(e,t,r){if(e&&t)for(var i=0,n=0,s=e.length;n<=s;n++){var o=e[n],a=t[n+i];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?r(o,a):i--}}function d(e,t,r){for(var i=t.skippedSegments,n=Math.max(e.startSN,t.startSN)-t.startSN,s=(e.fragmentHint?1:0)+(i?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,o=t.startSN-e.startSN,a=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=n;c<=s;c++){var u=l[o+c],h=a[c];i&&!h&&c<i&&(h=t.fragments[c]=u),u&&h&&r(u,h)}}function f(e,t){var r=t.startSN+t.skippedSegments-e.startSN,i=e.fragments;r<0||r>=i.length||p(t,i[r].start)}function p(e,t){if(t){for(var r=e.fragments,i=e.skippedSegments;i<r.length;i++)r[i].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function g(e,t){var r,i=1e3*e.levelTargetDuration,n=i/2,s=e.age,o=s>0&&s<3*i,a=t.loading.end-t.loading.start,l=e.availabilityDelay;if(!1===e.updated)if(o){var c=333*e.misses;r=Math.max(Math.min(n,2*a),c),e.availabilityDelay=(e.availabilityDelay||0)+r}else r=n;else o?(l=Math.min(l||i/2,s),e.availabilityDelay=l,r=l+i-s):r=i-a;return Math.round(r)}function v(e,t,r){if(!e||!e.details)return null;var i=e.details,n=i.fragments[t-i.startSN];return n||((n=i.fragmentHint)&&n.sn===t?n:t<i.startSN&&r&&r.sn===t?r:null)}function m(e,t,r){if(!e||!e.details)return null;var i=e.details.partList;if(i)for(var n=i.length;n--;){var s=i[n];if(s.index===r&&s.fragment.sn===t)return s}return null}},"./src/controller/stream-controller.ts":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/controller/stream-controller.ts ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return _}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),s=r(/*! ../is-supported */"./src/is-supported.ts"),o=r(/*! ../events */"./src/events.ts"),a=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),c=r(/*! ../types/loader */"./src/types/loader.ts"),u=r(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=r(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),d=r(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),f=r(/*! ./gap-controller */"./src/controller/gap-controller.ts"),p=r(/*! ../errors */"./src/errors.ts"),g=r(/*! ../utils/logger */"./src/utils/logger.ts");function v(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _=function(e){var t,r;function _(t,r){var i;return(i=e.call(this,t,r,"[stream-controller]")||this).audioCodecSwap=!1,i.gapController=null,i.level=-1,i._forceStartLoad=!1,i.altAudio=!1,i.audioOnly=!1,i.fragPlaying=null,i.onvplaying=null,i.onvseeked=null,i.fragLastKbps=0,i.stalled=!1,i.couldBacktrack=!1,i.audioCodecSwitch=!1,i.videoBuffer=null,i._registerListeners(),i}r=e,(t=_).prototype=Object.create(r.prototype),t.prototype.constructor=t,m(t,r);var y,b,S,w=_.prototype;return w._registerListeners=function(){var e=this.hls;e.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(o.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(o.Events.ERROR,this.onError,this),e.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var e=this.hls;e.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(o.Events.ERROR,this.onError,this),e.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},w.startLoad=function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var i=r.startLevel;-1===i&&(r.config.testBandwidth?(i=0,this.bitrateTest=!0):i=r.nextAutoLevel),this.level=r.nextLoadLevel=i,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=n.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=n.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_LEVEL:var e,t=this.levels,r=this.level,i=null==t||null===(e=t[r])||void 0===e?void 0:e.details;if(i&&(!i.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(i))break;this.state=n.State.IDLE;break}break;case n.State.FRAG_LOADING_WAITING_RETRY:var s,o=self.performance.now(),a=this.retryDate;(!a||o>=a||null!==(s=this.media)&&void 0!==s&&s.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=n.State.IDLE)}this.onTickEnd()},w.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var e,t,r=this.hls,i=this.levelLastLoaded,s=this.levels,a=this.media,h=r.config,d=r.nextLoadLevel;if(null!==i&&(a||!this.startFragRequested&&h.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&s&&s[d]){var f=s[d];this.level=r.nextLoadLevel=d;var p=f.details;if(!p||this.state===n.State.WAITING_LEVEL||p.live&&this.levelLastLoaded!==d)this.state=n.State.WAITING_LEVEL;else{var g=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:a,c.PlaylistLevelType.MAIN);if(null!==g&&!(g.len>=this.getMaxBufferLength(f.maxBitrate))){if(this._streamEnded(g,p)){var v={};return this.altAudio&&(v.type="video"),this.hls.trigger(o.Events.BUFFER_EOS,v),void(this.state=n.State.ENDED)}var m=g.end,_=this.getNextFragment(m,p);if(this.couldBacktrack&&!this.fragPrevious&&_&&"initSegment"!==_.sn){var y=_.sn-p.startSN;y>1&&(_=p.fragments[y-1],this.fragmentTracker.removeFragment(_))}if(_&&this.fragmentTracker.getState(_)===l.FragmentState.OK&&this.nextLoadPosition>m){var b=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(a,b,c.PlaylistLevelType.MAIN),_=this.getNextFragment(this.nextLoadPosition,p)}_&&(!_.initSegment||_.initSegment.data||this.bitrateTest||(_=_.initSegment),"identity"!==(null===(e=_.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=_.decryptdata)&&void 0!==t&&t.key?this.loadFragment(_,p,m):this.loadKey(_,p))}}}},w.loadFragment=function(t,r,i){var n,s=this.fragmentTracker.getState(t);if(this.fragCurrent=t,s===l.FragmentState.BACKTRACKED){var o=this.fragmentTracker.getBacktrackData(t);if(o)return this._handleFragmentLoadProgress(o),void this._handleFragmentLoadComplete(o);s=l.FragmentState.NOT_LOADED}s===l.FragmentState.NOT_LOADED||s===l.FragmentState.PARTIAL?"initSegment"===t.sn?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,e.prototype.loadFragment.call(this,t,r,i)):s===l.FragmentState.APPENDING?this.reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(e){var t=this.fragmentTracker.getAppendedFrag(e,c.PlaylistLevelType.MAIN);return t&&"fragment"in t?t.fragment:t},w.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,c.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var r,i=this.getAppendedFrag(t.currentTime);if(i&&i.start>1&&this.flushMainBuffer(0,i.start-1),!t.paused&&e){var n=e[this.hls.nextLoadLevel],s=this.fragLastKbps;r=s&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*s)+1:0}else r=0;var o=this.getBufferedFrag(t.currentTime+r);if(o){var a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();var l=a.maxStartPTS?a.maxStartPTS:a.start,c=a.duration,u=Math.max(o.end,l+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,.5*c),.75*c));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var e=this.fragCurrent;this.fragCurrent=null,null!=e&&e.loader&&e.loader.abort(),this.state===n.State.KEY_LOADING&&(this.state=n.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(t,r){e.prototype.flushMainBuffer.call(this,t,r,this.altAudio?"video":null)},w.onMediaAttached=function(t,r){e.prototype.onMediaAttached.call(this,t,r);var i=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,i,this.fragmentTracker,this.hls)},w.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),e.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;Object(i.isFiniteNumber)(t)&&this.log("Media seeked to "+t.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(o.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(e,t){var r,i=!1,n=!1;t.levels.forEach((function(e){(r=e.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(i=!0),-1!==r.indexOf("mp4a.40.5")&&(n=!0))})),this.audioCodecSwitch=i&&n&&!Object(s.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},w.onLevelLoading=function(e,t){var r=this.levels;if(r&&this.state===n.State.IDLE){var i=r[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(i.details))&&(this.state=n.State.WAITING_LEVEL)}},w.onLevelLoaded=function(e,t){var r,i=this.levels,s=t.level,a=t.details,l=a.totalduration;if(i){this.log("Level "+s+" loaded ["+a.startSN+","+a.endSN+"], cc ["+a.startCC+", "+a.endCC+"] duration:"+l);var c=this.fragCurrent;!c||this.state!==n.State.FRAG_LOADING&&this.state!==n.State.FRAG_LOADING_WAITING_RETRY||c.level!==t.level&&c.loader&&(this.state=n.State.IDLE,c.loader.abort());var u=i[s],h=0;if(a.live||null!==(r=u.details)&&void 0!==r&&r.live){if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed)return;h=this.alignPlaylists(a,u.details)}if(u.details=a,this.levelLastLoaded=s,this.hls.trigger(o.Events.LEVEL_UPDATED,{details:a,level:s}),this.state===n.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(a))return;this.state=n.State.IDLE}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,h),this.tick()}else this.warn("Levels were reset while loading level "+s)},w._handleFragmentLoadProgress=function(e){var t,r=e.frag,i=e.part,n=e.payload,s=this.levels;if(s){var o=s[r.level],a=o.details;if(a){var l=o.videoCodec,u=a.PTSKnown||!a.live,f=null===(t=r.initSegment)||void 0===t?void 0:t.data,p=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new h.default(this.hls,c.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),v=i?i.index:-1,m=-1!==v,_=new d.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,n.byteLength,v,m),y=this.initPTS[r.cc];g.push(n,f,p,l,r,i,a.totalduration,u,_,y)}else this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},w.onAudioTrackSwitching=function(e,t){var r=this.altAudio,i=!!t.url,n=t.id;if(!i){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var s=this.fragCurrent;null!=s&&s.loader&&(this.log("Switching to main audio track, cancel main fragment load"),s.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var a=this.hls;r&&a.trigger(o.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:n})}},w.onAudioTrackSwitched=function(e,t){var r=t.id,i=!!this.hls.audioTracks[r].url;if(i){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=i,this.tick()},w.onBufferCreated=function(e,t){var r,i,n=t.tracks,s=!1;for(var o in n){var a=n[o];if("main"===a.id){if(i=o,r=a,"video"===o){var l=n[o];l&&(this.videoBuffer=l.buffer)}}else s=!0}s&&r?(this.log("Alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(e,t){var r=t.frag,i=t.part;if(!r||r.type===c.PlaylistLevelType.MAIN){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===n.State.PARSED&&(this.state=n.State.IDLE));var s=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}},w.onError=function(e,t){switch(t.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:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.MAIN,t);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==n.State.ERROR&&(t.fatal?(this.warn(""+t.details),this.state=n.State.ERROR):t.levelRetry||this.state!==n.State.WAITING_LEVEL||(this.state=n.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if("main"===t.parent&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var r=!0,i=this.getFwdBufferInfo(this.media,c.PlaylistLevelType.MAIN);i&&i.len>.5&&(r=!this.reduceMaxBufferLength(i.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},w.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){var r=a.BufferHelper.getBuffered(e);!this.loadedmetadata&&r.length?(this.loadedmetadata=!0,this.seekToStartPos()):t.poll(this.lastCurrentTime),this.lastCurrentTime=e.currentTime}},w.onFragLoadEmergencyAborted=function(){this.state=n.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(e,t){var r=t.type;if(r!==u.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var i=(r===u.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,r,c.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(e,t){this.levels=t.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var e=this.media,t=e.currentTime,r=this.startPosition;if(r>=0&&t<r){if(e.seeking)return void g.logger.log("could not seek to "+r+", already seeking at "+t);var i=a.BufferHelper.getBuffered(e),n=(i.length?i.start(0):0)-r;n>0&&(n<this.config.maxBufferHole||n<this.config.maxFragLookUpTolerance)&&(g.logger.log("adjusting start position by "+n+" to match buffer start"),r+=n,this.startPosition=r),this.log("seek to target start position "+r+" from current time "+t),e.currentTime=r}},w._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t},w._loadBitrateTestFrag=function(e){var t=this;this._doFragLoad(e).then((function(r){var i=t.hls;if(r&&!i.nextLoadLevel&&!t.fragContextChanged(e)){t.fragLoadError=0,t.state=n.State.IDLE,t.startFragRequested=!1,t.bitrateTest=!1;var s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(o.Events.FRAG_LOADED,r)}}))},w._handleTransmuxComplete=function(e){var t,r="main",s=this.hls,a=e.remuxResult,l=e.chunkMeta,c=this.getCurrentContext(l);if(!c)return this.warn("The loading context changed while buffering fragment "+l.sn+" of level "+l.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(l.level);var h=c.frag,d=c.part,f=c.level,p=a.video,g=a.text,v=a.id3,m=a.initSegment,_=this.altAudio?void 0:a.audio;if(!this.fragContextChanged(h)){if(this.state=n.State.PARSING,m){m.tracks&&(this._bufferInitSegment(f,m.tracks,h,l),s.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:r,tracks:m.tracks}));var y=m.initPTS,b=m.timescale;Object(i.isFiniteNumber)(y)&&(this.initPTS[h.cc]=y,s.trigger(o.Events.INIT_PTS_FOUND,{frag:h,id:r,initPTS:y,timescale:b}))}if(p&&!1!==a.independent){if(f.details){var S=p.startPTS,w=p.endPTS,C=p.startDTS,E=p.endDTS;if(d)d.elementaryStreams[p.type]={startPTS:S,endPTS:w,startDTS:C,endDTS:E};else if(p.firstKeyFrame&&p.independent&&(this.couldBacktrack=!0),p.dropped&&p.independent){if(this.getLoadPosition()+this.config.maxBufferHole<S)return void this.backtrack(h);h.setElementaryStreamInfo(p.type,h.start,w,h.start,E,!0)}h.setElementaryStreamInfo(p.type,S,w,C,E),this.bufferFragmentData(p,h,d,l)}}else if(!1===a.independent)return void this.backtrack(h);if(_){var k=_.startPTS,x=_.endPTS,T=_.startDTS,L=_.endDTS;d&&(d.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:k,endPTS:x,startDTS:T,endDTS:L}),h.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,k,x,T,L),this.bufferFragmentData(_,h,d,l)}if(null!=v&&null!==(t=v.samples)&&void 0!==t&&t.length){var A={frag:h,id:r,samples:v.samples};s.trigger(o.Events.FRAG_PARSING_METADATA,A)}if(g){var D={frag:h,id:r,samples:g.samples};s.trigger(o.Events.FRAG_PARSING_USERDATA,D)}}},w._bufferInitSegment=function(e,t,r,i){var s=this;if(this.state===n.State.PARSING){this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;var a=t.audio,l=t.video,c=t.audiovideo;if(a){var u=e.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==a.metadata.channelCount&&-1===h.indexOf("firefox")&&(u="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==a.container&&(u="mp4a.40.2",this.log("Android: force audio codec to "+u)),e.audioCodec&&e.audioCodec!==u&&this.log('Swapping manifest audio codec "'+e.audioCodec+'" for "'+u+'"'),a.levelCodec=u,a.id="main",this.log("Init audio buffer, container:"+a.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(e.audioCodec||"")+"/"+a.codec+"]")}l&&(l.levelCodec=e.videoCodec,l.id="main",this.log("Init video buffer, container:"+l.container+", codecs[level/parsed]=["+(e.videoCodec||"")+"/"+l.codec+"]")),c&&this.log("Init audiovideo buffer, container:"+c.container+", codecs[level/parsed]=["+(e.attrs.CODECS||"")+"/"+c.codec+"]"),this.hls.trigger(o.Events.BUFFER_CODECS,t),Object.keys(t).forEach((function(e){var n=t[e].initSegment;null!=n&&n.byteLength&&s.hls.trigger(o.Events.BUFFER_APPENDING,{type:e,data:n,frag:r,part:null,chunkMeta:i,parent:r.type})})),this.tick()}},w.backtrack=function(e){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(e);var t=this.fragmentTracker.backtrack(e);this.fragPrevious=null,this.nextLoadPosition=e.start,t?this.resetFragmentLoading(e):this.state=n.State.BACKTRACKING},w.checkFragmentChanged=function(){var e=this.media,t=null;if(e&&e.readyState>1&&!1===e.seeking){var r=e.currentTime;if(a.BufferHelper.isBuffered(e,r)?t=this.getAppendedFrag(r):a.BufferHelper.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){var i=this.fragPlaying,n=t.level;i&&t.sn===i.sn&&i.level===n&&t.urlId===i.urlId||(this.hls.trigger(o.Events.FRAG_CHANGED,{frag:t}),i&&i.level===n||this.hls.trigger(o.Events.LEVEL_SWITCHED,{level:n}),this.fragPlaying=t)}}},y=_,(b=[{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getAppendedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;if(e){var t=this.getAppendedFrag(e.currentTime);return this.followingBufferedFrag(t)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&v(y.prototype,b),S&&v(y,S),_}(n.default)},"./src/controller/subtitle-stream-controller.ts":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/controller/subtitle-stream-controller.ts ***!
|
|
|
\******************************************************/
|
|
|
/*! exports provided: SubtitleStreamController */function(e,t,r){"use strict";r.r(t),r.d(t,"SubtitleStreamController",(function(){return g}));var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../utils/logger */"./src/utils/logger.ts"),s=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),o=r(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),a=r(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),l=r(/*! ./level-helper */"./src/controller/level-helper.ts"),c=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),u=r(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),h=r(/*! ../types/loader */"./src/types/loader.ts"),d=r(/*! ../types/level */"./src/types/level.ts");function f(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g=function(e){var t,r;function g(t,r){var i;return(i=e.call(this,t,r,"[subtitle-stream-controller]")||this).levels=[],i.currentTrackId=-1,i.tracksBuffered=[],i.mainDetails=null,i._registerListeners(),i}r=e,(t=g).prototype=Object.create(r.prototype),t.prototype.constructor=t,p(t,r);var v,m,_,y=g.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var e=this.hls;e.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(i.Events.ERROR,this.onError,this),e.on(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(i.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(i.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y._unregisterListeners=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(i.Events.ERROR,this.onError,this),e.off(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(i.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(i.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y.startLoad=function(){this.stopLoad(),this.state=u.State.IDLE,this.setInterval(500),this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},y.onLevelLoaded=function(e,t){this.mainDetails=t.details},y.onSubtitleFragProcessed=function(e,t){var r=t.frag,i=t.success;if(this.fragPrevious=r,this.state=u.State.IDLE,i){var n=this.tracksBuffered[this.currentTrackId];if(n){for(var s,o=r.start,a=0;a<n.length;a++)if(o>=n[a].start&&o<=n[a].end){s=n[a];break}var l=r.start+r.duration;s?s.end=l:(s={start:o,end:l},n.push(s)),this.fragmentTracker.fragBuffered(r)}}},y.onBufferFlushing=function(e,t){var r=t.startOffset,i=t.endOffset;if(0===r&&i!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,s=this.levels;if(!s.length||!s[n]||!s[n].details)return;var o=i-s[n].details.targetduration;if(o<=0)return;t.endOffsetSubtitles=Math.max(0,o),this.tracksBuffered.forEach((function(e){for(var t=0;t<e.length;)if(e[t].end<=o)e.shift();else{if(!(e[t].start<o))break;e[t].start=o,t++}})),this.fragmentTracker.removeFragmentsInRange(r,o,h.PlaylistLevelType.SUBTITLE)}},y.onError=function(e,t){var r,i=t.frag;i&&i.type===h.PlaylistLevelType.SUBTITLE&&(null!==(r=this.fragCurrent)&&void 0!==r&&r.loader&&this.fragCurrent.loader.abort(),this.state=u.State.IDLE)},y.onSubtitleTracksUpdated=function(e,t){var r=this,i=t.subtitleTracks;this.tracksBuffered=[],this.levels=i.map((function(e){return new d.Level(e)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(e){r.tracksBuffered[e.id]=[]})),this.mediaBuffer=null},y.onSubtitleTrackSwitch=function(e,t){if(this.currentTrackId=t.id,this.levels.length&&-1!==this.currentTrackId){var r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)}else this.clearInterval()},y.onSubtitleTrackLoaded=function(e,t){var r,i=t.details,n=t.id,s=this.currentTrackId,c=this.levels;if(c.length){var h=c[s];if(!(n>=c.length||n!==s)&&h){if(this.mediaBuffer=this.mediaBufferTimeRanges,i.live||null!==(r=h.details)&&void 0!==r&&r.live){var d=this.mainDetails;if(i.deltaUpdateFailed||!d)return;var f=d.fragments[0];h.details?0===this.alignPlaylists(i,h.details)&&f&&Object(l.addSliding)(i,f.start):i.hasProgramDateTime&&d.hasProgramDateTime?Object(a.alignMediaPlaylistByPDT)(i,d):f&&Object(l.addSliding)(i,f.start)}h.details=i,this.levelLastLoaded=n,this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE&&(Object(o.findFragmentByPTS)(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0))}}},y._handleFragmentLoadComplete=function(e){var t=e.frag,r=e.payload,n=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).then((function(e){var r=performance.now();s.trigger(i.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:r}})}))}},y.doTick=function(){if(this.media){if(this.state===u.State.IDLE){var e,t=this.currentTrackId,r=this.levels;if(!r.length||!r[t]||!r[t].details)return;var a=r[t].details,l=a.targetduration,h=this.config,d=this.media,f=s.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,d.currentTime-l,h.maxBufferHole),p=f.end;if(f.len>this.getMaxBufferLength()+l)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var g,v=a.fragments,m=v.length,_=a.edge,y=this.fragPrevious;if(p<_){var b=h.maxFragLookUpTolerance;y&&a.hasProgramDateTime&&(g=Object(o.findFragmentByPDT)(v,y.endProgramDateTime,b)),g||!(g=Object(o.findFragmentByPTS)(y,v,p,b))&&y&&y.start<v[0].start&&(g=v[0])}else g=v[m-1];null!==(e=g)&&void 0!==e&&e.encrypted?(n.logger.log("Loading key for "+g.sn),this.state=u.State.KEY_LOADING,this.hls.trigger(i.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===c.FragmentState.NOT_LOADED&&this.loadFragment(g,a,p)}}else this.state=u.State.IDLE},y.loadFragment=function(t,r,i){this.fragCurrent=t,e.prototype.loadFragment.call(this,t,r,i)},v=g,(m=[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}])&&f(v.prototype,m),_&&f(v,_),g}(u.default)},"./src/controller/subtitle-track-controller.ts":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./src/controller/subtitle-track-controller.ts ***!
|
|
|
\*****************************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),s=r(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),o=r(/*! ../types/loader */"./src/types/loader.ts");function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,r;function s(t){var r;return(r=e.call(this,t,"[subtitle-track-controller]")||this).media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}r=e,(t=s).prototype=Object.create(r.prototype),t.prototype.constructor=t,l(t,r);var c,h,d,f=s.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,e.prototype.destroy.call(this)},f.registerListeners=function(){var e=this.hls;e.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(i.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(i.Events.ERROR,this.onError,this)},f.onMediaAttached=function(e,t){this.media=t.media,this.media&&(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))},f.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},f.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),u(this.media.textTracks).forEach((function(e){Object(n.clearCurrentCues)(e)})),this.subtitleTrack=-1,this.media=null)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},f.onSubtitleTrackLoaded=function(e,t){var r=t.id,i=t.details,n=this.trackId,s=this.tracksInGroup[n];if(s){var o=s.details;s.details=t.details,this.log("subtitle track "+r+" loaded ["+i.startSN+"-"+i.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,t,o))}else this.warn("Invalid subtitle track id "+r)},f.onLevelLoading=function(e,t){this.switchLevel(t.level)},f.onLevelSwitching=function(e,t){this.switchLevel(t.level)},f.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var r=t.textGroupIds[t.urlId];if(this.groupId!==r){var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,s=this.tracks.filter((function(e){return!r||e.groupId===r}));this.tracksInGroup=s;var o=this.findTrackId(null==n?void 0:n.name)||this.findTrackId();this.groupId=r;var a={subtitleTracks:s};this.log("Updating subtitle tracks, "+s.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(i.Events.SUBTITLE_TRACKS_UPDATED,a),-1!==o&&this.setSubtitleTrack(o,n)}}},f.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r<t.length;r++){var i=t[r];if((!this.selectDefaultTrack||i.default)&&(!e||e===i.name))return i.id}return-1},f.onError=function(t,r){e.prototype.onError.call(this,t,r),!r.fatal&&r.context&&r.context.type===o.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},f.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var r=t.id,n=t.groupId,s=t.url;if(e)try{s=e.addDirectives(s)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("Loading subtitle playlist for id "+r),this.hls.trigger(i.Events.SUBTITLE_TRACK_LOADING,{url:s,id:r,groupId:n,deliveryDirectives:e||null})}},f.toggleTrackModes=function(e){var t=this,r=this.media,i=this.subtitleDisplay,n=this.trackId;if(r){var s=u(r.textTracks),o=s.filter((function(e){return e.groupId===t.groupId}));if(-1===e)[].slice.call(s).forEach((function(e){e.mode="disabled"}));else{var a=o[n];a&&(a.mode="disabled")}var l=o[e];l&&(l.mode=i?"showing":"hidden")}},f.setSubtitleTrack=function(e,t){var r,n=this.tracksInGroup;if(this.media){if(this.trackId!==e&&this.toggleTrackModes(e),!(this.trackId===e&&(-1===e||null!==(r=n[e])&&void 0!==r&&r.details)||e<-1||e>=n.length)){this.clearTimer();var s=n[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,s){var o=s.id,a=s.groupId,l=void 0===a?"":a,c=s.name,u=s.type,h=s.url;this.hls.trigger(i.Events.SUBTITLE_TRACK_SWITCH,{id:o,groupId:l,name:c,type:u,url:h});var d=this.switchParams(s.url,null==t?void 0:t.details);this.loadPlaylist(d)}else this.hls.trigger(i.Events.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=u(this.media.textTracks),r=0;r<t.length;r++)if("hidden"===t[r].mode)e=r;else if("showing"===t[r].mode){e=r;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}},c=s,(h=[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}])&&a(c.prototype,h),d&&a(c,d),s}(s.default);function u(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];"subtitles"===i.kind&&i.label&&t.push(e[r])}return t}t.default=c},"./src/controller/timeline-controller.ts":
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/controller/timeline-controller.ts ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: TimelineController */function(e,t,r){"use strict";r.r(t),r.d(t,"TimelineController",(function(){return d}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../utils/cea-608-parser */"./src/utils/cea-608-parser.ts"),o=r(/*! ../utils/output-filter */"./src/utils/output-filter.ts"),a=r(/*! ../utils/webvtt-parser */"./src/utils/webvtt-parser.ts"),l=r(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),c=r(/*! ../utils/imsc1-ttml-parser */"./src/utils/imsc1-ttml-parser.ts"),u=r(/*! ../types/loader */"./src/types/loader.ts"),h=r(/*! ../utils/logger */"./src/utils/logger.ts"),d=function(){function e(e){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={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.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 t=new o.default(this,"textTrack1"),r=new o.default(this,"textTrack2"),i=new o.default(this,"textTrack3"),a=new o.default(this,"textTrack4");this.cea608Parser1=new s.default(1,t,r),this.cea608Parser2=new s.default(3,i,a)}e.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(n.Events.FRAG_LOADING,this.onFragLoading,this),e.on(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(n.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(n.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(n.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(n.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(n.Events.FRAG_LOADING,this.onFragLoading,this),e.off(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(n.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(n.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(n.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(n.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(e,t,r,i,s){for(var o,a,l,c,u=!1,h=s.length;h--;){var d=s[h],f=(o=d[0],a=d[1],l=t,c=r,Math.min(a,c)-Math.max(o,l));if(f>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],r),u=!0,f/(r-t)>.5))return}if(u||s.push([t,r]),this.config.renderTextTracksNatively){var p=this.captionsTracks[e];this.Cues.newCue(p,t,r,i)}else{var g=this.Cues.newCue(null,t,r,i);this.hls.trigger(n.Events.CUES_PARSED,{type:"captions",cues:g,track:e})}},t.onInitPtsFound=function(e,t){var r=this,i=t.frag,s=t.id,o=t.initPTS,a=t.timescale,l=this.unparsedVttFrags;"main"===s&&(this.initPTS[i.cc]=o,this.timescale[i.cc]=a),l.length&&(this.unparsedVttFrags=[],l.forEach((function(e){r.onFragLoaded(n.Events.FRAG_LOADED,e)})))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var r=0;r<t.textTracks.length;r++){var i=t.textTracks[r];if(i[e])return i}return null},t.createCaptionsTrack=function(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)},t.createNativeTrack=function(e){if(!this.captionsTracks[e]){var t=this.captionsProperties,r=this.captionsTracks,i=this.media,n=t[e],s=n.label,o=n.languageCode,a=this.getExistingTrack(e);if(a)r[e]=a,Object(l.clearCurrentCues)(r[e]),Object(l.sendAddTrackEvent)(r[e],i);else{var c=this.createTextTrack("captions",s,o);c&&(c[e]=!0,r[e]=c)}}},t.createNonNativeTrack=function(e){if(!this.nonNativeCaptionsTracks[e]){var t=this.captionsProperties[e];if(t){var r={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(n.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}}},t.createTextTrack=function(e,t,r){var i=this.media;if(i)return i.addTextTrack(e,t,r)},t.onMediaAttaching=function(e,t){this.media=t.media,this._cleanTracks()},t.onMediaDetaching=function(){var e=this.captionsTracks;Object.keys(e).forEach((function(t){Object(l.clearCurrentCues)(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},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())},t._cleanTracks=function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var r=0;r<t.length;r++)Object(l.clearCurrentCues)(t[r])}},t.onSubtitleTracksUpdated=function(e,t){var r=this;this.textTracks=[];var i=t.subtitleTracks||[],s=i.some((function(e){return e.textCodec===c.IMSC1_CODEC}));if(this.config.enableWebVTT||s&&this.config.enableIMSC1){var o=this.tracks&&i&&this.tracks.length===i.length;if(this.tracks=i||[],this.config.renderTextTracksNatively){var a=this.media?this.media.textTracks:[];this.tracks.forEach((function(e,t){var i;if(t<a.length){for(var n=null,s=0;s<a.length;s++)if(f(a[s],e)){n=a[s];break}n&&(i=n)}i?Object(l.clearCurrentCues)(i):(i=r.createTextTrack("subtitles",e.name,e.lang))&&(i.mode="disabled"),i&&(i.groupId=e.groupId,r.textTracks.push(i))}))}else if(!o&&this.tracks&&this.tracks.length){var u=this.tracks.map((function(e){return{label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}}));this.hls.trigger(n.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},t.onManifestLoaded=function(e,t){var r=this;this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((function(e){var t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(t){var i="textTrack"+t[1],n=r.captionsProperties[i];n&&(n.label=e.name,e.lang&&(n.languageCode=e.lang),n.media=e)}}))},t.onFragLoading=function(e,t){var r=this.cea608Parser1,i=this.cea608Parser2,n=this.lastSn,s=this.lastPartIndex;if(this.enabled&&r&&i&&t.frag.type===u.PlaylistLevelType.MAIN){var o,a,l=t.frag.sn,c=null!=(o=null==t||null===(a=t.part)||void 0===a?void 0:a.index)?o:-1;l===n+1||l===n&&c===s+1||(r.reset(),i.reset()),this.lastSn=l,this.lastPartIndex=c}},t.onFragLoaded=function(e,t){var r=t.frag,s=t.payload,o=this.initPTS,a=this.unparsedVttFrags;if(r.type===u.PlaylistLevelType.SUBTITLE)if(s.byteLength){if(!Object(i.isFiniteNumber)(o[r.cc]))return a.push(t),void(o.length&&this.hls.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Missing initial subtitle PTS")}));var l=r.decryptdata;if(null==l||null==l.key||"AES-128"!==l.method){var h=this.tracks[r.level],d=this.vttCCs;d[r.cc]||(d[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),h&&h.textCodec===c.IMSC1_CODEC?this._parseIMSC1(r,s):this._parseVTTs(r,s,d)}}else this.hls.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(e,t){var r=this,i=this.hls;Object(c.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],(function(t){r._appendCues(t,e.level),i.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(t){h.logger.log("Failed to parse IMSC1: "+t),i.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))},t._parseVTTs=function(e,t,r){var i=this,s=this.hls;Object(a.parseWebVTT)(t,this.initPTS[e.cc],this.timescale[e.cc],r,e.cc,e.start,(function(t){i._appendCues(t,e.level),s.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(r){i._fallbackToIMSC1(e,t),h.logger.log("Failed to parse VTT cue: "+r),s.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})}))},t._fallbackToIMSC1=function(e,t){var r=this,i=this.tracks[e.level];i.textCodec||Object(c.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],(function(){i.textCodec=c.IMSC1_CODEC,r._parseIMSC1(e,t)}),(function(){i.textCodec="wvtt"}))},t._appendCues=function(e,t){var r=this.hls;if(this.config.renderTextTracksNatively){var i=this.textTracks[t];if("disabled"===i.mode)return;e.forEach((function(e){return Object(l.addCueToTrack)(i,e)}))}else{var s=this.tracks[t].default?"default":"subtitles"+t;r.trigger(n.Events.CUES_PARSED,{type:"subtitles",cues:e,track:s})}},t.onFragDecrypted=function(e,t){var r=t.frag;if(r.type===u.PlaylistLevelType.SUBTITLE){if(!Object(i.isFiniteNumber)(this.initPTS[r.cc]))return void this.unparsedVttFrags.push(t);this.onFragLoaded(n.Events.FRAG_LOADED,t)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){var r=this.cea608Parser1,i=this.cea608Parser2;if(this.enabled&&r&&i)for(var n=0;n<t.samples.length;n++){var s=t.samples[n].bytes;if(s){var o=this.extractCea608Data(s);r.addData(t.samples[n].pts,o[0]),i.addData(t.samples[n].pts,o[1])}}},t.onBufferFlushing=function(e,t){var r=t.startOffset,i=t.endOffset,n=t.endOffsetSubtitles,s=t.type,o=this.media;if(o&&!(o.currentTime<i)){if(!s||"video"===s){var a=this.captionsTracks;Object.keys(a).forEach((function(e){return Object(l.removeCuesInRange)(a[e],r,i)}))}if(this.config.renderTextTracksNatively&&0===r&&void 0!==n){var c=this.textTracks;Object.keys(c).forEach((function(e){return Object(l.removeCuesInRange)(c[e],r,n)}))}}},t.extractCea608Data=function(e){for(var t=31&e[0],r=2,i=[[],[]],n=0;n<t;n++){var s=e[r++],o=127&e[r++],a=127&e[r++],l=3&s;0===o&&0===a||0!=(4&s)&&(0!==l&&1!==l||(i[l].push(o),i[l].push(a)))}return i},e}();function f(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}},"./src/crypt/aes-crypto.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/crypt/aes-crypto.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var i=function(){function e(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}return e.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}()},"./src/crypt/aes-decryptor.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/crypt/aes-decryptor.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: removePadding, default */function(e,t,r){"use strict";r.r(t),r.d(t,"removePadding",(function(){return n})),r.d(t,"default",(function(){return s}));var i=r(/*! ../utils/typed-array */"./src/utils/typed-array.ts");function n(e){var t=e.byteLength,r=t&&new DataView(e.buffer).getUint8(t-1);return r?Object(i.sliceUint8)(e,0,t-r):e}var s=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 t=e.prototype;return t.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),i=0;i<4;i++)r[i]=t.getUint32(4*i);return r},t.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,i=r[0],n=r[1],s=r[2],o=r[3],a=this.invSubMix,l=a[0],c=a[1],u=a[2],h=a[3],d=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)d[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var v=p^p<<1^p<<2^p<<3^p<<4;v=v>>>8^255&v^99,e[f]=v,t[v]=f;var m=d[f],_=d[m],y=d[_],b=257*d[v]^16843008*v;i[f]=b<<24|b>>>8,n[f]=b<<16|b>>>16,s[f]=b<<8|b>>>24,o[f]=b,b=16843009*y^65537*_^257*m^16843008*f,l[v]=b<<24|b>>>8,c[v]=b<<16|b>>>16,u[v]=b<<8|b>>>24,h[v]=b,f?(f=m^d[d[d[y^m]]],p^=d[d[p]]):f=p=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,i=0;i<t.length&&r;)r=t[i]===this.key[i],i++;if(!r){this.key=t;var n=this.keySize=t.length;if(4!==n&&6!==n&&8!==n)throw new Error("Invalid aes key size="+n);var s,o,a,l,c=this.ksRows=4*(n+6+1),u=this.keySchedule=new Uint32Array(c),h=this.invKeySchedule=new Uint32Array(c),d=this.sBox,f=this.rcon,p=this.invSubMix,g=p[0],v=p[1],m=p[2],_=p[3];for(s=0;s<c;s++)s<n?a=u[s]=t[s]:(l=a,s%n==0?(l=d[(l=l<<8|l>>>24)>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l],l^=f[s/n|0]<<24):n>6&&s%n==4&&(l=d[l>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l]),u[s]=a=(u[s-n]^l)>>>0);for(o=0;o<c;o++)s=c-o,l=3&o?u[s]:u[s-4],h[o]=o<4||s<=4?l:g[d[l>>>24]]^v[d[l>>>16&255]]^m[d[l>>>8&255]]^_[d[255&l]],h[o]=h[o]>>>0}},t.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},t.decrypt=function(e,t,r){for(var i,n,s,o,a,l,c,u,h,d,f,p,g,v,m=this.keySize+6,_=this.invKeySchedule,y=this.invSBox,b=this.invSubMix,S=b[0],w=b[1],C=b[2],E=b[3],k=this.uint8ArrayToUint32Array_(r),x=k[0],T=k[1],L=k[2],A=k[3],D=new Int32Array(e),O=new Int32Array(D.length),R=this.networkToHostOrderSwap;t<D.length;){for(h=R(D[t]),d=R(D[t+1]),f=R(D[t+2]),p=R(D[t+3]),a=h^_[0],l=p^_[1],c=f^_[2],u=d^_[3],g=4,v=1;v<m;v++)i=S[a>>>24]^w[l>>16&255]^C[c>>8&255]^E[255&u]^_[g],n=S[l>>>24]^w[c>>16&255]^C[u>>8&255]^E[255&a]^_[g+1],s=S[c>>>24]^w[u>>16&255]^C[a>>8&255]^E[255&l]^_[g+2],o=S[u>>>24]^w[a>>16&255]^C[l>>8&255]^E[255&c]^_[g+3],a=i,l=n,c=s,u=o,g+=4;i=y[a>>>24]<<24^y[l>>16&255]<<16^y[c>>8&255]<<8^y[255&u]^_[g],n=y[l>>>24]<<24^y[c>>16&255]<<16^y[u>>8&255]<<8^y[255&a]^_[g+1],s=y[c>>>24]<<24^y[u>>16&255]<<16^y[a>>8&255]<<8^y[255&l]^_[g+2],o=y[u>>>24]<<24^y[a>>16&255]<<16^y[l>>8&255]<<8^y[255&c]^_[g+3],O[t]=R(i^x),O[t+1]=R(o^T),O[t+2]=R(s^L),O[t+3]=R(n^A),x=h,T=d,L=f,A=p,t+=4}return O.buffer},e}()},"./src/crypt/decrypter.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/crypt/decrypter.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return c}));var i=r(/*! ./aes-crypto */"./src/crypt/aes-crypto.ts"),n=r(/*! ./fast-aes-key */"./src/crypt/fast-aes-key.ts"),s=r(/*! ./aes-decryptor */"./src/crypt/aes-decryptor.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=r(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),c=function(){function e(e,t,r){var i=(void 0===r?{}:r).removePKCS7Padding,n=void 0===i||i;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=e,this.config=t,this.removePKCS7Padding=n,n)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(e){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var t=e.prototype;return t.destroy=function(){this.observer=null},t.isSync=function(){return this.config.enableSoftwareAES},t.flush=function(){var e=this.currentResult;if(e){var t=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Object(s.removePadding)(t):t}this.reset()},t.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(e,t,r,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(e),t,r);var n=this.flush();n&&i(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(e),t,r).then(i)},t.softwareDecrypt=function(e,t,r){var i=this.currentIV,n=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(e=Object(a.appendUint8Array)(o,e),this.remainderData=null);var c=this.getValidChunk(e);if(!c.length)return null;i&&(r=i);var u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new s.default),u.expandKey(t);var h=n;return this.currentResult=u.decrypt(c.buffer,0,r),this.currentIV=Object(l.sliceUint8)(c,-16).buffer,h||null},t.webCryptoDecrypt=function(e,t,r){var s=this,o=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new n.default(o,t)),this.fastAesKey.expandKey().then((function(t){return o?new i.default(o,r).decrypt(e.buffer,t):Promise.reject(new Error("web crypto not initialized"))})).catch((function(i){return s.onWebCryptoError(i,e,t,r)}))},t.onWebCryptoError=function(e,t,r,i){return o.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",e),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(t,r,i)},t.getValidChunk=function(e){var t=e,r=e.length-e.length%16;return r!==e.length&&(t=Object(l.sliceUint8)(e,0,r),this.remainderData=Object(l.sliceUint8)(e,r)),t},t.logOnce=function(e){this.logEnabled&&(o.logger.log("[decrypter.ts]: "+e),this.logEnabled=!1)},e}()},"./src/crypt/fast-aes-key.ts":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/crypt/fast-aes-key.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var i=function(){function e(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}return e.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}()},"./src/demux/aacdemuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/aacdemuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),n=r(/*! ./adts */"./src/demux/adts.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=r(/*! ../demux/id3 */"./src/demux/id3.ts");function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){var t,r;function i(t,r){var i;return(i=e.call(this)||this).observer=void 0,i.config=void 0,i.observer=t,i.config=r,i}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,a(t,r);var l=i.prototype;return l.resetInitSegment=function(t,r,i){e.prototype.resetInitSegment.call(this,t,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}},i.probe=function(e){if(!e)return!1;for(var t=(o.getID3Data(e,0)||[]).length,r=e.length;t<r;t++)if(n.probe(e,t))return s.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(e,t){return n.canParse(e,t)},l.appendFrame=function(e,t,r){n.initTrackConfig(e,this.observer,t,r,e.manifestCodec);var i=n.appendFrame(e,t,r,this.initPTS,this.frameIndex);if(i&&0===i.missing)return i},i}(i.default);l.minProbeByteLength=9,t.default=l},"./src/demux/adts.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/demux/adts.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: getAudioConfig, isHeaderPattern, getHeaderLength, getFullFrameLength, canGetFrameLength, isHeader, canParse, probe, initTrackConfig, getFrameDuration, parseFrameHeader, appendFrame */function(e,t,r){"use strict";r.r(t),r.d(t,"getAudioConfig",(function(){return o})),r.d(t,"isHeaderPattern",(function(){return a})),r.d(t,"getHeaderLength",(function(){return l})),r.d(t,"getFullFrameLength",(function(){return c})),r.d(t,"canGetFrameLength",(function(){return u})),r.d(t,"isHeader",(function(){return h})),r.d(t,"canParse",(function(){return d})),r.d(t,"probe",(function(){return f})),r.d(t,"initTrackConfig",(function(){return p})),r.d(t,"getFrameDuration",(function(){return g})),r.d(t,"parseFrameHeader",(function(){return v})),r.d(t,"appendFrame",(function(){return m}));var i=r(/*! ../utils/logger */"./src/utils/logger.ts"),n=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ../events */"./src/events.ts");function o(e,t,r,o){var a,l,c,u,h=navigator.userAgent.toLowerCase(),d=o,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];a=1+((192&t[r+2])>>>6);var p=(60&t[r+2])>>>2;if(!(p>f.length-1))return c=(1&t[r+2])<<2,c|=(192&t[r+3])>>>6,i.logger.log("manifest codec:"+o+", ADTS type:"+a+", samplingIndex:"+p),/firefox/i.test(h)?p>=6?(a=5,u=new Array(4),l=p-3):(a=2,u=new Array(2),l=p):-1!==h.indexOf("android")?(a=2,u=new Array(2),l=p):(a=5,u=new Array(4),o&&(-1!==o.indexOf("mp4a.40.29")||-1!==o.indexOf("mp4a.40.5"))||!o&&p>=6?l=p-3:((o&&-1!==o.indexOf("mp4a.40.2")&&(p>=6&&1===c||/vivaldi/i.test(h))||!o&&1===c)&&(a=2,u=new Array(2)),l=p)),u[0]=a<<3,u[0]|=(14&p)>>1,u[1]|=(1&p)<<7,u[1]|=c<<3,5===a&&(u[1]|=(14&l)>>1,u[2]=(1&l)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:f[p],channelCount:c,codec:"mp4a.40."+a,manifestCodec:d};e.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+p})}function a(e,t){return 255===e[t]&&240==(246&e[t+1])}function l(e,t){return 1&e[t+1]?7:9}function c(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function u(e,t){return t+5<e.length}function h(e,t){return t+1<e.length&&a(e,t)}function d(e,t){return u(e,t)&&a(e,t)&&c(e,t)<=e.length-t}function f(e,t){if(h(e,t)){var r=l(e,t);if(t+r>=e.length)return!1;var i=c(e,t);if(i<=r)return!1;var n=t+i;return n===e.length||h(e,n)}return!1}function p(e,t,r,n,s){if(!e.samplerate){var a=o(t,r,n,s);if(!a)return;e.config=a.config,e.samplerate=a.samplerate,e.channelCount=a.channelCount,e.codec=a.codec,e.manifestCodec=a.manifestCodec,i.logger.log("parsed codec:"+e.codec+", rate:"+a.samplerate+", channels:"+a.channelCount)}}function g(e){return 9216e4/e}function v(e,t,r,i,n){var s=l(e,t),o=c(e,t);if((o-=s)>0)return{headerLength:s,frameLength:o,stamp:r+i*n}}function m(e,t,r,i,n){var s=v(t,r,i,n,g(e.samplerate));if(s){var o,a=s.frameLength,l=s.headerLength,c=s.stamp,u=l+a,h=Math.max(0,r+u-t.length);h?(o=new Uint8Array(u-l)).set(t.subarray(r+l,t.length),0):o=t.subarray(r+l,r+u);var d={unit:o,pts:c};return h||e.samples.push(d),{sample:d,length:u,missing:h}}}},"./src/demux/base-audio-demuxer.ts":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/demux/base-audio-demuxer.ts ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: initPTSFn, default */function(e,t,r){"use strict";r.r(t),r.d(t,"initPTSFn",(function(){return c}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../demux/id3 */"./src/demux/id3.ts"),s=r(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),o=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),a=r(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),l=function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(){},t.resetContiguity=function(){},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,r){},t.demux=function(e,t){this.cachedData&&(e=Object(o.appendUint8Array)(this.cachedData,e),this.cachedData=null);var r,i,l=n.getID3Data(e,0),u=l?l.length:0,h=this._audioTrack,d=this._id3Track,f=l?n.getTimeStamp(l):void 0,p=e.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=c(f,t)),l&&l.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),i=this.initPTS;u<p;){if(this.canParse(e,u)){var g=this.appendFrame(h,e,u);g?(this.frameIndex++,i=g.sample.pts,r=u+=g.length):u=p}else n.canParse(e,u)?(l=n.getID3Data(e,u),d.samples.push({pts:i,dts:i,data:l}),r=u+=l.length):u++;if(u===p&&r!==p){var v=Object(a.sliceUint8)(e,r);this.cachedData?this.cachedData=Object(o.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:h,avcTrack:Object(s.dummyTrack)(),id3Track:d,textTrack:Object(s.dummyTrack)()}},t.demuxSampleAes=function(e,t,r){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},t.flush=function(e){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(s.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(s.dummyTrack)()}},t.destroy=function(){},e}(),c=function(e,t){return Object(i.isFiniteNumber)(e)?90*e:9e4*t};t.default=l},"./src/demux/chunk-cache.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/demux/chunk-cache.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var i=function(){function e(){this.chunks=[],this.dataLength=0}var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e,t=this.chunks,r=this.dataLength;return t.length?(e=1===t.length?t[0]:function(e,t){for(var r=new Uint8Array(t),i=0,n=0;n<e.length;n++){var s=e[n];r.set(s,i),i+=s.length}return r}(t,r),this.reset(),e):new Uint8Array(0)},t.reset=function(){this.chunks.length=0,this.dataLength=0},e}()},"./src/demux/dummy-demuxed-track.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/demux/dummy-demuxed-track.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: dummyTrack */function(e,t,r){"use strict";function i(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}r.r(t),r.d(t,"dummyTrack",(function(){return i}))},"./src/demux/exp-golomb.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/exp-golomb.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger */"./src/utils/logger.ts"),n=function(){function e(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}var t=e.prototype;return t.loadWord=function(){var e=this.data,t=this.bytesAvailable,r=e.byteLength-t,i=new Uint8Array(4),n=Math.min(4,t);if(0===n)throw new Error("no bytes available");i.set(e.subarray(r,r+n)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*n,this.bytesAvailable-=n},t.skipBits=function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&i.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?r<<t|this.readBits(t):r},t.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},t.skipScalingList=function(e){for(var t=8,r=8,i=0;i<e;i++)0!==r&&(r=(t+this.readEG()+256)%256),t=0===r?t:r},t.readSPS=function(){var e,t,r,i=0,n=0,s=0,o=0,a=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);a();var g=a();if(l(5),h(3),a(),f(),100===g||110===g||122===g||244===g||44===g||83===g||86===g||118===g||128===g){var v=c();if(3===v&&h(1),f(),f(),h(1),u())for(t=3!==v?8:12,r=0;r<t;r++)u()&&p(r<6?16:64)}f();var m=c();if(0===m)c();else if(1===m)for(h(1),d(),d(),e=c(),r=0;r<e;r++)d();f(),h(1);var _=c(),y=c(),b=l(1);0===b&&h(1),h(1),u()&&(i=c(),n=c(),s=c(),o=c());var S=[1,1];if(u()&&u())switch(a()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[a()<<8|a(),a()<<8|a()]}return{width:Math.ceil(16*(_+1)-2*i-2*n),height:(2-b)*(y+1)*16-(b?2:4)*(s+o),pixelRatio:S}},t.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();t.default=n},"./src/demux/id3.ts":
|
|
|
/*!**************************!*\
|
|
|
!*** ./src/demux/id3.ts ***!
|
|
|
\**************************/
|
|
|
/*! exports provided: isHeader, isFooter, getID3Data, canParse, getTimeStamp, isTimeStampFrame, getID3Frames, decodeFrame, utf8ArrayToStr, testables */function(e,t,r){"use strict";r.r(t),r.d(t,"isHeader",(function(){return n})),r.d(t,"isFooter",(function(){return s})),r.d(t,"getID3Data",(function(){return o})),r.d(t,"canParse",(function(){return l})),r.d(t,"getTimeStamp",(function(){return c})),r.d(t,"isTimeStampFrame",(function(){return u})),r.d(t,"getID3Frames",(function(){return d})),r.d(t,"decodeFrame",(function(){return f})),r.d(t,"utf8ArrayToStr",(function(){return _})),r.d(t,"testables",(function(){return y}));var i,n=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},s=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},o=function(e,t){for(var r=t,i=0;n(e,t);)i+=10,i+=a(e,t+6),s(e,t+10)&&(i+=10),t+=i;if(i>0)return e.subarray(r,r+i)},a=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3]},l=function(e,t){return n(e,t)&&a(e,t+6)+10<=e.length-t},c=function(e){for(var t=d(e),r=0;r<t.length;r++){var i=t[r];if(u(i))return m(i)}},u=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},h=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=a(e,4);return{type:t,size:r,data:e.subarray(10,10+r)}},d=function(e){for(var t=0,r=[];n(e,t);){for(var i=a(e,t+6),o=(t+=10)+i;t+8<o;){var l=h(e.subarray(t)),c=f(l);c&&r.push(c),t+=l.size+10}s(e,t)&&(t+=10)}return r},f=function(e){return"PRIV"===e.type?p(e):"W"===e.type[0]?v(e):g(e)},p=function(e){if(!(e.size<2)){var t=_(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}}},g=function(e){if(!(e.size<2)){if("TXXX"===e.type){var t=1,r=_(e.data.subarray(t),!0);t+=r.length+1;var i=_(e.data.subarray(t));return{key:e.type,info:r,data:i}}var n=_(e.data.subarray(1));return{key:e.type,data:n}}},v=function(e){if("WXXX"===e.type){if(e.size<2)return;var t=1,r=_(e.data.subarray(t),!0);t+=r.length+1;var i=_(e.data.subarray(t));return{key:e.type,info:r,data:i}}var n=_(e.data);return{key:e.type,data:n}},m=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),r=1&t[3],i=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},_=function(e,t){void 0===t&&(t=!1);var r=b();if(r){var i=r.decode(e);if(t){var n=i.indexOf("\0");return-1!==n?i.substring(0,n):i}return i.replace(/\0/g,"")}for(var s,o,a,l=e.length,c="",u=0;u<l;){if(0===(s=e[u++])&&t)return c;if(0!==s&&3!==s)switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(s);break;case 12:case 13:o=e[u++],c+=String.fromCharCode((31&s)<<6|63&o);break;case 14:o=e[u++],a=e[u++],c+=String.fromCharCode((15&s)<<12|(63&o)<<6|(63&a)<<0)}}return c},y={decodeTextFrame:g};function b(){return i||void 0===self.TextDecoder||(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/mp3demuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),n=r(/*! ../demux/id3 */"./src/demux/id3.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=r(/*! ./mpegaudio */"./src/demux/mpegaudio.ts");function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){var t,r;function i(){return e.apply(this,arguments)||this}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,a(t,r);var l=i.prototype;return l.resetInitSegment=function(t,r,i){e.prototype.resetInitSegment.call(this,t,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}},i.probe=function(e){if(!e)return!1;for(var t=(n.getID3Data(e,0)||[]).length,r=e.length;t<r;t++)if(o.probe(e,t))return s.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(e,t){return o.canParse(e,t)},l.appendFrame=function(e,t,r){if(null!==this.initPTS)return o.appendFrame(e,t,r,this.initPTS,this.frameIndex)},i}(i.default);l.minProbeByteLength=4,t.default=l},"./src/demux/mp4demuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/mp4demuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),n=r(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),s=function(){function e(e,t){this.remainderData=null,this.config=void 0,this.config=t}var t=e.prototype;return t.resetTimeStamp=function(){},t.resetInitSegment=function(){},t.resetContiguity=function(){},e.probe=function(e){return Object(i.findBox)({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},t.demux=function(e){var t=e,r=Object(n.dummyTrack)();if(this.config.progressive){this.remainderData&&(t=Object(i.appendUint8Array)(this.remainderData,e));var s=Object(i.segmentValidRange)(t);this.remainderData=s.remainder,r.samples=s.valid||new Uint8Array}else r.samples=t;return{audioTrack:Object(n.dummyTrack)(),avcTrack:r,id3Track:Object(n.dummyTrack)(),textTrack:Object(n.dummyTrack)()}},t.flush=function(){var e=Object(n.dummyTrack)();return e.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(n.dummyTrack)(),avcTrack:e,id3Track:Object(n.dummyTrack)(),textTrack:Object(n.dummyTrack)()}},t.demuxSampleAes=function(e,t,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e}();s.minProbeByteLength=1024,t.default=s},"./src/demux/mpegaudio.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/demux/mpegaudio.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: appendFrame, parseHeader, isHeaderPattern, isHeader, canParse, probe */function(e,t,r){"use strict";r.r(t),r.d(t,"appendFrame",(function(){return l})),r.d(t,"parseHeader",(function(){return c})),r.d(t,"isHeaderPattern",(function(){return u})),r.d(t,"isHeader",(function(){return h})),r.d(t,"canParse",(function(){return d})),r.d(t,"probe",(function(){return f}));var i=null,n=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],o=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],a=[0,1,1,4];function l(e,t,r,i,n){if(!(r+24>t.length)){var s=c(t,r);if(s&&r+s.frameLength<=t.length){var o=i+n*(9e4*s.samplesPerFrame/s.sampleRate),a={unit:t.subarray(r,r+s.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=s.channelCount,e.samplerate=s.sampleRate,e.samples.push(a),{sample:a,length:s.frameLength,missing:0}}}}function c(e,t){var r=e[t+1]>>3&3,l=e[t+1]>>1&3,c=e[t+2]>>4&15,u=e[t+2]>>2&3;if(1!==r&&0!==c&&15!==c&&3!==u){var h=e[t+2]>>1&1,d=e[t+3]>>6,f=1e3*n[14*(3===r?3-l:3===l?3:4)+c-1],p=s[3*(3===r?0:2===r?1:2)+u],g=3===d?1:2,v=o[r][l],m=a[l],_=8*v*m,y=Math.floor(v*f/p+h)*m;if(null===i){var b=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);i=b?parseInt(b[1]):0}return!!i&&i<=87&&2===l&&f>=224e3&&0===d&&(e[t+3]=128|e[t+3]),{sampleRate:p,channelCount:g,frameLength:y,samplesPerFrame:_}}}function u(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function h(e,t){return t+1<e.length&&u(e,t)}function d(e,t){return u(e,t)&&4<=e.length-t}function f(e,t){if(t+1<e.length&&u(e,t)){var r=c(e,t),i=4;null!=r&&r.frameLength&&(i=r.frameLength);var n=t+i;return n===e.length||h(e,n)}return!1}},"./src/demux/sample-aes.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/sample-aes.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),n=r(/*! ./tsdemuxer */"./src/demux/tsdemuxer.ts"),s=function(){function e(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new i.default(e,t,{removePKCS7Padding:!1})}var t=e.prototype;return t.decryptBuffer=function(e,t){this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,t)},t.decryptAacSample=function(e,t,r,i){var n=e[t].unit,s=n.subarray(16,n.length-n.length%16),o=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),a=this;this.decryptBuffer(o,(function(s){var o=new Uint8Array(s);n.set(o,16),i||a.decryptAacSamples(e,t+1,r)}))},t.decryptAacSamples=function(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,i),!i)return}}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),i=0,n=32;n<=e.length-16;n+=160,i+=16)r.set(e.subarray(n,n+16),i);return r},t.getAvcDecryptedUnit=function(e,t){for(var r=new Uint8Array(t),i=0,n=32;n<=e.length-16;n+=160,i+=16)e.set(r.subarray(i,i+16),n);return e},t.decryptAvcSample=function(e,t,r,i,s,o){var a=Object(n.discardEPB)(s.data),l=this.getAvcEncryptedData(a),c=this;this.decryptBuffer(l.buffer,(function(n){s.data=c.getAvcDecryptedUnit(a,n),o||c.decryptAvcSamples(e,t,r+1,i)}))},t.decryptAvcSamples=function(e,t,r,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length)return void i();for(var n=e[t].units;!(r>=n.length);r++){var s=n[r];if(!(s.data.length<=48||1!==s.type&&5!==s.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,i,s,o),!o)return}}}},e}();t.default=s},"./src/demux/transmuxer-interface.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/demux/transmuxer-interface.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return h}));var i=r(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=r(/*! ../errors */"./src/errors.ts"),l=r(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=r(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),u=Object(l.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function e(e,t,r,l){var h=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=e,this.id=t,this.onTransmuxComplete=r,this.onFlush=l;var d=e.config,f=function(t,r){(r=r||{}).frag=h.frag,r.id=h.id,e.trigger(t,r)};this.observer=new c.EventEmitter,this.observer.on(n.Events.FRAG_DECRYPTED,f),this.observer.on(n.Events.ERROR,f);var p={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(d.enableWorker&&"undefined"!=typeof Worker){var v;o.logger.log("demuxing in webworker");try{v=this.worker=i(/*! ../demux/transmuxer-worker.ts */"./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(t){e.trigger(n.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(t.message+" ("+t.filename+":"+t.lineno+")")})},v.postMessage({cmd:"init",typeSupported:p,vendor:g,id:t,config:JSON.stringify(d)})}catch(e){o.logger.warn("Error in worker:",e),o.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new s.default(this.observer,p,d,g,t),this.worker=null}}else this.transmuxer=new s.default(this.observer,p,d,g,t)}var t=e.prototype;return t.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.observer=null},t.push=function(e,t,r,i,n,a,l,c,u,h){var d=this;u.transmuxing.start=self.performance.now();var f=this.transmuxer,p=this.worker,g=a?a.start:n.start,v=n.decryptdata,m=this.frag,_=!(m&&n.cc===m.cc),y=!(m&&u.level===m.level),b=m?u.sn-m.sn:-1,S=this.part?u.part-this.part.index:1,w=!y&&(1===b||0===b&&1===S),C=self.performance.now();(y||b||0===n.stats.parsing.start)&&(n.stats.parsing.start=C),!a||!S&&w||(a.stats.parsing.start=C);var E=new s.TransmuxState(_,w,c,y,g);if(!w||_){o.logger.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+_+"\n trackSwitch: "+y+"\n contiguous: "+w+"\n accurateTimeOffset: "+c+"\n timeOffset: "+g);var k=new s.TransmuxConfig(r,i,t,l,h);this.configureTransmuxer(k)}if(this.frag=n,this.part=a,p)p.postMessage({cmd:"demux",data:e,decryptdata:v,chunkMeta:u,state:E},e instanceof ArrayBuffer?[e]:[]);else if(f){var x=f.push(e,v,u,E);Object(s.isPromise)(x)?x.then((function(e){d.handleTransmuxComplete(e)})):this.handleTransmuxComplete(x)}},t.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var r=this.transmuxer,i=this.worker;if(i)i.postMessage({cmd:"flush",chunkMeta:e});else if(r){var n=r.flush(e);Object(s.isPromise)(n)?n.then((function(r){t.handleFlushResult(r,e)})):this.handleFlushResult(n,e)}},t.handleFlushResult=function(e,t){var r=this;e.forEach((function(e){r.handleTransmuxComplete(e)})),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.worker,r=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):r&&r.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e}()},"./src/demux/transmuxer-worker.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/demux/transmuxer-worker.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return a}));var i=r(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=r(/*! eventemitter3 */"./node_modules/eventemitter3/index.js");function a(e){var t=new o.EventEmitter,r=function(t,r){e.postMessage({event:t,data:r})};t.on(n.Events.FRAG_DECRYPTED,r),t.on(n.Events.ERROR,r),e.addEventListener("message",(function(n){var o=n.data;switch(o.cmd){case"init":var a=JSON.parse(o.config);e.transmuxer=new i.default(t,o.typeSupported,a,o.vendor,o.id),Object(s.enableLogs)(a.debug),r("init",null);break;case"configure":e.transmuxer.configure(o.config);break;case"demux":var c=e.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(i.isPromise)(c)?c.then((function(t){l(e,t)})):l(e,c);break;case"flush":var h=o.chunkMeta,d=e.transmuxer.flush(h);Object(i.isPromise)(d)?d.then((function(t){u(e,t,h)})):u(e,d,h)}}))}function l(e,t){if((r=t.remuxResult).audio||r.video||r.text||r.id3||r.initSegment){var r,i=[],n=t.remuxResult,s=n.audio,o=n.video;s&&c(i,s),o&&c(i,o),e.postMessage({event:"transmuxComplete",data:t},i)}}function c(e,t){t.data1&&e.push(t.data1.buffer),t.data2&&e.push(t.data2.buffer)}function u(e,t,r){t.forEach((function(t){l(e,t)})),e.postMessage({event:"flush",data:r})}},"./src/demux/transmuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/transmuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default, isPromise, TransmuxConfig, TransmuxState */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return _})),r.d(t,"isPromise",(function(){return b})),r.d(t,"TransmuxConfig",(function(){return S})),r.d(t,"TransmuxState",(function(){return w}));var i,n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../errors */"./src/errors.ts"),o=r(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),a=r(/*! ../demux/aacdemuxer */"./src/demux/aacdemuxer.ts"),l=r(/*! ../demux/mp4demuxer */"./src/demux/mp4demuxer.ts"),c=r(/*! ../demux/tsdemuxer */"./src/demux/tsdemuxer.ts"),u=r(/*! ../demux/mp3demuxer */"./src/demux/mp3demuxer.ts"),h=r(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),d=r(/*! ../remux/passthrough-remuxer */"./src/remux/passthrough-remuxer.ts"),f=r(/*! ./chunk-cache */"./src/demux/chunk-cache.ts"),p=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),g=r(/*! ../utils/logger */"./src/utils/logger.ts");try{i=self.performance.now.bind(self.performance)}catch(e){g.logger.debug("Unable to use Performance API on this environment"),i=self.Date.now}var v=[{demux:c.default,remux:h.default},{demux:l.default,remux:d.default},{demux:a.default,remux:h.default},{demux:u.default,remux:h.default}],m=1024;v.forEach((function(e){var t=e.demux;m=Math.max(m,t.minProbeByteLength)}));var _=function(){function e(e,t,r,i,n){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 f.default,this.observer=e,this.typeSupported=t,this.config=r,this.vendor=i,this.id=n}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,r,n){var s=this,o=r.transmuxing;o.executeStart=i();var a=new Uint8Array(e),l=this.cache,c=this.config,u=this.currentTransmuxState,h=this.transmuxConfig;n&&(this.currentTransmuxState=n);var d=function(e,t){var r=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(r=t),r}(a,t);if(d&&"AES-128"===d.method){var f=this.getDecrypter();if(!c.enableSoftwareAES)return this.decryptionPromise=f.webCryptoDecrypt(a,d.key.buffer,d.iv.buffer).then((function(e){var t=s.push(e,null,r);return s.decryptionPromise=null,t})),this.decryptionPromise;var g=f.softwareDecrypt(a,d.key.buffer,d.iv.buffer);if(!g)return o.executeEnd=i(),y(r);a=new Uint8Array(g)}var v=n||u,m=v.contiguous,_=v.discontinuity,b=v.trackSwitch,S=v.accurateTimeOffset,w=v.timeOffset,C=h.audioCodec,E=h.videoCodec,k=h.defaultInitPts,x=h.duration,T=h.initSegmentData;if((_||b)&&this.resetInitSegment(T,C,E,x),_&&this.resetInitialTimestamp(k),m||this.resetContiguity(),this.needsProbing(a,_,b)){if(l.dataLength){var L=l.flush();a=Object(p.appendUint8Array)(L,a)}this.configureTransmuxer(a,h)}var A=this.transmux(a,d,w,S,r),D=this.currentTransmuxState;return D.contiguous=!0,D.discontinuity=!1,D.trackSwitch=!1,o.executeEnd=i(),A},t.flush=function(e){var t=this,r=e.transmuxing;r.executeStart=i();var o=this.decrypter,a=this.cache,l=this.currentTransmuxState,c=this.decryptionPromise;if(c)return c.then((function(){return t.flush(e)}));var u=[],h=l.timeOffset;if(o){var d=o.flush();d&&u.push(this.push(d,null,e))}var f=a.dataLength;a.reset();var p=this.demuxer,g=this.remuxer;if(!p||!g)return f>=m&&this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=i(),[y(e)];var v=p.flush(h);return b(v)?v.then((function(r){return t.flushRemux(u,r,e),u})):(this.flushRemux(u,v,e),u)},t.flushRemux=function(e,t,r){var n=t.audioTrack,s=t.avcTrack,o=t.id3Track,a=t.textTrack,l=this.currentTransmuxState,c=l.accurateTimeOffset,u=l.timeOffset;g.logger.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var h=this.remuxer.remux(n,s,o,a,u,c,!0,this.id);e.push({remuxResult:h,chunkMeta:r}),r.transmuxing.executeEnd=i()},t.resetInitialTimestamp=function(e){var t=this.demuxer,r=this.remuxer;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,r,i){var n=this.demuxer,s=this.remuxer;n&&s&&(n.resetInitSegment(t,r,i),s.resetInitSegment(e,t,r))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,r,i,n){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,i,n):this.transmuxUnencrypted(e,r,i,n)},t.transmuxUnencrypted=function(e,t,r,i){var n=this.demuxer.demux(e,t,!1,!this.config.progressive),s=n.audioTrack,o=n.avcTrack,a=n.id3Track,l=n.textTrack;return{remuxResult:this.remuxer.remux(s,o,a,l,t,r,!1,this.id),chunkMeta:i}},t.transmuxSampleAes=function(e,t,r,i,n){var s=this;return this.demuxer.demuxSampleAes(e,t,r).then((function(e){return{remuxResult:s.remuxer.remux(e.audioTrack,e.avcTrack,e.id3Track,e.textTrack,r,i,!1,s.id),chunkMeta:n}}))},t.configureTransmuxer=function(e,t){for(var r,i=this.config,n=this.observer,s=this.typeSupported,o=this.vendor,a=t.audioCodec,c=t.defaultInitPts,u=t.duration,h=t.initSegmentData,f=t.videoCodec,p=0,m=v.length;p<m;p++)if(v[p].demux.probe(e)){r=v[p];break}r||(g.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),r={demux:l.default,remux:d.default});var _=this.demuxer,y=this.remuxer,b=r.remux,S=r.demux;y&&y instanceof b||(this.remuxer=new b(n,i,s,o)),_&&_ instanceof S||(this.demuxer=new S(n,i,s),this.probe=S.probe),this.resetInitSegment(h,a,f,u),this.resetInitialTimestamp(c)},t.needsProbing=function(e,t,r){return!this.demuxer||!this.remuxer||t||r},t.getDecrypter=function(){var e=this.decrypter;return e||(e=this.decrypter=new o.default(this.observer,this.config)),e},e}(),y=function(e){return{remuxResult:{},chunkMeta:e}};function b(e){return"then"in e&&e.then instanceof Function}var S=function(e,t,r,i,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=r,this.duration=i,this.defaultInitPts=n},w=function(e,t,r,i,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=r,this.trackSwitch=i,this.timeOffset=n}},"./src/demux/tsdemuxer.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/demux/tsdemuxer.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: discardEPB, default */function(e,t,r){"use strict";r.r(t),r.d(t,"discardEPB",(function(){return b}));var i=r(/*! ./adts */"./src/demux/adts.ts"),n=r(/*! ./mpegaudio */"./src/demux/mpegaudio.ts"),s=r(/*! ./exp-golomb */"./src/demux/exp-golomb.ts"),o=r(/*! ./id3 */"./src/demux/id3.ts"),a=r(/*! ./sample-aes */"./src/demux/sample-aes.ts"),l=r(/*! ../events */"./src/events.ts"),c=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),u=r(/*! ../utils/logger */"./src/utils/logger.ts"),h=r(/*! ../errors */"./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},f=function(){function e(e,t,r){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=e,this.config=t,this.typeSupported=r}e.probe=function(t){var r=e.syncOffset(t);return!(r<0||(r&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),0))},e.syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),r=0;r<t;){if(71===e[r]&&71===e[r+188]&&71===e[r+376])return r;r++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:d[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}};var t=e.prototype;return t.resetInitSegment=function(t,r,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video",i),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3",i),this._txtTrack=e.createTrack("text",i),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=t,this.videoCodec=r,this._duration=i},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._avcTrack,r=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},t.demux=function(t,r,i,n){var s;void 0===i&&(i=!1),void 0===n&&(n=!1),i||(this.sampleAes=null);var o=this._avcTrack,a=this._audioTrack,d=this._id3Track,f=o.pid,p=o.pesData,_=a.pid,y=d.pid,b=a.pesData,S=d.pesData,w=!1,C=this.pmtParsed,E=this._pmtId,k=t.length;if(this.remainderData&&(k=(t=Object(c.appendUint8Array)(this.remainderData,t)).length,this.remainderData=null),k<188&&!n)return this.remainderData=t,{audioTrack:a,avcTrack:o,id3Track:d,textTrack:this._txtTrack};var x=Math.max(0,e.syncOffset(t));(k-=(k+x)%188)<t.byteLength&&!n&&(this.remainderData=new Uint8Array(t.buffer,k,t.buffer.byteLength-k));for(var T=x;T<k;T+=188)if(71===t[T]){var L=!!(64&t[T+1]),A=((31&t[T+1])<<8)+t[T+2],D=void 0;if((48&t[T+3])>>4>1){if((D=T+5+t[T+4])===T+188)continue}else D=T+4;switch(A){case f:L&&(p&&(s=m(p))&&this.parseAVCPES(s,!1),p={data:[],size:0}),p&&(p.data.push(t.subarray(D,T+188)),p.size+=T+188-D);break;case _:L&&(b&&(s=m(b))&&(a.isAAC?this.parseAACPES(s):this.parseMPEGPES(s)),b={data:[],size:0}),b&&(b.data.push(t.subarray(D,T+188)),b.size+=T+188-D);break;case y:L&&(S&&(s=m(S))&&this.parseID3PES(s),S={data:[],size:0}),S&&(S.data.push(t.subarray(D,T+188)),S.size+=T+188-D);break;case 0:L&&(D+=t[D]+1),E=this._pmtId=g(t,D);break;case E:L&&(D+=t[D]+1);var O=v(t,D,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,i);(f=O.avc)>0&&(o.pid=f),(_=O.audio)>0&&(a.pid=_,a.isAAC=O.isAAC),(y=O.id3)>0&&(d.pid=y),w&&!C&&(u.logger.log("reparse from beginning"),w=!1,T=x-188),C=this.pmtParsed=!0;break;case 17:case 8191:break;default:w=!0}}else this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});o.pesData=p,a.pesData=b,d.pesData=S;var R={audioTrack:a,avcTrack:o,id3Track:d,textTrack:this._txtTrack};return n&&this.extractRemainingSamples(R),R},t.flush=function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,r=e.audioTrack,i=e.avcTrack,n=e.id3Track,s=i.pesData,o=r.pesData,a=n.pesData;s&&(t=m(s))?(this.parseAVCPES(t,!0),i.pesData=null):i.pesData=s,o&&(t=m(o))?(r.isAAC?this.parseAACPES(t):this.parseMPEGPES(t),r.pesData=null):(null!=o&&o.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=o),a&&(t=m(a))?(this.parseID3PES(t),n.pesData=null):n.pesData=a},t.demuxSampleAes=function(e,t,r){var i=this.demux(e,r,!0,!this.config.progressive),n=this.sampleAes=new a.default(this.observer,this.config,t);return this.decrypt(i,n)},t.decrypt=function(e,t){return new Promise((function(r){var i=e.audioTrack,n=e.avcTrack;i.samples&&i.isAAC?t.decryptAacSamples(i.samples,0,(function(){n.samples?t.decryptAvcSamples(n.samples,0,0,(function(){r(e)})):r(e)})):n.samples&&t.decryptAvcSamples(n.samples,0,0,(function(){r(e)}))}))},t.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},t.parseAVCPES=function(e,t){var r,i=this,n=this._avcTrack,a=this.parseAVCNALu(e.data),l=this.avcSample,c=!1;e.data=null,l&&a.length&&!n.audFound&&(_(l,n),l=this.avcSample=p(!1,e.pts,e.dts,"")),a.forEach((function(t){switch(t.type){case 1:r=!0,l||(l=i.avcSample=p(!0,e.pts,e.dts,"")),l.frame=!0;var a=t.data;if(c&&a.length>4){var u=new s.default(a).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:r=!0,l||(l=i.avcSample=p(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:r=!0;var h=new s.default(b(t.data));h.readUByte();for(var d=0,f=0,g=!1,v=0;!g&&h.bytesAvailable>1;){d=0;do{d+=v=h.readUByte()}while(255===v);f=0;do{f+=v=h.readUByte()}while(255===v);if(4===d&&0!==h.bytesAvailable){if(g=!0,181===h.readUByte()&&49===h.readUShort()&&1195456820===h.readUInt()&&3===h.readUByte()){for(var m=h.readUByte(),S=31&m,w=[m,h.readUByte()],C=0;C<S;C++)w.push(h.readUByte()),w.push(h.readUByte()),w.push(h.readUByte());y(i._txtTrack.samples,{type:3,pts:e.pts,bytes:w})}}else if(5===d&&0!==h.bytesAvailable){if(g=!0,f>16){for(var E=[],k=0;k<16;k++)E.push(h.readUByte().toString(16)),3!==k&&5!==k&&7!==k&&9!==k||E.push("-");for(var x=f-16,T=new Uint8Array(x),L=0;L<x;L++)T[L]=h.readUByte();y(i._txtTrack.samples,{pts:e.pts,payloadType:d,uuid:E.join(""),userData:Object(o.utf8ArrayToStr)(T),userDataBytes:T})}}else if(f<h.bytesAvailable)for(var A=0;A<f;A++)h.readUByte()}break;case 7:if(r=!0,c=!0,!n.sps){var D=new s.default(t.data).readSPS();n.width=D.width,n.height=D.height,n.pixelRatio=D.pixelRatio,n.sps=[t.data],n.duration=i._duration;for(var O=t.data.subarray(1,4),R="avc1.",M=0;M<3;M++){var I=O[M].toString(16);I.length<2&&(I="0"+I),R+=I}n.codec=R}break;case 8:r=!0,n.pps||(n.pps=[t.data]);break;case 9:r=!1,n.audFound=!0,l&&_(l,n),l=i.avcSample=p(!1,e.pts,e.dts,"");break;case 12:r=!1;break;default:r=!1,l&&(l.debug+="unknown NAL "+t.type+" ")}l&&r&&l.units.push(t)})),t&&l&&(_(l,n),this.avcSample=null)},t.getLastNalUnit=function(){var e,t,r=this.avcSample;if(!r||0===r.units.length){var i=this._avcTrack.samples;r=i[i.length-1]}if(null!==(e=r)&&void 0!==e&&e.units){var n=r.units;t=n[n.length-1]}return t},t.parseAVCNALu=function(e){var t,r,i=e.byteLength,n=this._avcTrack,s=n.naluState||0,o=s,a=[],l=0,c=-1,u=0;for(-1===s&&(c=0,u=31&e[0],s=0,l=1);l<i;)if(t=e[l++],s)if(1!==s)if(t)if(1===t){if(c>=0){var h={data:e.subarray(c,l-s-1),type:u};a.push(h)}else{var d=this.getLastNalUnit();if(d&&(o&&l<=4-o&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-o)),(r=l-s-1)>0)){var f=new Uint8Array(d.data.byteLength+r);f.set(d.data,0),f.set(e.subarray(0,r),d.data.byteLength),d.data=f,d.state=0}}l<i?(c=l,u=31&e[l],s=0):s=-1}else s=0;else s=3;else s=t?0:2;else s=t?0:1;if(c>=0&&s>=0){var p={data:e.subarray(c,i),type:u,state:s};a.push(p)}if(0===a.length){var g=this.getLastNalUnit();if(g){var v=new Uint8Array(g.data.byteLength+e.byteLength);v.set(g.data,0),v.set(e,g.data.byteLength),g.data=v}}return n.naluState=s,a},t.parseAACPES=function(e){var t,r,n,s,o,a=0,c=this._audioTrack,d=this.aacOverFlow,f=e.data;if(d){this.aacOverFlow=null;var p=d.sample.unit.byteLength,g=Math.min(d.missing,p),v=p-g;d.sample.unit.set(f.subarray(0,g),v),c.samples.push(d.sample),a=d.missing}for(t=a,r=f.length;t<r-1&&!i.isHeader(f,t);t++);if(t===a||(t<r-1?(n="AAC PES did not start with ADTS header,offset:"+t,s=!1):(n="no ADTS header found in AAC PES",s=!0),u.logger.warn("parsing error:"+n),this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:s,reason:n}),!s)){if(i.initTrackConfig(c,this.observer,f,t,this.audioCodec),void 0!==e.pts)o=e.pts;else{if(!d)return void u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");var m=i.getFrameDuration(c.samplerate);o=d.sample.pts+m}for(var _=0;t<r;){if(i.isHeader(f,t)){if(t+5<r){var y=i.appendFrame(c,f,t,o,_);if(y){if(!y.missing){t+=y.length,_++;continue}this.aacOverFlow=y}}break}t++}}},t.parseMPEGPES=function(e){var t=e.data,r=t.length,i=0,s=0,o=e.pts;if(void 0!==o)for(;s<r;)if(n.isHeader(t,s)){var a=n.appendFrame(this._audioTrack,t,s,o,i);if(!a)break;s+=a.length,i++}else s++;else u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")},t.parseID3PES=function(e){void 0!==e.pts?this._id3Track.samples.push(e):u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS")},e}();function p(e,t,r,i){return{key:e,frame:!1,pts:t,dts:r,units:[],debug:i,length:0}}function g(e,t){return(31&e[t+10])<<8|e[t+11]}function v(e,t,r,i){var n={audio:-1,avc:-1,id3:-1,isAAC:!0},s=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<s;){var o=(31&e[t+1])<<8|e[t+2];switch(e[t]){case 207:if(!i){u.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===n.audio&&(n.audio=o);break;case 21:-1===n.id3&&(n.id3=o);break;case 219:if(!i){u.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===n.avc&&(n.avc=o);break;case 3:case 4:r?-1===n.audio&&(n.audio=o,n.isAAC=!1):u.logger.log("MPEG audio found, not supported in this browser");break;case 36:u.logger.warn("Unsupported HEVC stream type found")}t+=5+((15&e[t+3])<<8|e[t+4])}return n}function m(e){var t,r,i,n,s,o=0,a=e.data;if(!e||0===e.size)return null;for(;a[0].length<19&&a.length>1;){var l=new Uint8Array(a[0].length+a[1].length);l.set(a[0]),l.set(a[1],a[0].length),a[0]=l,a.splice(1,1)}if(1===((t=a[0])[0]<<16)+(t[1]<<8)+t[2]){if((r=(t[4]<<8)+t[5])&&r>e.size-6)return null;var c=t[7];192&c&&(n=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&c?n-(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(u.logger.warn(Math.round((n-s)/9e4)+"s delta between PTS and DTS, align them"),n=s):s=n);var h=(i=t[8])+9;if(e.size<=h)return null;e.size-=h;for(var d=new Uint8Array(e.size),f=0,p=a.length;f<p;f++){var g=(t=a[f]).byteLength;if(h){if(h>g){h-=g;continue}t=t.subarray(h),g-=h,h=0}d.set(t,o),o+=g}return r&&(r-=i+3),{data:d,pts:n,dts:s,len:r}}return null}function _(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var r=t.samples,i=r.length;if(!i)return void t.dropped++;var n=r[i-1];e.pts=n.pts,e.dts=n.dts}t.samples.push(e)}e.debug.length&&u.logger.log(e.pts+"/"+e.dts+":"+e.debug)}function y(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var i=r-1;i>=0;i--)if(t.pts<e[i].pts){e.splice(i,0,t);break}}else e.push(t)}function b(e){for(var t=e.byteLength,r=[],i=1;i<t-2;)0===e[i]&&0===e[i+1]&&3===e[i+2]?(r.push(i+2),i+=2):i++;if(0===r.length)return e;var n=t-r.length,s=new Uint8Array(n),o=0;for(i=0;i<n;o++,i++)o===r[0]&&(o++,r.shift()),s[i]=e[o];return s}f.minProbeByteLength=188,t.default=f},"./src/errors.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/errors.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: ErrorTypes, ErrorDetails */function(e,t,r){"use strict";var i,n;r.r(t),r.d(t,"ErrorTypes",(function(){return i})),r.d(t,"ErrorDetails",(function(){return n})),function(e){e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError"}(i||(i={})),function(e){e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown"}(n||(n={}))},"./src/events.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/events.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: Events */function(e,t,r){"use strict";var i;r.r(t),r.d(t,"Events",(function(){return i})),function(e){e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached"}(i||(i={}))},"./src/hls.ts":
|
|
|
/*!********************!*\
|
|
|
!*** ./src/hls.ts ***!
|
|
|
\********************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return _}));var i=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),n=r(/*! ./loader/playlist-loader */"./src/loader/playlist-loader.ts"),s=r(/*! ./loader/key-loader */"./src/loader/key-loader.ts"),o=r(/*! ./controller/id3-track-controller */"./src/controller/id3-track-controller.ts"),a=r(/*! ./controller/latency-controller */"./src/controller/latency-controller.ts"),l=r(/*! ./controller/level-controller */"./src/controller/level-controller.ts"),c=r(/*! ./controller/fragment-tracker */"./src/controller/fragment-tracker.ts"),u=r(/*! ./controller/stream-controller */"./src/controller/stream-controller.ts"),h=r(/*! ./is-supported */"./src/is-supported.ts"),d=r(/*! ./utils/logger */"./src/utils/logger.ts"),f=r(/*! ./config */"./src/config.ts"),p=r(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),g=r(/*! ./events */"./src/events.ts"),v=r(/*! ./errors */"./src/errors.ts");function m(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var _=function(){function e(t){void 0===t&&(t={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 r=this.config=Object(f.mergeConfig)(e.DefaultConfig,t);this.userConfig=t,Object(d.enableLogs)(r.debug),this._autoLevelCapping=-1,r.progressive&&Object(f.enableStreamingMode)(r);var i=r.abrController,h=r.bufferController,g=r.capLevelController,v=r.fpsController,m=this.abrController=new i(this),_=this.bufferController=new h(this),y=this.capLevelController=new g(this),b=new v(this),S=new n.default(this),w=new s.default(this),C=new o.default(this),E=this.levelController=new l.default(this),k=new c.FragmentTracker(this),x=this.streamController=new u.default(this,k);y.setStreamController(x),b.setStreamController(x);var T=[E,x];this.networkControllers=T;var L=[S,w,m,_,y,b,C,k];this.audioTrackController=this.createController(r.audioTrackController,null,T),this.createController(r.audioStreamController,k,T),this.subtitleTrackController=this.createController(r.subtitleTrackController,null,T),this.createController(r.subtitleStreamController,k,T),this.createController(r.timelineController,null,L),this.emeController=this.createController(r.emeController,null,L),this.cmcdController=this.createController(r.cmcdController,null,L),this.latencyController=this.createController(a.default,null,L),this.coreComponents=L}e.isSupported=function(){return Object(h.isSupported)()};var t,r,_,y=e.prototype;return y.createController=function(e,t,r){if(e){var i=t?new e(this,t):new e(this);return r&&r.push(i),i}return null},y.on=function(e,t,r){void 0===r&&(r=this),this._emitter.on(e,t,r)},y.once=function(e,t,r){void 0===r&&(r=this),this._emitter.once(e,t,r)},y.removeAllListeners=function(e){this._emitter.removeAllListeners(e)},y.off=function(e,t,r,i){void 0===r&&(r=this),this._emitter.off(e,t,r,i)},y.listeners=function(e){return this._emitter.listeners(e)},y.emit=function(e,t,r){return this._emitter.emit(e,t,r)},y.trigger=function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){d.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(g.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,error:t})}return!1},y.listenerCount=function(e){return this._emitter.listenerCount(e)},y.destroy=function(){d.logger.log("destroy"),this.trigger(g.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0},y.attachMedia=function(e){d.logger.log("attachMedia"),this._media=e,this.trigger(g.Events.MEDIA_ATTACHING,{media:e})},y.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(g.Events.MEDIA_DETACHING,void 0),this._media=null},y.loadSource=function(e){this.stopLoad();var t=this.media,r=this.url,n=this.url=i.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});d.logger.log("loadSource:"+n),t&&r&&r!==n&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(t)),this.trigger(g.Events.MANIFEST_LOADING,{url:e})},y.startLoad=function(e){void 0===e&&(e=-1),d.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},y.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},y.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},y.recoverMediaError=function(){d.logger.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)},y.removeLevel=function(e,t){void 0===t&&(t=0),this.levelController.removeLevel(e,t)},t=e,_=[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return g.Events}},{key:"ErrorTypes",get:function(){return v.ErrorTypes}},{key:"ErrorDetails",get:function(){return v.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:f.hlsDefaultConfig},set:function(t){e.defaultConfig=t}}],(r=[{key:"levels",get:function(){var e=this.levelController.levels;return e||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){d.logger.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){d.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){d.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){d.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){d.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;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(e){this._autoLevelCapping!==e&&(d.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var r=e.length,i=0;i<r;i++)if(e[i].maxBitrate>t)return i;return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{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}}])&&m(t.prototype,r),_&&m(t,_),e}();_.defaultConfig=void 0},"./src/is-supported.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/is-supported.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: isSupported, changeTypeSupported */function(e,t,r){"use strict";r.r(t),r.d(t,"isSupported",(function(){return s})),r.d(t,"changeTypeSupported",(function(){return o}));var i=r(/*! ./utils/mediasource-helper */"./src/utils/mediasource-helper.ts");function n(){return self.SourceBuffer||self.WebKitSourceBuffer}function s(){var e=Object(i.getMediaSource)();if(!e)return!1;var t=n(),r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),s=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!r&&!!s}function o(){var e,t=n();return"function"==typeof(null==t||null===(e=t.prototype)||void 0===e?void 0:e.changeType)}},"./src/loader/fragment-loader.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/loader/fragment-loader.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: default, LoadError */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return h})),r.d(t,"LoadError",(function(){return f}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../errors */"./src/errors.ts");function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return o(e,arguments,c(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),l(i,e)})(e)}function o(e,t,r){return(o=a()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var n=new(Function.bind.apply(e,i));return r&&l(n,r.prototype),n}).apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=Math.pow(2,17),h=function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var r=this,i=e.url;if(!i)return Promise.reject(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var s=this.config,o=s.fLoader,a=s.loader;return new Promise((function(i,l){r.loader&&r.loader.destroy();var c=r.loader=e.loader=o?new o(s):new a(s),h=d(e),p={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:u};e.stats=c.stats,c.load(h,p,{onSuccess:function(t,n,s,o){r.resetLoader(e,c),i({frag:e,part:null,payload:t.data,networkDetails:o})},onError:function(t,i,s){r.resetLoader(e,c),l(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:t,networkDetails:s}))},onAbort:function(t,i,s){r.resetLoader(e,c),l(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,networkDetails:s}))},onTimeout:function(t,i,s){r.resetLoader(e,c),l(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,networkDetails:s}))},onProgress:function(r,i,n,s){t&&t({frag:e,part:null,payload:n,networkDetails:s})}})}))},t.loadPart=function(e,t,r){var i=this;this.abort();var s=this.config,o=s.fLoader,a=s.loader;return new Promise((function(l,c){i.loader&&i.loader.destroy();var h=i.loader=e.loader=o?new o(s):new a(s),p=d(e,t),g={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:u};t.stats=h.stats,h.load(p,g,{onSuccess:function(n,s,o,a){i.resetLoader(e,h),i.updateStatsFromPart(e,t);var c={frag:e,part:t,payload:n.data,networkDetails:a};r(c),l(c)},onError:function(r,s,o){i.resetLoader(e,h),c(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:r,networkDetails:o}))},onAbort:function(r,s,o){e.stats.aborted=t.stats.aborted,i.resetLoader(e,h),c(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,networkDetails:o}))},onTimeout:function(r,s,o){i.resetLoader(e,h),c(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,networkDetails:o}))}})}))},t.updateStatsFromPart=function(e,t){var r=e.stats,i=t.stats,n=i.total;if(r.loaded+=i.loaded,n){var s=Math.round(e.duration/t.duration),o=Math.min(Math.round(r.loaded/n),s),a=(s-o)*Math.round(r.loaded/o);r.total=r.loaded+a}else r.total=Math.max(r.loaded,r.total);var l=r.loading,c=i.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e}();function d(e,t){void 0===t&&(t=null);var r=t||e,n={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},s=r.byteRangeStartOffset,o=r.byteRangeEndOffset;return Object(i.isFiniteNumber)(s)&&Object(i.isFiniteNumber)(o)&&(n.rangeStart=s,n.rangeEnd=o),n}var f=function(e){var t,r;function i(t){for(var r,i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return(r=e.call.apply(e,[this].concat(n))||this).data=void 0,r.data=t,r}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,l(t,r),i}(s(Error))},"./src/loader/fragment.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/loader/fragment.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: ElementaryStreamTypes, BaseSegment, Fragment, Part */function(e,t,r){"use strict";r.r(t),r.d(t,"ElementaryStreamTypes",(function(){return i})),r.d(t,"BaseSegment",(function(){return f})),r.d(t,"Fragment",(function(){return p})),r.d(t,"Part",(function(){return g}));var i,n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),s=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=r(/*! ./level-key */"./src/loader/level-key.ts"),l=r(/*! ./load-stats */"./src/loader/load-stats.ts");function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}!function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"}(i||(i={}));var f=function(){function e(e){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[i.AUDIO]=null,t[i.VIDEO]=null,t[i.AUDIOVIDEO]=null,t),this.baseurl=e}return e.prototype.setByteRange=function(e,t){var r=e.split("@",2),i=[];1===r.length?i[0]=t?t.byteRangeEndOffset:0:i[0]=parseInt(r[1]),i[1]=parseInt(r[0])+i[0],this._byteRange=i},d(e,[{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(s.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}]),e}(),p=function(e){function t(t,r){var i;return(i=e.call(this,r)||this)._decryptdata=null,i.rawProgramDateTime=null,i.programDateTime=null,i.tagList=[],i.duration=0,i.sn=0,i.levelkey=void 0,i.type=void 0,i.loader=null,i.level=-1,i.cc=0,i.startPTS=void 0,i.endPTS=void 0,i.appendedPTS=void 0,i.startDTS=void 0,i.endDTS=void 0,i.start=0,i.deltaPTS=void 0,i.maxStartPTS=void 0,i.minEndPTS=void 0,i.stats=new l.LoadStats,i.urlId=0,i.data=void 0,i.bitrateTest=!1,i.title=null,i.initSegment=null,i.type=t,i}c(t,e);var r=t.prototype;return r.createInitializationVector=function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t},r.setDecryptDataFromLevelKey=function(e,t){var r=e;return"AES-128"===(null==e?void 0:e.method)&&e.uri&&!e.iv&&((r=a.LevelKey.fromURI(e.uri)).method=e.method,r.iv=this.createInitializationVector(t),r.keyFormat="identity"),r},r.setElementaryStreamInfo=function(e,t,r,i,n,s){void 0===s&&(s=!1);var o=this.elementaryStreams,a=o[e];a?(a.startPTS=Math.min(a.startPTS,t),a.endPTS=Math.max(a.endPTS,r),a.startDTS=Math.min(a.startDTS,i),a.endDTS=Math.max(a.endDTS,n)):o[e]={startPTS:t,endPTS:r,startDTS:i,endDTS:n,partial:s}},r.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[i.AUDIO]=null,e[i.VIDEO]=null,e[i.AUDIOVIDEO]=null},d(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var e=this.sn;"number"!=typeof e&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&o.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),e=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,e)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(n.isFiniteNumber)(this.programDateTime))return null;var e=Object(n.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;return!(null===(e=this.decryptdata)||void 0===e||!e.keyFormat||!this.decryptdata.uri)}}]),t}(f),g=function(e){function t(t,r,i,n,s){var o;(o=e.call(this,i)||this).fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new l.LoadStats,o.duration=t.decimalFloatingPoint("DURATION"),o.gap=t.bool("GAP"),o.independent=t.bool("INDEPENDENT"),o.relurl=t.enumeratedString("URI"),o.fragment=r,o.index=n;var a=t.enumeratedString("BYTERANGE");return a&&o.setByteRange(a,s),s&&(o.fragOffset=s.fragOffset+s.duration),o}return c(t,e),d(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),t}(f)},"./src/loader/key-loader.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/loader/key-loader.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var i=r(/*! ../events */"./src/events.ts"),n=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=function(){function e(e){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){this.hls.on(i.Events.KEY_LOADING,this.onKeyLoading,this)},t._unregisterListeners=function(){this.hls.off(i.Events.KEY_LOADING,this.onKeyLoading)},t.destroy=function(){for(var e in this._unregisterListeners(),this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={}},t.onKeyLoading=function(e,t){var r=t.frag,n=r.type,o=this.loaders[n];if(r.decryptdata){var a=r.decryptdata.uri;if(a!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(o&&(s.logger.warn("abort previous key loader for type:"+n),o.abort()),!a)return void s.logger.warn("key uri is falsy");var c=l.loader,u=r.loader=this.loaders[n]=new c(l);this.decrypturl=a,this.decryptkey=null;var h={url:a,frag:r,responseType:"arraybuffer"},d={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(h,d,f)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(i.Events.KEY_LOADED,{frag:r}))}else s.logger.warn("Missing decryption data on fragment in onKeyLoading")},t.loadsuccess=function(e,t,r){var n=r.frag;n.decryptdata?(this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(i.Events.KEY_LOADED,{frag:n})):s.logger.error("after key load, decryptdata unset")},t.loaderror=function(e,t){var r=t.frag,s=r.loader;s&&s.abort(),delete this.loaders[r.type],this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},t.loadtimeout=function(e,t){var r=t.frag,s=r.loader;s&&s.abort(),delete this.loaders[r.type],this.hls.trigger(i.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e}()},"./src/loader/level-details.ts":
|
|
|
/*!*************************************!*\
|
|
|
!*** ./src/loader/level-details.ts ***!
|
|
|
\*************************************/
|
|
|
/*! exports provided: LevelDetails */function(e,t,r){"use strict";r.r(t),r.d(t,"LevelDetails",(function(){return s}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts");function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=function(){function e(e){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=e}var t,r,s;return e.prototype.reloaded=function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},t=e,(r=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(i.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!==(e=this.fragments)&&void 0!==e&&e.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 e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&n(t.prototype,r),s&&n(t,s),e}()},"./src/loader/level-key.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/loader/level-key.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: LevelKey */function(e,t,r){"use strict";r.r(t),r.d(t,"LevelKey",(function(){return s}));var i=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js");function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=function(){function e(e,t){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=t?Object(i.buildAbsoluteURL)(e,t,{alwaysNormalize:!0}):e}var t,r,s;return e.fromURL=function(t,r){return new e(t,r)},e.fromURI=function(t){return new e(t)},t=e,(r=[{key:"uri",get:function(){return this._uri}}])&&n(t.prototype,r),s&&n(t,s),e}()},"./src/loader/load-stats.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/loader/load-stats.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: LoadStats */function(e,t,r){"use strict";r.r(t),r.d(t,"LoadStats",(function(){return i}));var i=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":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/loader/m3u8-parser.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return v}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),s=r(/*! ./fragment */"./src/loader/fragment.ts"),o=r(/*! ./level-details */"./src/loader/level-details.ts"),a=r(/*! ./level-key */"./src/loader/level-key.ts"),l=r(/*! ../utils/attr-list */"./src/utils/attr-list.ts"),c=r(/*! ../utils/logger */"./src/utils/logger.ts"),u=r(/*! ../utils/codecs */"./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,d=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=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("|")),g=/\.(mp4|m4s|m4v|m4a)$/i,v=function(){function e(){}return e.findGroup=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(i.id===t)return i}},e.convertAVC1ToAVCOTI=function(e){var t=e.split(".");if(t.length>2){var r=t.shift()+".";return r+=parseInt(t.shift()).toString(16),r+=("000"+parseInt(t.shift()).toString(16)).substr(-4)}return e},e.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,r){var i,n=[],s={},o=!1;for(h.lastIndex=0;null!=(i=h.exec(t));)if(i[1]){var a=new l.AttrList(i[1]),c={attrs:a,bitrate:a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),name:a.NAME,url:e.resolve(i[2],r)},u=a.decimalResolution("RESOLUTION");u&&(c.width=u.width,c.height=u.height),m((a.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),c),c.videoCodec&&-1!==c.videoCodec.indexOf("avc1")&&(c.videoCodec=e.convertAVC1ToAVCOTI(c.videoCodec)),n.push(c)}else if(i[3]){var d=new l.AttrList(i[3]);d["DATA-ID"]&&(o=!0,s[d["DATA-ID"]]=d)}return{levels:n,sessionData:o?s:null}},e.parseMasterPlaylistMedia=function(t,r,i,n){var s;void 0===n&&(n=[]);var o=[],a=0;for(d.lastIndex=0;null!==(s=d.exec(t));){var c=new l.AttrList(s[1]);if(c.TYPE===i){var u={attrs:c,bitrate:0,id:a++,groupId:c["GROUP-ID"],instreamId:c["INSTREAM-ID"],name:c.NAME||c.LANGUAGE||"",type:i,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:c.LANGUAGE,url:c.URI?e.resolve(c.URI,r):""};if(n.length){var h=e.findGroup(n,u.groupId)||n[0];_(u,h,"audioCodec"),_(u,h,"textCodec")}o.push(u)}}return o},e.parseLevelPlaylist=function(e,t,r,u,h){var d,v,m,_=new o.LevelDetails(t),b=_.fragments,S=null,w=0,C=0,E=0,k=0,x=null,T=new s.Fragment(u,t),L=-1,A=!1;for(f.lastIndex=0,_.m3u8=e;null!==(d=f.exec(e));){A&&(A=!1,(T=new s.Fragment(u,t)).start=E,T.sn=w,T.cc=k,T.level=r,S&&(T.initSegment=S,T.rawProgramDateTime=S.rawProgramDateTime));var D=d[1];if(D){T.duration=parseFloat(D);var O=(" "+d[2]).slice(1);T.title=O||null,T.tagList.push(O?["INF",D,O]:["INF",D])}else if(d[3])Object(i.isFiniteNumber)(T.duration)&&(T.start=E,m&&(T.levelkey=m),T.sn=w,T.level=r,T.cc=k,T.urlId=h,b.push(T),T.relurl=(" "+d[3]).slice(1),y(T,x),x=T,E+=T.duration,w++,C=0,A=!0);else if(d[4]){var R=(" "+d[4]).slice(1);x?T.setByteRange(R,x):T.setByteRange(R)}else if(d[5])T.rawProgramDateTime=(" "+d[5]).slice(1),T.tagList.push(["PROGRAM-DATE-TIME",T.rawProgramDateTime]),-1===L&&(L=b.length);else{if(!(d=d[0].match(p))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(v=1;v<d.length&&void 0===d[v];v++);var M=(" "+d[v]).slice(1),I=(" "+d[v+1]).slice(1),F=d[v+2]?(" "+d[v+2]).slice(1):"";switch(M){case"PLAYLIST-TYPE":_.type=I.toUpperCase();break;case"MEDIA-SEQUENCE":w=_.startSN=parseInt(I);break;case"SKIP":var P=new l.AttrList(I),N=P.decimalInteger("SKIPPED-SEGMENTS");if(Object(i.isFiniteNumber)(N)){_.skippedSegments=N;for(var B=N;B--;)b.unshift(null);w+=N}var K=P.enumeratedString("RECENTLY-REMOVED-DATERANGES");K&&(_.recentlyRemovedDateranges=K.split("\t"));break;case"TARGETDURATION":_.targetduration=parseFloat(I);break;case"VERSION":_.version=parseInt(I);break;case"EXTM3U":break;case"ENDLIST":_.live=!1;break;case"#":(I||F)&&T.tagList.push(F?[I,F]:[I]);break;case"DIS":k++;case"GAP":T.tagList.push([M]);break;case"BITRATE":T.tagList.push([M,I]);break;case"DISCONTINUITY-SEQ":k=parseInt(I);break;case"KEY":var j,U=new l.AttrList(I),H=U.enumeratedString("METHOD"),X=U.URI,W=U.hexadecimalInteger("IV"),z=U.enumeratedString("KEYFORMATVERSIONS"),G=U.enumeratedString("KEYID"),V=null!=(j=U.enumeratedString("KEYFORMAT"))?j:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(V)>-1){c.logger.warn("Keyformat "+V+" is not supported from the manifest");continue}if("identity"!==V)continue;H&&(m=a.LevelKey.fromURL(t,X),X&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(H)>=0&&(m.method=H,m.keyFormat=V,G&&(m.keyID=G),z&&(m.keyFormatVersions=z),m.iv=W));break;case"START":var q=new l.AttrList(I).decimalFloatingPoint("TIME-OFFSET");Object(i.isFiniteNumber)(q)&&(_.startTimeOffset=q);break;case"MAP":var Q=new l.AttrList(I);T.relurl=Q.URI,Q.BYTERANGE&&T.setByteRange(Q.BYTERANGE),T.level=r,T.sn="initSegment",m&&(T.levelkey=m),T.initSegment=null,S=T,A=!0;break;case"SERVER-CONTROL":var Y=new l.AttrList(I);_.canBlockReload=Y.bool("CAN-BLOCK-RELOAD"),_.canSkipUntil=Y.optionalFloat("CAN-SKIP-UNTIL",0),_.canSkipDateRanges=_.canSkipUntil>0&&Y.bool("CAN-SKIP-DATERANGES"),_.partHoldBack=Y.optionalFloat("PART-HOLD-BACK",0),_.holdBack=Y.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var Z=new l.AttrList(I);_.partTarget=Z.decimalFloatingPoint("PART-TARGET");break;case"PART":var $=_.partList;$||($=_.partList=[]);var J=C>0?$[$.length-1]:void 0,ee=C++,te=new s.Part(new l.AttrList(I),T,t,ee,J);$.push(te),T.duration+=te.duration;break;case"PRELOAD-HINT":var re=new l.AttrList(I);_.preloadHint=re;break;case"RENDITION-REPORT":var ie=new l.AttrList(I);_.renditionReports=_.renditionReports||[],_.renditionReports.push(ie);break;default:c.logger.warn("line parsed but not handled: "+d)}}}x&&!x.relurl?(b.pop(),E-=x.duration,_.partList&&(_.fragmentHint=x)):_.partList&&(y(T,x),T.cc=k,_.fragmentHint=T);var ne=b.length,se=b[0],oe=b[ne-1];if((E+=_.skippedSegments*_.targetduration)>0&&ne&&oe){_.averagetargetduration=E/ne;var ae=oe.sn;_.endSN="initSegment"!==ae?ae:0,se&&(_.startCC=se.cc,se.initSegment||_.fragments.every((function(e){return e.relurl&&(t=e.relurl,g.test(null!=(r=null===(i=n.parseURL(t))||void 0===i?void 0:i.path)?r:""));var t,r,i}))&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(T=new s.Fragment(u,t)).relurl=oe.relurl,T.level=r,T.sn="initSegment",se.initSegment=T,_.needSidxRanges=!0))}else _.endSN=0,_.startCC=0;return _.fragmentHint&&(E+=_.fragmentHint.duration),_.totalduration=E,_.endCC=k,L>0&&function(e,t){for(var r=e[t],i=t;i--;){var n=e[i];if(!n)return;n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}(b,L),_},e}();function m(e,t){["video","audio","text"].forEach((function(r){var i=e.filter((function(e){return Object(u.isCodecType)(e,r)}));if(i.length){var n=i.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=n.length>0?n[0]:i[0],e=e.filter((function(e){return-1===i.indexOf(e)}))}})),t.unknownCodecs=e}function _(e,t,r){var i=t[r];i&&(e[r]=i)}function y(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Object(i.isFiniteNumber)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/loader/playlist-loader.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../events */"./src/events.ts"),s=r(/*! ../errors */"./src/errors.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=r(/*! ./m3u8-parser */"./src/loader/m3u8-parser.ts"),c=r(/*! ../types/loader */"./src/types/loader.ts"),u=r(/*! ../utils/attr-list */"./src/utils/attr-list.ts");function h(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}var d=function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.hls=e,this.registerListeners()}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,i=t.loader,n=new(r||i)(t);return e.loader=n,this.loaders[e.type]=n,n},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){var r=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:c.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var r=t.id,i=t.level,n=t.url,s=t.deliveryDirectives;this.load({id:r,groupId:null,level:i,responseType:"text",type:c.PlaylistContextType.LEVEL,url:n,deliveryDirectives:s})},t.onAudioTrackLoading=function(e,t){var r=t.id,i=t.groupId,n=t.url,s=t.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:c.PlaylistContextType.AUDIO_TRACK,url:n,deliveryDirectives:s})},t.onSubtitleTrackLoading=function(e,t){var r=t.id,i=t.groupId,n=t.url,s=t.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:c.PlaylistContextType.SUBTITLE_TRACK,url:n,deliveryDirectives:s})},t.load=function(e){var t,r,i,n,s,a,l=this.hls.config,u=this.getInternalLoader(e);if(u){var h=u.context;if(h&&h.url===e.url)return void o.logger.trace("[playlist-loader]: playlist request ongoing");o.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),u.abort()}switch(e.type){case c.PlaylistContextType.MANIFEST:r=l.manifestLoadingMaxRetry,i=l.manifestLoadingTimeOut,n=l.manifestLoadingRetryDelay,s=l.manifestLoadingMaxRetryTimeout;break;case c.PlaylistContextType.LEVEL:case c.PlaylistContextType.AUDIO_TRACK:case c.PlaylistContextType.SUBTITLE_TRACK:r=0,i=l.levelLoadingTimeOut;break;default:r=l.levelLoadingMaxRetry,i=l.levelLoadingTimeOut,n=l.levelLoadingRetryDelay,s=l.levelLoadingMaxRetryTimeout}if(u=this.createInternalLoader(e),null!==(t=e.deliveryDirectives)&&void 0!==t&&t.part&&(e.type===c.PlaylistContextType.LEVEL&&null!==e.level?a=this.hls.levels[e.level].details:e.type===c.PlaylistContextType.AUDIO_TRACK&&null!==e.id?a=this.hls.audioTracks[e.id].details:e.type===c.PlaylistContextType.SUBTITLE_TRACK&&null!==e.id&&(a=this.hls.subtitleTracks[e.id].details),a)){var d=a.partTarget,f=a.targetduration;d&&f&&(i=Math.min(1e3*Math.max(3*d,.8*f),i))}var p={timeout:i,maxRetry:r,retryDelay:n,maxRetryDelay:s,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(e,p,g)},t.loadsuccess=function(e,t,r,i){if(void 0===i&&(i=null),r.isSidxRequest)return this.handleSidxRequest(e,r),void this.handlePlaylistLoaded(e,t,r,i);this.resetInternalLoader(r.type);var n=e.data;0===n.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,t,r,i):this.handleMasterPlaylist(e,t,r,i)):this.handleManifestParsingError(e,r,"no EXTM3U delimiter",i)},t.loaderror=function(e,t,r){void 0===r&&(r=null),this.handleNetworkError(t,r,!1,e)},t.loadtimeout=function(e,t,r){void 0===r&&(r=null),this.handleNetworkError(t,r,!0)},t.handleMasterPlaylist=function(e,t,r,i){var s=this.hls,a=e.data,c=h(e,r),d=l.default.parseMasterPlaylist(a,c),f=d.levels,p=d.sessionData;if(f.length){var g=f.map((function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}})),v=f.map((function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}})),m=l.default.parseMasterPlaylistMedia(a,c,"AUDIO",g),_=l.default.parseMasterPlaylistMedia(a,c,"SUBTITLES",v),y=l.default.parseMasterPlaylistMedia(a,c,"CLOSED-CAPTIONS");m.length&&(m.some((function(e){return!e.url}))||!f[0].audioCodec||f[0].attrs.AUDIO||(o.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))),s.trigger(n.Events.MANIFEST_LOADED,{levels:f,audioTracks:m,subtitles:_,captions:y,url:c,stats:t,networkDetails:i,sessionData:p})}else this.handleManifestParsingError(e,r,"no level found in manifest",i)},t.handleTrackOrLevelPlaylist=function(e,t,r,o){var a=this.hls,d=r.id,f=r.level,p=r.type,g=h(e,r),v=Object(i.isFiniteNumber)(d)?d:0,m=Object(i.isFiniteNumber)(f)?f:v,_=function(e){switch(e.type){case c.PlaylistContextType.AUDIO_TRACK:return c.PlaylistLevelType.AUDIO;case c.PlaylistContextType.SUBTITLE_TRACK:return c.PlaylistLevelType.SUBTITLE;default:return c.PlaylistLevelType.MAIN}}(r),y=l.default.parseLevelPlaylist(e.data,g,m,_,v);if(y.fragments.length){if(p===c.PlaylistContextType.MANIFEST){var b={attrs:new u.AttrList({}),bitrate:0,details:y,name:"",url:g};a.trigger(n.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:g,stats:t,networkDetails:o,sessionData:null})}if(t.parsing.end=performance.now(),y.needSidxRanges){var S,w=null===(S=y.fragments[0].initSegment)||void 0===S?void 0:S.url;this.load({url:w,isSidxRequest:!0,type:p,level:f,levelDetails:y,id:d,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else r.levelDetails=y,this.handlePlaylistLoaded(e,t,r,o)}else a.trigger(n.Events.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0})},t.handleSidxRequest=function(e,t){var r=Object(a.parseSegmentIndex)(new Uint8Array(e.data));if(r){var i=r.references,n=t.levelDetails;i.forEach((function(e,t){var i=e.info,s=n.fragments[t];0===s.byteRange.length&&s.setByteRange(String(1+i.end-i.start)+"@"+String(i.start)),s.initSegment&&s.initSegment.setByteRange(String(r.moovEndOffset)+"@0")}))}},t.handleManifestParsingError=function(e,t,r,i){this.hls.trigger(n.Events.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===c.PlaylistContextType.MANIFEST,url:e.url,reason:r,response:e,context:t,networkDetails:i})},t.handleNetworkError=function(e,t,r,i){void 0===r&&(r=!1),o.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var a=s.ErrorDetails.UNKNOWN,l=!1,u=this.getInternalLoader(e);switch(e.type){case c.PlaylistContextType.MANIFEST:a=r?s.ErrorDetails.MANIFEST_LOAD_TIMEOUT:s.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case c.PlaylistContextType.LEVEL:a=r?s.ErrorDetails.LEVEL_LOAD_TIMEOUT:s.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.AUDIO_TRACK:a=r?s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.SUBTITLE_TRACK:a=r?s.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:s.ErrorDetails.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(e.type);var h={type:s.ErrorTypes.NETWORK_ERROR,details:a,fatal:l,url:e.url,loader:u,context:e,networkDetails:t};i&&(h.response=i),this.hls.trigger(n.Events.ERROR,h)},t.handlePlaylistLoaded=function(e,t,r,i){var s=r.type,o=r.level,a=r.id,l=r.groupId,u=r.loader,h=r.levelDetails,d=r.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),s){case c.PlaylistContextType.MANIFEST:case c.PlaylistContextType.LEVEL:this.hls.trigger(n.Events.LEVEL_LOADED,{details:h,level:o||0,id:a||0,stats:t,networkDetails:i,deliveryDirectives:d});break;case c.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(n.Events.AUDIO_TRACK_LOADED,{details:h,id:a||0,groupId:l||"",stats:t,networkDetails:i,deliveryDirectives:d});break;case c.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADED,{details:h,id:a||0,groupId:l||"",stats:t,networkDetails:i,deliveryDirectives:d})}}else this.handleManifestParsingError(e,r,"invalid target duration",i)},e}();t.default=d},"./src/polyfills/number.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/polyfills/number.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: isFiniteNumber, MAX_SAFE_INTEGER */function(e,t,r){"use strict";r.r(t),r.d(t,"isFiniteNumber",(function(){return i})),r.d(t,"MAX_SAFE_INTEGER",(function(){return n}));var i=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},n=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/remux/aac-helper.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=function(){function e(){}return e.getSilentFrame=function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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(6===t)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(1===t)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(2===t)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(3===t)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])}},e}();t.default=i},"./src/remux/mp4-generator.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/remux/mp4-generator.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=Math.pow(2,32)-1,n=function(){function e(){}return e.init=function(){var t;for(t in e.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:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:r,audio:i};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=s,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,l,o,a),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,n))},e.box=function(e){for(var t=8,r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];for(var s=i.length,o=s;s--;)t+=i[s].byteLength;var a=new Uint8Array(t);for(a[0]=t>>24&255,a[1]=t>>16&255,a[2]=t>>8&255,a[3]=255&t,a.set(e,4),s=0,t=8;s<o;s++)a.set(i[s],t),t+=i[s].byteLength;return a},e.hdlr=function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])},e.mdat=function(t){return e.box(e.types.mdat,t)},e.mdhd=function(t,r){r*=t;var n=Math.floor(r/(i+1)),s=Math.floor(r%(i+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,s>>24,s>>16&255,s>>8&255,255&s,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,r,i){return e.box(e.types.moof,e.mfhd(t),e.traf(i,r))},e.moov=function(t){for(var r=t.length,i=[];r--;)i[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(e.mvex(t)))},e.mvex=function(t){for(var r=t.length,i=[];r--;)i[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(i))},e.mvhd=function(t,r){r*=t;var n=Math.floor(r/(i+1)),s=Math.floor(r%(i+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,s>>24,s>>16&255,s>>8&255,255&s,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 e.box(e.types.mvhd,o)},e.sdtp=function(t){var r,i,n=t.samples||[],s=new Uint8Array(4+n.length);for(r=0;r<n.length;r++)i=n[r].flags,s[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return e.box(e.types.sdtp,s)},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(t){var r,i,n,s=[],o=[];for(r=0;r<t.sps.length;r++)n=(i=t.sps[r]).byteLength,s.push(n>>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(i));for(r=0;r<t.pps.length;r++)n=(i=t.pps[r]).byteLength,o.push(n>>>8&255),o.push(255&n),o=o.concat(Array.prototype.slice.call(i));var a=e.box(e.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|t.sps.length].concat(s).concat([t.pps.length]).concat(o))),l=t.width,c=t.height,u=t.pixelRatio[0],h=t.pixelRatio[1];return e.box(e.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,l>>8&255,255&l,c>>8&255,255&c,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,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,h>>24,h>>16&255,h>>8&255,255&h])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},e.stsd=function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var r=t.id,n=t.duration*t.timescale,s=t.width,o=t.height,a=Math.floor(n/(i+1)),l=Math.floor(n%(i+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,l>>24,l>>16&255,l>>8&255,255&l,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,s>>8&255,255&s,0,0,o>>8&255,255&o,0,0]))},e.traf=function(t,r){var n=e.sdtp(t),s=t.id,o=Math.floor(r/(i+1)),a=Math.floor(r%(i+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,a>>24,a>>16&255,a>>8&255,255&a])),e.trun(t,n.length+16+20+8+16+8+8),n)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,r){var i,n,s,o,a,l,c=t.samples||[],u=c.length,h=12+16*u,d=new Uint8Array(h);for(r+=8+h,d.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i<u;i++)s=(n=c[i]).duration,o=n.size,a=n.flags,l=n.cts,d.set([s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,61440&a.degradPrio,15&a.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return e.box(e.types.trun,d)},e.initSegment=function(t){e.types||e.init();var r=e.moov(t),i=new Uint8Array(e.FTYP.byteLength+r.byteLength);return i.set(e.FTYP),i.set(r,e.FTYP.byteLength),i},e}();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0,t.default=n},"./src/remux/mp4-remuxer.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/remux/mp4-remuxer.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default, normalizePts */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return g})),r.d(t,"normalizePts",(function(){return v}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ./aac-helper */"./src/remux/aac-helper.ts"),s=r(/*! ./mp4-generator */"./src/remux/mp4-generator.ts"),o=r(/*! ../events */"./src/events.ts"),a=r(/*! ../errors */"./src/errors.ts"),l=r(/*! ../utils/logger */"./src/utils/logger.ts"),c=r(/*! ../types/loader */"./src/types/loader.ts"),u=r(/*! ../utils/timescale-conversion */"./src/utils/timescale-conversion.ts");function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}var d=null,f=null,p=!1,g=function(){function e(e,t,r,i){if(void 0===i&&(i=""),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=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,null===d){var n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);d=n?parseInt(n[1]):0}if(null===f){var s=navigator.userAgent.match(/Safari\/(\d+)/i);f=s?parseInt(s[1]):0}p=!!d&&d<75||!!f&&f<600}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){l.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e},t.resetNextTimestamp=function(){l.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},t.resetInitSegment=function(){l.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},t.getVideoStartPts=function(e){var t=!1,r=e.reduce((function(e,r){var i=r.pts-e;return i<-4294967296?(t=!0,v(e,r.pts)):i>0?e:r.pts}),e[0].pts);return t&&l.logger.debug("PTS rollover detected"),r},t.remux=function(e,t,r,i,n,s,o,a){var u,h,d,f,p,g,m=n,_=n,y=e.pid>-1,b=t.pid>-1,S=t.samples.length,w=e.samples.length>0,C=S>1;if((!y||w)&&(!b||C)||this.ISGenerated||o){this.ISGenerated||(d=this.generateIS(e,t,n));var E=this.isVideoContiguous,k=-1;if(C&&(k=function(e){for(var t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!E&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,k>0){l.logger.warn("[mp4-remuxer]: Dropped "+k+" out of "+S+" video samples due to a missing keyframe");var x=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(k),t.dropped+=k,_+=(t.samples[0].pts-x)/(t.timescale||9e4)}else-1===k&&(l.logger.warn("[mp4-remuxer]: No keyframe found out of "+S+" video samples"),g=!1);if(this.ISGenerated){if(w&&C){var T=this.getVideoStartPts(t.samples),L=(v(e.samples[0].pts,T)-T)/t.inputTimeScale;m+=Math.max(0,L),_+=Math.max(0,-L)}if(w){if(e.samplerate||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(e,t,n)),h=this.remuxAudio(e,m,this.isAudioContiguous,s,b||C||a===c.PlaylistLevelType.AUDIO?_:void 0),C){var A=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(e,t,n)),u=this.remuxVideo(t,_,E,A)}}else C&&(u=this.remuxVideo(t,_,E,0));u&&(u.firstKeyFrame=k,u.independent=-1!==k)}}return this.ISGenerated&&(r.samples.length&&(p=this.remuxID3(r,n)),i.samples.length&&(f=this.remuxText(i,n))),{audio:h,video:u,initSegment:d,independent:g,text:f,id3:p}},t.generateIS=function(e,t,r){var n,o,a,l=e.samples,c=t.samples,u=this.typeSupported,h={},d=!Object(i.isFiniteNumber)(this._initPTS),f="audio/mp4";if(d&&(n=o=1/0),e.config&&l.length&&(e.timescale=e.samplerate,e.isAAC||(u.mpeg?(f="audio/mpeg",e.codec=""):u.mp3&&(e.codec="mp3")),h.audio={id:"audio",container:f,codec:e.codec,initSegment:!e.isAAC&&u.mpeg?new Uint8Array(0):s.default.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(a=e.inputTimeScale,n=o=l[0].pts-Math.round(a*r))),t.sps&&t.pps&&c.length&&(t.timescale=t.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:s.default.initSegment([t]),metadata:{width:t.width,height:t.height}},d)){a=t.inputTimeScale;var p=this.getVideoStartPts(c),g=Math.round(a*r);o=Math.min(o,v(c[0].dts,p)-g),n=Math.min(n,p-g)}if(Object.keys(h).length)return this.ISGenerated=!0,d&&(this._initPTS=n,this._initDTS=o),{tracks:h,initPTS:n,timescale:a}},t.remuxVideo=function(e,t,r,i){var n,c,f,g=e.inputTimeScale,_=e.samples,y=[],b=_.length,S=this._initPTS,w=this.nextAvcDts,C=8,E=Number.POSITIVE_INFINITY,k=Number.NEGATIVE_INFINITY,x=0,T=!1;r&&null!==w||(w=t*g-(_[0].pts-v(_[0].dts,_[0].pts)));for(var L=0;L<b;L++){var A=_[L];A.pts=v(A.pts-S,w),A.dts=v(A.dts-S,w),A.dts>A.pts&&(x=Math.max(Math.min(x,A.pts-A.dts),-18e3)),A.dts<_[L>0?L-1:L].dts&&(T=!0)}T&&_.sort((function(e,t){var r=e.dts-t.dts,i=e.pts-t.pts;return r||i})),c=_[0].dts,f=_[_.length-1].dts;var D=Math.round((f-c)/(b-1));if(x<0){if(x<-2*D){l.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(u.toMsFromMpegTsClock)(-D,!0)+" ms");for(var O=x,R=0;R<b;R++)_[R].dts=O=Math.max(O,_[R].pts-D),_[R].pts=Math.max(O,_[R].pts)}else{l.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(u.toMsFromMpegTsClock)(x,!0)+" ms to overcome this issue");for(var M=0;M<b;M++)_[M].dts=_[M].dts+x}c=_[0].dts}if(r){var I=c-w,F=I>D;if(F||I<-1){F?l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(I,!0)+" ms ("+I+"dts) hole between fragments detected, filling it"):l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(-I,!0)+" ms ("+I+"dts) overlapping between fragments detected"),c=w;var P=_[0].pts-I;_[0].dts=c,_[0].pts=P,l.logger.log("Video: First PTS/DTS adjusted: "+Object(u.toMsFromMpegTsClock)(P,!0)+"/"+Object(u.toMsFromMpegTsClock)(c,!0)+", delta: "+Object(u.toMsFromMpegTsClock)(I,!0)+" ms")}}p&&(c=Math.max(0,c));for(var N=0,B=0,K=0;K<b;K++){for(var j=_[K],U=j.units,H=U.length,X=0,W=0;W<H;W++)X+=U[W].data.length;B+=X,N+=H,j.length=X,j.dts=Math.max(j.dts,c),j.pts=Math.max(j.pts,j.dts,0),E=Math.min(j.pts,E),k=Math.max(j.pts,k)}f=_[b-1].dts;var z,G=B+4*N+8;try{z=new Uint8Array(G)}catch(e){return void this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:G,reason:"fail allocating video mdat "+G})}var V=new DataView(z.buffer);V.setUint32(0,G),z.set(s.default.types.mdat,4);for(var q=0;q<b;q++){for(var Q=_[q],Y=Q.units,Z=0,$=0,J=Y.length;$<J;$++){var ee=Y[$],te=ee.data,re=ee.data.byteLength;V.setUint32(C,re),C+=4,z.set(te,C),C+=re,Z+=4+re}if(q<b-1)n=_[q+1].dts-Q.dts;else{var ie=this.config,ne=Q.dts-_[q>0?q-1:q].dts;if(ie.stretchShortVideoTrack&&null!==this.nextAudioPts){var se=Math.floor(ie.maxBufferHole*g),oe=(i?E+i*g:this.nextAudioPts)-Q.pts;oe>se?((n=oe-ne)<0&&(n=ne),l.logger.log("[mp4-remuxer]: It is approximately "+oe/90+" ms to the next segment; using duration "+n/90+" ms for the last video frame.")):n=ne}else n=ne}var ae=Math.round(Q.pts-Q.dts);y.push(new m(Q.key,n,Z,ae))}if(y.length&&d&&d<70){var le=y[0].flags;le.dependsOn=2,le.isNonSync=0}console.assert(void 0!==n,"mp4SampleDuration must be computed"),this.nextAvcDts=w=f+n,this.isVideoContiguous=!0;var ce={data1:s.default.moof(e.sequenceNumber++,c,h({},e,{samples:y})),data2:z,startPTS:E/g,endPTS:(k+n)/g,startDTS:c/g,endDTS:w/g,type:"video",hasAudio:!1,hasVideo:!0,nb:y.length,dropped:e.dropped};return e.samples=[],e.dropped=0,console.assert(z.length,"MDAT length must not be zero"),ce},t.remuxAudio=function(e,t,r,i,c){var u=e.inputTimeScale,d=u/(e.samplerate?e.samplerate:u),f=e.isAAC?1024:1152,p=f*d,g=this._initPTS,_=!e.isAAC&&this.typeSupported.mpeg,y=[],b=e.samples,S=_?0:8,w=this.nextAudioPts||-1,C=t*u;if(this.isAudioContiguous=r=r||b.length&&w>0&&(i&&Math.abs(C-w)<9e3||Math.abs(v(b[0].pts-g,C)-w)<20*p),b.forEach((function(e){e.pts=v(e.pts-g,C)})),!r||w<0){if(!(b=b.filter((function(e){return e.pts>=0}))).length)return;w=0===c?0:i?Math.max(0,C):b[0].pts}if(e.isAAC)for(var E=void 0!==c,k=this.config.maxAudioFramesDrift,x=0,T=w;x<b.length;x++){var L=b[x],A=L.pts,D=A-T,O=Math.abs(1e3*D/u);if(D<=-k*p&&E)0===x&&(l.logger.warn("Audio frame @ "+(A/u).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*D/u)+" ms."),this.nextAudioPts=w=T=A);else if(D>=k*p&&O<1e4&&E){var R=Math.round(D/p);(T=A-R*p)<0&&(R--,T+=p),0===x&&(this.nextAudioPts=w=T),l.logger.warn("[mp4-remuxer]: Injecting "+R+" audio frame @ "+(T/u).toFixed(3)+"s due to "+Math.round(1e3*D/u)+" ms gap.");for(var M=0;M<R;M++){var I=Math.max(T,0),F=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);F||(l.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),F=L.unit.subarray()),b.splice(x,0,{unit:F,pts:I}),T+=p,x++}}L.pts=T,T+=p}for(var P,N=null,B=null,K=0,j=b.length;j--;)K+=b[j].unit.byteLength;for(var U=0,H=b.length;U<H;U++){var X=b[U],W=X.unit,z=X.pts;if(null!==B)y[U-1].duration=Math.round((z-B)/d);else{if(r&&e.isAAC&&(z=w),N=z,!(K>0))return;K+=S;try{P=new Uint8Array(K)}catch(e){return void this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:"fail allocating audio mdat "+K})}_||(new DataView(P.buffer).setUint32(0,K),P.set(s.default.types.mdat,4))}P.set(W,S);var G=W.byteLength;S+=G,y.push(new m(!0,f,G,0)),B=z}var V=y.length;if(V){var q=y[y.length-1];this.nextAudioPts=w=B+d*q.duration;var Q=_?new Uint8Array(0):s.default.moof(e.sequenceNumber++,N/d,h({},e,{samples:y}));e.samples=[];var Y=N/u,Z=w/u,$={data1:Q,data2:P,startPTS:Y,endPTS:Z,startDTS:Y,endDTS:Z,type:"audio",hasAudio:!0,hasVideo:!1,nb:V};return this.isAudioContiguous=!0,console.assert(P.length,"MDAT length must not be zero"),$}},t.remuxEmptyAudio=function(e,t,r,i){var s=e.inputTimeScale,o=s/(e.samplerate?e.samplerate:s),a=this.nextAudioPts,c=(null!==a?a:i.startDTS*s)+this._initDTS,u=i.endDTS*s+this._initDTS,h=1024*o,d=Math.ceil((u-c)/h),f=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(l.logger.warn("[mp4-remuxer]: remux empty Audio"),f){for(var p=[],g=0;g<d;g++){var v=c+g*h;p.push({unit:f,pts:v,dts:v})}return e.samples=p,this.remuxAudio(e,t,r,!1)}l.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},t.remuxID3=function(e,t){var r=e.samples.length;if(r){for(var i=e.inputTimeScale,n=this._initPTS,s=this._initDTS,o=0;o<r;o++){var a=e.samples[o];a.pts=v(a.pts-n,t*i)/i,a.dts=v(a.dts-s,t*i)/i}var l=e.samples;return e.samples=[],{samples:l}}},t.remuxText=function(e,t){var r=e.samples.length;if(r){for(var i=e.inputTimeScale,n=this._initPTS,s=0;s<r;s++){var o=e.samples[s];o.pts=v(o.pts-n,t*i)/i}e.samples.sort((function(e,t){return e.pts-t.pts}));var a=e.samples;return e.samples=[],{samples:a}}},e}();function v(e,t){var r;if(null===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e}var m=function(e,t,r,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=r,this.cts=i,this.flags=new _(e)},_=function(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}},"./src/remux/passthrough-remuxer.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/remux/passthrough-remuxer.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),s=r(/*! ../loader/fragment */"./src/loader/fragment.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=function(){function e(){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 t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){this.initPTS=e,this.lastEndDTS=null},t.resetNextTimestamp=function(){this.lastEndDTS=null},t.resetInitSegment=function(e,t,r){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e),this.emitInitSegment=!0},t.generateInitSegment=function(e){var t=this.audioCodec,r=this.videoCodec;if(!e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var i=this.initData=Object(n.parseInitSegment)(e);t||(t=c(i.audio,s.ElementaryStreamTypes.AUDIO)),r||(r=c(i.video,s.ElementaryStreamTypes.VIDEO));var a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:e,id:"main"}:i.audio?a.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?a.video={container:"video/mp4",codec:r,initSegment:e,id:"main"}:o.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},t.remux=function(e,t,r,s,a){var c=this.initPTS,u=this.lastEndDTS,h={audio:void 0,video:void 0,text:s,id3:r,initSegment:void 0};Object(i.isFiniteNumber)(u)||(u=this.lastEndDTS=a||0);var d=t.samples;if(!d||!d.length)return h;var f={initPTS:void 0,timescale:1},p=this.initData;if(p&&p.length||(this.generateInitSegment(d),p=this.initData),!p||!p.length)return o.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(i.isFiniteNumber)(c)||(this.initPTS=f.initPTS=c=l(p,d,u));var g=Object(n.getDuration)(d,p),v=u,m=g+v;Object(n.offsetStartDTS)(p,d,c),g>0?this.lastEndDTS=m:(o.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var _=!!p.audio,y=!!p.video,b="";_&&(b+="audio"),y&&(b+="video");var S={data1:d,startPTS:v,startDTS:v,endPTS:m,endDTS:m,type:b,hasAudio:_,hasVideo:y,nb:1,dropped:0};return h.audio="audio"===S.type?S:void 0,h.video="audio"!==S.type?S:void 0,h.text=s,h.id3=r,h.initSegment=f,h},e}(),l=function(e,t,r){return Object(n.getStartDTS)(e,t)-r};function c(e,t){var r=null==e?void 0:e.codec;return r&&r.length>4?r:"hvc1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||t===s.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=a},"./src/task-loop.ts":
|
|
|
/*!**************************!*\
|
|
|
!*** ./src/task-loop.ts ***!
|
|
|
\**************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var i=function(){function e(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var t=e.prototype;return t.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},t.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},t.onHandlerDestroyed=function(){},t.hasInterval=function(){return!!this._tickInterval},t.hasNextTick=function(){return!!this._tickTimer},t.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,e),!0)},t.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},t.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},t.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},t.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},t.doTick=function(){},e}()},"./src/types/cmcd.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/types/cmcd.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: CMCDVersion, CMCDObjectType, CMCDStreamingFormat, CMCDStreamType */function(e,t,r){"use strict";r.r(t),r.d(t,"CMCDVersion",(function(){return o})),r.d(t,"CMCDObjectType",(function(){return i})),r.d(t,"CMCDStreamingFormat",(function(){return n})),r.d(t,"CMCDStreamType",(function(){return s}));var i,n,s,o=1;!function(e){e.MANIFEST="m",e.AUDIO="a",e.VIDEO="v",e.MUXED="av",e.INIT="i",e.CAPTION="c",e.TIMED_TEXT="tt",e.KEY="k",e.OTHER="o"}(i||(i={})),function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"}(n||(n={})),function(e){e.VOD="v",e.LIVE="l"}(s||(s={}))},"./src/types/level.ts":
|
|
|
/*!****************************!*\
|
|
|
!*** ./src/types/level.ts ***!
|
|
|
\****************************/
|
|
|
/*! exports provided: HlsSkip, getSkipValue, HlsUrlParameters, Level */function(e,t,r){"use strict";function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var n;function s(e,t){var r=e.canSkipUntil,i=e.canSkipDateRanges,s=e.endSN;return r&&(void 0!==t?t-s:0)<r?i?n.v2:n.Yes:n.No}r.r(t),r.d(t,"HlsSkip",(function(){return n})),r.d(t,"getSkipValue",(function(){return s})),r.d(t,"HlsUrlParameters",(function(){return o})),r.d(t,"Level",(function(){return a})),function(e){e.No="",e.Yes="YES",e.v2="v2"}(n||(n={}));var o=function(){function e(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}return e.prototype.addDirectives=function(e){var t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.toString()},e}(),a=function(){function e(e){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=[e.url],this.attrs=e.attrs,this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter((function(e){return e})).join(",").replace(/\.[^.,]+/g,"")}var t,r,n;return t=e,(r=[{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(e){var t=e%this.url.length;this._urlId!==t&&(this.details=void 0,this._urlId=t)}}])&&i(t.prototype,r),n&&i(t,n),e}()},"./src/types/loader.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/types/loader.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: PlaylistContextType, PlaylistLevelType */function(e,t,r){"use strict";var i,n;r.r(t),r.d(t,"PlaylistContextType",(function(){return i})),r.d(t,"PlaylistLevelType",(function(){return n})),function(e){e.MANIFEST="manifest",e.LEVEL="level",e.AUDIO_TRACK="audioTrack",e.SUBTITLE_TRACK="subtitleTrack"}(i||(i={})),function(e){e.MAIN="main",e.AUDIO="audio",e.SUBTITLE="subtitle"}(n||(n={}))},"./src/types/transmuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/types/transmuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: ChunkMetadata */function(e,t,r){"use strict";r.r(t),r.d(t,"ChunkMetadata",(function(){return i}));var i=function(e,t,r,i,n,s){void 0===i&&(i=0),void 0===n&&(n=-1),void 0===s&&(s=!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={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=r,this.size=i,this.part=n,this.partial=s}},"./src/utils/attr-list.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/attr-list.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: AttrList */function(e,t,r){"use strict";r.r(t),r.d(t,"AttrList",(function(){return s}));var i=/^(\d+)x(\d+)$/,n=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,s=function(){function e(t){for(var r in"string"==typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(r)&&(this[r]=t[r])}var t=e.prototype;return t.decimalInteger=function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),i=0;i<t.length/2;i++)r[i]=parseInt(t.slice(2*i,2*i+2),16);return r}return null},t.hexadecimalIntegerAsNumber=function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var r=this[e];return r?parseFloat(r):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=i.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,r={};for(n.lastIndex=0;null!==(t=n.exec(e));){var i=t[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[t[1]]=i}return r},e}()},"./src/utils/binary-search.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/binary-search.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),t.default={search:function(e,t){for(var r=0,i=e.length-1,n=null,s=null;r<=i;){var o=t(s=e[n=(r+i)/2|0]);if(o>0)r=n+1;else{if(!(o<0))return s;i=n-1}}return null}}},"./src/utils/buffer-helper.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/buffer-helper.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: BufferHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"BufferHelper",(function(){return s}));var i=r(/*! ./logger */"./src/utils/logger.ts"),n={length:0,start:function(){return 0},end:function(){return 0}},s=function(){function e(){}return e.isBuffered=function(t,r){try{if(t)for(var i=e.getBuffered(t),n=0;n<i.length;n++)if(r>=i.start(n)&&r<=i.end(n))return!0}catch(e){}return!1},e.bufferInfo=function(t,r,i){try{if(t){var n,s=e.getBuffered(t),o=[];for(n=0;n<s.length;n++)o.push({start:s.start(n),end:s.end(n)});return this.bufferedInfo(o,r,i)}}catch(e){}return{len:0,start:r,end:r,nextStart:void 0}},e.bufferedInfo=function(e,t,r){t=Math.max(0,t),e.sort((function(e,t){var r=e.start-t.start;return r||t.end-e.end}));var i=[];if(r)for(var n=0;n<e.length;n++){var s=i.length;if(s){var o=i[s-1].end;e[n].start-o<r?e[n].end>o&&(i[s-1].end=e[n].end):i.push(e[n])}else i.push(e[n])}else i=e;for(var a,l=0,c=t,u=t,h=0;h<i.length;h++){var d=i[h].start,f=i[h].end;if(t+r>=d&&t<f)c=d,l=(u=f)-t;else if(t+r<d){a=d;break}}return{len:l,start:c||0,end:u||0,nextStart:a}},e.getBuffered=function(e){try{return e.buffered}catch(e){return i.logger.log("failed to get media.buffered",e),n}},e}()},"./src/utils/cea-608-parser.ts":
|
|
|
/*!*************************************!*\
|
|
|
!*** ./src/utils/cea-608-parser.ts ***!
|
|
|
\*************************************/
|
|
|
/*! exports provided: Row, CaptionScreen, default */function(e,t,r){"use strict";r.r(t),r.d(t,"Row",(function(){return v})),r.d(t,"CaptionScreen",(function(){return m}));var i,n=r(/*! ../utils/logger */"./src/utils/logger.ts"),s={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},o=function(e){var t=e;return s.hasOwnProperty(e)&&(t=s[e]),String.fromCharCode(t)},a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},l={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(e){e[e.ERROR=0]="ERROR",e[e.TEXT=1]="TEXT",e[e.WARNING=2]="WARNING",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG",e[e.DATA=3]="DATA"}(i||(i={}));var d=function(){function e(){this.time=null,this.verboseLevel=i.ERROR}return e.prototype.log=function(e,t){this.verboseLevel>=e&&n.logger.log(this.time+" ["+e+"] "+t)},e}(),f=function(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].toString(16));return t},p=function(){function e(e,t,r,i,n){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=r||!1,this.background=i||"black",this.flash=n||!1}var t=e.prototype;return t.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.setStyles=function(e){for(var t=["foreground","underline","italics","background","flash"],r=0;r<t.length;r++){var i=t[r];e.hasOwnProperty(i)&&(this[i]=e[i])}},t.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.equals=function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},t.copy=function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},t.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},e}(),g=function(){function e(e,t,r,i,n,s){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new p(t,r,i,n,s)}var t=e.prototype;return t.reset=function(){this.uchar=" ",this.penState.reset()},t.setChar=function(e,t){this.uchar=e,this.penState.copy(t)},t.setPenState=function(e){this.penState.copy(e)},t.equals=function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},t.copy=function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},t.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},e}(),v=function(){function e(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var t=0;t<100;t++)this.chars.push(new g);this.logger=e,this.pos=0,this.currPenState=new p}var t=e.prototype;return t.equals=function(e){for(var t=!0,r=0;r<100;r++)if(!this.chars[r].equals(e.chars[r])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<100;t++)this.chars[t].copy(e.chars[t])},t.isEmpty=function(){for(var e=!0,t=0;t<100;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},t.setCursor=function(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(i.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(i.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)},t.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.insertChar=function(e){e>=144&&this.backSpace();var t=o(e);this.pos>=100?this.logger.log(i.ERROR,"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},t.clearFromPos=function(e){var t;for(t=e;t<100;t++)this.chars[t].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 e=[],t=!0,r=0;r<100;r++){var i=this.chars[r].uchar;" "!==i&&(t=!1),e.push(i)}return t?"":e.join("")},t.setPenStyles=function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)},e}(),m=function(){function e(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var t=0;t<15;t++)this.rows.push(new v(e));this.logger=e,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var t=e.prototype;return t.reset=function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},t.equals=function(e){for(var t=!0,r=0;r<15;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},t.isEmpty=function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},t.backSpace=function(){this.rows[this.currRow].backSpace()},t.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.insertChar=function(e){this.rows[this.currRow].insertChar(e)},t.setPen=function(e){this.rows[this.currRow].setPenStyles(e)},t.moveCursor=function(e){this.rows[this.currRow].moveCursor(e)},t.setCursor=function(e){this.logger.log(i.INFO,"setCursor: "+e),this.rows[this.currRow].setCursor(e)},t.setPAC=function(e){this.logger.log(i.INFO,"pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var r=0;r<15;r++)this.rows[r].clear();var n=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){var o=s.rows[n].cueStartTime,a=this.logger.time;if(o&&null!==a&&o<a)for(var l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(s.rows[n+l])}}this.currRow=t;var c=this.rows[this.currRow];if(null!==e.indent){var u=e.indent,h=Math.max(u-1,0);c.setCursor(e.indent),e.color=c.chars[h].penState.foreground}var d={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(d)},t.setBkgData=function(e){this.logger.log(i.INFO,"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},t.setRollUpRows=function(e){this.nrRollUpRows=e},t.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(i.TEXT,this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(i.INFO,"Rolling up")}else this.logger.log(i.DEBUG,"roll_up but nrRollUpRows not set yet")},t.getDisplayText=function(e){e=e||!1;for(var t=[],r="",i=-1,n=0;n<15;n++){var s=this.rows[n].getTextString();s&&(i=n+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},t.getTextAndFormat=function(){return this.rows},e}(),_=function(){function e(e,t,r){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=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new m(r),this.nonDisplayedMemory=new m(r),this.lastOutputScreen=new m(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var t=e.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[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(i.INFO,"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},t.insertChars=function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(i.INFO,r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(i.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},t.ccRCL=function(){this.logger.log(i.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.ccBS=function(){this.logger.log(i.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},t.ccAOF=function(){},t.ccAON=function(){},t.ccDER=function(){this.logger.log(i.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.ccRU=function(e){this.logger.log(i.INFO,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},t.ccFON=function(){this.logger.log(i.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.ccRDC=function(){this.logger.log(i.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},t.ccTR=function(){this.logger.log(i.INFO,"TR"),this.setMode("MODE_TEXT")},t.ccRTD=function(){this.logger.log(i.INFO,"RTD"),this.setMode("MODE_TEXT")},t.ccEDM=function(){this.logger.log(i.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.ccCR=function(){this.logger.log(i.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.ccENM=function(){this.logger.log(i.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.ccEOC=function(){if(this.logger.log(i.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(i.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},t.ccTO=function(e){this.logger.log(i.INFO,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},t.ccMIDROW=function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(i.INFO,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e}(),y=function(){function e(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var i=new d;this.channels=[null,new _(e,t,i),new _(e+1,r,i)],this.cmdHistory={a:null,b:null},this.logger=i}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var r,n,s,o=!1;this.logger.time=e;for(var a=0;a<t.length;a+=2)if(n=127&t[a],s=127&t[a+1],0!==n||0!==s){if(this.logger.log(i.DATA,"["+f([t[a],t[a+1]])+"] -> ("+f([n,s])+")"),(r=this.parseCmd(n,s))||(r=this.parseMidrow(n,s)),r||(r=this.parsePAC(n,s)),r||(r=this.parseBackgroundAttributes(n,s)),!r&&(o=this.parseChars(n,s))){var l=this.currentChannel;l&&l>0?this.channels[l].insertChars(o):this.logger.log(i.WARNING,"No channel found yet. TEXT-MODE?")}r||o||this.logger.log(i.WARNING,"Couldn't parse cleaned data "+f([n,s])+" orig: "+f([t[a],t[a+1]]))}},t.parseCmd=function(e,t){var r=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(S(e,t,r))return b(null,null,r),this.logger.log(i.DEBUG,"Repeated command ("+f([e,t])+") is dropped"),!0;var n=20===e||21===e||23===e?1:2,s=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?s.ccRCL():33===t?s.ccBS():34===t?s.ccAOF():35===t?s.ccAON():36===t?s.ccDER():37===t?s.ccRU(2):38===t?s.ccRU(3):39===t?s.ccRU(4):40===t?s.ccFON():41===t?s.ccRDC():42===t?s.ccTR():43===t?s.ccRTD():44===t?s.ccEDM():45===t?s.ccCR():46===t?s.ccENM():47===t&&s.ccEOC():s.ccTO(t-32),b(e,t,r),this.currentChannel=n,!0},t.parseMidrow=function(e,t){var r=0;if((17===e||25===e)&&t>=32&&t<=47){if((r=17===e?1:2)!==this.currentChannel)return this.logger.log(i.ERROR,"Mismatch channel in midrow parsing"),!1;var n=this.channels[r];return!!n&&(n.ccMIDROW(t),this.logger.log(i.DEBUG,"MIDROW ("+f([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var r,i=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(S(e,t,i))return b(null,null,i),!0;var n=e<=23?1:2;r=t>=64&&t<=95?1===n?a[e]:c[e]:1===n?l[e]:u[e];var s=this.channels[n];return!!s&&(s.setPAC(this.interpretPAC(r,t)),b(e,t,i),this.currentChannel=n,!0)},t.interpretPAC=function(e,t){var r,i={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i},t.parseChars=function(e,t){var r,n,s=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),a>=17&&a<=19?(n=17===a?t+80:18===a?t+112:t+144,this.logger.log(i.INFO,"Special char '"+o(n)+"' in channel "+r),s=[n]):e>=32&&e<=127&&(s=0===t?[e]:[e,t]),s){var l=f(s);this.logger.log(i.DEBUG,"Char codes = "+l.join(",")),b(e,t,this.cmdHistory)}return s},t.parseBackgroundAttributes=function(e,t){var r;if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var i={};16===e||24===e?(r=Math.floor((t-32)/2),i.background=h[r],t%2==1&&(i.background=i.background+"_semi")):45===t?i.background="transparent":(i.foreground="black",47===t&&(i.underline=!0));var n=e<=23?1:2;return this.channels[n].setBkgData(i),b(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;e<Object.keys(this.channels).length;e++){var t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}},t.cueSplitAtTime=function(e){for(var t=0;t<this.channels.length;t++){var r=this.channels[t];r&&r.cueSplitAtTime(e)}},e}();function b(e,t,r){r.a=e,r.b=t}function S(e,t,r){return r.a===e&&r.b===t}t.default=y},"./src/utils/codecs.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/codecs.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: isCodecType, isCodecSupportedInMp4 */function(e,t,r){"use strict";r.r(t),r.d(t,"isCodecType",(function(){return n})),r.d(t,"isCodecSupportedInMp4",(function(){return s}));var i={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function n(e,t){var r=i[t];return!!r&&!0===r[e.slice(0,4)]}function s(e,t){return MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},"./src/utils/cues.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/utils/cues.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ./vttparser */"./src/utils/vttparser.ts"),n=r(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts"),s=r(/*! ./texttrack-utils */"./src/utils/texttrack-utils.ts"),o=/\s/,a={newCue:function(e,t,r,a){for(var l,c,u,h,d,f=[],p=self.VTTCue||self.TextTrackCue,g=0;g<a.rows.length;g++)if(u=!0,h=0,d="",!(l=a.rows[g]).isEmpty()){for(var v=0;v<l.chars.length;v++)o.test(l.chars[v].uchar)&&u?h++:(d+=l.chars[v].uchar,u=!1);l.cueStartTime=t,t===r&&(r+=1e-4),h>=16?h--:h++;var m=Object(i.fixLineBreaks)(d.trim()),_=Object(n.generateCueId)(t,r,m);e&&e.cues&&e.cues.getCueById(_)||((c=new p(t,r,m)).id=_,c.line=g+1,c.align="left",c.position=10+Math.min(80,10*Math.floor(8*h/32)),f.push(c))}return e&&f.length&&(f.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),f.forEach((function(t){return Object(s.addCueToTrack)(e,t)}))),f}};t.default=a},"./src/utils/discontinuities.ts":
|
|
|
/*!**************************************!*\
|
|
|
!*** ./src/utils/discontinuities.ts ***!
|
|
|
\**************************************/
|
|
|
/*! exports provided: findFirstFragWithCC, shouldAlignOnDiscontinuities, findDiscontinuousReferenceFrag, adjustSlidingStart, alignStream, alignPDT, alignFragmentByPDTDelta, alignMediaPlaylistByPDT */function(e,t,r){"use strict";r.r(t),r.d(t,"findFirstFragWithCC",(function(){return o})),r.d(t,"shouldAlignOnDiscontinuities",(function(){return a})),r.d(t,"findDiscontinuousReferenceFrag",(function(){return l})),r.d(t,"adjustSlidingStart",(function(){return u})),r.d(t,"alignStream",(function(){return h})),r.d(t,"alignPDT",(function(){return d})),r.d(t,"alignFragmentByPDTDelta",(function(){return f})),r.d(t,"alignMediaPlaylistByPDT",(function(){return p}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ./logger */"./src/utils/logger.ts"),s=r(/*! ../controller/level-helper */"./src/controller/level-helper.ts");function o(e,t){for(var r=null,i=0,n=e.length;i<n;i++){var s=e[i];if(s&&s.cc===t){r=s;break}}return r}function a(e,t,r){return!(!t.details||!(r.endCC>r.startCC||e&&e.cc<r.startCC))}function l(e,t){var r=e.fragments,i=t.fragments;if(i.length&&r.length){var s=o(r,i[0].cc);if(s&&(!s||s.startPTS))return s;n.logger.log("No frag in previous level to align on")}else n.logger.log("No fragments to align")}function c(e,t){if(e){var r=e.start+t;e.start=e.startPTS=r,e.endPTS=r+e.duration}}function u(e,t){for(var r=t.fragments,i=0,n=r.length;i<n;i++)c(r[i],e);t.fragmentHint&&c(t.fragmentHint,e),t.alignedSliding=!0}function h(e,t,r){t&&(function(e,t,r){if(a(e,r,t)){var s=l(r.details,t);s&&Object(i.isFiniteNumber)(s.start)&&(n.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),u(s.start,t))}}(e,r,t),!r.alignedSliding&&t.details&&d(r,t.details),r.alignedSliding||!t.details||r.skippedSegments||Object(s.adjustSliding)(t.details,r))}function d(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var r=t.fragments[0].programDateTime,s=e.fragments[0].programDateTime,o=(s-r)/1e3+t.fragments[0].start;o&&Object(i.isFiniteNumber)(o)&&(n.logger.log("Adjusting PTS using programDateTime delta "+(s-r)+"ms, sliding:"+o.toFixed(3)+" "+e.url+" "),u(o,e))}}function f(e,t){var r=e.programDateTime;if(r){var i=(r-t)/1e3;e.start=e.startPTS=i,e.endPTS=i+e.duration}}function p(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var r=t.fragments[0].programDateTime-1e3*t.fragments[0].start;e.fragments.forEach((function(e){f(e,r)})),e.fragmentHint&&f(e.fragmentHint,r),e.alignedSliding=!0}}},"./src/utils/ewma-bandwidth-estimator.ts":
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/utils/ewma-bandwidth-estimator.ts ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/ewma */"./src/utils/ewma.ts"),n=function(){function e(e,t,r){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new i.default(e),this.fast_=new i.default(t)}var t=e.prototype;return t.update=function(e,t){var r=this.slow_,n=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new i.default(e,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==t&&(this.fast_=new i.default(t,n.getEstimate(),n.getTotalWeight()))},t.sample=function(e,t){var r=(e=Math.max(e,this.minDelayMs_))/1e3,i=8*t/r;this.fast_.sample(r,i),this.slow_.sample(r,i)},t.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.destroy=function(){},e}();t.default=n},"./src/utils/ewma.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/utils/ewma.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=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_=t,this.totalWeight_=r}var t=e.prototype;return t.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e}();t.default=i},"./src/utils/fetch-loader.ts":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/utils/fetch-loader.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: fetchSupported, default */function(e,t,r){"use strict";r.r(t),r.d(t,"fetchSupported",(function(){return d}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),s=r(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts");function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return a(e,arguments,u(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c(i,e)})(e)}function a(e,t,r){return(a=l()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var n=new(Function.bind.apply(e,i));return r&&c(n,r.prototype),n}).apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}function d(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}var f=function(){function e(e){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=e.fetchSetup||p,this.controller=new self.AbortController,this.stats=new n.LoadStats}var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},t.abortInternal=function(){var e=this.response;e&&e.ok||(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,r){var n=this,s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();var o=function(e,t){var r={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(h({},e.headers))};return e.rangeEnd&&r.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),r}(e,this.controller.signal),a=r.onProgress,l="arraybuffer"===e.responseType,c=l?"byteLength":"length";this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){n.abortInternal(),r.onTimeout(s,e,n.response)}),t.timeout),self.fetch(this.request).then((function(r){if(n.response=n.loader=r,!r.ok){var o=r.status,c=r.statusText;throw new g(c||"fetch, bad network response",o,r)}return s.loading.first=Math.max(self.performance.now(),s.loading.start),s.total=parseInt(r.headers.get("Content-Length")||"0"),a&&Object(i.isFiniteNumber)(t.highWaterMark)?n.loadProgressively(r,s,e,t.highWaterMark,a):l?r.arrayBuffer():r.text()})).then((function(o){var l=n.response;self.clearTimeout(n.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first),s.loaded=s.total=o[c];var u={url:l.url,data:o};a&&!Object(i.isFiniteNumber)(t.highWaterMark)&&a(s,e,o,l),r.onSuccess(u,s,e,l)})).catch((function(t){if(self.clearTimeout(n.requestTimeout),!s.aborted){var i=t.code||0;r.onError({code:i,text:t.message},e,t.details)}}))},t.getCacheAge=function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e},t.loadProgressively=function(e,t,r,i,n){void 0===i&&(i=0);var o=new s.default,a=e.body.getReader();return function s(){return a.read().then((function(a){if(a.done)return o.dataLength&&n(t,r,o.flush(),e),Promise.resolve(new ArrayBuffer(0));var l=a.value,c=l.length;return t.loaded+=c,c<i||o.dataLength?(o.push(l),o.dataLength>=i&&n(t,r,o.flush(),e)):n(t,r,l,e),s()})).catch((function(){return Promise.reject()}))}()},e}();function p(e,t){return new self.Request(e.url,t)}var g=function(e){var t,r;function i(t,r,i){var n;return(n=e.call(this,t)||this).code=void 0,n.details=void 0,n.code=r,n.details=i,n}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,c(t,r),i}(o(Error));t.default=f},"./src/utils/imsc1-ttml-parser.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/utils/imsc1-ttml-parser.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: IMSC1_CODEC, parseIMSC1 */function(e,t,r){"use strict";r.r(t),r.d(t,"IMSC1_CODEC",(function(){return u})),r.d(t,"parseIMSC1",(function(){return p}));var i=r(/*! ./mp4-tools */"./src/utils/mp4-tools.ts"),n=r(/*! ./vttparser */"./src/utils/vttparser.ts"),s=r(/*! ./vttcue */"./src/utils/vttcue.ts"),o=r(/*! ../demux/id3 */"./src/demux/id3.ts"),a=r(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),l=r(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts");function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}var u="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(e,t,r,n,u){var h=Object(i.findBox)(new Uint8Array(e),["mdat"]);if(0!==h.length){var d=h[0],p=Object(o.utf8ArrayToStr)(new Uint8Array(e,d.start,d.end-d.start)),b=Object(a.toTimescaleFromScale)(t,1,r);try{n(function(e,t){var r=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");var i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(i).reduce((function(e,t){return e[t]=r.getAttribute("ttp:"+t)||i[t],e}),{}),o="preserve"!==r.getAttribute("xml:space"),a=v(g(r,"styling","style")),u=v(g(r,"layout","region")),h=g(r,"body","[begin]");return[].map.call(h,(function(e){var r=function e(t,r){return[].slice.call(t.childNodes).reduce((function(t,i,n){var s;return"br"===i.nodeName&&n?t+"\n":null!==(s=i.childNodes)&&void 0!==s&&s.length?e(i,r):r?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent}),"")}(e,o);if(!r||!e.hasAttribute("begin"))return null;var i=y(e.getAttribute("begin"),n),h=y(e.getAttribute("dur"),n),d=y(e.getAttribute("end"),n);if(null===i)throw _(e);if(null===d){if(null===h)throw _(e);d=i+h}var p=new s.default(i-t,d-t,r);p.id=Object(l.generateCueId)(p.startTime,p.endTime,p.text);var g=u[e.getAttribute("region")],v=a[e.getAttribute("style")];p.position=10,p.size=80;var b=function(e,t){var r="http://www.w3.org/ns/ttml#styling";return["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(i,n){var s=m(t,r,n)||m(e,r,n);return s&&(i[n]=s),i}),{})}(g,v),S=b.textAlign;if(S){var w=f[S];w&&(p.lineAlign=w),p.align=S}return c(p,b),p})).filter((function(e){return null!==e}))}(p,b))}catch(e){u(e)}}else u(new Error("Could not parse IMSC1 mdat"))}function g(e,t,r){var i=e.getElementsByTagName(t)[0];return i?[].slice.call(i.querySelectorAll(r)):[]}function v(e){return e.reduce((function(e,t){var r=t.getAttribute("xml:id");return r&&(e[r]=t),e}),{})}function m(e,t,r){return e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null}function _(e){return new Error("Could not parse ttml timestamp "+e)}function y(e,t){if(!e)return null;var r=Object(n.parseTimeStamp)(e);return null===r&&(h.test(e)?r=function(e,t){var r=h.exec(e),i=(0|r[4])+(0|r[5])/t.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+i/t.frameRate}(e,t):d.test(e)&&(r=function(e,t){var r=d.exec(e),i=Number(r[1]);switch(r[2]){case"h":return 3600*i;case"m":return 60*i;case"ms":return 1e3*i;case"f":return i/t.frameRate;case"t":return i/t.tickRate}return i}(e,t))),r}},"./src/utils/logger.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/logger.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: enableLogs, logger */function(e,t,r){"use strict";r.r(t),r.d(t,"enableLogs",(function(){return a})),r.d(t,"logger",(function(){return l}));var i=function(){},n={trace:i,debug:i,log:i,warn:i,info:i,error:i},s=n;function o(e){var t=self.console[e];return t?t.bind(self.console,"["+e+"] >"):i}function a(e){if(self.console&&!0===e||"object"==typeof e){!function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];r.forEach((function(t){s[t]=e[t]?e[t].bind(e):o(t)}))}(e,"debug","log","info","warn","error");try{s.log()}catch(e){s=n}}else s=n}var l=n},"./src/utils/mediakeys-helper.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/utils/mediakeys-helper.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: KeySystems, requestMediaKeySystemAccess */function(e,t,r){"use strict";var i;r.r(t),r.d(t,"KeySystems",(function(){return i})),r.d(t,"requestMediaKeySystemAccess",(function(){return n})),function(e){e.WIDEVINE="com.widevine.alpha",e.PLAYREADY="com.microsoft.playready"}(i||(i={}));var n="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null},"./src/utils/mediasource-helper.ts":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/utils/mediasource-helper.ts ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: getMediaSource */function(e,t,r){"use strict";function i(){return self.MediaSource||self.WebKitMediaSource}r.r(t),r.d(t,"getMediaSource",(function(){return i}))},"./src/utils/mp4-tools.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/mp4-tools.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: bin2str, readUint16, readUint32, writeUint32, findBox, parseSegmentIndex, parseInitSegment, getStartDTS, getDuration, computeRawDurationFromSamples, offsetStartDTS, segmentValidRange, appendUint8Array */function(e,t,r){"use strict";r.r(t),r.d(t,"bin2str",(function(){return a})),r.d(t,"readUint16",(function(){return l})),r.d(t,"readUint32",(function(){return c})),r.d(t,"writeUint32",(function(){return u})),r.d(t,"findBox",(function(){return h})),r.d(t,"parseSegmentIndex",(function(){return d})),r.d(t,"parseInitSegment",(function(){return f})),r.d(t,"getStartDTS",(function(){return p})),r.d(t,"getDuration",(function(){return g})),r.d(t,"computeRawDurationFromSamples",(function(){return v})),r.d(t,"offsetStartDTS",(function(){return m})),r.d(t,"segmentValidRange",(function(){return _})),r.d(t,"appendUint8Array",(function(){return y}));var i=r(/*! ./typed-array */"./src/utils/typed-array.ts"),n=r(/*! ../loader/fragment */"./src/loader/fragment.ts"),s=Math.pow(2,32)-1,o=[].push;function a(e){return String.fromCharCode.apply(null,e)}function l(e,t){"data"in e&&(t+=e.start,e=e.data);var r=e[t]<<8|e[t+1];return r<0?65536+r:r}function c(e,t){"data"in e&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r}function u(e,t,r){"data"in e&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function h(e,t){var r,i,n,s=[];if(!t.length)return s;"data"in e?(r=e.data,i=e.start,n=e.end):(i=0,n=(r=e).byteLength);for(var l=i;l<n;){var u=c(r,l),d=u>1?l+u:n;if(a(r.subarray(l+4,l+8))===t[0])if(1===t.length)s.push({data:r,start:l+8,end:d});else{var f=h({data:r,start:l+8,end:d},t.slice(1));f.length&&o.apply(s,f)}l=d}return s}function d(e){var t=h(e,["moov"])[0],r=t?t.end:null,i=h(e,["sidx"]);if(!i||!i[0])return null;var n=[],s=i[0],o=s.data[0],a=0===o?8:16,u=c(s,a);a+=4,a+=0===o?8:16,a+=2;var d=s.end+0,f=l(s,a);a+=2;for(var p=0;p<f;p++){var g=a,v=c(s,g);g+=4;var m=2147483647&v;if(1==(2147483648&v)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var _=c(s,g);g+=4,n.push({referenceSize:m,subsegmentDuration:_,info:{duration:_/u,start:d,end:d+m-1}}),d+=m,a=g+=4}return{earliestPresentationTime:0,timescale:u,version:o,referencesCount:f,references:n,moovEndOffset:r}}function f(e){for(var t=[],r=h(e,["moov","trak"]),i=0;i<r.length;i++){var s=r[i],o=h(s,["tkhd"])[0];if(o){var l=o.data[o.start],u=0===l?12:20,d=c(o,u),f=h(s,["mdia","mdhd"])[0];if(f){var p=c(f,u=0===(l=f.data[f.start])?12:20),g=h(s,["mdia","hdlr"])[0];if(g){var v=a(g.data.subarray(g.start+8,g.start+12)),m={soun:n.ElementaryStreamTypes.AUDIO,vide:n.ElementaryStreamTypes.VIDEO}[v];if(m){var _=h(s,["mdia","minf","stbl","stsd"])[0],y=void 0;_&&(y=a(_.data.subarray(_.start+12,_.start+16))),t[d]={timescale:p,type:m},t[m]={timescale:p,id:d,codec:y}}}}}}return h(e,["moov","mvex","trex"]).forEach((function(e){var r=c(e,4),i=t[r];i&&(i.default={duration:c(e,12),flags:c(e,20)})})),t}function p(e,t){return h(t,["moof","traf"]).reduce((function(t,r){var i=h(r,["tfdt"])[0],n=i.data[i.start],s=h(r,["tfhd"]).reduce((function(t,r){var s=c(r,4),o=e[s];if(o){var a=c(i,4);1===n&&(a*=Math.pow(2,32),a+=c(i,8));var l=a/(o.timescale||9e4);if(isFinite(l)&&(null===t||l<t))return l}return t}),null);return null!==s&&isFinite(s)&&(null===t||s<t)?s:t}),null)||0}function g(e,t){for(var r=0,i=0,s=0,o=h(e,["moof","traf"]),a=0;a<o.length;a++){var l=o[a],u=h(l,["tfhd"])[0],f=t[c(u,4)];if(f){var p=f.default,g=c(u,0)|(null==p?void 0:p.flags),m=null==p?void 0:p.duration;8&g&&(m=c(u,2&g?12:8));for(var _=f.timescale||9e4,y=h(l,["trun"]),b=0;b<y.length;b++)r=m?m*c(y[b],4):v(y[b]),f.type===n.ElementaryStreamTypes.VIDEO?i+=r/_:f.type===n.ElementaryStreamTypes.AUDIO&&(s+=r/_)}}if(0===i&&0===s){var S=d(e);if(null!=S&&S.references)return S.references.reduce((function(e,t){return e+t.info.duration||0}),0)}return i||s}function v(e){var t=c(e,0),r=8;1&t&&(r+=4),4&t&&(r+=4);for(var i=0,n=c(e,4),s=0;s<n;s++)256&t&&(i+=c(e,r),r+=4),512&t&&(r+=4),1024&t&&(r+=4),2048&t&&(r+=4);return i}function m(e,t,r){h(t,["moof","traf"]).forEach((function(t){h(t,["tfhd"]).forEach((function(i){var n=c(i,4),o=e[n];if(o){var a=o.timescale||9e4;h(t,["tfdt"]).forEach((function(e){var t=e.data[e.start],i=c(e,4);if(0===t)u(e,4,i-r*a);else{i*=Math.pow(2,32),i+=c(e,8),i-=r*a,i=Math.max(i,0);var n=Math.floor(i/(s+1)),o=Math.floor(i%(s+1));u(e,4,n),u(e,8,o)}}))}}))}))}function _(e){var t={valid:null,remainder:null},r=h(e,["moof"]);if(!r)return t;if(r.length<2)return t.remainder=e,t;var n=r[r.length-1];return t.valid=Object(i.sliceUint8)(e,0,n.start-8),t.remainder=Object(i.sliceUint8)(e,n.start-8),t}function y(e,t){var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}},"./src/utils/output-filter.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/output-filter.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var i=function(){function e(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}var t=e.prototype;return t.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},t.newCue=function(e,t,r){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[]},e}()},"./src/utils/texttrack-utils.ts":
|
|
|
/*!**************************************!*\
|
|
|
!*** ./src/utils/texttrack-utils.ts ***!
|
|
|
\**************************************/
|
|
|
/*! exports provided: sendAddTrackEvent, addCueToTrack, clearCurrentCues, removeCuesInRange, getCuesInRange */function(e,t,r){"use strict";r.r(t),r.d(t,"sendAddTrackEvent",(function(){return n})),r.d(t,"addCueToTrack",(function(){return s})),r.d(t,"clearCurrentCues",(function(){return o})),r.d(t,"removeCuesInRange",(function(){return a})),r.d(t,"getCuesInRange",(function(){return l}));var i=r(/*! ./logger */"./src/utils/logger.ts");function n(e,t){var r;try{r=new Event("addtrack")}catch(e){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function s(e,t){var r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(r){i.logger.debug("[texttrack-utils]: "+r);var n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}"disabled"===r&&(e.mode=r)}function o(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var r=e.cues.length;r--;)e.removeCue(e.cues[r]);"disabled"===t&&(e.mode=t)}function a(e,t,r){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var n=l(e.cues,t,r),s=0;s<n.length;s++)e.removeCue(n[s]);"disabled"===i&&(e.mode=i)}function l(e,t,r){var i=[],n=function(e,t){if(t<e[0].startTime)return 0;var r=e.length-1;if(t>e[r].endTime)return-1;for(var i=0,n=r;i<=n;){var s=Math.floor((n+i)/2);if(t<e[s].startTime)n=s-1;else{if(!(t>e[s].startTime&&i<r))return s;i=s+1}}return e[i].startTime-t<t-e[n].startTime?i:n}(e,t);if(n>-1)for(var s=n,o=e.length;s<o;s++){var a=e[s];if(a.startTime>=t&&a.endTime<=r)i.push(a);else if(a.startTime>r)return i}return i}},"./src/utils/time-ranges.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/utils/time-ranges.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),t.default={toString:function(e){for(var t="",r=e.length,i=0;i<r;i++)t+="["+e.start(i).toFixed(3)+","+e.end(i).toFixed(3)+"]";return t}}},"./src/utils/timescale-conversion.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/utils/timescale-conversion.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: toTimescaleFromBase, toTimescaleFromScale, toMsFromMpegTsClock, toMpegTsClockFromTimescale */function(e,t,r){"use strict";function i(e,t,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var n=e*t*r;return i?Math.round(n):n}function n(e,t,r,n){return void 0===r&&(r=1),void 0===n&&(n=!1),i(e,t,1/r,n)}function s(e,t){return void 0===t&&(t=!1),i(e,1e3,1/9e4,t)}function o(e,t){return void 0===t&&(t=1),i(e,9e4,1/t)}r.r(t),r.d(t,"toTimescaleFromBase",(function(){return i})),r.d(t,"toTimescaleFromScale",(function(){return n})),r.d(t,"toMsFromMpegTsClock",(function(){return s})),r.d(t,"toMpegTsClockFromTimescale",(function(){return o}))},"./src/utils/typed-array.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/utils/typed-array.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: sliceUint8 */function(e,t,r){"use strict";function i(e,t,r){return Uint8Array.prototype.slice?e.slice(t,r):new Uint8Array(Array.prototype.slice.call(e,t,r))}r.r(t),r.d(t,"sliceUint8",(function(){return i}))},"./src/utils/vttcue.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/vttcue.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t),t.default=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function r(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;var r=t.toLowerCase();return!!~e.indexOf(r)&&r}function i(e){return r(t,e)}function n(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)e[o]=s[o]}return e}function s(t,s,o){var a=this,l={enumerable:!0};a.hasBeenReset=!1;var c="",u=!1,h=t,d=s,f=o,p=null,g="",v=!0,m="auto",_="start",y=50,b="middle",S=50,w="middle";Object.defineProperty(a,"id",n({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(a,"pauseOnExit",n({},l,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(a,"startTime",n({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",n({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",n({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",n({},l,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",n({},l,{get:function(){return g},set:function(t){var i=function(t){return r(e,t)}(t);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");g=i,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",n({},l,{get:function(){return v},set:function(e){v=!!e,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",n({},l,{get:function(){return m},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",n({},l,{get:function(){return _},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",n({},l,{get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",n({},l,{get:function(){return b},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",n({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",n({},l,{get:function(){return w},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),a.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}()},"./src/utils/vttparser.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/vttparser.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: parseTimeStamp, fixLineBreaks, VTTParser */function(e,t,r){"use strict";r.r(t),r.d(t,"parseTimeStamp",(function(){return s})),r.d(t,"fixLineBreaks",(function(){return h})),r.d(t,"VTTParser",(function(){return d}));var i=r(/*! ./vttcue */"./src/utils/vttcue.ts"),n=function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e}();function s(e){function t(e,t,r,i){return 3600*(0|e)+60*(0|t)+(0|r)+parseFloat(i||0)}var r=e.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 o=function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,r){for(var i=0;i<r.length;++i)if(t===r[i]){this.set(e,t);break}},t.integer=function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},t.percent=function(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1},e}();function a(e,t,r,i){var n=i?e.split(i):[e];for(var s in n)if("string"==typeof n[s]){var o=n[s].split(r);2===o.length&&t(o[0],o[1])}}var l=new i.default(0,0,""),c="middle"===l.align?"middle":"center";function u(e,t,r){var i=e;function n(){var t=s(e);if(null===t)throw new Error("Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}if(u(),t.startTime=n(),u(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.substr(3),u(),t.endTime=n(),u(),function(e,t){var i=new o;a(e,(function(e,t){var n;switch(e){case"region":for(var s=r.length-1;s>=0;s--)if(r[s].id===t){i.set(e,r[s].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":n=t.split(","),i.integer(e,n[0]),i.percent(e,n[0])&&i.set("snapToLines",!1),i.alt(e,n[0],["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start",c,"end"]);break;case"position":n=t.split(","),i.percent(e,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start",c,"end","line-left","line-right","auto"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start",c,"end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");var n=i.get("line","auto");"auto"===n&&-1===l.line&&(n=-1),t.line=n,t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align",c);var s=i.get("position","auto");"auto"===s&&50===l.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function h(e){return e.replace(/<br(?: \/)?>/gi,"\n")}var d=function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new n,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=e.prototype;return t.parse=function(e){var t=this;function r(){var e=t.buffer,r=0;for(e=h(e);r<e.length&&"\r"!==e[r]&&"\n"!==e[r];)++r;var i=e.substr(0,r);return"\r"===e[r]&&++r,"\n"===e[r]&&++r,t.buffer=e.substr(r),i}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var n="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var s=(n=r()).match(/^()?WEBVTT([ \t].*)?$/);if(!s||!s[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var o=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(o?o=!1:n=r(),t.state){case"HEADER":/:/.test(n)?a(n,(function(e,t){}),/:/):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;if(t.cue=new i.default(0,0,""),t.state="CUE",-1===n.indexOf("--\x3e")){t.cue.id=n;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{u(n,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var l=-1!==n.indexOf("--\x3e");if(!n||l&&(o=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=n;continue;case"BADCUE":n||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw new Error("Malformed WebVTT signature.")}catch(e){this.onparsingerror&&this.onparsingerror(e)}return this.onflush&&this.onflush(),this},e}()},"./src/utils/webvtt-parser.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/webvtt-parser.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: generateCueId, parseWebVTT */function(e,t,r){"use strict";r.r(t),r.d(t,"generateCueId",(function(){return h})),r.d(t,"parseWebVTT",(function(){return d}));var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! ./vttparser */"./src/utils/vttparser.ts"),s=r(/*! ../demux/id3 */"./src/demux/id3.ts"),o=r(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),a=r(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),l=/\r\n|\n\r|\n|\r/g,c=function(e,t,r){return void 0===r&&(r=0),e.substr(r,t.length)===t},u=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()};function h(e,t,r){return u(e.toString())+u(t.toString())+u(r)}function d(e,t,r,u,d,f,p,g){var v,m=new n.VTTParser,_=Object(s.utf8ArrayToStr)(new Uint8Array(e)).trim().replace(l,"\n").split("\n"),y=[],b=Object(o.toMpegTsClockFromTimescale)(t,r),S="00:00.000",w=0,C=0,E=!0,k=!1;m.oncue=function(e){var t=u[d],r=u.ccOffset,i=(w-b)/9e4;if(null!=t&&t.new&&(void 0!==C?r=u.ccOffset=t.start:function(e,t,r){var i=e[t],n=e[i.prevCC];if(!n||!n.new&&i.new)return e.ccOffset=e.presentationOffset=i.start,void(i.new=!1);for(;null!==(s=n)&&void 0!==s&&s.new;){var s;e.ccOffset+=i.start-n.start,i.new=!1,n=e[(i=n).prevCC]}e.presentationOffset=r}(u,d,i)),i&&(r=i-u.presentationOffset),k){var n=e.endTime-e.startTime,s=Object(a.normalizePts)(9e4*(e.startTime+r-C),9e4*f)/9e4;e.startTime=s,e.endTime=s+n}var o=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(o)),e.id||(e.id=h(e.startTime,e.endTime,o)),e.endTime>0&&y.push(e)},m.onparsingerror=function(e){v=e},m.onflush=function(){v?g(v):p(y)},_.forEach((function(e){if(E){if(c(e,"X-TIMESTAMP-MAP=")){E=!1,k=!0,e.substr(16).split(",").forEach((function(e){c(e,"LOCAL:")?S=e.substr(6):c(e,"MPEGTS:")&&(w=parseInt(e.substr(7)))}));try{C=function(e){var t=parseInt(e.substr(-3)),r=parseInt(e.substr(-6,2)),n=parseInt(e.substr(-9,2)),s=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;if(!(Object(i.isFiniteNumber)(t)&&Object(i.isFiniteNumber)(r)&&Object(i.isFiniteNumber)(n)&&Object(i.isFiniteNumber)(s)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*r,t+=6e4*n,t+=36e5*s}(S)/1e3}catch(e){k=!1,v=e}return}""===e&&(E=!1)}m.parse(e+"\n")})),m.flush()}},"./src/utils/xhr-loader.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/utils/xhr-loader.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,r){"use strict";r.r(t);var i=r(/*! ../utils/logger */"./src/utils/logger.ts"),n=r(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),s=/^age:\s*[\d.]+\s*$/m,o=function(){function e(e){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=e?e.xhrSetup:null,this.stats=new n.LoadStats,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.retryDelay=t.retryDelay,this.loadInternal()},t.loadInternal=function(){var e=this.config,t=this.context;if(e){var r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0;var n=this.xhrSetup;try{if(n)try{n(r,t.url)}catch(e){r.open("GET",t.url,!0),n(r,t.url)}r.readyState||r.open("GET",t.url,!0);var s=this.context.headers;if(s)for(var o in s)r.setRequestHeader(o,s[o])}catch(e){return void this.callbacks.onError({code:r.status,text:e.message},t,r)}t.rangeEnd&&r.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=t.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout),r.send()}},t.readystatechange=function(){var e=this.context,t=this.loader,r=this.stats;if(e&&t){var n=t.readyState,s=this.config;if(!r.aborted&&n>=2)if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===n){t.onreadystatechange=null,t.onprogress=null;var o=t.status;if(o>=200&&o<300){var a,l;if(r.loading.end=Math.max(self.performance.now(),r.loading.first),l="arraybuffer"===e.responseType?(a=t.response).byteLength:(a=t.responseText).length,r.loaded=r.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(r,e,a,t),!this.callbacks)return;var u={url:t.responseURL,data:a};this.callbacks.onSuccess(u,r,e,t)}else r.retry>=s.maxRetry||o>=400&&o<499?(i.logger.error(o+" while loading "+e.url),this.callbacks.onError({code:o,text:t.statusText},e,t)):(i.logger.warn(o+" while loading "+e.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,s.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)}},t.loadtimeout=function(){i.logger.warn("timeout while loading "+this.context.url);var e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null;if(this.loader&&s.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},e}();t.default=o}}).default},e.exports=i())},vHTk:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.less?modules ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/events.js ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPointerEvent=function(e){return e.changedTouches?e.changedTouches[0]:e.touches?e.touches[0]:e},t.stopEvent=function(e){e.stopPropagation(),e.preventDefault()},t.setCapture=function(e){if(e.setCapture)e.setCapture(),document.captureElement=e,e.addEventListener("mouseup",l);else{l();var t=document.getElementById("noVNC_mouse_capture_elem");null===t&&((t=document.createElement("div")).id="noVNC_mouse_capture_elem",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.zIndex=1e4,t.style.display="none",document.body.appendChild(t),t.addEventListener("contextmenu",s),t.addEventListener("mousemove",s),t.addEventListener("mouseup",s)),document.captureElement=e,a.observe(e,{attributes:!0}),o(),t.style.display="",window.addEventListener("mousemove",s),window.addEventListener("mouseup",s)}},t.releaseCapture=l;var i=!1,n=null;function s(e){if(!i){var t=new e.constructor(e.type,e);i=!0,document.captureElement?document.captureElement.dispatchEvent(t):n.dispatchEvent(t),i=!1,e.stopPropagation(),t.defaultPrevented&&e.preventDefault(),"mouseup"===e.type&&l()}}function o(){document.getElementById("noVNC_mouse_capture_elem").style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;var a=new MutationObserver(o);function l(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;n=document.captureElement,document.captureElement=null,a.disconnect(),document.getElementById("noVNC_mouse_capture_elem").style.display="none",window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",s)}}},whVF:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/deflator.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=r(/*! ../lib/vendor/pako/lib/zlib/deflate.js */"lNSK"),s=(i=r(/*! ../lib/vendor/pako/lib/zlib/zstream.js */"1q3G"))&&i.__esModule?i:{default:i};function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strm=new s.default,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,n.deflateInit)(this.strm,this.windowBits)}var t,r,i;return t=e,(r=[{key:"deflate",value:function(e){this.strm.input=e,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 t=(0,n.deflate)(this.strm,n.Z_FULL_FLUSH),r=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(t<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){var i=[r],s=r.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,(t=(0,n.deflate)(this.strm,n.Z_FULL_FLUSH))<0)throw new Error("zlib deflate failed");var o=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);s+=o.length,i.push(o)}while(this.strm.avail_in>0);for(var a=new Uint8Array(s),l=0,c=0;c<i.length;c++)a.set(i[c],l),l+=i[c].length;r=a}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,r}}])&&o(t.prototype,r),i&&o(t,i),e}();t.default=a},xO64:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/tightpng.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";var i;function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=u(e);if(t){var n=u(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return c(this,r)}}function c(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(c,e);var t,r,i,n=l(c);function c(){return s(this,c),n.apply(this,arguments)}return t=c,(r=[{key:"_pngRect",value:function(e,t,r,i,n,s,o){var a=this._readData(n);return null!==a&&(s.imageRect(e,t,r,i,"image/png",a),!0)}},{key:"_basicRect",value:function(e,t,r,i,n,s,o,a){throw new Error("BasicCompression received in TightPNG rect")}}])&&o(t.prototype,r),i&&o(t,i),c}(((i=r(/*! ./tight.js */"8K/p"))&&i.__esModule?i:{default:i}).default);t.default=h},xSIq:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/messages.js ***!
|
|
|
\************************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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"}},xlC8:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/adler32.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,i){var n=65535&e|0,s=e>>>16&65535|0,o=0;for(;0!==r;){r-=o=r>2e3?2e3:r;do{n=n+t[i++]|0,s=s+n|0}while(--o);n%=65521,s%=65521}return n|s<<16|0}}}]); |