UNPKG

@cocalc/static

Version:

CoCalc's static frontend Webpack-based build system and framework

1 lines 424 kB
(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[9993],{79726:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var r=i(75025),n=i.n(r)()((function(e){return e[1]}));n.push([e.id,'/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * https://github.com/chjj/term.js\n * @license MIT\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Originally forked from (with the author\'s permission):\n * Fabrice Bellard\'s javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n */\n\n/**\n * Default styles for xterm.js\n */\n\n.xterm {\n cursor: text;\n position: relative;\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n}\n\n.xterm.focus,\n.xterm:focus {\n outline: none;\n}\n\n.xterm .xterm-helpers {\n position: absolute;\n top: 0;\n /**\n * The z-index of the helpers must be higher than the canvases in order for\n * IMEs to appear on top.\n */\n z-index: 5;\n}\n\n.xterm .xterm-helper-textarea {\n padding: 0;\n border: 0;\n margin: 0;\n /* Move textarea out of the screen to the far left, so that the cursor is not visible */\n position: absolute;\n opacity: 0;\n left: -9999em;\n top: 0;\n width: 0;\n height: 0;\n z-index: -5;\n /** Prevent wrapping so the IME appears against the textarea at the correct position */\n white-space: nowrap;\n overflow: hidden;\n resize: none;\n}\n\n.xterm .composition-view {\n /* TODO: Composition position got messed up somewhere */\n background: #000;\n color: #FFF;\n display: none;\n position: absolute;\n white-space: nowrap;\n z-index: 1;\n}\n\n.xterm .composition-view.active {\n display: block;\n}\n\n.xterm .xterm-viewport {\n /* On OS X this is required in order for the scroll bar to appear fully opaque */\n background-color: #000;\n overflow-y: scroll;\n cursor: default;\n position: absolute;\n right: 0;\n left: 0;\n top: 0;\n bottom: 0;\n}\n\n.xterm .xterm-screen {\n position: relative;\n}\n\n.xterm .xterm-screen canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.xterm .xterm-scroll-area {\n visibility: hidden;\n}\n\n.xterm-char-measure-element {\n display: inline-block;\n visibility: hidden;\n position: absolute;\n top: 0;\n left: -9999em;\n line-height: normal;\n}\n\n.xterm.enable-mouse-events {\n /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */\n cursor: default;\n}\n\n.xterm.xterm-cursor-pointer,\n.xterm .xterm-cursor-pointer {\n cursor: pointer;\n}\n\n.xterm.column-select.focus {\n /* Column selection mode */\n cursor: crosshair;\n}\n\n.xterm .xterm-accessibility,\n.xterm .xterm-message {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10;\n color: transparent;\n}\n\n.xterm .live-region {\n position: absolute;\n left: -9999px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\n.xterm-dim {\n opacity: 0.5;\n}\n\n.xterm-underline-1 { text-decoration: underline; }\n.xterm-underline-2 { text-decoration: double underline; }\n.xterm-underline-3 { text-decoration: wavy underline; }\n.xterm-underline-4 { text-decoration: dotted underline; }\n.xterm-underline-5 { text-decoration: dashed underline; }\n\n.xterm-strikethrough {\n text-decoration: line-through;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration {\n\tz-index: 6;\n\tposition: absolute;\n}\n\n.xterm-decoration-overview-ruler {\n z-index: 7;\n position: absolute;\n top: 0;\n right: 0;\n pointer-events: none;\n}\n\n.xterm-decoration-top {\n z-index: 2;\n position: relative;\n}\n',""]);const s=n},56389:(e,t,i)=>{"use strict";var r=i(75701),n=i.n(r),s=i(79726);n()(s.Z,{insert:"head",singleton:!1}),s.Z.locals},34662:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var r=i(86994),n=i(63505);const s={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M292.7 840h438.6l24.2-512h-487z",fill:t}},{tag:"path",attrs:{d:"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-504-72h304v72H360v-72zm371.3 656H292.7l-24.2-512h487l-24.2 512z",fill:e}}]}},name:"delete",theme:"twotone"};var o=i(17583),a=function(e,t){return n.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:s}))};a.displayName="DeleteTwoTone";const c=n.forwardRef(a)},86931:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var r=i(86994),n=i(63505);const s={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M761.1 288.3L687.8 215 325.1 577.6l-15.6 89 88.9-15.7z",fill:t}},{tag:"path",attrs:{d:"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89z",fill:e}}]}},name:"edit",theme:"twotone"};var o=i(17583),a=function(e,t){return n.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:s}))};a.displayName="EditTwoTone";const c=n.forwardRef(a)},97299:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var r=i(86994),n=i(63505);const s={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z",fill:e}},{tag:"path",attrs:{d:"M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm-80 524c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V360c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v304zm224 0c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V360c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v304z",fill:t}},{tag:"path",attrs:{d:"M424 352h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z",fill:e}}]}},name:"pause-circle",theme:"twotone"};var o=i(17583),a=function(e,t){return n.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:s}))};a.displayName="PauseCircleTwoTone";const c=n.forwardRef(a)},2902:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var r=i(86994),n=i(63505);const s={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z",fill:e}},{tag:"path",attrs:{d:"M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm164.1 378.2L457.7 677.1a8.02 8.02 0 01-12.7-6.5V353a8 8 0 0112.7-6.5l218.4 158.8a7.9 7.9 0 010 12.9z",fill:t}},{tag:"path",attrs:{d:"M676.1 505.3L457.7 346.5A8 8 0 00445 353v317.6a8.02 8.02 0 0012.7 6.5l218.4-158.9a7.9 7.9 0 000-12.9z",fill:e}}]}},name:"play-circle",theme:"twotone"};var o=i(17583),a=function(e,t){return n.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:s}))};a.displayName="PlayCircleTwoTone";const c=n.forwardRef(a)},48678:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var r=i(86994),n=i(63505);const s={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z",fill:e}},{tag:"path",attrs:{d:"M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm192 396c0 4.4-3.6 8-8 8H544v152c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V544H328c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h152V328c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v152h152c4.4 0 8 3.6 8 8v48z",fill:t}},{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z",fill:e}}]}},name:"plus-circle",theme:"twotone"};var o=i(17583),a=function(e,t){return n.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:s}))};a.displayName="PlusCircleTwoTone";const c=n.forwardRef(a)},46390:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var r=i(86994),n=i(63505);const s={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm288.5 682.8L277.7 224C258 240 240 258 224 277.7l522.8 522.8C682.8 852.7 601 884 512 884c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372c0 89-31.3 170.8-83.5 234.8z",fill:e}},{tag:"path",attrs:{d:"M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372c89 0 170.8-31.3 234.8-83.5L224 277.7c16-19.7 34-37.7 53.7-53.7l522.8 522.8C852.7 682.8 884 601 884 512c0-205.4-166.6-372-372-372z",fill:t}}]}},name:"stop",theme:"twotone"};var o=i(17583),a=function(e,t){return n.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:s}))};a.displayName="StopTwoTone";const c=n.forwardRef(a)},87933:e=>{function t(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}self,e.exports=function(){"use strict";var e,i={};return e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.FitAddon=void 0,e.FitAddon=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var i,r;return i=e,r=[{key:"activate",value:function(e){this._terminal=e}},{key:"dispose",value:function(){}},{key:"fit",value:function(){var e=this.proposeDimensions();if(e&&this._terminal&&!isNaN(e.cols)&&!isNaN(e.rows)){var t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}}},{key:"proposeDimensions",value:function(){if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement){var e=this._terminal._core;if(0!==e._renderService.dimensions.actualCellWidth&&0!==e._renderService.dimensions.actualCellHeight){var t=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(i.getPropertyValue("height")),n=Math.max(0,parseInt(i.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o=r-(parseInt(s.getPropertyValue("padding-top"))+parseInt(s.getPropertyValue("padding-bottom"))),a=n-(parseInt(s.getPropertyValue("padding-right"))+parseInt(s.getPropertyValue("padding-left")))-t;return{cols:Math.max(2,Math.floor(a/e._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(o/e._renderService.dimensions.actualCellHeight))}}}}}],r&&t(i.prototype,r),e}(),i}()},34800:e=>{function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}self,e.exports=function(){"use strict";var e={6:function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.LinkComputer=r.WebLinkProvider=void 0,r.WebLinkProvider=function(){function e(t,r,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i(this,e),this._terminal=t,this._regex=r,this._handler=n,this._options=s}return n(e,[{key:"provideLinks",value:function(e,t){var i=s.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(i))}},{key:"_addCallbacks",value:function(e){var t=this;return e.map((function(e){return e.leave=t._options.leave,e.hover=function(i,r){if(t._options.hover){var n=e.range;t._options.hover(i,r,n)}},e}))}}]),e}();var s=function(){function e(){i(this,e)}return n(e,null,[{key:"computeLink",value:function(i,r,n,s){for(var o,a=new RegExp(r.source,(r.flags||"")+"g"),c=function(e,i){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,s=[],o=!0,a=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(a)throw n}}return s}}(e,i)||function(e,i){if(e){if("string"==typeof e)return t(e,i);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(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,i):void 0}}(e,i)||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.")}()}(e._translateBufferLineToStringWithWrap(i-1,!1,n),2),l=c[0],h=c[1],u=-1,f=[];null!==(o=a.exec(l));){var d=o[1];if(!d){console.log("match found without corresponding matchIndex");break}if(u=l.indexOf(d,u+1),a.lastIndex=u+d.length,u<0)break;for(var _=u+d.length,v=h+1;_>n.cols;)_-=n.cols,v++;for(var g=u+1,p=h+1;g>n.cols;)g-=n.cols,p++;var y={start:{x:g,y:p},end:{x:_,y:v}};f.push({range:y,text:d,activate:s})}return f}},{key:"_translateBufferLineToStringWithWrap",value:function(e,t,i){var r,n,s="";do{var o=i.buffer.active.getLine(e);if(!o)break;o.isWrapped&&e--,n=o.isWrapped}while(n);var a=e;do{var c=i.buffer.active.getLine(e+1);r=!!c&&c.isWrapped;var l=i.buffer.active.getLine(e);if(!l)break;s+=l.translateToString(!r&&t).substring(0,i.cols),e++}while(r);return[s,a]}}]),e}();r.LinkComputer=s}},r={};function s(t){var i=r[t];if(void 0!==i)return i.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,s),n.exports}var o={};return function(){var e=function(e,t){var i=window.open();if(i){try{i.opener=null}catch(e){}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")},t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.WebLinksAddon=void 0;var r=s(6),a=new RegExp("(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,18}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?((\\/[\\/\\w\\.\\-%~:+@]*)*([^:\"'\\s]))?(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)");t.WebLinksAddon=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this._handler=r,this._options=n}return n(t,[{key:"activate",value:function(e){this._terminal=e;var t=this._options,i=t.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new r.WebLinkProvider(this._terminal,i,this._handler,t))}},{key:"dispose",value:function(){var e;null===(e=this._linkProvider)||void 0===e||e.dispose()}}]),t}()}(),o}()},95029:e=>{function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}function o(e,t,i){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(i):n.value}},o(e,t,i||e)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function c(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&&h(e,t)}function l(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?i(e):t}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function u(e,i){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,s=[],o=!0,a=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(a)throw n}}return s}}(e,i)||function(e,i){if(e){if("string"==typeof e)return t(e,i);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(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,i):void 0}}(e,i)||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.")}()}var f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function d(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=a(e);if(t){var n=a(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return l(this,i)}}self,e.exports=function(){"use strict";var e={965:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;var n=i(381),o=i(455),a=i(855),h=i(859),u=10,f=u*Float32Array.BYTES_PER_ELEMENT,_={i:0,glyph:void 0,leftCellPadding:0,clippedPixels:0},v=function(e){c(i,e);var t=d(i);function i(e,s,o,a){var c;r(this,i),(c=t.call(this))._terminal=e,c._colors=s,c._gl=o,c._dimensions=a,c._activeBuffer=0,c._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};var u=c._gl;c._program=(0,n.throwIfFalsy)((0,n.createProgram)(u,"#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in vec2 a_texcoord;\nlayout (location = 5) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}","#version 300 es\nprecision lowp float;\n\nin vec2 v_texcoord;\n\nuniform sampler2D u_texture;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = texture(u_texture, v_texcoord);\n}")),c.register((0,h.toDisposable)((function(){return u.deleteProgram(c._program)}))),c._projectionLocation=(0,n.throwIfFalsy)(u.getUniformLocation(c._program,"u_projection")),c._resolutionLocation=(0,n.throwIfFalsy)(u.getUniformLocation(c._program,"u_resolution")),c._textureLocation=(0,n.throwIfFalsy)(u.getUniformLocation(c._program,"u_texture")),c._vertexArrayObject=u.createVertexArray(),u.bindVertexArray(c._vertexArrayObject);var d=new Float32Array([0,0,1,0,0,1,1,1]),_=u.createBuffer();c.register((0,h.toDisposable)((function(){return u.deleteBuffer(_)}))),u.bindBuffer(u.ARRAY_BUFFER,_),u.bufferData(u.ARRAY_BUFFER,d,u.STATIC_DRAW),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,2,c._gl.FLOAT,!1,0,0);var v=new Uint8Array([0,1,3,0,2,3]),g=u.createBuffer();return c.register((0,h.toDisposable)((function(){return u.deleteBuffer(g)}))),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,g),u.bufferData(u.ELEMENT_ARRAY_BUFFER,v,u.STATIC_DRAW),c._attributesBuffer=(0,n.throwIfFalsy)(u.createBuffer()),c.register((0,h.toDisposable)((function(){return u.deleteBuffer(c._attributesBuffer)}))),u.bindBuffer(u.ARRAY_BUFFER,c._attributesBuffer),u.enableVertexAttribArray(2),u.vertexAttribPointer(2,2,u.FLOAT,!1,f,0),u.vertexAttribDivisor(2,1),u.enableVertexAttribArray(3),u.vertexAttribPointer(3,2,u.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(3,1),u.enableVertexAttribArray(4),u.vertexAttribPointer(4,2,u.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(4,1),u.enableVertexAttribArray(5),u.vertexAttribPointer(5,2,u.FLOAT,!1,f,6*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(5,1),u.enableVertexAttribArray(1),u.vertexAttribPointer(1,2,u.FLOAT,!1,f,8*Float32Array.BYTES_PER_ELEMENT),u.vertexAttribDivisor(1,1),c._atlasTexture=(0,n.throwIfFalsy)(u.createTexture()),c.register((0,h.toDisposable)((function(){return u.deleteTexture(c._atlasTexture)}))),u.bindTexture(u.TEXTURE_2D,c._atlasTexture),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,1,1,0,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.enable(u.BLEND),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),c.onResize(),l(c)}return s(i,[{key:"beginFrame",value:function(){return!this._atlas||this._atlas.beginFrame()}},{key:"updateCell",value:function(e,t,i,r,n,s,o,a){this._updateCell(this._vertices.attributes,e,t,i,r,n,s,o,a)}},{key:"_updateCell",value:function(e,t,i,r,n,s,c,l,h){_.i=(i*this._terminal.cols+t)*u,r!==a.NULL_CELL_CODE&&void 0!==r?this._atlas&&(l&&l.length>1?_.glyph=this._atlas.getRasterizedGlyphCombinedChar(l,n,s,c):_.glyph=this._atlas.getRasterizedGlyph(r,n,s,c),_.leftCellPadding=Math.floor((this._dimensions.scaledCellWidth-this._dimensions.scaledCharWidth)/2),n!==h&&_.glyph.offset.x>_.leftCellPadding?(_.clippedPixels=_.glyph.offset.x-_.leftCellPadding,e[_.i]=-(_.glyph.offset.x-_.clippedPixels)+this._dimensions.scaledCharLeft,e[_.i+1]=-_.glyph.offset.y+this._dimensions.scaledCharTop,e[_.i+2]=(_.glyph.size.x-_.clippedPixels)/this._dimensions.scaledCanvasWidth,e[_.i+3]=_.glyph.size.y/this._dimensions.scaledCanvasHeight,e[_.i+4]=_.glyph.texturePositionClipSpace.x+_.clippedPixels/this._atlas.cacheCanvas.width,e[_.i+5]=_.glyph.texturePositionClipSpace.y,e[_.i+6]=_.glyph.sizeClipSpace.x-_.clippedPixels/this._atlas.cacheCanvas.width,e[_.i+7]=_.glyph.sizeClipSpace.y):(e[_.i]=-_.glyph.offset.x+this._dimensions.scaledCharLeft,e[_.i+1]=-_.glyph.offset.y+this._dimensions.scaledCharTop,e[_.i+2]=_.glyph.size.x/this._dimensions.scaledCanvasWidth,e[_.i+3]=_.glyph.size.y/this._dimensions.scaledCanvasHeight,e[_.i+4]=_.glyph.texturePositionClipSpace.x,e[_.i+5]=_.glyph.texturePositionClipSpace.y,e[_.i+6]=_.glyph.sizeClipSpace.x,e[_.i+7]=_.glyph.sizeClipSpace.y)):(0,o.fill)(e,0,_.i,_.i+u-1-2)}},{key:"clear",value:function(){var e=this._terminal,t=e.cols*e.rows*u;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);for(var i=0;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==t?this._vertices.attributesBuffers[i]=new Float32Array(t):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=t;for(var r=0,n=0;n<e.rows;n++)for(var s=0;s<e.cols;s++)this._vertices.attributes[r+8]=s/e.cols,this._vertices.attributes[r+9]=n/e.rows,r+=u}},{key:"onResize",value:function(){var e=this._gl;e.viewport(0,0,e.canvas.width,e.canvas.height),this.clear()}},{key:"render",value:function(e){if(this._atlas){var t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;for(var i=this._vertices.attributesBuffers[this._activeBuffer],r=0,s=0;s<e.lineLengths.length;s++){var o=s*this._terminal.cols*u,a=this._vertices.attributes.subarray(o,o+e.lineLengths[s]*u);i.set(a,r),r+=a.length}t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,i.subarray(0,r),t.STREAM_DRAW),this._atlas.hasCanvasChanged&&(this._atlas.hasCanvasChanged=!1,t.uniform1i(this._textureLocation,0),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this._atlasTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this._atlas.cacheCanvas),t.generateMipmap(t.TEXTURE_2D)),t.uniformMatrix4fv(this._projectionLocation,!1,n.PROJECTION_MATRIX),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),t.drawElementsInstanced(t.TRIANGLES,6,t.UNSIGNED_BYTE,0,r/u)}}},{key:"setAtlas",value:function(e){var t=this._gl;this._atlas=e,t.bindTexture(t.TEXTURE_2D,this._atlasTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.cacheCanvas),t.generateMipmap(t.TEXTURE_2D)}},{key:"setDimensions",value:function(e){this._dimensions=e}}]),i}(h.Disposable);t.GlyphRenderer=v},742:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;var n=i(381),o=i(310),a=i(859),h=i(302),u=8*Float32Array.BYTES_PER_ELEMENT,f={rgba:0,isDefault:!1,x1:0,y1:0,r:0,g:0,b:0,a:0},_=function(e){c(i,e);var t=d(i);function i(e,s,o,c){var h;r(this,i),(h=t.call(this))._terminal=e,h._colors=s,h._gl=o,h._dimensions=c,h._vertices={count:0,attributes:new Float32Array(160)};var f=h._gl;h._program=(0,n.throwIfFalsy)((0,n.createProgram)(f,"#version 300 es\nlayout (location = 0) in vec2 a_position;\nlayout (location = 1) in vec2 a_size;\nlayout (location = 2) in vec4 a_color;\nlayout (location = 3) in vec2 a_unitquad;\n\nuniform mat4 u_projection;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 zeroToOne = a_position + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_color = a_color;\n}","#version 300 es\nprecision lowp float;\n\nin vec4 v_color;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n}")),h.register((0,a.toDisposable)((function(){return f.deleteProgram(h._program)}))),h._projectionLocation=(0,n.throwIfFalsy)(f.getUniformLocation(h._program,"u_projection")),h._vertexArrayObject=f.createVertexArray(),f.bindVertexArray(h._vertexArrayObject);var d=new Float32Array([0,0,1,0,0,1,1,1]),_=f.createBuffer();h.register((0,a.toDisposable)((function(){return f.deleteBuffer(_)}))),f.bindBuffer(f.ARRAY_BUFFER,_),f.bufferData(f.ARRAY_BUFFER,d,f.STATIC_DRAW),f.enableVertexAttribArray(3),f.vertexAttribPointer(3,2,h._gl.FLOAT,!1,0,0);var v=new Uint8Array([0,1,3,0,2,3]),g=f.createBuffer();return h.register((0,a.toDisposable)((function(){return f.deleteBuffer(g)}))),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,g),f.bufferData(f.ELEMENT_ARRAY_BUFFER,v,f.STATIC_DRAW),h._attributesBuffer=(0,n.throwIfFalsy)(f.createBuffer()),h.register((0,a.toDisposable)((function(){return f.deleteBuffer(h._attributesBuffer)}))),f.bindBuffer(f.ARRAY_BUFFER,h._attributesBuffer),f.enableVertexAttribArray(0),f.vertexAttribPointer(0,2,f.FLOAT,!1,u,0),f.vertexAttribDivisor(0,1),f.enableVertexAttribArray(1),f.vertexAttribPointer(1,2,f.FLOAT,!1,u,2*Float32Array.BYTES_PER_ELEMENT),f.vertexAttribDivisor(1,1),f.enableVertexAttribArray(2),f.vertexAttribPointer(2,4,f.FLOAT,!1,u,4*Float32Array.BYTES_PER_ELEMENT),f.vertexAttribDivisor(2,1),h._updateCachedColors(),l(h)}return s(i,[{key:"render",value:function(){var e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,n.PROJECTION_MATRIX),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,this._vertices.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLES,6,e.UNSIGNED_BYTE,0,this._vertices.count)}},{key:"onResize",value:function(){this._updateViewportRectangle()}},{key:"setColors",value:function(){this._updateCachedColors(),this._updateViewportRectangle()}},{key:"setDimensions",value:function(e){this._dimensions=e}},{key:"_updateCachedColors",value:function(){this._bgFloat=this._colorToFloat32Array(this._colors.background)}},{key:"_updateViewportRectangle",value:function(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.scaledCellWidth,this._terminal.rows*this._dimensions.scaledCellHeight,this._bgFloat)}},{key:"updateBackgrounds",value:function(e){var t,i,r,n,s,a,c,l,h,u,f,d=this._terminal,_=this._vertices,v=1;for(t=0;t<d.rows;t++){for(r=-1,n=0,s=0,a=!1,i=0;i<d.cols;i++)c=(t*d.cols+i)*o.RENDER_MODEL_INDICIES_PER_CELL,l=e.cells[c+o.RENDER_MODEL_BG_OFFSET],u=!!(67108864&(h=e.cells[c+o.RENDER_MODEL_FG_OFFSET])),(l!==n||h!==s&&(a||u))&&((0!==n||a&&0!==s)&&(f=8*v++,this._updateRectangle(_,f,s,n,r,i,t)),r=i,n=l,s=h,a=u);(0!==n||a&&0!==s)&&(f=8*v++,this._updateRectangle(_,f,s,n,r,d.cols,t))}_.count=v}},{key:"_updateRectangle",value:function(e,t,i,r,s,o,a){if(f.isDefault=!1,67108864&i)switch(50331648&i){case 16777216:case 33554432:f.rgba=this._colors.ansi[255&i].rgba;break;case 50331648:f.rgba=(16777215&i)<<8;break;default:f.rgba=this._colors.foreground.rgba}else switch(50331648&r){case 16777216:case 33554432:f.rgba=this._colors.ansi[255&r].rgba;break;case 50331648:f.rgba=(16777215&r)<<8;break;default:f.rgba=this._colors.background.rgba,f.isDefault=!0}e.attributes.length<t+4&&(e.attributes=(0,n.expandFloat32Array)(e.attributes,this._terminal.rows*this._terminal.cols*8)),f.x1=s*this._dimensions.scaledCellWidth,f.y1=a*this._dimensions.scaledCellHeight,f.r=(f.rgba>>24&255)/255,f.g=(f.rgba>>16&255)/255,f.b=(f.rgba>>8&255)/255,f.a=!f.isDefault&&134217728&r?h.DIM_OPACITY:1,this._addRectangle(e.attributes,t,f.x1,f.y1,(o-s)*this._dimensions.scaledCellWidth,this._dimensions.scaledCellHeight,f.r,f.g,f.b,f.a)}},{key:"_addRectangle",value:function(e,t,i,r,n,s,o,a,c,l){e[t]=i/this._dimensions.scaledCanvasWidth,e[t+1]=r/this._dimensions.scaledCanvasHeight,e[t+2]=n/this._dimensions.scaledCanvasWidth,e[t+3]=s/this._dimensions.scaledCanvasHeight,e[t+4]=o,e[t+5]=a,e[t+6]=c,e[t+7]=l}},{key:"_addRectangleFloat",value:function(e,t,i,r,n,s,o){e[t]=i/this._dimensions.scaledCanvasWidth,e[t+1]=r/this._dimensions.scaledCanvasHeight,e[t+2]=n/this._dimensions.scaledCanvasWidth,e[t+3]=s/this._dimensions.scaledCanvasHeight,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}},{key:"_colorToFloat32Array",value:function(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}}]),i}(a.Disposable);t.RectangleRenderer=_},310:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;var n=i(455);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=function(){function e(){r(this,e),this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection={hasSelection:!1,columnSelectMode:!1,viewportStartRow:0,viewportEndRow:0,viewportCappedStartRow:0,viewportCappedEndRow:0,startCol:0,endCol:0}}return s(e,[{key:"resize",value:function(e,i){var r=e*i*t.RENDER_MODEL_INDICIES_PER_CELL;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(i))}},{key:"clear",value:function(){(0,n.fill)(this.cells,0,0),(0,n.fill)(this.lineLengths,0,0)}},{key:"clearSelection",value:function(){this.selection.hasSelection=!1,this.selection.viewportStartRow=0,this.selection.viewportEndRow=0,this.selection.viewportCappedStartRow=0,this.selection.viewportCappedEndRow=0,this.selection.startCol=0,this.selection.endCol=0}}]),e}()},666:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;var n=i(965),h=i(733),u=i(461),f=i(713),_=i(742),v=i(310),g=i(859),p=i(855),y=i(476),m=i(345),C=i(782),S=i(820),b=i(147),k={fg:0,bg:0,hasFg:!1,hasBg:!1,isSelected:!1},w=function(e){c(i,e);var t=d(i);function i(e,n,s,o,a,c,d){var _;r(this,i),(_=t.call(this))._terminal=e,_._colors=n,_._characterJoinerService=s,_._coreBrowserService=o,_._decorationService=c,_._model=new v.RenderModel,_._workCell=new C.CellData,_._workColors={fg:0,bg:0,ext:0},_._onChangeTextureAtlas=new m.EventEmitter,_._onRequestRedraw=new m.EventEmitter,_._onContextLoss=new m.EventEmitter,_._core=_._terminal._core,_._renderLayers=[new h.LinkRenderLayer(_._core.screenElement,2,_._colors,_._core,_._coreBrowserService),new u.CursorRenderLayer(e,_._core.screenElement,3,_._colors,_._onRequestRedraw,_._coreBrowserService,a)],_.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},_._devicePixelRatio=_._coreBrowserService.dpr,_._updateDimensions(),_._canvas=document.createElement("canvas");var g={antialias:!1,depth:!1,preserveDrawingBuffer:d};if(_._gl=_._canvas.getContext("webgl2",g),!_._gl)throw new Error("WebGL2 not supported "+_._gl);return _.register((0,S.addDisposableDomListener)(_._canvas,"webglcontextlost",(function(e){console.log("webglcontextlost event received"),e.preventDefault(),_._contextRestorationTimeout=setTimeout((function(){_._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),_._onContextLoss.fire(e)}),3e3)}))),_.register((0,S.addDisposableDomListener)(_._canvas,"webglcontextrestored",(function(e){console.warn("webglcontextrestored event received"),clearTimeout(_._contextRestorationTimeout),_._contextRestorationTimeout=void 0,(0,f.removeTerminalFromCache)(_._terminal),_._initializeWebGLState(),_._requestRedrawViewport()}))),_.register((0,y.observeDevicePixelDimensions)(_._canvas,_._coreBrowserService.window,(function(e,t){return _._setCanvasDevicePixelDimensions(e,t)}))),_._core.screenElement.appendChild(_._canvas),_._initializeWebGLState(),_._isAttached=_._coreBrowserService.window.document.body.contains(_._core.screenElement),l(_)}return s(i,[{key:"onChangeTextureAtlas",get:function(){return this._onChangeTextureAtlas.event}},{key:"onRequestRedraw",get:function(){return this._onRequestRedraw.event}},{key:"onContextLoss",get:function(){return this._onContextLoss.event}},{key:"dispose",value:function(){var e,t=!0,r=!1,n=void 0;try{for(var s,c=this._renderLayers[Symbol.iterator]();!(t=(s=c.next()).done);t=!0)s.value.dispose()}catch(e){r=!0,n=e}finally{try{t||null==c.return||c.return()}finally{if(r)throw n}}null===(e=this._canvas.parentElement)||void 0===e||e.removeChild(this._canvas),(0,f.removeTerminalFromCache)(this._terminal),o(a(i.prototype),"dispose",this).call(this)}},{key:"textureAtlas",get:function(){var e;return null===(e=this._charAtlas)||void 0===e?void 0:e.cacheCanvas}},{key:"setColors",value:function(e){this._colors=e;var t=!0,i=!1,r=void 0;try{for(var n,s=this._renderLayers[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var o=n.value;o.setColors(this._terminal,this._colors),o.reset(this._terminal)}}catch(e){i=!0,r=e}finally{try{t||null==s.return||s.return()}finally{if(i)throw r}}this._rectangleRenderer.setColors(),this._refreshCharAtlas(),this._clearModel(!0)}},{key:"onDevicePixelRatioChange",value:function(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.onResize(this._terminal.cols,this._terminal.rows))}},{key:"onResize",value:function(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);var i=!0,r=!1,n=void 0;try{for(var s,o=this._renderLayers[Symbol.iterator]();!(i=(s=o.next()).done);i=!0)s.value.resize(this._terminal,this.dimensions)}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}this._canvas.width=this.dimensions.scaledCanvasWidth,this._canvas.height=this.dimensions.scaledCanvasHeight,this._canvas.style.width="".concat(this.dimensions.canvasWidth,"px"),this._canvas.style.height="".concat(this.dimensions.canvasHeight,"px"),this._core.screenElement.style.width="".concat(this.dimensions.canvasWidth,"px"),this._core.screenElement.style.height="".concat(this.dimensions.canvasHeight,"px"),this._rectangleRenderer.setDimensions(this.dimensions),this._rectangleRenderer.onResize(),this._glyphRenderer.setDimensions(this.dimensions),this._glyphRenderer.onResize(),this._refreshCharAtlas(),this._clearModel(!1)}},{key:"onCharSizeChanged",value:function(){this.onResize(this._terminal.cols,this._terminal.rows)}},{key:"onBlur",value:function(){var e=!0,t=!1,i=void 0;try{for(var r,n=this._renderLayers[Symbol.iterator]();!(e=(r=n.next()).done);e=!0)r.value.onBlur(this._terminal)}catch(e){t=!0,i=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw i}}this._requestRedrawViewport()}},{key:"onFocus",value:function(){var e=!0,t=!1,i=void 0;try{for(var r,n=this._renderLayers[Symbol.iterator]();!(e=(r=n.next()).done);e=!0)r.value.onFocus(this._terminal)}catch(e){t=!0,i=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw i}}this._requestRedrawViewport()}},{key:"onSelectionChanged",value:function(e,t,i){var r=!0,n=!1,s=void 0;try{for(var o,a=this._renderLayers[Symbol.iterator]();!(r=(o=a.next()).done);r=!0)o.value.onSelectionChanged(this._terminal,e,t,i)}catch(e){n=!0,s=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw s}}this._updateSelectionModel(e,t,i),this._requestRedrawViewport()}},{key:"onCursorMove",value:function(){var e=!0,t=!1,i=void 0;try{for(var r,n=this._renderLayers[Symbol.iterator]();!(e=(r=n.next()).done);e=!0)r.value.onCursorMove(this._terminal)}catch(e){t=!0,i=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw i}}}},{key:"onOptionsChanged",value:function(){var e=!0,t=!1,i=void 0;try{for(var r,n=this._renderLayers[Symbol.iterator]();!(e=(r=n.next()).done);e=!0)r.value.onOptionsChanged(this._terminal)}catch(e){t=!0,i=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw i}}this._updateDimensions(),this._refreshCharAtlas()}},{key:"_initializeWebGLState",value:function(){var e,t;null===(e=this._rectangleRenderer)||void 0===e||e.dispose(),null===(t=this._glyphRenderer)||void 0===t||t.dispose(),this._rectangleRenderer=new _.RectangleRenderer(this._terminal,this._colors,this._gl,this.dimensions),this._glyphRenderer=new n.GlyphRenderer(this._terminal,this._colors,this._gl,this.dimensions),this.onCharSizeChanged()}},{key:"_refreshCharAtlas",value:function(){if(this.dimensions.scaledCharWidth<=0&&this.dimensions.scaledCharHeight<=0)this._isAttached=!1;else{var e=(0,f.acquireCharAtlas)(this._terminal,this._colors,this.dimensions.scaledCellWidth,this.dimensions.scaledCellHeight,this.dimensions.scaledCharWidth,this.dimensions.scaledCharHeight,this._coreBrowserService.dpr);if(!("getRasterizedGlyph"in e))throw new Error("The webgl renderer only works with the webgl char atlas");this._charAtlas!==e&&this._onChangeTextureAtlas.fire(e.cacheCanvas),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.setAtlas(this._charAtlas)}}},{key:"_clearModel",value:function(e){this._model.clear(),e&&this._glyphRenderer.clear()}},{key:"clearCharAtlas",value:function(){var e;null===(e=this._charAtlas)||void 0===e||e.clearTexture(),this._clearModel(!0),this._updateModel(0,this._terminal.rows-1),this._requestRedrawViewport()}},{key:"clear",value:function(){this._clearModel(!0);var e=!0,t=!1,i=void 0;try{for(var r,n=this._renderLayers[Symbol.iterator]();!(e=(r=n.next()).done);e=!0)r.value.reset(this._terminal)}catch(e){t=!0,i=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw i}}}},{key:"registerCharacterJoiner",value:function(e){return-1}},{key:"deregisterCharacterJoiner",value:function(e){return!1}},{key:"renderRows",value:function(e,t){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._core._charSizeService.width&&this._core._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}var i=!0,r=!1,n=void 0;try{for(var s,o=this._renderLayers[Symbol.iterator]();!(i=(s=o.next()).done);i=!0)s.value.onGridChanged(this._terminal,e,t)}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}this._glyphRenderer.beginFrame()&&(this._clearModel(!0),this._updateSelectionModel(void 0,void 0)),this._updateModel(e,t),this._rectangleRenderer.render(),this._glyphRenderer.render(this._model)}},{key:"_updateModel",value:function(e,t){var i,r,n,s,o,a,c,l,h,u,f,d,_,g=this._core,y=this._workCell;for(r=e;r<=t;r++)for(n=r+g.buffer.ydisp,s=g.buffer.lines.get(n),this._model.lineLengths[r]=0,o=this._characterJoinerService.getJoinedCharacters(n),d=0;d<g.cols;d++)if(i=this._workColors.bg,s.loadCell(d,y),0===d&&(i=this._workColors.bg),a=!1,c=d,o.length>0&&d===o[0][0]&&(a=!0,l=o.shift(),y=new L(y,s.translateToString(!0,l[0],l[1]),l[1]-l[0]),c=l[1]-1),h=y.getChars(),u=y.getCode(),f=(r*g.cols+d)*v.RENDER_MODEL_INDICIES_PER_CELL,this._loadColorsForCell(d,n),u!==p.NULL_CELL_CODE&&(this._model.lineLengths[r]=d+1),(this._model.cells[f]!==u||this._model.cells[f+v.RENDER_MODEL_BG_OFFSET]!==this._workColors.bg||this._model.cells[f+v.RENDER_MODEL_FG_OFFSET]!==this._workColors.fg||this._model.cells[f+v.RENDER_MODEL_EXT_OFFSET]!==this._workColors.ext)&&(h.length>1&&(u|=v.COMBINED_CHAR_BIT_MASK),this._model.cells[f]=u,this._model.cells[f+v.RENDER_MODEL_BG_OFFSET]=this._workColors.bg,this._model.cells[f+v.RENDER_MODEL_FG_OFFSET]=this._workColors.fg,this._model.cells[f+v.RENDER_MODEL_EXT_OFFSET]=this._workColors.ext,this._glyphRenderer.updateCell(d,r,u,this._workColors.bg,this._workColors.fg,this._workColors.ext,h,i),a))for(y=this._workCell,d++;d<c;d++)_=(r*g.cols+d)*v.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.updateCell(d,r,p.NULL_CELL_CODE,0,0,0,p.NULL_CELL_CHAR,0),this._model.cells[_]=p.NULL_CELL_CODE,this._model.cells[_+v.RENDER_MODEL_BG_OFFSET]=this._workColors.bg,this._model.cells[_+v.RENDER_MODEL_FG_OFFSET]=this._workColors.fg,this._model.cells[_+v.RENDER_MODEL_EXT_OFFSET]=this._workColors.ext;this._rectangleRenderer.updateBackgrounds(this._model)}},{key:"_loadColorsForCell",value:function(e,t){this._workColors.bg=this._workCell.bg,this._workColors.fg=this._workCell.fg,this._workColors.ext=268435456&this._workCell.bg?this._workCell.extended.ext:0,k.bg=0,k.fg=0,k.hasBg=!1,k.hasFg=!1,k.isSelected=!1,this._decorationService.forEachDecorationAtCell(e,t,"bottom",(function(e){e.backgroundColorRGB&&(k.bg=e.backgroundColorRGB.rgba>>8&16777215,k.hasBg=!0),e.foregroundColorRGB&&(k.fg=e.foregroundColorRGB.rgba>>8&16777215,k.hasFg=!0)})),k.isSelected=this._isCellSelected(e,t),k.isSelected&&(k.bg=(this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque).rgba>>8&16777215,k.hasBg=!0,this._colors.selectionForeground&&(k.fg=this._colors.selectionForeground.rgba>>8&16777215,k.hasFg=!0)),this._decorationService.forEachDecorationAtCell(e,t,"top",(function(e){e.backgroundColorRGB&&(k.bg=e.backgroundColorRGB.rgba>>8&16777215,k.hasBg=!0),e.foregroundColorRGB&&(k.fg=e.foregroundColorRGB.rgba>>8&16777215,k.hasFg=!0)})),k.hasBg&&(k.isSelected?k.bg=-16777216&this._workCell.bg&-134217729|k.bg|50331648:k.bg=-16777216&this._workCell.bg|k.bg|50331648),k.hasFg&&(k.fg=-16777216&this._workCell.fg&-67108865|k.fg|50331648),67108864&this._workColors.fg&&(k.hasBg&&!k.hasFg&&(0==(50331648&this._workColors.bg)?k.fg=-134217728&this._workColors.fg|16777215&this._colors.background.rgba>>8|50331648:k.fg=-134217728&this._workColors.fg|67108863&this._workColors.bg,k.hasFg=!0),!k.hasBg&&k.hasFg&&(0==(50331648&this._workColors.fg)?k.bg=-67108864&this._workColors.bg|16777215&this._colors.foreground.rgba>>8|50331648:k.bg=-67108864&this._workColors.bg|67108863&this._workColors.fg,k.hasBg=!0)),this._workColors.bg=k.hasBg?k.bg:this._workColors.bg,this._workColors.fg=k.hasFg?k.fg:this._workColors.fg}},{key:"_isCellSelected",value:function(e,t){return!!this._model.selection.hasSelection&&(t-=this._terminal.buffer.active.viewportY,this._model.selection.columnSelectMode?this._model.selection.startCol<=this._model.selection.endCol?e>=this._model.selection.startCol&&t>=this._model.selection.viewportCappedStartRow&&e<this._model.selection.endCol&&t<=this._model.selection.viewportCappedEndRow:e<this._model.selection.startCol&&t>=this._model.selection.viewportCappedStartRow&&e>=this._model.selection.endCol&&t<=this._model.selection.viewportCappedEndRow:t>this._model.selection.viewportStartRow&&t<this._model.selection.viewportEndRow||this._model.selection.viewportStartRow===this._model.selection.viewportEndRow&&t===this._model.selection.viewportStartRow&&e>=this._model.selection.startCol&&e<this._model.selection.endCol||this._model.selection.viewportStartRow<this._model.selection.viewportEndRow&&t===this._model.selection.viewportEndRow&&e<this._model.selection.endCol||this._model.selection.viewportStartRow<this._model.selection.viewportEndRow&&t===this._model.selection.viewportStartRow&&e>=this._model.selection.startCol)}},{key:"_updateSelectionModel",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this._terminal;if(e&&t&&(e[0]!==t[0]||e[1]!==t[1])){var n=e[1]-r.buffer.active.viewportY,s=t[1]-r.buffer.active.viewportY,o=Math.max(n,0),a=Math.min(s,r.rows-1);o>=r.rows||a<0?this._model.clearSelection():(this._model.selection.hasSelection=!0,this._model.selection.columnSelectMode=i,this._model.selection.viewportStartRow=n,this._model.selection.viewportEndRow=s,this._model.selection.viewportCappedStartRow=o,this._model.selection.viewportCappedEndRow=a,this._model.selection.startCol=e[0],this._model.selection.endCol=t[0])}else this._model.clearSelection()}},{key:"_updateDimensions",value:function(){this._core._charSizeService.width&&this._core._charSizeService.height&&(this.dimensions.scaledCharWidth=Math.floor(this._core._charSizeService.width*this._devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._core._charSizeService.height*this._devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/this._devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/this._devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.scaledCellHeight/this._devicePixelRatio,this.dimensions.actualCellWidth=this.dimensions.scaledCellWidth/this._devicePixelRatio)}},{key:"_setCanvasDevicePixelDimensions",value:function(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}},{key:"_requestRedrawViewport",value:function(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}}]),i}(g.Disposable);t.WebglRenderer=w;var L=function(e){c(i,e);var t=d(i);function i(e,n,s){var o;return r(this,i),(o=t.call(this)).content=0,o.combinedData="",o.fg=e.fg,o.bg=e.bg,o.combinedData=n,o._width=s,l(o)}return s(i,[{key:"isCombined",value:function(){return 2097152}},{key:"getWidth",value:function(){return this._width}},{key:"getChars",value:function(){return this.combinedData}},{key:"getCode",value:function(){return 2097151}},{key:"setFromCharData",value:function(e){throw new Error("not implemented")}},{key:"getAsCharData",value:function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}]),i}(b.AttributeData);t.JoinedCellData=L},381:function(e,t){var i=function(e,t,i){var n=r(e.createShader(t));if(e.shaderSource(n,i),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS))return n;console.error(e.getShaderInfoLog(n)),e.deleteShader(n)},r=function(e){if(!e)throw new Error("value must not be falsy");return e};Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=t.expandFloat32Array=t.createShader=t.createProgr