@sunrise-upc/mobile-prod-card 12.2.0-beta.0 → 12.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,4 +39,24 @@ Starter code base to create a reusable functional react component for the sunris
39
39
  ### Upload into private NPM package ###
40
40
 
41
41
  * before upload the package into NPM repo. Please connect with Leads
42
-
42
+
43
+
44
+
45
+ ### Host-provided product card badges
46
+
47
+ The product card does not depend on `@sunrise-upc/sales-static-components`.
48
+ Supply the microsite's badge component around product card consumers, including
49
+ `StaticLineTable` and `DpLinetable`:
50
+
51
+ ```tsx
52
+ import { ProductCardBadgeProvider, StaticLineTable } from '@sunrise-upc/mobile-prod-card';
53
+ import { BadgeContainer } from '@sunrise-upc/sales-static-components';
54
+
55
+ <ProductCardBadgeProvider component={BadgeContainer}>
56
+ <StaticLineTable {...props} />
57
+ </ProductCardBadgeProvider>;
58
+ ```
59
+
60
+ The supplied component receives a `badges` array for both product and promotion
61
+ badges. Without a provider, cards retain their legacy highlight and promotion
62
+ text. No static-components import is included in the product card build.
@@ -1,2 +1,2 @@
1
- import e,{useState as t,useRef as l,useCallback as a,useEffect as n}from"react";import i from"./PriceCalculationSticky.module.scss.js";import{Container as r}from"react-bootstrap";import c from"../FalconButtonV2/FalconButtonV2.js";import{countZero as o,replacePlaceholder as m}from"../../utils/utils.js";const d=({totalOnetimeAmount:d=0,totalRecurring:s=0,onContinue:u,cartData:v,content:p,flow:E})=>{var N,P,f;const[I,x]=t(!1),g=l(null),b=!!E,h=I,T=a(e=>{e.stopPropagation(),null==u||u()},[u]),D=a(()=>{x(!1)},[]);n(()=>{if(!I)return;const e=e=>{g.current&&!g.current.contains(e.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h,D]);const y=null===(N=null==v?void 0:v.map(e=>(null==e?void 0:e.itemName)||""))||void 0===N?void 0:N.join(", "),L=!!(null===(P=null==v?void 0:v.some)||void 0===P?void 0:P.call(v,e=>Number(null==e?void 0:e.flexUpgradePrice)>0));return e.createElement("div",{className:i.stickyContainer,ref:g},e.createElement(r,null,e.createElement("div",{className:i.collapsedView,onClick:()=>x(!I)},e.createElement("div",{className:i.priceInfo},e.createElement("div",{className:i.priceWrapper},0!==s&&e.createElement("div",{className:i.price},o(s),e.createElement("span",{className:i.period},null==p?void 0:p.monthlyText)),0!==d&&e.createElement("div",{className:i.totalSection},e.createElement("div",null,(null==p?void 0:p.oneTime)||""," "),e.createElement("div",{className:i.price},null==p?void 0:p.recurringText," ",o(d)))),y&&e.createElement("div",{className:i.productName},y),L&&(null==p?void 0:p.flexUpgradeDescription)&&e.createElement("div",{className:i.flexUpgradeNote},null==p?void 0:p.flexUpgradeDescription)),e.createElement(c,{content:null===(f=null==p?void 0:p.continueBtn)||void 0===f?void 0:f[0],eventAction:"text",metadata:{},disabled:b,"aria-disabled":b,onClick:T})),I&&e.createElement("div",{className:i.expandedView},e.createElement("hr",null),e.createElement("div",{className:i.productsList},(null==p?void 0:p.title)&&e.createElement("h6",{className:i.pricingOverview},null==p?void 0:p.title),null==v?void 0:v.map((t,l)=>{const a="MOBILEPOSTPAID_RATEPLAN"===(null==t?void 0:t.itemType)?(e=>e&&"0"!==e?m(null==p?void 0:p.contractDuration,[e]):null==p?void 0:p.noMinContractDuration)((null==t?void 0:t.contractDuration)||(null==t?void 0:t.contractTerm)):"",n=Number(null==t?void 0:t.flexUpgradePrice),r=n>0,c=null==p?void 0:p.flexUpgradeLabel,d=r?o(t.flexUpgradePrice):"",s=e=>{if(!r||null==e||""===e)return o(e);const t=parseFloat(e)-n;return Number.isFinite(t)&&t>=0?o(t.toFixed(2)):o(e)},u=s(null==t?void 0:t.itemDiscountedPrice),v=s(null==t?void 0:t.itemDerivedPrice);return e.createElement(e.Fragment,{key:t.productName||String(l)},e.createElement("div",{className:i.productItem},e.createElement("div",{className:i.productItemInfo},(null==t?void 0:t.itemName)&&e.createElement("div",{className:i.productItemName},null==t?void 0:t.itemName),"HOME_SECURITY"===(null==t?void 0:t.itemType)&&e.createElement("div",{className:i.hardwarePayment},(null==p?void 0:p.hsDevicesLabel)&&e.createElement("span",null,null==p?void 0:p.hsDevicesLabel)," ",(null==t?void 0:t.accessoryCount)>0&&(null==p?void 0:p.hsAdditionalAccLabel)&&m(null==p?void 0:p.hsAdditionalAccLabel,[null==t?void 0:t.accessoryCount]))),e.createElement("div",{className:i.productItemPriceWrapper},(null==t?void 0:t.itemOneTimePrice)>0?e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice},o(null==t?void 0:t.itemOneTimePrice),e.createElement("span",null,"/-"))):(null==t?void 0:t.itemDerivedPrice)?e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice,"aria-label":`Price: ${v} per month`},v,e.createElement("span",null,null==p?void 0:p.monthlyText)),e.createElement("span",{className:i.recurringPrice},u)):e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice,"aria-label":`Price: ${u} per month`},u,e.createElement("span",null,null==p?void 0:p.monthlyText))),a&&e.createElement("div",{className:i.productItemDuration},a))),r&&e.createElement("div",{className:i.productItem},e.createElement("div",{className:i.productItemInfo},e.createElement("div",{className:i.productItemName},c)),e.createElement("div",{className:i.productItemPriceWrapper},e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice,"aria-label":`${c}: ${d} per month`},d,e.createElement("span",null,null==p?void 0:p.monthlyText))))))})))))};export{d as default};
1
+ import e,{useState as t,useRef as l,useCallback as a,useEffect as n}from"react";import i from"./PriceCalculationSticky.module.scss.js";import{Container as r}from"react-bootstrap";import c from"../FalconButtonV2/FalconButtonV2.js";import{countZero as o,replacePlaceholder as m}from"../../utils/utils.js";const d=({totalOnetimeAmount:d=0,totalRecurring:s=0,onContinue:u,cartData:v,content:p,flow:E})=>{var N,P,f;const[I,x]=t(!1),g=l(null),b=!!E,h=I,T=a(e=>{e.stopPropagation(),null==u||u()},[u]),D=a(()=>{x(!1)},[]);n(()=>{if(!I)return;const e=e=>{g.current&&!g.current.contains(e.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h,D]);const y=null===(N=null==v?void 0:v.map(e=>(null==e?void 0:e.itemName)||""))||void 0===N?void 0:N.join(", "),L=!!(null===(P=null==v?void 0:v.some)||void 0===P?void 0:P.call(v,e=>Number(null==e?void 0:e.flexUpgradePrice)>0));return e.createElement("div",{className:i.stickyContainer,ref:g},e.createElement(r,null,e.createElement("div",{className:i.collapsedView,onClick:()=>x(!I)},e.createElement("div",{className:i.priceInfo},e.createElement("div",{className:i.priceWrapper},e.createElement("div",{className:i.price},o(s),e.createElement("span",{className:i.period},null==p?void 0:p.monthlyText)),0!==d&&e.createElement("div",{className:i.totalSection},e.createElement("div",null,(null==p?void 0:p.oneTime)||""," "),e.createElement("div",{className:i.price},null==p?void 0:p.recurringText," ",o(d)))),y&&e.createElement("div",{className:i.productName},y),L&&(null==p?void 0:p.flexUpgradeDescription)&&e.createElement("div",{className:i.flexUpgradeNote},null==p?void 0:p.flexUpgradeDescription)),e.createElement(c,{content:null===(f=null==p?void 0:p.continueBtn)||void 0===f?void 0:f[0],eventAction:"text",metadata:{},disabled:b,"aria-disabled":b,onClick:T})),I&&e.createElement("div",{className:i.expandedView},e.createElement("hr",null),e.createElement("div",{className:i.productsList},(null==p?void 0:p.title)&&e.createElement("h6",{className:i.pricingOverview},null==p?void 0:p.title),null==v?void 0:v.map((t,l)=>{const a="MOBILEPOSTPAID_RATEPLAN"===(null==t?void 0:t.itemType)?(e=>e&&"0"!==e?m(null==p?void 0:p.contractDuration,[e]):null==p?void 0:p.noMinContractDuration)((null==t?void 0:t.contractDuration)||(null==t?void 0:t.contractTerm)):"",n=Number(null==t?void 0:t.flexUpgradePrice),r=n>0,c=null==p?void 0:p.flexUpgradeLabel,d=r?o(t.flexUpgradePrice):"",s=e=>{if(!r||null==e||""===e)return o(e);const t=parseFloat(e)-n;return Number.isFinite(t)&&t>=0?o(t.toFixed(2)):o(e)},u=s(null==t?void 0:t.itemDiscountedPrice),v=s(null==t?void 0:t.itemDerivedPrice);return e.createElement(e.Fragment,{key:t.productName||String(l)},e.createElement("div",{className:i.productItem},e.createElement("div",{className:i.productItemInfo},(null==t?void 0:t.itemName)&&e.createElement("div",{className:i.productItemName},null==t?void 0:t.itemName),"HOME_SECURITY"===(null==t?void 0:t.itemType)&&e.createElement("div",{className:i.hardwarePayment},(null==p?void 0:p.hsDevicesLabel)&&e.createElement("span",null,null==p?void 0:p.hsDevicesLabel)," ",(null==t?void 0:t.accessoryCount)>0&&(null==p?void 0:p.hsAdditionalAccLabel)&&m(null==p?void 0:p.hsAdditionalAccLabel,[null==t?void 0:t.accessoryCount]))),e.createElement("div",{className:i.productItemPriceWrapper},(null==t?void 0:t.itemOneTimePrice)>0?e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice},o(null==t?void 0:t.itemOneTimePrice),e.createElement("span",null,"/-"))):(null==t?void 0:t.itemDerivedPrice)?e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice,"aria-label":`Price: ${v} per month`},v,e.createElement("span",null,null==p?void 0:p.monthlyText)),e.createElement("span",{className:i.recurringPrice},u)):e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice,"aria-label":`Price: ${u} per month`},u,e.createElement("span",null,null==p?void 0:p.monthlyText))),a&&e.createElement("div",{className:i.productItemDuration},a))),r&&e.createElement("div",{className:i.productItem},e.createElement("div",{className:i.productItemInfo},e.createElement("div",{className:i.productItemName},c)),e.createElement("div",{className:i.productItemPriceWrapper},e.createElement("div",{className:i.productItemPrice},e.createElement("div",{className:i.derivedPrice,"aria-label":`${c}: ${d} per month`},d,e.createElement("span",null,null==p?void 0:p.monthlyText))))))})))))};export{d as default};
2
2
  //# sourceMappingURL=PriceCalculationSticky.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PriceCalculationSticky.js","sources":["../../../../src/components/PriceCalculationSticky/PriceCalculationSticky.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from 'react';\r\nimport { PriceCalculationStickyProps } from './PriceCalculationSticky.types';\r\nimport styles from './PriceCalculationSticky.module.scss';\r\nimport { Container } from 'react-bootstrap';\r\nimport FalconButtonV2 from '../FalconButtonV2/FalconButtonV2';\r\nimport { countZero, replacePlaceholder} from '../../utils/utils';\r\n\r\nconst PriceCalculationSticky: React.FC<PriceCalculationStickyProps> = ({\r\n totalOnetimeAmount = 0,\r\n totalRecurring=0,\r\n onContinue,\r\n cartData,\r\n content,\r\n flow\r\n}) => {\r\n const [internalExpanded, setInternalExpanded] = useState(false);\r\n const stickyContainerRef = useRef<HTMLDivElement>(null);\r\n // Use controlled state if provided, otherwise use internal state\r\n const isButtonDisabled = flow ? true : false;\r\n const isExpanded =internalExpanded;\r\n // Memoized handlers\r\n const handleButtonClick = useCallback(\r\n (e: React.MouseEvent) => {\r\n e.stopPropagation(); // Prevent toggle when clicking the button\r\n onContinue?.();\r\n },\r\n [onContinue]\r\n );\r\n\r\n const handleCollapse = useCallback(() => {\r\n setInternalExpanded(false);\r\n }, []);\r\n\r\n // Handle click outside to collapse\r\n useEffect(() => {\r\n if (!internalExpanded) return;\r\n\r\n const handleClickOutside = (event: MouseEvent) => {\r\n if (\r\n stickyContainerRef.current &&\r\n !stickyContainerRef.current.contains(event.target as Node)\r\n ) {\r\n setInternalExpanded(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', handleClickOutside);\r\n return () => document.removeEventListener('mousedown', handleClickOutside);\r\n }, [isExpanded, handleCollapse]);\r\n\r\n const getContractDuration = (contractDuration:string) => {\r\n return contractDuration && contractDuration !== '0' ? replacePlaceholder(content?.contractDuration, [contractDuration]) : content?.noMinContractDuration;\r\n };\r\n\r\n const productsNamesList = cartData?.map(\r\n (item:any) =>\r\n item?.itemName || ''\r\n )?.join(', ');\r\n const hasAnyFlexUpgrade = !!cartData?.some?.((item: any) => Number(item?.flexUpgradePrice) > 0);\r\n return (\r\n <div className={styles.stickyContainer} ref={stickyContainerRef}>\r\n {/* Collapsed View - Always Visible */}\r\n <Container>\r\n <div\r\n className={styles.collapsedView}\r\n onClick={() => setInternalExpanded(!internalExpanded)}\r\n >\r\n <div className={styles.priceInfo}>\r\n <div className={styles.priceWrapper}>\r\n {totalRecurring !== 0 && (\r\n <div className={styles.price}>\r\n {countZero(totalRecurring)}\r\n <span className={styles.period}>{content?.monthlyText}</span>\r\n </div>\r\n \r\n )}\r\n {totalOnetimeAmount !== 0 && (\r\n <div className={styles.totalSection}><div>{content?.oneTime || ''}&nbsp; \r\n </div>\r\n <div className={styles.price}>\r\n {content?.recurringText} {countZero(totalOnetimeAmount)}\r\n </div></div>\r\n )}\r\n </div>\r\n {/* {productsName && <div className={styles.productName}>{productsName}</div>} */}\r\n {productsNamesList && <div className={styles.productName}>{productsNamesList}</div>}\r\n {hasAnyFlexUpgrade && content?.flexUpgradeDescription && (\r\n <div className={styles.flexUpgradeNote}>\r\n {content?.flexUpgradeDescription}\r\n </div>\r\n )}\r\n </div>\r\n <FalconButtonV2\r\n content={content?.continueBtn?.[0]}\r\n eventAction='text'\r\n metadata={{}}\r\n disabled={isButtonDisabled}\r\n aria-disabled={isButtonDisabled}\r\n onClick={handleButtonClick}\r\n />\r\n </div>\r\n\r\n {/* Expanded View - Toggleable Content */}\r\n {internalExpanded && (\r\n <div className={styles.expandedView}>\r\n <hr />\r\n\r\n <div className={styles.productsList}>\r\n {content?.title && <h6 className={styles.pricingOverview}>{content?.title}</h6>}\r\n {cartData?.map((product:any, index:Number) => {\r\n const contractDuration =product?.itemType === 'MOBILEPOSTPAID_RATEPLAN' ? getContractDuration(product?.contractDuration || product?.contractTerm) : '';\r\n const flexUpgradePrice = Number(product?.flexUpgradePrice);\r\n const hasFlexUpgrade = flexUpgradePrice > 0;\r\n const flexUpgradeLabel = content?.flexUpgradeLabel;\r\n const flexUpgradePriceLabel = hasFlexUpgrade ? countZero(product.flexUpgradePrice) : '';\r\n\r\n // Parent row must show device-only price (Flex Upgrade is rendered as its own sub-row).\r\n // Falls back to the original value when the deduction is missing, NaN, or negative.\r\n const withFlexDeducted = (raw: any): string => {\r\n if (!hasFlexUpgrade || raw == null || raw === '') return countZero(raw);\r\n const adjusted = parseFloat(raw) - flexUpgradePrice;\r\n return Number.isFinite(adjusted) && adjusted >= 0\r\n ? countZero(adjusted.toFixed(2))\r\n : countZero(raw);\r\n };\r\n const displayDiscounted = withFlexDeducted(product?.itemDiscountedPrice);\r\n const displayDerived = withFlexDeducted(product?.itemDerivedPrice);\r\n\r\n return (\r\n <React.Fragment key={product.productName || String(index)}>\r\n <div className={styles.productItem}>\r\n <div className={styles.productItemInfo}>\r\n {product?.itemName && (\r\n <div className={styles.productItemName}>{product?.itemName}</div>\r\n )}\r\n {product?.itemType === 'HOME_SECURITY' && (\r\n <div className={styles.hardwarePayment}>\r\n {content?.hsDevicesLabel && <span>{content?.hsDevicesLabel}</span>}{' '}\r\n {product?.accessoryCount > 0 &&\r\n content?.hsAdditionalAccLabel &&\r\n replacePlaceholder(content?.hsAdditionalAccLabel, [\r\n product?.accessoryCount\r\n ])}\r\n </div>\r\n )}\r\n </div>\r\n <div className={styles.productItemPriceWrapper}>\r\n {product?.itemOneTimePrice > 0 ? \r\n <div className={styles.productItemPrice}>\r\n <div className={styles.derivedPrice}>\r\n {countZero(product?.itemOneTimePrice)}\r\n <span>/-</span>\r\n </div>\r\n </div> : product?.itemDerivedPrice ? (\r\n <div className={styles.productItemPrice}>\r\n <div\r\n className={styles.derivedPrice}\r\n aria-label={`Price: ${displayDerived} per month`}\r\n >\r\n {displayDerived}\r\n <span>{content?.monthlyText}</span>\r\n </div>\r\n <span className={styles.recurringPrice}>{displayDiscounted}</span>\r\n </div>\r\n ) : (\r\n <div className={styles.productItemPrice}>\r\n <div\r\n className={styles.derivedPrice}\r\n aria-label={`Price: ${displayDiscounted} per month`}\r\n >\r\n {displayDiscounted}\r\n <span>{content?.monthlyText}</span>\r\n </div>\r\n </div>\r\n )}\r\n {contractDuration && (\r\n <div className={styles.productItemDuration}>{contractDuration}</div>\r\n )}\r\n </div>\r\n </div>\r\n {hasFlexUpgrade && (\r\n <div className={styles.productItem}>\r\n <div className={styles.productItemInfo}>\r\n <div className={styles.productItemName}>{flexUpgradeLabel}</div>\r\n </div>\r\n <div className={styles.productItemPriceWrapper}>\r\n <div className={styles.productItemPrice}>\r\n <div\r\n className={styles.derivedPrice}\r\n aria-label={`${flexUpgradeLabel}: ${flexUpgradePriceLabel} per month`}\r\n >\r\n {flexUpgradePriceLabel}\r\n <span>{content?.monthlyText}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n </React.Fragment>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n )}\r\n </Container>\r\n </div>\r\n );\r\n};\r\n\r\nexport default PriceCalculationSticky;\r\n"],"names":["PriceCalculationSticky","totalOnetimeAmount","totalRecurring","onContinue","cartData","content","flow","internalExpanded","setInternalExpanded","useState","stickyContainerRef","useRef","isButtonDisabled","isExpanded","handleButtonClick","useCallback","e","stopPropagation","handleCollapse","useEffect","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","productsNamesList","_a","map","item","itemName","join","hasAnyFlexUpgrade","_b","some","Number","flexUpgradePrice","React","createElement","className","styles","stickyContainer","ref","Container","collapsedView","onClick","priceInfo","priceWrapper","price","countZero","period","monthlyText","totalSection","oneTime","recurringText","productName","flexUpgradeDescription","flexUpgradeNote","FalconButtonV2","continueBtn","_c","eventAction","metadata","disabled","expandedView","productsList","title","pricingOverview","product","index","contractDuration","itemType","replacePlaceholder","noMinContractDuration","getContractDuration","contractTerm","hasFlexUpgrade","flexUpgradeLabel","flexUpgradePriceLabel","withFlexDeducted","raw","adjusted","parseFloat","isFinite","toFixed","displayDiscounted","itemDiscountedPrice","displayDerived","itemDerivedPrice","Fragment","key","String","productItem","productItemInfo","productItemName","hardwarePayment","hsDevicesLabel","accessoryCount","hsAdditionalAccLabel","productItemPriceWrapper","itemOneTimePrice","productItemPrice","derivedPrice","recurringPrice","productItemDuration"],"mappings":"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"}
1
+ {"version":3,"file":"PriceCalculationSticky.js","sources":["../../../../src/components/PriceCalculationSticky/PriceCalculationSticky.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from 'react';\r\nimport { PriceCalculationStickyProps } from './PriceCalculationSticky.types';\r\nimport styles from './PriceCalculationSticky.module.scss';\r\nimport { Container } from 'react-bootstrap';\r\nimport FalconButtonV2 from '../FalconButtonV2/FalconButtonV2';\r\nimport { countZero, replacePlaceholder} from '../../utils/utils';\r\n\r\nconst PriceCalculationSticky: React.FC<PriceCalculationStickyProps> = ({\r\n totalOnetimeAmount = 0,\r\n totalRecurring=0,\r\n onContinue,\r\n cartData,\r\n content,\r\n flow\r\n}) => {\r\n const [internalExpanded, setInternalExpanded] = useState(false);\r\n const stickyContainerRef = useRef<HTMLDivElement>(null);\r\n // Use controlled state if provided, otherwise use internal state\r\n const isButtonDisabled = flow ? true : false;\r\n const isExpanded =internalExpanded;\r\n // Memoized handlers\r\n const handleButtonClick = useCallback(\r\n (e: React.MouseEvent) => {\r\n e.stopPropagation(); // Prevent toggle when clicking the button\r\n onContinue?.();\r\n },\r\n [onContinue]\r\n );\r\n\r\n const handleCollapse = useCallback(() => {\r\n setInternalExpanded(false);\r\n }, []);\r\n\r\n // Handle click outside to collapse\r\n useEffect(() => {\r\n if (!internalExpanded) return;\r\n\r\n const handleClickOutside = (event: MouseEvent) => {\r\n if (\r\n stickyContainerRef.current &&\r\n !stickyContainerRef.current.contains(event.target as Node)\r\n ) {\r\n setInternalExpanded(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', handleClickOutside);\r\n return () => document.removeEventListener('mousedown', handleClickOutside);\r\n }, [isExpanded, handleCollapse]);\r\n\r\n const getContractDuration = (contractDuration:string) => {\r\n return contractDuration && contractDuration !== '0' ? replacePlaceholder(content?.contractDuration, [contractDuration]) : content?.noMinContractDuration;\r\n };\r\n\r\n const productsNamesList = cartData?.map(\r\n (item:any) =>\r\n item?.itemName || ''\r\n )?.join(', ');\r\n const hasAnyFlexUpgrade = !!cartData?.some?.((item: any) => Number(item?.flexUpgradePrice) > 0);\r\n return (\r\n <div className={styles.stickyContainer} ref={stickyContainerRef}>\r\n {/* Collapsed View - Always Visible */}\r\n <Container>\r\n <div\r\n className={styles.collapsedView}\r\n onClick={() => setInternalExpanded(!internalExpanded)}\r\n >\r\n <div className={styles.priceInfo}>\r\n <div className={styles.priceWrapper}>\r\n {/* commented */}\r\n {/* {totalRecurring !== 0 && ( */}\r\n <div className={styles.price}>\r\n {countZero(totalRecurring)}\r\n <span className={styles.period}>{content?.monthlyText}</span>\r\n </div>\r\n \r\n {/* )} */}\r\n {totalOnetimeAmount !== 0 && (\r\n <div className={styles.totalSection}><div>{content?.oneTime || ''}&nbsp; \r\n </div>\r\n <div className={styles.price}>\r\n {content?.recurringText} {countZero(totalOnetimeAmount)}\r\n </div></div>\r\n )}\r\n </div>\r\n {/* {productsName && <div className={styles.productName}>{productsName}</div>} */}\r\n {productsNamesList && <div className={styles.productName}>{productsNamesList}</div>}\r\n {hasAnyFlexUpgrade && content?.flexUpgradeDescription && (\r\n <div className={styles.flexUpgradeNote}>\r\n {content?.flexUpgradeDescription}\r\n </div>\r\n )}\r\n </div>\r\n <FalconButtonV2\r\n content={content?.continueBtn?.[0]}\r\n eventAction='text'\r\n metadata={{}}\r\n disabled={isButtonDisabled}\r\n aria-disabled={isButtonDisabled}\r\n onClick={handleButtonClick}\r\n />\r\n </div>\r\n\r\n {/* Expanded View - Toggleable Content */}\r\n {internalExpanded && (\r\n <div className={styles.expandedView}>\r\n <hr />\r\n\r\n <div className={styles.productsList}>\r\n {content?.title && <h6 className={styles.pricingOverview}>{content?.title}</h6>}\r\n {cartData?.map((product:any, index:Number) => {\r\n const contractDuration =product?.itemType === 'MOBILEPOSTPAID_RATEPLAN' ? getContractDuration(product?.contractDuration || product?.contractTerm) : '';\r\n const flexUpgradePrice = Number(product?.flexUpgradePrice);\r\n const hasFlexUpgrade = flexUpgradePrice > 0;\r\n const flexUpgradeLabel = content?.flexUpgradeLabel;\r\n const flexUpgradePriceLabel = hasFlexUpgrade ? countZero(product.flexUpgradePrice) : '';\r\n\r\n // Parent row must show device-only price (Flex Upgrade is rendered as its own sub-row).\r\n // Falls back to the original value when the deduction is missing, NaN, or negative.\r\n const withFlexDeducted = (raw: any): string => {\r\n if (!hasFlexUpgrade || raw == null || raw === '') return countZero(raw);\r\n const adjusted = parseFloat(raw) - flexUpgradePrice;\r\n return Number.isFinite(adjusted) && adjusted >= 0\r\n ? countZero(adjusted.toFixed(2))\r\n : countZero(raw);\r\n };\r\n const displayDiscounted = withFlexDeducted(product?.itemDiscountedPrice);\r\n const displayDerived = withFlexDeducted(product?.itemDerivedPrice);\r\n\r\n return (\r\n <React.Fragment key={product.productName || String(index)}>\r\n <div className={styles.productItem}>\r\n <div className={styles.productItemInfo}>\r\n {product?.itemName && (\r\n <div className={styles.productItemName}>{product?.itemName}</div>\r\n )}\r\n {product?.itemType === 'HOME_SECURITY' && (\r\n <div className={styles.hardwarePayment}>\r\n {content?.hsDevicesLabel && <span>{content?.hsDevicesLabel}</span>}{' '}\r\n {product?.accessoryCount > 0 &&\r\n content?.hsAdditionalAccLabel &&\r\n replacePlaceholder(content?.hsAdditionalAccLabel, [\r\n product?.accessoryCount\r\n ])}\r\n </div>\r\n )}\r\n </div>\r\n <div className={styles.productItemPriceWrapper}>\r\n {product?.itemOneTimePrice > 0 ? \r\n <div className={styles.productItemPrice}>\r\n <div className={styles.derivedPrice}>\r\n {countZero(product?.itemOneTimePrice)}\r\n <span>/-</span>\r\n </div>\r\n </div> : product?.itemDerivedPrice ? (\r\n <div className={styles.productItemPrice}>\r\n <div\r\n className={styles.derivedPrice}\r\n aria-label={`Price: ${displayDerived} per month`}\r\n >\r\n {displayDerived}\r\n <span>{content?.monthlyText}</span>\r\n </div>\r\n <span className={styles.recurringPrice}>{displayDiscounted}</span>\r\n </div>\r\n ) : (\r\n <div className={styles.productItemPrice}>\r\n <div\r\n className={styles.derivedPrice}\r\n aria-label={`Price: ${displayDiscounted} per month`}\r\n >\r\n {displayDiscounted}\r\n <span>{content?.monthlyText}</span>\r\n </div>\r\n </div>\r\n )}\r\n {contractDuration && (\r\n <div className={styles.productItemDuration}>{contractDuration}</div>\r\n )}\r\n </div>\r\n </div>\r\n {hasFlexUpgrade && (\r\n <div className={styles.productItem}>\r\n <div className={styles.productItemInfo}>\r\n <div className={styles.productItemName}>{flexUpgradeLabel}</div>\r\n </div>\r\n <div className={styles.productItemPriceWrapper}>\r\n <div className={styles.productItemPrice}>\r\n <div\r\n className={styles.derivedPrice}\r\n aria-label={`${flexUpgradeLabel}: ${flexUpgradePriceLabel} per month`}\r\n >\r\n {flexUpgradePriceLabel}\r\n <span>{content?.monthlyText}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n </React.Fragment>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n )}\r\n </Container>\r\n </div>\r\n );\r\n};\r\n\r\nexport default PriceCalculationSticky;\r\n"],"names":["PriceCalculationSticky","totalOnetimeAmount","totalRecurring","onContinue","cartData","content","flow","internalExpanded","setInternalExpanded","useState","stickyContainerRef","useRef","isButtonDisabled","isExpanded","handleButtonClick","useCallback","e","stopPropagation","handleCollapse","useEffect","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","productsNamesList","_a","map","item","itemName","join","hasAnyFlexUpgrade","_b","some","Number","flexUpgradePrice","React","createElement","className","styles","stickyContainer","ref","Container","collapsedView","onClick","priceInfo","priceWrapper","price","countZero","period","monthlyText","totalSection","oneTime","recurringText","productName","flexUpgradeDescription","flexUpgradeNote","FalconButtonV2","continueBtn","_c","eventAction","metadata","disabled","expandedView","productsList","title","pricingOverview","product","index","contractDuration","itemType","replacePlaceholder","noMinContractDuration","getContractDuration","contractTerm","hasFlexUpgrade","flexUpgradeLabel","flexUpgradePriceLabel","withFlexDeducted","raw","adjusted","parseFloat","isFinite","toFixed","displayDiscounted","itemDiscountedPrice","displayDerived","itemDerivedPrice","Fragment","key","String","productItem","productItemInfo","productItemName","hardwarePayment","hsDevicesLabel","accessoryCount","hsAdditionalAccLabel","productItemPriceWrapper","itemOneTimePrice","productItemPrice","derivedPrice","recurringPrice","productItemDuration"],"mappings":"+SAOA,MAAMA,EAAgE,EACpEC,qBAAqB,EACrBC,iBAAe,EACfC,aACAC,WACAC,UACAC,qBAEA,MAAOC,EAAkBC,GAAuBC,GAAS,GACnDC,EAAqBC,EAAuB,MAE5CC,IAAmBN,EACnBO,EAAYN,EAEZO,EAAoBC,EACvBC,IACCA,EAAEC,kBACFd,SAAAA,KAEF,CAACA,IAGGe,EAAiBH,EAAY,KACjCP,GAAoB,IACnB,IAGHW,EAAU,KACR,IAAKZ,EAAkB,OAEvB,MAAMa,EAAsBC,IAExBX,EAAmBY,UAClBZ,EAAmBY,QAAQC,SAASF,EAAMG,SAE3ChB,GAAoB,IAKxB,OADAiB,SAASC,iBAAiB,YAAaN,GAChC,IAAMK,SAASE,oBAAoB,YAAaP,IACtD,CAACP,EAAYK,IAEhB,MAIMU,EAGL,QAHyBC,EAAAzB,aAAQ,EAARA,EAAU0B,IACjCC,IACCA,aAAI,EAAJA,EAAMC,WAAY,WACrB,IAAAH,OAAA,EAAAA,EAAEI,KAAK,MACFC,aAAsBC,EAAA/B,aAAQ,EAARA,EAAUgC,kCAAQL,GAAcM,OAAON,aAAI,EAAJA,EAAMO,kBAAoB,IAC7F,OACEC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOC,gBAAiBC,IAAKlC,GAE3C6B,EAAAC,cAACK,EAAS,KACRN,EAAAC,cAAA,MAAA,CACEC,UAAWC,EAAOI,cAClBC,QAAS,IAAMvC,GAAqBD,IAEpCgC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOM,WACrBT,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOO,cAGtBV,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOQ,OACnBC,EAAUjD,GACXqC,EAAAC,cAAA,OAAA,CAAMC,UAAWC,EAAOU,QAAS/C,aAAO,EAAPA,EAASgD,cAItB,IAAvBpD,GACCsC,uBAAKE,UAAWC,EAAOY,cAAcf,EAAAC,cAAA,MAAA,MAAMnC,aAAO,EAAPA,EAASkD,UAAW,GACzD,KACFhB,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOQ,OACpB7C,aAAO,EAAPA,EAASmD,kBAAgBL,EAAUlD,MAK3C2B,GAAqBW,uBAAKE,UAAWC,EAAOe,aAAc7B,GAC1DM,IAAqB7B,aAAO,EAAPA,EAASqD,yBAC7BnB,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOiB,iBACpBtD,aAAO,EAAPA,EAASqD,yBAIhBnB,EAAAC,cAACoB,EAAc,CACbvD,QAA6B,UAApBA,aAAO,EAAPA,EAASwD,mBAAW,IAAAC,OAAA,EAAAA,EAAG,GAChCC,YAAY,OACZC,SAAU,CAAA,EACVC,SAAUrD,EAAgB,gBACXA,EACfmC,QAASjC,KAKZP,GACCgC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOwB,cACrB3B,EAAAC,cAAA,KAAA,MAEAD,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOyB,eACpB9D,aAAO,EAAPA,EAAS+D,QAAS7B,EAAAC,cAAA,KAAA,CAAIC,UAAWC,EAAO2B,iBAAkBhE,aAAO,EAAPA,EAAS+D,OACnEhE,aAAQ,EAARA,EAAU0B,IAAI,CAACwC,EAAaC,KAC3B,MAAMC,EAAwC,6BAAtBF,aAAO,EAAPA,EAASG,UA7DnB,CAACD,GACpBA,GAAyC,MAArBA,EAA2BE,EAAmBrE,eAAAA,EAASmE,iBAAkB,CAACA,IAAqBnE,aAAO,EAAPA,EAASsE,sBA4D7CC,EAAoBN,eAAAA,EAASE,oBAAoBF,aAAO,EAAPA,EAASO,eAAgB,GAC9IvC,EAAmBD,OAAOiC,aAAO,EAAPA,EAAShC,kBACnCwC,EAAiBxC,EAAmB,EACpCyC,EAAmB1E,aAAO,EAAPA,EAAS0E,iBAC5BC,EAAwBF,EAAiB3B,EAAUmB,EAAQhC,kBAAoB,GAI/E2C,EAAoBC,IACxB,IAAKJ,GAAyB,MAAPI,GAAuB,KAARA,EAAY,OAAO/B,EAAU+B,GACnE,MAAMC,EAAWC,WAAWF,GAAO5C,EACnC,OAAOD,OAAOgD,SAASF,IAAaA,GAAY,EAC5ChC,EAAUgC,EAASG,QAAQ,IAC3BnC,EAAU+B,IAEVK,EAAoBN,EAAiBX,aAAO,EAAPA,EAASkB,qBAC9CC,EAAiBR,EAAiBX,aAAO,EAAPA,EAASoB,kBAEjD,OACEnD,EAAAC,cAACD,EAAMoD,SAAQ,CAACC,IAAKtB,EAAQb,aAAeoC,OAAOtB,IACnDhC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOoD,aACrBvD,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOqD,kBACpBzB,aAAO,EAAPA,EAAStC,WACRO,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOsD,iBAAkB1B,eAAAA,EAAStC,UAE7B,mBAAtBsC,aAAO,EAAPA,EAASG,WACRlC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOuD,kBACpB5F,aAAO,EAAPA,EAAS6F,iBAAkB3D,EAAAC,cAAA,OAAA,KAAOnC,aAAO,EAAPA,EAAS6F,gBAAwB,KACnE5B,aAAO,EAAPA,EAAS6B,gBAAiB,IACzB9F,aAAO,EAAPA,EAAS+F,uBACT1B,EAAmBrE,eAAAA,EAAS+F,qBAAsB,CAChD9B,aAAO,EAAPA,EAAS6B,mBAKnB5D,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAO2D,0BACpB/B,aAAO,EAAPA,EAASgC,kBAAmB,EAC5B/D,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAO6D,kBACpBhE,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAO8D,cACpBrD,EAAUmB,eAAAA,EAASgC,kBACpB/D,EAAAC,cAAA,OAAA,KAAA,SAEK8B,aAAO,EAAPA,EAASoB,kBAClBnD,uBAAKE,UAAWC,EAAO6D,kBACrBhE,EAAAC,cAAA,MAAA,CACEC,UAAWC,EAAO8D,aAAY,aAClB,UAAUf,eAErBA,EACDlD,EAAAC,cAAA,OAAA,KAAOnC,aAAO,EAAPA,EAASgD,cAElBd,EAAAC,cAAA,OAAA,CAAMC,UAAWC,EAAO+D,gBAAiBlB,IAG3ChD,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAO6D,kBACrBhE,EAAAC,cAAA,MAAA,CACEC,UAAWC,EAAO8D,aAAY,aAClB,UAAUjB,eAErBA,EACDhD,EAAAC,cAAA,OAAA,KAAOnC,aAAO,EAAPA,EAASgD,eAIrBmB,GACCjC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOgE,qBAAsBlC,KAIlDM,GACCvC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOoD,aACrBvD,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOqD,iBACrBxD,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAOsD,iBAAkBjB,IAE3CxC,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAO2D,yBACrB9D,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAO6D,kBACrBhE,EAAAC,cAAA,MAAA,CACEC,UAAWC,EAAO8D,0BACN,GAAGzB,MAAqBC,eAEnCA,EACDzC,EAAAC,cAAA,OAAA,KAAOnC,aAAO,EAAPA,EAASgD"}
@@ -0,0 +1,2 @@
1
+ import e,{createContext as r,useContext as o}from"react";const t=r(null),n=({component:r,children:o})=>e.createElement(t.Provider,{value:r},o),c=()=>o(t);export{n as ProductCardBadgeProvider,c as useProductCardBadge};
2
+ //# sourceMappingURL=ProductCardBadgeProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductCardBadgeProvider.js","sources":["../../../../src/components/StaticLineTable/ProductCardBadgeProvider.tsx"],"sourcesContent":["import React, { createContext, useContext } from 'react';\nimport type { ComponentType, ReactNode } from 'react';\n\nexport interface ProductCardBadgeProps {\n badges?: any[];\n}\n\ninterface ProductCardBadgeProviderProps {\n component: ComponentType<ProductCardBadgeProps>;\n children: ReactNode;\n}\n\nconst ProductCardBadgeContext = createContext<ComponentType<ProductCardBadgeProps> | null>(null);\n\nexport const ProductCardBadgeProvider = ({\n component,\n children\n}: ProductCardBadgeProviderProps) => (\n <ProductCardBadgeContext.Provider value={component}>{children}</ProductCardBadgeContext.Provider>\n);\n\nexport const useProductCardBadge = () => useContext(ProductCardBadgeContext);\n"],"names":["ProductCardBadgeContext","createContext","ProductCardBadgeProvider","component","children","React","createElement","Provider","value","useProductCardBadge","useContext"],"mappings":"yDAYA,MAAMA,EAA0BC,EAA2D,MAE9EC,EAA2B,EACtCC,YACAC,cAEAC,EAAAC,cAACN,EAAwBO,SAAQ,CAACC,MAAOL,GAAYC,GAG1CK,EAAsB,IAAMC,EAAWV"}
@@ -1,2 +1,2 @@
1
- import{__awaiter as e}from"../../_virtual/_tslib.js";import o,{useState as l,useRef as n,useContext as t,useEffect as i}from"react";import d from"../Dotloader/Dotloader.js";import{createPortal as a}from"react-dom";import r from"../SkeletonLoader/SkeletonLoader.js";import s from"./StaticLineTable.module.scss.js";import c from"../richtext.js";import v from"./StaticProductEntitlement.js";import u from"./StaticBenefit.js";import m from"./DynamicPriceSection.js";import p from"./CheckoutButton.js";import g from"./StaticProductDetails.js";import{LineTableBasicPropConfig as f,AssetPathPropConfig as h}from"../../services/LineTableBasicPropConfig.js";import b from"js-cookie";import{LoginBasicPropConfig as E}from"../../services/LoginBasicPropConfig.js";import w from"../login/LoginModalV2.js";import{isTimerActive as C,fetchServiceOptions as P,fetchPrice as S,findHeight as y,checkGiftOrCashback as k,getTimeUntilNextTimerEvent as T,staticCreateCart as x,combineWithVasOptions as $,combineWithSmartPhone as D}from"./Product.utils.js";import I from"../ProductDetailsV3/GiftConfigV2.js";import L from"../ProductDetailsV3/ChooseGiftV2.js";import{viewport as N,replacePlaceholder as B,getUtcTimestamp as O}from"../../utils/utils.js";import j from"./StaticProductCashback.js";import{trackNewDatalayerEvent as A}from"../../utils/AnalyticsUtils.js";import{CTABUTTONCLICK as U,GAEVENT as V,EXISTINGCUSTOMER as F,LINETABLE as M,DOWNLOADPRODUCT as R}from"../../Analytics/AnalyticsConstants.js";import G from"./TVChannelModal.js";import _ from"../LineCheckV3/LinecheckModal.js";import J from"../BenefitWrapper/BenefitsValidateWrapper.js";import W from"../PretoPost/PreToPostSubsPopup.js";import q from"../LineCheckV3/GenericModal.js";import{fetchSubscriptionData as H,trackPegaEvents as z,validateP2P as K}from"../../services/LineTableService.js";import Q from"./ExsistingSubscriptionModal.js";import{getEcomCartInfo as X}from"../../models/Analytics/items.js";import Y from"../NewLineCheck/CoverageCheckModal.js";import{API_BASE_BASEPOINT as Z}from"../../services/api-constants.js";import{AppContext as ee}from"./StaticLineTableStore/StaticLineTableProvider.js";import oe from"./OttServiceOptions/OttServiceOptionsSmallPopup.js";import le from"./StaticExclusiveBenefit.js";import ne from"../UserLoggedPricesToggle/UserLoggedPricesToggle.js";import te from"../FalconButtonV2/FalconButtonV2.js";import{ONE_ECOMMERCE_INTERNET_SUMMARY as ie}from"../../utils/constants.js";import de from"./StaticLineTabelTimer/StaticLineTabelTimer.js";import{BadgeContainer as ae}from"@sunrise-upc/sales-static-components";import re from"../GenericPopup/GenericPopup.js";const se=({content:se,offeringData:ce,uniqueId:ve,storyContent:ue,metadata:me,tabIndex:pe,cardsLength:ge,indexKey:fe,constants:he,mainContent:be,address:Ee,eligibleBundle:we,linecheckSuccessCallBack:Ce,selectedOption:Pe,fetchOfferData:Se,basicConfigUrl:ye,selectedExistingOption:ke,setLoginSuccess:Te,enableP2P:xe,lineCheckCallBack:$e,loginSuccess:De,setToggleState:Ie,toggleState:Le,noTabs:Ne,deviceFlow:Be,deviceFlowCallBack:Oe,selectedRP:je,continueCart:Ae,lineCheckOnClear:Ue,pegaIntegration:Ve,isProdEnv:Fe,deviceUltimateBundle:Me,toggleContent:Re,pricesToggleState:Ge,isShogunFlow:_e,shogunToken:Je})=>{var We,qe,He,ze,Ke,Qe,Xe,Ye,Ze,eo,oo,lo,no,to,io,ao,ro,so,co,vo,uo,mo,po,go,fo,ho,bo,Eo,wo,Co,Po,So,yo,ko,To,xo,$o,Do,Io,Lo,No,Bo,Oo,jo,Ao,Uo,Vo,Fo,Mo,Ro,Go,_o,Jo,Wo,qo,Ho,zo,Ko,Qo,Xo,Yo,Zo,el,ol,ll,nl,tl,il,dl,al,rl,sl,cl,vl,ul,ml,pl,gl,fl,hl,bl,El,wl,Cl,Pl,Sl;const[yl,kl]=l(!1),[Tl,xl]=l(!1),[$l,Dl]=l({showGift:!1,cashbackAvailable:!1}),[Il,Ll]=l(!0),[Nl,Bl]=l(!1),[Ol,jl]=l([]),[Al,Ul]=l(!1),[Vl,Fl]=l(!1),[Ml,Rl]=l(!1),[Gl,_l]=l(!1),[Jl,Wl]=l(!1),[ql,Hl]=l(!1),zl=`${ye}inf/customer-management/subscriptions`,Kl=`${ye}inf/resource-management/msisdns/pretopost/validation`,[Ql,Xl]=l([]),[Yl,Zl]=l(!1),[en,on]=l(!1),[ln,nn]=l(!1),[tn,dn]=l([]),[an,rn]=l(!1),[sn,cn]=l(!1),[vn,un]=l(!1),[mn,pn]=l(!1),[gn,fn]=l([]),[hn,bn]=l(0),[En,wn]=l(!1),Cn=n(null),[Pn,Sn]=l(null),yn=n(!1),kn=n(null),Tn=`${ye}inf/${Z.CUSTOMER}`,xn=void 0!==typeof window&&document.getElementById("static-linetable"),$n=0===(null===(We=Object.keys(se))||void 0===We?void 0:We.length),Dn=null===(Qe=null===(Ke=null===(ze=null===(He=null===(qe=null==se?void 0:se.products)||void 0===qe?void 0:qe[0])||void 0===He?void 0:He.reference)||void 0===ze?void 0:ze.content)||void 0===Ke?void 0:Ke.product)||void 0===Qe?void 0:Qe[0],In=null===(oo=null===(eo=null===(Ze=null===(Ye=null===(Xe=null==se?void 0:se.promotion)||void 0===Xe?void 0:Xe[0])||void 0===Ye?void 0:Ye.reference)||void 0===Ze?void 0:Ze.content)||void 0===eo?void 0:eo.promoDescription)||void 0===oo?void 0:oo[0],Ln=null===(lo=null==se?void 0:se.timer)||void 0===lo?void 0:lo[0],Nn=null==Ln?void 0:Ln.enableCounter,[Bn,On]=l(!!(Nn&&(null==Ln?void 0:Ln.startTime)&&(null==Ln?void 0:Ln.endTime))&&C(Ln.startTime,Ln.endTime)),jn=Boolean((null==se?void 0:se.highlightText)&&!0!==Ge&&!Bn&&!(null==se?void 0:se.badgesContainer)),An=Boolean((null==In?void 0:In.displayText)&&!(null==se?void 0:se.notShowPromotionLabel)&&!0!==Ge&&!Bn),Un=Boolean((null==se?void 0:se.badgesContainer)&&!0!==Ge&&!Bn&&!An),Vn=null==Dn?void 0:Dn.productId,Fn=null===(no=null==f?void 0:f.getInstance())||void 0===no?void 0:no.getCartUrl(),Mn=null===(to=null==h?void 0:h.getInstance())||void 0===to?void 0:to.getAssetPath(),Rn="MOBILE"===(null==ue?void 0:ue.pageType),Gn=N(),_n=t(ee);let Jn;Jn=Ee&&(null===(io=null==we?void 0:we.eligibleBundle)||void 0===io?void 0:io.includes(Vn));const Wn=null==se?void 0:se.enableTVStreamingOptionsPopUp,qn=null==se?void 0:se.enableTVStreamingOptionsStepper,Hn=null==se?void 0:se.disableDiscountedPriceToggle,zn=null==se?void 0:se.skipAccessoriesPage;E.create({baseURL:null!=ye?ye:""});let Kn=void 0!==typeof window&&b.get("sunriseAuth");Kn=Kn&&JSON.parse(Kn);const Qn=((null==ce?void 0:ce[ve])||[]).filter(e=>(null==e?void 0:e.id)===Vn),Xn=e=>{dn(e)},Yn=()=>{Ul(!0),_l(!Gl),on(!en)},Zn=()=>{var e,o,l;if(xl(!1),xe&&null==Kn)_l(!Gl),on(!en);else if(xe&&(null==Kn?void 0:Kn.siteId))it();else if(Pe===F&&(null==ke?void 0:ke.length)>0)Wl(!0);else{!!((null==be?void 0:be.enableExistingCustomer)&&null==Kn||!Kn&&!0===Ge&&(null==Re?void 0:Re.enableLoggedInPrice))?Ul(!0):ut()}if(Ve){const n=localStorage.getItem("prospectId"),t=null!==(l=null===(o=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname)||void 0===o?void 0:o.split("/"))&&void 0!==l?l:[],i=t[t.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"CartCreated",pageLocation:i,targetProduct:Vn};n&&z(Tn,d,n)}},et=e=>{const o=Ol.findIndex(o=>(null==e?void 0:e.giftGroupId)===(null==o?void 0:o.giftGroupId)),l=Ol;-1===o?l.push(e):l[o]=e,jl([...l])},ot=new URLSearchParams(null===(ao=null===window||void 0===window?void 0:window.location)||void 0===ao?void 0:ao.search),lt=null==ot?void 0:ot.get("selectedMsisdn"),nt=e=>{var o;1===(null==e?void 0:e.length)?(Nl?D(pt,ue,Qn,null==e?void 0:e[0],se,Ve):ut(null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.msisdn),Hl(!1)):(null==e?void 0:e.length)>1?(Xl(e),nn(!ln),Hl(!1)):(on(!en),Hl(!0),Ll(!0),kl(!1))},tt=(o,l)=>e(void 0,void 0,void 0,function*(){yield K(null==o?void 0:o.msisdn,Kl).then(e=>{e&&l.push(o)}).catch(e=>{console.log("error",e)})}),it=()=>{var o;kl(!0);try{null===(o=H("PREPAID",zl))||void 0===o||o.then(o=>e(void 0,void 0,void 0,function*(){if(204==(null==o?void 0:o.subscriptionData))on(!en),Hl(!0),Ll(!0),kl(!1);else{const l=null==o?void 0:o.subscriptionData,n=l.find(e=>e.msisdn===lt);if(l){const o=[];lt?(yield tt(n,o),nt(o)):yield Promise.all(null==l?void 0:l.map(l=>e(void 0,void 0,void 0,function*(){yield tt(l,o)}))).then(e=>{nt(o)})}}})).catch(e=>{console.log("error---\x3e",e),kl(!1)})}catch(e){console.log("error---\x3e",e),kl(!1)}Zl(!0)},dt=()=>{on(!Il),_l(!1)},at=e=>{rn(!1),e&&A(V,U,{headline:"VAS POPUP CLOSE"})},rt=()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");we=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),Ee="undefined"!=typeof window&&b.get("chAddressJson"),Rl(!Ml),"function"==typeof Ce&&Ce(),ut()},st=P(null==Dn?void 0:Dn.bloks,Rn),ct=null===(ro=null==st?void 0:st[0])||void 0===ro?void 0:ro.tvProductId,vt=e=>{var o,l,n,t,i,d,a,r,s,c;const v=Ve&&(null===(n=null===(l=null===(o=null==Qn?void 0:Qn[0])||void 0===o?void 0:o.promotionInfo)||void 0===l?void 0:l[0])||void 0===n?void 0:n.id),u=Ve&&(null===(d=null===(i=null===(t=null==Qn?void 0:Qn[0])||void 0===t?void 0:t.promotionInfo)||void 0===i?void 0:i[0])||void 0===d?void 0:d.version),m=_e?{pointsBurnt:null===(r=null===(a=null==Qn?void 0:Qn[0])||void 0===a?void 0:a.rewards)||void 0===r?void 0:r.points,rewardOfferId:null===(c=null===(s=null==Qn?void 0:Qn[0])||void 0===s?void 0:s.rewards)||void 0===c?void 0:c.offerId,gloxTokenId:Je}:void 0;Qn&&Qn[0]&&(Qn[0].fromPopup=mn),ht("false"),sessionStorage.removeItem("vasPopUp"),cn(!1),x(kl,Fn,Ol,Qn,be,pt,Rn,ct,we,Ee,Rl,Ml,$e,xe,null!=lt?lt:e,se,tn,v,u,m)},ut=e=>{var o,l,n,t,i,d,a,r,s;pn(!1),xl(!1);let c=void 0!==typeof window&&b.get("sunriseAuth");const v=c&&JSON.parse(c),u=!(!(null==be?void 0:be.enableExistingCustomer)||null!=v);if(sessionStorage.removeItem(ie),(null===(o=null==be?void 0:be.linecheckData)||void 0===o?void 0:o.length)>0&&!Rn&&!Jn){return void(document.getElementById("linecheck")&&$e())}if(Jn&&!Rn&&(null===(l=null==be?void 0:be.loginData)||void 0===l?void 0:l.length)>0&&u)Ul(!0);else if(qn&&(null===(n=Qn[0])||void 0===n?void 0:n.isBundle)){let o=!1;zn||((null===(t=Qn[0])||void 0===t?void 0:t.isBundle)?null===(d=null===(i=Qn[0])||void 0===i?void 0:i.bundledOffers)||void 0===d||d.map(e=>{var l,n,t;"internet"!==(null===(l=null==e?void 0:e.productType)||void 0===l?void 0:l.toLowerCase())&&"tv"!=(null===(n=null==e?void 0:e.productType)||void 0===n?void 0:n.toLowerCase())||(null==e?void 0:e.recommendAccessory)&&(o=null==e?void 0:e.recommendAccessory),"mobile"!==(null===(t=null==e?void 0:e.productType)||void 0===t?void 0:t.toLowerCase())||(o=!1)}):(null===(a=null==Qn?void 0:Qn[0])||void 0===a?void 0:a.recommendAccessory)&&(o=null===(r=null==Qn?void 0:Qn[0])||void 0===r?void 0:r.recommendAccessory)),$(pt,Qn,se,Ve,null==Dn?void 0:Dn.productName,o),vt(e)}else Wn&&(null===(s=Qn[0])||void 0===s?void 0:s.isBundle)&&!sn?(rn(!0),cn(!0),ht("true"),window.addEventListener("beforeunload",function(e){ht("false"),sessionStorage.removeItem("vasPopUp"),cn(!1)})):(xe&&kl(!0),vt(e))},mt=(e,o)=>l=>{var n;const t=void 0!==typeof window&&b.get("one-commerce-cartId");(null==be?void 0:be.enableReplacePopup)&&t?(Cn.current=()=>e(l),yn.current=Boolean(o),Sn(null!=o?o:null===(n=null==be?void 0:be.generalReplacePopup)||void 0===n?void 0:n[0]),wn(!0)):e(l)},pt=S(Qn,Rn,null==be?void 0:be.pageType,!1,tn,Ve);i(()=>{var e,o;setTimeout(()=>{y(pe,ge)},100);const l=k(Rn?Qn:null!==(o=null===(e=null==Qn?void 0:Qn[0])||void 0===e?void 0:e.bundledOffers)&&void 0!==o?o:Qn);Dl(Object.assign({},l))},[ce,Le,tn,hn,((null==Le?void 0:Le.TV)||(null==Le?void 0:Le.gigaSpeed)||(null==Le?void 0:Le.Netflix))&&Array.isArray(Qn)&&3===(null===(co=null===(so=null==Qn?void 0:Qn[0])||void 0===so?void 0:so.bundledOffers)||void 0===co?void 0:co.length)]);const gt=()=>{((null==st?void 0:st.length)>0||Wn)&&Fl(!0)},ft=null===(vo=null==be?void 0:be.productContainer)||void 0===vo?void 0:vo[0];i(()=>{Nl&&(xe&&null==Kn?(_l(!Gl),on(!en)):xe&&(null==Kn?void 0:Kn.siteId)&&it())},[Nl]),i(()=>{var e;if(_n){const{store:o}=_n;(null===(e=null==o?void 0:o.ottOptionsApi)||void 0===e?void 0:e.length)>0&&0===(null==gn?void 0:gn.length)&&fn(null==o?void 0:o.ottOptionsApi)}},[_n]),i(()=>{if(!Nn||!(null==Ln?void 0:Ln.startTime)||!(null==Ln?void 0:Ln.endTime))return void On(!1);On(C(Ln.startTime,Ln.endTime));const e=T(Ln.startTime,Ln.endTime);if(e<=0)return;const o=setTimeout(()=>{On(C(Ln.startTime,Ln.endTime))},e);return()=>clearTimeout(o)},[Nn,null==Ln?void 0:Ln.startTime,null==Ln?void 0:Ln.endTime]),i(()=>{var e;const o=kn.current;if(!o||!(null===(e=null==se?void 0:se.timer)||void 0===e?void 0:e.length)||!Nn)return void bn(0);const l=()=>{bn(o.clientHeight)};if(l(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(l);return n.observe(o),()=>{n.disconnect()}},[null===(uo=null==se?void 0:se.timer)||void 0===uo?void 0:uo.length,Nn]),i(()=>{vn&&(at(),un(!0),ht("false"),sessionStorage.removeItem("vasPopUp"),cn(!1),vt())},[vn]),i(()=>{const e=()=>{const e=sessionStorage.getItem("vasPopUp");cn("true"===e)};e();const o=o=>{o.storageArea===sessionStorage&&"vasPopUp"===o.key&&e(),o.storageArea===sessionStorage&&"vasPopUp"===o.key&&null===o.newValue&&cn(!1)},l=()=>{e()};return window.addEventListener("storage",o),window.addEventListener("vasPopUpChange",l),()=>{window.removeEventListener("storage",o),window.removeEventListener("vasPopUpChange",l)}},[]);const ht=e=>{sessionStorage.setItem("vasPopUp",e);const o=new Event("vasPopUpChange");window.dispatchEvent(o)};return o.createElement("div",null,yl&&xn&&a(o.createElement(d,{keyParams:"loading"}),xn),$n&&o.createElement("div",{className:"w-75 pb-2"},o.createElement(r,null)),!$n&&we&&se&&Ee&&!Rn&&o.createElement("div",{className:s.selected},o.createElement("span",{style:{paddingBottom:"10px"}},Jn?o.createElement("span",{className:s.activeicon},o.createElement("img",{src:`${Mn}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:s.activeicon}),o.createElement("span",null,null==he?void 0:he.subscriptionAvalTxt)):o.createElement("span",{className:s.inactiveicon},o.createElement("img",{src:`${Mn}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:s.inactiveicon}),o.createElement("span",null,null==he?void 0:he.notSubscriptionTxt)))),o.createElement("div",{className:`${!Rn&&!1===Jn&&(null===(mo=null==be?void 0:be.linecheckData)||void 0===mo?void 0:mo.length)>0&&"global/coverage-check"!==(null===(fo=null===(go=null===(po=null==be?void 0:be.linecheckData)||void 0===po?void 0:po[0])||void 0===go?void 0:go.reference)||void 0===fo?void 0:fo.default_full_slug)?s.overlay:""}\n ${Me&&!(null===(bo=null===(ho=null==Qn?void 0:Qn[0])||void 0===ho?void 0:ho.eligibility)||void 0===bo?void 0:bo.fpb)?s.disabled:""}\n `,style:{flexDirection:"column"}},o.createElement("div",{className:s.bundleproductcard},o.createElement("div",{id:`timer-section${pe}${fe}`,"data-timer-active":hn>0?"true":"false"},(null===(Eo=null==se?void 0:se.timer)||void 0===Eo?void 0:Eo.length)&&Nn?o.createElement("div",{style:{height:`${hn}px`,transition:"height 0.3s ease"}}):null),o.createElement("div",{className:`${s.productcontainer}`,style:(()=>{const e=An?In:se,o=null==e?void 0:e.showBorder,l=null==e?void 0:e.borderGradient,n=null==e?void 0:e.borderColor;return{borderColor:o&&!l?n||"":"transparent",borderWidth:o?"4px":"0px",borderStyle:o?"solid":"none",borderRadius:o?"8px":"",background:o&&l?`linear-gradient(white, white) padding-box, ${l} border-box`:void 0}})()},Un&&o.createElement(ae,{badges:se.badgesContainer}),jn&&o.createElement("div",{className:`${s.highlightText}`},null==se?void 0:se.highlightText),An&&((null==In?void 0:In.badgeContainer)?o.createElement(ae,{badges:null==In?void 0:In.badgeContainer}):o.createElement("div",{className:`${s.promocontainer}`,style:{background:null==In?void 0:In.bestSellerColor}},null==In?void 0:In.displayText)),o.createElement("div",{ref:kn,className:s.timerContainer},(null===(wo=null==se?void 0:se.timer)||void 0===wo?void 0:wo.length)&&Nn?o.createElement(de,{content:null===(Co=null==se?void 0:se.timer)||void 0===Co?void 0:Co[0],hasHighlightText:Un||An,onTimerChange:e=>{On(e)}}):null),o.createElement("div",{className:`${s.detailsection} ${s.imageFullWidthSection}`,id:`detailsectionv3${pe}${fe}`},o.createElement("div",{className:`${s.headersection}`},o.createElement("div",{className:`${s.titlesection}`},o.createElement("div",{className:`${s.productheader}`,id:`titleV3${pe}${fe}`},null==Dn?void 0:Dn.productName),o.createElement("div",null,(null===(Po=null==Dn?void 0:Dn.icon)||void 0===Po?void 0:Po.filename)&&o.createElement("img",{className:`${s.imagecontainer}`,src:null===(So=null==Dn?void 0:Dn.icon)||void 0===So?void 0:So.filename,height:15,width:20,alt:"productIcon"}))),o.createElement("div",{className:`${s.productdescription}`,id:`descriptionV3${pe}${fe}`},o.createElement(c,{content:null==Dn?void 0:Dn.description})),o.createElement("div",{className:`${s.images}`},(null===(yo=null==Dn?void 0:Dn.img)||void 0===yo?void 0:yo.filename)&&o.createElement("img",{className:`${s.imagespace} ${(null==se?void 0:se.highlightText)&&s.borderimage}`,alt:"cardimg",src:`${null===(ko=null==Dn?void 0:Dn.img)||void 0===ko?void 0:ko.filename}/m/`}))),o.createElement("div",{className:`${s.productconfig}`,id:`product-configv3${pe}${fe}`},$n?o.createElement(o.Fragment,null,o.createElement("div",{className:s.space}),o.createElement(r,{stylename:s.skeletontittle,count:1}),o.createElement(r,{stylename:s.skeletonline,count:5}),o.createElement("div",{className:s.space}),o.createElement(r,{stylename:s.skeletontittle,count:1}),o.createElement(r,{stylename:s.skeletonline,count:5})):o.createElement("div",null,(null==Dn?void 0:Dn.bloks)&&(null===(To=null==Dn?void 0:Dn.bloks)||void 0===To?void 0:To.map((e,l)=>o.createElement(v,{content:e,indexKey:l,constants:he,key:l,showModalPopup:gt,setToggleState:Ie,toggleState:Le,noTabs:Ne,mainContent:be,enableTVStreamingOptions:null==se?void 0:se.enableTVStreamingOptions,metadata:me,setTvOptionsData:Xn})))))),o.createElement("div",{className:`${s.detailsection}`,id:`benefits-price-section${pe}${fe}`},o.createElement("div",{id:`exclusive-benefits-section${pe}${fe}`},(null===(xo=null==Dn?void 0:Dn.extraBenefits)||void 0===xo?void 0:xo.length)>0&&o.createElement(le,{content:null===($o=null==Dn?void 0:Dn.extraBenefits)||void 0===$o?void 0:$o[0]})),o.createElement("div",{className:`${s.benefitssection}`,id:`benefits-section${pe}${fe}`},(null===(Do=null==Dn?void 0:Dn.benefits)||void 0===Do?void 0:Do.length)>0&&o.createElement(u,{content:null==Dn?void 0:Dn.benefits,benefitData:pt,constants:he,pricesToggleState:Ge,togglePriceLabel:null==Re?void 0:Re.togglePriceLabel})),o.createElement("br",null),o.createElement("div",{className:`${s.giftsection}`,id:`gift-section${pe}${fe}`},(null==$l?void 0:$l.showGift)&&(null===(Io=null==In?void 0:In.singleGift)||void 0===Io?void 0:Io.map((e,l)=>o.createElement(I,{content:e,key:l}))),(null==$l?void 0:$l.showGift)&&(null===(Lo=null==In?void 0:In.giftConfig)||void 0===Lo?void 0:Lo.map((e,l)=>o.createElement(L,{content:e,key:l,selectedGiftItem:et,parentPoType:Rn?"MOBILE":"HOME"}))),o.createElement("div",{className:`${s.giftsection}`,id:`cashback-section${pe}${fe}`},o.createElement(j,{uniqueProductData:Qn,mainContent:be}))),o.createElement("div",{className:`${s.ordersection}`,id:`order-section${pe}${fe}`},""===(null==pt?void 0:pt.base)?o.createElement("div",null,o.createElement(r,{stylename:s.skeletontittle})):o.createElement("div",{id:`price-section${pe}${fe}`},o.createElement(m,{priceCollection:pt,constants:he,promoText:null==Dn?void 0:Dn.promoText,deviceFlow:Be,content:se,offeringData:ce,uniqueId:ve})),!_e&&o.createElement("div",{className:`${s.discountedpricetoggleSection}`,id:`discountedpricetoggle-section${pe}${fe}`},Hn||"INLINE"!==(null==Re?void 0:Re.togglePosition)?null:o.createElement(ne,{content:Dn,index:fe,lineTable:!0,toggleContent:Re})),xe&&(null==he?void 0:he.P2PDiscountLabel)&&o.createElement("div",{className:s.longterm},null==he?void 0:he.P2PDiscountLabel),$n?o.createElement(o.Fragment,null,o.createElement(r,{stylename:s.skeletontittle,count:1}),o.createElement(r,{stylename:s.skeletonline,count:2})):o.createElement("div",{className:`${(null==ue?void 0:ue.swapButton)&&s.swapButton}`},o.createElement("div",{style:{padding:"16px 0 0 0"}},o.createElement(p,{isMobileFlow:Rn,createCartCall:(null==Be?void 0:Be.isDeviceFlow)?mt(e=>{xl(!1);Oe({setShowLoader:kl,cartEndPoint:Fn,giftItem:Ol,uniqueProductData:Qn,mainContent:be,showPrice:pt,isMobileFlow:Rn,eligibleBundle:we,address:Ee,setShowLinecheck:Rl,showLinecheck:Ml,lineCheckCallBack:$e,enableP2P:xe,msisdnn:null!=lt?lt:e,content:se,selectedRP:je,continueCart:Ae})}):mt(Rn?Zn:ut),constants:he,storyContent:ue,showPrice:pt,isAvailable:Jn,address:Ee,uniqueProductBenefits:null==Qn?void 0:Qn[0],alwaysActive:!Jn&&(null===(No=null==be?void 0:be.linecheckData)||void 0===No?void 0:No.length)>0&&"global/coverage-check"===(null===(jo=null===(Oo=null===(Bo=null==be?void 0:be.linecheckData)||void 0===Bo?void 0:Bo[0])||void 0===Oo?void 0:Oo.reference)||void 0===jo?void 0:jo.default_full_slug),flexUpgradeFreePopup:null===(Uo=null===(Ao=null==be?void 0:be.flexUpgradeFreePopup)||void 0===Ao?void 0:Ao.reference)||void 0===Uo?void 0:Uo.content,content:se,deviceUltimateBundle:Me,forceDisabled:Boolean(null===(Fo=null===(Vo=null==Qn?void 0:Qn[0])||void 0===Vo?void 0:Vo.rewards)||void 0===Fo?void 0:Fo.notEligibleReason),notEligibileReason:null===(Ro=null===(Mo=null==Qn?void 0:Qn[0])||void 0===Mo?void 0:Mo.rewards)||void 0===Ro?void 0:Ro.notEligibleReason})),!_e&&(null===(Go=null==ue?void 0:ue.addSmartPhone)||void 0===Go?void 0:Go.length)>0&&!(null==Be?void 0:Be.isDeviceFlow)&&o.createElement("div",{style:{textAlign:"center"}},(null==ue?void 0:ue.swapButton)?(null==ue?void 0:ue.ctaLabel)&&o.createElement("div",{style:{padding:"16px 0"}},o.createElement("button",{className:"primarybutton",onClick:()=>{var e;return mt(()=>D(pt,ue,Qn,"",se,Ve),null===(e=null==be?void 0:be.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}},o.createElement("span",{className:s.buttontext},null==ue?void 0:ue.ctaLabel))):!(null==se?void 0:se.redirectOnly)&&o.createElement("div",{style:{padding:"12px 0 0 0"}},o.createElement(te,{content:{buttonType:"Secondary-V1",buttonLabel:(null==se?void 0:se.ultimateBundlePromotion)?null==he?void 0:he.ultimateBundleLbl:null===(Jo=null===(_o=null==ue?void 0:ue.addSmartPhone)||void 0===_o?void 0:_o[0])||void 0===Jo?void 0:Jo.buttonLabel,buttonIcon:null===(qo=null===(Wo=null==ue?void 0:ue.addSmartPhone)||void 0===Wo?void 0:Wo[0])||void 0===qo?void 0:qo.buttonIcon,buttonAlignment:"left"},wafIdentifier:ye,style:{width:"100%"},onClick:()=>{var e;return mt(()=>xe?void Bl(!0):D(pt,ue,Qn,"",se,Ve),null===(e=null==be?void 0:be.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}}))),o.createElement("div",{className:s.productcontractduration,id:`contract-section${pe}${fe}`,style:{paddingTop:(null===(Ho=null==ue?void 0:ue.addSmartPhone)||void 0===Ho?void 0:Ho.length)>0&&!(null==Be?void 0:Be.isDeviceFlow)&&!(null==ue?void 0:ue.swapButton)&&!(null==se?void 0:se.redirectOnly)?"8px":void 0}},(null==pt?void 0:pt.contractDuration)>"1"?B(null===(zo=null==he?void 0:he.minContractDuration)||void 0===zo?void 0:zo.substring(1),[null==pt?void 0:pt.contractDuration]):null==he?void 0:he.noContractDuration)),o.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(Ko=null==Dn?void 0:Dn.productDetails)||void 0===Ko?void 0:Ko.length)>0&&o.createElement("span",{className:s.productdetailslink,onClick:()=>{var e,o,l;xl(!Tl),A(V,R,X(Qn,"",M));const n=localStorage.getItem("prospectId"),t=null!==(l=null===(o=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname)||void 0===o?void 0:o.split("/"))&&void 0!==l?l:[],i=t[t.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"ProductDetails",pageLocation:i,targetProduct:Vn};n&&z(Tn,d,n)}},null==he?void 0:he.productDetailsLink)),Tl&&o.createElement(g,{content:null==Dn?void 0:Dn.productDetails,showProductDetail:Tl,setShowProductDetail:xl,constants:he,showPrice:pt,isMobileFlow:Rn,createCartCall:Rn?Zn:ut,storyContent:ue,isAvailable:Jn,address:Ee,flexUpgradeFreePopup:null===(Xo=null===(Qo=null==be?void 0:be.flexUpgradeFreePopup)||void 0===Qo?void 0:Qo.reference)||void 0===Xo?void 0:Xo.content,notEligibileReason:null===(Zo=null===(Yo=null==Qn?void 0:Qn[0])||void 0===Yo?void 0:Yo.rewards)||void 0===Zo?void 0:Zo.notEligibleReason})))))),Me&&Qn&&!(null===(ol=null===(el=null==Qn?void 0:Qn[0])||void 0===el?void 0:el.eligibility)||void 0===ol?void 0:ol.fpb)&&o.createElement("div",{className:s.disabledInfo},o.createElement(c,{content:null==he?void 0:he.fpbNotCompatibleText})),Vl&&($n?o.createElement(r,null):o.createElement(G,{content:null==st?void 0:st[0],setShowModal:Fl,showModal:Vl,constants:he})),Al&&(null===(ll=null==be?void 0:be.loginData)||void 0===ll?void 0:ll.length)>0&&xn&&a(o.createElement(w,{content:null===(nl=null==be?void 0:be.loginData)||void 0===nl?void 0:nl[0],closeLogin:()=>{Ul(!1)},metadata:me,onSuccess:()=>{Ul(!1),Te(),sessionStorage.removeItem("vasPopUp"),cn(!1),xe?it():ut()},isProdEnv:Fe}),xn),Gl&&xe&&!Al&&en&&o.createElement(q,{modalState:Il,handler:dt,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(W,{onClose:Yn,content:null===(dl=null===(il=null===(tl=null==be?void 0:be.productContainer)||void 0===tl?void 0:tl[0])||void 0===il?void 0:il.p2pBloks)||void 0===dl?void 0:dl[0],prepaid:!1})),xe&&Yl&&ql&&en&&o.createElement(q,{modalState:Il,handler:dt,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px",id:"table-product"},o.createElement(W,{onClose:Yn,content:null===(sl=null===(rl=null===(al=null==be?void 0:be.productContainer)||void 0===al?void 0:al[0])||void 0===rl?void 0:rl.p2pBloks)||void 0===sl?void 0:sl[1],prepaid:!0})),(null==Ql?void 0:Ql.length)>1&&xe&&Yl&&!ql&&ln&&o.createElement(q,{modalState:ln,handler:()=>{kl(!1),nn(!ln)},showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(Q,{onSubmit:e=>{nn(!ln),Nl?D(pt,ue,Qn,e,se,Ve):ut(null==e?void 0:e.msisdn)},exsistingSubscriptionData:Ql,updatedContent:ft})),Ml&&(null==be?void 0:be.enableLinecheckOverlay)&&!Rn&&(null===(cl=null==be?void 0:be.linecheckData)||void 0===cl?void 0:cl.length)>0&&!xe&&"global/new-linecheck-test"===(null===(ml=null===(ul=null===(vl=null==be?void 0:be.linecheckData)||void 0===vl?void 0:vl[0])||void 0===ul?void 0:ul.reference)||void 0===ml?void 0:ml.default_full_slug)?o.createElement(_,{content:null===(pl=null==be?void 0:be.linecheckData)||void 0===pl?void 0:pl[0],onSuccess:rt,showModal:Ml,setShowModal:Rl,productName:null==Dn?void 0:Dn.productName,productId:null==Dn?void 0:Dn.productId}):Ml&&(null==be?void 0:be.enableLinecheckOverlay)&&!Rn&&(null===(gl=null==be?void 0:be.linecheckData)||void 0===gl?void 0:gl.length)>0&&!xe&&"global/coverage-check"===(null===(bl=null===(hl=null===(fl=null==be?void 0:be.linecheckData)||void 0===fl?void 0:fl[0])||void 0===hl?void 0:hl.reference)||void 0===bl?void 0:bl.default_full_slug)?o.createElement(Y,{content:null===(El=null==be?void 0:be.linecheckData)||void 0===El?void 0:El[0].reference.content.body[0],overlayIsOpen:!0,externalHandleModal:Rl,productName:null==Dn?void 0:Dn.productName,showModal:Ml,setShowModal:Rl,onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");we=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),Ee="undefined"!=typeof window&&b.get("chAddressJson"),"function"==typeof Ce&&Ce()},onCreateCart:rt,lineCheckOnClear:Ue,productId:null==Dn?void 0:Dn.productId}):null,Jl&&Rn&&(null===(wl=null==ue?void 0:ue.benefitsValidate)||void 0===wl?void 0:wl.length)>0&&o.createElement(J,{content:null===(Cl=null==ue?void 0:ue.benefitsValidate)||void 0===Cl?void 0:Cl[0],loginContent:null===(Pl=null==be?void 0:be.loginData)||void 0===Pl?void 0:Pl[0],metadata:me,createCartCall:ut,fetchOfferData:Se,basicConfigUrl:ye,selectedExistingOption:ke,setShowBenefit:Wl,setLoginSuccess:Te,isProdEnv:Fe}),an&&o.createElement(q,{modalState:an,handler:at,showFooter:!1,width:"mobile"===Gn?"":"tablet"===Gn?"700px":"990px",fixedWidth:"mobile"===Gn?"":"tablet"===Gn?"700px":"990px",height:"845px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"24px"},o.createElement(oe,{content:null===(Sl=null==be?void 0:be.optionsPopup)||void 0===Sl?void 0:Sl[0],addOptionsCallBack:e=>{pn(!0),un(!0),Xn(e)},metadata:me,constants:he,mainContent:be,preSelectedOptions:[],optionsResponse:gn,updateResponseList:fn,showPrice:pt,productData:Dn,offeringData:ce,uniqueId:ve,deviceFlow:Be})),En&&Pn&&o.createElement(re,{modalState:En,onCloseHandler:()=>{Cn.current=null,wn(!1)},content:Pn,wafIdentifier:ye,onPrimaryClick:()=>{const e=Cn.current;Cn.current=null,yn.current&&b.remove("one-commerce-cartId"),yn.current=!1,wn(!1),null==e||e()},onSecondaryClick:()=>{Cn.current=null,wn(!1)}}))};export{se as default};
1
+ import{__awaiter as e}from"../../_virtual/_tslib.js";import o,{useState as l,useRef as n,useContext as t,useEffect as i}from"react";import d from"../Dotloader/Dotloader.js";import{createPortal as a}from"react-dom";import r from"../SkeletonLoader/SkeletonLoader.js";import s from"./StaticLineTable.module.scss.js";import c from"../richtext.js";import v from"./StaticProductEntitlement.js";import u from"./StaticBenefit.js";import m from"./DynamicPriceSection.js";import p from"./CheckoutButton.js";import g from"./StaticProductDetails.js";import{LineTableBasicPropConfig as f,AssetPathPropConfig as h}from"../../services/LineTableBasicPropConfig.js";import b from"js-cookie";import{LoginBasicPropConfig as E}from"../../services/LoginBasicPropConfig.js";import w from"../login/LoginModalV2.js";import{isTimerActive as P,fetchServiceOptions as C,fetchPrice as S,findHeight as y,checkGiftOrCashback as k,getTimeUntilNextTimerEvent as T,staticCreateCart as x,combineWithVasOptions as $,combineWithSmartPhone as D}from"./Product.utils.js";import I from"../ProductDetailsV3/GiftConfigV2.js";import L from"../ProductDetailsV3/ChooseGiftV2.js";import{viewport as N,replacePlaceholder as B,getUtcTimestamp as O}from"../../utils/utils.js";import j from"./StaticProductCashback.js";import{trackNewDatalayerEvent as A}from"../../utils/AnalyticsUtils.js";import{CTABUTTONCLICK as U,GAEVENT as V,EXISTINGCUSTOMER as F,LINETABLE as M,DOWNLOADPRODUCT as R}from"../../Analytics/AnalyticsConstants.js";import G from"./TVChannelModal.js";import _ from"../LineCheckV3/LinecheckModal.js";import J from"../BenefitWrapper/BenefitsValidateWrapper.js";import W from"../PretoPost/PreToPostSubsPopup.js";import q from"../LineCheckV3/GenericModal.js";import{fetchSubscriptionData as H,trackPegaEvents as z,validateP2P as K}from"../../services/LineTableService.js";import Q from"./ExsistingSubscriptionModal.js";import{getEcomCartInfo as X}from"../../models/Analytics/items.js";import Y from"../NewLineCheck/CoverageCheckModal.js";import{API_BASE_BASEPOINT as Z}from"../../services/api-constants.js";import{AppContext as ee}from"./StaticLineTableStore/StaticLineTableProvider.js";import oe from"./OttServiceOptions/OttServiceOptionsSmallPopup.js";import le from"./StaticExclusiveBenefit.js";import ne from"../UserLoggedPricesToggle/UserLoggedPricesToggle.js";import te from"../FalconButtonV2/FalconButtonV2.js";import{ONE_ECOMMERCE_INTERNET_SUMMARY as ie}from"../../utils/constants.js";import de from"./StaticLineTabelTimer/StaticLineTabelTimer.js";import{useProductCardBadge as ae}from"./ProductCardBadgeProvider.js";import re from"../GenericPopup/GenericPopup.js";const se=({content:se,offeringData:ce,uniqueId:ve,storyContent:ue,metadata:me,tabIndex:pe,cardsLength:ge,indexKey:fe,constants:he,mainContent:be,address:Ee,eligibleBundle:we,linecheckSuccessCallBack:Pe,selectedOption:Ce,fetchOfferData:Se,basicConfigUrl:ye,selectedExistingOption:ke,setLoginSuccess:Te,enableP2P:xe,lineCheckCallBack:$e,loginSuccess:De,setToggleState:Ie,toggleState:Le,noTabs:Ne,deviceFlow:Be,deviceFlowCallBack:Oe,selectedRP:je,continueCart:Ae,lineCheckOnClear:Ue,pegaIntegration:Ve,isProdEnv:Fe,deviceUltimateBundle:Me,toggleContent:Re,pricesToggleState:Ge,isShogunFlow:_e,shogunToken:Je})=>{var We,qe,He,ze,Ke,Qe,Xe,Ye,Ze,eo,oo,lo,no,to,io,ao,ro,so,co,vo,uo,mo,po,go,fo,ho,bo,Eo,wo,Po,Co,So,yo,ko,To,xo,$o,Do,Io,Lo,No,Bo,Oo,jo,Ao,Uo,Vo,Fo,Mo,Ro,Go,_o,Jo,Wo,qo,Ho,zo,Ko,Qo,Xo,Yo,Zo,el,ol,ll,nl,tl,il,dl,al,rl,sl,cl,vl,ul,ml,pl,gl,fl,hl,bl,El,wl,Pl,Cl,Sl;const yl=ae(),[kl,Tl]=l(!1),[xl,$l]=l(!1),[Dl,Il]=l({showGift:!1,cashbackAvailable:!1}),[Ll,Nl]=l(!0),[Bl,Ol]=l(!1),[jl,Al]=l([]),[Ul,Vl]=l(!1),[Fl,Ml]=l(!1),[Rl,Gl]=l(!1),[_l,Jl]=l(!1),[Wl,ql]=l(!1),[Hl,zl]=l(!1),Kl=`${ye}inf/customer-management/subscriptions`,Ql=`${ye}inf/resource-management/msisdns/pretopost/validation`,[Xl,Yl]=l([]),[Zl,en]=l(!1),[on,ln]=l(!1),[nn,tn]=l(!1),[dn,an]=l([]),[rn,sn]=l(!1),[cn,vn]=l(!1),[un,mn]=l(!1),[pn,gn]=l(!1),[fn,hn]=l([]),[bn,En]=l(0),[wn,Pn]=l(!1),Cn=n(null),[Sn,yn]=l(null),kn=n(!1),Tn=n(null),xn=`${ye}inf/${Z.CUSTOMER}`,$n=void 0!==typeof window&&document.getElementById("static-linetable"),Dn=0===(null===(We=Object.keys(se))||void 0===We?void 0:We.length),In=null===(Qe=null===(Ke=null===(ze=null===(He=null===(qe=null==se?void 0:se.products)||void 0===qe?void 0:qe[0])||void 0===He?void 0:He.reference)||void 0===ze?void 0:ze.content)||void 0===Ke?void 0:Ke.product)||void 0===Qe?void 0:Qe[0],Ln=null===(oo=null===(eo=null===(Ze=null===(Ye=null===(Xe=null==se?void 0:se.promotion)||void 0===Xe?void 0:Xe[0])||void 0===Ye?void 0:Ye.reference)||void 0===Ze?void 0:Ze.content)||void 0===eo?void 0:eo.promoDescription)||void 0===oo?void 0:oo[0],Nn=null===(lo=null==se?void 0:se.timer)||void 0===lo?void 0:lo[0],Bn=null==Nn?void 0:Nn.enableCounter,[On,jn]=l(!!(Bn&&(null==Nn?void 0:Nn.startTime)&&(null==Nn?void 0:Nn.endTime))&&P(Nn.startTime,Nn.endTime)),An=Boolean((null==se?void 0:se.highlightText)&&!0!==Ge&&!On&&!(yl&&(null==se?void 0:se.badgesContainer))),Un=Boolean((null==Ln?void 0:Ln.displayText)&&!(null==se?void 0:se.notShowPromotionLabel)&&!0!==Ge&&!On),Vn=Boolean(yl&&(null==se?void 0:se.badgesContainer)&&!0!==Ge&&!On&&!Un),Fn=null==In?void 0:In.productId,Mn=null===(no=null==f?void 0:f.getInstance())||void 0===no?void 0:no.getCartUrl(),Rn=null===(to=null==h?void 0:h.getInstance())||void 0===to?void 0:to.getAssetPath(),Gn="MOBILE"===(null==ue?void 0:ue.pageType),_n=N(),Jn=t(ee);let Wn;Wn=Ee&&(null===(io=null==we?void 0:we.eligibleBundle)||void 0===io?void 0:io.includes(Fn));const qn=null==se?void 0:se.enableTVStreamingOptionsPopUp,Hn=null==se?void 0:se.enableTVStreamingOptionsStepper,zn=null==se?void 0:se.disableDiscountedPriceToggle,Kn=null==se?void 0:se.skipAccessoriesPage;E.create({baseURL:null!=ye?ye:""});let Qn=void 0!==typeof window&&b.get("sunriseAuth");Qn=Qn&&JSON.parse(Qn);const Xn=((null==ce?void 0:ce[ve])||[]).filter(e=>(null==e?void 0:e.id)===Fn),Yn=e=>{an(e)},Zn=()=>{Vl(!0),Jl(!_l),ln(!on)},et=()=>{var e,o,l;if($l(!1),xe&&null==Qn)Jl(!_l),ln(!on);else if(xe&&(null==Qn?void 0:Qn.siteId))dt();else if(Ce===F&&(null==ke?void 0:ke.length)>0)ql(!0);else{!!((null==be?void 0:be.enableExistingCustomer)&&null==Qn||!Qn&&!0===Ge&&(null==Re?void 0:Re.enableLoggedInPrice))?Vl(!0):mt()}if(Ve){const n=localStorage.getItem("prospectId"),t=null!==(l=null===(o=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname)||void 0===o?void 0:o.split("/"))&&void 0!==l?l:[],i=t[t.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"CartCreated",pageLocation:i,targetProduct:Fn};n&&z(xn,d,n)}},ot=e=>{const o=jl.findIndex(o=>(null==e?void 0:e.giftGroupId)===(null==o?void 0:o.giftGroupId)),l=jl;-1===o?l.push(e):l[o]=e,Al([...l])},lt=new URLSearchParams(null===(ao=null===window||void 0===window?void 0:window.location)||void 0===ao?void 0:ao.search),nt=null==lt?void 0:lt.get("selectedMsisdn"),tt=e=>{var o;1===(null==e?void 0:e.length)?(Bl?D(gt,ue,Xn,null==e?void 0:e[0],se,Ve):mt(null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.msisdn),zl(!1)):(null==e?void 0:e.length)>1?(Yl(e),tn(!nn),zl(!1)):(ln(!on),zl(!0),Nl(!0),Tl(!1))},it=(o,l)=>e(void 0,void 0,void 0,function*(){yield K(null==o?void 0:o.msisdn,Ql).then(e=>{e&&l.push(o)}).catch(e=>{console.log("error",e)})}),dt=()=>{var o;Tl(!0);try{null===(o=H("PREPAID",Kl))||void 0===o||o.then(o=>e(void 0,void 0,void 0,function*(){if(204==(null==o?void 0:o.subscriptionData))ln(!on),zl(!0),Nl(!0),Tl(!1);else{const l=null==o?void 0:o.subscriptionData,n=l.find(e=>e.msisdn===nt);if(l){const o=[];nt?(yield it(n,o),tt(o)):yield Promise.all(null==l?void 0:l.map(l=>e(void 0,void 0,void 0,function*(){yield it(l,o)}))).then(e=>{tt(o)})}}})).catch(e=>{console.log("error---\x3e",e),Tl(!1)})}catch(e){console.log("error---\x3e",e),Tl(!1)}en(!0)},at=()=>{ln(!Ll),Jl(!1)},rt=e=>{sn(!1),e&&A(V,U,{headline:"VAS POPUP CLOSE"})},st=()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");we=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),Ee="undefined"!=typeof window&&b.get("chAddressJson"),Gl(!Rl),"function"==typeof Pe&&Pe(),mt()},ct=C(null==In?void 0:In.bloks,Gn),vt=null===(ro=null==ct?void 0:ct[0])||void 0===ro?void 0:ro.tvProductId,ut=e=>{var o,l,n,t,i,d,a,r,s,c;const v=Ve&&(null===(n=null===(l=null===(o=null==Xn?void 0:Xn[0])||void 0===o?void 0:o.promotionInfo)||void 0===l?void 0:l[0])||void 0===n?void 0:n.id),u=Ve&&(null===(d=null===(i=null===(t=null==Xn?void 0:Xn[0])||void 0===t?void 0:t.promotionInfo)||void 0===i?void 0:i[0])||void 0===d?void 0:d.version),m=_e?{pointsBurnt:null===(r=null===(a=null==Xn?void 0:Xn[0])||void 0===a?void 0:a.rewards)||void 0===r?void 0:r.points,rewardOfferId:null===(c=null===(s=null==Xn?void 0:Xn[0])||void 0===s?void 0:s.rewards)||void 0===c?void 0:c.offerId,gloxTokenId:Je}:void 0;Xn&&Xn[0]&&(Xn[0].fromPopup=pn),bt("false"),sessionStorage.removeItem("vasPopUp"),vn(!1),x(Tl,Mn,jl,Xn,be,gt,Gn,vt,we,Ee,Gl,Rl,$e,xe,null!=nt?nt:e,se,dn,v,u,m)},mt=e=>{var o,l,n,t,i,d,a,r,s;gn(!1),$l(!1);let c=void 0!==typeof window&&b.get("sunriseAuth");const v=c&&JSON.parse(c),u=!(!(null==be?void 0:be.enableExistingCustomer)||null!=v);if(sessionStorage.removeItem(ie),(null===(o=null==be?void 0:be.linecheckData)||void 0===o?void 0:o.length)>0&&!Gn&&!Wn){return void(document.getElementById("linecheck")&&$e())}if(Wn&&!Gn&&(null===(l=null==be?void 0:be.loginData)||void 0===l?void 0:l.length)>0&&u)Vl(!0);else if(Hn&&(null===(n=Xn[0])||void 0===n?void 0:n.isBundle)){let o=!1;Kn||((null===(t=Xn[0])||void 0===t?void 0:t.isBundle)?null===(d=null===(i=Xn[0])||void 0===i?void 0:i.bundledOffers)||void 0===d||d.map(e=>{var l,n,t;"internet"!==(null===(l=null==e?void 0:e.productType)||void 0===l?void 0:l.toLowerCase())&&"tv"!=(null===(n=null==e?void 0:e.productType)||void 0===n?void 0:n.toLowerCase())||(null==e?void 0:e.recommendAccessory)&&(o=null==e?void 0:e.recommendAccessory),"mobile"!==(null===(t=null==e?void 0:e.productType)||void 0===t?void 0:t.toLowerCase())||(o=!1)}):(null===(a=null==Xn?void 0:Xn[0])||void 0===a?void 0:a.recommendAccessory)&&(o=null===(r=null==Xn?void 0:Xn[0])||void 0===r?void 0:r.recommendAccessory)),$(gt,Xn,se,Ve,null==In?void 0:In.productName,o),ut(e)}else qn&&(null===(s=Xn[0])||void 0===s?void 0:s.isBundle)&&!cn?(sn(!0),vn(!0),bt("true"),window.addEventListener("beforeunload",function(e){bt("false"),sessionStorage.removeItem("vasPopUp"),vn(!1)})):(xe&&Tl(!0),ut(e))},pt=(e,o)=>l=>{var n;const t=void 0!==typeof window&&b.get("one-commerce-cartId");(null==be?void 0:be.enableReplacePopup)&&t?(Cn.current=()=>e(l),kn.current=Boolean(o),yn(null!=o?o:null===(n=null==be?void 0:be.generalReplacePopup)||void 0===n?void 0:n[0]),Pn(!0)):e(l)},gt=S(Xn,Gn,null==be?void 0:be.pageType,!1,dn,Ve);i(()=>{var e,o;setTimeout(()=>{y(pe,ge)},100);const l=k(Gn?Xn:null!==(o=null===(e=null==Xn?void 0:Xn[0])||void 0===e?void 0:e.bundledOffers)&&void 0!==o?o:Xn);Il(Object.assign({},l))},[ce,Le,dn,bn,((null==Le?void 0:Le.TV)||(null==Le?void 0:Le.gigaSpeed)||(null==Le?void 0:Le.Netflix))&&Array.isArray(Xn)&&3===(null===(co=null===(so=null==Xn?void 0:Xn[0])||void 0===so?void 0:so.bundledOffers)||void 0===co?void 0:co.length)]);const ft=()=>{((null==ct?void 0:ct.length)>0||qn)&&Ml(!0)},ht=null===(vo=null==be?void 0:be.productContainer)||void 0===vo?void 0:vo[0];i(()=>{Bl&&(xe&&null==Qn?(Jl(!_l),ln(!on)):xe&&(null==Qn?void 0:Qn.siteId)&&dt())},[Bl]),i(()=>{var e;if(Jn){const{store:o}=Jn;(null===(e=null==o?void 0:o.ottOptionsApi)||void 0===e?void 0:e.length)>0&&0===(null==fn?void 0:fn.length)&&hn(null==o?void 0:o.ottOptionsApi)}},[Jn]),i(()=>{if(!Bn||!(null==Nn?void 0:Nn.startTime)||!(null==Nn?void 0:Nn.endTime))return void jn(!1);jn(P(Nn.startTime,Nn.endTime));const e=T(Nn.startTime,Nn.endTime);if(e<=0)return;const o=setTimeout(()=>{jn(P(Nn.startTime,Nn.endTime))},e);return()=>clearTimeout(o)},[Bn,null==Nn?void 0:Nn.startTime,null==Nn?void 0:Nn.endTime]),i(()=>{var e;const o=Tn.current;if(!o||!(null===(e=null==se?void 0:se.timer)||void 0===e?void 0:e.length)||!Bn)return void En(0);const l=()=>{En(o.clientHeight)};if(l(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(l);return n.observe(o),()=>{n.disconnect()}},[null===(uo=null==se?void 0:se.timer)||void 0===uo?void 0:uo.length,Bn]),i(()=>{un&&(rt(),mn(!0),bt("false"),sessionStorage.removeItem("vasPopUp"),vn(!1),ut())},[un]),i(()=>{const e=()=>{const e=sessionStorage.getItem("vasPopUp");vn("true"===e)};e();const o=o=>{o.storageArea===sessionStorage&&"vasPopUp"===o.key&&e(),o.storageArea===sessionStorage&&"vasPopUp"===o.key&&null===o.newValue&&vn(!1)},l=()=>{e()};return window.addEventListener("storage",o),window.addEventListener("vasPopUpChange",l),()=>{window.removeEventListener("storage",o),window.removeEventListener("vasPopUpChange",l)}},[]);const bt=e=>{sessionStorage.setItem("vasPopUp",e);const o=new Event("vasPopUpChange");window.dispatchEvent(o)};return o.createElement("div",null,kl&&$n&&a(o.createElement(d,{keyParams:"loading"}),$n),Dn&&o.createElement("div",{className:"w-75 pb-2"},o.createElement(r,null)),!Dn&&we&&se&&Ee&&!Gn&&o.createElement("div",{className:s.selected},o.createElement("span",{style:{paddingBottom:"10px"}},Wn?o.createElement("span",{className:s.activeicon},o.createElement("img",{src:`${Rn}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:s.activeicon}),o.createElement("span",null,null==he?void 0:he.subscriptionAvalTxt)):o.createElement("span",{className:s.inactiveicon},o.createElement("img",{src:`${Rn}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:s.inactiveicon}),o.createElement("span",null,null==he?void 0:he.notSubscriptionTxt)))),o.createElement("div",{className:`${!Gn&&!1===Wn&&(null===(mo=null==be?void 0:be.linecheckData)||void 0===mo?void 0:mo.length)>0&&"global/coverage-check"!==(null===(fo=null===(go=null===(po=null==be?void 0:be.linecheckData)||void 0===po?void 0:po[0])||void 0===go?void 0:go.reference)||void 0===fo?void 0:fo.default_full_slug)?s.overlay:""}\n ${Me&&!(null===(bo=null===(ho=null==Xn?void 0:Xn[0])||void 0===ho?void 0:ho.eligibility)||void 0===bo?void 0:bo.fpb)?s.disabled:""}\n `,style:{flexDirection:"column"}},o.createElement("div",{className:s.bundleproductcard},o.createElement("div",{id:`timer-section${pe}${fe}`,"data-timer-active":bn>0?"true":"false"},(null===(Eo=null==se?void 0:se.timer)||void 0===Eo?void 0:Eo.length)&&Bn?o.createElement("div",{style:{height:`${bn}px`,transition:"height 0.3s ease"}}):null),o.createElement("div",{className:`${s.productcontainer}`,style:(()=>{const e=Un?Ln:se,o=null==e?void 0:e.showBorder,l=null==e?void 0:e.borderGradient,n=null==e?void 0:e.borderColor;return{borderColor:o&&!l?n||"":"transparent",borderWidth:o?"4px":"0px",borderStyle:o?"solid":"none",borderRadius:o?"8px":"",background:o&&l?`linear-gradient(white, white) padding-box, ${l} border-box`:void 0}})()},Vn&&yl&&o.createElement(yl,{badges:se.badgesContainer}),An&&o.createElement("div",{className:`${s.highlightText}`},null==se?void 0:se.highlightText),Un&&((null==Ln?void 0:Ln.badgeContainer)&&yl?o.createElement(yl,{badges:null==Ln?void 0:Ln.badgeContainer}):o.createElement("div",{className:`${s.promocontainer}`,style:{background:null==Ln?void 0:Ln.bestSellerColor}},null==Ln?void 0:Ln.displayText)),o.createElement("div",{ref:Tn,className:s.timerContainer},(null===(wo=null==se?void 0:se.timer)||void 0===wo?void 0:wo.length)&&Bn?o.createElement(de,{content:null===(Po=null==se?void 0:se.timer)||void 0===Po?void 0:Po[0],hasHighlightText:Vn||Un,onTimerChange:e=>{jn(e)}}):null),o.createElement("div",{className:`${s.detailsection} ${s.imageFullWidthSection}`,id:`detailsectionv3${pe}${fe}`},o.createElement("div",{className:`${s.headersection}`},o.createElement("div",{className:`${s.titlesection}`},o.createElement("div",{className:`${s.productheader}`,id:`titleV3${pe}${fe}`},null==In?void 0:In.productName),o.createElement("div",null,(null===(Co=null==In?void 0:In.icon)||void 0===Co?void 0:Co.filename)&&o.createElement("img",{className:`${s.imagecontainer}`,src:null===(So=null==In?void 0:In.icon)||void 0===So?void 0:So.filename,height:15,width:20,alt:"productIcon"}))),o.createElement("div",{className:`${s.productdescription}`,id:`descriptionV3${pe}${fe}`},o.createElement(c,{content:null==In?void 0:In.description})),o.createElement("div",{className:`${s.images}`},(null===(yo=null==In?void 0:In.img)||void 0===yo?void 0:yo.filename)&&o.createElement("img",{className:`${s.imagespace} ${(null==se?void 0:se.highlightText)&&s.borderimage}`,alt:"cardimg",src:`${null===(ko=null==In?void 0:In.img)||void 0===ko?void 0:ko.filename}/m/`}))),o.createElement("div",{className:`${s.productconfig}`,id:`product-configv3${pe}${fe}`},Dn?o.createElement(o.Fragment,null,o.createElement("div",{className:s.space}),o.createElement(r,{stylename:s.skeletontittle,count:1}),o.createElement(r,{stylename:s.skeletonline,count:5}),o.createElement("div",{className:s.space}),o.createElement(r,{stylename:s.skeletontittle,count:1}),o.createElement(r,{stylename:s.skeletonline,count:5})):o.createElement("div",null,(null==In?void 0:In.bloks)&&(null===(To=null==In?void 0:In.bloks)||void 0===To?void 0:To.map((e,l)=>o.createElement(v,{content:e,indexKey:l,constants:he,key:l,showModalPopup:ft,setToggleState:Ie,toggleState:Le,noTabs:Ne,mainContent:be,enableTVStreamingOptions:null==se?void 0:se.enableTVStreamingOptions,metadata:me,setTvOptionsData:Yn})))))),o.createElement("div",{className:`${s.detailsection}`,id:`benefits-price-section${pe}${fe}`},o.createElement("div",{id:`exclusive-benefits-section${pe}${fe}`},(null===(xo=null==In?void 0:In.extraBenefits)||void 0===xo?void 0:xo.length)>0&&o.createElement(le,{content:null===($o=null==In?void 0:In.extraBenefits)||void 0===$o?void 0:$o[0]})),o.createElement("div",{className:`${s.benefitssection}`,id:`benefits-section${pe}${fe}`},(null===(Do=null==In?void 0:In.benefits)||void 0===Do?void 0:Do.length)>0&&o.createElement(u,{content:null==In?void 0:In.benefits,benefitData:gt,constants:he,pricesToggleState:Ge,togglePriceLabel:null==Re?void 0:Re.togglePriceLabel})),o.createElement("br",null),o.createElement("div",{className:`${s.giftsection}`,id:`gift-section${pe}${fe}`},(null==Dl?void 0:Dl.showGift)&&(null===(Io=null==Ln?void 0:Ln.singleGift)||void 0===Io?void 0:Io.map((e,l)=>o.createElement(I,{content:e,key:l}))),(null==Dl?void 0:Dl.showGift)&&(null===(Lo=null==Ln?void 0:Ln.giftConfig)||void 0===Lo?void 0:Lo.map((e,l)=>o.createElement(L,{content:e,key:l,selectedGiftItem:ot,parentPoType:Gn?"MOBILE":"HOME"}))),o.createElement("div",{className:`${s.giftsection}`,id:`cashback-section${pe}${fe}`},o.createElement(j,{uniqueProductData:Xn,mainContent:be}))),o.createElement("div",{className:`${s.ordersection}`,id:`order-section${pe}${fe}`},""===(null==gt?void 0:gt.base)?o.createElement("div",null,o.createElement(r,{stylename:s.skeletontittle})):o.createElement("div",{id:`price-section${pe}${fe}`},o.createElement(m,{priceCollection:gt,constants:he,promoText:null==In?void 0:In.promoText,deviceFlow:Be,content:se,offeringData:ce,uniqueId:ve})),!_e&&o.createElement("div",{className:`${s.discountedpricetoggleSection}`,id:`discountedpricetoggle-section${pe}${fe}`},zn||"INLINE"!==(null==Re?void 0:Re.togglePosition)?null:o.createElement(ne,{content:In,index:fe,lineTable:!0,toggleContent:Re})),xe&&(null==he?void 0:he.P2PDiscountLabel)&&o.createElement("div",{className:s.longterm},null==he?void 0:he.P2PDiscountLabel),Dn?o.createElement(o.Fragment,null,o.createElement(r,{stylename:s.skeletontittle,count:1}),o.createElement(r,{stylename:s.skeletonline,count:2})):o.createElement("div",{className:`${(null==ue?void 0:ue.swapButton)&&s.swapButton}`},o.createElement("div",{style:{padding:"16px 0 0 0"}},o.createElement(p,{isMobileFlow:Gn,createCartCall:(null==Be?void 0:Be.isDeviceFlow)?pt(e=>{$l(!1);Oe({setShowLoader:Tl,cartEndPoint:Mn,giftItem:jl,uniqueProductData:Xn,mainContent:be,showPrice:gt,isMobileFlow:Gn,eligibleBundle:we,address:Ee,setShowLinecheck:Gl,showLinecheck:Rl,lineCheckCallBack:$e,enableP2P:xe,msisdnn:null!=nt?nt:e,content:se,selectedRP:je,continueCart:Ae})}):pt(Gn?et:mt),constants:he,storyContent:ue,showPrice:gt,isAvailable:Wn,address:Ee,uniqueProductBenefits:null==Xn?void 0:Xn[0],alwaysActive:!Wn&&(null===(No=null==be?void 0:be.linecheckData)||void 0===No?void 0:No.length)>0&&"global/coverage-check"===(null===(jo=null===(Oo=null===(Bo=null==be?void 0:be.linecheckData)||void 0===Bo?void 0:Bo[0])||void 0===Oo?void 0:Oo.reference)||void 0===jo?void 0:jo.default_full_slug),flexUpgradeFreePopup:null===(Uo=null===(Ao=null==be?void 0:be.flexUpgradeFreePopup)||void 0===Ao?void 0:Ao.reference)||void 0===Uo?void 0:Uo.content,content:se,deviceUltimateBundle:Me,forceDisabled:Boolean(null===(Fo=null===(Vo=null==Xn?void 0:Xn[0])||void 0===Vo?void 0:Vo.rewards)||void 0===Fo?void 0:Fo.notEligibleReason),notEligibileReason:null===(Ro=null===(Mo=null==Xn?void 0:Xn[0])||void 0===Mo?void 0:Mo.rewards)||void 0===Ro?void 0:Ro.notEligibleReason})),!_e&&(null===(Go=null==ue?void 0:ue.addSmartPhone)||void 0===Go?void 0:Go.length)>0&&!(null==Be?void 0:Be.isDeviceFlow)&&o.createElement("div",{style:{textAlign:"center"}},(null==ue?void 0:ue.swapButton)?(null==ue?void 0:ue.ctaLabel)&&o.createElement("div",{style:{padding:"16px 0"}},o.createElement("button",{className:"primarybutton",onClick:()=>{var e;return pt(()=>D(gt,ue,Xn,"",se,Ve),null===(e=null==be?void 0:be.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}},o.createElement("span",{className:s.buttontext},null==ue?void 0:ue.ctaLabel))):!(null==se?void 0:se.redirectOnly)&&o.createElement("div",{style:{padding:"12px 0 0 0"}},o.createElement(te,{content:{buttonType:"Secondary-V1",buttonLabel:(null==se?void 0:se.ultimateBundlePromotion)?null==he?void 0:he.ultimateBundleLbl:null===(Jo=null===(_o=null==ue?void 0:ue.addSmartPhone)||void 0===_o?void 0:_o[0])||void 0===Jo?void 0:Jo.buttonLabel,buttonIcon:null===(qo=null===(Wo=null==ue?void 0:ue.addSmartPhone)||void 0===Wo?void 0:Wo[0])||void 0===qo?void 0:qo.buttonIcon,buttonAlignment:"left"},wafIdentifier:ye,style:{width:"100%"},onClick:()=>{var e;return pt(()=>xe?void Ol(!0):D(gt,ue,Xn,"",se,Ve),null===(e=null==be?void 0:be.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}}))),o.createElement("div",{className:s.productcontractduration,id:`contract-section${pe}${fe}`,style:{paddingTop:(null===(Ho=null==ue?void 0:ue.addSmartPhone)||void 0===Ho?void 0:Ho.length)>0&&!(null==Be?void 0:Be.isDeviceFlow)&&!(null==ue?void 0:ue.swapButton)&&!(null==se?void 0:se.redirectOnly)?"8px":void 0}},(null==gt?void 0:gt.contractDuration)>"1"?B(null===(zo=null==he?void 0:he.minContractDuration)||void 0===zo?void 0:zo.substring(1),[null==gt?void 0:gt.contractDuration]):null==he?void 0:he.noContractDuration)),o.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(Ko=null==In?void 0:In.productDetails)||void 0===Ko?void 0:Ko.length)>0&&o.createElement("span",{className:s.productdetailslink,onClick:()=>{var e,o,l;$l(!xl),A(V,R,X(Xn,"",M));const n=localStorage.getItem("prospectId"),t=null!==(l=null===(o=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname)||void 0===o?void 0:o.split("/"))&&void 0!==l?l:[],i=t[t.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"ProductDetails",pageLocation:i,targetProduct:Fn};n&&z(xn,d,n)}},null==he?void 0:he.productDetailsLink)),xl&&o.createElement(g,{content:null==In?void 0:In.productDetails,showProductDetail:xl,setShowProductDetail:$l,constants:he,showPrice:gt,isMobileFlow:Gn,createCartCall:Gn?et:mt,storyContent:ue,isAvailable:Wn,address:Ee,flexUpgradeFreePopup:null===(Xo=null===(Qo=null==be?void 0:be.flexUpgradeFreePopup)||void 0===Qo?void 0:Qo.reference)||void 0===Xo?void 0:Xo.content,notEligibileReason:null===(Zo=null===(Yo=null==Xn?void 0:Xn[0])||void 0===Yo?void 0:Yo.rewards)||void 0===Zo?void 0:Zo.notEligibleReason})))))),Me&&Xn&&!(null===(ol=null===(el=null==Xn?void 0:Xn[0])||void 0===el?void 0:el.eligibility)||void 0===ol?void 0:ol.fpb)&&o.createElement("div",{className:s.disabledInfo},o.createElement(c,{content:null==he?void 0:he.fpbNotCompatibleText})),Fl&&(Dn?o.createElement(r,null):o.createElement(G,{content:null==ct?void 0:ct[0],setShowModal:Ml,showModal:Fl,constants:he})),Ul&&(null===(ll=null==be?void 0:be.loginData)||void 0===ll?void 0:ll.length)>0&&$n&&a(o.createElement(w,{content:null===(nl=null==be?void 0:be.loginData)||void 0===nl?void 0:nl[0],closeLogin:()=>{Vl(!1)},metadata:me,onSuccess:()=>{Vl(!1),Te(),sessionStorage.removeItem("vasPopUp"),vn(!1),xe?dt():mt()},isProdEnv:Fe}),$n),_l&&xe&&!Ul&&on&&o.createElement(q,{modalState:Ll,handler:at,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(W,{onClose:Zn,content:null===(dl=null===(il=null===(tl=null==be?void 0:be.productContainer)||void 0===tl?void 0:tl[0])||void 0===il?void 0:il.p2pBloks)||void 0===dl?void 0:dl[0],prepaid:!1})),xe&&Zl&&Hl&&on&&o.createElement(q,{modalState:Ll,handler:at,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px",id:"table-product"},o.createElement(W,{onClose:Zn,content:null===(sl=null===(rl=null===(al=null==be?void 0:be.productContainer)||void 0===al?void 0:al[0])||void 0===rl?void 0:rl.p2pBloks)||void 0===sl?void 0:sl[1],prepaid:!0})),(null==Xl?void 0:Xl.length)>1&&xe&&Zl&&!Hl&&nn&&o.createElement(q,{modalState:nn,handler:()=>{Tl(!1),tn(!nn)},showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(Q,{onSubmit:e=>{tn(!nn),Bl?D(gt,ue,Xn,e,se,Ve):mt(null==e?void 0:e.msisdn)},exsistingSubscriptionData:Xl,updatedContent:ht})),Rl&&(null==be?void 0:be.enableLinecheckOverlay)&&!Gn&&(null===(cl=null==be?void 0:be.linecheckData)||void 0===cl?void 0:cl.length)>0&&!xe&&"global/new-linecheck-test"===(null===(ml=null===(ul=null===(vl=null==be?void 0:be.linecheckData)||void 0===vl?void 0:vl[0])||void 0===ul?void 0:ul.reference)||void 0===ml?void 0:ml.default_full_slug)?o.createElement(_,{content:null===(pl=null==be?void 0:be.linecheckData)||void 0===pl?void 0:pl[0],onSuccess:st,showModal:Rl,setShowModal:Gl,productName:null==In?void 0:In.productName,productId:null==In?void 0:In.productId}):Rl&&(null==be?void 0:be.enableLinecheckOverlay)&&!Gn&&(null===(gl=null==be?void 0:be.linecheckData)||void 0===gl?void 0:gl.length)>0&&!xe&&"global/coverage-check"===(null===(bl=null===(hl=null===(fl=null==be?void 0:be.linecheckData)||void 0===fl?void 0:fl[0])||void 0===hl?void 0:hl.reference)||void 0===bl?void 0:bl.default_full_slug)?o.createElement(Y,{content:null===(El=null==be?void 0:be.linecheckData)||void 0===El?void 0:El[0].reference.content.body[0],overlayIsOpen:!0,externalHandleModal:Gl,productName:null==In?void 0:In.productName,showModal:Rl,setShowModal:Gl,onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");we=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),Ee="undefined"!=typeof window&&b.get("chAddressJson"),"function"==typeof Pe&&Pe()},onCreateCart:st,lineCheckOnClear:Ue,productId:null==In?void 0:In.productId}):null,Wl&&Gn&&(null===(wl=null==ue?void 0:ue.benefitsValidate)||void 0===wl?void 0:wl.length)>0&&o.createElement(J,{content:null===(Pl=null==ue?void 0:ue.benefitsValidate)||void 0===Pl?void 0:Pl[0],loginContent:null===(Cl=null==be?void 0:be.loginData)||void 0===Cl?void 0:Cl[0],metadata:me,createCartCall:mt,fetchOfferData:Se,basicConfigUrl:ye,selectedExistingOption:ke,setShowBenefit:ql,setLoginSuccess:Te,isProdEnv:Fe}),rn&&o.createElement(q,{modalState:rn,handler:rt,showFooter:!1,width:"mobile"===_n?"":"tablet"===_n?"700px":"990px",fixedWidth:"mobile"===_n?"":"tablet"===_n?"700px":"990px",height:"845px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"24px"},o.createElement(oe,{content:null===(Sl=null==be?void 0:be.optionsPopup)||void 0===Sl?void 0:Sl[0],addOptionsCallBack:e=>{gn(!0),mn(!0),Yn(e)},metadata:me,constants:he,mainContent:be,preSelectedOptions:[],optionsResponse:fn,updateResponseList:hn,showPrice:gt,productData:In,offeringData:ce,uniqueId:ve,deviceFlow:Be})),wn&&Sn&&o.createElement(re,{modalState:wn,onCloseHandler:()=>{Cn.current=null,Pn(!1)},content:Sn,wafIdentifier:ye,onPrimaryClick:()=>{const e=Cn.current;Cn.current=null,kn.current&&b.remove("one-commerce-cartId"),kn.current=!1,Pn(!1),null==e||e()},onSecondaryClick:()=>{Cn.current=null,Pn(!1)}}))};export{se as default};
2
2
  //# sourceMappingURL=StaticProduct.js.map