@sunrise-upc/mobile-prod-card 11.12.0 → 11.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import o from"js-cookie";import{TV_SERVICE_OPTION as l,RATEPLAN as i,DEFAULT_MOBILEPOSTPAID_BUNDLE 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,checkLinkWithLang as s}from"../../utils/utils.js";import{trackNewDatalayerEvent as p}from"../../utils/AnalyticsUtils.js";import{LINETABLEPRODUCT as m,ADDTOCART as f,LINETABLE as y,LINETABLEDEVICE as h,COMBINEDEVICE as g,GAEVENT as I}from"../../Analytics/AnalyticsConstants.js";import{trackEligibleItem as b,getEcomCartInfo as T}from"../../models/Analytics/items.js";import{calculateDateTime as w}from"./StaticLineTabelTimer/util.js";const P=(o,l)=>{try{const i=new Date,n=w(new Date(o.replace(/-/g,"/"))),e=w(new Date(l.replace(/-/g,"/")));return!Number.isNaN(n.getTime())&&!Number.isNaN(e.getTime())&&(i>=n&&i<e)}catch(o){return!1}},D=(o,l)=>{try{const i=w(new Date(o.replace(/-/g,"/"))),n=w(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,l,i,e,d)=>{null==o||o.map(o=>{var e,u,t,v,r,c,a,s,p,m,f,y,h,g,I,b,T,w,D,N,C,S,_,x,O;const L={id:"",promoIds:[]},A=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],E=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==E||E.promotionId,L.id=null==A?void 0:A.productId;const B=null===(f=null==o?void 0:o.timer)||void 0===f?void 0:f[0],k=!!B&&P(B.startTime,B.endTime),M=null===(T=null===(b=null===(I=null===(g=null===(h=null===(y=null==B?void 0:B.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,$=d&&!0===d&&""===(null==E?void 0:E.promotionId)?n:null==E?void 0:E.promotionId;if(k&&M?null===(w=null==L?void 0:L.promoIds)||void 0===w||w.push(M):null===(D=null==L?void 0:L.promoIds)||void 0===D||D.push($),i){const l=null===(x=null===(_=null===(S=null===(C=null===(N=null==o?void 0:o.mobilePromotion)||void 0===N?void 0:N[0])||void 0===C?void 0:C.reference)||void 0===S?void 0:S.content)||void 0===_?void 0:_.promoDescription)||void 0===x?void 0:x[0];null===(O=null==L?void 0:L.promoIds)||void 0===O||O.push(null==l?void 0:l.promotionId)}null==l||l.push(L)})},C=(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)}]}},S=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}},_=(l,i,t,v,c,p,h,g,I,T,w,P,D,N,C,S,_,x,O)=>{var L,A,E;if(h){l(!0);const d=a(e);0!==(null===(L=Object.keys(v))||void 0===L?void 0:L.length)&&r(v,"",(null==p?void 0:p.promoID)?null==p?void 0:p.promoID:n,i,"mobile",t,N,C,null===(E=null===(A=null==c?void 0:c.productContainer)||void 0===A?void 0:A[0])||void 0===E?void 0:E.isQoQaFlow,null==d?void 0:d.voucher,null,null,x,O).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==p?void 0:p.id,{path:"/"}),b(f,v,"",m),window.location.href=null===(i=null==c?void 0:c.summaryPageUrl)||void 0===i?void 0:i.cached_url}).catch(o=>{console.log(o),l(!1)}).finally(()=>{l(!1)})}else{const n="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid");I&&T&&n?(l(!0),0!==v.length&&r(v,g,(null==p?void 0:p.promoID)?null==p?void 0:p.promoID:d,i,"fixnet",t,"","",!1,"","",_).then(l=>{var i,n,e,d,t,r,a,m,h,g,I;"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==p?void 0:p.id,{path:"/"}),"undefined"!=typeof window&&o.remove("landline"),b(f,v,"",y);const T=s(null===(i=null==S?void 0:S.productBasedCheckoutUrl)||void 0===i?void 0:i.cached_url);let w=!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)&&(w=null==o?void 0:o.recommendAccessory),"mobile"!==(null===(n=null==o?void 0:o.productType)||void 0===n?void 0:n.toLowerCase())||(w=!1)}):(null===(t=null==v?void 0:v[0])||void 0===t?void 0:t.recommendAccessory)&&(w=null===(r=null==v?void 0:v[0])||void 0===r?void 0:r.recommendAccessory),w){const o={flow:"WIN"};sessionStorage.setItem(u,JSON.stringify(o))}const P=T||((null==S?void 0:S.enableTVStreamingOptionsStepper)&&(null===(a=null==c?void 0:c.vasStepperURL)||void 0===a?void 0:a.cached_url)?null===(m=null==c?void 0:c.vasStepperURL)||void 0===m?void 0:m.cached_url:w&&(null===(h=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===h?void 0:h.cached_url)?null===(g=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===g?void 0:g.cached_url:null===(I=null==c?void 0:c.summaryPageUrl)||void 0===I?void 0:I.cached_url);window.location.href=P}).catch(o=>{console.log(o)}).finally(()=>{l(!1)})):(null==c?void 0:c.enableLinecheckOverlay)?w(!P):D()}},x=(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)},O=(o,l,i,e,d,u)=>{var t,v,r,c,a,s,m;const y={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:""},w=(null==o?void 0:o.promoID)?null==o?void 0:o.promoID:n;let P="";P=`?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${null!=w?w:""}&productCode=${null!==(c=null==o?void 0:o.id)&&void 0!==c?c:""}`,window.location.href=(null===(m=null===(s=null===(a=null==l?void 0:l.addSmartPhone)||void 0===a?void 0:a[0])||void 0===s?void 0:s.buttonLink)||void 0===m?void 0:m.cached_url)+P,((o,l,i,n,e,d)=>{var u,t,v,r,c,a,s,p,m,f,y,h,g,I,b,T,w,P,D,N,C,S,_,x,O;const L=l,A=null!==(r=null===(v=null===(t=null===(u=null==L?void 0:L[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,E=null!==(p=null===(s=null===(a=null===(c=null==L?void 0:L[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,B=null!==(h=null===(y=null===(f=null===(m=null==L?void 0:L[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,k=null!==(T=null===(b=null===(I=null===(g=null==L?void 0:L[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,M=null!=i?i:"",$=d&&(null===(D=null===(P=null===(w=null==l?void 0:l[0])||void 0===w?void 0:w.promotionInfo)||void 0===P?void 0:P[0])||void 0===D?void 0:D.id),U=d&&(null===(S=null===(C=null===(N=null==l?void 0:l[0])||void 0===N?void 0:N.promotionInfo)||void 0===C?void 0:C[0])||void 0===S?void 0:S.version),F=d?{discountRef:$,discountType:"DISCOUNT"}:null,R=[];null==R||R.push({author:"offerType",text:"ATL"}),null==R||R.push({author:"externalPromotionName",text:$}),null==R||R.push({author:"offerVersion",text:U});const V=d?R:null,j=new URLSearchParams(window.location.search).get("flow"),J={mobileSubscription:null!==(x=null===(_=null==L?void 0:L[0])||void 0===_?void 0:_.id)&&void 0!==x?x:"",mobileSubscriptionPrice:E>0?E:A,mobileSubscriptionPromo:o,subGroup:"MOBILE",duration:Number(k>0?k:B),basePrice:A,withoutPromo:!1,pretopostvalue:M,upBenefit:"MULTIMOBILE"==n.mob_benefit_category||"FMC"==n.mob_benefit_category,ultimateBundlePromo:null!==(O=null==e?void 0:e.ultimateBundlePromotion)&&void 0!==O?O:"",clientDiscountInfo:F,extraNotes:V,isOttFlow:"ott"===j};void 0!==typeof window&&sessionStorage.setItem("one-ecommerce-mobileSummary",JSON.stringify(J))})(w,i,e&&y,o,d,u),p(I,g,T(i,"",h)),b(f,i,"",h)},L=(o,l,i,e,d,u)=>{((o,l,i,n,e,d,u)=>{var v,r,c,a,s,p,m,f,y,h,g,I,b,T,w,P,D,N,C,S,_,x,O,L,A,E;const B=l,k=null!==(a=null===(c=null===(r=null===(v=null==B?void 0:B[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,M=null!==(f=null===(m=null===(p=null===(s=null==B?void 0:B[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,$=null!==(b=null!==(I=null===(g=null===(h=null===(y=null==B?void 0:B[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,U=null!==(D=null===(P=null===(w=null===(T=null==B?void 0:B[0])||void 0===T?void 0:T.promotionInfo)||void 0===w?void 0:w[0])||void 0===P?void 0:P.campaignDuration)&&void 0!==D?D:0,F=e&&(null===(S=null===(C=null===(N=null==l?void 0:l[0])||void 0===N?void 0:N.promotionInfo)||void 0===C?void 0:C[0])||void 0===S?void 0:S.id),R=e&&(null===(O=null===(x=null===(_=null==l?void 0:l[0])||void 0===_?void 0:_.promotionInfo)||void 0===x?void 0:x[0])||void 0===O?void 0:O.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:R});const J=e?j:null,G={internetSubscription:null!=d?d:"",internetSubscriptionId:null!==(A=null===(L=null==B?void 0:B[0])||void 0===L?void 0:L.id)&&void 0!==A?A:"",internetSubscriptionPrice:M>0?M:k,internetSubscriptionPromo:o,subGroup:"INTERNET",duration:Number(U>0?U:$),basePrice:k,withPromo:M>0,upBenefit:"MULTIMOBILE"==i.mob_benefit_category||"FMC"==i.mob_benefit_category,ultimateBundlePromo:null!==(E=null==n?void 0:n.ultimateBundlePromotion)&&void 0!==E?E:"",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:n,l,o,i,e,d,u),p(I,g,T(l,"",h)),b(f,l,"",h)},A=(o,l)=>{let i;return l||(i=(o||[]).filter(o=>!0===(null==o?void 0:o.enableTV))),i},E=(o,l,i,n,e,d)=>{var u,t,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,u,t,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===(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)+g)),h.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)&&(h.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)?h.int_fmc+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(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===(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)||(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)&&"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},B=(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},k=o=>{var n;return null===(n=(null==o?void 0:o.products)||[])||void 0===n?void 0:n.map(o=>{var n,e,d;return{itemType:null!==(n=null==o?void 0:o.type)&&void 0!==n?n:"",promotionId:null!==(e=null==o?void 0:o.promo)&&void 0!==e?e:"",items:[{itemType:(null==o?void 0:o.type)===l?l:i,id:null!==(d=null==o?void 0:o.id)&&void 0!==d?d:""}]}})};let M=null;const $=o=>(null==M?void 0:M.gloxTokenId)===o&&null!==M.results,U=(o,l,i)=>{if($(o))return Promise.resolve(M.results);if((null==M?void 0:M.gloxTokenId)===o&&null!==M.promise)return M.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==M?void 0:M.gloxTokenId)===o&&(M.results=e,M.promise=null),e}).catch(l=>{throw(null==M?void 0:M.gloxTokenId)===o&&(M=null),l});return M={gloxTokenId:o,results:null,promise:n},n},F=(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{S as checkGiftOrCashback,O as combineWithSmartPhone,L as combineWithVasOptions,B as fetchFilteredProducts,k as fetchOttItems,C as fetchPegaProducts,E as fetchPrice,A as fetchServiceOptions,N as fetchStaticProductIds,F as filterShogunProducts,x as findHeight,U as getShogunSharedOffer,D as getTimeUntilNextTimerEvent,$ as isShogunOfferResolved,P as isTimerActive,_ as staticCreateCart};
1
+ import o from"js-cookie";import{TV_SERVICE_OPTION as l,RATEPLAN as i,DEFAULT_MOBILEPOSTPAID_BUNDLE 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,checkLinkWithLang as s}from"../../utils/utils.js";import{trackNewDatalayerEvent as p}from"../../utils/AnalyticsUtils.js";import{LINETABLEPRODUCT as m,ADDTOCART as f,LINETABLE as y,LINETABLEDEVICE as h,COMBINEDEVICE as g,GAEVENT as I}from"../../Analytics/AnalyticsConstants.js";import{trackEligibleItem as b,getEcomCartInfo as T}from"../../models/Analytics/items.js";import{calculateDateTime as w}from"./StaticLineTabelTimer/util.js";const P=(o,l)=>{try{const i=new Date,n=w(new Date(o.replace(/-/g,"/"))),e=w(new Date(l.replace(/-/g,"/")));return!Number.isNaN(n.getTime())&&!Number.isNaN(e.getTime())&&(i>=n&&i<e)}catch(o){return!1}},D=(o,l)=>{try{const i=w(new Date(o.replace(/-/g,"/"))),n=w(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,l,i,e,d)=>{null==o||o.map(o=>{var e,u,t,v,r,c,a,s,p,m,f,y,h,g,I,b,T,w,D,N,C,S,_,x,O;const L={id:"",promoIds:[]},A=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],E=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==E||E.promotionId,L.id=null==A?void 0:A.productId;const B=null===(f=null==o?void 0:o.timer)||void 0===f?void 0:f[0],k=!!B&&P(B.startTime,B.endTime),M=null===(T=null===(b=null===(I=null===(g=null===(h=null===(y=null==B?void 0:B.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,$=d&&!0===d&&""===(null==E?void 0:E.promotionId)?n:null==E?void 0:E.promotionId;if(k&&M?null===(w=null==L?void 0:L.promoIds)||void 0===w||w.push(M):null===(D=null==L?void 0:L.promoIds)||void 0===D||D.push($),i){const l=null===(x=null===(_=null===(S=null===(C=null===(N=null==o?void 0:o.mobilePromotion)||void 0===N?void 0:N[0])||void 0===C?void 0:C.reference)||void 0===S?void 0:S.content)||void 0===_?void 0:_.promoDescription)||void 0===x?void 0:x[0];null===(O=null==L?void 0:L.promoIds)||void 0===O||O.push(null==l?void 0:l.promotionId)}null==l||l.push(L)})},C=(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)}]}},S=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}},_=(l,i,t,v,c,p,h,g,I,T,w,P,D,N,C,S,_,x,O,L)=>{var A,E,B;if(h){l(!0);const d=a(e);0!==(null===(A=Object.keys(v))||void 0===A?void 0:A.length)&&r(v,"",(null==p?void 0:p.promoID)?null==p?void 0:p.promoID:n,i,"mobile",t,N,C,null===(B=null===(E=null==c?void 0:c.productContainer)||void 0===E?void 0:E[0])||void 0===B?void 0:B.isQoQaFlow,null==d?void 0:d.voucher,null,null,x,O,L).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==p?void 0:p.id,{path:"/"}),b(f,v,"",m),window.location.href=null===(i=null==c?void 0:c.summaryPageUrl)||void 0===i?void 0:i.cached_url}).catch(o=>{console.log(o),l(!1)}).finally(()=>{l(!1)})}else{const n="undefined"!=typeof window&&o.get("one-commerce-linecheckcorrelationid");I&&T&&n?(l(!0),0!==v.length&&r(v,g,(null==p?void 0:p.promoID)?null==p?void 0:p.promoID:d,i,"fixnet",t,"","",!1,"","",_,void 0,void 0,L).then(l=>{var i,n,e,d,t,r,a,m,h,g,I;"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==p?void 0:p.id,{path:"/"}),"undefined"!=typeof window&&o.remove("landline"),b(f,v,"",y);const T=s(null===(i=null==S?void 0:S.productBasedCheckoutUrl)||void 0===i?void 0:i.cached_url);let w=!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)&&(w=null==o?void 0:o.recommendAccessory),"mobile"!==(null===(n=null==o?void 0:o.productType)||void 0===n?void 0:n.toLowerCase())||(w=!1)}):(null===(t=null==v?void 0:v[0])||void 0===t?void 0:t.recommendAccessory)&&(w=null===(r=null==v?void 0:v[0])||void 0===r?void 0:r.recommendAccessory),w){const o={flow:"WIN"};sessionStorage.setItem(u,JSON.stringify(o))}const P=T||((null==S?void 0:S.enableTVStreamingOptionsStepper)&&(null===(a=null==c?void 0:c.vasStepperURL)||void 0===a?void 0:a.cached_url)?null===(m=null==c?void 0:c.vasStepperURL)||void 0===m?void 0:m.cached_url:w&&(null===(h=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===h?void 0:h.cached_url)?null===(g=null==c?void 0:c.multiItemPageRedirectionUrl)||void 0===g?void 0:g.cached_url:null===(I=null==c?void 0:c.summaryPageUrl)||void 0===I?void 0:I.cached_url);window.location.href=P}).catch(o=>{console.log(o)}).finally(()=>{l(!1)})):(null==c?void 0:c.enableLinecheckOverlay)?w(!P):D()}},x=(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)},O=(o,l,i,e,d,u)=>{var t,v,r,c,a,s,m;const y={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:""},w=(null==o?void 0:o.promoID)?null==o?void 0:o.promoID:n;let P="";P=`?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${null!=w?w:""}&productCode=${null!==(c=null==o?void 0:o.id)&&void 0!==c?c:""}`,window.location.href=(null===(m=null===(s=null===(a=null==l?void 0:l.addSmartPhone)||void 0===a?void 0:a[0])||void 0===s?void 0:s.buttonLink)||void 0===m?void 0:m.cached_url)+P,((o,l,i,n,e,d)=>{var u,t,v,r,c,a,s,p,m,f,y,h,g,I,b,T,w,P,D,N,C,S,_,x,O;const L=l,A=null!==(r=null===(v=null===(t=null===(u=null==L?void 0:L[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,E=null!==(p=null===(s=null===(a=null===(c=null==L?void 0:L[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,B=null!==(h=null===(y=null===(f=null===(m=null==L?void 0:L[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,k=null!==(T=null===(b=null===(I=null===(g=null==L?void 0:L[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,M=null!=i?i:"",$=d&&(null===(D=null===(P=null===(w=null==l?void 0:l[0])||void 0===w?void 0:w.promotionInfo)||void 0===P?void 0:P[0])||void 0===D?void 0:D.id),U=d&&(null===(S=null===(C=null===(N=null==l?void 0:l[0])||void 0===N?void 0:N.promotionInfo)||void 0===C?void 0:C[0])||void 0===S?void 0:S.version),F=d?{discountRef:$,discountType:"DISCOUNT"}:null,R=[];null==R||R.push({author:"offerType",text:"ATL"}),null==R||R.push({author:"externalPromotionName",text:$}),null==R||R.push({author:"offerVersion",text:U});const V=d?R:null,j=new URLSearchParams(window.location.search).get("flow"),J={mobileSubscription:null!==(x=null===(_=null==L?void 0:L[0])||void 0===_?void 0:_.id)&&void 0!==x?x:"",mobileSubscriptionPrice:E>0?E:A,mobileSubscriptionPromo:o,subGroup:"MOBILE",duration:Number(k>0?k:B),basePrice:A,withoutPromo:!1,pretopostvalue:M,upBenefit:"MULTIMOBILE"==n.mob_benefit_category||"FMC"==n.mob_benefit_category,ultimateBundlePromo:null!==(O=null==e?void 0:e.ultimateBundlePromotion)&&void 0!==O?O:"",clientDiscountInfo:F,extraNotes:V,isOttFlow:"ott"===j};void 0!==typeof window&&sessionStorage.setItem("one-ecommerce-mobileSummary",JSON.stringify(J))})(w,i,e&&y,o,d,u),p(I,g,T(i,"",h)),b(f,i,"",h)},L=(o,l,i,e,d,u)=>{((o,l,i,n,e,d,u)=>{var v,r,c,a,s,p,m,f,y,h,g,I,b,T,w,P,D,N,C,S,_,x,O,L,A,E;const B=l,k=null!==(a=null===(c=null===(r=null===(v=null==B?void 0:B[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,M=null!==(f=null===(m=null===(p=null===(s=null==B?void 0:B[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,$=null!==(b=null!==(I=null===(g=null===(h=null===(y=null==B?void 0:B[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,U=null!==(D=null===(P=null===(w=null===(T=null==B?void 0:B[0])||void 0===T?void 0:T.promotionInfo)||void 0===w?void 0:w[0])||void 0===P?void 0:P.campaignDuration)&&void 0!==D?D:0,F=e&&(null===(S=null===(C=null===(N=null==l?void 0:l[0])||void 0===N?void 0:N.promotionInfo)||void 0===C?void 0:C[0])||void 0===S?void 0:S.id),R=e&&(null===(O=null===(x=null===(_=null==l?void 0:l[0])||void 0===_?void 0:_.promotionInfo)||void 0===x?void 0:x[0])||void 0===O?void 0:O.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:R});const J=e?j:null,G={internetSubscription:null!=d?d:"",internetSubscriptionId:null!==(A=null===(L=null==B?void 0:B[0])||void 0===L?void 0:L.id)&&void 0!==A?A:"",internetSubscriptionPrice:M>0?M:k,internetSubscriptionPromo:o,subGroup:"INTERNET",duration:Number(U>0?U:$),basePrice:k,withPromo:M>0,upBenefit:"MULTIMOBILE"==i.mob_benefit_category||"FMC"==i.mob_benefit_category,ultimateBundlePromo:null!==(E=null==n?void 0:n.ultimateBundlePromotion)&&void 0!==E?E:"",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:n,l,o,i,e,d,u),p(I,g,T(l,"",h)),b(f,l,"",h)},A=(o,l)=>{let i;return l||(i=(o||[]).filter(o=>!0===(null==o?void 0:o.enableTV))),i},E=(o,l,i,n,e,d)=>{var u,t,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,u,t,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===(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)+g)),h.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)&&(h.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)?h.int_fmc+=Number(null==o?void 0:o.value):"MULTIMOBILE"!=(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===(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)||(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)&&"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},B=(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},k=o=>{var n;return null===(n=(null==o?void 0:o.products)||[])||void 0===n?void 0:n.map(o=>{var n,e,d;return{itemType:null!==(n=null==o?void 0:o.type)&&void 0!==n?n:"",promotionId:null!==(e=null==o?void 0:o.promo)&&void 0!==e?e:"",items:[{itemType:(null==o?void 0:o.type)===l?l:i,id:null!==(d=null==o?void 0:o.id)&&void 0!==d?d:""}]}})};let M=null;const $=o=>(null==M?void 0:M.gloxTokenId)===o&&null!==M.results,U=(o,l,i)=>{if($(o))return Promise.resolve(M.results);if((null==M?void 0:M.gloxTokenId)===o&&null!==M.promise)return M.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==M?void 0:M.gloxTokenId)===o&&(M.results=e,M.promise=null),e}).catch(l=>{throw(null==M?void 0:M.gloxTokenId)===o&&(M=null),l});return M={gloxTokenId:o,results:null,promise:n},n},F=(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{S as checkGiftOrCashback,O as combineWithSmartPhone,L as combineWithVasOptions,B as fetchFilteredProducts,k as fetchOttItems,C as fetchPegaProducts,E as fetchPrice,A as fetchServiceOptions,N as fetchStaticProductIds,F as filterShogunProducts,x as findHeight,U as getShogunSharedOffer,D as getTimeUntilNextTimerEvent,$ as isShogunOfferResolved,P as isTimerActive,_ 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';\r\nimport { SetStateAction } from 'react';\r\nimport {\r\n DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n DEFAULT_WIRELINE_BUNDLE,\r\n ONE_ECOMMERCE_INTERNET_SUMMARY,\r\n ONE_ECOMMERCE_SUMMARY,\r\n RATEPLAN,\r\n TV_SERVICE_OPTION,\r\n VCTYPE\r\n} from '../../utils/constants';\r\nimport { createCartV2, fetchShogunOfferData } from '../../services/LineTableService';\r\nimport {\r\n checkLinkWithLang,\r\n getElementMaximumHeight,\r\n getLocalStorageWithExpiry,\r\n returnPriceByType\r\n} from '../../utils/utils';\r\nimport { trackNewDatalayerEvent } from '../../utils/AnalyticsUtils';\r\nimport {\r\n ADDTOCART,\r\n COMBINEDEVICE,\r\n GAEVENT,\r\n LINETABLE,\r\n LINETABLEDEVICE,\r\n LINETABLEPRODUCT\r\n} from '../../Analytics/AnalyticsConstants';\r\nimport { getEcomCartInfo, trackEligibleItem } from '../../models/Analytics/items';\r\nimport { AtlOffer, OfferValidation, PegaProductRequestBase } from '../lineTable/lineTable.types';\r\nimport { calculateDateTime } from './StaticLineTabelTimer/util';\r\n\r\nexport const isTimerActive = (startTime: string, endTime: string): boolean => {\r\n try {\r\n const now = new Date();\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return false;\r\n }\r\n\r\n return now >= start && now < end;\r\n } catch {\r\n return false;\r\n }\r\n};\r\n\r\nexport const getTimeUntilNextTimerEvent = (startTime: string, endTime: string): number => {\r\n try {\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return 0;\r\n }\r\n\r\n const now = new Date().getTime();\r\n const startTimeMs = start.getTime();\r\n const endTimeMs = end.getTime();\r\n\r\n // Next transition is start when timer is upcoming, otherwise end when active.\r\n if (now < startTimeMs) {\r\n return Math.max(0, startTimeMs - now);\r\n }\r\n if (now >= startTimeMs && now < endTimeMs) {\r\n return Math.max(0, endTimeMs - now);\r\n }\r\n\r\n return 0;\r\n } catch {\r\n return 0;\r\n }\r\n};\r\n\r\nexport const fetchStaticProductIds = (\r\n productList: any,\r\n productId: any,\r\n bundle4PProduct?: boolean,\r\n tvOptionIds?: any,\r\n //US_31295\r\n pricesToggleState?: any\r\n): any => {\r\n let enableStream = false;\r\n let promotionId = '';\r\n productList?.map((data: any) => {\r\n const productRequest: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n\r\n const productData = data?.products?.[0]?.reference?.content?.product?.[0];\r\n const promotionData = data?.promotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n promotionId = promotionData?.promotionId;\r\n productRequest['id'] = productData?.productId;\r\n const timer = data?.timer?.[0];\r\n const timerIsActive = timer ? isTimerActive(timer.startTime, timer.endTime) : false;\r\n const timerPromotionId =\r\n timer?.promotion?.[0]?.reference?.content?.promoDescription?.[0]?.promotionId;\r\n const defaultPromotionId =\r\n pricesToggleState && pricesToggleState === true && promotionData?.promotionId === ''\r\n ? DEFAULT_MOBILEPOSTPAID_BUNDLE\r\n : promotionData?.promotionId;\r\n\r\n //US_31295 - add default promo only when timer is not active and timer has no promo\r\n if (timerIsActive && timerPromotionId) {\r\n productRequest?.promoIds?.push(timerPromotionId);\r\n } else {\r\n productRequest?.promoIds?.push(defaultPromotionId);\r\n }\r\n\r\n //for 4P product\r\n if (bundle4PProduct) {\r\n const mobilePromotionData =\r\n data?.mobilePromotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n productRequest?.promoIds?.push(mobilePromotionData?.promotionId);\r\n }\r\n\r\n productId?.push(productRequest);\r\n });\r\n if (enableStream) {\r\n tvOptionIds?.map((option: any) => {\r\n const tvOptionObj: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n tvOptionObj['id'] = option?.text;\r\n tvOptionObj?.promoIds?.push(promotionId);\r\n\r\n productId?.push(tvOptionObj);\r\n });\r\n }\r\n};\r\n\r\nexport const fetchPegaProducts = (\r\n content: any,\r\n pegaCustomerInterest?: string,\r\n placements?: string\r\n): PegaProductRequestBase => {\r\n // const url = window?.location?.pathname?.split('/') ?? [];\r\n // const pathname = url[url.length - 1];\r\n //set customerInterest as content?.tabCaption capitalize inital letter and after space and then remove spaces - from Other plans into OtherPlans\r\n const customerInterest = content?.tabCaption\r\n ?.replace(/\\b\\w/g, (l: string) => l.toUpperCase())\r\n .replace(/\\s+/g, '');\r\n\r\n const offerValidations = [\r\n {\r\n key: 'Segment',\r\n type: 'CustomerType',\r\n value: 'Residential'\r\n },\r\n {\r\n key: 'OrderType',\r\n type: 'CustomerInterest',\r\n value: 'New'\r\n },\r\n {\r\n key: 'CurrentPage',\r\n type: 'Context',\r\n value: 'mobile-subscription' //pathname ?? ''\r\n },\r\n {\r\n key: 'Category',\r\n type: 'CustomerInterest',\r\n value: customerInterest ?? ''\r\n },\r\n {\r\n key: 'RequestedOfferCount',\r\n type: 'Context',\r\n value: content?.pegaRequestOfferCount?.toString() ?? '3'\r\n },\r\n pegaCustomerInterest\r\n ? {\r\n key: 'Tag',\r\n type: 'CustomerInterest',\r\n value: pegaCustomerInterest\r\n }\r\n : null\r\n ].filter(Boolean) as OfferValidation[];\r\n\r\n const atlOffers: AtlOffer = {\r\n placements,\r\n offerValidations\r\n };\r\n\r\n const pegaProducts: PegaProductRequestBase = {\r\n atlOffers: [atlOffers]\r\n };\r\n\r\n return pegaProducts;\r\n};\r\n\r\nexport const checkGiftOrCashback = (data: any): any => {\r\n let showGift = false;\r\n let cashbackAvailable = false;\r\n data?.map((product: any) => {\r\n product?.promotionInfo?.map((offer: any) => {\r\n if (offer?.hardwareGift) showGift = true;\r\n if (offer?.cashBack) cashbackAvailable = true;\r\n });\r\n });\r\n return { showGift, cashbackAvailable };\r\n};\r\n\r\nexport const staticCreateCart = (\r\n setShowLoader: { (value: SetStateAction<boolean>): void; (arg0: boolean): void },\r\n cartEndPoint: string,\r\n giftItem: any,\r\n uniqueProductData: any,\r\n mainContent: any,\r\n showPrice: any,\r\n isMobileFlow: boolean,\r\n radioValue: any,\r\n eligibleBundle: any,\r\n address: any,\r\n setShowLinecheck: any,\r\n showLinecheck: any,\r\n lineCheckCallBack: any,\r\n enableP2P: any,\r\n P2PData: any,\r\n content: any,\r\n tvOptions?: any,\r\n discountRef?: string,\r\n discountVersion?: string\r\n): any => {\r\n if (isMobileFlow) {\r\n setShowLoader(true);\r\n const vcType: { voucher: string; voucherType: string } = getLocalStorageWithExpiry(VCTYPE);\r\n Object.keys(uniqueProductData)?.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n '',\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n cartEndPoint,\r\n 'mobile',\r\n giftItem,\r\n enableP2P,\r\n P2PData,\r\n mainContent?.productContainer?.[0]?.isQoQaFlow,\r\n vcType?.voucher,\r\n null,\r\n null,\r\n discountRef,\r\n discountVersion\r\n )\r\n .then((res: any) => {\r\n Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEPRODUCT);\r\n window.location.href = mainContent?.summaryPageUrl?.cached_url;\r\n })\r\n .catch((err) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n setShowLoader(false);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n } else {\r\n const linecheckId: any =\r\n typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid');\r\n if (!eligibleBundle || !address || !linecheckId) {\r\n mainContent?.enableLinecheckOverlay ? setShowLinecheck(!showLinecheck) : lineCheckCallBack();\r\n } else {\r\n setShowLoader(true);\r\n uniqueProductData.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n radioValue,\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_WIRELINE_BUNDLE,\r\n cartEndPoint,\r\n 'fixnet',\r\n giftItem,\r\n '',\r\n '',\r\n false,\r\n '',\r\n '',\r\n tvOptions\r\n )\r\n .then((res: any) => {\r\n typeof window !== 'undefined' && Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n typeof window !== 'undefined' &&\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n typeof window !== 'undefined' &&\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n typeof window !== 'undefined' && Cookies.remove('landline');\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLE);\r\n const productUrl = checkLinkWithLang(content?.productBasedCheckoutUrl?.cached_url);\r\n let recommendAccessory = false;\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (uniqueProductData[0]?.isBundle) {\r\n uniqueProductData[0]?.bundledOffers?.map((item: any) => {\r\n if (\r\n item?.productType?.toLowerCase() === 'internet' ||\r\n item?.productType?.toLowerCase() == 'tv'\r\n ) {\r\n if (item?.recommendAccessory) {\r\n recommendAccessory = item?.recommendAccessory;\r\n }\r\n }\r\n // setting to false incase of Mobile product Type as it is currently out of scope\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n recommendAccessory = false;\r\n return;\r\n }\r\n });\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n if (uniqueProductData?.[0]?.recommendAccessory) {\r\n recommendAccessory = uniqueProductData?.[0]?.recommendAccessory;\r\n }\r\n }\r\n //setting the session to identify internet flow for mia for win\r\n if (recommendAccessory) {\r\n const sessionObj = { flow: 'WIN' };\r\n sessionStorage.setItem(ONE_ECOMMERCE_SUMMARY, JSON.stringify(sessionObj));\r\n }\r\n\r\n const finalURL = productUrl\r\n ? productUrl\r\n : content?.enableTVStreamingOptionsStepper && mainContent?.vasStepperURL?.cached_url\r\n ? mainContent?.vasStepperURL?.cached_url\r\n : recommendAccessory && mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n ? mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n : mainContent?.summaryPageUrl?.cached_url;\r\n\r\n window.location.href = finalURL;\r\n })\r\n .catch((err: any) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n }\r\n }\r\n};\r\n\r\nexport const findHeight = (tabIndex: number, cardsLength: number) => {\r\n const setTimerSectionHeight = () => {\r\n let maxActiveTimerHeight = 0;\r\n const timerSections: HTMLElement[] = [];\r\n\r\n [...Array(cardsLength)].forEach((_, index) => {\r\n const timerSection = document.getElementById(`timer-section${tabIndex}${index}`);\r\n if (timerSection) {\r\n timerSections.push(timerSection);\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n if (isTimerActive) {\r\n const spacer = timerSection.firstElementChild as HTMLElement | null;\r\n // Read the inline style target height instead of clientHeight so that\r\n // an in-progress CSS transition does not yield an intermediate value.\r\n const targetHeight = parseFloat(spacer?.style.height || '0') || 0;\r\n maxActiveTimerHeight = Math.max(maxActiveTimerHeight, targetHeight);\r\n }\r\n }\r\n });\r\n\r\n timerSections.forEach((timerSection) => {\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n timerSection.style.transition = 'height 0.3s ease';\r\n timerSection.style.height = isTimerActive ? '0px' : `${maxActiveTimerHeight}px`;\r\n });\r\n };\r\n\r\n getElementMaximumHeight('headingV3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('descriptionV3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('titleV3' + `${tabIndex}`, cardsLength);\r\n setTimerSectionHeight();\r\n getElementMaximumHeight('detailsectionv3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('product-configv3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('gift-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('benefits-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('order-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('price-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('benefits-price-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('contract-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('exclusive-benefits-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('discountedpricetoggle-section' + `${tabIndex}`, cardsLength);\r\n};\r\n\r\nconst setMobileSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n pretopostvalues?: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration = productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n const pretopostvalue = pretopostvalues ?? '';\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const flow = urlParams.get('flow');\r\n const sessionObj: any = {\r\n mobileSubscription: productPrice?.[0]?.id ?? '',\r\n mobileSubscriptionPrice: discount > 0 ? discount : base,\r\n mobileSubscriptionPromo: promoId,\r\n subGroup: 'MOBILE',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withoutPromo: false,\r\n pretopostvalue: pretopostvalue,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n isOttFlow: flow === 'ott' ? true : false\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem('one-ecommerce-mobileSummary', JSON.stringify(sessionObj));\r\n};\r\n\r\nexport const combineWithSmartPhone = (\r\n showPrice: any,\r\n storyContent: any,\r\n uniqueProductData: any,\r\n responseData?: any,\r\n product?: any,\r\n pegaIntegration?: boolean\r\n) => {\r\n const pretopostvalues = {\r\n msisdn: responseData?.msisdn ?? '',\r\n ratePlan: responseData?.ratePlan ?? '',\r\n ratePlanType: responseData?.ratePlanType ?? '',\r\n productId: responseData ? showPrice?.id : ''\r\n };\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n let Params = '';\r\n Params = `?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${\r\n promoId ?? ''\r\n }&productCode=${showPrice?.id ?? ''}`;\r\n window.location.href = storyContent?.addSmartPhone?.[0]?.buttonLink?.cached_url + Params;\r\n setMobileSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n responseData && pretopostvalues,\r\n showPrice,\r\n product,\r\n pegaIntegration\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nconst setFixnetSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any,\r\n productName?: string,\r\n recommendAccessory?: boolean | undefined\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration =\r\n productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? showPrice?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n\r\n const sessionObj: any = {\r\n internetSubscription: productName ?? '',\r\n internetSubscriptionId: productPrice?.[0]?.id ?? '',\r\n internetSubscriptionPrice: discount > 0 ? discount : base,\r\n internetSubscriptionPromo: promoId,\r\n subGroup: 'INTERNET',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withPromo: discount > 0 ? true : false,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n productType: 'subscription',\r\n recommendAccessory: recommendAccessory\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem(ONE_ECOMMERCE_INTERNET_SUMMARY, JSON.stringify(sessionObj));\r\n};\r\nexport const combineWithVasOptions = (\r\n showPrice: any,\r\n uniqueProductData: any,\r\n product?: any,\r\n pegaIntegration?: boolean,\r\n productName?: string,\r\n recommendAccessory?: boolean\r\n) => {\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n\r\n setFixnetSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n showPrice,\r\n product,\r\n pegaIntegration,\r\n productName,\r\n recommendAccessory\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nexport const fetchServiceOptions = (entitlement: any, isMobileFlow: boolean) => {\r\n let service: any;\r\n if (!isMobileFlow) {\r\n service = (entitlement || []).filter((product: any) => product?.enableTV === true);\r\n }\r\n return service;\r\n};\r\n\r\nexport const fetchPrice = (\r\n product: any,\r\n isMobileFlow: boolean,\r\n pageType?: string,\r\n isConfigurator?: boolean,\r\n tvOptions?: any[],\r\n pegaIntegration?: boolean\r\n): any => {\r\n const showPrice: any = {\r\n base: '',\r\n onetimePrice: '',\r\n discount: [],\r\n contractDuration: '',\r\n int_fmc: 0,\r\n mob_fmc: 0,\r\n mob_benefit_category: '',\r\n id: '',\r\n promoID: '',\r\n loyaltyPrice: ''\r\n };\r\n let tvOptionsBasePrice = 0;\r\n let tvOptionsDiscountPrice = 0;\r\n let tvOptionsBaseToDiscount = 0;\r\n\r\n Array.isArray(product) &&\r\n product?.map((item: any) => {\r\n showPrice['id'] = item?.id ?? '';\r\n item?.prices?.map((basePrice: any) => {\r\n if (basePrice?.priceType?.toLowerCase() === 'recurring') {\r\n if (tvOptions && tvOptions?.length > 0) {\r\n tvOptions?.forEach((opt: any) => {\r\n if (opt?.beneficiaryPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.beneficiaryPrice);\r\n } else if (opt?.derivedPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.derivedPrice);\r\n } else {\r\n tvOptionsBaseToDiscount += parseFloat(opt?.recurringPrice);\r\n }\r\n if (opt?.recurringPrice > 0) {\r\n tvOptionsBasePrice += parseFloat(opt?.recurringPrice);\r\n }\r\n });\r\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\r\n if (tvOptionsDiscountPrice > 0) {\r\n tvOptionsDiscountPrice += tvOptionsBaseToDiscount;\r\n }\r\n showPrice['base'] = JSON.stringify(\r\n parseFloat(basePrice?.value) +\r\n (tvOptionsDiscountPrice > 0 ? tvOptionsDiscountPrice : tvOptionsBasePrice)\r\n );\r\n } else {\r\n showPrice['base'] = basePrice?.value;\r\n }\r\n } else if (basePrice?.priceType?.toLowerCase() === 'one time')\r\n showPrice['onetimePrice'] = basePrice?.value;\r\n });\r\n item?.derivedPrice?.map((discountPrice: any) => {\r\n const cycle = { cycleStart: '', cycleEnd: '', value: '' };\r\n cycle['cycleStart'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? 1\r\n : discountPrice?.cycle?.cycleStart;\r\n cycle['cycleEnd'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n : discountPrice?.cycle?.cycleEnd;\r\n cycle['value'] = discountPrice?.value;\r\n if (tvOptions && tvOptions?.length > 0) {\r\n if (tvOptionsDiscountPrice > 0) {\r\n cycle['value'] = JSON.stringify(\r\n parseFloat(discountPrice?.value) + tvOptionsDiscountPrice\r\n );\r\n } else {\r\n cycle['value'] = JSON.stringify(parseFloat(discountPrice?.value) + tvOptionsBasePrice);\r\n }\r\n }\r\n showPrice['discount'].push(cycle);\r\n });\r\n // Calculating loyalty price introduced with DC portfolio\r\n if (item?.promotionInfo?.[0]?.relatedPromo?.length > 0) {\r\n item?.promotionInfo?.[0]?.relatedPromo?.map((promo: any) => {\r\n if (promo?.type === 'LOYALTY_DISCOUNT') {\r\n showPrice['loyaltyPrice'] = promo?.discount;\r\n }\r\n });\r\n }\r\n });\r\n\r\n product?.[0]?.bundledOffers?.forEach((item: any) => {\r\n item?.prices?.forEach((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.forEach((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n showPrice['int_fmc'] += Number(price?.value);\r\n } else if (price?.priceCategory == 'MULTIMOBILE' || price?.priceCategory == 'FMC') {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (item?.contractDuration) {\r\n showPrice['contractDuration'] = item?.contractDuration; // for bundled products contract duration is taken from bundled offers\r\n }\r\n if (item?.promotionInfo?.[0]?.id && !pegaIntegration) {\r\n showPrice['promoID'] = item?.promotionInfo?.[0]?.id;\r\n }\r\n });\r\n if (!product?.[0]?.isBundle) {\r\n showPrice['contractDuration'] = product?.[0]?.contractDuration; // for other products\r\n if (!pegaIntegration) {\r\n showPrice['promoID'] = product?.[0]?.promotionInfo?.[0]?.id;\r\n }\r\n }\r\n let int_fmc = 0;\r\n product?.[0]?.prices?.map((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.map((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n int_fmc += Number(price?.value);\r\n } else if (price?.priceCategory == 'MULTIMOBILE' || price?.priceCategory == 'FMC') {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (!showPrice?.contractDuration && !isMobileFlow) {\r\n showPrice['contractDuration'] = '12';\r\n }\r\n {\r\n showPrice['int_fmc'] = isConfigurator ? int_fmc : showPrice['int_fmc'];\r\n }\r\n if (pageType == '4P') {\r\n let bundleContractDuration = '0';\r\n product?.[0]?.bundledOffers?.map((offerData: any) => {\r\n if (offerData?.contractDuration) {\r\n bundleContractDuration =\r\n Number(bundleContractDuration) > Number(offerData?.contractDuration)\r\n ? bundleContractDuration\r\n : offerData?.contractDuration;\r\n }\r\n });\r\n showPrice['contractDuration'] = bundleContractDuration;\r\n }\r\n return showPrice;\r\n};\r\n\r\n//function for creating different array for 3 selections\r\nexport const fetchFilteredProducts = (productList: any, toggleState: any) => {\r\n //need to centralize for comman solution\r\n // Filter productList based on gigaSpeed toggle - US #363853\r\n let filteredList = productList;\r\n\r\n filteredList = productList.filter((item: any) => {\r\n const gigaSpeedValue = item?.gigaSpeed?.toLowerCase();\r\n if (toggleState?.gigaSpeed) {\r\n return gigaSpeedValue != 'hide';\r\n } else {\r\n return gigaSpeedValue != 'show';\r\n }\r\n });\r\n\r\n let mainArray = filteredList;\r\n const numberOfArray = 3;\r\n let res1 = [];\r\n let res2 = [];\r\n let res3 = [];\r\n for (let item of mainArray) {\r\n const multiIndex = item?.productIndex?.includes(',');\r\n const updatedMultiIndex = multiIndex && item?.productIndex?.split(',');\r\n if (multiIndex) {\r\n for (let mIndex of updatedMultiIndex) {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(mIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(item?.productIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n }\r\n const displayContent =\r\n toggleState?.TV && toggleState?.Netflix ? res3 : toggleState?.TV ? res2 : res1;\r\n return displayContent;\r\n};\r\nexport const fetchOttItems = (ottCartData: any) => {\r\n return (ottCartData?.products || [])?.map((products: any) => ({\r\n itemType: products?.type ?? '',\r\n promotionId: products?.promo ?? '',\r\n items: [\r\n {\r\n itemType: products?.type === TV_SERVICE_OPTION ? TV_SERVICE_OPTION : RATEPLAN,\r\n id: products?.id ?? ''\r\n }\r\n ]\r\n }));\r\n};\r\n\r\n// ─── Shogun shared-offer cache ────────────────────────────────────────────────\r\n\r\ninterface ShogunOfferCacheEntry {\r\n gloxTokenId: string;\r\n results: any[] | null;\r\n promise: Promise<any[]> | null;\r\n}\r\n\r\nlet shogunOfferSharedCache: ShogunOfferCacheEntry | null = null;\r\n\r\n/**\r\n * Returns true when the shared cache already holds resolved results for the\r\n * given token. Callers can use this to skip triggering a loading state.\r\n */\r\nexport const isShogunOfferResolved = (gloxTokenId: string): boolean =>\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.results !== null;\r\n\r\n/**\r\n * Shared-promise manager for the Shogun offer API.\r\n *\r\n * Because the Shogun flow sends no product payload (only gloxTokenId) the\r\n * response is identical for every StaticProductContainer on the page.\r\n * This function ensures exactly one network request is made:\r\n * - If results are already resolved → returns Promise.resolve(results)\r\n * - If a fetch is in-flight → returns the same promise\r\n * - First caller → creates the fetch and stores the promise\r\n *\r\n * On failure the promise rejects — the caller is responsible for surfacing\r\n * the error (e.g. showing the telesales/error popup). The failure is NOT\r\n * cached, so a retry (e.g. tab switch) will trigger a fresh request.\r\n */\r\nexport const getShogunSharedOffer = (\r\n gloxTokenId: string,\r\n uniqueId: string,\r\n offerEndpoint: string\r\n): Promise<any[]> => {\r\n // Already resolved\r\n if (isShogunOfferResolved(gloxTokenId)) {\r\n return Promise.resolve(shogunOfferSharedCache!.results!);\r\n }\r\n\r\n // In-flight\r\n if (\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.promise !== null\r\n ) {\r\n return shogunOfferSharedCache.promise;\r\n }\r\n\r\n // First caller — start the real fetch\r\n const fetchPromise: Promise<any[]> = fetchShogunOfferData(gloxTokenId, uniqueId, offerEndpoint)\r\n .then((resp: any) => {\r\n const results: any[] = resp?.[uniqueId] ?? [];\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache.results = results;\r\n shogunOfferSharedCache.promise = null;\r\n }\r\n return results;\r\n })\r\n .catch((err: any) => {\r\n // Clear the cache entry so the next call retries the API.\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache = null;\r\n }\r\n throw err;\r\n });\r\n\r\n shogunOfferSharedCache = { gloxTokenId, results: null, promise: fetchPromise };\r\n return fetchPromise;\r\n};\r\n\r\n\r\n/**\r\n * Filters and sorts the Storyblok product list to match only the products\r\n * returned by the Shogun offer API, preserving the API response order.\r\n */\r\nexport const filterShogunProducts = (\r\n availableProducts: any[],\r\n shogunProductIds: string[]\r\n): any[] => {\r\n const filtered = availableProducts.filter((product: any) => {\r\n const productId = product?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.includes(productId);\r\n });\r\n\r\n filtered.sort((a: any, b: any) => {\r\n const aId = a?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n const bId = b?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.indexOf(aId) - shogunProductIds.indexOf(bId);\r\n });\r\n\r\n return filtered;\r\n};\r\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","vcType","getLocalStorageWithExpiry","VCTYPE","Object","keys","length","createCartV2","promoID","productContainer","isQoQaFlow","voucher","then","res","Cookies","remove","path","set","trackEligibleItem","ADDTOCART","LINETABLEPRODUCT","window","location","href","summaryPageUrl","cached_url","catch","err","console","log","finally","linecheckId","get","DEFAULT_WIRELINE_BUNDLE","LINETABLE","productUrl","checkLinkWithLang","productBasedCheckoutUrl","recommendAccessory","isBundle","bundledOffers","item","productType","toLowerCase","sessionObj","flow","sessionStorage","setItem","ONE_ECOMMERCE_SUMMARY","JSON","stringify","finalURL","enableTVStreamingOptionsStepper","vasStepperURL","multiItemPageRedirectionUrl","enableLinecheckOverlay","findHeight","tabIndex","cardsLength","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","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","undefined","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":"q0BA+BaA,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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hS,gBAAQ,IAAAQ,OAAA,EAAAA,EAAG,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,OAAO0S,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';\r\nimport { SetStateAction } from 'react';\r\nimport {\r\n DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n DEFAULT_WIRELINE_BUNDLE,\r\n ONE_ECOMMERCE_INTERNET_SUMMARY,\r\n ONE_ECOMMERCE_SUMMARY,\r\n RATEPLAN,\r\n TV_SERVICE_OPTION,\r\n VCTYPE\r\n} from '../../utils/constants';\r\nimport { createCartV2, fetchShogunOfferData } from '../../services/LineTableService';\r\nimport {\r\n checkLinkWithLang,\r\n getElementMaximumHeight,\r\n getLocalStorageWithExpiry,\r\n returnPriceByType\r\n} from '../../utils/utils';\r\nimport { trackNewDatalayerEvent } from '../../utils/AnalyticsUtils';\r\nimport {\r\n ADDTOCART,\r\n COMBINEDEVICE,\r\n GAEVENT,\r\n LINETABLE,\r\n LINETABLEDEVICE,\r\n LINETABLEPRODUCT\r\n} from '../../Analytics/AnalyticsConstants';\r\nimport { getEcomCartInfo, trackEligibleItem } from '../../models/Analytics/items';\r\nimport { AtlOffer, OfferValidation, PegaProductRequestBase } from '../lineTable/lineTable.types';\r\nimport { calculateDateTime } from './StaticLineTabelTimer/util';\r\n\r\nexport const isTimerActive = (startTime: string, endTime: string): boolean => {\r\n try {\r\n const now = new Date();\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return false;\r\n }\r\n\r\n return now >= start && now < end;\r\n } catch {\r\n return false;\r\n }\r\n};\r\n\r\nexport const getTimeUntilNextTimerEvent = (startTime: string, endTime: string): number => {\r\n try {\r\n const start = calculateDateTime(new Date(startTime.replace(/-/g, '/')));\r\n const end = calculateDateTime(new Date(endTime.replace(/-/g, '/')));\r\n\r\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\r\n return 0;\r\n }\r\n\r\n const now = new Date().getTime();\r\n const startTimeMs = start.getTime();\r\n const endTimeMs = end.getTime();\r\n\r\n // Next transition is start when timer is upcoming, otherwise end when active.\r\n if (now < startTimeMs) {\r\n return Math.max(0, startTimeMs - now);\r\n }\r\n if (now >= startTimeMs && now < endTimeMs) {\r\n return Math.max(0, endTimeMs - now);\r\n }\r\n\r\n return 0;\r\n } catch {\r\n return 0;\r\n }\r\n};\r\n\r\nexport const fetchStaticProductIds = (\r\n productList: any,\r\n productId: any,\r\n bundle4PProduct?: boolean,\r\n tvOptionIds?: any,\r\n //US_31295\r\n pricesToggleState?: any\r\n): any => {\r\n let enableStream = false;\r\n let promotionId = '';\r\n productList?.map((data: any) => {\r\n const productRequest: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n\r\n const productData = data?.products?.[0]?.reference?.content?.product?.[0];\r\n const promotionData = data?.promotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n promotionId = promotionData?.promotionId;\r\n productRequest['id'] = productData?.productId;\r\n const timer = data?.timer?.[0];\r\n const timerIsActive = timer ? isTimerActive(timer.startTime, timer.endTime) : false;\r\n const timerPromotionId =\r\n timer?.promotion?.[0]?.reference?.content?.promoDescription?.[0]?.promotionId;\r\n const defaultPromotionId =\r\n pricesToggleState && pricesToggleState === true && promotionData?.promotionId === ''\r\n ? DEFAULT_MOBILEPOSTPAID_BUNDLE\r\n : promotionData?.promotionId;\r\n\r\n //US_31295 - add default promo only when timer is not active and timer has no promo\r\n if (timerIsActive && timerPromotionId) {\r\n productRequest?.promoIds?.push(timerPromotionId);\r\n } else {\r\n productRequest?.promoIds?.push(defaultPromotionId);\r\n }\r\n\r\n //for 4P product\r\n if (bundle4PProduct) {\r\n const mobilePromotionData =\r\n data?.mobilePromotion?.[0]?.reference?.content?.promoDescription?.[0];\r\n productRequest?.promoIds?.push(mobilePromotionData?.promotionId);\r\n }\r\n\r\n productId?.push(productRequest);\r\n });\r\n if (enableStream) {\r\n tvOptionIds?.map((option: any) => {\r\n const tvOptionObj: any = {\r\n id: '',\r\n promoIds: []\r\n };\r\n tvOptionObj['id'] = option?.text;\r\n tvOptionObj?.promoIds?.push(promotionId);\r\n\r\n productId?.push(tvOptionObj);\r\n });\r\n }\r\n};\r\n\r\nexport const fetchPegaProducts = (\r\n content: any,\r\n pegaCustomerInterest?: string,\r\n placements?: string\r\n): PegaProductRequestBase => {\r\n // const url = window?.location?.pathname?.split('/') ?? [];\r\n // const pathname = url[url.length - 1];\r\n //set customerInterest as content?.tabCaption capitalize inital letter and after space and then remove spaces - from Other plans into OtherPlans\r\n const customerInterest = content?.tabCaption\r\n ?.replace(/\\b\\w/g, (l: string) => l.toUpperCase())\r\n .replace(/\\s+/g, '');\r\n\r\n const offerValidations = [\r\n {\r\n key: 'Segment',\r\n type: 'CustomerType',\r\n value: 'Residential'\r\n },\r\n {\r\n key: 'OrderType',\r\n type: 'CustomerInterest',\r\n value: 'New'\r\n },\r\n {\r\n key: 'CurrentPage',\r\n type: 'Context',\r\n value: 'mobile-subscription' //pathname ?? ''\r\n },\r\n {\r\n key: 'Category',\r\n type: 'CustomerInterest',\r\n value: customerInterest ?? ''\r\n },\r\n {\r\n key: 'RequestedOfferCount',\r\n type: 'Context',\r\n value: content?.pegaRequestOfferCount?.toString() ?? '3'\r\n },\r\n pegaCustomerInterest\r\n ? {\r\n key: 'Tag',\r\n type: 'CustomerInterest',\r\n value: pegaCustomerInterest\r\n }\r\n : null\r\n ].filter(Boolean) as OfferValidation[];\r\n\r\n const atlOffers: AtlOffer = {\r\n placements,\r\n offerValidations\r\n };\r\n\r\n const pegaProducts: PegaProductRequestBase = {\r\n atlOffers: [atlOffers]\r\n };\r\n\r\n return pegaProducts;\r\n};\r\n\r\nexport const checkGiftOrCashback = (data: any): any => {\r\n let showGift = false;\r\n let cashbackAvailable = false;\r\n data?.map((product: any) => {\r\n product?.promotionInfo?.map((offer: any) => {\r\n if (offer?.hardwareGift) showGift = true;\r\n if (offer?.cashBack) cashbackAvailable = true;\r\n });\r\n });\r\n return { showGift, cashbackAvailable };\r\n};\r\n\r\nexport const staticCreateCart = (\r\n setShowLoader: { (value: SetStateAction<boolean>): void; (arg0: boolean): void },\r\n cartEndPoint: string,\r\n giftItem: any,\r\n uniqueProductData: any,\r\n mainContent: any,\r\n showPrice: any,\r\n isMobileFlow: boolean,\r\n radioValue: any,\r\n eligibleBundle: any,\r\n address: any,\r\n setShowLinecheck: any,\r\n showLinecheck: any,\r\n lineCheckCallBack: any,\r\n enableP2P: any,\r\n P2PData: any,\r\n content: any,\r\n tvOptions?: any,\r\n discountRef?: string,\r\n discountVersion?: string,\r\n // Shogun/rewards (loyalty) flow — forwarded verbatim to createCartV2 so it\r\n // can append the pointsBurnt note to the primary cartItem.\r\n rewardsInfo?: { pointsBurnt?: string | number }\r\n): any => {\r\n if (isMobileFlow) {\r\n setShowLoader(true);\r\n const vcType: { voucher: string; voucherType: string } = getLocalStorageWithExpiry(VCTYPE);\r\n Object.keys(uniqueProductData)?.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n '',\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE,\r\n cartEndPoint,\r\n 'mobile',\r\n giftItem,\r\n enableP2P,\r\n P2PData,\r\n mainContent?.productContainer?.[0]?.isQoQaFlow,\r\n vcType?.voucher,\r\n null,\r\n null,\r\n discountRef,\r\n discountVersion,\r\n rewardsInfo\r\n )\r\n .then((res: any) => {\r\n Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEPRODUCT);\r\n window.location.href = mainContent?.summaryPageUrl?.cached_url;\r\n })\r\n .catch((err) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n setShowLoader(false);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n } else {\r\n const linecheckId: any =\r\n typeof window !== 'undefined' && Cookies.get('one-commerce-linecheckcorrelationid');\r\n if (!eligibleBundle || !address || !linecheckId) {\r\n mainContent?.enableLinecheckOverlay ? setShowLinecheck(!showLinecheck) : lineCheckCallBack();\r\n } else {\r\n setShowLoader(true);\r\n uniqueProductData.length !== 0 &&\r\n createCartV2(\r\n uniqueProductData,\r\n radioValue,\r\n showPrice?.promoID ? showPrice?.promoID : DEFAULT_WIRELINE_BUNDLE,\r\n cartEndPoint,\r\n 'fixnet',\r\n giftItem,\r\n '',\r\n '',\r\n false,\r\n '',\r\n '',\r\n tvOptions,\r\n undefined,\r\n undefined,\r\n rewardsInfo\r\n )\r\n .then((res: any) => {\r\n typeof window !== 'undefined' && Cookies.remove('one-commerce-cartId', { path: '/' });\r\n // saving newly created cartid in the cookies.\r\n typeof window !== 'undefined' &&\r\n Cookies.set('one-commerce-cartId', res?.id, { path: '/' });\r\n typeof window !== 'undefined' &&\r\n Cookies.set('cartProduct', showPrice?.id, { path: '/' });\r\n typeof window !== 'undefined' && Cookies.remove('landline');\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLE);\r\n const productUrl = checkLinkWithLang(content?.productBasedCheckoutUrl?.cached_url);\r\n let recommendAccessory = false;\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (uniqueProductData[0]?.isBundle) {\r\n uniqueProductData[0]?.bundledOffers?.map((item: any) => {\r\n if (\r\n item?.productType?.toLowerCase() === 'internet' ||\r\n item?.productType?.toLowerCase() == 'tv'\r\n ) {\r\n if (item?.recommendAccessory) {\r\n recommendAccessory = item?.recommendAccessory;\r\n }\r\n }\r\n // setting to false incase of Mobile product Type as it is currently out of scope\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n recommendAccessory = false;\r\n return;\r\n }\r\n });\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n if (uniqueProductData?.[0]?.recommendAccessory) {\r\n recommendAccessory = uniqueProductData?.[0]?.recommendAccessory;\r\n }\r\n }\r\n //setting the session to identify internet flow for mia for win\r\n if (recommendAccessory) {\r\n const sessionObj = { flow: 'WIN' };\r\n sessionStorage.setItem(ONE_ECOMMERCE_SUMMARY, JSON.stringify(sessionObj));\r\n }\r\n\r\n const finalURL = productUrl\r\n ? productUrl\r\n : content?.enableTVStreamingOptionsStepper && mainContent?.vasStepperURL?.cached_url\r\n ? mainContent?.vasStepperURL?.cached_url\r\n : recommendAccessory && mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n ? mainContent?.multiItemPageRedirectionUrl?.cached_url\r\n : mainContent?.summaryPageUrl?.cached_url;\r\n\r\n window.location.href = finalURL;\r\n })\r\n .catch((err: any) => {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n })\r\n .finally(() => {\r\n setShowLoader(false);\r\n });\r\n }\r\n }\r\n};\r\n\r\nexport const findHeight = (tabIndex: number, cardsLength: number) => {\r\n const setTimerSectionHeight = () => {\r\n let maxActiveTimerHeight = 0;\r\n const timerSections: HTMLElement[] = [];\r\n\r\n [...Array(cardsLength)].forEach((_, index) => {\r\n const timerSection = document.getElementById(`timer-section${tabIndex}${index}`);\r\n if (timerSection) {\r\n timerSections.push(timerSection);\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n if (isTimerActive) {\r\n const spacer = timerSection.firstElementChild as HTMLElement | null;\r\n // Read the inline style target height instead of clientHeight so that\r\n // an in-progress CSS transition does not yield an intermediate value.\r\n const targetHeight = parseFloat(spacer?.style.height || '0') || 0;\r\n maxActiveTimerHeight = Math.max(maxActiveTimerHeight, targetHeight);\r\n }\r\n }\r\n });\r\n\r\n timerSections.forEach((timerSection) => {\r\n const isTimerActive = timerSection.dataset.timerActive === 'true';\r\n timerSection.style.transition = 'height 0.3s ease';\r\n timerSection.style.height = isTimerActive ? '0px' : `${maxActiveTimerHeight}px`;\r\n });\r\n };\r\n\r\n getElementMaximumHeight('headingV3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('descriptionV3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('titleV3' + `${tabIndex}`, cardsLength);\r\n setTimerSectionHeight();\r\n getElementMaximumHeight('detailsectionv3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('product-configv3' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('gift-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('benefits-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('order-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('price-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('benefits-price-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('contract-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('exclusive-benefits-section' + `${tabIndex}`, cardsLength);\r\n getElementMaximumHeight('discountedpricetoggle-section' + `${tabIndex}`, cardsLength);\r\n};\r\n\r\nconst setMobileSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n pretopostvalues?: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration = productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n const pretopostvalue = pretopostvalues ?? '';\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const flow = urlParams.get('flow');\r\n const sessionObj: any = {\r\n mobileSubscription: productPrice?.[0]?.id ?? '',\r\n mobileSubscriptionPrice: discount > 0 ? discount : base,\r\n mobileSubscriptionPromo: promoId,\r\n subGroup: 'MOBILE',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withoutPromo: false,\r\n pretopostvalue: pretopostvalue,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n isOttFlow: flow === 'ott' ? true : false\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem('one-ecommerce-mobileSummary', JSON.stringify(sessionObj));\r\n};\r\n\r\nexport const combineWithSmartPhone = (\r\n showPrice: any,\r\n storyContent: any,\r\n uniqueProductData: any,\r\n responseData?: any,\r\n product?: any,\r\n pegaIntegration?: boolean\r\n) => {\r\n const pretopostvalues = {\r\n msisdn: responseData?.msisdn ?? '',\r\n ratePlan: responseData?.ratePlan ?? '',\r\n ratePlanType: responseData?.ratePlanType ?? '',\r\n productId: responseData ? showPrice?.id : ''\r\n };\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n let Params = '';\r\n Params = `?componentCode=&productType=subscription&segmentCode=RC&prefPromo=${\r\n promoId ?? ''\r\n }&productCode=${showPrice?.id ?? ''}`;\r\n window.location.href = storyContent?.addSmartPhone?.[0]?.buttonLink?.cached_url + Params;\r\n setMobileSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n responseData && pretopostvalues,\r\n showPrice,\r\n product,\r\n pegaIntegration\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nconst setFixnetSummarySession = (\r\n promoId: string,\r\n uniqueProductData: any,\r\n showPrice?: any,\r\n product?: any,\r\n pegaIntegration?: any,\r\n productName?: string,\r\n recommendAccessory?: boolean | undefined\r\n) => {\r\n const productPrice = uniqueProductData;\r\n const base: number = productPrice?.[0]?.prices?.[0]?.value ?? 0;\r\n const discount = productPrice?.[0]?.derivedPrice?.[0]?.value ?? 0;\r\n const contractDuration =\r\n productPrice?.[0]?.promotionInfo?.[0]?.contractDuration ?? showPrice?.contractDuration ?? 0;\r\n const campaignDuration = productPrice?.[0]?.promotionInfo?.[0]?.campaignDuration ?? 0;\r\n\r\n //PEGA Integration\r\n const discountRef = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.id;\r\n const discountVersion = pegaIntegration && uniqueProductData?.[0]?.promotionInfo?.[0]?.version;\r\n const clientDiscountInfo = pegaIntegration\r\n ? {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n : null;\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n\r\n const extraNotes = pegaIntegration ? note : null;\r\n\r\n const sessionObj: any = {\r\n internetSubscription: productName ?? '',\r\n internetSubscriptionId: productPrice?.[0]?.id ?? '',\r\n internetSubscriptionPrice: discount > 0 ? discount : base,\r\n internetSubscriptionPromo: promoId,\r\n subGroup: 'INTERNET',\r\n duration: Number(campaignDuration > 0 ? campaignDuration : contractDuration),\r\n basePrice: base,\r\n withPromo: discount > 0 ? true : false,\r\n upBenefit:\r\n showPrice.mob_benefit_category == 'MULTIMOBILE' || showPrice.mob_benefit_category == 'FMC',\r\n ultimateBundlePromo: product?.ultimateBundlePromotion ?? '',\r\n clientDiscountInfo: clientDiscountInfo,\r\n extraNotes: extraNotes,\r\n productType: 'subscription',\r\n recommendAccessory: recommendAccessory\r\n };\r\n\r\n typeof window !== undefined &&\r\n sessionStorage.setItem(ONE_ECOMMERCE_INTERNET_SUMMARY, JSON.stringify(sessionObj));\r\n};\r\nexport const combineWithVasOptions = (\r\n showPrice: any,\r\n uniqueProductData: any,\r\n product?: any,\r\n pegaIntegration?: boolean,\r\n productName?: string,\r\n recommendAccessory?: boolean\r\n) => {\r\n const promoId = showPrice?.promoID ? showPrice?.promoID : DEFAULT_MOBILEPOSTPAID_BUNDLE;\r\n\r\n setFixnetSummarySession(\r\n promoId,\r\n uniqueProductData,\r\n showPrice,\r\n product,\r\n pegaIntegration,\r\n productName,\r\n recommendAccessory\r\n );\r\n trackNewDatalayerEvent(\r\n GAEVENT,\r\n COMBINEDEVICE,\r\n getEcomCartInfo(uniqueProductData, '', LINETABLEDEVICE)\r\n );\r\n trackEligibleItem(ADDTOCART, uniqueProductData, '', LINETABLEDEVICE);\r\n};\r\n\r\nexport const fetchServiceOptions = (entitlement: any, isMobileFlow: boolean) => {\r\n let service: any;\r\n if (!isMobileFlow) {\r\n service = (entitlement || []).filter((product: any) => product?.enableTV === true);\r\n }\r\n return service;\r\n};\r\n\r\nexport const fetchPrice = (\r\n product: any,\r\n isMobileFlow: boolean,\r\n pageType?: string,\r\n isConfigurator?: boolean,\r\n tvOptions?: any[],\r\n pegaIntegration?: boolean\r\n): any => {\r\n const showPrice: any = {\r\n base: '',\r\n onetimePrice: '',\r\n discount: [],\r\n contractDuration: '',\r\n int_fmc: 0,\r\n mob_fmc: 0,\r\n mob_benefit_category: '',\r\n id: '',\r\n promoID: '',\r\n loyaltyPrice: ''\r\n };\r\n let tvOptionsBasePrice = 0;\r\n let tvOptionsDiscountPrice = 0;\r\n let tvOptionsBaseToDiscount = 0;\r\n\r\n Array.isArray(product) &&\r\n product?.map((item: any) => {\r\n showPrice['id'] = item?.id ?? '';\r\n item?.prices?.map((basePrice: any) => {\r\n if (basePrice?.priceType?.toLowerCase() === 'recurring') {\r\n if (tvOptions && tvOptions?.length > 0) {\r\n tvOptions?.forEach((opt: any) => {\r\n if (opt?.beneficiaryPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.beneficiaryPrice);\r\n } else if (opt?.derivedPrice > 0) {\r\n tvOptionsDiscountPrice += parseFloat(opt?.derivedPrice);\r\n } else {\r\n tvOptionsBaseToDiscount += parseFloat(opt?.recurringPrice);\r\n }\r\n if (opt?.recurringPrice > 0) {\r\n tvOptionsBasePrice += parseFloat(opt?.recurringPrice);\r\n }\r\n });\r\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\r\n if (tvOptionsDiscountPrice > 0) {\r\n tvOptionsDiscountPrice += tvOptionsBaseToDiscount;\r\n }\r\n showPrice['base'] = JSON.stringify(\r\n parseFloat(basePrice?.value) +\r\n (tvOptionsDiscountPrice > 0 ? tvOptionsDiscountPrice : tvOptionsBasePrice)\r\n );\r\n } else {\r\n showPrice['base'] = basePrice?.value;\r\n }\r\n } else if (basePrice?.priceType?.toLowerCase() === 'one time')\r\n showPrice['onetimePrice'] = basePrice?.value;\r\n });\r\n item?.derivedPrice?.map((discountPrice: any) => {\r\n const cycle = { cycleStart: '', cycleEnd: '', value: '' };\r\n cycle['cycleStart'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? 1\r\n : discountPrice?.cycle?.cycleStart;\r\n cycle['cycleEnd'] =\r\n pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n ? pegaIntegration && !product?.[0]?.isBundle && product?.[0]?.contractDuration\r\n : discountPrice?.cycle?.cycleEnd;\r\n cycle['value'] = discountPrice?.value;\r\n if (tvOptions && tvOptions?.length > 0) {\r\n if (tvOptionsDiscountPrice > 0) {\r\n cycle['value'] = JSON.stringify(\r\n parseFloat(discountPrice?.value) + tvOptionsDiscountPrice\r\n );\r\n } else {\r\n cycle['value'] = JSON.stringify(parseFloat(discountPrice?.value) + tvOptionsBasePrice);\r\n }\r\n }\r\n showPrice['discount'].push(cycle);\r\n });\r\n // Calculating loyalty price introduced with DC portfolio\r\n if (item?.promotionInfo?.[0]?.relatedPromo?.length > 0) {\r\n item?.promotionInfo?.[0]?.relatedPromo?.map((promo: any) => {\r\n if (promo?.type === 'LOYALTY_DISCOUNT') {\r\n showPrice['loyaltyPrice'] = promo?.discount;\r\n }\r\n });\r\n }\r\n });\r\n\r\n product?.[0]?.bundledOffers?.forEach((item: any) => {\r\n item?.prices?.forEach((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.forEach((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n showPrice['int_fmc'] += Number(price?.value);\r\n } else if (price?.priceCategory == 'MULTIMOBILE' || price?.priceCategory == 'FMC') {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (item?.contractDuration) {\r\n showPrice['contractDuration'] = item?.contractDuration; // for bundled products contract duration is taken from bundled offers\r\n }\r\n if (item?.promotionInfo?.[0]?.id && !pegaIntegration) {\r\n showPrice['promoID'] = item?.promotionInfo?.[0]?.id;\r\n }\r\n });\r\n if (!product?.[0]?.isBundle) {\r\n showPrice['contractDuration'] = product?.[0]?.contractDuration; // for other products\r\n if (!pegaIntegration) {\r\n showPrice['promoID'] = product?.[0]?.promotionInfo?.[0]?.id;\r\n }\r\n }\r\n let int_fmc = 0;\r\n product?.[0]?.prices?.map((productDetails: any) => {\r\n if (productDetails?.priceAlteration?.length > 0) {\r\n productDetails?.priceAlteration?.map((price: any) => {\r\n if (price?.priceCategory == 'INTERNET_FMC') {\r\n int_fmc += Number(price?.value);\r\n } else if (price?.priceCategory == 'MULTIMOBILE' || price?.priceCategory == 'FMC') {\r\n showPrice['mob_fmc'] += Number(price?.value);\r\n showPrice['mob_benefit_category'] = price?.priceCategory;\r\n }\r\n });\r\n }\r\n });\r\n if (!showPrice?.contractDuration && !isMobileFlow) {\r\n showPrice['contractDuration'] = '12';\r\n }\r\n {\r\n showPrice['int_fmc'] = isConfigurator ? int_fmc : showPrice['int_fmc'];\r\n }\r\n if (pageType == '4P') {\r\n let bundleContractDuration = '0';\r\n product?.[0]?.bundledOffers?.map((offerData: any) => {\r\n if (offerData?.contractDuration) {\r\n bundleContractDuration =\r\n Number(bundleContractDuration) > Number(offerData?.contractDuration)\r\n ? bundleContractDuration\r\n : offerData?.contractDuration;\r\n }\r\n });\r\n showPrice['contractDuration'] = bundleContractDuration;\r\n }\r\n return showPrice;\r\n};\r\n\r\n//function for creating different array for 3 selections\r\nexport const fetchFilteredProducts = (productList: any, toggleState: any) => {\r\n //need to centralize for comman solution\r\n // Filter productList based on gigaSpeed toggle - US #363853\r\n let filteredList = productList;\r\n\r\n filteredList = productList.filter((item: any) => {\r\n const gigaSpeedValue = item?.gigaSpeed?.toLowerCase();\r\n if (toggleState?.gigaSpeed) {\r\n return gigaSpeedValue != 'hide';\r\n } else {\r\n return gigaSpeedValue != 'show';\r\n }\r\n });\r\n\r\n let mainArray = filteredList;\r\n const numberOfArray = 3;\r\n let res1 = [];\r\n let res2 = [];\r\n let res3 = [];\r\n for (let item of mainArray) {\r\n const multiIndex = item?.productIndex?.includes(',');\r\n const updatedMultiIndex = multiIndex && item?.productIndex?.split(',');\r\n if (multiIndex) {\r\n for (let mIndex of updatedMultiIndex) {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(mIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < numberOfArray; i++) {\r\n if (Number(item?.productIndex) === i) {\r\n i === 0 ? res1.push(item) : i === 1 ? res2.push(item) : res3.push(item);\r\n }\r\n }\r\n }\r\n }\r\n const displayContent =\r\n toggleState?.TV && toggleState?.Netflix ? res3 : toggleState?.TV ? res2 : res1;\r\n return displayContent;\r\n};\r\nexport const fetchOttItems = (ottCartData: any) => {\r\n return (ottCartData?.products || [])?.map((products: any) => ({\r\n itemType: products?.type ?? '',\r\n promotionId: products?.promo ?? '',\r\n items: [\r\n {\r\n itemType: products?.type === TV_SERVICE_OPTION ? TV_SERVICE_OPTION : RATEPLAN,\r\n id: products?.id ?? ''\r\n }\r\n ]\r\n }));\r\n};\r\n\r\n// ─── Shogun shared-offer cache ────────────────────────────────────────────────\r\n\r\ninterface ShogunOfferCacheEntry {\r\n gloxTokenId: string;\r\n results: any[] | null;\r\n promise: Promise<any[]> | null;\r\n}\r\n\r\nlet shogunOfferSharedCache: ShogunOfferCacheEntry | null = null;\r\n\r\n/**\r\n * Returns true when the shared cache already holds resolved results for the\r\n * given token. Callers can use this to skip triggering a loading state.\r\n */\r\nexport const isShogunOfferResolved = (gloxTokenId: string): boolean =>\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.results !== null;\r\n\r\n/**\r\n * Shared-promise manager for the Shogun offer API.\r\n *\r\n * Because the Shogun flow sends no product payload (only gloxTokenId) the\r\n * response is identical for every StaticProductContainer on the page.\r\n * This function ensures exactly one network request is made:\r\n * - If results are already resolved → returns Promise.resolve(results)\r\n * - If a fetch is in-flight → returns the same promise\r\n * - First caller → creates the fetch and stores the promise\r\n *\r\n * On failure the promise rejects — the caller is responsible for surfacing\r\n * the error (e.g. showing the telesales/error popup). The failure is NOT\r\n * cached, so a retry (e.g. tab switch) will trigger a fresh request.\r\n */\r\nexport const getShogunSharedOffer = (\r\n gloxTokenId: string,\r\n uniqueId: string,\r\n offerEndpoint: string\r\n): Promise<any[]> => {\r\n // Already resolved\r\n if (isShogunOfferResolved(gloxTokenId)) {\r\n return Promise.resolve(shogunOfferSharedCache!.results!);\r\n }\r\n\r\n // In-flight\r\n if (\r\n shogunOfferSharedCache?.gloxTokenId === gloxTokenId &&\r\n shogunOfferSharedCache.promise !== null\r\n ) {\r\n return shogunOfferSharedCache.promise;\r\n }\r\n\r\n // First caller — start the real fetch\r\n const fetchPromise: Promise<any[]> = fetchShogunOfferData(gloxTokenId, uniqueId, offerEndpoint)\r\n .then((resp: any) => {\r\n const results: any[] = resp?.[uniqueId] ?? [];\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache.results = results;\r\n shogunOfferSharedCache.promise = null;\r\n }\r\n return results;\r\n })\r\n .catch((err: any) => {\r\n // Clear the cache entry so the next call retries the API.\r\n if (shogunOfferSharedCache?.gloxTokenId === gloxTokenId) {\r\n shogunOfferSharedCache = null;\r\n }\r\n throw err;\r\n });\r\n\r\n shogunOfferSharedCache = { gloxTokenId, results: null, promise: fetchPromise };\r\n return fetchPromise;\r\n};\r\n\r\n\r\n/**\r\n * Filters and sorts the Storyblok product list to match only the products\r\n * returned by the Shogun offer API, preserving the API response order.\r\n */\r\nexport const filterShogunProducts = (\r\n availableProducts: any[],\r\n shogunProductIds: string[]\r\n): any[] => {\r\n const filtered = availableProducts.filter((product: any) => {\r\n const productId = product?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.includes(productId);\r\n });\r\n\r\n filtered.sort((a: any, b: any) => {\r\n const aId = a?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n const bId = b?.products?.[0]?.reference?.content?.product?.[0]?.productId;\r\n return shogunProductIds.indexOf(aId) - shogunProductIds.indexOf(bId);\r\n });\r\n\r\n return filtered;\r\n};\r\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","vcType","getLocalStorageWithExpiry","VCTYPE","Object","keys","length","createCartV2","promoID","productContainer","isQoQaFlow","voucher","then","res","Cookies","remove","path","set","trackEligibleItem","ADDTOCART","LINETABLEPRODUCT","window","location","href","summaryPageUrl","cached_url","catch","err","console","log","finally","linecheckId","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","findHeight","tabIndex","cardsLength","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","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":"q0BA+BaA,EAAg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AAtBC,EAAiB,QAAjBrB,EAAAyB,aAAO,EAAPA,EAASH,gBAAQ,IAAAtB,OAAA,EAAAA,EAAG,UAAE,IAAAqB,OAAA,EAAAA,EAAEE,iBAAS,IAAAH,OAAA,EAAAA,EAAEI,eAAO,IAAAL,OAAA,EAAAA,EAAEM,eAAO,IAAAP,OAAA,EAAAA,EAAG,UAAE,IAAAa,OAAA,EAAAA,EAAEvB,UAC5E,OAAO2S,EAAiB5B,SAAS/Q,KASnC,OANA4S,EAASC,KAAK,CAACC,EAAQC,iCACrB,MAAMC,EAAwD,QAAlDzR,EAA6C,QAA7Cb,EAAoC,QAApCC,EAA2B,QAA3BC,EAAgB,QAAhBC,EAAW,QAAXrB,EAAAsT,aAAC,EAADA,EAAGhS,gBAAQ,IAAAtB,OAAA,EAAAA,EAAG,UAAE,IAAAqB,OAAA,EAAAA,EAAEE,iBAAS,IAAAH,OAAA,EAAAA,EAAEI,eAAO,IAAAL,OAAA,EAAAA,EAAEM,eAAO,IAAAP,OAAA,EAAAA,EAAG,UAAE,IAAAa,OAAA,EAAAA,EAAEvB,UAC1DiT,EAAwD,QAAlD7Q,EAA6C,QAA7CR,EAAoC,QAApCT,EAA2B,QAA3BC,EAAgB,QAAhBC,EAAW,QAAXC,EAAAyR,aAAC,EAADA,EAAGjS,gBAAQ,IAAAQ,OAAA,EAAAA,EAAG,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,OAAO2S,EAAiBO,QAAQF,GAAOL,EAAiBO,QAAQD,KAG3DL"}
@@ -1,2 +1,2 @@
1
- import{__awaiter as e}from"../../_virtual/_tslib.js";import l,{useState as o,useRef as t,useContext as i,useEffect as n}from"react";import d from"../Dotloader/Dotloader.js";import{createPortal as a}from"react-dom";import s from"../SkeletonLoader/SkeletonLoader.js";import r from"./StaticLineTable.module.scss.js";import c from"../richtext.js";import v from"./StaticProductEntitlement.js";import u from"./StaticBenefit.js";import m from"./DynamicPriceSection.js";import p from"./CheckoutButton.js";import g from"./StaticProductDetails.js";import{LineTableBasicPropConfig as f,AssetPathPropConfig as h}from"../../services/LineTableBasicPropConfig.js";import b from"js-cookie";import{LoginBasicPropConfig as E}from"../../services/LoginBasicPropConfig.js";import w from"../login/LoginModalV2.js";import{isTimerActive as P,fetchServiceOptions as C,fetchPrice as S,findHeight as y,checkGiftOrCashback as k,getTimeUntilNextTimerEvent as T,staticCreateCart as x,combineWithVasOptions as $,combineWithSmartPhone as D}from"./Product.utils.js";import L from"../ProductDetailsV3/GiftConfigV2.js";import N from"../ProductDetailsV3/ChooseGiftV2.js";import{viewport as I,replacePlaceholder as B,getUtcTimestamp as O}from"../../utils/utils.js";import j from"./StaticProductCashback.js";import{trackNewDatalayerEvent as A}from"../../utils/AnalyticsUtils.js";import{CTABUTTONCLICK as U,GAEVENT as V,EXISTINGCUSTOMER as F,LINETABLE as M,DOWNLOADPRODUCT as R}from"../../Analytics/AnalyticsConstants.js";import _ from"./TVChannelModal.js";import G from"../LineCheckV3/LinecheckModal.js";import J from"../BenefitWrapper/BenefitsValidateWrapper.js";import q from"../PretoPost/PreToPostSubsPopup.js";import H from"../LineCheckV3/GenericModal.js";import{fetchSubscriptionData as W,trackPegaEvents as z,validateP2P as K}from"../../services/LineTableService.js";import Q from"./ExsistingSubscriptionModal.js";import{getEcomCartInfo as X}from"../../models/Analytics/items.js";import Y from"../NewLineCheck/CoverageCheckModal.js";import{API_BASE_BASEPOINT as Z}from"../../services/api-constants.js";import{AppContext as ee}from"./StaticLineTableStore/StaticLineTableProvider.js";import le from"./OttServiceOptions/OttServiceOptionsSmallPopup.js";import oe from"./StaticExclusiveBenefit.js";import te from"../UserLoggedPricesToggle/UserLoggedPricesToggle.js";import ie from"../FalconButtonV2/FalconButtonV2.js";import{ONE_ECOMMERCE_INTERNET_SUMMARY as ne}from"../../utils/constants.js";import de from"./StaticLineTabelTimer/StaticLineTabelTimer.js";const ae=({content:ae,offeringData:se,uniqueId:re,storyContent:ce,metadata:ve,tabIndex:ue,cardsLength:me,indexKey:pe,constants:ge,mainContent:fe,address:he,eligibleBundle:be,linecheckSuccessCallBack:Ee,selectedOption:we,fetchOfferData:Pe,basicConfigUrl:Ce,selectedExistingOption:Se,setLoginSuccess:ye,enableP2P:ke,lineCheckCallBack:Te,loginSuccess:xe,setToggleState:$e,toggleState:De,noTabs:Le,deviceFlow:Ne,deviceFlowCallBack:Ie,selectedRP:Be,continueCart:Oe,lineCheckOnClear:je,pegaIntegration:Ae,isProdEnv:Ue,deviceUltimateBundle:Ve,toggleContent:Fe,pricesToggleState:Me,isShogunFlow:Re})=>{var _e,Ge,Je,qe,He,We,ze,Ke,Qe,Xe,Ye,Ze,el,ll,ol,tl,il,nl,dl,al,sl,rl,cl,vl,ul,ml,pl,gl,fl,hl,bl,El,wl,Pl,Cl,Sl,yl,kl,Tl,xl,$l,Dl,Ll,Nl,Il,Bl,Ol,jl,Al,Ul,Vl,Fl,Ml,Rl,_l,Gl,Jl,ql,Hl,Wl,zl,Kl,Ql,Xl,Yl,Zl,eo,lo,oo,to,io,no,ao,so,ro,co,vo,uo,mo,po,go,fo,ho,bo;const[Eo,wo]=o(!1),[Po,Co]=o(!1),[So,yo]=o({showGift:!1,cashbackAvailable:!1}),[ko,To]=o(!0),[xo,$o]=o(!1),[Do,Lo]=o([]),[No,Io]=o(!1),[Bo,Oo]=o(!1),[jo,Ao]=o(!1),[Uo,Vo]=o(!1),[Fo,Mo]=o(!1),[Ro,_o]=o(!1),Go=`${Ce}inf/customer-management/subscriptions`,Jo=`${Ce}inf/resource-management/msisdns/pretopost/validation`,[qo,Ho]=o([]),[Wo,zo]=o(!1),[Ko,Qo]=o(!1),[Xo,Yo]=o(!1),[Zo,et]=o([]),[lt,ot]=o(!1),[tt,it]=o(!1),[nt,dt]=o(!1),[at,st]=o(!1),[rt,ct]=o([]),[vt,ut]=o(0),mt=t(null),pt=`${Ce}inf/${Z.CUSTOMER}`,gt=void 0!==typeof window&&document.getElementById("static-linetable"),ft=0===(null===(_e=Object.keys(ae))||void 0===_e?void 0:_e.length),ht=null===(We=null===(He=null===(qe=null===(Je=null===(Ge=null==ae?void 0:ae.products)||void 0===Ge?void 0:Ge[0])||void 0===Je?void 0:Je.reference)||void 0===qe?void 0:qe.content)||void 0===He?void 0:He.product)||void 0===We?void 0:We[0],bt=null===(Ye=null===(Xe=null===(Qe=null===(Ke=null===(ze=null==ae?void 0:ae.promotion)||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.promoDescription)||void 0===Ye?void 0:Ye[0],Et=null===(Ze=null==ae?void 0:ae.timer)||void 0===Ze?void 0:Ze[0],wt=null==Et?void 0:Et.enableCounter,[Pt,Ct]=o(!!(wt&&(null==Et?void 0:Et.startTime)&&(null==Et?void 0:Et.endTime))&&P(Et.startTime,Et.endTime)),St=Boolean((null==ae?void 0:ae.highlightText)&&!0!==Me&&!Pt),yt=Boolean((null==bt?void 0:bt.displayText)&&!(null==ae?void 0:ae.notShowPromotionLabel)&&!0!==Me&&!Pt),kt=null==ht?void 0:ht.productId,Tt=null===(el=null==f?void 0:f.getInstance())||void 0===el?void 0:el.getCartUrl(),xt=null===(ll=null==h?void 0:h.getInstance())||void 0===ll?void 0:ll.getAssetPath(),$t="MOBILE"===(null==ce?void 0:ce.pageType),Dt=I(),Lt=i(ee);let Nt;Nt=he&&(null===(ol=null==be?void 0:be.eligibleBundle)||void 0===ol?void 0:ol.includes(kt));const It=null==ae?void 0:ae.enableTVStreamingOptionsPopUp,Bt=null==ae?void 0:ae.enableTVStreamingOptionsStepper,Ot=null==ae?void 0:ae.disableDiscountedPriceToggle,jt=null==ae?void 0:ae.skipAccessoriesPage;E.create({baseURL:null!=Ce?Ce:""});let At=void 0!==typeof window&&b.get("sunriseAuth");At=At&&JSON.parse(At);const Ut=((null==se?void 0:se[re])||[]).filter(e=>(null==e?void 0:e.id)===kt),Vt=e=>{et(e)},Ft=()=>{Io(!0),Vo(!Uo),Qo(!Ko)},Mt=()=>{var e,l,o;if(Co(!1),ke&&null==At)Vo(!Uo),Qo(!Ko);else if(ke&&(null==At?void 0:At.siteId))Ht();else if(we===F&&(null==Se?void 0:Se.length)>0)Mo(!0);else{!!((null==fe?void 0:fe.enableExistingCustomer)&&null==At||!At&&!0===Me&&(null==Fe?void 0:Fe.enableLoggedInPrice))?Io(!0):Zt()}if(Ae){const t=localStorage.getItem("prospectId"),i=null!==(o=null===(l=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname)||void 0===l?void 0:l.split("/"))&&void 0!==o?o:[],n=i[i.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"CartCreated",pageLocation:n,targetProduct:kt};t&&z(pt,d,t)}},Rt=e=>{const l=Do.findIndex(l=>(null==e?void 0:e.giftGroupId)===(null==l?void 0:l.giftGroupId)),o=Do;-1===l?o.push(e):o[l]=e,Lo([...o])},_t=new URLSearchParams(null===(tl=null===window||void 0===window?void 0:window.location)||void 0===tl?void 0:tl.search),Gt=null==_t?void 0:_t.get("selectedMsisdn"),Jt=e=>{var l;1===(null==e?void 0:e.length)?(xo?D(ei,ce,Ut,null==e?void 0:e[0],ae,Ae):Zt(null===(l=null==e?void 0:e[0])||void 0===l?void 0:l.msisdn),_o(!1)):(null==e?void 0:e.length)>1?(Ho(e),Yo(!Xo),_o(!1)):(Qo(!Ko),_o(!0),To(!0),wo(!1))},qt=(l,o)=>e(void 0,void 0,void 0,function*(){yield K(null==l?void 0:l.msisdn,Jo).then(e=>{e&&o.push(l)}).catch(e=>{console.log("error",e)})}),Ht=()=>{var l;wo(!0);try{null===(l=W("PREPAID",Go))||void 0===l||l.then(l=>e(void 0,void 0,void 0,function*(){if(204==(null==l?void 0:l.subscriptionData))Qo(!Ko),_o(!0),To(!0),wo(!1);else{const o=null==l?void 0:l.subscriptionData,t=o.find(e=>e.msisdn===Gt);if(o){const l=[];Gt?(yield qt(t,l),Jt(l)):yield Promise.all(null==o?void 0:o.map(o=>e(void 0,void 0,void 0,function*(){yield qt(o,l)}))).then(e=>{Jt(l)})}}})).catch(e=>{console.log("error---\x3e",e),wo(!1)})}catch(e){console.log("error---\x3e",e),wo(!1)}zo(!0)},Wt=()=>{Qo(!ko),Vo(!1)},zt=e=>{ot(!1),e&&A(V,U,{headline:"VAS POPUP CLOSE"})},Kt=()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");be=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),he="undefined"!=typeof window&&b.get("chAddressJson"),Ao(!jo),"function"==typeof Ee&&Ee(),Zt()},Qt=C(null==ht?void 0:ht.bloks,$t),Xt=null===(il=null==Qt?void 0:Qt[0])||void 0===il?void 0:il.tvProductId,Yt=e=>{var l,o,t,i,n,d;const a=Ae&&(null===(t=null===(o=null===(l=null==Ut?void 0:Ut[0])||void 0===l?void 0:l.promotionInfo)||void 0===o?void 0:o[0])||void 0===t?void 0:t.id),s=Ae&&(null===(d=null===(n=null===(i=null==Ut?void 0:Ut[0])||void 0===i?void 0:i.promotionInfo)||void 0===n?void 0:n[0])||void 0===d?void 0:d.version);Ut&&Ut[0]&&(Ut[0].fromPopup=at),ti("false"),sessionStorage.removeItem("vasPopUp"),it(!1),x(wo,Tt,Do,Ut,fe,ei,$t,Xt,be,he,Ao,jo,Te,ke,null!=Gt?Gt:e,ae,Zo,a,s)},Zt=e=>{var l,o,t,i,n,d,a,s,r;st(!1),Co(!1);let c=void 0!==typeof window&&b.get("sunriseAuth");const v=c&&JSON.parse(c),u=!(!(null==fe?void 0:fe.enableExistingCustomer)||null!=v);if(sessionStorage.removeItem(ne),(null===(l=null==fe?void 0:fe.linecheckData)||void 0===l?void 0:l.length)>0&&!$t&&!Nt){return void(document.getElementById("linecheck")&&Te())}if(Nt&&!$t&&(null===(o=null==fe?void 0:fe.loginData)||void 0===o?void 0:o.length)>0&&u)Io(!0);else if(Bt&&(null===(t=Ut[0])||void 0===t?void 0:t.isBundle)){let l=!1;jt||((null===(i=Ut[0])||void 0===i?void 0:i.isBundle)?null===(d=null===(n=Ut[0])||void 0===n?void 0:n.bundledOffers)||void 0===d||d.map(e=>{var o,t,i;"internet"!==(null===(o=null==e?void 0:e.productType)||void 0===o?void 0:o.toLowerCase())&&"tv"!=(null===(t=null==e?void 0:e.productType)||void 0===t?void 0:t.toLowerCase())||(null==e?void 0:e.recommendAccessory)&&(l=null==e?void 0:e.recommendAccessory),"mobile"!==(null===(i=null==e?void 0:e.productType)||void 0===i?void 0:i.toLowerCase())||(l=!1)}):(null===(a=null==Ut?void 0:Ut[0])||void 0===a?void 0:a.recommendAccessory)&&(l=null===(s=null==Ut?void 0:Ut[0])||void 0===s?void 0:s.recommendAccessory)),$(ei,Ut,ae,Ae,null==ht?void 0:ht.productName,l),Yt(e)}else It&&(null===(r=Ut[0])||void 0===r?void 0:r.isBundle)&&!tt?(ot(!0),it(!0),ti("true"),window.addEventListener("beforeunload",function(e){ti("false"),sessionStorage.removeItem("vasPopUp"),it(!1)})):(ke&&wo(!0),Yt(e))},ei=S(Ut,$t,null==fe?void 0:fe.pageType,!1,Zo,Ae);n(()=>{var e,l;setTimeout(()=>{y(ue,me)},100);const o=k($t?Ut:null!==(l=null===(e=null==Ut?void 0:Ut[0])||void 0===e?void 0:e.bundledOffers)&&void 0!==l?l:Ut);yo(Object.assign({},o))},[se,De,Zo,vt,((null==De?void 0:De.TV)||(null==De?void 0:De.gigaSpeed)||(null==De?void 0:De.Netflix))&&Array.isArray(Ut)&&3===(null===(dl=null===(nl=null==Ut?void 0:Ut[0])||void 0===nl?void 0:nl.bundledOffers)||void 0===dl?void 0:dl.length)]);const li=()=>{((null==Qt?void 0:Qt.length)>0||It)&&Oo(!0)},oi=null===(al=null==fe?void 0:fe.productContainer)||void 0===al?void 0:al[0];n(()=>{xo&&(ke&&null==At?(Vo(!Uo),Qo(!Ko)):ke&&(null==At?void 0:At.siteId)&&Ht())},[xo]),n(()=>{var e;if(Lt){const{store:l}=Lt;(null===(e=null==l?void 0:l.ottOptionsApi)||void 0===e?void 0:e.length)>0&&0===(null==rt?void 0:rt.length)&&ct(null==l?void 0:l.ottOptionsApi)}},[Lt]),n(()=>{if(!wt||!(null==Et?void 0:Et.startTime)||!(null==Et?void 0:Et.endTime))return void Ct(!1);Ct(P(Et.startTime,Et.endTime));const e=T(Et.startTime,Et.endTime);if(e<=0)return;const l=setTimeout(()=>{Ct(P(Et.startTime,Et.endTime))},e);return()=>clearTimeout(l)},[wt,null==Et?void 0:Et.startTime,null==Et?void 0:Et.endTime]),n(()=>{var e;const l=mt.current;if(!l||!(null===(e=null==ae?void 0:ae.timer)||void 0===e?void 0:e.length)||!wt)return void ut(0);const o=()=>{ut(l.clientHeight)};if(o(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(o);return t.observe(l),()=>{t.disconnect()}},[null===(sl=null==ae?void 0:ae.timer)||void 0===sl?void 0:sl.length,wt]),n(()=>{nt&&(zt(),dt(!0),ti("false"),sessionStorage.removeItem("vasPopUp"),it(!1),Yt())},[nt]),n(()=>{const e=()=>{const e=sessionStorage.getItem("vasPopUp");it("true"===e)};e();const l=l=>{l.storageArea===sessionStorage&&"vasPopUp"===l.key&&e(),l.storageArea===sessionStorage&&"vasPopUp"===l.key&&null===l.newValue&&it(!1)},o=()=>{e()};return window.addEventListener("storage",l),window.addEventListener("vasPopUpChange",o),()=>{window.removeEventListener("storage",l),window.removeEventListener("vasPopUpChange",o)}},[]);const ti=e=>{sessionStorage.setItem("vasPopUp",e);const l=new Event("vasPopUpChange");window.dispatchEvent(l)};return l.createElement("div",null,Eo&&gt&&a(l.createElement(d,{keyParams:"loading"}),gt),ft&&l.createElement("div",{className:"w-75 pb-2"},l.createElement(s,null)),!ft&&be&&ae&&he&&!$t&&l.createElement("div",{className:r.selected},l.createElement("span",{style:{paddingBottom:"10px"}},Nt?l.createElement("span",{className:r.activeicon},l.createElement("img",{src:`${xt}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:r.activeicon}),l.createElement("span",null,null==ge?void 0:ge.subscriptionAvalTxt)):l.createElement("span",{className:r.inactiveicon},l.createElement("img",{src:`${xt}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:r.inactiveicon}),l.createElement("span",null,null==ge?void 0:ge.notSubscriptionTxt)))),l.createElement("div",{className:`${!$t&&!1===Nt&&(null===(rl=null==fe?void 0:fe.linecheckData)||void 0===rl?void 0:rl.length)>0&&"global/coverage-check"!==(null===(ul=null===(vl=null===(cl=null==fe?void 0:fe.linecheckData)||void 0===cl?void 0:cl[0])||void 0===vl?void 0:vl.reference)||void 0===ul?void 0:ul.default_full_slug)?r.overlay:""}\n ${Ve&&!(null===(pl=null===(ml=null==Ut?void 0:Ut[0])||void 0===ml?void 0:ml.eligibility)||void 0===pl?void 0:pl.fpb)?r.disabled:""}\n `,style:{flexDirection:"column"}},l.createElement("div",{className:r.bundleproductcard},l.createElement("div",{id:`timer-section${ue}${pe}`,"data-timer-active":vt>0?"true":"false"},(null===(gl=null==ae?void 0:ae.timer)||void 0===gl?void 0:gl.length)&&wt?l.createElement("div",{style:{height:`${vt}px`,transition:"height 0.3s ease"}}):null),l.createElement("div",{className:`${r.productcontainer} ${St?r.highlightBorder:""}`},St&&l.createElement("div",{className:`${r.highlightText}`},null==ae?void 0:ae.highlightText),yt&&l.createElement("div",{className:`${r.promocontainer}`,style:{background:null==bt?void 0:bt.bestSellerColor}},null==bt?void 0:bt.displayText),l.createElement("div",{ref:mt,className:r.timerContainer},(null===(fl=null==ae?void 0:ae.timer)||void 0===fl?void 0:fl.length)&&wt?l.createElement(de,{content:null===(hl=null==ae?void 0:ae.timer)||void 0===hl?void 0:hl[0],hasHighlightText:St||yt,onTimerChange:e=>{Ct(e)}}):null),l.createElement("div",{className:`${r.detailsection} ${r.imageFullWidthSection}`,id:`detailsectionv3${ue}${pe}`},l.createElement("div",{className:`${r.headersection}`},l.createElement("div",{className:`${r.titlesection}`},l.createElement("div",{className:`${r.productheader}`,id:`titleV3${ue}${pe}`},null==ht?void 0:ht.productName),l.createElement("div",null,(null===(bl=null==ht?void 0:ht.icon)||void 0===bl?void 0:bl.filename)&&l.createElement("img",{className:`${r.imagecontainer}`,src:null===(El=null==ht?void 0:ht.icon)||void 0===El?void 0:El.filename,height:15,width:20,alt:"productIcon"}))),l.createElement("div",{className:`${r.productdescription}`,id:`descriptionV3${ue}${pe}`},l.createElement(c,{content:null==ht?void 0:ht.description})),l.createElement("div",{className:`${r.images}`},(null===(wl=null==ht?void 0:ht.img)||void 0===wl?void 0:wl.filename)&&l.createElement("img",{className:`${r.imagespace} ${(null==ae?void 0:ae.highlightText)&&r.borderimage}`,alt:"cardimg",src:`${null===(Pl=null==ht?void 0:ht.img)||void 0===Pl?void 0:Pl.filename}/m/`}))),l.createElement("div",{className:`${r.productconfig}`,id:`product-configv3${ue}${pe}`},ft?l.createElement(l.Fragment,null,l.createElement("div",{className:r.space}),l.createElement(s,{stylename:r.skeletontittle,count:1}),l.createElement(s,{stylename:r.skeletonline,count:5}),l.createElement("div",{className:r.space}),l.createElement(s,{stylename:r.skeletontittle,count:1}),l.createElement(s,{stylename:r.skeletonline,count:5})):l.createElement("div",null,(null==ht?void 0:ht.bloks)&&(null===(Cl=null==ht?void 0:ht.bloks)||void 0===Cl?void 0:Cl.map((e,o)=>l.createElement(v,{content:e,indexKey:o,constants:ge,key:o,showModalPopup:li,setToggleState:$e,toggleState:De,noTabs:Le,mainContent:fe,enableTVStreamingOptions:null==ae?void 0:ae.enableTVStreamingOptions,metadata:ve,setTvOptionsData:Vt})))))),l.createElement("div",{className:`${r.detailsection}`,id:`benefits-price-section${ue}${pe}`},l.createElement("div",{id:`exclusive-benefits-section${ue}${pe}`},(null===(Sl=null==ht?void 0:ht.extraBenefits)||void 0===Sl?void 0:Sl.length)>0&&l.createElement(oe,{content:null===(yl=null==ht?void 0:ht.extraBenefits)||void 0===yl?void 0:yl[0]})),l.createElement("div",{className:`${r.benefitssection}`,id:`benefits-section${ue}${pe}`},(null===(kl=null==ht?void 0:ht.benefits)||void 0===kl?void 0:kl.length)>0&&l.createElement(u,{content:null==ht?void 0:ht.benefits,benefitData:ei,constants:ge,pricesToggleState:Me,togglePriceLabel:null==Fe?void 0:Fe.togglePriceLabel})),l.createElement("br",null),l.createElement("div",{className:`${r.giftsection}`,id:`gift-section${ue}${pe}`},(null==So?void 0:So.showGift)&&(null===(Tl=null==bt?void 0:bt.singleGift)||void 0===Tl?void 0:Tl.map((e,o)=>l.createElement(L,{content:e,key:o}))),(null==So?void 0:So.showGift)&&(null===(xl=null==bt?void 0:bt.giftConfig)||void 0===xl?void 0:xl.map((e,o)=>l.createElement(N,{content:e,key:o,selectedGiftItem:Rt,parentPoType:$t?"MOBILE":"HOME"}))),l.createElement("div",{className:`${r.giftsection}`,id:`cashback-section${ue}${pe}`},l.createElement(j,{uniqueProductData:Ut,mainContent:fe}))),l.createElement("div",{className:`${r.ordersection}`,id:`order-section${ue}${pe}`},""===(null==ei?void 0:ei.base)?l.createElement("div",null,l.createElement(s,{stylename:r.skeletontittle})):l.createElement("div",{id:`price-section${ue}${pe}`},l.createElement(m,{priceCollection:ei,constants:ge,promoText:null==ht?void 0:ht.promoText,deviceFlow:Ne,content:ae,offeringData:se,uniqueId:re})),!Re&&l.createElement("div",{className:`${r.discountedpricetoggleSection}`,id:`discountedpricetoggle-section${ue}${pe}`},Ot||"INLINE"!==(null==Fe?void 0:Fe.togglePosition)?null:l.createElement(te,{content:ht,index:pe,lineTable:!0,toggleContent:Fe})),ke&&(null==ge?void 0:ge.P2PDiscountLabel)&&l.createElement("div",{className:r.longterm},null==ge?void 0:ge.P2PDiscountLabel),ft?l.createElement(l.Fragment,null,l.createElement(s,{stylename:r.skeletontittle,count:1}),l.createElement(s,{stylename:r.skeletonline,count:2})):l.createElement("div",{className:`${(null==ce?void 0:ce.swapButton)&&r.swapButton}`},l.createElement("div",{style:{padding:"16px 0 0 0"}},l.createElement(p,{isMobileFlow:$t,createCartCall:(null==Ne?void 0:Ne.isDeviceFlow)?e=>{Co(!1);Ie({setShowLoader:wo,cartEndPoint:Tt,giftItem:Do,uniqueProductData:Ut,mainContent:fe,showPrice:ei,isMobileFlow:$t,eligibleBundle:be,address:he,setShowLinecheck:Ao,showLinecheck:jo,lineCheckCallBack:Te,enableP2P:ke,msisdnn:null!=Gt?Gt:e,content:ae,selectedRP:Be,continueCart:Oe})}:$t?Mt:Zt,constants:ge,storyContent:ce,showPrice:ei,isAvailable:Nt,address:he,uniqueProductBenefits:null==Ut?void 0:Ut[0],alwaysActive:!Nt&&(null===($l=null==fe?void 0:fe.linecheckData)||void 0===$l?void 0:$l.length)>0&&"global/coverage-check"===(null===(Nl=null===(Ll=null===(Dl=null==fe?void 0:fe.linecheckData)||void 0===Dl?void 0:Dl[0])||void 0===Ll?void 0:Ll.reference)||void 0===Nl?void 0:Nl.default_full_slug),flexUpgradeFreePopup:null===(Bl=null===(Il=null==fe?void 0:fe.flexUpgradeFreePopup)||void 0===Il?void 0:Il.reference)||void 0===Bl?void 0:Bl.content,content:ae,deviceUltimateBundle:Ve,forceDisabled:Boolean(null===(jl=null===(Ol=null==Ut?void 0:Ut[0])||void 0===Ol?void 0:Ol.rewards)||void 0===jl?void 0:jl.notEligibileReason),notEligibileReason:null===(Ul=null===(Al=null==Ut?void 0:Ut[0])||void 0===Al?void 0:Al.rewards)||void 0===Ul?void 0:Ul.notEligibileReason})),!Re&&(null===(Vl=null==ce?void 0:ce.addSmartPhone)||void 0===Vl?void 0:Vl.length)>0&&!(null==Ne?void 0:Ne.isDeviceFlow)&&l.createElement("div",{style:{textAlign:"center"}},(null==ce?void 0:ce.swapButton)?(null==ce?void 0:ce.ctaLabel)&&l.createElement("div",{style:{padding:"16px 0"}},l.createElement("button",{className:"primarybutton",onClick:()=>D(ei,ce,Ut,"",ae,Ae)},l.createElement("span",{className:r.buttontext},null==ce?void 0:ce.ctaLabel))):!(null==ae?void 0:ae.redirectOnly)&&l.createElement("div",{style:{padding:"12px 0 0 0"}},l.createElement(ie,{content:{buttonType:"Secondary-V1",buttonLabel:(null==ae?void 0:ae.ultimateBundlePromotion)?null==ge?void 0:ge.ultimateBundleLbl:null===(Ml=null===(Fl=null==ce?void 0:ce.addSmartPhone)||void 0===Fl?void 0:Fl[0])||void 0===Ml?void 0:Ml.buttonLabel,buttonIcon:null===(_l=null===(Rl=null==ce?void 0:ce.addSmartPhone)||void 0===Rl?void 0:Rl[0])||void 0===_l?void 0:_l.buttonIcon,buttonAlignment:"left"},wafIdentifier:Ce,style:{width:"100%"},onClick:()=>ke?void $o(!0):D(ei,ce,Ut,"",ae,Ae)}))),l.createElement("div",{className:r.productcontractduration,id:`contract-section${ue}${pe}`,style:{paddingTop:(null===(Gl=null==ce?void 0:ce.addSmartPhone)||void 0===Gl?void 0:Gl.length)>0&&!(null==Ne?void 0:Ne.isDeviceFlow)&&!(null==ce?void 0:ce.swapButton)&&!(null==ae?void 0:ae.redirectOnly)?"8px":void 0}},(null==ei?void 0:ei.contractDuration)>"1"?B(null===(Jl=null==ge?void 0:ge.minContractDuration)||void 0===Jl?void 0:Jl.substring(1),[null==ei?void 0:ei.contractDuration]):null==ge?void 0:ge.noContractDuration)),l.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(ql=null==ht?void 0:ht.productDetails)||void 0===ql?void 0:ql.length)>0&&l.createElement("span",{className:r.productdetailslink,onClick:()=>{var e,l,o;Co(!Po),A(V,R,X(Ut,"",M));const t=localStorage.getItem("prospectId"),i=null!==(o=null===(l=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname)||void 0===l?void 0:l.split("/"))&&void 0!==o?o:[],n=i[i.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"ProductDetails",pageLocation:n,targetProduct:kt};t&&z(pt,d,t)}},null==ge?void 0:ge.productDetailsLink)),Po&&l.createElement(g,{content:null==ht?void 0:ht.productDetails,showProductDetail:Po,setShowProductDetail:Co,constants:ge,showPrice:ei,isMobileFlow:$t,createCartCall:$t?Mt:Zt,storyContent:ce,isAvailable:Nt,address:he,flexUpgradeFreePopup:null===(Wl=null===(Hl=null==fe?void 0:fe.flexUpgradeFreePopup)||void 0===Hl?void 0:Hl.reference)||void 0===Wl?void 0:Wl.content})))))),Ve&&Ut&&!(null===(Kl=null===(zl=null==Ut?void 0:Ut[0])||void 0===zl?void 0:zl.eligibility)||void 0===Kl?void 0:Kl.fpb)&&l.createElement("div",{className:r.disabledInfo},l.createElement(c,{content:null==ge?void 0:ge.fpbNotCompatibleText})),Bo&&(ft?l.createElement(s,null):l.createElement(_,{content:null==Qt?void 0:Qt[0],setShowModal:Oo,showModal:Bo,constants:ge})),No&&(null===(Ql=null==fe?void 0:fe.loginData)||void 0===Ql?void 0:Ql.length)>0&&gt&&a(l.createElement(w,{content:null===(Xl=null==fe?void 0:fe.loginData)||void 0===Xl?void 0:Xl[0],closeLogin:()=>{Io(!1)},metadata:ve,onSuccess:()=>{Io(!1),ye(),sessionStorage.removeItem("vasPopUp"),it(!1),ke?Ht():Zt()},isProdEnv:Ue}),gt),Uo&&ke&&!No&&Ko&&l.createElement(H,{modalState:ko,handler:Wt,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},l.createElement(q,{onClose:Ft,content:null===(eo=null===(Zl=null===(Yl=null==fe?void 0:fe.productContainer)||void 0===Yl?void 0:Yl[0])||void 0===Zl?void 0:Zl.p2pBloks)||void 0===eo?void 0:eo[0],prepaid:!1})),ke&&Wo&&Ro&&Ko&&l.createElement(H,{modalState:ko,handler:Wt,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px",id:"table-product"},l.createElement(q,{onClose:Ft,content:null===(to=null===(oo=null===(lo=null==fe?void 0:fe.productContainer)||void 0===lo?void 0:lo[0])||void 0===oo?void 0:oo.p2pBloks)||void 0===to?void 0:to[1],prepaid:!0})),(null==qo?void 0:qo.length)>1&&ke&&Wo&&!Ro&&Xo&&l.createElement(H,{modalState:Xo,handler:()=>{wo(!1),Yo(!Xo)},showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},l.createElement(Q,{onSubmit:e=>{Yo(!Xo),xo?D(ei,ce,Ut,e,ae,Ae):Zt(null==e?void 0:e.msisdn)},exsistingSubscriptionData:qo,updatedContent:oi})),jo&&(null==fe?void 0:fe.enableLinecheckOverlay)&&!$t&&(null===(io=null==fe?void 0:fe.linecheckData)||void 0===io?void 0:io.length)>0&&!ke&&"global/new-linecheck-test"===(null===(so=null===(ao=null===(no=null==fe?void 0:fe.linecheckData)||void 0===no?void 0:no[0])||void 0===ao?void 0:ao.reference)||void 0===so?void 0:so.default_full_slug)?l.createElement(G,{content:null===(ro=null==fe?void 0:fe.linecheckData)||void 0===ro?void 0:ro[0],onSuccess:Kt,showModal:jo,setShowModal:Ao,productName:null==ht?void 0:ht.productName,productId:null==ht?void 0:ht.productId}):jo&&(null==fe?void 0:fe.enableLinecheckOverlay)&&!$t&&(null===(co=null==fe?void 0:fe.linecheckData)||void 0===co?void 0:co.length)>0&&!ke&&"global/coverage-check"===(null===(mo=null===(uo=null===(vo=null==fe?void 0:fe.linecheckData)||void 0===vo?void 0:vo[0])||void 0===uo?void 0:uo.reference)||void 0===mo?void 0:mo.default_full_slug)?l.createElement(Y,{content:null===(po=null==fe?void 0:fe.linecheckData)||void 0===po?void 0:po[0].reference.content.body[0],overlayIsOpen:!0,externalHandleModal:Ao,productName:null==ht?void 0:ht.productName,showModal:jo,setShowModal:Ao,onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");be=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),he="undefined"!=typeof window&&b.get("chAddressJson"),"function"==typeof Ee&&Ee()},onCreateCart:Kt,lineCheckOnClear:je,productId:null==ht?void 0:ht.productId}):null,Fo&&$t&&(null===(go=null==ce?void 0:ce.benefitsValidate)||void 0===go?void 0:go.length)>0&&l.createElement(J,{content:null===(fo=null==ce?void 0:ce.benefitsValidate)||void 0===fo?void 0:fo[0],loginContent:null===(ho=null==fe?void 0:fe.loginData)||void 0===ho?void 0:ho[0],metadata:ve,createCartCall:Zt,fetchOfferData:Pe,basicConfigUrl:Ce,selectedExistingOption:Se,setShowBenefit:Mo,setLoginSuccess:ye,isProdEnv:Ue}),lt&&l.createElement(H,{modalState:lt,handler:zt,showFooter:!1,width:"mobile"===Dt?"":"tablet"===Dt?"700px":"990px",fixedWidth:"mobile"===Dt?"":"tablet"===Dt?"700px":"990px",height:"845px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"24px"},l.createElement(le,{content:null===(bo=null==fe?void 0:fe.optionsPopup)||void 0===bo?void 0:bo[0],addOptionsCallBack:e=>{st(!0),dt(!0),Vt(e)},metadata:ve,constants:ge,mainContent:fe,preSelectedOptions:[],optionsResponse:rt,updateResponseList:ct,showPrice:ei,productData:ht,offeringData:se,uniqueId:re,deviceFlow:Ne})))};export{ae as default};
1
+ import{__awaiter as e}from"../../_virtual/_tslib.js";import o,{useState as l,useRef as t,useContext as i,useEffect as n}from"react";import d from"../Dotloader/Dotloader.js";import{createPortal as a}from"react-dom";import s from"../SkeletonLoader/SkeletonLoader.js";import r from"./StaticLineTable.module.scss.js";import c from"../richtext.js";import v from"./StaticProductEntitlement.js";import u from"./StaticBenefit.js";import m from"./DynamicPriceSection.js";import p from"./CheckoutButton.js";import g from"./StaticProductDetails.js";import{LineTableBasicPropConfig as f,AssetPathPropConfig as h}from"../../services/LineTableBasicPropConfig.js";import b from"js-cookie";import{LoginBasicPropConfig as E}from"../../services/LoginBasicPropConfig.js";import w from"../login/LoginModalV2.js";import{isTimerActive as P,fetchServiceOptions as C,fetchPrice as S,findHeight as y,checkGiftOrCashback as k,getTimeUntilNextTimerEvent as T,staticCreateCart as x,combineWithVasOptions as $,combineWithSmartPhone as D}from"./Product.utils.js";import L from"../ProductDetailsV3/GiftConfigV2.js";import N from"../ProductDetailsV3/ChooseGiftV2.js";import{viewport as I,replacePlaceholder as B,getUtcTimestamp as O}from"../../utils/utils.js";import j from"./StaticProductCashback.js";import{trackNewDatalayerEvent as A}from"../../utils/AnalyticsUtils.js";import{CTABUTTONCLICK as U,GAEVENT as V,EXISTINGCUSTOMER as F,LINETABLE as M,DOWNLOADPRODUCT as R}from"../../Analytics/AnalyticsConstants.js";import _ from"./TVChannelModal.js";import G from"../LineCheckV3/LinecheckModal.js";import J from"../BenefitWrapper/BenefitsValidateWrapper.js";import q from"../PretoPost/PreToPostSubsPopup.js";import H from"../LineCheckV3/GenericModal.js";import{fetchSubscriptionData as W,trackPegaEvents as z,validateP2P as K}from"../../services/LineTableService.js";import Q from"./ExsistingSubscriptionModal.js";import{getEcomCartInfo as X}from"../../models/Analytics/items.js";import Y from"../NewLineCheck/CoverageCheckModal.js";import{API_BASE_BASEPOINT as Z}from"../../services/api-constants.js";import{AppContext as ee}from"./StaticLineTableStore/StaticLineTableProvider.js";import oe from"./OttServiceOptions/OttServiceOptionsSmallPopup.js";import le from"./StaticExclusiveBenefit.js";import te from"../UserLoggedPricesToggle/UserLoggedPricesToggle.js";import ie from"../FalconButtonV2/FalconButtonV2.js";import{ONE_ECOMMERCE_INTERNET_SUMMARY as ne}from"../../utils/constants.js";import de from"./StaticLineTabelTimer/StaticLineTabelTimer.js";const ae=({content:ae,offeringData:se,uniqueId:re,storyContent:ce,metadata:ve,tabIndex:ue,cardsLength:me,indexKey:pe,constants:ge,mainContent:fe,address:he,eligibleBundle:be,linecheckSuccessCallBack:Ee,selectedOption:we,fetchOfferData:Pe,basicConfigUrl:Ce,selectedExistingOption:Se,setLoginSuccess:ye,enableP2P:ke,lineCheckCallBack:Te,loginSuccess:xe,setToggleState:$e,toggleState:De,noTabs:Le,deviceFlow:Ne,deviceFlowCallBack:Ie,selectedRP:Be,continueCart:Oe,lineCheckOnClear:je,pegaIntegration:Ae,isProdEnv:Ue,deviceUltimateBundle:Ve,toggleContent:Fe,pricesToggleState:Me,isShogunFlow:Re})=>{var _e,Ge,Je,qe,He,We,ze,Ke,Qe,Xe,Ye,Ze,eo,oo,lo,to,io,no,ao,so,ro,co,vo,uo,mo,po,go,fo,ho,bo,Eo,wo,Po,Co,So,yo,ko,To,xo,$o,Do,Lo,No,Io,Bo,Oo,jo,Ao,Uo,Vo,Fo,Mo,Ro,_o,Go,Jo,qo,Ho,Wo,zo,Ko,Qo,Xo,Yo,Zo,el,ol,ll,tl,il,nl,dl,al,sl,rl,cl,vl,ul,ml,pl,gl,fl,hl,bl;const[El,wl]=l(!1),[Pl,Cl]=l(!1),[Sl,yl]=l({showGift:!1,cashbackAvailable:!1}),[kl,Tl]=l(!0),[xl,$l]=l(!1),[Dl,Ll]=l([]),[Nl,Il]=l(!1),[Bl,Ol]=l(!1),[jl,Al]=l(!1),[Ul,Vl]=l(!1),[Fl,Ml]=l(!1),[Rl,_l]=l(!1),Gl=`${Ce}inf/customer-management/subscriptions`,Jl=`${Ce}inf/resource-management/msisdns/pretopost/validation`,[ql,Hl]=l([]),[Wl,zl]=l(!1),[Kl,Ql]=l(!1),[Xl,Yl]=l(!1),[Zl,et]=l([]),[ot,lt]=l(!1),[tt,it]=l(!1),[nt,dt]=l(!1),[at,st]=l(!1),[rt,ct]=l([]),[vt,ut]=l(0),mt=t(null),pt=`${Ce}inf/${Z.CUSTOMER}`,gt=void 0!==typeof window&&document.getElementById("static-linetable"),ft=0===(null===(_e=Object.keys(ae))||void 0===_e?void 0:_e.length),ht=null===(We=null===(He=null===(qe=null===(Je=null===(Ge=null==ae?void 0:ae.products)||void 0===Ge?void 0:Ge[0])||void 0===Je?void 0:Je.reference)||void 0===qe?void 0:qe.content)||void 0===He?void 0:He.product)||void 0===We?void 0:We[0],bt=null===(Ye=null===(Xe=null===(Qe=null===(Ke=null===(ze=null==ae?void 0:ae.promotion)||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.promoDescription)||void 0===Ye?void 0:Ye[0],Et=null===(Ze=null==ae?void 0:ae.timer)||void 0===Ze?void 0:Ze[0],wt=null==Et?void 0:Et.enableCounter,[Pt,Ct]=l(!!(wt&&(null==Et?void 0:Et.startTime)&&(null==Et?void 0:Et.endTime))&&P(Et.startTime,Et.endTime)),St=Boolean((null==ae?void 0:ae.highlightText)&&!0!==Me&&!Pt),yt=Boolean((null==bt?void 0:bt.displayText)&&!(null==ae?void 0:ae.notShowPromotionLabel)&&!0!==Me&&!Pt),kt=null==ht?void 0:ht.productId,Tt=null===(eo=null==f?void 0:f.getInstance())||void 0===eo?void 0:eo.getCartUrl(),xt=null===(oo=null==h?void 0:h.getInstance())||void 0===oo?void 0:oo.getAssetPath(),$t="MOBILE"===(null==ce?void 0:ce.pageType),Dt=I(),Lt=i(ee);let Nt;Nt=he&&(null===(lo=null==be?void 0:be.eligibleBundle)||void 0===lo?void 0:lo.includes(kt));const It=null==ae?void 0:ae.enableTVStreamingOptionsPopUp,Bt=null==ae?void 0:ae.enableTVStreamingOptionsStepper,Ot=null==ae?void 0:ae.disableDiscountedPriceToggle,jt=null==ae?void 0:ae.skipAccessoriesPage;E.create({baseURL:null!=Ce?Ce:""});let At=void 0!==typeof window&&b.get("sunriseAuth");At=At&&JSON.parse(At);const Ut=((null==se?void 0:se[re])||[]).filter(e=>(null==e?void 0:e.id)===kt),Vt=e=>{et(e)},Ft=()=>{Il(!0),Vl(!Ul),Ql(!Kl)},Mt=()=>{var e,o,l;if(Cl(!1),ke&&null==At)Vl(!Ul),Ql(!Kl);else if(ke&&(null==At?void 0:At.siteId))Ht();else if(we===F&&(null==Se?void 0:Se.length)>0)Ml(!0);else{!!((null==fe?void 0:fe.enableExistingCustomer)&&null==At||!At&&!0===Me&&(null==Fe?void 0:Fe.enableLoggedInPrice))?Il(!0):Zt()}if(Ae){const t=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:[],n=i[i.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"CartCreated",pageLocation:n,targetProduct:kt};t&&z(pt,d,t)}},Rt=e=>{const o=Dl.findIndex(o=>(null==e?void 0:e.giftGroupId)===(null==o?void 0:o.giftGroupId)),l=Dl;-1===o?l.push(e):l[o]=e,Ll([...l])},_t=new URLSearchParams(null===(to=null===window||void 0===window?void 0:window.location)||void 0===to?void 0:to.search),Gt=null==_t?void 0:_t.get("selectedMsisdn"),Jt=e=>{var o;1===(null==e?void 0:e.length)?(xl?D(ei,ce,Ut,null==e?void 0:e[0],ae,Ae):Zt(null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.msisdn),_l(!1)):(null==e?void 0:e.length)>1?(Hl(e),Yl(!Xl),_l(!1)):(Ql(!Kl),_l(!0),Tl(!0),wl(!1))},qt=(o,l)=>e(void 0,void 0,void 0,function*(){yield K(null==o?void 0:o.msisdn,Jl).then(e=>{e&&l.push(o)}).catch(e=>{console.log("error",e)})}),Ht=()=>{var o;wl(!0);try{null===(o=W("PREPAID",Gl))||void 0===o||o.then(o=>e(void 0,void 0,void 0,function*(){if(204==(null==o?void 0:o.subscriptionData))Ql(!Kl),_l(!0),Tl(!0),wl(!1);else{const l=null==o?void 0:o.subscriptionData,t=l.find(e=>e.msisdn===Gt);if(l){const o=[];Gt?(yield qt(t,o),Jt(o)):yield Promise.all(null==l?void 0:l.map(l=>e(void 0,void 0,void 0,function*(){yield qt(l,o)}))).then(e=>{Jt(o)})}}})).catch(e=>{console.log("error---\x3e",e),wl(!1)})}catch(e){console.log("error---\x3e",e),wl(!1)}zl(!0)},Wt=()=>{Ql(!kl),Vl(!1)},zt=e=>{lt(!1),e&&A(V,U,{headline:"VAS POPUP CLOSE"})},Kt=()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");be=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),he="undefined"!=typeof window&&b.get("chAddressJson"),Al(!jl),"function"==typeof Ee&&Ee(),Zt()},Qt=C(null==ht?void 0:ht.bloks,$t),Xt=null===(io=null==Qt?void 0:Qt[0])||void 0===io?void 0:io.tvProductId,Yt=e=>{var o,l,t,i,n,d,a,s;const r=Ae&&(null===(t=null===(l=null===(o=null==Ut?void 0:Ut[0])||void 0===o?void 0:o.promotionInfo)||void 0===l?void 0:l[0])||void 0===t?void 0:t.id),c=Ae&&(null===(d=null===(n=null===(i=null==Ut?void 0:Ut[0])||void 0===i?void 0:i.promotionInfo)||void 0===n?void 0:n[0])||void 0===d?void 0:d.version),v=Re?{pointsBurnt:null===(s=null===(a=null==Ut?void 0:Ut[0])||void 0===a?void 0:a.rewards)||void 0===s?void 0:s.points}:void 0;Ut&&Ut[0]&&(Ut[0].fromPopup=at),ti("false"),sessionStorage.removeItem("vasPopUp"),it(!1),x(wl,Tt,Dl,Ut,fe,ei,$t,Xt,be,he,Al,jl,Te,ke,null!=Gt?Gt:e,ae,Zl,r,c,v)},Zt=e=>{var o,l,t,i,n,d,a,s,r;st(!1),Cl(!1);let c=void 0!==typeof window&&b.get("sunriseAuth");const v=c&&JSON.parse(c),u=!(!(null==fe?void 0:fe.enableExistingCustomer)||null!=v);if(sessionStorage.removeItem(ne),(null===(o=null==fe?void 0:fe.linecheckData)||void 0===o?void 0:o.length)>0&&!$t&&!Nt){return void(document.getElementById("linecheck")&&Te())}if(Nt&&!$t&&(null===(l=null==fe?void 0:fe.loginData)||void 0===l?void 0:l.length)>0&&u)Il(!0);else if(Bt&&(null===(t=Ut[0])||void 0===t?void 0:t.isBundle)){let o=!1;jt||((null===(i=Ut[0])||void 0===i?void 0:i.isBundle)?null===(d=null===(n=Ut[0])||void 0===n?void 0:n.bundledOffers)||void 0===d||d.map(e=>{var l,t,i;"internet"!==(null===(l=null==e?void 0:e.productType)||void 0===l?void 0:l.toLowerCase())&&"tv"!=(null===(t=null==e?void 0:e.productType)||void 0===t?void 0:t.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==Ut?void 0:Ut[0])||void 0===a?void 0:a.recommendAccessory)&&(o=null===(s=null==Ut?void 0:Ut[0])||void 0===s?void 0:s.recommendAccessory)),$(ei,Ut,ae,Ae,null==ht?void 0:ht.productName,o),Yt(e)}else It&&(null===(r=Ut[0])||void 0===r?void 0:r.isBundle)&&!tt?(lt(!0),it(!0),ti("true"),window.addEventListener("beforeunload",function(e){ti("false"),sessionStorage.removeItem("vasPopUp"),it(!1)})):(ke&&wl(!0),Yt(e))},ei=S(Ut,$t,null==fe?void 0:fe.pageType,!1,Zl,Ae);n(()=>{var e,o;setTimeout(()=>{y(ue,me)},100);const l=k($t?Ut:null!==(o=null===(e=null==Ut?void 0:Ut[0])||void 0===e?void 0:e.bundledOffers)&&void 0!==o?o:Ut);yl(Object.assign({},l))},[se,De,Zl,vt,((null==De?void 0:De.TV)||(null==De?void 0:De.gigaSpeed)||(null==De?void 0:De.Netflix))&&Array.isArray(Ut)&&3===(null===(ao=null===(no=null==Ut?void 0:Ut[0])||void 0===no?void 0:no.bundledOffers)||void 0===ao?void 0:ao.length)]);const oi=()=>{((null==Qt?void 0:Qt.length)>0||It)&&Ol(!0)},li=null===(so=null==fe?void 0:fe.productContainer)||void 0===so?void 0:so[0];n(()=>{xl&&(ke&&null==At?(Vl(!Ul),Ql(!Kl)):ke&&(null==At?void 0:At.siteId)&&Ht())},[xl]),n(()=>{var e;if(Lt){const{store:o}=Lt;(null===(e=null==o?void 0:o.ottOptionsApi)||void 0===e?void 0:e.length)>0&&0===(null==rt?void 0:rt.length)&&ct(null==o?void 0:o.ottOptionsApi)}},[Lt]),n(()=>{if(!wt||!(null==Et?void 0:Et.startTime)||!(null==Et?void 0:Et.endTime))return void Ct(!1);Ct(P(Et.startTime,Et.endTime));const e=T(Et.startTime,Et.endTime);if(e<=0)return;const o=setTimeout(()=>{Ct(P(Et.startTime,Et.endTime))},e);return()=>clearTimeout(o)},[wt,null==Et?void 0:Et.startTime,null==Et?void 0:Et.endTime]),n(()=>{var e;const o=mt.current;if(!o||!(null===(e=null==ae?void 0:ae.timer)||void 0===e?void 0:e.length)||!wt)return void ut(0);const l=()=>{ut(o.clientHeight)};if(l(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(l);return t.observe(o),()=>{t.disconnect()}},[null===(ro=null==ae?void 0:ae.timer)||void 0===ro?void 0:ro.length,wt]),n(()=>{nt&&(zt(),dt(!0),ti("false"),sessionStorage.removeItem("vasPopUp"),it(!1),Yt())},[nt]),n(()=>{const e=()=>{const e=sessionStorage.getItem("vasPopUp");it("true"===e)};e();const o=o=>{o.storageArea===sessionStorage&&"vasPopUp"===o.key&&e(),o.storageArea===sessionStorage&&"vasPopUp"===o.key&&null===o.newValue&&it(!1)},l=()=>{e()};return window.addEventListener("storage",o),window.addEventListener("vasPopUpChange",l),()=>{window.removeEventListener("storage",o),window.removeEventListener("vasPopUpChange",l)}},[]);const ti=e=>{sessionStorage.setItem("vasPopUp",e);const o=new Event("vasPopUpChange");window.dispatchEvent(o)};return o.createElement("div",null,El&&gt&&a(o.createElement(d,{keyParams:"loading"}),gt),ft&&o.createElement("div",{className:"w-75 pb-2"},o.createElement(s,null)),!ft&&be&&ae&&he&&!$t&&o.createElement("div",{className:r.selected},o.createElement("span",{style:{paddingBottom:"10px"}},Nt?o.createElement("span",{className:r.activeicon},o.createElement("img",{src:`${xt}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:r.activeicon}),o.createElement("span",null,null==ge?void 0:ge.subscriptionAvalTxt)):o.createElement("span",{className:r.inactiveicon},o.createElement("img",{src:`${xt}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:r.inactiveicon}),o.createElement("span",null,null==ge?void 0:ge.notSubscriptionTxt)))),o.createElement("div",{className:`${!$t&&!1===Nt&&(null===(co=null==fe?void 0:fe.linecheckData)||void 0===co?void 0:co.length)>0&&"global/coverage-check"!==(null===(mo=null===(uo=null===(vo=null==fe?void 0:fe.linecheckData)||void 0===vo?void 0:vo[0])||void 0===uo?void 0:uo.reference)||void 0===mo?void 0:mo.default_full_slug)?r.overlay:""}\n ${Ve&&!(null===(go=null===(po=null==Ut?void 0:Ut[0])||void 0===po?void 0:po.eligibility)||void 0===go?void 0:go.fpb)?r.disabled:""}\n `,style:{flexDirection:"column"}},o.createElement("div",{className:r.bundleproductcard},o.createElement("div",{id:`timer-section${ue}${pe}`,"data-timer-active":vt>0?"true":"false"},(null===(fo=null==ae?void 0:ae.timer)||void 0===fo?void 0:fo.length)&&wt?o.createElement("div",{style:{height:`${vt}px`,transition:"height 0.3s ease"}}):null),o.createElement("div",{className:`${r.productcontainer} ${St?r.highlightBorder:""}`},St&&o.createElement("div",{className:`${r.highlightText}`},null==ae?void 0:ae.highlightText),yt&&o.createElement("div",{className:`${r.promocontainer}`,style:{background:null==bt?void 0:bt.bestSellerColor}},null==bt?void 0:bt.displayText),o.createElement("div",{ref:mt,className:r.timerContainer},(null===(ho=null==ae?void 0:ae.timer)||void 0===ho?void 0:ho.length)&&wt?o.createElement(de,{content:null===(bo=null==ae?void 0:ae.timer)||void 0===bo?void 0:bo[0],hasHighlightText:St||yt,onTimerChange:e=>{Ct(e)}}):null),o.createElement("div",{className:`${r.detailsection} ${r.imageFullWidthSection}`,id:`detailsectionv3${ue}${pe}`},o.createElement("div",{className:`${r.headersection}`},o.createElement("div",{className:`${r.titlesection}`},o.createElement("div",{className:`${r.productheader}`,id:`titleV3${ue}${pe}`},null==ht?void 0:ht.productName),o.createElement("div",null,(null===(Eo=null==ht?void 0:ht.icon)||void 0===Eo?void 0:Eo.filename)&&o.createElement("img",{className:`${r.imagecontainer}`,src:null===(wo=null==ht?void 0:ht.icon)||void 0===wo?void 0:wo.filename,height:15,width:20,alt:"productIcon"}))),o.createElement("div",{className:`${r.productdescription}`,id:`descriptionV3${ue}${pe}`},o.createElement(c,{content:null==ht?void 0:ht.description})),o.createElement("div",{className:`${r.images}`},(null===(Po=null==ht?void 0:ht.img)||void 0===Po?void 0:Po.filename)&&o.createElement("img",{className:`${r.imagespace} ${(null==ae?void 0:ae.highlightText)&&r.borderimage}`,alt:"cardimg",src:`${null===(Co=null==ht?void 0:ht.img)||void 0===Co?void 0:Co.filename}/m/`}))),o.createElement("div",{className:`${r.productconfig}`,id:`product-configv3${ue}${pe}`},ft?o.createElement(o.Fragment,null,o.createElement("div",{className:r.space}),o.createElement(s,{stylename:r.skeletontittle,count:1}),o.createElement(s,{stylename:r.skeletonline,count:5}),o.createElement("div",{className:r.space}),o.createElement(s,{stylename:r.skeletontittle,count:1}),o.createElement(s,{stylename:r.skeletonline,count:5})):o.createElement("div",null,(null==ht?void 0:ht.bloks)&&(null===(So=null==ht?void 0:ht.bloks)||void 0===So?void 0:So.map((e,l)=>o.createElement(v,{content:e,indexKey:l,constants:ge,key:l,showModalPopup:oi,setToggleState:$e,toggleState:De,noTabs:Le,mainContent:fe,enableTVStreamingOptions:null==ae?void 0:ae.enableTVStreamingOptions,metadata:ve,setTvOptionsData:Vt})))))),o.createElement("div",{className:`${r.detailsection}`,id:`benefits-price-section${ue}${pe}`},o.createElement("div",{id:`exclusive-benefits-section${ue}${pe}`},(null===(yo=null==ht?void 0:ht.extraBenefits)||void 0===yo?void 0:yo.length)>0&&o.createElement(le,{content:null===(ko=null==ht?void 0:ht.extraBenefits)||void 0===ko?void 0:ko[0]})),o.createElement("div",{className:`${r.benefitssection}`,id:`benefits-section${ue}${pe}`},(null===(To=null==ht?void 0:ht.benefits)||void 0===To?void 0:To.length)>0&&o.createElement(u,{content:null==ht?void 0:ht.benefits,benefitData:ei,constants:ge,pricesToggleState:Me,togglePriceLabel:null==Fe?void 0:Fe.togglePriceLabel})),o.createElement("br",null),o.createElement("div",{className:`${r.giftsection}`,id:`gift-section${ue}${pe}`},(null==Sl?void 0:Sl.showGift)&&(null===(xo=null==bt?void 0:bt.singleGift)||void 0===xo?void 0:xo.map((e,l)=>o.createElement(L,{content:e,key:l}))),(null==Sl?void 0:Sl.showGift)&&(null===($o=null==bt?void 0:bt.giftConfig)||void 0===$o?void 0:$o.map((e,l)=>o.createElement(N,{content:e,key:l,selectedGiftItem:Rt,parentPoType:$t?"MOBILE":"HOME"}))),o.createElement("div",{className:`${r.giftsection}`,id:`cashback-section${ue}${pe}`},o.createElement(j,{uniqueProductData:Ut,mainContent:fe}))),o.createElement("div",{className:`${r.ordersection}`,id:`order-section${ue}${pe}`},""===(null==ei?void 0:ei.base)?o.createElement("div",null,o.createElement(s,{stylename:r.skeletontittle})):o.createElement("div",{id:`price-section${ue}${pe}`},o.createElement(m,{priceCollection:ei,constants:ge,promoText:null==ht?void 0:ht.promoText,deviceFlow:Ne,content:ae,offeringData:se,uniqueId:re})),!Re&&o.createElement("div",{className:`${r.discountedpricetoggleSection}`,id:`discountedpricetoggle-section${ue}${pe}`},Ot||"INLINE"!==(null==Fe?void 0:Fe.togglePosition)?null:o.createElement(te,{content:ht,index:pe,lineTable:!0,toggleContent:Fe})),ke&&(null==ge?void 0:ge.P2PDiscountLabel)&&o.createElement("div",{className:r.longterm},null==ge?void 0:ge.P2PDiscountLabel),ft?o.createElement(o.Fragment,null,o.createElement(s,{stylename:r.skeletontittle,count:1}),o.createElement(s,{stylename:r.skeletonline,count:2})):o.createElement("div",{className:`${(null==ce?void 0:ce.swapButton)&&r.swapButton}`},o.createElement("div",{style:{padding:"16px 0 0 0"}},o.createElement(p,{isMobileFlow:$t,createCartCall:(null==Ne?void 0:Ne.isDeviceFlow)?e=>{Cl(!1);Ie({setShowLoader:wl,cartEndPoint:Tt,giftItem:Dl,uniqueProductData:Ut,mainContent:fe,showPrice:ei,isMobileFlow:$t,eligibleBundle:be,address:he,setShowLinecheck:Al,showLinecheck:jl,lineCheckCallBack:Te,enableP2P:ke,msisdnn:null!=Gt?Gt:e,content:ae,selectedRP:Be,continueCart:Oe})}:$t?Mt:Zt,constants:ge,storyContent:ce,showPrice:ei,isAvailable:Nt,address:he,uniqueProductBenefits:null==Ut?void 0:Ut[0],alwaysActive:!Nt&&(null===(Do=null==fe?void 0:fe.linecheckData)||void 0===Do?void 0:Do.length)>0&&"global/coverage-check"===(null===(Io=null===(No=null===(Lo=null==fe?void 0:fe.linecheckData)||void 0===Lo?void 0:Lo[0])||void 0===No?void 0:No.reference)||void 0===Io?void 0:Io.default_full_slug),flexUpgradeFreePopup:null===(Oo=null===(Bo=null==fe?void 0:fe.flexUpgradeFreePopup)||void 0===Bo?void 0:Bo.reference)||void 0===Oo?void 0:Oo.content,content:ae,deviceUltimateBundle:Ve,forceDisabled:Boolean(null===(Ao=null===(jo=null==Ut?void 0:Ut[0])||void 0===jo?void 0:jo.rewards)||void 0===Ao?void 0:Ao.notEligibileReason),notEligibileReason:null===(Vo=null===(Uo=null==Ut?void 0:Ut[0])||void 0===Uo?void 0:Uo.rewards)||void 0===Vo?void 0:Vo.notEligibileReason})),!Re&&(null===(Fo=null==ce?void 0:ce.addSmartPhone)||void 0===Fo?void 0:Fo.length)>0&&!(null==Ne?void 0:Ne.isDeviceFlow)&&o.createElement("div",{style:{textAlign:"center"}},(null==ce?void 0:ce.swapButton)?(null==ce?void 0:ce.ctaLabel)&&o.createElement("div",{style:{padding:"16px 0"}},o.createElement("button",{className:"primarybutton",onClick:()=>D(ei,ce,Ut,"",ae,Ae)},o.createElement("span",{className:r.buttontext},null==ce?void 0:ce.ctaLabel))):!(null==ae?void 0:ae.redirectOnly)&&o.createElement("div",{style:{padding:"12px 0 0 0"}},o.createElement(ie,{content:{buttonType:"Secondary-V1",buttonLabel:(null==ae?void 0:ae.ultimateBundlePromotion)?null==ge?void 0:ge.ultimateBundleLbl:null===(Ro=null===(Mo=null==ce?void 0:ce.addSmartPhone)||void 0===Mo?void 0:Mo[0])||void 0===Ro?void 0:Ro.buttonLabel,buttonIcon:null===(Go=null===(_o=null==ce?void 0:ce.addSmartPhone)||void 0===_o?void 0:_o[0])||void 0===Go?void 0:Go.buttonIcon,buttonAlignment:"left"},wafIdentifier:Ce,style:{width:"100%"},onClick:()=>ke?void $l(!0):D(ei,ce,Ut,"",ae,Ae)}))),o.createElement("div",{className:r.productcontractduration,id:`contract-section${ue}${pe}`,style:{paddingTop:(null===(Jo=null==ce?void 0:ce.addSmartPhone)||void 0===Jo?void 0:Jo.length)>0&&!(null==Ne?void 0:Ne.isDeviceFlow)&&!(null==ce?void 0:ce.swapButton)&&!(null==ae?void 0:ae.redirectOnly)?"8px":void 0}},(null==ei?void 0:ei.contractDuration)>"1"?B(null===(qo=null==ge?void 0:ge.minContractDuration)||void 0===qo?void 0:qo.substring(1),[null==ei?void 0:ei.contractDuration]):null==ge?void 0:ge.noContractDuration)),o.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(Ho=null==ht?void 0:ht.productDetails)||void 0===Ho?void 0:Ho.length)>0&&o.createElement("span",{className:r.productdetailslink,onClick:()=>{var e,o,l;Cl(!Pl),A(V,R,X(Ut,"",M));const t=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:[],n=i[i.length-1],d={eventTimestamp:O(),eventType:"PageView",pageType:"ProductDetails",pageLocation:n,targetProduct:kt};t&&z(pt,d,t)}},null==ge?void 0:ge.productDetailsLink)),Pl&&o.createElement(g,{content:null==ht?void 0:ht.productDetails,showProductDetail:Pl,setShowProductDetail:Cl,constants:ge,showPrice:ei,isMobileFlow:$t,createCartCall:$t?Mt:Zt,storyContent:ce,isAvailable:Nt,address:he,flexUpgradeFreePopup:null===(zo=null===(Wo=null==fe?void 0:fe.flexUpgradeFreePopup)||void 0===Wo?void 0:Wo.reference)||void 0===zo?void 0:zo.content})))))),Ve&&Ut&&!(null===(Qo=null===(Ko=null==Ut?void 0:Ut[0])||void 0===Ko?void 0:Ko.eligibility)||void 0===Qo?void 0:Qo.fpb)&&o.createElement("div",{className:r.disabledInfo},o.createElement(c,{content:null==ge?void 0:ge.fpbNotCompatibleText})),Bl&&(ft?o.createElement(s,null):o.createElement(_,{content:null==Qt?void 0:Qt[0],setShowModal:Ol,showModal:Bl,constants:ge})),Nl&&(null===(Xo=null==fe?void 0:fe.loginData)||void 0===Xo?void 0:Xo.length)>0&&gt&&a(o.createElement(w,{content:null===(Yo=null==fe?void 0:fe.loginData)||void 0===Yo?void 0:Yo[0],closeLogin:()=>{Il(!1)},metadata:ve,onSuccess:()=>{Il(!1),ye(),sessionStorage.removeItem("vasPopUp"),it(!1),ke?Ht():Zt()},isProdEnv:Ue}),gt),Ul&&ke&&!Nl&&Kl&&o.createElement(H,{modalState:kl,handler:Wt,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(q,{onClose:Ft,content:null===(ol=null===(el=null===(Zo=null==fe?void 0:fe.productContainer)||void 0===Zo?void 0:Zo[0])||void 0===el?void 0:el.p2pBloks)||void 0===ol?void 0:ol[0],prepaid:!1})),ke&&Wl&&Rl&&Kl&&o.createElement(H,{modalState:kl,handler:Wt,showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px",id:"table-product"},o.createElement(q,{onClose:Ft,content:null===(il=null===(tl=null===(ll=null==fe?void 0:fe.productContainer)||void 0===ll?void 0:ll[0])||void 0===tl?void 0:tl.p2pBloks)||void 0===il?void 0:il[1],prepaid:!0})),(null==ql?void 0:ql.length)>1&&ke&&Wl&&!Rl&&Xl&&o.createElement(H,{modalState:Xl,handler:()=>{wl(!1),Yl(!Xl)},showFooter:!1,width:"628px",height:"280px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"16px"},o.createElement(Q,{onSubmit:e=>{Yl(!Xl),xl?D(ei,ce,Ut,e,ae,Ae):Zt(null==e?void 0:e.msisdn)},exsistingSubscriptionData:ql,updatedContent:li})),jl&&(null==fe?void 0:fe.enableLinecheckOverlay)&&!$t&&(null===(nl=null==fe?void 0:fe.linecheckData)||void 0===nl?void 0:nl.length)>0&&!ke&&"global/new-linecheck-test"===(null===(sl=null===(al=null===(dl=null==fe?void 0:fe.linecheckData)||void 0===dl?void 0:dl[0])||void 0===al?void 0:al.reference)||void 0===sl?void 0:sl.default_full_slug)?o.createElement(G,{content:null===(rl=null==fe?void 0:fe.linecheckData)||void 0===rl?void 0:rl[0],onSuccess:Kt,showModal:jl,setShowModal:Al,productName:null==ht?void 0:ht.productName,productId:null==ht?void 0:ht.productId}):jl&&(null==fe?void 0:fe.enableLinecheckOverlay)&&!$t&&(null===(cl=null==fe?void 0:fe.linecheckData)||void 0===cl?void 0:cl.length)>0&&!ke&&"global/coverage-check"===(null===(ml=null===(ul=null===(vl=null==fe?void 0:fe.linecheckData)||void 0===vl?void 0:vl[0])||void 0===ul?void 0:ul.reference)||void 0===ml?void 0:ml.default_full_slug)?o.createElement(Y,{content:null===(pl=null==fe?void 0:fe.linecheckData)||void 0===pl?void 0:pl[0].reference.content.body[0],overlayIsOpen:!0,externalHandleModal:Al,productName:null==ht?void 0:ht.productName,showModal:jl,setShowModal:Al,onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");be=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),he="undefined"!=typeof window&&b.get("chAddressJson"),"function"==typeof Ee&&Ee()},onCreateCart:Kt,lineCheckOnClear:je,productId:null==ht?void 0:ht.productId}):null,Fl&&$t&&(null===(gl=null==ce?void 0:ce.benefitsValidate)||void 0===gl?void 0:gl.length)>0&&o.createElement(J,{content:null===(fl=null==ce?void 0:ce.benefitsValidate)||void 0===fl?void 0:fl[0],loginContent:null===(hl=null==fe?void 0:fe.loginData)||void 0===hl?void 0:hl[0],metadata:ve,createCartCall:Zt,fetchOfferData:Pe,basicConfigUrl:Ce,selectedExistingOption:Se,setShowBenefit:Ml,setLoginSuccess:ye,isProdEnv:Ue}),ot&&o.createElement(H,{modalState:ot,handler:zt,showFooter:!1,width:"mobile"===Dt?"":"tablet"===Dt?"700px":"990px",fixedWidth:"mobile"===Dt?"":"tablet"===Dt?"700px":"990px",height:"845px",backgroundColor:"#f7f6f5",noCloseButton:!1,backDrop:!0,bodyPadding:"24px"},o.createElement(oe,{content:null===(bl=null==fe?void 0:fe.optionsPopup)||void 0===bl?void 0:bl[0],addOptionsCallBack:e=>{st(!0),dt(!0),Vt(e)},metadata:ve,constants:ge,mainContent:fe,preSelectedOptions:[],optionsResponse:rt,updateResponseList:ct,showPrice:ei,productData:ht,offeringData:se,uniqueId:re,deviceFlow:Ne})))};export{ae as default};
2
2
  //# sourceMappingURL=StaticProduct.js.map