gotty/js/dist/gotty-bundle.js

29 lines
322 KiB
JavaScript
Raw Normal View History

2017-08-22 07:58:15 +00:00
!function(e){function t(i){if(r[i])return r[i].exports;var o=r[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(e,t,r){"use strict";function i(e){var t=this;if(!(this instanceof i))return new i(arguments[0],arguments[1],arguments[2]);t.browser=S,t.cancel=i.cancel,u.EventEmitter.call(this),"number"==typeof e&&(e={cols:arguments[0],rows:arguments[1],handler:arguments[2]}),e=e||{},Object.keys(i.defaults).forEach(function(r){null==e[r]&&(e[r]=i.options[r],i[r]!==i.defaults[r]&&(e[r]=i[r])),t[r]=e[r]}),8===e.colors.length?e.colors=e.colors.concat(i._colors.slice(8)):16===e.colors.length?e.colors=e.colors.concat(i._colors.slice(16)):10===e.colors.length?e.colors=e.colors.slice(0,-2).concat(i._colors.slice(8,-2),e.colors.slice(-2)):18===e.colors.length&&(e.colors=e.colors.concat(i._colors.slice(16,-2),e.colors.slice(-2))),this.colors=e.colors,this.options=e,this.parent=e.body||e.parent||(A?A.getElementsByTagName("body")[0]:null),this.cols=e.cols||e.geometry[0],this.rows=e.rows||e.geometry[1],this.geometry=[this.cols,this.rows],e.handler&&this.on("data",e.handler),this.ybase=0,this.ydisp=0,this.x=0,this.y=0,this.cursorState=0,this.cursorHidden=!1,this.convertEol,this.queue="",this.scrollTop=0,this.scrollBottom=this.rows-1,this.customKeyEventHandler=null,this.cursorBlinkInterval=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.normal=null,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.decLocator,this.x10Mouse,this.vt200Mouse,this.vt300Mouse,this.normalMouse,this.mouseEvents,this.sendFocus,this.utfMouse,this.sgrMouse,this.urxvtMouse,this.element,this.children,this.refreshStart,this.refreshEnd,this.savedX,this.savedY,this.savedCols,this.readable=!0,this.writable=!0,this.defAttr=131840,this.curAttr=this.defAttr,this.params=[],this.currentParam=0,this.prefix="",this.postfix="",this.inputHandler=new m.InputHandler(this),this.parser=new y.Parser(this.inputHandler,this),this.renderer=this.renderer||null,this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new _.Linkifier,this.writeBuffer=[],this.writeInProgress=!1,this.xoffSentToCatchUp=!1,this.writeStopped=!1,this.surrogate_high="",this.lines=new f.CircularList(this.scrollback);for(var r=this.rows;r--;)this.lines.push(this.blankLine());this.selectionManager&&this.selectionManager.setBuffer(this.lines),this.tabs,this.setupStops(),this.userScrolling=!1}function o(e,t,r,i){Array.isArray(e)||(e=[e]),e.forEach(function(e){e.addEventListener(t,r,i||!1)})}function s(e,t,r,i){e.removeEventListener(t,r,i||!1)}function n(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function a(e,t){var r=e.browser.isMac&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.browser.isMSWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"==t.type?r:r&&(!t.keyCode||t.keyCode>47)}function l(e,t,r){var o=e<<16|t<<8|r;if(null!=l._cache[o])return l._cache[o];for(var s,n,a,h,c,u=1/0,p=-1,d=0;d<i.vcolors.length;d++){if(s=i.vcolors[d],n=s[0],a=s[1],h=s[2],0===(c=l.distance(e,t,r,n,a,h))){p=d;break}c<u&&(u=c,p=d)}return l._cache[o]=p}function h(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}Object.defineProperty(t,"__esModule",{value:!0});var c=r(16),u=r(1),p=r(23),d=r(30),f=r(32),g=r(2),m=r(17),y=r(19),b=r(20),_=r(18),C=r(21),w=r(31),S=r(8),v=r(9),A="undefined"!=typeof window?window.document:null;n(i,u.EventEmitter),i.prototype.eraseAttr=function(){return-512&this.defAttr|511&this.curAttr},i.tangoColors=["#2e3436","#cc0000","#4e9a06","#c4a000","#3465a4","#75507b","#06989a","#d3d7cf","#555753","#ef2929","#8ae234","#fce94f","#729fcf","#ad7fa8","#34e2e2","#eeeeec"],i.colors=function(){f
* Implements the attach method, that attaches the terminal to a WebSocket stream.
* @module xterm/addons/attach/attach
* @license MIT
*/
2017-08-22 07:58:15 +00:00
!function(t){e.exports=t(r(0))}(function(e){"use strict";var t={};return t.attach=function(e,t,r,i){r=void 0===r||r,e.socket=t,e._flushBuffer=function(){e.write(e._attachSocketBuffer),e._attachSocketBuffer=null,clearTimeout(e._attachSocketBufferTimer),e._attachSocketBufferTimer=null},e._pushToBuffer=function(t){e._attachSocketBuffer?e._attachSocketBuffer+=t:(e._attachSocketBuffer=t,setTimeout(e._flushBuffer,10))},e._getMessage=function(t){i?e._pushToBuffer(t.data):e.write(t.data)},e._sendData=function(e){t.send(e)},t.addEventListener("message",e._getMessage),r&&e.on("data",e._sendData),t.addEventListener("close",e.detach.bind(e,t)),t.addEventListener("error",e.detach.bind(e,t))},t.detach=function(e,t){e.off("data",e._sendData),(t=void 0===t?e.socket:t)&&t.removeEventListener("message",e._getMessage),delete e.socket},e.prototype.attach=function(e,r,i){return t.attach(this,e,r,i)},e.prototype.detach=function(e){return t.detach(this,e)},t})},function(e,t,r){/**
* Fit terminal columns and rows to the dimensions of its DOM element.
*
* ## Approach
* - Rows: Truncate the division of the terminal parent element height by the terminal row height.
*
* - Columns: Truncate the division of the terminal parent element width by the terminal character
* width (apply display: inline at the terminal row and truncate its width with the current
* number of columns).
* @module xterm/addons/fit/fit
* @license MIT
*/
2017-08-22 07:58:15 +00:00
!function(t){e.exports=t(r(0))}(function(e){var t={};return t.proposeGeometry=function(e){if(!e.element.parentElement)return null;var t,r,i,o,s=window.getComputedStyle(e.element.parentElement),n=parseInt(s.getPropertyValue("height")),a=Math.max(0,parseInt(s.getPropertyValue("width"))-17),l=window.getComputedStyle(e.element),h=n-(parseInt(l.getPropertyValue("padding-top"))+parseInt(l.getPropertyValue("padding-bottom"))),c=a-(parseInt(l.getPropertyValue("padding-right"))+parseInt(l.getPropertyValue("padding-left"))),u=(e.rowContainer,e.rowContainer.firstElementChild),p=u.innerHTML;return u.style.display="inline",u.innerHTML="W",i=u.getBoundingClientRect().width,u.style.display="",t=u.getBoundingClientRect().height,u.innerHTML=p,r=parseInt(h/t),o=parseInt(c/i),{cols:o,rows:r}},t.fit=function(e){var r=t.proposeGeometry(e);r&&e.resize(r.cols,r.rows)},e.prototype.proposeGeometry=function(){return t.proposeGeometry(this)},e.prototype.fit=function(){return t.fit(this)},t})},function(e,t,r){/**
* Fullscreen addon for xterm.js
* @module xterm/addons/fullscreen/fullscreen
* @license MIT
*/
2017-08-22 07:58:15 +00:00
!function(t){e.exports=t(r(0))}(function(e){var t={};return t.toggleFullScreen=function(e,t){var r;r=void 0===t?e.element.classList.contains("fullscreen")?"remove":"add":t?"add":"remove",e.element.classList[r]("fullscreen")},e.prototype.toggleFullscreen=function(e){t.toggleFullScreen(this,e)},t})},function(e,t,r){/**
* This module provides methods for attaching a terminal to a terminado WebSocket stream.
*
* @module xterm/addons/terminado/terminado
* @license MIT
*/
2017-08-22 07:58:15 +00:00
!function(t){e.exports=t(r(0))}(function(e){"use strict";var t={};return t.terminadoAttach=function(e,t,r,i){r=void 0===r||r,e.socket=t,e._flushBuffer=function(){e.write(e._attachSocketBuffer),e._attachSocketBuffer=null,clearTimeout(e._attachSocketBufferTimer),e._attachSocketBufferTimer=null},e._pushToBuffer=function(t){e._attachSocketBuffer?e._attachSocketBuffer+=t:(e._attachSocketBuffer=t,setTimeout(e._flushBuffer,10))},e._getMessage=function(t){var r=JSON.parse(t.data);"stdout"==r[0]&&(i?e._pushToBuffer(r[1]):e.write(r[1]))},e._sendData=function(e){t.send(JSON.stringify(["stdin",e]))},e._setSize=function(e){t.send(JSON.stringify(["set_size",e.rows,e.cols]))},t.addEventListener("message",e._getMessage),r&&e.on("data",e._sendData),e.on("resize",e._setSize),t.addEventListener("close",e.terminadoDetach.bind(e,t)),t.addEventListener("error",e.terminadoDetach.bind(e,t))},t.terminadoDetach=function(e,t){e.off("data",e._sendData),(t=void 0===t?e.socket:t)&&t.removeEventListener("message",e._getMessage),delete e.socket},e.prototype.terminadoAttach=function(e,r,i){return t.terminadoAttach(this,e,r,i)},e.prototype.terminadoDetach=function(e){return t.terminadoDetach(this,e)},t})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(34),o="undefined"==typeof navigator,s=o?"node":navigator.userAgent,n=o?"node":navigator.platform;t.isFirefox=!!~s.indexOf("Firefox"),t.isMSIE=!!~s.indexOf("MSIE")||!!~s.indexOf("Trident"),t.isMac=i.contains(["Macintosh","MacIntel","MacPPC","Mac68K"],n),t.isIpad="iPad"===n,t.isIphone="iPhone"===n,t.isMSWindows=i.contains(["Windows","Win16","Win32","WinCE"],n),t.isLinux=n.indexOf("Linux")>=0},function(e,t,r){"use strict";function i(e,t){if(null==e.pageX)return null;for(var r=e.pageX,i=e.pageY;t&&t!==self.document.documentElement;)r-=t.offsetLeft,i-=t.offsetTop,t="offsetParent"in t?t.offsetParent:t.parentElement;return[r,i]}function o(e,t,r,o,s,n){var a=i(e,t);return a[0]=Math.ceil((a[0]+(n?r.width/2:0))/r.width),a[1]=Math.ceil(a[1]/r.height),a[0]=Math.min(Math.max(a[0],1),o+1),a[1]=Math.min(Math.max(a[1],1),s+1),a}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoordsRelativeToElement=i,t.getCoords=o,t.getRawByteCoords=function(e,t,r,i,s){var n=o(e,t,r,i,s),a=n[0],l=n[1];return a+=32,l+=32,{x:a,y:l}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(14),o=function(){function e(e){this.elem=e,i.hterm.defaultStorage=new i.lib.Storage.Memory,this.term=new i.hterm.Terminal,this.term.getPrefs().set("send-encoding","raw"),this.term.decorate(this.elem),this.io=this.term.io.push(),this.term.installKeyboard()}return e.prototype.info=function(){return{columns:this.columns,rows:this.rows}},e.prototype.output=function(e){null!=this.term.io&&this.term.io.writeUTF16(e)},e.prototype.showMessage=function(e,t){this.message=e,t>0?this.term.io.showOverlay(e,t):this.term.io.showOverlay(e,null)},e.prototype.removeMessage=function(){this.term.io.showOverlay(this.message,0)},e.prototype.setWindowTitle=function(e){this.term.setWindowTitle(e)},e.prototype.setPreferences=function(e){var t=this;Object.keys(e).forEach(function(r){t.term.getPrefs().set(r,e[r])})},e.prototype.onInput=function(e){this.io.onVTKeystroke=function(t){e(t)},this.io.sendString=function(t){e(t)}},e.prototype.onResize=function(e){var t=this;this.io.onTerminalResize=function(r,i){t.columns=r,t.rows=i,e(r,i)}},e.prototype.deactivate=function(){this.io.onVTKeystroke=null,this.io.sendString=null,this.io.onTerminalResize=null,this.term.uninstallKeyboard()},e.prototype.reset=function(){this.removeMessage(),this.term.installKeyboard()},e.prototype.close=function(){this.term.uninstallKeyboard()},e}();t.Hterm=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){this.url=e,this.protocols=t}return e.prototype.create=function(){return new o(this.url,this.protocols)},e}();t.ConnectionFactory=i;var o=function(){function e(e,t){this.bare=new WebSocket(e,t)}return e.prototype.open=function(){},e.prototype.close=function(){this.bare.close(