{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../codebase/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/errorNotification.js","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/FormRegex.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/login.js","webpack:///../codebase/tkooples/cartridges/app_core_tkooples/cartridge/client/default/js/login/login.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/validateEmailForm.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;AACA,yCAAyC;AACzC;;AAEA;AACA;;;;;;;;;;;;;ACVa;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;ACda;;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,qBAAqB,mBAAO,CAAC,mIAAW;;AAExC;AACA,mBAAmB,mBAAO,CAAC,mHAAe;AAC1C,CAAC;;;;;;;;;;;;;ACNY;;AAEb,qBAAqB,mBAAO,CAAC,gJAA8B;AAC3D,8BAA8B,mBAAO,CAAC,mLAAmC;AACzE,OAAO,YAAY,GAAG,mBAAO,CAAC,kHAAe;AAC7C,OAAO,iBAAiB,GAAG,mBAAO,CAAC,gHAAc;AACjD,OAAO,oBAAoB,GAAG,mBAAO,CAAC,gIAAsB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;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;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,uDAAuD,wBAAwB;AAC/E;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,uDAAuD,wBAAwB;AAC/E;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;;AAET,KAAK;AACL;;AAEA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;AAEA,oB;;;;;;;;;;;;AC3Ya;;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;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4CAA4C,IAAI;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,E","file":"default/js/login.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/login.js\");\n","'use strict';\n\nmodule.exports = function (element, message) {\n var errorHtml = '
' +\n '' + message + '
';\n\n $(element).append(errorHtml);\n};\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';\nmodule.exports = {\n FormInputRegex: function () {\n $('.form-regex-caractere input[type=text]').bind('input', function () {\n var c = this.selectionStart,\n pattern = /[^a-zA-Z0-9 '-]/gi,\n valInput = $(this).val();\n if (pattern.test(valInput)) {\n $(this).val(valInput.replace(pattern, ''));\n c--;\n }\n this.setSelectionRange(c, c);\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\nvar processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./login/login'));\n});\n","'use strict';\n\nvar formValidation = require('../components/formValidation');\nvar createErrorNotification = require('base/components/errorNotification');\nconst { selectIso } = require('../phoneRegex');\nconst { FormInputRegex } = require('../FormRegex');\nconst { validateEmailForm } = require('../validateEmailForm');\n\nvar showAccountCreationForm = function () {\n $.ajax({\n type: 'POST',\n url: $(\".show-customer-form\").data('url'),\n datatype: 'json',\n data: {\n email: $('#email-guest').val()\n },\n success: function (response) {\n if (!response.error) {\n $('.form-content').html(response.formHTML);\n login.initRegistrationForm();\n }\n }\n });\n}\n\nvar submitCheckEmail = function (data) {\n $.ajax({\n type: 'POST',\n url: $(login.checkEmailFormSelector).attr('action'),\n datatype: 'json',\n data: data,\n success: function (data) {\n login.handleErrors(data.message)\n if (!data.error) {\n login.renderHtml(data.formHTML);\n }\n //registration from ==> bind events\n if (data.code == 4321) {\n login.initRegistrationForm();\n }\n },\n error: function (error) {\n $('.btn-loader .loading').addClass('no-load');\n $('.login-page .invalid-feedback').empty();\n var invalidFeedbackEmail = $('.invalid-feedback-email');\n if (invalidFeedbackEmail.text().trim() === '') {\n var errorMessage = $('.login-page').data('captcha-error');\n $('#check-email-input-error').empty().append(errorMessage);\n $('.form-content .check-email').addClass('email-checked');\n }\n }\n });\n};\n\nvar submitLogin = function (form, formData) {\n var url = form.attr('action');\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: formData,\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n $('#form-password-error').empty().append(data.error[0]);\n } else {\n $('form.login').trigger('login:success', data);\n location.href = data.redirectUrl;\n }\n },\n error: function (data) {\n if (data.responseJSON && data.responseJSON.redirectUrl) {\n window.location.href = data.responseJSON.redirectUrl;\n } else if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n } else {\n $('form.login').trigger('login:error', data);\n form.spinner().stop();\n $('.login-page .invalid-feedback').empty();\n var errorMessage = $('.login-page').data('captcha-error');\n $('.error-captcha-message').empty().append(errorMessage);\n $('.form-content .check-email').addClass('email-checked');\n }\n }\n });\n}\nfunction submitRegister(form, formData) {\n var url = form.attr('action');\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: formData,\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n $('form.registration').trigger('login:register:error', data);\n formValidation(form, data);\n } else {\n $('form.registration').trigger('login:register:success', data);\n location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n $('form.registration').trigger('login:register:error', err);\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification($('.error-messaging'), err.responseJSON.errorMessage);\n }\n\n form.spinner().stop();\n }\n });\n};\n\nvar login = {\n formsContainer: $(\".form-container\"),\n errorsContainer: $(\".form-errors-container\"),\n checkEmailFormSelector: \"form#check-email-form\",\n loginFormSelector: 'form.login',\n registerFormSelector: 'form.registration',\n handleErrors: function (errors = null) {\n if (!errors) {\n login.errorsContainer.html(\"\");\n } else if (Array.isArray(errors)) {\n login.errorsContainer.empty();\n $.each(errors, function (index, errorHtml) {\n login.errorsContainer.append(errorHtml)\n })\n } else {\n $('.check-email-submit-form .invalid-feedback').html(errors);\n $('.btn-loader .loading').addClass('no-load');\n }\n },\n renderHtml: function (html) {\n login.formsContainer.html(html);\n },\n checkEmail: function () {\n $('.btn-loader .loading').removeClass('no-load');\n var formData = {\n csrf_token: $(\"input[name='csrf_token']\").val(),\n email: $('#check-email-input').val() ? $('#check-email-input').val() : ''\n };\n if (window.sitePreferences.RECAPTCHA_V3_ENABLED) {\n grecaptcha.ready(function () {\n grecaptcha.execute(sitePreferences.RECAPTCHA_SITE_KEY, {\n action: 'submit'\n }).then(function (token) {\n formData.reCaptchatoken = token;\n submitCheckEmail(formData);\n }).catch(function (error) {\n // Gestion de l'erreur du captcha\n $('.login-page .invalid-feedback').empty();\n var errorMessage = $(\".login-page\").data(\"captcha-error\");\n $('.error-captcha-message').empty().append(errorMessage);\n });\n });\n } else {\n submitCheckEmail(formData);\n }\n },\n initRegistrationForm: function () {\n $('#dwfrm_profile_byEmail').on('click', function () {\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\n $(\"#radio-buttons\").on(\"chicked\", function () {\n $('#radio-buttons').addClass('skp-gender-radio');\n });\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: \"DD\",\n monthLabel: \"MM\",\n yearLabel: \"YYYY\",\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 \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 selectIso();\n\n $('.date-dropdowns .day').on('change', function () {\n var valSelect = $(\".date-dropdowns .day\");\n if (valSelect[0].selectedIndex === 0)\n {\n valSelect.removeClass('color-black');\n } else {\n valSelect.addClass('color-black');\n }\n });\n\n $('.date-dropdowns .month').on('change', function () {\n var valSelect = $(\".date-dropdowns .month\");\n if (valSelect[0].selectedIndex === 0)\n {\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 {\n valSelect.removeClass('color-black');\n } else {\n valSelect.addClass('color-black');\n }\n });\n\n },\n submitGuestCustomer: function(){\n var customerForm=$('#guest-customer');\n $.ajax({\n url: customerForm.attr('action'), \n type: 'post',\n data: customerForm.serialize(),\n success: function (data) {\n window.location.href = data.redirectUrl;\n },\n error: function (err) {\n console.log(\"error\")\n }\n });\n },\n init: function () {\n $(document).on(\"submit\", login.checkEmailFormSelector, function (e) {\n e.preventDefault();\n login.checkEmail();\n });\n //guest\n $(document).on('click', '.submit-customer', function (e) {\n e.preventDefault();\n login.submitGuestCustomer()\n });\n\n //login\n $(document).on(\"submit\", login.loginFormSelector, function (e) {\n var form = $(this),\n formPassword = form.find('.form-alert'),\n titleError= form.find('.title-error').data('title-error');\n e.preventDefault();\n form.spinner().start();\n $('form.login').trigger('login:submit', e);\n var formData = form.serialize();\n if (window.sitePreferences.RECAPTCHA_V3_ENABLED) {\n grecaptcha.ready(function () {\n grecaptcha.execute(sitePreferences.RECAPTCHA_SITE_KEY, {\n action: 'submit'\n }).then(function (token) {\n formData = [formData, $.param({ reCaptchatoken: token })].join('&');\n submitLogin(form, formData);\n }).catch(function (error) {\n // Gestion de l'erreur du captcha\n form.spinner().stop();\n $('.login-page .invalid-feedback').empty();\n var errorMessage = $(\".login-page\").data(\"captcha-error\");\n $('.error-captcha-message').empty().append(errorMessage);\n });\n });\n } else {\n submitLogin(form, formData)\n }\n\n return false;\n });\n\n $(document).on(\"click\", \".js-close-btn\", function(e){\n $('.alert-password').hide();\n });\n\n //register:\n $(document).on(\"submit\", login.registerFormSelector, function (e) {\n var form = $(this);\n e.preventDefault();\n form.spinner().start();\n $('form.registration').trigger('login:register', e);\n var formData = form.serialize();\n if (window.sitePreferences.RECAPTCHA_V3_ENABLED) {\n grecaptcha.ready(function () {\n grecaptcha.execute(sitePreferences.RECAPTCHA_SITE_KEY, {\n action: 'submit'\n }).then(function (token) {\n formData = [formData, $.param({ reCaptchatoken: token })].join('&');\n submitRegister(form, formData);\n }).catch(function (error) {\n // Gestion de l'erreur du captcha\n form.spinner().stop();\n $('.login-page .invalid-feedback').empty();\n var errorMessage = $('.login-page').data('captcha-error');\n $('.error-captcha-message').empty().append(errorMessage);\n });\n });\n } else {\n submitRegister(form, formData);\n }\n \n return false;\n });\n\n $(document).on(\"submit\",'.reset-password-form',function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('.reset-password-form').trigger('login:register', 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 $('.request-password-title').text(data.receivedMsgHeading);\n $('.request-password-body').empty()\n .append('

' + data.receivedMsgBody + '

');\n if (!data.mobile) {\n $('#submitEmailButton').text(data.buttonText)\n .attr('data-dismiss', 'modal');\n } else {\n $('.send-email-btn').empty()\n .html('' +\n data.buttonText + ''\n );\n }\n }\n },\n error: function () {\n form.spinner().stop();\n }\n });\n return false;\n });\n\n },\n}\n\nFormInputRegex();\n\n$(document).on(\"click\", \".show-customer-form\", function (e) {\n showAccountCreationForm();\n});\n\n$('#check-email-input').on('input', function(){\n $('#check-email-input-error').empty();\n});\n\nmodule.exports = login.init;\n\nvalidateEmailForm();","'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\nmodule.exports = {\n validateEmailForm: function () {\n $('.check-email-submit-btn').on('click', function () {\n var email = $(\"#check-email-input\").val();\n\n // RĂ©initialiser les messages d'erreur\n $(\".invalid-feedback-email\").empty();\n\n var regex = /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/;\n var partsAfterLastDot = email.split('.').pop();\n\n var errorMessageEmpty = $('.login-form-check').data('email-check-empty'),\n errorMessageValid = $('.login-form-check').data('email-check-valid'),\n errorMessageFull = $('.login-form-check').data('email-check-full'),\n errorMessageAfter = $('.login-form-check').data('email-check-after'),\n errorMessageAfterText = $('.login-form-check').data('email-check-after-text'),\n errorMessageBefore = $('.login-form-check').data('email-check-before'),\n errorMessageMissingPoint = $('.login-form-check').data('email-check-missing-point'),\n errorMessageMissingPointText = $('.login-form-check').data('email-check-missing-point-text');\n\n // Conditions de validation\n if (email === \"\") {\n $(\".invalid-feedback-email\").text(errorMessageEmpty);\n } else if (email.split(\"@\")[0].indexOf(\"?\") !== -1) {\n $(\".invalid-feedback-email\").text(errorMessageBefore);\n } else if (email.indexOf(\"@\") === -1) {\n $(\".invalid-feedback-email\").text(errorMessageFull + \" \" + '\"' + email + '\"' + \".\");\n } else if (email.indexOf(\"@\") === -1 || email.split(\"@\")[1] === \"\") {\n $(\".invalid-feedback-email\").text(errorMessageAfter + \" \" + email + \" \" + errorMessageAfterText);\n } else if (partsAfterLastDot.length === 0) {\n $(\".invalid-feedback-email\").text(errorMessageMissingPoint + ' \"' + email.split('@')[1] + '\"' + errorMessageMissingPointText + \".\");\n } else if (!regex.test(email) && (email.indexOf(\"@\") === -1 || email.split(\"@\")[1] === \"\")) {\n $(\".invalid-feedback-email\").text(errorMessageValid);\n } else if (!regex.test(email)) {\n $(\".invalid-feedback-email\").text(errorMessageValid);\n }\n setTimeout(function () {\n $('.btn-loader .loading').addClass('no-load');\n }, 500);\n });\n }\n};"],"sourceRoot":""}