{"version":3,"file":"index.es.min.js","sources":["../../../packages/components/src/nespressoElement/nespressoElement.js","../../../packages/components/src/constants.mjs","../../../packages/helpers/src/catalog.js","../../../packages/helpers/src/getCurrency.js","../../../packages/components/src/sku/fragments/strikethroughPrice.js","../../../packages/helpers/src/utils.ts","../../../packages/components/src/sku-coffee/fragments/sleeve.js","../../../packages/helpers/src/viewport.helpers.ts","../../../packages/components/src/sku/constants.mjs","../../../packages/helpers/src/dataLayer.js","../../../packages/components/src/sku/fragments/addToCart.js","../../../packages/components/src/sku-coffee/services/index.js","../../../packages/helpers/src/colors.helpers.js","../../../packages/helpers/src/cupsizes.helpers.js","../../../packages/helpers/src/props.helpers.js","../../../packages/components/src/level/level.js","../../../packages/helpers/src/gtmEvents.js","../../../packages/components/src/sku-quick-view/sku-quick-view.js","../../../packages/components/src/sku-coffee/fragments/intensity.js","../../../packages/components/src/sku-machine/fragments/voltage.js","../../../packages/helpers/src/rating.service.js","../../../packages/components/src/sku-machine/fragments/ratings.js","../../../packages/components/src/sku/fragments/price.js","../../../packages/components/src/sku-coffee/fragments/priceCapsule.js"],"sourcesContent":["export class NespressoElement extends HTMLElement {\n constructor() {\n super()\n this.template = ''\n }\n\n connectedCallback() {\n this.props = this._createProps()\n this.onStart?.()\n this.loadTemplate()\n this.onReady?.()\n }\n\n /**\n * Load the attributes and create the props object\n * @returns {any}\n * @private\n */\n _createProps(forceAttributes = null) {\n const attributes = forceAttributes || this.attributes\n\n const getData = attr => attr.find(attribute => attribute.nodeName === 'data')\n\n let props\n try {\n props = [...attributes].reduce((all, attr) => {\n return { ...all, [attr.nodeName]: attr.nodeValue }\n }, {})\n\n const data = getData([...attributes])\n\n if (data === undefined || data === null) {\n return props\n }\n\n return { ...props, ...JSON.parse(data.nodeValue) }\n } catch (error) {\n console.log(this.nodeName, 'ERROR: No data', error)\n }\n }\n\n /**\n * Render by DOM diff\n */\n render(force = false) {\n if (force) {\n // todo review the performance of this\n this.innerHTML = ''\n }\n /**\n * Convert a template string into HTML DOM nodes\n * @param {String} str The template string\n * @return {Node} The template HTML\n */\n const _stringToHTML = str => {\n const parser = new DOMParser()\n const doc = parser.parseFromString(str, 'text/html')\n return doc.body\n }\n\n /**\n * Compare the template to the UI and make updates\n * @param {Node} template The template HTML\n * @param {Node} elem The UI HTML\n */\n const _diff = (template, elem) => {\n /**\n * Get the type for a node\n * @param {Node} node The node\n * @return {String} The type\n */\n const _getNodeType = node => {\n if (node.nodeType === 3) {\n return 'text'\n }\n if (node.nodeType === 8) {\n return 'comment'\n }\n return node.tagName.toLowerCase()\n }\n\n /**\n * Get the content from a node\n * @param {Node} node The node\n * @return {String} The type\n */\n const _getNodeContent = node => {\n if (node.childNodes && node.childNodes.length > 0) {\n return null\n }\n return node.textContent\n }\n\n // Get arrays of child nodes\n const domNodes = Array.prototype.slice.call(elem.childNodes)\n const templateNodes = Array.prototype.slice.call(template.childNodes)\n\n // If extra elements in DOM, remove them\n var count = domNodes.length - templateNodes.length\n if (count > 0) {\n for (; count > 0; count--) {\n domNodes[domNodes.length - count].parentNode.removeChild(\n domNodes[domNodes.length - count]\n )\n }\n }\n\n // Diff each item in the templateNodes\n templateNodes.forEach(function (node, index) {\n // If element doesn't exist, create it\n if (!domNodes[index]) {\n elem.appendChild(node.cloneNode(true))\n return\n }\n\n // If element is not the same type, replace it with new element\n if (_getNodeType(node) !== _getNodeType(domNodes[index])) {\n domNodes[index].parentNode.replaceChild(node.cloneNode(true), domNodes[index])\n return\n }\n\n // If content is different, update it\n const templateContent = _getNodeContent(node)\n if (templateContent && templateContent !== _getNodeContent(domNodes[index])) {\n domNodes[index].textContent = templateContent\n }\n\n // If target element should be empty, wipe it\n if (domNodes[index].childNodes.length > 0 && node.childNodes.length < 1) {\n domNodes[index].innerHTML = ''\n return\n }\n\n // If element is empty and shouldn't be, build it up\n // This uses a document fragment to minimize reflows\n if (domNodes[index].childNodes.length < 1 && node.childNodes.length > 0) {\n const fragment = document.createDocumentFragment()\n _diff(node, fragment)\n domNodes[index].appendChild(fragment)\n return\n }\n\n // If there are existing child elements that need to be modified, diff them\n if (node.childNodes.length > 0) {\n _diff(node, domNodes[index])\n }\n })\n }\n\n // todo - add support to reactivity\n // this.template(this.state)\n const templateHTML = _stringToHTML(this.template)\n _diff(templateHTML, this)\n }\n\n /**\n * Set the HTML to be used in the template\n * @param {String} html The HTML to use\n *\n * This function is overwritten by the extended class to set the HTML\n *\n */\n loadTemplate(template = '', force = false) {\n this.template = template === '' ? this.template : `${template}`\n this.render(force)\n }\n\n disconnectedCallback() {\n this.onDestroy?.()\n }\n}\n\ncustomElements.get('nb-nespresso-element') ||\n customElements.define('nb-nespresso-element', NespressoElement)\n","export const MAX_WIDTH_CONTAINER = 1160\n\nexport const BREAKPOINT_XL = 1920\nexport const BREAKPOINT_TABLET = 1024\nexport const BREAKPOINT_L = 996\nexport const BREAKPOINT_M = 768\nexport const BREAKPOINT_S = 750\nexport const BREAKPOINT_XS = 375\n\nexport const CTA_PRIMARY = 'primary'\nexport const CTA_PRIMARY_TRANSPARENT = 'primary_transparent'\nexport const CTA_SUBTLE = 'subtle'\nexport const CTA_LINK = 'link'\nexport const CTA_LINK_UNDERLINE = 'link-underline'\nexport const CTA_LINK_GOLD = 'link-gold'\nexport const CTA_LINK_ADD_TO_CART_SMALL = 'AddToCart_small'\nexport const CTA_LINK_ADD_TO_CART_LARGE = 'AddToCart_large'\n\nexport const EVENT_TAB_CHANGE = 'EVENT_TAB_CHANGE'\n\nexport const EVENT_VIDEO = 'WEB_COMPONENT_VIDEO'\nexport const EVENT_POPIN_OPEN = 'WEB_COMPONENT_POPIN_OPEN'\nexport const EVENT_POPIN_OPENED = 'WEB_COMPONENT_POPIN_OPENED'\nexport const EVENT_POPIN_CLOSE = 'WEB_COMPONENT_POPIN_CLOSE'\nexport const EVENT_POPIN_CLOSED = 'WEB_COMPONENT_POPIN_CLOSED'\nexport const EVENT_POPIN_CLOSE_CLICK = 'WEB_COMPONENT_POPIN_CLOSE_CLICK'\nexport const EVENT_POPIN_KEY_DOWN = 'keydown'\nexport const EVENT_POPIN_FORM_TOGGLE_TITLE = 'WEB_COMPONENT_POPIN_FORM_TOGGLE_TITLE'\nexport const EVENT_CTA_CLICK = 'WEB_COMPONENT_CTA_CLICK'\nexport const EVENT_HERO_REORDER_OPEN = 'WEB_COMPONENT_HERO_REORDER_OPEN'\nexport const EVENT_HERO_REORDER_CLOSE = 'WEB_COMPONENT_HERO_REORDER_CLOSE'\nexport const EVENT_QUICKVIEW_OPEN = 'WEB_COMPONENT_QUICKVIEW_OPEN'\nexport const EVENT_QS_OPEN = 'WEB_COMPONENT_QS_OPEN'\nexport const EVENT_QS_OPENED = 'WEB_COMPONENT_QS_OPENED'\nexport const EVENT_QS_CLOSE = 'WEB_COMPONENT_QS_CLOSE'\nexport const EVENT_QS_CLOSED = 'WEB_COMPONENT_QS_CLOSED'\nexport const EVENT_QS_CLOSE_CLICK = 'WEB_COMPONENT_QS_CLOSE_CLICK'\nexport const EVENT_QS_KEY_DOWN = 'keydown'\nexport const EVENT_ADD_TO_CART = 'WEB_COMPONENT_ADD_TO_CART'\nexport const EVENT_CART_UPDATED = 'WEB_COMPONENT_CART_UPDATED'\nexport const EVENT_VIDEO_TOGGLE = 'WEB_COMPONENT_VIDEO_TOGGLE'\nexport const VIDEO_ON_HOVER = 'VIDEO_ON_HOVER'\nexport const VIDEO_ON_OUT = 'VIDEO_ON_OUT'\nexport const EVENT_DETAIL_OPEN = 'WEB_COMPONENT_DETAIL_OPEN'\nexport const EVENT_SLIDER_READY = 'WEB_COMPONENT_SLIDER_READY'\nexport const EVENT_SLIDE_CHANGE = 'WEB_COMPONENT_SLIDE_CHANGE'\nexport const EVENT_OVERLAY_OPEN = 'WEB_COMPONENT_OVERLAY_OPEN'\nexport const EVENT_OVERLAY_CLOSE = 'WEB_COMPONENT_OVERLAY_CLOSE'\nexport const EVENT_OVERLAY_CLICKED = 'WEB_COMPONENT_OVERLAY_CLICKED'\nexport const EVENT_OPEN_PRODUCT_AR_CLICKED = 'OPEN_PRODUCT_AR_CLICKED'\nexport const EVENT_SORT_BY_CHANGE = 'WEB_COMPONENT_SORT_BY_CHANGE'\n\nexport const EVENT_BUBBLE_SELECTED = 'EVENT_BUBBLE_SELECTED'\nexport const EVENT_RECO_TOOL_OPTION_CLICKED = 'EVENT_RECO_TOOL_OPTION_CLICKED'\nexport const WEB_COMPONENT_PROJECTS_LOADED = 'WEB_COMPONENT_PROJECTS_LOADED'\nexport const WEB_COMPONENT_ANCHOR_LOADED = 'WEB_COMPONENT_ANCHOR_LOADED'\n\nexport const EVENT_SWIPED_UP = 'swiped-up'\nexport const EVENT_SWIPED_DOWN = 'swiped-down'\nexport const EVENT_SWIPED_LEFT = 'swiped-left'\nexport const EVENT_SWIPED_RIGHT = 'swiped-right'\n\nexport const EVENT_HEADER_POSITION_CHANGED = 'EVENT_HEADER_POSITION_CHANGED'\n\nexport const keys = { ESC: 'Escape' }\n\nexport const ADD_TO_CART_MODIFIER_MINI = 'mini'\nexport const ADD_TO_CART_MODIFIER_DEFAULT = ADD_TO_CART_MODIFIER_MINI\n\nexport const COFFEE_ORIGINAL = 'original'\nexport const COFFEE_VERTUO = 'vertuo'\nexport const COFFEE_PRO = 'pro'\nexport const COFFEE_OL = 'OL'\nexport const COFFEE_VL = 'VL'\nexport const INTENSITY_MAX_OL = 14\nexport const INTENSITY_MAX_VL = 12\nexport const DEFAULT_BUBBLE_ICON = ''\n\nexport const NUMBER_PRODUCTS_SLIDER = 8\nexport const NUMBER_FEATURES_PDP = 8\n\nexport const ALIGNMENT = ['center', 'left', 'right']\nexport const POSITION = ['top', 'right', 'bottom', 'left']\nexport const TRANSLATION_ADD_TO_CART = 'Add to cart'\nexport const TRANSLATION_UPDATE_BASKET = 'Update basket'\n\nexport const TIME_INSTANT = 1\nexport const TIME_FAST = 300\nexport const TIME_MEDIUM = 600\nexport const TIME_SLOW = 1200\n\nexport const APP_APPLE_LINK = {\n default: 'https://apps.apple.com/us/app/nespresso/id342879434',\n us: 'https://apps.apple.com/us/app/nespresso-new/id1609639566',\n uk: 'https://apps.apple.com/gb/app/nespresso-new/id1609639566'\n}\nexport const APP_ANDROID_LINK =\n 'https://play.google.com/store/apps/details?id=com.nespresso.activities'\nexport const APP_HUAWEI_LINK = 'https://appgallery.huawei.com/app/C102571517'\n\nexport const SRC_PAGE_PLP = 'plp'\nexport const SRC_PAGE_PDP = 'pdp'\n\nexport const PLP_TYPE_COFFEE = 'coffee'\nexport const PLP_TYPE_MACHINE = 'machine'\nexport const PLP_TYPE_ACCESSORY = 'accessory'\nexport const CALLEO_API_DOMAIN = 'https://www.contact.nespresso.com/'\n\n// SCSS RELATED\n// Todo : should be shared by JS and SCSS\nexport const BROWSER_CONTEXT = 16 // 1rem = 16px\nexport const COLOR_WHITE_1000 = '#FFFFFF' // Do not change for #FFF shortcut, it will break slider-natural gradients !\n\nexport const CONTRAST_DARK = 'dark'\nexport const CONTRAST_LIGHT = 'light'\n\nexport const B2B_CONTACT_FORM_POPIN_ID = 'b2b-contact-form-popin-id'\nexport const B2B_CONTACT_FORM_POPIN_SRC_SEARCH = 'coveo-search'\n\nexport const B2B_CONTACT_FORM_POPIN_SRC_SKU_MAIN_INFO = 'sku-main-info'\n\nexport const B2B_CONTACT_FORM_POPIN_SRC_SKU_MAIN_INFO_AUTO = 'sku-main-info-auto'\n\nexport const ASPECT_RATIO_16_9 = '16/9'\nexport const ASPECT_RATIO_1_1 = '1/1'\n\nexport const NESPRESSO_PRODUCTION_DOMAIN = 'https://www.nespresso.com'\nexport const NESPRESSO_ROLLOUT_DOMAIN = 'https://nc2-env-rollout.nespresso.com'\n\nexport const EVENT_QUIZ_ON_GO_BACK = 'WEB_COMPONENT_EVENT_QUIZ_ON_GO_BACK'\nexport const EVENT_QUIZ_SUBMIT = 'WEB_COMPONENT_EVENT_QUIZ_SUBMIT'\n","import { COFFEE_VERTUO } from '@kissui/components/src/constants.mjs'\nimport { getCurrency } from './getCurrency'\nexport { getCurrency } from './getCurrency'\n\nexport const ECAPI_TYPE_CAPSULE = 'capsule'\nexport const ECAPI_TYPE_MACHINE = 'machine'\nexport const ECAPI_TYPE_ACCESSORY = 'accessory'\nexport const ECAPI_TYPE_GIFT_CARD = 'giftcard'\n\nconst TECHNOLOGY_CATEGORY_IDENTIFIER = '/machineTechno/'\nconst SLEEVE_OF_10 = 10\nconst SLEEVE_OF_7 = 7\n\nconst trimSku = sku => sku.replace(/[^a-z0-9- +./]/gi, '')\n\nexport const getLegacySKU = productId => productId.split('prod/').pop()\n\nexport const getPriceFormatter = async () => await window.napi.priceFormat()\n\nexport const getProduct = sku => window.napi.catalog().getProduct(trimSku(sku))\n\nexport function getTechnologyName(productData) {\n const techno = productData.technologies[0]\n return techno.substring(\n techno.indexOf(TECHNOLOGY_CATEGORY_IDENTIFIER) + TECHNOLOGY_CATEGORY_IDENTIFIER.length\n )\n}\n\nfunction isMultipleOf(quantity, multiple) {\n return quantity % multiple === 0\n}\n\nexport function getSleeveNumber(product, getTechnologyNameFn = getTechnologyName) {\n if (product.sales_multiple !== 1 && isMultipleOf(product.sales_multiple, SLEEVE_OF_10)) {\n // Sleeve of original or vertuo\n return product.sales_multiple / SLEEVE_OF_10\n }\n\n if (\n product.sales_multiple !== 1 &&\n getTechnologyNameFn(product) === COFFEE_VERTUO &&\n isMultipleOf(product.sales_multiple, SLEEVE_OF_7)\n ) {\n // Sleeve of vertuo\n return product.sales_multiple / SLEEVE_OF_7\n }\n\n if (product.sales_multiple === 1 && isMultipleOf(product.unitQuantity, SLEEVE_OF_10)) {\n // Bundle of original or vertuo\n return product.unitQuantity / SLEEVE_OF_10\n }\n\n if (\n product.sales_multiple === 1 &&\n getTechnologyNameFn(product) === COFFEE_VERTUO &&\n isMultipleOf(product.unitQuantity, SLEEVE_OF_7)\n ) {\n // Bundle of vertuo\n return product.unitQuantity / SLEEVE_OF_7\n }\n\n return NaN\n}\n\n/**\n * Guess if the product is part of a bundle.\n * This is determined by checking the 'sales_multiple' and 'unitQuantity' properties.\n */\nexport function isBundled(productData) {\n // TODO: this function should not change the productData, but some components still need it\n productData.sales_multiple = productData.sales_multiple || productData.salesMultiple\n\n const isSalesMultipleGreaterThanOne = productData.sales_multiple > 1\n const isUnitQuantityEqualToOne = productData.unitQuantity === 1\n const isSalesMultipleEqualToOne = productData.sales_multiple === 1\n const isUnitQuantityGreaterThanOne = productData.unitQuantity > 1\n\n // The product is not bundled if sales_multiple > 1 and unitQuantity = 1\n if (isSalesMultipleGreaterThanOne && isUnitQuantityEqualToOne) {\n return false\n }\n\n // The product is bundled if sales_multiple = 1 and unitQuantity > 1\n return isSalesMultipleEqualToOne && isUnitQuantityGreaterThanOne\n}\n\n/**\n * Replace an array of SKU with product data\n * Remove the element inside the list if sku fail. It prevents to get an empty item.\n * @param {Array.<String>} skus\n * @param getProductFn\n * @returns {Promise<Awaited<unknown>[]>}\n */\nexport function getProductAndClean(skus, getProductFn = getProduct, napi = window.napi) {\n const promises = []\n\n if (!napi) {\n return Promise.reject()\n }\n\n if (!Array.isArray(skus)) {\n skus = [skus]\n }\n\n // Load manually the product to delete SKU fail\n for (const sku of skus) {\n promises.push(\n getProductFn(sku)\n .then(data => skus.splice(skus.indexOf(sku), 1, data))\n .catch(() => {\n skus.splice(skus.indexOf(sku), 1)\n console.error(`getProduct fail on sku ${sku}`)\n })\n )\n }\n\n return Promise.all(promises)\n}\n\nexport const getFormattedPrice = async price => {\n const priceFormatter = await getPriceFormatter()\n const currency = getCurrency()\n\n return priceFormatter.html\n ? priceFormatter.html(currency, price)\n : priceFormatter.short(currency, price) || ''\n}\n\nexport const getProductCategories = async sku => {\n const productDetails = await getProduct(sku)\n const productCategories = productDetails ? productDetails.supercategories : []\n const productCategoriesNew = await Promise.all(\n productCategories.map(async categoryEncoded => {\n const productCategoryData = await window.napi.catalog().getCategory(categoryEncoded)\n return productCategoryData\n })\n )\n return productCategoriesNew\n}\n","export const getCurrency = () => window[window.config.padl.namespace].dataLayer.app.app.currency\n","import { getFormattedPrice } from '@kissui/helpers/src/catalog'\n\nconst getStrikethroughPriceElement = component => {\n return component.querySelector('.cb-price-old')\n}\n\nconst fetchStrikethroughPrice = strikethroughPrice => {\n return getFormattedPrice(strikethroughPrice)\n}\n\nexport const renderStrikethroughPrice = ({ strikethrough_price }, component) => {\n if (!strikethrough_price) {\n return ''\n }\n\n fetchStrikethroughPrice(strikethrough_price)\n .then(payload => {\n const element = getStrikethroughPriceElement(component)\n if (!element) {\n return\n }\n\n element.innerHTML = payload\n })\n .catch(e => {\n console.error(`Error: Component SKU - Strike Through Price - ${e}`)\n\n const element = getStrikethroughPriceElement(component)\n if (!element) {\n return\n }\n\n element.style.display = 'none'\n })\n\n return `<p class=\"cb-price-old t-sm-400-sl\"></p>`\n}\n","export { waitForSelector } from './waitForSelector'\n\nexport const constants = {\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n ESC: 27,\n SPACE: 32,\n ENTER: 13,\n TAB: 9\n}\n\nexport function capitalize(s = '') {\n return s[0].toUpperCase() + s.slice(1)\n}\n\nexport const convertToCamelCase = (str: string): string => {\n const arr = str.match(/[a-z]+|\\d+/gi)\n if (!arr) { return str }\n return arr.map((m, i) => {\n let low = m.toLowerCase()\n if (i !== 0) {\n low = low.split('').map((s, k) => (k === 0 ? s.toUpperCase() : s)).join(\"\")\n }\n return low\n }).join(\"\")\n}\n\nexport function slug(s = '') {\n return s\n .toLowerCase()\n .trim()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .replace(/[^\\w-]+/g, '') // Remove all non-word chars\n .replace(/--+/g, '-') // Replace multiple - with single -\n}\n\nexport function pxToEm(target: number, stripedInnerFontSize = 1) {\n return target / 14 / stripedInnerFontSize + 'em'\n}\n\nexport function percent(target: number) {\n return target + '%'\n}\n\nexport function parseHTML(str: string) {\n const tmp = document.implementation.createHTMLDocument('')\n tmp.body.innerHTML = str\n return tmp.body.childNodes\n}\n\nexport function stripHTML(str: string) {\n const tmp = document.implementation.createHTMLDocument('')\n tmp.body.innerHTML = str\n return (tmp.body.textContent ?? \"\").replace(RegExp('[\\\\s|\\'|\"]', 'g'), '')\n}\n\nexport function makeId(length: number) {\n var result = ''\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n var charactersLength = characters.length\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength))\n }\n return result\n}\n\nexport function removeEmptyValues(obj: { [key: string]: any }): { [key: string]: any } {\n for (let key in obj) {\n if (obj[key] === null || obj[key] === undefined || obj[key] === '') {\n delete obj[key]\n }\n }\n\n return obj\n}\n\nexport function makeHash(str: string) {\n var hash = 0,\n i,\n chr\n if (!str) {\n return hash\n }\n for (i = 0; i < str.length; i++) {\n chr = str.charCodeAt(i)\n hash = (hash << 5) - hash + chr\n hash |= 0 // Convert to 32bit integer\n }\n return 'id-' + hash\n}\n\nexport function getHashLink(link: string) {\n let linkHash = link\n let linkNoHash = link\n if (link.indexOf('#') !== -1) {\n linkNoHash = link.replace('#', '')\n } else {\n linkHash = '#' + link\n }\n\n return { linkNoHash, linkHash }\n}\n\nexport function lazyLoad(node: Element, attribute: string, value: any, url: string) {\n const CLASSNAME_OUT_OF_SCREEN = 'lazy-load'\n const CLASSNAME_IN_SCREEN = 'lazy-loaded'\n const CLASSNAME_ON_ERROR = 'lazy-loaded-error'\n\n const isOldIOS = () => {\n var agent = window.navigator.userAgent,\n start = agent.indexOf('OS ')\n if ((agent.indexOf('iPhone') > -1 || agent.indexOf('iPad') > -1) && start > -1) {\n return window.Number(agent.substr(start + 3, 3).replace('_', '.')) < 14\n }\n return false\n }\n\n const inViewPort = (attribute: string, value: any) => {\n node.setAttribute(attribute, value)\n\n const cb = () => node.classList.add(CLASSNAME_IN_SCREEN)\n\n if (url) {\n const img = new Image()\n img.src = url\n img.onload = cb\n img.onerror = () => {\n cb()\n node.classList.add(CLASSNAME_ON_ERROR)\n throw new Error(`Image ${url} cannot be loaded`)\n }\n\n return\n }\n\n cb()\n }\n\n if (/Trident\\/|MSIE/.test(window.navigator.userAgent) || isOldIOS()) {\n inViewPort(attribute, value)\n } else {\n if ('IntersectionObserver' in window) {\n node.classList.add(CLASSNAME_OUT_OF_SCREEN)\n let lazyBackgroundObserver = new IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n if (entry.isIntersecting) {\n inViewPort(attribute, value)\n lazyBackgroundObserver.unobserve(entry.target)\n }\n })\n })\n lazyBackgroundObserver.observe(node)\n } else {\n inViewPort(attribute, value)\n }\n }\n}\n\nexport function lazyLoadCallback(node: Element, cb: () => void) {\n const isOldIOS = () => {\n var agent = window.navigator.userAgent,\n start = agent.indexOf('OS ')\n if ((agent.indexOf('iPhone') > -1 || agent.indexOf('iPad') > -1) && start > -1) {\n return window.Number(agent.substr(start + 3, 3).replace('_', '.')) < 14\n }\n return false\n }\n\n if (/Trident\\/|MSIE/.test(window.navigator.userAgent) || isOldIOS()) {\n cb()\n } else {\n if ('IntersectionObserver' in window) {\n let lazyBackgroundObserver = new IntersectionObserver(\n function (entries) {\n entries.forEach(function (entry) {\n if (entry.isIntersecting) {\n cb()\n lazyBackgroundObserver.unobserve(entry.target)\n }\n })\n },\n { rootMargin: '150% 0px' }\n )\n lazyBackgroundObserver.observe(node)\n }\n }\n}\n\n// Debounce\nexport function debounce<T>(func: (v: T) => void, time = 100) {\n let timer: number\n return function (event: T) {\n if (timer) {\n window.clearTimeout(timer)\n }\n timer = window.setTimeout(func, time, event)\n }\n}\n\n// isIE - to check for internet explorer\nexport function isIE() {\n let ua = window.navigator.userAgent,\n isIE = /MSIE|Trident/.test(ua)\n\n return isIE\n}\n\n// Load external script\nexport const loadExternalScript = ({\n src,\n callback = null,\n async = false,\n defer = false,\n module = false,\n id = ''\n}: {\n src: string;\n callback: null | GlobalEventHandlers[\"onload\"]\n module: boolean,\n defer: boolean,\n async: boolean,\n id: string\n}) => {\n const script = document.createElement('script')\n script.type = module ? 'module' : 'text/javascript'\n script.src = src\n id ? (script.id = id) : false // add id attribute only if passed\n if (typeof callback === 'function') {\n script.onload = callback\n }\n script.async = async\n script.defer = defer\n document.body.appendChild(script)\n}\n\n// Load external css\nexport const loadExternalCss = ({ src }: { src: string }) => {\n const script = document.createElement('link')\n script.rel = 'stylesheet'\n script.href = src\n document.body.appendChild(script)\n}\n// Lazy load vendor script\nexport const lazyLoadVendorScript = (handler, el) => {\n const observer = new IntersectionObserver(handler)\n observer.observe(el)\n}\n\n/**\n * Replaces variable inside a given string\n * Each variable have to be enclosed between stChr and enChr\n * The values have to be contained in the vars object, they key must match\n * example :\n * txt : 'See {resultsLength} Results'\n * vars : {resultsLength:'30'}\n * stChr : '{'\n * enChr : '}'\n *\n * will return : 'See 30 Results'\n *\n * @param {string} txt\n * @param {object} vars\n * @param {string} stChr\n * @param {string} enChr\n */\nexport function interpolate(txt: string, vars: Record<string, null | undefined | string>, stChr: string, enChr: string) {\n let curIdx = 0\n\n while (txt) {\n const stIdx = txt.indexOf(stChr, curIdx)\n if (stIdx === -1) {\n break\n }\n const enIdx = txt.indexOf(enChr, stIdx + 1)\n if (enIdx === -1) {\n break\n }\n const hashId = txt.substring(stIdx + stChr.length, enIdx)\n if (vars[hashId] != null) {\n txt = txt.substr(0, stIdx) + vars[hashId] + txt.substr(enIdx + enChr.length)\n curIdx = stIdx\n } else {\n curIdx = enIdx\n }\n }\n return txt\n}\n\n/**\n * Find in container element, add height to equal size of element\n * @param container css path where my element is contain e.g. `.c-container`\n * @param el css path of elements to equalized\n */\nexport const equalHeight = (containerSelector: string, el: string, elementScope: HTMLElement) => {\n const container = elementScope.querySelector<HTMLElement>(containerSelector)\n if (!container) {\n return\n }\n\n const items = container.querySelectorAll<HTMLElement>(el)\n let max = -1\n\n for (let i = 0; i < [...items].length; i++) {\n const item = [...items][i]\n let h = item.offsetHeight\n max = h > max ? h : max\n }\n\n if (max <= 0) {\n return\n }\n\n for (let i = 0; i < [...items].length; i++) {\n const item = [...items][i]\n item.style.height = `${max}px`\n }\n}\n\nexport const stringifyCurlyQuote = (data: {}) => JSON.stringify(data).replace(\"'\", '’')\n\nexport const stringifyForAttribute = (data = {}) => {\n return escapeHtml(JSON.stringify(data))\n}\n\n/**\n * This function is included instead of sanitizeString because for\n * inserting HTML into innerHTML we need to make sure all HTML\n * entities are escaped.\n */\nexport const escapeHtml = (text: string) => {\n const map = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n } as { [s: string]: string }\n\n return text.replace(/[&<>\"']/g, (m) => map[m])\n}\n\n/**\n * Because setting attributes escapes more than the characters above and then preact also\n * escapes text we need a more complete way of unescaping all html entities (not just the ones\n * above)\n */\nconst domParser = new DOMParser()\nexport const unescapeHtml = (text: string) => {\n return domParser.parseFromString(text, \"text/html\").body.textContent\n}\n\nexport const sanitizeString = (data: {}) => {\n if (!data) {\n return ''\n }\n\n return data.toString().replace(/\"/g, '"').replace(/'/g, ''')\n}\n\nexport const stripTags = (s: string) => {\n return (s || '').replace(/(<([^>]+)>)/gi, '')\n}\n\nexport const setAttributes = (element: Element, attrs: Record<string, any>) => {\n for (let key in attrs) {\n element.setAttribute(key, attrs[key])\n }\n return element\n}\n\nexport const getMetaContent = (metaName: string) => {\n const metaTag = document.querySelector(`meta[name=${metaName}]`)\n if (!metaTag) {\n return ''\n }\n return metaTag.getAttribute('content')\n}\n\nexport const isObjectEmpty = (obj: {}) => {\n return Object.keys(obj).length === 0\n}\n","import { interpolate } from '@kissui/helpers/src/utils'\nimport { getSleeveNumber } from '@kissui/helpers/src/catalog'\n\nconst getSleeveLabel = props => {\n const { number_of_sleeves, label_sleeves, label_sleeve } = props\n const sleeveNumber = number_of_sleeves || getSleeveNumber(props)\n return sleeveNumber > 1 && label_sleeves ? label_sleeves : label_sleeve\n}\n\nconst getQuantity = ({ bundled, sales_multiple, unit_quantity, unitQuantity }) =>\n bundled === false ? sales_multiple : unit_quantity || unitQuantity || 0\n\nexport const renderShowSleeve = props => {\n const { show_sleeve = false } = props\n\n if (!show_sleeve) {\n return ''\n }\n\n const { label_capsules, sleeve_syntax } = props\n const label = getSleeveLabel(props)\n const quantity = props.number_of_capsules ? props.number_of_capsules : getQuantity(props)\n const sleeveNumber = props.number_of_sleeves ? props.number_of_sleeves : getSleeveNumber(props)\n\n if (!quantity || !sleeveNumber) {\n return ''\n }\n\n const showSleeve = interpolate(\n sleeve_syntax,\n {\n numberOfSleeves: sleeveNumber,\n sleeveLabel: label,\n quantity,\n label_capsules,\n sleevePrice: props.hasPricePerSleeve ? props.sleevePrice : '',\n perSleeveLabel: props.hasPricePerSleeve ? props.perSleeveLabel : ''\n },\n '{',\n '}'\n )\n\n if (!showSleeve) {\n return ''\n }\n\n return `<p class=\"cb-price-items cb-show-sleeve t-xs-500-sl\">${showSleeve}</p>`\n}\n","import { BREAKPOINT_M, BREAKPOINT_TABLET } from '@kissui/components'\n\nconst viewport = () => {\n const lt = (ref: number) => {\n return window.innerWidth < ref\n }\n\n return {\n get is() {\n const { innerWidth: vw, devicePixelRatio } = window\n return {\n mobile: vw < BREAKPOINT_M,\n mobile_tablet: vw < BREAKPOINT_TABLET,\n tablet: vw >= BREAKPOINT_M && vw < BREAKPOINT_TABLET,\n desktop: vw >= BREAKPOINT_TABLET && devicePixelRatio <= 1,\n retina: vw >= BREAKPOINT_TABLET && devicePixelRatio > 1\n }\n },\n lt\n }\n}\n\nconst helper = viewport()\n\nexport default helper\n","export const VARIATION_PLP = 'plp'\nexport const VARIATION_PDP = 'pdp'\nexport const VARIATION_CROSS_SELL = 'cross-sell'\nexport const VARIATION_SMALL = 'small'\n","export const getDataLayer = () => {\n return window[window?.padlNamespace]?.dataLayer\n}\n\nexport const getMarketCode = () => {\n const dataLayer = getDataLayer()\n if (!dataLayer) {\n return 'ch'\n }\n\n return dataLayer.app.app.market.toLocaleLowerCase()\n}\n\nexport const getLangCode = () => {\n const dataLayer = getDataLayer()\n if (!dataLayer) {\n return 'en'\n }\n\n return getDataLayer().page.page.pageInfo.language.toLocaleLowerCase()\n}\n\nexport const getSegmentCode = () => {\n const dataLayer = getDataLayer()\n if (!dataLayer) {\n return 'B2C'\n }\n\n return getDataLayer().page.page.pageInfo.segmentBusiness\n}\n\nexport const isLoggedIn = () => {\n const dataLayer = getDataLayer()\n if (!dataLayer || !dataLayer.user) {\n return false\n }\n\n return dataLayer.user.isLoggedIn\n}\n\nexport const interpolateMarketLang = (string, market, lang) => {\n return string.replace('{market}', market).replace('{lang}', lang)\n}\n","import viewportHelper from '@kissui/helpers/src/viewport.helpers'\nimport {\n VARIATION_PLP,\n VARIATION_SMALL,\n VARIATION_CROSS_SELL,\n VARIATION_PDP\n} from '@kissui/components/src/sku/constants'\nimport { isLoggedIn } from '@kissui/helpers/src/dataLayer'\n\nconst getButtonSize = variation => {\n switch (variation) {\n case VARIATION_PLP:\n return viewportHelper.is.mobile ? 'small' : 'large'\n case VARIATION_SMALL:\n return 'small'\n default:\n return 'large'\n }\n}\n\nfunction getComputedProps(activeSku, activeLongSku, sku, longSku, disableTracking) {\n const skuProp = activeSku || sku\n const activeLongSkuProp = activeLongSku || longSku\n const disableTrackingProp = disableTracking && `disableTracking=true`\n\n return { skuProp, activeLongSkuProp, disableTrackingProp }\n}\n\nexport const renderAddToCart = props => {\n const {\n activeLongSku,\n activeSku,\n category_name = '',\n contact_cta = {},\n hidePrice,\n longSku = '',\n position,\n rendererName = '',\n show_view_details = false,\n sku,\n url,\n variation = VARIATION_PLP,\n view_details_label = 'View details',\n technologies = [],\n disableTracking = false\n } = props\n\n const buttonSize = getButtonSize(variation)\n let cta_url = url,\n cta_label = view_details_label,\n contact_cta_text = contact_cta.contact_cta_text || '',\n contact_url_anchor = contact_cta.contact_url_anchor || '',\n is_b2b = checkForB2B(technologies)\n\n // CONTACT US BUTTON\n const { skuProp, activeLongSkuProp, disableTrackingProp } = getComputedProps(\n activeSku,\n activeLongSku,\n sku,\n longSku,\n disableTracking\n )\n\n function b2bNotLoggedIn(contact_url_anchor, cta_url, cta_label) {\n //CONTACT US BUTTON[ hidePrice = true]\n const linkAttribute = contact_url_anchor ? `link=\"${cta_url}\"` : ''\n\n return `<nb-cta ${linkAttribute} variation=\"primary\" data-disabletracking=\"true\">${cta_label}</nb-cta>`\n }\n\n function b2bLoggedIn({\n skuProp,\n activeLongSkuProp,\n buttonSize,\n category_name,\n position,\n rendererName,\n variation,\n disableTrackingProp\n }) {\n return `\n <nb-add-to-cart\n sku=\"${skuProp}\"\n longSku=\"${activeLongSkuProp}\"\n buttonSize=\"${buttonSize}\"\n showPrice\n range='${category_name}'\n position='${position}'\n rendererName='${rendererName}'\n tracking_no_impression=\"${variation === VARIATION_PDP}\"\n ${disableTrackingProp}\n >\n </nb-add-to-cart>\n `\n }\n\n function remainingCases(cta_url, cta_label) {\n //VIEW DETAILS BUTTON [ hidePrice = false]\n return `<nb-cta link=\"${cta_url}\" variation=\"primary\">${cta_label}</nb-cta>`\n }\n\n if (hidePrice || show_view_details) {\n if (\n is_b2b &&\n (variation === VARIATION_PDP || variation === VARIATION_CROSS_SELL) &&\n !isLoggedIn()\n ) {\n cta_url = contact_url_anchor\n cta_label = contact_cta_text\n\n return b2bNotLoggedIn(contact_url_anchor, cta_url, cta_label)\n } else if (is_b2b && variation === VARIATION_PDP && isLoggedIn()) {\n return b2bLoggedIn({\n skuProp,\n activeLongSkuProp,\n buttonSize,\n category_name,\n position,\n rendererName,\n variation,\n disableTrackingProp\n })\n }\n\n return remainingCases(cta_url, cta_label)\n }\n\n // ADD TO CART BUTTON\n return `\n <nb-add-to-cart\n sku=\"${skuProp}\"\n longSku=\"${activeLongSkuProp}\"\n buttonSize=\"${buttonSize}\"\n showPrice\n range='${category_name}'\n position='${position}'\n rendererName='${rendererName}'\n tracking_no_impression=\"${variation === VARIATION_PDP}\"\n ${disableTrackingProp}\n ></nb-add-to-cart>\n `\n}\n\nfunction checkForB2B(technologies) {\n return Array.isArray(technologies) && technologies.some(tech => tech.includes('pro'))\n}\n","import { INTENSITY_MAX_OL, INTENSITY_MAX_VL } from '@kissui/components'\n\nexport const getMaxIntensity = ({ technologies }) =>\n technologies.indexOf('original') !== -1 ? INTENSITY_MAX_OL : INTENSITY_MAX_VL\n","import viewportHelper from '@kissui/helpers/src/viewport.helpers'\nimport { stringifyForAttribute } from '@kissui/helpers/src/utils'\n\nconst DISPLAY_COLOR_MAX = 4\n\nexport const renderColors = props => {\n if (!props) {\n return ''\n }\n\n const {\n colors,\n sku,\n max_colors = DISPLAY_COLOR_MAX,\n a11y_extra_color = '',\n url,\n activeSku,\n name\n } = props\n\n if (!colors) {\n return ''\n }\n\n const colorData = stringifyForAttribute({\n colors,\n max_colors,\n activeSku: activeSku || sku,\n extra_url: url,\n extra_title: name + ', ' + a11y_extra_color\n })\n\n const size = viewportHelper.is.mobile ? 'small' : 'large'\n\n return `<nb-colors data=\"${colorData}\" size=\"${size}\"></nb-colors>`\n}\n","const volumes = {\n carafe: { ml: 535, oz: 18.09 },\n 'carafe-vertuo': { ml: 535, oz: 18.09 },\n alto: { ml: 335, oz: 11.33 },\n mug: { ml: 230, oz: 7.77 },\n gran_lungo: { ml: 150, oz: 5.07 },\n lungo: { ml: 110, oz: 3.7 },\n double_espresso: { ml: 80, oz: 2.7 },\n 'double-espresso-vertuo': { ml: 80, oz: 2.7 },\n espresso: { ml: 40, oz: 1.35 },\n 'espresso-vertuo': { ml: 40, oz: 1.35 },\n ristretto: { ml: 25, oz: 0.84 }\n}\n\nexport const getCupSize = (size, isOz) => {\n const unit = isOz ? 'oz' : 'ml'\n const volume = volumes[size]\n\n if (!volume) {\n return ''\n }\n\n return `${volume[unit]} ${unit}`\n}\n","const getData = attributes => attributes.find(attribute => attribute.nodeName === 'data')\n\nconst createProps = attributes => {\n const data = getData([...attributes])\n const props = [...attributes]\n .filter(attribute => attribute.nodeName !== 'data')\n .reduce((all, attr) => {\n return { ...all, [attr.nodeName]: attr.nodeValue }\n }, {})\n\n if (isNil(data)) {\n return props\n }\n\n try {\n return { ...props, ...JSON.parse(data.nodeValue) }\n } catch (error) {\n console.log('ERROR: No data', error, data?.nodeValue)\n }\n}\n\nconst isNil = obj => obj === undefined || obj === null\n\nexport const parseBool = value => (!value || value === 'false' ? false : true)\n\nexport default createProps\n","import createProps from '@kissui/helpers/src/props.helpers'\n\nclass Level extends HTMLElement {\n connectedCallback() {\n this.props = createProps(this.attributes)\n this.render()\n }\n\n render() {\n const { value, a11y_level_of = 'of', max = '5' } = this.props\n\n this.innerHTML = `\n <p class=\"sr-only\">${value} ${a11y_level_of} ${max}</p>\n <div>${this.renderLevels(value, max)}</div>\n `\n }\n\n renderLevels(value, max) {\n let l = ''\n for (let i = 1; i <= max; i++) {\n l = l + this.renderLevel(i, value)\n }\n return l\n }\n\n renderLevel(i, value) {\n return `<span class=\"${i <= value ? 'selected' : ''}\"></span>`\n }\n}\n\ncustomElements.get('nb-level') || customElements.define('nb-level', Level)\nexport default Level\n","import { getProduct } from '@kissui/helpers/src/catalog'\nimport { emitCustomEvent } from './events.helpers'\nimport { removeEmptyValues } from '@kissui/helpers/src/utils'\n\nconst raisedByPB = 'page builder'\nconst raisedByWC = 'Web component'\n\n/**\n * helper method for 'itemDisplay' GTM event\n * @param {*} event : 'itemDisplay' - Mandatory as is\n * @param {*} eventRaisedBy : 'Web component' - Mandatory as is\n * @param {*} eventAction : 'Click' - Action that led to the item display. For example, click\n * @param {*} itemTypes : ['products'] - Mandatory as is\n * @param {*} rootElement : ['nb-slider'] - Root DOM element for item detection. Closest common ancestor element of the inserted/displayed promotions and products. It will help the detection to reduce its performance consumption. Set to 0 (zero) in order to request detection through the entire document.\n */\nexport const itemDisplay = args => {\n window.gtmDataObject = window.gtmDataObject || []\n const eventData = {\n event: 'itemDisplay',\n eventRaisedBy: raisedByWC,\n eventAction: 'Click',\n itemTypes: ['products'],\n ...args\n }\n window.gtmDataObject.push(eventData)\n emitCustomEvent('itemDisplay', eventData)\n}\n\n/**\n *\n * helper method for 'customEvent' GTM event\n * @param {*} args (event, eventRaisedBy, eventCategory, eventAction, eventLabel, nonInteraction)\n */\n\nexport const customEvent = args => {\n window.gtmDataObject = window.gtmDataObject || []\n var eventData\n if (args.event_GA4 === undefined || args.event_GA4 === false) {\n eventData = {\n event: 'customEvent',\n eventRaisedBy: raisedByWC,\n eventCategory: 'User Engagement',\n eventAction: 'Click',\n eventLabel: '',\n nonInteraction: 0,\n ...args\n }\n } else {\n eventData = {\n event_raised_by: raisedByPB,\n ...args\n }\n }\n window.gtmDataObject.push(eventData)\n emitCustomEvent('customEvent', eventData)\n}\n\n/**\n * Helper method for tracking component interactions, compatible with GA4.\n *\n * @param {String} creative : component raising the event, e.g. 'before_coffees_list', 'before_machines_list', 'before_accessories_list'\n * @param {String} actionType : description of the interaction, e.g 'pdp quick view'\n * @param {String} internationalId : long SKU, e.g. 'erp.pt.b2c/prod/7243.30'\n * @param {String} internationalName : international name of the product, e.g. 'Vertuo Carafe Pour-Over Style Mild'\n * @param {String} productType : type of product, i.e. 'capsule', 'machine', 'accessory'\n * @param {String} range : product range, e.g. 'ispirazione italiana'\n * @param {String} technology : technology, i.e. 'original', 'vertuo'\n * @param {Number} price : price, e.g. .51\n * @param {String} eventAction : description of the action, e.g. 'PDP Quick View'\n *\n * Initally created for PDP Quick View tracking:\n * https://dsu-confluence.nestle.biz/display/DIANA/BEFORE+-+PDP+Quick+View\n * Will probably be rolled out across all components, update this comment accordingly.\n */\nexport const trackComponentInteraction = ({\n creative = '',\n actionType = '',\n internationalId = '',\n internationalName = '',\n productType = '',\n technology = '',\n category = '',\n rawPrice = '',\n eventAction = ''\n}) => {\n window.gtmDataObject = window.gtmDataObject || []\n const eventData = {\n event: 'page_builder_component_interaction',\n event_raised_by: raisedByPB,\n component_name: creative,\n action_type: actionType,\n item_id_event: internationalId,\n item_name_event: internationalName,\n item_category_event: productType,\n item_technology_event: technology,\n item_range_event: category,\n item_price_event: rawPrice,\n eventCategory: 'User Engagement',\n eventAction: eventAction,\n eventLabel: `${productType} - ${technology} - ${internationalName}`\n }\n window.gtmDataObject.push(eventData)\n emitCustomEvent('page_builder_component_interaction', eventData)\n}\n\n/**\n *\n * Push 'view_promotion' event for GA 4\n * @param {*} args (event, event_raised_by, ecommerce: {promotion_id, promotion_name, creative_slot, creative_name})\n */\nexport const viewPromotion = args => {\n const event = 'view_promotion'\n const eventData = {\n event,\n event_raised_by: raisedByPB,\n ecommerce: {}\n }\n if (Object.keys(args).length) {\n const { id = '', creative = '', name = '', position = '' } = args\n eventData.ecommerce = {\n promotion_id: id,\n promotion_name: name,\n creative_slot: position,\n creative_name: creative\n }\n }\n window.gtmDataObject ??= []\n window.gtmDataObject.push(eventData)\n emitCustomEvent(event, eventData)\n}\n\nexport const handlePromoClick = args => {\n const { campaign, cta_name } = args\n\n const cleanedData = removeEmptyValues(campaign)\n selectPromotion({ cta_name, ...cleanedData })\n}\n\n/**\n *\n * Push 'select_promotion' event for GA 4\n * @param {*} args (event, event_raised_by, cta_name, ecommerce: {promotion_id, promotion_name, creative_slot, creative_name})\n */\nexport const selectPromotion = args => {\n const event = 'select_promotion'\n const eventData = {\n event: 'select_promotion',\n cta_name: args?.cta_name ?? '(not set)',\n event_raised_by: raisedByPB,\n ecommerce: {}\n }\n if (Object.keys(args).length) {\n const { id = '', creative = '', name = '', position = '' } = args\n eventData.ecommerce = {\n promotion_id: id,\n promotion_name: name,\n creative_slot: position,\n creative_name: creative\n }\n\n removeEmptyValues(eventData.ecommerce)\n }\n\n window.gtmDataObject ??= []\n window.gtmDataObject.push(eventData)\n emitCustomEvent(event, eventData)\n}\n\nexport const interactionClick = (nameComponent, ctaName) => {\n window.gtmDataObject = window.gtmDataObject || []\n const eventData = {\n event: 'page_builder_component_interaction',\n event_raised_by: raisedByPB,\n eventCategory: 'User Engagement',\n eventAction: 'Click CTA',\n eventLabel: `Page Builder - ${nameComponent} - ${ctaName}`,\n component_name: nameComponent,\n action_type: 'web component click',\n cta_name: ctaName\n }\n window.gtmDataObject.push(eventData)\n emitCustomEvent('page_builder_component_interaction', eventData)\n}\n\nexport const getProductInfo = async (sku, data) => {\n let product = data\n if (!product) {\n product = await getProduct(sku)\n }\n return product\n}\n\nexport const getProductPayload = (data, actionField = {}) => {\n const {\n internationalName,\n internationalId,\n category,\n unitPrice,\n legacyId,\n name,\n technologies,\n bundled,\n inStock,\n type\n } = data\n\n const technology = technologies.map(item => item.split('/').pop()).join('|')\n const isDiscovery = category.toLowerCase().includes('discovery')\n\n return [\n // Array consists of one product details for PDP Product Detail View\n {\n ...actionField,\n name: internationalName, // '[[International Product Name]]' NIE, Contract\n id: internationalId, // '[[International Product ID]]'\n price: unitPrice, // '[[Product Price]'\n // dimension43: '[[true/false]]', // '[[true/false]]' // Signifies if this product is part of a standing order or not\n dimension44: isDiscovery.toString(), // '[[true/false]]', // Signifies if this product is part of a discovery offer\n dimension53: legacyId, // '[[Product Local market ID]]', // Local market id for product\n dimension54: name, // '[[Product Local market Name]]', // Local market name for product\n dimension55: category, // '[[Product Range]]', // Range of the product, eg: Barista Creations for Ice (Nessoft Category)\n dimension56: technology, // '[[Product Technology]]', //Product technology according to Nespresso categorization (original, vertuo, pro)\n dimension57: bundled ? 'bundle' : 'single', // '[[Product Type]]', //If the product is single or bundle\n dimension192: inStock ? 'in stock' : 'out of stock', // '[in stock]', // \"in stock\" or \"out of stock\"\n category: type, // '[[Product Category]]', //Product category according to Nespresso categorization (Nessoft type): capsule, accessory, machine\n brand: 'Nespresso' // Static value set to Nespresso\n }\n ]\n}\n\nexport const trackDetailView = async (sku, data) => {\n // https://dsu-confluence.nestle.biz/display/DIANA/HQ+PB+Tracking+-+Product+Detail+View\n if (window.pbTrackDetailViewPDP || !sku || !window.napi) {\n return\n }\n\n const productInfo = await getProductInfo(sku, data)\n const productPayload = getProductPayload(productInfo)\n const currency = productInfo.currency\n\n window.gtmDataObject = window.gtmDataObject || []\n const eventData = {\n event: 'detailView',\n currencyCode: currency,\n eventRaisedBy: raisedByPB,\n ecommerce: {\n detail: {\n actionField: {},\n products: productPayload\n }\n }\n }\n window.gtmDataObject.push(eventData)\n // Track only once per page\n window.pbTrackDetailViewPDP = true\n emitCustomEvent('detailView', eventData)\n}\n\nexport const trackAddToCartImpression = (product, isStickyBar) => {\n // https://dsu-confluence.nestle.biz/pages/viewpage.action?spaceKey=DIANA&title=PDP+-+Sticky+Add+To+Cart+Custom+Event\n\n window.gtmDataObject = window.gtmDataObject || []\n const eventData = {\n event: 'page_builder_component_interaction',\n event_raised_by: raisedByPB,\n component_name: 'before_sku_main_info',\n action_type: isStickyBar\n ? 'sticky add to cart impression'\n : 'standard add to cart impression',\n //product info\n item_id_event: product.internationalId,\n item_name_event: product.internationalName,\n item_category_event: product.type,\n item_price_event: product.price_per_capsule?.split(' ')[0],\n item_market_id_event: product.legacyId,\n item_market_name_event: product.name,\n item_range_event: product.category_name,\n item_technology_event: product.technology?.[0]?.split('/').slice(-1) ?? '',\n item_type_event: product.bundled ? 'bundle' : 'single'\n }\n window.gtmDataObject.push(eventData)\n emitCustomEvent('page_builder_component_interaction', eventData)\n}\n\nexport const productImpression = async (position, list, sku, data) => {\n // https://dsu-confluence.nestle.biz/pages/viewpage.action?pageId=225612781\n // don't track already tracked products\n window.gtmDataObject = window.gtmDataObject || []\n const hasDetailView = window.gtmDataObject.find(item => item.event === 'detailView')\n const alreadyTracked = !!hasDetailView?.ecommerce?.detail?.products.find(p =>\n sku.includes(p.id)\n )\n if (alreadyTracked) {\n return\n }\n\n const productInfo = await getProductInfo(sku, data)\n const productPayload = getProductPayload(productInfo, { list: list, position: position })\n const currency = productInfo.currency\n const eventData = {\n event: 'impression',\n eventAction: 'Product Impression',\n currencyCode: currency,\n eventRaisedBy: raisedByPB,\n ecommerce: {\n impressions: productPayload\n }\n }\n window.gtmDataObject.push(eventData)\n emitCustomEvent('impression', eventData)\n}\n\nexport const productClick = async (position, list, sku, data) => {\n // https://dsu-confluence.nestle.biz/pages/viewpage.action?pageId=225612781\n\n if (typeof list !== 'string') return\n\n const productInfo = await getProductInfo(sku, data)\n const productPayload = getProductPayload(productInfo, { position: position })\n const currency = productInfo.currency\n\n window.gtmDataObject = window.gtmDataObject || []\n const eventData = {\n event: 'productClick',\n eventAction: 'Product Click',\n currencyCode: currency,\n eventRaisedBy: raisedByPB,\n ecommerce: {\n click: {\n actionField: {\n list: list\n },\n products: productPayload\n }\n }\n }\n window.gtmDataObject.push(eventData)\n emitCustomEvent('productClick', eventData)\n}\n\nexport function filterTrackingFromPlpFilters(filtersSelected) {\n const grouped = groupSelectedFilters(filtersSelected)\n const groupKeys = Object.keys(grouped)\n const typesFiltersSelected = groupKeys.join('|').substring(0, 99)\n const valuesFiltersSelected = groupKeys\n .map(key => grouped[key].values.map(value => value.split('/').at(-1)).join(','))\n .join('|')\n .substring(0, 99)\n\n return [typesFiltersSelected, valuesFiltersSelected]\n}\n\nexport const filterActionEvent = (\n actionType,\n filterType,\n filterValues,\n clickLocation,\n dataType\n) => {\n // https://dsu-confluence.nestle.biz/display/DIANA/PLP+-+Filter+Revamp\n window.gtmDataObject = window.gtmDataObject || []\n const eventData = getExplicitFilterEventData(\n actionType,\n filterType,\n filterValues,\n clickLocation\n )\n\n window.gtmDataObject.push(eventData)\n if (window.NEXT_V1_PLP_EXPLICIT_FILTER_TRACKING && dataType) {\n window.gtmDataObject.push({\n ...window.NEXT_V1_PLP_EXPLICIT_FILTER_TRACKING,\n experiment_action: `${actionType} - ${dataType}`,\n cta_name: 'All filters'\n })\n }\n\n emitCustomEvent('plp_filter', eventData)\n}\n\nconst getExplicitFilterEventData = (actionType, filterType, filterValues, clickLocation) => {\n return {\n event: 'plp_filter',\n event_raised_by: raisedByPB,\n action_type: actionType,\n filter_type: filterType,\n ...(filterValues ? { filter_values: filterValues } : {}),\n ...(clickLocation ? { click_location: clickLocation } : {})\n }\n}\n\nfunction groupSelectedFilters(filtersSelected = []) {\n return filtersSelected.reduce((grouped, { key, value }) => {\n if (!grouped[key]) grouped[key] = { key, values: [] }\n grouped[key].values.push(value.replaceAll(',', '-'))\n return grouped\n }, {})\n}\n\nfunction arrTolastURLElementMapper(arr) {\n if (typeof arr === 'undefined' || arr.length === 0) return undefined\n\n return arr.map(item => item.split('/').pop()?.trim() || '')\n}\n\nfunction arrToJoinedString(arr, joiner = '|') {\n if (typeof arr === 'undefined' || arr.length === 0) return undefined\n\n return arr.map(item => item.trim()).join(joiner)\n}\n\nfunction findTechnogiesText(arr) {\n if (typeof arr === 'undefined' || arr.length === 0) return undefined\n\n if (arr.length === 1) return cleanText(arrTolastURLElementMapper(arr)?.[0])\n else return 'multiple'\n}\n\nfunction cleanText(str) {\n if (typeof str === 'undefined') return undefined\n\n return str.toString().trim()\n}\n\nconst generateEcommerceObject = async (productIds, options) => {\n const productRequests = productIds.map(SKU => getProduct(SKU))\n const productData = await Promise.all(productRequests)\n\n return {\n ecommerce: {\n currency: window[window.config.padl.namespace].dataLayer.app.app.currency,\n value: productData.reduce((ac, product) => {\n return ac + product.price\n }, 0),\n items: productData.map((product, index) => {\n if (product.type === 'bundle' || product.type === 'giftcard') {\n return {\n item_id: cleanText(product.internationalId),\n item_name: cleanText(product.internationalName),\n item_brand: 'nespresso',\n item_category: cleanText(product.type),\n index: index + 1\n }\n }\n\n let output = {\n item_id: cleanText(product.internationalId),\n item_name: cleanText(product.internationalName),\n item_brand: 'nespresso',\n item_category: cleanText(product.type),\n item_category2: arrToJoinedString(\n arrTolastURLElementMapper(product.technologies)\n ),\n item_category3: cleanText(product.category),\n price: product.price,\n quantity: product.salesMultiple,\n affiliation: 'nespresso online store',\n coupon: undefined,\n discount: undefined,\n location_id: undefined,\n item_list_name: cleanText(options?.listName),\n item_list_id: cleanText(options?.listId),\n index: index + 1,\n item_market_id: cleanText(product.legacyId),\n item_market_name: cleanText(product.name),\n item_technology: findTechnogiesText(product.technologies),\n item_range: cleanText(product.category),\n item_discovery_offer: product.category.includes('discovery').toString(),\n item_added_by_user: undefined,\n item_ecotax_applicable: product?.displayEcoTax\n ? cleanText(product?.displayEcoTax.toString())\n : undefined,\n item_selection_list: cleanText(arrToJoinedString(product.productSelections)),\n item_in_stock: product?.inStock\n ? cleanText(product?.inStock.toString())\n : undefined,\n item_subscription_name: undefined,\n item_subscription_category: undefined,\n item_subscription_price: undefined,\n item_subscription_duration: undefined,\n item_subscription_fee: undefined\n }\n\n switch (product.type) {\n case 'capsule': {\n const capsuleProduct = product\n\n output.item_category4 = capsuleProduct.bundled ? 'bundle' : 'single'\n\n output.item_type = capsuleProduct.bundled ? 'bundle' : 'single'\n\n output.item_coffee_aromatic_profile = cleanText(\n arrToJoinedString(capsuleProduct.capsuleProductAromatics)?.toLowerCase()\n )\n\n output.item_coffee_intensity =\n cleanText(capsuleProduct.capsuleProperties.intensity) ?? undefined\n\n output.item_coffee_cup_size = cleanText(\n arrToJoinedString(capsuleProduct.capsuleCupSizes)\n )?.toLowerCase()\n\n break\n }\n case 'machine': {\n const machineProduct = product\n\n output.item_machine_shade = cleanText(machineProduct.colorShade?.name)\n\n break\n }\n }\n\n if (product.type === 'machine' || product.type === 'accessory') {\n output.item_avg_rating = product.ratingCode\n output.item_number_of_reviews = product.ratingCode\n }\n\n return output\n })\n }\n }\n}\n\nexport const selectItems = async (productIds, options) => {\n const ecommerceObject = await generateEcommerceObject(productIds, options)\n\n const output = {\n event: 'select_item',\n event_raised_by: options?.eventRaisedBy ?? 'before_cross_sell_v3',\n click_location: options?.clickLocation ?? 'page builder cross sell quick view',\n item_list_id: options?.listId ?? 'before_cross_sell_v3',\n subscription_product_included: 'false',\n discovery_offer_included: 'false',\n ...ecommerceObject\n }\n\n window.gtmDataObject.push({ ecommerce: null })\n window.gtmDataObject.push(output)\n}\n\nexport const viewItemList = async (productIds, options) => {\n const ecommerceObject = await generateEcommerceObject(productIds, options)\n\n const output = {\n event: 'view_item_list',\n event_raised_by: options?.eventRaisedBy,\n subscription_product_included: 'false',\n discovery_offer_included: 'false',\n ...ecommerceObject\n }\n\n if (options?.eventRaisedBy === undefined) delete output.event_raised_by\n\n window.gtmDataObject.push({ ecommerce: null })\n window.gtmDataObject.push(output)\n}\n","import { NespressoElement } from '@kissui/components/src/nespressoElement'\nimport { renderStrikethroughPrice } from '@kissui/components/src/sku/fragments/strikethroughPrice'\nimport { renderPrice } from '@kissui/components/src/sku/fragments/price'\nimport { renderShowSleeve } from '@kissui/components/src/sku-coffee/fragments/sleeve'\nimport { renderCapsulePrice } from '@kissui/components/src/sku-coffee/fragments/priceCapsule'\nimport { renderAddToCart } from '@kissui/components/src/sku/fragments/addToCart'\nimport { renderIntensity } from '@kissui/components/src/sku-coffee/fragments/intensity'\nimport { renderRatingsWithData } from '@kissui/components/src/sku-machine/fragments/ratings'\nimport { renderVoltage } from '@kissui/components/src/sku-machine/fragments/voltage'\nimport { renderColors } from '@kissui/helpers/src/colors.helpers'\nimport { isRatingEnabled } from '@kissui/helpers/src/rating.service'\nimport { getCupSize } from '@kissui/helpers/src/cupsizes.helpers'\nimport { parseBool } from '@kissui/helpers/src/props.helpers'\nimport { escapeHtml, stringifyForAttribute } from '@kissui/helpers/src/utils'\nimport '@kissui/components/src/level'\nimport { selectItems } from '../../../helpers/src/gtmEvents'\n\nclass SkuQuickView extends NespressoElement {\n loadTemplate() {\n const { popin_id, close, footer } = this.props.popin\n const { product, campaign_position, listname_text } = this.props\n this.product = product\n\n if (!popin_id || !this.product.name) {\n return ''\n }\n\n this.template = `<nb-popin\n id=\"${popin_id}\"\n heading=\"${this.product.name}\"\n size=\"S\"\n variation=\"sku-quick-view\"\n bgcolor=\"highlight\"\n label_close=\"${close}\"\n footer=\"${footer}\"\n >\n ${this.renderProduct()}\n ${this.renderLevels()}\n ${this.renderCupSizes()}\n ${this.renderAromaticProfile()}\n ${this.renderFeatures()}\n ${this.renderIngredients()}\n ${this.renderLink()}\n </nb-popin>`\n\n this.render()\n\n this.querySelector('nb-link').addEventListener('click', () => {\n selectItems([this.product.id], {\n listId: campaign_position,\n listName: `${campaign_position} - ${listname_text}`,\n eventRaisedBy: campaign_position,\n clickLocation: 'page builder cross sell quick view'\n })\n })\n\n this.renderFooter()\n }\n\n renderProduct() {\n let renderedText = ''\n if (this.product.headline && this.product.headline !== '') {\n renderedText = this.product.headline\n } else if (this.product.description) {\n renderedText = this.product.description\n }\n return `\n <div class='cb-row'>\n ${this.renderImageOrSlider()}\n <div>\n <div class=\"t-sm-500 wysiwyg\">${renderedText}</div>\n ${this.renderProductType()}\n </div>\n </div>\n `\n }\n\n renderProductType() {\n switch (this.product.type) {\n case 'capsule':\n return this.renderCoffee()\n case 'machine':\n return this.renderMachine()\n default:\n return ''\n }\n }\n\n renderCoffee() {\n const { product, intensity } = this.props\n\n if (!intensity) {\n return ''\n }\n\n return `\n ${renderIntensity({\n ...intensity,\n intensity_label: product.intensity_label || intensity.intensity_label,\n intensity: product.capsuleProperties?.intensity,\n technologies: product.technologies\n })}\n ${this.renderRoast()}\n `\n }\n\n renderMachine() {\n const { showVoltage, colors } = this.props\n // Todo : check why colors are not rendering with more link\n // Todo : link colors features to which action ???\n // Todo : shouldn't we just desactivate any actions ???\n return `\n ${this.renderRatings()}\n ${renderVoltage(showVoltage)}\n ${renderColors(colors)}\n `\n }\n\n renderRatings() {\n const { showRating } = this.props\n\n if (!showRating?.ratings?.ratingAverage || !isRatingEnabled(this.product)) {\n return ''\n }\n\n return `${renderRatingsWithData({\n ...showRating,\n ratingAverage: showRating.ratings.ratingAverage,\n reviewCount: 1\n })}`\n }\n\n renderImageOrSlider() {\n if (!this.product.image) {\n return ''\n }\n return `<img src='${this.product.image}' alt='' aria-hidden='true' loading='lazy' />`\n }\n\n renderRoast() {\n const { product, levels } = this.props\n\n if (!levels?.roast || !product.roast.label) {\n return ''\n }\n\n return `<p class=\"t-sm-500-sl cb-roast\">${levels.roast} <strong>${product.roast.label}</strong></p>`\n }\n\n renderLevels() {\n const { levels } = this.props\n\n if (this.product.type !== 'capsule' || !levels) {\n return ''\n }\n\n return `<div class=\"cb-properties cb-levels\">\n <ul>\n ${this.renderLevelItem(levels.roastiness_label, this.product?.roast?.value)}\n ${this.renderLevelItem(levels.bitterness_label, this.product?.bitterness?.value)}\n ${this.renderLevelItem(levels.body_label, this.product?.body?.value)}\n ${this.renderLevelItem(levels.acidity_label, this.product?.acidity?.value)}\n </ul>\n </div>`\n }\n\n renderLevelItem(heading, level) {\n const { a11y_level_of } = this.props.levels\n\n if (!heading || !level) {\n return ''\n }\n\n return `<li>\n <h3 class=\"t-sm-700-sl\">${heading}</h3>\n <nb-level value=\"${level}\" a11y_level_of=\"${a11y_level_of}\"></nb-level>\n </li>`\n }\n\n renderCupSizes() {\n const { cup_sizes } = this.props\n\n if (\n this.product.type !== 'capsule' ||\n !cup_sizes ||\n !cup_sizes.heading ||\n !cup_sizes.items\n ) {\n return ''\n }\n\n return `<div class=\"cb-properties cb-cup-sizes\">\n <h3 class=\"t-sm-700-sl\">${cup_sizes.heading}</h3>\n <ul>\n ${cup_sizes.items.map(item => `${this.renderCupSizeItem(item)}`).join('')}\n </ul>\n </div>`\n }\n\n renderCupSizeItem(_item) {\n let label, size, icon\n // backward compatibility as it used to receive a string\n const { unit_is_oz } = this.props.cup_sizes\n if (typeof _item === 'string') {\n label = _item\n size = getCupSize(label.toLowerCase(), unit_is_oz)\n icon = `capsule-cupSize-${label.toLowerCase()}`\n } else {\n label = _item.label\n size = _item.capacityLabel\n icon = _item.icon\n }\n\n if (!label) {\n return ''\n }\n\n return `<li>\n <nb-icon-text\n icon=\"${icon}\"\n label=\"${label}\"\n sub_label=\"\"\n classname=\"t-sm-500-sl\">\n </nb-icon-text>\n ${size ? `<span class='t-sm-500-sl'>(${size})</span>` : ''}\n </li>`\n }\n\n renderAromaticProfile() {\n const { aromatic_profile } = this.props\n\n if (\n this.product.type !== 'capsule' ||\n !aromatic_profile?.heading ||\n !aromatic_profile?.items ||\n aromatic_profile.items.length === 0\n ) {\n return ''\n }\n\n let labels = ''\n aromatic_profile.items.map(aromatic => {\n labels = labels + `${aromatic.toLowerCase()}, `\n })\n labels = labels.slice(0, -2)\n\n return `<div class='cb-properties cb-aromatic'>\n <h3 class=\"t-sm-700-sl\">${aromatic_profile.heading}</h3>\n <p class=\"t-sm-400\">${labels}</p>\n </div>`\n }\n\n renderFeatures() {\n const { features } = this.props\n\n if (this.product.type !== 'machine' || (!features && !this.product.features)) {\n return ''\n }\n\n if (features && features.length !== 0) {\n return `<ul class='cb-features'>${features\n .map(item => `${this.renderFeatureItem(item)}`)\n .join('')}</ul>`\n } else if (this.product.features && this.product.features !== 0) {\n return `<ul class='cb-features'>${this.product.features\n .map(item => `${this.renderFeatureItemApi(item)}`)\n .join('')}</ul>`\n } else {\n return ''\n }\n }\n\n renderFeatureItem(item) {\n const { icon, heading, description } = item\n\n if (!icon || !heading || !description) {\n return ''\n }\n\n return `<li class=\"cb-properties\">\n <nb-icon-text\n icon=\"${icon}\"\n label=\"${heading}\"\n sub_label=\"${description}\"\n classname=\"t-sm-500-sl\">\n </nb-icon-text>\n </li>`\n }\n\n renderFeatureItemApi(item) {\n const { name, description, unitOfMeasure } = item\n\n if (!name) {\n return ''\n }\n\n let subLabel = ''\n if (description) {\n subLabel += description\n }\n if (unitOfMeasure) {\n subLabel += unitOfMeasure\n }\n\n return `<div class=\"cb-properties\">\n <nb-icon-text\n icon=\"\"\n label=\"${name}\"\n sub_label=\"${subLabel}\"\n classname=\"t-sm-500-sl\">\n </nb-icon-text>\n </div>`\n }\n\n renderIngredients() {\n const { ingredients } = this.props\n\n if (\n this.product.type !== 'accessory' ||\n !ingredients ||\n !ingredients.heading ||\n !ingredients.description\n ) {\n return ''\n }\n\n return `<div class=\"cb-properties cb-ingredients\">\n <nb-icon-text\n icon=\"notes-cereal\"\n label=\"${ingredients.heading}\"\n sub_label=\"${ingredients.description}\"\n classname=\"t-sm-500-sl\">\n </nb-icon-text>\n </div>`\n }\n\n renderLink() {\n const { tracking_list, tracking_position } = this.props\n const { label, url } = this.props.link\n\n if (!label || !url) {\n return ''\n }\n\n const product = {\n id: this.props.product.id\n }\n\n return `<div class=\"cb-properties cb-link\">\n <nb-link\n link=\"${url}\"\n target=\"_self\"\n size=\"small\"\n campaign_id=\"${escapeHtml(this.props.campaign?.id || '')}\"\n campaign_name=\"${escapeHtml(this.props.campaign?.name || '')}\"\n campaign_position=\"${escapeHtml(this.props.campaign?.position || '')}\"\n campaign_creative=\"${escapeHtml(this.props.campaign?.creative || '')}\"\n data=\"${stringifyForAttribute({ product })}\"\n long_sku=\"${product.id}\"\n tracking_position=\"${tracking_position}\"\n tracking_list=\"${tracking_list}\"\n >${label}</nb-link>\n </div>`\n }\n\n renderPricing() {\n return `<div class='cb-price'>\n <span class='t-sm-400-sl'>${renderStrikethroughPrice(this.props.pricing, this)}</span>\n <span class='t-md-700-sl'>${renderPrice(this.props.pricing.add_to_cart)}</span>\n ${this.renderCapsuleExtraPricing()}\n </div>`\n }\n\n renderCapsuleExtraPricing() {\n if (this.product.type !== 'capsule') {\n return ''\n }\n return `\n ${renderShowSleeve(this.props.pricing.add_to_cart)}\n ${renderCapsulePrice(this.props.pricing.add_to_cart)}\n `\n }\n\n renderAction() {\n return `<div class='cb-action'>\n ${renderAddToCart(\n { ...this.props.pricing.add_to_cart, disableTracking: true },\n false,\n this\n )}\n </div>`\n }\n\n renderFooter() {\n const { popin, pricing } = this.props\n const has_footer = parseBool(popin.footer)\n\n if (!has_footer || !pricing) {\n return\n }\n\n this.footer = this.querySelector('footer')\n // we need to add this check because could be not rendered correctly\n if (this.footer) {\n this.footer.innerHTML = `\n ${this.renderPricing()}\n ${this.renderAction()}\n `\n }\n }\n}\n\ncustomElements.get('nb-sku-quick-view') || customElements.define('nb-sku-quick-view', SkuQuickView)\n\nexport default SkuQuickView\n","import { getMaxIntensity } from '@kissui/components/src/sku-coffee/services'\n\nexport const renderIntensity = ({\n technologies,\n intensity,\n a11y_intensity_max,\n intensity_label = ''\n}) => {\n const maxIntensity = getMaxIntensity({ technologies })\n\n if (intensity === 0) {\n return ''\n }\n\n return `<nb-intensity\n intensity=\"${intensity}\"\n max_intensity=\"${maxIntensity}\"\n a11y_intensity_max=\"${a11y_intensity_max}\"\n intensity_label=\"${intensity_label}\">\n </nb-intensity>`\n}\n","export const renderVoltage = props => {\n if (!props) {\n return ''\n }\n\n const { show_voltage, voltage_label, voltage_list, a11y_voltage_label } = props\n\n if (!show_voltage || !voltage_label || !voltage_list || !voltage_list.length) {\n return ''\n }\n\n const voltageItem = voltage_list\n .map(({ label, url }) => {\n if (url) {\n return `<a href=\"${url}\" target=\"_self\"><span class=\"t-sm-400\">${label}</span></a>`\n }\n\n return `<div aria-current=\"page\"><span class=\"t-sm-700\">${label}</span></div>`\n })\n .join('')\n\n return `<div class=\"cb-sku-tab\">\n <span class=\"sr-only\">${a11y_voltage_label}</span>\n <p class='t-sm-400' aria-hidden=\"true\">${voltage_label}</p>\n ${voltageItem}\n </div>`\n}\n","// Caching mechanism for ratings\nconst API_RATING_CACHE_TTL = 86400000 // 24 hrs\nconst API_RATING_CACHE_PREFIX = 'n-ratings-'\n\nconst setWithExpiry = (key, value) => {\n const now = new Date()\n\n // 'item' is an object which contains the original value\n // as well as the time when it's supposed to expire\n const item = {\n value: value,\n expiry: now.getTime() + API_RATING_CACHE_TTL\n }\n localStorage.setItem(key, JSON.stringify(item))\n}\n\nconst getWithExpiry = key => {\n const itemStr = localStorage.getItem(key)\n if (!itemStr) return undefined\n\n const item = JSON.parse(itemStr)\n const now = new Date()\n\n // compare the expiry time of the item with the current time\n if (now.getTime() > item.expiry) {\n // If the item is expired, delete the item from storage and return null\n localStorage.removeItem(key)\n return undefined\n }\n\n return item.value\n}\n\nexport const getEncodedProductId = longSku => window.btoa(longSku)\n\nexport const getRatingDetails = async sku => {\n const key = `${API_RATING_CACHE_PREFIX}${sku}`\n let data = getWithExpiry(key)\n if (data === undefined) {\n // already expired or not cached\n data = await window.napi.ratings().summary(sku)\n setWithExpiry(key, data)\n }\n return data\n}\n\nexport const isRatingEnabled = product =>\n product.productRatings && product.productRatings.ratingEnabled\n\nexport const isRated = (productRatings, minimum_rating) =>\n productRatings.reviewCount > 0 &&\n productRatings.ratingAverage > 0 &&\n productRatings.ratingAverage >= minimum_rating\n\nexport const getRatingPercentage = ratingSpread => {\n const ratingAverageSum = ratingSpread.reduce((partialSum, value) => partialSum + value, 0)\n\n return ratingSpread.map(element => {\n return (element / ratingAverageSum) * 100\n })\n}\n\nexport const checkIfReviewsAvailable = ratingsResult => ratingsResult.reviewCount > 0\n\nexport const getProductReviews = async (\n market,\n language,\n encodedProductId,\n sort = 'highlightedFirst',\n page = 0\n) => {\n const url = `/ecapi/rating/v1/${market}/${language}/${encodedProductId}/read?platform=desktop&page=${page}&sort=${sort}`\n const response = await fetch(url)\n\n return response.json()\n}\n\nexport const postLike = async (market, language, encodedProductId, reviewId) => {\n const url = `/ecapi/rating/v1/${market}/${language}/${encodedProductId}/${reviewId}/like`\n\n const response = await fetch(url, {\n method: 'POST'\n })\n\n return response.json()\n}\n\nexport const getNapiProductReviews = async (sku, sort = 'highlightedFirst', page = 0) => {\n return window.napi.ratings().read(sku, sort, page)\n}\n\nexport const postNapiLike = async (sku, reviewId) => {\n return window.napi.ratings().like(sku, reviewId)\n}\n","import { getRatingDetails, isRated } from '@kissui/helpers/src/rating.service'\n\nexport const renderRatings = ({ sku, minimum_rating = 0 }, component) => {\n getRatingDetails(sku)\n .then(ratings => {\n const ratingElementBlock = component.querySelector('.cb-ratings-block')\n if (!ratings || !isRated(ratings, minimum_rating)) {\n if (ratingElementBlock) {\n ratingElementBlock.innerHTML = ''\n }\n\n return ''\n }\n\n if (ratingElementBlock) {\n ratingElementBlock.innerHTML = `<nb-rating stars=\"${ratings.ratingAverage}\"></nb-rating>`\n }\n })\n .catch(err => {\n const ratingElementBlock = component.querySelector('.cb-ratings-block')\n if (ratingElementBlock) {\n ratingElementBlock.innerHTML = ''\n }\n console.error(err)\n })\n\n return ''\n}\n\nexport const renderRatingsWithData = props => {\n const {\n show_ratings,\n minimum_rating = 0,\n ratingAverage,\n reviewCount,\n review_cta,\n reviews_cta\n } = props\n\n if (!show_ratings || !isRated(props, minimum_rating)) {\n return ''\n }\n\n let link = ''\n if (reviewCount && review_cta && reviews_cta) {\n const ctaLabel = (reviewCount > 1 ? reviews_cta : review_cta).replace(\n '{nb_review}',\n reviewCount\n )\n if (ctaLabel) {\n link = `<nb-link class=\"is-review\" icon_right=\"chevron-right\" size=\"small\" color=\"gold\">\n ${ctaLabel}\n </nb-link>`\n }\n }\n\n const toInt = parseFloat(ratingAverage).toFixed(2)\n\n return `<nb-rating stars=\"${toInt}\"></nb-rating>\n ${link}`\n}\n","import { ECAPI_TYPE_CAPSULE } from '@kissui/helpers/src/catalog'\nexport const renderPrice = ({\n price,\n hidePrice,\n giftcard_price,\n price_per_capsule,\n show_sleeve_price,\n type\n}) => {\n if ((!price && !giftcard_price) || hidePrice) {\n return ''\n }\n let finalPrice = null\n if (!show_sleeve_price && price_per_capsule) {\n finalPrice = price_per_capsule\n } else {\n finalPrice = price\n }\n if (type !== ECAPI_TYPE_CAPSULE) {\n finalPrice = price\n }\n\n return `<p class=\"cb-price-current\"><span>${finalPrice || giftcard_price}</span></p>`\n}\n","import { interpolate } from '@kissui/helpers/src/utils'\n\nexport const renderCapsulePrice = props => {\n const {\n show_capsule_price = false,\n capsule_price_label,\n capsule_price_syntax = '{capsule_price_label}: {price_per_capsule}',\n price_per_capsule,\n show_sleeve_price\n } = props\n if (!show_capsule_price || !capsule_price_label || !show_sleeve_price) {\n return ''\n }\n\n const pricePerCapsule = interpolate(\n capsule_price_syntax,\n {\n capsule_price_label,\n price_per_capsule\n },\n '{',\n '}'\n )\n\n if (!pricePerCapsule || !price_per_capsule) {\n return ''\n }\n\n return `<p class=\"cb-price-items cb-price-capsule t-xs-500-sl\">${pricePerCapsule}</p>`\n}\n"],"names":["NespressoElement","HTMLElement","constructor","this","template","connectedCallback","props","_createProps","onStart","loadTemplate","onReady","forceAttributes","attributes","reduce","all","attr","nodeName","nodeValue","data","find","attribute","getData","JSON","parse","error","console","log","render","force","innerHTML","_diff","elem","_getNodeType","node","nodeType","tagName","toLowerCase","_getNodeContent","childNodes","length","textContent","domNodes","Array","prototype","slice","call","templateNodes","count","parentNode","removeChild","forEach","index","appendChild","cloneNode","replaceChild","templateContent","fragment","document","createDocumentFragment","templateHTML","str","DOMParser","parseFromString","body","disconnectedCallback","onDestroy","customElements","get","define","BREAKPOINT_TABLET","COFFEE_VERTUO","TECHNOLOGY_CATEGORY_IDENTIFIER","getTechnologyName","productData","techno","technologies","substring","indexOf","isMultipleOf","quantity","multiple","getSleeveNumber","product","getTechnologyNameFn","sales_multiple","unitQuantity","NaN","getFormattedPrice","async","price","priceFormatter","window","napi","priceFormat","getPriceFormatter","currency","config","padl","namespace","dataLayer","app","html","short","getStrikethroughPriceElement","component","querySelector","renderStrikethroughPrice","strikethrough_price","strikethroughPrice","fetchStrikethroughPrice","then","payload","element","catch","e","style","display","interpolate","txt","vars","stChr","enChr","curIdx","stIdx","enIdx","hashId","substr","stringifyForAttribute","escapeHtml","stringify","text","map","replace","m","renderShowSleeve","show_sleeve","label_capsules","sleeve_syntax","label","number_of_sleeves","label_sleeves","label_sleeve","getSleeveLabel","number_of_capsules","getQuantity","bundled","unit_quantity","sleeveNumber","showSleeve","numberOfSleeves","sleeveLabel","sleevePrice","hasPricePerSleeve","perSleeveLabel","helper","is","innerWidth","vw","devicePixelRatio","mobile","mobile_tablet","tablet","desktop","retina","lt","ref","VARIATION_PLP","VARIATION_PDP","isLoggedIn","padlNamespace","user","renderAddToCart","activeLongSku","activeSku","category_name","contact_cta","hidePrice","longSku","position","rendererName","show_view_details","sku","url","variation","view_details_label","disableTracking","buttonSize","viewportHelper","getButtonSize","cta_url","cta_label","contact_cta_text","contact_url_anchor","is_b2b","isArray","some","tech","includes","checkForB2B","skuProp","activeLongSkuProp","disableTrackingProp","getComputedProps","b2bLoggedIn","remainingCases","b2bNotLoggedIn","DISPLAY_COLOR_MAX","volumes","carafe","ml","oz","alto","mug","gran_lungo","lungo","double_espresso","espresso","ristretto","isNil","obj","Level","filter","createProps","value","a11y_level_of","max","renderLevels","l","i","renderLevel","arrTolastURLElementMapper","arr","item","split","pop","trim","arrToJoinedString","joiner","join","findTechnogiesText","cleanText","toString","generateEcommerceObject","productIds","options","productRequests","SKU","catalog","getProduct","trimSku","Promise","ecommerce","ac","items","type","item_id","internationalId","item_name","internationalName","item_brand","item_category","output","item_category2","item_category3","category","salesMultiple","affiliation","coupon","undefined","discount","location_id","item_list_name","listName","item_list_id","listId","item_market_id","legacyId","item_market_name","name","item_technology","item_range","item_discovery_offer","item_added_by_user","item_ecotax_applicable","displayEcoTax","item_selection_list","productSelections","item_in_stock","inStock","item_subscription_name","item_subscription_category","item_subscription_price","item_subscription_duration","item_subscription_fee","capsuleProduct","item_category4","item_type","item_coffee_aromatic_profile","capsuleProductAromatics","item_coffee_intensity","capsuleProperties","intensity","item_coffee_cup_size","capsuleCupSizes","machineProduct","item_machine_shade","colorShade","item_avg_rating","ratingCode","item_number_of_reviews","SkuQuickView","popin_id","close","footer","popin","campaign_position","listname_text","renderProduct","renderCupSizes","renderAromaticProfile","renderFeatures","renderIngredients","renderLink","addEventListener","ecommerceObject","event","event_raised_by","eventRaisedBy","click_location","clickLocation","subscription_product_included","discovery_offer_included","gtmDataObject","push","selectItems","id","renderFooter","renderedText","headline","description","renderImageOrSlider","renderProductType","renderCoffee","renderMachine","renderIntensity","a11y_intensity_max","intensity_label","maxIntensity","getMaxIntensity","renderRoast","showVoltage","colors","renderRatings","show_voltage","voltage_label","voltage_list","a11y_voltage_label","renderVoltage","max_colors","a11y_extra_color","extra_url","extra_title","renderColors","showRating","ratings","ratingAverage","productRatings","ratingEnabled","show_ratings","minimum_rating","reviewCount","review_cta","reviews_cta","isRated","link","ctaLabel","parseFloat","toFixed","renderRatingsWithData","image","levels","roast","renderLevelItem","roastiness_label","bitterness_label","bitterness","body_label","acidity_label","acidity","heading","level","cup_sizes","renderCupSizeItem","_item","size","icon","unit_is_oz","getCupSize","isOz","unit","volume","capacityLabel","aromatic_profile","labels","aromatic","features","renderFeatureItem","renderFeatureItemApi","unitOfMeasure","subLabel","ingredients","tracking_list","tracking_position","campaign","creative","renderPricing","pricing","renderPrice","giftcard_price","price_per_capsule","show_sleeve_price","finalPrice","add_to_cart","renderCapsuleExtraPricing","show_capsule_price","capsule_price_label","capsule_price_syntax","pricePerCapsule","renderCapsulePrice","renderAction"],"mappings":"AAAO,MAAMA,UAAyBC,YAClCC,WAAAA,WAEIC,KAAKC,SAAW,EACpB,CAEAC,iBAAAA,GACSC,KAAAA,MAAQH,KAAKI,eAClBJ,KAAKK,YACLL,KAAKM,eACLN,KAAKO,WACT,CAOAH,YAAAA,CAAaI,EAAkB,MAC3B,MAAMC,EAAaD,GAAmBR,KAAKS,WAIvCN,IAAAA,EACA,IACAA,EAAQ,IAAIM,GAAYC,QAAO,CAACC,EAAKC,KAC1B,IAAKD,EAAK,CAACC,EAAKC,UAAWD,EAAKE,aACxC,CAAE,GAEL,MAAMC,EARMH,CAAAA,GAAQA,EAAKI,MAAKC,GAAoC,SAAvBA,EAAUJ,WAQxCK,CAAQ,IAAIT,IAECM,OAAS,MAATA,EACfZ,EAGJ,IAAKA,KAAUgB,KAAKC,MAAML,EAAKD,WACzC,OAAQO,GACLC,QAAQC,IAAIvB,KAAKa,SAAU,iBAAkBQ,EACjD,CACJ,CAKAG,MAAAA,CAAOC,GAAQ,GACPA,IAEAzB,KAAK0B,UAAY,IAOrB,MAWMC,EAAQA,CAAC1B,EAAU2B,KAMrB,MAAMC,EAAeC,GACK,IAAlBA,EAAKC,SACE,OAEW,IAAlBD,EAAKC,SACE,UAEJD,EAAKE,QAAQC,cAQlBC,EAAkBJ,GAChBA,EAAKK,YAAcL,EAAKK,WAAWC,OAAS,EACrC,KAEJN,EAAKO,YAIVC,EAAWC,MAAMC,UAAUC,MAAMC,KAAKd,EAAKO,YAC3CQ,EAAgBJ,MAAMC,UAAUC,MAAMC,KAAKzC,EAASkC,YAGtDS,IAAAA,EAAQN,EAASF,OAASO,EAAcP,OAC5C,GAAIQ,EAAQ,EACR,KAAOA,EAAQ,EAAGA,IACdN,E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