{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./codebase/orange/cartridges/app_storefront_core/cartridge/client/default/js/dataLayer/dataLayer.js","webpack:///./codebase/orange/cartridges/app_storefront_core/cartridge/client/default/js/globalModal/globalModalConfig.js","webpack:///./codebase/orange/cartridges/app_storefront_core/cartridge/client/default/js/product/detailTariff.js","webpack:///./codebase/orange/cartridges/app_storefront_core/cartridge/client/default/js/productDetailTariff.js","webpack:///./codebase/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.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;AACA;;AAEa;;AAEb;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uHAAuH;AACvH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACjQa;;AAEb;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,CAAC;;;;;;;;;;;;;AC3BY;;AAEb,sBAAsB,mBAAO,CAAC,qIAA0B;AACxD,wBAAwB,mBAAO,CAAC,yJAAoC;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;;;;;;;;;;;AClBa;;AAEb,qBAAqB,mBAAO,CAAC,kIAAW;;AAExC;AACA,mBAAmB,mBAAO,CAAC,oIAAwB;AACnD,CAAC;;;;;;;;;;;;;ACNY;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA","file":"default\\js\\productDetailTariff.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/orange/cartridges/app_storefront_core/cartridge/client/default/js/productDetailTariff.js\");\n","/* eslint-disable camelcase */\r\n/* eslint-disable no-undef */\r\n\r\n'use strict';\r\n\r\n/**\r\n * Gets the product name from the utag_data object\r\n * @returns {string} the product name or an empty string if not found\r\n */\r\nfunction getProductName() {\r\n return (typeof utag_data !== 'undefined' && utag_data.product_name !== undefined) ? utag_data.product_name : '';\r\n}\r\n\r\n/**\r\n * Gets the product category from utag_data\r\n * @returns {string} the product category from utag_data\r\n */\r\nfunction getProductCategory() {\r\n return (typeof utag_data !== 'undefined' && utag_data.product_category !== undefined) ? utag_data.product_category : '';\r\n}\r\n\r\n/**\r\n * Gets the page category from utag_data\r\n * @returns {string} the page category from utag_data\r\n */\r\nfunction getPageCategory() {\r\n return (typeof utag_data !== 'undefined' && utag_data.pageCategory !== undefined) ? utag_data.pageCategory : '';\r\n}\r\n\r\n/**\r\n * Gets the page name from the utag_data object\r\n * @returns {string} the page name or an empty string if not found\r\n */\r\nfunction getPageName() {\r\n return (typeof utag_data !== 'undefined' && utag_data.pageName !== undefined) ? utag_data.pageName : '';\r\n}\r\n\r\n/**\r\n * Gets the page name from the utag_data object\r\n * @returns {string} the page name without web:orange: or an empty string if not found\r\n */\r\nfunction getPageNameWithoutWebOrange() {\r\n var name = getPageName().replace('web:orange:', '').replace('tiendaOnline:', '');\r\n return name;\r\n}\r\n\r\n/**\r\n * Checks if the user is a client\r\n * @returns {boolean} - true if the user is a client, false otherwise\r\n */\r\nfunction isClient() {\r\n return (typeof utag_data !== 'undefined' && utag_data.userType === 'cliente');\r\n}\r\n\r\n/**\r\n * Returns the page type from utag_data\r\n * @returns {string} - the page type from utag_data\r\n */\r\nfunction getPageType() {\r\n return (typeof utag_data !== 'undefined' && utag_data.pageType !== 'undefined') ? utag_data.pageType : '';\r\n}\r\n\r\n/**\r\n * Builds a data layer event link\r\n * @param {Object} obj - object with data button\r\n * @returns {Promise} A Promise that resolves when the AJAX request is complete and any returned data has been added to the `utag_data` object.\r\n */\r\nfunction addProductToDataLayer(obj) {\r\n return new Promise(function (resolve, reject) {\r\n if (obj.tokenname !== null && obj.token !== null && obj.category !== null && typeof utag_data !== 'undefined') {\r\n var data = {};\r\n data.id = obj.category;\r\n data[obj.tokenname] = obj.token;\r\n $.ajax({\r\n url: obj.url,\r\n type: 'post',\r\n data: data,\r\n dataType: 'json'\r\n }).done((resp) => {\r\n if (resp) {\r\n if (Object.keys(resp.data).length) {\r\n Object.keys(resp.data).forEach(key => {\r\n utag_data[key] = resp.data[key];\r\n });\r\n }\r\n }\r\n resolve();\r\n }).fail(() => {\r\n reject();\r\n });\r\n } else {\r\n reject();\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Builds a data layer event link\r\n * @param {string} zone - the event zone\r\n * @param {string} type - the event type\r\n * @param {string} name - the event name\r\n * @param {string} [event=null] - the Tealium event (optional)\r\n */\r\nfunction buildDataLayerEventLink(zone, type, name, event = null) {\r\n if (zone && name && typeof utag_data !== 'undefined' && typeof utag !== 'undefined') {\r\n utag_data.event_zone = zone;\r\n utag_data.event_name = name;\r\n utag_data.event_type = type;\r\n if (event !== null) {\r\n utag_data.tealium_event = event;\r\n }\r\n utag.track('link', utag_data);\r\n }\r\n}\r\n\r\n/**\r\n * Builds a data layer event link for the given zone, type, name and event\r\n * @param {string} zone - the zone of the event\r\n * @param {string} type - the type of the event\r\n * @param {string} name - the name of the event\r\n * @param {Object} [event] - the event object (optional)\r\n */\r\nfunction buildDataLayerEventLinkCheckout(zone, type, name, event = null) {\r\n if (typeof utag_data !== 'undefined') {\r\n zone = 'tiendaOnline:' + zone;\r\n if (isClient()) {\r\n zone = 'areaCliente:' + zone;\r\n }\r\n buildDataLayerEventLink(zone, type, name, event);\r\n }\r\n}\r\n\r\n/**\r\n * Builds the data layer view for the given section and data\r\n * @param {string} section - the section of the data layer\r\n * @param {Object} data - the data to be added to the data layer\r\n * @returns {void}\r\n */\r\nfunction buildDataLayerView(section, data) {\r\n if (typeof utag_data !== 'undefined' && typeof utag !== 'undefined') {\r\n var pageData = $('.js-data-layer').data('layer-' + section);\r\n if (pageData !== '') {\r\n utag_data.pageName = pageData.pageName;\r\n utag_data.pageType = pageData.pageType;\r\n var step = pageData.pageType.split(':');\r\n utag_data.checkoutStep = step[1].replace('paso', '');\r\n utag_data.pageVirtual = window.location.protocol + '//' + utag_data['dom.domain'] + utag_data['dom.pathname'];\r\n if (utag_data['dom.pathname'].slice(-1) !== '/') {\r\n utag_data.pageVirtual += '/';\r\n }\r\n utag_data.pageVirtual += pageData.stepID;\r\n }\r\n utag_data.tealium_event = 'checkout';\r\n if (Object.keys(data).length) {\r\n Object.keys(data).forEach(key => {\r\n utag_data[key] = data[key];\r\n });\r\n }\r\n\r\n // load again the view data\r\n utag.track('view', utag_data);\r\n\r\n // replace variable in script\r\n // eslint-disable-next-line no-use-before-define\r\n replaceScript();\r\n }\r\n}\r\n\r\n/**\r\n * Builds the data layer view general\r\n * @param {Object} data - the data to be added to the data layer\r\n */\r\nfunction buildDataLayerViewGeneral(data) {\r\n if (typeof utag_data !== 'undefined' && typeof utag !== 'undefined') {\r\n Object.keys(data).forEach(key => {\r\n utag_data[key] = data[key];\r\n });\r\n\r\n // load again the view data\r\n utag.track('view', utag_data);\r\n\r\n // replace variable in script\r\n // eslint-disable-next-line no-use-before-define\r\n replaceScript();\r\n }\r\n}\r\n\r\n/**\r\n * Removes the general data from the data layer and reloads the view data\r\n * @param {Object} data - the data to be removed from the data layer\r\n * @param {Array} except - the keys to be excluded from the removal\r\n * @returns {void}\r\n */\r\nfunction removeDataLayerViewGeneralData(data, except = []) {\r\n if (typeof utag_data !== 'undefined' && typeof utag !== 'undefined') {\r\n Object.keys(data).forEach(key => {\r\n if (except.indexOf(key) === -1) {\r\n delete utag_data[key];\r\n }\r\n });\r\n\r\n // load again the view data\r\n utag.track('view', utag_data);\r\n\r\n // replace variable in script\r\n // eslint-disable-next-line no-use-before-define\r\n replaceScript();\r\n }\r\n}\r\n\r\n/**\r\n * Replaces a script element with a new one that contains the `utag_data` variable.\r\n *\r\n * @function\r\n * @name replaceScript\r\n * @returns {void}\r\n *\r\n * @description\r\n * This function replaces a script element with a new one that contains the `utag_data` variable. The `utag_data` variable is a global variable that contains data for the Tealium tag management system.\r\n * This function assumes that there is an existing script element with the ID `js-data-layer-script` on the page. The `utag_data` variable must be defined and accessible in the global scope for this function to work properly.\r\n */\r\nfunction replaceScript() {\r\n if (typeof utag_data !== 'undefined') {\r\n // Get the script element to replace\r\n var scriptToReplace = document.getElementById('js-data-layer-script');\r\n if (scriptToReplace) {\r\n // Create a new script element\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.id = 'js-data-layer-script';\r\n // Create a text node with the utag_data variable\r\n var scriptContent = document.createTextNode('var utag_data = ' + JSON.stringify(utag_data, null, ' ') + ';');\r\n script.appendChild(scriptContent);\r\n // Replace the old script element with the new one\r\n scriptToReplace.parentNode.replaceChild(script, scriptToReplace);\r\n }\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n methods: {\r\n buildDataLayerView: buildDataLayerView,\r\n buildDataLayerEventLinkCheckout: buildDataLayerEventLinkCheckout,\r\n buildDataLayerEventLink: buildDataLayerEventLink,\r\n getProductName: getProductName,\r\n buildDataLayerViewGeneral: buildDataLayerViewGeneral,\r\n getProductCategory: getProductCategory,\r\n getPageCategory: getPageCategory,\r\n getPageType: getPageType,\r\n getPageName: getPageName,\r\n getPageNameWithoutWebOrange: getPageNameWithoutWebOrange,\r\n removeDataLayerViewGeneralData: removeDataLayerViewGeneralData,\r\n addProductToDataLayer: addProductToDataLayer,\r\n isClient: isClient,\r\n replaceScript: replaceScript\r\n\r\n }\r\n};\r\n","'use strict';\r\n\r\n/**\r\n * Global Modal Configuration\r\n *\r\n * @module globalModal/globalModalConfig\r\n */\r\nmodule.exports = Object.freeze({\r\n GLOBAL_MODAL_SAVE_ID: '.js-modal-save',\r\n GLOBAL_MODAL_CLOSE_ID: '.js-modal-close',\r\n GLOBAL_MODAL_ID: 'body #globalModal-drawer',\r\n GLOBAL_MODAL_BODY_CONTENT_ID: '.js-modal-body-content',\r\n GLOBAL_MODAL_TITLE_ID: '.js-modal-title',\r\n GLOBAL_MODAL_ALERT_BTN_ID: '.js-modal-alert-btn',\r\n GLOBAL_MODAL_ALERT_ID: '#js-modal-alert',\r\n GLOBAL_MODAL_ALERT_BIGTITLE_ID: '.modal-title',\r\n GLOBAL_MODAL_ALERT_TITLE_ID: '.js-modal-alert-title',\r\n GLOBAL_MODAL_ALERT_BODY_ID: '.js-modal-alert-body',\r\n GLOBAL_MODAL_ALERT_OUTER_ID: '#js-modal-alert-outer',\r\n GLOBAL_MODAL_ALERT_OUTER_BODY_ID: '.js-modal-alert-outer-body',\r\n GLOBAL_MODAL_ALERT_OUTER_TITLE_ID: '#js-modal-alert-outer .modal-title',\r\n GLOBAL_MODAL_ALERT_FOOTER_ID: '.js-modal-alert-footer',\r\n GLOBAL_MODAL_ALERT_FOOTER_BODY_ID: '.js-modal-alert-footer-body',\r\n GLOBAL_MODAL_ALERT_FOOTER_BUTTONS_ID: '.js-modal-alert-footer-buttons',\r\n GLOBAL_MODAL_ALERT_FOOTER_BUTTON_ID: '.js-modal-alert-footer-button',\r\n GLOBAL_MODAL_ALERT_FOOTER_BUTTON_REJECT_ID: '.js-modal-alert-reject',\r\n GLOBAL_MODAL_ALERT_FOOTER_BUTTON_ACCEPT_ID: '.js-modal-alert-accept'\r\n});\r\n","'use strict';\r\n\r\nvar dataLayerHelper = require('core/dataLayer/dataLayer');\r\nvar globalModalConfig = require('core/globalModal/globalModalConfig');\r\n\r\nmodule.exports = {\r\n productDetailsTariff: function () {\r\n if (document.querySelector('.js-more-info-btn')) {\r\n $('.js-more-info-btn').on('click', function () {\r\n var $modal = $(globalModalConfig.GLOBAL_MODAL_ID);\r\n var content = $(this).data('rendered');\r\n var title = $(this).data('title');\r\n dataLayerHelper.methods.buildDataLayerEventLink('moduloFibra', 'clickButton', 'MasInfo:' + dataLayerHelper.methods.getProductCategory());\r\n $modal.find(globalModalConfig.GLOBAL_MODAL_TITLE_ID).html(title);\r\n $modal.find(globalModalConfig.GLOBAL_MODAL_BODY_CONTENT_ID).html(content);\r\n });\r\n }\r\n }\r\n};\r\n","'use strict';\r\n\r\nvar processInclude = require('base/util');\r\n\r\n$(document).ready(function () {\r\n processInclude(require('./product/detailTariff'));\r\n});\r\n","'use strict';\r\n\r\nmodule.exports = function (include) {\r\n if (typeof include === 'function') {\r\n include();\r\n } else if (typeof include === 'object') {\r\n Object.keys(include).forEach(function (key) {\r\n if (typeof include[key] === 'function') {\r\n include[key]();\r\n }\r\n });\r\n }\r\n};\r\n"],"sourceRoot":""}