{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../codebase/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/checkout/MaskPhoneNumber.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/checkout/MaskPhoneNumberBilling.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/components/formValidation.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/phoneRegex.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/profile.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/profile/passwordChecker.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/profile/profile.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;ACZa;;AAEb;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA2C,aAAa;AACxD,KAAK;;AAEL;AACA;AACA;AACA;AACA,6CAA6C,aAAa;AAC1D;AACA;AACA,8CAA8C,aAAa;AAC3D;;AAEA,KAAK;AACL,0DAA0D,aAAa;AACvE;;AAEA;AACA,4CAA4C,aAAa,GAAG,gBAAgB;AAC5E;;AAEA;;AAEA,0CAA0C,aAAa,GAAG,gBAAgB;AAC1E;;AAEA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,uCAAuC,wBAAwB;AAC/D;AACA;AACA,GAAG;AACH,C;;;;;;;;;;;;AC7Ea;;AAEb;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0CAA0C,aAAa;AACvD,KAAK;;AAEL;AACA;AACA;AACA;AACA,4CAA4C,aAAa;AACzD;AACA;AACA,6CAA6C,aAAa;AAC1D;;AAEA,KAAK;AACL,yDAAyD,aAAa;AACtE;;AAEA;AACA,2CAA2C,aAAa,GAAG,gBAAgB;AAC3E;;AAEA;;AAEA,0CAA0C,aAAa,GAAG,gBAAgB;AAC1E;;AAEA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,uCAAuC,wBAAwB;AAC/D;AACA;AACA;AACA,GAAG;AACH,C;;;;;;;;;;;;AC/Ea;;AAEb;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACjDa;;AAEb,mBAAO,CAAC,6IAA4B;AACpC,mBAAO,CAAC,2JAAmC;;AAE3C;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnGa;;AAEb,qBAAqB,mBAAO,CAAC,mIAAW;;AAExC;AACA,mBAAmB,mBAAO,CAAC,2HAAmB;AAC9C,mBAAmB,mBAAO,CAAC,2IAA2B;AACtD,CAAC;;;;;;;;;;;;;ACPY;;AAEb;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA,E;;;;;;;;;;;;AC9Ha;AACb,qBAAqB,mBAAO,CAAC,gJAA8B;AAC3D,OAAO,YAAY,GAAG,mBAAO,CAAC,kHAAe;;AAE7C;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;;;AAGA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,E","file":"default/js/profile.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/profile.js\");\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","'use strict';\n\n$('body').on('refreshRegex', function () {\n InitMask();\n});\n\nfunction InitMask() {\n var manualEdit = false;\n $('body').on('countryPhone:open', function () {\n manualEdit = true;\n });\n\n $('.shipping-form .select-phone-regex').on('change', function (e) {\n var phoneNumber = $('.shipping-phone-control').val();\n var diallingCode = $(this).children('option:selected').data('phone-indicative') || '';\n var validNumber = phoneNumber.replace(/\\s/g, '');\n diallingCode = diallingCode.toString();\n\n var mask = $(this).children('option:selected').data('phone-mask') || '';\n $('.shipping-phone-control').unmask();\n \n if (!validNumber && diallingCode) {\n $('.shipping-phone-control').val(`+${diallingCode} `);\n } else if (validNumber && diallingCode) {\n\n if (validNumber.startsWith('+' + diallingCode) || validNumber.startsWith('00' + diallingCode)) {\n $('.shipping-phone-control').val(phoneNumber);\n }\n else if (validNumber.startsWith('+')) {\n $('.shipping-phone-control').val(`+${diallingCode} `);\n }\n else if (validNumber.startsWith('00')) {\n $('.shipping-phone-control').val(`00${diallingCode} `);\n }\n\n } else if (manualEdit) {\n $('.shipping-phone-control').val(diallingCode ? `+${diallingCode} ` : '');\n }\n \n if (mask) {\n $('.shipping-phone-control').mask(`+${diallingCode} ${mask.toString()}`);\n }\n \n if (mask && diallingCode) {\n\n var InfoMaskDiallingCode =`+${diallingCode} ${mask.toString()}`;\n $('.skp-error-message-phone .mask-diallingCode').empty().append(Resources.LABEL_FORM_PHONE + InfoMaskDiallingCode);\n\n } else {\n $('.skp-error-message-phone .mask-diallingCode').empty();\n }\n });\n \n $('.shipping-phone-control').on('keydown', function (event) {\n var keyCode = event.keyCode || event.which;\n var inputValue = $(this).val();\n var diallingCode = $('.select-phone-regex option:selected').data('phone-indicative') || '';\n var diallingCodeLength = diallingCode ? diallingCode.toString().length + 2 : 0;\n\n if (keyCode === 8 && inputValue.length <= diallingCodeLength) {\n event.preventDefault();\n }\n });\n\n $('.shipping-phone-control').on('paste', function (e) {\n e.preventDefault();\n });\n\n $('.shipping-phone-control').on('input mouseup keyup keydown', function (event) {\n var selectedNumber = window.getSelection().toString();\n var diallingCode = $('.select-phone-regex option:selected').data('phone-indicative') || '';\n if (selectedNumber !== '') {\n if (event.keyCode == 8 || event.keyCode == 46) {\n $(this).val(diallingCode ? `+${diallingCode.toString()} ` : \"\");\n }\n }\n });\n}","'use strict';\n\n$('body').on('refreshRegexBilling', function () {\n InitMask();\n});\n\nfunction InitMask() {\n var manualEdit = false;\n $('body').on('countryPhone:open', function () {\n manualEdit = true;\n });\n\n $('.billing-address .select-phone-regex').on('change', function (e) {\n var phoneNumber = $('.billing-phone-control').val();\n var diallingCode = $(this).children('option:selected').data('phone-indicative') || '';\n var validNumber = phoneNumber.replace(/\\s/g, '');\n diallingCode = diallingCode.toString();\n\n var mask = $(this).children('option:selected').data('phone-mask') || '';\n $('.billing-phone-control').unmask();\n \n if (!validNumber && diallingCode) {\n $('.billing-phone-control').val(`+${diallingCode} `);\n } else if (validNumber && diallingCode) {\n\n if (validNumber.startsWith('+' + diallingCode) || validNumber.startsWith('00' + diallingCode)) {\n $('.billing-phone-control').val(phoneNumber);\n }\n else if (validNumber.startsWith('+')) {\n $('.billing-phone-control').val(`+${diallingCode} `);\n }\n else if (validNumber.startsWith('00')) {\n $('.billing-phone-control').val(`00${diallingCode} `);\n }\n\n } else if (manualEdit) {\n $('.billing-phone-control').val(diallingCode ? `+${diallingCode} ` : '');\n }\n \n if (mask) {\n $('.billing-phone-control').mask(`+${diallingCode} ${mask.toString()}`);\n }\n \n if (mask && diallingCode) {\n\n var InfoMaskDiallingCode =`+${diallingCode} ${mask.toString()}`;\n $('.billing-address .skp-error-message-phone .mask-diallingCode').empty().append(Resources.LABEL_FORM_PHONE + InfoMaskDiallingCode);\n\n } else {\n $('.billing-address .skp-error-message-phone .mask-diallingCode').empty();\n }\n });\n \n $('.billing-phone-control').on('keydown', function (event) {\n var keyCode = event.keyCode || event.which;\n var inputValue = $(this).val();\n var diallingCode = $('.billing-address .select-phone-regex option:selected').data('phone-indicative') || '';\n var diallingCodeLength = diallingCode ? diallingCode.toString().length + 2 : 0;\n\n if (keyCode === 8 && inputValue.length <= diallingCodeLength) {\n event.preventDefault();\n }\n $('.billing-address .invalid-feedback-phoneNumber-billing').removeClass('red-message');\n });\n\n $('.billing-phone-control').on('paste', function (e) {\n e.preventDefault();\n });\n\n $('.billing-phone-control').on('input mouseup keyup keydown', function (event) {\n var selectedNumber = window.getSelection().toString();\n var diallingCode = $('.billing-address .select-phone-regex option:selected').data('phone-indicative') || '';\n if (selectedNumber !== '') {\n if (event.keyCode == 8 || event.keyCode == 46) {\n $(this).val(diallingCode ? `+${diallingCode.toString()} ` : \"\");\n }\n }\n $('.billing-address .invalid-feedback-phoneNumber-billing').removeClass('red-message');\n });\n}","'use strict';\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = function (formElement, payload) {\n // clear form validation first\n clearFormErrors(formElement);\n $('.alert', formElement).remove();\n\n if (typeof payload === 'object' && payload.fields) {\n Object.keys(payload.fields).forEach(function (key) {\n if (payload.fields[key]) {\n\n if (key.endsWith('title')) {\n var feedbackElement = $(formElement).find('[name=\"' + key + '\"]')\n .parents('.skp-status')\n .children('.invalid-feedback');\n } else {\n var feedbackElement = $(formElement).find('[name=\"' + key + '\"]')\n .parent()\n .children('.invalid-feedback');\n }\n\n if (feedbackElement.length > 0) {\n if (Array.isArray(payload[key])) {\n feedbackElement.html(payload.fields[key].join('
'));\n } else {\n feedbackElement.html(payload.fields[key]);\n }\n feedbackElement.siblings('.form-control').addClass('is-invalid');\n }\n }\n });\n }\n if (payload && payload.error) {\n var form = $(formElement).prop('tagName') === 'FORM'\n ? $(formElement)\n : $(formElement).parents('form');\n\n form.prepend('
'\n + payload.error.join('
') + '
');\n }\n};\n","'use strict';\n\nrequire('./checkout/MaskPhoneNumber');\nrequire('./checkout/MaskPhoneNumberBilling');\n\nmodule.exports = {\n selectIso: function () {\n var phoneSelect = $(\".select-phone-regex\");\n\n if (phoneSelect.length < 1) return;\n\n function matchStart2(params, data) {\n params.term = params.term || '';\n if (data.text.toUpperCase().indexOf(params.term.toUpperCase()) == 0) {\n return data;\n }\n return false;\n }\n\n function formatState(state) {\n if (!state.id) {\n return state.text;\n }\n var $country = $(\n '' +\n '' + state.text + ''\n );\n return $country;\n };\n\n phoneSelect.select2({\n templateResult: formatState,\n templateSelection: formatState,\n matcher: function(params, data) {\n return matchStart2(params, data);\n }\n }).on('select2:open', () => {\n $(\"body\").addClass('select2-results');\n $('body').trigger('countryPhone:open');\n $('.select2-dropdown').addClass('select2Open');\n })\n\n $(document).on('select2:open', () => {\n setTimeout(() => document.querySelector('.select2-search__field').focus(), 200);\n });\n\n $(document).ready(function () {\n $(\".phone-control, .shipping-phone-control,.billing-phone-control\").keypress(function (event) {\n var regex = new RegExp($(this).attr('pattern'), 'g')\n if(event.which !=8 && !regex.test( String.fromCharCode(event.which))){\n event.preventDefault();\n }\n });\n $(\".select-phone-regex\").trigger('change');\n });\n\n $('.shipping-form .select-phone-regex').on('change', function (e) {\n var customerType = $('.data-checkout-stage').data('customer-type');\n var billingAddress = $('.billingAddressOne').val();\n var shippingAddress = $('.shippingAddressOne').val();\n var NumberShippingAdress = $('.shipping-phone-control').val();\n var NumberBillingAdress = $('.billing-phone-control').val();\n\n if (customerType === 'guest' || ((billingAddress === shippingAddress) && NumberShippingAdress === NumberBillingAdress)) {\n var selectedOption = $('.shipping-form .select-phone-regex').find('option:selected');\n var phoneIso = selectedOption.data('phone-iso');\n $('.billing-address .select-phone-regex option[data-phone-iso=\"' + phoneIso + '\"]').prop('selected', true);\n }\n });\n\n $('.select-phone-regex').on('change', function (e) {\n e.stopPropagation();\n var self = $(this);\n var iso = self.find(':selected').data('phone-iso'),\n inputShippingPhone = $('.shipping-phone-control'),\n inpuPhoneIso = $(\"input[name=phoneIso]\"),\n inputShippingPhoneIso = $(\"input[name=shippingAddressPhoneIso]\");\n if (inputShippingPhone && inputShippingPhoneIso && e.target.getAttribute('data-shipping-targeted') == 'true') {\n //inputShippingPhone.attr(\"placeholder\", placeholder);\n // inputShippingPhone.attr(\"pattern\", pattern);\n inputShippingPhoneIso.val(iso);\n } else {\n //inputPhone.attr(\"placeholder\", placeholder);\n //inputPhone.attr(\"pattern\", pattern);\n inpuPhoneIso.val(iso);\n }\n\n $('body').trigger('refreshRegex');\n\n $('body').trigger('refreshRegexBilling');\n });\n\n function deplaceErrorMessage(){\n $('.skp-address-form .skp-error-message-phone-country').insertAfter('.skp-phone-form.skp-address-form');\n }\n deplaceErrorMessage();\n }\n};\n","'use strict';\n\nvar processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./profile/profile'));\n processInclude(require('./profile/passwordChecker'));\n});\n","'use strict';\n\nvar ruleValidator = function () {\n var pswd = $(this).val();\n //gets what is being input in the field and sets as variable\n if (pswd.length < 8) {\n $('#length').removeClass('valid').addClass('invalid');\n } else {\n $('#length').removeClass('invalid').addClass('valid');\n }\n // Capital\n if (pswd.match(/[A-Z]/)) {\n $('#capital').removeClass('invalid').addClass('valid');\n } else {\n $('#capital').removeClass('valid').addClass('invalid');\n\n }\n\n // number\n if (pswd.match(/\\d/)) {\n $('#number').removeClass('invalid').addClass('valid');\n } else {\n $('#number').removeClass('valid').addClass('invalid');\n }\n\n // character\n if (pswd.match(/[$&+,:;=?@#|'<>.^*()%!-]/)) {\n $('#special').removeClass('invalid').addClass('valid');\n } else {\n $('#special').removeClass('valid').addClass('invalid');\n }\n}\n\nvar ConfirmPassword = function () {\n var passwordChecker = $('.passwordChecker').val(),\n passwordCheckerConfirm = $('.passwordCheckerConfirm').val(),\n all_pass = true;\n\n if (passwordChecker == passwordCheckerConfirm && passwordChecker != ''){\n $('.skp-password-match').removeClass('invalid').addClass('valid');\n $('.btn-save-new-password').removeClass('disabled');\n all_pass = true;\n }\n else {\n $('.skp-password-match').removeClass('valid').addClass('invalid');\n $('.btn-save-new-password').addClass('disabled');\n all_pass = false;\n }\n\n\n}\nmodule.exports = {\n\n togglePassword: function () {\n $(document).on('click', \".toggle-password\", function () {\n var parent = $(this).parent(\".form-password\");\n $(this).toggleClass(\"icon-password-show icon-password-hide\");\n if ( parent.find('input').attr('type')=='password') {\n parent.find('input').attr('type', 'text');\n } else {\n parent.find('input').attr('type', 'password');\n }\n });\n },\n passwordStrenghtChecker: function () {\n\n $(document).on('focus','.passwordChecker',\n function () {\n // (triggers whenever the password field is selected by the user)\n $('.pswd_info').fadeIn('low');\n $('.pswd_info').addClass('pswd-active');\n });\n $(document).on('blur','.passwordChecker',function () {\n // (triggers whenever the password field is unselected)\n $('.pswd_info').fadeOut('low');\n $('.pswd_info').removeClass('pswd-active');\n });\n $(document).on('keyup','.passwordChecker',ruleValidator);\n $(document).on('keyup','.passwordCheckerConfirm',ConfirmPassword);\n },\n submitPassword: function () {\n \n $('form.change-password-form').submit(function (e) {\n var $form = $(this);\n e.preventDefault();\n var successTitle = $('.change-password-title').data('success-title'),\n successMsg = $('.change-password-body').data('success-msg');\n var url = $form.attr('action');\n $form.spinner().start();\n $('form.change-password-form').trigger('password:edit', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n $form.spinner().stop();\n if (!data.success) {\n formValidation($form, data);\n } else {\n $('.change-password-title').text(successTitle);\n $('.change-password-body').empty()\n .append('

' + successMsg + '

');\n location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n $form.spinner().stop();\n }\n });\n return false;\n });\n },\n ModalPassword: function () {\n var modalPassword = $('.modal-password'),\n closeModal = modalPassword.find('.close');\n\n if (modalPassword.lenght > 0) return;\n\n closeModal.on('click', function () {\n modalPassword.removeClass('show');\n })\n }\n};","'use strict';\nvar formValidation = require('../components/formValidation');\nconst { selectIso } = require('../phoneRegex');\n\nfunction fillInStateField(countrySelector, stateFieldSelector, stateContainerSelector) {\n var $countryField = $(countrySelector);\n var $statesField = $(stateFieldSelector);\n var $stateContainer = $(stateContainerSelector);\n $statesField.empty();\n\n var stateSelectedCode = $countryField.val();\n\n var hasStates = $countryField.find('option:selected').data('hasstate');\n if (hasStates) {\n // build new list\n var countryStates = window.states[stateSelectedCode];\n for (var idx in countryStates) {\n var state = countryStates[idx];\n $statesField.append('');\n }\n console.log(\"Remove dnone class \" + stateContainerSelector + \" >> \" + $stateContainer);\n $stateContainer.removeClass('d-none');\n $statesField.attr('required', true);\n } else {\n if (!$stateContainer.hasClass('d-none')) {\n $stateContainer.addClass('d-none');\n }\n $statesField.attr('required', false);\n }\n}\n\n\n\nmodule.exports = {\n submitRegistration: function () {\n $(document).on(\"submit\", \"form.registration\", function (e) {\n $($(this)).find('.invalid-feedback').empty();\n });\n },\n submitProfile: function () {\n $('form.edit-profile-form').submit(function (e) {\n var $form = $(this);\n e.preventDefault();\n var url = $form.attr('action');\n $form.spinner().start();\n $('form.edit-profile-form').trigger('profile:edit', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n $form.spinner().stop();\n if (!data.success) {\n formValidation($form, data);\n } else {\n location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n $form.spinner().stop();\n }\n });\n return false;\n });\n },\n\n submitPassword: function () {\n $('form.change-password-form').submit(function (e) {\n var $form = $(this);\n e.preventDefault();\n var successTitle = $('.change-password-title').data('success-title'),\n successMsg = $('.change-password-body').data('success-msg');\n var url = $form.attr('action');\n $form.spinner().start();\n $('form.change-password-form').trigger('password:edit', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n $form.spinner().stop();\n if (!data.success) {\n formValidation($form, data);\n } else {\n $('.change-password-title').text(successTitle);\n $('.change-password-body').empty()\n .append('

' + successMsg + '

');\n location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n $form.spinner().stop();\n }\n });\n return false;\n });\n },\n ModalPassword: function () {\n var modalPassword = $('.modal-password'),\n closeModal = modalPassword.find('.close');\n\n if (modalPassword.lenght > 0) return;\n\n closeModal.on('click', function () {\n modalPassword.removeClass('show');\n })\n },\n\n jQueryDataPicker: function () {\n\n var dateDropdownsOptions = {\n submitFieldName: 'skp-select-date',\n defaultDateFormat: 'dd/mm/yyyy',\n submitFormat: 'unix',\n defaultDateFormat: 'unix',\n daySuffixes: false,\n dayLabel: window.Resources.LABEL_DAY,\n monthLabel: window.Resources.LABEL_MONTH,\n yearLabel: window.Resources.LABEL_YEAR,\n monthLongValues: [\n window.Resources.LABEL_MONTHS_JANUARY,\n window.Resources.LABEL_MONTHS_FEBRUARY,\n window.Resources.LABEL_MONTHS_MARCH,\n window.Resources.LABEL_MONTHS_APRIL,\n window.Resources.LABEL_MONTHS_MAY,\n window.Resources.LABEL_MONTHS_JUNE,\n window.Resources.LABEL_MONTHS_JULY,\n window.Resources.LABEL_MONTHS_AUGUST,\n window.Resources.LABEL_MONTHS_SEPTEMBER,\n window.Resources.LABEL_MONTHS_OCTOBER,\n window.Resources.LABEL_MONTHS_NOVEMBER,\n window.Resources.LABEL_MONTHS_DECEMBER\n ]\n }\n if ($('#skp-select-date').data(\"birthdateday\") && $('#skp-select-date').data(\"birthdatemonth\") && $('#skp-select-date').data(\"birthdateyear\")) {\n let birthday = new Date(\n parseInt($('#skp-select-date').data(\"birthdateyear\")), \n parseInt($('#skp-select-date').data(\"birthdatemonth\")), \n parseInt($('#skp-select-date').data(\"birthdateday\"))\n );\n dateDropdownsOptions.defaultDate = Math.floor(birthday.valueOf() / 1000);\n }\n\n $(\"#skp-select-date\").dateDropdowns(dateDropdownsOptions);\n },\n\n EditProfile: function () {\n $('.btn-save[name=\"save\"]').click(function (e) {\n $('.edit-profile-form').find('.invalid-feedback').empty();\n });\n\n $('body').on('change', \".select2-country\" , function () {\n fillInStateField($(this), \".select2-country\", billingStateContainerSelector);\n });\n \n function hideGender() {\n if ($('#dwfrm_profile_byEmail').is(':checked')) {\n $('#dwfrm_profile_civility_1').attr('required', true);\n $('#radio-buttons').removeClass(\"hide\")\n $('#radio-buttons').addClass(\"skp-gender-radio\")\n } else {\n $('#dwfrm_profile_civility_1').removeAttr('required')\n $('#radio-buttons').addClass(\"hide\");\n $('#radio-buttons').removeClass(\"skp-gender-radio\")\n $('#dwfrm_profile_civility_1').removeAttr('aria-required')\n }\n }\n hideGender();\n\n $('#dwfrm_profile_byEmail').on('click', function () {\n hideGender();\n });\n\n $(\"#radio-buttons\").on(\"chicked\", function () {\n $('#radio-buttons').addClass('skp-gender-radio');\n });\n\n selectIso();\n\n\n var valSelect = $(\".skp-select-profile-date select\");\n\n $(valSelect).each(function () {\n if ($(this).get(0).selectedIndex === 0) {\n $(this).removeClass('color-black').addClass('color-gray');\n } else {\n $(this).addClass('color-black').removeClass('color-gray');;\n }\n });\n\n $('.date-dropdowns .day').on('change', function () {\n var valSelect = $(\".date-dropdowns .day\");\n if (valSelect[0].selectedIndex === 0) {\n valSelect.removeClass('color-black').addClass('color-gray');\n } else {\n valSelect.addClass('color-black').removeClass('color-gray');;\n }\n });\n\n $('.date-dropdowns .month').on('change', function () {\n var valSelect = $(\".date-dropdowns .month\");\n if (valSelect[0].selectedIndex === 0) {\n valSelect.removeClass('color-black');\n } else {\n valSelect.addClass('color-black');\n }\n });\n\n $('.date-dropdowns .year').on('change', function () {\n var valSelect = $(\".date-dropdowns .year\");\n if (valSelect[0].selectedIndex === 0) {\n valSelect.removeClass('color-black');\n } else {\n valSelect.addClass('color-black');\n }\n });\n }\n};\n\nif($('.skp-download-invoice .js-track-select').children().length === 0){\n $('.js-select2-invoices').addClass('remove-margin');\n $('.no-block-return').addClass('remove-margin');\n};"],"sourceRoot":""}