@sunrise-upc/mobile-prod-card 12.3.0-beta.6 → 12.3.0-beta.7
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/dist/esm/components/StaticLineTable/Product.utils.js +1 -1
- package/dist/esm/components/StaticLineTable/Product.utils.js.map +1 -1
- package/dist/esm/components/StaticLineTable/StaticProduct.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticProduct.js.map +1 -1
- package/dist/esm/components/StaticLineTable/StaticProductContainer.js +1 -1
- package/dist/esm/components/StaticLineTable/StaticProductContainer.js.map +1 -1
- package/dist/esm/components/lineTable/BundleProductsV3.js +1 -1
- package/dist/esm/components/lineTable/BundleProductsV3.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"js-cookie";import{DEFAULT_MOBILEPOSTPAID_BUNDLE as l,TV_SERVICE_OPTION as i,RATEPLAN as n,VCTYPE as e,DEFAULT_WIRELINE_BUNDLE as d,ONE_ECOMMERCE_SUMMARY as u,ONE_ECOMMERCE_INTERNET_SUMMARY as t}from"../../utils/constants.js";import{fetchShogunOfferData as v,createCartV2 as r}from"../../services/LineTableService.js";import{getElementMaximumHeight as c,getLocalStorageWithExpiry as a,redirectWithSuccess as s,checkLinkWithLang as p}from"../../utils/utils.js";import{trackNewDatalayerEvent as m}from"../../utils/AnalyticsUtils.js";import{COMBINEDEVICE as f,GAEVENT as y,LINETABLEPRODUCT as g,ADDTOCART as h,LINETABLE as I,LINETABLEDEVICE as b}from"../../Analytics/AnalyticsConstants.js";import{trackEligibleItem as T,getEcomCartInfo as D}from"../../models/Analytics/items.js";import{calculateDateTime as P}from"./StaticLineTabelTimer/util.js";const C=(o,l)=>{try{const i=new Date,n=P(new Date(o.replace(/-/g,"/"))),e=P(new Date(l.replace(/-/g,"/")));return!Number.isNaN(n.getTime())&&!Number.isNaN(e.getTime())&&(i>=n&&i<e)}catch(o){return!1}},w=(o,l)=>{try{const i=P(new Date(o.replace(/-/g,"/"))),n=P(new Date(l.replace(/-/g,"/")));if(Number.isNaN(i.getTime())||Number.isNaN(n.getTime()))return 0;const e=(new Date).getTime(),d=i.getTime(),u=n.getTime();return e<d?Math.max(0,d-e):e>=d&&e<u?Math.max(0,u-e):0}catch(o){return 0}},N=(o,i,n,e,d)=>{null==o||o.map(o=>{var e,u,t,v,r,c,a,s,p,m,f,y,g,h,I,b,T,D,P,w,N,S,_,x,L;const O={id:"",promoIds:[]},E=null===(r=null===(v=null===(t=null===(u=null===(e=null==o?void 0:o.products)||void 0===e?void 0:e[0])||void 0===u?void 0:u.reference)||void 0===t?void 0:t.content)||void 0===v?void 0:v.product)||void 0===r?void 0:r[0],A=null===(m=null===(p=null===(s=null===(a=null===(c=null==o?void 0:o.promotion)||void 0===c?void 0:c[0])||void 0===a?void 0:a.reference)||void 0===s?void 0:s.content)||void 0===p?void 0:p.promoDescription)||void 0===m?void 0:m[0];null==A||A.promotionId,O.id=null==E?void 0:E.productId;const M=null===(f=null==o?void 0:o.timer)||void 0===f?void 0:f[0],B=!!M&&C(M.startTime,M.endTime),k=null===(T=null===(b=null===(I=null===(h=null===(g=null===(y=null==M?void 0:M.promotion)||void 0===y?void 0:y[0])||void 0===g?void 0:g.reference)||void 0===h?void 0:h.content)||void 0===I?void 0:I.promoDescription)||void 0===b?void 0:b[0])||void 0===T?void 0:T.promotionId,U=d&&!0===d&&""===(null==A?void 0:A.promotionId)?l:null==A?void 0:A.promotionId;if(B&&k?null===(D=null==O?void 0:O.promoIds)||void 0===D||D.push(k):null===(P=null==O?void 0:O.promoIds)||void 0===P||P.push(U),n){const l=null===(x=null===(_=null===(S=null===(N=null===(w=null==o?void 0:o.mobilePromotion)||void 0===w?void 0:w[0])||void 0===N?void 0:N.reference)||void 0===S?void 0:S.content)||void 0===_?void 0:_.promoDescription)||void 0===x?void 0:x[0];null===(L=null==O?void 0:O.promoIds)||void 0===L||L.push(null==l?void 0:l.promotionId)}null==i||i.push(O)})},S=(o,l,i)=>{var n,e,d;const u=null===(n=null==o?void 0:o.tabCaption)||void 0===n?void 0:n.replace(/\b\w/g,o=>o.toUpperCase()).replace(/\s+/g,"");return{atlOffers:[{placements:i,offerValidations:[{key:"Segment",type:"CustomerType",value:"Residential"},{key:"OrderType",type:"CustomerInterest",value:"New"},{key:"CurrentPage",type:"Context",value:"mobile-subscription"},{key:"Category",type:"CustomerInterest",value:null!=u?u:""},{key:"RequestedOfferCount",type:"Context",value:null!==(d=null===(e=null==o?void 0:o.pegaRequestOfferCount)||void 0===e?void 0:e.toString())&&void 0!==d?d:"3"},l?{key:"Tag",type:"CustomerInterest",value:l}:null].filter(Boolean)}]}},_=o=>{let l=!1,i=!1;return null==o||o.map(o=>{var n;null===(n=null==o?void 0:o.promotionInfo)||void 0===n||n.map(o=>{(null==o?void 0:o.hardwareGift)&&(l=!0),(null==o?void 0:o.cashBack)&&(i=!0)})}),{showGift:l,cashbackAvailable:i}},x=(i,n,t,v,c,m,f,y,b,D,P,C,w,N,S,_,x,L,O,E,A)=>{var M,B,k;if(f){i(!0);const d=a(e);0!==(null===(M=Object.keys(v))||void 0===M?void 0:M.length)&&r(v,"",(null==m?void 0:m.promoID)?null==m?void 0:m.promoID:l,n,"mobile",t,N,S,null===(k=null===(B=null==c?void 0:c.productContainer)||void 0===B?void 0:B[0])||void 0===k?void 0:k.isQoQaFlow,null==d?void 0:d.voucher,null,null,L,O,E).then(l=>{var i;o.remove("one-commerce-cartId",{path:"/"}),o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),o.set("cartProduct",null==m?void 0:m.id,{path:"/"}),T(h,v,"",g),s(null===(i=null==c?void 0:c.summaryPageUrl)||void 0===i?void 0:i.cached_url,A)}).catch(o=>{console.log(o),i(!1)}).finally(()=>{i(!1)})}else{const l="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid");b&&D&&l?(i(!0),0!==v.length&&r(v,y,(null==m?void 0:m.promoID)?null==m?void 0:m.promoID:d,n,"fixnet",t,"","",!1,"","",x,void 0,void 0,E).then(l=>{var i,n,e,d,t,r,a,f,y,g,b;"undefined"!=typeof window&&o.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),"undefined"!=typeof window&&o.set("cartProduct",null==m?void 0:m.id,{path:"/"}),"undefined"!=typeof window&&o.remove("landline"),T(h,v,"",I);const D=p(null===(i=null==_?void 0:_.productBasedCheckoutUrl)||void 0===i?void 0:i.cached_url);let P=!1;if((null===(n=v[0])||void 0===n?void 0:n.isBundle)?null===(d=null===(e=v[0])||void 0===e?void 0:e.bundledOffers)||void 0===d||d.map(o=>{var l,i,n;"internet"!==(null===(l=null==o?void 0:o.productType)||void 0===l?void 0:l.toLowerCase())&&"tv"!=(null===(i=null==o?void 0:o.productType)||void 0===i?void 0:i.toLowerCase())||(null==o?void 0:o.recommendAccessory)&&(P=null==o?void 0:o.recommendAccessory),"mobile"!==(null===(n=null==o?void 0:o.productType)||void 0===n?void 0:n.toLowerCase())||(P=!1)}):(null===(t=null==v?void 0:v[0])||void 0===t?void 0:t.recommendAccessory)&&(P=null===(r=null==v?void 0:v[0])||void 0===r?void 0:r.recommendAccessory),P){const o={flow:"WIN"};sessionStorage.setItem(u,JSON.stringify(o))}const C=D||((null==_?void 0:_.enableTVStreamingOptionsStepper)&&(null===(a=null==c?void 0:c.vasStepperURL)||void 0===a?void 0:a.cached_url)?null===(f=null==c?void 0:c.vasStepperURL)||void 0===f?void 0:f.cached_url:P&&(null===(y=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===y?void 0:y.cached_url)?null===(g=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===g?void 0:g.cached_url:null===(b=null==c?void 0:c.summaryPageUrl)||void 0===b?void 0:b.cached_url);s(C,A)}).catch(o=>{console.log(o)}).finally(()=>{i(!1)})):(null==c?void 0:c.enableLinecheckOverlay)?P(!C):w()}},L=new Map,O=(o,l,i=100)=>{const n=L.get(o);n&&clearTimeout(n),L.set(o,setTimeout(()=>{L.delete(o),E(o,l)},i))},E=(o,l)=>{c(`headingV3${o}`,l),c(`descriptionV3${o}`,l),c(`titleV3${o}`,l),(()=>{let i=0;const n=[];[...Array(l)].forEach((l,e)=>{const d=document.getElementById(`timer-section${o}${e}`);if(d){n.push(d);if("true"===d.dataset.timerActive){const o=d.firstElementChild,l=parseFloat((null==o?void 0:o.style.height)||"0")||0;i=Math.max(i,l)}}}),n.forEach(o=>{const l="true"===o.dataset.timerActive;o.style.transition="height 0.3s ease",o.style.height=l?"0px":`${i}px`})})(),c(`detailsectionv3${o}`,l),c(`product-configv3${o}`,l),c(`gift-section${o}`,l),c(`benefits-section${o}`,l),c(`order-section${o}`,l),c(`price-section${o}`,l),c(`benefits-price-section${o}`,l),c(`contract-section${o}`,l),c(`exclusive-benefits-section${o}`,l),c(`discountedpricetoggle-section${o}`,l)},A=(o,i,n,e,d,u)=>{var t,v,r,c,a,s,p;const g={msisdn:null!==(t=null==e?void 0:e.msisdn)&&void 0!==t?t:"",ratePlan:null!==(v=null==e?void 0:e.ratePlan)&&void 0!==v?v:"",ratePlanType:null!==(r=null==e?void 0:e.ratePlanType)&&void 0!==r?r:"",productId:e?null==o?void 0:o.id:""},I=(null==o?void 0:o.promoID)?null==o?void 0:o.promoID:l;let P="";P=`?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${null!=I?I:""}&productCode=${null!==(c=null==o?void 0:o.id)&&void 0!==c?c:""}`,window.location.href=(null===(p=null===(s=null===(a=null==i?void 0:i.addSmartPhone)||void 0===a?void 0:a[0])||void 0===s?void 0:s.buttonLink)||void 0===p?void 0:p.cached_url)+P,((o,l,i,n,e,d)=>{var u,t,v,r,c,a,s,p,m,f,y,g,h,I,b,T,D,P,C,w,N,S,_,x,L;const O=l,E=null!==(r=null===(v=null===(t=null===(u=null==O?void 0:O[0])||void 0===u?void 0:u.prices)||void 0===t?void 0:t[0])||void 0===v?void 0:v.value)&&void 0!==r?r:0,A=null!==(p=null===(s=null===(a=null===(c=null==O?void 0:O[0])||void 0===c?void 0:c.derivedPrice)||void 0===a?void 0:a[0])||void 0===s?void 0:s.value)&&void 0!==p?p:0,M=null!==(g=null===(y=null===(f=null===(m=null==O?void 0:O[0])||void 0===m?void 0:m.promotionInfo)||void 0===f?void 0:f[0])||void 0===y?void 0:y.contractDuration)&&void 0!==g?g:0,B=null!==(T=null===(b=null===(I=null===(h=null==O?void 0:O[0])||void 0===h?void 0:h.promotionInfo)||void 0===I?void 0:I[0])||void 0===b?void 0:b.campaignDuration)&&void 0!==T?T:0,k=null!=i?i:"",U=d&&(null===(C=null===(P=null===(D=null==l?void 0:l[0])||void 0===D?void 0:D.promotionInfo)||void 0===P?void 0:P[0])||void 0===C?void 0:C.id),R=d&&(null===(S=null===(N=null===(w=null==l?void 0:l[0])||void 0===w?void 0:w.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.version),$=d?{discountRef:U,discountType:"DISCOUNT"}:null,F=[];null==F||F.push({author:"offerType",text:"ATL"}),null==F||F.push({author:"externalPromotionName",text:U}),null==F||F.push({author:"offerVersion",text:R});const V=d?F:null,j=new URLSearchParams(window.location.search).get("flow"),J={mobileSubscription:null!==(x=null===(_=null==O?void 0:O[0])||void 0===_?void 0:_.id)&&void 0!==x?x:"",mobileSubscriptionPrice:A>0?A:E,mobileSubscriptionPromo:o,subGroup:"MOBILE",duration:Number(B>0?B:M),basePrice:E,withoutPromo:!1,pretopostvalue:k,upBenefit:"MULTIMOBILE"==n.mob_benefit_category||"FMC"==n.mob_benefit_category,ultimateBundlePromo:null!==(L=null==e?void 0:e.ultimateBundlePromotion)&&void 0!==L?L:"",clientDiscountInfo:$,extraNotes:V,isOttFlow:"ott"===j};void 0!==typeof window&&sessionStorage.setItem("one-ecommerce-mobileSummary",JSON.stringify(J))})(I,n,e&&g,o,d,u),m(y,f,D(n,"",b)),T(h,n,"",b)},M=(o,i,n,e,d,u)=>{((o,l,i,n,e,d,u)=>{var v,r,c,a,s,p,m,f,y,g,h,I,b,T,D,P,C,w,N,S,_,x,L,O,E,A;const M=l,B=null!==(a=null===(c=null===(r=null===(v=null==M?void 0:M[0])||void 0===v?void 0:v.prices)||void 0===r?void 0:r[0])||void 0===c?void 0:c.value)&&void 0!==a?a:0,k=null!==(f=null===(m=null===(p=null===(s=null==M?void 0:M[0])||void 0===s?void 0:s.derivedPrice)||void 0===p?void 0:p[0])||void 0===m?void 0:m.value)&&void 0!==f?f:0,U=null!==(b=null!==(I=null===(h=null===(g=null===(y=null==M?void 0:M[0])||void 0===y?void 0:y.promotionInfo)||void 0===g?void 0:g[0])||void 0===h?void 0:h.contractDuration)&&void 0!==I?I:null==i?void 0:i.contractDuration)&&void 0!==b?b:0,R=null!==(C=null===(P=null===(D=null===(T=null==M?void 0:M[0])||void 0===T?void 0:T.promotionInfo)||void 0===D?void 0:D[0])||void 0===P?void 0:P.campaignDuration)&&void 0!==C?C:0,$=e&&(null===(S=null===(N=null===(w=null==l?void 0:l[0])||void 0===w?void 0:w.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.id),F=e&&(null===(L=null===(x=null===(_=null==l?void 0:l[0])||void 0===_?void 0:_.promotionInfo)||void 0===x?void 0:x[0])||void 0===L?void 0:L.version),V=e?{discountRef:$,discountType:"DISCOUNT"}:null,j=[];null==j||j.push({author:"offerType",text:"ATL"}),null==j||j.push({author:"externalPromotionName",text:$}),null==j||j.push({author:"offerVersion",text:F});const J=e?j:null,G={internetSubscription:null!=d?d:"",internetSubscriptionId:null!==(E=null===(O=null==M?void 0:M[0])||void 0===O?void 0:O.id)&&void 0!==E?E:"",internetSubscriptionPrice:k>0?k:B,internetSubscriptionPromo:o,subGroup:"INTERNET",duration:Number(R>0?R:U),basePrice:B,withPromo:k>0,upBenefit:"MULTIMOBILE"==i.mob_benefit_category||"FMC"==i.mob_benefit_category,ultimateBundlePromo:null!==(A=null==n?void 0:n.ultimateBundlePromotion)&&void 0!==A?A:"",clientDiscountInfo:V,extraNotes:J,productType:"subscription",recommendAccessory:u};void 0!==typeof window&&sessionStorage.setItem(t,JSON.stringify(G))})((null==o?void 0:o.promoID)?null==o?void 0:o.promoID:l,i,o,n,e,d,u),m(y,f,D(i,"",b)),T(h,i,"",b)},B=(o,l)=>{let i;return l||(i=(o||[]).filter(o=>!0===(null==o?void 0:o.enableTV))),i},k=(o,l,i,n,e,d)=>{var u,t,v,r,c,a,s,p,m,f,y;const g={base:"",onetimePrice:"",discount:[],contractDuration:"",int_fmc:0,mob_fmc:0,mob_benefit_category:"",id:"",promoID:"",loyaltyPrice:""};let h=0,I=0,b=0;Array.isArray(o)&&(null==o||o.map(l=>{var i,n,u,t,v,r,c,a,s;g.id=null!==(i=null==l?void 0:l.id)&&void 0!==i?i:"",null===(n=null==l?void 0:l.prices)||void 0===n||n.map(o=>{var l,i;"recurring"===(null===(l=null==o?void 0:o.priceType)||void 0===l?void 0:l.toLowerCase())?e&&(null==e?void 0:e.length)>0?(null==e||e.forEach(o=>{(null==o?void 0:o.beneficiaryPrice)>0?I+=parseFloat(null==o?void 0:o.beneficiaryPrice):(null==o?void 0:o.derivedPrice)>0?I+=parseFloat(null==o?void 0:o.derivedPrice):b+=parseFloat(null==o?void 0:o.recurringPrice),(null==o?void 0:o.recurringPrice)>0&&(h+=parseFloat(null==o?void 0:o.recurringPrice))}),I>0&&(I+=b),g.base=JSON.stringify(parseFloat(null==o?void 0:o.value)+(I>0?I:h))):g.base=null==o?void 0:o.value:"one time"===(null===(i=null==o?void 0:o.priceType)||void 0===i?void 0:i.toLowerCase())&&(g.onetimePrice=null==o?void 0:o.value)}),null===(u=null==l?void 0:l.derivedPrice)||void 0===u||u.map(l=>{var i,n,u,t,v,r,c,a;const s={cycleStart:"",cycleEnd:"",value:""};s.cycleStart=d&&!(null===(i=null==o?void 0:o[0])||void 0===i?void 0:i.isBundle)&&(null===(n=null==o?void 0:o[0])||void 0===n?void 0:n.contractDuration)?1:null===(u=null==l?void 0:l.cycle)||void 0===u?void 0:u.cycleStart,s.cycleEnd=d&&!(null===(t=null==o?void 0:o[0])||void 0===t?void 0:t.isBundle)&&(null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.contractDuration)?d&&!(null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.isBundle)&&(null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.contractDuration):null===(a=null==l?void 0:l.cycle)||void 0===a?void 0:a.cycleEnd,s.value=null==l?void 0:l.value,e&&(null==e?void 0:e.length)>0&&(s.value=I>0?JSON.stringify(parseFloat(null==l?void 0:l.value)+I):JSON.stringify(parseFloat(null==l?void 0:l.value)+h)),g.discount.push(s)}),(null===(r=null===(v=null===(t=null==l?void 0:l.promotionInfo)||void 0===t?void 0:t[0])||void 0===v?void 0:v.relatedPromo)||void 0===r?void 0:r.length)>0&&(null===(s=null===(a=null===(c=null==l?void 0:l.promotionInfo)||void 0===c?void 0:c[0])||void 0===a?void 0:a.relatedPromo)||void 0===s||s.map(o=>{"LOYALTY_DISCOUNT"===(null==o?void 0:o.type)&&(g.loyaltyPrice=null==o?void 0:o.discount)}))})),null===(t=null===(u=null==o?void 0:o[0])||void 0===u?void 0:u.bundledOffers)||void 0===t||t.forEach(o=>{var l,i,n,e,u;null===(l=null==o?void 0:o.prices)||void 0===l||l.forEach(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.forEach(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?g.int_fmc+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(g.mob_fmc+=Number(null==o?void 0:o.value),g.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==o?void 0:o.contractDuration)&&(g.contractDuration=null==o?void 0:o.contractDuration),(null===(n=null===(i=null==o?void 0:o.promotionInfo)||void 0===i?void 0:i[0])||void 0===n?void 0:n.id)&&!d&&(g.promoID=null===(u=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===u?void 0:u.id)}),(null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.isBundle)||(g.contractDuration=null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.contractDuration,d||(g.promoID=null===(s=null===(a=null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.promotionInfo)||void 0===a?void 0:a[0])||void 0===s?void 0:s.id));let T=0;if(null===(m=null===(p=null==o?void 0:o[0])||void 0===p?void 0:p.prices)||void 0===m||m.map(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.map(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?T+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(g.mob_fmc+=Number(null==o?void 0:o.value),g.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==g?void 0:g.contractDuration)||l||(g.contractDuration="12"),g.int_fmc=g.int_fmc,"4P"==i){let l="0";null===(y=null===(f=null==o?void 0:o[0])||void 0===f?void 0:f.bundledOffers)||void 0===y||y.map(o=>{(null==o?void 0:o.contractDuration)&&(l=Number(l)>Number(null==o?void 0:o.contractDuration)?l:null==o?void 0:o.contractDuration)}),g.contractDuration=l}return g},U=(o,l)=>{var i,n;let e=o;e=o.filter(o=>{var i;const n=null===(i=null==o?void 0:o.gigaSpeed)||void 0===i?void 0:i.toLowerCase();return(null==l?void 0:l.gigaSpeed)?"hide"!=n:"show"!=n});let d=e;let u=[],t=[],v=[];for(let o of d){const l=null===(i=null==o?void 0:o.productIndex)||void 0===i?void 0:i.includes(","),e=l&&(null===(n=null==o?void 0:o.productIndex)||void 0===n?void 0:n.split(","));if(l)for(let l of e)for(let i=0;i<3;i++)Number(l)===i&&(0===i?u.push(o):1===i?t.push(o):v.push(o));else for(let l=0;l<3;l++)Number(null==o?void 0:o.productIndex)===l&&(0===l?u.push(o):1===l?t.push(o):v.push(o))}return(null==l?void 0:l.TV)&&(null==l?void 0:l.Netflix)?v:(null==l?void 0:l.TV)?t:u},R=o=>{var l;return null===(l=(null==o?void 0:o.products)||[])||void 0===l?void 0:l.map(o=>{var l,e,d;return{itemType:null!==(l=null==o?void 0:o.type)&&void 0!==l?l:"",promotionId:null!==(e=null==o?void 0:o.promo)&&void 0!==e?e:"",items:[{itemType:(null==o?void 0:o.type)===i?i:n,id:null!==(d=null==o?void 0:o.id)&&void 0!==d?d:""}]}})};let $=null;const F=o=>(null==$?void 0:$.gloxTokenId)===o&&null!==$.results,V=(o,l,i)=>{if(F(o))return Promise.resolve($.results);if((null==$?void 0:$.gloxTokenId)===o&&null!==$.promise)return $.promise;const n=v(o,l,i).then(i=>{var n;const e=null!==(n=null==i?void 0:i[l])&&void 0!==n?n:[];return(null==$?void 0:$.gloxTokenId)===o&&($.results=e,$.promise=null),e}).catch(l=>{throw(null==$?void 0:$.gloxTokenId)===o&&($=null),l});return $={gloxTokenId:o,results:null,promise:n},n},j=(o,l)=>{const i=o.filter(o=>{var i,n,e,d,u,t;const v=null===(t=null===(u=null===(d=null===(e=null===(n=null===(i=null==o?void 0:o.products)||void 0===i?void 0:i[0])||void 0===n?void 0:n.reference)||void 0===e?void 0:e.content)||void 0===d?void 0:d.product)||void 0===u?void 0:u[0])||void 0===t?void 0:t.productId;return l.includes(v)});return i.sort((o,i)=>{var n,e,d,u,t,v,r,c,a,s,p,m;const f=null===(v=null===(t=null===(u=null===(d=null===(e=null===(n=null==o?void 0:o.products)||void 0===n?void 0:n[0])||void 0===e?void 0:e.reference)||void 0===d?void 0:d.content)||void 0===u?void 0:u.product)||void 0===t?void 0:t[0])||void 0===v?void 0:v.productId,y=null===(m=null===(p=null===(s=null===(a=null===(c=null===(r=null==i?void 0:i.products)||void 0===r?void 0:r[0])||void 0===c?void 0:c.reference)||void 0===a?void 0:a.content)||void 0===s?void 0:s.product)||void 0===p?void 0:p[0])||void 0===m?void 0:m.productId;return l.indexOf(f)-l.indexOf(y)}),i};export{_ as checkGiftOrCashback,A as combineWithSmartPhone,M as combineWithVasOptions,U as fetchFilteredProducts,R as fetchOttItems,S as fetchPegaProducts,k as fetchPrice,B as fetchServiceOptions,N as fetchStaticProductIds,j as filterShogunProducts,E as findHeight,V as getShogunSharedOffer,w as getTimeUntilNextTimerEvent,F as isShogunOfferResolved,C as isTimerActive,O as scheduleFindHeight,x as staticCreateCart};
|
|
1
|
+
import o from"js-cookie";import{DEFAULT_MOBILEPOSTPAID_BUNDLE as l,TV_SERVICE_OPTION as i,RATEPLAN as n,VCTYPE as e,DEFAULT_WIRELINE_BUNDLE as d,ONE_ECOMMERCE_SUMMARY as t,ONE_ECOMMERCE_INTERNET_SUMMARY as u}from"../../utils/constants.js";import{fetchShogunOfferData as v,createCartV2 as r}from"../../services/LineTableService.js";import{getElementMaximumHeight as c,getLocalStorageWithExpiry as a,redirectWithSuccess as s,checkLinkWithLang as p}from"../../utils/utils.js";import{trackNewDatalayerEvent as m}from"../../utils/AnalyticsUtils.js";import{COMBINEDEVICE as f,GAEVENT as y,LINETABLEPRODUCT as h,ADDTOCART as g,LINETABLE as I,LINETABLEDEVICE as b}from"../../Analytics/AnalyticsConstants.js";import{trackEligibleItem as T,getEcomCartInfo as D}from"../../models/Analytics/items.js";import{calculateDateTime as P}from"./StaticLineTabelTimer/util.js";const C=(o,l)=>{try{const i=new Date,n=P(new Date(o.replace(/-/g,"/"))),e=P(new Date(l.replace(/-/g,"/")));return!Number.isNaN(n.getTime())&&!Number.isNaN(e.getTime())&&(i>=n&&i<e)}catch(o){return!1}},w=(o,l)=>{try{const i=P(new Date(o.replace(/-/g,"/"))),n=P(new Date(l.replace(/-/g,"/")));if(Number.isNaN(i.getTime())||Number.isNaN(n.getTime()))return 0;const e=(new Date).getTime(),d=i.getTime(),t=n.getTime();return e<d?Math.max(0,d-e):e>=d&&e<t?Math.max(0,t-e):0}catch(o){return 0}},N=(o,i,n,e,d)=>{null==o||o.map(o=>{var e,t,u,v,r,c,a,s,p,m,f,y,h,g,I,b,T,D,P,w,N,S,_,x,L;const O={id:"",promoIds:[]},E=null===(r=null===(v=null===(u=null===(t=null===(e=null==o?void 0:o.products)||void 0===e?void 0:e[0])||void 0===t?void 0:t.reference)||void 0===u?void 0:u.content)||void 0===v?void 0:v.product)||void 0===r?void 0:r[0],M=null===(m=null===(p=null===(s=null===(a=null===(c=null==o?void 0:o.promotion)||void 0===c?void 0:c[0])||void 0===a?void 0:a.reference)||void 0===s?void 0:s.content)||void 0===p?void 0:p.promoDescription)||void 0===m?void 0:m[0];null==M||M.promotionId,O.id=null==E?void 0:E.productId;const A=null===(f=null==o?void 0:o.timer)||void 0===f?void 0:f[0],B=!!A&&C(A.startTime,A.endTime),k=null===(T=null===(b=null===(I=null===(g=null===(h=null===(y=null==A?void 0:A.promotion)||void 0===y?void 0:y[0])||void 0===h?void 0:h.reference)||void 0===g?void 0:g.content)||void 0===I?void 0:I.promoDescription)||void 0===b?void 0:b[0])||void 0===T?void 0:T.promotionId,U=d&&!0===d&&""===(null==M?void 0:M.promotionId)?l:null==M?void 0:M.promotionId;if(B&&k?null===(D=null==O?void 0:O.promoIds)||void 0===D||D.push(k):null===(P=null==O?void 0:O.promoIds)||void 0===P||P.push(U),n){const l=null===(x=null===(_=null===(S=null===(N=null===(w=null==o?void 0:o.mobilePromotion)||void 0===w?void 0:w[0])||void 0===N?void 0:N.reference)||void 0===S?void 0:S.content)||void 0===_?void 0:_.promoDescription)||void 0===x?void 0:x[0];null===(L=null==O?void 0:O.promoIds)||void 0===L||L.push(null==l?void 0:l.promotionId)}null==i||i.push(O)})},S=(o,l,i)=>{var n,e,d;const t=null===(n=null==o?void 0:o.tabCaption)||void 0===n?void 0:n.replace(/\b\w/g,o=>o.toUpperCase()).replace(/\s+/g,"");return{atlOffers:[{placements:i,offerValidations:[{key:"Segment",type:"CustomerType",value:"Residential"},{key:"OrderType",type:"CustomerInterest",value:"New"},{key:"CurrentPage",type:"Context",value:"mobile-subscription"},{key:"Category",type:"CustomerInterest",value:null!=t?t:""},{key:"RequestedOfferCount",type:"Context",value:null!==(d=null===(e=null==o?void 0:o.pegaRequestOfferCount)||void 0===e?void 0:e.toString())&&void 0!==d?d:"3"},l?{key:"Tag",type:"CustomerInterest",value:l}:null].filter(Boolean)}]}},_=o=>{let l=!1,i=!1;return null==o||o.map(o=>{var n;null===(n=null==o?void 0:o.promotionInfo)||void 0===n||n.map(o=>{(null==o?void 0:o.hardwareGift)&&(l=!0),(null==o?void 0:o.cashBack)&&(i=!0)})}),{showGift:l,cashbackAvailable:i}},x=(i,n,u,v,c,m,f,y,b,D,P,C,w,N,S,_,x,L,O,E,M)=>{var A,B,k;if(f){i(!0);const d=a(e);0!==(null===(A=Object.keys(v))||void 0===A?void 0:A.length)&&r(v,"",(null==m?void 0:m.promoID)?null==m?void 0:m.promoID:l,n,"mobile",u,N,S,null===(k=null===(B=null==c?void 0:c.productContainer)||void 0===B?void 0:B[0])||void 0===k?void 0:k.isQoQaFlow,null==d?void 0:d.voucher,null,null,L,O,E).then(l=>{var i;o.remove("one-commerce-cartId",{path:"/"}),o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),o.set("cartProduct",null==m?void 0:m.id,{path:"/"}),T(g,v,"",h),s(null===(i=null==c?void 0:c.summaryPageUrl)||void 0===i?void 0:i.cached_url,M)}).catch(o=>{console.log(o),i(!1)}).finally(()=>{i(!1)})}else{const l="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid");b&&D&&l?(i(!0),0!==v.length&&r(v,y,(null==m?void 0:m.promoID)?null==m?void 0:m.promoID:d,n,"fixnet",u,"","",!1,"","",x,void 0,void 0,E).then(l=>{var i,n,e,d,u,r,a,f,y,h,b;"undefined"!=typeof window&&o.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&o.set("one-commerce-cartId",null==l?void 0:l.id,{path:"/"}),"undefined"!=typeof window&&o.set("cartProduct",null==m?void 0:m.id,{path:"/"}),"undefined"!=typeof window&&o.remove("landline"),T(g,v,"",I);const D=p(null===(i=null==_?void 0:_.productBasedCheckoutUrl)||void 0===i?void 0:i.cached_url);let P=!1;if((null===(n=v[0])||void 0===n?void 0:n.isBundle)?null===(d=null===(e=v[0])||void 0===e?void 0:e.bundledOffers)||void 0===d||d.map(o=>{var l,i,n;"internet"!==(null===(l=null==o?void 0:o.productType)||void 0===l?void 0:l.toLowerCase())&&"tv"!=(null===(i=null==o?void 0:o.productType)||void 0===i?void 0:i.toLowerCase())||(null==o?void 0:o.recommendAccessory)&&(P=null==o?void 0:o.recommendAccessory),"mobile"!==(null===(n=null==o?void 0:o.productType)||void 0===n?void 0:n.toLowerCase())||(P=!1)}):(null===(u=null==v?void 0:v[0])||void 0===u?void 0:u.recommendAccessory)&&(P=null===(r=null==v?void 0:v[0])||void 0===r?void 0:r.recommendAccessory),P){const o={flow:"WIN"};sessionStorage.setItem(t,JSON.stringify(o))}const C=D||((null==_?void 0:_.enableTVStreamingOptionsStepper)&&(null===(a=null==c?void 0:c.vasStepperURL)||void 0===a?void 0:a.cached_url)?null===(f=null==c?void 0:c.vasStepperURL)||void 0===f?void 0:f.cached_url:P&&(null===(y=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===y?void 0:y.cached_url)?null===(h=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===h?void 0:h.cached_url:null===(b=null==c?void 0:c.summaryPageUrl)||void 0===b?void 0:b.cached_url);s(C,M)}).catch(o=>{console.log(o)}).finally(()=>{i(!1)})):(null==c?void 0:c.enableLinecheckOverlay)?P(!C):w()}},L=new Map,O=(o,l,i)=>{const n=[];for(const e of o){const o=`${e}${l}`,d=[];for(let l=0;l<i;l++){const i=document.getElementById(`${o}${l}`);i&&d.push(i)}d.length>0&&n.push(d)}if(0===n.length)return;for(const o of n)for(const l of o)l.style.height="unset";const e=n.map(o=>Math.max(...o.map(o=>o.clientHeight)));n.forEach((o,l)=>{const i=`${e[l]}px`;for(const l of o)l.style.height=i})},E=(o,l,i=0)=>{const n=L.get(o);if(n)if("boolean"!=typeof n)clearTimeout(n);else if(i<=0)return;if(i<=0&&"function"==typeof queueMicrotask)return L.set(o,!0),void queueMicrotask(()=>{L.delete(o),M(o,l)});L.set(o,setTimeout(()=>{L.delete(o),M(o,l)},i))},M=(o,l)=>{(()=>{let i=0;const n=[];[...Array(l)].forEach((l,e)=>{const d=document.getElementById(`timer-section${o}${e}`);if(d){n.push(d);if("true"===d.dataset.timerActive){const o=d.firstElementChild,l=parseFloat((null==o?void 0:o.style.height)||"0")||0;i=Math.max(i,l)}}}),n.forEach(o=>{const l="true"===o.dataset.timerActive;o.style.transition="height 0.3s ease",o.style.height=l?"0px":`${i}px`})})(),O(["headingV3","descriptionV3","titleV3","product-configv3","cashback-section","exclusive-benefits-section","benefits-section","price-section","discountedpricetoggle-section","contract-section"],o,l),O(["detailsectionv3","gift-section","order-section"],o,l),c(`benefits-price-section${o}`,l)},A=(o,i,n,e,d,t)=>{var u,v,r,c,a,s,p;const h={msisdn:null!==(u=null==e?void 0:e.msisdn)&&void 0!==u?u:"",ratePlan:null!==(v=null==e?void 0:e.ratePlan)&&void 0!==v?v:"",ratePlanType:null!==(r=null==e?void 0:e.ratePlanType)&&void 0!==r?r:"",productId:e?null==o?void 0:o.id:""},I=(null==o?void 0:o.promoID)?null==o?void 0:o.promoID:l;let P="";P=`?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${null!=I?I:""}&productCode=${null!==(c=null==o?void 0:o.id)&&void 0!==c?c:""}`,window.location.href=(null===(p=null===(s=null===(a=null==i?void 0:i.addSmartPhone)||void 0===a?void 0:a[0])||void 0===s?void 0:s.buttonLink)||void 0===p?void 0:p.cached_url)+P,((o,l,i,n,e,d)=>{var t,u,v,r,c,a,s,p,m,f,y,h,g,I,b,T,D,P,C,w,N,S,_,x,L;const O=l,E=null!==(r=null===(v=null===(u=null===(t=null==O?void 0:O[0])||void 0===t?void 0:t.prices)||void 0===u?void 0:u[0])||void 0===v?void 0:v.value)&&void 0!==r?r:0,M=null!==(p=null===(s=null===(a=null===(c=null==O?void 0:O[0])||void 0===c?void 0:c.derivedPrice)||void 0===a?void 0:a[0])||void 0===s?void 0:s.value)&&void 0!==p?p:0,A=null!==(h=null===(y=null===(f=null===(m=null==O?void 0:O[0])||void 0===m?void 0:m.promotionInfo)||void 0===f?void 0:f[0])||void 0===y?void 0:y.contractDuration)&&void 0!==h?h:0,B=null!==(T=null===(b=null===(I=null===(g=null==O?void 0:O[0])||void 0===g?void 0:g.promotionInfo)||void 0===I?void 0:I[0])||void 0===b?void 0:b.campaignDuration)&&void 0!==T?T:0,k=null!=i?i:"",U=d&&(null===(C=null===(P=null===(D=null==l?void 0:l[0])||void 0===D?void 0:D.promotionInfo)||void 0===P?void 0:P[0])||void 0===C?void 0:C.id),R=d&&(null===(S=null===(N=null===(w=null==l?void 0:l[0])||void 0===w?void 0:w.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.version),F=d?{discountRef:U,discountType:"DISCOUNT"}:null,$=[];null==$||$.push({author:"offerType",text:"ATL"}),null==$||$.push({author:"externalPromotionName",text:U}),null==$||$.push({author:"offerVersion",text:R});const V=d?$:null,j=new URLSearchParams(window.location.search).get("flow"),J={mobileSubscription:null!==(x=null===(_=null==O?void 0:O[0])||void 0===_?void 0:_.id)&&void 0!==x?x:"",mobileSubscriptionPrice:M>0?M:E,mobileSubscriptionPromo:o,subGroup:"MOBILE",duration:Number(B>0?B:A),basePrice:E,withoutPromo:!1,pretopostvalue:k,upBenefit:"MULTIMOBILE"==n.mob_benefit_category||"FMC"==n.mob_benefit_category,ultimateBundlePromo:null!==(L=null==e?void 0:e.ultimateBundlePromotion)&&void 0!==L?L:"",clientDiscountInfo:F,extraNotes:V,isOttFlow:"ott"===j};void 0!==typeof window&&sessionStorage.setItem("one-ecommerce-mobileSummary",JSON.stringify(J))})(I,n,e&&h,o,d,t),m(y,f,D(n,"",b)),T(g,n,"",b)},B=(o,i,n,e,d,t)=>{((o,l,i,n,e,d,t)=>{var v,r,c,a,s,p,m,f,y,h,g,I,b,T,D,P,C,w,N,S,_,x,L,O,E,M;const A=l,B=null!==(a=null===(c=null===(r=null===(v=null==A?void 0:A[0])||void 0===v?void 0:v.prices)||void 0===r?void 0:r[0])||void 0===c?void 0:c.value)&&void 0!==a?a:0,k=null!==(f=null===(m=null===(p=null===(s=null==A?void 0:A[0])||void 0===s?void 0:s.derivedPrice)||void 0===p?void 0:p[0])||void 0===m?void 0:m.value)&&void 0!==f?f:0,U=null!==(b=null!==(I=null===(g=null===(h=null===(y=null==A?void 0:A[0])||void 0===y?void 0:y.promotionInfo)||void 0===h?void 0:h[0])||void 0===g?void 0:g.contractDuration)&&void 0!==I?I:null==i?void 0:i.contractDuration)&&void 0!==b?b:0,R=null!==(C=null===(P=null===(D=null===(T=null==A?void 0:A[0])||void 0===T?void 0:T.promotionInfo)||void 0===D?void 0:D[0])||void 0===P?void 0:P.campaignDuration)&&void 0!==C?C:0,F=e&&(null===(S=null===(N=null===(w=null==l?void 0:l[0])||void 0===w?void 0:w.promotionInfo)||void 0===N?void 0:N[0])||void 0===S?void 0:S.id),$=e&&(null===(L=null===(x=null===(_=null==l?void 0:l[0])||void 0===_?void 0:_.promotionInfo)||void 0===x?void 0:x[0])||void 0===L?void 0:L.version),V=e?{discountRef:F,discountType:"DISCOUNT"}:null,j=[];null==j||j.push({author:"offerType",text:"ATL"}),null==j||j.push({author:"externalPromotionName",text:F}),null==j||j.push({author:"offerVersion",text:$});const J=e?j:null,q={internetSubscription:null!=d?d:"",internetSubscriptionId:null!==(E=null===(O=null==A?void 0:A[0])||void 0===O?void 0:O.id)&&void 0!==E?E:"",internetSubscriptionPrice:k>0?k:B,internetSubscriptionPromo:o,subGroup:"INTERNET",duration:Number(R>0?R:U),basePrice:B,withPromo:k>0,upBenefit:"MULTIMOBILE"==i.mob_benefit_category||"FMC"==i.mob_benefit_category,ultimateBundlePromo:null!==(M=null==n?void 0:n.ultimateBundlePromotion)&&void 0!==M?M:"",clientDiscountInfo:V,extraNotes:J,productType:"subscription",recommendAccessory:t};void 0!==typeof window&&sessionStorage.setItem(u,JSON.stringify(q))})((null==o?void 0:o.promoID)?null==o?void 0:o.promoID:l,i,o,n,e,d,t),m(y,f,D(i,"",b)),T(g,i,"",b)},k=(o,l)=>{let i;return l||(i=(o||[]).filter(o=>!0===(null==o?void 0:o.enableTV))),i},U=(o,l,i,n,e,d)=>{var t,u,v,r,c,a,s,p,m,f,y;const h={base:"",onetimePrice:"",discount:[],contractDuration:"",int_fmc:0,mob_fmc:0,mob_benefit_category:"",id:"",promoID:"",loyaltyPrice:""};let g=0,I=0,b=0;Array.isArray(o)&&(null==o||o.map(l=>{var i,n,t,u,v,r,c,a,s;h.id=null!==(i=null==l?void 0:l.id)&&void 0!==i?i:"",null===(n=null==l?void 0:l.prices)||void 0===n||n.map(o=>{var l,i;"recurring"===(null===(l=null==o?void 0:o.priceType)||void 0===l?void 0:l.toLowerCase())?e&&(null==e?void 0:e.length)>0?(null==e||e.forEach(o=>{(null==o?void 0:o.beneficiaryPrice)>0?I+=parseFloat(null==o?void 0:o.beneficiaryPrice):(null==o?void 0:o.derivedPrice)>0?I+=parseFloat(null==o?void 0:o.derivedPrice):b+=parseFloat(null==o?void 0:o.recurringPrice),(null==o?void 0:o.recurringPrice)>0&&(g+=parseFloat(null==o?void 0:o.recurringPrice))}),I>0&&(I+=b),h.base=JSON.stringify(parseFloat(null==o?void 0:o.value)+(I>0?I:g))):h.base=null==o?void 0:o.value:"one time"===(null===(i=null==o?void 0:o.priceType)||void 0===i?void 0:i.toLowerCase())&&(h.onetimePrice=null==o?void 0:o.value)}),null===(t=null==l?void 0:l.derivedPrice)||void 0===t||t.map(l=>{var i,n,t,u,v,r,c,a;const s={cycleStart:"",cycleEnd:"",value:""};s.cycleStart=d&&!(null===(i=null==o?void 0:o[0])||void 0===i?void 0:i.isBundle)&&(null===(n=null==o?void 0:o[0])||void 0===n?void 0:n.contractDuration)?1:null===(t=null==l?void 0:l.cycle)||void 0===t?void 0:t.cycleStart,s.cycleEnd=d&&!(null===(u=null==o?void 0:o[0])||void 0===u?void 0:u.isBundle)&&(null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.contractDuration)?d&&!(null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.isBundle)&&(null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.contractDuration):null===(a=null==l?void 0:l.cycle)||void 0===a?void 0:a.cycleEnd,s.value=null==l?void 0:l.value,e&&(null==e?void 0:e.length)>0&&(s.value=I>0?JSON.stringify(parseFloat(null==l?void 0:l.value)+I):JSON.stringify(parseFloat(null==l?void 0:l.value)+g)),h.discount.push(s)}),(null===(r=null===(v=null===(u=null==l?void 0:l.promotionInfo)||void 0===u?void 0:u[0])||void 0===v?void 0:v.relatedPromo)||void 0===r?void 0:r.length)>0&&(null===(s=null===(a=null===(c=null==l?void 0:l.promotionInfo)||void 0===c?void 0:c[0])||void 0===a?void 0:a.relatedPromo)||void 0===s||s.map(o=>{"LOYALTY_DISCOUNT"===(null==o?void 0:o.type)&&(h.loyaltyPrice=null==o?void 0:o.discount)}))})),null===(u=null===(t=null==o?void 0:o[0])||void 0===t?void 0:t.bundledOffers)||void 0===u||u.forEach(o=>{var l,i,n,e,t;null===(l=null==o?void 0:o.prices)||void 0===l||l.forEach(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.forEach(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?h.int_fmc+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(h.mob_fmc+=Number(null==o?void 0:o.value),h.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==o?void 0:o.contractDuration)&&(h.contractDuration=null==o?void 0:o.contractDuration),(null===(n=null===(i=null==o?void 0:o.promotionInfo)||void 0===i?void 0:i[0])||void 0===n?void 0:n.id)&&!d&&(h.promoID=null===(t=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===t?void 0:t.id)}),(null===(v=null==o?void 0:o[0])||void 0===v?void 0:v.isBundle)||(h.contractDuration=null===(r=null==o?void 0:o[0])||void 0===r?void 0:r.contractDuration,d||(h.promoID=null===(s=null===(a=null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.promotionInfo)||void 0===a?void 0:a[0])||void 0===s?void 0:s.id));let T=0;if(null===(m=null===(p=null==o?void 0:o[0])||void 0===p?void 0:p.prices)||void 0===m||m.map(o=>{var l,i;(null===(l=null==o?void 0:o.priceAlteration)||void 0===l?void 0:l.length)>0&&(null===(i=null==o?void 0:o.priceAlteration)||void 0===i||i.map(o=>{"INTERNET_FMC"==(null==o?void 0:o.priceCategory)?T+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(null==o?void 0:o.priceCategory)&&"MULTIMOBILE_REWARD"!=(null==o?void 0:o.priceCategory)&&"FMC"!=(null==o?void 0:o.priceCategory)||(h.mob_fmc+=Number(null==o?void 0:o.value),h.mob_benefit_category=null==o?void 0:o.priceCategory)}))}),(null==h?void 0:h.contractDuration)||l||(h.contractDuration="12"),h.int_fmc=h.int_fmc,"4P"==i){let l="0";null===(y=null===(f=null==o?void 0:o[0])||void 0===f?void 0:f.bundledOffers)||void 0===y||y.map(o=>{(null==o?void 0:o.contractDuration)&&(l=Number(l)>Number(null==o?void 0:o.contractDuration)?l:null==o?void 0:o.contractDuration)}),h.contractDuration=l}return h},R=(o,l)=>{var i,n;let e=o;e=o.filter(o=>{var i;const n=null===(i=null==o?void 0:o.gigaSpeed)||void 0===i?void 0:i.toLowerCase();return(null==l?void 0:l.gigaSpeed)?"hide"!=n:"show"!=n});let d=e;let t=[],u=[],v=[];for(let o of d){const l=null===(i=null==o?void 0:o.productIndex)||void 0===i?void 0:i.includes(","),e=l&&(null===(n=null==o?void 0:o.productIndex)||void 0===n?void 0:n.split(","));if(l)for(let l of e)for(let i=0;i<3;i++)Number(l)===i&&(0===i?t.push(o):1===i?u.push(o):v.push(o));else for(let l=0;l<3;l++)Number(null==o?void 0:o.productIndex)===l&&(0===l?t.push(o):1===l?u.push(o):v.push(o))}return(null==l?void 0:l.TV)&&(null==l?void 0:l.Netflix)?v:(null==l?void 0:l.TV)?u:t},F=o=>{var l;return null===(l=(null==o?void 0:o.products)||[])||void 0===l?void 0:l.map(o=>{var l,e,d;return{itemType:null!==(l=null==o?void 0:o.type)&&void 0!==l?l:"",promotionId:null!==(e=null==o?void 0:o.promo)&&void 0!==e?e:"",items:[{itemType:(null==o?void 0:o.type)===i?i:n,id:null!==(d=null==o?void 0:o.id)&&void 0!==d?d:""}]}})};let $=null;const V=o=>(null==$?void 0:$.gloxTokenId)===o&&null!==$.results,j=(o,l,i)=>{if(V(o))return Promise.resolve($.results);if((null==$?void 0:$.gloxTokenId)===o&&null!==$.promise)return $.promise;const n=v(o,l,i).then(i=>{var n;const e=null!==(n=null==i?void 0:i[l])&&void 0!==n?n:[];return(null==$?void 0:$.gloxTokenId)===o&&($.results=e,$.promise=null),e}).catch(l=>{throw(null==$?void 0:$.gloxTokenId)===o&&($=null),l});return $={gloxTokenId:o,results:null,promise:n},n},J=(o,l)=>{const i=o.filter(o=>{var i,n,e,d,t,u;const v=null===(u=null===(t=null===(d=null===(e=null===(n=null===(i=null==o?void 0:o.products)||void 0===i?void 0:i[0])||void 0===n?void 0:n.reference)||void 0===e?void 0:e.content)||void 0===d?void 0:d.product)||void 0===t?void 0:t[0])||void 0===u?void 0:u.productId;return l.includes(v)});return i.sort((o,i)=>{var n,e,d,t,u,v,r,c,a,s,p,m;const f=null===(v=null===(u=null===(t=null===(d=null===(e=null===(n=null==o?void 0:o.products)||void 0===n?void 0:n[0])||void 0===e?void 0:e.reference)||void 0===d?void 0:d.content)||void 0===t?void 0:t.product)||void 0===u?void 0:u[0])||void 0===v?void 0:v.productId,y=null===(m=null===(p=null===(s=null===(a=null===(c=null===(r=null==i?void 0:i.products)||void 0===r?void 0:r[0])||void 0===c?void 0:c.reference)||void 0===a?void 0:a.content)||void 0===s?void 0:s.product)||void 0===p?void 0:p[0])||void 0===m?void 0:m.productId;return l.indexOf(f)-l.indexOf(y)}),i};export{_ as checkGiftOrCashback,A as combineWithSmartPhone,B as combineWithVasOptions,R as fetchFilteredProducts,F as fetchOttItems,S as fetchPegaProducts,U as fetchPrice,k as fetchServiceOptions,N as fetchStaticProductIds,J as filterShogunProducts,M as findHeight,j as getShogunSharedOffer,w as getTimeUntilNextTimerEvent,V as isShogunOfferResolved,C as isTimerActive,E as scheduleFindHeight,x as staticCreateCart};
|
|
2
2
|
//# sourceMappingURL=Product.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Product.utils.js","sources":["../../../../src/components/StaticLineTable/Product.utils.ts"],"sourcesContent":["import Cookies from 'js-cookie';\nimport { SetStateAction } from 'react';\nimport {\n DEFAULT_MOBILEPOSTPAID_BUNDLE,\n DEFAULT_WIRELINE_BUNDLE,\n ONE_ECOMMERCE_INTERNET_SUMMARY,\n ONE_ECOMMERCE_SUMMARY,\n RATEPLAN,\n TV_SERVICE_OPTION,\n VCTYPE\n} from '../../utils/constants';\nimport { createCartV2, fetchShogunOfferData } from '../../services/LineTableService';\nimport {\n checkLinkWithLang,\n getElementMaximumHeight,\n getLocalStorageWithExpiry,\n redirectWithSuccess,\n SuccessLoaderData\n} from '../../utils/utils';\nimport { trackNewDatalayerEvent } from '../../utils/AnalyticsUtils';\nimport {\n ADDTOCART,\n COMBINEDEVICE,\n GAEVENT,\n LINETABLE,\n LINETABLEDEVICE,\n LINETABLEPRODUCT\n} from '../../Analytics/AnalyticsConstants';\nimport { getEcomCartInfo, trackEligibleItem } from '../../models/Analytics/items';\nimport { AtlOffer, OfferValidation, PegaProductRequestBase } from '../lineTable/lineTable.types';\nimport { calculateDateTime } from './StaticLineTabelTimer/util';\n\nexport const isTimerActive = (startTime: string, endTime: string): boolean => {\n try {\n const now = new Date();\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\n\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\n return false;\n }\n\n return now >= start && now < end;\n } catch {\n return false;\n }\n};\n\nexport const getTimeUntilNextTimerEvent = (startTime: string, endTime: string): number => {\n try {\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\n\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\n return 0;\n }\n\n const now = new Date().getTime();\n const startTimeMs = start.getTime();\n const endTimeMs = end.getTime();\n\n // Next transition is start when timer is upcoming, otherwise end when active.\n if (now < startTimeMs) {\n return Math.max(0, startTimeMs - now);\n }\n if (now >= startTimeMs && now < endTimeMs) {\n return Math.max(0, endTimeMs - now);\n }\n\n return 0;\n } catch {\n return 0;\n }\n};\n\nexport const fetchStaticProductIds = (\n productList: any,\n productId: any,\n bundle4PProduct?: boolean,\n tvOptionIds?: any,\n //US_31295\n pricesToggleState?: any\n): any => {\n let enableStream = false;\n let promotionId = '';\n productList?.map((data: any) => {\n const productRequest: any = {\n id: '',\n promoIds: []\n };\n\n const productData = data?.products?.[0]?.reference?.content?.product?.[0];\n const promotionData = data?.promotion?.[0]?.reference?.content?.promoDescription?.[0];\n promotionId = promotionData?.promotionId;\n productRequest['id'] = productData?.productId;\n const timer = data?.timer?.[0];\n const timerIsActive = timer ? isTimerActive(timer.startTime, timer.endTime) : false;\n const timerPromotionId =\n timer?.promotion?.[0]?.reference?.content?.promoDescription?.[0]?.promotionId;\n const defaultPromotionId =\n pricesToggleState && pricesToggleState === true && promotionData?.promotionId === ''\n ? DEFAULT_MOBILEPOSTPAID_BUNDLE\n : promotionData?.promotionId;\n\n //US_31295 - add default promo only when timer is not active and timer has no promo\n if (timerIsActive && timerPromotionId) {\n productRequest?.promoIds?.push(timerPromotionId);\n } else {\n productRequest?.promoIds?.push(defaultPromotionId);\n }\n\n //for 4P product\n if (bundle4PProduct) {\n const mobilePromotionData =\n data?.mobilePromotion?.[0]?.reference?.content?.promoDescription?.[0];\n productRequest?.promoIds?.push(mobilePromotionData?.promotionId);\n }\n\n productId?.push(productRequest);\n });\n if (enableStream) {\n tvOptionIds?.map((option: any) => {\n const tvOptionObj: any = {\n id: '',\n promoIds: []\n };\n tvOptionObj['id'] = option?.text;\n tvOptionObj?.promoIds?.push(promotionId);\n\n productId?.push(tvOptionObj);\n });\n }\n};\n\nexport const fetchPegaProducts = (\n content: any,\n pegaCustomerInterest?: string,\n placements?: string\n): PegaProductRequestBase => {\n // const url = window?.location?.pathname?.split('/') ?? [];\n // const pathname = url[url.length - 1];\n //set customerInterest as content?.tabCaption capitalize inital letter and after space and then remove spaces - from Other plans into OtherPlans\n const customerInterest = content?.tabCaption\n ?.replace(/\\b\\w/g, (l: string) => l.toUpperCase())\n .replace(/\\s+/g, '');\n\n const offerValidations = [\n {\n key: 'Segment',\n type: 'CustomerType',\n value: 'Residential'\n },\n {\n key: 'OrderType',\n type: 'CustomerInterest',\n value: 'New'\n },\n {\n key: 'CurrentPage',\n type: 'Context',\n value: 'mobile-subscription' //pathname ?? ''\n },\n {\n key: 'Category',\n type: 'CustomerInterest',\n value: customerInterest ?? ''\n },\n {\n key: 'RequestedOfferCount',\n type: 'Context',\n value: content?.pegaRequestOfferCount?.toString() ?? '3'\n },\n pegaCustomerInterest\n ? {\n key: 'Tag',\n type: 'CustomerInterest',\n value: pegaCustomerInterest\n }\n : null\n ].filter(Boolean) as OfferValidation[];\n\n const atlOffers: AtlOffer = {\n placements,\n offerValidations\n };\n\n const pegaProducts: PegaProductRequestBase = {\n atlOffers: [atlOffers]\n };\n\n return pegaProducts;\n};\n\nexport const checkGiftOrCashback = (data: any): any => {\n let showGift = false;\n let cashbackAvailable = false;\n data?.map((product: any) => {\n product?.promotionInfo?.map((offer: any) => {\n if (offer?.hardwareGift) showGift = true;\n if (offer?.cashBack) cashbackAvailable = true;\n });\n });\n return { showGift, cashbackAvailable };\n};\n\nexport const staticCreateCart = (\n setShowLoader: { (value: SetStateAction<boolean>): void; (arg0: boolean): void },\n cartEndPoint: string,\n giftItem: any,\n uniqueProductData: any,\n mainContent: any,\n showPrice: any,\n isMobileFlow: boolean,\n radioValue: any,\n eligibleBundle: any,\n address: any,\n setShowLinecheck: any,\n showLinecheck: any,\n lineCheckCallBack: any,\n enableP2P: any,\n P2PData: any,\n content: any,\n tvOptions?: any,\n discountRef?: string,\n discountVersion?: string,\n // Shogun/rewards (loyalty) flow — forwarded verbatim to createCartV2 so it\n // can append the pointsBurnt note at the item level (RATEPLAN for MOBILE,\n // internet item for FIXNET).\n rewardsInfo?: { pointsBurnt?: string | number; rewardOfferId?: string | number; gloxTokenId?: string | null },\n successLoaderData?: SuccessLoaderData\n): any => {\n if (isMobileFlow) {\n setShowLoader(true);\n const vcType: { voucher: string; voucherType: string } = getLocalStorageWithExpiry(VCTYPE);\n Object.keys(uniqueProductData)?.length !== 0 &&\n createCartV2(\n uniqueProductData,\n '',\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE,\n cartEndPoint,\n 'mobile',\n giftItem,\n enableP2P,\n P2PData,\n mainContent?.productContainer?.[0]?.isQoQaFlow,\n vcType?.voucher,\n null,\n null,\n discountRef,\n discountVersion,\n rewardsInfo\n )\n .then((res: any) => {\n Cookies.remove('one-commerce-cartId', { path: '/' });\n // saving newly created cartid in the cookies.\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEPRODUCT);\n\n redirectWithSuccess(mainContent?.summaryPageUrl?.cached_url, successLoaderData);\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.log(err);\n setShowLoader(false);\n })\n .finally(() => {\n setShowLoader(false);\n });\n } else {\n const linecheckId: any =\n typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid');\n if (!eligibleBundle || !address || !linecheckId) {\n mainContent?.enableLinecheckOverlay ? setShowLinecheck(!showLinecheck) : lineCheckCallBack();\n } else {\n setShowLoader(true);\n uniqueProductData.length !== 0 &&\n createCartV2(\n uniqueProductData,\n radioValue,\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_WIRELINE_BUNDLE,\n cartEndPoint,\n 'fixnet',\n giftItem,\n '',\n '',\n false,\n '',\n '',\n tvOptions,\n undefined,\n undefined,\n rewardsInfo\n )\n .then((res: any) => {\n typeof window !== 'undefined' && Cookies.remove('one-commerce-cartId', { path: '/' });\n // saving newly created cartid in the cookies.\n typeof window !== 'undefined' &&\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\n typeof window !== 'undefined' &&\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\n typeof window !== 'undefined' && Cookies.remove('landline');\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLE);\n const productUrl = checkLinkWithLang(content?.productBasedCheckoutUrl?.cached_url);\n let recommendAccessory = false;\n /**Check if bundle or Internet and add it to cart request*/\n if (uniqueProductData[0]?.isBundle) {\n uniqueProductData[0]?.bundledOffers?.map((item: any) => {\n if (\n item?.productType?.toLowerCase() === 'internet' ||\n item?.productType?.toLowerCase() == 'tv'\n ) {\n if (item?.recommendAccessory) {\n recommendAccessory = item?.recommendAccessory;\n }\n }\n // setting to false incase of Mobile product Type as it is currently out of scope\n if (item?.productType?.toLowerCase() === 'mobile') {\n recommendAccessory = false;\n return;\n }\n });\n } else {\n /**Add standlone product such as internet to cart request*/\n if (uniqueProductData?.[0]?.recommendAccessory) {\n recommendAccessory = uniqueProductData?.[0]?.recommendAccessory;\n }\n }\n //setting the session to identify internet flow for mia for win\n if (recommendAccessory) {\n const sessionObj = { flow: 'WIN' };\n sessionStorage.setItem(ONE_ECOMMERCE_SUMMARY, JSON.stringify(sessionObj));\n }\n\n const finalURL = productUrl\n ? productUrl\n : content?.enableTVStreamingOptionsStepper && mainContent?.vasStepperURL?.cached_url\n ? mainContent?.vasStepperURL?.cached_url\n : recommendAccessory && mainContent?.multiItemPageRedirectionUrl?.cached_url\n ? mainContent?.multiItemPageRedirectionUrl?.cached_url\n : mainContent?.summaryPageUrl?.cached_url;\n\n redirectWithSuccess(finalURL, successLoaderData);\n })\n .catch((err: any) => {\n // eslint-disable-next-line no-console\n console.log(err);\n })\n .finally(() => {\n setShowLoader(false);\n });\n }\n }\n};\n\nconst pendingHeightPasses = new Map<number, ReturnType<typeof setTimeout>>();\n\n// Every card in a tab requests the same pass; run it once per tab.\nexport const scheduleFindHeight = (tabIndex: number, cardsLength: number, delay = 100) => {\n const pending = pendingHeightPasses.get(tabIndex);\n if (pending) {\n clearTimeout(pending);\n }\n pendingHeightPasses.set(\n tabIndex,\n setTimeout(() => {\n pendingHeightPasses.delete(tabIndex);\n findHeight(tabIndex, cardsLength);\n }, delay)\n );\n};\n\nexport const findHeight = (tabIndex: number, cardsLength: number) => {\n const setTimerSectionHeight = () => {\n let maxActiveTimerHeight = 0;\n const timerSections: HTMLElement[] = [];\n\n [...Array(cardsLength)].forEach((_, index) => {\n const timerSection = document.getElementById(`timer-section${tabIndex}${index}`);\n if (timerSection) {\n timerSections.push(timerSection);\n const isTimerActive = timerSection.dataset.timerActive === 'true';\n if (isTimerActive) {\n const spacer = timerSection.firstElementChild as HTMLElement | null;\n // Read the inline style target height instead of clientHeight so that\n // an in-progress CSS transition does not yield an intermediate value.\n const targetHeight = parseFloat(spacer?.style.height || '0') || 0;\n maxActiveTimerHeight = Math.max(maxActiveTimerHeight, targetHeight);\n }\n }\n });\n\n timerSections.forEach((timerSection) => {\n const isTimerActive = timerSection.dataset.timerActive === 'true';\n timerSection.style.transition = 'height 0.3s ease';\n timerSection.style.height = isTimerActive ? '0px' : `${maxActiveTimerHeight}px`;\n });\n };\n\n getElementMaximumHeight('headingV3' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('descriptionV3' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('titleV3' + `${tabIndex}`, cardsLength);\n setTimerSectionHeight();\n getElementMaximumHeight('detailsectionv3' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('product-configv3' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('gift-section' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('benefits-section' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('order-section' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('price-section' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('benefits-price-section' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('contract-section' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('exclusive-benefits-section' + `${tabIndex}`, cardsLength);\n getElementMaximumHeight('discountedpricetoggle-section' + `${tabIndex}`, cardsLength);\n};\n\nconst setMobileSummarySession = (\n promoId: string,\n uniqueProductData: any,\n pretopostvalues?: any,\n showPrice?: any,\n product?: any,\n pegaIntegration?: any\n) => {\n const productPrice = uniqueProductData;\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\n const contractDuration = productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? 0;\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\n const pretopostvalue = pretopostvalues ?? '';\n //PEGA Integration\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\n const clientDiscountInfo = pegaIntegration\n ? {\n discountRef: discountRef,\n discountType: 'DISCOUNT'\n }\n : null;\n const note = [];\n note?.push({\n author: 'offerType',\n text: 'ATL'\n });\n note?.push({\n author: 'externalPromotionName',\n text: discountRef\n });\n note?.push({\n author: 'offerVersion',\n text: discountVersion\n });\n\n const extraNotes = pegaIntegration ? note : null;\n const urlParams = new URLSearchParams(window.location.search);\n const flow = urlParams.get('flow');\n const sessionObj: any = {\n mobileSubscription: productPrice?.[0]?.id ?? '',\n mobileSubscriptionPrice: discount > 0 ? discount : base,\n mobileSubscriptionPromo: promoId,\n subGroup: 'MOBILE',\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\n basePrice: base,\n withoutPromo: false,\n pretopostvalue: pretopostvalue,\n upBenefit:\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\n clientDiscountInfo: clientDiscountInfo,\n extraNotes: extraNotes,\n isOttFlow: flow === 'ott' ? true : false\n };\n\n typeof window !== undefined &&\n sessionStorage.setItem('one-ecommerce-mobileSummary', JSON.stringify(sessionObj));\n};\n\nexport const combineWithSmartPhone = (\n showPrice: any,\n storyContent: any,\n uniqueProductData: any,\n responseData?: any,\n product?: any,\n pegaIntegration?: boolean\n) => {\n const pretopostvalues = {\n msisdn: responseData?.msisdn ?? '',\n ratePlan: responseData?.ratePlan ?? '',\n ratePlanType: responseData?.ratePlanType ?? '',\n productId: responseData ? showPrice?.id : ''\n };\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\n let Params = '';\n Params = `?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${\n promoId ?? ''\n }&productCode=${showPrice?.id ?? ''}`;\n window.location.href = storyContent?.addSmartPhone?.[0]?.buttonLink?.cached_url + Params;\n setMobileSummarySession(\n promoId,\n uniqueProductData,\n responseData && pretopostvalues,\n showPrice,\n product,\n pegaIntegration\n );\n trackNewDatalayerEvent(\n GAEVENT,\n COMBINEDEVICE,\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\n );\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\n};\n\nconst setFixnetSummarySession = (\n promoId: string,\n uniqueProductData: any,\n showPrice?: any,\n product?: any,\n pegaIntegration?: any,\n productName?: string,\n recommendAccessory?: boolean | undefined\n) => {\n const productPrice = uniqueProductData;\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\n const contractDuration =\n productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? showPrice?.contractDuration ?? 0;\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\n\n //PEGA Integration\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\n const clientDiscountInfo = pegaIntegration\n ? {\n discountRef: discountRef,\n discountType: 'DISCOUNT'\n }\n : null;\n const note = [];\n note?.push({\n author: 'offerType',\n text: 'ATL'\n });\n note?.push({\n author: 'externalPromotionName',\n text: discountRef\n });\n note?.push({\n author: 'offerVersion',\n text: discountVersion\n });\n\n const extraNotes = pegaIntegration ? note : null;\n\n const sessionObj: any = {\n internetSubscription: productName ?? '',\n internetSubscriptionId: productPrice?.[0]?.id ?? '',\n internetSubscriptionPrice: discount > 0 ? discount : base,\n internetSubscriptionPromo: promoId,\n subGroup: 'INTERNET',\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\n basePrice: base,\n withPromo: discount > 0 ? true : false,\n upBenefit:\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\n clientDiscountInfo: clientDiscountInfo,\n extraNotes: extraNotes,\n productType: 'subscription',\n recommendAccessory: recommendAccessory\n };\n\n typeof window !== undefined &&\n sessionStorage.setItem(ONE_ECOMMERCE_INTERNET_SUMMARY, JSON.stringify(sessionObj));\n};\nexport const combineWithVasOptions = (\n showPrice: any,\n uniqueProductData: any,\n product?: any,\n pegaIntegration?: boolean,\n productName?: string,\n recommendAccessory?: boolean\n) => {\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\n\n setFixnetSummarySession(\n promoId,\n uniqueProductData,\n showPrice,\n product,\n pegaIntegration,\n productName,\n recommendAccessory\n );\n trackNewDatalayerEvent(\n GAEVENT,\n COMBINEDEVICE,\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\n );\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\n};\n\nexport const fetchServiceOptions = (entitlement: any, isMobileFlow: boolean) => {\n let service: any;\n if (!isMobileFlow) {\n service = (entitlement || []).filter((product: any) => product?.enableTV === true);\n }\n return service;\n};\n\nexport const fetchPrice = (\n product: any,\n isMobileFlow: boolean,\n pageType?: string,\n isConfigurator?: boolean,\n tvOptions?: any[],\n pegaIntegration?: boolean\n): any => {\n const showPrice: any = {\n base: '',\n onetimePrice: '',\n discount: [],\n contractDuration: '',\n int_fmc: 0,\n mob_fmc: 0,\n mob_benefit_category: '',\n id: '',\n promoID: '',\n loyaltyPrice: ''\n };\n let tvOptionsBasePrice = 0;\n let tvOptionsDiscountPrice = 0;\n let tvOptionsBaseToDiscount = 0;\n\n Array.isArray(product) &&\n product?.map((item: any) => {\n showPrice['id'] = item?.id ?? '';\n item?.prices?.map((basePrice: any) => {\n if (basePrice?.priceType?.toLowerCase() === 'recurring') {\n if (tvOptions && tvOptions?.length > 0) {\n tvOptions?.forEach((opt: any) => {\n if (opt?.beneficiaryPrice > 0) {\n tvOptionsDiscountPrice += parseFloat(opt?.beneficiaryPrice);\n } else if (opt?.derivedPrice > 0) {\n tvOptionsDiscountPrice += parseFloat(opt?.derivedPrice);\n } else {\n tvOptionsBaseToDiscount += parseFloat(opt?.recurringPrice);\n }\n if (opt?.recurringPrice > 0) {\n tvOptionsBasePrice += parseFloat(opt?.recurringPrice);\n }\n });\n //If one of the options in the list has a discount, other options base price is stored to sum it up in the end\n if (tvOptionsDiscountPrice > 0) {\n tvOptionsDiscountPrice += tvOptionsBaseToDiscount;\n }\n showPrice['base'] = JSON.stringify(\n parseFloat(basePrice?.value) +\n (tvOptionsDiscountPrice > 0 ? tvOptionsDiscountPrice : tvOptionsBasePrice)\n );\n } else {\n showPrice['base'] = basePrice?.value;\n }\n } else if (basePrice?.priceType?.toLowerCase() === 'one time')\n showPrice['onetimePrice'] = basePrice?.value;\n });\n item?.derivedPrice?.map((discountPrice: any) => {\n const cycle = { cycleStart: '', cycleEnd: '', value: '' };\n cycle['cycleStart'] =\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\n ? 1\n : discountPrice?.cycle?.cycleStart;\n cycle['cycleEnd'] =\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\n ? pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\n : discountPrice?.cycle?.cycleEnd;\n cycle['value'] = discountPrice?.value;\n if (tvOptions && tvOptions?.length > 0) {\n if (tvOptionsDiscountPrice > 0) {\n cycle['value'] = JSON.stringify(\n parseFloat(discountPrice?.value) + tvOptionsDiscountPrice\n );\n } else {\n cycle['value'] = JSON.stringify(parseFloat(discountPrice?.value) + tvOptionsBasePrice);\n }\n }\n showPrice['discount'].push(cycle);\n });\n // Calculating loyalty price introduced with DC portfolio\n if (item?.promotionInfo?.[0]?.relatedPromo?.length > 0) {\n item?.promotionInfo?.[0]?.relatedPromo?.map((promo: any) => {\n if (promo?.type === 'LOYALTY_DISCOUNT') {\n showPrice['loyaltyPrice'] = promo?.discount;\n }\n });\n }\n });\n\n product?.[0]?.bundledOffers?.forEach((item: any) => {\n item?.prices?.forEach((productDetails: any) => {\n if (productDetails?.priceAlteration?.length > 0) {\n productDetails?.priceAlteration?.forEach((price: any) => {\n if (price?.priceCategory == 'INTERNET_FMC') {\n showPrice['int_fmc'] += Number(price?.value);\n } else if (\n price?.priceCategory == 'MULTIMOBILE' ||\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\n price?.priceCategory == 'FMC'\n ) {\n showPrice['mob_fmc'] += Number(price?.value);\n showPrice['mob_benefit_category'] = price?.priceCategory;\n }\n });\n }\n });\n if (item?.contractDuration) {\n showPrice['contractDuration'] = item?.contractDuration; // for bundled products contract duration is taken from bundled offers\n }\n if (item?.promotionInfo?.[0]?.id && !pegaIntegration) {\n showPrice['promoID'] = item?.promotionInfo?.[0]?.id;\n }\n });\n if (!product?.[0]?.isBundle) {\n showPrice['contractDuration'] = product?.[0]?.contractDuration; // for other products\n if (!pegaIntegration) {\n showPrice['promoID'] = product?.[0]?.promotionInfo?.[0]?.id;\n }\n }\n let int_fmc = 0;\n product?.[0]?.prices?.map((productDetails: any) => {\n if (productDetails?.priceAlteration?.length > 0) {\n productDetails?.priceAlteration?.map((price: any) => {\n if (price?.priceCategory == 'INTERNET_FMC') {\n int_fmc += Number(price?.value);\n } else if (\n price?.priceCategory == 'MULTIMOBILE' ||\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\n price?.priceCategory == 'FMC'\n ) {\n showPrice['mob_fmc'] += Number(price?.value);\n showPrice['mob_benefit_category'] = price?.priceCategory;\n }\n });\n }\n });\n if (!showPrice?.contractDuration && !isMobileFlow) {\n showPrice['contractDuration'] = '12';\n }\n {\n showPrice['int_fmc'] = isConfigurator ? int_fmc : showPrice['int_fmc'];\n }\n if (pageType == '4P') {\n let bundleContractDuration = '0';\n product?.[0]?.bundledOffers?.map((offerData: any) => {\n if (offerData?.contractDuration) {\n bundleContractDuration =\n Number(bundleContractDuration) > Number(offerData?.contractDuration)\n ? bundleContractDuration\n : offerData?.contractDuration;\n }\n });\n showPrice['contractDuration'] = bundleContractDuration;\n }\n return showPrice;\n};\n\n//function for creating different array for 3 selections\nexport const fetchFilteredProducts = (productList: any, toggleState: any) => {\n //need to centralize for comman solution\n // Filter productList based on gigaSpeed toggle - US #363853\n let filteredList = productList;\n\n filteredList = productList.filter((item: any) => {\n const gigaSpeedValue = item?.gigaSpeed?.toLowerCase();\n if (toggleState?.gigaSpeed) {\n return gigaSpeedValue != 'hide';\n } else {\n return gigaSpeedValue != 'show';\n }\n });\n\n let mainArray = filteredList;\n const numberOfArray = 3;\n let res1 = [];\n let res2 = [];\n let res3 = [];\n for (let item of mainArray) {\n const multiIndex = item?.productIndex?.includes(',');\n const updatedMultiIndex = multiIndex && item?.productIndex?.split(',');\n if (multiIndex) {\n for (let mIndex of updatedMultiIndex) {\n for (let i = 0; i < numberOfArray; i++) {\n if (Number(mIndex) === i) {\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\n }\n }\n }\n } else {\n for (let i = 0; i < numberOfArray; i++) {\n if (Number(item?.productIndex) === i) {\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\n }\n }\n }\n }\n const displayContent =\n toggleState?.TV && toggleState?.Netflix ? res3 : toggleState?.TV ? res2 : res1;\n return displayContent;\n};\nexport const fetchOttItems = (ottCartData: any) => {\n return (ottCartData?.products || [])?.map((products: any) => ({\n itemType: products?.type ?? '',\n promotionId: products?.promo ?? '',\n items: [\n {\n itemType: products?.type === TV_SERVICE_OPTION ? TV_SERVICE_OPTION : RATEPLAN,\n id: products?.id ?? ''\n }\n ]\n }));\n};\n\n// ─── Shogun shared-offer cache ────────────────────────────────────────────────\n\ninterface ShogunOfferCacheEntry {\n gloxTokenId: string;\n results: any[] | null;\n promise: Promise<any[]> | null;\n}\n\nlet shogunOfferSharedCache: ShogunOfferCacheEntry | null = null;\n\n/**\n * Returns true when the shared cache already holds resolved results for the\n * given token. Callers can use this to skip triggering a loading state.\n */\nexport const isShogunOfferResolved = (gloxTokenId: string): boolean =>\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\n shogunOfferSharedCache.results !== null;\n\n/**\n * Shared-promise manager for the Shogun offer API.\n *\n * Because the Shogun flow sends no product payload (only gloxTokenId) the\n * response is identical for every StaticProductContainer on the page.\n * This function ensures exactly one network request is made:\n * - If results are already resolved → returns Promise.resolve(results)\n * - If a fetch is in-flight → returns the same promise\n * - First caller → creates the fetch and stores the promise\n *\n * On failure the promise rejects — the caller is responsible for surfacing\n * the error (e.g. showing the telesales/error popup). The failure is NOT\n * cached, so a retry (e.g. tab switch) will trigger a fresh request.\n */\nexport const getShogunSharedOffer = (\n gloxTokenId: string,\n uniqueId: string,\n offerEndpoint: string\n): Promise<any[]> => {\n // Already resolved\n if (isShogunOfferResolved(gloxTokenId)) {\n return Promise.resolve(shogunOfferSharedCache!.results!);\n }\n\n // In-flight\n if (\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\n shogunOfferSharedCache.promise !== null\n ) {\n return shogunOfferSharedCache.promise;\n }\n\n // First caller — start the real fetch\n const fetchPromise: Promise<any[]> = fetchShogunOfferData(gloxTokenId, uniqueId, offerEndpoint)\n .then((resp: any) => {\n const results: any[] = resp?.[uniqueId] ?? [];\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\n shogunOfferSharedCache.results = results;\n shogunOfferSharedCache.promise = null;\n }\n return results;\n })\n .catch((err: any) => {\n // Clear the cache entry so the next call retries the API.\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\n shogunOfferSharedCache = null;\n }\n throw err;\n });\n\n shogunOfferSharedCache = { gloxTokenId, results: null, promise: fetchPromise };\n return fetchPromise;\n};\n\n\n/**\n * Filters and sorts the Storyblok product list to match only the products\n * returned by the Shogun offer API, preserving the API response order.\n */\nexport const filterShogunProducts = (\n availableProducts: any[],\n shogunProductIds: string[]\n): any[] => {\n const filtered = availableProducts.filter((product: any) => {\n const productId = product?.products?.[0]?.reference?.content?.product?.[0]?.productId;\n return shogunProductIds.includes(productId);\n });\n\n filtered.sort((a: any, b: any) => {\n const aId = a?.products?.[0]?.reference?.content?.product?.[0]?.productId;\n const bId = b?.products?.[0]?.reference?.content?.product?.[0]?.productId;\n return shogunProductIds.indexOf(aId) - shogunProductIds.indexOf(bId);\n });\n\n return filtered;\n};\n"],"names":["isTimerActive","startTime","endTime","now","Date","start","calculateDateTime","replace","end","Number","isNaN","getTime","_a","getTimeUntilNextTimerEvent","startTimeMs","endTimeMs","Math","max","fetchStaticProductIds","productList","productId","bundle4PProduct","tvOptionIds","pricesToggleState","map","data","productRequest","id","promoIds","productData","_e","_d","_c","_b","products","reference","content","product","promotionData","_k","_j","_h","_g","_f","promotion","promoDescription","promotionId","timer","_l","timerIsActive","timerPromotionId","_s","_r","_q","_p","_o","_m","defaultPromotionId","DEFAULT_MOBILEPOSTPAID_BUNDLE","_t","push","_u","mobilePromotionData","_z","_y","_x","_w","_v","mobilePromotion","_0","fetchPegaProducts","pegaCustomerInterest","placements","customerInterest","tabCaption","l","toUpperCase","atlOffers","offerValidations","key","type","value","pegaRequestOfferCount","toString","filter","Boolean","checkGiftOrCashback","showGift","cashbackAvailable","promotionInfo","offer","hardwareGift","cashBack","staticCreateCart","setShowLoader","cartEndPoint","giftItem","uniqueProductData","mainContent","showPrice","isMobileFlow","radioValue","eligibleBundle","address","setShowLinecheck","showLinecheck","lineCheckCallBack","enableP2P","P2PData","tvOptions","discountRef","discountVersion","rewardsInfo","successLoaderData","vcType","getLocalStorageWithExpiry","VCTYPE","Object","keys","length","createCartV2","promoID","productContainer","isQoQaFlow","voucher","then","res","Cookies","remove","path","set","trackEligibleItem","ADDTOCART","LINETABLEPRODUCT","redirectWithSuccess","summaryPageUrl","cached_url","catch","err","console","log","finally","linecheckId","window","get","DEFAULT_WIRELINE_BUNDLE","undefined","LINETABLE","productUrl","checkLinkWithLang","productBasedCheckoutUrl","recommendAccessory","isBundle","bundledOffers","item","productType","toLowerCase","sessionObj","flow","sessionStorage","setItem","ONE_ECOMMERCE_SUMMARY","JSON","stringify","finalURL","enableTVStreamingOptionsStepper","vasStepperURL","multiItemPageRedirectionUrl","enableLinecheckOverlay","pendingHeightPasses","Map","scheduleFindHeight","tabIndex","cardsLength","delay","pending","clearTimeout","setTimeout","delete","findHeight","getElementMaximumHeight","maxActiveTimerHeight","timerSections","Array","forEach","_","index","timerSection","document","getElementById","dataset","timerActive","spacer","firstElementChild","targetHeight","parseFloat","style","height","transition","setTimerSectionHeight","combineWithSmartPhone","storyContent","responseData","pegaIntegration","pretopostvalues","msisdn","ratePlan","ratePlanType","promoId","Params","location","href","addSmartPhone","buttonLink","productPrice","base","prices","discount","derivedPrice","contractDuration","campaignDuration","pretopostvalue","version","clientDiscountInfo","discountType","note","author","text","extraNotes","URLSearchParams","search","mobileSubscription","mobileSubscriptionPrice","mobileSubscriptionPromo","subGroup","duration","basePrice","withoutPromo","upBenefit","mob_benefit_category","ultimateBundlePromo","ultimateBundlePromotion","isOttFlow","setMobileSummarySession","trackNewDatalayerEvent","GAEVENT","COMBINEDEVICE","getEcomCartInfo","LINETABLEDEVICE","combineWithVasOptions","productName","internetSubscription","internetSubscriptionId","internetSubscriptionPrice","internetSubscriptionPromo","withPromo","_1","ONE_ECOMMERCE_INTERNET_SUMMARY","setFixnetSummarySession","fetchServiceOptions","entitlement","service","enableTV","fetchPrice","pageType","isConfigurator","onetimePrice","int_fmc","mob_fmc","loyaltyPrice","tvOptionsBasePrice","tvOptionsDiscountPrice","tvOptionsBaseToDiscount","isArray","priceType","opt","beneficiaryPrice","recurringPrice","discountPrice","cycle","cycleStart","cycleEnd","relatedPromo","promo","productDetails","priceAlteration","price","priceCategory","bundleContractDuration","offerData","fetchFilteredProducts","toggleState","filteredList","gigaSpeedValue","gigaSpeed","mainArray","res1","res2","res3","multiIndex","productIndex","includes","updatedMultiIndex","split","mIndex","i","TV","Netflix","fetchOttItems","ottCartData","itemType","items","TV_SERVICE_OPTION","RATEPLAN","shogunOfferSharedCache","isShogunOfferResolved","gloxTokenId","results","getShogunSharedOffer","uniqueId","offerEndpoint","Promise","resolve","promise","fetchPromise","fetchShogunOfferData","resp","filterShogunProducts","availableProducts","shogunProductIds","filtered","sort","a","b","aId","bId","indexOf"],"mappings":"81BAgCaA,EAAgB,CAACC,EAAmBC,KAC/C,IACE,MAAMC,EAAM,IAAIC,KACVC,EAAQC,EAAkB,IAAIF,KAAKH,EAAUM,QAAQ,KAAM,OAC3DC,EAAMF,EAAkB,IAAIF,KAAKF,EAAQK,QAAQ,KAAM,OAE7D,OAAIE,OAAOC,MAAML,EAAMM,aAAcF,OAAOC,MAAMF,EAAIG,aAI/CR,GAAOE,GAASF,EAAMK,EAC/B,CAAE,MAAAI,GACA,OAAO,CACT,GAGWC,EAA6B,CAACZ,EAAmBC,KAC5D,IACE,MAAMG,EAAQC,EAAkB,IAAIF,KAAKH,EAAUM,QAAQ,KAAM,OAC3DC,EAAMF,EAAkB,IAAIF,KAAKF,EAAQK,QAAQ,KAAM,OAE7D,GAAIE,OAAOC,MAAML,EAAMM,YAAcF,OAAOC,MAAMF,EAAIG,WACpD,OAAO,EAGT,MAAMR,GAAM,IAAIC,MAAOO,UACjBG,EAAcT,EAAMM,UACpBI,EAAYP,EAAIG,UAGtB,OAAIR,EAAMW,EACDE,KAAKC,IAAI,EAAGH,EAAcX,GAE/BA,GAAOW,GAAeX,EAAMY,EACvBC,KAAKC,IAAI,EAAGF,EAAYZ,GAG1B,CACT,CAAE,MAAAS,GACA,OAAO,CACT,GAGWM,EAAwB,CACnCC,EACAC,EACAC,EACAC,EAEAC,KAIAJ,SAAAA,EAAaK,IAAKC,0DAChB,MAAMC,EAAsB,CAC1BC,GAAI,GACJC,SAAU,IAGNC,EAA8D,QAAhDC,EAAuC,QAAvCC,EAA8B,QAA9BC,EAAmB,QAAnBC,EAAc,QAAdrB,EAAAa,aAAI,EAAJA,EAAMS,gBAAQ,IAAAtB,OAAA,EAAAA,EAAG,UAAE,IAAAqB,OAAA,EAAAA,EAAEE,iBAAS,IAAAH,OAAA,EAAAA,EAAEI,eAAO,IAAAL,OAAA,EAAAA,E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AAG,UAAE,IAAAD,OAAA,EAAAA,EAAEN,iBAAS,IAAAK,OAAA,EAAAA,EAAEJ,eAAO,IAAAG,OAAA,EAAAA,EAAEF,eAAO,IAAAW,OAAA,EAAAA,EAAG,UAAE,IAAAQ,OAAA,EAAAA,EAAEpC,UAChE,OAAOqT,EAAiBO,QAAQF,GAAOL,EAAiBO,QAAQD,KAG3DL"}
|
|
1
|
+
{"version":3,"file":"Product.utils.js","sources":["../../../../src/components/StaticLineTable/Product.utils.ts"],"sourcesContent":["import Cookies from 'js-cookie';\nimport { SetStateAction } from 'react';\nimport {\n DEFAULT_MOBILEPOSTPAID_BUNDLE,\n DEFAULT_WIRELINE_BUNDLE,\n ONE_ECOMMERCE_INTERNET_SUMMARY,\n ONE_ECOMMERCE_SUMMARY,\n RATEPLAN,\n TV_SERVICE_OPTION,\n VCTYPE\n} from '../../utils/constants';\nimport { createCartV2, fetchShogunOfferData } from '../../services/LineTableService';\nimport {\n checkLinkWithLang,\n getElementMaximumHeight,\n getLocalStorageWithExpiry,\n redirectWithSuccess,\n SuccessLoaderData\n} from '../../utils/utils';\nimport { trackNewDatalayerEvent } from '../../utils/AnalyticsUtils';\nimport {\n ADDTOCART,\n COMBINEDEVICE,\n GAEVENT,\n LINETABLE,\n LINETABLEDEVICE,\n LINETABLEPRODUCT\n} from '../../Analytics/AnalyticsConstants';\nimport { getEcomCartInfo, trackEligibleItem } from '../../models/Analytics/items';\nimport { AtlOffer, OfferValidation, PegaProductRequestBase } from '../lineTable/lineTable.types';\nimport { calculateDateTime } from './StaticLineTabelTimer/util';\n\nexport const isTimerActive = (startTime: string, endTime: string): boolean => {\n try {\n const now = new Date();\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\n\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\n return false;\n }\n\n return now >= start && now < end;\n } catch {\n return false;\n }\n};\n\nexport const getTimeUntilNextTimerEvent = (startTime: string, endTime: string): number => {\n try {\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\n\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\n return 0;\n }\n\n const now = new Date().getTime();\n const startTimeMs = start.getTime();\n const endTimeMs = end.getTime();\n\n // Next transition is start when timer is upcoming, otherwise end when active.\n if (now < startTimeMs) {\n return Math.max(0, startTimeMs - now);\n }\n if (now >= startTimeMs && now < endTimeMs) {\n return Math.max(0, endTimeMs - now);\n }\n\n return 0;\n } catch {\n return 0;\n }\n};\n\nexport const fetchStaticProductIds = (\n productList: any,\n productId: any,\n bundle4PProduct?: boolean,\n tvOptionIds?: any,\n //US_31295\n pricesToggleState?: any\n): any => {\n let enableStream = false;\n let promotionId = '';\n productList?.map((data: any) => {\n const productRequest: any = {\n id: '',\n promoIds: []\n };\n\n const productData = data?.products?.[0]?.reference?.content?.product?.[0];\n const promotionData = data?.promotion?.[0]?.reference?.content?.promoDescription?.[0];\n promotionId = promotionData?.promotionId;\n productRequest['id'] = productData?.productId;\n const timer = data?.timer?.[0];\n const timerIsActive = timer ? isTimerActive(timer.startTime, timer.endTime) : false;\n const timerPromotionId =\n timer?.promotion?.[0]?.reference?.content?.promoDescription?.[0]?.promotionId;\n const defaultPromotionId =\n pricesToggleState && pricesToggleState === true && promotionData?.promotionId === ''\n ? DEFAULT_MOBILEPOSTPAID_BUNDLE\n : promotionData?.promotionId;\n\n //US_31295 - add default promo only when timer is not active and timer has no promo\n if (timerIsActive && timerPromotionId) {\n productRequest?.promoIds?.push(timerPromotionId);\n } else {\n productRequest?.promoIds?.push(defaultPromotionId);\n }\n\n //for 4P product\n if (bundle4PProduct) {\n const mobilePromotionData =\n data?.mobilePromotion?.[0]?.reference?.content?.promoDescription?.[0];\n productRequest?.promoIds?.push(mobilePromotionData?.promotionId);\n }\n\n productId?.push(productRequest);\n });\n if (enableStream) {\n tvOptionIds?.map((option: any) => {\n const tvOptionObj: any = {\n id: '',\n promoIds: []\n };\n tvOptionObj['id'] = option?.text;\n tvOptionObj?.promoIds?.push(promotionId);\n\n productId?.push(tvOptionObj);\n });\n }\n};\n\nexport const fetchPegaProducts = (\n content: any,\n pegaCustomerInterest?: string,\n placements?: string\n): PegaProductRequestBase => {\n // const url = window?.location?.pathname?.split('/') ?? [];\n // const pathname = url[url.length - 1];\n //set customerInterest as content?.tabCaption capitalize inital letter and after space and then remove spaces - from Other plans into OtherPlans\n const customerInterest = content?.tabCaption\n ?.replace(/\\b\\w/g, (l: string) => l.toUpperCase())\n .replace(/\\s+/g, '');\n\n const offerValidations = [\n {\n key: 'Segment',\n type: 'CustomerType',\n value: 'Residential'\n },\n {\n key: 'OrderType',\n type: 'CustomerInterest',\n value: 'New'\n },\n {\n key: 'CurrentPage',\n type: 'Context',\n value: 'mobile-subscription' //pathname ?? ''\n },\n {\n key: 'Category',\n type: 'CustomerInterest',\n value: customerInterest ?? ''\n },\n {\n key: 'RequestedOfferCount',\n type: 'Context',\n value: content?.pegaRequestOfferCount?.toString() ?? '3'\n },\n pegaCustomerInterest\n ? {\n key: 'Tag',\n type: 'CustomerInterest',\n value: pegaCustomerInterest\n }\n : null\n ].filter(Boolean) as OfferValidation[];\n\n const atlOffers: AtlOffer = {\n placements,\n offerValidations\n };\n\n const pegaProducts: PegaProductRequestBase = {\n atlOffers: [atlOffers]\n };\n\n return pegaProducts;\n};\n\nexport const checkGiftOrCashback = (data: any): any => {\n let showGift = false;\n let cashbackAvailable = false;\n data?.map((product: any) => {\n product?.promotionInfo?.map((offer: any) => {\n if (offer?.hardwareGift) showGift = true;\n if (offer?.cashBack) cashbackAvailable = true;\n });\n });\n return { showGift, cashbackAvailable };\n};\n\nexport const staticCreateCart = (\n setShowLoader: { (value: SetStateAction<boolean>): void; (arg0: boolean): void },\n cartEndPoint: string,\n giftItem: any,\n uniqueProductData: any,\n mainContent: any,\n showPrice: any,\n isMobileFlow: boolean,\n radioValue: any,\n eligibleBundle: any,\n address: any,\n setShowLinecheck: any,\n showLinecheck: any,\n lineCheckCallBack: any,\n enableP2P: any,\n P2PData: any,\n content: any,\n tvOptions?: any,\n discountRef?: string,\n discountVersion?: string,\n // Shogun/rewards (loyalty) flow — forwarded verbatim to createCartV2 so it\n // can append the pointsBurnt note at the item level (RATEPLAN for MOBILE,\n // internet item for FIXNET).\n rewardsInfo?: {\n pointsBurnt?: string | number;\n rewardOfferId?: string | number;\n gloxTokenId?: string | null;\n },\n successLoaderData?: SuccessLoaderData\n): any => {\n if (isMobileFlow) {\n setShowLoader(true);\n const vcType: { voucher: string; voucherType: string } = getLocalStorageWithExpiry(VCTYPE);\n Object.keys(uniqueProductData)?.length !== 0 &&\n createCartV2(\n uniqueProductData,\n '',\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE,\n cartEndPoint,\n 'mobile',\n giftItem,\n enableP2P,\n P2PData,\n mainContent?.productContainer?.[0]?.isQoQaFlow,\n vcType?.voucher,\n null,\n null,\n discountRef,\n discountVersion,\n rewardsInfo\n )\n .then((res: any) => {\n Cookies.remove('one-commerce-cartId', { path: '/' });\n // saving newly created cartid in the cookies.\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEPRODUCT);\n\n redirectWithSuccess(mainContent?.summaryPageUrl?.cached_url, successLoaderData);\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.log(err);\n setShowLoader(false);\n })\n .finally(() => {\n setShowLoader(false);\n });\n } else {\n const linecheckId: any =\n typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid');\n if (!eligibleBundle || !address || !linecheckId) {\n mainContent?.enableLinecheckOverlay ? setShowLinecheck(!showLinecheck) : lineCheckCallBack();\n } else {\n setShowLoader(true);\n uniqueProductData.length !== 0 &&\n createCartV2(\n uniqueProductData,\n radioValue,\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_WIRELINE_BUNDLE,\n cartEndPoint,\n 'fixnet',\n giftItem,\n '',\n '',\n false,\n '',\n '',\n tvOptions,\n undefined,\n undefined,\n rewardsInfo\n )\n .then((res: any) => {\n typeof window !== 'undefined' && Cookies.remove('one-commerce-cartId', { path: '/' });\n // saving newly created cartid in the cookies.\n typeof window !== 'undefined' &&\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\n typeof window !== 'undefined' &&\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\n typeof window !== 'undefined' && Cookies.remove('landline');\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLE);\n const productUrl = checkLinkWithLang(content?.productBasedCheckoutUrl?.cached_url);\n let recommendAccessory = false;\n /**Check if bundle or Internet and add it to cart request*/\n if (uniqueProductData[0]?.isBundle) {\n uniqueProductData[0]?.bundledOffers?.map((item: any) => {\n if (\n item?.productType?.toLowerCase() === 'internet' ||\n item?.productType?.toLowerCase() == 'tv'\n ) {\n if (item?.recommendAccessory) {\n recommendAccessory = item?.recommendAccessory;\n }\n }\n // setting to false incase of Mobile product Type as it is currently out of scope\n if (item?.productType?.toLowerCase() === 'mobile') {\n recommendAccessory = false;\n return;\n }\n });\n } else {\n /**Add standlone product such as internet to cart request*/\n if (uniqueProductData?.[0]?.recommendAccessory) {\n recommendAccessory = uniqueProductData?.[0]?.recommendAccessory;\n }\n }\n //setting the session to identify internet flow for mia for win\n if (recommendAccessory) {\n const sessionObj = { flow: 'WIN' };\n sessionStorage.setItem(ONE_ECOMMERCE_SUMMARY, JSON.stringify(sessionObj));\n }\n\n const finalURL = productUrl\n ? productUrl\n : content?.enableTVStreamingOptionsStepper && mainContent?.vasStepperURL?.cached_url\n ? mainContent?.vasStepperURL?.cached_url\n : recommendAccessory && mainContent?.multiItemPageRedirectionUrl?.cached_url\n ? mainContent?.multiItemPageRedirectionUrl?.cached_url\n : mainContent?.summaryPageUrl?.cached_url;\n\n redirectWithSuccess(finalURL, successLoaderData);\n })\n .catch((err: any) => {\n // eslint-disable-next-line no-console\n console.log(err);\n })\n .finally(() => {\n setShowLoader(false);\n });\n }\n }\n};\n\nconst pendingHeightPasses = new Map<number, ReturnType<typeof setTimeout> | boolean>();\n\nconst equalizeSectionGroup = (prefixes: string[], tabIndex: number, cardsLength: number) => {\n const groups: HTMLElement[][] = [];\n\n for (const prefix of prefixes) {\n const idPrefix = `${prefix}${tabIndex}`;\n const elements: HTMLElement[] = [];\n for (let item = 0; item < cardsLength; item++) {\n const element = document.getElementById(`${idPrefix}${item}`);\n if (element) {\n elements.push(element);\n }\n }\n if (elements.length > 0) {\n groups.push(elements);\n }\n }\n\n if (groups.length === 0) {\n return;\n }\n\n // Phase 1: Batch all DOM writes (reset heights)\n for (const elements of groups) {\n for (const element of elements) {\n element.style.height = 'unset';\n }\n }\n\n // Phase 2: Batch all DOM reads (single layout reflow for the entire level)\n const maxHeights = groups.map((elements) =>\n Math.max(...elements.map((element) => element.clientHeight))\n );\n\n // Phase 3: Batch all DOM writes (apply equalized heights)\n groups.forEach((elements, index) => {\n const maxHeight = `${maxHeights[index]}px`;\n for (const element of elements) {\n element.style.height = maxHeight;\n }\n });\n};\n\n// Every card in a tab requests the same pass; run it once per tab before paint when delay is 0.\nexport const scheduleFindHeight = (tabIndex: number, cardsLength: number, delay = 0) => {\n const pending = pendingHeightPasses.get(tabIndex);\n if (pending) {\n if (typeof pending !== 'boolean') {\n clearTimeout(pending);\n } else if (delay <= 0) {\n return;\n }\n }\n\n if (delay <= 0 && typeof queueMicrotask === 'function') {\n pendingHeightPasses.set(tabIndex, true);\n queueMicrotask(() => {\n pendingHeightPasses.delete(tabIndex);\n findHeight(tabIndex, cardsLength);\n });\n return;\n }\n\n pendingHeightPasses.set(\n tabIndex,\n setTimeout(() => {\n pendingHeightPasses.delete(tabIndex);\n findHeight(tabIndex, cardsLength);\n }, delay)\n );\n};\n\nexport const findHeight = (tabIndex: number, cardsLength: number) => {\n const setTimerSectionHeight = () => {\n let maxActiveTimerHeight = 0;\n const timerSections: HTMLElement[] = [];\n\n [...Array(cardsLength)].forEach((_, index) => {\n const timerSection = document.getElementById(`timer-section${tabIndex}${index}`);\n if (timerSection) {\n timerSections.push(timerSection);\n const isTimerActive = timerSection.dataset.timerActive === 'true';\n if (isTimerActive) {\n const spacer = timerSection.firstElementChild as HTMLElement | null;\n // Read the inline style target height instead of clientHeight so that\n // an in-progress CSS transition does not yield an intermediate value.\n const targetHeight = parseFloat(spacer?.style.height || '0') || 0;\n maxActiveTimerHeight = Math.max(maxActiveTimerHeight, targetHeight);\n }\n }\n });\n\n timerSections.forEach((timerSection) => {\n const isTimerActive = timerSection.dataset.timerActive === 'true';\n timerSection.style.transition = 'height 0.3s ease';\n timerSection.style.height = isTimerActive ? '0px' : `${maxActiveTimerHeight}px`;\n });\n };\n\n setTimerSectionHeight();\n\n // Level 1: Equalize independent leaf sections in a single layout pass\n equalizeSectionGroup(\n [\n 'headingV3',\n 'descriptionV3',\n 'titleV3',\n 'product-configv3',\n 'cashback-section',\n 'exclusive-benefits-section',\n 'benefits-section',\n 'price-section',\n 'discountedpricetoggle-section',\n 'contract-section'\n ],\n tabIndex,\n cardsLength\n );\n\n // Level 2: Equalize mid-level parent sections after their children are sized\n equalizeSectionGroup(['detailsectionv3', 'gift-section', 'order-section'], tabIndex, cardsLength);\n\n // Level 3: Equalize outer bottom container after its children are sized\n getElementMaximumHeight('benefits-price-section' + `${tabIndex}`, cardsLength);\n};\n\nconst setMobileSummarySession = (\n promoId: string,\n uniqueProductData: any,\n pretopostvalues?: any,\n showPrice?: any,\n product?: any,\n pegaIntegration?: any\n) => {\n const productPrice = uniqueProductData;\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\n const contractDuration = productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? 0;\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\n const pretopostvalue = pretopostvalues ?? '';\n //PEGA Integration\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\n const clientDiscountInfo = pegaIntegration\n ? {\n discountRef: discountRef,\n discountType: 'DISCOUNT'\n }\n : null;\n const note = [];\n note?.push({\n author: 'offerType',\n text: 'ATL'\n });\n note?.push({\n author: 'externalPromotionName',\n text: discountRef\n });\n note?.push({\n author: 'offerVersion',\n text: discountVersion\n });\n\n const extraNotes = pegaIntegration ? note : null;\n const urlParams = new URLSearchParams(window.location.search);\n const flow = urlParams.get('flow');\n const sessionObj: any = {\n mobileSubscription: productPrice?.[0]?.id ?? '',\n mobileSubscriptionPrice: discount > 0 ? discount : base,\n mobileSubscriptionPromo: promoId,\n subGroup: 'MOBILE',\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\n basePrice: base,\n withoutPromo: false,\n pretopostvalue: pretopostvalue,\n upBenefit:\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\n clientDiscountInfo: clientDiscountInfo,\n extraNotes: extraNotes,\n isOttFlow: flow === 'ott' ? true : false\n };\n\n typeof window !== undefined &&\n sessionStorage.setItem('one-ecommerce-mobileSummary', JSON.stringify(sessionObj));\n};\n\nexport const combineWithSmartPhone = (\n showPrice: any,\n storyContent: any,\n uniqueProductData: any,\n responseData?: any,\n product?: any,\n pegaIntegration?: boolean\n) => {\n const pretopostvalues = {\n msisdn: responseData?.msisdn ?? '',\n ratePlan: responseData?.ratePlan ?? '',\n ratePlanType: responseData?.ratePlanType ?? '',\n productId: responseData ? showPrice?.id : ''\n };\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\n let Params = '';\n Params = `?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${\n promoId ?? ''\n }&productCode=${showPrice?.id ?? ''}`;\n window.location.href = storyContent?.addSmartPhone?.[0]?.buttonLink?.cached_url + Params;\n setMobileSummarySession(\n promoId,\n uniqueProductData,\n responseData && pretopostvalues,\n showPrice,\n product,\n pegaIntegration\n );\n trackNewDatalayerEvent(\n GAEVENT,\n COMBINEDEVICE,\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\n );\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\n};\n\nconst setFixnetSummarySession = (\n promoId: string,\n uniqueProductData: any,\n showPrice?: any,\n product?: any,\n pegaIntegration?: any,\n productName?: string,\n recommendAccessory?: boolean | undefined\n) => {\n const productPrice = uniqueProductData;\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\n const contractDuration =\n productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? showPrice?.contractDuration ?? 0;\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\n\n //PEGA Integration\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\n const clientDiscountInfo = pegaIntegration\n ? {\n discountRef: discountRef,\n discountType: 'DISCOUNT'\n }\n : null;\n const note = [];\n note?.push({\n author: 'offerType',\n text: 'ATL'\n });\n note?.push({\n author: 'externalPromotionName',\n text: discountRef\n });\n note?.push({\n author: 'offerVersion',\n text: discountVersion\n });\n\n const extraNotes = pegaIntegration ? note : null;\n\n const sessionObj: any = {\n internetSubscription: productName ?? '',\n internetSubscriptionId: productPrice?.[0]?.id ?? '',\n internetSubscriptionPrice: discount > 0 ? discount : base,\n internetSubscriptionPromo: promoId,\n subGroup: 'INTERNET',\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\n basePrice: base,\n withPromo: discount > 0 ? true : false,\n upBenefit:\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\n clientDiscountInfo: clientDiscountInfo,\n extraNotes: extraNotes,\n productType: 'subscription',\n recommendAccessory: recommendAccessory\n };\n\n typeof window !== undefined &&\n sessionStorage.setItem(ONE_ECOMMERCE_INTERNET_SUMMARY, JSON.stringify(sessionObj));\n};\nexport const combineWithVasOptions = (\n showPrice: any,\n uniqueProductData: any,\n product?: any,\n pegaIntegration?: boolean,\n productName?: string,\n recommendAccessory?: boolean\n) => {\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\n\n setFixnetSummarySession(\n promoId,\n uniqueProductData,\n showPrice,\n product,\n pegaIntegration,\n productName,\n recommendAccessory\n );\n trackNewDatalayerEvent(\n GAEVENT,\n COMBINEDEVICE,\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\n );\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\n};\n\nexport const fetchServiceOptions = (entitlement: any, isMobileFlow: boolean) => {\n let service: any;\n if (!isMobileFlow) {\n service = (entitlement || []).filter((product: any) => product?.enableTV === true);\n }\n return service;\n};\n\nexport const fetchPrice = (\n product: any,\n isMobileFlow: boolean,\n pageType?: string,\n isConfigurator?: boolean,\n tvOptions?: any[],\n pegaIntegration?: boolean\n): any => {\n const showPrice: any = {\n base: '',\n onetimePrice: '',\n discount: [],\n contractDuration: '',\n int_fmc: 0,\n mob_fmc: 0,\n mob_benefit_category: '',\n id: '',\n promoID: '',\n loyaltyPrice: ''\n };\n let tvOptionsBasePrice = 0;\n let tvOptionsDiscountPrice = 0;\n let tvOptionsBaseToDiscount = 0;\n\n Array.isArray(product) &&\n product?.map((item: any) => {\n showPrice['id'] = item?.id ?? '';\n item?.prices?.map((basePrice: any) => {\n if (basePrice?.priceType?.toLowerCase() === 'recurring') {\n if (tvOptions && tvOptions?.length > 0) {\n tvOptions?.forEach((opt: any) => {\n if (opt?.beneficiaryPrice > 0) {\n tvOptionsDiscountPrice += parseFloat(opt?.beneficiaryPrice);\n } else if (opt?.derivedPrice > 0) {\n tvOptionsDiscountPrice += parseFloat(opt?.derivedPrice);\n } else {\n tvOptionsBaseToDiscount += parseFloat(opt?.recurringPrice);\n }\n if (opt?.recurringPrice > 0) {\n tvOptionsBasePrice += parseFloat(opt?.recurringPrice);\n }\n });\n //If one of the options in the list has a discount, other options base price is stored to sum it up in the end\n if (tvOptionsDiscountPrice > 0) {\n tvOptionsDiscountPrice += tvOptionsBaseToDiscount;\n }\n showPrice['base'] = JSON.stringify(\n parseFloat(basePrice?.value) +\n (tvOptionsDiscountPrice > 0 ? tvOptionsDiscountPrice : tvOptionsBasePrice)\n );\n } else {\n showPrice['base'] = basePrice?.value;\n }\n } else if (basePrice?.priceType?.toLowerCase() === 'one time')\n showPrice['onetimePrice'] = basePrice?.value;\n });\n item?.derivedPrice?.map((discountPrice: any) => {\n const cycle = { cycleStart: '', cycleEnd: '', value: '' };\n cycle['cycleStart'] =\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\n ? 1\n : discountPrice?.cycle?.cycleStart;\n cycle['cycleEnd'] =\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\n ? pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\n : discountPrice?.cycle?.cycleEnd;\n cycle['value'] = discountPrice?.value;\n if (tvOptions && tvOptions?.length > 0) {\n if (tvOptionsDiscountPrice > 0) {\n cycle['value'] = JSON.stringify(\n parseFloat(discountPrice?.value) + tvOptionsDiscountPrice\n );\n } else {\n cycle['value'] = JSON.stringify(parseFloat(discountPrice?.value) + tvOptionsBasePrice);\n }\n }\n showPrice['discount'].push(cycle);\n });\n // Calculating loyalty price introduced with DC portfolio\n if (item?.promotionInfo?.[0]?.relatedPromo?.length > 0) {\n item?.promotionInfo?.[0]?.relatedPromo?.map((promo: any) => {\n if (promo?.type === 'LOYALTY_DISCOUNT') {\n showPrice['loyaltyPrice'] = promo?.discount;\n }\n });\n }\n });\n\n product?.[0]?.bundledOffers?.forEach((item: any) => {\n item?.prices?.forEach((productDetails: any) => {\n if (productDetails?.priceAlteration?.length > 0) {\n productDetails?.priceAlteration?.forEach((price: any) => {\n if (price?.priceCategory == 'INTERNET_FMC') {\n showPrice['int_fmc'] += Number(price?.value);\n } else if (\n price?.priceCategory == 'MULTIMOBILE' ||\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\n price?.priceCategory == 'FMC'\n ) {\n showPrice['mob_fmc'] += Number(price?.value);\n showPrice['mob_benefit_category'] = price?.priceCategory;\n }\n });\n }\n });\n if (item?.contractDuration) {\n showPrice['contractDuration'] = item?.contractDuration; // for bundled products contract duration is taken from bundled offers\n }\n if (item?.promotionInfo?.[0]?.id && !pegaIntegration) {\n showPrice['promoID'] = item?.promotionInfo?.[0]?.id;\n }\n });\n if (!product?.[0]?.isBundle) {\n showPrice['contractDuration'] = product?.[0]?.contractDuration; // for other products\n if (!pegaIntegration) {\n showPrice['promoID'] = product?.[0]?.promotionInfo?.[0]?.id;\n }\n }\n let int_fmc = 0;\n product?.[0]?.prices?.map((productDetails: any) => {\n if (productDetails?.priceAlteration?.length > 0) {\n productDetails?.priceAlteration?.map((price: any) => {\n if (price?.priceCategory == 'INTERNET_FMC') {\n int_fmc += Number(price?.value);\n } else if (\n price?.priceCategory == 'MULTIMOBILE' ||\n price?.priceCategory == 'MULTIMOBILE_REWARD' ||\n price?.priceCategory == 'FMC'\n ) {\n showPrice['mob_fmc'] += Number(price?.value);\n showPrice['mob_benefit_category'] = price?.priceCategory;\n }\n });\n }\n });\n if (!showPrice?.contractDuration && !isMobileFlow) {\n showPrice['contractDuration'] = '12';\n }\n {\n showPrice['int_fmc'] = isConfigurator ? int_fmc : showPrice['int_fmc'];\n }\n if (pageType == '4P') {\n let bundleContractDuration = '0';\n product?.[0]?.bundledOffers?.map((offerData: any) => {\n if (offerData?.contractDuration) {\n bundleContractDuration =\n Number(bundleContractDuration) > Number(offerData?.contractDuration)\n ? bundleContractDuration\n : offerData?.contractDuration;\n }\n });\n showPrice['contractDuration'] = bundleContractDuration;\n }\n return showPrice;\n};\n\n//function for creating different array for 3 selections\nexport const fetchFilteredProducts = (productList: any, toggleState: any) => {\n //need to centralize for comman solution\n // Filter productList based on gigaSpeed toggle - US #363853\n let filteredList = productList;\n\n filteredList = productList.filter((item: any) => {\n const gigaSpeedValue = item?.gigaSpeed?.toLowerCase();\n if (toggleState?.gigaSpeed) {\n return gigaSpeedValue != 'hide';\n } else {\n return gigaSpeedValue != 'show';\n }\n });\n\n let mainArray = filteredList;\n const numberOfArray = 3;\n let res1 = [];\n let res2 = [];\n let res3 = [];\n for (let item of mainArray) {\n const multiIndex = item?.productIndex?.includes(',');\n const updatedMultiIndex = multiIndex && item?.productIndex?.split(',');\n if (multiIndex) {\n for (let mIndex of updatedMultiIndex) {\n for (let i = 0; i < numberOfArray; i++) {\n if (Number(mIndex) === i) {\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\n }\n }\n }\n } else {\n for (let i = 0; i < numberOfArray; i++) {\n if (Number(item?.productIndex) === i) {\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\n }\n }\n }\n }\n const displayContent =\n toggleState?.TV && toggleState?.Netflix ? res3 : toggleState?.TV ? res2 : res1;\n return displayContent;\n};\nexport const fetchOttItems = (ottCartData: any) => {\n return (ottCartData?.products || [])?.map((products: any) => ({\n itemType: products?.type ?? '',\n promotionId: products?.promo ?? '',\n items: [\n {\n itemType: products?.type === TV_SERVICE_OPTION ? TV_SERVICE_OPTION : RATEPLAN,\n id: products?.id ?? ''\n }\n ]\n }));\n};\n\n// ─── Shogun shared-offer cache ────────────────────────────────────────────────\n\ninterface ShogunOfferCacheEntry {\n gloxTokenId: string;\n results: any[] | null;\n promise: Promise<any[]> | null;\n}\n\nlet shogunOfferSharedCache: ShogunOfferCacheEntry | null = null;\n\n/**\n * Returns true when the shared cache already holds resolved results for the\n * given token. Callers can use this to skip triggering a loading state.\n */\nexport const isShogunOfferResolved = (gloxTokenId: string): boolean =>\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId && shogunOfferSharedCache.results !== null;\n\n/**\n * Shared-promise manager for the Shogun offer API.\n *\n * Because the Shogun flow sends no product payload (only gloxTokenId) the\n * response is identical for every StaticProductContainer on the page.\n * This function ensures exactly one network request is made:\n * - If results are already resolved → returns Promise.resolve(results)\n * - If a fetch is in-flight → returns the same promise\n * - First caller → creates the fetch and stores the promise\n *\n * On failure the promise rejects — the caller is responsible for surfacing\n * the error (e.g. showing the telesales/error popup). The failure is NOT\n * cached, so a retry (e.g. tab switch) will trigger a fresh request.\n */\nexport const getShogunSharedOffer = (\n gloxTokenId: string,\n uniqueId: string,\n offerEndpoint: string\n): Promise<any[]> => {\n // Already resolved\n if (isShogunOfferResolved(gloxTokenId)) {\n return Promise.resolve(shogunOfferSharedCache!.results!);\n }\n\n // In-flight\n if (\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\n shogunOfferSharedCache.promise !== null\n ) {\n return shogunOfferSharedCache.promise;\n }\n\n // First caller — start the real fetch\n const fetchPromise: Promise<any[]> = fetchShogunOfferData(gloxTokenId, uniqueId, offerEndpoint)\n .then((resp: any) => {\n const results: any[] = resp?.[uniqueId] ?? [];\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\n shogunOfferSharedCache.results = results;\n shogunOfferSharedCache.promise = null;\n }\n return results;\n })\n .catch((err: any) => {\n // Clear the cache entry so the next call retries the API.\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\n shogunOfferSharedCache = null;\n }\n throw err;\n });\n\n shogunOfferSharedCache = { gloxTokenId, results: null, promise: fetchPromise };\n return fetchPromise;\n};\n\n/**\n * Filters and sorts the Storyblok product list to match only the products\n * returned by the Shogun offer API, preserving the API response order.\n */\nexport const filterShogunProducts = (\n availableProducts: any[],\n shogunProductIds: string[]\n): any[] => {\n const filtered = availableProducts.filter((product: any) => {\n const productId = product?.products?.[0]?.reference?.content?.product?.[0]?.productId;\n return shogunProductIds.includes(productId);\n });\n\n filtered.sort((a: any, b: any) => {\n const aId = a?.products?.[0]?.reference?.content?.product?.[0]?.productId;\n const bId = b?.products?.[0]?.reference?.content?.product?.[0]?.productId;\n return shogunProductIds.indexOf(aId) - shogunProductIds.indexOf(bId);\n });\n\n return filtered;\n};\n"],"names":["isTimerActive","startTime","endTime","now","Date","start","calculateDateTime","replace","end","Number","isNaN","getTime","_a","getTimeUntilNextTimerEvent","startTimeMs","endTimeMs","Math","max","fetchStaticProductIds","productList","productId","bundle4PProduct","tvOptionIds","pricesToggleState","map","data","productRequest","id","promoIds","productData","_e","_d","_c","_b","products","reference","content","product","promotionData","_k","_j","_h","_g","_f","promotion","promoDescription","promotionId","timer","_l","timerIsActive","timerPromotionId","_s","_r","_q","_p","_o","_m","defaultPromotionId","DEFAULT_MOBILEPOSTPAID_BUNDLE","_t","push","_u","mobilePromotionData","_z","_y","_x","_w","_v","mobilePromotion","_0","fetchPegaProducts","pegaCustomerInterest","placements","customerInterest","tabCaption","l","toUpperCase","atlOffers","offerValidations","key","type","value","pegaRequestOfferCount","toString","filter","Boolean","checkGiftOrCashback","showGift","cashbackAvailable","promotionInfo","offer","hardwareGift","cashBack","staticCreateCart","setShowLoader","cartEndPoint","giftItem","uniqueProductData","mainContent","showPrice","isMobileFlow","radioValue","eligibleBundle","address","setShowLinecheck","showLinecheck","lineCheckCallBack","enableP2P","P2PData","tvOptions","discountRef","discountVersion","rewardsInfo","successLoaderData","vcType","getLocalStorageWithExpiry","VCTYPE","Object","keys","length","createCartV2","promoID","productContainer","isQoQaFlow","voucher","then","res","Cookies","remove","path","set","trackEligibleItem","ADDTOCART","LINETABLEPRODUCT","redirectWithSuccess","summaryPageUrl","cached_url","catch","err","console","log","finally","linecheckId","window","get","DEFAULT_WIRELINE_BUNDLE","undefined","LINETABLE","productUrl","checkLinkWithLang","productBasedCheckoutUrl","recommendAccessory","isBundle","bundledOffers","item","productType","toLowerCase","sessionObj","flow","sessionStorage","setItem","ONE_ECOMMERCE_SUMMARY","JSON","stringify","finalURL","enableTVStreamingOptionsStepper","vasStepperURL","multiItemPageRedirectionUrl","enableLinecheckOverlay","pendingHeightPasses","Map","equalizeSectionGroup","prefixes","tabIndex","cardsLength","groups","prefix","idPrefix","elements","element","document","getElementById","style","height","maxHeights","clientHeight","forEach","index","maxHeight","scheduleFindHeight","delay","pending","clearTimeout","queueMicrotask","delete","findHeight","setTimeout","maxActiveTimerHeight","timerSections","Array","_","timerSection","dataset","timerActive","spacer","firstElementChild","targetHeight","parseFloat","transition","setTimerSectionHeight","getElementMaximumHeight","combineWithSmartPhone","storyContent","responseData","pegaIntegration","pretopostvalues","msisdn","ratePlan","ratePlanType","promoId","Params","location","href","addSmartPhone","buttonLink","productPrice","base","prices","discount","derivedPrice","contractDuration","campaignDuration","pretopostvalue","version","clientDiscountInfo","discountType","note","author","text","extraNotes","URLSearchParams","search","mobileSubscription","mobileSubscriptionPrice","mobileSubscriptionPromo","subGroup","duration","basePrice","withoutPromo","upBenefit","mob_benefit_category","ultimateBundlePromo","ultimateBundlePromotion","isOttFlow","setMobileSummarySession","trackNewDatalayerEvent","GAEVENT","COMBINEDEVICE","getEcomCartInfo","LINETABLEDEVICE","combineWithVasOptions","productName","internetSubscription","internetSubscriptionId","internetSubscriptionPrice","internetSubscriptionPromo","withPromo","_1","ONE_ECOMMERCE_INTERNET_SUMMARY","setFixnetSummarySession","fetchServiceOptions","entitlement","service","enableTV","fetchPrice","pageType","isConfigurator","onetimePrice","int_fmc","mob_fmc","loyaltyPrice","tvOptionsBasePrice","tvOptionsDiscountPrice","tvOptionsBaseToDiscount","isArray","priceType","opt","beneficiaryPrice","recurringPrice","discountPrice","cycle","cycleStart","cycleEnd","relatedPromo","promo","productDetails","priceAlteration","price","priceCategory","bundleContractDuration","offerData","fetchFilteredProducts","toggleState","filteredList","gigaSpeedValue","gigaSpeed","mainArray","res1","res2","res3","multiIndex","productIndex","includes","updatedMultiIndex","split","mIndex","i","TV","Netflix","fetchOttItems","ottCartData","itemType","items","TV_SERVICE_OPTION","RATEPLAN","shogunOfferSharedCache","isShogunOfferResolved","gloxTokenId","results","getShogunSharedOffer","uniqueId","offerEndpoint","Promise","resolve","promise","fetchPromise","fetchShogunOfferData","resp","filterShogunProducts","availableProducts","shogunProductIds","filtered","sort","a","b","aId","bId","indexOf"],"mappings":"81BAgCaA,EAAgB,CAACC,EAAmBC,KAC/C,IACE,MAAMC,EAAM,IAAIC,KACVC,EAAQC,EAAkB,IAAIF,KAAKH,EAAUM,QAAQ,KAAM,OAC3DC,EAAMF,EAAkB,IAAIF,KAAKF,EAAQK,QAAQ,KAAM,OAE7D,OAAIE,OAAOC,MAAML,EAAMM,aAAcF,OAAOC,MAAMF,EAAIG,aAI/CR,GAAOE,GAASF,EAAMK,EAC/B,CAAE,MAAAI,GACA,OAAO,CACT,GAGWC,EAA6B,CAACZ,EAAmBC,KAC5D,IACE,MAAMG,EAAQC,EAAkB,IAAIF,KAAKH,EAAUM,QAAQ,KAAM,OAC3DC,EAAMF,EAAkB,IAAIF,KAAKF,EAAQK,QAAQ,KAAM,OAE7D,GAAIE,OAAOC,MAAML,EAAMM,YAAcF,OAAOC,MAAMF,EAAIG,WACpD,OAAO,EAGT,MAAMR,GAAM,IAAIC,MAAOO,UACjBG,EAAcT,EAAMM,UACpBI,EAAYP,EAAIG,UAGtB,OAAIR,EAAMW,EACDE,KAAKC,IAAI,EAAGH,EAAcX,GAE/BA,GAAOW,GAAeX,EAAMY,EACvBC,KAAKC,IAAI,EAAGF,EAAYZ,GAG1B,CACT,CAAE,MAAAS,GACA,OAAO,CACT,GAGWM,EAAwB,CACnCC,EACAC,EACAC,EACAC,EAEAC,KAIAJ,SAAAA,EAAaK,IAAKC,0DAChB,MAAMC,EAAsB,CAC1BC,GAAI,GACJC,SAAU,IAGNC,EAA8D,QAA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ortal as d}from"react-dom";import a from"../SkeletonLoader/SkeletonLoader.js";import r from"./StaticLineTable.module.scss.js";import s from"../richtext.js";import c from"./StaticProductEntitlement.js";import v from"./StaticBenefit.js";import u from"./DynamicPriceSection.js";import m from"./CheckoutButton.js";import p from"./StaticProductDetails.js";import{LineTableBasicPropConfig as g,AssetPathPropConfig as f}from"../../services/LineTableBasicPropConfig.js";import h from"js-cookie";import{LoginBasicPropConfig as b}from"../../services/LoginBasicPropConfig.js";import E from"../login/LoginModalV2.js";import{isTimerActive as w,fetchServiceOptions as C,fetchPrice as P,scheduleFindHeight as S,checkGiftOrCashback as y,getTimeUntilNextTimerEvent as k,staticCreateCart as T,combineWithVasOptions as x,combineWithSmartPhone as D}from"./Product.utils.js";import L from"../ProductDetailsV3/GiftConfigV2.js";import $ from"../ProductDetailsV3/ChooseGiftV2.js";import{viewport as I,replacePlaceholder as N,getUtcTimestamp as B}from"../../utils/utils.js";import O from"./StaticProductCashback.js";import{trackNewDatalayerEvent as j}from"../../utils/AnalyticsUtils.js";import{CTABUTTONCLICK as A,GAEVENT as U,EXISTINGCUSTOMER as V,LINETABLE as F,DOWNLOADPRODUCT as M}from"../../Analytics/AnalyticsConstants.js";import R from"./TVChannelModal.js";import G from"../LineCheckV3/LinecheckModal.js";import _ from"../BenefitWrapper/BenefitsValidateWrapper.js";import J from"../PretoPost/PreToPostSubsPopup.js";import W from"../LineCheckV3/GenericModal.js";import{fetchSubscriptionData as q,trackPegaEvents as H,validateP2P as z}from"../../services/LineTableService.js";import K from"./ExsistingSubscriptionModal.js";import{getEcomCartInfo as Q}from"../../models/Analytics/items.js";import X from"../NewLineCheck/CoverageCheckModal.js";import{API_BASE_BASEPOINT as Y}from"../../services/api-constants.js";import{AppContext as Z}from"./StaticLineTableStore/StaticLineTableProvider.js";import ee from"./OttServiceOptions/OttServiceOptionsSmallPopup.js";import oe from"./StaticExclusiveBenefit.js";import le from"../UserLoggedPricesToggle/UserLoggedPricesToggle.js";import ne from"../FalconButtonV2/FalconButtonV2.js";import{ONE_ECOMMERCE_INTERNET_SUMMARY as ie}from"../../utils/constants.js";import te from"./StaticLineTabelTimer/StaticLineTabelTimer.js";import{useProductCardBadge as de}from"./ProductCardBadgeProvider.js";import ae from"../GenericPopup/GenericPopup.js";import re from"../GlobalDotLoader/GlobalDotLoader.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:De,loginSuccess:Le,setToggleState:$e,toggleState:Ie,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,reserveBadgeSpace:We})=>{var qe,He,ze,Ke,Qe,Xe,Ye,Ze,eo,oo,lo,no,io,to,ao,ro,so,co,vo,uo,mo,po,go,fo,ho,bo,Eo,wo,Co,Po,So,yo,ko,To,xo,Do,Lo,$o,Io,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,il,tl,dl,al,rl,sl,cl,vl,ul,ml,pl,gl,fl,hl,bl,El,wl,Cl,Pl,Sl,yl,kl,Tl,xl,Dl,Ll,$l,Il,Nl,Bl,Ol,jl,Al;const Ul=de(),[Vl,Fl]=l(!1),[Ml,Rl]=l(!1),[Gl,_l]=l({showGift:!1,cashbackAvailable:!1}),[Jl,Wl]=l(!0),[ql,Hl]=l(!1),[zl,Kl]=l([]),[Ql,Xl]=l(!1),[Yl,Zl]=l(!1),[en,on]=l(!1),[ln,nn]=l(!1),[tn,dn]=l(!1),[an,rn]=l(!1),sn=`${ye}inf/customer-management/subscriptions`,cn=`${ye}inf/resource-management/msisdns/pretopost/validation`,[vn,un]=l([]),[mn,pn]=l(!1),[gn,fn]=l(!1),[hn,bn]=l(!1),[En,wn]=l([]),[Cn,Pn]=l(!1),[Sn,yn]=l(!1),[kn,Tn]=l(!1),[xn,Dn]=l(!1),[Ln,$n]=l([]),[In,Nn]=l(0),[Bn,On]=l(!1),jn=n(null),[An,Un]=l(null),Vn=n(!1),Fn=n(null),[Mn,Rn]=l(!1),Gn=`${ye}inf/${Y.CUSTOMER}`,_n=(null===(Qe=null===(Ke=null===(ze=null===(He=null===(qe=null==be?void 0:be.globalDotLoader)||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.body)||void 0===Qe?void 0:Qe[0])?null===(oo=null===(eo=null===(Ze=null===(Ye=null===(Xe=null==be?void 0:be.globalDotLoader)||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.body)||void 0===oo?void 0:oo[0]:null===(lo=null==be?void 0:be.globalDotLoader)||void 0===lo?void 0:lo[0],Jn={duration:null!==(no=null==_n?void 0:_n.successMsgDuration)&&void 0!==no?no:"0",successLoaderCallback:Rn},Wn=void 0!==typeof window&&document.getElementById("static-linetable"),qn=0===(null===(io=Object.keys(se))||void 0===io?void 0:io.length),Hn=null===(co=null===(so=null===(ro=null===(ao=null===(to=null==se?void 0:se.products)||void 0===to?void 0:to[0])||void 0===ao?void 0:ao.reference)||void 0===ro?void 0:ro.content)||void 0===so?void 0:so.product)||void 0===co?void 0:co[0],zn=null===(go=null===(po=null===(mo=null===(uo=null===(vo=null==se?void 0:se.promotion)||void 0===vo?void 0:vo[0])||void 0===uo?void 0:uo.reference)||void 0===mo?void 0:mo.content)||void 0===po?void 0:po.promoDescription)||void 0===go?void 0:go[0],Kn=null===(fo=null==se?void 0:se.timer)||void 0===fo?void 0:fo[0],Qn=null==Kn?void 0:Kn.enableCounter,[Xn,Yn]=l(!!(Qn&&(null==Kn?void 0:Kn.startTime)&&(null==Kn?void 0:Kn.endTime))&&w(Kn.startTime,Kn.endTime)),Zn=Boolean((null==se?void 0:se.highlightText)&&!0!==Ge&&!Xn&&!(Ul&&(null==se?void 0:se.badgesContainer))),ei=Boolean((null==zn?void 0:zn.displayText)&&!(null==se?void 0:se.notShowPromotionLabel)&&!0!==Ge&&!Xn),oi=Boolean(Ul&&(null==se?void 0:se.badgesContainer)&&!0!==Ge&&!Xn&&!ei),li=null==Hn?void 0:Hn.productId,ni=null===(ho=null==g?void 0:g.getInstance())||void 0===ho?void 0:ho.getCartUrl(),ii=null===(bo=null==f?void 0:f.getInstance())||void 0===bo?void 0:bo.getAssetPath(),ti="MOBILE"===(null==ue?void 0:ue.pageType),di=I(),ai=i(Z);let ri;ri=Ee&&(null===(Eo=null==we?void 0:we.eligibleBundle)||void 0===Eo?void 0:Eo.includes(li));const si=null==se?void 0:se.enableTVStreamingOptionsPopUp,ci=null==se?void 0:se.enableTVStreamingOptionsStepper,vi=null==se?void 0:se.disableDiscountedPriceToggle,ui=null==se?void 0:se.skipAccessoriesPage;b.create({baseURL:null!=ye?ye:""});let mi=void 0!==typeof window&&h.get("sunriseAuth");mi=mi&&JSON.parse(mi);const pi=((null==ce?void 0:ce[ve])||[]).filter(e=>(null==e?void 0:e.id)===li),gi=e=>{wn(e)},fi=()=>{Xl(!0),nn(!ln),fn(!gn)},hi=()=>{var e,o,l;if(Rl(!1),xe&&null==mi)nn(!ln),fn(!gn);else if(xe&&(null==mi?void 0:mi.siteId))Si();else if(Pe===V&&(null==ke?void 0:ke.length)>0)dn(!0);else{!!((null==be?void 0:be.enableExistingCustomer)&&null==mi||!mi&&!0===Ge&&(null==Re?void 0:Re.enableLoggedInPrice))?Xl(!0):$i()}if(Ve){const n=localStorage.getItem("prospectId"),i=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:[],t=i[i.length-1],d={eventTimestamp:B(),eventType:"PageView",pageType:"CartCreated",pageLocation:t,targetProduct:li};n&&H(Gn,d,n)}},bi=e=>{const o=zl.findIndex(o=>(null==e?void 0:e.giftGroupId)===(null==o?void 0:o.giftGroupId)),l=zl;-1===o?l.push(e):l[o]=e,Kl([...l])},Ei=new URLSearchParams(null===(wo=null===window||void 0===window?void 0:window.location)||void 0===wo?void 0:wo.search),wi=null==Ei?void 0:Ei.get("selectedMsisdn"),Ci=e=>{var o;1===(null==e?void 0:e.length)?(ql?D(Ni,ue,pi,null==e?void 0:e[0],se,Ve):$i(null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.msisdn),rn(!1)):(null==e?void 0:e.length)>1?(un(e),bn(!hn),rn(!1)):(fn(!gn),rn(!0),Wl(!0),Fl(!1))},Pi=(o,l)=>e(void 0,void 0,void 0,function*(){yield z(null==o?void 0:o.msisdn,cn).then(e=>{e&&l.push(o)}).catch(e=>{console.log("error",e)})}),Si=()=>{var o;Fl(!0);try{null===(o=q("PREPAID",sn))||void 0===o||o.then(o=>e(void 0,void 0,void 0,function*(){if(204==(null==o?void 0:o.subscriptionData))fn(!gn),rn(!0),Wl(!0),Fl(!1);else{const l=null==o?void 0:o.subscriptionData,n=l.find(e=>e.msisdn===wi);if(l){const o=[];wi?(yield Pi(n,o),Ci(o)):yield Promise.all(null==l?void 0:l.map(l=>e(void 0,void 0,void 0,function*(){yield Pi(l,o)}))).then(e=>{Ci(o)})}}})).catch(e=>{console.log("error---\x3e",e),Fl(!1)})}catch(e){console.log("error---\x3e",e),Fl(!1)}pn(!0)},yi=()=>{fn(!Jl),nn(!1)},ki=e=>{Pn(!1),e&&j(U,A,{headline:"VAS POPUP CLOSE"})},Ti=()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");we=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),Ee="undefined"!=typeof window&&h.get("chAddressJson"),on(!en),"function"==typeof Ce&&Ce(),$i()},xi=C(null==Hn?void 0:Hn.bloks,ti),Di=null===(Co=null==xi?void 0:xi[0])||void 0===Co?void 0:Co.tvProductId,Li=e=>{var o,l,n,i,t,d,a,r,s,c;const v=Ve&&(null===(n=null===(l=null===(o=null==pi?void 0:pi[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===(t=null===(i=null==pi?void 0:pi[0])||void 0===i?void 0:i.promotionInfo)||void 0===t?void 0:t[0])||void 0===d?void 0:d.version),m=_e?{pointsBurnt:null===(r=null===(a=null==pi?void 0:pi[0])||void 0===a?void 0:a.rewards)||void 0===r?void 0:r.points,rewardOfferId:null===(c=null===(s=null==pi?void 0:pi[0])||void 0===s?void 0:s.rewards)||void 0===c?void 0:c.offerId,gloxTokenId:Je}:void 0;pi&&pi[0]&&(pi[0].fromPopup=xn),ji("false"),sessionStorage.removeItem("vasPopUp"),yn(!1),T(Fl,ni,zl,pi,be,Ni,ti,Di,we,Ee,on,en,De,xe,null!=wi?wi:e,se,En,v,u,m,Jn)},$i=e=>{var o,l,n,i,t,d,a,r,s;Dn(!1),Rl(!1);let c=void 0!==typeof window&&h.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&&!ti&&!ri){return void(document.getElementById("linecheck")&&De())}if(ri&&!ti&&(null===(l=null==be?void 0:be.loginData)||void 0===l?void 0:l.length)>0&&u)Xl(!0);else if(ci&&(null===(n=pi[0])||void 0===n?void 0:n.isBundle)){let o=!1;ui||((null===(i=pi[0])||void 0===i?void 0:i.isBundle)?null===(d=null===(t=pi[0])||void 0===t?void 0:t.bundledOffers)||void 0===d||d.map(e=>{var l,n,i;"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===(i=null==e?void 0:e.productType)||void 0===i?void 0:i.toLowerCase())||(o=!1)}):(null===(a=null==pi?void 0:pi[0])||void 0===a?void 0:a.recommendAccessory)&&(o=null===(r=null==pi?void 0:pi[0])||void 0===r?void 0:r.recommendAccessory)),x(Ni,pi,se,Ve,null==Hn?void 0:Hn.productName,o),Li(e)}else si&&(null===(s=pi[0])||void 0===s?void 0:s.isBundle)&&!Sn?(Pn(!0),yn(!0),ji("true"),window.addEventListener("beforeunload",function(e){ji("false"),sessionStorage.removeItem("vasPopUp"),yn(!1)})):(xe&&Fl(!0),Li(e))},Ii=(e,o)=>l=>{var n;const i=void 0!==typeof window&&h.get("one-commerce-cartId");(null==be?void 0:be.enableReplacePopup)&&i?(jn.current=()=>e(l),Vn.current=Boolean(o),Un(null!=o?o:null===(n=null==be?void 0:be.generalReplacePopup)||void 0===n?void 0:n[0]),On(!0)):e(l)},Ni=P(pi,ti,null==be?void 0:be.pageType,!1,En,Ve);t(()=>{var e,o;S(pe,ge);const l=y(ti?pi:null!==(o=null===(e=null==pi?void 0:pi[0])||void 0===e?void 0:e.bundledOffers)&&void 0!==o?o:pi);_l(Object.assign({},l))},[ce,Ie,En,In,((null==Ie?void 0:Ie.TV)||(null==Ie?void 0:Ie.gigaSpeed)||(null==Ie?void 0:Ie.Netflix))&&Array.isArray(pi)&&3===(null===(So=null===(Po=null==pi?void 0:pi[0])||void 0===Po?void 0:Po.bundledOffers)||void 0===So?void 0:So.length)]);const Bi=()=>{((null==xi?void 0:xi.length)>0||si)&&Zl(!0)},Oi=null===(yo=null==be?void 0:be.productContainer)||void 0===yo?void 0:yo[0];t(()=>{ql&&(xe&&null==mi?(nn(!ln),fn(!gn)):xe&&(null==mi?void 0:mi.siteId)&&Si())},[ql]),t(()=>{var e;if(ai){const{store:o}=ai;(null===(e=null==o?void 0:o.ottOptionsApi)||void 0===e?void 0:e.length)>0&&0===(null==Ln?void 0:Ln.length)&&$n(null==o?void 0:o.ottOptionsApi)}},[ai]),t(()=>{if(!Qn||!(null==Kn?void 0:Kn.startTime)||!(null==Kn?void 0:Kn.endTime))return void Yn(!1);Yn(w(Kn.startTime,Kn.endTime));const e=k(Kn.startTime,Kn.endTime);if(e<=0)return;const o=setTimeout(()=>{Yn(w(Kn.startTime,Kn.endTime))},e);return()=>clearTimeout(o)},[Qn,null==Kn?void 0:Kn.startTime,null==Kn?void 0:Kn.endTime]),t(()=>{var e;const o=Fn.current;if(!o||!(null===(e=null==se?void 0:se.timer)||void 0===e?void 0:e.length)||!Qn)return void Nn(0);const l=()=>{Nn(o.clientHeight)};if(l(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(l);return n.observe(o),()=>{n.disconnect()}},[null===(ko=null==se?void 0:se.timer)||void 0===ko?void 0:ko.length,Qn]),t(()=>{kn&&(ki(),Tn(!0),ji("false"),sessionStorage.removeItem("vasPopUp"),yn(!1),Li())},[kn]),t(()=>{const e=()=>{const e=sessionStorage.getItem("vasPopUp");yn("true"===e)};e();const o=o=>{o.storageArea===sessionStorage&&"vasPopUp"===o.key&&e(),o.storageArea===sessionStorage&&"vasPopUp"===o.key&&null===o.newValue&&yn(!1)},l=()=>{e()};return window.addEventListener("storage",o),window.addEventListener("vasPopUpChange",l),()=>{window.removeEventListener("storage",o),window.removeEventListener("vasPopUpChange",l)}},[]);const ji=e=>{sessionStorage.setItem("vasPopUp",e);const o=new Event("vasPopUpChange");window.dispatchEvent(o)};return o.createElement("div",null,(Vl||Mn)&&Wn&&d(o.createElement(re,{content:_n,isSuccess:Mn}),Wn),qn&&o.createElement("div",{className:"w-75 pb-2"},o.createElement(a,null)),!qn&&we&&se&&Ee&&!ti&&o.createElement("div",{className:r.selected},o.createElement("span",{style:{paddingBottom:"10px"}},ri?o.createElement("span",{className:r.activeicon},o.createElement("img",{src:`${ii}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:r.activeicon}),o.createElement("span",null,null==he?void 0:he.subscriptionAvalTxt)):o.createElement("span",{className:r.inactiveicon},o.createElement("img",{src:`${ii}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:r.inactiveicon}),o.createElement("span",null,null==he?void 0:he.notSubscriptionTxt)))),o.createElement("div",{className:`${!ti&&!1===ri&&(null===(To=null==be?void 0:be.linecheckData)||void 0===To?void 0:To.length)>0&&"global/coverage-check"!==(null===(Lo=null===(Do=null===(xo=null==be?void 0:be.linecheckData)||void 0===xo?void 0:xo[0])||void 0===Do?void 0:Do.reference)||void 0===Lo?void 0:Lo.default_full_slug)?r.overlay:""}\n ${Me&&!(null===(Io=null===($o=null==pi?void 0:pi[0])||void 0===$o?void 0:$o.eligibility)||void 0===Io?void 0:Io.fpb)?r.disabled:""}\n `,style:{flexDirection:"column"}},o.createElement("div",{className:r.bundleproductcard},o.createElement("div",{id:`timer-section${pe}${fe}`,"data-timer-active":In>0?"true":"false"},(null===(No=null==se?void 0:se.timer)||void 0===No?void 0:No.length)&&Qn?o.createElement("div",{style:{height:`${In}px`,transition:"height 0.3s ease"}}):null),o.createElement("div",{className:`${r.productcontainer} ${We||oi||Zn||ei?r.productcontainerHasBadge:""}`,style:(()=>{const e=ei?zn: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}})()},oi&&Ul&&o.createElement(Ul,{badges:se.badgesContainer}),Zn&&o.createElement("div",{className:`${r.highlightText}`},null==se?void 0:se.highlightText),ei&&((null==zn?void 0:zn.badgeContainer)&&Ul?o.createElement(Ul,{badges:null==zn?void 0:zn.badgeContainer}):o.createElement("div",{className:`${r.promocontainer}`,style:{background:null==zn?void 0:zn.bestSellerColor}},null==zn?void 0:zn.displayText)),o.createElement("div",{ref:Fn,className:r.timerContainer},(null===(Bo=null==se?void 0:se.timer)||void 0===Bo?void 0:Bo.length)&&Qn?o.createElement(te,{content:null===(Oo=null==se?void 0:se.timer)||void 0===Oo?void 0:Oo[0],hasHighlightText:oi||ei,onTimerChange:e=>{Yn(e)}}):null),o.createElement("div",{className:`${r.detailsection} ${r.imageFullWidthSection}`,id:`detailsectionv3${pe}${fe}`},o.createElement("div",{className:`${r.headersection}`},o.createElement("div",{className:`${r.titlesection}`},o.createElement("div",{className:`${r.productheader}`,id:`titleV3${pe}${fe}`},null==Hn?void 0:Hn.productName),o.createElement("div",null,(null===(jo=null==Hn?void 0:Hn.icon)||void 0===jo?void 0:jo.filename)&&o.createElement("img",{className:`${r.imagecontainer}`,src:null===(Ao=null==Hn?void 0:Hn.icon)||void 0===Ao?void 0:Ao.filename,height:15,width:20,alt:"productIcon"}))),o.createElement("div",{className:`${r.productdescription}`,id:`descriptionV3${pe}${fe}`},o.createElement(s,{content:null==Hn?void 0:Hn.description})),o.createElement("div",{className:`${r.images}`},(null===(Uo=null==Hn?void 0:Hn.img)||void 0===Uo?void 0:Uo.filename)&&o.createElement("img",{className:`${r.imagespace} ${(null==se?void 0:se.highlightText)&&r.borderimage}`,alt:"cardimg",src:`${null===(Vo=null==Hn?void 0:Hn.img)||void 0===Vo?void 0:Vo.filename}/m/`}))),o.createElement("div",{className:`${r.productconfig}`,id:`product-configv3${pe}${fe}`},qn?o.createElement(o.Fragment,null,o.createElement("div",{className:r.space}),o.createElement(a,{stylename:r.skeletontittle,count:1}),o.createElement(a,{stylename:r.skeletonline,count:5}),o.createElement("div",{className:r.space}),o.createElement(a,{stylename:r.skeletontittle,count:1}),o.createElement(a,{stylename:r.skeletonline,count:5})):o.createElement("div",null,(null==Hn?void 0:Hn.bloks)&&(null===(Fo=null==Hn?void 0:Hn.bloks)||void 0===Fo?void 0:Fo.map((e,l)=>o.createElement(c,{content:e,indexKey:l,constants:he,key:l,showModalPopup:Bi,setToggleState:$e,toggleState:Ie,noTabs:Ne,mainContent:be,enableTVStreamingOptions:null==se?void 0:se.enableTVStreamingOptions,metadata:me,setTvOptionsData:gi})))))),o.createElement("div",{className:`${r.detailsection}`,id:`benefits-price-section${pe}${fe}`},o.createElement("div",{id:`exclusive-benefits-section${pe}${fe}`},(null===(Mo=null==Hn?void 0:Hn.extraBenefits)||void 0===Mo?void 0:Mo.length)>0&&o.createElement(oe,{content:null===(Ro=null==Hn?void 0:Hn.extraBenefits)||void 0===Ro?void 0:Ro[0]})),o.createElement("div",{className:`${r.benefitssection}`,id:`benefits-section${pe}${fe}`},(null===(Go=null==Hn?void 0:Hn.benefits)||void 0===Go?void 0:Go.length)>0&&o.createElement(v,{content:null==Hn?void 0:Hn.benefits,benefitData:Ni,constants:he,pricesToggleState:Ge,togglePriceLabel:null==Re?void 0:Re.togglePriceLabel})),o.createElement("br",null),o.createElement("div",{className:`${r.giftsection}`,id:`gift-section${pe}${fe}`},(null==Gl?void 0:Gl.showGift)&&(null===(_o=null==zn?void 0:zn.singleGift)||void 0===_o?void 0:_o.map((e,l)=>o.createElement(L,{content:e,key:l}))),(null==Gl?void 0:Gl.showGift)&&(null===(Jo=null==zn?void 0:zn.giftConfig)||void 0===Jo?void 0:Jo.map((e,l)=>o.createElement($,{content:e,key:l,selectedGiftItem:bi,parentPoType:ti?"MOBILE":"HOME"}))),o.createElement("div",{className:`${r.giftsection}`,id:`cashback-section${pe}${fe}`},o.createElement(O,{uniqueProductData:pi,mainContent:be}))),o.createElement("div",{className:`${r.ordersection}`,id:`order-section${pe}${fe}`},""===(null==Ni?void 0:Ni.base)?o.createElement("div",null,o.createElement(a,{stylename:r.skeletontittle})):o.createElement("div",{id:`price-section${pe}${fe}`},o.createElement(u,{priceCollection:Ni,constants:he,promoText:null==Hn?void 0:Hn.promoText,deviceFlow:Be,content:se,offeringData:ce,uniqueId:ve})),!_e&&o.createElement("div",{className:`${r.discountedpricetoggleSection}`,id:`discountedpricetoggle-section${pe}${fe}`},vi||"INLINE"!==(null==Re?void 0:Re.togglePosition)?null:o.createElement(le,{content:Hn,index:fe,lineTable:!0,toggleContent:Re})),xe&&(null==he?void 0:he.P2PDiscountLabel)&&o.createElement("div",{className:r.longterm},null==he?void 0:he.P2PDiscountLabel),qn?o.createElement(o.Fragment,null,o.createElement(a,{stylename:r.skeletontittle,count:1}),o.createElement(a,{stylename:r.skeletonline,count:2})):o.createElement("div",{className:`${(null==ue?void 0:ue.swapButton)&&r.swapButton}`},o.createElement("div",{style:{padding:"16px 0 0 0"}},o.createElement(m,{isMobileFlow:ti,createCartCall:(null==Be?void 0:Be.isDeviceFlow)?Ii(e=>{Rl(!1);Oe({setShowLoader:Fl,cartEndPoint:ni,giftItem:zl,uniqueProductData:pi,mainContent:be,showPrice:Ni,isMobileFlow:ti,eligibleBundle:we,address:Ee,setShowLinecheck:on,showLinecheck:en,lineCheckCallBack:De,enableP2P:xe,msisdnn:null!=wi?wi:e,content:se,selectedRP:je,continueCart:Ae,successLoaderData:Jn})}):Ii(ti?hi:$i),constants:he,storyContent:ue,showPrice:Ni,isAvailable:ri,address:Ee,uniqueProductBenefits:null==pi?void 0:pi[0],alwaysActive:!ri&&(null===(Wo=null==be?void 0:be.linecheckData)||void 0===Wo?void 0:Wo.length)>0&&"global/coverage-check"===(null===(zo=null===(Ho=null===(qo=null==be?void 0:be.linecheckData)||void 0===qo?void 0:qo[0])||void 0===Ho?void 0:Ho.reference)||void 0===zo?void 0:zo.default_full_slug),flexUpgradeFreePopup:null===(Qo=null===(Ko=null==be?void 0:be.flexUpgradeFreePopup)||void 0===Ko?void 0:Ko.reference)||void 0===Qo?void 0:Qo.content,content:se,deviceUltimateBundle:Me,forceDisabled:Boolean(null===(Yo=null===(Xo=null==pi?void 0:pi[0])||void 0===Xo?void 0:Xo.rewards)||void 0===Yo?void 0:Yo.notEligibleReason),notEligibileReason:null===(el=null===(Zo=null==pi?void 0:pi[0])||void 0===Zo?void 0:Zo.rewards)||void 0===el?void 0:el.notEligibleReason})),!_e&&(null===(ol=null==ue?void 0:ue.addSmartPhone)||void 0===ol?void 0:ol.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 Ii(()=>D(Ni,ue,pi,"",se,Ve),null===(e=null==be?void 0:be.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}},o.createElement("span",{className:r.buttontext},null==ue?void 0:ue.ctaLabel))):!(null==se?void 0:se.redirectOnly)&&o.createElement("div",{style:{padding:"12px 0 0 0"}},o.createElement(ne,{content:{buttonType:"Secondary-V1",buttonLabel:(null==se?void 0:se.ultimateBundlePromotion)?null==he?void 0:he.ultimateBundleLbl:null===(nl=null===(ll=null==ue?void 0:ue.addSmartPhone)||void 0===ll?void 0:ll[0])||void 0===nl?void 0:nl.buttonLabel,buttonIcon:null===(tl=null===(il=null==ue?void 0:ue.addSmartPhone)||void 0===il?void 0:il[0])||void 0===tl?void 0:tl.buttonIcon,buttonAlignment:"left"},wafIdentifier:ye,style:{width:"100%"},onClick:()=>{var e;return Ii(()=>xe?void Hl(!0):D(Ni,ue,pi,"",se,Ve),null===(e=null==be?void 0:be.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}}))),o.createElement("div",{className:r.productcontractduration,id:`contract-section${pe}${fe}`,style:{paddingTop:(null===(dl=null==ue?void 0:ue.addSmartPhone)||void 0===dl?void 0:dl.length)>0&&!(null==Be?void 0:Be.isDeviceFlow)&&!(null==ue?void 0:ue.swapButton)&&!(null==se?void 0:se.redirectOnly)?"8px":void 0}},(null==Ni?void 0:Ni.contractDuration)>"1"?N(null===(al=null==he?void 0:he.minContractDuration)||void 0===al?void 0:al.substring(1),[null==Ni?void 0:Ni.contractDuration]):null==he?void 0:he.noContractDuration)),o.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(rl=null==Hn?void 0:Hn.productDetails)||void 0===rl?void 0:rl.length)>0&&o.createElement("span",{className:r.productdetailslink,onClick:()=>{var e,o,l;Rl(!Ml),j(U,M,Q(pi,"",F));const n=localStorage.getItem("prospectId"),i=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:[],t=i[i.length-1],d={eventTimestamp:B(),eventType:"PageView",pageType:"ProductDetails",pageLocation:t,targetProduct:li};n&&H(Gn,d,n)}},null==he?void 0:he.productDetailsLink)),Ml&&o.createElement(p,{content:null==Hn?void 0:Hn.productDetails,showProductDetail:Ml,setShowProductDetail:Rl,constants:he,showPrice:Ni,isMobileFlow:ti,createCartCall:ti?hi:$i,storyContent:ue,isAvailable:ri,address:Ee,flexUpgradeFreePopup:null===(cl=null===(sl=null==be?void 0:be.flexUpgradeFreePopup)||void 0===sl?void 0:sl.reference)||void 0===cl?void 0:cl.content,notEligibileReason:null===(ul=null===(vl=null==pi?void 0:pi[0])||void 0===vl?void 0:vl.rewards)||void 0===ul?void 0:ul.notEligibleReason})))))),Me&&pi&&!(null===(pl=null===(ml=null==pi?void 0:pi[0])||void 0===ml?void 0:ml.eligibility)||void 0===pl?void 0:pl.fpb)&&o.createElement("div",{className:r.disabledInfo},o.createElement(s,{content:null==he?void 0:he.fpbNotCompatibleText})),Yl&&(qn?o.createElement(a,null):o.createElement(R,{content:null==xi?void 0:xi[0],setShowModal:Zl,showModal:Yl,constants:he})),Ql&&(null===(gl=null==be?void 0:be.loginData)||void 0===gl?void 0:gl.length)>0&&Wn&&d(o.createElement(E,{content:null===(fl=null==be?void 0:be.loginData)||void 0===fl?void 0:fl[0],closeLogin:()=>{Xl(!1)},metadata:me,onSuccess:()=>{Xl(!1),Te(),sessionStorage.removeItem("vasPopUp"),yn(!1),xe?Si():$i()},isProdEnv:Fe}),Wn),ln&&xe&&!Ql&&gn&&o.createElement(W,{modalState:Jl,handler:yi,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(J,{onClose:fi,content:null===(El=null===(bl=null===(hl=null==be?void 0:be.productContainer)||void 0===hl?void 0:hl[0])||void 0===bl?void 0:bl.p2pBloks)||void 0===El?void 0:El[0],prepaid:!1})),xe&&mn&&an&&gn&&o.createElement(W,{modalState:Jl,handler:yi,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px",id:"table-product"},o.createElement(J,{onClose:fi,content:null===(Pl=null===(Cl=null===(wl=null==be?void 0:be.productContainer)||void 0===wl?void 0:wl[0])||void 0===Cl?void 0:Cl.p2pBloks)||void 0===Pl?void 0:Pl[1],prepaid:!0})),(null==vn?void 0:vn.length)>1&&xe&&mn&&!an&&hn&&o.createElement(W,{modalState:hn,handler:()=>{Fl(!1),bn(!hn)},showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(K,{onSubmit:e=>{bn(!hn),ql?D(Ni,ue,pi,e,se,Ve):$i(null==e?void 0:e.msisdn)},exsistingSubscriptionData:vn,updatedContent:Oi})),en&&(null==be?void 0:be.enableLinecheckOverlay)&&!ti&&(null===(Sl=null==be?void 0:be.linecheckData)||void 0===Sl?void 0:Sl.length)>0&&!xe&&"global/new-linecheck-test"===(null===(Tl=null===(kl=null===(yl=null==be?void 0:be.linecheckData)||void 0===yl?void 0:yl[0])||void 0===kl?void 0:kl.reference)||void 0===Tl?void 0:Tl.default_full_slug)?o.createElement(G,{content:null===(xl=null==be?void 0:be.linecheckData)||void 0===xl?void 0:xl[0],onSuccess:Ti,showModal:en,setShowModal:on,productName:null==Hn?void 0:Hn.productName,productId:null==Hn?void 0:Hn.productId}):en&&(null==be?void 0:be.enableLinecheckOverlay)&&!ti&&(null===(Dl=null==be?void 0:be.linecheckData)||void 0===Dl?void 0:Dl.length)>0&&!xe&&"global/coverage-check"===(null===(Il=null===($l=null===(Ll=null==be?void 0:be.linecheckData)||void 0===Ll?void 0:Ll[0])||void 0===$l?void 0:$l.reference)||void 0===Il?void 0:Il.default_full_slug)?o.createElement(X,{content:null===(Nl=null==be?void 0:be.linecheckData)||void 0===Nl?void 0:Nl[0].reference.content.body[0],overlayIsOpen:!0,externalHandleModal:on,productName:null==Hn?void 0:Hn.productName,showModal:en,setShowModal:on,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&&h.get("chAddressJson"),"function"==typeof Ce&&Ce()},onCreateCart:Ti,lineCheckOnClear:Ue,productId:null==Hn?void 0:Hn.productId}):null,tn&&ti&&(null===(Bl=null==ue?void 0:ue.benefitsValidate)||void 0===Bl?void 0:Bl.length)>0&&o.createElement(_,{content:null===(Ol=null==ue?void 0:ue.benefitsValidate)||void 0===Ol?void 0:Ol[0],loginContent:null===(jl=null==be?void 0:be.loginData)||void 0===jl?void 0:jl[0],metadata:me,createCartCall:$i,fetchOfferData:Se,basicConfigUrl:ye,selectedExistingOption:ke,setShowBenefit:dn,setLoginSuccess:Te,isProdEnv:Fe}),Cn&&o.createElement(W,{modalState:Cn,handler:ki,showFooter:!1,width:"mobile"===di?"":"tablet"===di?"700px":"990px",fixedWidth:"mobile"===di?"":"tablet"===di?"700px":"990px",height:"845px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"24px"},o.createElement(ee,{content:null===(Al=null==be?void 0:be.optionsPopup)||void 0===Al?void 0:Al[0],addOptionsCallBack:e=>{Dn(!0),Tn(!0),gi(e)},metadata:me,constants:he,mainContent:be,preSelectedOptions:[],optionsResponse:Ln,updateResponseList:$n,showPrice:Ni,productData:Hn,offeringData:ce,uniqueId:ve,deviceFlow:Be})),Bn&&An&&o.createElement(ae,{modalState:Bn,onCloseHandler:()=>{jn.current=null,On(!1)},content:An,wafIdentifier:ye,onPrimaryClick:()=>{const e=jn.current;jn.current=null,Vn.current&&h.remove("one-commerce-cartId"),Vn.current=!1,On(!1),null==e||e()},onSecondaryClick:()=>{jn.current=null,On(!1)}}))};export{se as default};
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import o,{useState as l,useRef as n,useContext as i,useMemo as t,useEffect as d,useLayoutEffect as a}from"react";import{createPortal as r}from"react-dom";import s from"../SkeletonLoader/SkeletonLoader.js";import c from"./StaticLineTable.module.scss.js";import v from"../richtext.js";import u from"./StaticProductEntitlement.js";import m from"./StaticBenefit.js";import p from"./DynamicPriceSection.js";import g from"./CheckoutButton.js";import f from"./StaticProductDetails.js";import{LineTableBasicPropConfig as h,AssetPathPropConfig as b}from"../../services/LineTableBasicPropConfig.js";import E from"js-cookie";import{LoginBasicPropConfig as w}from"../../services/LoginBasicPropConfig.js";import C from"../login/LoginModalV2.js";import{isTimerActive as P,fetchServiceOptions as S,fetchPrice as y,checkGiftOrCashback as k,scheduleFindHeight as T,getTimeUntilNextTimerEvent as x,staticCreateCart as D,combineWithVasOptions as L,combineWithSmartPhone as $}from"./Product.utils.js";import I from"../ProductDetailsV3/GiftConfigV2.js";import N from"../ProductDetailsV3/ChooseGiftV2.js";import{viewport as B,replacePlaceholder as O,getUtcTimestamp as j}from"../../utils/utils.js";import A from"./StaticProductCashback.js";import{trackNewDatalayerEvent as U}from"../../utils/AnalyticsUtils.js";import{CTABUTTONCLICK as V,GAEVENT as F,EXISTINGCUSTOMER as M,LINETABLE as R,DOWNLOADPRODUCT as G}from"../../Analytics/AnalyticsConstants.js";import _ from"./TVChannelModal.js";import J from"../LineCheckV3/LinecheckModal.js";import W from"../BenefitWrapper/BenefitsValidateWrapper.js";import q from"../PretoPost/PreToPostSubsPopup.js";import H from"../LineCheckV3/GenericModal.js";import{fetchSubscriptionData as z,trackPegaEvents as K,validateP2P as Q}from"../../services/LineTableService.js";import X from"./ExsistingSubscriptionModal.js";import{getEcomCartInfo as Y}from"../../models/Analytics/items.js";import Z from"../NewLineCheck/CoverageCheckModal.js";import{API_BASE_BASEPOINT as ee}from"../../services/api-constants.js";import{AppContext as oe}from"./StaticLineTableStore/StaticLineTableProvider.js";import le from"./OttServiceOptions/OttServiceOptionsSmallPopup.js";import ne from"./StaticExclusiveBenefit.js";import ie from"../UserLoggedPricesToggle/UserLoggedPricesToggle.js";import te from"../FalconButtonV2/FalconButtonV2.js";import{ONE_ECOMMERCE_INTERNET_SUMMARY as de}from"../../utils/constants.js";import ae from"./StaticLineTabelTimer/StaticLineTabelTimer.js";import{useProductCardBadge as re}from"./ProductCardBadgeProvider.js";import se from"../GenericPopup/GenericPopup.js";import ce from"../GlobalDotLoader/GlobalDotLoader.js";const ve=({content:ve,offeringData:ue,uniqueId:me,storyContent:pe,metadata:ge,tabIndex:fe,cardsLength:he,indexKey:be,constants:Ee,mainContent:we,address:Ce,eligibleBundle:Pe,linecheckSuccessCallBack:Se,selectedOption:ye,fetchOfferData:ke,basicConfigUrl:Te,selectedExistingOption:xe,setLoginSuccess:De,enableP2P:Le,lineCheckCallBack:$e,loginSuccess:Ie,setToggleState:Ne,toggleState:Be,noTabs:Oe,deviceFlow:je,deviceFlowCallBack:Ae,selectedRP:Ue,continueCart:Ve,lineCheckOnClear:Fe,pegaIntegration:Me,isProdEnv:Re,deviceUltimateBundle:Ge,toggleContent:_e,pricesToggleState:Je,isShogunFlow:We,shogunToken:qe,reserveBadgeSpace:He})=>{var ze,Ke,Qe,Xe,Ye,Ze,eo,oo,lo,no,io,to,ao,ro,so,co,vo,uo,mo,po,go,fo,ho,bo,Eo,wo,Co,Po,So,yo,ko,To,xo,Do,Lo,$o,Io,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,il,tl,dl,al,rl,sl,cl,vl,ul,ml,pl,gl,fl,hl,bl,El,wl,Cl,Pl,Sl,yl,kl,Tl,xl,Dl,Ll,$l,Il,Nl,Bl,Ol,jl,Al,Ul,Vl;const Fl=re(),[Ml,Rl]=l(!1),[Gl,_l]=l(!1),[Jl,Wl]=l(!0),[ql,Hl]=l(!1),[zl,Kl]=l([]),[Ql,Xl]=l(!1),[Yl,Zl]=l(!1),[en,on]=l(!1),[ln,nn]=l(!1),[tn,dn]=l(!1),[an,rn]=l(!1),sn=`${Te}inf/customer-management/subscriptions`,cn=`${Te}inf/resource-management/msisdns/pretopost/validation`,[vn,un]=l([]),[mn,pn]=l(!1),[gn,fn]=l(!1),[hn,bn]=l(!1),[En,wn]=l([]),[Cn,Pn]=l(!1),[Sn,yn]=l(!1),[kn,Tn]=l(!1),[xn,Dn]=l(!1),[Ln,$n]=l([]),[In,Nn]=l(0),[Bn,On]=l(!1),jn=n(null),[An,Un]=l(null),Vn=n(!1),Fn=n(null),[Mn,Rn]=l(!1),Gn=`${Te}inf/${ee.CUSTOMER}`,_n=(null===(Ye=null===(Xe=null===(Qe=null===(Ke=null===(ze=null==we?void 0:we.globalDotLoader)||void 0===ze?void 0:ze[0])||void 0===Ke?void 0:Ke.reference)||void 0===Qe?void 0:Qe.content)||void 0===Xe?void 0:Xe.body)||void 0===Ye?void 0:Ye[0])?null===(no=null===(lo=null===(oo=null===(eo=null===(Ze=null==we?void 0:we.globalDotLoader)||void 0===Ze?void 0:Ze[0])||void 0===eo?void 0:eo.reference)||void 0===oo?void 0:oo.content)||void 0===lo?void 0:lo.body)||void 0===no?void 0:no[0]:null===(io=null==we?void 0:we.globalDotLoader)||void 0===io?void 0:io[0],Jn={duration:null!==(to=null==_n?void 0:_n.successMsgDuration)&&void 0!==to?to:"0",successLoaderCallback:Rn},Wn=void 0!==typeof window&&document.getElementById("static-linetable"),qn=0===(null===(ao=Object.keys(ve))||void 0===ao?void 0:ao.length),Hn=null===(uo=null===(vo=null===(co=null===(so=null===(ro=null==ve?void 0:ve.products)||void 0===ro?void 0:ro[0])||void 0===so?void 0:so.reference)||void 0===co?void 0:co.content)||void 0===vo?void 0:vo.product)||void 0===uo?void 0:uo[0],zn=null===(ho=null===(fo=null===(go=null===(po=null===(mo=null==ve?void 0:ve.promotion)||void 0===mo?void 0:mo[0])||void 0===po?void 0:po.reference)||void 0===go?void 0:go.content)||void 0===fo?void 0:fo.promoDescription)||void 0===ho?void 0:ho[0],Kn=null===(bo=null==ve?void 0:ve.timer)||void 0===bo?void 0:bo[0],Qn=null==Kn?void 0:Kn.enableCounter,[Xn,Yn]=l(!!(Qn&&(null==Kn?void 0:Kn.startTime)&&(null==Kn?void 0:Kn.endTime))&&P(Kn.startTime,Kn.endTime)),Zn=Boolean((null==ve?void 0:ve.highlightText)&&!0!==Je&&!Xn&&!(Fl&&(null==ve?void 0:ve.badgesContainer))),ei=Boolean((null==zn?void 0:zn.displayText)&&!(null==ve?void 0:ve.notShowPromotionLabel)&&!0!==Je&&!Xn),oi=Boolean(Fl&&(null==ve?void 0:ve.badgesContainer)&&!0!==Je&&!Xn&&!ei),li=null==Hn?void 0:Hn.productId,ni=null===(Eo=null==h?void 0:h.getInstance())||void 0===Eo?void 0:Eo.getCartUrl(),ii=null===(wo=null==b?void 0:b.getInstance())||void 0===wo?void 0:wo.getAssetPath(),ti="MOBILE"===(null==pe?void 0:pe.pageType),di=B(),ai=i(oe);let ri;ri=Ce&&(null===(Co=null==Pe?void 0:Pe.eligibleBundle)||void 0===Co?void 0:Co.includes(li));const si=null==ve?void 0:ve.enableTVStreamingOptionsPopUp,ci=null==ve?void 0:ve.enableTVStreamingOptionsStepper,vi=null==ve?void 0:ve.disableDiscountedPriceToggle,ui=null==ve?void 0:ve.skipAccessoriesPage;w.create({baseURL:null!=Te?Te:""});let mi=void 0!==typeof window&&E.get("sunriseAuth");mi=mi&&JSON.parse(mi);const pi=((null==ue?void 0:ue[me])||[]).filter(e=>(null==e?void 0:e.id)===li),gi=e=>{wn(e)},fi=()=>{Xl(!0),nn(!ln),fn(!gn)},hi=()=>{var e,o,l;if(_l(!1),Le&&null==mi)nn(!ln),fn(!gn);else if(Le&&(null==mi?void 0:mi.siteId))Si();else if(ye===M&&(null==xe?void 0:xe.length)>0)dn(!0);else{!!((null==we?void 0:we.enableExistingCustomer)&&null==mi||!mi&&!0===Je&&(null==_e?void 0:_e.enableLoggedInPrice))?Xl(!0):$i()}if(Me){const n=localStorage.getItem("prospectId"),i=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:[],t=i[i.length-1],d={eventTimestamp:j(),eventType:"PageView",pageType:"CartCreated",pageLocation:t,targetProduct:li};n&&K(Gn,d,n)}},bi=e=>{const o=zl.findIndex(o=>(null==e?void 0:e.giftGroupId)===(null==o?void 0:o.giftGroupId)),l=zl;-1===o?l.push(e):l[o]=e,Kl([...l])},Ei=new URLSearchParams(null===(Po=null===window||void 0===window?void 0:window.location)||void 0===Po?void 0:Po.search),wi=null==Ei?void 0:Ei.get("selectedMsisdn"),Ci=e=>{var o;1===(null==e?void 0:e.length)?(ql?$(Ni,pe,pi,null==e?void 0:e[0],ve,Me):$i(null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.msisdn),rn(!1)):(null==e?void 0:e.length)>1?(un(e),bn(!hn),rn(!1)):(fn(!gn),rn(!0),Wl(!0),Rl(!1))},Pi=(o,l)=>e(void 0,void 0,void 0,function*(){yield Q(null==o?void 0:o.msisdn,cn).then(e=>{e&&l.push(o)}).catch(e=>{console.log("error",e)})}),Si=()=>{var o;Rl(!0);try{null===(o=z("PREPAID",sn))||void 0===o||o.then(o=>e(void 0,void 0,void 0,function*(){if(204==(null==o?void 0:o.subscriptionData))fn(!gn),rn(!0),Wl(!0),Rl(!1);else{const l=null==o?void 0:o.subscriptionData,n=l.find(e=>e.msisdn===wi);if(l){const o=[];wi?(yield Pi(n,o),Ci(o)):yield Promise.all(null==l?void 0:l.map(l=>e(void 0,void 0,void 0,function*(){yield Pi(l,o)}))).then(e=>{Ci(o)})}}})).catch(e=>{console.log("error---\x3e",e),Rl(!1)})}catch(e){console.log("error---\x3e",e),Rl(!1)}pn(!0)},yi=()=>{fn(!Jl),nn(!1)},ki=e=>{Pn(!1),e&&U(F,V,{headline:"VAS POPUP CLOSE"})},Ti=()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");Pe=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),Ce="undefined"!=typeof window&&E.get("chAddressJson"),on(!en),"function"==typeof Se&&Se(),$i()},xi=S(null==Hn?void 0:Hn.bloks,ti),Di=null===(So=null==xi?void 0:xi[0])||void 0===So?void 0:So.tvProductId,Li=e=>{var o,l,n,i,t,d,a,r,s,c;const v=Me&&(null===(n=null===(l=null===(o=null==pi?void 0:pi[0])||void 0===o?void 0:o.promotionInfo)||void 0===l?void 0:l[0])||void 0===n?void 0:n.id),u=Me&&(null===(d=null===(t=null===(i=null==pi?void 0:pi[0])||void 0===i?void 0:i.promotionInfo)||void 0===t?void 0:t[0])||void 0===d?void 0:d.version),m=We?{pointsBurnt:null===(r=null===(a=null==pi?void 0:pi[0])||void 0===a?void 0:a.rewards)||void 0===r?void 0:r.points,rewardOfferId:null===(c=null===(s=null==pi?void 0:pi[0])||void 0===s?void 0:s.rewards)||void 0===c?void 0:c.offerId,gloxTokenId:qe}:void 0;pi&&pi[0]&&(pi[0].fromPopup=xn),Ai("false"),sessionStorage.removeItem("vasPopUp"),yn(!1),D(Rl,ni,zl,pi,we,Ni,ti,Di,Pe,Ce,on,en,$e,Le,null!=wi?wi:e,ve,En,v,u,m,Jn)},$i=e=>{var o,l,n,i,t,d,a,r,s;Dn(!1),_l(!1);let c=void 0!==typeof window&&E.get("sunriseAuth");const v=c&&JSON.parse(c),u=!(!(null==we?void 0:we.enableExistingCustomer)||null!=v);if(sessionStorage.removeItem(de),(null===(o=null==we?void 0:we.linecheckData)||void 0===o?void 0:o.length)>0&&!ti&&!ri){return void(document.getElementById("linecheck")&&$e())}if(ri&&!ti&&(null===(l=null==we?void 0:we.loginData)||void 0===l?void 0:l.length)>0&&u)Xl(!0);else if(ci&&(null===(n=pi[0])||void 0===n?void 0:n.isBundle)){let o=!1;ui||((null===(i=pi[0])||void 0===i?void 0:i.isBundle)?null===(d=null===(t=pi[0])||void 0===t?void 0:t.bundledOffers)||void 0===d||d.map(e=>{var l,n,i;"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===(i=null==e?void 0:e.productType)||void 0===i?void 0:i.toLowerCase())||(o=!1)}):(null===(a=null==pi?void 0:pi[0])||void 0===a?void 0:a.recommendAccessory)&&(o=null===(r=null==pi?void 0:pi[0])||void 0===r?void 0:r.recommendAccessory)),L(Ni,pi,ve,Me,null==Hn?void 0:Hn.productName,o),Li(e)}else si&&(null===(s=pi[0])||void 0===s?void 0:s.isBundle)&&!Sn?(Pn(!0),yn(!0),Ai("true"),window.addEventListener("beforeunload",function(e){Ai("false"),sessionStorage.removeItem("vasPopUp"),yn(!1)})):(Le&&Rl(!0),Li(e))},Ii=(e,o)=>l=>{var n;const i=void 0!==typeof window&&E.get("one-commerce-cartId");(null==we?void 0:we.enableReplacePopup)&&i?(jn.current=()=>e(l),Vn.current=Boolean(o),Un(null!=o?o:null===(n=null==we?void 0:we.generalReplacePopup)||void 0===n?void 0:n[0]),On(!0)):e(l)},Ni=y(pi,ti,null==we?void 0:we.pageType,!1,En,Me),Bi=t(()=>{var e,o;return k(ti?pi:null!==(o=null===(e=null==pi?void 0:pi[0])||void 0===e?void 0:e.bundledOffers)&&void 0!==o?o:pi)},[ti,pi]);("undefined"!=typeof window?a:d)(()=>{T(fe,he,0)},[ve,ue,Be,En,In,Bi.showGift,Bi.cashbackAvailable,((null==Be?void 0:Be.TV)||(null==Be?void 0:Be.gigaSpeed)||(null==Be?void 0:Be.Netflix))&&Array.isArray(pi)&&3===(null===(ko=null===(yo=null==pi?void 0:pi[0])||void 0===yo?void 0:yo.bundledOffers)||void 0===ko?void 0:ko.length)]);const Oi=()=>{((null==xi?void 0:xi.length)>0||si)&&Zl(!0)},ji=null===(To=null==we?void 0:we.productContainer)||void 0===To?void 0:To[0];d(()=>{ql&&(Le&&null==mi?(nn(!ln),fn(!gn)):Le&&(null==mi?void 0:mi.siteId)&&Si())},[ql]),d(()=>{var e;if(ai){const{store:o}=ai;(null===(e=null==o?void 0:o.ottOptionsApi)||void 0===e?void 0:e.length)>0&&0===(null==Ln?void 0:Ln.length)&&$n(null==o?void 0:o.ottOptionsApi)}},[ai]),d(()=>{if(!Qn||!(null==Kn?void 0:Kn.startTime)||!(null==Kn?void 0:Kn.endTime))return void Yn(!1);Yn(P(Kn.startTime,Kn.endTime));const e=x(Kn.startTime,Kn.endTime);if(e<=0)return;const o=setTimeout(()=>{Yn(P(Kn.startTime,Kn.endTime))},e);return()=>clearTimeout(o)},[Qn,null==Kn?void 0:Kn.startTime,null==Kn?void 0:Kn.endTime]),d(()=>{var e;const o=Fn.current;if(!o||!(null===(e=null==ve?void 0:ve.timer)||void 0===e?void 0:e.length)||!Qn)return void Nn(0);const l=()=>{Nn(o.clientHeight)};if(l(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(l);return n.observe(o),()=>{n.disconnect()}},[null===(xo=null==ve?void 0:ve.timer)||void 0===xo?void 0:xo.length,Qn]),d(()=>{kn&&(ki(),Tn(!0),Ai("false"),sessionStorage.removeItem("vasPopUp"),yn(!1),Li())},[kn]),d(()=>{const e=()=>{const e=sessionStorage.getItem("vasPopUp");yn("true"===e)};e();const o=o=>{o.storageArea===sessionStorage&&"vasPopUp"===o.key&&e(),o.storageArea===sessionStorage&&"vasPopUp"===o.key&&null===o.newValue&&yn(!1)},l=()=>{e()};return window.addEventListener("storage",o),window.addEventListener("vasPopUpChange",l),()=>{window.removeEventListener("storage",o),window.removeEventListener("vasPopUpChange",l)}},[]);const Ai=e=>{sessionStorage.setItem("vasPopUp",e);const o=new Event("vasPopUpChange");window.dispatchEvent(o)};return o.createElement("div",null,(Ml||Mn)&&Wn&&r(o.createElement(ce,{content:_n,isSuccess:Mn}),Wn),qn&&o.createElement("div",{className:"w-75 pb-2"},o.createElement(s,null)),!qn&&Pe&&ve&&Ce&&!ti&&o.createElement("div",{className:c.selected},o.createElement("span",{style:{paddingBottom:"10px"}},ri?o.createElement("span",{className:c.activeicon},o.createElement("img",{src:`${ii}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:c.activeicon}),o.createElement("span",null,null==Ee?void 0:Ee.subscriptionAvalTxt)):o.createElement("span",{className:c.inactiveicon},o.createElement("img",{src:`${ii}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:c.inactiveicon}),o.createElement("span",null,null==Ee?void 0:Ee.notSubscriptionTxt)))),o.createElement("div",{className:`${!ti&&!1===ri&&(null===(Do=null==we?void 0:we.linecheckData)||void 0===Do?void 0:Do.length)>0&&"global/coverage-check"!==(null===(Io=null===($o=null===(Lo=null==we?void 0:we.linecheckData)||void 0===Lo?void 0:Lo[0])||void 0===$o?void 0:$o.reference)||void 0===Io?void 0:Io.default_full_slug)?c.overlay:""}\n ${Ge&&!(null===(Bo=null===(No=null==pi?void 0:pi[0])||void 0===No?void 0:No.eligibility)||void 0===Bo?void 0:Bo.fpb)?c.disabled:""}\n `,style:{flexDirection:"column"}},o.createElement("div",{className:c.bundleproductcard},o.createElement("div",{id:`timer-section${fe}${be}`,"data-timer-active":In>0?"true":"false"},(null===(Oo=null==ve?void 0:ve.timer)||void 0===Oo?void 0:Oo.length)&&Qn?o.createElement("div",{style:{height:`${In}px`,transition:"height 0.3s ease"}}):null),o.createElement("div",{className:`${c.productcontainer} ${He||oi||Zn||ei?c.productcontainerHasBadge:""}`,style:(()=>{const e=ei?zn:ve,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}})()},oi&&Fl&&o.createElement(Fl,{badges:ve.badgesContainer}),Zn&&o.createElement("div",{className:`${c.highlightText}`},null==ve?void 0:ve.highlightText),ei&&((null==zn?void 0:zn.badgeContainer)&&Fl?o.createElement(Fl,{badges:null==zn?void 0:zn.badgeContainer}):o.createElement("div",{className:`${c.promocontainer}`,style:{background:null==zn?void 0:zn.bestSellerColor}},null==zn?void 0:zn.displayText)),o.createElement("div",{ref:Fn,className:c.timerContainer},(null===(jo=null==ve?void 0:ve.timer)||void 0===jo?void 0:jo.length)&&Qn?o.createElement(ae,{content:null===(Ao=null==ve?void 0:ve.timer)||void 0===Ao?void 0:Ao[0],hasHighlightText:oi||ei,onTimerChange:e=>{Yn(e)}}):null),o.createElement("div",{className:`${c.detailsection} ${c.imageFullWidthSection}`,id:`detailsectionv3${fe}${be}`},o.createElement("div",{className:`${c.headersection}`},o.createElement("div",{className:`${c.titlesection}`},o.createElement("div",{className:`${c.productheader}`,id:`titleV3${fe}${be}`},null==Hn?void 0:Hn.productName),o.createElement("div",null,(null===(Uo=null==Hn?void 0:Hn.icon)||void 0===Uo?void 0:Uo.filename)&&o.createElement("img",{className:`${c.imagecontainer}`,src:null===(Vo=null==Hn?void 0:Hn.icon)||void 0===Vo?void 0:Vo.filename,height:15,width:20,alt:"productIcon"}))),o.createElement("div",{className:`${c.productdescription}`,id:`descriptionV3${fe}${be}`},o.createElement(v,{content:null==Hn?void 0:Hn.description})),o.createElement("div",{className:`${c.images}`},(null===(Fo=null==Hn?void 0:Hn.img)||void 0===Fo?void 0:Fo.filename)&&o.createElement("img",{className:`${c.imagespace} ${(null==ve?void 0:ve.highlightText)&&c.borderimage}`,alt:"cardimg",src:`${null===(Mo=null==Hn?void 0:Hn.img)||void 0===Mo?void 0:Mo.filename}/m/`}))),o.createElement("div",{className:`${c.productconfig}`,id:`product-configv3${fe}${be}`},qn?o.createElement(o.Fragment,null,o.createElement("div",{className:c.space}),o.createElement(s,{stylename:c.skeletontittle,count:1}),o.createElement(s,{stylename:c.skeletonline,count:5}),o.createElement("div",{className:c.space}),o.createElement(s,{stylename:c.skeletontittle,count:1}),o.createElement(s,{stylename:c.skeletonline,count:5})):o.createElement("div",null,(null==Hn?void 0:Hn.bloks)&&(null===(Ro=null==Hn?void 0:Hn.bloks)||void 0===Ro?void 0:Ro.map((e,l)=>o.createElement(u,{content:e,indexKey:l,constants:Ee,key:l,showModalPopup:Oi,setToggleState:Ne,toggleState:Be,noTabs:Oe,mainContent:we,enableTVStreamingOptions:null==ve?void 0:ve.enableTVStreamingOptions,metadata:ge,setTvOptionsData:gi})))))),o.createElement("div",{className:`${c.detailsection}`,id:`benefits-price-section${fe}${be}`},o.createElement("div",{id:`exclusive-benefits-section${fe}${be}`},(null===(Go=null==Hn?void 0:Hn.extraBenefits)||void 0===Go?void 0:Go.length)>0&&o.createElement(ne,{content:null===(_o=null==Hn?void 0:Hn.extraBenefits)||void 0===_o?void 0:_o[0]})),o.createElement("div",{className:`${c.benefitssection}`,id:`benefits-section${fe}${be}`},(null===(Jo=null==Hn?void 0:Hn.benefits)||void 0===Jo?void 0:Jo.length)>0&&o.createElement(m,{content:null==Hn?void 0:Hn.benefits,benefitData:Ni,constants:Ee,pricesToggleState:Je,togglePriceLabel:null==_e?void 0:_e.togglePriceLabel})),o.createElement("br",null),o.createElement("div",{className:`${c.giftsection}`,id:`gift-section${fe}${be}`},(null==Bi?void 0:Bi.showGift)&&(null===(Wo=null==zn?void 0:zn.singleGift)||void 0===Wo?void 0:Wo.map((e,l)=>o.createElement(I,{content:e,key:l}))),(null==Bi?void 0:Bi.showGift)&&(null===(qo=null==zn?void 0:zn.giftConfig)||void 0===qo?void 0:qo.map((e,l)=>o.createElement(N,{content:e,key:l,selectedGiftItem:bi,parentPoType:ti?"MOBILE":"HOME"}))),o.createElement("div",{className:`${c.giftsection}`,id:`cashback-section${fe}${be}`},o.createElement(A,{uniqueProductData:pi,mainContent:we}))),o.createElement("div",{className:`${c.ordersection}`,id:`order-section${fe}${be}`},""===(null==Ni?void 0:Ni.base)?o.createElement("div",null,o.createElement(s,{stylename:c.skeletontittle})):o.createElement("div",{id:`price-section${fe}${be}`},o.createElement(p,{priceCollection:Ni,constants:Ee,promoText:null==Hn?void 0:Hn.promoText,deviceFlow:je,content:ve,offeringData:ue,uniqueId:me})),!We&&o.createElement("div",{className:`${c.discountedpricetoggleSection}`,id:`discountedpricetoggle-section${fe}${be}`},vi||"INLINE"!==(null==_e?void 0:_e.togglePosition)?null:o.createElement(ie,{content:Hn,index:be,lineTable:!0,toggleContent:_e})),Le&&(null==Ee?void 0:Ee.P2PDiscountLabel)&&o.createElement("div",{className:c.longterm},null==Ee?void 0:Ee.P2PDiscountLabel),qn?o.createElement(o.Fragment,null,o.createElement(s,{stylename:c.skeletontittle,count:1}),o.createElement(s,{stylename:c.skeletonline,count:2})):o.createElement("div",{className:`${(null==pe?void 0:pe.swapButton)&&c.swapButton}`},o.createElement("div",{style:{padding:"16px 0 0 0"}},o.createElement(g,{isMobileFlow:ti,createCartCall:(null==je?void 0:je.isDeviceFlow)?Ii(e=>{_l(!1);Ae({setShowLoader:Rl,cartEndPoint:ni,giftItem:zl,uniqueProductData:pi,mainContent:we,showPrice:Ni,isMobileFlow:ti,eligibleBundle:Pe,address:Ce,setShowLinecheck:on,showLinecheck:en,lineCheckCallBack:$e,enableP2P:Le,msisdnn:null!=wi?wi:e,content:ve,selectedRP:Ue,continueCart:Ve,successLoaderData:Jn})}):Ii(ti?hi:$i),constants:Ee,storyContent:pe,showPrice:Ni,isAvailable:ri,address:Ce,uniqueProductBenefits:null==pi?void 0:pi[0],alwaysActive:!ri&&(null===(Ho=null==we?void 0:we.linecheckData)||void 0===Ho?void 0:Ho.length)>0&&"global/coverage-check"===(null===(Qo=null===(Ko=null===(zo=null==we?void 0:we.linecheckData)||void 0===zo?void 0:zo[0])||void 0===Ko?void 0:Ko.reference)||void 0===Qo?void 0:Qo.default_full_slug),flexUpgradeFreePopup:null===(Yo=null===(Xo=null==we?void 0:we.flexUpgradeFreePopup)||void 0===Xo?void 0:Xo.reference)||void 0===Yo?void 0:Yo.content,content:ve,deviceUltimateBundle:Ge,forceDisabled:Boolean(null===(el=null===(Zo=null==pi?void 0:pi[0])||void 0===Zo?void 0:Zo.rewards)||void 0===el?void 0:el.notEligibleReason),notEligibileReason:null===(ll=null===(ol=null==pi?void 0:pi[0])||void 0===ol?void 0:ol.rewards)||void 0===ll?void 0:ll.notEligibleReason})),!We&&(null===(nl=null==pe?void 0:pe.addSmartPhone)||void 0===nl?void 0:nl.length)>0&&!(null==je?void 0:je.isDeviceFlow)&&o.createElement("div",{style:{textAlign:"center"}},(null==pe?void 0:pe.swapButton)?(null==pe?void 0:pe.ctaLabel)&&o.createElement("div",{style:{padding:"16px 0"}},o.createElement("button",{className:"primarybutton",onClick:()=>{var e;return Ii(()=>$(Ni,pe,pi,"",ve,Me),null===(e=null==we?void 0:we.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}},o.createElement("span",{className:c.buttontext},null==pe?void 0:pe.ctaLabel))):!(null==ve?void 0:ve.redirectOnly)&&o.createElement("div",{style:{padding:"12px 0 0 0"}},o.createElement(te,{content:{buttonType:"Secondary-V1",buttonLabel:(null==ve?void 0:ve.ultimateBundlePromotion)?null==Ee?void 0:Ee.ultimateBundleLbl:null===(tl=null===(il=null==pe?void 0:pe.addSmartPhone)||void 0===il?void 0:il[0])||void 0===tl?void 0:tl.buttonLabel,buttonIcon:null===(al=null===(dl=null==pe?void 0:pe.addSmartPhone)||void 0===dl?void 0:dl[0])||void 0===al?void 0:al.buttonIcon,buttonAlignment:"left"},wafIdentifier:Te,style:{width:"100%"},onClick:()=>{var e;return Ii(()=>Le?void Hl(!0):$(Ni,pe,pi,"",ve,Me),null===(e=null==we?void 0:we.replacePopupWithSmartphone)||void 0===e?void 0:e[0])()}}))),o.createElement("div",{className:c.productcontractduration,id:`contract-section${fe}${be}`,style:{paddingTop:(null===(rl=null==pe?void 0:pe.addSmartPhone)||void 0===rl?void 0:rl.length)>0&&!(null==je?void 0:je.isDeviceFlow)&&!(null==pe?void 0:pe.swapButton)&&!(null==ve?void 0:ve.redirectOnly)?"8px":void 0}},(null==Ni?void 0:Ni.contractDuration)>"1"?O(null===(sl=null==Ee?void 0:Ee.minContractDuration)||void 0===sl?void 0:sl.substring(1),[null==Ni?void 0:Ni.contractDuration]):null==Ee?void 0:Ee.noContractDuration)),o.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(cl=null==Hn?void 0:Hn.productDetails)||void 0===cl?void 0:cl.length)>0&&o.createElement("span",{className:c.productdetailslink,onClick:()=>{var e,o,l;_l(!Gl),U(F,G,Y(pi,"",R));const n=localStorage.getItem("prospectId"),i=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:[],t=i[i.length-1],d={eventTimestamp:j(),eventType:"PageView",pageType:"ProductDetails",pageLocation:t,targetProduct:li};n&&K(Gn,d,n)}},null==Ee?void 0:Ee.productDetailsLink)),Gl&&o.createElement(f,{content:null==Hn?void 0:Hn.productDetails,showProductDetail:Gl,setShowProductDetail:_l,constants:Ee,showPrice:Ni,isMobileFlow:ti,createCartCall:ti?hi:$i,storyContent:pe,isAvailable:ri,address:Ce,flexUpgradeFreePopup:null===(ul=null===(vl=null==we?void 0:we.flexUpgradeFreePopup)||void 0===vl?void 0:vl.reference)||void 0===ul?void 0:ul.content,notEligibileReason:null===(pl=null===(ml=null==pi?void 0:pi[0])||void 0===ml?void 0:ml.rewards)||void 0===pl?void 0:pl.notEligibleReason})))))),Ge&&pi&&!(null===(fl=null===(gl=null==pi?void 0:pi[0])||void 0===gl?void 0:gl.eligibility)||void 0===fl?void 0:fl.fpb)&&o.createElement("div",{className:c.disabledInfo},o.createElement(v,{content:null==Ee?void 0:Ee.fpbNotCompatibleText})),Yl&&(qn?o.createElement(s,null):o.createElement(_,{content:null==xi?void 0:xi[0],setShowModal:Zl,showModal:Yl,constants:Ee})),Ql&&(null===(hl=null==we?void 0:we.loginData)||void 0===hl?void 0:hl.length)>0&&Wn&&r(o.createElement(C,{content:null===(bl=null==we?void 0:we.loginData)||void 0===bl?void 0:bl[0],closeLogin:()=>{Xl(!1)},metadata:ge,onSuccess:()=>{Xl(!1),De(),sessionStorage.removeItem("vasPopUp"),yn(!1),Le?Si():$i()},isProdEnv:Re}),Wn),ln&&Le&&!Ql&&gn&&o.createElement(H,{modalState:Jl,handler:yi,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(q,{onClose:fi,content:null===(Cl=null===(wl=null===(El=null==we?void 0:we.productContainer)||void 0===El?void 0:El[0])||void 0===wl?void 0:wl.p2pBloks)||void 0===Cl?void 0:Cl[0],prepaid:!1})),Le&&mn&&an&&gn&&o.createElement(H,{modalState:Jl,handler:yi,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px",id:"table-product"},o.createElement(q,{onClose:fi,content:null===(yl=null===(Sl=null===(Pl=null==we?void 0:we.productContainer)||void 0===Pl?void 0:Pl[0])||void 0===Sl?void 0:Sl.p2pBloks)||void 0===yl?void 0:yl[1],prepaid:!0})),(null==vn?void 0:vn.length)>1&&Le&&mn&&!an&&hn&&o.createElement(H,{modalState:hn,handler:()=>{Rl(!1),bn(!hn)},showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(X,{onSubmit:e=>{bn(!hn),ql?$(Ni,pe,pi,e,ve,Me):$i(null==e?void 0:e.msisdn)},exsistingSubscriptionData:vn,updatedContent:ji})),en&&(null==we?void 0:we.enableLinecheckOverlay)&&!ti&&(null===(kl=null==we?void 0:we.linecheckData)||void 0===kl?void 0:kl.length)>0&&!Le&&"global/new-linecheck-test"===(null===(Dl=null===(xl=null===(Tl=null==we?void 0:we.linecheckData)||void 0===Tl?void 0:Tl[0])||void 0===xl?void 0:xl.reference)||void 0===Dl?void 0:Dl.default_full_slug)?o.createElement(J,{content:null===(Ll=null==we?void 0:we.linecheckData)||void 0===Ll?void 0:Ll[0],onSuccess:Ti,showModal:en,setShowModal:on,productName:null==Hn?void 0:Hn.productName,productId:null==Hn?void 0:Hn.productId}):en&&(null==we?void 0:we.enableLinecheckOverlay)&&!ti&&(null===($l=null==we?void 0:we.linecheckData)||void 0===$l?void 0:$l.length)>0&&!Le&&"global/coverage-check"===(null===(Bl=null===(Nl=null===(Il=null==we?void 0:we.linecheckData)||void 0===Il?void 0:Il[0])||void 0===Nl?void 0:Nl.reference)||void 0===Bl?void 0:Bl.default_full_slug)?o.createElement(Z,{content:null===(Ol=null==we?void 0:we.linecheckData)||void 0===Ol?void 0:Ol[0].reference.content.body[0],overlayIsOpen:!0,externalHandleModal:on,productName:null==Hn?void 0:Hn.productName,showModal:en,setShowModal:on,onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");Pe=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),Ce="undefined"!=typeof window&&E.get("chAddressJson"),"function"==typeof Se&&Se()},onCreateCart:Ti,lineCheckOnClear:Fe,productId:null==Hn?void 0:Hn.productId}):null,tn&&ti&&(null===(jl=null==pe?void 0:pe.benefitsValidate)||void 0===jl?void 0:jl.length)>0&&o.createElement(W,{content:null===(Al=null==pe?void 0:pe.benefitsValidate)||void 0===Al?void 0:Al[0],loginContent:null===(Ul=null==we?void 0:we.loginData)||void 0===Ul?void 0:Ul[0],metadata:ge,createCartCall:$i,fetchOfferData:ke,basicConfigUrl:Te,selectedExistingOption:xe,setShowBenefit:dn,setLoginSuccess:De,isProdEnv:Re}),Cn&&o.createElement(H,{modalState:Cn,handler:ki,showFooter:!1,width:"mobile"===di?"":"tablet"===di?"700px":"990px",fixedWidth:"mobile"===di?"":"tablet"===di?"700px":"990px",height:"845px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"24px"},o.createElement(le,{content:null===(Vl=null==we?void 0:we.optionsPopup)||void 0===Vl?void 0:Vl[0],addOptionsCallBack:e=>{Dn(!0),Tn(!0),gi(e)},metadata:ge,constants:Ee,mainContent:we,preSelectedOptions:[],optionsResponse:Ln,updateResponseList:$n,showPrice:Ni,productData:Hn,offeringData:ue,uniqueId:me,deviceFlow:je})),Bn&&An&&o.createElement(se,{modalState:Bn,onCloseHandler:()=>{jn.current=null,On(!1)},content:An,wafIdentifier:Te,onPrimaryClick:()=>{const e=jn.current;jn.current=null,Vn.current&&E.remove("one-commerce-cartId"),Vn.current=!1,On(!1),null==e||e()},onSecondaryClick:()=>{jn.current=null,On(!1)}}))};export{ve as default};
|
|
2
2
|
//# sourceMappingURL=StaticProduct.js.map
|