{"version":3,"sources":["webpack:///../node_modules/@uds/product/dist/es/index.js","webpack:///./domain/url.ts"],"names":["useShouldIncludeTax$1","_useBrandConfig","_useBrandConfig$payme","payment","addTaxToDisplayPrice","getId$1","_ref","product","id","getName$1","_product$displayName","displayName","getProductName$1","_product$name","name","getDescription$1","_product$description","description","getCategory$1","_product$categoryName","categoryName","getTagline$1","tagline","getProductType","_product$productType","productType","DOMAIN_REGEX","getBasePrices$1","_product$priceTiers","term","interval","priceTiers","priceTier","length","find","tier","paymentInterval","defaultPrice","cancellationPeriod","cancellationPeriodType","getCancellationPeriod$1","basePrices","getTerm$1","_getBasePrices","getInterval$1","_prices$paymentInterv","prices","getPromotion$1","_promotion$priceTiers","promotion","promotionMessage","priceTerm","priceInterval","hasDiscount$1","Object","keys","getRawPrices$1","_ref2","_ref3","_basePrices$retail","promotional","_getPromotion","discountedPrice","getPromotionalPrice$1","result","retail","retailPrice","price","upFront","upFrontCost","recurring","recurringCost","firstTerm","firstTermCost","forEach","key","getCurrency$1","_getRawPrices","_Object$values$","_Object$values$$gross","values","gross","currency","ViewMode","DiscountInterval","INTLNAMESPACE","getPrices$1","includeTax","taxProperty","getTaxProperty","rawPrices","entries","reduce","acc","value","amount","getPriceByType","_prices$type","displayInterval","type","withDisplay","adjustPriceByDisplayPeriod","getRetailPrice","options","getUpFrontPrice","_ref4","getPromotionalPrice","_ref6","getPrice$1","viewMode","RETAIL_INCLUDES_UPFRONT","getPromotionalRate$1","_promotion$percentOff","percentOff","getTax$2","getTaxRate$1","net","perc","toFixed","calcPerc","hasUpFrontCost$1","getDiscountInterval$1","_product$promotionMes","discountInterval","getRecurringPrice$1","recurringPrice","EVERGREEN","isTierPrice","item","createPromotionTier","totalPrice","totalDiscountedPrice","priceWithAdjustments","unitDiscountedPrice","totalAdjustmentValue","totalDiscountAmount","unitAdjustmentValue","unitDiscountAmount","orderItemPriceDetails","discountAmount","mergePrice","_product$defaultPrice","_product$defaultPrice2","isDefaultPrice","priceBeforeAdjustments","upfrontCost","mergeDefaultPrice","map","createTier","getBasketItemProduct$1","basketItem","basketItemProduct","JSON","parse","stringify","_normalizedProduct","_normalizedProduct$pr","_normalizedProduct2","_normalizedProduct2$p","found","isAdjusted","hasAdjustments","normalizedProduct","_normalizedProduct3","_normalizedProduct$pr2","_normalizedProduct4","_normalizedProduct4$p","mergePromotions","index","freeze","__proto__","useShouldIncludeTax","getId","getName","getProductName","getDescription","getCategory","getTagline","isDomain","test","getCancellationPeriod","getCurrency","getInterval","getPrice","getPrices","getPromotionalRate","getTax","getTaxRate","getTerm","hasDiscount","hasUpFrontCost","getRecurringPrice","getFirstTermPrice","_ref5","getBasketItemProduct","RenewalPeriod$1","intlNamespace","period","frequency","RenewalMessage$1","years","Math","floor","months","differs","priceNumber","style","recurringNumber","periodComponent","recurringMessage","termMessage","feeNumber","feeMessage","fee","useProductPrice$1","props","discount","discountPerc","taxRate","taxPerc","getRecurring","LegalText$1","bespoke","cancellation","tax","legalText","isInternalUrl","url","charAt","isHashUrl"],"mappings":"6EAAA,8LAYA,IAAIA,EANwB,KAC1B,IAAIC,EAAiBC,EAErB,OAAgD,QAAxCD,EAAkB,qBAAkD,IAApBA,GAA4F,QAArDC,EAAwBD,EAAgBE,eAA+C,IAA1BD,OAAvE,EAAmHA,EAAsBE,sBAYhO,IAAIC,EAPUC,IACZ,IAAI,QACFC,GACED,EACJ,OAAOC,aAAyC,EAASA,EAAQC,IAcnE,IAAIC,EATYH,IACd,IAAII,EAEJ,IAAI,QACFH,GACED,EACJ,OAAyG,OAAjGI,EAAuBH,aAAyC,EAASA,EAAQI,aAAuBD,EAAuB,IAczI,IAAIE,EATmBN,IACrB,IAAIO,EAEJ,IAAI,QACFN,GACED,EACJ,OAA2F,OAAnFO,EAAgBN,aAAyC,EAASA,EAAQO,MAAgBD,EAAgB,IAcpH,IAAIE,EATmBT,IACrB,IAAIU,EAEJ,IAAI,QACFT,GACED,EACJ,OAAyG,OAAjGU,EAAuBT,aAAyC,EAASA,EAA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AAyC,EAASA,EAAQ0N,WAAqBxH,EAAQ,GAGrIsH,aAA8B,MAAhBA,EAAoC,cAAI,IAAS,CAC7DvN,GAAO4L,EAAH,sBACJpH,OAAQ,CACN+I,kBAEC,U,oBClkCX,oEAAO,MAAMG,EAAiBC,GACK,OAA1B,MAACA,IAAO,IAAIC,OAAO,GAEfC,EAAaF,GACS,OAA1B,MAACA,IAAO,IAAIC,OAAO","file":"pex-static/90/3.f83754de265fb2cbddc6.chunk.js","sourcesContent":["import Message from '@uds/message';\nimport { FormattedNumber } from 'react-intl';\nimport { jsx } from 'react/jsx-runtime';\nimport merge from 'lodash.merge';\nimport { useBrandConfig } from '@ux/whitelabel';\n\nconst useShouldIncludeTax = () => {\n var _useBrandConfig, _useBrandConfig$payme;\n\n return (_useBrandConfig = useBrandConfig()) === null || _useBrandConfig === void 0 ? void 0 : (_useBrandConfig$payme = _useBrandConfig.payment) === null || _useBrandConfig$payme === void 0 ? void 0 : _useBrandConfig$payme.addTaxToDisplayPrice;\n};\n\nvar useShouldIncludeTax$1 = useShouldIncludeTax;\n\nconst getId = _ref => {\n let {\n product\n } = _ref;\n return product === null || product === void 0 ? void 0 : product.id;\n};\n\nvar getId$1 = getId;\n\nconst getName = _ref => {\n var _product$displayName;\n\n let {\n product\n } = _ref;\n return (_product$displayName = product === null || product === void 0 ? void 0 : product.displayName) != null ? _product$displayName : '';\n};\n\nvar getName$1 = getName;\n\nconst getProductName = _ref => {\n var _product$name;\n\n let {\n product\n } = _ref;\n return (_product$name = product === null || product === void 0 ? void 0 : product.name) != null ? _product$name : '';\n};\n\nvar getProductName$1 = getProductName;\n\nconst getDescription = _ref => {\n var _product$description;\n\n let {\n product\n } = _ref;\n return (_product$description = product === null || product === void 0 ? void 0 : product.description) != null ? _product$description : '';\n};\n\nvar getDescription$1 = getDescription;\n\nconst getCategory = _ref => {\n var _product$categoryName;\n\n let {\n product\n } = _ref;\n return (_product$categoryName = product === null || product === void 0 ? void 0 : product.categoryName) != null ? _product$categoryName : '';\n};\n\nvar getCategory$1 = getCategory;\n\nconst getTagline = _ref => {\n let {\n product\n } = _ref;\n return product === null || product === void 0 ? void 0 : product.tagline;\n};\n\nvar getTagline$1 = getTagline;\n\nconst getProductType = _ref => {\n var _product$productType;\n\n let {\n product\n } = _ref;\n return (_product$productType = product === null || product === void 0 ? void 0 : product.productType) != null ? _product$productType : '';\n};\nconst DOMAIN_REGEX = /^\\/domains\\/.*domain.*/;\nconst isDomain = _ref2 => {\n let {\n product\n } = _ref2;\n return DOMAIN_REGEX.test(getProductType({\n product\n }));\n};\n\n// this function pulls all of the raw price data together\n// if you pass a term/interval it will attempt to find the price\n// from the priceTiers property\n// otherwise it'll just fall back to the default price\nconst getBasePrices = _ref => {\n var _product$priceTiers;\n\n let {\n product,\n term,\n interval\n } = _ref;\n const priceTiers = (_product$priceTiers = product === null || product === void 0 ? void 0 : product.priceTiers) != null ? _product$priceTiers : [];\n let priceTier;\n\n if (term != null && interval != null && priceTiers.length > 0) {\n priceTier = priceTiers.find(tier => {\n return tier.term === term && tier.paymentInterval === interval;\n });\n }\n\n if (priceTier == null) {\n // unlike price tiers, the default price doesn't contain the cancellation period\n // so we have to manually pull it out of the root product and merge it in\n priceTier = merge(product === null || product === void 0 ? void 0 : product.defaultPrice, {\n cancellationPeriod: product === null || product === void 0 ? void 0 : product.cancellationPeriod,\n cancellationPeriodType: product === null || product === void 0 ? void 0 : product.cancellationPeriodType\n });\n }\n\n return priceTier;\n};\n\nvar getBasePrices$1 = getBasePrices;\n\nconst getCancellationPeriod = _ref => {\n let {\n product,\n term,\n interval\n } = _ref;\n const basePrices = getBasePrices$1({\n product,\n term,\n interval\n });\n return basePrices === null || basePrices === void 0 ? void 0 : basePrices.cancellationPeriod;\n};\n\nvar getCancellationPeriod$1 = getCancellationPeriod;\n\nconst getTerm = _ref => {\n var _getBasePrices;\n\n let {\n product,\n term,\n interval\n } = _ref;\n return (_getBasePrices = getBasePrices$1({\n product,\n term,\n interval\n })) === null || _getBasePrices === void 0 ? void 0 : _getBasePrices.term;\n};\n\nvar getTerm$1 = getTerm;\n\nconst getInterval = _ref => {\n var _prices$paymentInterv;\n\n let {\n product,\n term,\n interval\n } = _ref;\n const prices = getBasePrices$1({\n product,\n term,\n interval\n });\n return (_prices$paymentInterv = prices === null || prices === void 0 ? void 0 : prices.paymentInterval) != null ? _prices$paymentInterv : prices === null || prices === void 0 ? void 0 : prices.interval;\n};\n\nvar getInterval$1 = getInterval;\n\nconst getPromotion = _ref => {\n var _promotion$priceTiers;\n\n let {\n product,\n term,\n interval\n } = _ref;\n const promotion = product === null || product === void 0 ? void 0 : product.promotionMessage;\n const priceTerm = getTerm$1({\n product,\n term,\n interval\n });\n const priceInterval = getInterval$1({\n product,\n term,\n interval\n }); // promotions have a priceTiers object. If the term and interval do not\n // match then there is not a promo\n\n return promotion === null || promotion === void 0 ? void 0 : (_promotion$priceTiers = promotion.priceTiers) === null || _promotion$priceTiers === void 0 ? void 0 : _promotion$priceTiers.find(tier => {\n return tier.term === priceTerm && tier.paymentInterval === priceInterval;\n });\n};\n\nvar getPromotion$1 = getPromotion;\n\nconst hasDiscount = _ref => {\n let {\n product,\n term,\n interval\n } = _ref;\n const promotion = getPromotion$1({\n product,\n term,\n interval\n });\n return promotion != null && Object.keys(promotion).length > 0;\n};\n\nvar hasDiscount$1 = hasDiscount;\n\nconst getPromotionalPrice$1 = _ref => {\n let {\n product,\n term,\n interval\n } = _ref;\n\n if (hasDiscount$1({\n product,\n term,\n interval\n })) {\n var _getPromotion;\n\n return (_getPromotion = getPromotion$1({\n product,\n term,\n interval\n })) === null || _getPromotion === void 0 ? void 0 : _getPromotion.discountedPrice;\n }\n\n return null;\n};\n\nconst getRawPrices = _ref2 => {\n var _ref3, _basePrices$retail;\n\n let {\n product,\n term,\n interval\n } = _ref2;\n const basePrices = getBasePrices$1({\n product,\n term,\n interval\n });\n const promotional = getPromotionalPrice$1({\n product,\n term,\n interval\n });\n const retail = (_ref3 = (_basePrices$retail = basePrices === null || basePrices === void 0 ? void 0 : basePrices.retail) != null ? _basePrices$retail : basePrices === null || basePrices === void 0 ? void 0 : basePrices.retailPrice) != null ? _ref3 : basePrices === null || basePrices === void 0 ? void 0 : basePrices.price;\n const upFront = basePrices === null || basePrices === void 0 ? void 0 : basePrices.upFrontCost;\n const recurring = basePrices === null || basePrices === void 0 ? void 0 : basePrices.recurringCost;\n const firstTerm = basePrices === null || basePrices === void 0 ? void 0 : basePrices.firstTermCost;\n const result = {\n retail,\n upFront,\n recurring,\n firstTerm,\n promotional\n }; // strip out null/undefined properties from the result\n\n Object.keys(result).forEach(key => {\n if (result[key] == null) {\n delete result[key];\n }\n });\n return result;\n};\n\nvar getRawPrices$1 = getRawPrices;\n\nconst getCurrency = _ref => {\n var _getRawPrices, _Object$values$, _Object$values$$gross;\n\n let {\n product,\n term,\n interval\n } = _ref;\n const prices = (_getRawPrices = getRawPrices$1({\n product,\n term,\n interval\n })) != null ? _getRawPrices : {};\n return (_Object$values$ = Object.values(prices)[0]) === null || _Object$values$ === void 0 ? void 0 : (_Object$values$$gross = _Object$values$.gross) === null || _Object$values$$gross === void 0 ? void 0 : _Object$values$$gross.currency;\n};\n\nvar getCurrency$1 = getCurrency;\n\nlet ViewMode;\n\n(function (ViewMode) {\n ViewMode[ViewMode[\"RETAIL_AND_UPFRONT\"] = 0] = \"RETAIL_AND_UPFRONT\";\n ViewMode[ViewMode[\"RETAIL_INCLUDES_UPFRONT\"] = 1] = \"RETAIL_INCLUDES_UPFRONT\";\n ViewMode[ViewMode[\"RETAIL_ONLY\"] = 2] = \"RETAIL_ONLY\";\n})(ViewMode || (ViewMode = {}));\n\nlet DiscountInterval;\n\n(function (DiscountInterval) {\n DiscountInterval[DiscountInterval[\"EVERGREEN\"] = -1] = \"EVERGREEN\";\n})(DiscountInterval || (DiscountInterval = {}));\n\nconst INTLNAMESPACE = 'ux.product';\n\nconst getTaxProperty = includeTax => {\n switch (includeTax) {\n case 'taxOnly':\n return 'tax';\n\n case true:\n return 'gross';\n\n default:\n return 'net';\n }\n};\n\nconst getPrices = _ref => {\n var _getRawPrices;\n\n let {\n product,\n term,\n interval,\n includeTax\n } = _ref;\n const taxProperty = getTaxProperty(includeTax != null ? includeTax : true);\n const rawPrices = (_getRawPrices = getRawPrices$1({\n product,\n term,\n interval\n })) != null ? _getRawPrices : {};\n return Object.entries(rawPrices).reduce((acc, _ref2) => {\n let [key, value] = _ref2;\n return { ...acc,\n [key]: value === null || value === void 0 ? void 0 : value[taxProperty].amount\n };\n }, {});\n};\n\nvar getPrices$1 = getPrices;\n\nconst adjustPriceByDisplayPeriod = _ref => {\n let {\n price,\n interval,\n displayInterval\n } = _ref;\n\n if (interval == null) {\n return price;\n } // when display period matches the price's interval we don't need to adjust\n\n\n if (interval === displayInterval) {\n return price;\n } // when want to display in a different interval than the product's\n\n\n if (displayInterval === 1 || displayInterval === 12) {\n return price / interval * displayInterval;\n }\n\n return price;\n};\n\nconst getPriceByType = _ref2 => {\n var _prices$type;\n\n let {\n product,\n term,\n interval,\n includeTax,\n displayInterval,\n type,\n withDisplay\n } = _ref2;\n const prices = getPrices$1({\n product,\n term,\n interval,\n includeTax\n });\n let price = (_prices$type = prices === null || prices === void 0 ? void 0 : prices[type]) != null ? _prices$type : 0;\n\n if (displayInterval != null && withDisplay) {\n price = adjustPriceByDisplayPeriod({\n price,\n interval: getInterval$1({\n product,\n term,\n interval\n }),\n displayInterval\n });\n }\n\n return price;\n};\nconst getRetailPrice = _ref3 => {\n let {\n product,\n ...options\n } = _ref3;\n return getPriceByType({\n product,\n ...options,\n type: 'retail',\n withDisplay: true\n });\n};\nconst getUpFrontPrice = _ref4 => {\n let {\n product,\n ...options\n } = _ref4;\n return getPriceByType({\n product,\n ...options,\n type: 'upFront',\n withDisplay: false\n });\n};\nconst getFirstTermPrice = _ref5 => {\n let {\n product,\n ...options\n } = _ref5;\n return getPriceByType({\n product,\n ...options,\n type: 'firstTerm',\n withDisplay: true\n });\n};\nconst getPromotionalPrice = _ref6 => {\n let {\n product,\n ...options\n } = _ref6;\n return getPriceByType({\n product,\n ...options,\n type: 'promotional',\n withDisplay: true\n });\n};\n\nconst getPrice = _ref => {\n let {\n product,\n viewMode,\n ...options\n } = _ref;\n // get the \"standard price\" this will either be the retail price or the promotional price\n let price = hasDiscount$1({\n product,\n ...options\n }) ? getPromotionalPrice({\n product,\n ...options\n }) : getRetailPrice({\n product,\n ...options\n });\n\n if (viewMode === ViewMode.RETAIL_INCLUDES_UPFRONT) {\n price = price + getUpFrontPrice({\n product,\n ...options\n });\n }\n\n return price;\n};\n\nvar getPrice$1 = getPrice;\n\nconst getPromotionalRate = _ref => {\n var _promotion$percentOff;\n\n let {\n product,\n term,\n interval\n } = _ref;\n const promotion = getPromotion$1({\n product,\n term,\n interval\n });\n return (_promotion$percentOff = promotion === null || promotion === void 0 ? void 0 : promotion.percentOff) != null ? _promotion$percentOff : 0;\n};\n\nvar getPromotionalRate$1 = getPromotionalRate;\n\nconst getTax$1 = _ref => {\n let {\n product,\n ...options\n } = _ref;\n return getPrice$1({\n product,\n ...options,\n includeTax: 'taxOnly'\n });\n};\n\nvar getTax$2 = getTax$1;\n\nconst calcPerc = (net, gross) => {\n const perc = ((gross - net) / net * 100).toFixed(0);\n return net && gross ? perc : '—';\n};\n\nconst getTaxRate = _ref => {\n let {\n product,\n ...options\n } = _ref;\n const netPrice = getPrice$1({\n product,\n ...options,\n includeTax: false\n });\n const grossPrice = getPrice$1({\n product,\n ...options,\n includeTax: true\n });\n return calcPerc(netPrice, grossPrice);\n};\n\nvar getTaxRate$1 = getTaxRate;\n\nconst hasUpFrontCost = _ref => {\n let {\n product,\n term,\n interval,\n displayInterval,\n includeTax\n } = _ref;\n return getUpFrontPrice({\n product,\n term,\n interval,\n displayInterval,\n includeTax\n }) > 0;\n};\n\nvar hasUpFrontCost$1 = hasUpFrontCost;\n\nconst getDiscountInterval = _ref => {\n var _product$promotionMes;\n\n let {\n product\n } = _ref;\n return product === null || product === void 0 ? void 0 : (_product$promotionMes = product.promotionMessage) === null || _product$promotionMes === void 0 ? void 0 : _product$promotionMes.discountInterval;\n};\n\nvar getDiscountInterval$1 = getDiscountInterval;\n\nconst getRecurringPrice = _ref => {\n let {\n product,\n ...options\n } = _ref;\n const discountInterval = getDiscountInterval$1({\n product\n });\n const price = getPrice$1({\n product,\n ...options\n });\n const recurringPrice = getPriceByType({\n product,\n ...options,\n type: 'recurring',\n withDisplay: true\n });\n return discountInterval === DiscountInterval.EVERGREEN ? price : recurringPrice;\n};\nvar getRecurringPrice$1 = getRecurringPrice;\n\n// is the basket item's current term/interval the default price tier?\nconst isDefaultPrice = (item, product) => {\n var _product$defaultPrice, _product$defaultPrice2;\n\n const interval = product === null || product === void 0 ? void 0 : (_product$defaultPrice = product.defaultPrice) === null || _product$defaultPrice === void 0 ? void 0 : _product$defaultPrice.interval;\n const term = product === null || product === void 0 ? void 0 : (_product$defaultPrice2 = product.defaultPrice) === null || _product$defaultPrice2 === void 0 ? void 0 : _product$defaultPrice2.term;\n return item.paymentInterval === interval && item.term === term;\n};\n\nconst mergeDefaultPrice = (item, product) => {\n return { ...product,\n defaultPrice: merge(product.defaultPrice, {\n retailPrice: item.priceBeforeAdjustments,\n firstTermCost: item.firstTermCost,\n recurringCost: item.recurringCost,\n upFrontCost: item.upfrontCost\n })\n };\n}; // is the basket item's current term/interval the same as this tier?\n\n\nconst isTierPrice = (item, tier) => {\n return item.paymentInterval === tier.paymentInterval && item.term === tier.term;\n}; // generate a tier from the basket item's price data\n\n\nconst createTier = (item, tier) => {\n return { ...tier,\n paymentInterval: item.paymentInterval,\n term: item.term,\n firstTermCost: item.firstTermCost,\n price: item.priceBeforeAdjustments,\n recurringCost: item.recurringCost,\n upFrontCost: item.upfrontCost\n };\n}; // does the basket item have price adjustments?\n\n\nconst hasAdjustments = item => {\n return item.totalAdjustmentValue.gross.amount > 0;\n}; // generate a tier from the basket item's price data\n\n\nconst createPromotionTier = item => {\n const {\n term,\n paymentInterval,\n totalPrice: totalDiscountedPrice,\n // unit equivalent of totalPrice, only available for baskets created after multiquantity PPE changes\n priceWithAdjustments: unitDiscountedPrice,\n totalAdjustmentValue: totalDiscountAmount,\n // unit equivalent of AdjustmentValue, only available for baskets created after multiquantity PPE changes\n unitAdjustmentValue: unitDiscountAmount,\n orderItemPriceDetails: [{\n percentOff\n }]\n } = item;\n const discountedPrice = unitDiscountedPrice ? unitDiscountedPrice : totalDiscountedPrice;\n const discountAmount = unitDiscountAmount ? unitDiscountAmount : totalDiscountAmount;\n return {\n term,\n paymentInterval,\n discountedPrice,\n discountAmount,\n percentOff\n };\n}; // find which price tier the basket item is currently set to\n// and override it with the basket's pricing\n\n\nconst mergePrice = (item, product) => {\n var _product$priceTiers;\n\n if (isDefaultPrice(item, product)) {\n return mergeDefaultPrice(item, product);\n } // loop through the price tiers to see if we can find a match\n\n\n const priceTiers = ((_product$priceTiers = product.priceTiers) != null ? _product$priceTiers : []).map(tier => {\n if (isTierPrice(item, tier)) {\n return createTier(item, tier);\n }\n\n return tier;\n });\n return { ...product,\n priceTiers\n };\n}; // if the basket item has adjustments, we treat this as if it was on offer\n// if the product doesn't have any offers, we just create a bespoke one\n\n\nconst mergePromotions = (item, product) => {\n var _normalizedProduct, _normalizedProduct$pr, _normalizedProduct2, _normalizedProduct2$p;\n\n let found = false;\n const isAdjusted = hasAdjustments(item);\n let normalizedProduct = product; // if for some reason priceTiers isn't set (it has happened),\n // we should default it\n\n normalizedProduct = { ...normalizedProduct,\n promotionMessage: { ...((_normalizedProduct = normalizedProduct) === null || _normalizedProduct === void 0 ? void 0 : _normalizedProduct.promotionMessage),\n priceTiers: ((_normalizedProduct$pr = (_normalizedProduct2 = normalizedProduct) === null || _normalizedProduct2 === void 0 ? void 0 : (_normalizedProduct2$p = _normalizedProduct2.promotionMessage) === null || _normalizedProduct2$p === void 0 ? void 0 : _normalizedProduct2$p.priceTiers) != null ? _normalizedProduct$pr : []).reduce((acc, tier) => {\n // if the price tier matches the basket's term/interval\n // we want to replace it with the basket's actual pricing\n if (isTierPrice(item, tier)) {\n found = true; // if the product has an offer for this tier\n // but the basket doesn't have any adjustments\n // that means that the offer isn't valid for this customer\n // so we should remove it from the price tiers\n\n if (!isAdjusted) {\n return acc;\n }\n\n return [...acc, createPromotionTier(item)];\n }\n\n return [...acc, tier];\n }, [])\n }\n }; // if the currently-selected term/interval doesn't match a promotion tier\n // we want to force a new one onto the product\n\n if (!found && isAdjusted) {\n var _normalizedProduct3, _normalizedProduct$pr2, _normalizedProduct4, _normalizedProduct4$p;\n\n normalizedProduct = { ...normalizedProduct,\n promotionMessage: { ...((_normalizedProduct3 = normalizedProduct) === null || _normalizedProduct3 === void 0 ? void 0 : _normalizedProduct3.promotionMessage),\n priceTiers: [...((_normalizedProduct$pr2 = (_normalizedProduct4 = normalizedProduct) === null || _normalizedProduct4 === void 0 ? void 0 : (_normalizedProduct4$p = _normalizedProduct4.promotionMessage) === null || _normalizedProduct4$p === void 0 ? void 0 : _normalizedProduct4$p.priceTiers) != null ? _normalizedProduct$pr2 : []), createPromotionTier(item)]\n }\n };\n }\n\n return normalizedProduct;\n}; // a basket item contains a PPE product, but it has its own\n// pricing fields, which take precedence over the PPE data\n// this selector merges the basket item pricing into the\n// PPE object\n\n\nconst getBasketItemProduct = basketItem => {\n const product = basketItem.product;\n\n if (product == null) {\n return product;\n } // Don't mutate original basketItem product; its generally a\n // bad idea to have side effects but specifically this can\n // cause issues where there is one product for different basket items\n // and you end up altering the orignal product and effecting both items pricing\n\n\n let basketItemProduct = JSON.parse(JSON.stringify(product));\n basketItemProduct = mergePrice(basketItem, basketItemProduct);\n basketItemProduct = mergePromotions(basketItem, basketItemProduct);\n return basketItemProduct;\n};\n\nvar getBasketItemProduct$1 = getBasketItemProduct;\n\nvar index = /*#__PURE__*/Object.freeze({\n __proto__: null,\n useShouldIncludeTax: useShouldIncludeTax$1,\n getId: getId$1,\n getName: getName$1,\n getProductName: getProductName$1,\n getDescription: getDescription$1,\n getCategory: getCategory$1,\n getTagline: getTagline$1,\n getProductType: getProductType,\n isDomain: isDomain,\n getCancellationPeriod: getCancellationPeriod$1,\n getCurrency: getCurrency$1,\n getInterval: getInterval$1,\n getPrice: getPrice$1,\n getPrices: getPrices$1,\n getPromotionalRate: getPromotionalRate$1,\n getTax: getTax$2,\n getTaxRate: getTaxRate$1,\n getTerm: getTerm$1,\n hasDiscount: hasDiscount$1,\n hasUpFrontCost: hasUpFrontCost$1,\n getRecurringPrice: getRecurringPrice$1,\n getFirstTermPrice: getFirstTermPrice,\n getPromotionalPrice: getPromotionalPrice,\n getRetailPrice: getRetailPrice,\n getUpFrontPrice: getUpFrontPrice,\n getBasketItemProduct: getBasketItemProduct$1\n});\n\n// ux.product.renewalPeriod.{yearly,monthly,nMonthly}\n// per year / per month / every n months\nconst RenewalPeriod = _ref => {\n let {\n intlNamespace = INTLNAMESPACE,\n period\n } = _ref;\n let frequency = 'nMonthly';\n\n if (period === 12) {\n frequency = 'yearly';\n }\n\n if (period === 1) {\n frequency = 'monthly';\n }\n\n return /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.renewalPeriod.${frequency}`,\n values: {\n period\n }\n });\n};\n\nvar RenewalPeriod$1 = RenewalPeriod;\n\nconst RenewalMessage = _ref => {\n let {\n intlNamespace = INTLNAMESPACE,\n interval,\n currency,\n price,\n upFront,\n recurring,\n term\n } = _ref;\n const years = Math.floor(term / 12);\n const months = term % 12;\n const differs = price !== recurring; // the price, either the discount price or the retail price\n // £9.99\n\n const priceNumber = /*#__PURE__*/jsx(FormattedNumber, {\n value: price,\n style: \"currency\",\n currency: currency\n }); // the price after the initial period has ended\n // £19.99\n\n\n const recurringNumber = /*#__PURE__*/jsx(FormattedNumber, {\n value: recurring,\n style: \"currency\",\n currency: currency\n }); // per month\n\n\n const periodComponent = /*#__PURE__*/jsx(RenewalPeriod$1, {\n intlNamespace: intlNamespace,\n period: interval != null ? interval : 1\n }); // ux.product.recurring.price\n // shown when the renewal price is different to the first term price\n // , then £19.99 per month\n\n\n const recurringMessage = (() => {\n if (recurring === price || recurring === 0) {\n return '';\n }\n\n return /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.recurring.price`,\n values: {\n price: recurringNumber,\n period: periodComponent\n }\n });\n })(); // ux.product.term.{months,years,monthsAndYears}\n // 2 years / 6 months / 2 years and 6 months\n\n\n const termMessage = (() => {\n if (term < 12) {\n return /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.term.months`,\n values: {\n months\n }\n });\n }\n\n if (term % 12 === 0) {\n return /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.term.years`,\n values: {\n years\n }\n });\n }\n\n return /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.term.monthsAndYears`,\n values: {\n months,\n years\n }\n });\n })(); // the setup fee\n // £50\n\n\n const feeNumber = /*#__PURE__*/jsx(FormattedNumber, {\n value: upFront,\n style: \"currency\",\n currency: currency\n }); // ux.product.fee\n // will not display if there isn't a fee\n // Setup fee: £50\n\n\n const feeMessage = upFront != null && upFront > 0 ? /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.fee`,\n values: {\n price: feeNumber\n }\n }) : null; // ux.product.recurring\n\n return /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.recurring`,\n values: {\n price: priceNumber,\n recurringPrice: recurringMessage,\n term: termMessage,\n period: periodComponent,\n fee: feeMessage,\n differs\n }\n });\n};\n\nvar RenewalMessage$1 = RenewalMessage;\n\nconst useProductPrice = props => {\n const {\n interval,\n term,\n displayInterval\n } = props;\n return {\n currency: getCurrency$1(props),\n price: getPrice$1(props),\n upFront: getUpFrontPrice(props),\n recurring: getRecurringPrice$1(props),\n retail: getRetailPrice(props),\n discount: getPromotionalPrice(props),\n discountPerc: getPromotionalRate$1(props),\n taxRate: getTaxRate$1(props),\n hasUpFrontCost: hasUpFrontCost$1(props),\n hasDiscount: hasDiscount$1(props),\n interval: interval != null ? interval : getInterval$1(props),\n term: term != null ? term : getTerm$1(props),\n displayInterval: displayInterval != null ? displayInterval : getInterval$1(props)\n };\n};\n\nvar useProductPrice$1 = useProductPrice;\n\nconst getTax = _ref => {\n let {\n includeTax,\n taxRate,\n intlNamespace\n } = _ref;\n\n if (taxRate === '—' || taxRate === '0') {\n return '';\n }\n\n if (includeTax) {\n return (\n /*#__PURE__*/\n // ux.product.legal.tax.inc\n // includes tax at 20%\n jsx(Message, {\n id: `${intlNamespace}.legal.tax.inc`,\n values: {\n taxPerc: `${taxRate}%`\n }\n })\n );\n }\n\n return (\n /*#__PURE__*/\n // ux.product.legal.tax.exc\n // excludes tax at 20%\n jsx(Message, {\n id: `${intlNamespace}.legal.tax.exc`,\n values: {\n taxPerc: `${taxRate}%`\n }\n })\n );\n};\n\nconst getRecurring = _ref2 => {\n let {\n intlNamespace,\n term,\n interval,\n displayInterval,\n currency,\n price,\n upFront,\n recurring\n } = _ref2;\n\n if (term == null || interval == null) {\n return null;\n }\n\n if (term > 0 && interval > 0) {\n return /*#__PURE__*/jsx(RenewalMessage$1, {\n intlNamespace: intlNamespace,\n term: term,\n interval: displayInterval,\n currency: currency,\n price: price,\n upFront: upFront,\n recurring: recurring\n });\n }\n\n return null;\n};\n\nconst LegalText = _ref3 => {\n var _ref4;\n\n let {\n intlNamespace = INTLNAMESPACE,\n ...props\n } = _ref3;\n const {\n product,\n bespoke\n } = props;\n const includeTax = useShouldIncludeTax$1();\n const {\n currency,\n price,\n upFront,\n recurring,\n taxRate,\n interval,\n term,\n displayInterval\n } = useProductPrice$1({\n includeTax,\n ...props\n });\n const cancellation = getCancellationPeriod$1({\n product,\n term,\n interval\n }); // {tax}{recurring}{bespoke}{cancellation}\n // includes 20% tax\n\n return /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.legal`,\n values: {\n tax: getTax({\n intlNamespace,\n includeTax,\n taxRate\n }),\n recurring: getRecurring({\n intlNamespace,\n term,\n interval,\n displayInterval,\n currency,\n price,\n upFront,\n recurring\n }),\n bespoke: (_ref4 = bespoke != null ? bespoke : product === null || product === void 0 ? void 0 : product.legalText) != null ? _ref4 : '',\n // ux.product.legal.cancellation\n // 4 weeks notice\n cancellation: cancellation != null ? /*#__PURE__*/jsx(Message, {\n id: `${intlNamespace}.legal.cancellation`,\n values: {\n cancellation\n }\n }) : null\n }\n });\n};\n\nvar LegalText$1 = LegalText;\n\nconst price = function () {\n let amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n return {\n amount,\n currency: 'GBP'\n };\n};\nconst prices = function () {\n let net = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n let taxRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.2;\n return {\n raw: price(net),\n net: price(net),\n tax: price(net * taxRate),\n gross: price(net + net * taxRate)\n };\n};\nconst priceTier = function () {\n let {\n retail = 10,\n firstTerm = retail,\n recurring = retail,\n upfront = 0,\n interval = 1,\n term = 12,\n taxRate = 0.2\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return {\n cancellationPeriodType: '',\n hidden: false,\n legacyTariffId: '',\n minQuantity: 1,\n term,\n paymentInterval: interval,\n cancellationPeriod: '4 weeks',\n price: prices(retail, taxRate),\n upFrontCost: prices(upfront, taxRate),\n recurringCost: prices(recurring, taxRate),\n firstTermCost: prices(firstTerm, taxRate)\n };\n};\nconst promotionPriceTier = _ref => {\n let {\n term = 12,\n interval = 1,\n retail = 10,\n offer = retail / 2,\n taxRate = 0.2\n } = _ref;\n return {\n term,\n paymentInterval: interval,\n discountedPrice: prices(offer, taxRate),\n discountAmount: prices(retail - offer, taxRate),\n percentOff: Math.round(offer / retail * 100)\n };\n};\nconst promotionMessage = function () {\n let {\n term = 12,\n interval = 1,\n retail = 10,\n offer = retail / 2,\n taxRate = 0.2,\n tiers = [promotionPriceTier({\n term,\n interval,\n offer,\n retail,\n taxRate\n })]\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return {\n offerType: '',\n discountType: '',\n discountValue: 5,\n percentOff: 50,\n discountAmount: prices(5, taxRate),\n message: '',\n messagePlacement: '',\n priority: 0,\n media: {\n allowOverrideUrl: false,\n id: 1,\n url: '',\n archived: ''\n },\n discountedPrice: prices(5, taxRate),\n priceTiers: tiers\n };\n};\nconst defaultPrice = function () {\n let {\n interval = 1,\n term = 12,\n retail = 10,\n firstTerm = retail,\n recurring = retail,\n upfront = 0,\n taxRate = 0.2\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return {\n term,\n interval,\n retailPrice: prices(retail, taxRate),\n upFrontCost: prices(upfront, taxRate),\n recurringCost: prices(recurring, taxRate),\n firstTermCost: prices(firstTerm, taxRate)\n };\n};\nconst productAttribute = function () {\n let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'name';\n let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';\n return {\n attributeName: name,\n attributeValue: value,\n id: Math.random() * 1024\n };\n};\nconst product = function () {\n let overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return {\n id: 1234,\n name: 'name',\n url: '/url',\n activeStartDate: '',\n externalId: '',\n displayName: 'display name',\n productType: '',\n tagline: '',\n keywords: '',\n legalText: '',\n isEntitlement: false,\n isOptimisticProvision: false,\n cancellationPeriod: '4 weeks',\n cancellationPeriodType: '4_WEEKS',\n defaultPrice: defaultPrice({\n firstTerm: 10,\n interval: 1,\n term: 12,\n recurring: 10,\n retail: 10,\n upfront: 0\n }),\n defaultSkuId: 1,\n categoryName: 'category',\n priceTiers: [priceTier({\n term: 12,\n interval: 12,\n retail: 120\n })],\n productAttributes: [],\n ...overrides\n };\n};\n\nvar mocks = /*#__PURE__*/Object.freeze({\n __proto__: null,\n price: price,\n prices: prices,\n priceTier: priceTier,\n promotionPriceTier: promotionPriceTier,\n promotionMessage: promotionMessage,\n defaultPrice: defaultPrice,\n productAttribute: productAttribute,\n product: product\n});\n\nexport { LegalText$1 as LegalText, RenewalMessage$1 as RenewalMessage, RenewalPeriod$1 as RenewalPeriod, ViewMode, mocks, index as selectors, useProductPrice$1 as useProductPrice };\n","export const isInternalUrl = (url: string | null | undefined) => {\n return (url ?? '').charAt(0) === '/';\n};\nexport const isHashUrl = (url: string | null | undefined) => {\n return (url ?? '').charAt(0) === '#';\n};\n"],"sourceRoot":""}