/* DOM Keyboard Event Level 3 polyfill | @version 0.4.4 | MIT License | github.com/termi */ void function(){"use strict"; var f=void 0,h=!0,j=null,k=!1,l;try{l="a"==(new this.KeyboardEvent("keyup",{key:"a"})).key}catch(aa){l=k} if(!l){var x=function(a,b){var c;try{c=document.createEvent("KeyboardEvent")}catch(d){c=document.createEvent("Event")}b=b||{};var e={},n,g;for(n in m)p(m,n)&&(e[n]=n in b&&(g=b[n])!==f?g:m[n]);g=e.ctrlKey||k;var q=e.shiftKey||k,r=e.altKey||k,L=e.metaKey||k,S=e.altGraphKey||k,T=3b&&(64Y.h&&(z[107]=z[61],A[109]=A[173]))}var ca={Escape:j,Win:j,Scroll:j,Apps:j,Delete:j,Window:j,ContextMenu:j,Mul:j};x.DOM_KEY_LOCATION_STANDARD=0;x.DOM_KEY_LOCATION_LEFT=ha;x.DOM_KEY_LOCATION_RIGHT=ia;x.DOM_KEY_LOCATION_NUMPAD= I;x.DOM_KEY_LOCATION_MOBILE=ja;x.DOM_KEY_LOCATION_JOYSTICK=ka;x.prototype=J;$=new x("keyup");try{delete $.keyCode,w($,"keyCode",{writable:h,value:9}),delete $.which,w($,"which",{writable:h,value:9})}catch(va){}ea=9===$.which;!(t=9==$.keyCode)&&N?(w(J,"keyCode",{enumerable:h,configurable:h,get:function(){return"__keyCode"in this?this.__keyCode:N.call(this)},set:function(a){return this.__keyCode=isNaN(a)?0:a}}),w(J,"charCode",{enumerable:h,configurable:h,get:function(){return"__charCode"in this?this.__charCode: N.call(this)},set:function(a){return this.__charCode=isNaN(a)?0:a}})):N=f;sa=function(a){a=a||"";if(1b&&b;return(b&&String.fromCharCode(b)||a).toLowerCase()};w(J,"key",{enumerable:h,configurable:h,get:function(){var a;if(G&&((a=G.call(this))&&2>a.length||y(a)))return sa.call(this,a);if("__key"in this)return this.__key;if(this.type in na){var b= this.which||this.keyCode,c="keypress"!=this.type;a=c?"keyIdentifier"in this&&y(this.keyIdentifier)?this.keyIdentifier:!c||(a=z[b])?((a=a||A[b])&&"object"==typeof a?a.a:a)||this["char"]:sa.call(this,a):this["char"];X.value=a;w(this,"__key",X);return a}}});w(J,"char",{enumerable:h,configurable:h,get:function(){if(this.type in na){if(this.ctrlKey||this.altKey||this.metaKey)return"";if("__char"in this)return this.__char;var a,b="keypress"!=this.type,c=!b&&this.__keyCode||this.which||this.keyCode,d;if(b&& (a=z[c])&&"object"!=typeof a)return"";if(!(K&&(a=K.call(this))!==j))d=(a=A[c]||z[c])&&"object"==typeof a,!d||a.b===k?a="":d&&a.b!==f?a=a.b||"":"keyIdentifier"in this&&y(this.keyIdentifier)?a="":(a=String.fromCharCode(c),b&&!this.shiftKey&&(a=a.toLowerCase()));X.value=a;w(this,"__char",X);return a}}});F=function(){if(ma)return ma.call(this);if("__location"in this)return this.__location;if(this.type in na){var a=this.which||this.keyCode,b="keypress"!=this.type;"keyLocation"in this?a=this.keyLocation: (a=b&&(z[a]||A[a]),a="object"==typeof a&&a.c||0);X.value=a;w(this,"__location",X);return a}};w(J,"location",{enumerable:h,configurable:h,get:F});K?document.addEventListener("keydown",function(a){var b=K?K.call(a):a["char"],b=b&&b.charCodeAt(0),c,d;if(b&&!A[b+=999])c=A[b]={},a=a.keyCode,b=(d=A[a])?"object"==typeof d&&d.a||d:String.fromCharCode(a),64a&&a)&&(b=b.toLowerCase()),c.a=b},h):[($=u.Document)&&$.prototype||u.document,($=u.HTMLDocument)&&$.prototype,($=u.Window)&&$.prototype||u,($=u.Node)&& $.prototype,($=u.Element)&&$.prototype].forEach(function(a){if(a&&p(a,"addEventListener")){var b=a.addEventListener,c=a.removeEventListener;b&&(a.addEventListener=function(a,c,n){var g,q,r;if("keydown"===(a+"").toLowerCase()){g="_e_8vj"+(n?"-":"")+a;q=g+(c._h_9e2||(c._h_9e2=++oa));r=g+"__count";if(!(g=this._))g=this._={};if(q in g)return;g[r]===f&&b.call(this,"keypress",ga,h);g[r]=(g[r]||0)+1;arguments[1]=g[q]=qa.call(da,{f:c,g:this})}return b.apply(this,arguments)},c&&(a.removeEventListener=function(a, b,n){var g,q,r;"keydown"===(a+"").toLowerCase()&&(g="_e_8vj"+(n?"-":"")+a,q=g+b._h_9e2,r=g+"__count",g=this._,q&&(g&&g[r])&&(--g[r],(arguments[1]=g[q])&&delete g[q]));return c.apply(this,arguments)}))}});u.KeyboardEvent=x;ha=ia=I=ja=ka=O=P=$=R=x=J=Z=la=ua=Y=j;f}; }.call(this);