diff --git a/build/css/index.css b/build/css/index.css index a2c3a787..a0caf844 100644 --- a/build/css/index.css +++ b/build/css/index.css @@ -1,6 +1,6 @@ /*! * - * simple-keyboard v3.5.51 + * simple-keyboard v3.5.52 * https://github.com/hodgef/simple-keyboard * * Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors. diff --git a/build/index.js b/build/index.js index cb2309d8..c2c5578e 100644 --- a/build/index.js +++ b/build/index.js @@ -1,6 +1,6 @@ /*! * - * simple-keyboard v3.5.51 + * simple-keyboard v3.5.52 * https://github.com/hodgef/simple-keyboard * * Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors. @@ -9,4 +9,4 @@ * LICENSE file in the root directory of this source tree. * */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(this,(function(){return function(){var t={9662:function(t,e,n){var o=n(614),r=n(6330),i=TypeError;t.exports=function(t){if(o(t))return t;throw i(r(t)+" is not a function")}},9483:function(t,e,n){var o=n(4411),r=n(6330),i=TypeError;t.exports=function(t){if(o(t))return t;throw i(r(t)+" is not a constructor")}},6077:function(t,e,n){var o=n(614),r=String,i=TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw i("Can't set "+r(t)+" as a prototype")}},1223:function(t,e,n){var o=n(5112),r=n(30),i=n(3070).f,a=o("unscopables"),s=Array.prototype;null==s[a]&&i(s,a,{configurable:!0,value:r(null)}),t.exports=function(t){s[a][t]=!0}},1530:function(t,e,n){"use strict";var o=n(8710).charAt;t.exports=function(t,e,n){return e+(n?o(t,e).length:1)}},9670:function(t,e,n){var o=n(111),r=String,i=TypeError;t.exports=function(t){if(o(t))return t;throw i(r(t)+" is not an object")}},8533:function(t,e,n){"use strict";var o=n(2092).forEach,r=n(9341)("forEach");t.exports=r?[].forEach:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}},8457:function(t,e,n){"use strict";var o=n(9974),r=n(6916),i=n(7908),a=n(3411),s=n(7659),u=n(4411),c=n(6244),l=n(6135),f=n(4121),d=n(1246),p=Array;t.exports=function(t){var e=i(t),n=u(this),h=arguments.length,v=h>1?arguments[1]:void 0,y=void 0!==v;y&&(v=o(v,h>2?arguments[2]:void 0));var g,m,b,x,w,E,S=d(e),O=0;if(!S||this===p&&s(S))for(g=c(e),m=n?new this(g):p(g);g>O;O++)E=y?v(e[O],O):e[O],l(m,O,E);else for(w=(x=f(e,S)).next,m=n?new this:[];!(b=r(w,x)).done;O++)E=y?a(x,v,[b.value,O],!0):b.value,l(m,O,E);return m.length=O,m}},1318:function(t,e,n){var o=n(5656),r=n(1400),i=n(6244),a=function(t){return function(e,n,a){var s,u=o(e),c=i(u),l=r(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},2092:function(t,e,n){var o=n(9974),r=n(1702),i=n(8361),a=n(7908),s=n(6244),u=n(5417),c=r([].push),l=function(t){var e=1==t,n=2==t,r=3==t,l=4==t,f=6==t,d=7==t,p=5==t||f;return function(h,v,y,g){for(var m,b,x=a(h),w=i(x),E=o(v,y),S=s(w),O=0,k=g||u,P=e?k(h,S):n||d?k(h,0):void 0;S>O;O++)if((p||O in w)&&(b=E(m=w[O],O,x),t))if(e)P[O]=b;else if(b)switch(t){case 3:return!0;case 5:return m;case 6:return O;case 2:c(P,m)}else switch(t){case 4:return!1;case 7:c(P,m)}return f?-1:r||l?l:P}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},1194:function(t,e,n){var o=n(7293),r=n(5112),i=n(7392),a=r("species");t.exports=function(t){return i>=51||!o((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:function(t,e,n){"use strict";var o=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&o((function(){n.call(null,e||function(){return 1},1)}))}},3671:function(t,e,n){var o=n(9662),r=n(7908),i=n(8361),a=n(6244),s=TypeError,u=function(t){return function(e,n,u,c){o(n);var l=r(e),f=i(l),d=a(l),p=t?d-1:0,h=t?-1:1;if(u<2)for(;;){if(p in f){c=f[p],p+=h;break}if(p+=h,t?p<0:d<=p)throw s("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=h)p in f&&(c=n(c,f[p],p,l));return c}};t.exports={left:u(!1),right:u(!0)}},3658:function(t,e,n){"use strict";var o=n(9781),r=n(3157),i=TypeError,a=Object.getOwnPropertyDescriptor,s=o&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(r(t)&&!a(t,"length").writable)throw i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},1589:function(t,e,n){var o=n(1400),r=n(6244),i=n(6135),a=Array,s=Math.max;t.exports=function(t,e,n){for(var u=r(t),c=o(e,u),l=o(void 0===n?u:n,u),f=a(s(l-c,0)),d=0;c0;)t[o]=t[--o];o!==i++&&(t[o]=n)}return t},s=function(t,e,n,o){for(var r=e.length,i=n.length,a=0,s=0;a9007199254740991)throw e("Maximum allowed index exceeded");return t}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:function(t,e,n){var o=n(317)("span").classList,r=o&&o.constructor&&o.constructor.prototype;t.exports=r===Object.prototype?void 0:r},8886:function(t,e,n){var o=n(8113).match(/firefox\/(\d+)/i);t.exports=!!o&&+o[1]},256:function(t,e,n){var o=n(8113);t.exports=/MSIE|Trident/.test(o)},5268:function(t,e,n){var o=n(4326);t.exports="undefined"!=typeof process&&"process"==o(process)},8113:function(t){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:function(t,e,n){var o,r,i=n(7854),a=n(8113),s=i.process,u=i.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(r=(o=l.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!r&&a&&(!(o=a.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=a.match(/Chrome\/(\d+)/))&&(r=+o[1]),t.exports=r},8008:function(t,e,n){var o=n(8113).match(/AppleWebKit\/(\d+)\./);t.exports=!!o&&+o[1]},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,n){var o=n(7854),r=n(1236).f,i=n(8880),a=n(8052),s=n(3072),u=n(9920),c=n(4705);t.exports=function(t,e){var n,l,f,d,p,h=t.target,v=t.global,y=t.stat;if(n=v?o:y?o[h]||s(h,{}):(o[h]||{}).prototype)for(l in e){if(d=e[l],f=t.dontCallGetSet?(p=r(n,l))&&p.value:n[l],!c(v?l:h+(y?".":"#")+l,t.forced)&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(t.sham||f&&f.sham)&&i(d,"sham",!0),a(n,l,d,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,e,n){"use strict";n(4916);var o=n(1470),r=n(8052),i=n(2261),a=n(7293),s=n(5112),u=n(8880),c=s("species"),l=RegExp.prototype;t.exports=function(t,e,n,f){var d=s(t),p=!a((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),h=p&&!a((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return e=!0,null},n[d](""),!e}));if(!p||!h||n){var v=o(/./[d]),y=e(d,""[t],(function(t,e,n,r,a){var s=o(t),u=e.exec;return u===i||u===l.exec?p&&!a?{done:!0,value:v(e,n,r)}:{done:!0,value:s(n,e,r)}:{done:!1}}));r(String.prototype,t,y[0]),r(l,d,y[1])}f&&u(l[d],"sham",!0)}},2104:function(t,e,n){var o=n(4374),r=Function.prototype,i=r.apply,a=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(o?a.bind(i):function(){return a.apply(i,arguments)})},9974:function(t,e,n){var o=n(1470),r=n(9662),i=n(4374),a=o(o.bind);t.exports=function(t,e){return r(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},4374:function(t,e,n){var o=n(7293);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:function(t,e,n){var o=n(4374),r=Function.prototype.call;t.exports=o?r.bind(r):function(){return r.apply(r,arguments)}},6530:function(t,e,n){var o=n(9781),r=n(2597),i=Function.prototype,a=o&&Object.getOwnPropertyDescriptor,s=r(i,"name"),u=s&&"something"===function(){}.name,c=s&&(!o||o&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},5668:function(t,e,n){var o=n(1702),r=n(9662);t.exports=function(t,e,n){try{return o(r(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},1470:function(t,e,n){var o=n(4326),r=n(1702);t.exports=function(t){if("Function"===o(t))return r(t)}},1702:function(t,e,n){var o=n(4374),r=Function.prototype,i=r.call,a=o&&r.bind.bind(i,i);t.exports=o?a:function(t){return function(){return i.apply(t,arguments)}}},5005:function(t,e,n){var o=n(7854),r=n(614),i=function(t){return r(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(o[t]):o[t]&&o[t][e]}},1246:function(t,e,n){var o=n(648),r=n(8173),i=n(8554),a=n(7497),s=n(5112)("iterator");t.exports=function(t){if(!i(t))return r(t,s)||r(t,"@@iterator")||a[o(t)]}},4121:function(t,e,n){var o=n(6916),r=n(9662),i=n(9670),a=n(6330),s=n(1246),u=TypeError;t.exports=function(t,e){var n=arguments.length<2?s(t):e;if(r(n))return i(o(n,t));throw u(a(t)+" is not iterable")}},8044:function(t,e,n){var o=n(1702),r=n(3157),i=n(614),a=n(4326),s=n(1340),u=o([].push);t.exports=function(t){if(i(t))return t;if(r(t)){for(var e=t.length,n=[],o=0;o]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,o,f,d){var p=n+t.length,h=o.length,v=l;return void 0!==f&&(f=r(f),v=c),s(d,v,(function(r,s){var c;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,n);case"'":return u(e,p);case"<":c=f[u(s,1,-1)];break;default:var l=+s;if(0===l)return r;if(l>h){var d=i(l/10);return 0===d?r:d<=h?void 0===o[d-1]?a(s,1):o[d-1]+a(s,1):r}c=o[l-1]}return void 0===c?"":c}))}},7854:function(t,e,n){var o=function(t){return t&&t.Math==Math&&t};t.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:function(t,e,n){var o=n(1702),r=n(7908),i=o({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(r(t),e)}},3501:function(t){t.exports={}},490:function(t,e,n){var o=n(5005);t.exports=o("document","documentElement")},4664:function(t,e,n){var o=n(9781),r=n(7293),i=n(317);t.exports=!o&&!r((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(t,e,n){var o=n(1702),r=n(7293),i=n(4326),a=Object,s=o("".split);t.exports=r((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?s(t,""):a(t)}:a},9587:function(t,e,n){var o=n(614),r=n(111),i=n(7674);t.exports=function(t,e,n){var a,s;return i&&o(a=e.constructor)&&a!==n&&r(s=a.prototype)&&s!==n.prototype&&i(t,s),t}},2788:function(t,e,n){var o=n(1702),r=n(614),i=n(5465),a=o(Function.toString);r(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},9909:function(t,e,n){var o,r,i,a=n(4811),s=n(7854),u=n(111),c=n(8880),l=n(2597),f=n(5465),d=n(6200),p=n(3501),h="Object already initialized",v=s.TypeError,y=s.WeakMap;if(a||f.state){var g=f.state||(f.state=new y);g.get=g.get,g.has=g.has,g.set=g.set,o=function(t,e){if(g.has(t))throw v(h);return e.facade=t,g.set(t,e),e},r=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var m=d("state");p[m]=!0,o=function(t,e){if(l(t,m))throw v(h);return e.facade=t,c(t,m,e),e},r=function(t){return l(t,m)?t[m]:{}},i=function(t){return l(t,m)}}t.exports={set:o,get:r,has:i,enforce:function(t){return i(t)?r(t):o(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=r(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},7659:function(t,e,n){var o=n(5112),r=n(7497),i=o("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[i]===t)}},3157:function(t,e,n){var o=n(4326);t.exports=Array.isArray||function(t){return"Array"==o(t)}},614:function(t,e,n){var o=n(4154),r=o.all;t.exports=o.IS_HTMLDDA?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},4411:function(t,e,n){var o=n(1702),r=n(7293),i=n(614),a=n(648),s=n(5005),u=n(2788),c=function(){},l=[],f=s("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=o(d.exec),h=!d.exec(c),v=function(t){if(!i(t))return!1;try{return f(c,l,t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(d,u(t))}catch(t){return!0}};y.sham=!0,t.exports=!f||r((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?y:v},4705:function(t,e,n){var o=n(7293),r=n(614),i=/#|\.prototype\./,a=function(t,e){var n=u[s(t)];return n==l||n!=c&&(r(e)?o(e):!!e)},s=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},5988:function(t,e,n){var o=n(111),r=Math.floor;t.exports=Number.isInteger||function(t){return!o(t)&&isFinite(t)&&r(t)===t}},8554:function(t){t.exports=function(t){return null==t}},111:function(t,e,n){var o=n(614),r=n(4154),i=r.all;t.exports=r.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:o(t)||t===i}:function(t){return"object"==typeof t?null!==t:o(t)}},1913:function(t){t.exports=!1},7850:function(t,e,n){var o=n(111),r=n(4326),i=n(5112)("match");t.exports=function(t){var e;return o(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==r(t))}},2190:function(t,e,n){var o=n(5005),r=n(614),i=n(7976),a=n(3307),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return r(e)&&i(e.prototype,s(t))}},9212:function(t,e,n){var o=n(6916),r=n(9670),i=n(8173);t.exports=function(t,e,n){var a,s;r(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw n;return n}a=o(a,t)}catch(t){s=!0,a=t}if("throw"===e)throw n;if(s)throw a;return r(a),n}},3061:function(t,e,n){"use strict";var o=n(3383).IteratorPrototype,r=n(30),i=n(9114),a=n(8003),s=n(7497),u=function(){return this};t.exports=function(t,e,n,c){var l=e+" Iterator";return t.prototype=r(o,{next:i(+!c,n)}),a(t,l,!1,!0),s[l]=u,t}},1656:function(t,e,n){"use strict";var o=n(2109),r=n(6916),i=n(1913),a=n(6530),s=n(614),u=n(3061),c=n(9518),l=n(7674),f=n(8003),d=n(8880),p=n(8052),h=n(5112),v=n(7497),y=n(3383),g=a.PROPER,m=a.CONFIGURABLE,b=y.IteratorPrototype,x=y.BUGGY_SAFARI_ITERATORS,w=h("iterator"),E="keys",S="values",O="entries",k=function(){return this};t.exports=function(t,e,n,a,h,y,P){u(n,e,a);var I,C,A,M=function(t){if(t===h&&R)return R;if(!x&&t in j)return j[t];switch(t){case E:case S:case O:return function(){return new n(this,t)}}return function(){return new n(this)}},T=e+" Iterator",D=!1,j=t.prototype,N=j[w]||j["@@iterator"]||h&&j[h],R=!x&&N||M(h),L="Array"==e&&j.entries||N;if(L&&(I=c(L.call(new t)))!==Object.prototype&&I.next&&(i||c(I)===b||(l?l(I,b):s(I[w])||p(I,w,k)),f(I,T,!0,!0),i&&(v[T]=k)),g&&h==S&&N&&N.name!==S&&(!i&&m?d(j,"name",S):(D=!0,R=function(){return r(N,this)})),h)if(C={values:M(S),keys:y?R:M(E),entries:M(O)},P)for(A in C)(x||D||!(A in j))&&p(j,A,C[A]);else o({target:e,proto:!0,forced:x||D},C);return i&&!P||j[w]===R||p(j,w,R,{name:h}),v[e]=R,C}},3383:function(t,e,n){"use strict";var o,r,i,a=n(7293),s=n(614),u=n(111),c=n(30),l=n(9518),f=n(8052),d=n(5112),p=n(1913),h=d("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(r=l(l(i)))!==Object.prototype&&(o=r):v=!0),!u(o)||a((function(){var t={};return o[h].call(t)!==t}))?o={}:p&&(o=c(o)),s(o[h])||f(o,h,(function(){return this})),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:v}},7497:function(t){t.exports={}},6244:function(t,e,n){var o=n(7466);t.exports=function(t){return o(t.length)}},6339:function(t,e,n){var o=n(1702),r=n(7293),i=n(614),a=n(2597),s=n(9781),u=n(6530).CONFIGURABLE,c=n(2788),l=n(9909),f=l.enforce,d=l.get,p=String,h=Object.defineProperty,v=o("".slice),y=o("".replace),g=o([].join),m=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===v(p(e),0,7)&&(e="["+y(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||u&&t.name!==e)&&(s?h(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&a(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var o=f(t);return a(o,"source")||(o.source=g(b,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return i(this)&&d(this).source||c(this)}),"toString")},4758:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var o=+t;return(o>0?n:e)(o)}},3929:function(t,e,n){var o=n(7850),r=TypeError;t.exports=function(t){if(o(t))throw r("The method doesn't accept regular expressions");return t}},1574:function(t,e,n){"use strict";var o=n(9781),r=n(1702),i=n(6916),a=n(7293),s=n(1956),u=n(5181),c=n(5296),l=n(7908),f=n(8361),d=Object.assign,p=Object.defineProperty,h=r([].concat);t.exports=!d||a((function(){if(o&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=d({},t)[n]||s(d({},e)).join("")!=r}))?function(t,e){for(var n=l(t),r=arguments.length,a=1,d=u.f,p=c.f;r>a;)for(var v,y=f(arguments[a++]),g=d?h(s(y),d(y)):s(y),m=g.length,b=0;m>b;)v=g[b++],o&&!i(p,y,v)||(n[v]=y[v]);return n}:d},30:function(t,e,n){var o,r=n(9670),i=n(6048),a=n(748),s=n(3501),u=n(490),c=n(317),l=n(6200),f="prototype",d="script",p=l("IE_PROTO"),h=function(){},v=function(t){return"<"+d+">"+t+""},y=function(t){t.write(v("")),t.close();var e=t.parentWindow.Object;return t=null,e},g=function(){try{o=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;g="undefined"!=typeof document?document.domain&&o?y(o):(e=c("iframe"),n="java"+d+":",e.style.display="none",u.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(v("document.F=Object")),t.close(),t.F):y(o);for(var r=a.length;r--;)delete g[f][a[r]];return g()};s[p]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h[f]=r(t),n=new h,h[f]=null,n[p]=t):n=g(),void 0===e?n:i.f(n,e)}},6048:function(t,e,n){var o=n(9781),r=n(3353),i=n(3070),a=n(9670),s=n(5656),u=n(1956);e.f=o&&!r?Object.defineProperties:function(t,e){a(t);for(var n,o=s(e),r=u(e),c=r.length,l=0;c>l;)i.f(t,n=r[l++],o[n]);return t}},3070:function(t,e,n){var o=n(9781),r=n(4664),i=n(3353),a=n(9670),s=n(4948),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",p="writable";e.f=o?i?function(t,e,n){if(a(t),e=s(e),a(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var o=l(t,e);o&&o[p]&&(t[e]=n.value,n={configurable:d in n?n[d]:o[d],enumerable:f in n?n[f]:o[f],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(a(t),e=s(e),a(n),r)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:function(t,e,n){var o=n(9781),r=n(6916),i=n(5296),a=n(9114),s=n(5656),u=n(4948),c=n(2597),l=n(4664),f=Object.getOwnPropertyDescriptor;e.f=o?f:function(t,e){if(t=s(t),e=u(e),l)try{return f(t,e)}catch(t){}if(c(t,e))return a(!r(i.f,t,e),t[e])}},1156:function(t,e,n){var o=n(4326),r=n(5656),i=n(8006).f,a=n(1589),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"Window"==o(t)?function(t){try{return i(t)}catch(t){return a(s)}}(t):i(r(t))}},8006:function(t,e,n){var o=n(6324),r=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,r)}},5181:function(t,e){e.f=Object.getOwnPropertySymbols},9518:function(t,e,n){var o=n(2597),r=n(614),i=n(7908),a=n(6200),s=n(8544),u=a("IE_PROTO"),c=Object,l=c.prototype;t.exports=s?c.getPrototypeOf:function(t){var e=i(t);if(o(e,u))return e[u];var n=e.constructor;return r(n)&&e instanceof n?n.prototype:e instanceof c?l:null}},7976:function(t,e,n){var o=n(1702);t.exports=o({}.isPrototypeOf)},6324:function(t,e,n){var o=n(1702),r=n(2597),i=n(5656),a=n(1318).indexOf,s=n(3501),u=o([].push);t.exports=function(t,e){var n,o=i(t),c=0,l=[];for(n in o)!r(s,n)&&r(o,n)&&u(l,n);for(;e.length>c;)r(o,n=e[c++])&&(~a(l,n)||u(l,n));return l}},1956:function(t,e,n){var o=n(6324),r=n(748);t.exports=Object.keys||function(t){return o(t,r)}},5296:function(t,e){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,r=o&&!n.call({1:2},1);e.f=r?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},9026:function(t,e,n){"use strict";var o=n(1913),r=n(7854),i=n(7293),a=n(8008);t.exports=o||!i((function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete r[t]}}))},7674:function(t,e,n){var o=n(5668),r=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=o(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,o){return r(n),i(o),e?t(n,o):n.__proto__=o,n}}():void 0)},288:function(t,e,n){"use strict";var o=n(1694),r=n(648);t.exports=o?{}.toString:function(){return"[object "+r(this)+"]"}},2140:function(t,e,n){var o=n(6916),r=n(614),i=n(111),a=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&r(n=t.toString)&&!i(s=o(n,t)))return s;if(r(n=t.valueOf)&&!i(s=o(n,t)))return s;if("string"!==e&&r(n=t.toString)&&!i(s=o(n,t)))return s;throw a("Can't convert object to primitive value")}},3887:function(t,e,n){var o=n(5005),r=n(1702),i=n(8006),a=n(5181),s=n(9670),u=r([].concat);t.exports=o("Reflect","ownKeys")||function(t){var e=i.f(s(t)),n=a.f;return n?u(e,n(t)):e}},857:function(t,e,n){var o=n(7854);t.exports=o},2626:function(t,e,n){var o=n(3070).f;t.exports=function(t,e,n){n in t||o(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},7651:function(t,e,n){var o=n(6916),r=n(9670),i=n(614),a=n(4326),s=n(2261),u=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var c=o(n,t,e);return null!==c&&r(c),c}if("RegExp"===a(t))return o(s,t,e);throw u("RegExp#exec called on incompatible receiver")}},2261:function(t,e,n){"use strict";var o,r,i=n(6916),a=n(1702),s=n(1340),u=n(7066),c=n(2999),l=n(2309),f=n(30),d=n(9909).get,p=n(9441),h=n(7168),v=l("native-string-replace",String.prototype.replace),y=RegExp.prototype.exec,g=y,m=a("".charAt),b=a("".indexOf),x=a("".replace),w=a("".slice),E=(r=/b*/g,i(y,o=/a/,"a"),i(y,r,"a"),0!==o.lastIndex||0!==r.lastIndex),S=c.BROKEN_CARET,O=void 0!==/()??/.exec("")[1];(E||O||S||p||h)&&(g=function(t){var e,n,o,r,a,c,l,p=this,h=d(p),k=s(t),P=h.raw;if(P)return P.lastIndex=p.lastIndex,e=i(g,P,k),p.lastIndex=P.lastIndex,e;var I=h.groups,C=S&&p.sticky,A=i(u,p),M=p.source,T=0,D=k;if(C&&(A=x(A,"y",""),-1===b(A,"g")&&(A+="g"),D=w(k,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==m(k,p.lastIndex-1))&&(M="(?: "+M+")",D=" "+D,T++),n=new RegExp("^(?:"+M+")",A)),O&&(n=new RegExp("^"+M+"$(?!\\s)",A)),E&&(o=p.lastIndex),r=i(y,C?n:p,D),C?r?(r.input=w(r.input,T),r[0]=w(r[0],T),r.index=p.lastIndex,p.lastIndex+=r[0].length):p.lastIndex=0:E&&r&&(p.lastIndex=p.global?r.index+r[0].length:o),O&&r&&r.length>1&&i(v,r[0],n,(function(){for(a=1;ab)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},4488:function(t,e,n){var o=n(8554),r=TypeError;t.exports=function(t){if(o(t))throw r("Can't call method on "+t);return t}},6340:function(t,e,n){"use strict";var o=n(5005),r=n(7045),i=n(5112),a=n(9781),s=i("species");t.exports=function(t){var e=o(t);a&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},8003:function(t,e,n){var o=n(3070).f,r=n(2597),i=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!r(t,i)&&o(t,i,{configurable:!0,value:e})}},6200:function(t,e,n){var o=n(2309),r=n(9711),i=o("keys");t.exports=function(t){return i[t]||(i[t]=r(t))}},5465:function(t,e,n){var o=n(7854),r=n(3072),i="__core-js_shared__",a=o[i]||r(i,{});t.exports=a},2309:function(t,e,n){var o=n(1913),r=n(5465);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.30.1",mode:o?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:function(t,e,n){var o=n(9670),r=n(9483),i=n(8554),a=n(5112)("species");t.exports=function(t,e){var n,s=o(t).constructor;return void 0===s||i(n=o(s)[a])?e:r(n)}},8710:function(t,e,n){var o=n(1702),r=n(9303),i=n(1340),a=n(4488),s=o("".charAt),u=o("".charCodeAt),c=o("".slice),l=function(t){return function(e,n){var o,l,f=i(a(e)),d=r(n),p=f.length;return d<0||d>=p?t?"":void 0:(o=u(f,d))<55296||o>56319||d+1===p||(l=u(f,d+1))<56320||l>57343?t?s(f,d):o:t?c(f,d,d+2):l-56320+(o-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},6091:function(t,e,n){var o=n(6530).PROPER,r=n(7293),i=n(1361);t.exports=function(t){return r((function(){return!!i[t]()||"​…᠎"!=="​…᠎"[t]()||o&&i[t].name!==t}))}},3111:function(t,e,n){var o=n(1702),r=n(4488),i=n(1340),a=n(1361),s=o("".replace),u=RegExp("^["+a+"]+"),c=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(t){return function(e){var n=i(r(e));return 1&t&&(n=s(n,u,"")),2&t&&(n=s(n,c,"$1")),n}};t.exports={start:l(1),end:l(2),trim:l(3)}},6293:function(t,e,n){var o=n(7392),r=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},6532:function(t,e,n){var o=n(6916),r=n(5005),i=n(5112),a=n(8052);t.exports=function(){var t=r("Symbol"),e=t&&t.prototype,n=e&&e.valueOf,s=i("toPrimitive");e&&!e[s]&&a(e,s,(function(t){return o(n,this)}),{arity:1})}},2015:function(t,e,n){var o=n(6293);t.exports=o&&!!Symbol.for&&!!Symbol.keyFor},863:function(t,e,n){var o=n(1702);t.exports=o(1..valueOf)},1400:function(t,e,n){var o=n(9303),r=Math.max,i=Math.min;t.exports=function(t,e){var n=o(t);return n<0?r(n+e,0):i(n,e)}},5656:function(t,e,n){var o=n(8361),r=n(4488);t.exports=function(t){return o(r(t))}},9303:function(t,e,n){var o=n(4758);t.exports=function(t){var e=+t;return e!=e||0===e?0:o(e)}},7466:function(t,e,n){var o=n(9303),r=Math.min;t.exports=function(t){return t>0?r(o(t),9007199254740991):0}},7908:function(t,e,n){var o=n(4488),r=Object;t.exports=function(t){return r(o(t))}},7593:function(t,e,n){var o=n(6916),r=n(111),i=n(2190),a=n(8173),s=n(2140),u=n(5112),c=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!r(t)||i(t))return t;var n,u=a(t,l);if(u){if(void 0===e&&(e="default"),n=o(u,t,e),!r(n)||i(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},4948:function(t,e,n){var o=n(7593),r=n(2190);t.exports=function(t){var e=o(t,"string");return r(e)?e:e+""}},1694:function(t,e,n){var o={};o[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(o)},1340:function(t,e,n){var o=n(648),r=String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},6330:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:function(t,e,n){var o=n(1702),r=0,i=Math.random(),a=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++r+i,36)}},3307:function(t,e,n){var o=n(6293);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(t,e,n){var o=n(9781),r=n(7293);t.exports=o&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4811:function(t,e,n){var o=n(7854),r=n(614),i=o.WeakMap;t.exports=r(i)&&/native code/.test(String(i))},6800:function(t,e,n){var o=n(857),r=n(2597),i=n(6061),a=n(3070).f;t.exports=function(t){var e=o.Symbol||(o.Symbol={});r(e,t)||a(e,t,{value:i.f(t)})}},6061:function(t,e,n){var o=n(5112);e.f=o},5112:function(t,e,n){var o=n(7854),r=n(2309),i=n(2597),a=n(9711),s=n(6293),u=n(3307),c=o.Symbol,l=r("wks"),f=u?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){return i(l,t)||(l[t]=s&&i(c,t)?c[t]:f("Symbol."+t)),l[t]}},1361:function(t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},2222:function(t,e,n){"use strict";var o=n(2109),r=n(7293),i=n(3157),a=n(111),s=n(7908),u=n(6244),c=n(7207),l=n(6135),f=n(5417),d=n(1194),p=n(5112),h=n(7392),v=p("isConcatSpreadable"),y=h>=51||!r((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),g=function(t){if(!a(t))return!1;var e=t[v];return void 0!==e?!!e:i(t)};o({target:"Array",proto:!0,arity:1,forced:!y||!d("concat")},{concat:function(t){var e,n,o,r,i,a=s(this),d=f(a,0),p=0;for(e=-1,o=arguments.length;e1?arguments[1]:void 0)}})},1038:function(t,e,n){var o=n(2109),r=n(8457);o({target:"Array",stat:!0,forced:!n(7072)((function(t){Array.from(t)}))},{from:r})},6699:function(t,e,n){"use strict";var o=n(2109),r=n(1318).includes,i=n(7293),a=n(1223);o({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},2772:function(t,e,n){"use strict";var o=n(2109),r=n(1470),i=n(1318).indexOf,a=n(9341),s=r([].indexOf),u=!!s&&1/s([1],1,-0)<0;o({target:"Array",proto:!0,forced:u||!a("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return u?s(this,t,e)||0:i(this,t,e)}})},6992:function(t,e,n){"use strict";var o=n(5656),r=n(1223),i=n(7497),a=n(9909),s=n(3070).f,u=n(1656),c=n(6178),l=n(1913),f=n(9781),d="Array Iterator",p=a.set,h=a.getterFor(d);t.exports=u(Array,"Array",(function(t,e){p(this,{type:d,target:o(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,n=t.kind,o=t.index++;return!e||o>=e.length?(t.target=void 0,c(void 0,!0)):c("keys"==n?o:"values"==n?e[o]:[o,e[o]],!1)}),"values");var v=i.Arguments=i.Array;if(r("keys"),r("values"),r("entries"),!l&&f&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(t){}},9600:function(t,e,n){"use strict";var o=n(2109),r=n(1702),i=n(8361),a=n(5656),s=n(9341),u=r([].join);o({target:"Array",proto:!0,forced:i!=Object||!s("join",",")},{join:function(t){return u(a(this),void 0===t?",":t)}})},1249:function(t,e,n){"use strict";var o=n(2109),r=n(2092).map;o({target:"Array",proto:!0,forced:!n(1194)("map")},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},5827:function(t,e,n){"use strict";var o=n(2109),r=n(3671).left,i=n(9341),a=n(7392);o({target:"Array",proto:!0,forced:!n(5268)&&a>79&&a<83||!i("reduce")},{reduce:function(t){var e=arguments.length;return r(this,t,e,e>1?arguments[1]:void 0)}})},7042:function(t,e,n){"use strict";var o=n(2109),r=n(3157),i=n(4411),a=n(111),s=n(1400),u=n(6244),c=n(5656),l=n(6135),f=n(5112),d=n(1194),p=n(206),h=d("slice"),v=f("species"),y=Array,g=Math.max;o({target:"Array",proto:!0,forced:!h},{slice:function(t,e){var n,o,f,d=c(this),h=u(d),m=s(t,h),b=s(void 0===e?h:e,h);if(r(d)&&(n=d.constructor,(i(n)&&(n===y||r(n.prototype))||a(n)&&null===(n=n[v]))&&(n=void 0),n===y||void 0===n))return p(d,m,b);for(o=new(void 0===n?y:n)(g(b-m,0)),f=0;m3)){if(h)return!0;if(y)return y<603;var t,e,n,o,r="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)g.push({k:e+o,v:n})}for(g.sort((function(t,e){return e.v-t.v})),o=0;oc(n)?1:-1}}(t)),n=s(r),o=0;ox-o+n;y--)d(b,y-1)}else if(n>o)for(y=x-o;y>w;y--)m=y+n-1,(g=y+o-1)in b?b[m]=b[g]:d(b,m);for(y=0;y2)if(c=x(c),43===(e=I(c,0))||45===e){if(88===(n=I(c,2))||120===n)return NaN}else if(48===e){switch(I(c,1)){case 66:case 98:o=2,r=49;break;case 79:case 111:o=8,r=55;break;default:return+c}for(a=(i=P(c,2)).length,s=0;sr)return NaN;return parseInt(i,o)}return+c},M=c(w,!E(" 0o1")||!E("0b1")||E("+0x1")),T=function(t){return d(O,t)&&v((function(){b(t)}))},D=function(t){var e=arguments.length<1?0:E(C(t));return T(this)?f(Object(e),this,D):e};D.prototype=O,M&&!r&&(O.constructor=D),o({global:!0,constructor:!0,wrap:!0,forced:M},{Number:D});var j=function(t,e){for(var n,o=i?y(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;o.length>r;r++)l(e,n=o[r])&&!l(t,n)&&m(t,n,g(e,n))};r&&S&&j(s[w],S),(M||r)&&j(s[w],E)},3161:function(t,e,n){n(2109)({target:"Number",stat:!0},{isInteger:n(5988)})},9601:function(t,e,n){var o=n(2109),r=n(1574);o({target:"Object",stat:!0,arity:2,forced:Object.assign!==r},{assign:r})},9595:function(t,e,n){"use strict";var o=n(2109),r=n(9781),i=n(9026),a=n(9662),s=n(7908),u=n(3070);r&&o({target:"Object",proto:!0,forced:i},{__defineGetter__:function(t,e){u.f(s(this),t,{get:a(e),enumerable:!0,configurable:!0})}})},5003:function(t,e,n){var o=n(2109),r=n(7293),i=n(5656),a=n(1236).f,s=n(9781);o({target:"Object",stat:!0,forced:!s||r((function(){a(1)})),sham:!s},{getOwnPropertyDescriptor:function(t,e){return a(i(t),e)}})},9337:function(t,e,n){var o=n(2109),r=n(9781),i=n(3887),a=n(5656),s=n(1236),u=n(6135);o({target:"Object",stat:!0,sham:!r},{getOwnPropertyDescriptors:function(t){for(var e,n,o=a(t),r=s.f,c=i(o),l={},f=0;c.length>f;)void 0!==(n=r(o,e=c[f++]))&&u(l,e,n);return l}})},6210:function(t,e,n){var o=n(2109),r=n(7293),i=n(1156).f;o({target:"Object",stat:!0,forced:r((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:i})},9660:function(t,e,n){var o=n(2109),r=n(6293),i=n(7293),a=n(5181),s=n(7908);o({target:"Object",stat:!0,forced:!r||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(t){var e=a.f;return e?e(s(t)):[]}})},7941:function(t,e,n){var o=n(2109),r=n(7908),i=n(1956);o({target:"Object",stat:!0,forced:n(7293)((function(){i(1)}))},{keys:function(t){return i(r(t))}})},1539:function(t,e,n){var o=n(1694),r=n(8052),i=n(288);o||r(Object.prototype,"toString",i,{unsafe:!0})},4603:function(t,e,n){var o=n(9781),r=n(7854),i=n(1702),a=n(4705),s=n(9587),u=n(8880),c=n(8006).f,l=n(7976),f=n(7850),d=n(1340),p=n(4706),h=n(2999),v=n(2626),y=n(8052),g=n(7293),m=n(2597),b=n(9909).enforce,x=n(6340),w=n(5112),E=n(9441),S=n(7168),O=w("match"),k=r.RegExp,P=k.prototype,I=r.SyntaxError,C=i(P.exec),A=i("".charAt),M=i("".replace),T=i("".indexOf),D=i("".slice),j=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,N=/a/g,R=/a/g,L=new k(N)!==N,B=h.MISSED_STICKY,K=h.UNSUPPORTED_Y,F=o&&(!L||B||E||S||g((function(){return R[O]=!1,k(N)!=N||k(R)==R||"/a/i"!=k(N,"i")})));if(a("RegExp",F)){for(var _=function(t,e){var n,o,r,i,a,c,h=l(P,this),v=f(t),y=void 0===e,g=[],x=t;if(!h&&v&&y&&t.constructor===_)return t;if((v||l(P,t))&&(t=t.source,y&&(e=p(x))),t=void 0===t?"":d(t),e=void 0===e?"":d(e),x=t,E&&"dotAll"in N&&(o=!!e&&T(e,"s")>-1)&&(e=M(e,/s/g,"")),n=e,B&&"sticky"in N&&(r=!!e&&T(e,"y")>-1)&&K&&(e=M(e,/y/g,"")),S&&(i=function(t){for(var e,n=t.length,o=0,r="",i=[],a={},s=!1,u=!1,c=0,l="";o<=n;o++){if("\\"===(e=A(t,o)))e+=A(t,++o);else if("]"===e)s=!1;else if(!s)switch(!0){case"["===e:s=!0;break;case"("===e:C(j,D(t,o+1))&&(o+=2,u=!0),r+=e,c++;continue;case">"===e&&u:if(""===l||m(a,l))throw new I("Invalid capture group name");a[l]=!0,i[i.length]=[l,c],u=!1,l="";continue}u?l+=e:r+=e}return[r,i]}(t),t=i[0],g=i[1]),a=s(k(t,e),h?this:P,_),(o||r||g.length)&&(c=b(a),o&&(c.dotAll=!0,c.raw=_(function(t){for(var e,n=t.length,o=0,r="",i=!1;o<=n;o++)"\\"!==(e=A(t,o))?i||"."!==e?("["===e?i=!0:"]"===e&&(i=!1),r+=e):r+="[\\s\\S]":r+=e+A(t,++o);return r}(t),n)),r&&(c.sticky=!0),g.length&&(c.groups=g)),t!==x)try{u(a,"source",""===x?"(?:)":x)}catch(t){}return a},H=c(k),U=0;H.length>U;)v(_,k,H[U++]);P.constructor=_,_.prototype=P,y(r,"RegExp",_,{constructor:!0})}x("RegExp")},4916:function(t,e,n){"use strict";var o=n(2109),r=n(2261);o({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},9714:function(t,e,n){"use strict";var o=n(6530).PROPER,r=n(8052),i=n(9670),a=n(1340),s=n(7293),u=n(4706),c="toString",l=RegExp.prototype[c],f=s((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),d=o&&l.name!=c;(f||d)&&r(RegExp.prototype,c,(function(){var t=i(this);return"/"+a(t.source)+"/"+a(u(t))}),{unsafe:!0})},2023:function(t,e,n){"use strict";var o=n(2109),r=n(1702),i=n(3929),a=n(4488),s=n(1340),u=n(4964),c=r("".indexOf);o({target:"String",proto:!0,forced:!u("includes")},{includes:function(t){return!!~c(s(a(this)),s(i(t)),arguments.length>1?arguments[1]:void 0)}})},8783:function(t,e,n){"use strict";var o=n(8710).charAt,r=n(1340),i=n(9909),a=n(1656),s=n(6178),u="String Iterator",c=i.set,l=i.getterFor(u);a(String,"String",(function(t){c(this,{type:u,string:r(t),index:0})}),(function(){var t,e=l(this),n=e.string,r=e.index;return r>=n.length?s(void 0,!0):(t=o(n,r),e.index+=t.length,s(t,!1))}))},6373:function(t,e,n){"use strict";var o=n(2109),r=n(6916),i=n(1470),a=n(3061),s=n(6178),u=n(4488),c=n(7466),l=n(1340),f=n(9670),d=n(8554),p=n(4326),h=n(7850),v=n(4706),y=n(8173),g=n(8052),m=n(7293),b=n(5112),x=n(6707),w=n(1530),E=n(7651),S=n(9909),O=n(1913),k=b("matchAll"),P="RegExp String",I=P+" Iterator",C=S.set,A=S.getterFor(I),M=RegExp.prototype,T=TypeError,D=i("".indexOf),j=i("".matchAll),N=!!j&&!m((function(){j("a",/./)})),R=a((function(t,e,n,o){C(this,{type:I,regexp:t,string:e,global:n,unicode:o,done:!1})}),P,(function(){var t=A(this);if(t.done)return s(void 0,!0);var e=t.regexp,n=t.string,o=E(e,n);return null===o?(t.done=!0,s(void 0,!0)):t.global?(""===l(o[0])&&(e.lastIndex=w(n,c(e.lastIndex),t.unicode)),s(o,!1)):(t.done=!0,s(o,!1))})),L=function(t){var e,n,o,r=f(this),i=l(t),a=x(r,RegExp),s=l(v(r));return e=new a(a===RegExp?r.source:r,s),n=!!~D(s,"g"),o=!!~D(s,"u"),e.lastIndex=c(r.lastIndex),new R(e,i,n,o)};o({target:"String",proto:!0,forced:N},{matchAll:function(t){var e,n,o,i,a=u(this);if(d(t)){if(N)return j(a,t)}else{if(h(t)&&(e=l(u(v(t))),!~D(e,"g")))throw T("`.matchAll` does not allow non-global regexes");if(N)return j(a,t);if(void 0===(o=y(t,k))&&O&&"RegExp"==p(t)&&(o=L),o)return r(o,t,a)}return n=l(a),i=new RegExp(t,"g"),O?r(L,i,n):i[k](n)}}),O||k in M||g(M,k,L)},4723:function(t,e,n){"use strict";var o=n(6916),r=n(7007),i=n(9670),a=n(8554),s=n(7466),u=n(1340),c=n(4488),l=n(8173),f=n(1530),d=n(7651);r("match",(function(t,e,n){return[function(e){var n=c(this),r=a(e)?void 0:l(e,t);return r?o(r,e,n):new RegExp(e)[t](u(n))},function(t){var o=i(this),r=u(t),a=n(e,o,r);if(a.done)return a.value;if(!o.global)return d(o,r);var c=o.unicode;o.lastIndex=0;for(var l,p=[],h=0;null!==(l=d(o,r));){var v=u(l[0]);p[h]=v,""===v&&(o.lastIndex=f(r,s(o.lastIndex),c)),h++}return 0===h?null:p}]}))},5306:function(t,e,n){"use strict";var o=n(2104),r=n(6916),i=n(1702),a=n(7007),s=n(7293),u=n(9670),c=n(614),l=n(8554),f=n(9303),d=n(7466),p=n(1340),h=n(4488),v=n(1530),y=n(8173),g=n(647),m=n(7651),b=n(5112)("replace"),x=Math.max,w=Math.min,E=i([].concat),S=i([].push),O=i("".indexOf),k=i("".slice),P="$0"==="a".replace(/./,"$0"),I=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(t,e,n){var i=I?"$":"$0";return[function(t,n){var o=h(this),i=l(t)?void 0:y(t,b);return i?r(i,t,o,n):r(e,p(o),t,n)},function(t,r){var a=u(this),s=p(t);if("string"==typeof r&&-1===O(r,i)&&-1===O(r,"$<")){var l=n(e,a,s,r);if(l.done)return l.value}var h=c(r);h||(r=p(r));var y=a.global;if(y){var b=a.unicode;a.lastIndex=0}for(var P=[];;){var I=m(a,s);if(null===I)break;if(S(P,I),!y)break;""===p(I[0])&&(a.lastIndex=v(s,d(a.lastIndex),b))}for(var C,A="",M=0,T=0;T=M&&(A+=k(s,M,j)+K,M=j+D.length)}return A+k(s,M)}]}),!!s((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!P||I)},3123:function(t,e,n){"use strict";var o=n(2104),r=n(6916),i=n(1702),a=n(7007),s=n(9670),u=n(8554),c=n(7850),l=n(4488),f=n(6707),d=n(1530),p=n(7466),h=n(1340),v=n(8173),y=n(1589),g=n(7651),m=n(2261),b=n(2999),x=n(7293),w=b.UNSUPPORTED_Y,E=4294967295,S=Math.min,O=[].push,k=i(/./.exec),P=i(O),I=i("".slice),C=!x((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));a("split",(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=h(l(this)),a=void 0===n?E:n>>>0;if(0===a)return[];if(void 0===t)return[i];if(!c(t))return r(e,i,t,a);for(var s,u,f,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,g=new RegExp(t.source,p+"g");(s=r(m,g,i))&&!((u=g.lastIndex)>v&&(P(d,I(i,v,s.index)),s.length>1&&s.index=a));)g.lastIndex===s.index&&g.lastIndex++;return v===i.length?!f&&k(g,"")||P(d,""):P(d,I(i,v)),d.length>a?y(d,0,a):d}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:r(e,this,t,n)}:e,[function(e,n){var o=l(this),a=u(e)?void 0:v(e,t);return a?r(a,e,o,n):r(i,h(o),e,n)},function(t,o){var r=s(this),a=h(t),u=n(i,r,a,o,i!==e);if(u.done)return u.value;var c=f(r,RegExp),l=r.unicode,v=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(w?"g":"y"),y=new c(w?"^(?:"+r.source+")":r,v),m=void 0===o?E:o>>>0;if(0===m)return[];if(0===a.length)return null===g(y,a)?[a]:[];for(var b=0,x=0,O=[];xt.length)&&(e=t.length);for(var n=0,o=new Array(e);n2&&void 0!==arguments[2]&&arguments[2]?Object.assign({},this.getDefaultDiplay(),e):e||this.getDefaultDiplay())[t]||t}},{key:"getUpdatedInput",value:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this.getOptions(),a=[n,o,r],s=e;return("{bksp}"===t||"{backspace}"===t)&&s.length>0?s=this.removeAt.apply(this,[s].concat(a)):("{delete}"===t||"{forwarddelete}"===t)&&s.length>0?s=this.removeForwardsAt.apply(this,[s].concat(a)):"{space}"===t?s=this.addStringAt.apply(this,[s," "].concat(a)):"{tab}"!==t||"boolean"==typeof i.tabCharOnTab&&!1===i.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!i.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?s=this.addStringAt.apply(this,[s,t[t.length-2]].concat(a)):"{numpaddivide}"===t?s=this.addStringAt.apply(this,[s,"/"].concat(a)):"{numpadmultiply}"===t?s=this.addStringAt.apply(this,[s,"*"].concat(a)):"{numpadsubtract}"===t?s=this.addStringAt.apply(this,[s,"-"].concat(a)):"{numpadadd}"===t?s=this.addStringAt.apply(this,[s,"+"].concat(a)):"{numpaddecimal}"===t?s=this.addStringAt.apply(this,[s,"."].concat(a)):"{"===t||"}"===t?s=this.addStringAt.apply(this,[s,t].concat(a)):t.includes("{")||t.includes("}")||(s=this.addStringAt.apply(this,[s,t].concat(a))):s=this.addStringAt.apply(this,[s,"\n"].concat(a)):s=this.addStringAt.apply(this,[s,"\t"].concat(a)),i.debug&&console.log("Input will be: "+s),s}},{key:"updateCaretPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.setCaretPosition(n)}))}},{key:"updateCaretPosAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOptions(),o=this.getCaretPosition();return null!=o&&(e?o>0&&(o-=t):o+=t),n.debug&&console.log("Caret at:",o),o}},{key:"addStringAt",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o||0===o?(n=[t.slice(0,o),e,t.slice(r)].join(""),this.isMaxLengthReached()||i&&this.updateCaretPos(e.length)):n=t+e,n}},{key:"removeAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===n&&0===o)return t;if(n===o){var i=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;n&&n>=0?t.substring(n-2,n).match(i)?(e=t.substr(0,n-2)+t.substr(n),r&&this.updateCaretPos(2,!0)):(e=t.substr(0,n-1)+t.substr(n),r&&this.updateCaretPos(1,!0)):t.slice(-2).match(i)?(e=t.slice(0,-2),r&&this.updateCaretPos(2,!0)):(e=t.slice(0,-1),r&&this.updateCaretPos(1,!0))}else e=t.slice(0,n)+t.slice(o),r&&this.dispatch((function(t){t.setCaretPosition(n)}));return e}},{key:"removeForwardsAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return null!=t&&t.length&&null!==n?(n===o?e=t.substring(n,n+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?t.substr(0,n)+t.substr(n+2):t.substr(0,n)+t.substr(n+1):(e=t.slice(0,n)+t.slice(o),r&&this.dispatch((function(t){t.setCaretPosition(n)}))),e):t}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,r=t[n.inputName||"default"],a=e.length-1>=o;if(e.length<=r.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===i(o)){var s=e.length-1>=o[n.inputName||"default"];return n.debug&&console.log("maxLength (obj) reached:",s),s?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(t){return t?t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t})):""}},{key:"chunkArray",value:function(e,n){return t(Array(Math.ceil(e.length/n))).map((function(t,o){return e.slice(n*o,n+n*o)}))}},{key:"escapeRegex",value:function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"getRtlOffset",value:function(t,e){var n=t,o=e.indexOf("‫");return o=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f: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.")}var a,s=!0,u=!1;return{s:function(){o=o.call(t)},n:function(){var t=o.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==o.return||o.return()}finally{if(u)throw a}}}}(Object.getOwnPropertyNames(t.prototype));try{for(r.s();!(o=r.n()).done;){var i=o.value;"constructor"===i||"bindMethods"===i||(n[i]=n[i].bind(n))}}catch(t){r.e(t)}finally{r.f()}}}],r&&a(o.prototype,r),u&&a(o,u),Object.defineProperty(o,"prototype",{writable:!1}),n}();s(c,"noop",(function(){}));var l=c;function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function d(t,e){for(var n=0;n1?null===(e=n)||void 0===e?void 0:e.toLowerCase():n}},{key:"keyCodeToKey",value:function(t){return{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:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",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",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[t]||""}}])&&d(e.prototype,n),o&&d(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:r();return s(t,e)},u.appendChild(o)}));var c=i>0,l=document.createElement("div");l.classList.add("hg-candidate-box-prev"),c&&l.classList.add("hg-candidate-box-btn-active"),l.onclick=function(){c&&n.renderPage({candidateListPages:o,targetElement:r,pageIndex:i-1,nbPages:a,onItemSelected:s})},this.candidateBoxElement.appendChild(l),this.candidateBoxElement.appendChild(u);var f=it.length)&&(e=t.length);for(var n=0,o=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:t;this.caretPosition=t,this.caretPositionEnd=e}},{key:"getInputCandidates",value:function(t){var e=this,n=this.options,o=n.layoutCandidates,r=n.layoutCandidatesCaseSensitiveMatch;if(!o||"object"!==O(o))return{};var i=Object.keys(o).filter((function(n){var o=t.substring(0,e.getCaretPositionEnd()||0)||t,i=new RegExp("".concat(e.utilities.escapeRegex(n),"$"),r?"g":"gi");return!!E(o.matchAll(i)).length}));if(i.length>1){var a=i.sort((function(t,e){return e.length-t.length}))[0];return{candidateKey:a,candidateValue:o[a]}}if(i.length){var s=i[0];return{candidateKey:s,candidateValue:o[s]}}return{}}},{key:"showCandidatesBox",value:function(t,e,n){var o=this;this.candidateBox&&this.candidateBox.show({candidateValue:e,targetElement:n,onSelect:function(e,n){var r=o.options,i=r.layoutCandidatesCaseSensitiveMatch,a=r.disableCandidateNormalization,s=r.enableLayoutCandidatesKeyPress,u=e;a||(u=e.normalize("NFD"));var c=o.getInput(o.options.inputName,!0),l=o.getCaretPositionEnd()||0,f=c.substring(0,l||0)||c,d=new RegExp("".concat(o.utilities.escapeRegex(t),"$"),i?"g":"gi"),p=f.replace(d,u),h=c.replace(f,p),v=p.length-f.length,y=(l||c.length)+v;y<0&&(y=0),o.setInput(h,o.options.inputName,!0),o.setCaretPosition(y),s&&"function"==typeof o.options.onKeyPress&&o.options.onKeyPress(e,n),"function"==typeof o.options.onChange&&o.options.onChange(o.getInput(o.options.inputName,!0),n),"function"==typeof o.options.onChangeAll&&o.options.onChangeAll(o.getAllInputs(),n)}})}},{key:"handleButtonClicked",value:function(t,e){var n=this.options,o=n.inputName,r=void 0===o?this.defaultName:o,i=n.debug;if("{//}"!==t){this.input[r]||(this.input[r]="");var a=this.utilities.getUpdatedInput(t,this.input[r],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(t)&&this.activeInputElement&&this.input[r]&&this.input[r]===a&&0===this.caretPosition&&this.caretPositionEnd===a.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(t,e);if("function"==typeof this.options.onKeyPress&&this.options.onKeyPress(t,e),this.input[r]!==a&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(a))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,a))return;var s=this.utilities.getUpdatedInput(t,this.input[r],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(s,this.options.inputName,!0),i&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),null==e?void 0:e.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),"function"==typeof this.options.onChange&&this.options.onChange(this.getInput(this.options.inputName,!0),e),"function"==typeof this.options.onChangeAll&&this.options.onChangeAll(this.getAllInputs(),e),null!=e&&e.target&&this.options.enableLayoutCandidates){var u,c=this.getInputCandidates(a),l=c.candidateKey,f=c.candidateValue;l&&f?this.showCandidatesBox(l,f,this.keyboardDOM):null===(u=this.candidateBox)||void 0===u||u.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),i&&console.log("Key pressed:",t)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(t){this.options.syncInstanceInputs?this.dispatch((function(e){e.isMouseHold=t})):this.isMouseHold=t}},{key:"handleButtonMouseDown",value:function(t,e){var n=this;e&&(this.options.preventMouseDownDefault&&e.preventDefault(),this.options.stopMouseDownPropagation&&e.stopPropagation(),e.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout((function(){(n.getMouseHold()&&(!t.includes("{")&&!t.includes("}")||"{delete}"===t||"{backspace}"===t||"{bksp}"===t||"{space}"===t||"{tab}"===t)||"{arrowright}"===t||"{arrowleft}"===t||"{arrowup}"===t||"{arrowdown}"===t)&&(n.options.debug&&console.log("Button held:",t),n.handleButtonHold(t)),clearTimeout(n.holdTimeout)}),500))}},{key:"handleButtonMouseUp",value:function(t,e){var n=this;e&&(this.options.preventMouseUpDefault&&e.preventDefault&&e.preventDefault(),this.options.stopMouseUpPropagation&&e.stopPropagation&&e.stopPropagation(),!(e.target===this.keyboardDOM||e.target&&this.keyboardDOM.contains(e.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(e.target===this.candidateBox.candidateBoxElement||e.target&&this.candidateBox.candidateBoxElement.contains(e.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons((function(t){t.classList.remove(n.activeButtonClass)})),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),t&&"function"==typeof this.options.onKeyReleased&&this.options.onKeyReleased(t,e)}},{key:"handleKeyboardContainerMouseDown",value:function(t){this.options.preventMouseDownDefault&&t.preventDefault()}},{key:"handleButtonHold",value:function(t){var e=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout((function(){e.getMouseHold()?(e.handleButtonClicked(t),e.handleButtonHold(t)):clearTimeout(e.holdInteractionTimeout)}),100)}},{key:"syncInstanceInputs",value:function(){var t=this;this.dispatch((function(e){e.replaceInput(t.input),e.setCaretPosition(t.caretPosition,t.caretPositionEnd)}))}},{key:"clearInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName;this.input[t]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.options.syncInstanceInputs&&!e&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[t].replace("‫","").replace("‬","")+"‬":this.input[t]}},{key:"getAllInputs",value:function(){var t=this,e={};return Object.keys(this.input).forEach((function(n){e[n]=t.getInput(n,!0)})),e}},{key:"setInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.inputName||this.defaultName,n=arguments.length>2?arguments[2]:void 0;this.input[e]=t,!n&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(t){this.input=t}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.changedOptions(t);this.options=Object.assign(this.options,t),e.length&&(this.options.debug&&console.log("changedOptions",e),this.onSetOptions(e),this.render())}},{key:"changedOptions",value:function(t){var e=this;return Object.keys(t).filter((function(n){return JSON.stringify(t[n])!==JSON.stringify(e.options[n])}))}},{key:"onSetOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(t.includes("layoutCandidatesPageSize")||t.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new w({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(t){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach((function(e){t(window.SimpleKeyboardInstances[e],e)}))}},{key:"addButtonTheme",value:function(t,e){var n=this;e&&t&&(t.split(" ").forEach((function(o){e.split(" ").forEach((function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);var r=!1;n.options.buttonTheme.map((function(t){if(null!=t&&t.class.split(" ").includes(e)){r=!0;var n=t.buttons.split(" ");n.includes(o)||(r=!0,n.push(o),t.buttons=n.join(" "))}return t})),r||n.options.buttonTheme.push({class:e,buttons:t})}))})),this.render())}},{key:"removeButtonTheme",value:function(t,e){var n=this;if(!t&&!e)return this.options.buttonTheme=[],void this.render();t&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(t.split(" ").forEach((function(t){var o,r;null===(o=n.options)||void 0===o||null===(r=o.buttonTheme)||void 0===r||r.map((function(o,r){if(o&&e&&e.includes(o.class)||!e){var i,a,s=null===(i=o)||void 0===i?void 0:i.buttons.split(" ").filter((function(e){return e!==t}));o&&null!=s&&s.length?o.buttons=s.join(" "):(null===(a=n.options.buttonTheme)||void 0===a||a.splice(r,1),o=null)}return o}))})),this.render())}},{key:"getButtonElement",value:function(t){var e,n=this.buttonElements[t];return n&&(e=n.length>1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName||this.defaultName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.addEventListener("keyup",this.handleKeyUp,e),document.addEventListener("keydown",this.handleKeyDown,e),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"handleSelect",value:function(t){this.caretEventHandler(t)}},{key:"handleSelectionChange",value:function(t){navigator.userAgent.includes("Firefox")||this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e,n=this;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(o){var r=t.target===o.keyboardDOM||t.target&&o.keyboardDOM.contains(t.target);if(n.options.syncInstanceInputs&&Array.isArray(t.path)&&(r=t.path.some((function(t){var e;return null==t||null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-skInstance")}))),("textarea"===e||"input"===e&&["text","search","url","tel","password"].includes(t.target.type))&&!o.options.disableCaretPositioning){var i=t.target.selectionStart,a=t.target.selectionEnd;o.options.rtl&&(i=o.utilities.getRtlOffset(i,o.getInput()),a=o.utilities.getRtlOffset(a,o.getInput())),o.setCaretPosition(i,a),n.activeInputElement=t.target,o.options.debug&&console.log("Caret at: ",o.getCaretPosition(),o.getCaretPositionEnd(),t&&t.target.tagName.toLowerCase(),"(".concat(o.keyboardDOMClass,")"),null==t?void 0:t.type)}else!o.options.disableCaretPositioning&&r||"selectionchange"===(null==t?void 0:t.type)||(o.setCaretPosition(null),n.activeInputElement=null,o.options.debug&&console.log('Caret position reset due to "'.concat(null==t?void 0:t.type,'" event'),t))}))}},{key:"recurseButtons",value:function(t){var e=this;t&&Object.keys(this.buttonElements).forEach((function(n){return e.buttonElements[n].forEach(t)}))}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.removeEventListener("keyup",this.handleKeyUp,e),document.removeEventListener("keydown",this.handleKeyDown,e),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons((function(t){t&&(t.onpointerdown=null,t.onpointerup=null,t.onpointercancel=null,t.ontouchstart=null,t.ontouchend=null,t.ontouchcancel=null,t.onclick=null,t.onmousedown=null,t.onmouseup=null,t.remove(),t=null)})),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e&&e.class&&"string"==typeof e.class&&e.buttons&&"string"==typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(E(n),E(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"==typeof n.attribute&&n.value&&"string"==typeof n.value&&n.buttons&&"string"==typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"==typeof this.options.onInit&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"==typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"==typeof this.options.beforeRender&&this.options.beforeRender(this)}},{key:"onRender",value:function(){"function"==typeof this.options.onRender&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){"function"==typeof this.options.onModulesLoaded&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e(t);n.init&&n.init(t)})),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var r=this,i=Array.from(t.children),a=0;return i.length&&n.forEach((function(n,s){var u=o[s];if(!(u&&u>n))return!1;var c=n-a,l=u-a,f=document.createElement("div");f.className+="hg-button-container";var d="".concat(r.options.layoutName,"-r").concat(e,"c").concat(s);f.setAttribute("data-skUID",d);var p=i.splice(c,l-c+1);a=l-c,p.forEach((function(t){return f.appendChild(t)})),i.splice(c,0,f),t.innerHTML="",i.forEach((function(e){return t.appendChild(e)})),r.options.debug&&console.log("rowDOMContainer",p,c,l,a+1)})),t}},{key:"render",value:function(){var t=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},o=this.options.useTouchEvents||!1,r=o?"hg-touch-events":"",i=this.options.useMouseEvents||!1,a=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,e,this.keyboardPluginClasses,r),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",n[this.options.layoutName||this.defaultName].forEach((function(e,n){var r=e.split(" ");t.options.excludeFromLayout&&t.options.excludeFromLayout[t.options.layoutName||t.defaultName]&&(r=r.filter((function(e){return t.options.excludeFromLayout&&!t.options.excludeFromLayout[t.options.layoutName||t.defaultName].includes(e)})));var s=document.createElement("div");s.className+="hg-row";var u=[],c=[];r.forEach((function(e,r){var l,f=!a&&"string"==typeof e&&e.length>1&&0===e.indexOf("["),d=!a&&"string"==typeof e&&e.length>1&&e.indexOf("]")===e.length-1;f&&(u.push(r),e=e.replace(/\[/g,"")),d&&(c.push(r),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),h=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),v=t.options.useButtonTag?"button":"div",y=document.createElement(v);y.className+="hg-button ".concat(p),(l=y.classList).add.apply(l,E(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){y.setAttribute(t,e)})),t.activeButtonClass="hg-activeButton",!t.utilities.pointerEventsSupported()||o||i?o?(y.ontouchstart=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.ontouchend=function(n){t.handleButtonMouseUp(e,n)},y.ontouchcancel=function(n){t.handleButtonMouseUp(e,n)}):(y.onclick=function(n){t.setMouseHold(!1),"function"!=typeof t.options.onKeyReleased&&t.handleButtonClicked(e,n)},y.onmousedown=function(n){"function"!=typeof t.options.onKeyReleased||t.isMouseHold||t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.onmouseup=function(n){t.handleButtonMouseUp(e,n)}):(y.onpointerdown=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.onpointerup=function(n){t.handleButtonMouseUp(e,n)},y.onpointercancel=function(n){t.handleButtonMouseUp(e,n)}),y.setAttribute("data-skBtn",e);var g="".concat(t.options.layoutName,"-r").concat(n,"b").concat(r);y.setAttribute("data-skBtnUID",g);var m=document.createElement("span");m.innerHTML=h,y.appendChild(m),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(y),s.appendChild(y)})),s=t.parseRowDOMContainers(s,n,u,c),t.keyboardRowsDOM.appendChild(s)})),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||i?o?(document.ontouchend=function(e){return t.handleButtonMouseUp(void 0,e)},document.ontouchcancel=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}],n&&P(e.prototype,n),o&&P(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}(),M=A,T=A}(),o}()})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(this,(function(){return function(){var t={9662:function(t,e,n){var o=n(614),r=n(6330),i=TypeError;t.exports=function(t){if(o(t))return t;throw i(r(t)+" is not a function")}},9483:function(t,e,n){var o=n(4411),r=n(6330),i=TypeError;t.exports=function(t){if(o(t))return t;throw i(r(t)+" is not a constructor")}},6077:function(t,e,n){var o=n(614),r=String,i=TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw i("Can't set "+r(t)+" as a prototype")}},1223:function(t,e,n){var o=n(5112),r=n(30),i=n(3070).f,a=o("unscopables"),s=Array.prototype;null==s[a]&&i(s,a,{configurable:!0,value:r(null)}),t.exports=function(t){s[a][t]=!0}},1530:function(t,e,n){"use strict";var o=n(8710).charAt;t.exports=function(t,e,n){return e+(n?o(t,e).length:1)}},9670:function(t,e,n){var o=n(111),r=String,i=TypeError;t.exports=function(t){if(o(t))return t;throw i(r(t)+" is not an object")}},8533:function(t,e,n){"use strict";var o=n(2092).forEach,r=n(9341)("forEach");t.exports=r?[].forEach:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}},8457:function(t,e,n){"use strict";var o=n(9974),r=n(6916),i=n(7908),a=n(3411),s=n(7659),u=n(4411),c=n(6244),l=n(6135),f=n(4121),d=n(1246),p=Array;t.exports=function(t){var e=i(t),n=u(this),h=arguments.length,v=h>1?arguments[1]:void 0,y=void 0!==v;y&&(v=o(v,h>2?arguments[2]:void 0));var g,m,b,x,w,E,S=d(e),O=0;if(!S||this===p&&s(S))for(g=c(e),m=n?new this(g):p(g);g>O;O++)E=y?v(e[O],O):e[O],l(m,O,E);else for(w=(x=f(e,S)).next,m=n?new this:[];!(b=r(w,x)).done;O++)E=y?a(x,v,[b.value,O],!0):b.value,l(m,O,E);return m.length=O,m}},1318:function(t,e,n){var o=n(5656),r=n(1400),i=n(6244),a=function(t){return function(e,n,a){var s,u=o(e),c=i(u),l=r(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},2092:function(t,e,n){var o=n(9974),r=n(1702),i=n(8361),a=n(7908),s=n(6244),u=n(5417),c=r([].push),l=function(t){var e=1==t,n=2==t,r=3==t,l=4==t,f=6==t,d=7==t,p=5==t||f;return function(h,v,y,g){for(var m,b,x=a(h),w=i(x),E=o(v,y),S=s(w),O=0,k=g||u,P=e?k(h,S):n||d?k(h,0):void 0;S>O;O++)if((p||O in w)&&(b=E(m=w[O],O,x),t))if(e)P[O]=b;else if(b)switch(t){case 3:return!0;case 5:return m;case 6:return O;case 2:c(P,m)}else switch(t){case 4:return!1;case 7:c(P,m)}return f?-1:r||l?l:P}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},1194:function(t,e,n){var o=n(7293),r=n(5112),i=n(7392),a=r("species");t.exports=function(t){return i>=51||!o((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:function(t,e,n){"use strict";var o=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&o((function(){n.call(null,e||function(){return 1},1)}))}},3671:function(t,e,n){var o=n(9662),r=n(7908),i=n(8361),a=n(6244),s=TypeError,u=function(t){return function(e,n,u,c){o(n);var l=r(e),f=i(l),d=a(l),p=t?d-1:0,h=t?-1:1;if(u<2)for(;;){if(p in f){c=f[p],p+=h;break}if(p+=h,t?p<0:d<=p)throw s("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=h)p in f&&(c=n(c,f[p],p,l));return c}};t.exports={left:u(!1),right:u(!0)}},3658:function(t,e,n){"use strict";var o=n(9781),r=n(3157),i=TypeError,a=Object.getOwnPropertyDescriptor,s=o&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(r(t)&&!a(t,"length").writable)throw i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},1589:function(t,e,n){var o=n(1400),r=n(6244),i=n(6135),a=Array,s=Math.max;t.exports=function(t,e,n){for(var u=r(t),c=o(e,u),l=o(void 0===n?u:n,u),f=a(s(l-c,0)),d=0;c0;)t[o]=t[--o];o!==i++&&(t[o]=n)}return t},s=function(t,e,n,o){for(var r=e.length,i=n.length,a=0,s=0;a9007199254740991)throw e("Maximum allowed index exceeded");return t}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:function(t,e,n){var o=n(317)("span").classList,r=o&&o.constructor&&o.constructor.prototype;t.exports=r===Object.prototype?void 0:r},8886:function(t,e,n){var o=n(8113).match(/firefox\/(\d+)/i);t.exports=!!o&&+o[1]},256:function(t,e,n){var o=n(8113);t.exports=/MSIE|Trident/.test(o)},5268:function(t,e,n){var o=n(4326);t.exports="undefined"!=typeof process&&"process"==o(process)},8113:function(t){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:function(t,e,n){var o,r,i=n(7854),a=n(8113),s=i.process,u=i.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(r=(o=l.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!r&&a&&(!(o=a.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=a.match(/Chrome\/(\d+)/))&&(r=+o[1]),t.exports=r},8008:function(t,e,n){var o=n(8113).match(/AppleWebKit\/(\d+)\./);t.exports=!!o&&+o[1]},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,n){var o=n(7854),r=n(1236).f,i=n(8880),a=n(8052),s=n(3072),u=n(9920),c=n(4705);t.exports=function(t,e){var n,l,f,d,p,h=t.target,v=t.global,y=t.stat;if(n=v?o:y?o[h]||s(h,{}):(o[h]||{}).prototype)for(l in e){if(d=e[l],f=t.dontCallGetSet?(p=r(n,l))&&p.value:n[l],!c(v?l:h+(y?".":"#")+l,t.forced)&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(t.sham||f&&f.sham)&&i(d,"sham",!0),a(n,l,d,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,e,n){"use strict";n(4916);var o=n(1470),r=n(8052),i=n(2261),a=n(7293),s=n(5112),u=n(8880),c=s("species"),l=RegExp.prototype;t.exports=function(t,e,n,f){var d=s(t),p=!a((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),h=p&&!a((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return e=!0,null},n[d](""),!e}));if(!p||!h||n){var v=o(/./[d]),y=e(d,""[t],(function(t,e,n,r,a){var s=o(t),u=e.exec;return u===i||u===l.exec?p&&!a?{done:!0,value:v(e,n,r)}:{done:!0,value:s(n,e,r)}:{done:!1}}));r(String.prototype,t,y[0]),r(l,d,y[1])}f&&u(l[d],"sham",!0)}},2104:function(t,e,n){var o=n(4374),r=Function.prototype,i=r.apply,a=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(o?a.bind(i):function(){return a.apply(i,arguments)})},9974:function(t,e,n){var o=n(1470),r=n(9662),i=n(4374),a=o(o.bind);t.exports=function(t,e){return r(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},4374:function(t,e,n){var o=n(7293);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:function(t,e,n){var o=n(4374),r=Function.prototype.call;t.exports=o?r.bind(r):function(){return r.apply(r,arguments)}},6530:function(t,e,n){var o=n(9781),r=n(2597),i=Function.prototype,a=o&&Object.getOwnPropertyDescriptor,s=r(i,"name"),u=s&&"something"===function(){}.name,c=s&&(!o||o&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},5668:function(t,e,n){var o=n(1702),r=n(9662);t.exports=function(t,e,n){try{return o(r(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},1470:function(t,e,n){var o=n(4326),r=n(1702);t.exports=function(t){if("Function"===o(t))return r(t)}},1702:function(t,e,n){var o=n(4374),r=Function.prototype,i=r.call,a=o&&r.bind.bind(i,i);t.exports=o?a:function(t){return function(){return i.apply(t,arguments)}}},5005:function(t,e,n){var o=n(7854),r=n(614),i=function(t){return r(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(o[t]):o[t]&&o[t][e]}},1246:function(t,e,n){var o=n(648),r=n(8173),i=n(8554),a=n(7497),s=n(5112)("iterator");t.exports=function(t){if(!i(t))return r(t,s)||r(t,"@@iterator")||a[o(t)]}},4121:function(t,e,n){var o=n(6916),r=n(9662),i=n(9670),a=n(6330),s=n(1246),u=TypeError;t.exports=function(t,e){var n=arguments.length<2?s(t):e;if(r(n))return i(o(n,t));throw u(a(t)+" is not iterable")}},8044:function(t,e,n){var o=n(1702),r=n(3157),i=n(614),a=n(4326),s=n(1340),u=o([].push);t.exports=function(t){if(i(t))return t;if(r(t)){for(var e=t.length,n=[],o=0;o]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,o,f,d){var p=n+t.length,h=o.length,v=l;return void 0!==f&&(f=r(f),v=c),s(d,v,(function(r,s){var c;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,n);case"'":return u(e,p);case"<":c=f[u(s,1,-1)];break;default:var l=+s;if(0===l)return r;if(l>h){var d=i(l/10);return 0===d?r:d<=h?void 0===o[d-1]?a(s,1):o[d-1]+a(s,1):r}c=o[l-1]}return void 0===c?"":c}))}},7854:function(t,e,n){var o=function(t){return t&&t.Math==Math&&t};t.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:function(t,e,n){var o=n(1702),r=n(7908),i=o({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(r(t),e)}},3501:function(t){t.exports={}},490:function(t,e,n){var o=n(5005);t.exports=o("document","documentElement")},4664:function(t,e,n){var o=n(9781),r=n(7293),i=n(317);t.exports=!o&&!r((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(t,e,n){var o=n(1702),r=n(7293),i=n(4326),a=Object,s=o("".split);t.exports=r((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?s(t,""):a(t)}:a},9587:function(t,e,n){var o=n(614),r=n(111),i=n(7674);t.exports=function(t,e,n){var a,s;return i&&o(a=e.constructor)&&a!==n&&r(s=a.prototype)&&s!==n.prototype&&i(t,s),t}},2788:function(t,e,n){var o=n(1702),r=n(614),i=n(5465),a=o(Function.toString);r(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},9909:function(t,e,n){var o,r,i,a=n(4811),s=n(7854),u=n(111),c=n(8880),l=n(2597),f=n(5465),d=n(6200),p=n(3501),h="Object already initialized",v=s.TypeError,y=s.WeakMap;if(a||f.state){var g=f.state||(f.state=new y);g.get=g.get,g.has=g.has,g.set=g.set,o=function(t,e){if(g.has(t))throw v(h);return e.facade=t,g.set(t,e),e},r=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var m=d("state");p[m]=!0,o=function(t,e){if(l(t,m))throw v(h);return e.facade=t,c(t,m,e),e},r=function(t){return l(t,m)?t[m]:{}},i=function(t){return l(t,m)}}t.exports={set:o,get:r,has:i,enforce:function(t){return i(t)?r(t):o(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=r(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},7659:function(t,e,n){var o=n(5112),r=n(7497),i=o("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[i]===t)}},3157:function(t,e,n){var o=n(4326);t.exports=Array.isArray||function(t){return"Array"==o(t)}},614:function(t,e,n){var o=n(4154),r=o.all;t.exports=o.IS_HTMLDDA?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},4411:function(t,e,n){var o=n(1702),r=n(7293),i=n(614),a=n(648),s=n(5005),u=n(2788),c=function(){},l=[],f=s("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=o(d.exec),h=!d.exec(c),v=function(t){if(!i(t))return!1;try{return f(c,l,t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(d,u(t))}catch(t){return!0}};y.sham=!0,t.exports=!f||r((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?y:v},4705:function(t,e,n){var o=n(7293),r=n(614),i=/#|\.prototype\./,a=function(t,e){var n=u[s(t)];return n==l||n!=c&&(r(e)?o(e):!!e)},s=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},5988:function(t,e,n){var o=n(111),r=Math.floor;t.exports=Number.isInteger||function(t){return!o(t)&&isFinite(t)&&r(t)===t}},8554:function(t){t.exports=function(t){return null==t}},111:function(t,e,n){var o=n(614),r=n(4154),i=r.all;t.exports=r.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:o(t)||t===i}:function(t){return"object"==typeof t?null!==t:o(t)}},1913:function(t){t.exports=!1},7850:function(t,e,n){var o=n(111),r=n(4326),i=n(5112)("match");t.exports=function(t){var e;return o(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==r(t))}},2190:function(t,e,n){var o=n(5005),r=n(614),i=n(7976),a=n(3307),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return r(e)&&i(e.prototype,s(t))}},9212:function(t,e,n){var o=n(6916),r=n(9670),i=n(8173);t.exports=function(t,e,n){var a,s;r(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw n;return n}a=o(a,t)}catch(t){s=!0,a=t}if("throw"===e)throw n;if(s)throw a;return r(a),n}},3061:function(t,e,n){"use strict";var o=n(3383).IteratorPrototype,r=n(30),i=n(9114),a=n(8003),s=n(7497),u=function(){return this};t.exports=function(t,e,n,c){var l=e+" Iterator";return t.prototype=r(o,{next:i(+!c,n)}),a(t,l,!1,!0),s[l]=u,t}},1656:function(t,e,n){"use strict";var o=n(2109),r=n(6916),i=n(1913),a=n(6530),s=n(614),u=n(3061),c=n(9518),l=n(7674),f=n(8003),d=n(8880),p=n(8052),h=n(5112),v=n(7497),y=n(3383),g=a.PROPER,m=a.CONFIGURABLE,b=y.IteratorPrototype,x=y.BUGGY_SAFARI_ITERATORS,w=h("iterator"),E="keys",S="values",O="entries",k=function(){return this};t.exports=function(t,e,n,a,h,y,P){u(n,e,a);var I,C,A,M=function(t){if(t===h&&R)return R;if(!x&&t in j)return j[t];switch(t){case E:case S:case O:return function(){return new n(this,t)}}return function(){return new n(this)}},T=e+" Iterator",D=!1,j=t.prototype,N=j[w]||j["@@iterator"]||h&&j[h],R=!x&&N||M(h),L="Array"==e&&j.entries||N;if(L&&(I=c(L.call(new t)))!==Object.prototype&&I.next&&(i||c(I)===b||(l?l(I,b):s(I[w])||p(I,w,k)),f(I,T,!0,!0),i&&(v[T]=k)),g&&h==S&&N&&N.name!==S&&(!i&&m?d(j,"name",S):(D=!0,R=function(){return r(N,this)})),h)if(C={values:M(S),keys:y?R:M(E),entries:M(O)},P)for(A in C)(x||D||!(A in j))&&p(j,A,C[A]);else o({target:e,proto:!0,forced:x||D},C);return i&&!P||j[w]===R||p(j,w,R,{name:h}),v[e]=R,C}},3383:function(t,e,n){"use strict";var o,r,i,a=n(7293),s=n(614),u=n(111),c=n(30),l=n(9518),f=n(8052),d=n(5112),p=n(1913),h=d("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(r=l(l(i)))!==Object.prototype&&(o=r):v=!0),!u(o)||a((function(){var t={};return o[h].call(t)!==t}))?o={}:p&&(o=c(o)),s(o[h])||f(o,h,(function(){return this})),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:v}},7497:function(t){t.exports={}},6244:function(t,e,n){var o=n(7466);t.exports=function(t){return o(t.length)}},6339:function(t,e,n){var o=n(1702),r=n(7293),i=n(614),a=n(2597),s=n(9781),u=n(6530).CONFIGURABLE,c=n(2788),l=n(9909),f=l.enforce,d=l.get,p=String,h=Object.defineProperty,v=o("".slice),y=o("".replace),g=o([].join),m=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===v(p(e),0,7)&&(e="["+y(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||u&&t.name!==e)&&(s?h(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&a(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var o=f(t);return a(o,"source")||(o.source=g(b,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return i(this)&&d(this).source||c(this)}),"toString")},4758:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var o=+t;return(o>0?n:e)(o)}},3929:function(t,e,n){var o=n(7850),r=TypeError;t.exports=function(t){if(o(t))throw r("The method doesn't accept regular expressions");return t}},1574:function(t,e,n){"use strict";var o=n(9781),r=n(1702),i=n(6916),a=n(7293),s=n(1956),u=n(5181),c=n(5296),l=n(7908),f=n(8361),d=Object.assign,p=Object.defineProperty,h=r([].concat);t.exports=!d||a((function(){if(o&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=d({},t)[n]||s(d({},e)).join("")!=r}))?function(t,e){for(var n=l(t),r=arguments.length,a=1,d=u.f,p=c.f;r>a;)for(var v,y=f(arguments[a++]),g=d?h(s(y),d(y)):s(y),m=g.length,b=0;m>b;)v=g[b++],o&&!i(p,y,v)||(n[v]=y[v]);return n}:d},30:function(t,e,n){var o,r=n(9670),i=n(6048),a=n(748),s=n(3501),u=n(490),c=n(317),l=n(6200),f="prototype",d="script",p=l("IE_PROTO"),h=function(){},v=function(t){return"<"+d+">"+t+""},y=function(t){t.write(v("")),t.close();var e=t.parentWindow.Object;return t=null,e},g=function(){try{o=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;g="undefined"!=typeof document?document.domain&&o?y(o):(e=c("iframe"),n="java"+d+":",e.style.display="none",u.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(v("document.F=Object")),t.close(),t.F):y(o);for(var r=a.length;r--;)delete g[f][a[r]];return g()};s[p]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h[f]=r(t),n=new h,h[f]=null,n[p]=t):n=g(),void 0===e?n:i.f(n,e)}},6048:function(t,e,n){var o=n(9781),r=n(3353),i=n(3070),a=n(9670),s=n(5656),u=n(1956);e.f=o&&!r?Object.defineProperties:function(t,e){a(t);for(var n,o=s(e),r=u(e),c=r.length,l=0;c>l;)i.f(t,n=r[l++],o[n]);return t}},3070:function(t,e,n){var o=n(9781),r=n(4664),i=n(3353),a=n(9670),s=n(4948),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",p="writable";e.f=o?i?function(t,e,n){if(a(t),e=s(e),a(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var o=l(t,e);o&&o[p]&&(t[e]=n.value,n={configurable:d in n?n[d]:o[d],enumerable:f in n?n[f]:o[f],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(a(t),e=s(e),a(n),r)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:function(t,e,n){var o=n(9781),r=n(6916),i=n(5296),a=n(9114),s=n(5656),u=n(4948),c=n(2597),l=n(4664),f=Object.getOwnPropertyDescriptor;e.f=o?f:function(t,e){if(t=s(t),e=u(e),l)try{return f(t,e)}catch(t){}if(c(t,e))return a(!r(i.f,t,e),t[e])}},1156:function(t,e,n){var o=n(4326),r=n(5656),i=n(8006).f,a=n(1589),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"Window"==o(t)?function(t){try{return i(t)}catch(t){return a(s)}}(t):i(r(t))}},8006:function(t,e,n){var o=n(6324),r=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,r)}},5181:function(t,e){e.f=Object.getOwnPropertySymbols},9518:function(t,e,n){var o=n(2597),r=n(614),i=n(7908),a=n(6200),s=n(8544),u=a("IE_PROTO"),c=Object,l=c.prototype;t.exports=s?c.getPrototypeOf:function(t){var e=i(t);if(o(e,u))return e[u];var n=e.constructor;return r(n)&&e instanceof n?n.prototype:e instanceof c?l:null}},7976:function(t,e,n){var o=n(1702);t.exports=o({}.isPrototypeOf)},6324:function(t,e,n){var o=n(1702),r=n(2597),i=n(5656),a=n(1318).indexOf,s=n(3501),u=o([].push);t.exports=function(t,e){var n,o=i(t),c=0,l=[];for(n in o)!r(s,n)&&r(o,n)&&u(l,n);for(;e.length>c;)r(o,n=e[c++])&&(~a(l,n)||u(l,n));return l}},1956:function(t,e,n){var o=n(6324),r=n(748);t.exports=Object.keys||function(t){return o(t,r)}},5296:function(t,e){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,r=o&&!n.call({1:2},1);e.f=r?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},9026:function(t,e,n){"use strict";var o=n(1913),r=n(7854),i=n(7293),a=n(8008);t.exports=o||!i((function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete r[t]}}))},7674:function(t,e,n){var o=n(5668),r=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=o(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,o){return r(n),i(o),e?t(n,o):n.__proto__=o,n}}():void 0)},288:function(t,e,n){"use strict";var o=n(1694),r=n(648);t.exports=o?{}.toString:function(){return"[object "+r(this)+"]"}},2140:function(t,e,n){var o=n(6916),r=n(614),i=n(111),a=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&r(n=t.toString)&&!i(s=o(n,t)))return s;if(r(n=t.valueOf)&&!i(s=o(n,t)))return s;if("string"!==e&&r(n=t.toString)&&!i(s=o(n,t)))return s;throw a("Can't convert object to primitive value")}},3887:function(t,e,n){var o=n(5005),r=n(1702),i=n(8006),a=n(5181),s=n(9670),u=r([].concat);t.exports=o("Reflect","ownKeys")||function(t){var e=i.f(s(t)),n=a.f;return n?u(e,n(t)):e}},857:function(t,e,n){var o=n(7854);t.exports=o},2626:function(t,e,n){var o=n(3070).f;t.exports=function(t,e,n){n in t||o(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},7651:function(t,e,n){var o=n(6916),r=n(9670),i=n(614),a=n(4326),s=n(2261),u=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var c=o(n,t,e);return null!==c&&r(c),c}if("RegExp"===a(t))return o(s,t,e);throw u("RegExp#exec called on incompatible receiver")}},2261:function(t,e,n){"use strict";var o,r,i=n(6916),a=n(1702),s=n(1340),u=n(7066),c=n(2999),l=n(2309),f=n(30),d=n(9909).get,p=n(9441),h=n(7168),v=l("native-string-replace",String.prototype.replace),y=RegExp.prototype.exec,g=y,m=a("".charAt),b=a("".indexOf),x=a("".replace),w=a("".slice),E=(r=/b*/g,i(y,o=/a/,"a"),i(y,r,"a"),0!==o.lastIndex||0!==r.lastIndex),S=c.BROKEN_CARET,O=void 0!==/()??/.exec("")[1];(E||O||S||p||h)&&(g=function(t){var e,n,o,r,a,c,l,p=this,h=d(p),k=s(t),P=h.raw;if(P)return P.lastIndex=p.lastIndex,e=i(g,P,k),p.lastIndex=P.lastIndex,e;var I=h.groups,C=S&&p.sticky,A=i(u,p),M=p.source,T=0,D=k;if(C&&(A=x(A,"y",""),-1===b(A,"g")&&(A+="g"),D=w(k,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==m(k,p.lastIndex-1))&&(M="(?: "+M+")",D=" "+D,T++),n=new RegExp("^(?:"+M+")",A)),O&&(n=new RegExp("^"+M+"$(?!\\s)",A)),E&&(o=p.lastIndex),r=i(y,C?n:p,D),C?r?(r.input=w(r.input,T),r[0]=w(r[0],T),r.index=p.lastIndex,p.lastIndex+=r[0].length):p.lastIndex=0:E&&r&&(p.lastIndex=p.global?r.index+r[0].length:o),O&&r&&r.length>1&&i(v,r[0],n,(function(){for(a=1;ab)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},4488:function(t,e,n){var o=n(8554),r=TypeError;t.exports=function(t){if(o(t))throw r("Can't call method on "+t);return t}},6340:function(t,e,n){"use strict";var o=n(5005),r=n(7045),i=n(5112),a=n(9781),s=i("species");t.exports=function(t){var e=o(t);a&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},8003:function(t,e,n){var o=n(3070).f,r=n(2597),i=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!r(t,i)&&o(t,i,{configurable:!0,value:e})}},6200:function(t,e,n){var o=n(2309),r=n(9711),i=o("keys");t.exports=function(t){return i[t]||(i[t]=r(t))}},5465:function(t,e,n){var o=n(7854),r=n(3072),i="__core-js_shared__",a=o[i]||r(i,{});t.exports=a},2309:function(t,e,n){var o=n(1913),r=n(5465);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.30.1",mode:o?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:function(t,e,n){var o=n(9670),r=n(9483),i=n(8554),a=n(5112)("species");t.exports=function(t,e){var n,s=o(t).constructor;return void 0===s||i(n=o(s)[a])?e:r(n)}},8710:function(t,e,n){var o=n(1702),r=n(9303),i=n(1340),a=n(4488),s=o("".charAt),u=o("".charCodeAt),c=o("".slice),l=function(t){return function(e,n){var o,l,f=i(a(e)),d=r(n),p=f.length;return d<0||d>=p?t?"":void 0:(o=u(f,d))<55296||o>56319||d+1===p||(l=u(f,d+1))<56320||l>57343?t?s(f,d):o:t?c(f,d,d+2):l-56320+(o-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},6091:function(t,e,n){var o=n(6530).PROPER,r=n(7293),i=n(1361);t.exports=function(t){return r((function(){return!!i[t]()||"​…᠎"!=="​…᠎"[t]()||o&&i[t].name!==t}))}},3111:function(t,e,n){var o=n(1702),r=n(4488),i=n(1340),a=n(1361),s=o("".replace),u=RegExp("^["+a+"]+"),c=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(t){return function(e){var n=i(r(e));return 1&t&&(n=s(n,u,"")),2&t&&(n=s(n,c,"$1")),n}};t.exports={start:l(1),end:l(2),trim:l(3)}},6293:function(t,e,n){var o=n(7392),r=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},6532:function(t,e,n){var o=n(6916),r=n(5005),i=n(5112),a=n(8052);t.exports=function(){var t=r("Symbol"),e=t&&t.prototype,n=e&&e.valueOf,s=i("toPrimitive");e&&!e[s]&&a(e,s,(function(t){return o(n,this)}),{arity:1})}},2015:function(t,e,n){var o=n(6293);t.exports=o&&!!Symbol.for&&!!Symbol.keyFor},863:function(t,e,n){var o=n(1702);t.exports=o(1..valueOf)},1400:function(t,e,n){var o=n(9303),r=Math.max,i=Math.min;t.exports=function(t,e){var n=o(t);return n<0?r(n+e,0):i(n,e)}},5656:function(t,e,n){var o=n(8361),r=n(4488);t.exports=function(t){return o(r(t))}},9303:function(t,e,n){var o=n(4758);t.exports=function(t){var e=+t;return e!=e||0===e?0:o(e)}},7466:function(t,e,n){var o=n(9303),r=Math.min;t.exports=function(t){return t>0?r(o(t),9007199254740991):0}},7908:function(t,e,n){var o=n(4488),r=Object;t.exports=function(t){return r(o(t))}},7593:function(t,e,n){var o=n(6916),r=n(111),i=n(2190),a=n(8173),s=n(2140),u=n(5112),c=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!r(t)||i(t))return t;var n,u=a(t,l);if(u){if(void 0===e&&(e="default"),n=o(u,t,e),!r(n)||i(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},4948:function(t,e,n){var o=n(7593),r=n(2190);t.exports=function(t){var e=o(t,"string");return r(e)?e:e+""}},1694:function(t,e,n){var o={};o[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(o)},1340:function(t,e,n){var o=n(648),r=String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},6330:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:function(t,e,n){var o=n(1702),r=0,i=Math.random(),a=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++r+i,36)}},3307:function(t,e,n){var o=n(6293);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(t,e,n){var o=n(9781),r=n(7293);t.exports=o&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4811:function(t,e,n){var o=n(7854),r=n(614),i=o.WeakMap;t.exports=r(i)&&/native code/.test(String(i))},6800:function(t,e,n){var o=n(857),r=n(2597),i=n(6061),a=n(3070).f;t.exports=function(t){var e=o.Symbol||(o.Symbol={});r(e,t)||a(e,t,{value:i.f(t)})}},6061:function(t,e,n){var o=n(5112);e.f=o},5112:function(t,e,n){var o=n(7854),r=n(2309),i=n(2597),a=n(9711),s=n(6293),u=n(3307),c=o.Symbol,l=r("wks"),f=u?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){return i(l,t)||(l[t]=s&&i(c,t)?c[t]:f("Symbol."+t)),l[t]}},1361:function(t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},2222:function(t,e,n){"use strict";var o=n(2109),r=n(7293),i=n(3157),a=n(111),s=n(7908),u=n(6244),c=n(7207),l=n(6135),f=n(5417),d=n(1194),p=n(5112),h=n(7392),v=p("isConcatSpreadable"),y=h>=51||!r((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),g=function(t){if(!a(t))return!1;var e=t[v];return void 0!==e?!!e:i(t)};o({target:"Array",proto:!0,arity:1,forced:!y||!d("concat")},{concat:function(t){var e,n,o,r,i,a=s(this),d=f(a,0),p=0;for(e=-1,o=arguments.length;e1?arguments[1]:void 0)}})},1038:function(t,e,n){var o=n(2109),r=n(8457);o({target:"Array",stat:!0,forced:!n(7072)((function(t){Array.from(t)}))},{from:r})},6699:function(t,e,n){"use strict";var o=n(2109),r=n(1318).includes,i=n(7293),a=n(1223);o({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},2772:function(t,e,n){"use strict";var o=n(2109),r=n(1470),i=n(1318).indexOf,a=n(9341),s=r([].indexOf),u=!!s&&1/s([1],1,-0)<0;o({target:"Array",proto:!0,forced:u||!a("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return u?s(this,t,e)||0:i(this,t,e)}})},6992:function(t,e,n){"use strict";var o=n(5656),r=n(1223),i=n(7497),a=n(9909),s=n(3070).f,u=n(1656),c=n(6178),l=n(1913),f=n(9781),d="Array Iterator",p=a.set,h=a.getterFor(d);t.exports=u(Array,"Array",(function(t,e){p(this,{type:d,target:o(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,n=t.kind,o=t.index++;return!e||o>=e.length?(t.target=void 0,c(void 0,!0)):c("keys"==n?o:"values"==n?e[o]:[o,e[o]],!1)}),"values");var v=i.Arguments=i.Array;if(r("keys"),r("values"),r("entries"),!l&&f&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(t){}},9600:function(t,e,n){"use strict";var o=n(2109),r=n(1702),i=n(8361),a=n(5656),s=n(9341),u=r([].join);o({target:"Array",proto:!0,forced:i!=Object||!s("join",",")},{join:function(t){return u(a(this),void 0===t?",":t)}})},1249:function(t,e,n){"use strict";var o=n(2109),r=n(2092).map;o({target:"Array",proto:!0,forced:!n(1194)("map")},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},5827:function(t,e,n){"use strict";var o=n(2109),r=n(3671).left,i=n(9341),a=n(7392);o({target:"Array",proto:!0,forced:!n(5268)&&a>79&&a<83||!i("reduce")},{reduce:function(t){var e=arguments.length;return r(this,t,e,e>1?arguments[1]:void 0)}})},7042:function(t,e,n){"use strict";var o=n(2109),r=n(3157),i=n(4411),a=n(111),s=n(1400),u=n(6244),c=n(5656),l=n(6135),f=n(5112),d=n(1194),p=n(206),h=d("slice"),v=f("species"),y=Array,g=Math.max;o({target:"Array",proto:!0,forced:!h},{slice:function(t,e){var n,o,f,d=c(this),h=u(d),m=s(t,h),b=s(void 0===e?h:e,h);if(r(d)&&(n=d.constructor,(i(n)&&(n===y||r(n.prototype))||a(n)&&null===(n=n[v]))&&(n=void 0),n===y||void 0===n))return p(d,m,b);for(o=new(void 0===n?y:n)(g(b-m,0)),f=0;m3)){if(h)return!0;if(y)return y<603;var t,e,n,o,r="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)g.push({k:e+o,v:n})}for(g.sort((function(t,e){return e.v-t.v})),o=0;oc(n)?1:-1}}(t)),n=s(r),o=0;ox-o+n;y--)d(b,y-1)}else if(n>o)for(y=x-o;y>w;y--)m=y+n-1,(g=y+o-1)in b?b[m]=b[g]:d(b,m);for(y=0;y2)if(c=x(c),43===(e=I(c,0))||45===e){if(88===(n=I(c,2))||120===n)return NaN}else if(48===e){switch(I(c,1)){case 66:case 98:o=2,r=49;break;case 79:case 111:o=8,r=55;break;default:return+c}for(a=(i=P(c,2)).length,s=0;sr)return NaN;return parseInt(i,o)}return+c},M=c(w,!E(" 0o1")||!E("0b1")||E("+0x1")),T=function(t){return d(O,t)&&v((function(){b(t)}))},D=function(t){var e=arguments.length<1?0:E(C(t));return T(this)?f(Object(e),this,D):e};D.prototype=O,M&&!r&&(O.constructor=D),o({global:!0,constructor:!0,wrap:!0,forced:M},{Number:D});var j=function(t,e){for(var n,o=i?y(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;o.length>r;r++)l(e,n=o[r])&&!l(t,n)&&m(t,n,g(e,n))};r&&S&&j(s[w],S),(M||r)&&j(s[w],E)},3161:function(t,e,n){n(2109)({target:"Number",stat:!0},{isInteger:n(5988)})},9601:function(t,e,n){var o=n(2109),r=n(1574);o({target:"Object",stat:!0,arity:2,forced:Object.assign!==r},{assign:r})},9595:function(t,e,n){"use strict";var o=n(2109),r=n(9781),i=n(9026),a=n(9662),s=n(7908),u=n(3070);r&&o({target:"Object",proto:!0,forced:i},{__defineGetter__:function(t,e){u.f(s(this),t,{get:a(e),enumerable:!0,configurable:!0})}})},5003:function(t,e,n){var o=n(2109),r=n(7293),i=n(5656),a=n(1236).f,s=n(9781);o({target:"Object",stat:!0,forced:!s||r((function(){a(1)})),sham:!s},{getOwnPropertyDescriptor:function(t,e){return a(i(t),e)}})},9337:function(t,e,n){var o=n(2109),r=n(9781),i=n(3887),a=n(5656),s=n(1236),u=n(6135);o({target:"Object",stat:!0,sham:!r},{getOwnPropertyDescriptors:function(t){for(var e,n,o=a(t),r=s.f,c=i(o),l={},f=0;c.length>f;)void 0!==(n=r(o,e=c[f++]))&&u(l,e,n);return l}})},6210:function(t,e,n){var o=n(2109),r=n(7293),i=n(1156).f;o({target:"Object",stat:!0,forced:r((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:i})},9660:function(t,e,n){var o=n(2109),r=n(6293),i=n(7293),a=n(5181),s=n(7908);o({target:"Object",stat:!0,forced:!r||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(t){var e=a.f;return e?e(s(t)):[]}})},7941:function(t,e,n){var o=n(2109),r=n(7908),i=n(1956);o({target:"Object",stat:!0,forced:n(7293)((function(){i(1)}))},{keys:function(t){return i(r(t))}})},1539:function(t,e,n){var o=n(1694),r=n(8052),i=n(288);o||r(Object.prototype,"toString",i,{unsafe:!0})},4603:function(t,e,n){var o=n(9781),r=n(7854),i=n(1702),a=n(4705),s=n(9587),u=n(8880),c=n(8006).f,l=n(7976),f=n(7850),d=n(1340),p=n(4706),h=n(2999),v=n(2626),y=n(8052),g=n(7293),m=n(2597),b=n(9909).enforce,x=n(6340),w=n(5112),E=n(9441),S=n(7168),O=w("match"),k=r.RegExp,P=k.prototype,I=r.SyntaxError,C=i(P.exec),A=i("".charAt),M=i("".replace),T=i("".indexOf),D=i("".slice),j=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,N=/a/g,R=/a/g,L=new k(N)!==N,B=h.MISSED_STICKY,K=h.UNSUPPORTED_Y,F=o&&(!L||B||E||S||g((function(){return R[O]=!1,k(N)!=N||k(R)==R||"/a/i"!=k(N,"i")})));if(a("RegExp",F)){for(var _=function(t,e){var n,o,r,i,a,c,h=l(P,this),v=f(t),y=void 0===e,g=[],x=t;if(!h&&v&&y&&t.constructor===_)return t;if((v||l(P,t))&&(t=t.source,y&&(e=p(x))),t=void 0===t?"":d(t),e=void 0===e?"":d(e),x=t,E&&"dotAll"in N&&(o=!!e&&T(e,"s")>-1)&&(e=M(e,/s/g,"")),n=e,B&&"sticky"in N&&(r=!!e&&T(e,"y")>-1)&&K&&(e=M(e,/y/g,"")),S&&(i=function(t){for(var e,n=t.length,o=0,r="",i=[],a={},s=!1,u=!1,c=0,l="";o<=n;o++){if("\\"===(e=A(t,o)))e+=A(t,++o);else if("]"===e)s=!1;else if(!s)switch(!0){case"["===e:s=!0;break;case"("===e:C(j,D(t,o+1))&&(o+=2,u=!0),r+=e,c++;continue;case">"===e&&u:if(""===l||m(a,l))throw new I("Invalid capture group name");a[l]=!0,i[i.length]=[l,c],u=!1,l="";continue}u?l+=e:r+=e}return[r,i]}(t),t=i[0],g=i[1]),a=s(k(t,e),h?this:P,_),(o||r||g.length)&&(c=b(a),o&&(c.dotAll=!0,c.raw=_(function(t){for(var e,n=t.length,o=0,r="",i=!1;o<=n;o++)"\\"!==(e=A(t,o))?i||"."!==e?("["===e?i=!0:"]"===e&&(i=!1),r+=e):r+="[\\s\\S]":r+=e+A(t,++o);return r}(t),n)),r&&(c.sticky=!0),g.length&&(c.groups=g)),t!==x)try{u(a,"source",""===x?"(?:)":x)}catch(t){}return a},H=c(k),U=0;H.length>U;)v(_,k,H[U++]);P.constructor=_,_.prototype=P,y(r,"RegExp",_,{constructor:!0})}x("RegExp")},4916:function(t,e,n){"use strict";var o=n(2109),r=n(2261);o({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},9714:function(t,e,n){"use strict";var o=n(6530).PROPER,r=n(8052),i=n(9670),a=n(1340),s=n(7293),u=n(4706),c="toString",l=RegExp.prototype[c],f=s((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),d=o&&l.name!=c;(f||d)&&r(RegExp.prototype,c,(function(){var t=i(this);return"/"+a(t.source)+"/"+a(u(t))}),{unsafe:!0})},2023:function(t,e,n){"use strict";var o=n(2109),r=n(1702),i=n(3929),a=n(4488),s=n(1340),u=n(4964),c=r("".indexOf);o({target:"String",proto:!0,forced:!u("includes")},{includes:function(t){return!!~c(s(a(this)),s(i(t)),arguments.length>1?arguments[1]:void 0)}})},8783:function(t,e,n){"use strict";var o=n(8710).charAt,r=n(1340),i=n(9909),a=n(1656),s=n(6178),u="String Iterator",c=i.set,l=i.getterFor(u);a(String,"String",(function(t){c(this,{type:u,string:r(t),index:0})}),(function(){var t,e=l(this),n=e.string,r=e.index;return r>=n.length?s(void 0,!0):(t=o(n,r),e.index+=t.length,s(t,!1))}))},6373:function(t,e,n){"use strict";var o=n(2109),r=n(6916),i=n(1470),a=n(3061),s=n(6178),u=n(4488),c=n(7466),l=n(1340),f=n(9670),d=n(8554),p=n(4326),h=n(7850),v=n(4706),y=n(8173),g=n(8052),m=n(7293),b=n(5112),x=n(6707),w=n(1530),E=n(7651),S=n(9909),O=n(1913),k=b("matchAll"),P="RegExp String",I=P+" Iterator",C=S.set,A=S.getterFor(I),M=RegExp.prototype,T=TypeError,D=i("".indexOf),j=i("".matchAll),N=!!j&&!m((function(){j("a",/./)})),R=a((function(t,e,n,o){C(this,{type:I,regexp:t,string:e,global:n,unicode:o,done:!1})}),P,(function(){var t=A(this);if(t.done)return s(void 0,!0);var e=t.regexp,n=t.string,o=E(e,n);return null===o?(t.done=!0,s(void 0,!0)):t.global?(""===l(o[0])&&(e.lastIndex=w(n,c(e.lastIndex),t.unicode)),s(o,!1)):(t.done=!0,s(o,!1))})),L=function(t){var e,n,o,r=f(this),i=l(t),a=x(r,RegExp),s=l(v(r));return e=new a(a===RegExp?r.source:r,s),n=!!~D(s,"g"),o=!!~D(s,"u"),e.lastIndex=c(r.lastIndex),new R(e,i,n,o)};o({target:"String",proto:!0,forced:N},{matchAll:function(t){var e,n,o,i,a=u(this);if(d(t)){if(N)return j(a,t)}else{if(h(t)&&(e=l(u(v(t))),!~D(e,"g")))throw T("`.matchAll` does not allow non-global regexes");if(N)return j(a,t);if(void 0===(o=y(t,k))&&O&&"RegExp"==p(t)&&(o=L),o)return r(o,t,a)}return n=l(a),i=new RegExp(t,"g"),O?r(L,i,n):i[k](n)}}),O||k in M||g(M,k,L)},4723:function(t,e,n){"use strict";var o=n(6916),r=n(7007),i=n(9670),a=n(8554),s=n(7466),u=n(1340),c=n(4488),l=n(8173),f=n(1530),d=n(7651);r("match",(function(t,e,n){return[function(e){var n=c(this),r=a(e)?void 0:l(e,t);return r?o(r,e,n):new RegExp(e)[t](u(n))},function(t){var o=i(this),r=u(t),a=n(e,o,r);if(a.done)return a.value;if(!o.global)return d(o,r);var c=o.unicode;o.lastIndex=0;for(var l,p=[],h=0;null!==(l=d(o,r));){var v=u(l[0]);p[h]=v,""===v&&(o.lastIndex=f(r,s(o.lastIndex),c)),h++}return 0===h?null:p}]}))},5306:function(t,e,n){"use strict";var o=n(2104),r=n(6916),i=n(1702),a=n(7007),s=n(7293),u=n(9670),c=n(614),l=n(8554),f=n(9303),d=n(7466),p=n(1340),h=n(4488),v=n(1530),y=n(8173),g=n(647),m=n(7651),b=n(5112)("replace"),x=Math.max,w=Math.min,E=i([].concat),S=i([].push),O=i("".indexOf),k=i("".slice),P="$0"==="a".replace(/./,"$0"),I=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(t,e,n){var i=I?"$":"$0";return[function(t,n){var o=h(this),i=l(t)?void 0:y(t,b);return i?r(i,t,o,n):r(e,p(o),t,n)},function(t,r){var a=u(this),s=p(t);if("string"==typeof r&&-1===O(r,i)&&-1===O(r,"$<")){var l=n(e,a,s,r);if(l.done)return l.value}var h=c(r);h||(r=p(r));var y=a.global;if(y){var b=a.unicode;a.lastIndex=0}for(var P=[];;){var I=m(a,s);if(null===I)break;if(S(P,I),!y)break;""===p(I[0])&&(a.lastIndex=v(s,d(a.lastIndex),b))}for(var C,A="",M=0,T=0;T=M&&(A+=k(s,M,j)+K,M=j+D.length)}return A+k(s,M)}]}),!!s((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!P||I)},3123:function(t,e,n){"use strict";var o=n(2104),r=n(6916),i=n(1702),a=n(7007),s=n(9670),u=n(8554),c=n(7850),l=n(4488),f=n(6707),d=n(1530),p=n(7466),h=n(1340),v=n(8173),y=n(1589),g=n(7651),m=n(2261),b=n(2999),x=n(7293),w=b.UNSUPPORTED_Y,E=4294967295,S=Math.min,O=[].push,k=i(/./.exec),P=i(O),I=i("".slice),C=!x((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));a("split",(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=h(l(this)),a=void 0===n?E:n>>>0;if(0===a)return[];if(void 0===t)return[i];if(!c(t))return r(e,i,t,a);for(var s,u,f,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,g=new RegExp(t.source,p+"g");(s=r(m,g,i))&&!((u=g.lastIndex)>v&&(P(d,I(i,v,s.index)),s.length>1&&s.index=a));)g.lastIndex===s.index&&g.lastIndex++;return v===i.length?!f&&k(g,"")||P(d,""):P(d,I(i,v)),d.length>a?y(d,0,a):d}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:r(e,this,t,n)}:e,[function(e,n){var o=l(this),a=u(e)?void 0:v(e,t);return a?r(a,e,o,n):r(i,h(o),e,n)},function(t,o){var r=s(this),a=h(t),u=n(i,r,a,o,i!==e);if(u.done)return u.value;var c=f(r,RegExp),l=r.unicode,v=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(w?"g":"y"),y=new c(w?"^(?:"+r.source+")":r,v),m=void 0===o?E:o>>>0;if(0===m)return[];if(0===a.length)return null===g(y,a)?[a]:[];for(var b=0,x=0,O=[];xt.length)&&(e=t.length);for(var n=0,o=new Array(e);n2&&void 0!==arguments[2]&&arguments[2]?Object.assign({},this.getDefaultDiplay(),e):e||this.getDefaultDiplay())[t]||t}},{key:"getUpdatedInput",value:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this.getOptions(),a=[n,o,r],s=e;return("{bksp}"===t||"{backspace}"===t)&&s.length>0?s=this.removeAt.apply(this,[s].concat(a)):("{delete}"===t||"{forwarddelete}"===t)&&s.length>0?s=this.removeForwardsAt.apply(this,[s].concat(a)):"{space}"===t?s=this.addStringAt.apply(this,[s," "].concat(a)):"{tab}"!==t||"boolean"==typeof i.tabCharOnTab&&!1===i.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!i.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?s=this.addStringAt.apply(this,[s,t[t.length-2]].concat(a)):"{numpaddivide}"===t?s=this.addStringAt.apply(this,[s,"/"].concat(a)):"{numpadmultiply}"===t?s=this.addStringAt.apply(this,[s,"*"].concat(a)):"{numpadsubtract}"===t?s=this.addStringAt.apply(this,[s,"-"].concat(a)):"{numpadadd}"===t?s=this.addStringAt.apply(this,[s,"+"].concat(a)):"{numpaddecimal}"===t?s=this.addStringAt.apply(this,[s,"."].concat(a)):"{"===t||"}"===t?s=this.addStringAt.apply(this,[s,t].concat(a)):t.includes("{")||t.includes("}")||(s=this.addStringAt.apply(this,[s,t].concat(a))):s=this.addStringAt.apply(this,[s,"\n"].concat(a)):s=this.addStringAt.apply(this,[s,"\t"].concat(a)),i.debug&&console.log("Input will be: "+s),s}},{key:"updateCaretPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.setCaretPosition(n)}))}},{key:"updateCaretPosAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOptions(),o=this.getCaretPosition();return null!=o&&(e?o>0&&(o-=t):o+=t),n.debug&&console.log("Caret at:",o),o}},{key:"addStringAt",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o||0===o?(n=[t.slice(0,o),e,t.slice(r)].join(""),this.isMaxLengthReached()||i&&this.updateCaretPos(e.length)):n=t+e,n}},{key:"removeAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===n&&0===o)return t;if(n===o){var i=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;n&&n>=0?t.substring(n-2,n).match(i)?(e=t.substr(0,n-2)+t.substr(n),r&&this.updateCaretPos(2,!0)):(e=t.substr(0,n-1)+t.substr(n),r&&this.updateCaretPos(1,!0)):t.slice(-2).match(i)?(e=t.slice(0,-2),r&&this.updateCaretPos(2,!0)):(e=t.slice(0,-1),r&&this.updateCaretPos(1,!0))}else e=t.slice(0,n)+t.slice(o),r&&this.dispatch((function(t){t.setCaretPosition(n)}));return e}},{key:"removeForwardsAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return null!=t&&t.length&&null!==n?(n===o?e=t.substring(n,n+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?t.substr(0,n)+t.substr(n+2):t.substr(0,n)+t.substr(n+1):(e=t.slice(0,n)+t.slice(o),r&&this.dispatch((function(t){t.setCaretPosition(n)}))),e):t}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,r=t[n.inputName||"default"],a=e.length-1>=o;if(e.length<=r.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===i(o)){var s=e.length-1>=o[n.inputName||"default"];return n.debug&&console.log("maxLength (obj) reached:",s),s?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(t){return t?t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t})):""}},{key:"chunkArray",value:function(e,n){return t(Array(Math.ceil(e.length/n))).map((function(t,o){return e.slice(n*o,n+n*o)}))}},{key:"escapeRegex",value:function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"getRtlOffset",value:function(t,e){var n=t,o=e.indexOf("‫");return o=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f: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.")}var a,s=!0,u=!1;return{s:function(){o=o.call(t)},n:function(){var t=o.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==o.return||o.return()}finally{if(u)throw a}}}}(Object.getOwnPropertyNames(t.prototype));try{for(r.s();!(o=r.n()).done;){var i=o.value;"constructor"===i||"bindMethods"===i||(n[i]=n[i].bind(n))}}catch(t){r.e(t)}finally{r.f()}}}],r&&a(o.prototype,r),u&&a(o,u),Object.defineProperty(o,"prototype",{writable:!1}),n}();s(c,"noop",(function(){}));var l=c;function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function d(t,e){for(var n=0;n1?null===(e=n)||void 0===e?void 0:e.toLowerCase():n}},{key:"keyCodeToKey",value:function(t){return{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:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",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",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[t]||""}}])&&d(e.prototype,n),o&&d(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:r();return s(t,e)},u.appendChild(o)}));var c=i>0,l=document.createElement("div");l.classList.add("hg-candidate-box-prev"),c&&l.classList.add("hg-candidate-box-btn-active");var f=function(){c&&n.renderPage({candidateListPages:o,targetElement:r,pageIndex:i-1,nbPages:a,onItemSelected:s})};this.options.useTouchEvents?l.ontouchstart=f:l.onclick=f,this.candidateBoxElement.appendChild(l),this.candidateBoxElement.appendChild(u);var d=it.length)&&(e=t.length);for(var n=0,o=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:t;this.caretPosition=t,this.caretPositionEnd=e}},{key:"getInputCandidates",value:function(t){var e=this,n=this.options,o=n.layoutCandidates,r=n.layoutCandidatesCaseSensitiveMatch;if(!o||"object"!==O(o))return{};var i=Object.keys(o).filter((function(n){var o=t.substring(0,e.getCaretPositionEnd()||0)||t,i=new RegExp("".concat(e.utilities.escapeRegex(n),"$"),r?"g":"gi");return!!E(o.matchAll(i)).length}));if(i.length>1){var a=i.sort((function(t,e){return e.length-t.length}))[0];return{candidateKey:a,candidateValue:o[a]}}if(i.length){var s=i[0];return{candidateKey:s,candidateValue:o[s]}}return{}}},{key:"showCandidatesBox",value:function(t,e,n){var o=this;this.candidateBox&&this.candidateBox.show({candidateValue:e,targetElement:n,onSelect:function(e,n){var r=o.options,i=r.layoutCandidatesCaseSensitiveMatch,a=r.disableCandidateNormalization,s=r.enableLayoutCandidatesKeyPress,u=e;a||(u=e.normalize("NFD"));var c=o.getInput(o.options.inputName,!0),l=o.getCaretPositionEnd()||0,f=c.substring(0,l||0)||c,d=new RegExp("".concat(o.utilities.escapeRegex(t),"$"),i?"g":"gi"),p=f.replace(d,u),h=c.replace(f,p),v=p.length-f.length,y=(l||c.length)+v;y<0&&(y=0),o.setInput(h,o.options.inputName,!0),o.setCaretPosition(y),s&&"function"==typeof o.options.onKeyPress&&o.options.onKeyPress(e,n),"function"==typeof o.options.onChange&&o.options.onChange(o.getInput(o.options.inputName,!0),n),"function"==typeof o.options.onChangeAll&&o.options.onChangeAll(o.getAllInputs(),n)}})}},{key:"handleButtonClicked",value:function(t,e){var n=this.options,o=n.inputName,r=void 0===o?this.defaultName:o,i=n.debug;if("{//}"!==t){this.input[r]||(this.input[r]="");var a=this.utilities.getUpdatedInput(t,this.input[r],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(t)&&this.activeInputElement&&this.input[r]&&this.input[r]===a&&0===this.caretPosition&&this.caretPositionEnd===a.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(t,e);if("function"==typeof this.options.onKeyPress&&this.options.onKeyPress(t,e),this.input[r]!==a&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(a))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,a))return;var s=this.utilities.getUpdatedInput(t,this.input[r],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(s,this.options.inputName,!0),i&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),null==e?void 0:e.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),"function"==typeof this.options.onChange&&this.options.onChange(this.getInput(this.options.inputName,!0),e),"function"==typeof this.options.onChangeAll&&this.options.onChangeAll(this.getAllInputs(),e),null!=e&&e.target&&this.options.enableLayoutCandidates){var u,c=this.getInputCandidates(a),l=c.candidateKey,f=c.candidateValue;l&&f?this.showCandidatesBox(l,f,this.keyboardDOM):null===(u=this.candidateBox)||void 0===u||u.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),i&&console.log("Key pressed:",t)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(t){this.options.syncInstanceInputs?this.dispatch((function(e){e.isMouseHold=t})):this.isMouseHold=t}},{key:"handleButtonMouseDown",value:function(t,e){var n=this;e&&(this.options.preventMouseDownDefault&&e.preventDefault(),this.options.stopMouseDownPropagation&&e.stopPropagation(),e.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout((function(){(n.getMouseHold()&&(!t.includes("{")&&!t.includes("}")||"{delete}"===t||"{backspace}"===t||"{bksp}"===t||"{space}"===t||"{tab}"===t)||"{arrowright}"===t||"{arrowleft}"===t||"{arrowup}"===t||"{arrowdown}"===t)&&(n.options.debug&&console.log("Button held:",t),n.handleButtonHold(t)),clearTimeout(n.holdTimeout)}),500))}},{key:"handleButtonMouseUp",value:function(t,e){var n=this;e&&(this.options.preventMouseUpDefault&&e.preventDefault&&e.preventDefault(),this.options.stopMouseUpPropagation&&e.stopPropagation&&e.stopPropagation(),!(e.target===this.keyboardDOM||e.target&&this.keyboardDOM.contains(e.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(e.target===this.candidateBox.candidateBoxElement||e.target&&this.candidateBox.candidateBoxElement.contains(e.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons((function(t){t.classList.remove(n.activeButtonClass)})),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),t&&"function"==typeof this.options.onKeyReleased&&this.options.onKeyReleased(t,e)}},{key:"handleKeyboardContainerMouseDown",value:function(t){this.options.preventMouseDownDefault&&t.preventDefault()}},{key:"handleButtonHold",value:function(t){var e=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout((function(){e.getMouseHold()?(e.handleButtonClicked(t),e.handleButtonHold(t)):clearTimeout(e.holdInteractionTimeout)}),100)}},{key:"syncInstanceInputs",value:function(){var t=this;this.dispatch((function(e){e.replaceInput(t.input),e.setCaretPosition(t.caretPosition,t.caretPositionEnd)}))}},{key:"clearInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName;this.input[t]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.options.syncInstanceInputs&&!e&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[t].replace("‫","").replace("‬","")+"‬":this.input[t]}},{key:"getAllInputs",value:function(){var t=this,e={};return Object.keys(this.input).forEach((function(n){e[n]=t.getInput(n,!0)})),e}},{key:"setInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.inputName||this.defaultName,n=arguments.length>2?arguments[2]:void 0;this.input[e]=t,!n&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(t){this.input=t}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.changedOptions(t);this.options=Object.assign(this.options,t),e.length&&(this.options.debug&&console.log("changedOptions",e),this.onSetOptions(e),this.render())}},{key:"changedOptions",value:function(t){var e=this;return Object.keys(t).filter((function(n){return JSON.stringify(t[n])!==JSON.stringify(e.options[n])}))}},{key:"onSetOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(t.includes("layoutCandidatesPageSize")||t.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new w({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(t){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach((function(e){t(window.SimpleKeyboardInstances[e],e)}))}},{key:"addButtonTheme",value:function(t,e){var n=this;e&&t&&(t.split(" ").forEach((function(o){e.split(" ").forEach((function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);var r=!1;n.options.buttonTheme.map((function(t){if(null!=t&&t.class.split(" ").includes(e)){r=!0;var n=t.buttons.split(" ");n.includes(o)||(r=!0,n.push(o),t.buttons=n.join(" "))}return t})),r||n.options.buttonTheme.push({class:e,buttons:t})}))})),this.render())}},{key:"removeButtonTheme",value:function(t,e){var n=this;if(!t&&!e)return this.options.buttonTheme=[],void this.render();t&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(t.split(" ").forEach((function(t){var o,r;null===(o=n.options)||void 0===o||null===(r=o.buttonTheme)||void 0===r||r.map((function(o,r){if(o&&e&&e.includes(o.class)||!e){var i,a,s=null===(i=o)||void 0===i?void 0:i.buttons.split(" ").filter((function(e){return e!==t}));o&&null!=s&&s.length?o.buttons=s.join(" "):(null===(a=n.options.buttonTheme)||void 0===a||a.splice(r,1),o=null)}return o}))})),this.render())}},{key:"getButtonElement",value:function(t){var e,n=this.buttonElements[t];return n&&(e=n.length>1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName||this.defaultName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.addEventListener("keyup",this.handleKeyUp,e),document.addEventListener("keydown",this.handleKeyDown,e),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"handleSelect",value:function(t){this.caretEventHandler(t)}},{key:"handleSelectionChange",value:function(t){navigator.userAgent.includes("Firefox")||this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e,n=this;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(o){var r=t.target===o.keyboardDOM||t.target&&o.keyboardDOM.contains(t.target);if(n.options.syncInstanceInputs&&Array.isArray(t.path)&&(r=t.path.some((function(t){var e;return null==t||null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-skInstance")}))),("textarea"===e||"input"===e&&["text","search","url","tel","password"].includes(t.target.type))&&!o.options.disableCaretPositioning){var i=t.target.selectionStart,a=t.target.selectionEnd;o.options.rtl&&(i=o.utilities.getRtlOffset(i,o.getInput()),a=o.utilities.getRtlOffset(a,o.getInput())),o.setCaretPosition(i,a),n.activeInputElement=t.target,o.options.debug&&console.log("Caret at: ",o.getCaretPosition(),o.getCaretPositionEnd(),t&&t.target.tagName.toLowerCase(),"(".concat(o.keyboardDOMClass,")"),null==t?void 0:t.type)}else!o.options.disableCaretPositioning&&r||"selectionchange"===(null==t?void 0:t.type)||(o.setCaretPosition(null),n.activeInputElement=null,o.options.debug&&console.log('Caret position reset due to "'.concat(null==t?void 0:t.type,'" event'),t))}))}},{key:"recurseButtons",value:function(t){var e=this;t&&Object.keys(this.buttonElements).forEach((function(n){return e.buttonElements[n].forEach(t)}))}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.removeEventListener("keyup",this.handleKeyUp,e),document.removeEventListener("keydown",this.handleKeyDown,e),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons((function(t){t&&(t.onpointerdown=null,t.onpointerup=null,t.onpointercancel=null,t.ontouchstart=null,t.ontouchend=null,t.ontouchcancel=null,t.onclick=null,t.onmousedown=null,t.onmouseup=null,t.remove(),t=null)})),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e&&e.class&&"string"==typeof e.class&&e.buttons&&"string"==typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(E(n),E(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"==typeof n.attribute&&n.value&&"string"==typeof n.value&&n.buttons&&"string"==typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"==typeof this.options.onInit&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"==typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"==typeof this.options.beforeRender&&this.options.beforeRender(this)}},{key:"onRender",value:function(){"function"==typeof this.options.onRender&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){"function"==typeof this.options.onModulesLoaded&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e(t);n.init&&n.init(t)})),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var r=this,i=Array.from(t.children),a=0;return i.length&&n.forEach((function(n,s){var u=o[s];if(!(u&&u>n))return!1;var c=n-a,l=u-a,f=document.createElement("div");f.className+="hg-button-container";var d="".concat(r.options.layoutName,"-r").concat(e,"c").concat(s);f.setAttribute("data-skUID",d);var p=i.splice(c,l-c+1);a=l-c,p.forEach((function(t){return f.appendChild(t)})),i.splice(c,0,f),t.innerHTML="",i.forEach((function(e){return t.appendChild(e)})),r.options.debug&&console.log("rowDOMContainer",p,c,l,a+1)})),t}},{key:"render",value:function(){var t=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},o=this.options.useTouchEvents||!1,r=o?"hg-touch-events":"",i=this.options.useMouseEvents||!1,a=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,e,this.keyboardPluginClasses,r),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",n[this.options.layoutName||this.defaultName].forEach((function(e,n){var r=e.split(" ");t.options.excludeFromLayout&&t.options.excludeFromLayout[t.options.layoutName||t.defaultName]&&(r=r.filter((function(e){return t.options.excludeFromLayout&&!t.options.excludeFromLayout[t.options.layoutName||t.defaultName].includes(e)})));var s=document.createElement("div");s.className+="hg-row";var u=[],c=[];r.forEach((function(e,r){var l,f=!a&&"string"==typeof e&&e.length>1&&0===e.indexOf("["),d=!a&&"string"==typeof e&&e.length>1&&e.indexOf("]")===e.length-1;f&&(u.push(r),e=e.replace(/\[/g,"")),d&&(c.push(r),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),h=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),v=t.options.useButtonTag?"button":"div",y=document.createElement(v);y.className+="hg-button ".concat(p),(l=y.classList).add.apply(l,E(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){y.setAttribute(t,e)})),t.activeButtonClass="hg-activeButton",!t.utilities.pointerEventsSupported()||o||i?o?(y.ontouchstart=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.ontouchend=function(n){t.handleButtonMouseUp(e,n)},y.ontouchcancel=function(n){t.handleButtonMouseUp(e,n)}):(y.onclick=function(n){t.setMouseHold(!1),"function"!=typeof t.options.onKeyReleased&&t.handleButtonClicked(e,n)},y.onmousedown=function(n){"function"!=typeof t.options.onKeyReleased||t.isMouseHold||t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.onmouseup=function(n){t.handleButtonMouseUp(e,n)}):(y.onpointerdown=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.onpointerup=function(n){t.handleButtonMouseUp(e,n)},y.onpointercancel=function(n){t.handleButtonMouseUp(e,n)}),y.setAttribute("data-skBtn",e);var g="".concat(t.options.layoutName,"-r").concat(n,"b").concat(r);y.setAttribute("data-skBtnUID",g);var m=document.createElement("span");m.innerHTML=h,y.appendChild(m),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(y),s.appendChild(y)})),s=t.parseRowDOMContainers(s,n,u,c),t.keyboardRowsDOM.appendChild(s)})),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||i?o?(document.ontouchend=function(e){return t.handleButtonMouseUp(void 0,e)},document.ontouchcancel=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}],n&&P(e.prototype,n),o&&P(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}(),M=A,T=A}(),o}()})); \ No newline at end of file diff --git a/build/index.modern.js b/build/index.modern.js index 5e86b8a0..48dd9a8a 100644 --- a/build/index.modern.js +++ b/build/index.modern.js @@ -1,6 +1,6 @@ /*! * - * simple-keyboard v3.5.51 (index.modern.js - Modern Browsers bundle) + * simple-keyboard v3.5.52 (index.modern.js - Modern Browsers bundle) * https://github.com/hodgef/simple-keyboard * * NOTE: This modern browsers bundle (index.modern.js) removes all polyfills @@ -13,5 +13,5 @@ * LICENSE file in the root directory of this source tree. * */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(this,(function(){return function(){"use strict";var t={d:function(e,n){for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{SimpleKeyboard:function(){return B},default:function(){return A}});function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n2&&void 0!==arguments[2]&&arguments[2]?Object.assign({},this.getDefaultDiplay(),e):e||this.getDefaultDiplay())[t]||t}},{key:"getUpdatedInput",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this.getOptions(),a=[n,i,o],r=e;return("{bksp}"===t||"{backspace}"===t)&&r.length>0?r=this.removeAt.apply(this,[r].concat(a)):("{delete}"===t||"{forwarddelete}"===t)&&r.length>0?r=this.removeForwardsAt.apply(this,[r].concat(a)):"{space}"===t?r=this.addStringAt.apply(this,[r," "].concat(a)):"{tab}"!==t||"boolean"==typeof s.tabCharOnTab&&!1===s.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!s.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?r=this.addStringAt.apply(this,[r,t[t.length-2]].concat(a)):"{numpaddivide}"===t?r=this.addStringAt.apply(this,[r,"/"].concat(a)):"{numpadmultiply}"===t?r=this.addStringAt.apply(this,[r,"*"].concat(a)):"{numpadsubtract}"===t?r=this.addStringAt.apply(this,[r,"-"].concat(a)):"{numpadadd}"===t?r=this.addStringAt.apply(this,[r,"+"].concat(a)):"{numpaddecimal}"===t?r=this.addStringAt.apply(this,[r,"."].concat(a)):"{"===t||"}"===t?r=this.addStringAt.apply(this,[r,t].concat(a)):t.includes("{")||t.includes("}")||(r=this.addStringAt.apply(this,[r,t].concat(a))):r=this.addStringAt.apply(this,[r,"\n"].concat(a)):r=this.addStringAt.apply(this,[r,"\t"].concat(a)),s.debug&&console.log("Input will be: "+r),r}},{key:"updateCaretPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.setCaretPosition(n)}))}},{key:"updateCaretPosAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOptions(),i=this.getCaretPosition();return null!=i&&(e?i>0&&(i-=t):i+=t),n.debug&&console.log("Caret at:",i),i}},{key:"addStringAt",value:function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return i||0===i?(n=[t.slice(0,i),e,t.slice(o)].join(""),this.isMaxLengthReached()||s&&this.updateCaretPos(e.length)):n=t+e,n}},{key:"removeAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===n&&0===i)return t;if(n===i){var s=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;n&&n>=0?t.substring(n-2,n).match(s)?(e=t.substr(0,n-2)+t.substr(n),o&&this.updateCaretPos(2,!0)):(e=t.substr(0,n-1)+t.substr(n),o&&this.updateCaretPos(1,!0)):t.slice(-2).match(s)?(e=t.slice(0,-2),o&&this.updateCaretPos(2,!0)):(e=t.slice(0,-1),o&&this.updateCaretPos(1,!0))}else e=t.slice(0,n)+t.slice(i),o&&this.dispatch((function(t){t.setCaretPosition(n)}));return e}},{key:"removeForwardsAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return null!=t&&t.length&&null!==n?(n===i?e=t.substring(n,n+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?t.substr(0,n)+t.substr(n+2):t.substr(0,n)+t.substr(n+1):(e=t.slice(0,n)+t.slice(i),o&&this.dispatch((function(t){t.setCaretPosition(n)}))),e):t}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),i=n.maxLength,o=t[n.inputName||"default"],a=e.length-1>=i;if(e.length<=o.length)return!1;if(Number.isInteger(i))return n.debug&&console.log("maxLength (num) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===s(i)){var r=e.length-1>=i[n.inputName||"default"];return n.debug&&console.log("maxLength (obj) reached:",r),r?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(t){return t?t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t})):""}},{key:"chunkArray",value:function(t,e){return n(Array(Math.ceil(t.length/e))).map((function(n,i){return t.slice(e*i,e+e*i)}))}},{key:"escapeRegex",value:function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"getRtlOffset",value:function(t,e){var n=t,i=e.indexOf("‫");return i=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},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 a,r=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return r=t.done,t},e:function(t){u=!0,a=t},f:function(){try{r||null==n.return||n.return()}finally{if(u)throw a}}}}(Object.getOwnPropertyNames(t.prototype));try{for(o.s();!(n=o.n()).done;){var s=n.value;"constructor"===s||"bindMethods"===s||(e[s]=e[s].bind(e))}}catch(t){o.e(t)}finally{o.f()}}}],o&&a(e.prototype,o),u&&a(e,u),Object.defineProperty(e,"prototype",{writable:!1}),t}();r(l,"noop",(function(){}));var c=l;function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){for(var n=0;n1?null===(e=n)||void 0===e?void 0:e.toLowerCase():n}},{key:"keyCodeToKey",value:function(t){return{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:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",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",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[t]||""}}])&&h(e.prototype,n),i&&h(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function g(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:o();return r(t,e)},u.appendChild(i)}));var l=s>0,c=document.createElement("div");c.classList.add("hg-candidate-box-prev"),l&&c.classList.add("hg-candidate-box-btn-active"),c.onclick=function(){l&&n.renderPage({candidateListPages:i,targetElement:o,pageIndex:s-1,nbPages:a,onItemSelected:r})},this.candidateBoxElement.appendChild(c),this.candidateBoxElement.appendChild(u);var d=st.length)&&(e=t.length);for(var n=0,i=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:t;this.caretPosition=t,this.caretPositionEnd=e}},{key:"getInputCandidates",value:function(t){var e=this,n=this.options,i=n.layoutCandidates,o=n.layoutCandidatesCaseSensitiveMatch;if(!i||"object"!==P(i))return{};var s=Object.keys(i).filter((function(n){var i=t.substring(0,e.getCaretPositionEnd()||0)||t,s=new RegExp("".concat(e.utilities.escapeRegex(n),"$"),o?"g":"gi");return!!E(i.matchAll(s)).length}));if(s.length>1){var a=s.sort((function(t,e){return e.length-t.length}))[0];return{candidateKey:a,candidateValue:i[a]}}if(s.length){var r=s[0];return{candidateKey:r,candidateValue:i[r]}}return{}}},{key:"showCandidatesBox",value:function(t,e,n){var i=this;this.candidateBox&&this.candidateBox.show({candidateValue:e,targetElement:n,onSelect:function(e,n){var o=i.options,s=o.layoutCandidatesCaseSensitiveMatch,a=o.disableCandidateNormalization,r=o.enableLayoutCandidatesKeyPress,u=e;a||(u=e.normalize("NFD"));var l=i.getInput(i.options.inputName,!0),c=i.getCaretPositionEnd()||0,d=l.substring(0,c||0)||l,h=new RegExp("".concat(i.utilities.escapeRegex(t),"$"),s?"g":"gi"),p=d.replace(h,u),f=l.replace(d,p),y=p.length-d.length,v=(c||l.length)+y;v<0&&(v=0),i.setInput(f,i.options.inputName,!0),i.setCaretPosition(v),r&&"function"==typeof i.options.onKeyPress&&i.options.onKeyPress(e,n),"function"==typeof i.options.onChange&&i.options.onChange(i.getInput(i.options.inputName,!0),n),"function"==typeof i.options.onChangeAll&&i.options.onChangeAll(i.getAllInputs(),n)}})}},{key:"handleButtonClicked",value:function(t,e){var n=this.options,i=n.inputName,o=void 0===i?this.defaultName:i,s=n.debug;if("{//}"!==t){this.input[o]||(this.input[o]="");var a=this.utilities.getUpdatedInput(t,this.input[o],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(t)&&this.activeInputElement&&this.input[o]&&this.input[o]===a&&0===this.caretPosition&&this.caretPositionEnd===a.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(t,e);if("function"==typeof this.options.onKeyPress&&this.options.onKeyPress(t,e),this.input[o]!==a&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(a))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,a))return;var r=this.utilities.getUpdatedInput(t,this.input[o],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(r,this.options.inputName,!0),s&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),null==e?void 0:e.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),"function"==typeof this.options.onChange&&this.options.onChange(this.getInput(this.options.inputName,!0),e),"function"==typeof this.options.onChangeAll&&this.options.onChangeAll(this.getAllInputs(),e),null!=e&&e.target&&this.options.enableLayoutCandidates){var u,l=this.getInputCandidates(a),c=l.candidateKey,d=l.candidateValue;c&&d?this.showCandidatesBox(c,d,this.keyboardDOM):null===(u=this.candidateBox)||void 0===u||u.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),s&&console.log("Key pressed:",t)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(t){this.options.syncInstanceInputs?this.dispatch((function(e){e.isMouseHold=t})):this.isMouseHold=t}},{key:"handleButtonMouseDown",value:function(t,e){var n=this;e&&(this.options.preventMouseDownDefault&&e.preventDefault(),this.options.stopMouseDownPropagation&&e.stopPropagation(),e.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout((function(){(n.getMouseHold()&&(!t.includes("{")&&!t.includes("}")||"{delete}"===t||"{backspace}"===t||"{bksp}"===t||"{space}"===t||"{tab}"===t)||"{arrowright}"===t||"{arrowleft}"===t||"{arrowup}"===t||"{arrowdown}"===t)&&(n.options.debug&&console.log("Button held:",t),n.handleButtonHold(t)),clearTimeout(n.holdTimeout)}),500))}},{key:"handleButtonMouseUp",value:function(t,e){var n=this;e&&(this.options.preventMouseUpDefault&&e.preventDefault&&e.preventDefault(),this.options.stopMouseUpPropagation&&e.stopPropagation&&e.stopPropagation(),!(e.target===this.keyboardDOM||e.target&&this.keyboardDOM.contains(e.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(e.target===this.candidateBox.candidateBoxElement||e.target&&this.candidateBox.candidateBoxElement.contains(e.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons((function(t){t.classList.remove(n.activeButtonClass)})),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),t&&"function"==typeof this.options.onKeyReleased&&this.options.onKeyReleased(t,e)}},{key:"handleKeyboardContainerMouseDown",value:function(t){this.options.preventMouseDownDefault&&t.preventDefault()}},{key:"handleButtonHold",value:function(t){var e=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout((function(){e.getMouseHold()?(e.handleButtonClicked(t),e.handleButtonHold(t)):clearTimeout(e.holdInteractionTimeout)}),100)}},{key:"syncInstanceInputs",value:function(){var t=this;this.dispatch((function(e){e.replaceInput(t.input),e.setCaretPosition(t.caretPosition,t.caretPositionEnd)}))}},{key:"clearInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName;this.input[t]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.options.syncInstanceInputs&&!e&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[t].replace("‫","").replace("‬","")+"‬":this.input[t]}},{key:"getAllInputs",value:function(){var t=this,e={};return Object.keys(this.input).forEach((function(n){e[n]=t.getInput(n,!0)})),e}},{key:"setInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.inputName||this.defaultName,n=arguments.length>2?arguments[2]:void 0;this.input[e]=t,!n&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(t){this.input=t}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.changedOptions(t);this.options=Object.assign(this.options,t),e.length&&(this.options.debug&&console.log("changedOptions",e),this.onSetOptions(e),this.render())}},{key:"changedOptions",value:function(t){var e=this;return Object.keys(t).filter((function(n){return JSON.stringify(t[n])!==JSON.stringify(e.options[n])}))}},{key:"onSetOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(t.includes("layoutCandidatesPageSize")||t.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new w({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(t){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach((function(e){t(window.SimpleKeyboardInstances[e],e)}))}},{key:"addButtonTheme",value:function(t,e){var n=this;e&&t&&(t.split(" ").forEach((function(i){e.split(" ").forEach((function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);var o=!1;n.options.buttonTheme.map((function(t){if(null!=t&&t.class.split(" ").includes(e)){o=!0;var n=t.buttons.split(" ");n.includes(i)||(o=!0,n.push(i),t.buttons=n.join(" "))}return t})),o||n.options.buttonTheme.push({class:e,buttons:t})}))})),this.render())}},{key:"removeButtonTheme",value:function(t,e){var n=this;if(!t&&!e)return this.options.buttonTheme=[],void this.render();t&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(t.split(" ").forEach((function(t){var i,o;null===(i=n.options)||void 0===i||null===(o=i.buttonTheme)||void 0===o||o.map((function(i,o){if(i&&e&&e.includes(i.class)||!e){var s,a,r=null===(s=i)||void 0===s?void 0:s.buttons.split(" ").filter((function(e){return e!==t}));i&&null!=r&&r.length?i.buttons=r.join(" "):(null===(a=n.options.buttonTheme)||void 0===a||a.splice(o,1),i=null)}return i}))})),this.render())}},{key:"getButtonElement",value:function(t){var e,n=this.buttonElements[t];return n&&(e=n.length>1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName||this.defaultName])&&t){var i=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(i?"passed":"did not pass!")),i}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.addEventListener("keyup",this.handleKeyUp,e),document.addEventListener("keydown",this.handleKeyDown,e),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"handleSelect",value:function(t){this.caretEventHandler(t)}},{key:"handleSelectionChange",value:function(t){navigator.userAgent.includes("Firefox")||this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e,n=this;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(i){var o=t.target===i.keyboardDOM||t.target&&i.keyboardDOM.contains(t.target);if(n.options.syncInstanceInputs&&Array.isArray(t.path)&&(o=t.path.some((function(t){var e;return null==t||null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-skInstance")}))),("textarea"===e||"input"===e&&["text","search","url","tel","password"].includes(t.target.type))&&!i.options.disableCaretPositioning){var s=t.target.selectionStart,a=t.target.selectionEnd;i.options.rtl&&(s=i.utilities.getRtlOffset(s,i.getInput()),a=i.utilities.getRtlOffset(a,i.getInput())),i.setCaretPosition(s,a),n.activeInputElement=t.target,i.options.debug&&console.log("Caret at: ",i.getCaretPosition(),i.getCaretPositionEnd(),t&&t.target.tagName.toLowerCase(),"(".concat(i.keyboardDOMClass,")"),null==t?void 0:t.type)}else!i.options.disableCaretPositioning&&o||"selectionchange"===(null==t?void 0:t.type)||(i.setCaretPosition(null),n.activeInputElement=null,i.options.debug&&console.log('Caret position reset due to "'.concat(null==t?void 0:t.type,'" event'),t))}))}},{key:"recurseButtons",value:function(t){var e=this;t&&Object.keys(this.buttonElements).forEach((function(n){return e.buttonElements[n].forEach(t)}))}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.removeEventListener("keyup",this.handleKeyUp,e),document.removeEventListener("keydown",this.handleKeyDown,e),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons((function(t){t&&(t.onpointerdown=null,t.onpointerup=null,t.onpointercancel=null,t.ontouchstart=null,t.ontouchend=null,t.ontouchcancel=null,t.onclick=null,t.onmousedown=null,t.onmouseup=null,t.remove(),t=null)})),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e&&e.class&&"string"==typeof e.class&&e.buttons&&"string"==typeof e.buttons){var i=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(E(n),E(i)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"==typeof n.attribute&&n.value&&"string"==typeof n.value&&n.buttons&&"string"==typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"==typeof this.options.onInit&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"==typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"==typeof this.options.beforeRender&&this.options.beforeRender(this)}},{key:"onRender",value:function(){"function"==typeof this.options.onRender&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){"function"==typeof this.options.onModulesLoaded&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e(t);n.init&&n.init(t)})),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,i){var o=this,s=Array.from(t.children),a=0;return s.length&&n.forEach((function(n,r){var u=i[r];if(!(u&&u>n))return!1;var l=n-a,c=u-a,d=document.createElement("div");d.className+="hg-button-container";var h="".concat(o.options.layoutName,"-r").concat(e,"c").concat(r);d.setAttribute("data-skUID",h);var p=s.splice(l,c-l+1);a=c-l,p.forEach((function(t){return d.appendChild(t)})),s.splice(l,0,d),t.innerHTML="",s.forEach((function(e){return t.appendChild(e)})),o.options.debug&&console.log("rowDOMContainer",p,l,c,a+1)})),t}},{key:"render",value:function(){var t=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},i=this.options.useTouchEvents||!1,o=i?"hg-touch-events":"",s=this.options.useMouseEvents||!1,a=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,e,this.keyboardPluginClasses,o),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",n[this.options.layoutName||this.defaultName].forEach((function(e,n){var o=e.split(" ");t.options.excludeFromLayout&&t.options.excludeFromLayout[t.options.layoutName||t.defaultName]&&(o=o.filter((function(e){return t.options.excludeFromLayout&&!t.options.excludeFromLayout[t.options.layoutName||t.defaultName].includes(e)})));var r=document.createElement("div");r.className+="hg-row";var u=[],l=[];o.forEach((function(e,o){var c,d=!a&&"string"==typeof e&&e.length>1&&0===e.indexOf("["),h=!a&&"string"==typeof e&&e.length>1&&e.indexOf("]")===e.length-1;d&&(u.push(o),e=e.replace(/\[/g,"")),h&&(l.push(o),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),f=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),y=t.options.useButtonTag?"button":"div",v=document.createElement(y);v.className+="hg-button ".concat(p),(c=v.classList).add.apply(c,E(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){v.setAttribute(t,e)})),t.activeButtonClass="hg-activeButton",!t.utilities.pointerEventsSupported()||i||s?i?(v.ontouchstart=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},v.ontouchend=function(n){t.handleButtonMouseUp(e,n)},v.ontouchcancel=function(n){t.handleButtonMouseUp(e,n)}):(v.onclick=function(n){t.setMouseHold(!1),"function"!=typeof t.options.onKeyReleased&&t.handleButtonClicked(e,n)},v.onmousedown=function(n){"function"!=typeof t.options.onKeyReleased||t.isMouseHold||t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},v.onmouseup=function(n){t.handleButtonMouseUp(e,n)}):(v.onpointerdown=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},v.onpointerup=function(n){t.handleButtonMouseUp(e,n)},v.onpointercancel=function(n){t.handleButtonMouseUp(e,n)}),v.setAttribute("data-skBtn",e);var g="".concat(t.options.layoutName,"-r").concat(n,"b").concat(o);v.setAttribute("data-skBtnUID",g);var m=document.createElement("span");m.innerHTML=f,v.appendChild(m),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(v),r.appendChild(v)})),r=t.parseRowDOMContainers(r,n,u,l),t.keyboardRowsDOM.appendChild(r)})),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||i||s?i?(document.ontouchend=function(e){return t.handleButtonMouseUp(void 0,e)},document.ontouchcancel=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):i||(document.onmouseup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}],n&&I(e.prototype,n),i&&I(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}(),B=D,A=B;return e}()})); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(this,(function(){return function(){"use strict";var t={d:function(e,n){for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{SimpleKeyboard:function(){return B},default:function(){return A}});function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n2&&void 0!==arguments[2]&&arguments[2]?Object.assign({},this.getDefaultDiplay(),e):e||this.getDefaultDiplay())[t]||t}},{key:"getUpdatedInput",value:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this.getOptions(),a=[n,o,i],r=e;return("{bksp}"===t||"{backspace}"===t)&&r.length>0?r=this.removeAt.apply(this,[r].concat(a)):("{delete}"===t||"{forwarddelete}"===t)&&r.length>0?r=this.removeForwardsAt.apply(this,[r].concat(a)):"{space}"===t?r=this.addStringAt.apply(this,[r," "].concat(a)):"{tab}"!==t||"boolean"==typeof s.tabCharOnTab&&!1===s.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!s.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?r=this.addStringAt.apply(this,[r,t[t.length-2]].concat(a)):"{numpaddivide}"===t?r=this.addStringAt.apply(this,[r,"/"].concat(a)):"{numpadmultiply}"===t?r=this.addStringAt.apply(this,[r,"*"].concat(a)):"{numpadsubtract}"===t?r=this.addStringAt.apply(this,[r,"-"].concat(a)):"{numpadadd}"===t?r=this.addStringAt.apply(this,[r,"+"].concat(a)):"{numpaddecimal}"===t?r=this.addStringAt.apply(this,[r,"."].concat(a)):"{"===t||"}"===t?r=this.addStringAt.apply(this,[r,t].concat(a)):t.includes("{")||t.includes("}")||(r=this.addStringAt.apply(this,[r,t].concat(a))):r=this.addStringAt.apply(this,[r,"\n"].concat(a)):r=this.addStringAt.apply(this,[r,"\t"].concat(a)),s.debug&&console.log("Input will be: "+r),r}},{key:"updateCaretPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.setCaretPosition(n)}))}},{key:"updateCaretPosAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOptions(),o=this.getCaretPosition();return null!=o&&(e?o>0&&(o-=t):o+=t),n.debug&&console.log("Caret at:",o),o}},{key:"addStringAt",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o||0===o?(n=[t.slice(0,o),e,t.slice(i)].join(""),this.isMaxLengthReached()||s&&this.updateCaretPos(e.length)):n=t+e,n}},{key:"removeAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===n&&0===o)return t;if(n===o){var s=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;n&&n>=0?t.substring(n-2,n).match(s)?(e=t.substr(0,n-2)+t.substr(n),i&&this.updateCaretPos(2,!0)):(e=t.substr(0,n-1)+t.substr(n),i&&this.updateCaretPos(1,!0)):t.slice(-2).match(s)?(e=t.slice(0,-2),i&&this.updateCaretPos(2,!0)):(e=t.slice(0,-1),i&&this.updateCaretPos(1,!0))}else e=t.slice(0,n)+t.slice(o),i&&this.dispatch((function(t){t.setCaretPosition(n)}));return e}},{key:"removeForwardsAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return null!=t&&t.length&&null!==n?(n===o?e=t.substring(n,n+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?t.substr(0,n)+t.substr(n+2):t.substr(0,n)+t.substr(n+1):(e=t.slice(0,n)+t.slice(o),i&&this.dispatch((function(t){t.setCaretPosition(n)}))),e):t}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,i=t[n.inputName||"default"],a=e.length-1>=o;if(e.length<=i.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===s(o)){var r=e.length-1>=o[n.inputName||"default"];return n.debug&&console.log("maxLength (obj) reached:",r),r?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(t){return t?t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t})):""}},{key:"chunkArray",value:function(t,e){return n(Array(Math.ceil(t.length/e))).map((function(n,o){return t.slice(e*o,e+e*o)}))}},{key:"escapeRegex",value:function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"getRtlOffset",value:function(t,e){var n=t,o=e.indexOf("‫");return o=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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 a,r=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return r=t.done,t},e:function(t){u=!0,a=t},f:function(){try{r||null==n.return||n.return()}finally{if(u)throw a}}}}(Object.getOwnPropertyNames(t.prototype));try{for(i.s();!(n=i.n()).done;){var s=n.value;"constructor"===s||"bindMethods"===s||(e[s]=e[s].bind(e))}}catch(t){i.e(t)}finally{i.f()}}}],i&&a(e.prototype,i),u&&a(e,u),Object.defineProperty(e,"prototype",{writable:!1}),t}();r(l,"noop",(function(){}));var c=l;function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){for(var n=0;n1?null===(e=n)||void 0===e?void 0:e.toLowerCase():n}},{key:"keyCodeToKey",value:function(t){return{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:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",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",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[t]||""}}])&&h(e.prototype,n),o&&h(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function g(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:i();return r(t,e)},u.appendChild(o)}));var l=s>0,c=document.createElement("div");c.classList.add("hg-candidate-box-prev"),l&&c.classList.add("hg-candidate-box-btn-active");var d=function(){l&&n.renderPage({candidateListPages:o,targetElement:i,pageIndex:s-1,nbPages:a,onItemSelected:r})};this.options.useTouchEvents?c.ontouchstart=d:c.onclick=d,this.candidateBoxElement.appendChild(c),this.candidateBoxElement.appendChild(u);var h=st.length)&&(e=t.length);for(var n=0,o=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:t;this.caretPosition=t,this.caretPositionEnd=e}},{key:"getInputCandidates",value:function(t){var e=this,n=this.options,o=n.layoutCandidates,i=n.layoutCandidatesCaseSensitiveMatch;if(!o||"object"!==P(o))return{};var s=Object.keys(o).filter((function(n){var o=t.substring(0,e.getCaretPositionEnd()||0)||t,s=new RegExp("".concat(e.utilities.escapeRegex(n),"$"),i?"g":"gi");return!!E(o.matchAll(s)).length}));if(s.length>1){var a=s.sort((function(t,e){return e.length-t.length}))[0];return{candidateKey:a,candidateValue:o[a]}}if(s.length){var r=s[0];return{candidateKey:r,candidateValue:o[r]}}return{}}},{key:"showCandidatesBox",value:function(t,e,n){var o=this;this.candidateBox&&this.candidateBox.show({candidateValue:e,targetElement:n,onSelect:function(e,n){var i=o.options,s=i.layoutCandidatesCaseSensitiveMatch,a=i.disableCandidateNormalization,r=i.enableLayoutCandidatesKeyPress,u=e;a||(u=e.normalize("NFD"));var l=o.getInput(o.options.inputName,!0),c=o.getCaretPositionEnd()||0,d=l.substring(0,c||0)||l,h=new RegExp("".concat(o.utilities.escapeRegex(t),"$"),s?"g":"gi"),p=d.replace(h,u),f=l.replace(d,p),y=p.length-d.length,v=(c||l.length)+y;v<0&&(v=0),o.setInput(f,o.options.inputName,!0),o.setCaretPosition(v),r&&"function"==typeof o.options.onKeyPress&&o.options.onKeyPress(e,n),"function"==typeof o.options.onChange&&o.options.onChange(o.getInput(o.options.inputName,!0),n),"function"==typeof o.options.onChangeAll&&o.options.onChangeAll(o.getAllInputs(),n)}})}},{key:"handleButtonClicked",value:function(t,e){var n=this.options,o=n.inputName,i=void 0===o?this.defaultName:o,s=n.debug;if("{//}"!==t){this.input[i]||(this.input[i]="");var a=this.utilities.getUpdatedInput(t,this.input[i],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(t)&&this.activeInputElement&&this.input[i]&&this.input[i]===a&&0===this.caretPosition&&this.caretPositionEnd===a.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(t,e);if("function"==typeof this.options.onKeyPress&&this.options.onKeyPress(t,e),this.input[i]!==a&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(a))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,a))return;var r=this.utilities.getUpdatedInput(t,this.input[i],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(r,this.options.inputName,!0),s&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),null==e?void 0:e.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),"function"==typeof this.options.onChange&&this.options.onChange(this.getInput(this.options.inputName,!0),e),"function"==typeof this.options.onChangeAll&&this.options.onChangeAll(this.getAllInputs(),e),null!=e&&e.target&&this.options.enableLayoutCandidates){var u,l=this.getInputCandidates(a),c=l.candidateKey,d=l.candidateValue;c&&d?this.showCandidatesBox(c,d,this.keyboardDOM):null===(u=this.candidateBox)||void 0===u||u.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),s&&console.log("Key pressed:",t)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(t){this.options.syncInstanceInputs?this.dispatch((function(e){e.isMouseHold=t})):this.isMouseHold=t}},{key:"handleButtonMouseDown",value:function(t,e){var n=this;e&&(this.options.preventMouseDownDefault&&e.preventDefault(),this.options.stopMouseDownPropagation&&e.stopPropagation(),e.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout((function(){(n.getMouseHold()&&(!t.includes("{")&&!t.includes("}")||"{delete}"===t||"{backspace}"===t||"{bksp}"===t||"{space}"===t||"{tab}"===t)||"{arrowright}"===t||"{arrowleft}"===t||"{arrowup}"===t||"{arrowdown}"===t)&&(n.options.debug&&console.log("Button held:",t),n.handleButtonHold(t)),clearTimeout(n.holdTimeout)}),500))}},{key:"handleButtonMouseUp",value:function(t,e){var n=this;e&&(this.options.preventMouseUpDefault&&e.preventDefault&&e.preventDefault(),this.options.stopMouseUpPropagation&&e.stopPropagation&&e.stopPropagation(),!(e.target===this.keyboardDOM||e.target&&this.keyboardDOM.contains(e.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(e.target===this.candidateBox.candidateBoxElement||e.target&&this.candidateBox.candidateBoxElement.contains(e.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons((function(t){t.classList.remove(n.activeButtonClass)})),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),t&&"function"==typeof this.options.onKeyReleased&&this.options.onKeyReleased(t,e)}},{key:"handleKeyboardContainerMouseDown",value:function(t){this.options.preventMouseDownDefault&&t.preventDefault()}},{key:"handleButtonHold",value:function(t){var e=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout((function(){e.getMouseHold()?(e.handleButtonClicked(t),e.handleButtonHold(t)):clearTimeout(e.holdInteractionTimeout)}),100)}},{key:"syncInstanceInputs",value:function(){var t=this;this.dispatch((function(e){e.replaceInput(t.input),e.setCaretPosition(t.caretPosition,t.caretPositionEnd)}))}},{key:"clearInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName;this.input[t]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.options.syncInstanceInputs&&!e&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[t].replace("‫","").replace("‬","")+"‬":this.input[t]}},{key:"getAllInputs",value:function(){var t=this,e={};return Object.keys(this.input).forEach((function(n){e[n]=t.getInput(n,!0)})),e}},{key:"setInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.inputName||this.defaultName,n=arguments.length>2?arguments[2]:void 0;this.input[e]=t,!n&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(t){this.input=t}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.changedOptions(t);this.options=Object.assign(this.options,t),e.length&&(this.options.debug&&console.log("changedOptions",e),this.onSetOptions(e),this.render())}},{key:"changedOptions",value:function(t){var e=this;return Object.keys(t).filter((function(n){return JSON.stringify(t[n])!==JSON.stringify(e.options[n])}))}},{key:"onSetOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(t.includes("layoutCandidatesPageSize")||t.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new w({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(t){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach((function(e){t(window.SimpleKeyboardInstances[e],e)}))}},{key:"addButtonTheme",value:function(t,e){var n=this;e&&t&&(t.split(" ").forEach((function(o){e.split(" ").forEach((function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);var i=!1;n.options.buttonTheme.map((function(t){if(null!=t&&t.class.split(" ").includes(e)){i=!0;var n=t.buttons.split(" ");n.includes(o)||(i=!0,n.push(o),t.buttons=n.join(" "))}return t})),i||n.options.buttonTheme.push({class:e,buttons:t})}))})),this.render())}},{key:"removeButtonTheme",value:function(t,e){var n=this;if(!t&&!e)return this.options.buttonTheme=[],void this.render();t&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(t.split(" ").forEach((function(t){var o,i;null===(o=n.options)||void 0===o||null===(i=o.buttonTheme)||void 0===i||i.map((function(o,i){if(o&&e&&e.includes(o.class)||!e){var s,a,r=null===(s=o)||void 0===s?void 0:s.buttons.split(" ").filter((function(e){return e!==t}));o&&null!=r&&r.length?o.buttons=r.join(" "):(null===(a=n.options.buttonTheme)||void 0===a||a.splice(i,1),o=null)}return o}))})),this.render())}},{key:"getButtonElement",value:function(t){var e,n=this.buttonElements[t];return n&&(e=n.length>1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName||this.defaultName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.addEventListener("keyup",this.handleKeyUp,e),document.addEventListener("keydown",this.handleKeyDown,e),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"handleSelect",value:function(t){this.caretEventHandler(t)}},{key:"handleSelectionChange",value:function(t){navigator.userAgent.includes("Firefox")||this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e,n=this;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(o){var i=t.target===o.keyboardDOM||t.target&&o.keyboardDOM.contains(t.target);if(n.options.syncInstanceInputs&&Array.isArray(t.path)&&(i=t.path.some((function(t){var e;return null==t||null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-skInstance")}))),("textarea"===e||"input"===e&&["text","search","url","tel","password"].includes(t.target.type))&&!o.options.disableCaretPositioning){var s=t.target.selectionStart,a=t.target.selectionEnd;o.options.rtl&&(s=o.utilities.getRtlOffset(s,o.getInput()),a=o.utilities.getRtlOffset(a,o.getInput())),o.setCaretPosition(s,a),n.activeInputElement=t.target,o.options.debug&&console.log("Caret at: ",o.getCaretPosition(),o.getCaretPositionEnd(),t&&t.target.tagName.toLowerCase(),"(".concat(o.keyboardDOMClass,")"),null==t?void 0:t.type)}else!o.options.disableCaretPositioning&&i||"selectionchange"===(null==t?void 0:t.type)||(o.setCaretPosition(null),n.activeInputElement=null,o.options.debug&&console.log('Caret position reset due to "'.concat(null==t?void 0:t.type,'" event'),t))}))}},{key:"recurseButtons",value:function(t){var e=this;t&&Object.keys(this.buttonElements).forEach((function(n){return e.buttonElements[n].forEach(t)}))}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var t=this.options.physicalKeyboardHighlightPreventDefault,e=void 0!==t&&t;document.removeEventListener("keyup",this.handleKeyUp,e),document.removeEventListener("keydown",this.handleKeyDown,e),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons((function(t){t&&(t.onpointerdown=null,t.onpointerup=null,t.onpointercancel=null,t.ontouchstart=null,t.ontouchend=null,t.ontouchcancel=null,t.onclick=null,t.onmousedown=null,t.onmouseup=null,t.remove(),t=null)})),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e&&e.class&&"string"==typeof e.class&&e.buttons&&"string"==typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(E(n),E(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"==typeof n.attribute&&n.value&&"string"==typeof n.value&&n.buttons&&"string"==typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"==typeof this.options.onInit&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"==typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"==typeof this.options.beforeRender&&this.options.beforeRender(this)}},{key:"onRender",value:function(){"function"==typeof this.options.onRender&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){"function"==typeof this.options.onModulesLoaded&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e(t);n.init&&n.init(t)})),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var i=this,s=Array.from(t.children),a=0;return s.length&&n.forEach((function(n,r){var u=o[r];if(!(u&&u>n))return!1;var l=n-a,c=u-a,d=document.createElement("div");d.className+="hg-button-container";var h="".concat(i.options.layoutName,"-r").concat(e,"c").concat(r);d.setAttribute("data-skUID",h);var p=s.splice(l,c-l+1);a=c-l,p.forEach((function(t){return d.appendChild(t)})),s.splice(l,0,d),t.innerHTML="",s.forEach((function(e){return t.appendChild(e)})),i.options.debug&&console.log("rowDOMContainer",p,l,c,a+1)})),t}},{key:"render",value:function(){var t=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},o=this.options.useTouchEvents||!1,i=o?"hg-touch-events":"",s=this.options.useMouseEvents||!1,a=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,e,this.keyboardPluginClasses,i),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",n[this.options.layoutName||this.defaultName].forEach((function(e,n){var i=e.split(" ");t.options.excludeFromLayout&&t.options.excludeFromLayout[t.options.layoutName||t.defaultName]&&(i=i.filter((function(e){return t.options.excludeFromLayout&&!t.options.excludeFromLayout[t.options.layoutName||t.defaultName].includes(e)})));var r=document.createElement("div");r.className+="hg-row";var u=[],l=[];i.forEach((function(e,i){var c,d=!a&&"string"==typeof e&&e.length>1&&0===e.indexOf("["),h=!a&&"string"==typeof e&&e.length>1&&e.indexOf("]")===e.length-1;d&&(u.push(i),e=e.replace(/\[/g,"")),h&&(l.push(i),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),f=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),y=t.options.useButtonTag?"button":"div",v=document.createElement(y);v.className+="hg-button ".concat(p),(c=v.classList).add.apply(c,E(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){v.setAttribute(t,e)})),t.activeButtonClass="hg-activeButton",!t.utilities.pointerEventsSupported()||o||s?o?(v.ontouchstart=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},v.ontouchend=function(n){t.handleButtonMouseUp(e,n)},v.ontouchcancel=function(n){t.handleButtonMouseUp(e,n)}):(v.onclick=function(n){t.setMouseHold(!1),"function"!=typeof t.options.onKeyReleased&&t.handleButtonClicked(e,n)},v.onmousedown=function(n){"function"!=typeof t.options.onKeyReleased||t.isMouseHold||t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},v.onmouseup=function(n){t.handleButtonMouseUp(e,n)}):(v.onpointerdown=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},v.onpointerup=function(n){t.handleButtonMouseUp(e,n)},v.onpointercancel=function(n){t.handleButtonMouseUp(e,n)}),v.setAttribute("data-skBtn",e);var g="".concat(t.options.layoutName,"-r").concat(n,"b").concat(i);v.setAttribute("data-skBtnUID",g);var m=document.createElement("span");m.innerHTML=f,v.appendChild(m),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(v),r.appendChild(v)})),r=t.parseRowDOMContainers(r,n,u,l),t.keyboardRowsDOM.appendChild(r)})),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||s?o?(document.ontouchend=function(e){return t.handleButtonMouseUp(void 0,e)},document.ontouchcancel=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}],n&&I(e.prototype,n),o&&I(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}(),B=D,A=B;return e}()})); //# sourceMappingURL=index.modern.js.map \ No newline at end of file diff --git a/build/index.modern.js.map b/build/index.modern.js.map index 0a6626fd..e7995b77 100644 --- a/build/index.modern.js.map +++ b/build/index.modern.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://SimpleKeyboard/webpack/universalModuleDefinition","webpack://SimpleKeyboard/webpack/bootstrap","webpack://SimpleKeyboard/webpack/runtime/define property getters","webpack://SimpleKeyboard/webpack/runtime/hasOwnProperty shorthand","webpack://SimpleKeyboard/webpack/runtime/make namespace object","webpack://SimpleKeyboard/./src/lib/services/Utilities.ts","webpack://SimpleKeyboard/./src/lib/services/PhysicalKeyboard.ts","webpack://SimpleKeyboard/./src/lib/components/CandidateBox.ts","webpack://SimpleKeyboard/./src/lib/components/Keyboard.ts","webpack://SimpleKeyboard/./src/lib/services/KeyboardLayout.ts","webpack://SimpleKeyboard/./src/lib/index.modern.ts"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Utilities","_ref","getOptions","getCaretPosition","getCaretPositionEnd","dispatch","_classCallCheck","_defineProperty","button","length","bindMethods","includes","buttonTypeClass","getButtonType","buttonWithoutBraces","replace","buttonNormalized","concat","display","arguments","undefined","assign","getDefaultDiplay","input","caretPos","caretPosEnd","moveCaret","options","commonParams","output","removeAt","apply","removeForwardsAt","addStringAt","tabCharOnTab","newLineOnEnter","Number","isInteger","debug","console","log","minus","newCaretPos","updateCaretPosAction","instance","setCaretPosition","caretPosition","source","str","position","positionEnd","slice","join","isMaxLengthReached","updateCaretPos","emojiMatchedReg","substring","match","substr","inputObj","updatedInput","maxLength","currentInput","inputName","condition","maxLengthReached","_typeof","Boolean","window","navigator","maxTouchPoints","PointerEvent","toLowerCase","trim","split","reduce","word","toUpperCase","arr","size","_toConsumableArray","Array","Math","ceil","map","_","i","index","newIndex","startMarkerIndex","indexOf","myClass","_step","_iterator","_createForOfIteratorHelper","getOwnPropertyNames","s","n","done","myMethod","bind","err","e","f","PhysicalKeyboard","_this","altKey","ctrlKey","shiftKey","code","keyCodeToKey","keyCode","physicalKeyboardHighlightPreventDefault","isMofifierKey","preventDefault","stopImmediatePropagation","buttonPressed","getSimpleKeyboardLayoutKey","buttonDOM","buttonName","standardButtonPressed","getButtonElement","functionButtonPressed","_buttonDOM$","applyButtonStyle","buttonElement","style","background","physicalKeyboardHighlightBgColor","color","physicalKeyboardHighlightTextColor","isArray","forEach","physicalKeyboardHighlightPress","physicalKeyboardHighlightPressUsePointerEvents","onpointerdown","physicalKeyboardHighlightPressUseClick","_buttonDOM$2","click","handleButtonClicked","_buttonDOM$3","removeAttribute","onpointerup","_output","keyId","CandidateBox","utilities","pageSize","layoutCandidatesPageSize","candidateBoxElement","remove","pageIndex","_ref2","candidateValue","targetElement","onSelect","candidateListPages","chunkArray","renderPage","nbPages","onItemSelected","selectedCandidate","destroy","_ref3","_this$candidateBoxEle","_this2","document","createElement","className","candidateListULElement","candidateListItem","_this2$options$displa","candidateListLIElement","getMouseEvent","mouseEvent","MouseEvent","innerHTML","onclick","appendChild","isPrevBtnElementActive","prevBtnElement","classList","add","isNextBtnElementActive","nextBtnElement","prepend","SimpleKeyboard","selectorOrOptions","keyboardOptions","keyboardDOMClass","keyboardDOM","querySelector","HTMLDivElement","warn","Error","caretPositionEnd","name","initCallback","modules","_len","baseDOMClasses","_key","filter","DOMClass","_this$handleParams","handleParams","_this$handleParams$op","_objectSpread","layoutName","theme","preventMouseDownDefault","enableLayoutCandidates","excludeFromLayout","keyboardPluginClasses","_this$options$inputNa","defaultName","buttonElements","currentInstanceName","camelCase","allKeyboardInstances","keyboardInstanceNames","keys","isFirstKeyboardInstance","physicalKeyboard","candidateBox","render","loadModules","endPosition","_this$options","layoutCandidatesObj","layoutCandidates","layoutCandidatesCaseSensitiveMatch","layoutCandidate","inputSubstr","regexp","RegExp","escapeRegex","matchAll","candidateKey","sort","a","b","_this3","show","_this3$options","disableCandidateNormalization","enableLayoutCandidatesKeyPress","candidateStr","normalize","getInput","initialCaretPosition","newInputSubstr","newInput","caretPositionDiff","newCaretPosition","setInput","onKeyPress","onChange","onChangeAll","getAllInputs","_this$options2","_this$options2$inputN","getUpdatedInput","isStandardButton","activeInputElement","setSelectionRange","inputPattern","inputPatternIsValid","handleMaxLength","newInputValue","type","syncInstanceInputs","target","_this$candidateBox","_this$getInputCandida","getInputCandidates","showCandidatesBox","isMouseHold","_this4","stopMouseDownPropagation","stopPropagation","activeButtonClass","holdInteractionTimeout","clearTimeout","holdTimeout","setMouseHold","disableButtonHold","setTimeout","getMouseHold","handleButtonHold","_this5","preventMouseUpDefault","stopMouseUpPropagation","contains","recurseButtons","onKeyReleased","_this6","_this7","replaceInput","skipSync","rtl","_this8","changedOptions","onSetOptions","newOptions","_this9","optionName","JSON","stringify","keyboardRowsDOM","setAttribute","callback","buttons","_this10","classNameItem","buttonTheme","classNameFound","buttonThemeArray","push","class","_this11","_this11$options","_this11$options$butto","_buttonTheme","_this11$options$butto2","filteredButtonArray","item","splice","buttonArr","inputVal","inputPatternRaw","didInputMatch","test","_this$options$physica","addEventListener","handleKeyUp","handleKeyDown","handleMouseUp","handleTouchEnd","handleSelectionChange","handleSelect","event","caretEventHandler","physicalKeyboardHighlight","handleHighlightKeyUp","handleHighlightKeyDown","userAgent","targetTagName","_this12","tagName","isKeyboard","path","some","_item$hasAttribute","hasAttribute","disableCaretPositioning","selectionStart","selectionEnd","getRtlOffset","fn","_this13","_this$options$physica2","removeEventListener","ontouchend","ontouchcancel","onmouseup","onpointercancel","ontouchstart","onmousedown","resetRows","initialized","buttonClasses","themeObj","themeObjClasses","buttonAttributes","attrObj","attribute","processAutoTouchEvents","disableContextualWindow","oncontextmenu","autoUseTouchEvents","useTouchEvents","setEventListeners","onInit","isTouchDevice","onTouchDeviceDetected","beforeFirstRender","pointerEventsSupported","useMouseEvents","beforeRender","onRender","onModulesLoaded","_this14","KeyboardModule","keyboardModule","init","rowDOM","rowIndex","containerStartIndexes","containerEndIndexes","_this15","rowDOMArray","from","children","removedElements","startIndex","arrIndex","endIndex","updated_startIndex","updated_endIndex","containerDOM","containerUID","containedElements","element","_this16","layoutClass","layout","default","shift","useTouchEventsClass","disableRowButtonContainers","getKeyboardClassString","row","rIndex","rowArray","bIndex","_buttonDOM$classList","buttonHasContainerStart","buttonHasContainerEnd","fctBtnClass","getButtonClass","buttonDisplayName","getButtonDisplayName","mergeDisplay","buttonType","useButtonTag","getButtonThemeClasses","setDOMButtonAttributes","handleButtonMouseDown","handleButtonMouseUp","buttonUID","buttonSpanDOM","parseRowDOMContainers","handleKeyboardContainerMouseDown"],"mappings":";;;;;;;;;;;;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,MAAM,WACT,O,wBCTA,IAAIC,EAAsB,CCA1BA,EAAwB,SAASL,EAASM,GACzC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAF,EAAwB,SAASQ,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECCtGT,EAAwB,SAASL,GACX,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GACvD,G,0pDCHA,IAGMC,EAAS,WAUb,SAAAA,EAAAC,GAKoB,IAJlBC,EAAUD,EAAVC,WACAC,EAAgBF,EAAhBE,iBACAC,EAAmBH,EAAnBG,oBACAC,EAAQJ,EAARI,U,4FAAQC,CAAA,KAAAN,GAAAO,E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xM,GAKjCsR,EAAO1N,YAAY5D,EACrB,IAKAsR,EAASkB,EAAK4B,sBACZ9C,EACA2B,EACAzB,EACAC,GAMFe,EAAKzG,gBAAgBnI,YAAY0N,EACnC,IAMF7Z,KAAK+M,YAAYZ,YAAYnM,KAAKsU,iBAKlCtU,KAAKuZ,WAEAvZ,KAAKmY,cAIRnY,KAAKmY,aAAc,GAOjBnY,KAAKmK,UAAUiP,0BACdN,GACAO,EAMQP,GAITvN,SAASqM,WAAa,SAACrQ,GAAuB,OAC5CwT,EAAKyB,yBAAoBna,EAAWkF,EAAE,EACxCgE,SAASsM,cAAgB,SAACtQ,GAAuB,OAC/CwT,EAAKyB,yBAAoBna,EAAWkF,EAAE,EAExCvH,KAAK+M,YAAYiL,aAAe,SAACzQ,GAAuB,OACtDwT,EAAK6B,iCAAiCrV,EAAE,GAChCuR,IAIVvN,SAASuM,UAAY,SAACvQ,GAAuB,OAC3CwT,EAAKyB,yBAAoBna,EAAWkF,EAAE,EACxCvH,KAAK+M,YAAYkL,YAAc,SAAC1Q,GAAuB,OACrDwT,EAAK6B,iCAAiCrV,EAAE,IAtB1CgE,SAASxB,YAAc,SAACxC,GAAuB,OAC7CwT,EAAKyB,yBAAoBna,EAAWkF,EAAE,EACxCvH,KAAK+M,YAAYvD,cAAgB,SAACjC,GAAuB,OACvDwT,EAAK6B,iCAAiCrV,EAAE,GAyB5CvH,KAAKgZ,SAET,I,iFAACrM,CAAA,CA5+DiB,GA++DpB,IEngEA,I","file":"index.modern.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SimpleKeyboard\"] = factory();\n\telse\n\t\troot[\"SimpleKeyboard\"] = factory();\n})(this, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { KeyboardInput } from \"./../interfaces\";\nimport { KeyboardOptions, UtilitiesParams } from \"../interfaces\";\n\n/**\n * Utility Service\n */\nclass Utilities {\n getOptions: () => KeyboardOptions;\n getCaretPosition: () => number | null;\n getCaretPositionEnd: () => number | null;\n dispatch: any;\n maxLengthReached!: boolean;\n\n /**\n * Creates an instance of the Utility service\n */\n constructor({\n getOptions,\n getCaretPosition,\n getCaretPositionEnd,\n dispatch,\n }: UtilitiesParams) {\n this.getOptions = getOptions;\n this.getCaretPosition = getCaretPosition;\n this.getCaretPositionEnd = getCaretPositionEnd;\n this.dispatch = dispatch;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(Utilities, this);\n }\n\n /**\n * Retrieve button type\n *\n * @param {string} button The button's layout name\n * @return {string} The button type\n */\n getButtonType(button: string): string {\n return button.includes(\"{\") && button.includes(\"}\") && button !== \"{//}\"\n ? \"functionBtn\"\n : \"standardBtn\";\n }\n\n /**\n * Adds default classes to a given button\n *\n * @param {string} button The button's layout name\n * @return {string} The classes to be added to the button\n */\n getButtonClass(button: string): string {\n const buttonTypeClass = this.getButtonType(button);\n const buttonWithoutBraces = button.replace(\"{\", \"\").replace(\"}\", \"\");\n let buttonNormalized = \"\";\n\n if (buttonTypeClass !== \"standardBtn\")\n buttonNormalized = ` hg-button-${buttonWithoutBraces}`;\n\n return `hg-${buttonTypeClass}${buttonNormalized}`;\n }\n\n /**\n * Default button display labels\n */\n getDefaultDiplay() {\n return {\n \"{bksp}\": \"backspace\",\n \"{backspace}\": \"backspace\",\n \"{enter}\": \"< enter\",\n \"{shift}\": \"shift\",\n \"{shiftleft}\": \"shift\",\n \"{shiftright}\": \"shift\",\n \"{alt}\": \"alt\",\n \"{s}\": \"shift\",\n \"{tab}\": \"tab\",\n \"{lock}\": \"caps\",\n \"{capslock}\": \"caps\",\n \"{accept}\": \"Submit\",\n \"{space}\": \" \",\n \"{//}\": \" \",\n \"{esc}\": \"esc\",\n \"{escape}\": \"esc\",\n \"{f1}\": \"f1\",\n \"{f2}\": \"f2\",\n \"{f3}\": \"f3\",\n \"{f4}\": \"f4\",\n \"{f5}\": \"f5\",\n \"{f6}\": \"f6\",\n \"{f7}\": \"f7\",\n \"{f8}\": \"f8\",\n \"{f9}\": \"f9\",\n \"{f10}\": \"f10\",\n \"{f11}\": \"f11\",\n \"{f12}\": \"f12\",\n \"{numpaddivide}\": \"/\",\n \"{numlock}\": \"lock\",\n \"{arrowup}\": \"↑\",\n \"{arrowleft}\": \"←\",\n \"{arrowdown}\": \"↓\",\n \"{arrowright}\": \"→\",\n \"{prtscr}\": \"print\",\n \"{scrolllock}\": \"scroll\",\n \"{pause}\": \"pause\",\n \"{insert}\": \"ins\",\n \"{home}\": \"home\",\n \"{pageup}\": \"up\",\n \"{delete}\": \"del\",\n \"{forwarddelete}\": \"del\",\n \"{end}\": \"end\",\n \"{pagedown}\": \"down\",\n \"{numpadmultiply}\": \"*\",\n \"{numpadsubtract}\": \"-\",\n \"{numpadadd}\": \"+\",\n \"{numpadenter}\": \"enter\",\n \"{period}\": \".\",\n \"{numpaddecimal}\": \".\",\n \"{numpad0}\": \"0\",\n \"{numpad1}\": \"1\",\n \"{numpad2}\": \"2\",\n \"{numpad3}\": \"3\",\n \"{numpad4}\": \"4\",\n \"{numpad5}\": \"5\",\n \"{numpad6}\": \"6\",\n \"{numpad7}\": \"7\",\n \"{numpad8}\": \"8\",\n \"{numpad9}\": \"9\",\n };\n }\n /**\n * Returns the display (label) name for a given button\n *\n * @param {string} button The button's layout name\n * @param {object} display The provided display option\n * @param {boolean} mergeDisplay Whether the provided param value should be merged with the default one.\n */\n getButtonDisplayName(\n button: string,\n display: KeyboardOptions[\"display\"],\n mergeDisplay = false\n ) {\n if (mergeDisplay) {\n display = Object.assign({}, this.getDefaultDiplay(), display);\n } else {\n display = display || this.getDefaultDiplay();\n }\n\n return display[button] || button;\n }\n\n /**\n * Returns the updated input resulting from clicking a given button\n *\n * @param {string} button The button's layout name\n * @param {string} input The input string\n * @param {number} caretPos The cursor's current position\n * @param {number} caretPosEnd The cursor's current end position\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n getUpdatedInput(\n button: string,\n input: string,\n caretPos: any,\n caretPosEnd = caretPos,\n moveCaret = false\n ) {\n const options = this.getOptions();\n const commonParams: [number | undefined, number | undefined, boolean] = [\n caretPos,\n caretPosEnd,\n moveCaret,\n ];\n\n let output = input;\n\n if (\n (button === \"{bksp}\" || button === \"{backspace}\") &&\n output.length > 0\n ) {\n output = this.removeAt(output, ...commonParams);\n } else if (\n (button === \"{delete}\" || button === \"{forwarddelete}\") &&\n output.length > 0\n ) {\n output = this.removeForwardsAt(output, ...commonParams);\n } else if (button === \"{space}\")\n output = this.addStringAt(output, \" \", ...commonParams);\n else if (\n button === \"{tab}\" &&\n !(\n typeof options.tabCharOnTab === \"boolean\" &&\n options.tabCharOnTab === false\n )\n ) {\n output = this.addStringAt(output, \"\\t\", ...commonParams);\n } else if (\n (button === \"{enter}\" || button === \"{numpadenter}\") &&\n options.newLineOnEnter\n )\n output = this.addStringAt(output, \"\\n\", ...commonParams);\n else if (\n button.includes(\"numpad\") &&\n Number.isInteger(Number(button[button.length - 2]))\n ) {\n output = this.addStringAt(\n output,\n button[button.length - 2],\n ...commonParams\n );\n } else if (button === \"{numpaddivide}\")\n output = this.addStringAt(output, \"/\", ...commonParams);\n else if (button === \"{numpadmultiply}\")\n output = this.addStringAt(output, \"*\", ...commonParams);\n else if (button === \"{numpadsubtract}\")\n output = this.addStringAt(output, \"-\", ...commonParams);\n else if (button === \"{numpadadd}\")\n output = this.addStringAt(output, \"+\", ...commonParams);\n else if (button === \"{numpaddecimal}\")\n output = this.addStringAt(output, \".\", ...commonParams);\n else if (button === \"{\" || button === \"}\")\n output = this.addStringAt(output, button, ...commonParams);\n else if (!button.includes(\"{\") && !button.includes(\"}\"))\n output = this.addStringAt(output, button, ...commonParams);\n\n if(options.debug){\n console.log(\"Input will be: \"+ output);\n }\n\n return output;\n }\n\n /**\n * Moves the cursor position by a given amount\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPos(length: number, minus = false) {\n const newCaretPos = this.updateCaretPosAction(length, minus);\n\n this.dispatch((instance: any) => {\n instance.setCaretPosition(newCaretPos);\n });\n }\n\n /**\n * Action method of updateCaretPos\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPosAction(length: number, minus = false) {\n const options = this.getOptions();\n let caretPosition = this.getCaretPosition();\n\n if (caretPosition != null) {\n if (minus) {\n if (caretPosition > 0) caretPosition = caretPosition - length;\n } else {\n caretPosition = caretPosition + length;\n }\n }\n\n if (options.debug) {\n console.log(\"Caret at:\", caretPosition);\n }\n\n return caretPosition;\n }\n\n /**\n * Adds a string to the input at a given position\n *\n * @param {string} source The source input\n * @param {string} str The string to add\n * @param {number} position The (cursor) position where the string should be added\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n addStringAt(\n source: string,\n str: string,\n position = source.length,\n positionEnd = source.length,\n moveCaret = false\n ) {\n let output;\n\n if (!position && position !== 0) {\n output = source + str;\n } else {\n output = [source.slice(0, position), str, source.slice(positionEnd)].join(\n \"\"\n );\n\n /**\n * Avoid caret position change when maxLength is set\n */\n if (!this.isMaxLengthReached()) {\n if (moveCaret) this.updateCaretPos(str.length);\n }\n }\n\n return output;\n }\n\n /**\n * Check whether the button is a standard button\n */\n isStandardButton = (button: string) =>\n button && !(button[0] === \"{\" && button[button.length - 1] === \"}\");\n\n /**\n * Removes an amount of characters before a given position\n *\n * @param {string} source The source input\n * @param {number} position The (cursor) position from where the characters should be removed\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n removeAt(\n source: string,\n position = source.length,\n positionEnd = source.length,\n moveCaret = false\n ) {\n if (position === 0 && positionEnd === 0) {\n return source;\n }\n\n let output;\n\n if (position === positionEnd) {\n let prevTwoChars;\n let emojiMatched;\n const emojiMatchedReg = /([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n\n /**\n * Emojis are made out of two characters, so we must take a custom approach to trim them.\n * For more info: https://mathiasbynens.be/notes/javascript-unicode\n */\n if (position && position >= 0) {\n prevTwoChars = source.substring(position - 2, position);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.substr(0, position - 2) + source.substr(position);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.substr(0, position - 1) + source.substr(position);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n } else {\n prevTwoChars = source.slice(-2);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.slice(0, -2);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.slice(0, -1);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n }\n } else {\n output = source.slice(0, position) + source.slice(positionEnd);\n if (moveCaret) {\n this.dispatch((instance: any) => {\n instance.setCaretPosition(position);\n });\n }\n }\n\n return output;\n }\n\n /**\n * Removes an amount of characters after a given position\n *\n * @param {string} source The source input\n * @param {number} position The (cursor) position from where the characters should be removed\n */\n removeForwardsAt(\n source: string,\n position: number = source.length,\n positionEnd: number = source.length,\n moveCaret = false\n ) {\n if (!source?.length || position === null) {\n return source;\n }\n\n let output;\n\n if (position === positionEnd) {\n const emojiMatchedReg = /([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n\n /**\n * Emojis are made out of two characters, so we must take a custom approach to trim them.\n * For more info: https://mathiasbynens.be/notes/javascript-unicode\n */\n const nextTwoChars = source.substring(position, position + 2);\n const emojiMatched = nextTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.substr(0, position) + source.substr(position + 2);\n } else {\n output = source.substr(0, position) + source.substr(position + 1);\n }\n } else {\n output = source.slice(0, position) + source.slice(positionEnd);\n if (moveCaret) {\n this.dispatch((instance: any) => {\n instance.setCaretPosition(position);\n });\n }\n }\n\n return output;\n }\n\n /**\n * Determines whether the maxLength has been reached. This function is called when the maxLength option it set.\n *\n * @param {object} inputObj\n * @param {string} updatedInput\n */\n handleMaxLength(inputObj: KeyboardInput, updatedInput: string) {\n const options = this.getOptions();\n const maxLength = options.maxLength;\n const currentInput = inputObj[options.inputName || \"default\"];\n const condition = updatedInput.length - 1 >= maxLength;\n\n if (\n /**\n * If pressing this button won't add more characters\n * We exit out of this limiter function\n */\n updatedInput.length <= currentInput.length\n ) {\n return false;\n }\n\n if (Number.isInteger(maxLength)) {\n if (options.debug) {\n console.log(\"maxLength (num) reached:\", condition);\n }\n\n if (condition) {\n /**\n * @type {boolean} Boolean value that shows whether maxLength has been reached\n */\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n\n if (typeof maxLength === \"object\") {\n const condition =\n updatedInput.length - 1 >= maxLength[options.inputName || \"default\"];\n\n if (options.debug) {\n console.log(\"maxLength (obj) reached:\", condition);\n }\n\n if (condition) {\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n }\n\n /**\n * Gets the current value of maxLengthReached\n */\n isMaxLengthReached() {\n return Boolean(this.maxLengthReached);\n }\n\n /**\n * Determines whether a touch device is being used\n */\n isTouchDevice() {\n return \"ontouchstart\" in window || navigator.maxTouchPoints;\n }\n\n /**\n * Determines whether pointer events are supported\n */\n pointerEventsSupported() {\n return !!window.PointerEvent;\n }\n\n /**\n * Bind all methods in a given class\n */\n\n static bindMethods(myClass: any, instance: any) {\n // eslint-disable-next-line no-unused-vars\n for (const myMethod of Object.getOwnPropertyNames(myClass.prototype)) {\n const excludeMethod =\n myMethod === \"constructor\" || myMethod === \"bindMethods\";\n if (!excludeMethod) {\n instance[myMethod] = instance[myMethod].bind(instance);\n }\n }\n }\n\n /**\n * Transforms an arbitrary string to camelCase\n *\n * @param {string} str The string to transform.\n */\n camelCase(str: string): string {\n if (!str) return \"\";\n\n return str\n .toLowerCase()\n .trim()\n .split(/[.\\-_\\s]/g)\n .reduce((str, word) =>\n word.length ? str + word[0].toUpperCase() + word.slice(1) : str\n );\n }\n\n /**\n * Split array into chunks\n */\n chunkArray(arr: T[], size: number): T[][] {\n return [...Array(Math.ceil(arr.length / size))].map((_, i) =>\n arr.slice(size * i, size + size * i)\n );\n }\n\n /**\n * Escape regex input\n */\n escapeRegex(str: string) {\n return str.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n }\n\n /**\n * Calculate caret position offset when using rtl option\n */\n getRtlOffset(index: number, input: string) {\n let newIndex = index;\n const startMarkerIndex = input.indexOf(\"\\u202B\");\n const endMarkerIndex = input.indexOf(\"\\u202C\");\n\n if(startMarkerIndex < index && startMarkerIndex != -1){ newIndex--; }\n if(endMarkerIndex < index && startMarkerIndex != -1){ newIndex--; }\n\n return newIndex < 0 ? 0 : newIndex;\n }\n\n /**\n * Reusable empty function\n */\n static noop = () => {};\n}\n\nexport default Utilities;\n","import { KeyboardOptions, PhysicalKeyboardParams } from \"../interfaces\";\nimport Utilities from \"../services/Utilities\";\n\n/**\n * Physical Keyboard Service\n */\nclass PhysicalKeyboard {\n getOptions: () => KeyboardOptions;\n dispatch: any;\n\n /**\n * Creates an instance of the PhysicalKeyboard service\n */\n constructor({ dispatch, getOptions }: PhysicalKeyboardParams) {\n /**\n * @type {object} A simple-keyboard instance\n */\n this.dispatch = dispatch;\n this.getOptions = getOptions;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(PhysicalKeyboard, this);\n }\n\n handleHighlightKeyDown(e: KeyboardEvent) {\n const options = this.getOptions();\n\n if(options.physicalKeyboardHighlightPreventDefault && this.isMofifierKey(e)){\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n\n const buttonPressed = this.getSimpleKeyboardLayoutKey(e);\n\n this.dispatch((instance: any) => {\n const standardButtonPressed = instance.getButtonElement(buttonPressed);\n const functionButtonPressed = instance.getButtonElement(\n `{${buttonPressed}}`\n );\n let buttonDOM;\n let buttonName: string;\n\n if (standardButtonPressed) {\n buttonDOM = standardButtonPressed;\n buttonName = buttonPressed;\n } else if (functionButtonPressed) {\n buttonDOM = functionButtonPressed;\n buttonName = `{${buttonPressed}}`;\n } else {\n return;\n }\n\n const applyButtonStyle = (buttonElement: HTMLElement) => {\n buttonElement.style.background =\n options.physicalKeyboardHighlightBgColor || \"#dadce4\";\n buttonElement.style.color =\n options.physicalKeyboardHighlightTextColor || \"black\";\n }\n\n if (buttonDOM) {\n if(Array.isArray(buttonDOM)){\n buttonDOM.forEach(buttonElement => applyButtonStyle(buttonElement));\n\n // Even though we have an array of buttons, we just want to press one of them\n if (options.physicalKeyboardHighlightPress) {\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM[0]?.onpointerdown();\n } else if (options.physicalKeyboardHighlightPressUseClick) {\n buttonDOM[0]?.click();\n } else {\n instance.handleButtonClicked(buttonName, e);\n }\n }\n } else {\n applyButtonStyle(buttonDOM);\n\n if (options.physicalKeyboardHighlightPress) {\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM.onpointerdown();\n } else if (options.physicalKeyboardHighlightPressUseClick) {\n buttonDOM.click();\n } else {\n instance.handleButtonClicked(buttonName, e);\n }\n }\n }\n }\n });\n }\n\n handleHighlightKeyUp(e: KeyboardEvent) {\n const options = this.getOptions();\n\n if(options.physicalKeyboardHighlightPreventDefault && this.isMofifierKey(e)){\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n \n const buttonPressed = this.getSimpleKeyboardLayoutKey(e);\n\n this.dispatch((instance: any) => {\n const buttonDOM =\n instance.getButtonElement(buttonPressed) ||\n instance.getButtonElement(`{${buttonPressed}}`);\n\n const applyButtonStyle = (buttonElement: HTMLElement) => {\n if(buttonElement.removeAttribute){\n buttonElement.removeAttribute(\"style\");\n }\n };\n\n if (buttonDOM) {\n if(Array.isArray(buttonDOM)){\n buttonDOM.forEach(buttonElement => applyButtonStyle(buttonElement));\n\n // Even though we have an array of buttons, we just want to press one of them\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM[0]?.onpointerup();\n }\n } else {\n applyButtonStyle(buttonDOM);\n\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM.onpointerup();\n }\n }\n }\n });\n }\n\n /**\n * Transforms a KeyboardEvent's \"key.code\" string into a simple-keyboard layout format\n * @param {object} e The KeyboardEvent\n */\n getSimpleKeyboardLayoutKey(e: KeyboardEvent) {\n let output = \"\";\n const keyId = e.code || e.key || this.keyCodeToKey(e?.keyCode);\n\n if (\n keyId?.includes(\"Numpad\") ||\n keyId?.includes(\"Shift\") ||\n keyId?.includes(\"Space\") ||\n keyId?.includes(\"Backspace\") ||\n keyId?.includes(\"Control\") ||\n keyId?.includes(\"Alt\") ||\n keyId?.includes(\"Meta\")\n ) {\n output = e.code || \"\";\n } else {\n output = e.key || this.keyCodeToKey(e?.keyCode) || \"\";\n }\n\n return output.length > 1 ? output?.toLowerCase() : output;\n }\n\n /**\n * Retrieve key from keyCode\n */\n keyCodeToKey(keyCode: number): string {\n return {\n 8: \"Backspace\",\n 9: \"Tab\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Ctrl\",\n 18: \"Alt\",\n 19: \"Pause\",\n 20: \"CapsLock\",\n 27: \"Esc\",\n 32: \"Space\",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 45: \"Insert\",\n 46: \"Delete\",\n 48: \"0\",\n 49: \"1\",\n 50: \"2\",\n 51: \"3\",\n 52: \"4\",\n 53: \"5\",\n 54: \"6\",\n 55: \"7\",\n 56: \"8\",\n 57: \"9\",\n 65: \"A\",\n 66: \"B\",\n 67: \"C\",\n 68: \"D\",\n 69: \"E\",\n 70: \"F\",\n 71: \"G\",\n 72: \"H\",\n 73: \"I\",\n 74: \"J\",\n 75: \"K\",\n 76: \"L\",\n 77: \"M\",\n 78: \"N\",\n 79: \"O\",\n 80: \"P\",\n 81: \"Q\",\n 82: \"R\",\n 83: \"S\",\n 84: \"T\",\n 85: \"U\",\n 86: \"V\",\n 87: \"W\",\n 88: \"X\",\n 89: \"Y\",\n 90: \"Z\",\n 91: \"Meta\",\n 96: \"Numpad0\",\n 97: \"Numpad1\",\n 98: \"Numpad2\",\n 99: \"Numpad3\",\n 100: \"Numpad4\",\n 101: \"Numpad5\",\n 102: \"Numpad6\",\n 103: \"Numpad7\",\n 104: \"Numpad8\",\n 105: \"Numpad9\",\n 106: \"NumpadMultiply\",\n 107: \"NumpadAdd\",\n 109: \"NumpadSubtract\",\n 110: \"NumpadDecimal\",\n 111: \"NumpadDivide\",\n 112: \"F1\",\n 113: \"F2\",\n 114: \"F3\",\n 115: \"F4\",\n 116: \"F5\",\n 117: \"F6\",\n 118: \"F7\",\n 119: \"F8\",\n 120: \"F9\",\n 121: \"F10\",\n 122: \"F11\",\n 123: \"F12\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\",\n }[keyCode] || \"\";\n }\n\n isMofifierKey = (e: KeyboardEvent): boolean => {\n return (\n e.altKey\n || e.ctrlKey\n || e.shiftKey\n || [\"Tab\", \"CapsLock\", \"Esc\", \"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"].includes(\n e.code || e.key || this.keyCodeToKey(e?.keyCode)\n )\n )\n }\n}\n\nexport default PhysicalKeyboard;\n","import \"./css/CandidateBox.css\";\n\nimport Utilities from \"../services/Utilities\";\nimport {\n CandidateBoxParams,\n CandidateBoxRenderParams,\n CandidateBoxShowParams,\n KeyboardOptions,\n} from \"./../interfaces\";\n\nclass CandidateBox {\n utilities: Utilities;\n options: KeyboardOptions;\n candidateBoxElement!: HTMLDivElement;\n pageIndex = 0;\n pageSize;\n\n constructor({ utilities, options }: CandidateBoxParams) {\n this.utilities = utilities;\n this.options = options;\n Utilities.bindMethods(CandidateBox, this);\n this.pageSize = this.utilities.getOptions().layoutCandidatesPageSize || 5;\n }\n\n destroy() {\n if (this.candidateBoxElement) {\n this.candidateBoxElement.remove();\n this.pageIndex = 0;\n }\n }\n\n show({\n candidateValue,\n targetElement,\n onSelect,\n }: CandidateBoxShowParams): void {\n if (!candidateValue || !candidateValue.length) {\n return;\n }\n\n const candidateListPages = this.utilities.chunkArray(\n candidateValue.split(\" \"),\n this.pageSize\n );\n\n this.renderPage({\n candidateListPages,\n targetElement,\n pageIndex: this.pageIndex,\n nbPages: candidateListPages.length,\n onItemSelected: (selectedCandidate: string, e: MouseEvent) => {\n onSelect(selectedCandidate, e);\n this.destroy();\n },\n });\n }\n\n renderPage({\n candidateListPages,\n targetElement,\n pageIndex,\n nbPages,\n onItemSelected,\n }: CandidateBoxRenderParams) {\n // Remove current candidate box, if any\n this.candidateBoxElement?.remove();\n\n // Create candidate box element\n this.candidateBoxElement = document.createElement(\"div\");\n this.candidateBoxElement.className = \"hg-candidate-box\";\n\n // Candidate box list\n const candidateListULElement = document.createElement(\"ul\");\n candidateListULElement.className = \"hg-candidate-box-list\";\n\n // Create Candidate box list items\n candidateListPages[pageIndex].forEach((candidateListItem) => {\n const candidateListLIElement = document.createElement(\"li\");\n const getMouseEvent = () => {\n const mouseEvent = new MouseEvent(\"click\");\n Object.defineProperty(mouseEvent, \"target\", {\n value: candidateListLIElement,\n });\n return mouseEvent;\n };\n\n candidateListLIElement.className = \"hg-candidate-box-list-item\";\n candidateListLIElement.innerHTML = this.options.display?.[candidateListItem] || candidateListItem;\n candidateListLIElement.onclick = (e = getMouseEvent()) =>\n onItemSelected(candidateListItem, e);\n\n // Append list item to ul\n candidateListULElement.appendChild(candidateListLIElement);\n });\n\n // Add previous button\n const isPrevBtnElementActive = pageIndex > 0;\n const prevBtnElement = document.createElement(\"div\");\n prevBtnElement.classList.add(\"hg-candidate-box-prev\");\n isPrevBtnElementActive &&\n prevBtnElement.classList.add(\"hg-candidate-box-btn-active\");\n prevBtnElement.onclick = () => {\n if (!isPrevBtnElementActive) return;\n this.renderPage({\n candidateListPages,\n targetElement,\n pageIndex: pageIndex - 1,\n nbPages,\n onItemSelected,\n });\n };\n this.candidateBoxElement.appendChild(prevBtnElement);\n\n // Add elements to container\n this.candidateBoxElement.appendChild(candidateListULElement);\n\n // Add next button\n const isNextBtnElementActive = pageIndex < nbPages - 1;\n const nextBtnElement = document.createElement(\"div\");\n nextBtnElement.classList.add(\"hg-candidate-box-next\");\n isNextBtnElementActive &&\n nextBtnElement.classList.add(\"hg-candidate-box-btn-active\");\n\n nextBtnElement.onclick = () => {\n if (!isNextBtnElementActive) return;\n this.renderPage({\n candidateListPages,\n targetElement,\n pageIndex: pageIndex + 1,\n nbPages,\n onItemSelected,\n });\n };\n this.candidateBoxElement.appendChild(nextBtnElement);\n\n // Append candidate box to target element\n targetElement.prepend(this.candidateBoxElement);\n }\n}\n\nexport default CandidateBox;\n","import \"./css/Keyboard.css\";\n\n// Services\nimport { getDefaultLayout } from \"../services/KeyboardLayout\";\nimport PhysicalKeyboard from \"../services/PhysicalKeyboard\";\nimport Utilities from \"../services/Utilities\";\nimport {\n KeyboardOptions,\n KeyboardInput,\n KeyboardButtonElements,\n KeyboardHandlerEvent,\n KeyboardElement,\n} from \"../interfaces\";\nimport CandidateBox from \"./CandidateBox\";\n\n/**\n * Root class for simple-keyboard.\n * This class:\n * - Parses the options\n * - Renders the rows and buttons\n * - Handles button functionality\n */\nclass SimpleKeyboard {\n input!: KeyboardInput;\n options!: KeyboardOptions;\n utilities!: Utilities;\n caretPosition!: number | null;\n caretPositionEnd!: number | null;\n keyboardDOM!: KeyboardElement;\n keyboardPluginClasses!: string;\n keyboardDOMClass!: string;\n buttonElements!: KeyboardButtonElements;\n currentInstanceName!: string;\n allKeyboardInstances!: { [key: string]: SimpleKeyboard };\n keyboardInstanceNames!: string[];\n isFirstKeyboardInstance!: boolean;\n physicalKeyboard!: PhysicalKeyboard;\n modules!: { [key: string]: any };\n activeButtonClass!: string;\n holdInteractionTimeout!: number;\n holdTimeout!: number;\n isMouseHold!: boolean;\n initialized!: boolean;\n candidateBox!: CandidateBox | null;\n keyboardRowsDOM!: KeyboardElement;\n defaultName = \"default\";\n activeInputElement: HTMLInputElement | HTMLTextAreaElement | null = null;\n\n /**\n * Creates an instance of SimpleKeyboard\n * @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object.\n */\n constructor(\n selectorOrOptions?: string | HTMLDivElement | KeyboardOptions,\n keyboardOptions?: KeyboardOptions\n ) {\n if (typeof window === \"undefined\") return;\n\n const {\n keyboardDOMClass,\n keyboardDOM,\n options = {},\n } = this.handleParams(selectorOrOptions, keyboardOptions);\n\n /**\n * Initializing Utilities\n */\n this.utilities = new Utilities({\n getOptions: this.getOptions,\n getCaretPosition: this.getCaretPosition,\n getCaretPositionEnd: this.getCaretPositionEnd,\n dispatch: this.dispatch,\n });\n\n /**\n * Caret position\n */\n this.caretPosition = null;\n\n /**\n * Caret position end\n */\n this.caretPositionEnd = null;\n\n /**\n * Processing options\n */\n this.keyboardDOM = keyboardDOM;\n\n /**\n * @type {object}\n * @property {object} layout Modify the keyboard layout.\n * @property {string} layoutName Specifies which layout should be used.\n * @property {object} display Replaces variable buttons (such as {bksp}) with a human-friendly name (e.g.: “backspace”).\n * @property {boolean} mergeDisplay By default, when you set the display property, you replace the default one. This setting merges them instead.\n * @property {string} theme A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space.\n * @property {array} buttonTheme A prop to add your own css classes to one or several buttons.\n * @property {array} buttonAttributes A prop to add your own attributes to one or several buttons.\n * @property {boolean} debug Runs a console.log every time a key is pressed. Displays the buttons pressed and the current input.\n * @property {boolean} newLineOnEnter Specifies whether clicking the “ENTER” button will input a newline (\\n) or not.\n * @property {boolean} tabCharOnTab Specifies whether clicking the “TAB” button will input a tab character (\\t) or not.\n * @property {string} inputName Allows you to use a single simple-keyboard instance for several inputs.\n * @property {number} maxLength Restrains all of simple-keyboard inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {object} maxLength Restrains simple-keyboard’s individual inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {boolean} syncInstanceInputs When set to true, this option synchronizes the internal input of every simple-keyboard instance.\n * @property {boolean} physicalKeyboardHighlight Enable highlighting of keys pressed on physical keyboard.\n * @property {boolean} physicalKeyboardHighlightPress Presses keys highlighted by physicalKeyboardHighlight\n * @property {string} physicalKeyboardHighlightTextColor Define the text color that the physical keyboard highlighted key should have.\n * @property {string} physicalKeyboardHighlightBgColor Define the background color that the physical keyboard highlighted key should have.\n * @property {boolean} physicalKeyboardHighlightPressUseClick Whether physicalKeyboardHighlightPress should use clicks to trigger buttons.\n * @property {boolean} physicalKeyboardHighlightPressUsePointerEvents Whether physicalKeyboardHighlightPress should use pointer events to trigger buttons.\n * @property {boolean} physicalKeyboardHighlightPreventDefault Whether physicalKeyboardHighlight should use preventDefault to disable default browser actions.\n * @property {boolean} preventMouseDownDefault Calling preventDefault for the mousedown events keeps the focus on the input.\n * @property {boolean} preventMouseUpDefault Calling preventDefault for the mouseup events.\n * @property {boolean} stopMouseDownPropagation Stops pointer down events on simple-keyboard buttons from bubbling to parent elements.\n * @property {boolean} stopMouseUpPropagation Stops pointer up events on simple-keyboard buttons from bubbling to parent elements.\n * @property {function(button: string):string} onKeyPress Executes the callback function on key press. Returns button layout name (i.e.: “{shift}”).\n * @property {function(input: string):string} onChange Executes the callback function on input change. Returns the current input’s string.\n * @property {function} onRender Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n * @property {function} onInit Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n * @property {function(inputs: object):object} onChangeAll Executes the callback function on input change. Returns the input object with all defined inputs.\n * @property {boolean} useButtonTag Render buttons as a button element instead of a div element.\n * @property {boolean} disableCaretPositioning A prop to ensure characters are always be added/removed at the end of the string.\n * @property {object} inputPattern Restrains input(s) change to the defined regular expression pattern.\n * @property {boolean} useTouchEvents Instructs simple-keyboard to use touch events instead of click events.\n * @property {boolean} autoUseTouchEvents Enable useTouchEvents automatically when touch device is detected.\n * @property {boolean} useMouseEvents Opt out of PointerEvents handling, falling back to the prior mouse event logic.\n * @property {function} destroy Clears keyboard listeners and DOM elements.\n * @property {boolean} disableButtonHold Disable button hold action.\n * @property {boolean} rtl Adds unicode right-to-left control characters to input return values.\n * @property {function} onKeyReleased Executes the callback function on key release.\n * @property {array} modules Module classes to be loaded by simple-keyboard.\n * @property {boolean} enableLayoutCandidates Enable input method editor candidate list support.\n * @property {object} excludeFromLayout Buttons to exclude from layout\n * @property {number} layoutCandidatesPageSize Determines size of layout candidate list\n * @property {boolean} layoutCandidatesCaseSensitiveMatch Determines whether layout candidate match should be case sensitive.\n * @property {boolean} disableCandidateNormalization Disables the automatic normalization for selected layout candidates\n * @property {boolean} enableLayoutCandidatesKeyPress Enables onKeyPress triggering for layoutCandidate items\n */\n this.options = {\n layoutName: \"default\",\n theme: \"hg-theme-default\",\n inputName: \"default\",\n preventMouseDownDefault: false,\n enableLayoutCandidates: true,\n excludeFromLayout: {},\n ...options,\n };\n\n /**\n * @type {object} Classes identifying loaded plugins\n */\n this.keyboardPluginClasses = \"\";\n\n /**\n * Bindings\n */\n Utilities.bindMethods(SimpleKeyboard, this);\n\n /**\n * simple-keyboard uses a non-persistent internal input to keep track of the entered string (the variable `keyboard.input`).\n * This removes any dependency to input DOM elements. You can type and directly display the value in a div element, for example.\n * @example\n * // To get entered input\n * const input = keyboard.getInput();\n *\n * // To clear entered input.\n * keyboard.clearInput();\n *\n * @type {object}\n * @property {object} default Default SimpleKeyboard internal input.\n * @property {object} myInputName Example input that can be set through `options.inputName:\"myInputName\"`.\n */\n const { inputName = this.defaultName } = this.options;\n this.input = {};\n this.input[inputName] = \"\";\n\n /**\n * @type {string} DOM class of the keyboard wrapper, normally \"simple-keyboard\" by default.\n */\n this.keyboardDOMClass = keyboardDOMClass;\n\n /**\n * @type {object} Contains the DOM elements of every rendered button, the key being the button's layout name (e.g.: \"{enter}\").\n */\n this.buttonElements = {};\n\n /**\n * Simple-keyboard Instances\n * This enables multiple simple-keyboard support with easier management\n */\n if (!window[\"SimpleKeyboardInstances\"])\n window[\"SimpleKeyboardInstances\"] = {};\n\n this.currentInstanceName = this.utilities.camelCase(this.keyboardDOMClass);\n window[\"SimpleKeyboardInstances\"][this.currentInstanceName] = this;\n\n /**\n * Instance vars\n */\n this.allKeyboardInstances = window[\"SimpleKeyboardInstances\"];\n this.keyboardInstanceNames = Object.keys(window[\"SimpleKeyboardInstances\"]);\n this.isFirstKeyboardInstance =\n this.keyboardInstanceNames[0] === this.currentInstanceName;\n\n /**\n * Physical Keyboard support\n */\n this.physicalKeyboard = new PhysicalKeyboard({\n dispatch: this.dispatch,\n getOptions: this.getOptions,\n });\n\n /**\n * Initializing CandidateBox\n */\n this.candidateBox = this.options.enableLayoutCandidates\n ? new CandidateBox({\n utilities: this.utilities,\n options: this.options,\n })\n : null;\n\n /**\n * Rendering keyboard\n */\n if (this.keyboardDOM) this.render();\n else {\n console.warn(`\".${keyboardDOMClass}\" was not found in the DOM.`);\n throw new Error(\"KEYBOARD_DOM_ERROR\");\n }\n\n /**\n * Modules\n */\n this.modules = {};\n this.loadModules();\n }\n\n /**\n * parseParams\n */\n handleParams = (\n selectorOrOptions?: string | HTMLDivElement | KeyboardOptions,\n keyboardOptions?: KeyboardOptions\n ): {\n keyboardDOMClass: string;\n keyboardDOM: KeyboardElement;\n options: Partial;\n } => {\n let keyboardDOMClass;\n let keyboardDOM;\n let options;\n\n /**\n * If first parameter is a string:\n * Consider it as an element's class\n */\n if (typeof selectorOrOptions === \"string\") {\n keyboardDOMClass = selectorOrOptions.split(\".\").join(\"\");\n keyboardDOM = document.querySelector(\n `.${keyboardDOMClass}`\n ) as KeyboardElement;\n options = keyboardOptions;\n\n /**\n * If first parameter is an KeyboardElement\n * Consider it as the keyboard DOM element\n */\n } else if (selectorOrOptions instanceof HTMLDivElement) {\n /**\n * This element must have a class, otherwise throw\n */\n if (!selectorOrOptions.className) {\n console.warn(\"Any DOM element passed as parameter must have a class.\");\n throw new Error(\"KEYBOARD_DOM_CLASS_ERROR\");\n }\n\n keyboardDOMClass = selectorOrOptions.className.split(\" \")[0];\n keyboardDOM = selectorOrOptions;\n options = keyboardOptions;\n\n /**\n * Otherwise, search for .simple-keyboard DOM element\n */\n } else {\n keyboardDOMClass = \"simple-keyboard\";\n keyboardDOM = document.querySelector(\n `.${keyboardDOMClass}`\n ) as KeyboardElement;\n options = selectorOrOptions;\n }\n\n return {\n keyboardDOMClass,\n keyboardDOM,\n options,\n };\n };\n\n /**\n * Getters\n */\n getOptions = (): KeyboardOptions => this.options;\n getCaretPosition = (): number | null => this.caretPosition;\n getCaretPositionEnd = (): number | null => this.caretPositionEnd;\n\n /**\n * Changes the internal caret position\n * @param {number} position The caret's start position\n * @param {number} positionEnd The caret's end position\n */\n setCaretPosition(position: number | null, endPosition = position): void {\n this.caretPosition = position;\n this.caretPositionEnd = endPosition;\n }\n\n /**\n * Retrieve the candidates for a given input\n * @param input The input string to check\n */\n getInputCandidates(\n input: string\n ): { candidateKey: string; candidateValue: string } | Record {\n const {\n layoutCandidates: layoutCandidatesObj,\n layoutCandidatesCaseSensitiveMatch,\n } = this.options;\n\n if (!layoutCandidatesObj || typeof layoutCandidatesObj !== \"object\") {\n return {};\n }\n\n const layoutCandidates = Object.keys(layoutCandidatesObj).filter(\n (layoutCandidate: string) => {\n const inputSubstr =\n input.substring(0, this.getCaretPositionEnd() || 0) || input;\n const regexp = new RegExp(\n `${this.utilities.escapeRegex(layoutCandidate)}$`,\n layoutCandidatesCaseSensitiveMatch ? \"g\" : \"gi\"\n );\n const matches = [...inputSubstr.matchAll(regexp)];\n return !!matches.length;\n }\n );\n\n if (layoutCandidates.length > 1) {\n const candidateKey = layoutCandidates.sort(\n (a, b) => b.length - a.length\n )[0];\n return {\n candidateKey,\n candidateValue: layoutCandidatesObj[candidateKey],\n };\n } else if (layoutCandidates.length) {\n const candidateKey = layoutCandidates[0];\n return {\n candidateKey,\n candidateValue: layoutCandidatesObj[candidateKey],\n };\n } else {\n return {};\n }\n }\n\n /**\n * Shows a suggestion box with a list of candidate words\n * @param candidates The chosen candidates string as defined in the layoutCandidates option\n * @param targetElement The element next to which the candidates box will be shown\n */\n showCandidatesBox(\n candidateKey: string,\n candidateValue: string,\n targetElement: KeyboardElement\n ): void {\n if (this.candidateBox) {\n this.candidateBox.show({\n candidateValue,\n targetElement,\n onSelect: (selectedCandidate: string, e: MouseEvent) => {\n const {\n layoutCandidatesCaseSensitiveMatch,\n disableCandidateNormalization,\n enableLayoutCandidatesKeyPress\n } = this.options;\n\n let candidateStr = selectedCandidate;\n\n if(!disableCandidateNormalization) {\n /**\n * Making sure that our suggestions are not composed characters\n */\n candidateStr = selectedCandidate.normalize(\"NFD\");\n }\n\n const currentInput = this.getInput(this.options.inputName, true);\n const initialCaretPosition = this.getCaretPositionEnd() || 0;\n const inputSubstr =\n currentInput.substring(0, initialCaretPosition || 0) ||\n currentInput;\n\n const regexp = new RegExp(\n `${this.utilities.escapeRegex(candidateKey)}$`,\n layoutCandidatesCaseSensitiveMatch ? \"g\" : \"gi\"\n );\n const newInputSubstr = inputSubstr.replace(\n regexp,\n candidateStr\n );\n const newInput = currentInput.replace(inputSubstr, newInputSubstr);\n\n const caretPositionDiff = newInputSubstr.length - inputSubstr.length;\n let newCaretPosition =\n (initialCaretPosition || currentInput.length) + caretPositionDiff;\n\n if (newCaretPosition < 0) newCaretPosition = 0;\n\n this.setInput(newInput, this.options.inputName, true);\n this.setCaretPosition(newCaretPosition);\n\n /**\n * Calling onKeyPress\n * We pass in the composed candidate instead of the decomposed one\n * To prevent confusion for users\n */\n if (enableLayoutCandidatesKeyPress && typeof this.options.onKeyPress === \"function\")\n this.options.onKeyPress(selectedCandidate, e);\n\n if (typeof this.options.onChange === \"function\")\n this.options.onChange(\n this.getInput(this.options.inputName, true),\n e\n );\n\n /**\n * Calling onChangeAll\n */\n if (typeof this.options.onChangeAll === \"function\")\n this.options.onChangeAll(this.getAllInputs(), e);\n },\n });\n }\n }\n\n /**\n * Handles clicks made to keyboard buttons\n * @param {string} button The button's layout name.\n */\n handleButtonClicked(button: string, e?: KeyboardHandlerEvent): void {\n const { inputName = this.defaultName, debug } = this.options;\n /**\n * Ignoring placeholder buttons\n */\n if (button === \"{//}\") return;\n\n /**\n * Creating inputName if it doesn't exist\n */\n if (!this.input[inputName]) this.input[inputName] = \"\";\n\n /**\n * Calculating new input\n */\n const updatedInput = this.utilities.getUpdatedInput(\n button,\n this.input[inputName],\n this.caretPosition,\n this.caretPositionEnd\n );\n\n /**\n * EDGE CASE: Check for whole input selection changes that will yield same updatedInput\n */\n if (this.utilities.isStandardButton(button) && this.activeInputElement) {\n const isEntireInputSelection =\n this.input[inputName] &&\n this.input[inputName] === updatedInput &&\n this.caretPosition === 0 &&\n this.caretPositionEnd === updatedInput.length;\n\n if (isEntireInputSelection) {\n this.setInput(\"\", this.options.inputName, true);\n this.setCaretPosition(0);\n this.activeInputElement.value = \"\";\n this.activeInputElement.setSelectionRange(0, 0);\n this.handleButtonClicked(button, e);\n return;\n }\n }\n\n /**\n * Calling onKeyPress\n */\n if (typeof this.options.onKeyPress === \"function\")\n this.options.onKeyPress(button, e);\n\n if (\n // If input will change as a result of this button press\n this.input[inputName] !== updatedInput &&\n // This pertains to the \"inputPattern\" option:\n // If inputPattern isn't set\n (!this.options.inputPattern ||\n // Or, if it is set and if the pattern is valid - we proceed.\n (this.options.inputPattern && this.inputPatternIsValid(updatedInput)))\n ) {\n /**\n * If maxLength and handleMaxLength yield true, halting\n */\n if (\n this.options.maxLength &&\n this.utilities.handleMaxLength(this.input, updatedInput)\n ) {\n return;\n }\n\n /**\n * Updating input\n */\n const newInputValue = this.utilities.getUpdatedInput(\n button,\n this.input[inputName],\n this.caretPosition,\n this.caretPositionEnd,\n true\n );\n\n this.setInput(newInputValue, this.options.inputName, true);\n\n if (debug) console.log(\"Input changed:\", this.getAllInputs());\n\n if (this.options.debug) {\n console.log(\n \"Caret at: \",\n this.getCaretPosition(),\n this.getCaretPositionEnd(),\n `(${this.keyboardDOMClass})`,\n e?.type\n );\n }\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n\n /**\n * Calling onChange\n */\n if (typeof this.options.onChange === \"function\")\n this.options.onChange(this.getInput(this.options.inputName, true), e);\n\n /**\n * Calling onChangeAll\n */\n if (typeof this.options.onChangeAll === \"function\")\n this.options.onChangeAll(this.getAllInputs(), e);\n\n /**\n * Check if this new input has candidates (suggested words)\n */\n if (e?.target && this.options.enableLayoutCandidates) {\n const { candidateKey, candidateValue } =\n this.getInputCandidates(updatedInput);\n\n if (candidateKey && candidateValue) {\n this.showCandidatesBox(\n candidateKey,\n candidateValue,\n this.keyboardDOM\n );\n } else {\n this.candidateBox?.destroy();\n }\n }\n }\n\n /**\n * After a button is clicked the selection (if any) will disappear\n * we should reflect this in our state, as applicable\n */\n if(this.caretPositionEnd && this.caretPosition !== this.caretPositionEnd){\n this.setCaretPosition(this.caretPositionEnd, this.caretPositionEnd);\n\n if(this.activeInputElement){\n this.activeInputElement.setSelectionRange(this.caretPositionEnd, this.caretPositionEnd);\n }\n \n if(this.options.debug){\n console.log(\"Caret position aligned\", this.caretPosition);\n }\n }\n\n if (debug) {\n console.log(\"Key pressed:\", button);\n }\n }\n\n /**\n * Get mouse hold state\n */\n getMouseHold() {\n return this.isMouseHold;\n }\n\n /**\n * Mark mouse hold state as set\n */\n setMouseHold(value: boolean) {\n if (this.options.syncInstanceInputs) {\n this.dispatch((instance: SimpleKeyboard) => {\n instance.isMouseHold = value;\n });\n } else {\n this.isMouseHold = value;\n }\n }\n\n /**\n * Handles button mousedown\n */\n /* istanbul ignore next */\n handleButtonMouseDown(button: string, e: KeyboardHandlerEvent): void {\n if (e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n if (this.options.stopMouseDownPropagation) e.stopPropagation();\n\n /**\n * Add active class\n */\n e.target.classList.add(this.activeButtonClass);\n }\n\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n if (this.holdTimeout) clearTimeout(this.holdTimeout);\n\n /**\n * @type {boolean} Whether the mouse is being held onKeyPress\n */\n this.setMouseHold(true);\n\n /**\n * @type {object} Time to wait until a key hold is detected\n */\n if (!this.options.disableButtonHold) {\n this.holdTimeout = window.setTimeout(() => {\n if (\n (this.getMouseHold() &&\n // TODO: This needs to be configurable through options\n ((!button.includes(\"{\") && !button.includes(\"}\")) ||\n button === \"{delete}\" ||\n button === \"{backspace}\" ||\n button === \"{bksp}\" ||\n button === \"{space}\" ||\n button === \"{tab}\")) ||\n button === \"{arrowright}\" ||\n button === \"{arrowleft}\" ||\n button === \"{arrowup}\" ||\n button === \"{arrowdown}\"\n ) {\n if (this.options.debug) console.log(\"Button held:\", button);\n\n this.handleButtonHold(button);\n }\n clearTimeout(this.holdTimeout);\n }, 500);\n }\n }\n\n /**\n * Handles button mouseup\n */\n handleButtonMouseUp(button?: string, e?: KeyboardHandlerEvent): void {\n if (e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseUpDefault && e.preventDefault)\n e.preventDefault();\n if (this.options.stopMouseUpPropagation && e.stopPropagation)\n e.stopPropagation();\n\n /* istanbul ignore next */\n const isKeyboard =\n e.target === this.keyboardDOM ||\n (e.target && this.keyboardDOM.contains(e.target)) ||\n (this.candidateBox &&\n this.candidateBox.candidateBoxElement &&\n (e.target === this.candidateBox.candidateBoxElement ||\n (e.target &&\n this.candidateBox.candidateBoxElement.contains(e.target))));\n\n /**\n * On click outside, remove candidateBox\n */\n if (!isKeyboard && this.candidateBox) {\n this.candidateBox.destroy();\n }\n }\n\n /**\n * Remove active class\n */\n this.recurseButtons((buttonElement: Element) => {\n buttonElement.classList.remove(this.activeButtonClass);\n });\n\n this.setMouseHold(false);\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * Calling onKeyReleased\n */\n if (button && typeof this.options.onKeyReleased === \"function\")\n this.options.onKeyReleased(button, e);\n }\n\n /**\n * Handles container mousedown\n */\n handleKeyboardContainerMouseDown(e: KeyboardHandlerEvent): void {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n }\n\n /**\n * Handles button hold\n */\n /* istanbul ignore next */\n handleButtonHold(button: string): void {\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * @type {object} Timeout dictating the speed of key hold iterations\n */\n this.holdInteractionTimeout = window.setTimeout(() => {\n if (this.getMouseHold()) {\n this.handleButtonClicked(button);\n this.handleButtonHold(button);\n } else {\n clearTimeout(this.holdInteractionTimeout);\n }\n }, 100);\n }\n\n /**\n * Send a command to all simple-keyboard instances (if you have several instances).\n */\n syncInstanceInputs(): void {\n this.dispatch((instance: SimpleKeyboard) => {\n instance.replaceInput(this.input);\n instance.setCaretPosition(this.caretPosition, this.caretPositionEnd);\n });\n }\n\n /**\n * Clear the keyboard’s input.\n * @param {string} [inputName] optional - the internal input to select\n */\n clearInput(\n inputName: string = this.options.inputName || this.defaultName\n ): void {\n this.input[inputName] = \"\";\n\n /**\n * Reset caretPosition\n */\n this.setCaretPosition(0);\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Get the keyboard’s input (You can also get it from the onChange prop).\n * @param {string} [inputName] optional - the internal input to select\n */\n getInput(\n inputName: string = this.options.inputName || this.defaultName,\n skipSync = false\n ): string {\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs && !skipSync) this.syncInstanceInputs();\n\n if (this.options.rtl) {\n // Remove existing control chars\n const inputWithoutRTLControl = this.input[inputName]\n .replace(\"\\u202B\", \"\")\n .replace(\"\\u202C\", \"\");\n\n return \"\\u202B\" + inputWithoutRTLControl + \"\\u202C\";\n } else {\n return this.input[inputName];\n }\n }\n\n /**\n * Get all simple-keyboard inputs\n */\n getAllInputs(): KeyboardInput {\n const output = {};\n const inputNames = Object.keys(this.input);\n\n inputNames.forEach((inputName) => {\n output[inputName] = this.getInput(inputName, true);\n });\n\n return output;\n }\n\n /**\n * Set the keyboard’s input.\n * @param {string} input the input value\n * @param {string} inputName optional - the internal input to select\n */\n setInput(\n input: string,\n inputName: string = this.options.inputName || this.defaultName,\n skipSync?: boolean\n ): void {\n this.input[inputName] = input;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (!skipSync && this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Replace the input object (`keyboard.input`)\n * @param {object} inputObj The input object\n */\n replaceInput(inputObj: KeyboardInput): void {\n this.input = inputObj;\n }\n\n /**\n * Set new option or modify existing ones after initialization.\n * @param {object} options The options to set\n */\n setOptions(options = {}): void {\n const changedOptions = this.changedOptions(options);\n this.options = Object.assign(this.options, options);\n\n if (changedOptions.length) {\n if (this.options.debug) {\n console.log(\"changedOptions\", changedOptions);\n }\n\n /**\n * Some option changes require adjustments before re-render\n */\n this.onSetOptions(changedOptions);\n\n /**\n * Rendering\n */\n this.render();\n }\n }\n\n /**\n * Detecting changes to non-function options\n * This allows us to ascertain whether a button re-render is needed\n */\n changedOptions(newOptions: Partial): string[] {\n return Object.keys(newOptions).filter(\n (optionName) =>\n JSON.stringify(newOptions[optionName]) !==\n JSON.stringify(this.options[optionName])\n );\n }\n\n /**\n * Executing actions depending on changed options\n * @param {object} options The options to set\n */\n onSetOptions(changedOptions: string[] = []): void {\n /**\n * Changed: layoutName\n */\n if (changedOptions.includes(\"layoutName\")) {\n /**\n * Reset candidateBox\n */\n if (this.candidateBox) {\n this.candidateBox.destroy();\n }\n }\n\n /**\n * Changed: layoutCandidatesPageSize, layoutCandidates\n */\n if (\n changedOptions.includes(\"layoutCandidatesPageSize\") ||\n changedOptions.includes(\"layoutCandidates\")\n ) {\n /**\n * Reset and recreate candidateBox\n */\n if (this.candidateBox) {\n this.candidateBox.destroy();\n this.candidateBox = new CandidateBox({\n utilities: this.utilities,\n options: this.options,\n });\n }\n }\n }\n\n /**\n * Remove all keyboard rows and reset keyboard values.\n * Used internally between re-renders.\n */\n resetRows(): void {\n if (this.keyboardRowsDOM) {\n this.keyboardRowsDOM.remove();\n }\n\n this.keyboardDOM.className = this.keyboardDOMClass;\n this.keyboardDOM.setAttribute(\"data-skInstance\", this.currentInstanceName);\n this.buttonElements = {};\n }\n\n /**\n * Send a command to all simple-keyboard instances at once (if you have multiple instances).\n * @param {function(instance: object, key: string)} callback Function to run on every instance\n */\n // eslint-disable-next-line no-unused-vars\n dispatch(callback: (instance: SimpleKeyboard, key?: string) => void): void {\n if (!window[\"SimpleKeyboardInstances\"]) {\n console.warn(\n `SimpleKeyboardInstances is not defined. Dispatch cannot be called.`\n );\n throw new Error(\"INSTANCES_VAR_ERROR\");\n }\n\n return Object.keys(window[\"SimpleKeyboardInstances\"]).forEach((key) => {\n callback(window[\"SimpleKeyboardInstances\"][key], key);\n });\n }\n\n /**\n * Adds/Modifies an entry to the `buttonTheme`. Basically a way to add a class to a button.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n addButtonTheme(buttons: string, className: string): void {\n if (!className || !buttons) return;\n\n buttons.split(\" \").forEach((button) => {\n className.split(\" \").forEach((classNameItem) => {\n if (!this.options.buttonTheme) this.options.buttonTheme = [];\n\n let classNameFound = false;\n\n /**\n * If class is already defined, we add button to class definition\n */\n this.options.buttonTheme.map((buttonTheme) => {\n if (buttonTheme?.class.split(\" \").includes(classNameItem)) {\n classNameFound = true;\n\n const buttonThemeArray = buttonTheme.buttons.split(\" \");\n if (!buttonThemeArray.includes(button)) {\n classNameFound = true;\n buttonThemeArray.push(button);\n buttonTheme.buttons = buttonThemeArray.join(\" \");\n }\n }\n return buttonTheme;\n });\n\n /**\n * If class is not defined, we create a new entry\n */\n if (!classNameFound) {\n this.options.buttonTheme.push({\n class: classNameItem,\n buttons: buttons,\n });\n }\n });\n });\n\n this.render();\n }\n\n /**\n * Removes/Amends an entry to the `buttonTheme`. Basically a way to remove a class previously added to a button through buttonTheme or addButtonTheme.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n removeButtonTheme(buttons: string, className: string): void {\n /**\n * When called with empty parameters, remove all button themes\n */\n if (!buttons && !className) {\n this.options.buttonTheme = [];\n this.render();\n return;\n }\n\n /**\n * If buttons are passed and buttonTheme has items\n */\n if (\n buttons &&\n Array.isArray(this.options.buttonTheme) &&\n this.options.buttonTheme.length\n ) {\n const buttonArray = buttons.split(\" \");\n buttonArray.forEach((button) => {\n this.options?.buttonTheme?.map((buttonTheme, index) => {\n /**\n * If className is set, we affect the buttons only for that class\n * Otherwise, we afect all classes\n */\n if (\n (buttonTheme &&\n className &&\n className.includes(buttonTheme.class)) ||\n !className\n ) {\n const filteredButtonArray = buttonTheme?.buttons\n .split(\" \")\n .filter((item) => item !== button);\n\n /**\n * If buttons left, return them, otherwise, remove button Theme\n */\n if (buttonTheme && filteredButtonArray?.length) {\n buttonTheme.buttons = filteredButtonArray.join(\" \");\n } else {\n this.options.buttonTheme?.splice(index, 1);\n buttonTheme = null;\n }\n }\n\n return buttonTheme;\n });\n });\n\n this.render();\n }\n }\n\n /**\n * Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.\n * @param {string} button The button layout name to select\n */\n getButtonElement(\n button: string\n ): KeyboardElement | KeyboardElement[] | undefined {\n let output;\n\n const buttonArr = this.buttonElements[button];\n if (buttonArr) {\n if (buttonArr.length > 1) {\n output = buttonArr;\n } else {\n output = buttonArr[0];\n }\n }\n\n return output;\n }\n\n /**\n * This handles the \"inputPattern\" option\n * by checking if the provided inputPattern passes\n */\n inputPatternIsValid(inputVal: string): boolean {\n const inputPatternRaw = this.options.inputPattern;\n let inputPattern;\n\n /**\n * Check if input pattern is global or targeted to individual inputs\n */\n if (inputPatternRaw instanceof RegExp) {\n inputPattern = inputPatternRaw;\n } else {\n inputPattern =\n inputPatternRaw[this.options.inputName || this.defaultName];\n }\n\n if (inputPattern && inputVal) {\n const didInputMatch = inputPattern.test(inputVal);\n\n if (this.options.debug) {\n console.log(\n `inputPattern (\"${inputPattern}\"): ${\n didInputMatch ? \"passed\" : \"did not pass!\"\n }`\n );\n }\n\n return didInputMatch;\n } else {\n /**\n * inputPattern doesn't seem to be set for the current input, or input is empty. Pass.\n */\n return true;\n }\n }\n\n /**\n * Handles simple-keyboard event listeners\n */\n setEventListeners(): void {\n /**\n * Only first instance should set the event listeners\n */\n if (this.isFirstKeyboardInstance || !this.allKeyboardInstances) {\n if (this.options.debug) {\n console.log(`Caret handling started (${this.keyboardDOMClass})`);\n }\n\n const { physicalKeyboardHighlightPreventDefault = false } = this.options;\n\n /**\n * Event Listeners\n */\n document.addEventListener(\"keyup\", this.handleKeyUp, physicalKeyboardHighlightPreventDefault);\n document.addEventListener(\"keydown\", this.handleKeyDown, physicalKeyboardHighlightPreventDefault);\n document.addEventListener(\"mouseup\", this.handleMouseUp);\n document.addEventListener(\"touchend\", this.handleTouchEnd);\n document.addEventListener(\"selectionchange\", this.handleSelectionChange);\n document.addEventListener(\"select\", this.handleSelect);\n }\n }\n\n /**\n * Event Handler: KeyUp\n */\n handleKeyUp(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyUp(event);\n }\n }\n\n /**\n * Event Handler: KeyDown\n */\n handleKeyDown(event: KeyboardHandlerEvent): void {\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyDown(event);\n }\n }\n\n /**\n * Event Handler: MouseUp\n */\n handleMouseUp(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: TouchEnd\n */\n /* istanbul ignore next */\n handleTouchEnd(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: Select\n */\n /* istanbul ignore next */\n handleSelect(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: SelectionChange\n */\n /* istanbul ignore next */\n handleSelectionChange(event: KeyboardHandlerEvent): void {\n /**\n * Firefox is not reporting the correct caret position through this event\n * https://github.com/hodgef/simple-keyboard/issues/1839\n */\n if(navigator.userAgent.includes('Firefox')){\n return;\n }\n this.caretEventHandler(event);\n }\n\n /**\n * Called by {@link setEventListeners} when an event that warrants a cursor position update is triggered\n */\n caretEventHandler(event: KeyboardHandlerEvent): void {\n let targetTagName: string;\n if (event.target.tagName) {\n targetTagName = event.target.tagName.toLowerCase();\n }\n\n this.dispatch((instance) => {\n let isKeyboard =\n event.target === instance.keyboardDOM ||\n (event.target && instance.keyboardDOM.contains(event.target));\n\n /**\n * If syncInstanceInputs option is enabled, make isKeyboard match any instance\n * not just the current one\n */\n if (this.options.syncInstanceInputs && Array.isArray(event.path)) {\n isKeyboard = event.path.some((item: HTMLElement) =>\n item?.hasAttribute?.(\"data-skInstance\")\n );\n }\n\n if (\n (targetTagName === \"textarea\" ||\n (targetTagName === \"input\" &&\n [\"text\", \"search\", \"url\", \"tel\", \"password\"].includes(\n event.target.type\n ))) &&\n !instance.options.disableCaretPositioning\n ) {\n /**\n * Tracks current cursor position\n * As keys are pressed, text will be added/removed at that position within the input.\n */\n let selectionStart = event.target.selectionStart;\n let selectionEnd = event.target.selectionEnd;\n\n if(instance.options.rtl){\n selectionStart = instance.utilities.getRtlOffset(selectionStart, instance.getInput());\n selectionEnd = instance.utilities.getRtlOffset(selectionEnd, instance.getInput());\n }\n\n instance.setCaretPosition(selectionStart, selectionEnd);\n\n /**\n * Tracking current input in order to handle caret positioning edge cases\n */\n this.activeInputElement = event.target;\n\n if (instance.options.debug) {\n console.log(\n \"Caret at: \",\n instance.getCaretPosition(),\n instance.getCaretPositionEnd(),\n event && event.target.tagName.toLowerCase(),\n `(${instance.keyboardDOMClass})`,\n event?.type\n );\n }\n } else if (\n (instance.options.disableCaretPositioning || !isKeyboard) &&\n event?.type !== \"selectionchange\"\n ) {\n /**\n * If we toggled off disableCaretPositioning, we must ensure caretPosition doesn't persist once reactivated.\n */\n instance.setCaretPosition(null);\n\n /**\n * Resetting activeInputElement\n */\n this.activeInputElement = null;\n\n if (instance.options.debug) {\n console.log(\n `Caret position reset due to \"${event?.type}\" event`,\n event\n );\n }\n }\n });\n }\n\n /**\n * Execute an operation on each button\n */\n recurseButtons(fn: any): void {\n if (!fn) return;\n\n Object.keys(this.buttonElements).forEach((buttonName) =>\n this.buttonElements[buttonName].forEach(fn)\n );\n }\n\n /**\n * Destroy keyboard listeners and DOM elements\n */\n destroy(): void {\n if (this.options.debug)\n console.log(\n `Destroying simple-keyboard instance: ${this.currentInstanceName}`\n );\n\n const { physicalKeyboardHighlightPreventDefault = false } = this.options;\n\n /**\n * Remove document listeners\n */\n document.removeEventListener(\"keyup\", this.handleKeyUp, physicalKeyboardHighlightPreventDefault);\n document.removeEventListener(\"keydown\", this.handleKeyDown, physicalKeyboardHighlightPreventDefault);\n document.removeEventListener(\"mouseup\", this.handleMouseUp);\n document.removeEventListener(\"touchend\", this.handleTouchEnd);\n document.removeEventListener(\"select\", this.handleSelect);\n document.removeEventListener(\"selectionchange\", this.handleSelectionChange);\n document.onpointerup = null;\n document.ontouchend = null;\n document.ontouchcancel = null;\n document.onmouseup = null;\n\n /**\n * Remove buttons\n */\n const deleteButton = (buttonElement: KeyboardElement | null) => {\n if (buttonElement) {\n buttonElement.onpointerdown = null;\n buttonElement.onpointerup = null;\n buttonElement.onpointercancel = null;\n buttonElement.ontouchstart = null;\n buttonElement.ontouchend = null;\n buttonElement.ontouchcancel = null;\n buttonElement.onclick = null;\n buttonElement.onmousedown = null;\n buttonElement.onmouseup = null;\n\n buttonElement.remove();\n buttonElement = null;\n }\n };\n\n this.recurseButtons(deleteButton);\n\n /**\n * Remove wrapper events\n */\n this.keyboardDOM.onpointerdown = null;\n this.keyboardDOM.ontouchstart = null;\n this.keyboardDOM.onmousedown = null;\n\n /**\n * Clearing keyboard rows\n */\n this.resetRows();\n\n /**\n * Candidate box\n */\n if (this.candidateBox) {\n this.candidateBox.destroy();\n this.candidateBox = null;\n }\n\n /**\n * Clearing activeInputElement\n */\n this.activeInputElement = null;\n\n /**\n * Removing instance attribute\n */\n this.keyboardDOM.removeAttribute(\"data-skInstance\");\n\n /**\n * Clearing keyboardDOM\n */\n this.keyboardDOM.innerHTML = \"\";\n\n /**\n * Remove instance\n */\n window[\"SimpleKeyboardInstances\"][this.currentInstanceName] = null;\n delete window[\"SimpleKeyboardInstances\"][this.currentInstanceName];\n\n /**\n * Reset initialized flag\n */\n this.initialized = false;\n }\n\n /**\n * Process buttonTheme option\n */\n getButtonThemeClasses(button: string): string[] {\n const buttonTheme = this.options.buttonTheme;\n let buttonClasses: string[] = [];\n\n if (Array.isArray(buttonTheme)) {\n buttonTheme.forEach((themeObj) => {\n if (\n themeObj &&\n themeObj.class &&\n typeof themeObj.class === \"string\" &&\n themeObj.buttons &&\n typeof themeObj.buttons === \"string\"\n ) {\n const themeObjClasses = themeObj.class.split(\" \");\n const themeObjButtons = themeObj.buttons.split(\" \");\n\n if (themeObjButtons.includes(button)) {\n buttonClasses = [...buttonClasses, ...themeObjClasses];\n }\n } else {\n console.warn(\n `Incorrect \"buttonTheme\". Please check the documentation.`,\n themeObj\n );\n }\n });\n }\n\n return buttonClasses;\n }\n\n /**\n * Process buttonAttributes option\n */\n setDOMButtonAttributes(button: string, callback: any): void {\n const buttonAttributes = this.options.buttonAttributes;\n\n if (Array.isArray(buttonAttributes)) {\n buttonAttributes.forEach((attrObj) => {\n if (\n attrObj.attribute &&\n typeof attrObj.attribute === \"string\" &&\n attrObj.value &&\n typeof attrObj.value === \"string\" &&\n attrObj.buttons &&\n typeof attrObj.buttons === \"string\"\n ) {\n const attrObjButtons = attrObj.buttons.split(\" \");\n\n if (attrObjButtons.includes(button)) {\n callback(attrObj.attribute, attrObj.value);\n }\n } else {\n console.warn(\n `Incorrect \"buttonAttributes\". Please check the documentation.`,\n attrObj\n );\n }\n });\n }\n }\n\n onTouchDeviceDetected() {\n /**\n * Processing autoTouchEvents\n */\n this.processAutoTouchEvents();\n\n /**\n * Disabling contextual window on touch devices\n */\n this.disableContextualWindow();\n }\n\n /**\n * Disabling contextual window for hg-button\n */\n /* istanbul ignore next */\n disableContextualWindow() {\n window.oncontextmenu = (event: KeyboardHandlerEvent) => {\n if (event.target.classList.contains(\"hg-button\")) {\n event.preventDefault();\n event.stopPropagation();\n return false;\n }\n };\n }\n\n /**\n * Process autoTouchEvents option\n */\n processAutoTouchEvents() {\n if (this.options.autoUseTouchEvents) {\n this.options.useTouchEvents = true;\n\n if (this.options.debug) {\n console.log(\n `autoUseTouchEvents: Touch device detected, useTouchEvents enabled.`\n );\n }\n }\n }\n\n /**\n * Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n */\n onInit() {\n if (this.options.debug) {\n console.log(`${this.keyboardDOMClass} Initialized`);\n }\n\n /**\n * setEventListeners\n */\n this.setEventListeners();\n\n if (typeof this.options.onInit === \"function\") this.options.onInit(this);\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeFirstRender() {\n /**\n * Performing actions when touch device detected\n */\n if (this.utilities.isTouchDevice()) {\n this.onTouchDeviceDetected();\n }\n\n if (typeof this.options.beforeFirstRender === \"function\")\n this.options.beforeFirstRender(this);\n\n /**\n * Notify about PointerEvents usage\n */\n if (\n this.isFirstKeyboardInstance &&\n this.utilities.pointerEventsSupported() &&\n !this.options.useTouchEvents &&\n !this.options.useMouseEvents\n ) {\n if (this.options.debug) {\n console.log(\"Using PointerEvents as it is supported by this browser\");\n }\n }\n\n /**\n * Notify about touch events usage\n */\n if (this.options.useTouchEvents) {\n if (this.options.debug) {\n console.log(\n \"useTouchEvents has been enabled. Only touch events will be used.\"\n );\n }\n }\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeRender() {\n if (typeof this.options.beforeRender === \"function\")\n this.options.beforeRender(this);\n }\n\n /**\n * Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n */\n onRender() {\n if (typeof this.options.onRender === \"function\")\n this.options.onRender(this);\n }\n\n /**\n * Executes the callback function once all modules have been loaded\n */\n onModulesLoaded() {\n if (typeof this.options.onModulesLoaded === \"function\")\n this.options.onModulesLoaded(this);\n }\n\n /**\n * Register module\n */\n registerModule = (name: string, initCallback: any) => {\n if (!this.modules[name]) this.modules[name] = {};\n\n initCallback(this.modules[name]);\n };\n\n /**\n * Load modules\n */\n loadModules() {\n if (Array.isArray(this.options.modules)) {\n this.options.modules.forEach((KeyboardModule) => {\n const keyboardModule = new KeyboardModule(this);\n keyboardModule.init && keyboardModule.init(this);\n });\n\n this.keyboardPluginClasses = \"modules-loaded\";\n\n this.render();\n this.onModulesLoaded();\n }\n }\n\n /**\n * Get module prop\n */\n getModuleProp(name: string, prop: string) {\n if (!this.modules[name]) return false;\n\n return this.modules[name][prop];\n }\n\n /**\n * getModulesList\n */\n getModulesList() {\n return Object.keys(this.modules);\n }\n\n /**\n * Parse Row DOM containers\n */\n parseRowDOMContainers(\n rowDOM: HTMLDivElement,\n rowIndex: number,\n containerStartIndexes: number[],\n containerEndIndexes: number[]\n ) {\n const rowDOMArray = Array.from(rowDOM.children);\n let removedElements = 0;\n\n if (rowDOMArray.length) {\n containerStartIndexes.forEach((startIndex, arrIndex) => {\n const endIndex = containerEndIndexes[arrIndex];\n\n /**\n * If there exists a respective end index\n * if end index comes after start index\n */\n if (!endIndex || !(endIndex > startIndex)) {\n return false;\n }\n\n /**\n * Updated startIndex, endIndex\n * This is since the removal of buttons to place a single button container\n * results in a modified array size\n */\n const updated_startIndex = startIndex - removedElements;\n const updated_endIndex = endIndex - removedElements;\n\n /**\n * Create button container\n */\n const containerDOM = document.createElement(\"div\");\n containerDOM.className += \"hg-button-container\";\n const containerUID = `${this.options.layoutName}-r${rowIndex}c${arrIndex}`;\n containerDOM.setAttribute(\"data-skUID\", containerUID);\n\n /**\n * Taking elements due to be inserted into container\n */\n const containedElements = rowDOMArray.splice(\n updated_startIndex,\n updated_endIndex - updated_startIndex + 1\n );\n removedElements = updated_endIndex - updated_startIndex;\n\n /**\n * Inserting elements to container\n */\n containedElements.forEach((element) =>\n containerDOM.appendChild(element)\n );\n\n /**\n * Adding container at correct position within rowDOMArray\n */\n rowDOMArray.splice(updated_startIndex, 0, containerDOM);\n\n /**\n * Clearing old rowDOM children structure\n */\n rowDOM.innerHTML = \"\";\n\n /**\n * Appending rowDOM new children list\n */\n rowDOMArray.forEach((element) => rowDOM.appendChild(element));\n\n if (this.options.debug) {\n console.log(\n \"rowDOMContainer\",\n containedElements,\n updated_startIndex,\n updated_endIndex,\n removedElements + 1\n );\n }\n });\n }\n\n return rowDOM;\n }\n\n /**\n * getKeyboardClassString\n */\n getKeyboardClassString = (...baseDOMClasses: any[]) => {\n const keyboardClasses = [this.keyboardDOMClass, ...baseDOMClasses].filter(\n (DOMClass) => !!DOMClass\n );\n\n return keyboardClasses.join(\" \");\n };\n\n /**\n * Renders rows and buttons as per options\n */\n render() {\n /**\n * Clear keyboard\n */\n this.resetRows();\n\n /**\n * Calling beforeFirstRender\n */\n if (!this.initialized) {\n this.beforeFirstRender();\n }\n\n /**\n * Calling beforeRender\n */\n this.beforeRender();\n\n const layoutClass = `hg-layout-${this.options.layoutName}`;\n const layout = this.options.layout || getDefaultLayout();\n const useTouchEvents = this.options.useTouchEvents || false;\n const useTouchEventsClass = useTouchEvents ? \"hg-touch-events\" : \"\";\n const useMouseEvents = this.options.useMouseEvents || false;\n const disableRowButtonContainers = this.options.disableRowButtonContainers;\n\n /**\n * Adding themeClass, layoutClass to keyboardDOM\n */\n this.keyboardDOM.className = this.getKeyboardClassString(\n this.options.theme,\n layoutClass,\n this.keyboardPluginClasses,\n useTouchEventsClass\n );\n\n /**\n * Adding keyboard identifier\n */\n this.keyboardDOM.setAttribute(\"data-skInstance\", this.currentInstanceName);\n\n /**\n * Create row wrapper\n */\n this.keyboardRowsDOM = document.createElement(\"div\");\n this.keyboardRowsDOM.className = \"hg-rows\";\n\n /**\n * Iterating through each row\n */\n layout[this.options.layoutName || this.defaultName].forEach(\n (row, rIndex) => {\n let rowArray = row.split(\" \");\n\n /**\n * Enforce excludeFromLayout\n */\n if (\n this.options.excludeFromLayout &&\n this.options.excludeFromLayout[\n this.options.layoutName || this.defaultName\n ]\n ) {\n rowArray = rowArray.filter(\n (buttonName) =>\n this.options.excludeFromLayout &&\n !this.options.excludeFromLayout[\n this.options.layoutName || this.defaultName\n ].includes(buttonName)\n );\n }\n\n /**\n * Creating empty row\n */\n let rowDOM = document.createElement(\"div\");\n rowDOM.className += \"hg-row\";\n\n /**\n * Tracking container indicators in rows\n */\n const containerStartIndexes: number[] = [];\n const containerEndIndexes: number[] = [];\n\n /**\n * Iterating through each button in row\n */\n rowArray.forEach((button, bIndex) => {\n /**\n * Check if button has a container indicator\n */\n const buttonHasContainerStart =\n !disableRowButtonContainers &&\n typeof button === \"string\" &&\n button.length > 1 &&\n button.indexOf(\"[\") === 0;\n\n const buttonHasContainerEnd =\n !disableRowButtonContainers &&\n typeof button === \"string\" &&\n button.length > 1 &&\n button.indexOf(\"]\") === button.length - 1;\n\n /**\n * Save container start index, if applicable\n */\n if (buttonHasContainerStart) {\n containerStartIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\[/g, \"\");\n }\n\n if (buttonHasContainerEnd) {\n containerEndIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\]/g, \"\");\n }\n\n /**\n * Processing button options\n */\n const fctBtnClass = this.utilities.getButtonClass(button);\n const buttonDisplayName = this.utilities.getButtonDisplayName(\n button,\n this.options.display,\n this.options.mergeDisplay\n );\n\n /**\n * Creating button\n */\n const buttonType = this.options.useButtonTag ? \"button\" : \"div\";\n const buttonDOM = document.createElement(buttonType);\n buttonDOM.className += `hg-button ${fctBtnClass}`;\n\n /**\n * Adding buttonTheme\n */\n buttonDOM.classList.add(...this.getButtonThemeClasses(button));\n\n /**\n * Adding buttonAttributes\n */\n this.setDOMButtonAttributes(\n button,\n (attribute: string, value: string) => {\n buttonDOM.setAttribute(attribute, value);\n }\n );\n\n this.activeButtonClass = \"hg-activeButton\";\n\n /**\n * Handle button click event\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n /**\n * Handle PointerEvents\n */\n buttonDOM.onpointerdown = (e: KeyboardHandlerEvent) => {\n this.handleButtonClicked(button, e);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.onpointerup = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n buttonDOM.onpointercancel = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n } else {\n /**\n * Fallback for browsers not supporting PointerEvents\n */\n if (useTouchEvents) {\n /**\n * Handle touch events\n */\n buttonDOM.ontouchstart = (e: KeyboardHandlerEvent) => {\n this.handleButtonClicked(button, e);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.ontouchend = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n buttonDOM.ontouchcancel = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n } else {\n /**\n * Handle mouse events\n */\n buttonDOM.onclick = (e: KeyboardHandlerEvent) => {\n this.setMouseHold(false);\n /**\n * Fire button handler in onclick for compatibility reasons\n * This fires handler before onKeyReleased, therefore when that option is set we will fire the handler\n * in onmousedown instead\n */\n if (typeof this.options.onKeyReleased !== \"function\") {\n this.handleButtonClicked(button, e);\n }\n };\n buttonDOM.onmousedown = (e: KeyboardHandlerEvent) => {\n /**\n * Fire button handler for onKeyReleased use-case\n */\n if (\n typeof this.options.onKeyReleased === \"function\" &&\n !this.isMouseHold\n ) {\n this.handleButtonClicked(button, e);\n }\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.onmouseup = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n }\n }\n\n /**\n * Adding identifier\n */\n buttonDOM.setAttribute(\"data-skBtn\", button);\n\n /**\n * Adding unique id\n * Since there's no limit on spawning same buttons, the unique id ensures you can style every button\n */\n const buttonUID = `${this.options.layoutName}-r${rIndex}b${bIndex}`;\n buttonDOM.setAttribute(\"data-skBtnUID\", buttonUID);\n\n /**\n * Adding button label to button\n */\n const buttonSpanDOM = document.createElement(\"span\");\n buttonSpanDOM.innerHTML = buttonDisplayName;\n buttonDOM.appendChild(buttonSpanDOM);\n\n /**\n * Adding to buttonElements\n */\n if (!this.buttonElements[button]) this.buttonElements[button] = [];\n\n this.buttonElements[button].push(buttonDOM);\n\n /**\n * Appending button to row\n */\n rowDOM.appendChild(buttonDOM);\n });\n\n /**\n * Parse containers in row\n */\n rowDOM = this.parseRowDOMContainers(\n rowDOM,\n rIndex,\n containerStartIndexes,\n containerEndIndexes\n );\n\n /**\n * Appending row to hg-rows\n */\n this.keyboardRowsDOM.appendChild(rowDOM);\n }\n );\n\n /**\n * Appending row to keyboard\n */\n this.keyboardDOM.appendChild(this.keyboardRowsDOM);\n\n /**\n * Calling onRender\n */\n this.onRender();\n\n if (!this.initialized) {\n /**\n * Ensures that onInit and beforeFirstRender are only called once per instantiation\n */\n this.initialized = true;\n\n /**\n * Handling parent events\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n document.onpointerup = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n this.keyboardDOM.onpointerdown = (e: KeyboardHandlerEvent) =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (useTouchEvents) {\n /**\n * Handling ontouchend, ontouchcancel\n */\n document.ontouchend = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n document.ontouchcancel = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n\n this.keyboardDOM.ontouchstart = (e: KeyboardHandlerEvent) =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (!useTouchEvents) {\n /**\n * Handling mouseup\n */\n document.onmouseup = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n this.keyboardDOM.onmousedown = (e: KeyboardHandlerEvent) =>\n this.handleKeyboardContainerMouseDown(e);\n }\n\n /**\n * Calling onInit\n */\n this.onInit();\n }\n }\n}\n\nexport default SimpleKeyboard;\n","export const getDefaultLayout = () => {\n return {\n default: [\n \"` 1 2 3 4 5 6 7 8 9 0 - = {bksp}\",\n \"{tab} q w e r t y u i o p [ ] \\\\\",\n \"{lock} a s d f g h j k l ; ' {enter}\",\n \"{shift} z x c v b n m , . / {shift}\",\n \".com @ {space}\",\n ],\n shift: [\n \"~ ! @ # $ % ^ & * ( ) _ + {bksp}\",\n \"{tab} Q W E R T Y U I O P { } |\",\n '{lock} A S D F G H J K L : \" {enter}',\n \"{shift} Z X C V B N M < > ? {shift}\",\n \".com @ {space}\",\n ],\n };\n};\n","import SimpleKeyboard from \"./components/Keyboard\";\nexport { SimpleKeyboard };\nexport default SimpleKeyboard;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://SimpleKeyboard/webpack/universalModuleDefinition","webpack://SimpleKeyboard/webpack/bootstrap","webpack://SimpleKeyboard/webpack/runtime/define property getters","webpack://SimpleKeyboard/webpack/runtime/hasOwnProperty shorthand","webpack://SimpleKeyboard/webpack/runtime/make namespace object","webpack://SimpleKeyboard/./src/lib/services/Utilities.ts","webpack://SimpleKeyboard/./src/lib/services/PhysicalKeyboard.ts","webpack://SimpleKeyboard/./src/lib/components/CandidateBox.ts","webpack://SimpleKeyboard/./src/lib/components/Keyboard.ts","webpack://SimpleKeyboard/./src/lib/services/KeyboardLayout.ts","webpack://SimpleKeyboard/./src/lib/index.modern.ts"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Utilities","_ref","getOptions","getCaretPosition","getCaretPositionEnd","dispatch","_classCallCheck","_defineProperty","button","length","bindMethods","includes","buttonTypeClass","getButtonType","buttonWithoutBraces","replace","buttonNormalized","concat","display","arguments","undefined","assign","getDefaultDiplay","input","caretPos","caretPosEnd","moveCaret","options","commonParams","output","removeAt","apply","removeForwardsAt","addStringAt","tabCharOnTab","newLineOnEnter","Number","isInteger","debug","console","log","minus","newCaretPos","updateCaretPosAction","instance","setCaretPosition","caretPosition","source","str","position","positionEnd","slice","join","isMaxLengthReached","updateCaretPos","emojiMatchedReg","substring","match","substr","inputObj","updatedInput","maxLength","currentInput","inputName","condition","maxLengthReached","_typeof","Boolean","window","navigator","maxTouchPoints","PointerEvent","toLowerCase","trim","split","reduce","word","toUpperCase","arr","size","_toConsumableArray","Array","Math","ceil","map","_","i","index","newIndex","startMarkerIndex","indexOf","myClass","_step","_iterator","_createForOfIteratorHelper","getOwnPropertyNames","s","n","done","myMethod","bind","err","e","f","PhysicalKeyboard","_this","altKey","ctrlKey","shiftKey","code","keyCodeToKey","keyCode","physicalKeyboardHighlightPreventDefault","isMofifierKey","preventDefault","stopImmediatePropagation","buttonPressed","getSimpleKeyboardLayoutKey","buttonDOM","buttonName","standardButtonPressed","getButtonElement","functionButtonPressed","_buttonDOM$","applyButtonStyle","buttonElement","style","background","physicalKeyboardHighlightBgColor","color","physicalKeyboardHighlightTextColor","isArray","forEach","physicalKeyboardHighlightPress","physicalKeyboardHighlightPressUsePointerEvents","onpointerdown","physicalKeyboardHighlightPressUseClick","_buttonDOM$2","click","handleButtonClicked","_buttonDOM$3","removeAttribute","onpointerup","_output","keyId","CandidateBox","utilities","pageSize","layoutCandidatesPageSize","candidateBoxElement","remove","pageIndex","_ref2","candidateValue","targetElement","onSelect","candidateListPages","chunkArray","renderPage","nbPages","onItemSelected","selectedCandidate","destroy","_ref3","_this$candidateBoxEle","_this2","document","createElement","className","candidateListULElement","candidateListItem","_this2$options$displa","candidateListLIElement","getMouseEvent","mouseEvent","useTouchEvents","TouchEvent","MouseEvent","innerHTML","ontouchstart","onclick","appendChild","isPrevBtnElementActive","prevBtnElement","classList","add","prevBtnElementClickAction","isNextBtnElementActive","nextBtnElement","nextBtnElementClickAction","prepend","SimpleKeyboard","selectorOrOptions","keyboardOptions","keyboardDOMClass","keyboardDOM","querySelector","HTMLDivElement","warn","Error","caretPositionEnd","name","initCallback","modules","_len","baseDOMClasses","_key","filter","DOMClass","_this$handleParams","handleParams","_this$handleParams$op","_objectSpread","layoutName","theme","preventMouseDownDefault","enableLayoutCandidates","excludeFromLayout","keyboardPluginClasses","_this$options$inputNa","defaultName","buttonElements","currentInstanceName","camelCase","allKeyboardInstances","keyboardInstanceNames","keys","isFirstKeyboardInstance","physicalKeyboard","candidateBox","render","loadModules","endPosition","_this$options","layoutCandidatesObj","layoutCandidates","layoutCandidatesCaseSensitiveMatch","layoutCandidate","inputSubstr","regexp","RegExp","escapeRegex","matchAll","candidateKey","sort","a","b","_this3","show","_this3$options","disableCandidateNormalization","enableLayoutCandidatesKeyPress","candidateStr","normalize","getInput","initialCaretPosition","newInputSubstr","newInput","caretPositionDiff","newCaretPosition","setInput","onKeyPress","onChange","onChangeAll","getAllInputs","_this$options2","_this$options2$inputN","getUpdatedInput","isStandardButton","activeInputElement","setSelectionRange","inputPattern","inputPatternIsValid","handleMaxLength","newInputValue","type","syncInstanceInputs","target","_this$candidateBox","_this$getInputCandida","getInputCandidates","showCandidatesBox","isMouseHold","_this4","stopMouseDownPropagation","stopPropagation","activeButtonClass","holdInteractionTimeout","clearTimeout","holdTimeout","setMouseHold","disableButtonHold","setTimeout","getMouseHold","handleButtonHold","_this5","preventMouseUpDefault","stopMouseUpPropagation","contains","recurseButtons","onKeyReleased","_this6","_this7","replaceInput","skipSync","rtl","_this8","changedOptions","onSetOptions","newOptions","_this9","optionName","JSON","stringify","keyboardRowsDOM","setAttribute","callback","buttons","_this10","classNameItem","buttonTheme","classNameFound","buttonThemeArray","push","class","_this11","_this11$options","_this11$options$butto","_buttonTheme","_this11$options$butto2","filteredButtonArray","item","splice","buttonArr","inputVal","inputPatternRaw","didInputMatch","test","_this$options$physica","addEventListener","handleKeyUp","handleKeyDown","handleMouseUp","handleTouchEnd","handleSelectionChange","handleSelect","event","caretEventHandler","physicalKeyboardHighlight","handleHighlightKeyUp","handleHighlightKeyDown","userAgent","targetTagName","_this12","tagName","isKeyboard","path","some","_item$hasAttribute","hasAttribute","disableCaretPositioning","selectionStart","selectionEnd","getRtlOffset","fn","_this13","_this$options$physica2","removeEventListener","ontouchend","ontouchcancel","onmouseup","onpointercancel","onmousedown","resetRows","initialized","buttonClasses","themeObj","themeObjClasses","buttonAttributes","attrObj","attribute","processAutoTouchEvents","disableContextualWindow","oncontextmenu","autoUseTouchEvents","setEventListeners","onInit","isTouchDevice","onTouchDeviceDetected","beforeFirstRender","pointerEventsSupported","useMouseEvents","beforeRender","onRender","onModulesLoaded","_this14","KeyboardModule","keyboardModule","init","rowDOM","rowIndex","containerStartIndexes","containerEndIndexes","_this15","rowDOMArray","from","children","removedElements","startIndex","arrIndex","endIndex","updated_startIndex","updated_endIndex","containerDOM","containerUID","containedElements","element","_this16","layoutClass","layout","default","shift","useTouchEventsClass","disableRowButtonContainers","getKeyboardClassString","row","rIndex","rowArray","bIndex","_buttonDOM$classList","buttonHasContainerStart","buttonHasContainerEnd","fctBtnClass","getButtonClass","buttonDisplayName","getButtonDisplayName","mergeDisplay","buttonType","useButtonTag","getButtonThemeClasses","setDOMButtonAttributes","handleButtonMouseDown","handleButtonMouseUp","buttonUID","buttonSpanDOM","parseRowDOMContainers","handleKeyboardContainerMouseDown"],"mappings":";;;;;;;;;;;;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,MAAM,WACT,O,wBCTA,IAAIC,EAAsB,CCA1BA,EAAwB,SAASL,EAASM,GACzC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAF,EAAwB,SAASQ,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECCtGT,EAAwB,SAASL,GACX,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GACvD,G,0pDCHA,IAGMC,EAAS,WAUb,SAAAA,EAAAC,GAKoB,IAJlBC,EAAUD,EAAVC,WACAC,EAAgBF,EAAhBE,iBACAC,EAAmBH,EAAnBG,oBACAC,EAAQJ,EAARI,U,4FAAQC,CAAA,KAAAN,GAAAO,EAAA,0BAAAA,EAAA,gCAAAA,EAAA,mCAAAA,EAAA,wBAAAA,EAAA,gCA6RVA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UniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SimpleKeyboard\"] = factory();\n\telse\n\t\troot[\"SimpleKeyboard\"] = factory();\n})(this, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { KeyboardInput } from \"./../interfaces\";\nimport { KeyboardOptions, UtilitiesParams } from \"../interfaces\";\n\n/**\n * Utility Service\n */\nclass Utilities {\n getOptions: () => KeyboardOptions;\n getCaretPosition: () => number | null;\n getCaretPositionEnd: () => number | null;\n dispatch: any;\n maxLengthReached!: boolean;\n\n /**\n * Creates an instance of the Utility service\n */\n constructor({\n getOptions,\n getCaretPosition,\n getCaretPositionEnd,\n dispatch,\n }: UtilitiesParams) {\n this.getOptions = getOptions;\n this.getCaretPosition = getCaretPosition;\n this.getCaretPositionEnd = getCaretPositionEnd;\n this.dispatch = dispatch;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(Utilities, this);\n }\n\n /**\n * Retrieve button type\n *\n * @param {string} button The button's layout name\n * @return {string} The button type\n */\n getButtonType(button: string): string {\n return button.includes(\"{\") && button.includes(\"}\") && button !== \"{//}\"\n ? \"functionBtn\"\n : \"standardBtn\";\n }\n\n /**\n * Adds default classes to a given button\n *\n * @param {string} button The button's layout name\n * @return {string} The classes to be added to the button\n */\n getButtonClass(button: string): string {\n const buttonTypeClass = this.getButtonType(button);\n const buttonWithoutBraces = button.replace(\"{\", \"\").replace(\"}\", \"\");\n let buttonNormalized = \"\";\n\n if (buttonTypeClass !== \"standardBtn\")\n buttonNormalized = ` hg-button-${buttonWithoutBraces}`;\n\n return `hg-${buttonTypeClass}${buttonNormalized}`;\n }\n\n /**\n * Default button display labels\n */\n getDefaultDiplay() {\n return {\n \"{bksp}\": \"backspace\",\n \"{backspace}\": \"backspace\",\n \"{enter}\": \"< enter\",\n \"{shift}\": \"shift\",\n \"{shiftleft}\": \"shift\",\n \"{shiftright}\": \"shift\",\n \"{alt}\": \"alt\",\n \"{s}\": \"shift\",\n \"{tab}\": \"tab\",\n \"{lock}\": \"caps\",\n \"{capslock}\": \"caps\",\n \"{accept}\": \"Submit\",\n \"{space}\": \" \",\n \"{//}\": \" \",\n \"{esc}\": \"esc\",\n \"{escape}\": \"esc\",\n \"{f1}\": \"f1\",\n \"{f2}\": \"f2\",\n \"{f3}\": \"f3\",\n \"{f4}\": \"f4\",\n \"{f5}\": \"f5\",\n \"{f6}\": \"f6\",\n \"{f7}\": \"f7\",\n \"{f8}\": \"f8\",\n \"{f9}\": \"f9\",\n \"{f10}\": \"f10\",\n \"{f11}\": \"f11\",\n \"{f12}\": \"f12\",\n \"{numpaddivide}\": \"/\",\n \"{numlock}\": \"lock\",\n \"{arrowup}\": \"↑\",\n \"{arrowleft}\": \"←\",\n \"{arrowdown}\": \"↓\",\n \"{arrowright}\": \"→\",\n \"{prtscr}\": \"print\",\n \"{scrolllock}\": \"scroll\",\n \"{pause}\": \"pause\",\n \"{insert}\": \"ins\",\n \"{home}\": \"home\",\n \"{pageup}\": \"up\",\n \"{delete}\": \"del\",\n \"{forwarddelete}\": \"del\",\n \"{end}\": \"end\",\n \"{pagedown}\": \"down\",\n \"{numpadmultiply}\": \"*\",\n \"{numpadsubtract}\": \"-\",\n \"{numpadadd}\": \"+\",\n \"{numpadenter}\": \"enter\",\n \"{period}\": \".\",\n \"{numpaddecimal}\": \".\",\n \"{numpad0}\": \"0\",\n \"{numpad1}\": \"1\",\n \"{numpad2}\": \"2\",\n \"{numpad3}\": \"3\",\n \"{numpad4}\": \"4\",\n \"{numpad5}\": \"5\",\n \"{numpad6}\": \"6\",\n \"{numpad7}\": \"7\",\n \"{numpad8}\": \"8\",\n \"{numpad9}\": \"9\",\n };\n }\n /**\n * Returns the display (label) name for a given button\n *\n * @param {string} button The button's layout name\n * @param {object} display The provided display option\n * @param {boolean} mergeDisplay Whether the provided param value should be merged with the default one.\n */\n getButtonDisplayName(\n button: string,\n display: KeyboardOptions[\"display\"],\n mergeDisplay = false\n ) {\n if (mergeDisplay) {\n display = Object.assign({}, this.getDefaultDiplay(), display);\n } else {\n display = display || this.getDefaultDiplay();\n }\n\n return display[button] || button;\n }\n\n /**\n * Returns the updated input resulting from clicking a given button\n *\n * @param {string} button The button's layout name\n * @param {string} input The input string\n * @param {number} caretPos The cursor's current position\n * @param {number} caretPosEnd The cursor's current end position\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n getUpdatedInput(\n button: string,\n input: string,\n caretPos: any,\n caretPosEnd = caretPos,\n moveCaret = false\n ) {\n const options = this.getOptions();\n const commonParams: [number | undefined, number | undefined, boolean] = [\n caretPos,\n caretPosEnd,\n moveCaret,\n ];\n\n let output = input;\n\n if (\n (button === \"{bksp}\" || button === \"{backspace}\") &&\n output.length > 0\n ) {\n output = this.removeAt(output, ...commonParams);\n } else if (\n (button === \"{delete}\" || button === \"{forwarddelete}\") &&\n output.length > 0\n ) {\n output = this.removeForwardsAt(output, ...commonParams);\n } else if (button === \"{space}\")\n output = this.addStringAt(output, \" \", ...commonParams);\n else if (\n button === \"{tab}\" &&\n !(\n typeof options.tabCharOnTab === \"boolean\" &&\n options.tabCharOnTab === false\n )\n ) {\n output = this.addStringAt(output, \"\\t\", ...commonParams);\n } else if (\n (button === \"{enter}\" || button === \"{numpadenter}\") &&\n options.newLineOnEnter\n )\n output = this.addStringAt(output, \"\\n\", ...commonParams);\n else if (\n button.includes(\"numpad\") &&\n Number.isInteger(Number(button[button.length - 2]))\n ) {\n output = this.addStringAt(\n output,\n button[button.length - 2],\n ...commonParams\n );\n } else if (button === \"{numpaddivide}\")\n output = this.addStringAt(output, \"/\", ...commonParams);\n else if (button === \"{numpadmultiply}\")\n output = this.addStringAt(output, \"*\", ...commonParams);\n else if (button === \"{numpadsubtract}\")\n output = this.addStringAt(output, \"-\", ...commonParams);\n else if (button === \"{numpadadd}\")\n output = this.addStringAt(output, \"+\", ...commonParams);\n else if (button === \"{numpaddecimal}\")\n output = this.addStringAt(output, \".\", ...commonParams);\n else if (button === \"{\" || button === \"}\")\n output = this.addStringAt(output, button, ...commonParams);\n else if (!button.includes(\"{\") && !button.includes(\"}\"))\n output = this.addStringAt(output, button, ...commonParams);\n\n if(options.debug){\n console.log(\"Input will be: \"+ output);\n }\n\n return output;\n }\n\n /**\n * Moves the cursor position by a given amount\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPos(length: number, minus = false) {\n const newCaretPos = this.updateCaretPosAction(length, minus);\n\n this.dispatch((instance: any) => {\n instance.setCaretPosition(newCaretPos);\n });\n }\n\n /**\n * Action method of updateCaretPos\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPosAction(length: number, minus = false) {\n const options = this.getOptions();\n let caretPosition = this.getCaretPosition();\n\n if (caretPosition != null) {\n if (minus) {\n if (caretPosition > 0) caretPosition = caretPosition - length;\n } else {\n caretPosition = caretPosition + length;\n }\n }\n\n if (options.debug) {\n console.log(\"Caret at:\", caretPosition);\n }\n\n return caretPosition;\n }\n\n /**\n * Adds a string to the input at a given position\n *\n * @param {string} source The source input\n * @param {string} str The string to add\n * @param {number} position The (cursor) position where the string should be added\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n addStringAt(\n source: string,\n str: string,\n position = source.length,\n positionEnd = source.length,\n moveCaret = false\n ) {\n let output;\n\n if (!position && position !== 0) {\n output = source + str;\n } else {\n output = [source.slice(0, position), str, source.slice(positionEnd)].join(\n \"\"\n );\n\n /**\n * Avoid caret position change when maxLength is set\n */\n if (!this.isMaxLengthReached()) {\n if (moveCaret) this.updateCaretPos(str.length);\n }\n }\n\n return output;\n }\n\n /**\n * Check whether the button is a standard button\n */\n isStandardButton = (button: string) =>\n button && !(button[0] === \"{\" && button[button.length - 1] === \"}\");\n\n /**\n * Removes an amount of characters before a given position\n *\n * @param {string} source The source input\n * @param {number} position The (cursor) position from where the characters should be removed\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n removeAt(\n source: string,\n position = source.length,\n positionEnd = source.length,\n moveCaret = false\n ) {\n if (position === 0 && positionEnd === 0) {\n return source;\n }\n\n let output;\n\n if (position === positionEnd) {\n let prevTwoChars;\n let emojiMatched;\n const emojiMatchedReg = /([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n\n /**\n * Emojis are made out of two characters, so we must take a custom approach to trim them.\n * For more info: https://mathiasbynens.be/notes/javascript-unicode\n */\n if (position && position >= 0) {\n prevTwoChars = source.substring(position - 2, position);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.substr(0, position - 2) + source.substr(position);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.substr(0, position - 1) + source.substr(position);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n } else {\n prevTwoChars = source.slice(-2);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.slice(0, -2);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.slice(0, -1);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n }\n } else {\n output = source.slice(0, position) + source.slice(positionEnd);\n if (moveCaret) {\n this.dispatch((instance: any) => {\n instance.setCaretPosition(position);\n });\n }\n }\n\n return output;\n }\n\n /**\n * Removes an amount of characters after a given position\n *\n * @param {string} source The source input\n * @param {number} position The (cursor) position from where the characters should be removed\n */\n removeForwardsAt(\n source: string,\n position: number = source.length,\n positionEnd: number = source.length,\n moveCaret = false\n ) {\n if (!source?.length || position === null) {\n return source;\n }\n\n let output;\n\n if (position === positionEnd) {\n const emojiMatchedReg = /([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n\n /**\n * Emojis are made out of two characters, so we must take a custom approach to trim them.\n * For more info: https://mathiasbynens.be/notes/javascript-unicode\n */\n const nextTwoChars = source.substring(position, position + 2);\n const emojiMatched = nextTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.substr(0, position) + source.substr(position + 2);\n } else {\n output = source.substr(0, position) + source.substr(position + 1);\n }\n } else {\n output = source.slice(0, position) + source.slice(positionEnd);\n if (moveCaret) {\n this.dispatch((instance: any) => {\n instance.setCaretPosition(position);\n });\n }\n }\n\n return output;\n }\n\n /**\n * Determines whether the maxLength has been reached. This function is called when the maxLength option it set.\n *\n * @param {object} inputObj\n * @param {string} updatedInput\n */\n handleMaxLength(inputObj: KeyboardInput, updatedInput: string) {\n const options = this.getOptions();\n const maxLength = options.maxLength;\n const currentInput = inputObj[options.inputName || \"default\"];\n const condition = updatedInput.length - 1 >= maxLength;\n\n if (\n /**\n * If pressing this button won't add more characters\n * We exit out of this limiter function\n */\n updatedInput.length <= currentInput.length\n ) {\n return false;\n }\n\n if (Number.isInteger(maxLength)) {\n if (options.debug) {\n console.log(\"maxLength (num) reached:\", condition);\n }\n\n if (condition) {\n /**\n * @type {boolean} Boolean value that shows whether maxLength has been reached\n */\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n\n if (typeof maxLength === \"object\") {\n const condition =\n updatedInput.length - 1 >= maxLength[options.inputName || \"default\"];\n\n if (options.debug) {\n console.log(\"maxLength (obj) reached:\", condition);\n }\n\n if (condition) {\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n }\n\n /**\n * Gets the current value of maxLengthReached\n */\n isMaxLengthReached() {\n return Boolean(this.maxLengthReached);\n }\n\n /**\n * Determines whether a touch device is being used\n */\n isTouchDevice() {\n return \"ontouchstart\" in window || navigator.maxTouchPoints;\n }\n\n /**\n * Determines whether pointer events are supported\n */\n pointerEventsSupported() {\n return !!window.PointerEvent;\n }\n\n /**\n * Bind all methods in a given class\n */\n\n static bindMethods(myClass: any, instance: any) {\n // eslint-disable-next-line no-unused-vars\n for (const myMethod of Object.getOwnPropertyNames(myClass.prototype)) {\n const excludeMethod =\n myMethod === \"constructor\" || myMethod === \"bindMethods\";\n if (!excludeMethod) {\n instance[myMethod] = instance[myMethod].bind(instance);\n }\n }\n }\n\n /**\n * Transforms an arbitrary string to camelCase\n *\n * @param {string} str The string to transform.\n */\n camelCase(str: string): string {\n if (!str) return \"\";\n\n return str\n .toLowerCase()\n .trim()\n .split(/[.\\-_\\s]/g)\n .reduce((str, word) =>\n word.length ? str + word[0].toUpperCase() + word.slice(1) : str\n );\n }\n\n /**\n * Split array into chunks\n */\n chunkArray(arr: T[], size: number): T[][] {\n return [...Array(Math.ceil(arr.length / size))].map((_, i) =>\n arr.slice(size * i, size + size * i)\n );\n }\n\n /**\n * Escape regex input\n */\n escapeRegex(str: string) {\n return str.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n }\n\n /**\n * Calculate caret position offset when using rtl option\n */\n getRtlOffset(index: number, input: string) {\n let newIndex = index;\n const startMarkerIndex = input.indexOf(\"\\u202B\");\n const endMarkerIndex = input.indexOf(\"\\u202C\");\n\n if(startMarkerIndex < index && startMarkerIndex != -1){ newIndex--; }\n if(endMarkerIndex < index && startMarkerIndex != -1){ newIndex--; }\n\n return newIndex < 0 ? 0 : newIndex;\n }\n\n /**\n * Reusable empty function\n */\n static noop = () => {};\n}\n\nexport default Utilities;\n","import { KeyboardOptions, PhysicalKeyboardParams } from \"../interfaces\";\nimport Utilities from \"../services/Utilities\";\n\n/**\n * Physical Keyboard Service\n */\nclass PhysicalKeyboard {\n getOptions: () => KeyboardOptions;\n dispatch: any;\n\n /**\n * Creates an instance of the PhysicalKeyboard service\n */\n constructor({ dispatch, getOptions }: PhysicalKeyboardParams) {\n /**\n * @type {object} A simple-keyboard instance\n */\n this.dispatch = dispatch;\n this.getOptions = getOptions;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(PhysicalKeyboard, this);\n }\n\n handleHighlightKeyDown(e: KeyboardEvent) {\n const options = this.getOptions();\n\n if(options.physicalKeyboardHighlightPreventDefault && this.isMofifierKey(e)){\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n\n const buttonPressed = this.getSimpleKeyboardLayoutKey(e);\n\n this.dispatch((instance: any) => {\n const standardButtonPressed = instance.getButtonElement(buttonPressed);\n const functionButtonPressed = instance.getButtonElement(\n `{${buttonPressed}}`\n );\n let buttonDOM;\n let buttonName: string;\n\n if (standardButtonPressed) {\n buttonDOM = standardButtonPressed;\n buttonName = buttonPressed;\n } else if (functionButtonPressed) {\n buttonDOM = functionButtonPressed;\n buttonName = `{${buttonPressed}}`;\n } else {\n return;\n }\n\n const applyButtonStyle = (buttonElement: HTMLElement) => {\n buttonElement.style.background =\n options.physicalKeyboardHighlightBgColor || \"#dadce4\";\n buttonElement.style.color =\n options.physicalKeyboardHighlightTextColor || \"black\";\n }\n\n if (buttonDOM) {\n if(Array.isArray(buttonDOM)){\n buttonDOM.forEach(buttonElement => applyButtonStyle(buttonElement));\n\n // Even though we have an array of buttons, we just want to press one of them\n if (options.physicalKeyboardHighlightPress) {\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM[0]?.onpointerdown();\n } else if (options.physicalKeyboardHighlightPressUseClick) {\n buttonDOM[0]?.click();\n } else {\n instance.handleButtonClicked(buttonName, e);\n }\n }\n } else {\n applyButtonStyle(buttonDOM);\n\n if (options.physicalKeyboardHighlightPress) {\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM.onpointerdown();\n } else if (options.physicalKeyboardHighlightPressUseClick) {\n buttonDOM.click();\n } else {\n instance.handleButtonClicked(buttonName, e);\n }\n }\n }\n }\n });\n }\n\n handleHighlightKeyUp(e: KeyboardEvent) {\n const options = this.getOptions();\n\n if(options.physicalKeyboardHighlightPreventDefault && this.isMofifierKey(e)){\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n \n const buttonPressed = this.getSimpleKeyboardLayoutKey(e);\n\n this.dispatch((instance: any) => {\n const buttonDOM =\n instance.getButtonElement(buttonPressed) ||\n instance.getButtonElement(`{${buttonPressed}}`);\n\n const applyButtonStyle = (buttonElement: HTMLElement) => {\n if(buttonElement.removeAttribute){\n buttonElement.removeAttribute(\"style\");\n }\n };\n\n if (buttonDOM) {\n if(Array.isArray(buttonDOM)){\n buttonDOM.forEach(buttonElement => applyButtonStyle(buttonElement));\n\n // Even though we have an array of buttons, we just want to press one of them\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM[0]?.onpointerup();\n }\n } else {\n applyButtonStyle(buttonDOM);\n\n if (options.physicalKeyboardHighlightPressUsePointerEvents) {\n buttonDOM.onpointerup();\n }\n }\n }\n });\n }\n\n /**\n * Transforms a KeyboardEvent's \"key.code\" string into a simple-keyboard layout format\n * @param {object} e The KeyboardEvent\n */\n getSimpleKeyboardLayoutKey(e: KeyboardEvent) {\n let output = \"\";\n const keyId = e.code || e.key || this.keyCodeToKey(e?.keyCode);\n\n if (\n keyId?.includes(\"Numpad\") ||\n keyId?.includes(\"Shift\") ||\n keyId?.includes(\"Space\") ||\n keyId?.includes(\"Backspace\") ||\n keyId?.includes(\"Control\") ||\n keyId?.includes(\"Alt\") ||\n keyId?.includes(\"Meta\")\n ) {\n output = e.code || \"\";\n } else {\n output = e.key || this.keyCodeToKey(e?.keyCode) || \"\";\n }\n\n return output.length > 1 ? output?.toLowerCase() : output;\n }\n\n /**\n * Retrieve key from keyCode\n */\n keyCodeToKey(keyCode: number): string {\n return {\n 8: \"Backspace\",\n 9: \"Tab\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Ctrl\",\n 18: \"Alt\",\n 19: \"Pause\",\n 20: \"CapsLock\",\n 27: \"Esc\",\n 32: \"Space\",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 45: \"Insert\",\n 46: \"Delete\",\n 48: \"0\",\n 49: \"1\",\n 50: \"2\",\n 51: \"3\",\n 52: \"4\",\n 53: \"5\",\n 54: \"6\",\n 55: \"7\",\n 56: \"8\",\n 57: \"9\",\n 65: \"A\",\n 66: \"B\",\n 67: \"C\",\n 68: \"D\",\n 69: \"E\",\n 70: \"F\",\n 71: \"G\",\n 72: \"H\",\n 73: \"I\",\n 74: \"J\",\n 75: \"K\",\n 76: \"L\",\n 77: \"M\",\n 78: \"N\",\n 79: \"O\",\n 80: \"P\",\n 81: \"Q\",\n 82: \"R\",\n 83: \"S\",\n 84: \"T\",\n 85: \"U\",\n 86: \"V\",\n 87: \"W\",\n 88: \"X\",\n 89: \"Y\",\n 90: \"Z\",\n 91: \"Meta\",\n 96: \"Numpad0\",\n 97: \"Numpad1\",\n 98: \"Numpad2\",\n 99: \"Numpad3\",\n 100: \"Numpad4\",\n 101: \"Numpad5\",\n 102: \"Numpad6\",\n 103: \"Numpad7\",\n 104: \"Numpad8\",\n 105: \"Numpad9\",\n 106: \"NumpadMultiply\",\n 107: \"NumpadAdd\",\n 109: \"NumpadSubtract\",\n 110: \"NumpadDecimal\",\n 111: \"NumpadDivide\",\n 112: \"F1\",\n 113: \"F2\",\n 114: \"F3\",\n 115: \"F4\",\n 116: \"F5\",\n 117: \"F6\",\n 118: \"F7\",\n 119: \"F8\",\n 120: \"F9\",\n 121: \"F10\",\n 122: \"F11\",\n 123: \"F12\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\",\n }[keyCode] || \"\";\n }\n\n isMofifierKey = (e: KeyboardEvent): boolean => {\n return (\n e.altKey\n || e.ctrlKey\n || e.shiftKey\n || [\"Tab\", \"CapsLock\", \"Esc\", \"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"].includes(\n e.code || e.key || this.keyCodeToKey(e?.keyCode)\n )\n )\n }\n}\n\nexport default PhysicalKeyboard;\n","import \"./css/CandidateBox.css\";\n\nimport Utilities from \"../services/Utilities\";\nimport {\n CandidateBoxParams,\n CandidateBoxRenderParams,\n CandidateBoxShowParams,\n KeyboardOptions,\n} from \"./../interfaces\";\n\nclass CandidateBox {\n utilities: Utilities;\n options: KeyboardOptions;\n candidateBoxElement!: HTMLDivElement;\n pageIndex = 0;\n pageSize: number;\n\n constructor({ utilities, options }: CandidateBoxParams) {\n this.utilities = utilities;\n this.options = options;\n Utilities.bindMethods(CandidateBox, this);\n this.pageSize = this.utilities.getOptions().layoutCandidatesPageSize || 5;\n }\n\n destroy() {\n if (this.candidateBoxElement) {\n this.candidateBoxElement.remove();\n this.pageIndex = 0;\n }\n }\n\n show({\n candidateValue,\n targetElement,\n onSelect,\n }: CandidateBoxShowParams): void {\n if (!candidateValue || !candidateValue.length) {\n return;\n }\n\n const candidateListPages = this.utilities.chunkArray(\n candidateValue.split(\" \"),\n this.pageSize\n );\n\n this.renderPage({\n candidateListPages,\n targetElement,\n pageIndex: this.pageIndex,\n nbPages: candidateListPages.length,\n onItemSelected: (selectedCandidate: string, e: MouseEvent) => {\n onSelect(selectedCandidate, e);\n this.destroy();\n },\n });\n }\n\n renderPage({\n candidateListPages,\n targetElement,\n pageIndex,\n nbPages,\n onItemSelected,\n }: CandidateBoxRenderParams) {\n // Remove current candidate box, if any\n this.candidateBoxElement?.remove();\n\n // Create candidate box element\n this.candidateBoxElement = document.createElement(\"div\");\n this.candidateBoxElement.className = \"hg-candidate-box\";\n\n // Candidate box list\n const candidateListULElement = document.createElement(\"ul\");\n candidateListULElement.className = \"hg-candidate-box-list\";\n\n // Create Candidate box list items\n candidateListPages[pageIndex].forEach((candidateListItem) => {\n const candidateListLIElement = document.createElement(\"li\");\n const getMouseEvent = () => {\n const mouseEvent = new (this.options.useTouchEvents ? TouchEvent : MouseEvent)(\"click\");\n Object.defineProperty(mouseEvent, \"target\", {\n value: candidateListLIElement,\n });\n return mouseEvent;\n };\n\n candidateListLIElement.className = \"hg-candidate-box-list-item\";\n candidateListLIElement.innerHTML = this.options.display?.[candidateListItem] || candidateListItem;\n\n if(this.options.useTouchEvents) {\n candidateListLIElement.ontouchstart = (e: any) =>\n onItemSelected(candidateListItem, e || getMouseEvent());\n } else {\n candidateListLIElement.onclick = (e = getMouseEvent() as MouseEvent) =>\n onItemSelected(candidateListItem, e);\n }\n\n // Append list item to ul\n candidateListULElement.appendChild(candidateListLIElement);\n });\n\n // Add previous button\n const isPrevBtnElementActive = pageIndex > 0;\n const prevBtnElement = document.createElement(\"div\");\n prevBtnElement.classList.add(\"hg-candidate-box-prev\");\n isPrevBtnElementActive &&\n prevBtnElement.classList.add(\"hg-candidate-box-btn-active\");\n\n const prevBtnElementClickAction = () => {\n if (!isPrevBtnElementActive) return;\n this.renderPage({\n candidateListPages,\n targetElement,\n pageIndex: pageIndex - 1,\n nbPages,\n onItemSelected,\n });\n };\n\n if(this.options.useTouchEvents) {\n prevBtnElement.ontouchstart = prevBtnElementClickAction;\n } else {\n prevBtnElement.onclick = prevBtnElementClickAction;\n }\n \n this.candidateBoxElement.appendChild(prevBtnElement);\n\n // Add elements to container\n this.candidateBoxElement.appendChild(candidateListULElement);\n\n // Add next button\n const isNextBtnElementActive = pageIndex < nbPages - 1;\n const nextBtnElement = document.createElement(\"div\");\n nextBtnElement.classList.add(\"hg-candidate-box-next\");\n isNextBtnElementActive &&\n nextBtnElement.classList.add(\"hg-candidate-box-btn-active\");\n\n const nextBtnElementClickAction = () => {\n if (!isNextBtnElementActive) return;\n this.renderPage({\n candidateListPages,\n targetElement,\n pageIndex: pageIndex + 1,\n nbPages,\n onItemSelected,\n });\n };\n\n if(this.options.useTouchEvents) {\n nextBtnElement.ontouchstart = nextBtnElementClickAction;\n } else {\n nextBtnElement.onclick = nextBtnElementClickAction;\n }\n\n this.candidateBoxElement.appendChild(nextBtnElement);\n\n // Append candidate box to target element\n targetElement.prepend(this.candidateBoxElement);\n }\n}\n\nexport default CandidateBox;\n","import \"./css/Keyboard.css\";\n\n// Services\nimport { getDefaultLayout } from \"../services/KeyboardLayout\";\nimport PhysicalKeyboard from \"../services/PhysicalKeyboard\";\nimport Utilities from \"../services/Utilities\";\nimport {\n KeyboardOptions,\n KeyboardInput,\n KeyboardButtonElements,\n KeyboardHandlerEvent,\n KeyboardElement,\n} from \"../interfaces\";\nimport CandidateBox from \"./CandidateBox\";\n\n/**\n * Root class for simple-keyboard.\n * This class:\n * - Parses the options\n * - Renders the rows and buttons\n * - Handles button functionality\n */\nclass SimpleKeyboard {\n input!: KeyboardInput;\n options!: KeyboardOptions;\n utilities!: Utilities;\n caretPosition!: number | null;\n caretPositionEnd!: number | null;\n keyboardDOM!: KeyboardElement;\n keyboardPluginClasses!: string;\n keyboardDOMClass!: string;\n buttonElements!: KeyboardButtonElements;\n currentInstanceName!: string;\n allKeyboardInstances!: { [key: string]: SimpleKeyboard };\n keyboardInstanceNames!: string[];\n isFirstKeyboardInstance!: boolean;\n physicalKeyboard!: PhysicalKeyboard;\n modules!: { [key: string]: any };\n activeButtonClass!: string;\n holdInteractionTimeout!: number;\n holdTimeout!: number;\n isMouseHold!: boolean;\n initialized!: boolean;\n candidateBox!: CandidateBox | null;\n keyboardRowsDOM!: KeyboardElement;\n defaultName = \"default\";\n activeInputElement: HTMLInputElement | HTMLTextAreaElement | null = null;\n\n /**\n * Creates an instance of SimpleKeyboard\n * @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object.\n */\n constructor(\n selectorOrOptions?: string | HTMLDivElement | KeyboardOptions,\n keyboardOptions?: KeyboardOptions\n ) {\n if (typeof window === \"undefined\") return;\n\n const {\n keyboardDOMClass,\n keyboardDOM,\n options = {},\n } = this.handleParams(selectorOrOptions, keyboardOptions);\n\n /**\n * Initializing Utilities\n */\n this.utilities = new Utilities({\n getOptions: this.getOptions,\n getCaretPosition: this.getCaretPosition,\n getCaretPositionEnd: this.getCaretPositionEnd,\n dispatch: this.dispatch,\n });\n\n /**\n * Caret position\n */\n this.caretPosition = null;\n\n /**\n * Caret position end\n */\n this.caretPositionEnd = null;\n\n /**\n * Processing options\n */\n this.keyboardDOM = keyboardDOM;\n\n /**\n * @type {object}\n * @property {object} layout Modify the keyboard layout.\n * @property {string} layoutName Specifies which layout should be used.\n * @property {object} display Replaces variable buttons (such as {bksp}) with a human-friendly name (e.g.: “backspace”).\n * @property {boolean} mergeDisplay By default, when you set the display property, you replace the default one. This setting merges them instead.\n * @property {string} theme A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space.\n * @property {array} buttonTheme A prop to add your own css classes to one or several buttons.\n * @property {array} buttonAttributes A prop to add your own attributes to one or several buttons.\n * @property {boolean} debug Runs a console.log every time a key is pressed. Displays the buttons pressed and the current input.\n * @property {boolean} newLineOnEnter Specifies whether clicking the “ENTER” button will input a newline (\\n) or not.\n * @property {boolean} tabCharOnTab Specifies whether clicking the “TAB” button will input a tab character (\\t) or not.\n * @property {string} inputName Allows you to use a single simple-keyboard instance for several inputs.\n * @property {number} maxLength Restrains all of simple-keyboard inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {object} maxLength Restrains simple-keyboard’s individual inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {boolean} syncInstanceInputs When set to true, this option synchronizes the internal input of every simple-keyboard instance.\n * @property {boolean} physicalKeyboardHighlight Enable highlighting of keys pressed on physical keyboard.\n * @property {boolean} physicalKeyboardHighlightPress Presses keys highlighted by physicalKeyboardHighlight\n * @property {string} physicalKeyboardHighlightTextColor Define the text color that the physical keyboard highlighted key should have.\n * @property {string} physicalKeyboardHighlightBgColor Define the background color that the physical keyboard highlighted key should have.\n * @property {boolean} physicalKeyboardHighlightPressUseClick Whether physicalKeyboardHighlightPress should use clicks to trigger buttons.\n * @property {boolean} physicalKeyboardHighlightPressUsePointerEvents Whether physicalKeyboardHighlightPress should use pointer events to trigger buttons.\n * @property {boolean} physicalKeyboardHighlightPreventDefault Whether physicalKeyboardHighlight should use preventDefault to disable default browser actions.\n * @property {boolean} preventMouseDownDefault Calling preventDefault for the mousedown events keeps the focus on the input.\n * @property {boolean} preventMouseUpDefault Calling preventDefault for the mouseup events.\n * @property {boolean} stopMouseDownPropagation Stops pointer down events on simple-keyboard buttons from bubbling to parent elements.\n * @property {boolean} stopMouseUpPropagation Stops pointer up events on simple-keyboard buttons from bubbling to parent elements.\n * @property {function(button: string):string} onKeyPress Executes the callback function on key press. Returns button layout name (i.e.: “{shift}”).\n * @property {function(input: string):string} onChange Executes the callback function on input change. Returns the current input’s string.\n * @property {function} onRender Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n * @property {function} onInit Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n * @property {function(inputs: object):object} onChangeAll Executes the callback function on input change. Returns the input object with all defined inputs.\n * @property {boolean} useButtonTag Render buttons as a button element instead of a div element.\n * @property {boolean} disableCaretPositioning A prop to ensure characters are always be added/removed at the end of the string.\n * @property {object} inputPattern Restrains input(s) change to the defined regular expression pattern.\n * @property {boolean} useTouchEvents Instructs simple-keyboard to use touch events instead of click events.\n * @property {boolean} autoUseTouchEvents Enable useTouchEvents automatically when touch device is detected.\n * @property {boolean} useMouseEvents Opt out of PointerEvents handling, falling back to the prior mouse event logic.\n * @property {function} destroy Clears keyboard listeners and DOM elements.\n * @property {boolean} disableButtonHold Disable button hold action.\n * @property {boolean} rtl Adds unicode right-to-left control characters to input return values.\n * @property {function} onKeyReleased Executes the callback function on key release.\n * @property {array} modules Module classes to be loaded by simple-keyboard.\n * @property {boolean} enableLayoutCandidates Enable input method editor candidate list support.\n * @property {object} excludeFromLayout Buttons to exclude from layout\n * @property {number} layoutCandidatesPageSize Determines size of layout candidate list\n * @property {boolean} layoutCandidatesCaseSensitiveMatch Determines whether layout candidate match should be case sensitive.\n * @property {boolean} disableCandidateNormalization Disables the automatic normalization for selected layout candidates\n * @property {boolean} enableLayoutCandidatesKeyPress Enables onKeyPress triggering for layoutCandidate items\n */\n this.options = {\n layoutName: \"default\",\n theme: \"hg-theme-default\",\n inputName: \"default\",\n preventMouseDownDefault: false,\n enableLayoutCandidates: true,\n excludeFromLayout: {},\n ...options,\n };\n\n /**\n * @type {object} Classes identifying loaded plugins\n */\n this.keyboardPluginClasses = \"\";\n\n /**\n * Bindings\n */\n Utilities.bindMethods(SimpleKeyboard, this);\n\n /**\n * simple-keyboard uses a non-persistent internal input to keep track of the entered string (the variable `keyboard.input`).\n * This removes any dependency to input DOM elements. You can type and directly display the value in a div element, for example.\n * @example\n * // To get entered input\n * const input = keyboard.getInput();\n *\n * // To clear entered input.\n * keyboard.clearInput();\n *\n * @type {object}\n * @property {object} default Default SimpleKeyboard internal input.\n * @property {object} myInputName Example input that can be set through `options.inputName:\"myInputName\"`.\n */\n const { inputName = this.defaultName } = this.options;\n this.input = {};\n this.input[inputName] = \"\";\n\n /**\n * @type {string} DOM class of the keyboard wrapper, normally \"simple-keyboard\" by default.\n */\n this.keyboardDOMClass = keyboardDOMClass;\n\n /**\n * @type {object} Contains the DOM elements of every rendered button, the key being the button's layout name (e.g.: \"{enter}\").\n */\n this.buttonElements = {};\n\n /**\n * Simple-keyboard Instances\n * This enables multiple simple-keyboard support with easier management\n */\n if (!window[\"SimpleKeyboardInstances\"])\n window[\"SimpleKeyboardInstances\"] = {};\n\n this.currentInstanceName = this.utilities.camelCase(this.keyboardDOMClass);\n window[\"SimpleKeyboardInstances\"][this.currentInstanceName] = this;\n\n /**\n * Instance vars\n */\n this.allKeyboardInstances = window[\"SimpleKeyboardInstances\"];\n this.keyboardInstanceNames = Object.keys(window[\"SimpleKeyboardInstances\"]);\n this.isFirstKeyboardInstance =\n this.keyboardInstanceNames[0] === this.currentInstanceName;\n\n /**\n * Physical Keyboard support\n */\n this.physicalKeyboard = new PhysicalKeyboard({\n dispatch: this.dispatch,\n getOptions: this.getOptions,\n });\n\n /**\n * Initializing CandidateBox\n */\n this.candidateBox = this.options.enableLayoutCandidates\n ? new CandidateBox({\n utilities: this.utilities,\n options: this.options,\n })\n : null;\n\n /**\n * Rendering keyboard\n */\n if (this.keyboardDOM) this.render();\n else {\n console.warn(`\".${keyboardDOMClass}\" was not found in the DOM.`);\n throw new Error(\"KEYBOARD_DOM_ERROR\");\n }\n\n /**\n * Modules\n */\n this.modules = {};\n this.loadModules();\n }\n\n /**\n * parseParams\n */\n handleParams = (\n selectorOrOptions?: string | HTMLDivElement | KeyboardOptions,\n keyboardOptions?: KeyboardOptions\n ): {\n keyboardDOMClass: string;\n keyboardDOM: KeyboardElement;\n options: Partial;\n } => {\n let keyboardDOMClass;\n let keyboardDOM;\n let options;\n\n /**\n * If first parameter is a string:\n * Consider it as an element's class\n */\n if (typeof selectorOrOptions === \"string\") {\n keyboardDOMClass = selectorOrOptions.split(\".\").join(\"\");\n keyboardDOM = document.querySelector(\n `.${keyboardDOMClass}`\n ) as KeyboardElement;\n options = keyboardOptions;\n\n /**\n * If first parameter is an KeyboardElement\n * Consider it as the keyboard DOM element\n */\n } else if (selectorOrOptions instanceof HTMLDivElement) {\n /**\n * This element must have a class, otherwise throw\n */\n if (!selectorOrOptions.className) {\n console.warn(\"Any DOM element passed as parameter must have a class.\");\n throw new Error(\"KEYBOARD_DOM_CLASS_ERROR\");\n }\n\n keyboardDOMClass = selectorOrOptions.className.split(\" \")[0];\n keyboardDOM = selectorOrOptions;\n options = keyboardOptions;\n\n /**\n * Otherwise, search for .simple-keyboard DOM element\n */\n } else {\n keyboardDOMClass = \"simple-keyboard\";\n keyboardDOM = document.querySelector(\n `.${keyboardDOMClass}`\n ) as KeyboardElement;\n options = selectorOrOptions;\n }\n\n return {\n keyboardDOMClass,\n keyboardDOM,\n options,\n };\n };\n\n /**\n * Getters\n */\n getOptions = (): KeyboardOptions => this.options;\n getCaretPosition = (): number | null => this.caretPosition;\n getCaretPositionEnd = (): number | null => this.caretPositionEnd;\n\n /**\n * Changes the internal caret position\n * @param {number} position The caret's start position\n * @param {number} positionEnd The caret's end position\n */\n setCaretPosition(position: number | null, endPosition = position): void {\n this.caretPosition = position;\n this.caretPositionEnd = endPosition;\n }\n\n /**\n * Retrieve the candidates for a given input\n * @param input The input string to check\n */\n getInputCandidates(\n input: string\n ): { candidateKey: string; candidateValue: string } | Record {\n const {\n layoutCandidates: layoutCandidatesObj,\n layoutCandidatesCaseSensitiveMatch,\n } = this.options;\n\n if (!layoutCandidatesObj || typeof layoutCandidatesObj !== \"object\") {\n return {};\n }\n\n const layoutCandidates = Object.keys(layoutCandidatesObj).filter(\n (layoutCandidate: string) => {\n const inputSubstr =\n input.substring(0, this.getCaretPositionEnd() || 0) || input;\n const regexp = new RegExp(\n `${this.utilities.escapeRegex(layoutCandidate)}$`,\n layoutCandidatesCaseSensitiveMatch ? \"g\" : \"gi\"\n );\n const matches = [...inputSubstr.matchAll(regexp)];\n return !!matches.length;\n }\n );\n\n if (layoutCandidates.length > 1) {\n const candidateKey = layoutCandidates.sort(\n (a, b) => b.length - a.length\n )[0];\n return {\n candidateKey,\n candidateValue: layoutCandidatesObj[candidateKey],\n };\n } else if (layoutCandidates.length) {\n const candidateKey = layoutCandidates[0];\n return {\n candidateKey,\n candidateValue: layoutCandidatesObj[candidateKey],\n };\n } else {\n return {};\n }\n }\n\n /**\n * Shows a suggestion box with a list of candidate words\n * @param candidates The chosen candidates string as defined in the layoutCandidates option\n * @param targetElement The element next to which the candidates box will be shown\n */\n showCandidatesBox(\n candidateKey: string,\n candidateValue: string,\n targetElement: KeyboardElement\n ): void {\n if (this.candidateBox) {\n this.candidateBox.show({\n candidateValue,\n targetElement,\n onSelect: (selectedCandidate: string, e: MouseEvent) => {\n const {\n layoutCandidatesCaseSensitiveMatch,\n disableCandidateNormalization,\n enableLayoutCandidatesKeyPress\n } = this.options;\n\n let candidateStr = selectedCandidate;\n\n if(!disableCandidateNormalization) {\n /**\n * Making sure that our suggestions are not composed characters\n */\n candidateStr = selectedCandidate.normalize(\"NFD\");\n }\n\n const currentInput = this.getInput(this.options.inputName, true);\n const initialCaretPosition = this.getCaretPositionEnd() || 0;\n const inputSubstr =\n currentInput.substring(0, initialCaretPosition || 0) ||\n currentInput;\n\n const regexp = new RegExp(\n `${this.utilities.escapeRegex(candidateKey)}$`,\n layoutCandidatesCaseSensitiveMatch ? \"g\" : \"gi\"\n );\n const newInputSubstr = inputSubstr.replace(\n regexp,\n candidateStr\n );\n const newInput = currentInput.replace(inputSubstr, newInputSubstr);\n\n const caretPositionDiff = newInputSubstr.length - inputSubstr.length;\n let newCaretPosition =\n (initialCaretPosition || currentInput.length) + caretPositionDiff;\n\n if (newCaretPosition < 0) newCaretPosition = 0;\n\n this.setInput(newInput, this.options.inputName, true);\n this.setCaretPosition(newCaretPosition);\n\n /**\n * Calling onKeyPress\n * We pass in the composed candidate instead of the decomposed one\n * To prevent confusion for users\n */\n if (enableLayoutCandidatesKeyPress && typeof this.options.onKeyPress === \"function\")\n this.options.onKeyPress(selectedCandidate, e);\n\n if (typeof this.options.onChange === \"function\")\n this.options.onChange(\n this.getInput(this.options.inputName, true),\n e\n );\n\n /**\n * Calling onChangeAll\n */\n if (typeof this.options.onChangeAll === \"function\")\n this.options.onChangeAll(this.getAllInputs(), e);\n },\n });\n }\n }\n\n /**\n * Handles clicks made to keyboard buttons\n * @param {string} button The button's layout name.\n */\n handleButtonClicked(button: string, e?: KeyboardHandlerEvent): void {\n const { inputName = this.defaultName, debug } = this.options;\n /**\n * Ignoring placeholder buttons\n */\n if (button === \"{//}\") return;\n\n /**\n * Creating inputName if it doesn't exist\n */\n if (!this.input[inputName]) this.input[inputName] = \"\";\n\n /**\n * Calculating new input\n */\n const updatedInput = this.utilities.getUpdatedInput(\n button,\n this.input[inputName],\n this.caretPosition,\n this.caretPositionEnd\n );\n\n /**\n * EDGE CASE: Check for whole input selection changes that will yield same updatedInput\n */\n if (this.utilities.isStandardButton(button) && this.activeInputElement) {\n const isEntireInputSelection =\n this.input[inputName] &&\n this.input[inputName] === updatedInput &&\n this.caretPosition === 0 &&\n this.caretPositionEnd === updatedInput.length;\n\n if (isEntireInputSelection) {\n this.setInput(\"\", this.options.inputName, true);\n this.setCaretPosition(0);\n this.activeInputElement.value = \"\";\n this.activeInputElement.setSelectionRange(0, 0);\n this.handleButtonClicked(button, e);\n return;\n }\n }\n\n /**\n * Calling onKeyPress\n */\n if (typeof this.options.onKeyPress === \"function\")\n this.options.onKeyPress(button, e);\n\n if (\n // If input will change as a result of this button press\n this.input[inputName] !== updatedInput &&\n // This pertains to the \"inputPattern\" option:\n // If inputPattern isn't set\n (!this.options.inputPattern ||\n // Or, if it is set and if the pattern is valid - we proceed.\n (this.options.inputPattern && this.inputPatternIsValid(updatedInput)))\n ) {\n /**\n * If maxLength and handleMaxLength yield true, halting\n */\n if (\n this.options.maxLength &&\n this.utilities.handleMaxLength(this.input, updatedInput)\n ) {\n return;\n }\n\n /**\n * Updating input\n */\n const newInputValue = this.utilities.getUpdatedInput(\n button,\n this.input[inputName],\n this.caretPosition,\n this.caretPositionEnd,\n true\n );\n\n this.setInput(newInputValue, this.options.inputName, true);\n\n if (debug) console.log(\"Input changed:\", this.getAllInputs());\n\n if (this.options.debug) {\n console.log(\n \"Caret at: \",\n this.getCaretPosition(),\n this.getCaretPositionEnd(),\n `(${this.keyboardDOMClass})`,\n e?.type\n );\n }\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n\n /**\n * Calling onChange\n */\n if (typeof this.options.onChange === \"function\")\n this.options.onChange(this.getInput(this.options.inputName, true), e);\n\n /**\n * Calling onChangeAll\n */\n if (typeof this.options.onChangeAll === \"function\")\n this.options.onChangeAll(this.getAllInputs(), e);\n\n /**\n * Check if this new input has candidates (suggested words)\n */\n if (e?.target && this.options.enableLayoutCandidates) {\n const { candidateKey, candidateValue } =\n this.getInputCandidates(updatedInput);\n\n if (candidateKey && candidateValue) {\n this.showCandidatesBox(\n candidateKey,\n candidateValue,\n this.keyboardDOM\n );\n } else {\n this.candidateBox?.destroy();\n }\n }\n }\n\n /**\n * After a button is clicked the selection (if any) will disappear\n * we should reflect this in our state, as applicable\n */\n if(this.caretPositionEnd && this.caretPosition !== this.caretPositionEnd){\n this.setCaretPosition(this.caretPositionEnd, this.caretPositionEnd);\n\n if(this.activeInputElement){\n this.activeInputElement.setSelectionRange(this.caretPositionEnd, this.caretPositionEnd);\n }\n \n if(this.options.debug){\n console.log(\"Caret position aligned\", this.caretPosition);\n }\n }\n\n if (debug) {\n console.log(\"Key pressed:\", button);\n }\n }\n\n /**\n * Get mouse hold state\n */\n getMouseHold() {\n return this.isMouseHold;\n }\n\n /**\n * Mark mouse hold state as set\n */\n setMouseHold(value: boolean) {\n if (this.options.syncInstanceInputs) {\n this.dispatch((instance: SimpleKeyboard) => {\n instance.isMouseHold = value;\n });\n } else {\n this.isMouseHold = value;\n }\n }\n\n /**\n * Handles button mousedown\n */\n /* istanbul ignore next */\n handleButtonMouseDown(button: string, e: KeyboardHandlerEvent): void {\n if (e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n if (this.options.stopMouseDownPropagation) e.stopPropagation();\n\n /**\n * Add active class\n */\n e.target.classList.add(this.activeButtonClass);\n }\n\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n if (this.holdTimeout) clearTimeout(this.holdTimeout);\n\n /**\n * @type {boolean} Whether the mouse is being held onKeyPress\n */\n this.setMouseHold(true);\n\n /**\n * @type {object} Time to wait until a key hold is detected\n */\n if (!this.options.disableButtonHold) {\n this.holdTimeout = window.setTimeout(() => {\n if (\n (this.getMouseHold() &&\n // TODO: This needs to be configurable through options\n ((!button.includes(\"{\") && !button.includes(\"}\")) ||\n button === \"{delete}\" ||\n button === \"{backspace}\" ||\n button === \"{bksp}\" ||\n button === \"{space}\" ||\n button === \"{tab}\")) ||\n button === \"{arrowright}\" ||\n button === \"{arrowleft}\" ||\n button === \"{arrowup}\" ||\n button === \"{arrowdown}\"\n ) {\n if (this.options.debug) console.log(\"Button held:\", button);\n\n this.handleButtonHold(button);\n }\n clearTimeout(this.holdTimeout);\n }, 500);\n }\n }\n\n /**\n * Handles button mouseup\n */\n handleButtonMouseUp(button?: string, e?: KeyboardHandlerEvent): void {\n if (e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseUpDefault && e.preventDefault)\n e.preventDefault();\n if (this.options.stopMouseUpPropagation && e.stopPropagation)\n e.stopPropagation();\n\n /* istanbul ignore next */\n const isKeyboard =\n e.target === this.keyboardDOM ||\n (e.target && this.keyboardDOM.contains(e.target)) ||\n (this.candidateBox &&\n this.candidateBox.candidateBoxElement &&\n (e.target === this.candidateBox.candidateBoxElement ||\n (e.target &&\n this.candidateBox.candidateBoxElement.contains(e.target))));\n\n /**\n * On click outside, remove candidateBox\n */\n if (!isKeyboard && this.candidateBox) {\n this.candidateBox.destroy();\n }\n }\n\n /**\n * Remove active class\n */\n this.recurseButtons((buttonElement: Element) => {\n buttonElement.classList.remove(this.activeButtonClass);\n });\n\n this.setMouseHold(false);\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * Calling onKeyReleased\n */\n if (button && typeof this.options.onKeyReleased === \"function\")\n this.options.onKeyReleased(button, e);\n }\n\n /**\n * Handles container mousedown\n */\n handleKeyboardContainerMouseDown(e: KeyboardHandlerEvent): void {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n }\n\n /**\n * Handles button hold\n */\n /* istanbul ignore next */\n handleButtonHold(button: string): void {\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * @type {object} Timeout dictating the speed of key hold iterations\n */\n this.holdInteractionTimeout = window.setTimeout(() => {\n if (this.getMouseHold()) {\n this.handleButtonClicked(button);\n this.handleButtonHold(button);\n } else {\n clearTimeout(this.holdInteractionTimeout);\n }\n }, 100);\n }\n\n /**\n * Send a command to all simple-keyboard instances (if you have several instances).\n */\n syncInstanceInputs(): void {\n this.dispatch((instance: SimpleKeyboard) => {\n instance.replaceInput(this.input);\n instance.setCaretPosition(this.caretPosition, this.caretPositionEnd);\n });\n }\n\n /**\n * Clear the keyboard’s input.\n * @param {string} [inputName] optional - the internal input to select\n */\n clearInput(\n inputName: string = this.options.inputName || this.defaultName\n ): void {\n this.input[inputName] = \"\";\n\n /**\n * Reset caretPosition\n */\n this.setCaretPosition(0);\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Get the keyboard’s input (You can also get it from the onChange prop).\n * @param {string} [inputName] optional - the internal input to select\n */\n getInput(\n inputName: string = this.options.inputName || this.defaultName,\n skipSync = false\n ): string {\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs && !skipSync) this.syncInstanceInputs();\n\n if (this.options.rtl) {\n // Remove existing control chars\n const inputWithoutRTLControl = this.input[inputName]\n .replace(\"\\u202B\", \"\")\n .replace(\"\\u202C\", \"\");\n\n return \"\\u202B\" + inputWithoutRTLControl + \"\\u202C\";\n } else {\n return this.input[inputName];\n }\n }\n\n /**\n * Get all simple-keyboard inputs\n */\n getAllInputs(): KeyboardInput {\n const output = {};\n const inputNames = Object.keys(this.input);\n\n inputNames.forEach((inputName) => {\n output[inputName] = this.getInput(inputName, true);\n });\n\n return output;\n }\n\n /**\n * Set the keyboard’s input.\n * @param {string} input the input value\n * @param {string} inputName optional - the internal input to select\n */\n setInput(\n input: string,\n inputName: string = this.options.inputName || this.defaultName,\n skipSync?: boolean\n ): void {\n this.input[inputName] = input;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (!skipSync && this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Replace the input object (`keyboard.input`)\n * @param {object} inputObj The input object\n */\n replaceInput(inputObj: KeyboardInput): void {\n this.input = inputObj;\n }\n\n /**\n * Set new option or modify existing ones after initialization.\n * @param {object} options The options to set\n */\n setOptions(options = {}): void {\n const changedOptions = this.changedOptions(options);\n this.options = Object.assign(this.options, options);\n\n if (changedOptions.length) {\n if (this.options.debug) {\n console.log(\"changedOptions\", changedOptions);\n }\n\n /**\n * Some option changes require adjustments before re-render\n */\n this.onSetOptions(changedOptions);\n\n /**\n * Rendering\n */\n this.render();\n }\n }\n\n /**\n * Detecting changes to non-function options\n * This allows us to ascertain whether a button re-render is needed\n */\n changedOptions(newOptions: Partial): string[] {\n return Object.keys(newOptions).filter(\n (optionName) =>\n JSON.stringify(newOptions[optionName]) !==\n JSON.stringify(this.options[optionName])\n );\n }\n\n /**\n * Executing actions depending on changed options\n * @param {object} options The options to set\n */\n onSetOptions(changedOptions: string[] = []): void {\n /**\n * Changed: layoutName\n */\n if (changedOptions.includes(\"layoutName\")) {\n /**\n * Reset candidateBox\n */\n if (this.candidateBox) {\n this.candidateBox.destroy();\n }\n }\n\n /**\n * Changed: layoutCandidatesPageSize, layoutCandidates\n */\n if (\n changedOptions.includes(\"layoutCandidatesPageSize\") ||\n changedOptions.includes(\"layoutCandidates\")\n ) {\n /**\n * Reset and recreate candidateBox\n */\n if (this.candidateBox) {\n this.candidateBox.destroy();\n this.candidateBox = new CandidateBox({\n utilities: this.utilities,\n options: this.options,\n });\n }\n }\n }\n\n /**\n * Remove all keyboard rows and reset keyboard values.\n * Used internally between re-renders.\n */\n resetRows(): void {\n if (this.keyboardRowsDOM) {\n this.keyboardRowsDOM.remove();\n }\n\n this.keyboardDOM.className = this.keyboardDOMClass;\n this.keyboardDOM.setAttribute(\"data-skInstance\", this.currentInstanceName);\n this.buttonElements = {};\n }\n\n /**\n * Send a command to all simple-keyboard instances at once (if you have multiple instances).\n * @param {function(instance: object, key: string)} callback Function to run on every instance\n */\n // eslint-disable-next-line no-unused-vars\n dispatch(callback: (instance: SimpleKeyboard, key?: string) => void): void {\n if (!window[\"SimpleKeyboardInstances\"]) {\n console.warn(\n `SimpleKeyboardInstances is not defined. Dispatch cannot be called.`\n );\n throw new Error(\"INSTANCES_VAR_ERROR\");\n }\n\n return Object.keys(window[\"SimpleKeyboardInstances\"]).forEach((key) => {\n callback(window[\"SimpleKeyboardInstances\"][key], key);\n });\n }\n\n /**\n * Adds/Modifies an entry to the `buttonTheme`. Basically a way to add a class to a button.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n addButtonTheme(buttons: string, className: string): void {\n if (!className || !buttons) return;\n\n buttons.split(\" \").forEach((button) => {\n className.split(\" \").forEach((classNameItem) => {\n if (!this.options.buttonTheme) this.options.buttonTheme = [];\n\n let classNameFound = false;\n\n /**\n * If class is already defined, we add button to class definition\n */\n this.options.buttonTheme.map((buttonTheme) => {\n if (buttonTheme?.class.split(\" \").includes(classNameItem)) {\n classNameFound = true;\n\n const buttonThemeArray = buttonTheme.buttons.split(\" \");\n if (!buttonThemeArray.includes(button)) {\n classNameFound = true;\n buttonThemeArray.push(button);\n buttonTheme.buttons = buttonThemeArray.join(\" \");\n }\n }\n return buttonTheme;\n });\n\n /**\n * If class is not defined, we create a new entry\n */\n if (!classNameFound) {\n this.options.buttonTheme.push({\n class: classNameItem,\n buttons: buttons,\n });\n }\n });\n });\n\n this.render();\n }\n\n /**\n * Removes/Amends an entry to the `buttonTheme`. Basically a way to remove a class previously added to a button through buttonTheme or addButtonTheme.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n removeButtonTheme(buttons: string, className: string): void {\n /**\n * When called with empty parameters, remove all button themes\n */\n if (!buttons && !className) {\n this.options.buttonTheme = [];\n this.render();\n return;\n }\n\n /**\n * If buttons are passed and buttonTheme has items\n */\n if (\n buttons &&\n Array.isArray(this.options.buttonTheme) &&\n this.options.buttonTheme.length\n ) {\n const buttonArray = buttons.split(\" \");\n buttonArray.forEach((button) => {\n this.options?.buttonTheme?.map((buttonTheme, index) => {\n /**\n * If className is set, we affect the buttons only for that class\n * Otherwise, we afect all classes\n */\n if (\n (buttonTheme &&\n className &&\n className.includes(buttonTheme.class)) ||\n !className\n ) {\n const filteredButtonArray = buttonTheme?.buttons\n .split(\" \")\n .filter((item) => item !== button);\n\n /**\n * If buttons left, return them, otherwise, remove button Theme\n */\n if (buttonTheme && filteredButtonArray?.length) {\n buttonTheme.buttons = filteredButtonArray.join(\" \");\n } else {\n this.options.buttonTheme?.splice(index, 1);\n buttonTheme = null;\n }\n }\n\n return buttonTheme;\n });\n });\n\n this.render();\n }\n }\n\n /**\n * Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.\n * @param {string} button The button layout name to select\n */\n getButtonElement(\n button: string\n ): KeyboardElement | KeyboardElement[] | undefined {\n let output;\n\n const buttonArr = this.buttonElements[button];\n if (buttonArr) {\n if (buttonArr.length > 1) {\n output = buttonArr;\n } else {\n output = buttonArr[0];\n }\n }\n\n return output;\n }\n\n /**\n * This handles the \"inputPattern\" option\n * by checking if the provided inputPattern passes\n */\n inputPatternIsValid(inputVal: string): boolean {\n const inputPatternRaw = this.options.inputPattern;\n let inputPattern;\n\n /**\n * Check if input pattern is global or targeted to individual inputs\n */\n if (inputPatternRaw instanceof RegExp) {\n inputPattern = inputPatternRaw;\n } else {\n inputPattern =\n inputPatternRaw[this.options.inputName || this.defaultName];\n }\n\n if (inputPattern && inputVal) {\n const didInputMatch = inputPattern.test(inputVal);\n\n if (this.options.debug) {\n console.log(\n `inputPattern (\"${inputPattern}\"): ${\n didInputMatch ? \"passed\" : \"did not pass!\"\n }`\n );\n }\n\n return didInputMatch;\n } else {\n /**\n * inputPattern doesn't seem to be set for the current input, or input is empty. Pass.\n */\n return true;\n }\n }\n\n /**\n * Handles simple-keyboard event listeners\n */\n setEventListeners(): void {\n /**\n * Only first instance should set the event listeners\n */\n if (this.isFirstKeyboardInstance || !this.allKeyboardInstances) {\n if (this.options.debug) {\n console.log(`Caret handling started (${this.keyboardDOMClass})`);\n }\n\n const { physicalKeyboardHighlightPreventDefault = false } = this.options;\n\n /**\n * Event Listeners\n */\n document.addEventListener(\"keyup\", this.handleKeyUp, physicalKeyboardHighlightPreventDefault);\n document.addEventListener(\"keydown\", this.handleKeyDown, physicalKeyboardHighlightPreventDefault);\n document.addEventListener(\"mouseup\", this.handleMouseUp);\n document.addEventListener(\"touchend\", this.handleTouchEnd);\n document.addEventListener(\"selectionchange\", this.handleSelectionChange);\n document.addEventListener(\"select\", this.handleSelect);\n }\n }\n\n /**\n * Event Handler: KeyUp\n */\n handleKeyUp(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyUp(event);\n }\n }\n\n /**\n * Event Handler: KeyDown\n */\n handleKeyDown(event: KeyboardHandlerEvent): void {\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyDown(event);\n }\n }\n\n /**\n * Event Handler: MouseUp\n */\n handleMouseUp(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: TouchEnd\n */\n /* istanbul ignore next */\n handleTouchEnd(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: Select\n */\n /* istanbul ignore next */\n handleSelect(event: KeyboardHandlerEvent): void {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: SelectionChange\n */\n /* istanbul ignore next */\n handleSelectionChange(event: KeyboardHandlerEvent): void {\n /**\n * Firefox is not reporting the correct caret position through this event\n * https://github.com/hodgef/simple-keyboard/issues/1839\n */\n if(navigator.userAgent.includes('Firefox')){\n return;\n }\n this.caretEventHandler(event);\n }\n\n /**\n * Called by {@link setEventListeners} when an event that warrants a cursor position update is triggered\n */\n caretEventHandler(event: KeyboardHandlerEvent): void {\n let targetTagName: string;\n if (event.target.tagName) {\n targetTagName = event.target.tagName.toLowerCase();\n }\n\n this.dispatch((instance) => {\n let isKeyboard =\n event.target === instance.keyboardDOM ||\n (event.target && instance.keyboardDOM.contains(event.target));\n\n /**\n * If syncInstanceInputs option is enabled, make isKeyboard match any instance\n * not just the current one\n */\n if (this.options.syncInstanceInputs && Array.isArray(event.path)) {\n isKeyboard = event.path.some((item: HTMLElement) =>\n item?.hasAttribute?.(\"data-skInstance\")\n );\n }\n\n if (\n (targetTagName === \"textarea\" ||\n (targetTagName === \"input\" &&\n [\"text\", \"search\", \"url\", \"tel\", \"password\"].includes(\n event.target.type\n ))) &&\n !instance.options.disableCaretPositioning\n ) {\n /**\n * Tracks current cursor position\n * As keys are pressed, text will be added/removed at that position within the input.\n */\n let selectionStart = event.target.selectionStart;\n let selectionEnd = event.target.selectionEnd;\n\n if(instance.options.rtl){\n selectionStart = instance.utilities.getRtlOffset(selectionStart, instance.getInput());\n selectionEnd = instance.utilities.getRtlOffset(selectionEnd, instance.getInput());\n }\n\n instance.setCaretPosition(selectionStart, selectionEnd);\n\n /**\n * Tracking current input in order to handle caret positioning edge cases\n */\n this.activeInputElement = event.target;\n\n if (instance.options.debug) {\n console.log(\n \"Caret at: \",\n instance.getCaretPosition(),\n instance.getCaretPositionEnd(),\n event && event.target.tagName.toLowerCase(),\n `(${instance.keyboardDOMClass})`,\n event?.type\n );\n }\n } else if (\n (instance.options.disableCaretPositioning || !isKeyboard) &&\n event?.type !== \"selectionchange\"\n ) {\n /**\n * If we toggled off disableCaretPositioning, we must ensure caretPosition doesn't persist once reactivated.\n */\n instance.setCaretPosition(null);\n\n /**\n * Resetting activeInputElement\n */\n this.activeInputElement = null;\n\n if (instance.options.debug) {\n console.log(\n `Caret position reset due to \"${event?.type}\" event`,\n event\n );\n }\n }\n });\n }\n\n /**\n * Execute an operation on each button\n */\n recurseButtons(fn: any): void {\n if (!fn) return;\n\n Object.keys(this.buttonElements).forEach((buttonName) =>\n this.buttonElements[buttonName].forEach(fn)\n );\n }\n\n /**\n * Destroy keyboard listeners and DOM elements\n */\n destroy(): void {\n if (this.options.debug)\n console.log(\n `Destroying simple-keyboard instance: ${this.currentInstanceName}`\n );\n\n const { physicalKeyboardHighlightPreventDefault = false } = this.options;\n\n /**\n * Remove document listeners\n */\n document.removeEventListener(\"keyup\", this.handleKeyUp, physicalKeyboardHighlightPreventDefault);\n document.removeEventListener(\"keydown\", this.handleKeyDown, physicalKeyboardHighlightPreventDefault);\n document.removeEventListener(\"mouseup\", this.handleMouseUp);\n document.removeEventListener(\"touchend\", this.handleTouchEnd);\n document.removeEventListener(\"select\", this.handleSelect);\n document.removeEventListener(\"selectionchange\", this.handleSelectionChange);\n document.onpointerup = null;\n document.ontouchend = null;\n document.ontouchcancel = null;\n document.onmouseup = null;\n\n /**\n * Remove buttons\n */\n const deleteButton = (buttonElement: KeyboardElement | null) => {\n if (buttonElement) {\n buttonElement.onpointerdown = null;\n buttonElement.onpointerup = null;\n buttonElement.onpointercancel = null;\n buttonElement.ontouchstart = null;\n buttonElement.ontouchend = null;\n buttonElement.ontouchcancel = null;\n buttonElement.onclick = null;\n buttonElement.onmousedown = null;\n buttonElement.onmouseup = null;\n\n buttonElement.remove();\n buttonElement = null;\n }\n };\n\n this.recurseButtons(deleteButton);\n\n /**\n * Remove wrapper events\n */\n this.keyboardDOM.onpointerdown = null;\n this.keyboardDOM.ontouchstart = null;\n this.keyboardDOM.onmousedown = null;\n\n /**\n * Clearing keyboard rows\n */\n this.resetRows();\n\n /**\n * Candidate box\n */\n if (this.candidateBox) {\n this.candidateBox.destroy();\n this.candidateBox = null;\n }\n\n /**\n * Clearing activeInputElement\n */\n this.activeInputElement = null;\n\n /**\n * Removing instance attribute\n */\n this.keyboardDOM.removeAttribute(\"data-skInstance\");\n\n /**\n * Clearing keyboardDOM\n */\n this.keyboardDOM.innerHTML = \"\";\n\n /**\n * Remove instance\n */\n window[\"SimpleKeyboardInstances\"][this.currentInstanceName] = null;\n delete window[\"SimpleKeyboardInstances\"][this.currentInstanceName];\n\n /**\n * Reset initialized flag\n */\n this.initialized = false;\n }\n\n /**\n * Process buttonTheme option\n */\n getButtonThemeClasses(button: string): string[] {\n const buttonTheme = this.options.buttonTheme;\n let buttonClasses: string[] = [];\n\n if (Array.isArray(buttonTheme)) {\n buttonTheme.forEach((themeObj) => {\n if (\n themeObj &&\n themeObj.class &&\n typeof themeObj.class === \"string\" &&\n themeObj.buttons &&\n typeof themeObj.buttons === \"string\"\n ) {\n const themeObjClasses = themeObj.class.split(\" \");\n const themeObjButtons = themeObj.buttons.split(\" \");\n\n if (themeObjButtons.includes(button)) {\n buttonClasses = [...buttonClasses, ...themeObjClasses];\n }\n } else {\n console.warn(\n `Incorrect \"buttonTheme\". Please check the documentation.`,\n themeObj\n );\n }\n });\n }\n\n return buttonClasses;\n }\n\n /**\n * Process buttonAttributes option\n */\n setDOMButtonAttributes(button: string, callback: any): void {\n const buttonAttributes = this.options.buttonAttributes;\n\n if (Array.isArray(buttonAttributes)) {\n buttonAttributes.forEach((attrObj) => {\n if (\n attrObj.attribute &&\n typeof attrObj.attribute === \"string\" &&\n attrObj.value &&\n typeof attrObj.value === \"string\" &&\n attrObj.buttons &&\n typeof attrObj.buttons === \"string\"\n ) {\n const attrObjButtons = attrObj.buttons.split(\" \");\n\n if (attrObjButtons.includes(button)) {\n callback(attrObj.attribute, attrObj.value);\n }\n } else {\n console.warn(\n `Incorrect \"buttonAttributes\". Please check the documentation.`,\n attrObj\n );\n }\n });\n }\n }\n\n onTouchDeviceDetected() {\n /**\n * Processing autoTouchEvents\n */\n this.processAutoTouchEvents();\n\n /**\n * Disabling contextual window on touch devices\n */\n this.disableContextualWindow();\n }\n\n /**\n * Disabling contextual window for hg-button\n */\n /* istanbul ignore next */\n disableContextualWindow() {\n window.oncontextmenu = (event: KeyboardHandlerEvent) => {\n if (event.target.classList.contains(\"hg-button\")) {\n event.preventDefault();\n event.stopPropagation();\n return false;\n }\n };\n }\n\n /**\n * Process autoTouchEvents option\n */\n processAutoTouchEvents() {\n if (this.options.autoUseTouchEvents) {\n this.options.useTouchEvents = true;\n\n if (this.options.debug) {\n console.log(\n `autoUseTouchEvents: Touch device detected, useTouchEvents enabled.`\n );\n }\n }\n }\n\n /**\n * Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n */\n onInit() {\n if (this.options.debug) {\n console.log(`${this.keyboardDOMClass} Initialized`);\n }\n\n /**\n * setEventListeners\n */\n this.setEventListeners();\n\n if (typeof this.options.onInit === \"function\") this.options.onInit(this);\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeFirstRender() {\n /**\n * Performing actions when touch device detected\n */\n if (this.utilities.isTouchDevice()) {\n this.onTouchDeviceDetected();\n }\n\n if (typeof this.options.beforeFirstRender === \"function\")\n this.options.beforeFirstRender(this);\n\n /**\n * Notify about PointerEvents usage\n */\n if (\n this.isFirstKeyboardInstance &&\n this.utilities.pointerEventsSupported() &&\n !this.options.useTouchEvents &&\n !this.options.useMouseEvents\n ) {\n if (this.options.debug) {\n console.log(\"Using PointerEvents as it is supported by this browser\");\n }\n }\n\n /**\n * Notify about touch events usage\n */\n if (this.options.useTouchEvents) {\n if (this.options.debug) {\n console.log(\n \"useTouchEvents has been enabled. Only touch events will be used.\"\n );\n }\n }\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeRender() {\n if (typeof this.options.beforeRender === \"function\")\n this.options.beforeRender(this);\n }\n\n /**\n * Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n */\n onRender() {\n if (typeof this.options.onRender === \"function\")\n this.options.onRender(this);\n }\n\n /**\n * Executes the callback function once all modules have been loaded\n */\n onModulesLoaded() {\n if (typeof this.options.onModulesLoaded === \"function\")\n this.options.onModulesLoaded(this);\n }\n\n /**\n * Register module\n */\n registerModule = (name: string, initCallback: any) => {\n if (!this.modules[name]) this.modules[name] = {};\n\n initCallback(this.modules[name]);\n };\n\n /**\n * Load modules\n */\n loadModules() {\n if (Array.isArray(this.options.modules)) {\n this.options.modules.forEach((KeyboardModule) => {\n const keyboardModule = new KeyboardModule(this);\n keyboardModule.init && keyboardModule.init(this);\n });\n\n this.keyboardPluginClasses = \"modules-loaded\";\n\n this.render();\n this.onModulesLoaded();\n }\n }\n\n /**\n * Get module prop\n */\n getModuleProp(name: string, prop: string) {\n if (!this.modules[name]) return false;\n\n return this.modules[name][prop];\n }\n\n /**\n * getModulesList\n */\n getModulesList() {\n return Object.keys(this.modules);\n }\n\n /**\n * Parse Row DOM containers\n */\n parseRowDOMContainers(\n rowDOM: HTMLDivElement,\n rowIndex: number,\n containerStartIndexes: number[],\n containerEndIndexes: number[]\n ) {\n const rowDOMArray = Array.from(rowDOM.children);\n let removedElements = 0;\n\n if (rowDOMArray.length) {\n containerStartIndexes.forEach((startIndex, arrIndex) => {\n const endIndex = containerEndIndexes[arrIndex];\n\n /**\n * If there exists a respective end index\n * if end index comes after start index\n */\n if (!endIndex || !(endIndex > startIndex)) {\n return false;\n }\n\n /**\n * Updated startIndex, endIndex\n * This is since the removal of buttons to place a single button container\n * results in a modified array size\n */\n const updated_startIndex = startIndex - removedElements;\n const updated_endIndex = endIndex - removedElements;\n\n /**\n * Create button container\n */\n const containerDOM = document.createElement(\"div\");\n containerDOM.className += \"hg-button-container\";\n const containerUID = `${this.options.layoutName}-r${rowIndex}c${arrIndex}`;\n containerDOM.setAttribute(\"data-skUID\", containerUID);\n\n /**\n * Taking elements due to be inserted into container\n */\n const containedElements = rowDOMArray.splice(\n updated_startIndex,\n updated_endIndex - updated_startIndex + 1\n );\n removedElements = updated_endIndex - updated_startIndex;\n\n /**\n * Inserting elements to container\n */\n containedElements.forEach((element) =>\n containerDOM.appendChild(element)\n );\n\n /**\n * Adding container at correct position within rowDOMArray\n */\n rowDOMArray.splice(updated_startIndex, 0, containerDOM);\n\n /**\n * Clearing old rowDOM children structure\n */\n rowDOM.innerHTML = \"\";\n\n /**\n * Appending rowDOM new children list\n */\n rowDOMArray.forEach((element) => rowDOM.appendChild(element));\n\n if (this.options.debug) {\n console.log(\n \"rowDOMContainer\",\n containedElements,\n updated_startIndex,\n updated_endIndex,\n removedElements + 1\n );\n }\n });\n }\n\n return rowDOM;\n }\n\n /**\n * getKeyboardClassString\n */\n getKeyboardClassString = (...baseDOMClasses: any[]) => {\n const keyboardClasses = [this.keyboardDOMClass, ...baseDOMClasses].filter(\n (DOMClass) => !!DOMClass\n );\n\n return keyboardClasses.join(\" \");\n };\n\n /**\n * Renders rows and buttons as per options\n */\n render() {\n /**\n * Clear keyboard\n */\n this.resetRows();\n\n /**\n * Calling beforeFirstRender\n */\n if (!this.initialized) {\n this.beforeFirstRender();\n }\n\n /**\n * Calling beforeRender\n */\n this.beforeRender();\n\n const layoutClass = `hg-layout-${this.options.layoutName}`;\n const layout = this.options.layout || getDefaultLayout();\n const useTouchEvents = this.options.useTouchEvents || false;\n const useTouchEventsClass = useTouchEvents ? \"hg-touch-events\" : \"\";\n const useMouseEvents = this.options.useMouseEvents || false;\n const disableRowButtonContainers = this.options.disableRowButtonContainers;\n\n /**\n * Adding themeClass, layoutClass to keyboardDOM\n */\n this.keyboardDOM.className = this.getKeyboardClassString(\n this.options.theme,\n layoutClass,\n this.keyboardPluginClasses,\n useTouchEventsClass\n );\n\n /**\n * Adding keyboard identifier\n */\n this.keyboardDOM.setAttribute(\"data-skInstance\", this.currentInstanceName);\n\n /**\n * Create row wrapper\n */\n this.keyboardRowsDOM = document.createElement(\"div\");\n this.keyboardRowsDOM.className = \"hg-rows\";\n\n /**\n * Iterating through each row\n */\n layout[this.options.layoutName || this.defaultName].forEach(\n (row: string, rIndex: number) => {\n let rowArray = row.split(\" \");\n\n /**\n * Enforce excludeFromLayout\n */\n if (\n this.options.excludeFromLayout &&\n this.options.excludeFromLayout[\n this.options.layoutName || this.defaultName\n ]\n ) {\n rowArray = rowArray.filter(\n (buttonName) =>\n this.options.excludeFromLayout &&\n !this.options.excludeFromLayout[\n this.options.layoutName || this.defaultName\n ].includes(buttonName)\n );\n }\n\n /**\n * Creating empty row\n */\n let rowDOM = document.createElement(\"div\");\n rowDOM.className += \"hg-row\";\n\n /**\n * Tracking container indicators in rows\n */\n const containerStartIndexes: number[] = [];\n const containerEndIndexes: number[] = [];\n\n /**\n * Iterating through each button in row\n */\n rowArray.forEach((button, bIndex) => {\n /**\n * Check if button has a container indicator\n */\n const buttonHasContainerStart =\n !disableRowButtonContainers &&\n typeof button === \"string\" &&\n button.length > 1 &&\n button.indexOf(\"[\") === 0;\n\n const buttonHasContainerEnd =\n !disableRowButtonContainers &&\n typeof button === \"string\" &&\n button.length > 1 &&\n button.indexOf(\"]\") === button.length - 1;\n\n /**\n * Save container start index, if applicable\n */\n if (buttonHasContainerStart) {\n containerStartIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\[/g, \"\");\n }\n\n if (buttonHasContainerEnd) {\n containerEndIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\]/g, \"\");\n }\n\n /**\n * Processing button options\n */\n const fctBtnClass = this.utilities.getButtonClass(button);\n const buttonDisplayName = this.utilities.getButtonDisplayName(\n button,\n this.options.display,\n this.options.mergeDisplay\n );\n\n /**\n * Creating button\n */\n const buttonType = this.options.useButtonTag ? \"button\" : \"div\";\n const buttonDOM = document.createElement(buttonType);\n buttonDOM.className += `hg-button ${fctBtnClass}`;\n\n /**\n * Adding buttonTheme\n */\n buttonDOM.classList.add(...this.getButtonThemeClasses(button));\n\n /**\n * Adding buttonAttributes\n */\n this.setDOMButtonAttributes(\n button,\n (attribute: string, value: string) => {\n buttonDOM.setAttribute(attribute, value);\n }\n );\n\n this.activeButtonClass = \"hg-activeButton\";\n\n /**\n * Handle button click event\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n /**\n * Handle PointerEvents\n */\n buttonDOM.onpointerdown = (e: KeyboardHandlerEvent) => {\n this.handleButtonClicked(button, e);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.onpointerup = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n buttonDOM.onpointercancel = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n } else {\n /**\n * Fallback for browsers not supporting PointerEvents\n */\n if (useTouchEvents) {\n /**\n * Handle touch events\n */\n buttonDOM.ontouchstart = (e: KeyboardHandlerEvent) => {\n this.handleButtonClicked(button, e);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.ontouchend = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n buttonDOM.ontouchcancel = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n } else {\n /**\n * Handle mouse events\n */\n buttonDOM.onclick = (e: KeyboardHandlerEvent) => {\n this.setMouseHold(false);\n /**\n * Fire button handler in onclick for compatibility reasons\n * This fires handler before onKeyReleased, therefore when that option is set we will fire the handler\n * in onmousedown instead\n */\n if (typeof this.options.onKeyReleased !== \"function\") {\n this.handleButtonClicked(button, e);\n }\n };\n buttonDOM.onmousedown = (e: KeyboardHandlerEvent) => {\n /**\n * Fire button handler for onKeyReleased use-case\n */\n if (\n typeof this.options.onKeyReleased === \"function\" &&\n !this.isMouseHold\n ) {\n this.handleButtonClicked(button, e);\n }\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.onmouseup = (e: KeyboardHandlerEvent) => {\n this.handleButtonMouseUp(button, e);\n };\n }\n }\n\n /**\n * Adding identifier\n */\n buttonDOM.setAttribute(\"data-skBtn\", button);\n\n /**\n * Adding unique id\n * Since there's no limit on spawning same buttons, the unique id ensures you can style every button\n */\n const buttonUID = `${this.options.layoutName}-r${rIndex}b${bIndex}`;\n buttonDOM.setAttribute(\"data-skBtnUID\", buttonUID);\n\n /**\n * Adding button label to button\n */\n const buttonSpanDOM = document.createElement(\"span\");\n buttonSpanDOM.innerHTML = buttonDisplayName;\n buttonDOM.appendChild(buttonSpanDOM);\n\n /**\n * Adding to buttonElements\n */\n if (!this.buttonElements[button]) this.buttonElements[button] = [];\n\n this.buttonElements[button].push(buttonDOM);\n\n /**\n * Appending button to row\n */\n rowDOM.appendChild(buttonDOM);\n });\n\n /**\n * Parse containers in row\n */\n rowDOM = this.parseRowDOMContainers(\n rowDOM,\n rIndex,\n containerStartIndexes,\n containerEndIndexes\n );\n\n /**\n * Appending row to hg-rows\n */\n this.keyboardRowsDOM.appendChild(rowDOM);\n }\n );\n\n /**\n * Appending row to keyboard\n */\n this.keyboardDOM.appendChild(this.keyboardRowsDOM);\n\n /**\n * Calling onRender\n */\n this.onRender();\n\n if (!this.initialized) {\n /**\n * Ensures that onInit and beforeFirstRender are only called once per instantiation\n */\n this.initialized = true;\n\n /**\n * Handling parent events\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n document.onpointerup = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n this.keyboardDOM.onpointerdown = (e: KeyboardHandlerEvent) =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (useTouchEvents) {\n /**\n * Handling ontouchend, ontouchcancel\n */\n document.ontouchend = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n document.ontouchcancel = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n\n this.keyboardDOM.ontouchstart = (e: KeyboardHandlerEvent) =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (!useTouchEvents) {\n /**\n * Handling mouseup\n */\n document.onmouseup = (e: KeyboardHandlerEvent) =>\n this.handleButtonMouseUp(undefined, e);\n this.keyboardDOM.onmousedown = (e: KeyboardHandlerEvent) =>\n this.handleKeyboardContainerMouseDown(e);\n }\n\n /**\n * Calling onInit\n */\n this.onInit();\n }\n }\n}\n\nexport default SimpleKeyboard;\n","export const getDefaultLayout = () => {\n return {\n default: [\n \"` 1 2 3 4 5 6 7 8 9 0 - = {bksp}\",\n \"{tab} q w e r t y u i o p [ ] \\\\\",\n \"{lock} a s d f g h j k l ; ' {enter}\",\n \"{shift} z x c v b n m , . / {shift}\",\n \".com @ {space}\",\n ],\n shift: [\n \"~ ! @ # $ % ^ & * ( ) _ + {bksp}\",\n \"{tab} Q W E R T Y U I O P { } |\",\n '{lock} A S D F G H J K L : \" {enter}',\n \"{shift} Z X C V B N M < > ? {shift}\",\n \".com @ {space}\",\n ],\n };\n};\n","import SimpleKeyboard from \"./components/Keyboard\";\nexport { SimpleKeyboard };\nexport default SimpleKeyboard;\n"],"sourceRoot":""} \ No newline at end of file