'use strict';var _typeof='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a};(function(){'use strict';function a(){var a;for(p=!0,a=0;a":'>','"':'"',"'":''',"/":'/',"`":'`',"=":'='};m.htmlEscape=function(a){return(a+'').replace(/[&<>"'`=\/]/g,function(a){return t[a]})},d.$=m})(); 'use strict';(function(a){function b(a,b){for(var c=a.length;c--;)if(a[c]===b)return c;return-1}function c(a,b){if(a.length!=b.length)return!1;for(var c=0;cj;j++)p['f'+j]=111+j;var s={16:'shiftKey',17:'ctrlKey',18:'altKey',91:'metaKey'};for(j in o)f[j]=!1;i(document,'keydown',function(a){e(a)}),i(document,'keyup',function(a){var c,d=a.keyCode,e=b(r,d);if(0<=e&&r.splice(e,1),(93==d||224==d)&&(d=91),d in n)for(c in n[d]=!1,o)o[c]==d&&(f[c]=!1)}),i(window,'focus',function(){for(j in n)n[j]=!1;for(j in o)f[j]=!1});var t=a.key;a.key=f,a.key.setScope=function(a){k=a||'all'},a.key.getScope=g,a.key.deleteScope=function(a){var b,c,d;for(b in m)for(c=m[b],d=0;di||1114111=i?a.push(i):(i-=65536,d=(i>>10)+55296,e=i%1024+56320,a.push(d,e)),(f+1==g||a.length>16384)&&(h+=b.apply(null,a),a.length=0)}return h};a?a(String,'fromCodePoint',{value:d,configurable:!0,writable:!0}):String.fromCodePoint=d}(); 'use strict';function mk(a){return document.createElement(a)}function qs(a){return document.querySelector(a)}function qsa(a){return document.querySelectorAll(a)}function bool(a){return 1===a||'1'===a||!0===a||'true'===a}function cr(a){return function(b){(10===b.which||13===b.which||32===b.which)&&a()}}function extend(a,b){var c={};return Object.keys(a).forEach(function(b){c[b]=a[b]}),Object.keys(b).forEach(function(a){c[a]=b[a]}),c}function rgxe(a){return a.replace(/[-[\]/{}()*+?.\\^$|]/g,'\\$&')}function numfmt(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}function msNow(){return+new Date}function msElapsed(a){return msNow()-a}Math.log10=Math.log10||function(a){return Math.log(a)/Math.LN10};function esc(a){return $.htmlEscape(a)}function undef(a){return'undefined'==typeof a}function jsp(a){try{return JSON.parse(a)}catch(a){return console.error(a),null}}function Chr(a){return String.fromCharCode(a)}function parse2B(a){var b=1'+a.rssi_perc+'').htmlAppend('
'+i+'
').htmlAppend('
'+g[a.enc]+'
'),d.on('click',function(){var a=$(this);var b=a.data('ssid');var d='';+a.data('pwd')&&(d=prompt(tr('wifi.enter_passwd').replace(':ssid:',b)),!d)||($('#sta_password').val(d),$('#sta_ssid').val(b),c(b,d,''))}),b.appendChild(f),e[0].appendChild(b)}})}}function e(){_demo?d(_demo_aps,200):$.get('http://'+_root+'/cfg/wifi/scan',d)}function f(a){setTimeout(e,a)}var g=['Open','WEP','WPA','WPA2','WPA/WPA2'];var h;a.init=function(a){$('.Row.range').forEach(function(a){var c=a.querySelector('input');var d=a.querySelector('.x-disp1');var e=a.querySelector('.x-disp2');var f=b(c);$(d).html(f),$(e).html(f),$(c).on('input',function(){f=b(c),$(d).html(f),$(e).html(f)})}),$('#forget-sta').on('click',function(){return c('','',''),!1}),c(a.sta_ssid,a.sta_password,a.sta_active_ip),h=a.sta_active_ssid},a.startScanning=function(){$('#ap-loader').removeClass('hidden'),$('#ap-scan').addClass('hidden'),$('#ap-loader .anim-dots').html('.'),e()}})(window.WiFi={}); 'use strict';window.Conn=function(){function a(){console.log('CONNECTED'),f(),d('i')}function b(a){console.warn('SOCKET CLOSED, code '+a.code+'. Reconnecting...'),clearTimeout(m),m=setTimeout(function(){e()},2e3)}function c(a){try{switch(a.data.charAt(0)){case'.':break;case'-':k=!0,l=setTimeout(function(){k=!1},250);break;case'+':k=!1,clearTimeout(l);break;default:Screen.load(a.data),n||(showPage(),n=!0);}f()}catch(a){console.error(a)}}function d(a){return _demo?(console.log('TX: ',a),!0):k?(console.log('Can\'t send, flood control.'),!1):!!h&&(1===h.readyState?('string'!=typeof a&&(a=JSON.stringify(a)),h.send(a),!0):(console.error('Socket not ready'),!1))}function e(){return _demo?(console.log('Demo mode!'),Screen.load(_demo_screen),void showPage()):void(clearTimeout(m),clearTimeout(i),h=new WebSocket('ws://'+_root+'/term/update.ws'),h.onopen=a,h.onclose=b,h.onmessage=c,console.log('Opening socket.'),f())}function f(){clearTimeout(i),i=setTimeout(g,2e3)}function g(){console.error('Heartbeat lost, probing server...'),j=setInterval(function(){console.log('> ping'),$.get('http://'+_root+'/system/ping',function(a,b){200===b&&(clearInterval(j),console.info('Server ready, reloading page...'),location.reload())},{timeout:100})},1e3)}var h;var i;var j;var k=!1;var l;var m;var n=!1;return{ws:null,init:e,send:d,canSend:function(){return!k}}}(); 'use strict';window.Input=function(){function a(a){return Conn.send('s'+a)}function b(a){Conn.send('b'+Chr(a))}function c(a,b){return j.fn_alt?a:b}function d(a,b){return j.cu_alt?a:b}function e(a,b){return j.np_alt?a:b}function f(){var a={tab:'\t',backspace:'\b',enter:j.crlf_mode?'\r\n':'\r',"ctrl+enter":'\n',esc:'\x1B',up:d('\x1BOA','\x1B[A'),down:d('\x1BOB','\x1B[B'),right:d('\x1BOC','\x1B[C'),left:d('\x1BOD','\x1B[D'),home:d('\x1BOH',c('\x1B[H','\x1B[1~')),insert:'\x1B[2~',delete:'\x1B[3~',end:d('\x1BOF',c('\x1B[F','\x1B[4~')),pageup:'\x1B[5~',pagedown:'\x1B[6~',f1:c('\x1BOP','\x1B[11~'),f2:c('\x1BOQ','\x1B[12~'),f3:c('\x1BOR','\x1B[13~'),f4:c('\x1BOS','\x1B[14~'),f5:'\x1B[15~',f6:'\x1B[17~',f7:'\x1B[18~',f8:'\x1B[19~',f9:'\x1B[20~',f10:'\x1B[21~',f11:'\x1B[23~',f12:'\x1B[24~',"shift+f1":c('\x1BO1;2P','\x1B[25~'),"shift+f2":c('\x1BO1;2Q','\x1B[26~'),"shift+f3":c('\x1BO1;2R','\x1B[28~'),"shift+f4":c('\x1BO1;2S','\x1B[29~'),"shift+f5":c('\x1B[15;2~','\x1B[31~'),"shift+f6":c('\x1B[17;2~','\x1B[32~'),"shift+f7":c('\x1B[18;2~','\x1B[33~'),"shift+f8":c('\x1B[19;2~','\x1B[34~'),"shift+f9":c('\x1B[20;2~','\x1B[35~'),"shift+f10":c('\x1B[21;2~','\x1B[36~'),"shift+f11":c('\x1B[22;2~','\x1B[37~'),"shift+f12":c('\x1B[23;2~','\x1B[38~'),np_0:e('\x1BOp','0'),np_1:e('\x1BOq','1'),np_2:e('\x1BOr','2'),np_3:e('\x1BOs','3'),np_4:e('\x1BOt','4'),np_5:e('\x1BOu','5'),np_6:e('\x1BOv','6'),np_7:e('\x1BOw','7'),np_8:e('\x1BOx','8'),np_9:e('\x1BOy','9'),np_mul:e('\x1BOR','*'),np_add:e('\x1BOl','+'),np_sub:e('\x1BOS','-'),np_point:e('\x1BOn','.'),np_div:e('\x1BOQ','/')};for(var b in a)a.hasOwnProperty(b)&&g(b,a[b])}function g(b,c){-1!==b.indexOf('ctrl+')&&(b+=','+b.replace('ctrl','command')),key.unbind(b),key(b,function(b){j.no_keys||(b.preventDefault(),a(c))})}function h(){var b=String.fromCharCode;window.addEventListener('keypress',function(b){if(!j.no_keys){var c='';b.key?c=b.key:b.which&&(c=String.fromCodePoint(b.which)),0=c;c++)g('ctrl+'+b(96+c),b(c));g('ctrl+]','\x1B'),g('ctrl+\\','\x1C'),g('ctrl+[','\x1D'),g('ctrl+^','\x1E'),g('ctrl+_','\x1F'),g('ctrl+left','\x1F[1;5D'),g('ctrl+right','\x1F[1;5C'),g('ctrl+up','\x1F[1;5A'),g('ctrl+down','\x1F[1;5B'),g('ctrl+home','\x1F[1;5H'),g('ctrl+end','\x1F[1;5F'),g('shift+left','\x1F[1;2D'),g('shift+right','\x1F[1;2C'),g('shift+up','\x1F[1;2A'),g('shift+down','\x1F[1;2B'),g('shift+home','\x1F[1;2H'),g('shift+end','\x1F[1;2F'),g('\u2325+left','\x1Fb'),g('\u2325+right','\x1Ff'),g('\u2318+left','\x01'),g('\u2318+right','\x05'),g('\u2325+backspace','\x17'),g('\u2318+backspace','\x15'),f()}function i(){return(key.isModifier('ctrl')?1:0)|(key.isModifier('shift')?2:0)|(key.isModifier('alt')?4:0)|(key.isModifier('meta')?8:0)}var j={np_alt:!1,cu_alt:!1,fn_alt:!1,mt_click:!1,mt_move:!1,no_keys:!1,crlf_mode:!1};var k=0;var l=0;var n=0;return{init:function(){h(),$('#action-buttons button').forEach(function(a){a.addEventListener('click',function(){b(+this.dataset.n)})}),window.addEventListener('mousedown',function(a){0===a.button&&(k=1),1===a.button&&(l=1),2===a.button&&(n=1)}),window.addEventListener('mouseup',function(a){0===a.button&&(k=0),1===a.button&&(l=0),2===a.button&&(n=0)})},sendString:a,setAlts:function setAlts(a,b,c,d){(j.cu_alt!==a||j.np_alt!==b||j.fn_alt!==c||j.crlf_mode!==d)&&(j.cu_alt=a,j.np_alt=b,j.fn_alt=c,j.crlf_mode=d,f())},setMouseMode:function setMouseMode(a,b){j.mt_click=a,j.mt_move=b},onMouseMove:function onMouseMove(a,c){if(j.mt_move){var d=k?1:l?2:n?3:0;var b=i();Conn.send('m'+encode2B(c)+encode2B(a)+encode2B(d)+encode2B(b))}},onMouseDown:function onMouseDown(a,c,d){if(j.mt_click&&!(3d)){var b=i();Conn.send('p'+encode2B(c)+encode2B(a)+encode2B(d)+encode2B(b))}},onMouseUp:function onMouseUp(a,c,d){if(j.mt_click&&!(3d)){var b=i();Conn.send('r'+encode2B(c)+encode2B(a)+encode2B(d)+encode2B(b))}},onMouseWheel:function onMouseWheel(a,c,d){if(j.mt_click){var e=i();var f=0>d?4:5;Conn.send('p'+encode2B(c)+encode2B(a)+encode2B(f)+encode2B(e))}},mouseTracksClicks:function mouseTracksClicks(){return j.mt_click},blockKeys:function blockKeys(a){j.no_keys=a}}}(); 'use strict';var _slicedToArray=function(){function a(a,b){var c=[];var d=!0;var e=!1;var f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{!d&&h['return']&&h['return']()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError('Invalid attempt to destructure non-iterable instance')}}();var _createClass=function(){function a(a,b){for(var c=0;cred;red++)for(var green=0;6>green;green++)for(var blue=0;6>blue;blue++){var redValue=40*red+(red?55:0);var greenValue=40*green+(green?55:0);var blueValue=40*blue+(blue?55:0);colorTable256.push('rgb('+redValue+', '+greenValue+', '+blueValue+')')}for(var gray=0;24>gray;gray++){var value=10*gray+8;colorTable256.push('rgb('+value+', '+value+', '+value+')')}var TermScreen=function(){function a(){var b=this;_classCallCheck(this,a),this.canvas=mk('canvas'),this.ctx=this.canvas.getContext('2d'),'AudioContext'in window||'webkitAudioContext'in window?this.audioCtx=new(window.AudioContext||window.webkitAudioContext):console.warn('No AudioContext!'),this.cursor={x:0,y:0,fg:7,bg:0,attrs:0,blinkOn:!1,blinking:!0,visible:!0,hanging:!1,style:'block',blinkEnable:!0,blinkInterval:0},this._palette=null,this._window={width:0,height:0,devicePixelRatio:1,fontFamily:'"DejaVu Sans Mono", "Liberation Mono", "Inconsolata", "Menlo", monospace',fontSize:20,gridScaleX:1,gridScaleY:1.2,blinkStyleOn:!0,blinkInterval:null,fitIntoWidth:0,fitIntoHeight:0,debug:!1},this.windowState={width:0,height:0,devicePixelRatio:0,gridScaleX:0,gridScaleY:0,fontFamily:'',fontSize:0,fitIntoWidth:0,fitIntoHeight:0},this.selection={selectable:!0,start:[0,0],end:[0,0]},this.mouseMode={clicks:!1,movement:!1},this._listeners={};var c=this;this.window=new Proxy(this._window,{set:function set(a,b,d){return a[b]=d,c.scheduleSizeUpdate(),c.scheduleDraw('window:'+b+'='+d),!0}}),this.blinkingCellCount=0,this.screen=[],this.screenFG=[],this.screenBG=[],this.screenAttrs=[],this.drawnScreen=[],this.drawnScreenFG=[],this.drawnScreenBG=[],this.drawnScreenAttrs=[],this.resetBlink(),this.resetCursorBlink();var d=!1;var f=function(a,c){d||(d=!0,b.selection.start=b.selection.end=b.screenToGrid(a,c),b.scheduleDraw('select-start'))};var g=function(a,c){d&&(b.selection.end=b.screenToGrid(a,c),b.scheduleDraw('select-move'))};var h=function(a,c){d&&(d=!1,b.selection.end=b.screenToGrid(a,c),b.scheduleDraw('select-end'),Object.assign(b.selection,b.getNormalizedSelection()))};this.canvas.addEventListener('mousedown',function(a){if((b.selection.selectable||a.altKey)&&0===a.button)f(a.offsetX,a.offsetY);else{var c;(c=Input).onMouseDown.apply(c,_toConsumableArray(b.screenToGrid(a.offsetX,a.offsetY)).concat([a.button+1]))}}),window.addEventListener('mousemove',function(a){g(a.offsetX,a.offsetY)}),window.addEventListener('mouseup',function(a){h(a.offsetX,a.offsetY)});var i=null;var j=0;var k=!1;var l=function(a){var c=b.canvas.getBoundingClientRect();return[a.clientX-c.left,a.clientY-c.top]};this.canvas.addEventListener('touchstart',function(a){i=l(a.touches[0]),k=!1,j=Date.now()}),this.canvas.addEventListener('touchmove',function(a){i=l(a.touches[0]),d||!1!=k?d&&(a.preventDefault(),g.apply(void 0,_toConsumableArray(i))):ja)return colorTable256[a];if(255>16;var c=255&a>>8;var d=255&a;return'rgb('+b+', '+c+', '+d+')'}return'rgba(0, 0, 0, 0)'}},{key:'scheduleSizeUpdate',value:function scheduleSizeUpdate(){var a=this;clearTimeout(this._scheduledSizeUpdate),this._scheduledSizeUpdate=setTimeout(function(){return a.updateSize()},1)}},{key:'scheduleDraw',value:function scheduleDraw(a){var b=this;var c=1h?(m=h/(l/m),l=h):i&&m>i&&(l=i*(l/m),m=i);else if(l>h||m>i){var n=l/m;n=a.blinkingCellCount||(b++,4<=b&&a.window.blinkStyleOn?(a.window.blinkStyleOn=!1,b=0):1<=b&&!a.window.blinkStyleOn&&(a.window.blinkStyleOn=!0,b=0))},200)}},{key:'getNormalizedSelection',value:function getNormalizedSelection(){var a=this.selection,b=a.start,c=a.end;if(b[1]>c[1]||b[1]===c[1]&&b[0]>c[0]){var d=[c,b];b=d[0],c=d[1]}return{start:b,end:c}}},{key:'isInSelection',value:function isInSelection(a,b){var c=this.getNormalizedSelection(),d=c.start,e=c.end;var f=d[0]<=a;var g=a=m+0.05};var s=function(a){var c=p.get(a)||q.get(a);var d=b.screen[a];var e=r(d);var g=e?2:1;if(!c){var u=!1;var h=!0;var i=!1;var j=void 0;try{for(var k,l=b.getAdjacentCells(a,g)[Symbol.iterator]();!(h=(k=l.next()).done);h=!0){var v=k.value;if(p.get(v)){u=!0;break}}}catch(a){i=!0,j=a}finally{try{!h&&l.return&&l.return()}finally{if(i)throw j}}u&&(c=!0)}if(c&&e){var m=!0;var n=!1;var o=void 0;try{for(var s,t=b.getAdjacentCells(a)[Symbol.iterator]();!(m=(s=t.next()).done);m=!0){var w=s.value;q.set(w,!0)}}catch(a){n=!0,o=a}finally{try{!m&&t.return&&t.return()}finally{if(n)throw o}}for(var x=a-1;0>9;0>1;var q=!(1&o);0==p?this.cursor.style='block':1==p?this.cursor.style='line':2==p&&(this.cursor.style='bar'),this.cursor.blinking!==q&&(this.cursor.blinking=q,this.resetCursorBlink()),Input.setMouseMode(m,n),this.selection.selectable=!n,$(this.canvas).toggleClass('selectable',!n),this.mouseMode={clicks:m,movement:n};$('.x-term-conf-btn').toggleClass('hidden',!!!(256&l)),$('#action-buttons').toggleClass('hidden',!!!(128&l));var r=7;var s=0;var t=0;var u=0;var v=' ';var w=this.window.width*this.window.height;f&&(this.updateSize(),this.blinkingCellCount=0,this.screen=Array(w).fill(' '),this.screenFG=Array(w).fill(' '),this.screenBG=Array(w).fill(' '),this.screenAttrs=Array(w).fill(' '));var x=undef(Array.from)?a.split(''):Array.from(a);var y=16;for(var z=function(){var a=t;0!=(a&y)&&(' '==v&&0==(a&200)||r==s)&&(a^=y),(b.screenAttrs[u]&y)!=(a&y)&&(a&y?b.blinkingCellCount++:b.blinkingCellCount--),b.screen[u]=v,b.screenFG[u]=r,b.screenBG[u]=s,b.screenAttrs[u]=a};cw));E++);break;case SEQ_SET_COLORS:C=parse3B(x[c]+x[c+1]+x[c+2]),c+=3,r=255&C,s=255&C>>8;break;case SEQ_SET_ATTRS:C=parse2B(x[c]+x[c+1]),c+=2,t=255&C;break;case SEQ_SET_FG:C=parse2B(x[c]+x[c+1]),c+=2,r=255&C;break;case SEQ_SET_BG:C=parse2B(x[c]+x[c+1]),c+=2,s=255&C;break;default:32>B&&(A='\uFFFD'),v=A,z(u),u++;}}this.window.debug&&console.log('Blinky cells = '+this.blinkingCellCount),this.scheduleDraw('load',16),this.emit('load')}},{key:'loadLabels',value:function loadLabels(a){var b=a.split('\x01');qs('h1').textContent=b[0],$('#action-buttons button').forEach(function(a,c){var d=b[c+1].trim();a.innerHTML=d?esc(d):' ',a.style.opacity=d?1:0.2})}},{key:'showNotification',value:function showNotification(a){if(console.info('Notification: '+a),Notification&&'granted'===Notification.permission){var b=new Notification('ESPTerm',{body:a});b.addEventListener('click',function(){return window.focus()})}else Notification&&'denied'!==Notification.permission?Notification.requestPermission():Notify.show(a)}},{key:'load',value:function load(a){var b=1Date.now()-50)){this._lastBeep=Date.now();var b,c;b=a.createOscillator(),c=a.createGain(),b.connect(c),c.connect(a.destination),c.gain.value=0.5,b.frequency.value=750,b.type='sine',b.start(),b.stop(a.currentTime+0.05),b=a.createOscillator(),c=a.createGain(),b.connect(c),c.connect(a.destination),c.gain.value=0.2,b.frequency.value=400,b.type='sine',b.start(a.currentTime+0.05),b.stop(a.currentTime+0.08)}}},{key:'palette',get:function get(){return this._palette||themes[0]},set:function set(a){this._palette!==a&&(this._palette=a,this.scheduleDraw('palette'))}}],[{key:'alphaToFraktur',value:function alphaToFraktur(a){var b=String.fromCodePoint;return'a'<=a&&'z'>=a?a=b(119997+a.charCodeAt(0)):'A'<=a&&'Z'>=a&&(a=frakturExceptions[a]||b(120003+a.charCodeAt(0))),a}}]),a}();var Screen=new TermScreen;Screen.once('load',function(){qs('#screen').appendChild(Screen.canvas)});var fitScreen=!1;function fitScreenIfNeeded(){Screen.window.fitIntoWidth=fitScreen?window.innerWidth-20:0,Screen.window.fitIntoHeight=fitScreen?window.innerHeight:0}fitScreenIfNeeded(),window.addEventListener('resize',fitScreenIfNeeded),window.toggleFitScreen=function(){fitScreen=!fitScreen;var a=qs('#resize-button-icon');fitScreen?(a.classList.remove('icn-resize-small'),a.classList.add('icn-resize-full')):(a.classList.remove('icn-resize-full'),a.classList.add('icn-resize-small')),fitScreenIfNeeded()}; 'use strict';window.TermUpl=function(){function a(){console.log('Upload modal closed.'),clearTimeout(h),g=0,Input.blockKeys(!1)}function b(a){qs('#fu_prog').textContent=a}function c(){if($('#fu_modal').hasClass('visible')){if(!Conn.canSend())return void(h=setTimeout(c,1));0===l&&(k=f[g++]+j);var a;if(k.length-l<=m?(a=k.substr(l,m),l=0):(a=k.substr(l,m),l+=m),!Input.sendString(a))return void b('FAILED!');var e=f.length;b(g+' / '+e+' ('+Math.round(1e3*(g/e))/10+'%)'),f.length>g||0i&&(i=0,qs('#fu_delay').value=i),j={CR:'\r',LF:'\n',CRLF:'\r\n'}[qs('#fu_crlf').value],$('#fu_form').toggleClass('busy',!0),b('Starting...'),c()):void e()},open:function(){b('Ready...'),Modal.show('#fu_modal',a),$('#fu_form').toggleClass('busy',!1),Input.blockKeys(!0)}}}(); "use strict";window.termInit=function(a,b){Conn.init(),Input.init(),TermUpl.init(),Screen.load(a,b)}; 'use strict';var _slicedToArray=function(){function a(a,b){var c=[];var d=!0;var e=!1;var f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{!d&&h['return']&&h['return']()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError('Invalid attempt to destructure non-iterable instance')}}();$.ready(function(){var a=qs('#softkb-input');if(a){var b=!1;var c=function(){if(b){var c=Screen.gridToScreen(Screen.cursor.x,Screen.cursor.y),d=_slicedToArray(c,2),e=d[0],f=d[1];a.style.transform='translate('+e+'px, '+f+'px)'}};a.addEventListener('focus',function(){b=!0,c()}),a.addEventListener('blur',function(){return b=!1}),Screen.on('cursor-moved',c),window.kbOpen=function(d){b=d,c(),d?a.focus():a.blur()};var d='';var e=!1;var f=function(a){var b=!1;a.length>d.length?a.startsWith(d)?Input.sendString(a.substr(d.length)):b=!0:a.length