{"version":3,"file":"../number-spinner-handler-220.min.js","sources":["number-spinner-handler-220.js"],"sourcesContent":["/**\n * Handle phone fields using `intl-tel-input` component.\n */\n\n(function (root, factory) {\n\tif ( typeof define === 'function' && define.amd ) {\n\t\tdefine([], factory(root));\n\t} else if ( typeof exports === 'object' ) {\n\t\tmodule.exports = factory(root);\n\t} else {\n\t\troot.NumberSpinnerHandler = factory(root);\n\t}\n})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) {\n\n\t'use strict';\n\n\tvar $ = jQuery;\n\tvar _hasJQuery = ( $ != null );\n\n\tvar _hasInitialized = false;\n\tvar _publicMethods = {};\n\tvar _settings = {\n\t\tbodyClass: 'has-number-spinner--activated',\n\n\t\tnumberSpinnerOptions: {},\n\n\t\tfragmentsUpdateEvent: 'wc_fragment_refresh',\n\t\tfragmentsReplacedEvent: 'wc_fragments_refreshed',\n\t};\n\n\n\n\n\t/**\n\t * METHODS\n\t */\n\n\n\n\t/**\n\t * Initialize a phone field.\n\t */\n\t_publicMethods.initAllInputFields = function() {\n\t\t// Bail if container selector option is not set\n\t\tif ( ! _settings.numberSpinnerOptions || ! _settings.numberSpinnerOptions.containerSelector || '' == _settings.numberSpinnerOptions.containerSelector ) { return; }\n\n\t\t// Get container element\n\t\tvar containerElements = document.querySelectorAll( _settings.numberSpinnerOptions.containerSelector );\n\n\t\tfor ( var i = 0; i < containerElements.length; i++ ) {\n\t\t\tvar containerElement = containerElements[i];\n\n\t\t\t// Initialize number input fields\n\t\t\tNumberSpinner.initInputFields( containerElement, _settings.numberSpinnerOptions );\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Initialize intl phone number inputs\n\t */\n\t_publicMethods.init = function( options ) {\n\t\tif ( _hasInitialized ) return;\n\n\t\t// Bail if NumberSpinner script was not loaded\n\t\tif ( ! window.NumberSpinner ) { return; }\n\n\t\t// Merge settings\n\t\t_settings = FCUtils.extendObject( _settings, options );\n\n\t\t// Set jQuery event listeners\n\t\tif ( _hasJQuery ) {\n\t\t\t$( document.body ).on( _settings.fragmentsReplacedEvent, _publicMethods.initAllInputFields );\n\t\t}\n\n\t\t// Initialize number spinner on page load\n\t\tNumberSpinner.init();\n\t\t_publicMethods.initAllInputFields();\n\n\t\t// Add init class\n\t\tdocument.body.classList.add( _settings.bodyClass );\n\n\t\t_hasInitialized = true;\n\t};\n\n\n\n\t//\n\t// Public APIs\n\t//\n\treturn _publicMethods;\n\n});\n"],"names":["root","factory","define","amd","exports","module","NumberSpinnerHandler","global","this","window","$","jQuery","_hasJQuery","_hasInitialized","_publicMethods","_settings","bodyClass","numberSpinnerOptions","fragmentsUpdateEvent","fragmentsReplacedEvent","initAllInputFields","containerSelector","containerElements","document","querySelectorAll","i","length","containerElement","NumberSpinner","initInputFields","init","options","FCUtils","extendObject","body","on","classList","add"],"mappings":"AAIA,CAAA,SAAWA,EAAMC,GACO,YAAlB,OAAOC,QAAyBA,OAAOC,IAC3CD,OAAO,GAAID,EAAY,CAAC,EACM,UAAnB,OAAOG,QAClBC,OAAOD,QAAUH,EAAY,EAE7BD,EAAKM,qBAAuBL,EAAY,CAEzC,EAAoB,aAAlB,OAAOM,OAAyBA,OAASC,KAAKC,QAAUD,KAAKD,OAAQ,SAAUP,GAEjF,aAEA,IAAIU,EAAIC,OACJC,EAAoB,MAALF,EAEfG,EAAkB,CAAA,EAClBC,EAAiB,GACjBC,EAAY,CACfC,UAAW,gCAEXC,qBAAsB,GAEtBC,qBAAsB,sBACtBC,uBAAwB,wBACzB,EA+DA,OAjDAL,EAAeM,mBAAqB,WAEnC,GAAOL,EAAUE,sBAA0BF,EAAUE,qBAAqBI,mBAAqB,IAAMN,EAAUE,qBAAqBI,kBAKpI,IAFA,IAAIC,EAAoBC,SAASC,iBAAkBT,EAAUE,qBAAqBI,iBAAkB,EAE1FI,EAAI,EAAGA,EAAIH,EAAkBI,OAAQD,CAAC,GAAK,CACpD,IAAIE,EAAmBL,EAAkBG,GAGzCG,cAAcC,gBAAiBF,EAAkBZ,EAAUE,oBAAqB,CACjF,CACD,EAOAH,EAAegB,KAAO,SAAUC,GAC1BlB,GAGEJ,OAAOmB,gBAGdb,EAAYiB,QAAQC,aAAclB,EAAWgB,CAAQ,EAGhDnB,GACJF,EAAGa,SAASW,IAAK,EAAEC,GAAIpB,EAAUI,uBAAwBL,EAAeM,kBAAmB,EAI5FQ,cAAcE,KAAK,EACnBhB,EAAeM,mBAAmB,EAGlCG,SAASW,KAAKE,UAAUC,IAAKtB,EAAUC,SAAU,EAEjDH,EAAkB,CAAA,EACnB,EAOOC,CAER,CAAC"}