{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./codebase/orange/cartridges/app_osp_renove_orange/cartridge/client/default/js/pageHeader.js","webpack:///./codebase/orange/cartridges/app_osp_renove_orange/cartridge/client/default/js/pageHeader/pageHeader.js","webpack:///./codebase/orange/cartridges/app_storefront_core/cartridge/client/default/js/dataLayer/dataLayer.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;;AAEb,qBAAqB,mBAAO,CAAC,kIAAW;;AAExC;AACA,mBAAmB,mBAAO,CAAC,wIAAyB;AACpD,CAAC;;;;;;;;;;;;;ACNY;;AAEb;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU;AACrC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,gCAAgC,mBAAO,CAAC,qIAA0B;AAClE;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5JA;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,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA","file":"default\\js\\pageHeader.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_osp_renove_orange/cartridge/client/default/js/pageHeader.js\");\n","'use strict';\r\n\r\nvar processInclude = require('base/util');\r\n\r\n$(document).ready(function () {\r\n processInclude(require('./pageHeader/pageHeader'));\r\n});\r\n","'use strict';\r\n\r\nconst functions = {};\r\n\r\n/**\r\n * Function that handles the logout click event\r\n * @returns {void}\r\n */\r\nfunctions.handleLogoutClick = function () {\r\n $(document).on('click', '.js-user-logout', function () {\r\n var url = $(this).data('url');\r\n window.location.href = url;\r\n });\r\n};\r\n\r\nfunctions.refreshProducts = function () {\r\n $('.js-renove-remove-plp-filters').trigger('click');\r\n};\r\n\r\n/**\r\n * Handles the click event for the Renove carousel\r\n * @returns {void}\r\n */\r\nfunctions.handleRenoveCarouselClick = function () {\r\n $(document).on('click', '.js-swiper-slide-renove', function (e) {\r\n if (!$(e.target).hasClass('js-renove-line')) return;\r\n\r\n const radioInput = $(this).find('input[type=\"radio\"]').first();\r\n const errorCode = $(radioInput).data('error-code');\r\n switch (errorCode) {\r\n case 'childhood':\r\n $('#modalRenoveChildhoodWarning').modal();\r\n break;\r\n case 'prepaid':\r\n e.preventDefault();\r\n $('#modalRenovePrepaidError').modal();\r\n break;\r\n case 'landline':\r\n e.preventDefault();\r\n $('#modalRenoveLandlineError').modal();\r\n break;\r\n case 'noProductBundle':\r\n e.preventDefault();\r\n $('#modalRenoveNoProductBundleError').modal();\r\n break;\r\n }\r\n if ($(radioInput).val() === 'true' && errorCode !== 'childhood') {\r\n functions.refreshProducts();\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Handles the click event for the Renove Carousel\r\n * @returns {void}\r\n */\r\nfunctions.handleRenoveShowChildhoodTariff = function () {\r\n $(document).on('click', '.js-renove-show-childhood-tariff', function (e) {\r\n $('.js-renove-childhood-close-modal').trigger('click');\r\n functions.refreshProducts();\r\n });\r\n};\r\n\r\n/**\r\n * Initializes an event listener for the 'shown.bs.modal' event on the '#modalLogout' element.\r\n * @returns {void}\r\n */\r\nfunctions.handleModalLogoutShow = function () {\r\n $('body').on('shown.bs.modal', '#modalLogout, #modalLogoutAbandonedCart, #modalAbandonedCart', function (e) {\r\n if ($('.modal-backdrop.show').length > 1) {\r\n let long = $('.modal-backdrop.show').length;\r\n for (let i = 1; i < long; i++) {\r\n $('.modal-backdrop.show')[i].remove();\r\n }\r\n }\r\n });\r\n\r\n $(document).on('click', '.js-open-logout-modal', function () {\r\n // obtener el valor del input oculto showLogutAbandonedCartModal y si es true mostrar el modal\r\n var showLogutAbandonedCartModal = $('#showLogutAbandonedCartModal2').val();\r\n if (showLogutAbandonedCartModal === 'true') {\r\n $('#modalLogoutAbandonedCart').modal();\r\n } else {\r\n $('#modalLogout').modal();\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Refreshes the distributive page by making an AJAX GET request to the specified URL with the provided phone number.\r\n * On success, replaces the content of the distributive page section with the response HTML.\r\n *\r\n * @param {string} url - The URL to which the AJAX request is sent.\r\n * @param {string} phoneNumber - The phone number to be sent as a parameter in the AJAX request.\r\n * @returns {void}\r\n */\r\nfunctions.refreshDistributivePage = function (url, phoneNumber) {\r\n $.spinner().start();\r\n $.ajax({\r\n url: url,\r\n method: 'GET',\r\n data: { phoneNumber: phoneNumber },\r\n dataType: 'json',\r\n success: function (response) {\r\n $.spinner().stop();\r\n if (response && response.html) {\r\n // Replace the entire section element with the response HTML\r\n $('.js-distributive-page-section').replaceWith(response.html);\r\n }\r\n },\r\n error: function () {\r\n $.spinner().stop();\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Handles click events on the tariffs carousel and updates the distributive page accordingly.\r\n *\r\n * This function sets up an event listener for click events on elements with the class\r\n * 'js-swiper-slide-distributive-line'. When such an element is clicked, it checks if the\r\n * target of the event has the class 'js-distributive-line'. If so, it finds the first radio\r\n * input within the clicked element, retrieves the URL for setting the phone number from a\r\n * data attribute on the element with the class 'js-swiper-distributive', and calls\r\n * `functions.refreshDistributivePage` with the URL and the phone number from the radio input's\r\n * data attributes.\r\n *\r\n * @returns {void}\r\n */\r\nfunctions.handleTariffsCarouselClick = function () {\r\n $(document).on('click', '.js-swiper-slide-distributive-line', function (e) {\r\n if (!$(e.target).hasClass('js-distributive-line')) return;\r\n const radioInput = $(this).find('input[type=\"radio\"]').first();\r\n const url = $('.js-swiper-distributive').data('setphonenumber-url');\r\n functions.refreshDistributivePage(url, $(radioInput).data('phone-number'));\r\n });\r\n};\r\n\r\nfunctions.handleDatalyerOptionClick = function () {\r\n $(document).on('click', '.js-dp-datalayer', function (e) {\r\n const dataLayerHelper = require('core/dataLayer/dataLayer');\r\n let eventname = $(this).parent('hl-link-icon').data('event-name');\r\n dataLayerHelper.methods.buildDataLayerEventLink('areaCliente:tiendaOnline:distributiva', eventname, 'clickLink');\r\n });\r\n};\r\n\r\nmodule.exports = {\r\n functions: functions,\r\n init: function () {\r\n functions.handleLogoutClick();\r\n functions.handleRenoveCarouselClick();\r\n functions.handleRenoveShowChildhoodTariff();\r\n functions.handleModalLogoutShow();\r\n functions.handleTariffsCarouselClick();\r\n functions.handleDatalyerOptionClick();\r\n }\r\n};\r\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\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":""}