{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_monnalisa/cartridge/client/default/js/components/alertNotification.js","webpack:///./cartridges/app_monnalisa/cartridge/client/default/js/components/alerts/alertHelpers.js","webpack:///./cartridges/app_monnalisa/cartridge/client/default/js/components/UUIDGenerator.js","webpack:///./cartridges/app_monnalisa/cartridge/client/default/js/contactUs/contactUs.js","webpack:///./cartridges/app_monnalisa/cartridge/client/default/js/contactUs.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","alert","require","alertNotification","set","alertName","id","alertOptions","alertContainer","document","querySelector","attachToElement","appendTo","prependTo","createAlertContainer","createAlert","UUIDGenerator","message","status","timeout","dismissible","dismissibleAlert","alertUUID","alertHTML","dwPropertyLabels","window","dwResources","properties","close","createAlertHTML","insertAdjacentHTML","setTimeout","parentNode","removeChild","childElementCount","_setAlertTimeout","alertElementDiv","createElement","classList","add","body","append","UUID","Uint32Array","crypto","getRandomValues","contactUs","subscribeContact","$","submit","e","form","this","removeClass","grecaptcha","getResponse","preventDefault","addClass","handleCaseChange","change","target","toLowerCase","attr","removeAttr","handleMessageLimit","MESSAGE_WORDS_LIMIT","data","on","text","replaceAll","trim","words","split","length","siblings","composePhoneNumber","find","prefix","val","number","fullNumber","contactUsInit","init","readyState","addEventListener"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,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EAAE,aAAa8B,IAAIE,GAAYlB,KAAK,QAASkB,KAMrD,WACI5B,KAAKM,mBACLN,KAAKY,qBACLZ,KAAKuB,qBACLvB,KAAKL,qBCjGb,MAAMkC,EAAgB,KAClBnC,EAAUoC,MAGc,YAAxBzE,SAAS0E,WACT1E,SAAS2E,iBAAkB,mBAAoB,KAC3CH,MACD,GAGHA","file":"contactUs.min.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 = 54);\n","'use strict';\n\nvar alert = require('./alerts/alertHelpers');\n\n/**\n * ALERT NOTIFICATION API v1.0x\n * A set of methods and helper functions written in Vanilla Javascript which simplify the creation of standard alert messages according to client's specifications\n * \n * ------------\n * Accepted properties\n * ------------ \n * @param {String} alertName - (MANDATORY) A class name for the alert\n * @param {String} id - (OPTIONAL) An optional identifier for the alert\n * \n * // Alert options - alertOptions: {}\n * @param {String} message - (MANDATORY) The message to attach to alert. It can be simple text or a HTML string - e.g., '

Your product has been added to the wishlist

'\n * @param {String} status - (MANDATORY) the alert status. It accepts two values: 'alert-success' for succesful alerts and 'alert-danger' for warning alerts\n * @param {String} appendTo - (OPTIONAL) The element to append the alert to. It defaults to body\n * @param {Boolean} dismissible - (OPTIONAL) If true, set a dismissible alert. Dismissible alerts have no timeout and a button which requires user interaction in order to close it\n * @param {String} prependTo - (OPTIONAL) The element to prepend the alert to. It defaults to body\n * @param {Boolean} timeout - (OPTIONAL) If false, remove the default timeout for alerts. Dismissible alerts have no timeout by default\n * \n */\n\n/**\n * ----------------\n * Example of usage\n * ----------------\n * var alertNotification = require('./alertNotification');\n * alertNotification.set(\n {\n alertName: 'add-to-wishlist',\n alertOptions: {\n message: data.msg,\n status: 'alert-success' \n }\n }\n);\n*/\n\nclass AlertNotification {\n set ({alertName, id, alertOptions}) {\n let alertContainer = document.querySelector('.alert-messages');\n let attachToElement = alertOptions.appendTo || alertOptions.prependTo;\n\n if (!alertContainer && !attachToElement) {\n alert.createAlertContainer (alertName);\n }\n\n alert.createAlert(alertName, id, alertOptions);\n }\n}\n\nconst alertNotification = new AlertNotification ();\nmodule.exports = alertNotification;\n","'use strict';\n\nvar UUIDGenerator = require('../UUIDGenerator');\n\n/**\n * DEFAULT VALUES\n */\nconst _ALERTTIMEOUT = 5000; // 2 seconds\nconst _DISMISSIBLE = true;\n\n/**\n * Construct the HTML for the alert, depending on whether it's a dismissible alert or not\n * @param {String} status - The status of the alert message. It accepts two values: 'alert-success' for succesful alerts and 'alert-danger' for warning alerts\n * @param {String} id - An optional identifier for the alert\n * @param {String} alertName - A class name for the alert\n * @param {Number} alertUUID - The alert identifier number\n * @param {String} message - The message to attach to alert. It can be simple text or a HTML string - e.g., '

Your product has been added to the wishlist

'\n * @param {Boolean} dismissible - If true, set a dismissible alert. Dismissible alerts have no timeout and a button which requires user interaction in order to close it\n * @returns {String} alert - The HTML repesentation of the request alert\n */\n\nconst createAlertHTML = (status, id, alertName, alertUUID, message, dismissible) => {\n let alert;\n let dwPropertyLabels = window.dwResources.properties;\n\n if (dismissible) {\n alert =`
\n ${message}
`;\n } else {\n alert = `
${message}
`;\n }\n return alert;\n};\n\n/**\n * Set a timeout for the alert. Timeout is active by default in non-dismissible alerts. It can be disabled in any moment by setting timeout: false\n * @param {Number} alertUUID - A universally unique identifier for the alert\n * @param {Object} alertContainer - The alert container.\n */\n\nconst _setAlertTimeout = (alertUUID, alertContainer) => {\n\n setTimeout(() => {\n let alert = document.querySelector(`[data-alert-uuid=\"${alertUUID}\"]`);\n alert.parentNode.removeChild(alert);\n\n if (alertContainer.childElementCount == 0) {\n alertContainer.parentNode.removeChild(alertContainer);\n }\n }, _ALERTTIMEOUT);\n};\n\n/**\n * Create alert with the requested options\n * @param {String} alertName - A class name for the alert\n * @param {String} id - An optional identifier for the alert\n * @param {String} message - The message to attach to alert. It can be simple text or a HTML string - e.g., '

Your product has been added to the wishlist

'\n * @param {String} status - The alert status. It accepts two values: 'alert-success' for succesful alerts and 'alert-danger' for warning alerts\n * @param {String} appendTo - The element to append the alert to. It defaults to body.\n * @param {String} prependTo - The element to prepend the alert to. It defaults to body\n * @param {Boolean} timeout - If false, remove the default timeout for alerts. Dismissible alerts have no timeout by default\n * @param {Boolean} dismissible - If true, set a dismissible alert. Dismissible alerts have no timeout and a button which requires user interaction in order to close it\n */\n\nconst createAlert = (alertName, id, {message, status, appendTo, prependTo, timeout, dismissible}) => {\n let attachToElement = appendTo || prependTo;\n var dismissibleAlert = dismissible == false ? dismissible : _DISMISSIBLE;\n\n let alertContainer = document.querySelector(attachToElement) || document.querySelector('.alert-messages');\n let alertUUID = UUIDGenerator.get();\n let alertHTML = createAlertHTML(status, id, alertName, alertUUID, message, dismissibleAlert);\n\n if (attachToElement) {\n alertContainer.insertAdjacentHTML(appendTo ? 'beforeend' : 'afterbegin', alertHTML);\n } else {\n alertContainer.insertAdjacentHTML('afterbegin', alertHTML);\n\n }\n\n if (dismissible != true && timeout != false) {\n _setAlertTimeout(alertUUID, alertContainer);\n }\n};\n\n/**\n * Create an alert container. An alert container is automatically created when no element to attach the alert to has been specified using the appendTo and prependTo options or when no alert container already exists\n * @param {String} alertName - A class name for the alert\n */\nconst createAlertContainer = (alertName) => {\n const alertElementDiv = document.createElement('div');\n alertElementDiv.classList.add(`${alertName}-messages`, 'alert-messages');\n\n document.body.append(alertElementDiv);\n};\n\nmodule.exports = {\n createAlert: createAlert,\n createAlertContainer: createAlertContainer\n};\n\n","'use strict';\n\n/**\n * Construct a Universally Unique IDentifier number\n * @returns {Number} A universally unique identifier\n */\n\nconst getUUID = () => {\n let UUID = new Uint32Array(1);\n window.crypto.getRandomValues(UUID);\n\n return UUID[0];\n};\n\nmodule.exports = {\n get: getUUID\n};","'use strict';\n\nvar alertNotification = require('../components/alertNotification');\n\n/**\n * Display the returned message.\n * @param {string} data - data returned from the server's ajax call\n * @param {Object} button - button that was clicked for contact us sign-up\n */\nfunction displayMessage (data) {\n $.spinner().stop();\n var status;\n if (data.success) {\n status = 'alert-success';\n } else {\n status = 'alert-danger';\n }\n\n alertNotification.set(\n {\n alertName: 'contact-us-signup',\n alertOptions: {\n message: data.msg,\n status: status\n }\n }\n );\n}\n\nclass ContactUs {\n subscribeContact () {\n $('form.contact-us').submit(function (e) {\n var form = $(this);\n // var url = form.attr('action');\n\n $('.g-recaptcha', form).removeClass('is-invalid');\n if (!window.grecaptcha.getResponse()) {\n e.preventDefault();\n $('.g-recaptcha', form).addClass('is-invalid');\n return false;\n }\n\n // $.spinner().start();\n // $.ajax({\n // url: url,\n // type: 'post',\n // dataType: 'json',\n // data: form.serialize(),\n // success: function (data) {\n // displayMessage(data);\n // if (data.success) {\n // $('.contact-us').trigger('reset');\n // }\n // },\n // error: function (err) {\n // displayMessage(err);\n // }\n // });\n });\n }\n\n handleCaseChange () {\n $('.js-contact-topic').change((e) => {\n const isCaseOrder = e.target.value.toLowerCase() === 'order';\n\n if (isCaseOrder) {\n $('.order-number').removeClass('hidden');\n $('.order-number input').attr('required', 'required').addClass('required');\n } else {\n $('.order-number').addClass('hidden');\n $('.order-number input').removeAttr('required').removeClass('required');\n }\n });\n }\n\n handleMessageLimit () {\n const MESSAGE_WORDS_LIMIT = $('.js-contact-message').data('parsley-words-limit');\n\n $('.js-contact-message').on('input', e => {\n const value = e.target.value;\n const text = value.replaceAll(/\\s+/g, ' ').trim();\n const words = text ? text.split(' ').length : 0;\n\n $('.js-contact-message').siblings('.help-block').text(`${words}/${MESSAGE_WORDS_LIMIT}`);\n });\n }\n\n composePhoneNumber() {\n const form = $('form.contact-us');\n\n const concat = () => {\n const prefix = $('.js-phone-prefix', form).val();\n const number = $('.js-phone-number', form).val();\n const fullNumber = `${prefix}${number}`;\n\n $('.js-phone').val(fullNumber).attr('value', fullNumber);\n };\n\n form.find('.js-phone-prefix, .js-phone-number').on('change input', concat);\n }\n\n get init () {\n this.handleCaseChange();\n this.handleMessageLimit();\n this.composePhoneNumber();\n this.subscribeContact();\n }\n}\n\nconst contactUs = new ContactUs;\nexport default contactUs;\n","'use strict';\n\nimport contactUs from './contactUs/contactUs';\n\n/**\n * Initialize contactUs js assets\n */\n\nconst contactUsInit = () => {\n contactUs.init;\n};\n\nif (document.readyState === 'loading') {\n document.addEventListener ('DOMContentLoaded', () => {\n contactUsInit();\n }, false);\n\n} else {\n contactUsInit();\n}"],"sourceRoot":""}