!function(t,n){"object"===typeofexports&&"object"===typeofmodule?module.exports=n():"function"===typeofdefine&&define.amd?define([],n):"object"===typeofexports?exports.SimpleKeyboard=n():t.SimpleKeyboard=n()}(this,function(){returnfunction(t){functionn(o){if(e[o])returne[o].exports;vari=e[o]={i:o,l:!1,exports:{}};returnt[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}vare={};returnn.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){vare=t&&t.__esModule?function(){returnt.default}:function(){returnt};returnn.d(e,"a",e),e},n.o=function(t,n){returnObject.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});varo=e(2);n.default=o.a},function(t,n,e){"use strict";functiono(t,n){if(!(tinstanceofn))thrownewTypeError("Cannot call a class as a function")}vari=e(3),s=(e.n(i),e(4)),a=e(5),r=e(6),u="function"===typeofSymbol&&"symbol"===typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"===typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},c=functiont(){varn=this;o(this,t),this.handleButtonClicked=function(t){vare=n.options.debug;if("{//}"===t)return!1;"function"===typeofn.options.onKeyPress&&n.options.onKeyPress(t),n.input[n.options.inputName]||(n.input[n.options.inputName]="");varo=n.utilities.getUpdatedInput(t,n.input[n.options.inputName],n.options,n.caretPosition);if(n.input[n.options.inputName]!==o){if(n.options.maxLength&&n.utilities.handleMaxLength(n.input,n.options,o))return!1;n.input[n.options.inputName]=o,e&&console.log("Input changed:",n.input),n.options.syncInstanceInputs&&n.syncInstanceInputs(n.input),"function"===typeofn.options.onChange&&n.options.onChange(n.input[n.options.inputName])}e&&console.log("Key pressed:",t)},this.syncInstanceInputs=function(){n.dispatch(function(t){t.replaceInput(n.input)})},this.clearInput=function(t){t=t||n.options.inputName,n.input[n.options.inputName]="",n.options.syncInstanceInputs&&n.syncInstanceInputs(n.input)},this.getInput=function(t){returnt=t||n.options.inputName,n.options.syncInstanceInputs&&n.syncInstanceInputs(n.input),n.input[n.options.inputName]},this.setInput=function(t,e){e=e||n.options.inputName,n.input[e]=t,n.options.syncInstanceInputs&&n.syncInstanceInputs(n.input)},this.replaceInput=function(t){n.input=t},this.setOptions=function(t){t=t||{},n.options=Object.assign(n.options,t),n.render()},this.clear=function(){n.keyboardDOM.innerHTML="",n.keyboardDOM.className=n.keyboardDOMClass,n.buttonElements={},n.caretPosition=null},this.dispatch=function(t){returnwindow.SimpleKeyboardInstances?Object.keys(window.SimpleKeyboardInstances).forEach(function(n){t(window.SimpleKeyboardInstances[n],n)}):(console.error("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),!1)},this.addButtonTheme=function(t,e){if(!e||!t)return!1;t.split(" ").forEach(function(o){e.split(" ").forEach(function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);vari=!1;n.options.buttonTheme.map(function(t){if(t.class.split(" ").includes(e)){i=!0;varn=t.buttons.split(" ");n.includes(o)||(i=!0,n.push(o),t.buttons=n.join(" "))}returnt}),i||n.options.buttonTheme.push({class:e,buttons:t})})}),n.render()},this.removeButtonTheme=function(t,e){if(!t&&!e)returnn.options.buttonTheme=[],n.render(),!1;if(t&&Array.isArray(n.options.buttonTheme)&&n.options.buttonTheme.length){varo=t.split(" ");o.forEach(function(t,i){n.options.buttonTheme.map(function(i,s){if(e&&e.includes(i.class)||!e){vara=void0;o.includes(t)&&(a=i.buttons.split(" ").filter(function(n){returnn!==t})),a.length?i.buttons=a.join(" "):(n.options.buttonTheme.splice(s,1),i=null)}returni})}),n.render()}},this.getButtonElement=function(t){vare=void0,o=n.buttonElements[t];returno&&(e=o.length>1?o:o[0]),e},this.handleCaret=function(){n.options.debug&&console.log("Caret handling started");vart=function(t){vare=t.target.tagName.toLowerCase();"textarea"!==e&&"inpu