PageSourceSearch

https://privati.vodafone.it/_next/static/chunks/6789-57d29642e0e18d4b.js

js vodafone.it collected 2026-09-24 08:38:59 UTC 475,501 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6789],{60784:function(e,i,n){n.d(i,{Z:function(){return eB}});var o,l,t,r,d=n(52322),a=n(2784),u=n(36506),s=n(68550),v=n(45867),c=n(86465),p=n(83756),m=n(88301),f=n(46776),g=n(82066);(o=t||(t={})).FALLBACK_ACCEPT="1",o.FALLBACK_CONTINUE="2",o.FALLBACK_CTC="3",o.FALLBACK_REDIRECT="4",(l=r||(r={})).OFFER_STEP="offerStep",l.DETAILS_STEP="detailsStep";var E=n(71804),h=n(82898),b=n(90401),y=n(67862),C=n(92603),_=n(28165),S=n(12153);function I(){let e=(0,y._)(["\n  b {\n    font-family: ",";\n    font-weight: ",";\n  }\n\n  img {\n    cursor: text;\n    vertical-align: baseline;\n  }\n\n  a {\n    color: ",";\n    font-weight: ",";\n\n    &:hover {\n      color: ",";\n    }\n  }\n\n  button {\n    font-family: ",";\n    font-weight: ",";\n    font-size: ",";\n    \n    color: ",";\n    background: none;\n    border: none;\n    padding: 0;\n    outline: inherit;\n\n    span {\n      font-family: ",";\n      font-weight: ",";\n      color: ","; \n      background-color: ",";\n      padding-left: ",";\n      padding-right: ",";\n      border-radius: 50%;\n      cursor: pointer;\n    }\n\n    &:hover {\n      span {\n        background-color: ",";\n      }\n    }\n\n    &:active {\n      span {\n        background-color: ",";\n      }\n    }\n  }\n"]);return I=function(){return e},e}function T(){let e=(0,y._)(["\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: ",";\n  margin-bottom: ",";\n"]);return T=function(){return e},e}function A(){let e=(0,y._)(["\n    div {\n      width: 300px;\n    }\n  "]);return A=function(){return e},e}function R(){let e=(0,y._)(["\n    flex-direction: row-reverse;\n    justify-content: center;\n  "]);return R=function(){return e},e}function L(){let e=(0,y._)(["\n  display: flex;\n  flex-direction: column;\n  gap: ",";\n  width: 100%;\n  max-width: 80%;\n  \n\n  ","\n\n  ","\n"]);return L=function(){return e},e}function N(){let e=(0,y._)(["\n  margin-top: ",";\n"]);return N=function(){return e},e}function O(){let e=(0,y._)(["\n  margin: 0;\n"]);return O=function(){return e},e}function x(){let e=(0,y._)(["\n    font-size:",";\n    line-height:",";\n  "]);return x=function(){return e},e}function P(){let e=(0,y._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size:",";\n  line-height:",";\n  color: ",";\n\n  ","\n"]);return P=function(){return e},e}function M(){let e=(0,y._)(["\n    margin-top: ",";\n\n    .rec {\n      font-size:",";\n      line-height:",";\n    }\n  "]);return M=function(){return e},e}function k(){let e=(0,y._)(["\n  .rec {\n    font-size:",";\n    line-height:",";\n  }\n\n  ","\n"]);return k=function(){return e},e}function D(){let e=(0,y._)(["\n    div {\n      margin: 0;\n      margin-top: ",";\n    }\n  "]);return D=function(){return e},e}function B(){let e=(0,y._)(["\n  div {\n    margin: 0;\n    margin-top: ",";\n    margin-bottom: ",";\n\n    p,\n    span {\n      font-size:",";\n      line-height:",";\n      color: ",";\n      margin:0;\n    }\n  }\n\n  ","\n"]);return B=function(){return e},e}function w(){let e=(0,y._)(["\n    margin-top: ",";\n    margin-bottom: ",";\n    font-size:",";\n    line-height:",";\n  "]);return w=function(){return e},e}function j(){let e=(0,y._)(["\n    margin-top: ",";\n    margin-bottom: ",";\n  "]);return j=function(){return e},e}function U(){let e=(0,y._)(["\n  ","\n  font-family: ",";\n  font-weight: ",";\n  font-size:",";\n  line-height:",";\n  color: ",";\n  text-transform: uppercase;\n  text-align: left;\n  margin-top: ",";\n  margin-bottom: ",";\n  ","\n  ","\n"]);return U=function(){return e},e}function F(){let e=(0,y._)(["\n  display: flex;\n  flex-direction: row;\n  flex: 1;\n  align-items: baseline;\n  justify-content: space-between;\n"]);return F=function(){return e},e}function G(){let e=(0,y._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size:",";\n  line-height:",";\n  color: ",";\n  text-transform: uppercase;\n"]);return G=function(){return e},e}function z(){let e=(0,y._)(["\n    margin-bottom: ",";\n  "]);return z=function(){return e},e}function V(){let e=(0,y._)(["\n    margin-bottom: ",";\n  "]);return V=function(){return e},e}function Y(){let e=(0,y._)(["\n  display: flex;\n  align-items: baseline;\n  margin: 0;\n  margin-bottom: ",";\n\n  div {\n    font-family: ",";\n    font-weight: ",";\n    font-size:",";\n    line-height:",";\n    color: ",";\n    margin: 0;\n\n    img {\n      width: ",";\n    }\n  }\n\n  svg {\n    margin-right: ",";\n    width: ",";\n  }\n\n  ","\n\n  ","\n"]);return Y=function(){return e},e}function H(){let e=(0,y._)(["\n  ","\n  font-family: ",";\n  font-weight: ",";\n  font-size:",";\n  line-height:",";
1\n  color: ",";\n  text-transform: uppercase;\n  text-align: left;\n  margin: "," "," "," ",";\n"]);return H=function(){return e},e}function Z(){let e=(0,y._)(["\n    div {\n      font-size:",";\n      line-height:",";\n    }\n  "]);return Z=function(){return e},e}function Q(){let e=(0,y._)(["\n  div {\n    margin: 0;\n    font-size:",";\n    line-height:",";\n  }\n\n  ","\n"]);return Q=function(){return e},e}function W(){let e=(0,y._)(["\n  ","\n  font-family: ",";\n  font-weight: ",";\n  font-size:",";\n  line-height:",";\n  color: ",";\n  text-transform: uppercase;\n  text-align: left;\n  margin: "," "," "," ",";\n"]);return W=function(){return e},e}function K(){let e=(0,y._)(["\n  ","\n  font-family: ",";\n  font-weight: ",";\n  font-size:",";\n  line-height:",";\n  color: ",";\n  text-transform: uppercase;\n  text-align: left;\n  margin: "," "," "," ",";\n"]);return K=function(){return e},e}function J(){let e=(0,y._)(["\n  div {\n    margin: 0;\n  }\n"]);return J=function(){return e},e}let q=(0,_.iv)(I(),S.r.typography.fontFamily.primary,S.r.typography.fontWeight.extrabold,S.r.colors.text.primary,S.r.typography.fontWeight.bold,S.r.colors.text.link,S.r.typography.fontFamily.primary,S.r.typography.fontWeight.extrabold,S.r.typography.fontSize.display5,S.r.colors.text.brand,S.r.typography.fontFamily.secondary,S.r.typography.fontWeight.light,S.r.colors.text.inverse,S.r.colors.brand.primary,S.r.spacing.sm,S.r.spacing.sm,S.r.colors.text.linkHover,S.r.colors.interactive.active),X=C.Z.div(T(),S.r.spacing.xl,S.r.spacing.xl),$=C.Z.div(L(),S.r.spacing.md,S.B.tablet(A()),S.B.desktop(R())),ee=C.Z.div(N(),S.r.spacing.md),ei=C.Z.p(O()),en=(0,C.Z)(ei)(P(),S.r.typography.fontFamily.primary,S.r.typography.fontWeight.extrabold,S.r.typography.fontSize.h4,S.r.typography.lineHeight.h5,S.r.colors.text.primary,S.B.desktop(x(),S.r.typography.fontSize.h2,S.r.typography.lineHeight.h2)),eo=(0,C.Z)(en)(k(),S.r.typography.fontSize.h5,S.r.typography.lineHeight.h6,S.B.desktop(M(),S.r.spacing.sm,S.r.typography.fontSize.h2,S.r.typography.lineHeight.h2)),el=C.Z.div(B(),S.r.spacing.sm,S.r.spacing.sm,S.r.typography.fontSize.body2,S.r.typography.lineHeight.body2,S.r.colors.text.primary,S.B.desktop(D(),S.r.spacing.xs)),et=C.Z.div(U(),q,S.r.typography.fontFamily.secondary,S.r.typography.fontWeight.light,S.r.typography.fontSize.body1,S.r.typography.lineHeight.body1,S.r.colors.text.primary,S.r.spacing.md,S.r.spacing.xl,S.B.tablet(w(),S.r.spacing.lg,S.r.spacing.xl,S.r.typography.fontSize.h6,S.r.typography.lineHeight.h6),S.B.desktop(j(),S.r.spacing.md,S.r.spacing["2xl"])),er=C.Z.div(F()),ed=C.Z.p(G(),S.r.typography.fontFamily.secondary,S.r.typography.fontWeight.regular,S.r.typography.fontSize.body1,S.r.typography.lineHeight.body1,S.r.colors.text.primary),ea=C.Z.div(Y(),S.r.spacing.xs,S.r.typography.fontFamily.secondary,S.r.typography.fontWeight.bold,S.r.typography.fontSize.h6,S.r.typography.lineHeight.h6,S.r.colors.text.primary,S.r.iconSize.sm,S.r.spacing.md,S.r.iconSize.xs,S.B.tablet(z(),S.r.spacing.md),S.B.desktop(V(),S.r.spacing.md)),eu=C.Z.div(H(),q,S.r.typography.fontFamily.secondary,S.r.typography.fontWeight.light,S.r.typography.fontSize.body1,S.r.typography.lineHeight.body1,S.r.colors.text.primary,S.r.spacing["2xl"],S.r.spacing.lg,S.r.spacing.xl,S.r.spacing.lg),es=C.Z.div(Q(),S.r.typography.fontSize.h4,S.r.typography.lineHeight.h4,S.B.desktop(Z(),S.r.typography.fontSize.h2,S.r.typography.lineHeight.h2)),ev=C.Z.div(W(),q,S.r.typography.fontFamily.primary,S.r.typography.fontWeight.extrabold,S.r.typography.fontSize.body1,S.r.typography.lineHeight.body1,S.r.colors.text.primary,S.r.spacing["2xl"],S.r.spacing.lg,S.r.spacing.xl,S.r.spacing.lg),ec=C.Z.div(K(),q,S.r.typography.fontFamily.secondary,S.r.typography.fontWeight.regular,S.r.typography.fontSize.body1,S.r.typography.lineHeight.body1,S.r.colors.text.primary,S.r.spacing["2xl"],S.r.spacing.lg,S.r.spacing.xl,S.r.spacing.lg),ep=C.Z.div(J());function em(){let e=(0,y._)(["\n    margin: 0 "," 110px;\n  "]);return em=function(){return e},e}function ef(){let e=(0,y._)(["\n    width: 616px;\n  "]);return ef=function(){return e},e}function eg(){let e=(0,y._)(["\n  margin: 0 "," 170px;\n\n  ","\n  ","\n"]);return eg=function(){return e},e}function eE(){let e=(0,y._)(["\n    border-radius: 0 0 "," ",";\n  "]);return eE=function(){return e},e}function eh(){let e=(0,y._)(["\n    padding: "," 128px;\n  "]);return eh=function(){return e},e}function eb(){let e=(0,y._)(["\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  padding: "," 0;\n  width: 100%;\n  background: ",";\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n\n  ","\n\n  ","\n"]);return eb=function(){return e},e}let ey=C.Z.div(eg(),S.r.spacing.xl,S.B.tablet(em(),S.r.spacing["3xl"]),S.B.desktop(ef())),eC=C.Z.div(eb(),S.r.spacing.lg,S.r.colors.bg.primary,S.B.tablet(eE(),S.r.radius.lg,S.r.radius.lg),S.B.desktop(eh(),S.r.spacing.xl));var e_=n(12206),eS=n(73843),eI=e=>{let{data:i,onSeeDetailClick:n,onFirstButtonClick:o,onSecondButtonClick:l,seconButtonEnabled:t}=e,{title:r,offerDescription:u,productTitle:s,price:v,recurrence:c,priceDescription:p,productSpecs:m,detailsLabel:f,firstButtonLabel:g,fistButtonVariant:y,secondButtonLabel:C,secondButtonVariant:_}=i,[S]=(0,b.q)([p||""]),I=(0,a.useRef)(null),[T,A]=(0,a.useState)({show:!1,text:"",title:""});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(ey,{children:[(0,d.jsx)(en,{children:r}),(0,d.jsx)(et,{dangerouslySetInnerHTML:{__html:(0,b.q)([u])[0]||""}}),(0,d.jsx)(en,{children:s}),(0,d.jsxs)(eo,{children:[v,(0,d.jsx)("span",{className:"rec",children:c&&"/".concat(c)})]}),(0,d.jsx)(el,{children:S&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:S}})}),(0,d.jsx)(ee,{children:(0,d.jsx)("div",{ref:I,className:"product-specs",style:{marginBottom:32},children:a.Children.toArray(m&&m.length>0&&m.map(e=>{let{title:i,items:n}=e;return(0,d.jsxs)("div",{children:[i&&(0,d.jsx)(ed,{children:i}),n&&n.length>0&&a.Children.toArray(n.filter(e=>!!e.title).map(e=>(0,d.jsx)(er,{children:(0,d.jsxs)(ea,{children:[(0,d.jsx)("div",{children:(0,d.jsx)(e_.Z,{})}),(0,d.jsx)(eu,{dangerouslySetInnerHTML:{__html:(0,b.q)([e.title])[0]||""}})]})})))]})}))})}),(0,d.jsx)(X,{children:(0,d.jsx)(E.Z,{text:f,onClick:n,size:"2"})}),(0,d.jsx)(eC,{children:(0,d.jsxs)($,{children:[(0,d.jsx)(eS.Z,{onClick:o,variant:y||"primary",children:g}),l&&C&&t&&(0,d.jsx)(eS.Z,{onClick:l,variant:_||"secondary",children:C})]})})]}),(0,d.jsx)(h.Z,{height:563,isOpen:T.show,handleClose:()=>A({show:!1,text:"",title:""}),children:(0,d.jsxs)(d.Fragment,{children:[T.title&&(0,d.jsx)(es,{children:(0,d.jsx)(ev,{dangerouslySetInnerHTML:{__html:(0,b.q)([T.title])[0]||""}})}),(0,d.jsx)(ep,{children:(0,d.jsx)(ec,{dangerouslySetInnerHTML:{__html:(0,b.q)([T.text])[0]||""}})})]})})]})},eT=n(36079);function eA(){let e=(0,y._)(["\n    margin-top: -28px;\n    margin-bottom: 150px;\n  "]);return eA=function(){return e},e}function eR(){let e=(0,y._)(["\n    margin-top: -",";\n    margin-bottom: 110px;\n  "]);return eR=function(){return e},e}function eL(){let e=(0,y._)(["\n  margin-top: -",";\n  margin-bottom: 150px;\n\n  ","\n\n  ","\n"]);return eL=function(){return e},e}function eN(){let e=(0,y._)(["\n    div {\n      width: 290px;\n    }\n  "]);return eN=function(){return e},e}function eO(){let e=(0,y._)(["\n    flex-flow: row;\n  "]);return eO=function(){return e},e}function ex(){let e=(0,y._)(["\n  display: flex;\n  flex-flow: column;\n  justify-content: center;\n  align-items: center;\n  width: 100%;\n  gap: ","\n  max-width: 80%;\n  div {\n    width: 100%;\n  }\n\n  ","\n\n  ","\n"]);return ex=function(){return e},e}let eP=(0,C.Z)(ey)(eL(),S.r.spacing.xl,S.B.tablet(eA()),S.B.desktop(eR(),S.r.spacing["2xl"])),eM=C.Z.div(ex(),S.r.spacing.md,S.B.tablet(eN()),S.B.desktop(eO()));var ek=n(30815),eD=e=>{let{details:i,modalInfo:n,onButtonClick:o,onSecondButtonClick:l}=e;return(0,d.jsxs)(eP,{children:[(0,d.jsx)(ek.Z,{trackingOpt:{event:["ui_interaction"],event_label:"offer details",opts:{event_category:"users",event_action:"click"},visitorTrackingOpts:(0,eT.bG)(),disableInitialTrack:!0},details:i,modalInfo:n}),(0,d.jsx)(eC,{children:(0,d.jsxs)(eM,{children:[(0,d.jsx)(eS.Z,{onClick:o,variant:i.firstButtonVarian||"primary",children:i.firstButtonLabel}),l&&i.secondButtonLabel&&!i.disableSecondAction&&(0,d.jsx)(eS.Z,{onClick:l,variant:i.seconButtonVarian||"secondary",children:i.secondButtonLabel})]})})]})},eB=e=>{var i,n,o,l,t,E,h,b,y,C,_,S,I,T,A,R,L;let{product:N,isOpen:O,handleClose:x,handleAccept:P,buildTrackingObject:M,offerData:k,taggingPageName:D}=e,B=(0,g.useQueryClient)(),{trackView:w,trackWithNewDatalayer:j}=(0,m.rS)({event:["".concat(D)],disableInitialTrack:!0}),U=(0,a.useRef)(null),{OFFER_STEP:F,DETAILS_STEP:G}=r,[z,V]=(0,a.useState)(F),Y=(0,s.C)(s.y[c.Z.CONSUMER],v.bl.CMS_GET_SUPPORT_MODULE),H=e=>{switch(e.type?+e.type:0){case f.e.CUSTOM_URL:P();break;case f.e.CALL_ME_NOW:(0,p.u)(B,{product:N,idClickToCall:null==e?void 0:e.key,clickToCallFallbackUrl:(null==e?void 0:e.callMeNow)||(null==e?void 0:e.url)});break;case f.e.CALL_ME_NOW_SUNRISE:if(!(null==e?void 0:e.title)||!(null==e?void 0:e.url))return;(0,p.u)(B,{product:N,idClickToCall:null==e?void 0:e.key,clickToCallFallbackUrl:(null==e?void 0:e.callMeNow)||(null==e?void 0:e.url),clickToCallFallbackType:"CTC_
1SUNRISE",clickToCallFallbackTemplate:null==e?void 0:e.template})}},Z=e=>{w({event_name:"ui_interaction",event_label_track:"".concat(e),event_category:"users",event_action:"click",tracking_type:"link"})};(0,a.useEffect)(()=>{O&&j({...M(z)})},[z,O]);let Q=[(0,d.jsx)(eI,{data:{title:(null==k?void 0:null===(i=k.offerProposition)||void 0===i?void 0:i.title)||"",offerDescription:(null==k?void 0:null===(n=k.offerProposition)||void 0===n?void 0:n.description)||"",productTitle:(null==k?void 0:null===(o=k.offerDetails)||void 0===o?void 0:o.title)||"",price:(null==k?void 0:k.price)||"",recurrence:(null==k?void 0:k.recurrence)||"",priceDescription:(null==k?void 0:k.priceDescription)||"",productSpecs:(null==k?void 0:k.specs)||[],firstButtonLabel:(null==k?void 0:null===(l=k.firstButtonAction)||void 0===l?void 0:l.title)||"",fistButtonVariant:null==k?void 0:null===(t=k.firstButtonAction)||void 0===t?void 0:t.style,secondButtonLabel:null==k?void 0:null===(E=k.secondButtonAction)||void 0===E?void 0:E.title,secondButtonVariant:null==k?void 0:null===(h=k.secondButtonAction)||void 0===h?void 0:h.style,detailsLabel:(null==k?void 0:null===(b=k.offerProposition)||void 0===b?void 0:b.showDetailLabel)||""},onFirstButtonClick:()=>{var e;let i=(null==k?void 0:null===(e=k.firstButtonAction)||void 0===e?void 0:e.title)||"";H(null==k?void 0:k.firstButtonAction),Z(i)},onSecondButtonClick:()=>{var e;H(null==k?void 0:k.secondButtonAction),Z((null==k?void 0:null===(e=k.secondButtonAction)||void 0===e?void 0:e.title)||"")},onSeeDetailClick:()=>{var e,i;null==U||null===(e=U.current)||void 0===e||e._stepperModalGoNext();let n=(null==k?void 0:null===(i=k.offerProposition)||void 0===i?void 0:i.showDetailLabel)||"",o=document.getElementById("modalContent");null==o||o.scrollTo(0,0),Z(n),V(G)},seconButtonEnabled:null==k?void 0:k.cTCEnabled}),N?(0,d.jsx)(eD,{details:{title:(null==k?void 0:null===(y=k.offerDetails)||void 0===y?void 0:y.title)||"",conditions:null==k?void 0:k.offerDetails.conditions,description:null==k?void 0:k.offerDetails.description,offerDetails:null==k?void 0:k.offerDetails.offerDetails,price:(null==k?void 0:k.price)||"",recurrence:null==k?void 0:k.recurrence,disableSecondAction:(null==k?void 0:null===(C=k.offerDetails)||void 0===C?void 0:C.disableSecondAction)||!(null==k?void 0:k.cTCEnabled),firstButtonLabel:(null==k?void 0:null===(_=k.firstButtonAction)||void 0===_?void 0:_.title)||"",firstButtonVarian:null==k?void 0:null===(S=k.firstButtonAction)||void 0===S?void 0:S.style,secondButtonLabel:null==k?void 0:k.secondButtonAction.title,seconButtonVarian:null==k?void 0:null===(I=k.secondButtonAction)||void 0===I?void 0:I.style},modalInfo:{title:(null==Y?void 0:null===(A=Y.supportmodules)||void 0===A?void 0:null===(T=A.needHelp)||void 0===T?void 0:T.title)||"",ctaName:(null==Y?void 0:null===(L=Y.supportmodules)||void 0===L?void 0:null===(R=L.needHelp)||void 0===R?void 0:R.ctaSupportCall)||""},onButtonClick:()=>{var e;H(null==k?void 0:k.firstButtonAction),Z((null==k?void 0:null===(e=k.firstButtonAction)||void 0===e?void 0:e.title)||"")},onSecondButtonClick:()=>{var e;H(null==k?void 0:k.secondButtonAction),Z((null==k?void 0:null===(e=k.secondButtonAction)||void 0===e?void 0:e.title)||"")}}):(0,d.jsx)("div",{})];return(0,d.jsx)(u.Z,{id:"fallback-modal",isOpen:O,handleClose:x,ref:U,components:Q})}},31558:function(e,i,n){n.d(i,{Z:function(){return R}});var o=n(52322),l=n(96108),t=n(64185),r=n(2784),d=n(67862),a=n(92603),u=n(70095),s=n(35067);function v(){let e=(0,d._)(["\n    padding: 0 40px;\n  "]);return v=function(){return e},e}function c(){let e=(0,d._)(["\n    padding: 0 54px;\n  "]);return c=function(){return e},e}function p(){let e=(0,d._)(["\n  padding: 0 ",";\n\n  ","\n\n  ","\n"]);return p=function(){return e},e}function m(){let e=(0,d._)(["\n    ","\n    padding: 60px 0 0;\n  "]);return m=function(){return e},e}function f(){let e=(0,d._)(["\n    ","\n  "]);return f=function(){return e},e}function g(){let e=(0,d._)(["\n  padding: "," 0 0;\n  ","\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n\n  ","\n\n  ","\n"]);return g=function(){return e},e}function E(){let e=(0,d._)(["\n  display: flex;\n  flex-direction: column;\n  gap: ",";\n  margin-bottom: ",";\n"]);return E=function(){return e},e}function h(){let e=(0,d._)(["\n  margin: 0;\n  text-align: start;\n  ",";\n  font-family: ",";\n  font-weight: ",";\n"]);return h=function(){return e},e}function b(){let e=(0,d._)(["\n  margin: 0;\n  text-align: start;\n  ",";\n  font-family: ",";\n  font-weight: ",";\n"]);return b=function(){return e},e}function y(){let e=(0,d._)(["\n  margin-top: ",";\n  margin-bottom: ",";\n  padding: 0;\n\n  p {\n    margin: 0;\n  }\n"]);return y=function(){return e},e}let C=a.Z.div(p(),u.v.spacing.lg,u.B.tablet(v()),u.B.desktop(c())),_=a.Z.div(g(),u.v.spacing.xl,(0,s.L)(30,38),u.v.typography.fontFamily.primary,u.v.typography.fontWeight.extrabold,u.B.tablet(m(),(0,s.L)(42,52)),u.B.desktop(f(),(0,s.L)(36,45))),S=a.Z.div(E(),u.v.spacing.sm,u.v.spacing.lg),I=a.Z.p(h(),(0,s.L)(20,26),u.v.typography.fontFamily.primary,u.v.typography.fontWeight.extrabold),T=a.Z.p(b(),(0,s.L)(18,24),u.v.typography.fontFamily.primary,u.v.typography.fontWeight.regular),A=a.Z.ul(y(),u.v.spacing.sm,u.v.spacing.lg);var R=e=>{var i;let{data:n,list:d}=e,{title:a,description:u,text:s,textBold:v}=n;return(0,o.jsxs)(C,{children:[(0,o.jsx)(_,{children:a}),(0,o.jsx)(l.Z,{modal:!0,text:u,size:20,lineHeight:26}),(0,o.jsxs)(S,{children:[(0,o.jsx)(I,{children:v}),(0,o.jsx)(T,{children:s})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(I,{children:d.title}),(0,o.jsx)(A,{children:r.Children.toArray(null===(i=d.items)||void 0===i?void 0:i.map(e=>(0,o.jsx)(t.Z,{text:e.text,icon:e.icon})))})]})]})}},15019:function(e,i,n){n.d(i,{Z:function(){return D}});var o=n(52322),l=n(2784),t=n(63955),r=n(6812),d=n(2985),a=n(45451),u=n(82454),s=n(96108),v=n(67862),c=n(92603),p=n(60042);function m(){let e=(0,v._)(["\n    width: 366px;\n  "]);return m=function(){return e},e}function f(){let e=(0,v._)(["\n    width: 406px;\n  "]);return f=function(){return e},e}function g(){let e=(0,v._)(["\n  margin: 0 auto;\n  width: 287px;\n\n  ","\n\n  ","\n"]);return g=function(){return e},e}function E(){let e=(0,v._)(["\n    font-size: ",";  \n    line-height: ",";\n    padding: 60px 0 16px;\n  "]);return E=function(){return e},e}function h(){let e=(0,v._)(["\n    font-size: ",";  \n    line-height: ",";\n  "]);return h=function(){return e},e}function b(){let e=(0,v._)(["\n  padding: 32px 0 16px;\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n  ","\n\n  ","\n\n  ","\n"]);return b=function(){return e},e}function y(){let e=(0,v._)(["\n    ","\n  "]);return y=function(){return e},e}function C(){let e=(0,v._)(["\n    margin-bottom: ",";\n  "]);return C=function(){return e},e}function _(){let e=(0,v._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  font-style: normal;\n  margin-top: ",";\n  margin-bottom: ",";\n  text-align: center;\n\n  ","\n\n  ","\n"]);return _=function(){return e},e}function S(){let e=(0,v._)(["\n    gap: ",";\n  "]);return S=function(){return e},e}function I(){let e=(0,v._)(["\n  input::-webkit-outer-spin-button,\n  input::-webkit-inner-spin-button {\n    -webkit-appearance: none;\n    margin: 0;\n  }\n  input[type='number'] {\n    -moz-appearance: textfield;\n  }\n  display: flex;\n  flex-direction: column;\n\n  div {\n    margin-top: 0;\n  }\n\n  p {\n    position: relative;\n    margin-bottom: 0;\n  }\n\n  gap: ",";\n\n  ","\n"]);return I=function(){return e},e}function T(){let e=(0,v._)(["\n    margin-top: ",";\n  "]);return T=function(){return e},e}function A(){let e=(0,v._)(["\n  display: flex;\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  font-style: normal;\n  margin-top: ",";\n  margin-bottom: ",";\n\n  ","\n"]);return A=function(){return e},e}function R(){let e=(0,v._)(["\n  margin-top: 3.75rem;\n"]);return R=function(){return e},e}let L=c.Z.div(g(),p.BC.tablet(m()),p.BC.desktop(f())),N=c.Z.div(b(),p.rS.typography.fontFamily.primary,p.rS.typography.fontWeight.extrabold,(0,p.Ln)(30,38),p.BC.tablet(E(),p.rS.typography.fontSize.h1,p.rS.typography.lineHeight.h1),p.BC.tablet(h(),p.rS.typography.fontSize.h2,p.rS.typography.lineHeight.h2)),O=c.Z.div(_(),p.rS.typography.fontFamily.primary,p.rS.typography.fontWeight.regular,p.rS.typography.fontSize.h6,p.rS.typography.lineHeight.h6,p.rS.spacing.md,p.rS.spacing.xl,p.BC.tablet(y(),(0,p.Ln)(20,30
1)),p.BC.desktop(C(),(0,p.Q1)(40))),x=c.Z.div(I(),p.rS.spacing.md,p.BC.tablet(S(),(0,p.Q1)(20)));c.Z.div(A(),p.rS.typography.fontFamily.primary,p.rS.typography.fontWeight.regular,p.rS.typography.fontSize.body3,p.rS.typography.lineHeight.body3,p.rS.spacing.md,p.rS.spacing.xl,p.BC.tablet(T(),(0,p.Q1)(20)));let P=c.Z.div(R());var M=n(65413);let k=e=>{var i,n,o,l;return M.object({phoneNumber:M.string().required((null==e?void 0:null===(i=e.phoneNumber)||void 0===i?void 0:i.required)||"").min(9,(null==e?void 0:null===(n=e.phoneNumber)||void 0===n?void 0:n.minimum)||" ").max(11,(null==e?void 0:null===(o=e.phoneNumber)||void 0===o?void 0:o.maximum)||" ").matches(/^(3)+[0-9]*$/,(null==e?void 0:null===(l=e.phoneNumber)||void 0===l?void 0:l.matches)||"")})};var D=e=>{var i;let{title:n,description:v,label:c,value:p,onChangeData:m,onValidChange:f,isLoading:g,schema:E,disabled:h,disclaimer:b,validationMessage:y}=e,{register:C,setValue:_,getValues:S,formState:{isValid:I,errors:T}}=(0,t.cI)({resolver:(0,r.X)(k(y)||E),mode:"all"});return(0,l.useEffect)(()=>{p&&_("phoneNumber",p,{shouldValidate:!!p})},[]),(0,l.useEffect)(()=>{null==f||f(I)},[I]),(0,o.jsx)(L,{children:g?(0,o.jsx)(P,{children:(0,o.jsx)(d.Z,{heights:70,quantity:3})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(N,{children:n}),(0,o.jsx)(O,{children:v}),(0,o.jsx)(x,{children:(0,o.jsx)("div",{className:"textInput",children:(0,o.jsx)(a.Z.TextInput,{label:c,type:"number",placeholder:" ",autoComplete:"off",disabled:h||!1,error:null===(i=T.phoneNumber)||void 0===i?void 0:i.message,...C("phoneNumber",{onChange:()=>{let e=S().phoneNumber;m&&m(e)},setValueAs:e=>e.trim()})})})}),b&&(0,o.jsx)(s.Z,{text:b,size:14,sizeMobile:14,lineHeight:18,margin:[32,0],fontFamily:u.R.regular,textAlign:"left"})]})})}},79487:function(e,i,n){n.d(i,{g:function(){return d}});var o=n(82066),l=n(41307),t=n(10727);let r=(e,i)=>l.W.post(t.b.SIM_TYPE,e,{...(null==i?void 0:i.headers)&&{headers:i.headers},...(null==i?void 0:i.ignoreUpdateToken)&&{ignoreUpdateToken:!0},...(null==i?void 0:i.silentLoginHeaders)&&{silentLoginHeaders:i.silentLoginHeaders}}),d=()=>{let e=(0,o.useQueryClient)();return(0,o.useMutation)("simSelection",e=>{let{cartId:i}=e,n=i&&i.substring(0,i.length-1);return r({externalRefernce:i,id:n},{ignoreUpdateToken:!0})},{onSuccess:i=>{localStorage.setItem("simSelection",JSON.stringify(i)),e.setQueryData("simSelection",i)},onError:e=>{l.K.error("ERROR on simSelection: ",e),localStorage.setItem("simSelection",JSON.stringify(e))}})}},45149:function(e,i,n){var o,l;n.d(i,{h:function(){return t},l:function(){return o}});let t={description:"",deliveryAddress:"",civicNumber:""};(l=o||(o={})).FAMILYPLUS_ACCEPT="1",l.FAMILYPLUS_CONTINUE="2",l.FAMILYPLUS_CTC="3",l.FAMILYPLUS_REDIRECT="4"},72631:function(e,i,n){var o,l;n.d(i,{Bf:function(){return t},tb:function(){return r},v9:function(){return o},xz:function(){return d}});let t={PERSONAL_INFO:"Personal info",PERSONAL_INFO_WINBACK:"Personal Info Winback",DOCUMENT_ID:"Document id",CONTACT_CARD:"Contact Card",CONFIRM_IDENDITY_APP:"Confirm Identity app",CONFIRM_IDENDITY:"Confirm Identity",OTP:"Otp",WINBACK_OTP:"Winback otp",WINBACK_LEGACY_OTP:"Winback Legacy otp",PAYMENT_METHOD:"Payment method",RECURRENT_PAYMENT_CARD:"Recurrent payment card",PORTABILITY:"Portability",PORTABILITY_NUMBER:"Portability Number",PORTABILITY_NUMBER_WINBACK:"Portability Number Winback",PORTABILITY_NUMBER_PORTABILITY_REQUIRED:"Portability Number portability required",WINBACK_NUMBER:"Winback Number",WINBACK_LEGACY_NUMBER:"Winback Legacy Number",DELIVERY_ADDRESS:"Delivery",PORTABILITY_SIM_SERIAL:"Portability Sim Serial",PORTABILITY_OTP:"Portability Otp",PORTABILITY_DATA:"Portability Data",ESIM_SIM_SELECTION:"ESimSIM Selection",RECOGNITION_ESIM:"ESim recognition",RECOGNITION_ESIM_WINBACK:"ESim Recognition Winback",RECOGNITION_ESIM_SKIP_MNP:"ESim Recognition Skip Mnp",RECOGNITION_CARD:"EsimSim recognition",RECOGNITION_CARD_SKIP_MNP:"ESimSim recognition Skip Mnp",RECOGNITION_SIM_METHOD_SELECTION:"Sim recognition method selection",RECOGNITION_SIM_COURIER:"Sim recognition courier",RECOGNITION_SIM_VIDEO_RECOGNITION:"Sim recognition video recognition",TERMS_AND_CON
1DITIONS:"Terms and Conditions",CONSENTS:"Consents",WARNING_PRICE_CHANGE:"Warning price change",UPFRONT_PAYMENT:"Upfront payment",VOUCHER:"Voucher",ADDON_CARD:"Addon"};(l=o||(o={})).ADDON_CARD="AddonCard",l.CAMPAIGN_CARD="CampaignCard",l.CONFIRM_IDENTITY_APP_CARD="ConfirmIdentityAppCard",l.CONFIRM_IDENTITY_CARD="ConfirmIdentityCard",l.CONSENT_CARD="ConsentCard",l.CONTACT_CARD="ContactCard",l.DOCUMENT_ID_CARD="DocumentIdCard",l.LOADING_CARD="LoadingCard",l.NAME_FISCAL_CODE_CARD="NameFiscalCodeCard",l.NAME_FISCAL_CODE_CARD_WINBACK="NameFiscalCodeCardWinback",l.OTP_CARD="OtpCard",l.PAYMENT_METHOD_CARD="PaymentMethodCard",l.PORTABILITY_CARD="PortabilityCard",l.PORTABILITY_DATA_CARD="PortabilityDataCard",l.PORTABILITY_NUMBER_CARD="PortabilityNumberCard",l.PORTABILITY_NUMBER_CARD_WINBACK="PortabilityNumberCardWinback",l.PORTABILITY_NUMBER_PORTABILITY_REQUIRED_CARD="PortabilityNumberPortabilityRequiredCard",l.PORTABILITY_OTP_CARD="PortabilityOtpCard",l.SIM_NUMBER_CARD="SimNumberCard",l.RECOGNITION_CARD="RecognitionCard",l.RECOGNITION_CARD_SKIP_MNP="RecognitionCardSkipMnp",l.RECURRENT_PAYMENT_CARD="RecurrentPaymentCard",l.SIM_TYPE_SELECTION_CARD="SimTypeSelectionCard",l.SIM_TYPE_SELECTION_CARD_MNP_SKIP="SimTypeSelectionCardMnpSkip",l.SIM_TYPE_SELECTION_CARD_WINBACK="SimTypeSelectionCardWinback",l.TERMS_AND_CONDITIONS_CARD="TermsAndConditionsCard",l.UPFRONT_PAYMENT_CARD="UpfrontPaymentCard",l.VOUCHER_CARD="VoucherCard",l.WARNING_CARD="WarningCard",l.WINBACK_LEGACY_NUMBER_CARD="WinbackLegacyNumberCard",l.WINBACK_LEGACY_OTP_CARD="WinbackLegacyOtpCard",l.WINBACK_NUMBER_CARD="WinbackNumberCard",l.WINBACK_OTP_CARD="WinbackOtpCard",l.DELIVERY_ADDRESS_CARD="DeliveryCard";let r=[{key:"AddonCard"},{key:"CampaignCard"},{key:"ConfirmIdentityAppCard"},{key:"ConfirmIdentityCard"},{key:"ConsentCard"},{key:"ContactCard"},{key:"DocumentIdCard"},{key:"LoadingCard"},{key:"NameFiscalCodeCard"},{key:"NameFiscalCodeCardWinback"},{key:"OtpCard"},{key:"PaymentMethodCard"},{key:"PortabilityCard"},{key:"PortabilityDataCard"},{key:"PortabilityNumberCard"},{key:"PortabilityNumberCardWinback"},{key:"PortabilityNumberPortabilityRequiredCard"},{key:"PortabilityOtpCard"},{key:"SimNumberCard"},{key:"RecognitionCard"},{key:"RecognitionCardSkipMnp"},{key:"RecurrentPaymentCard"},{key:"SimTypeSelectionCard"},{key:"SimTypeSelectionCardMnpSkip"},{key:"SimTypeSelectionCardWinback"},{key:"TermsAndConditionsCard"},{key:"UpfrontPaymentCard"},{key:"VoucherCard"},{key:"WarningCard"},{key:"WinbackLegacyNumberCard"},{key:"WinbackLegacyOtpCard"},{key:"WinbackNumberCard"},{key:"WinbackOtpCard"},{key:"DeliveryCard"}],d=t.PERSONAL_INFO},5756:function(e,i,n){n.d(i,{o0:function(){return s0},Mo:function(){return sX},ie:function(){return vp},Cx:function(){return vm},tD:function(){return s7},M7:function(){return vs},AK:function(){return vu},Dv:function(){return s8}});var o,l,t,r,d,a,u,s,v,c,p=n(52322),m=n(2784),f=n(99306),g=n(33849),E=n(94198),h=n(72631),b=n(90401);let y={nameTitle:[{rel:"self",href:"/care/v1/nameTitle",id:"EMPTY",name:"EMPTY",displayName:" ",default:!0},{rel:"self",href:"/care/v1/nameTitle",id:"Mr.",name:"Mr.",displayName:"Sig.",default:!1},{rel:"self",href:"/care/v1/nameTitle",id:"Mrs.",name:"Mrs.",displayName:"Sig.ra",default:!1},{rel:"self",href:"/care/v1/nameTitle",id:"Ms.",name:"Ms.",displayName:"Sig.na",default:!1},{rel:"self",href:"/care/v1/nameTitle",id:"Dr.",name:"Dr.",displayName:"Dr.",default:!1}],identificationType:[{rel:"self",href:"/care/v1/identificationType",id:"1",name:"1",displayName:"Carta d'identit\xe0",default:!1},{rel:"self",href:"/care/v1/identificationType",id:"2",name:"2",displayName:"Passaporto",default:!1},{rel:"self",href:"/care/v1/identificationType",id:"3",name:"3",displayName:"Patente di guida",default:!1}]},C=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N;return{title:i?(null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.clientLogged)||void 0===o?void 0:null===(n=o.documentPreFilled)||void 0===n?void 0:n.title)||"":(null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:null===(t=r.newDocument)||void 0===t?void 0:t.t
1itle)||"",subtitle:i?(null==e?void 0:null===(u=e.personalinfomobile)||void 0===u?void 0:null===(a=u.clientLogged)||void 0===a?void 0:null===(d=a.documentPreFilled)||void 0===d?void 0:d.description)||"":(null==e?void 0:null===(v=e.personalinfomobile)||void 0===v?void 0:null===(s=v.newDocument)||void 0===s?void 0:s.description)||"",docLable:(null==e?void 0:null===(p=e.personalinfomobile)||void 0===p?void 0:null===(c=p.selectInput)||void 0===c?void 0:c.docType)||"",docNumberLable:(null==e?void 0:null===(f=e.personalinfomobile)||void 0===f?void 0:null===(m=f.selectInput)||void 0===m?void 0:m.docNumber)||"",docExpirationDateLable:(null==e?void 0:null===(E=e.personalinfomobile)||void 0===E?void 0:null===(g=E.selectInput)||void 0===g?void 0:g.docExpirationDate)||"",countryLable:(null==e?void 0:null===(b=e.personalinfomobile)||void 0===b?void 0:null===(h=b.selectInput)||void 0===h?void 0:h.nation)||"",errorMessage:i?(null==e?void 0:null===(_=e.personalinfomobile)||void 0===_?void 0:null===(C=_.clientLogged)||void 0===C?void 0:null===(y=C.documentPreFilled)||void 0===y?void 0:y.allFieldsAreRequired)||"":(null==e?void 0:null===(I=e.personalinfomobile)||void 0===I?void 0:null===(S=I.newDocument)||void 0===S?void 0:S.allFieldsAreRequired)||"",validationMessage:(null==e?void 0:null===(T=e.personalinfomobile)||void 0===T?void 0:T.validationMessage)||{},cieEnabled:"true"===String(null==e?void 0:null===(R=e.personalinfomobile)||void 0===R?void 0:null===(A=R.selectInput)||void 0===A?void 0:A.cieEnabled).toLowerCase(),cieErrorMessage:(null==e?void 0:null===(N=e.personalinfomobile)||void 0===N?void 0:null===(L=N.selectInput)||void 0===L?void 0:L.cieErrorMessage)||""}},_=(e,i)=>{let n=e=>{var n,o,l,t;let r=new DOMParser,d=(null==i?void 0:null===(n=i.find(i=>i.id===e))||void 0===n?void 0:n.value)||"",a=r.parseFromString((null===(o=(0,b.q)([d||""]))||void 0===o?void 0:o[0])||"","text/html");return(null==a?void 0:null===(t=a.body)||void 0===t?void 0:null===(l=t.textContent)||void 0===l?void 0:l.replace("\n",""))||""};return null==e?void 0:e.map(e=>(null==e?void 0:e.id)==="1"&&n("identityCard")?{displayName:n("identityCard")||(null==e?void 0:e.displayName)||"",id:(null==e?void 0:e.id)||"",identificationType:(null==e?void 0:e.displayName)||""}:(null==e?void 0:e.id)==="2"&&n("passport")?{displayName:n("passport")||(null==e?void 0:e.displayName)||"",id:(null==e?void 0:e.id)||"",identificationType:(null==e?void 0:e.displayName)||""}:(null==e?void 0:e.id)==="3"&&n("drivingLicense")?{displayName:n("drivingLicense")||(null==e?void 0:e.displayName)||"",id:(null==e?void 0:e.id)||"",identificationType:(null==e?void 0:e.displayName)||""}:{displayName:(null==e?void 0:e.displayName)||"",id:(null==e?void 0:e.id)||"",identificationType:(null==e?void 0:e.displayName)||""})};var S=n(55552),I=n(82066),T=n(95294);let A=()=>e=>i=>{let[n,o]=(0,m.useState)(!0);return((0,m.useEffect)(()=>{setTimeout(()=>{o(!1)},800)},[]),n)?null:(0,p.jsx)(e,{...i})},R=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("document","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step2"],event_label:"document",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,S.q)(n),null});var L=n(63955),N=n(75672),O=n(45451),x=n(6812),P=n(29281),M=n(65413);let k=(e,i,n)=>{var o,l,t,r,d,a;return M.object({identificationType:M.string().required(" "),identificationNumber:M.string().ensure().when("identificationType",{is:e=>(null==e?void 0:e.toLowerCase())==="carta d'identit\xe0"||(null==e?void 0:e.toLowerCase())==="carta di identit\xe0"||(null==e?void 0:e.toLowerCase())==="identity card",then:i?M.string().required(" ").matches(/^[A-Z]{2}\d{5}[A-Z]{2}$/i,n||"Inserire un numero di documento valido"):M.string().required(" ").matches(/^[a-zA-Z]{2}[0-9]{5}([0-9]{2}||[a-zA-Z]{2})$/,(null==e?void 0:null===(o=e.identificationNumber)||void 0===o?void 0:o.valid)||"Inserire un numero di documento valido").min(9,(null==e?void 0:null===(l=e.identificationNumber)||void 0===l?void 0:l.minimum)||"Inserire un numero di documento valido"),otherwise:M.string().required(" ").matches(/^[a-zA-Z0-9]*$/,(null==e?void 0:null===(t=e.otherwise)||void 0===t?void 0:t.valid)||"Inserire un numero di documento valido").min(6,(null==e?void 0:null===(r=e.otherwise)||void 0===r?void 0:r.minimum)||"Inserire un numero di documento valido").max(15,(null==e?void 0:null===(d=e.otherwise)||void 0===d?void 0:d.maximum)||"Inserire un numero di documento valido")}
1),expirationDate:M.string().required(" ").test("rangeTest",(null==e?void 0:null===(a=e.expirationDate)||void 0===a?void 0:a.rangeTest)||"Inserire una data di scadenza valida",e=>{if((null==e?void 0:e.includes("_"))===!1&&e.match(/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/)){let i=new Date,n=e.split("/"),o=new Date(parseInt(n[2],10),parseInt(n[1],10)-1,parseInt(n[0],10)),l=new Date;l.setDate(i.getDate()-1);let t=new Date;if(t.setFullYear(i.getFullYear()+10),o>l&&o<=t)return!0}return!1}),nationality:M.string().required(" ")})};var D=n(67862),B=n(92603),w=n(12153);function j(){let e=(0,D._)(["\n    width: 366px;\n  "]);return j=function(){return e},e}function U(){let e=(0,D._)(["\n    width: 406px;\n  "]);return U=function(){return e},e}function F(){let e=(0,D._)(["\n  margin: 0 auto;\n  width: 287px;\n\n  ","\n\n  ","\n"]);return F=function(){return e},e}function G(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: 3.25rem;\n    padding: 60px 0 ",";\n  "]);return G=function(){return e},e}function z(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: 2.8125rem;\n  "]);return z=function(){return e},e}function V(){let e=(0,D._)(["\n  padding: "," 0 ",";\n  font-family: ",";\n  text-align: center;\n  font-weight: ",";\n  font-size: 1.875rem;\n  line-height: 2.375rem;\n\n  ","\n\n  ","\n"]);return V=function(){return e},e}function Y(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: 1.875rem;\n  "]);return Y=function(){return e},e}function H(){let e=(0,D._)(["\n    margin-bottom: 40px;\n  "]);return H=function(){return e},e}function Z(){let e=(0,D._)(["\n  font-family: ",";\n  font-style: normal;\n  margin-bottom: ",";\n  text-align: center;\n  font-weight: ",";\n  font-size: ",";\n  line-height: 1.625rem;\n\n  ","\n\n  ","\n"]);return Z=function(){return e},e}function Q(){let e=(0,D._)(["\n    gap: 1.25rem;\n  "]);return Q=function(){return e},e}function W(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  gap: ",";\n\n  ","\n\n  div {\n    margin-top: 0;\n  }\n\n  p {\n    position: relative;\n    margin-bottom: 0;\n  }\n"]);return W=function(){return e},e}function K(){let e=(0,D._)(["\n    margin-top: ",";\n  "]);return K=function(){return e},e}function J(){let e=(0,D._)(["\n  display: flex;\n  font-family: ",";\n  font-style: normal;\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  margin-top: ",";\n  margin-bottom: ",";\n\n  ","\n"]);return J=function(){return e},e}let q=B.Z.div(F(),w.B.tablet(j()),w.B.desktop(U())),X=B.Z.div(V(),w.r.spacing.xl,w.r.spacing.md,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.B.tablet(G(),w.r.typography.fontSize.h1,w.r.spacing.md),w.B.desktop(z(),w.r.typography.fontSize.h2)),$=B.Z.div(Z(),w.r.typography.fontFamily.primary,w.r.spacing.xl,w.r.typography.fontWeight.regular,w.r.typography.fontSize.h6,w.B.tablet(Y(),w.r.typography.fontSize.h6),w.B.desktop(H())),ee=B.Z.div(W(),w.r.spacing.md,w.B.tablet(Q())),ei=B.Z.div(J(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.typography.fontSize.body3,w.r.typography.lineHeight.body1,w.r.spacing.md,w.r.spacing.xl,w.B.tablet(K(),w.r.spacing.lg)),en={margins:[60,30],tabletMargins:[32,15],groups:[{heights:60,marginBottom:15},{heights:90,marginBottom:32},{heights:60,repeat:4,gap:15}]};var eo=e=>{var i,n,o,l;let{data:t,nationality:r,identificationType:d,onChangeData:a,isReadonly:u,isLoading:s,setIsValidForm:v,configCms:c}=e,{owningIndividual:f}=t,{title:g,docExpirationDateLable:E,docLable:h,docNumberLable:y,errorMessage:C,countryLable:_,subtitle:S,cieEnabled:I,cieErrorMessage:T}=c,{register:A,setValue:R,getValues:M,trigger:D,formState:{isValid:B,touchedFields:w,errors:j}}=(0,L.cI)({resolver:(0,x.X)(k(null==c?void 0:c.validationMessage,I,T)),mode:"all"}),[U,F]=(0,m.useState)(0),[G]=(0,m.useState)(""),z=e=>(null==e?void 0:e.identificationType)!==""&&(null==e?void 0:e.identificationNumber)!==""&&(null==e?void 0:e.expirationDate)!==""&&(null==e?void 0:e.nationality)!=="",[V]=(0,b.q)([S||""]);(0,m.useEffect)(()=>{if(!s){let e=(0,P.N)(f),i=null==d?void 0:d.find(i=>{var n,o;return(null==i?void 0:null===(n=i.identificationType)||void 0===n?void 0:n.toLowerCase())===(null==e?void 0:null===(o=e.identificationType)||void 0===o?void 0:o.toLowerCase())}),n=z(e||void 0);f&&(R("identificationType",(null==i?void 0:i.displayName)||"",{shouldValidate:n}),R("identificationNumber",(null==e?void 0:e.identificationNumber)||"",{shouldTouch:n,shouldValidate:n}),R("expirationDate",(null==e?void 0:e.expirationDate)||"",{shouldTouch:n,shouldValidate:n}),R("nationality",(null==e?void 0:e.nationality)||"",{shouldValidate:n}))}},[s,t]);let Y=()=>{var e;let i=M(),n={...t,owningIndividual:{...f,identification:[{identificationType:(null==d?void 0:null===(e=d.find(e=>{var n,o;return(null==e?void 0:null===(n=e.displayName)||void 0===n?void 0:n.toLowerCase())===(null==i?void 0:null===(o=i.identificationType)||void 0===o?void 0:o.toLowerCase())}))||void 0===e?void 0:e.identificationType)||"",nationality:i.nationality||"",identificationNumber:i.identificationNumber||"",expirationDate:i.expirationDate||""}]}};a&&a(n,B),F(e=>e+1)};return(0,m.useEffect)(()=>{null==v||v(B)},[U,B]),(0,m.useEffect)(()=>{s||Y()},[B]),(0,p.jsx)(q,{children:s?(0,p.jsx)(N.Z,{...en}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(X,{children:g}),V&&(0,p.jsx)($,{dangerouslySetInnerHTML:{__html:V}}),(0,p.jsxs)(ee,{children:[(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.SelectInput,{label:h,setValue:()=>G,onSelectValue:e=>{R("identificationType",e),D("identificationType"),R("identificationNumber",""),D("identificationNumber"),Y()},isDisabled:s||u,errorMessage:null===(i=j.identificationType)||void 0===i?void 0:i.message,placeholder:" ",...A("identificationType",{onChange:Y}),items:(null==d?void 0:d.map(e=>(null==e?void 0:e.displayName)||""))||["Patente","Passaporto","Carta"],"data-cs-mask":""})}),(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.TextInput,{"data-cs-mask":"",label:y,placeholder:" ",autoComplete:"off",disabled:s||u,error:w.identificationNumber?null===(n=j.identificationNumber)||void 0===n?void 0:n.message:"",...A("identificationNumber",{onChange:Y})})}),(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.MaskInput,{"data-cs-mask":"",mask:"99/99/9999",label:E,placeholder:" ",autoComplete:"off",disabled:s||u,error:null===(o=j.expirationDate)||void 0===o?void 0:o.message,...A("expirationDate",{onChange:Y})})}),(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.SelectInput,{label:_,isDisabled:s||u,setValue:()=>G,onSelectValue:e=>{R("nationality",e),D("nationality"),Y()},errorMessage:w.nationality?null===(l=j.nationality)||void 0===l?void 0:l.message:"",suggestionsMaxHeight:"120px",placeholder:" ",...A("nationality",{onChange:Y}),items:r||["Italia"],"data-cs-mask":""})})]}),(0,p.jsx)(ei,{children:C})]})})},el=n(64630),et=n(96789),er=n(86465),ed=n(64854);let ea=()=>{var e;let i=new URL("".concat((0,ed.e)(),"/").concat(er.Z.RETE_MOBILE)),n=null===(e=sessionStorage)||void 0===e?void 0:e.getItem("icmp");n&&i.searchParams.set("icmp",n),window.location.href=i.toString()},eu=(e,i,n)=>{let o=(null==n?void 0:n.title)||"",l=(null==n?void 0:n.description)||"",t=(null==n?void 0:n.buttonLabel)||"",r=i,d=i;return e===et.S.FISCAL_CODE_UNDERAGE&&(l="Devi essere maggiorenne per proseguire",r=void 0,d=void 0),e===et.S.FISCAL_CODE_ERROR&&(l="Il codice fiscale non \xe8 valido. Inserisci un codice fiscale valido per proseguire",r=void 0,d=void 0),{title:o,message:l,actionText:t,onClose:r,actionEvent:d}},es=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w;return{title:(null==e?void 0:null===(o=e.personalinfomobile)||void 0===o?void 0:null===(n=o.firstCard)||void 0===n?void 0:n.title)||"",description:(null==e?void 0:null===(t=e.personalinfomobile)||void 0===t?void 0:null===(l=t.firstCard)||void 0===l?void 0:l.description)||"",firstNameLable:(null==e?void 0:null===(d=e.personalinfomobile)||void 0===d?void 0:null===(r=d.selectInput)||void 0===r?void 0:r.firstName)||"",lastNameLable:(null==e?void 0:null===(u=e.personalinfomobile)||void 0===u?void 0:null===(a=u.selectInput)||void 0===a?void 0:a.lastName)||"",fiscalCodeLable:(null==e?void 0:null===(v=e.personalinfomobile)||void 0===v?void 0:null===(s=v.selectInput)||void 0===s?void 0:s.fiscalCode)||"",buttonLabel:(null==e?void 0:null===(p=e.personalinfomobile)||void 0===p?void 0:null===(c=p.firstCard)||void 0===c?void 0:c.fcMissingLabel)||"",legacyPopup:{legacyPopupIsOpen:!0,legacyPopupTitle:(null==i?void 0:null===(f=i.commonOverride)||void 0===f?void 0:null===(m=f.legacyCtc)||void 0===m?void 0:m.title)||(null==e?void 0:null===(h=e.personalinfomobile)||void 0===h?void 0:null===(E=h.clientRecognition)||void 0===E?void 0:null===(g=E.redirect)||void 0===g?void 0:g.title)||"",legacyPopupMessage:(null==i?void 0:null===(y=i.commonOverride)||void 0===y?void 0:null===(b=y.legacyCtc)||void 0===b?void 0:b.description)||(null==e?void 0:null===(S=e.personalinfomobile)||void 0===S?void 0:null===(_=S.clientRecognition)||void 0===_?void 0:null===(C=_.redirect)||void 0===C?void 0:C.description)||"",legacyPopupActionText:(null==i?void 0:null===(T=i.commonOverride)||void 0===T?void 0:null===(I=T.legacyCtc)||void 0===I?void 0:I.buttonLabel)||(null==e?void 0:null===(L=e.personalinfomobile)||void 0===L?void 0:null===(R=L.clientRecognition)||void 0===R?void 0:null===(A=R.redirect)||void 0===A?void 0:A.buttonLabel)||"",legacyPopupUrl:(null==i?void 0:null===(O=i.commonOverride)||void 0===O?void 0:null===(N=O.legacyCtc)||void 0===N?void 0:N.buttonLabel)?(null==i?void 0:null===(P=i.commonOverride)||void 0===P?void 0:null===(x=P.legacyCtc)||void 0===x?void 0:x.url)||"":(null==i?void 0:null===(k=i.commonOverride)||void 0===k?void 0:null===(M=k.legacyCtc)||void 0===M?void 0:M.url)||(null==e?void 0:null===(w=e.personalinfomobile)||void 0===w?void 0:null===(B=w.clientRecognition)||void 0===B?void 0:null===(D=B.redirect)||void 0===D?void 0:D.url)||""}}},ev=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C;return{title:(null==e?void 0:null===(o=e.personalinfomobile)||void 0===o?void 0:null===(n=o.clientLogged)||void 0===n?void 0:null===(i=n.personalInfo)||void 0===i?void 0:i.title)||"",description:(null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:null===(t=r.clientLogged)||void 0===t?void 0:null===(l=t.personalInfo)||void 0===l?void 0:l.description)||"",bottomText:(null==e?void 0:null===(u=e.personalinfomobile)||void 0===u?void 0:null===(a=u.clientLogged)||void 0===a?void 0:null===(d=a.personalInfo)||void 0===d?void 0:d.bottomText)||"",lableName:(null==e?void 0:null===(c=e.personalinfomobile)||void 0===c?void 0:null===(v=c.clientLogged)||void 0===v?void 0:null===(s=v.personalInfo)||void 0===s?void 0:s.labelName)||"",lableFiscalCode:(null==e?void 0:null===(f=e.personalinfomobile)||void 0===f?void 0:null===(m=f.clientLogged)||void 0===m?void 0:null===(p=m.personalInfo)||void 0===p?void 0:p.lableFiscalCode)||"",action:(null==e?void 0:null===(h=e.personalinfomobile)||void 0===h?void 0:null===(E=h.clientLogged)||void 0===E?void 0:null===(g=E.personalInfo)||void 0===g?void 0:g.textAction)||"Logout",url:(null==e?void 0:null===(C=e.personalinfomobile)||void 0===C?void 0:null===(y=C.clientLogged)||void 0===y?void 0:null===(b=y.personalInfo)||void 0===b?void 0:b.url)||"https://www.vodafone.it/accediavodafone/accedi.html"}},ec=(e,i,n)=>{var o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w,j,U,F,G,z,V,Y,H,Z,Q,W;return{retriveFiscalCode:{title:(null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.fiscalCode)||void 0===o?void 0:o.title)||"",description:(null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:null===(t=r.fiscalCode)||void 0===t?void 0:t.description)||"",firstName:(null==e?void 0:null===(a=e.personalinfomobile)||void 0===a?void 0:null===(d=a.selectInput)||void 0===d?void 0:d.firstName)||"",lastName:(null==e?void 0:null===(s=e.personalinfomobile)||void 0===s?void 0:null===(u=s.selectInput)||void 0===u?void 0:u.lastName)||"",birthDate:(null==e?void 0:null===(c=e.personalinfomobile)||void 0===c?void 0:null===(v=c.selectInput)||void 0===v?void 0:v.birthdate)||"",gender:(null==e?void 0:null===(m=e.personalinfomobile)||void 0===m?void 0:null===(p=m.selectInput)||void 0===p?void 0:p.gender)||"",nationality:(null==e?void 0:null===(g=e.personalinfomobile)||void 0===g?void 0:null===(f=g.selectInput)||void 0===f?void 0:f.country)||"",birthPlace:(null==e?void 0:null===(h=e.personalinfomobile)||void 0===h?void 0:null===(E=h.selectInput)||void 0===E?void 0:E.
1city)||"",birthNation:(null==e?void 0:null===(y=e.personalinfomobile)||void 0===y?void 0:null===(b=y.selectInput)||void 0===b?void 0:b.birthNation)||"Nazione di nascita",errorMessage:(null==e?void 0:null===(_=e.personalinfomobile)||void 0===_?void 0:null===(C=_.firstCard)||void 0===C?void 0:C.allFieldsAreRequired)||"",buttonLabel:(null==e?void 0:null===(I=e.personalinfomobile)||void 0===I?void 0:null===(S=I.fiscalCode)||void 0===S?void 0:S.buttonLabel)||""},nameFiscalCodeCard:{title:(null==e?void 0:null===(A=e.personalinfomobile)||void 0===A?void 0:null===(T=A.firstCard)||void 0===T?void 0:T.title)||"",titleReadOnly:(null==e?void 0:null===(L=e.personalinfomobile)||void 0===L?void 0:null===(R=L.firstCard)||void 0===R?void 0:R.titleReadOnly)||(null==e?void 0:null===(O=e.personalinfomobile)||void 0===O?void 0:null===(N=O.firstCard)||void 0===N?void 0:N.title)||"",description:(null==e?void 0:null===(P=e.personalinfomobile)||void 0===P?void 0:null===(x=P.firstCard)||void 0===x?void 0:x.description)||"",descriptionReadOnly:(null==e?void 0:null===(k=e.personalinfomobile)||void 0===k?void 0:null===(M=k.firstCard)||void 0===M?void 0:M.descriptionReadOnly)||(null==e?void 0:null===(B=e.personalinfomobile)||void 0===B?void 0:null===(D=B.firstCard)||void 0===D?void 0:D.description)||"",firstNameLable:(null==e?void 0:null===(j=e.personalinfomobile)||void 0===j?void 0:null===(w=j.selectInput)||void 0===w?void 0:w.firstName)||"",lastNameLable:(null==e?void 0:null===(F=e.personalinfomobile)||void 0===F?void 0:null===(U=F.selectInput)||void 0===U?void 0:U.lastName)||"",fiscalCodeLable:(null==e?void 0:null===(z=e.personalinfomobile)||void 0===z?void 0:null===(G=z.selectInput)||void 0===G?void 0:G.fiscalCode)||"",buttonLabel:(null==e?void 0:null===(Y=e.personalinfomobile)||void 0===Y?void 0:null===(V=Y.firstCard)||void 0===V?void 0:V.fcMissingLabel)||""},howToModalCard:{title:n?"":(null==i?void 0:null===(Z=i.portabilitymobile)||void 0===Z?void 0:null===(H=Z.howToModal)||void 0===H?void 0:H.label)||"",description:(null==i?void 0:null===(W=i.portabilitymobile)||void 0===W?void 0:null===(Q=W.howToModal)||void 0===Q?void 0:Q.description)||""}}},ep=e=>{var i;let n=(null==e?void 0:null===(i=e.editorialconfigs)||void 0===i?void 0:i.elements)||[],o=e=>{var i,o;let l=new DOMParser,t=(null==n?void 0:null===(i=n.find(i=>i.id===e))||void 0===i?void 0:i.value)||"";return l.parseFromString((null===(o=(0,b.q)([t||""]))||void 0===o?void 0:o[0])||"","text/html").body.textContent||""};return{requiredField:o("requiredField"),validFiscalCode:o("validFiscalCode"),validName:o("validName"),validSurname:o("validSurname"),surnameMinLen:o("surnameMinLen"),validDate:o("validDate"),nameMinLen:o("nameMinLen")}};var em=n(3725),ef=n(42406);let eg=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("personal data","mobile",e),{trackView:n,trackWithNewDatalayer:o}=(0,em.rS)({event:["checkout_step1"],event_label:"personal information",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"personal information"),(0,em.qH)(n),(0,em.VI)(o),null});var eE=n(35977),eh=n(88301),eb=n(83756),ey=n(75762),eC=n(34759),e_=n(4217),eS=n(11946);let eI=e=>{var i,n,o;let{handleOnChangeEnableGoNext:l,handleOnClose:t}=e,{currentStepKey:r,checkoutErrors:d,owningData:a,findCaller:u,isLoadingCart:s,isModalButtonSticky:v,customerFlow:c,product:p,setIsStartCustomerFlow:f,setOwningData:g,setFindCaller:b,setIsReadOnly:y,setCurrentStepKey:C,serializeContext:_,deleteSerializedContext:S,setCheckoutStepState:A}=(0,E.Mg)(),R=(0,I.useQueryClient)(),L=(0,T.De)("personal data","mobile",R),N=(0,eS.DK)(),O=(0,eS.AQ)()===eS.xx.LOGGED_USER,x={...L,opts:{...L.opts},pageProductsInfo:{...L.pageProductsInfo,product_category:"mobile",product_price:"string"==typeof(null===(i=L.pageProductsInfo)||void 0===i?void 0:i.product_price)&&(null===(n=L.pageProductsInfo)||void 0===n?void 0:n.product_price.replace(".",","))}},[P,M]=(0,m.useState)(N),{isLoading:k,isError:D,errorCode:B,errorMessage:w,getFindCallerResponse:j,isInResetCustomer:U}=(0,eE.n)({fiscalCode:a.owningIndividual.fiscalCode,owningDataIsValid:!P&&(a.isValid||!1),isFlowEnabled:!s,isWinbackFlow:null==p?void 0:p.isWinback}),F=["existingLegacyCustomer","inMigration"],[G,z]=(0,m.useState)(""),V=(0,eC.CA)(eC.Jn,ey.b.CMS_GET_GENERIC_ERROR_MOBILE),Y=(0,eC.CA)(eC.Jn,ey.b.CMS_GET_PERSONAL_DATA_MOBILE),H=(0,eC.CA)(eC.Jn,ey.b.CMS_GET_PORTABILITY_MOBILE),{legacyPopup:Z}=es(Y,p),Q=ev(Y),W=ec(Y,H,null==p?void 0:p.skipMnp),K=O?k||!(null==c?void 0:null===(o=c.associateCustomer)||void 0===o?void 0:o.isSuccess):k;(0,m.useEffect)(()=>{!s&&O&&f(!0)},[s]),(0,m.useEffect)(()=>{C(h.Bf.PERSONAL_INFO),N&&setTimeout(()=>{S(),window.history.pushState(null,"",window.location.pathname),M(!1)},1e3)},[]),(0,m.useEffect)(()=>{A(h.v9.NAME_FISCAL_CODE_CARD,{})},[]);let J=()=>{l&&l(a.isValid&&!K)},q=()=>{(0,eh.uY)(R,["fiscalCodeBirthPlace","findCaller","generateOTP","verifyOTP","postCustomer","customerData","updateProductCharacteristic","validateDuplicateOrder","payMean","associateCustomer"])},X=e=>{if(((null==p?void 0:p.isFamilyPlusProduct)||(null==p?void 0:p.forceCampaign))&&!e){var i,n,o,l,t,r,a;(0,ef.YL)({event:["journey_end"],event_label:"family plus not available for not client",opts:{...x.opts,event_category:"journey",page_browser_system:"browser"},cartProduct:x.trackingProduct,visitorTrackingOpts:(0,T.bG)()}
1),null==d||null===(a=d.showAndTrackError)||void 0===a||a.call(d,V,ea,void 0,(null==p?void 0:null===(n=p.familyPlus)||void 0===n?void 0:null===(i=n.noCustomer)||void 0===i?void 0:i.title)||"",(null==p?void 0:null===(l=p.familyPlus)||void 0===l?void 0:null===(o=l.noCustomer)||void 0===o?void 0:o.message)||"",ea,(null==p?void 0:null===(r=p.familyPlus)||void 0===r?void 0:null===(t=r.noCustomer)||void 0===t?void 0:t.actionLabel)||"",void 0,void 0,v,void 0,!0)}};return(0,m.useEffect)(()=>{j&&!u.verifyOtp&&j.resultInfo&&F.includes(j.resultInfo)&&q()},[]),(0,m.useEffect)(()=>{if(j){var e,i,n,o;eh.KF.debug("FIND CALLER RESPONSE",j);let l=!a.isLogged&&!u.isVerified&&!!((null===(e=j.individualRef)||void 0===e?void 0:e.email)||(null===(i=j.individualRef)||void 0===i?void 0:i.msisdn));b({...j,showOtp:l,isVerified:!!a.isLogged}),!u.verifyOtp&&j.resultInfo&&F.includes(j.resultInfo)?((0,ef.Fk)({event_name:"checkout_step1.3",event_label_track:"coexistent popup"}),null==d||null===(o=d.showAndTrackError)||void 0===o||o.call(d,V,t,(0,eS.nQ)("findCaller",{url:"findCaller",status:"200",statusText:"ok"},void 0,void 0,"legacy customer",!1,{fiscalCode:(null==a?void 0:null===(n=a.owningIndividual)||void 0===n?void 0:n.fiscalCode)||""}),null==Z?void 0:Z.legacyPopupTitle,null==Z?void 0:Z.legacyPopupMessage,()=>{(null==Z?void 0:Z.legacyPopupUrl)?(0,eb.x)(R,null==Z?void 0:Z.legacyPopupUrl,p,t):t&&t()},null==Z?void 0:Z.legacyPopupActionText,void 0,void 0,v)):X(l)}},[j]),(0,m.useEffect)(()=>{if(U&&!N){var e;null==d||null===(e=d.showAndTrackError)||void 0===e||e.call(d,V,()=>{t&&t()},(0,eS.nQ)("resetUser",{url:"resetUser",status:"200",statusText:"200"}),"Attenzione!","Vuoi effettuare l'ordine con un altro utente?",()=>{localStorage.removeItem("customerDataCf"),_(!0),setTimeout(()=>{l&&l(!1);let e="".concat(window.location.href,"?").concat(e_.S.MODE_RESET_USER);eh.KF.debug("Redirect reset",e),window.location.href=e},1500)},"Si",()=>{t&&t()},"No",v,!0)}},[U]),(0,m.useEffect)(()=>{J()},[K,a.isLogged,a.isValid]),(0,m.useEffect)(()=>{if(D){var e,i,n;let o=B===e_.S.FISCAL_CODE_ERROR,l=eu(B,t,null==V?void 0:V.genericerror);g({...a,owningIndividual:{...a.owningIndividual,fiscalCode:B===e_.S.FISCAL_CODE_ERROR?a.owningIndividual.fiscalCode:""},isValid:!1}),q(),B!==e_.S.FISCAL_CODE_ERROR?z(""):z(()=>(null==l?void 0:l.message)||"");let u=(0,eS.nQ)("checkFiscalCode",{url:"checkFiscalCode",status:"NA",statusText:B||"error"},void 0,B,w||"Fiscal code error",!1,{fiscalCode:(null==a?void 0:null===(e=a.owningIndividual)||void 0===e?void 0:e.fiscalCode)||""});null==d||null===(n=d.showAndTrackError)||void 0===n||n.call(d,V,null==l?void 0:l.onClose,u,null==l?void 0:l.title,null==l?void 0:l.message,null==l?void 0:l.onClose,l.actionText,()=>{var e;return(0,eb.x)(R,(null==p?void 0:null===(e=p.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",p,t,r,u)},(null==p?void 0:p.removeCTC)?void 0:(null==p?void 0:null===(i=p.genericErrorCallMeNow)||void 0===i?void 0:i.label)||"",v,!0,o)}},[D]),{owningData:a,dataFromCms:Y,product:p,personalInfoConfigCms:Q,nameFiscalCodeConfigCms:W,taggingMobile:x,isErrorFiscaleCode:G,isLoading:K,isLoadingCart:s,isLoadingReset:P,isLoggedUser:O,onChangeData:(e,i)=>{let{owningIndividual:n}=e,{firstName:o,lastName:l,fiscalCode:t}=n,{owningIndividual:r}=a,{firstName:d,lastName:u,fiscalCode:s}=r;a&&g({...e}),o===d&&l===u&&t===s||(q(),y(!1),i||g({...e,isValid:!1,isLogged:!1}))},isPartnerOffer:()=>{var e;return(null==p?void 0:null===(e=p.partnerOffer)||void 0===e?void 0:e.isPartnerOffer)||!1},getPartnerOfferData:()=>{let e=(0,ey.U)(eS.Qh),i=(0,eS.nQ)("partnerOffer",{url:"getPartnerOfferData",status:"200",statusText:"ok"},void 0,void 0,"cookie partner offer not found",!0);if(!e){var n,o;null==d||null===(o=d.showAndTrackError)||void 0===o||o.call(d,V,t,i,null==Z?void 0:Z.legacyPopupTitle,null==Z?void 0:Z.legacyPopupMessage,t,null==Z?void 0:Z.legacyPopupActionText,()=>{var e;return(0,eb.x)(R,(null==p?void 0:null===(e=p.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",p,t,r,i)},(null==p?void 0:p.removeCTC)?void 0:(null==p?void 0:null===(n=p.genericErrorCallMeNow)||void 0===n?void 0:n.label)||"",v,!0)}return{...a,owningIndividual:{...null==a?void 0:a.owningIndividual,firstName:(null==e?void 0:e.firstName)||"",lastName:(null==e?void 0:e.lastName)||"",fiscalCode:(null==e?void 0:e.fiscalCode)||""}}}}};var eT=e=>{let{handleOnChangeEnableGoNext:i,handleOnClose:n}=e,{owningData:o,product:l,dataFromCms:t,personalInfoConfigCms:r,nameFiscalCodeConfigCms:d,taggingMobile:a,isLoggedUser:u,isLoading:s,isLoadingCart:v,isLoadingReset:c,isErrorFiscaleCode:m,isPartnerOffer:f,getPartnerOfferData:g,onChangeData:E}=eI({handleOnChangeEnableGoNext:i,handleOnClose:n});return(0,p.jsxs)("div",{children:[(0,p.jsx)(eg,{}),(o.isLogged||u)&&(0,p.jsx)(el.B,{data:o,isLoading:s,cmsConfig:r}),!o.isLogged&&!c&&!u&&(0,p.jsx)(el.v,{errorFiscalCode:!o.isValid&&m?m:void 0,data:f()?g():o,onChangeData:E,isLoading:null!=o&&!!o.isValid&&!!v||s,cmsConfig:d,taggingData:{trackingProduct:a.trackingProduct,opts:a.opts},isFormDisabled:(null==l?void 0:l.isAcceptedFamilyPlusProduct)||f(),isLoggedUser:u,cmsValidationConfig:ep(t)})]})},eA=n(45149),eR=n(36787),eL=n(30681),eN=n(12418),eO=n(48638),ex=n(95616);(o=a||(a={}
1))[o.MANUAL=0]="MANUAL",o[o.AUTO=1]="AUTO",o[o.MAPS=2]="MAPS",o[o.ERROR=3]="ERROR",o[o.LIST_ADDRESS=4]="LIST_ADDRESS";var eP=n(71804),eM=n(66649),ek=n(82898),eD=n(38524);let eB=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h;let b=M.object({phoneNumber:M.string().required((null==e?void 0:null===(o=e.coveragetool)||void 0===o?void 0:null===(n=o.validationMessage)||void 0===n?void 0:null===(i=n.phoneNumber)||void 0===i?void 0:i.required)||"").min(9,(null==e?void 0:null===(r=e.coveragetool)||void 0===r?void 0:null===(t=r.validationMessage)||void 0===t?void 0:null===(l=t.phoneNumber)||void 0===l?void 0:l.maximum)||"").max(10,(null==e?void 0:null===(u=e.coveragetool)||void 0===u?void 0:null===(a=u.validationMessage)||void 0===a?void 0:null===(d=a.phoneNumber)||void 0===d?void 0:d.minimum)||"").matches(/^(3)+[0-9]*$/,(null==e?void 0:null===(c=e.coveragetool)||void 0===c?void 0:null===(v=c.validationMessage)||void 0===v?void 0:null===(s=v.phoneNumber)||void 0===s?void 0:s.matches)||""),emailAddress:M.string().required((null==e?void 0:null===(f=e.coveragetool)||void 0===f?void 0:null===(m=f.validationMessage)||void 0===m?void 0:null===(p=m.emailAddress)||void 0===p?void 0:p.required)||"").email((null==e?void 0:null===(h=e.coveragetool)||void 0===h?void 0:null===(E=h.validationMessage)||void 0===E?void 0:null===(g=E.emailAddress)||void 0===g?void 0:g.email)||"")}),y=(0,eS.dO)(e);return b.concat(y)},ew=e=>{var i,n,o,l,t,r,d,a,u,s,v,c;return{roTitle:(null==e?void 0:null===(n=e.personalinfomobile)||void 0===n?void 0:null===(i=n.contactInfoRecap)||void 0===i?void 0:i.title)||"",roSubtitle:(null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.contactInfoRecap)||void 0===o?void 0:o.description)||"",roTelephoneLable:(null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:null===(t=r.contactInfoRecap)||void 0===t?void 0:t.checkTelephone)||"",roEmailLable:(null==e?void 0:null===(a=e.personalinfomobile)||void 0===a?void 0:null===(d=a.contactInfoRecap)||void 0===d?void 0:d.checkEmail)||"",roCtaTelephone:(null==e?void 0:null===(s=e.personalinfomobile)||void 0===s?void 0:null===(u=s.contactInfoRecap)||void 0===u?void 0:u.editNumber)||"",roCtaEmail:(null==e?void 0:null===(c=e.personalinfomobile)||void 0===c?void 0:null===(v=c.contactInfoRecap)||void 0===v?void 0:v.editEmail)||""}},ej=e=>{var i,n,o,l,t,r,d,a,u,s;return{title:(null==e?void 0:null===(n=e.personalinfomobile)||void 0===n?void 0:null===(i=n.contactAddress)||void 0===i?void 0:i.title)||"",subtitle:(null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.contactAddress)||void 0===o?void 0:o.subtitle)||"",telephoneLable:(null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:null===(t=r.selectInput)||void 0===t?void 0:t.telephone)||"",emailLable:(null==e?void 0:null===(a=e.personalinfomobile)||void 0===a?void 0:null===(d=a.selectInput)||void 0===d?void 0:d.email)||"",footerInfo:(null==e?void 0:null===(s=e.personalinfomobile)||void 0===s?void 0:null===(u=s.contactAddress)||void 0===u?void 0:u.checkboxLabel)||""}},eU=e=>{switch(e){case"CRM-0020":case"CRM-0024":return et.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT;case"CRM-0021":case"CRM-0023":return et.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT;case"CRM-0022":case"CRM-0025":return et.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT;default:return""}},eF=(e,i,n)=>{var o,l;let t=i.find(i=>i.error===e),r=(null==n?void 0:n.genericerror)||null;return{title:(null==t?void 0:t.title)||(null==r?void 0:r.title)||"",message:(null==t?void 0:t.message)||(null==r?void 0:r.description)||"",actionText:(null==t?void 0:null===(o=t.button)||void 0===o?void 0:o.title)||(null==r?void 0:r.buttonLabel)||"",url:(null==t?void 0:null===(l=t.button)||void 0===l?void 0:l.urlForRedirect)||""}};(l=u||(u={})).ERROR="error",l.ADD="add",l.EDIT="edit",(t=s||(s={})).EMAIL="email",t.MSISDN="phone";var eG=n(96443);function ez(){let e=(0,D._)(["\n    width: 366px;\n  "]);return ez=function(){return e},e}function eV(){let e=(0,D._)(["\n    width: 406px;\n  "]);return eV=function(){return e},e}function eY(){let e=(0,D._)(["\n  margin: 0 auto;\n  width: 287px;\n\n  ","\n\n  ","\n"]);return eY=function(){return e},e}function eH(){let e=(0,D._)(["\n    padding: 3.75rem 0 1rem;\n    font-size: ",";\n    line-height: ","; \n  "]);return eH=function(){return e},e}function eZ(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return eZ=function(){return e},e}function eQ(){let e=(0,D._)(["\n  padding: 2rem 0 1rem;\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n"]);return eQ=function(){return e},e}function eW(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return eW=function(){return e},e}function eK(){let e=(0,D._)(["\n    margin-bottom: ",";\n  "]);return eK=function(){return e},e}function eJ(){let e=(0,D._)(["\n  font-family: ",";\n  font-style: normal;\n  margin-top: ",";\n  margin-bottom: ",";\n  text-align: center;\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n"]);return eJ=function(){return e},e}function eq(){let e=(0,D._)(["\n  text-align: left;\n  margin: 0 0 ",";\n  font-size: ",";\n  line-height: ",";\n"]);return eq=function(){return e},e}function eX(){let e=(0,D._)(["\n    gap: ","; \n  "]);return eX=function(){return e},e}function e$(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n\n  div {\n    margin-top: 0;\n  }\n\n  p {\n    position: relative;\n  }\n\n  gap: ",";\n\n  ","\n"]);return e$=function(){return e},e}function e0(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  font-style: normal;\n  line-height: ",";\n  margin-top: ",";\n  margin-bottom: ",";\n  display: flex;\n  flex-direction: row;\n"]);return e0=function(){return e},e}function e1(){let e=(0,D._)(["\n  margin-top: ",";\n"]);return e1=function(){return e},e}function e2(){let e=(0,D._)(["\n  width: fit-content;\n  text-align: start;\n"]);return e2=function(){return e},e}function e5(){let e=(0,D._)(["\n  display: flex;\n  width: 25px;\n  margin-right: ",";\n"]);return e5=function(){return e},e}function e3(){let e=(0,D._)(["\n  input {\n    position: absolute;\n    margin: 0 auto;\n    opacity: 0;\n    cursor: pointer;\n    height: 20px;
1\n    width: 20px;\n    z-index: 3;\n  }\n\n  .checkmark::after {\n    left: 7px;\n    top: 3px;\n    width: 5px;\n    height: 10px;\n    border: solid white;\n    border-width: 0 2px 2px 0;\n    transform: rotate(45deg);\n    content: '';\n    position: absolute;\n    display: none;\n  }\n\n  .checkmark {\n    position: absolute;\n    height: ",";\n    width: ",";\n    border-radius: ",";\n    border: 1px solid ",";\n  }\n\n  &:hover input ~ .checkmark {\n    border: 1px solid ",";\n  }\n\n  input:checked ~ .checkmark {\n    background-color: #00697c;\n    border: none;\n  }\n\n  input:checked ~ .checkmark::after {\n    display: block;\n  }\n"]);return e3=function(){return e},e}function e6(){let e=(0,D._)(["\n    gap: ",";\n    margin-bottom: ","; \n  "]);return e6=function(){return e},e}function e4(){let e=(0,D._)(["\n    margin-bottom: ","; \n  "]);return e4=function(){return e},e}function e7(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  align-items: flex-start;\n  gap: ",";\n\n  ","\n\n  ","\n"]);return e7=function(){return e},e}function e9(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return e9=function(){return e},e}function e8(){let e=(0,D._)(["\n  text-align: left;\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  p {\n    margin: 0 0 8px;\n    color: ",";\n    overflow-wrap: break-word;\n    word-wrap: break-word;\n    word-break: break-all;\n  }\n\n  div {\n    justify-content: flex-start;\n  }\n"]);return e8=function(){return e},e}let ie=B.Z.div(eY(),eG.BC.tablet(ez()),eG.BC.desktop(eV())),ii=B.Z.div(eQ(),eG.rS.typography.fontFamily.primary,eG.rS.typography.fontWeight.extrabold,eG.rS.typography.fontSize.display5,eG.rS.typography.lineHeight.display5,eG.BC.tablet(eH(),eG.rS.typography.fontSize.display4,eG.rS.typography.lineHeight.display4),eG.BC.desktop(eZ(),eG.rS.typography.fontSize.display4,eG.rS.typography.lineHeight.display4)),io=B.Z.div(eJ(),eG.rS.typography.fontFamily.primary,eG.rS.spacing.md,eG.rS.spacing.xl,eG.rS.typography.fontWeight.regular,eG.rS.typography.fontSize.h6,eG.rS.typography.lineHeight.h6,eG.BC.tablet(eW(),eG.rS.typography.fontSize.h6,eG.rS.typography.lineHeight.h6),eG.BC.desktop(eK(),eG.rS.spacing["2xl"]));(0,B.Z)(io)(eq(),eG.rS.spacing.md,eG.rS.typography.fontSize.body2,eG.rS.typography.lineHeight.body2);let il=B.Z.div(e$(),eG.rS.spacing.md,eG.BC.tablet(eX(),eG.rS.spacing.lg)),it=B.Z.div(e0(),eG.rS.typography.fontFamily.primary,eG.rS.typography.fontWeight.regular,eG.rS.typography.fontSize.body3,eG.rS.typography.lineHeight.body3,eG.rS.spacing.xl,eG.rS.spacing.xl);B.Z.div(e1(),eG.rS.spacing.md);let ir=B.Z.div(e2()),id=B.Z.div(e5(),eG.rS.spacing.sm),ia=B.Z.div(e3(),eG.rS.iconSize.sm,eG.rS.iconSize.sm,eG.rS.spacing.xs,eG.rS.colors.interactive.disabled,eG.rS.colors.interactive.disabled),iu=B.Z.div(e7(),eG.rS.spacing.lg,eG.BC.tablet(e6(),eG.rS.spacing.xl,eG.rS.spacing.xs),eG.BC.desktop(e4(),eG.rS.spacing.sm)),is=B.Z.div(e8(),eG.rS.typography.fontWeight.extrabold,eG.rS.typography.fontSize.body1,eG.rS.typography.lineHeight.body1,eG.BC.tablet(e9(),eG.rS.typography.fontSize.h6,eG.rS.typography.lineHeight.h6),eG.DH.cyanDark);var iv=n(95956);let ic=e=>{var i;let n=null==e?void 0:null===(i=e.owningIndividual)||void 0===i?void 0:i.contactMedium;if(n&&n.length>0){let e=n.find(e=>"email"===e.type),i=n.find(e=>"phone"===e.type);(null==e?void 0:e.emailAddress)?localStorage.setItem(iv.e,e.emailAddress):localStorage.removeItem(iv.e),(null==i?void 0:i.phoneNumber)?localStorage.setItem(iv.j,i.phoneNumber):localStorage.removeItem(iv.j)}};var ip=n(38037);function im(){let e=(0,D._)(["\n  margin-top: ",";\n"]);return im=function(){return e},e}function ig(){let e=(0,D._)(["\n  margin: 0 auto;\n  width: 287px;\n\n  @media (min-width: ",") {\n    width: 366px;\n  }\n\n  @media (min-width: ",") {\n    width: 406px;\n  }\n"]);return ig=function(){return e},e}function iE(){let e=(0,D._)(["\n    gap: ",";\n  "]);return iE=function(){return e},e}function ih(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n\n  div {\n    margin-top: 0;\n  }\n\n  p {\n    position: relative;\n  }\n\n  gap: ",";\n\n  ","\n"]);return ih=function(){return e},e}function ib(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return ib=function(){return e},e}function iy(){let e=(0,D._)(["\n    margin-bottom: ",";\n  "]);return iy=function(){return e},e}function iC(){let e=(0,D._)(["\n  font-family: ",";\n  font-style: normal;\n  margin-top: ",";\n  margin-bottom: ",";\n  text-align: center;\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n"]);return iC=function(){return e},e}function i_(){let e=(0,D._)(["\n  text-align: left;\n  margin: 0 0 ",";\n  font-size: ",";\n  line-height: ",";\n"]);return i_=function(){return e},e}let iS=B.Z.div(im(),w.r.spacing.md),iI=B.Z.div(ig(),ip.A.tablet,ip.A.desktop),iT=B.Z.div(ih(),w.r.spacing.md,w.B.tablet(iE(),w.r.spacing.lg)),iA=B.Z.div(iC(),w.r.typography.fontFamily.primary,w.r.spacing.md,w.r.spacing.xl,w.r.typography.fontWeight.regular,w.r.typography.fontSize.body3,w.r.typography.lineHeight.body3,w.B.tablet(ib(),w.r.typography.fontSize.body3,w.r.typography.lineHeight.body3),w.B.desktop(iy(),w.r.spacing.xl)),iR=(0,B.Z)(iA)(i_(),w.r.spacing.md,w.r.typography.fontSize.body3,w.r.typography.lineHeight.body3);var iL=n(16053),iN=n(13630),iO=n(74191),ix=n(38004),iP=n(36172),iM=n(85363);let ik=e=>{let i="";return Object.values(e).map(e=>(e&&(i=i.concat(e,", ")),null)),i};var iD=n(54751);let iB=e=>{var i,n;let{state:o,onChangeData:l,onChangeCompleteAddress:t,onChangeHiddenStreetNumber:r,handleOpenModal:d}=e,{isDesktop:a}=(0,iP.h)(),u=(0,iN.q)(),[s,v]=(0,m.useState)(""),[c,p]=(0,m.useState)(""),[f,g]=(0,m.useState)(!1),[E,h]=(0,m.useState)(!1),b=(0,e
1C.CA)(eC.y7,iO.b.CMS_GET_COVERAGE_TOOL_CONFIG),y=(0,eC.CA)(eC.y7,iO.b.CMS_GET_EDIT_ADDRESS),{labels:{addressInputPlaceHolderAutocomplete:C}}=(0,eR.kk)(null==y?void 0:y.editaddressconfig),_=(null==b?void 0:null===(n=b.coveragetool)||void 0===n?void 0:null===(i=n.geolocalization)||void 0===i?void 0:i.alertError)||"",S={placeId:!1,streetNumber:!0};void 0!==o.isHiddenStreetNumber?S.streetNumber=o.isHiddenStreetNumber:(null==o?void 0:o.street)!==""&&(null==o?void 0:o.streetNumber)!==""&&(S.streetNumber=!1);let[I,T]=(0,m.useState)(S),{control:A,register:R,watch:N,setValue:O,getValues:x,trigger:P,formState:{errors:M}}=(0,L.Gc)(),k=async e=>await (0,ix.Bz)(e),D=async(e,i)=>{if(e){let i=await k(e);i&&((null==i?void 0:i.streetNumber)?(O("streetNumber",i.streetNumber),null==l||l()):(T(e=>({...e,streetNumber:!1})),null==r||r(!1)),O("placeId",e),i.city&&O("city",i.city),i.postalCode&&O("postalCode",i.postalCode),i.street&&O("street",i.street),i.stateOrProvince&&O("stateOrProvince",i.stateOrProvince),v(i.latitude),p(i.longitude),await P(["city","postalCode","street","stateOrProvince"]));let n={...x(),latitude:parseFloat((null==i?void 0:i.latitude)||s),longitude:parseFloat((null==i?void 0:i.longitude)||c)};u.mutate(n),null==l||l()}else if(!e&&i){let e=await (0,iD.rp)(i);if(e){v(e.latitude),p(e.longitude),e.placeId&&O("placeId",e.placeId),e.streetNumber&&O("streetNumber",e.streetNumber),e.city&&O("city",e.city),e.postalCode&&O("postalCode",e.postalCode),e.street&&O("street",e.street),e.stateOrProvince&&O("stateOrProvince",e.stateOrProvince),await P();let i={...x(),latitude:e.latitude?parseFloat(e.latitude):0,longitude:e.longitude?parseFloat(e.longitude):0};u.mutate(i),null==l||l()}}};(0,m.useEffect)(()=>{u.reset(),g(!1)},[]);let B=N("placeId"),w=N("streetNumber");return(0,m.useEffect)(()=>{if(B&&!w&&I.streetNumber)D(B).catch(e=>{iM.K.debug(e)});else if(B&&w){let e=x();D(null,ik({city:e.city,postalCode:e.postalCode,stateOrProvince:e.stateOrProvince,street:e.street,streetNumber:w})).catch(e=>{iM.K.debug(e)})}},[B,w,I.streetNumber,O]),(0,m.useEffect)(()=>{B||O("streetNumber","")},[B]),{control:A,register:R,errors:M,isDesktop:a,hiddenFields:I,isFormDisabled:f,isLoadingGeolocation:E,errorMessageGeolocalizzation:_,addressInputPlaceHolderAutocomplete:C,onIconClick:()=>{O("streetNumber",""),O("postalCode",""),O("stateOrProvince",""),O("city",""),O("street",""),O("placeId",void 0),T({placeId:!1,streetNumber:!0}),null==r||r(!0),null==l||l()},findPosition:async e=>((0,iO.d)("click geolocalization"),new Promise(i=>{var n,o;(0,iL.fK)(null==e?void 0:null===(n=e.coords)||void 0===n?void 0:n.latitude,null==e?void 0:null===(o=e.coords)||void 0===o?void 0:o.longitude).then(e=>{let n={street:"",city:"",province:"",postalCode:""};void 0!==e&&(T(e=>({...e,streetNumber:!1})),null==r||r(!1),n=(0,iD.Jg)(e)),i(n),n.latitude&&v(n.latitude),n.longitude&&p(n.longitude),n.streetNumber&&O("streetNumber",n.streetNumber),n.postalCode&&O("postalCode",n.postalCode),n.province&&O("stateOrProvince",n.province.toUpperCase()),n.city&&O("city",n.city.toUpperCase()),n.street&&O("street",n.street),n.placeId&&O("placeId",n.placeId)}).catch(e=>{iM.K.debug(e)})})),handleLoadingGeolocation:e=>{h(e)},handlePlaceIdChange:e=>i=>{T(e=>({...e,streetNumber:!0})),null==r||r(!0),e(i)},handleStreetNumberChange:()=>{let e={...x()};u.mutate(e),null==l||l()}}};var iw=e=>{var i;let{labels:n,onChangeCompleteAddress:o,handleOpenModal:l}=e,{control:t,register:r,errors:d,isDesktop:a,hiddenFields:u,isFormDisabled:s,isLoadingGeolocation:v,errorMessageGeolocalizzation:c,addressInputPlaceHolderAutocomplete:m,onIconClick:f,findPosition:g,handleLoadingGeolocation:E,handlePlaceIdChange:h,handleStreetNumberChange:b}=iB(e);return(0,p.jsxs)(iS,{children:[(0,p.jsx)(iR,{children:null==n?void 0:n.description}),(0,p.jsx)(iI,{children:(0,p.jsxs)(iT,{children:[(0,p.jsx)(L.Qr,{control:t,name:"placeId",render:i=>{let{field:{onChange:t,onBlur:r,ref:d}}=i;return(0,p.jsx)(O.Z.AddressInput,{label:(null==n?void 0:n.deliveryAddress)||"",onChange:h(t),changeValue:e=>{null==o||o(e)},defaultValue:e.state.completeAddress||"",hidden:u.placeId,autoFocus:a,autoComplete:"off",onIconClick:f,onBlur:r,"data-cs-mask":"",ref:d,disabled:s||v,findPosition:g,onChangeGeolocation:E,errorMessage:c,placeholderAutocomplete:{enabled:!0,label:m,action:l}})}}),(0,p.jsx)(O.Z.TextInput,{placeholder:" ",label:(null==n?void 0:n.civicNumber)||"",hidden:u.streetNumber,error:u.streetNumber?" ":null===(i=d.streetNumber)||void 0===i?void 0:i.message,autoFocus:!0,autoComplete:"off","data-cs-mask":"",disabled:s,...r("streetNumber",{onChange:b})})]})})]})};let ij={placeId:"",city:"",postalCode:"",stateOrProvince:"",streetNumber:"",street:"",completeAddress:"",typeCoverage:a.AUTO};var iU=e=>{var i,n,o,l,t,r;let{data:d,address:a,onChangeData:v,checkInfo:c,onChangeCheck:f,showEditMail:g=!0,setIsValidForm:h}=e,b=(0,I.useQueryClient)(),{owningIndividual:y}=d,C=(0,eC.CA)(eC.Jn,ex.bl.CMS_GET_PERSONAL_DATA_MOBILE),_=(0,eC.CA)(eC.Jn,ex.bl.CMS_GET_COVERAGE_TOOL_MOBILE_CONFIG),S=(0,eC.CA)(eC.Jn,ex.bl.CMS_GET_EDIT_ADDRESS_MOBILE),T=(0,eR.lf)(S),{currentStepKey:A,product:R,owningData:N,checkoutErrors:P,findCaller:M,isModalButtonSticky:k,setOwningData:D,setBillingEmail:B}=(0,E.Mg)(),[w,j]=(0,m.useState)((null==a?void 0:a.completeAddress)||""),[U,F]=(0,m.useState)(null==a?void 0:a.isHiddenStreetNumber),[G,z]=(0,m.useState)(!1),{isError:V,error:Y,mutateAsync:H}=(0,eL.n)(),[Z,Q]=(0,m.useState)({isOpen:!1,type:s.EMAIL,operationType:u.EDIT}),[W,K]=(0,m.useState)({email:-2,phone:-2}),J=()=>{var e,i;let{owningIndividual:n}=N,o=null==n?void 0:null===(e=n.contactMedium)||void 0===e?void 0:e.find(e=>e.type===s.MSISDN),l=null==n?void 0:null===(i=n.contactMedium)||void 0===i?void 0:i.find(e=>e.type===s.EMAIL);return!!((null==o?void 0:o.phoneNumber)&&(null==l?void 0:l.emailAddress)&&"3"===o.phoneNumber.substring(0,1))},q=()=>{var e,i,n,o;let{owningIndividual:l}=N,t=null==l?void 0:null===(e=l.contactMedium)||void 0===e?void 0:e.find(e=>e.type===s.MSISDN),r=null==l?void 0:null===(i=l.contactMedium)||void 0===i?void 0:i.find(e=>e.type===s.EMAIL),d=null==N?void 0:null===(n=N.address)||void 0===n?void 0:n.placeId,a=null==N?void 0:null===(o=N.address)||void 0===o?void 0:o.streetNumber;return!!((null==t?void 0:t.phoneNumber)&&(null==r?void 0:r.emailAddress)&&"3"===t.phoneNumber.substring(0,1)&&d&&a&&""!==a)},[X,$]=(0,m.useState)(!1),ee=(0,eC.CA)(eC.Jn,ex.bl.CMS_GET_GENERIC_ERROR_MOBILE),{errorcomponent:ei}=(0,eC.CA)(eC.Jn,ex.bl.CMS_GET_CUSTOMER_ERROR_MOBILE)||{},en=(0,L.cI)({resolver:(0,x.X)(eB(_)),defaultValues:{...0===Object.keys(a).length?ij:a},mode:"all"}),{register:eo,getValues:el,setValue:et,formState:{isValid:er,errors:ed},trigger:ea}=en,eu=()=>{z(!0),(0,ex.Fk)({event_name:"view",event_label_track:"manual address input",event_category:"tools",page_type:"address"})},es=(e,i,n)=>{var o,l;
1if(!y.contactMedium)return;null==y||y.contactMedium.push(e===s.EMAIL?{type:e,preferred:n,emailAddress:i}:{type:e,preferred:n,phoneNumber:i});let t=(null!==(l=null==y?void 0:null===(o=y.contactMedium)||void 0===o?void 0:o.length)&&void 0!==l?l:0)-1;e===s.EMAIL?W.email=t:W.phone=t,K(W),D({...N,owningIndividual:y})},ev=e=>{let i=-2;return(null==y?void 0:y.contactMedium)&&-1===(i=null==y?void 0:y.contactMedium.findIndex(i=>i.type===e&&i.preferred))&&-1===(i=null==y?void 0:y.contactMedium.findIndex(i=>i.type===e))&&es(e,"",!0),i},ec=()=>{var e,i,n,o;let l=ev(s.EMAIL),t=ev(s.MSISDN),r=(null==y?void 0:null===(i=y.contactMedium)||void 0===i?void 0:null===(e=i[l])||void 0===e?void 0:e.emailAddress)||"",d=(null==y?void 0:null===(o=y.contactMedium)||void 0===o?void 0:null===(n=o[t])||void 0===n?void 0:n.phoneNumber)||"";-1!==l&&(W.email=l,et("emailAddress",r,{shouldValidate:""!==r})),-1!==t&&(W.phone=t,et("phoneNumber",d,{shouldValidate:""!==d})),K(W)};(0,m.useEffect)(()=>{var e,i;N.isLogged&&setTimeout(()=>{v&&v({...d,owningIndividual:y},J())},250),N.isValid&&(null==N?void 0:null===(e=N.address)||void 0===e?void 0:e.placeId)!==void 0&&(null==N?void 0:null===(i=N.address)||void 0===i?void 0:i.streetNumber)!==""&&setTimeout(()=>{v&&v({...d,owningIndividual:y},q())},250)},[]),(0,m.useEffect)(()=>{ec();let e={...el(),completeAddress:w,isHiddenStreetNumber:U};delete e.emailAddress,delete e.phoneNumber,localStorage.setItem("emailAddress",JSON.stringify(el("emailAddress"))),localStorage.setItem("phoneNumber",JSON.stringify(el("phoneNumber"))),v&&v({...d,owningIndividual:y,address:e},er)},[er,w]),(0,m.useEffect)(()=>{null==h||h(er)},[er]),(0,m.useEffect)(()=>{if(V&&Z.operationType!==u.ERROR){var e,i,n;let o=eF(eU((null===(e=Y.headers)||void 0===e?void 0:e.get("ERR-backendErrorCode"))||""),(null==ei?void 0:ei.errors)||[],ee),l=V&&Y?(0,eS.nQ)(e_.S.PATCH_CUSTOMER,Y,e_.S.PATCH_CUSTOMER):void 0;null==P||null===(n=P.showAndTrackError)||void 0===n||n.call(P,ee,()=>{},l,null==o?void 0:o.title,null==o?void 0:o.message,()=>{},null==o?void 0:o.actionText,()=>{var e;return(0,eO.x)(b,(null==R?void 0:null===(e=R.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",R,()=>{},A,l)},(null==R?void 0:R.removeCTC)?"":(null==R?void 0:null===(i=R.genericErrorCallMeNow)||void 0===i?void 0:i.label)||"",k,!0)}},[V]);let{footerInfo:ep,subtitle:em,title:ef,telephoneLable:eg,emailLable:eE}=ej(C),eh=ew(C),eb=()=>{Q({isOpen:!1,operationType:u.EDIT,type:s.EMAIL})},ey=e=>{$(!0),H([{updatedValue:e.value,type:"number",operation:"replace",index:1}]).then(()=>{(null==y?void 0:y.contactMedium)&&(null==y||y.contactMedium.forEach((i,n)=>{var o;i.type===s.MSISDN&&(null==y?void 0:null===(o=y.contactMedium)||void 0===o?void 0:o[n])&&(y.contactMedium[n].phoneNumber=e.value)}));let i={...d,owningIndividual:y};D({...i}),ic({...i}),$(!1),eb()}).catch(e=>{$(!1),eO.K.debug(e)})},eI=()=>{var e;return null===(e=M.subscription)||void 0===e?void 0:e.filter(e=>"M"===e.serviceType).map(e=>({type:"phone",preferred:!1,phoneNumber:e.msisdn}))},eT=()=>{var e;return!(!eI()||eI()&&(null===(e=eI())||void 0===e?void 0:e.length)===0)},eG=(e,i)=>{Q({isOpen:!0,type:e,operationType:i})},ez=()=>{let e=el(),i={...e,completeAddress:w,isHiddenStreetNumber:U};(null==y?void 0:y.contactMedium)&&(y.contactMedium[W.email].emailAddress=e.emailAddress,y.contactMedium[W.phone].phoneNumber=e.phoneNumber),delete i.emailAddress,delete i.phoneNumber,v&&v({...d,owningIndividual:y,address:i},er)},eV=e=>{" "===e.key&&e.preventDefault()};return(0,p.jsxs)(ie,{children:[(0,p.jsx)(ii,{children:(0,eS.gp)()?eh.roTitle:ef}),(0,p.jsx)(io,{children:(0,eS.gp)()?eh.roSubtitle:em}),(0,eS.gp)()?(0,p.jsxs)(iu,{children:[(0,p.jsxs)(is,{children:[eh.roTelephoneLable,(0,p.jsx)("p",{"data-cs-mask":"",children:(null==y?void 0:y.contactMedium)&&-2!==W.phone?null==y?void 0:null===(n=y.contactMedium[W.phone])||void 0===n?void 0:n.phoneNumber:""}),(0,p.jsx)(eP.Z,{onClick:()=>{(0,ex.dw)(null==eh?void 0:eh.roCtaTelephone),eG(s.MSISDN,eT()?u.ADD:u.EDIT)},text:eh.roCtaTelephone})]}),(0,p.jsxs)(is,{children:[eh.roEmailLable,(0,p.jsx)("p",{"data-cs-mask":"",children:(null==y?void 0:y.contactMedium)&&-2!==W.email?null==y?void 0:null===(o=y.contactMedium[W.email])||void 0===o?void 0:o.emailAddress:""}),g&&(0,p.jsx)(eP.Z,{onClick:()=>{(0,ex.dw)(null==eh?void 0:eh.roCtaEmail),eG(s.EMAIL,u.EDIT)},text:eh.roCtaEmail})]})]}):(0,p.jsxs)(L.RV,{...en,children:[(0,p.jsxs)(il,{children:[(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.TextInput,{id:"phoneNumber","data-cs-mask":"",label:eg,error:null===(l=ed.phoneNumber)||void 0===l?void 0:l.message,autoComplete:"off",placeholder:eg,"aria-label":eg,...eo("phoneNumber",{onChange:ez})})}),(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.TextInput,{id:"emailAddress","data-cs-mask":"",label:eE,type:"email",error:null===(t=ed.emailAddress)||void 0===t?void 0:t.message,autoComplete:"off",placeholder:eE,"aria-label":eE,onKeyDown:e=>eV(e),...eo("emailAddress",{onChange:e=>{et("emailAddress",e.target.value.replace(/\s+/g,"")),null==ez||ez()}})})})]}),(null==C?void 0:null===(r=C.personalinfomobile)||void 0===r?void 0:r.contactAddress)&&(()=>{var e;let i=(0,p.jsx)(iw,{handleOpenModal:eu,labels:(null==C?void 0:null===(e=C.personalinfomobile)||void 0===e?void 0:e.contactAddress)||eA.h,state:0===Object.keys(a).length?ij:a,onChangeData:()=>ez(),onChangeCompleteAddress:e=>{j(e)},onChangeHiddenStreetNumber:e=>{F(e)}});return G?null:i})(),(0,p.jsx)(ek.Z,{isOpen:G,handleClose:()=>z(!1),children:(0,p.jsx)(eD.Z,{cmsConfig:T,onSubmit:(e,i)=>{let n="".concat(null==e?void 0:e.street,", ").concat(null==e?void 0:e.streetNumber,", ").concat(null==e?void 0:e.city,", ").concat(null==e?void 0:e.stateOrProvince);null==v||v({...d,address:{...e,placeId:i.placeId,completeAddress:n,isHiddenStreetNumber:!0},isValid:er},er),j(n),null==h||h(q()),et("city",e.city),et("placeId",i.placeId),et("postalCode",e.postalCode),et("stateOrProvince",e.stateOrProvince),et("street",e.street),et("streetNumber",e.streetNumber),et("completeAddress",n),ea(),z(!1)},state:a})})]}),(0,p.jsxs)(it,{children:[(0,p.jsx)(id,{children:(0,p.jsx)(ia,{children:(0,p.jsxs)("label",{htmlFor:"checkContactProblem",children:[(0,p.jsx)("input",{id:"checkContactProblem",type:"checkbox",checked:c.checkContactProblem,onChange:()=>{f({checkContactProblem:!(null==c?void 0:c.checkContactProblem)})},"aria-label":ep,role:"checkbox"}),(0,p.jsx)("span",{className:"checkmark"})]})})}),(0,p.jsx)(ir,{children:ep})]}),(0,p.jsx)(ek.Z,{isOpen:Z.isOpen&&Z.operationType===u.ADD,handleClose:eb,children:(0,p.jsxs)(p.Fragment,{children:[X&&(0,p.jsx)(eM.Z,{}),(0,p.jsx)(eN.E,{"data-cs-mask":"",onChangeNumber:ey,isLoading:X,data:eI(),selectedNumber:(null==y?void 0:null===(i=y.contactMedium)||void 0===i?void 0:i[1].phoneNumber)||""})]})}),(0,p.jsx)(ek.Z,{isOpen:Z.isOpen&&Z.operationType===u.EDIT,handleClose:eb,children:(0,p.jsxs)(p.Fragment,{children:[X&&(0,p.jsx)(eM.Z,{}),(0,p.jsx)(eN.B,{"data-cs-mask":"",isLoading:X,onSubmit:e=>{e.phoneNumber?ey({title:"",value:e.phoneNumber}):($(!0),H([{updatedValue:e.email,type:"email",operation:"replace",index:0}]).then(()=>{(null==y?void 0:y.contactMedium)&&(y.contactMedium[W.email].emailAddress=e.email);let i={...d,owningIndividual:y};D({...i}),localStorage.setItem(iv.e,(null==e?void 0:e.email)||""),B((null==e?void 0:e.email)||""),ic({...i}),$(!1),eb()}).catch(e=>{$(!1),eO.K.debug(e)}))},handleClose:eb,isPhone:Z.type===s.MSISDN})]})})]})},iF=n(4679),iG=n(2985),iz=n(62606),iV=n(52107),iY=n(21302);function iH(){let e=(0,D._)(["\n    padding: 0 40px;\n    height: 737px;\n  "]);return iH=function(){return e},e}function iZ(){let e=(0,D._)(["\n    padding: 0 74px;\n  "]);return iZ=function(){return e},e}function iQ(){let e=(0,D._)(["\n  padding: 0 20px;\n  text-align: center;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  height: 492px;\n\n  ","\n\n  ","\n"]);return iQ=function(){return e},e}function iW(){let e=(0,D._)(["\n    width: 100%;\n    margin-left: 0;\n    margin-right: 0;\n  "]);return iW=function(){return e},e}function iK(){let e=(0,D._)(["\n  height: 30px;\n\n  ","\n"]);return iK=function(){return e},e}function iJ(){let e=(0,D._)(["\n    @-moz-document url-prefix() {\n      zoom: 115%;\n    }\n  "]);return iJ=function(){return e},e}function iq(){let e=(0,D._)(["\n    @-moz-document url-prefix() {\n      zoom: 130%;\n    }\n  "]);return iq=function(){return e},e}function iX(){let e=(0,D._)(["\n  @-moz-document url-prefix() {\n    zoom: 0;\n  }\n\n  ","\n\n  ","\n"]);return iX=function(){return e},e}let i$=B.Z.div(iQ(),iY.B.tablet(iH()),iY.B.desktop(iZ())),i0=B.Z.div(iK(),iY.B.tablet(iW())),i1=B.Z.div(iX(),iY.B.tablet(iJ()),iY.B.desktop(iq()));var i2=()=>{var e;let{product:i,currentStepKey:n,setCheckoutStepState:o}=(0,E.Mg)(),l=()=>{var e,o,l,t,r,d;
1switch(n){case h.Bf.TERMS_AND_CONDITIONS:case h.Bf.DELIVERY_ADDRESS:return(null==i?void 0:null===(e=i.loaders)||void 0===e?void 0:e.yourAddressCard)||"";case h.Bf.PAYMENT_METHOD:case h.Bf.RECURRENT_PAYMENT_CARD:case h.Bf.UPFRONT_PAYMENT:return(null==i?void 0:null===(o=i.loaders)||void 0===o?void 0:o.choosePayment)||(null==i?void 0:null===(l=i.loaders)||void 0===l?void 0:l.shoppingCart)||"";default:return(null==i?void 0:null===(t=i.loaders)||void 0===t?void 0:t.shoppingCart)||(null==i?void 0:null===(r=i.loaders)||void 0===r?void 0:r.yourAddressCard)||(null==i?void 0:null===(d=i.loaders)||void 0===d?void 0:d.choosePayment)||""}},t=()=>{iV.datadogRum.addError({step:n,message:"La pagina sembra non rispondere in questo momento. Attendi o premi il tasto in basso per essere ricontattato.",error:"stuck"})};return((0,m.useEffect)(()=>{let e=setInterval(()=>{t()},12e4);return()=>clearInterval(e)},[]),(0,m.useEffect)(()=>{o(h.v9.LOADING_CARD,{})},[]),l())?(0,p.jsxs)(i$,{children:[(0,p.jsx)(i0,{}),(0,p.jsx)(i1,{children:(0,p.jsx)(iz.J5,{src:(null===(e=(0,iF.o)(l()
1))||void 0===e?void 0:e.src)||"",loop:!0,autoplay:!0})})]}):(0,p.jsx)(iG.Z,{quantity:2,heights:90})},i5=n(29927),i3=n(58676),i6=e=>{let i=(0,I.useQueryClient)(),n=(0,T.De)("loading offer","mobile",i);return(0,i3.r)({event:["view"],event_label:"loading offer",opts:null==n?void 0:n.opts,cartProduct:null==n?void 0:n.trackingProduct,pageProduct:null==n?void 0:n.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()}),(0,p.jsx)(i5.Z,{...e})},i4=n(36506),i7=n(52258);(r=v||(v={})).OFFER_STEP="offerStep",r.DETAILS_STEP="detailsStep";var i9=n(83144),i8=n(64185),ne=n(95125);function ni(){let e=(0,D._)(["\n  b {\n    font-family: ",";\n    font-weight: ",";\n  }\n\n  img {\n    cursor: text;\n    vertical-align: baseline;\n  }\n\n  a {\n    color: ",";\n    font-weight: ",";\n\n    &:hover {\n      color: ",";\n    }\n  }\n\n  button {\n    font-family: ",";\n    font-weight: ",";\n    font-size: ",";\n    \n    color: ",";\n    background: none;\n    border: none;\n    padding: 0;\n    outline: inherit;\n\n    span {\n      font-family: ",";\n      font-weight: ",";\n      color: ","; \n      background-color: ",";\n      padding-left: ",";\n      padding-right: ",";\n      border-radius: 50%;\n      cursor: pointer;\n    }\n\n    &:hover {\n      span {\n        background-color: ",";\n      }\n    }\n\n    &:active {\n      span {\n        background-color: ",";\n      }\n    }\n  }\n"]);return ni=function(){return e},e}function nn(){let e=(0,D._)(["\n  margin-bottom: ",";\n  margin-top: ",";\n  font-family: ",";\n  font-weight: ",";\n"]);return nn=function(){return e},e}function no(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: ",";\n  margin-bottom: ",";\n"]);return no=function(){return e},e}function nl(){let e=(0,D._)(["\n    flex-direction: row;\n    justify-content: center;\n\n    div {\n      width: 300px;\n    }\n  "]);return nl=function(){return e},e}function nt(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  gap: ",";\n  width: 100%;  \n  position: absolute;\n  bottom: ",";\n  max-width: 80%;\n  \n  ","\n"]);return nt=function(){return e},e}function nr(){let e=(0,D._)(["\n  margin: 0;\n"]);return nr=function(){return e},e}function nd(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return nd=function(){return e},e}function na(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  color: ",";\n  ","\n"]);return na=function(){return e},e}function nu(){let e=(0,D._)(["\n    margin-top: ","; \n    margin-bottom: ",";\n  "]);return nu=function(){return e},e}function ns(){let e=(0,D._)(["\n    margin-top: ","; \n    margin-bottom: ",";\n  "]);return ns=function(){return e},e}function nv(){let e=(0,D._)(["\n  ","\n  margin: 0;\n  text-align: left;\n  margin-top: ","; \n  margin-bottom: ",";\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  ",";\n  ",";\n"]);return nv=function(){return e},e}function nc(){let e=(0,D._)(["\n    margin-top: ","\n\n    .rec {\n      font-size: ",";\n      line-height: ",";\n    }\n  "]);return nc=function(){return e},e}function np(){let e=(0,D._)(["\n  .rec {\n    font-size: ",";\n    line-height: ",";\n  }\n\n  ","\n"]);return np=function(){return e},e}function nm(){let e=(0,D._)(["\n    div {\n      margin: 0;\n      margin-top: ","\n    }\n  "]);return nm=function(){return e},e}function nf(){let e=(0,D._)(["\n  div {\n    margin: 0;\n    margin-top: ","\n    margin-bottom: ","\n\n    p,\n    span {\n      font-size: ",";\n      line-height: ",";\n      color: ",";\n      margin:0;\n    }\n  }\n\n  ","\n"]);return nf=function(){return e},e}let ng=(0,n(28165).iv)(ni(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.colors.text.primary,w.r.typography.fontWeight.bold,w.r.colors.text.link,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.display5,w.r.colors.text.brand,w.r.typography.fontFamily.secondary,w.r.typography.fontWeight.light,w.r.colors.text.inverse,w.r.colors.brand.primary,w.r.spacing.sm,w.r.spacing.sm,w.r.colors.text.linkHover,w.r.colors.interactive.active),nE=B.Z.div(nn(),w.r.spacing.xl,w.r.spacing.md,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold),nh=B.Z.div(no(),w.r.spacing.xl,w.r.spacing.xl),nb=B.Z.div(nt(),w.r.spacing.md,w.r.spacing.md,w.B.tablet(nl())),ny=B.Z.p(nr()),nC=(0,B.Z)(ny)(na(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.h4,w.r.typography.lineHeight.h4,
1w.r.colors.text.primary,w.B.desktop(nd(),w.r.typography.fontSize.h2,w.r.typography.lineHeight.h2)),n_=B.Z.div(nv(),ng,w.r.spacing.md,w.r.spacing.xl,w.r.typography.fontFamily.secondary,w.r.typography.fontWeight.light,w.r.typography.fontSize.h6,w.r.typography.lineHeight.h6,w.B.tablet(nu(),w.r.spacing.lg,w.r.spacing.xl),w.B.desktop(ns(),w.r.spacing.md,w.r.spacing["2xl"])),nS=(0,B.Z)(nC)(np(),w.r.typography.fontSize.h5,w.r.typography.lineHeight.body1,w.B.desktop(nc(),w.r.spacing.sm,w.r.typography.fontSize.h5,w.r.typography.lineHeight.h6)),nI=B.Z.div(nf(),w.r.spacing.sm,w.r.spacing.sm,w.r.typography.fontSize.body2,w.r.typography.lineHeight.body2,w.r.colors.text.primary,w.B.desktop(nm(),w.r.spacing.xs));function nT(){let e=(0,D._)(["\n    margin: 0 ",";\n    width: 616px;\n  "]);return nT=function(){return e},e}function nA(){let e=(0,D._)(["\n  margin: 0 ",";\n  height: auto;\n  max-height: calc(100vh - 230px);\n\n  ","\n"]);return nA=function(){return e},e}let nR=B.Z.div(nA(),w.r.spacing.xl,w.B.tablet(nT(),w.r.spacing["3xl"]));var nL=n(36731),nN=e=>{let{data:i,onSeeDetailClick:n,onFirstButtonClick:o,onSecondButtonClick:l}=e,{title:t,offerDescription:r,productTitle:d,price:a,recurrence:u,priceDescription:s,productSpecs:v,detailsLabel:c,firstButtonLabel:f,secondButtonLabel:g,hideIcons:E}=i,[h]=(0,b.q)([s||""]),[y]=(0,b.q)([r||""]);return(0,p.jsxs)(nR,{children:[(0,p.jsx)(nC,{children:t}),(0,p.jsx)(n_,{dangerouslySetInnerHTML:{__html:y||""}}),(0,p.jsx)(nC,{children:d}),(0,p.jsxs)(nS,{children:[a,(0,p.jsx)("span",{className:"rec",children:u&&"/".concat(u)})]}),(0,p.jsx)(nI,{children:h&&(0,p.jsx)("div",{dangerouslySetInnerHTML:{__html:h}})}),(0,p.jsx)(nE,{children:m.Children.toArray(v.map(e=>(0,p.jsx)(i8.Z,{text:e,hideIcon:E})))}),(0,p.jsxs)(nh,{children:[(0,p.jsx)(eP.Z,{text:c,onClick:n,size:"2"}),(0,p.jsxs)(nb,{children:[(0,p.jsx)(i9.Z,{onClick:o,label:f,isApp:(0,ne.k)(),buttonColor:nL.r.colors.brand.primary,hoverColor:nL.r.colors.brand.primaryHover,clickColor:nL.r.colors.brand.primaryActive,labelColor:nL.r.colors.text.inverse}),l&&g&&(0,p.jsx)(i9.Z,{onClick:l,label:g,isApp:(0,ne.k)(),buttonColor:nL.r.colors.text.inverse,hoverColor:nL.r.colors.text.primary,hoverTextColor:nL.r.colors.text.inverse,clickColor:nL.r.colors.text.secondary,clickTextColor:nL.r.colors.text.inverse,borderColor:nL.r.colors.text.mvaSecondary})]})]})]})},nO=n(30815);function nx(){let e=(0,D._)(["\n    margin-top: -",";\n  "]);return nx=function(){return e},e}function nP(){let e=(0,D._)(["\n    margin-top: -",";\n  "]);return nP=function(){return e},e}function nM(){let e=(0,D._)(["\n  margin-top: -",";\n  max-height: 100vh;\n\n  ","\n\n  ","\n"]);return nM=function(){return e},e}function nk(){let e=(0,D._)(["\n    flex-direction: row;\n    justify-content: center;\n\n    div {\n      width: 290px;\n    }\n  "]);return nk=function(){return e},e}function nD(){let e=(0,D._)(["\n  display: flex;\n  flex-flow: column;\n  justify-content: center;\n  align-items: center;\n  width: 100%;\n  padding: "," 0;\n  gap: ",";\n\n  div {\n    width:100%\n  }\n\n  ","\n\n"]);return nD=function(){return e},e}let nB=(0,B.Z)(nR)(nM(),w.r.spacing.xl,w.B.tablet(nx(),w.r.spacing.lg),w.B.desktop(nP(),w.r.spacing["2xl"])),nw=B.Z.div(nD(),w.r.spacing.xl,w.r.spacing.md,w.B.tablet(nk()));var nj=e=>{let{details:i,modalInfo:n,product:o,onButtonClick:l,onSecondButtonClick:t}=e;return(0,p.jsxs)(nB,{children:[(0,p.jsx)(nO.Z,{trackingOpt:{event:["ui_interaction"],event_label:"offer details",opts:{event_category:"users",event_action:"click"},visitorTrackingOpts:(0,T.bG)(),disableInitialTrack:!0},details:i,modalInfo:n,product:o}),(0,p.jsxs)(nw,{children:[(0,p.jsx)(i9.Z,{onClick:l,isApp:(0,ne.k)(),label:i.firstButtonLabel||"",buttonColor:nL.r.colors.brand.primary,hoverColor:nL.r.colors.brand.primaryHover,clickColor:nL.r.colors.brand.primaryActive,labelColor:nL.r.colors.text.inverse}),t&&i.secondButtonLabel&&!i.disableSecondAction&&(0,p.jsx)(i9.Z,{onClick:t,isApp:(0,ne.k)(),label:i.secondButtonLabel,buttonColor:nL.r.colors.text.inverse,hoverColor:nL.r.colors.text.primary,hoverTextColor:nL.r.colors.text.inverse,clickColor:nL.r.colors.text.secondary,clickTextColor:nL.r.colors.text.inverse,borderColor:nL.r.colors.text.mvaSecondary})]})]})},nU=e=>{var i,n,o,l,t,r,d,a,u,s,c;let{product:f,isOpen:g,handleClose:E,handleContinue:h,handleAccept:b}=e,y=(0,I.useQueryClient)(),{trackView:C,isReadyTrackView:_}=(0,i3.r)({event:["view"],disableInitialTrack:!0}),{familyPlus:S}=f||{},T=(0,m.useRef)(null),{OFFER_STEP:A,DETAILS_STEP:R}=v,L=(0,eC.CA)(eC.Jn,i7.b.CMS_GET_SUPPORT_MODULE),N=e=>{switch(null==e?void 0:e.type){case eA.l.FAMILYPLUS_REDIRECT:e.url&&window.open(e.url,"_self");break;case eA.l.FAMILYPLUS_CTC:e.url&&(0,i7.x)(y,(null==e?void 0:e.url)||"",f,E);break;case eA.l.FAMILYPLUS_CONTINUE:null==h||h();break;case eA.l.FAMILYPLUS_ACCEPT:null==b||b()}}
1,O=e=>{let i;switch(e){case A:i={event_name:"view",event_label_track:"family plus display",event_category:"journey",journey_name:"checkout",journey_type:"journey",page_section:"mobile offers",page_subsection:"checkout",page_type:"family plus display",page_browser_system:(0,eS.ks)()?"webview":"browser"};break;case R:i={event_name:"view",event_label_track:"offer details",event_category:"journey",journey_name:"checkout",journey_type:"journey",page_section:"mobile offers",page_subsection:"checkout",page_type:"offer details",page_browser_system:(0,eS.ks)()?"webview":"browser"}}return i};(0,m.useEffect)(()=>{let e=O(A);null==C||C(e)},[_]);let x=(e,i)=>{null==C||C({event_name:"ui_interaction",event_label_track:e,event_category:"users",event_action:"click",tracking_type:"link",page_name_override:i===A?"family plus display":"offer details"})},P=[(0,p.jsx)(nN,{data:{title:(null==S?void 0:null===(i=S.offerProposition)||void 0===i?void 0:i.offerPropositionTitle)||"",offerDescription:(null==S?void 0:null===(n=S.offerProposition)||void 0===n?void 0:n.offerPropositionDescription)||"",productTitle:(null==S?void 0:S.offerDetails.title)||"",price:(null==S?void 0:S.price)||"",recurrence:(null==S?void 0:S.recurrence)||"",priceDescription:(null==S?void 0:S.priceDescription)||"",productSpecs:(null==S?void 0:S.offerProposition.propositionItems)||[],firstButtonLabel:(null==S?void 0:null===(o=S.buttonAction)||void 0===o?void 0:o.label)||"",secondButtonLabel:null==S?void 0:S.secondButtonAction.label,detailsLabel:(null==S?void 0:null===(l=S.offerProposition)||void 0===l?void 0:l.labelShowDetail
1s)||""},onFirstButtonClick:()=>{var e;let i=(null==S?void 0:null===(e=S.buttonAction)||void 0===e?void 0:e.label)||"";N(null==S?void 0:S.buttonAction),x(i,A)},onSecondButtonClick:()=>{var e;N(null==S?void 0:S.secondButtonAction),x((null==S?void 0:null===(e=S.secondButtonAction)||void 0===e?void 0:e.label)||"",A)},onSeeDetailClick:()=>{var e,i;null==T||null===(e=T.current)||void 0===e||e._stepperModalGoNext(),x((null==S?void 0:null===(i=S.offerProposition)||void 0===i?void 0:i.labelShowDetails)||"",A),null==C||C(O(R))}}),f?(0,p.jsx)(nj,{details:{title:(null==S?void 0:null===(t=S.offerDetails)||void 0===t?void 0:t.title)||"",conditions:null==S?void 0:S.offerDetails.conditions,description:null==S?void 0:S.offerDetails.description,offerDetails:null==S?void 0:S.offerDetails.offerDetailsFamilyPlus,price:(null==S?void 0:S.price)||"",recurrence:null==S?void 0:S.recurrence,disableSecondAction:null==S?void 0:null===(r=S.offerDetails)||void 0===r?void 0:r.disableSecondAction,firstButtonLabel:(null==S?void 0:null===(d=S.buttonAction)||void 0===d?void 0:d.label)||"",secondButtonLabel:null==S?void 0:S.secondButtonAction.label},modalInfo:{title:(null==L?void 0:null===(u=L.supportmodules)||void 0===u?void 0:null===(a=u.needHelp)||void 0===a?void 0:a.title)||"",ctaName:(null==L?void 0:null===(c=L.supportmodules)||void 0===c?void 0:null===(s=c.needHelp)||void 0===s?void 0:s.ctaSupportCall)||""},onButtonClick:()=>{var e;N(null==S?void 0:S.buttonAction),x((null==S?void 0:null===(e=S.buttonAction)||void 0===e?void 0:e.label)||"",R)},onSecondButtonClick:()=>{var e;N(null==S?void 0:S.secondButtonAction),x((null==S?void 0:null===(e=S.secondButtonAction)||void 0===e?void 0:e.label)||"",R)},product:f}):(0,p.jsx)("div",{})];return(0,p.jsx)(i4.Z,{id:"convergence-modal",isOpen:g,handleClose:E,ref:T,components:P})},nF=e=>{var i,n,o,l,t,r;let{handleOnClose:d}=e,a=(0,I.useQueryClient)(),{currentStepKey:u,campaign:s,product:v,checkoutErrors:c,isModalButtonSticky:p,setCampaign:f,setIsStartAcceptCampaign:b,setCheckoutStepState:y}=(0,E.Mg)(),{campaign:C,updateCart:_,accept:S}=s||{},[A,R]=(0,m.useState)(!1),L=(null==v?void 0:v.isFamilyPlusProduct)||(null==v?void 0:v.forceCampaign),N=(0,T.De)("ko","mobile",a),{trackWithNewDatalayer:O}=(0,i3.r)({event:["view"],disableInitialTrack:!0}),x=(0,g.C)(g.J,i7.b.CMS_GET_GENERIC_ERROR_MOBILE),P=(null==v?void 0:v.isTpoOffer)?i7.b.CMS_GET_PAYMENTS_MOBILE:i7.b.CMS_GET_FAMILY_PLUS_PAYMENT,{paymentsmobile:M}=(0,g.C)(g.J,P)||{paymentsmobile:{warningPriceChange:{title:"",subtitle:"",description:""}}},k=!L&&(null==s?void 0:s.campaign.isSuccess)&&(null==s?void 0:null===(i=s.campaign)||void 0===i?void 0:i.isEligible)&&!A,D=(null==s?void 0:s.campaign.isSuccess)&&!(null==s?void 0:null===(n=s.campaign)||void 0===n?void 0:n.isEligible)&&L,B=(null==s?void 0:s.campaign.isSuccess)&&(null==s?void 0:null===(o=s.campaign)||void 0===o?void 0:o.isEligible)&&L,w=()=>{b(!0),R(!0)};return(0,m.useEffect)(()=>{B&&w()},[B]),(0,m.useEffect)(()=>{if(D||(null==S?void 0:S.isError)){var e,i,n,o,l,t,r,s,m,f,g,E,h;let b=!(null==v?void 0:v.removeCTC)&&(null==v?void 0:null===(i=v.familyPlus)||void 0===i?void 0:null===(e=i.noCampaign)||void 0===e?void 0:e.actionCtcLabel)&&(null==v?void 0:null===(o=v.familyPlus)||void 0===o?void 0:null===(n=o.noCampaign)||void 0===n?void 0:n.actionCtcUrl);O({event:["journey_end"],event_label:"campaign not available for client",opts:{...null==N?void 0:N.opts,event_category:"journey",page_browser_system:"browser"},cartProduct:null==N?void 0:N.trackingProduct,pageProduct:null==N?void 0:N.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()}),null==c||null===(h=c.showAndTrackError)||void 0===h||h.call(c,x,d,void 0,(null==v?void 0:null===(t=v.familyPlus)||void 0===t?void 0:null===(l=t.noCampaign)||void 0===l?void 0:l.title)||"",(null==v?void 0:null===(s=v.familyPlus)||void 0===s?void 0:null===(r=s.noCampaign)||void 0===r?void 0:r.message)||"",b?()=>{var e,i;return(0,i7.x)(a,(null==v?void 0:null===(i=v.familyPlus)||void 0===i?void 0:null===(e=i.noCampaign)||void 0===e?void 0:e.actionCtcUrl)||"",v,d,u,null==S?void 0:S.error)}:void 0,!b||(null==v?void 0:v.removeCTC)?void 0:null==v?void 0:null===(f=v.familyPlus)||void 0===f?void 0:null===(m=f.noCampaign)||void 0===m?void 0:m.actionCtcLabel,d,(null==v?void 0:null===(E=v.familyPlus)||void 0===E?void 0:null===(g=E.noCampaign)||void 0===g?void 0:g.actionLabel)||"",p,void 0,!0,!0)}},[D,null==S?void 0:S.isError]),(0,m.useEffect)(()=>{y(h.v9.CAMPAIGN_CARD,{})},[]),{updateCart:_,product:v,cmsWarningUpdateOffer:{title:(null==M?void 0:null===(l=M.warningPriceChange)||void 0===l?void 0:l.title)||"",subtitle:(null==M?void 0:null===(t=M.warningPriceChange)||void 0===t?void 0:t.subtitle)||"",description:(null==M?void 0:null===(r=M.warningPriceChange)||void 0===r?void 0:r.description)||""},showConvergenceModal:k,onRefuseCampaign:()=>{f({...s,campaign:{...null==s?void 0:s.campaign,isRejected:!0}}),R(!0)},onAcceptCampaign:w,campaign:C}},nG=e=>{let{handleOnClose:i}=e,{updateCart:n,product:o,cmsWarningUpdateOffer:l,showConvergenceModal:t,onRefuseCampaign:r,onAcceptCampaign:d,campaign:a}=nF({handleOnClose:i});return(0,p.jsxs)(p.Fragment,{children:[(null==n?void 0:n.isLoading)&&!(null==o?void 0:o.isTpoOffer)&&(0,p.jsx)(i6,{...l}),(null==n?void 0:n.isLoading)&&(null==o?void 0:o.isTpoOffer)&&(0,p.jsx)(i2,{}),t&&(0,p.jsx)(nU,{isOpen:!0,handleClose:()=>{window.open(null==o?void 0:o.hubPath,"_self")},handleContinue:r,product:null==a?void 0:a.campaignProduct,handleAccept:d})]})},nz=n(63514),nV=n(10020),nY=n(35969),nH=n(90722);let nZ=e=>{var i,n,o,l,t,r,d;let{handleOnClose:a}=e,{product:u,findCaller:s,customerFlow:v,customerAsyncInfo:c,owningData:p,checkoutErrors:f,isModalButtonSticky:g,currentStepKey:h,setBillingAddress:b,setShippingAddress:y,setIsDisabledBackButton:C,setCustomerId:_,setOwningData:S,setIsStartCustomerFlow:A,setFindCaller:R}=(0,E.Mg)(),L=(0,I.useQueryClient)(),N=(0,nY.fF)("getCountry"),O={id:s.verifyOtp},{isSuccess:x,isLoading:P,isError:M,error:k}=(0,nV.OD)(),{associateCustomer:D}=v,B=(0,nV.CA)(nV.Jn,nY.bl.CMS_GET_GENERIC_ERROR_MOBILE),{errorcomponent:{errors:w}={errors:[]}}=(0,nV.CA)(nV.Jn,nY.bl.CMS_GET_RECURRENT_ORDER_ERROR_MOBILE)||{},j=null==w?void 0:w.find(e=>(null==e?void 0:e.error)===nV.SM.ASSOCIATE_CUSTOMER_BLOCKED),U=P||!x||!!(null==O?void 0:O.id)&&!D.isSuccess||!!(null==O?void 0:O.id)&&!(null==v?void 0:null===(i=v.billingAccount)||void 0===i?void 0:i.isSuccess)||(null==c?void 0:null===(n=c.customerInfo)||void 0===n?void 0:n.isLoading)||(null==v?void 0:null===(o=v.payment)||void 0===o?void 0:o.isLoading)||(null==c?void 0:null===(l=c.termsAndConditions)||void 0===l?void 0:l.isLoading),F=()=>
1{if(D.isSuccess||D.isError||M){var e,i,n,o,l,t,r,d,p,m,E,b,y,C,_,S;if(R({...s,...(null==v?void 0:null===(i=v.findcaller)||void 0===i?void 0:null===(e=i.data)||void 0===e?void 0:e.paymean)&&{paymean:null==v?void 0:null===(o=v.findcaller)||void 0===o?void 0:null===(n=o.data)||void 0===n?void 0:n.paymean},showOtp:!1,verifyOtp:"",isVerified:!0}),D.isError&&(null===(t=D.error)||void 0===t?void 0:null===(l=t.error)||void 0===l?void 0:l.statusText)===nV.SM.ASSOCIATE_CUSTOMER_BLOCKED){D.isError&&(0,nY.Fk)((0,T.yP)(D.error,null==h?void 0:h.toLowerCase(),L));let e=()=>{a&&((0,nH.u)(L),a())},i=()=>{var e,i;(null==j?void 0:null===(e=j.button)||void 0===e?void 0:e.urlForRedirect)?(0,nY.xb)(L,(null==j?void 0:null===(i=j.button)||void 0===i?void 0:i.urlForRedirect)||"",u,()=>{a&&((0,nH.u)(L),a())},h,null==D?void 0:D.error):a&&((0,nH.u)(L),a())};null==f||null===(p=f.showAndTrackError)||void 0===p||p.call(f,B,()=>e(),void 0,(null==j?void 0:j.title)||"Attenzione",(null==j?void 0:j.message)||"I seguenti articoli non sono attivabili dal cliente selezionato",()=>i(),(null==j?void 0:null===(r=j.button)||void 0===r?void 0:r.title)||"Ti richiamiamo",()=>{var i;return(0,nY.xb)(L,(null==j?void 0:j.keyClickToCall)||(null==u?void 0:null===(i=u.genericErrorCallMeNow)||void 0===i?void 0:i.url)||"",u,e,h,null==D?void 0:D.error)},(null==u?void 0:u.removeCTC)?void 0:null==u?void 0:null===(d=u.genericErrorCallMeNow)||void 0===d?void 0:d.label,g)}else if(D.isError||M){M&&k&&(0,nY.Fk)((0,T.yP)((0,nV.nQ)(nV.SM.REFERENCE_CUSTOMER,k),null==h?void 0:h.toLowerCase(),L)),D.isError&&(null==c?void 0:null===(m=c.customerInfo)||void 0===m?void 0:m.isError)&&(0,nY.Fk)((0,T.yP)(null==c?void 0:null===(E=c.customerInfo)||void 0===E?void 0:E.error,null==h?void 0:h.toLowerCase(),L));let e=D.isError&&(null==c?void 0:null===(b=c.customerInfo)||void 0===b?void 0:b.isError)?null==c?void 0:null===(y=c.customerInfo)||void 0===y?void 0:y.error:void 0;null==f||null===(S=f.showAndTrackError)||void 0===S||S.call(f,B,a,e,"","",a,(null==B?void 0:null===(C=B.genericerror)||void 0===C?void 0:C.buttonLabel)||"",()=>{var i;return(0,nY.xb)(L,(null==u?void 0:null===(i=u.genericErrorCallMeNow)||void 0===i?void 0:i.url)||"",u,a,h,e)},(null==u?void 0:u.removeCTC)?void 0:null==u?void 0:null===(_=u.genericErrorCallMeNow)||void 0===_?void 0:_.label,g)}}};return(0,m.useEffect)(()=>{if(F(),D.isSuccess){var e;let i=null===(e=c.customerInfo.data)||void 0===e?void 0:e[0];if(i){let e=(0,T.Vp)(i,N);S({...p,owningIndividual:{...p.owningIndividual,...e}}),_(i.id);let n=(0,T.GW)(i),o=(0,T.mv)(i);y(n),b(o)}}},[D,M,c]),(0,m.useEffect)(()=>{C(U)},[U]),(0,m.useEffect)(()=>{R({...s,showOtp:!1}),A(!0)},[]),{isLoading:U,isError:M||(null==D?void 0:D.isError)||(null==c?void 0:null===(t=c.customerInfo)||void 0===t?void 0:t.isError)||(null==v?void 0:null===(r=v.payment)||void 0===r?void 0:r.isError)||(null==c?void 0:null===(d=c.termsAndConditions)||void 0===d?void 0:d.isError)}};var nQ=n(12755);let nW=e=>{let{owningData:i,address:n,contactInfo:o,isReadOnly:l,campaign:t,setAddress:r,setOwningData:d,setContactInfo:a,setCurrentStepKey:u,setIsDisabledBackButton:s,setCheckoutStepState:v}=(0,E.Mg)(),{handleOnChangeEnableGoNext:c}=e,{isLoading:p,isError:f}=nZ(e),g=(0,I.useQueryClient)(),[b,y]=(0,m.useState)(!1),C=(0,T.De)("contact","mobile",g),{trackWithNewDatalayer:_,trackView:S}=(0,eh.rS)({event:["contacts"],disableInitialTrack:!0});return(0,ef.kg)(S,"contacts"),(0,m.useEffect)(()=>{i.owningIndividual&&ic(i)},[null==i?void 0:i.owningIndividual]),(0,m.useEffect)(()=>{c&&(p?(s(p),c(!1)):(s(!1),l&&c(!0),(0,nz.g)()?c(b||(0,nz.g)()):c(b)))},[b,p]),(0,m.useEffect)(()=>{p||f||_({event:["checkout_step2"],event_label:"contacts",opts:null==C?void 0:C.opts,cartProduct:null==C?void 0:C.trackingProduct,pageProduct:null==C?void 0:C.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()})},[p,f]),(0,m.useEffect)(()=>{u(h.Bf.CONTACT_CARD),v(h.v9.CONTACT_CARD,{}),(0,nz._)(o),(0,eh.uY)(g,["validatedAddress","createdAddress","modifyMobileSimDeviceId"])},[]),{owningData:i,address:n,contactInfo:o,isReadOnly:l,campaign:t,isLoading:p,setIsValidForm:y,onChangeData:e=>{ic(e),r(e.address||nQ.n),d(e)},onChangeCheck:e=>{let i="off";e.checkContactProblem&&(i="on"),S({event_name:"ui_interaction",event_label_track:"re-contact checkbox ".concat(i),event_category:"users",event_action:"click",tracking_type:"link"}),(0,nz._)(e),a(e)}}};var nK=n(51039),nJ=n(8244),nq=n(10727),nX=n(95147);let n$=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("OTP","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step1.2"],event_label:"OTP",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"OTP"),(0,S.q)(n),null});var n0=n(21271),n1=n(29949);let n2=(e,i)=>{var n,o,l,t,r,d,a,u,s,v;return{titleCms:(null==e?void 0:null===(o=e.personalinfomobile)||void 0===o?void 0:null===(n=o.clientRecognition)||void 0===n?void 0:n.title)||"",descriptionCms:(null==e?void 0:null===(t=e.personalinfomobile)||void 0===t?void 0:null===(l=t.clientRecognition)||void 0===l?void 0:l.description)||"",placeholderCms:(null==e?void 0:null===(d=e.personalinfomobile)||void 0===d?void 0:null===(r=d.selectInput)||void 0===r?void 0:r.contactPlaceholder)||"",ctaLabelCms:(null==e?void 0:null===(u=e.personalinfomobile)||void 0===u?void 0:null===(a=u.clientRecognition)||void 0===a?void 0:a.contactNotAccessLabel)||"",ctaUrl:(null==e?void 0:null===(v=e.personalinfomobile)||void 0===v?void 0:null===(s=v.clientRecognition)||void 0===s?void 0:s.contactNotAccessUrl)||(null==i?void 0:i.urlClickToCallOtp)||""}},n5=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("confirm id","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step1.1"],event_label:"verify id",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n),(0,S.q)(n),null});var n3=n(12822);function n6(){let e=(0,D._)(["\n  padding-top: 3.75rem;\n  width: 85%;\n  margin: 0 auto;\n"]);return n6=function(){return e},e}let n4=B.Z.div(n6());var n7=n(45867),n9=n(3307);let n8=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h;return{errorOnPortability:{errorMessage:{genericError:{title:(null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.errorOnPortability)||void 0===i?void 0:i.message)||"",buttonLabel:(null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.errorOnPortability)||void 0===o?void 0:o.buttonLabel)||""}}},title:(null==e?void 0:null===(r=e.portabilitymobile)||void 0===r?void 0:null===(t=r.general)||void 0===t?void 0:t.t
1itle)||"",description:(null==e?void 0:null===(a=e.portabilitymobile)||void 0===a?void 0:null===(d=a.general)||void 0===d?void 0:d.description)||"",bottomText:(null==e?void 0:null===(s=e.portabilitymobile)||void 0===s?void 0:null===(u=s.general)||void 0===u?void 0:u.bottomText)||"",items:[{title:(null==e?void 0:null===(m=e.portabilitymobile)||void 0===m?void 0:null===(p=m.general)||void 0===p?void 0:null===(c=p.choicePortability)||void 0===c?void 0:null===(v=c.option1)||void 0===v?void 0:v.title)||"",value:"yes"},{title:(null==e?void 0:null===(h=e.portabilitymobile)||void 0===h?void 0:null===(E=h.general)||void 0===E?void 0:null===(g=E.choicePortability)||void 0===g?void 0:null===(f=g.option2)||void 0===f?void 0:f.title)||"",value:"no"}]}};var oe=n(41307),oi=n(1733);let on=(e,i)=>oe.W.post(nq.b.RELEASE_RESOURCE,e,{...(null==i?void 0:i.headers)&&{headers:i.headers},...(null==i?void 0:i.silentLoginHeaders)&&{silentLoginHeaders:i.silentLoginHeaders},searchParams:{salesChannel:"selfService"}}),oo=()=>{let e=(0,I.useQueryClient)();return(0,I.useMutation)("releaseResource",e=>{let{valueList:i}=e,n={value:i,resourceType:"msisdn"};return oe.K.debug("reservePhoneNumber payload ",n),on(n)},{onSuccess:i=>{localStorage.setItem("releaseResource",JSON.stringify(i)),e.setQueryData("releaseResource",i)},onError:i=>{oe.K.error("ERROR - releaseResource: ",i),e.setQueryData("releaseResource",(0,oi.n)("releaseResource",i)),localStorage.setItem("releaseResource",JSON.stringify((0,oi.n)("releaseResource",i)))}})},ol=(e,i)=>oe.W.post(nq.b.RESERVE,e,{...(null==i?void 0:i.headers)&&{headers:i.headers},...(null==i?void 0:i.silentLoginHeaders)&&{silentLoginHeaders:i.silentLoginHeaders}}),ot=()=>{let e=(0,I.useQueryClient)();return(0,I.useMutation)("reservePhoneNumber",()=>{let e={type:"msisdn",phoneNumberCategory:"regular",resourceReqCount:6};return oe.K.debug("reservePhoneNumber payload ",e),ol(e)},{onSuccess:i=>{localStorage.setItem("reservePhoneNumber",JSON.stringify(i)),e.setQueryData("reservePhoneNumber",i)},onError:i=>{oe.K.error("ERROR - reservePhoneNumber: ",i),e.setQueryData("reservePhoneNumber",(0,oi.n)("reservePhoneNumber",i)),localStorage.setItem("reservePhoneNumber",JSON.stringify((0,oi.n)("reservePhoneNumber",i)))}})},or=e=>{let{flowEnabler:i}=e,[n,o]=(0,m.useState)({isSuccess:!1,isLoading:!1,isError:!1}),{mutate:l,isSuccess:t,isLoading:r,isError:d,data:a}=ot(),{mutate:u,isSuccess:s,isLoading:v,isError:c}=oo();return(0,m.useEffect)(()=>{!i||r||t||d||v||c||s||(o(e=>({...e,isError:!1,isSuccess:!1,isLoading:!0})),l())},[i]),(0,m.useEffect)(()=>{!s||c||v?c&&o({isSuccess:!1,isLoading:!1,isError:!0}):o({isSuccess:!0,isLoading:!1,isError:!0})},[s,v]),(0,m.useEffect)(()=>{!t||d||r?d&&o({isSuccess:!1,isLoading:!1,isError:!0}):u({valueList:null==a?void 0:a.map(e=>e.value||"")})},[t,r]),{...n}};var od=n(81909),oa=n(4880),ou=n(23236);let os=e=>{let{onConfirmAddress:i}=e,n=(0,I.useQueryClient)(),[o,l]=(0,m.useState)(),[t,r]=(0,m.useState)(!1),[d,a]=(0,m.useState)(!1),[u,s]=(0,m.useState)(!1),[v,c]=(0,m.useState)(ou.Z.KO),[p,f]=(0,m.useState)(!1),[g,E]=(0,m.useState)(""),h=(0,n9.f)("coexistenceUser"),b=n.getQueryData("silentLoginR2"),y=(null==b?void 0:b.flowId)&&(null==b?void 0:b.flowId)==="existingLogin"&&(null==h?void 0:h.userType)===od.j.LEGACY,C=(0,iN.r)(),_=(0,oa.V)(),S=localStorage.getItem("disableReset"),T=n.getQueryData("coverageToolInputAddress"),A=(0,eS.hz)("validatedAddress",!!S),R=(0,eS.hz)("createdAddress",!!S),L=!!(null==T?void 0:T.city)&&!!(null==T?void 0:T.postalCode)&&!!(null==T?void 0:T.stateOrProvince)&&!!(null==T?void 0:T.street)&&!!(null==T?void 0:T.streetNumber)&&i,N=()=>{var e,i,n,o,l,t,r,d,a;iM.K.debug({validatedAddress:A});let u=null==A?void 0:null===(e=A.validAddressList)||void 0===e?void 0:e[0];return!!u&&(null===(i=u.city)||void 0===i?void 0:i.toLowerCase())===(null==T?void 0:null===(n=T.city)||void 0===n?void 0:n.toLowerCase())&&(null===(o=u.postalCode)||void 0===o?void 0:o.toLowerCase())===(null==T?void 0:null===(l=T.postalCode)||void 0===l?void 0:l.toLowerCase())&&(null===(t=u.stateOrProvince)||void 0===t?void 0:t.toLowerCase())===(null==T?void 0:null===(r=T.stateOrProvince)||void 0===r?void 0:r.toLowerCase())&&(null===(d=u.street)||void 0===d?void 0:d.toLowerCase())===(null==T?void 0:null===(a=T.street)||void 0===a?void 0:a.toLowerCase())},O=()=>{var e;iM.K.debug("serviceabilityAddressMutation validatedAddress",A),iM.K.debug("serviceabilityAddressMutation.mutate PAYLOAD",null==A?void 0:null===(e=A.validAddressList)||void 0===e?void 0:e[0]),(C.isError||(null==A?void 0:A.error))&&(iM.K.debug("ERROR POPUP"),a(!1),s(!0),c(ou.Z.KO),E((null==A?void 0:A.errorMessage)||""))};return(0,m.useEffect)(()=>{!L&&T&&f(!0),T&&L&&!N()&&!A&&(a(!0),C.mutate({placeObject:T}))},[T,L]),(0,m.useEffect)(()=>{A&&C.isSuccess&&O()},[!!A,C.isSuccess]),(0,m.useEffect)(()=>{C.isError&&(null==A?void 0:A.error)&&(s(!0),E(null==A?void 0:A.errorMessage))},[C.isError,!!A]),(0,m.useEffect)(()=>{var e,i;!u&&(!R||S)&&!_.isLoading&&(null==A?void 0:null===(e=A.validAddressList)||void 0===e?void 0:e[0])&&C.isSuccess&&_.mutate({address:null==A?void 0:null===(i=A.validAddressList)||void 0===i?void 0:i[0]})},[u,C.isSuccess]),(0,m.useEffect)(()=>{!u&&_.isSuccess&&(null==_?void 0:_.data)&&(r(!0),l(null==_?void 0:_.data))},[_.isSuccess,null==_?void 0:_.data]),(0,m.useEffect)(()=>{t&&a(!1)},[t]),(0,m.useEffect)(()=>{y&&(c(ou.Z.R2_LOGGED),a(!1),s(!0))},[y]),{data:o,validatedAddress:null==C?void 0:C.data,mutationIsNotFull:p,isSuccess:t,isLoading:d,isError:u,errorMessage:g,errorType:v}},ov=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p;let{handleOnChangeEnableGoNext:f,handleOnClose:g,handleGoPrevSlide:b}=e,y=(0,I.useQueryClient)(),C=(0,n9.f)("releaseResource"),{portability:_,keepsNumber:S,currentStepKey:A,cartAsyncInfo:R,isModalButtonSticky:L,customerFlow:N,checkoutErrors:O,product:x,setIsStartCustomerFlow:P,setCurrentStepKey:M,setKeepsNumber:k,setPortability:D,setSlidesGoBack:B,setBillingAddress:w,setShippingAddress:j,setIsDisabledBackButton:U,setCheckoutStepState:F}=(0,E.Mg)(),{urlGenericErrorCallMeNow:G}=(0,eS.S6)(x),[z,V]=(0,m.useState)(!1),Y=(0,T.De)("portability","mobile",y),H=(null==R?void 0:null===(i=R.simTypeSelection)||void 0===i?void 0:i.isLoading)||!1,Z=(null==N?void 0:null===(n=N.postCustomer)||void 0===n?void 0:n.isLoading)||(null==N?void 0:null===(o=N.patchCustomer)||void 0===o?void 0:o.isLoading)||(null==N?void 0:null===(l=N.customerInfo)||void 0===l?void 0:l.isLoading)||(null==N?void 0:null===(t=N.associateCustomer)||void 0===t?void 0:t.isLoading),Q=(null==N?void 0:null===(r=N.postCustomer)||void 0===r?void 0:r.isError)||(null==N?void 0:null===(d=N.patchCustomer)||void 0===d?void 0:d.isError)||(null==N?void 0:null===(a=N.customerInfo)||void 0===a?void 0:a.isError)||(null==N?void 0:null===(u=N.associateCustomer)||void 0===u?void 0:u.isError),W=(null==N?void 0:null===(s=N.postCustomer)||void 0===s?void 0:s.error)||(null==N?void 0:null===(v=N.patchCustomer)||void 0===v?void 0:v.error)||(null==N?void 0:null===(c=N.associateCustomer)||void 0===c?void 0:c.error),K=null==N?void 0:null===(p=N.associateCustomer)||void 0===p?void 0:p.isSuccess,{trackWithNewDatalayer:J,trackView:q}=(0,i3.r)({event:["portability"],disableInitialTrack:!0});(0,ef.kg)(q);let X=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PORTABILITY_MOBILE),$=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),{errorcomponent:ee}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_RECURRENT_ORDER_ERROR_MOBILE)||{},ei=(null==ee?void 0:ee.errors)||[],{errorcomponent:en}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_CUSTOMER_ERROR_MOBILE)||{},eo=[...ei,...(null==en?void 0:en.errors)||[]],{title:el,description:et,items:er,errorOnPortability:ed,bottomText:ea}=n8(X),{data:eu,isSuccess:es,isLoading:ev,isError:ec}=os({onConfirmAddress:!0});return or({flowEnabler:z}),(0,m.useEffect)(()=>{var e;null==f||f(!Z&&!ev&&!(null==R?void 0:null===(e=R.simTypeSelection)||void 0===e?void 0:e.isLoading)&&(null==_?void 0:_.portabilityWant)!==void 0&&!!S&&A===h.Bf.PORTABILITY)},[Z,_,R]),(0,m.useEffect)(()=>{es&&eu&&(w(eu),j(eu),P(!0))},[es,eu]),(0,m.useEffect)(()=>
1{if(Q){var e,i,n,o,l;let t=(0,T.Tz)(eo,(null==W?void 0:W.errorCode)||"",{title:(null==$?void 0:null===(e=$.genericerror)||void 0===e?void 0:e.title)||"",description:(null==$?void 0:null===(i=$.genericerror)||void 0===i?void 0:i.description)||(null==ed?void 0:null===(o=ed.errorMessage)||void 0===o?void 0:null===(n=o.genericError)||void 0===n?void 0:n.title)||""}),r=e=>{var i;switch(null==N||null===(i=N.resetPatchAndPost)||void 0===i||i.call(N,N),null==W?void 0:W.errorCode){case e_.S.CREATE_CUSTOMER_FISCAL_CODE_ALREADY_PRESENT:B(4);break;case e_.S.CREATE_CUSTOMER_DOCUMENT_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_MISSING_NATION_ADDRESS:(null==t?void 0:t.isPopup)&&e?(0,eb.x)(y,(null==t?void 0:t.url)||G,x,()=>{g&&g()},A,W):B(2);break;case e_.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT:B(3);break;case e_.S.ASSOCIATE_CUSTOMER_BLOCKED:(null==t?void 0:t.isPopup)&&e?(0,eb.x)(y,(null==t?void 0:t.url)||G,x,()=>{g&&g()},A,W):g&&g();break;default:g&&g()}};null==O||null===(l=O.showAndTrackError)||void 0===l||l.call(O,{genericerror:{title:(null==t?void 0:t.title)||"",description:(null==t?void 0:t.message)||"",buttonLabel:(null==t?void 0:t.actionText)||""}},r,W,"","",()=>r(!0),"")}},[Q]),(0,m.useEffect)(()=>{if(ec){var e,i,n,o;let l=()=>{null==b||b()},t=(0,eS.nQ)("address",{url:"validateAddress",status:"500",statusText:"500"});null==O||null===(o=O.showAndTrackError)||void 0===o||o.call(O,$,l,t,void 0,void 0,l,null==ed?void 0:null===(i=ed.errorMessage)||void 0===i?void 0:null===(e=i.genericError)||void 0===e?void 0:e.buttonLabel,()=>{var e;return(0,eb.x)(y,(null==x?void 0:null===(e=x.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",x,l,A,t)},(null==x?void 0:x.removeCTC)?void 0:null==x?void 0:null===(n=x.genericErrorCallMeNow)||void 0===n?void 0:n.label,L,!0)}},[ec]),(0,m.useEffect)(()=>{z&&V(!1)},[z]),(0,m.useEffect)(()=>{U(Z||ev||H)},[Z,ev,H]),(0,m.useEffect)(()=>{K&&(M(h.Bf.PORTABILITY),J({event:["checkout_step4"],event_label:"portability",opts:null==Y?void 0:Y.opts,cartProduct:null==Y?void 0:Y.trackingProduct,pageProduct:null==Y?void 0:Y.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()}))},[K]),(0,m.useEffect)(()=>{F(h.v9.PORTABILITY_CARD,{})},[]),(0,m.useEffect)(()=>{let e=()=>{let e=(null==_?void 0:_.portabilityWant)?"keep number":"new number";
1(0,ef.dw)(e)},i=document.getElementById("sticky-offer-next");return null==i||i.addEventListener("click",e),()=>{null==i||i.removeEventListener("click",e)}},[_.portabilityWant]),(0,m.useEffect)(()=>{C||V(!0)},[]),{title:el,description:et,items:er,bottomText:ea,portability:_,keepsNumber:S,isSuccessAssociate:K,handleSelect:e=>{let i=(null==e?void 0:e.value)==="yes";D({..._,portabilityWant:i}),localStorage.setItem("portability",(null==e?void 0:e.value)==="yes"?"1":"0")},setKeepsNumber:k}};var oc=n(8350);function op(){let e=(0,D._)(["\n  padding-top: 3.75rem;\n  width: 85%;\n  margin: 0 auto;\n"]);return op=function(){return e},e}let om=B.Z.div(op()),of=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("portability","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step4.1"],event_label:"number portability",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"number portability"),(0,S.q)(n),null});var og=n(15019),oE=n(27389),oh=n(38206);let ob=e=>oe.W.get("".concat(nq.b.GET_PORTABILITY_INFO,"/").concat(e),{searchParams:{salesChannel:"selfService",portInInfoType:"ALL"}}),oy=(e,i,n)=>{let o=localStorage.getItem("shoppingCart"),l=!!o&&"undefined"!==o&&JSON.parse(o),t=null==l?void 0:l.id;return(0,I.useQuery)(["getPortabilityInfo"],()=>ob(t),{enabled:!!t,onSuccess:o=>{let l=(0,oh.gE)(o,n),t=(0,oh.E)(l,i),r=(0,oh.S2)(t,e);localStorage.setItem("portabilityInfo",JSON.stringify(r))},onError:e=>{oe.K.error("ERROR - getPortabilityInfo",e),localStorage.setItem("portabilityInfo",JSON.stringify((0,eS.nQ)("getPortabilityInfo")))}})};var oC=n(47103);let o_=(e,i)=>{var n,o,l,t;let r=new DOMParser,d=(null==e?void 0:null===(n=e.find(e=>e.id===i))||void 0===n?void 0:n.value)||"",a=r.parseFromString((null===(o=(0,b.q)([d||""]))||void 0===o?void 0:o[0])||"","text/html");return(null==a?void 0:null===(t=a.body)||void 0===t?void 0:null===(l=t.textContent)||void 0===l?void 0:l.replace("\n",""))||""},oS=e=>{var i,n,o,l,t,r,d,a,u,s,v,c;return{title:(null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.telephone)||void 0===i?void 0:i.title)||"",description:(null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.telephone)||void 0===o?void 0:o.description)||"",label:(null==e?void 0:null===(r=e.portabilitymobile)||void 0===r?void 0:null===(t=r.selectInput)||void 0===t?void 0:t.telephone)||"",disclaimer:(null==e?void 0:null===(a=e.portabilitymobile)||void 0===a?void 0:null===(d=a.telephone)||void 0===d?void 0:d.disclaimer)||"",validationMessage:{phoneNumber:{required:o_(null==e?void 0:null===(u=e.editorialconfigs)||void 0===u?void 0:u.elements,"phoneNumberRequired")||"Inserire un numero di telefono valido",minumum:o_(null==e?void 0:null===(s=e.editorialconfigs)||void 0===s?void 0:s.elements,"phoneNumberMin")||"Inserire un numero di telefono valido",maximum:o_(null==e?void 0:null===(v=e.editorialconfigs)||void 0===v?void 0:v.elements,"phoneNumberMax")||"Inserire un numero di telefono valido",matches:o_(null==e?void 0:null===(c=e.editorialconfigs)||void 0===c?void 0:c.elements,"phoneNumberMatches")||"Inserire un numero di telefono valido"}}}},oI=e=>{var i,n,o,l;return{titleError:(null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.errorModal)||void 0===i?void 0:i.title)||"",messageError:(null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.errorModal)||void 0===o?void 0:o.message)||""}},oT=e=>{let{handleOnChangeEnableGoNext:i,handleGoPrevSlide:n}=e,{currentStepKey:o,checkoutErrors:l,portability:t,isModalButtonSticky:r,product:d,setPortability:a,setCurrentStepKey:u,setIsValidNumberPortability:s,setCheckoutStepState:v}=(0,E.Mg)(),c=(0,I.useQueryClient)(),p=null==d?void 0:d.isRequiredPortability,{buttonGenericError:f,urlGenericErrorCallMeNow:g}=(0,eS.S6)(d),b=(0,eC.CA)(eC.Jn,oC.bl.CMS_GET_PORTABILITY_MOBILE),y=(0,eC.CA)(eC.Jn,oC.bl.CMS_GET_GENERIC_ERROR_MOBILE),{blackl
1ist:C}=(0,eC.CA)(eC.Jn,oC.bl.CMS_GET_DIGITAL_BUNDLE_OPERATORS)||{},_=(0,eC.CA)(eC.Jn,oC.bl.CMS_GET_STEPPER_COMMON_LABELS_MOBILE),{goBackInStepper:S}=(0,oE.j)(_),{title:T,description:A,label:R,disclaimer:L,validationMessage:N}=oS(b),{titleError:O,messageError:x}=oI(b),{isLoading:P,isError:M,error:k}=oy(b.portabilitymobile.operatorList,b.portabilitymobile.operatorsOrder,null==C?void 0:C.elements),D=()=>{if(null==t?void 0:t.portabilityNumber){let e=t.portabilityNumber.match(oC.Sz.mobilePhoneNumber);null==i||i(!!e)}};return(0,m.useEffect)(()=>{if(M){var e;let i=()=>{n&&n()},a=(0,eS.nQ)("portininfo",k,void 0,void 0,"portin info in portabilityCard",!1,{portabilityNumber:(null==t?void 0:t.portabilityNumber)||"",portabilityOperators:(null==t?void 0:t.portabilityOperators)||""});null==l||null===(e=l.showAndTrackError)||void 0===e||e.call(l,y,i,a,O,x,i,S,()=>(0,oC.xb)(c,g,d,i,o,a),(null==d?void 0:d.removeCTC)?void 0:f,r,!0)}},[M]),(0,m.useEffect)(()=>{D()},[t]),(0,m.useEffect)(()=>{u(h.Bf.PORTABILITY_NUMBER),v(h.v9.PORTABILITY_NUMBER_CARD,{}),D(),p&&localStorage.setItem("portability","1")},[]),{title:T,description:A,label:R,disclaimer:L,validationMessage:N,isLoadingPortInfo:P,portability:t,onChangeData:e=>{s(!1),a({...nQ.XM,portabilityWant:!!p||t.portabilityWant,portabilityNumber:e||""})}}};var oA=n(56908),oR=n(23072),oL=n(38225),oN=n(26533);function oO(){let e=(0,D._)(["\n      padding: 60px 40px 32px;\n  "]);return oO=function(){return e},e}function ox(){let e=(0,D._)(["\n      padding: 60px 55px 64px;\n  "]);return ox=function(){return e},e}function oP(){let e=(0,D._)(["\n  padding: "," "," ",";\n\n  ","\n\n  ","\n"]);return oP=function(){return e},e}function oM(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n"]);return oM=function(){return e},e}function ok(){let e=(0,D._)(["\n  margin: 0;\n  font-weight: 400;\n  color: ",";\n"]);return ok=function(){return e},e}function oD(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return oD=function(){return e},e}function oB(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return oB=function(){return e},e}function ow(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n"]);return ow=function(){return e},e}function oj(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n\n    max-width: 366px;\n  "]);return oj=function(){return e},e}function oU(){let e=(0,D._)(["\n    max-width: 406px;\n  "]);return oU=function(){return e},e}function oF(){let e=(0,D._)(["\n  margin: "," auto 0;\n  text-align: center;\n  max-width: 287px;\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n"]);return oF=function(){return e},e}function oG(){let e=(0,D._)(["\n    margin-top: ",";\n    margin-bottom: ",";\n    font-size: ",";\n    line-height: ",";\n  "]);return oG=function(){return e},e}function oz(){let e=(0,D._)(["\n    margin-top: ",";\n  "]);return oz=function(){return e},e}function oV(){let e=(0,D._)(["\n  margin-top: ",";\n  margin-bottom: ",";\n  text-align: start;\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n"]);return oV=function(){return e},e}function oY(){let e=(0,D._)(["\n      font-size: ",";\n      line-height: ",";\n    "]);return oY=function(){return e},e}function oH(){let e=(0,D._)(["\n      margin-top: ",";\n    "]);return oH=function(){return e},e}function oZ(){let e=(0,D._)(["\n  .username {\n    text-transform: capitalize;\n  }\n\n  p {\n    margin: 0;\n    color: ",";\n    text-align: start;\n    font-family: ",";\n    font-weight: ",";\n    font-size: ",";\n    line-height: ",";\n\n    ","\n  }\n\n  p:nth-child(2) {\n    font-weight: ",";\n    color: #00697c; \n  }\n\n  p:nth-child(5) {\n    margin-top: ",";\n\n    ","\n  }\n"]);return oZ=function(){return e},e}function oQ(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n    margin-top: ",";\n  "]);return oQ=function(){return e},e}function oW(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return oW=function(){return e},e}function oK(){let e=(0,D._)(["\n  display: flex;\n  background-color: transparent;\n  padding: 0;\n  margin: 0;\n  border: none;\n  border-bottom: 1px solid ",";\n  margin-top: ",";\n  color: ",";\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n\n  &:hover {\n    cursor: pointer;\n    color: ",";\n    border-bottom: 1px solid ",";\n  }\n"]);return oK=function(){return e},e}function oJ(){let e=(0,D._)(["\n  margin-top: ",";\n  border-bottom: 1px solid ",";\n"]);return oJ=function(){return e},e}function oq(){let e=(0,D._)(["\n    max-width: 366px;\n    margin-top: ",";\n  "]);return oq=function(){return e},e}function oX(){let e=(0,D._)(["\n    max-width: 406px;\n    margin-top: ",";\n  "]);return oX=function(){return e},e}function o$(){let e=(0,D._)(["\n  max-width: 287px;\n  margin-top: ",";\n  margin-bottom: ",";\n  color: ",";\n  ","\n\n  ","\n"]);return o$=function(){return e},e}function o0(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return o0=function(){return e},e}function o1(){let e=(0,D._)(["\n  color: ",";\n  text-align: start;\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  ","\n"]);return o1=function(){return e},e}function o2(){let e=(0,D._)(["\n  margin-top: ",";\n"]);return o2=function(){return e},e}function o5(){let e=(0,D._)(["\n    width: 100%;\n    margin-left: 0;\n    margin-right: 0;\n  "]);return o5=function(){return e},e}function o3(){let e=(0,D._)(["\n  width: inherit;\n  background: linear-gradient(0.25turn, transparent, ",", transparent),\n    linear-gradient(",", ","),\n    linear-gradient(",", ",");\n  background-repeat: no-repeat;\n  animation: loading 1.5s infinite;\n\n  :first-child {\n    margin-top: ",";\n    margin-bottom: ",";\n    height: ",";\n  }\n\n  height: 150px;\n  margin-top: ",";\n\n  ","\n\n  @keyframes loading {\n    to {\n      background-position: 315px 0, 0 0, 0 190px, 50px 195px;\n    }\n  }\n"]);return o3=function(){return e},e}function o6(){let e=(0,D._)(["\n    width: 100%;\n    margin-left: 0;\n    margin-right: 0;\n  "]);return o6=function(){return e},e}function o4(){let e=(0,D._)(["\n  height: ",";\n  margin-top: ",";\n\n  ","\n"]);return o4=function(){return e},e}let o7=B.Z.div(oP(),w.r.spacing.xl,w.r.spacing.md,w.r.spacing["3xl"],w.B.tablet(oO()),w.B.desktop(ox())),o9=B.Z.div(oM()),o8=B.Z.p(ok(),w.r.colors.text.primary),le=(0,B.Z)(o8)(ow(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.h4,w.r.typography.lineHeight.h4,
1w.B.tablet(oD(),w.r.typography.fontSize.display4,w.r.typography.lineHeight.display5),w.B.desktop(oB(),w.r.typography.fontSize.display4,w.r.typography.lineHeight.display5)),li=(0,B.Z)(o8)(oF(),w.r.spacing.md,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.typography.fontSize.h6,w.r.typography.lineHeight.h6,w.B.tablet(oj(),w.r.typography.fontSize.h6,w.r.typography.lineHeight.body3),w.B.desktop(oU())),ln=(0,B.Z)(o8)(oV(),w.r.spacing.xl,w.r.spacing.sm,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.h6,w.r.typography.lineHeight.h6,w.B.tablet(oG(),w.r.spacing.xl,w.r.spacing.md,w.r.typography.fontSize.h5,w.r.typography.lineHeight.display5),w.B.desktop(oz(),w.r.spacing.xl)),lo=B.Z.div(oZ(),w.r.colors.text.primary,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.typography.fontSize.body1,w.r.typography.lineHeight.body1,w.B.tablet(oY(),w.r.typography.fontSize.h6,w.r.typography.lineHeight.caption),w.r.typography.fontWeight.bold,w.r.spacing.sm,w.B.tablet(oH(),w.r.spacing.md)),ll=B.Z.button(oK(),w.r.colors.text.primary,w.r.spacing.sm,w.r.colors.text.primary,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.bold,w.r.typography.fontSize.body2,w.r.typography.lineHeight.body2,w.B.tablet(oQ(),w.r.typography.fontSize.body1,w.r.typography.lineHeight.body1,w.r.spacing.md),w.B.desktop(oW(),w.r.typography.fontSize.body1,w.r.typography.lineHeight.body1),w.r.colors.brand.primary,w.r.colors.brand.primary),lt=B.Z.div(oJ(),w.r.spacing.lg,w.r.colors.border.default),lr=(0,B.Z)(ln)(o$(),w.r.spacing.lg,w.r.spacing.md,w.r.colors.text.primary,w.B.tablet(oq(),w.r.spacing.md),w.B.desktop(oX(),w.r.spacing.lg)),ld=(0,B.Z)(o8)(o1(),w.r.colors.text.primary,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.bold,w.r.typography.fontSize.body2,w.r.typography.lineHeight.body2,w.B.tablet(o0(),w.r.typography.fontSize.body1,w.r.typography.lineHeight.body1)),la=(0,B.Z)(ll)(o2(),w.r.spacing.sm);B.Z.div(o3(),w.r.colors.bg.primary,w.r.colors.bg.disabled,w.r.colors.bg.disabled,w.r.colors.bg.disabled,w.r.colors.bg.disabled,w.r.spacing["3xl"],w.r.spacing.md,w.r.spacing.xl,w.r.spacing.xl,w.B.tablet(o5())),B.Z.div(o4(),w.r.spacing.xl,w.r.spacing.xl,w.B.tablet(o6()));var lu=n(27864),ls=n(78908);let lv=lu.ZP.div.withConfig({componentId:"sc-716c9f63-0"})(["display:flex;height:100%;flex-direction:column;justify-content:space-between;background-color:",";"],ls.O9.$ffffff),lc=lu.ZP.p.withConfig({componentId:"sc-716c9f63-1"})(["margin:0;font-weight:400;color:",";"],ls.O9.$262626),lp=(0,lu.ZP)(lc).withConfig({componentId:"sc-716c9f63-2"})(["font-family:",";"," @media (min-width:","){","}@media (min-width:","){","}"],ls.Rq.exbold,(0,ls.Ln)(30,38),ls.AV.tablet,(0,ls.Ln)(30,38),ls.AV.desktop,(0,ls.Ln)(36,45)),lm=(0,lu.ZP)(lc).withConfig({componentId:"sc-716c9f63-3"})(["font-family:",";"," margin-top:24px;margin-bottom:32px;"],ls.Rq.regular,(0,ls.Ln)(18,24)),lf=lu.ZP.div.withConfig({componentId:"sc-716c9f63-4"})(["width:100%;height:45px;@media (min-width:","){width:258px;margin:0 auto;}@media (min-width:","){width:296px;margin:0 auto;}"],ls.AV.tablet,ls.AV.desktop),lg=lu.ZP.div.withConfig({componentId:"sc-716c9f63-5"})(["margin-bottom:24px;@media (min-width:","){margin-bottom:32px;}@media (min-width:","){margin-bottom:40px;}div{.textAreaInputFieldset{height:100px;@media (min-width:","){height:120px;}}}"],ls.AV.tablet,ls.AV.desktop,ls.AV.tablet);var lE=e=>{let{handleClose:i,shippingAddress:n,setShippingAddress:o,noteModalConfig:l}=e,[t,r]=(0,m.useState)(n.note||""),[d,a]=(0,m.useState)(!1),u=()=>{o({...n,note:t}),i()};return(0,m.useEffect)(()=>{(void 0===n.note||""===n.note)&&a(!0)},[n.note]),(0,p.jsxs)(lv,{children:[(0,p.jsxs)(lg,{children:[(0,p.jsx)(lp,{children:d?null==l?void 0:l.title:null==l?void 0:l.titleMod}),(0,p.jsx)(lm,{children:d?null==l?void 0:l.description:null==l?void 0:l.descriptionMod}
1),(0,p.jsx)(O.Z.TextAreaInput,{id:"noteValue",maxLength:255,placeholder:" ",label:null==l?void 0:l.textLabel,style:{height:"auto",zIndex:1},value:t,onChange:e=>r(e.target.value)})]}),(0,p.jsx)(lf,{children:(0,p.jsx)(i9.Z,{disabled:0===t.trim().length&&d,borderColor:"#0d0d0d",isApp:(0,ne.k)(),hoverColor:"#262626",hoverTextColor:"#fff",clickColor:"#7e7e7e",clickTextColor:"#fff",label:null==l?void 0:l.ctaLabel,onClick:()=>{u(),(0,ef.dw)(null==l?void 0:l.ctaLabel)},name:"action_note"})})]})};let lh=e=>{let{getData:i}=e,[n,o]=(0,m.useState)([]),[l,t]=(0,m.useState)([]),[r,d]=(0,m.useState)([]),a=()=>{let e=(0,n9.f)("searchPickUpLocations"),i=(0,n9.f)("searchPickUpStoreLocations"),n=(0,n9.f)("locateStores");o(e),t(i),d(n)};return(0,m.useEffect)(()=>{i&&a()},[i]),{postalOffices:n,pickupPoints:l,vodafoneStores:r}};var lb=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,f,g,h,b,y,C,_;let{billingData:S,shippingData:I,billingDataEsim:T,shippingDataEsim:A,editAddressConfig:R,noteModalConfig:L,noteLabels:N,description:O,topTitle:x,disableAddNotes:P,isEsim:M,isEsimFD:k}=e,{shippingAddress:D,billingAddress:B,owningData:w,deliveryAdvance:j,pickupLocationStore:U,setShippingAddress:F,setBillingAddress:G,setInvoice:z,setPickupPoint:V,setEnablerChangeBilling:Y,hasSPC:H}=(0,E.Mg)(),{isTablet:Z,isDesktop:Q}=(0,oR.h)(),[W,K]=(0,m.useState)(!1),[J,q]=(0,m.useState)(!1),[X,$]=(0,m.useState)(!1),{setStartingSearchAddress:ee}=(0,oN.g)(),{postalOffices:ei,vodafoneStores:en,pickupPoints:eo}=lh({getData:U.global.isSuccess}),el=()=>Z&&647||Q&&676||1200,{firstName:et,lastName:er}=(null==w?void 0:w.owningIndividual)||{},ed=(null==j?void 0:null===(i=j.deliveryOptions)||void 0===i?void 0:i.filter(e=>e.code!==oL.V.DI))||[],ea=!!(null==D?void 0:D.postalCode),eu=!!(null==B?void 0:B.postalCode),es=(0,eS.cG)(D,B),ev=(0,eC.CA)(eC.Jn,iO.b.CMS_GET_MAP_MOBILE),ec=(0,eC.CA)(eC.Jn,iO.b.CMS_GET_DELIVERY_INFORMATION_MOBILE),ep=(0,eC.CA)(eC.Jn,iO.b.CMS_GET_EDIT_ADDRESS_MOBILE),em=(0,eC.CA)(eC.Jn,iO.b.CMS_GET_EDIT_ADDRESS_STEPPER_MOBILE),ef=null==ec?void 0:null===(o=ec.deliveryinformationm)||void 0===o?void 0:null===(n=o.addressChange)||void 0===n?void 0:n.options,eg=(0,eR.Yc)(null==em?void 0:em.editaddressconfig),{mapConfig:eE,mapEditConfig:eh}=(0,eR.$Y)(ev),eb=(0,eR.JE)(ec),ey=(0,eR.lf)(ep),e_=e=>{e&&(0,iO.d)(e),K(e=>!e)},eI=e=>{var i,n,o,l,t,r;let{typePickupPoint:d}=e||{},a=(null==ec?void 0:null===(i=ec.deliveryinformationm)||void 0===i?void 0:i.officialOfficePlaceholder)||"";return d&&(null==I?void 0:null===(n=I.addressData)||void 0===n?void 0:n.postalOfficeDescription)?d===oL.G.PO&&(null==I?void 0:null===(o=I.addressData)||void 0===o?void 0:o.postalOfficeDescription)?"".concat(a," ").concat(null==I?void 0:null===(l=I.addressData)||void 0===l?void 0:l.postalOfficeDescription.toLowerCase()):(null==I?void 0:null===(t=I.addressData)||void 0===t?void 0:t.postalOfficeDescription)?"".concat(null==I?void 0:null===(r=I.addressData)||void 0===r?void 0:r.postalOfficeDescription.toLowerCase()):"".concat(et||""," ").concat(er||""):"".concat(et||""," ").concat(er||"")},eT=e=>{V(e)},eA=()=>{var e;null==U||null===(e=U.startDeliveryLocateAndPickupPoint)||void 0===e||e.call(U),(0,iO.d)(ea?null==I?void 0:I.changeAddress:null==I?void 0:I.labelEdit),q(!0)},eL=()=>{(0,iO.d)(eu?null==S?void 0:S.labelEdit:null==S?void 0:S.changeAddress),Y(!0),$(!0)};(0,m.useEffect)(()=>{if(ed&&ed.length>0){var e;null==U||null===(e=U.startDeliveryLocateAndPickupPoint)||void 0===e||e.call(U),ee(D)}},[j]);let eN=()=>(0,p.jsx)(oA.Q,{address:D,shippingAddress:D,setShippingAddress:F,postalOffices:ei||[],pickupPoints:eo||[],vodafoneStores:en||[],onChangePickupPoint:eT,isOpen:J,handleClose:()=>q(!1),deliveryOptions:ed&&(null==ed?void 0:ed.length)>0?ed:[{code:oL.G.S,description:"CASA",isSelected:!1}],userData:{lastName:er,firstName:et},setPickupPoint:V,billingAddress:B,setBillingAddress:G,setInvoice:z,multipleOptions:ef||[],editAddressStepperModalConfig:eg,mapConfig:eE,mapConfigEdit:eh,editAddressOptionsConfig:eb,manualAddressConfig:ey,isLoading:U.global.isLoading||(null==U?void 0:U.searchLocateStore.isLoading)||(null==U?void 0:U.searchPickupLocations.isLoading)||(null==U?void 0:U.searchPostalOffice.isLoading)||(null==j?void 0:j.isLoading)}),eO=()=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ek.Z,{height:el(),isOpen:W,handleClose:e_,children:(0,p.jsx)(lE,{handleClose:e_,shippingAddress:D,setShippingAddress:F,noteModalConfig:L})}),(0,p.jsx)(ek.Z,{height:el(),isOpen:X,handleClose:()=>$(!1),children:(0,p.jsx)(oA.I,{firstName:et,lastName:er,handleClose:()=>$(!1),origin:!1,billingAddress:B,setBillingAddress:G,setShippingAddress:F,setInvoice:z,setP
1ickupPoint:V,shippingAddress:D,cmsConfig:R,manualAddressConfig:ey})})]}),ex=()=>{var e,i,n,o;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lr,{children:eu?null==S?void 0:S.title:null==S?void 0:S.matchAddress}),!eu&&(0,p.jsx)(ld,{children:null==S?void 0:S.noMatch}),eu&&!!B&&(0,p.jsxs)(lo,{children:[(0,p.jsx)("p",{"data-cs-mask":"",className:"username",children:"".concat(et," ").concat(er)}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==S?void 0:null===(e=S.addressData)||void 0===e?void 0:e.address}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==S?void 0:null===(i=S.addressData)||void 0===i?void 0:i.city}),(0,p.jsx)("p",{"data-cs-mask":"",children:"".concat(null==S?void 0:null===(n=S.addressData)||void 0===n?void 0:n.zipCode,"-").concat(null==S?void 0:null===(o=S.addressData)||void 0===o?void 0:o.province)})]}),(0,p.jsx)(la,{onClick:eL,children:eu?null==S?void 0:S.labelEdit:null==S?void 0:S.changeAddress})]})},eP=(e,i)=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lr,{children:null==e?void 0:e.matchAddress}),(0,p.jsx)(ld,{children:null==e?void 0:e.noMatch}),(0,p.jsx)(la,{onClick:()=>{(0,iO.d)("".concat(null==e?void 0:e.changeAddress)),i?$(!0):q(!0)},children:null==e?void 0:e.changeAddress})]}),eM=()=>P?null:(0,p.jsx)(ll,{onClick:()=>{null==e_||e_(D.note?null==N?void 0:N.noteTitleAfterEdit:null==N?void 0:N.noteTitle)},children:D.note?null==N?void 0:N.noteTitleAfterEdit:null==N?void 0:N.noteTitle}),eD=()=>{var e,i,n,o;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lr,{children:null==I?void 0:I.title}),!ea&&(0,p.jsx)(ld,{children:null==I?void 0:I.noMatch}),ea&&!!D&&(0,p.jsxs)(lo,{style:{textTransform:"capitalize"},children:[(0,p.jsx)("p",{"data-cs-mask":"",children:eI(D)}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==I?void 0:null===(e=I.addressData)||void 0===e?void 0:e.address}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==I?void 0:null===(i=I.addressData)||void 0===i?void 0:i.city}),(0,p.jsx)("p",{"data-cs-mask":"",children:"".concat(null==I?void 0:null===(n=I.addressData)||void 0===n?void 0:n.zipCode,"-").concat(null==I?void 0:null===(o=I.addressData)||void 0===o?void 0:o.province)}),D.note?(0,p.jsxs)("p",{"data-cs-mask":"",children:["Note: ",(0,p.jsx)("span",{className:"note",children:"".concat(D.note)})]}):""]}),eM(),(0,p.jsx)(la,{onClick:eA,children:ea?null==I?void 0:I.changeAddress:null==I?void 0:I.labelEdit}),(0,p.jsx)(lt,{}),!es&&eP(S,!0),es&&ex(),eO(),ed&&eN()]})};return(0,p.jsxs)(o7,{children:[(0,p.jsxs)(o9,{children:[(0,p.jsx)(le,{children:x}),(0,p.jsx)(li,{children:O})]}),H?eD():k?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lr,{children:(null==T?void 0:T.title)||""}),eu&&!!B&&(0,p.jsxs)(lo,{style:{textTransform:"capitalize"},children:[(0,p.jsx)("p",{"data-cs-mask":"",children:eI(B)}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==T?void 0:null===(l=T.addressData)||void 0===l?void 0:l.address}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==T?void 0:null===(t=T.addressData)||void 0===t?void 0:t.city}),(0,p.jsx)("p",{"data-cs-mask":"",children:"".concat(null==T?void 0:null===(r=T.addressData)||void 0===r?void 0:r.zipCode,"-").concat(null==T?void 0:null===(d=T.addressData)||void 0===d?void 0:d.province)}),B.note?(0,p.jsxs)("p",{"data-cs-mask":"",children:["Note: ",(0,p.jsx)("span",{className:"note",children:"".concat(B.note)})]}):""]}),eM(),(0,p.jsx)(la,{onClick:eL,children:eu?null==T?void 0:T.changeAddress:null==T?void 0:T.labelEdit}),eO(),ed&&eN()]}):M?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lr,{children:ea?null==I?void 0:I.title:null==A?void 0:A.title}),!ea&&(0,p.jsx)(ld,{children:(null==A?void 0:A.noMatch)||(null==I?void 0:I.noMatch)}),ea&&!!D&&(0,p.jsxs)(lo,{style:{textTransform:"capitalize"},children:[(0,p.jsx)("p",{"data-cs-mask":"",children:eI(D)}),(0,p.jsx)("p",{"data-cs-mask":"",children:(null==A?void 0:null===(a=A.addressData)||void 0===a?void 0:a.address)||(null==I?void 0:null===(u=I.addressData)||void 0===u?void 0:u.address)}),(0,p.jsx)("p",{"data-cs-mask":"",children:(null==A?void 0:null===(s=A.addressData)||void 0===s?void 0:s.city)||(null==I?void 0:null===(v=I.addressData)||void 0===v?void 0:v.city)}),(0,p.jsx)("p",{"data-cs-mask":"",children:"".concat((null==A?void 0:null===(c=A.addressData)||void 0===c?void 0:c.zipCode)||(null==I?void 0:null===(f=I.addressData)||void 0===f?void 0:f.zipCode),"-").concat((null==A?void 0:null===(g=A.addressData)||void 0===g?void 0:g.province)||(null==I?void 0:null===(h=I.addressData)||void 0===h?void 0:h.province))}),D.note?(0,p.jsxs)("p",{"data-cs-mask":"",children:["Note: ",(0,p.jsx)("span",{className:"note",children:"".concat(D.note)})]}):""]}),eM(),(0,p.jsx)(la,{onClick:eA,children:ea?(null==A?void 0:A.changeAddress)||(null==I?void 0:I.changeAddress):(null==A?void 0:A.labelEdit)||(null==I?void 0:I.labelEdit)}),(0,p.jsx)(lt,{}),!es&&eP(S,!0),es&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lr,{children:eu?null==T?void 0:T.title:null==T?void 0:T.matchAddress}),!eu&&(0,p.jsx)(ld,{children:null==T?void 0:T.noMatch}),eu&&B&&(0,p.jsxs)(lo,{children:[(0,p.jsx)("p",{"data-cs-mask":"",className:"username",children:"".concat(et," ").concat(er)}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==T?void 0:null===(b=T.addressData)||void 0===b?void 0:b.address}),(0,p.jsx)("p",{"data-cs-mask":"",children:null==T?void 0:null===(y=T.addressData)||void 0===y?void 0:y.city}),(0,p.jsx)("p",{"data-cs-mask":"",children:"".concat(null==T?void 0:null===(C=T.addressData)||void 0===C?void 0:C.zipCode,"-").concat(null==T?void 0:null===(_=T.addressData)||void 0===_?void 0:_.province)})]}),(0,p.jsx)(la,{onClick:eL,children:eu?null==T?void 0:T.labelEdit:null==T?void 0:T.changeAddress})]}),eO(),ed&&eN()]}):eD()]})};let ly=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("address confirmation","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step5"],event_label:"address confirmation",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"address confirmation"),(0,S.q)(n),null}),lC=(e,i,n,o,l,t,r,d)=>{var a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w,j,U,F,G,z,V,Y,H,Z,Q,W,K,J,q,X,$,ee,ei,en,eo,el,et,er,ed,ea,eu,es,ev,ec,ep,em,ef,eg,eE,eh,eb,ey,eC,e_,eI,eT,eA,eR,eL;let eN=null==e?void 0:null===(u=e.deliveryinformationm)||void 0===u?void 0:null===(a=u.selfService)||void 0===a?void 0:a.sim,eO=null==e?void 0:null===(v=e.deliveryinformationm)||void 0===v?void 0:null===(s=v.selfService)||void 0===s?void 0:s.eSim,ex=null==e?void 0:null===(p=e.deliveryinformationm)||void 0===p?void 0:null===(c=p.selfService)||void 0===c?void 0:c.eSimFullyDigital,eP=null==e?void 0:null===(m=e.deliveryinformationm)||void 0===m?void 0:m.courrier,eM={topTitle:"",description:""};return{...eM=t?r?{...eM,topTitle:(null==ex?void 0:ex.title)||(null==eO?void 0:eO.title)||"",description:(null==ex?void 0:ex.description)||(null==eO?void 0:eO.description)||""}:{...eM,topTitle:(null==eO?void 0:eO.title)||"",description:(null==eO?void 0:eO.description)||""}:d?{...eM,topTitle:(null==eP?void 0:eP.title)||(null==eN?void 0:eN.title)||"",description:(null==eP?void 0:eP.description)||(null==eN?void 0:eN.description)||""}:{...eM,topTitle:(null==eN?void 0:eN.title)||"",description:(null==eN?void 0:eN.description)||""},userInfoTitle:"",userData:{lastName:null==i?void 0:i.lastName,firstName:null==i?void 0:i.firstName,address:null===(g=(0,eS.kg)((null==o?void 0:o.street)||""))||void 0===g?void 0:null===(f=g.concat)||void 0===f?void 0:f.call(g," ",(null==o?void 0:o.streetNumber)||""),city:(0,eS.kg)((null==o?void 0:o.city)||""),zipCode:(null==o?void 0:o.postalCode)||"",province:(null==o?void 0:o.stateOrProvince)||""},billingData:{title:(null==e?void 0:null===(h=e.deliveryinformationm)||void 0===h?void 0:null===(E=h.addressBilling)||void 0===E?void 0:E.bottomTitle)||"",matchAddress:(null==e?void 0:null===(y=e.deliveryinformationm)||void 0===y?void 0:null===(b=y.addressBilling)||void 0===b?void 0:b.title)||"",noMatch:(null==e?void 0:null===(_=e.deliveryinformationm)||void 0===_?void 0:null===(C=_.addressBilling)||void 0===C?void 0:C.description)||"",labelEdit:(null==e?void 0:null===(I=e.deliveryinformationm)||void 0===I?void 0:null===(S=I.addressBilling)||void 0===S?void 0:S.linkLabelEdit)||"",changeAddress:(null==e?void 0:null===(A=e.deliveryinformationm)||void 0===A?void 0:null===(T=A.addressBilling)||void 0===T?void 0:T.linkLabel)||"",addressData:{lastName:(null==i?void 0:i.lastName)||"",firstName:(null==i?void 0:i.firstName)||"",address:null===(L=(0,eS.kg)(null==n?void 0:n.street))||void 0===L?void 0:null===(R=L.concat)||void 0===R?void 0:R.call(L," ",(null==n?void 0:n.streetNumber)||""),city:(0,eS.kg)(null==n?void 0:n.city),zipCode:(null==n?void 0:n.postalCode)||"",province:(null==n?void 0:n.stateOrProvince)||""}},shippingData:{title:(null==e?void 0:null===(O=e.deliveryinformationm)||void 0===O?void 0:null===(N=O.addressShipping)||void 0===N?void 0:N.title)||"",matchAddress:(null==e?void 0:null===(P=e.deliveryinformationm)||void 0===P?void 0:null===(x=P.addressShipping)||void 0===x?void 0:x.subtitle)||"",noMatch:(null==e?void 0:null===(k=e.deliveryinformationm)||void 0===k?void 0:null===(M=k.addressShipping)||void 0===M?void 0:M.address)||"",labelEdit:(null==e?void 0:null===(B=e.deliveryinformationm)||void 0===B?void 0:null===(D=B.addressShipping)||void 0===D?void 0:D.linkLabelEdit)||"",changeAddress:(null==e?void 0:null===(j=e.deliveryinformationm)||void 0===j?void 0:null===(w=j.addressShipping)||void 0===w?void 0:w.linkLabel)||"",addressData:{lastName:(null==i?void 0:i.lastName)||"",firstName:(null==i?void 0:i.firstName)||"",address:null===(F=(0,eS.kg)((null==o?void 0:o.street)||""))||void 0===F?void 0:null===(U=F.concat)||void 0===U?void 0:U.call(F," ",(null==o?void 0:o.streetNumber)||""),city:(0,eS.kg)(null==o?void 0:o.city),zipCode:(null==o?void 0:o.postalCode)||"",province:(null==o?void 0:o.stateOrProvince)||"",note:(null==o?void 0:o.note)||"",postalOfficeDescription:(null==o?void 0:o.postalOfficeDescription)||""}},billingDataEsim:{title:(null==e?void 0:null===(z=e.deliveryinformationm)||void 0===z?void 0:null===(G=z.addressBillingEsim)||void 0===G?void 0:G.bottomTitle)||"",matchAddress:(null==e?void 0:null===(Y=e.deliveryinformationm)||void 0===Y?void 0:null===(V=Y.addressBillingEsim)||void 0===V?void 0:V.title)||"",noMatch:(null==e?void 0:null===(Z=e.deliveryinformationm)||void 0===Z?void 0:null===(H=Z.addressBillingEsim)||void 0===H?void 0:H.description)||"",labelEdit:(null==e?void 0:null===(W=e.deliveryinformationm)||void 0===W?void 0:null===(Q=W.addressBillingEsim)||void 0===Q?void 0:Q.linkLabelEdit)||"",changeAddress:(null==e?void 0:null===(J=e.deliveryinformationm)||void 0===J?void 0:null===(K=J.addressBillingEsim)||void 0===K?void 0:K.linkLabel)||"",addressData:{lastName:(null==i?void 0:i.lastName)||"",firstName:(null==i?void 0:i.firstName)||"",address:null===(X=(0,eS.kg)(null==n?void 0:n.street))||void 0===X?void 0:null===(q=X.concat)||void 0===q?void 0:q.call(X," ",(null==n?void 0:n.streetNumber)||""),city:(0,eS.kg)(null==n?void 0:n.city),zipCode:(null==n?void 0:n.postalCode)||"",province:(null==n?void 0:n.stateOrProvince)||""}},shippingDataEsim:{title:(null==e?void 0:null===(ee=e.deliveryinformationm)||void 0===ee?void 0:null===($=ee.addressShippingEsim)||void 0===$?void 0:$.t
1itle)||"",matchAddress:(null==e?void 0:null===(en=e.deliveryinformationm)||void 0===en?void 0:null===(ei=en.addressShippingEsim)||void 0===ei?void 0:ei.subtitle)||"",noMatch:(null==e?void 0:null===(el=e.deliveryinformationm)||void 0===el?void 0:null===(eo=el.addressShippingEsim)||void 0===eo?void 0:eo.address)||"",labelEdit:(null==e?void 0:null===(er=e.deliveryinformationm)||void 0===er?void 0:null===(et=er.addressShippingEsim)||void 0===et?void 0:et.linkLabelEdit)||"",changeAddress:(null==e?void 0:null===(ea=e.deliveryinformationm)||void 0===ea?void 0:null===(ed=ea.addressShippingEsim)||void 0===ed?void 0:ed.linkLabel)||"",addressData:{lastName:(null==i?void 0:i.lastName)||"",firstName:(null==i?void 0:i.firstName)||"",address:null===(es=(0,eS.kg)((null==o?void 0:o.street)||""))||void 0===es?void 0:null===(eu=es.concat)||void 0===eu?void 0:eu.call(es," ",(null==o?void 0:o.streetNumber)||""),city:(0,eS.kg)(null==o?void 0:o.city),zipCode:(null==o?void 0:o.postalCode)||"",province:(null==o?void 0:o.stateOrProvince)||"",note:(null==o?void 0:o.note)||"",postalOfficeDescription:(null==o?void 0:o.postalOfficeDescription)||""}},deliveryCta:"",afterEditAddress:"",editAddressConfig:l,noteLabels:{noteTitle:(null==e?void 0:null===(ec=e.deliveryinformationm)||void 0===ec?void 0:null===(ev=ec.commonLabel)||void 0===ev?void 0:ev.descriptionNote)||"",noteTitleAfterEdit:(null==e?void 0:null===(em=e.deliveryinformationm)||void 0===em?void 0:null===(ep=em.commonLabel)||void 0===ep?void 0:ep.linkLabelEdit)||""},noteModalConfig:{title:(null==e?void 0:null===(eg=e.deliveryinformationm)||void 0===eg?void 0:null===(ef=eg.commonLabel)||void 0===ef?void 0:ef.linkLabel)||"",description:(null==e?void 0:null===(eh=e.deliveryinformationm)||void 0===eh?void 0:null===(eE=eh.commonLabel)||void 0===eE?void 0:eE.modalTextLabel)||"",textLabel:(null==e?void 0:null===(ey=e.deliveryinformationm)||void 0===ey?void 0:null===(eb=ey.commonLabel)||void 0===eb?void 0:eb.placeholderNotes)||"",ctaLabel:(null==e?void 0:null===(e_=e.deliveryinformationm)||void 0===e_?void 0:null===(eC=e_.commonLabel)||void 0===eC?void 0:eC.modalCtaLabel)||"",titleMod:(null==e?void 0:null===(eT=e.deliveryinformationm)||void 0===eT?void 0:null===(eI=eT.commonLabel)||void 0===eI?void 0:eI.linkLabelEdit)||"",descriptionMod:(null==e?void 0:null===(eR=e.deliveryinformationm)||void 0===eR?void 0:null===(eA=eR.commonLabel)||void 0===eA?void 0:eA.linkLabel)||""},disableAddNotes:(null==e?void 0:null===(eL=e.deliveryinformationm)||void 0===eL?void 0:eL.disableAddNotes)==="true"}};var l_=n(54687),lS=n(25184),lI=n(40975),lT=n(21328),lA=n(99645),lR=n(77991),lL=n(19567);let lN=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("OTP port","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step4.5"],event_label:"OTP port",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,S.q)(n),(0,ef.kg)(n,"OTP port"),null});var lO=n(96108),lx=n(82454),lP=n(31696),lM=n(5632),lk=n(20789);function lD(){let e=(0,D._)(["\n    padding: 60px 40px;\n  "]);return lD=function(){return e},e}function lB(){let e=(0,D._)(["\n    padding: 60px 55px;\n  "]);return lB=function(){return e},e}function lw(){let e=(0,D._)(["\n      font-size: ",";\n      line-height: ",";\n    "]);return lw=function(){return e},e}function lj(){let e=(0,D._)(["\n  padding: 32px 20px;\n\n  ","\n\n  ","\n\n  .linkWithIcon {\n    margin-top: 16px;\n    display: flex;\n    justify-content: left;\n\n    ","\n  }\n"]);return lj=function(){return e},e}function lU(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return lU=function(){return e},e}function lF(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return lF=function(){return e},e}function lG(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  ",";\n  margin: ",";\n\n  ","\n\n  ","\n"]);return lG=function(){return e},e}function lz(){let e=(0,D._)(["\n    ","\n  "]);return lz=function(){return e},e}function lV(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n"]);return lV=function(){return e},e}function lY(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  text-align: center;
1\n  color: ",";\n  margin-bottom: ",";\n"]);return lY=function(){return e},e}function lH(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  gap: ",";\n  margin-bottom: ",";\n"]);return lH=function(){return e},e}function lZ(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  font-style: normal;\n  display: flex;\n  flex-direction: row;\n"]);return lZ=function(){return e},e}function lQ(){let e=(0,D._)(["\n  width: fit-content;\n  text-align: start;\n"]);return lQ=function(){return e},e}function lW(){let e=(0,D._)(["\n  display: flex;\n  width: 25px;\n  margin-right: 10px;\n"]);return lW=function(){return e},e}function lK(){let e=(0,D._)(["\n  input {\n    position: absolute;\n    margin: 0 auto;\n    opacity: 0;\n    cursor: pointer;\n    height: 20px;\n    width: 20px;\n    z-index: 3;\n  }\n\n  .checkmark::after {\n    left: 7px;\n    top: 3px;\n    width: 5px;\n    height: 10px;\n    border: solid white;\n    border-width: 0 2px 2px 0;\n    transform: rotate(45deg);\n    content: '';\n    position: absolute;\n    display: none;\n  }\n\n  .checkmark {\n    position: absolute;\n    height: ",";\n    width: ",";\n    border-radius: ",";\n    border: "," solid ",";\n  }\n\n  &:hover input ~ .checkmark {\n    border: "," solid ",";\n  }\n\n  input:checked ~ .checkmark {\n    background-color: ",";\n    border: none;\n  }\n\n  input:checked ~ .checkmark::after {\n    display: block;\n  }\n"]);return lK=function(){return e},e}function lJ(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  margin-bottom: 8px;\n"]);return lJ=function(){return e},e}function lq(){let e=(0,D._)(["\n  div {\n    margin: 0;\n    text-align: left;\n    font-family: ",";\n    font-weight: ",";\n    font-size: ",";\n    line-height: ",";\n  }\n"]);return lq=function(){return e},e}function lX(){let e=(0,D._)(["\n  p {\n    margin: 0 0 24px;\n\n    &:has(b) {\n      margin: 0 0 8px;\n    }\n  }\n"]);return lX=function(){return e},e}function l$(){let e=(0,D._)(["\n  text-align: left;\n  margin-top: 12px;\n  margin-bottom: 0;\n  span {\n    font-family: ",";\n    font-weight: ",";\n    font-size: ",";\n    line-height: ",";\n    transition: all 0.2s;\n    text-decoration: underline;\n    cursor: pointer;\n\n    &:hover {\n      color: ",";\n      text-decoration-color: red;\n    }\n  }\n"]);return l$=function(){return e},e}let l0=B.Z.div(lj(),lk.BC.tablet(lD()),lk.BC.desktop(lB()),lk.BC.desktop(lw(),lk.rS.typography.fontSize.body1,lk.rS.typography.lineHeight.body1)),l1=B.Z.div(lG(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.extrabold,(0,lk.Ln)(30,38),e=>{let{margin:i}=e;return void 0!=i?(0,lk.Q1)(...i):"0 0 16px"},lk.BC.tablet(lU(),lk.rS.typography.fontSize.h1,lk.rS.typography.lineHeight.h1),lk.BC.desktop(lF(),lk.rS.typography.fontSize.h2,lk.rS.typography.lineHeight.h2)),l2=B.Z.div(lV(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.regular,lk.rS.typography.fontSize.h6,lk.rS.typography.lineHeight.h6,lk.BC.tablet(lz(),(0,lk.Ln)(20,30))),l5=B.Z.div(lY(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.bold,lk.rS.typography.fontSize.h6,lk.rS.typography.lineHeight.h6,lk.rS.colors.text.brand,lk.rS.spacing.xl),l3=B.Z.div(lH(),lk.rS.spacing.xl,lk.rS.spacing.xl),l6=B.Z.div(lZ(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.regular,lk.rS.typography.fontSize.body3,lk.rS.typography.lineHeight.body3),l4=B.Z.div(lQ()),l7=B.Z.div(lW()),l9=B.Z.div(lK(),(0,lk.Q1)(20),(0,lk.Q1)(20),(0,lk.Q1)(3),lk.rS.borderWidth.thin,lk.rS.colors.border.default,lk.rS.borderWidth.thin,lk.rS.colors.border.default,lk.DH.cyanDark);B.Z.div(lJ(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.bold,lk.rS.typography.fontSize.h6,lk.rS.typography.lineHeight.h6),B.Z.div(lq(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.regular,lk.rS.typography.fontSize.h6,lk.rS.typography.lineHeight.h6);let l8=B.Z.div(lX()),te=B.Z.p(l$(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.bold,lk.rS.typography.fontSize.body2,lk.rS.typography.lineHeight.body2,lk.rS.colors.brand),ti=e=>{var i,n;return M.object({operator:M.string().required((null==e?void 0:null===(i=e.operator)||void 0===i?void 0:i.required)||""),contract:M.str
1ing().required((null==e?void 0:null===(n=e.contract)||void 0===n?void 0:n.required)||""),transferBalance:M.boolean()})},tn=e=>{var i,n,o,l,t;let{currentPlan:r,currentProvider:d,editorialLabels:a,handleOnChangeEnableGoNext:u,onChangeData:s}=e,{portability:v,product:c}=(0,E.Mg)(),{validationMessage:p,preselectResidualCreditTransfer:f}=a,g=null==d?void 0:d.map(e=>e.displayValue),h=null==r?void 0:r.map(e=>e.displayValue),b=null==d?void 0:null===(i=d.find(e=>{var i;return e.value===(null===(i=v.portabilityMigration)||void 0===i?void 0:i.currentProvider)}))||void 0===i?void 0:i.displayValue,y=null==r?void 0:null===(n=r.find(e=>{var i;return e.value===(null===(i=v.portabilityMigration)||void 0===i?void 0:i.currentPlan)}))||void 0===n?void 0:n.displayValue,{register:C,setValue:_,trigger:S,formState:{errors:I}}=(0,L.cI)({resolver:(0,x.X)(ti(p)),mode:"all"}),[T,A]=(0,m.useState)(!1),[R,N]=(0,m.useState)(null==v?void 0:null===(o=v.portabilityMigration)||void 0===o?void 0:o.currentProvider),[O,P]=(0,m.useState)(b||""),[M,k]=(0,m.useState)(null==v?void 0:null===(l=v.portabilityMigration)||void 0===l?void 0:l.currentPlan),[D,B]=(0,m.useState)(y||""),[w,j]=(0,m.useState)((null==v?void 0:null===(t=v.portabilityMigration)||void 0===t?void 0:t.transferBalance)||!1),U=localStorage.getItem("operator"),F=()=>!!R&&!!M;return(0,m.useEffect)(()=>{if(U){let e=null==d?void 0:d.find(e=>e.value===U);e&&_("operator",e.displayValue)}else b&&_("operator",b);y&&_("contract",y)},[]),(0,m.useEffect)(()=>{var e;N((null==d?void 0:null===(e=d.find(e=>e.displayValue===O))||void 0===e?void 0:e.value)||"")},[O]),(0,m.useEffect)(()=>{var e;k((null==r?void 0:null===(e=r.find(e=>e.displayValue===D))||void 0===e?void 0:e.value)||"")},[D]),(0,m.useEffect)(()=>{!F()&&u&&u(!1),s({...v,portabilityMigration:{currentProvider:R,currentPlan:M,transferBalance:w}},F())},[R,M,w]),{product:c,errors:I,openModal:T,currentPlanValues:h,providerList:g,selectedContract:D,transferBalance:w,onSelectContractType:e=>{_("contract",e),S("contract").then(()=>B(e)),"Ricaricabile"!==e?(_("transferBalance",!1),S("transferBalance").then(()=>j(!1))):"Ricaricabile"===e&&f&&(_("transferBalance",!0),S("transferBalance").then(()=>j(!0)))},register:C,setOpenModal:A,setSelectedOperator:P,setTransferBalance:j,setValue:_,trigger:S}};var to=e=>{var i,n;let{editorialLabels:o,oldNumber:l,currentProvider:t,currentPlan:r,onChangeData:d,portabilityOperatorsFirstAction:a,handleOnChangeEnableGoNext:u}=e,{title:s,description:v,secondActionLabel:c,modalTitle:m,modalDescription:f,checkboxText:g,operatorLabel:E,contractLabel:h}=o,b=(0,I.useQueryClient)(),{push:y}=(0,lM.useRouter)(),{product:C,errors:_,openModal:S,currentPlanValues:T,providerList:A,selectedContract:R,transferBalance:L,onSelectContractType:N,register:x,setValue:P,setOpenModal:M,setSelectedOperator:k,setTransferBalance:D,trigger:B}=tn({currentPlan:r,currentProvider:t,onChangeData:d,handleOnChangeEnableGoNext:u,editorialLabels:o,oldNumber:l});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(l0,{children:[(0,p.jsx)(l1,{children:s}),(0,p.jsx)(l2,{children:v}),(0,p.jsx)(l5,{children:l}),(0,p.jsxs)(l3,{children:[(0,p.jsxs)("div",{className:"textInput",children:[(0,p.jsx)(O.Z.SelectInput,{label:E,onSelectValue:e=>{P("operator",e),B("operator").then(()=>k(e))},errorMessage:null===(i=_.operator)||void 0===i?void 0:i.message,placeholder:" ",...x("operator"),items:A||[]}),(null==a?void 0:a.title)&&(0,p.jsx)(te,{onClick:()=>{(0,lP.d)("click on ".concat(null==a?void 0:a.title)),(0,lP.O)(a,y,b,void 0,C)},children:(0,p.jsx)("span",{children:null==a?void 0:a.title})})]}),(0,p.jsxs)("div",{className:"textInput",children:[(0,p.jsx)(O.Z.SelectInput,{label:h,style:{overflowY:"auto",maxHeight:10},onSelectValue:e=>N(e),errorMessage:null===(n=_.contract)||void 0===n?void 0:n.message,placeholder:" ",...x("contract"),items:T||[]}),c&&(0,p.jsx)(te,{onClick:()=>{(0,lP.d)("click on info box"),M(!0)},children:(0,p.jsx)("span",{children:c})})]})]}),"Ricaricabile"===R&&(0,p.jsxs)(l6,{children:[(0,p.jsx)(l7,{children:(0,p.jsxs)(l9,{children:[(0,p.jsx)("input",{type:"checkbox",checked:L,onChange:()=>D(!L)}),(0,p.jsx)("span",{className:"checkmark"})]})}),(0,p.jsx)(l4,{children:g})]})]}),(0,p.jsx)(ek.Z,{isOpen:S,handleClose:()=>M(!1),children:(0,p.jsxs)(l8,{children:[m&&(0,p.jsx)(l1,{margin:[0,0,32],children:m}),f&&(0,p.jsx)(lO.Z,{text:f,size:20,textAlign:"left",modal:!1,margin:[0],lineHeight:26,fontFamily:lx.R.regular})]})})]})};let tl=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("portability","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step4.4"],event_label:"migration code",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"migration code"),(0,S.q)(n),null}),tt=(e,i)=>{var n,o,l,t;let r=new DOMParser,d=(null==e?void 0:null===(n=e.find(e=>e.id===i))||void 0===n?void 0:n.value)||"",a=r.parseFromString((null===(o=(0,b.q)([d||""]))||void 0===o?void 0:o[0])||"","text/html");return(null==a?void 0:null===(t=a.body)||void 0===t?void 0:null===(l=t.textContent)||void 0===l?void 0:l.replace("\n",""))||""},tr=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y;return{title:null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.migrationData)||void 0===i?void 0:i.title,de
1scription:null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.migrationData)||void 0===o?void 0:o.description,modalTitle:null==e?void 0:null===(r=e.portabilitymobile)||void 0===r?void 0:null===(t=r.migrationData)||void 0===t?void 0:t.modalTitle,modalDescription:null==e?void 0:null===(a=e.portabilitymobile)||void 0===a?void 0:null===(d=a.migrationData)||void 0===d?void 0:d.modalDescription,checkboxText:null==e?void 0:null===(s=e.portabilitymobile)||void 0===s?void 0:null===(u=s.migrationData)||void 0===u?void 0:u.checkboxText,operatorLabel:null==e?void 0:null===(c=e.portabilitymobile)||void 0===c?void 0:null===(v=c.selectInput)||void 0===v?void 0:v.operator,contractLabel:null==e?void 0:null===(m=e.portabilitymobile)||void 0===m?void 0:null===(p=m.selectInput)||void 0===p?void 0:p.contract,secondActionLabel:null==e?void 0:null===(g=e.portabilitymobile)||void 0===g?void 0:null===(f=g.migrationData)||void 0===f?void 0:f.actionLabel,preselectResidualCreditTransfer:(null==e?void 0:null===(h=e.portabilitymobile)||void 0===h?void 0:null===(E=h.migrationData)||void 0===E?void 0:E.preselectResidualCreditTransfer)==="true",validationMessage:{operator:{required:tt(null==e?void 0:null===(b=e.editorialconfigs)||void 0===b?void 0:b.elements,"operatorRequired")||"Inserire un operatore"},contract:{required:tt(null==e?void 0:null===(y=e.editorialconfigs)||void 0===y?void 0:y.elements,"contractRequired")||"Selezionare un contratto"}}}},td=e=>{var i,n,o,l,t,r,d,a;let{handleOnChangeEnableGoNext:u}=e,{portability:s,product:v,setPortability:c,setIsValidNumberPortability:p}=(0,E.Mg)(),f=(0,n9.f)("portabilityInfo"),h=null==f?void 0:null===(l=f.portInDetails)||void 0===l?void 0:null===(o=l.mobilePortInDetails)||void 0===o?void 0:null===(n=o[0])||void 0===n?void 0:null===(i=n.portInProviderCust)||void 0===i?void 0:i.availableValues,b=null==f?void 0:null===(a=f.portInDetails)||void 0===a?void 0:null===(d=a.mobilePortInDetails)||void 0===d?void 0:null===(r=d[0])||void 0===r?void 0:null===(t=r.currentPlan)||void 0===t?void 0:t.availableValues,y=s.portabilityNumber||"",C=tr((0,g.C)(g.J,n7.bl.CMS_GET_PORTABILITY_MOBILE)),_=e=>{(0,ef.dw)(e?"trasferimento credito on":"trasferimento credito off")};return(0,m.useEffect)(()=>{p(!0)},[]),{availableOperators:h,currentPlan:b,editorialLabels:C,product:v,oldNumber:y,onChangeData:(e,i)=>{if(u){var n;let{transferBalance:o}=e.portabilityMigration||{};o!=(null==s?void 0:null===(n=s.portabilityMigration)||void 0===n?void 0:n.transferBalance)&&_(o||!1),c(e),i&&u(!0)}}}};function ta(){let e=(0,D._)(["\n  padding-top: 3.75rem;\n  width: 85%;\n  margin: 0 auto;\n"]);return ta=function(){return e},e}let tu=B.Z.div(ta());var ts=n(78439);let tv=e=>{var i,n;let o=null==e?void 0:null===(i=e.toString())||void 0===i?void 0:i.replace(".",",");if(o&&"0"!=o){let e=o.split(",");(null==e?void 0:e.length)>0&&(null==e?void 0:null===(n=e[1])||void 0===n?void 0:n.length)===1&&(o="".concat(e[0],",").concat(e[1],"0"))}return"0"==o?0:o},tc=e=>{switch(null==e?void 0:e.trim().toUpperCase()){case l_.V.CO:return l_.V.CO;case l_.V.DI:return l_.V.DI;case l_.V.VR:return l_.V.VR;case l_.V.NA:default:return l_.V.NA}},tp=function(e,i,n){var o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w,j,U,F,G,z,V,Y,H,Z,Q,W,K,J,q,X,$,ee,ei,en,eo,el,et,er,ed,ea,eu,es,ev,ec,ep,em,ef,eg,eE,eh,eb,ey,eC,e_,eI,eT,eA,eR,eL,eN,eO,ex,eP,eM,ek,eD,eB,ew,ej,eU,eF,eG,ez,eV,eY,eH,eZ,eQ,eW,eK,eJ,eq,eX,e$,e0,e1,e2,e5;let e3=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",e6=[];return n||i||(e6=[{...null==e?void 0:null===(u=e.personalinfomobile)||void 0===u?void 0:null===(a=u.recognitionMethodSelection)||void 0===a?void 0:null===(d=a.elements)||void 0===d?void 0:d[0],value:tc(null==e?void 0:null===(p=e.personalinfomobile)||void 0===p?void 0:null===(c=p.recognitionMethodSelection)||void 0===c?void 0:null===(v=c.elements)||void 0===v?void 0:null===(s=v[0])||void 0===s?void 0:s.value),extra:(null==e?void 0:null===(E=e.personalinfomobile)||void 0===E?void 0:null===(g=E.recognitionMethodSelection)||void 0===g?void 0:null===(f=g.elements)||void 0===f?void 0:null===(m=f[0])||void 0===m?void 0:m.isHighlighted)==="true"?{text:(null==e?void 0:null===(b=e.personalinfomobile)||void 0===b?void 0:null===(h=b.recognitionMethodSelection)||void 0===h?void 0:h.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}}
1,{...null==e?void 0:null===(_=e.personalinfomobile)||void 0===_?void 0:null===(C=_.recognitionMethodSelection)||void 0===C?void 0:null===(y=C.elements)||void 0===y?void 0:y[1],value:tc(null==e?void 0:null===(A=e.personalinfomobile)||void 0===A?void 0:null===(T=A.recognitionMethodSelection)||void 0===T?void 0:null===(I=T.elements)||void 0===I?void 0:null===(S=I[1])||void 0===S?void 0:S.value),extra:(null==e?void 0:null===(O=e.personalinfomobile)||void 0===O?void 0:null===(N=O.recognitionMethodSelection)||void 0===N?void 0:null===(L=N.elements)||void 0===L?void 0:null===(R=L[1])||void 0===R?void 0:R.isHighlighted)==="true"?{text:(null==e?void 0:null===(P=e.personalinfomobile)||void 0===P?void 0:null===(x=P.recognitionMethodSelection)||void 0===x?void 0:x.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}}]),!n&&i&&(e6=[{...null==e?void 0:null===(D=e.personalinfomobile)||void 0===D?void 0:null===(k=D.recognitionMethodSelection)||void 0===k?void 0:null===(M=k.elementsMnp)||void 0===M?void 0:M[0],value:tc(null==e?void 0:null===(U=e.personalinfomobile)||void 0===U?void 0:null===(j=U.recognitionMethodSelection)||void 0===j?void 0:null===(w=j.elementsMnp)||void 0===w?void 0:null===(B=w[0])||void 0===B?void 0:B.value),extra:(null==e?void 0:null===(V=e.personalinfomobile)||void 0===V?void 0:null===(z=V.recognitionMethodSelection)||void 0===z?void 0:null===(G=z.elementsMnp)||void 0===G?void 0:null===(F=G[0])||void 0===F?void 0:F.isHighlighted)==="true"?{text:(null==e?void 0:null===(H=e.personalinfomobile)||void 0===H?void 0:null===(Y=H.recognitionMethodSelection)||void 0===Y?void 0:Y.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}},{...null==e?void 0:null===(W=e.personalinfomobile)||void 0===W?void 0:null===(Q=W.recognitionMethodSelection)||void 0===Q?void 0:null===(Z=Q.elementsMnp)||void 0===Z?void 0:Z[1],value:tc(null==e?void 0:null===(X=e.personalinfomobile)||void 0===X?void 0:null===(q=X.recognitionMethodSelection)||void 0===q?void 0:null===(J=q.elementsMnp)||void 0===J?void 0:null===(K=J[1])||void 0===K?void 0:K.value),extra:(null==e?void 0:null===(en=e.personalinfomobile)||void 0===en?void 0:null===(ei=en.recognitionMethodSelection)||void 0===ei?void 0:null===(ee=ei.elementsMnp)||void 0===ee?void 0:null===($=ee[1])||void 0===$?void 0:$.isHighlighted)==="true"?{text:(null==e?void 0:null===(el=e.personalinfomobile)||void 0===el?void 0:null===(eo=el.recognitionMethodSelection)||void 0===eo?void 0:eo.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}}]),n&&!i&&(e6=[{...null==e?void 0:null===(ed=e.personalinfomobile)||void 0===ed?void 0:null===(er=ed.recognitionMethodSelectionEsim)||void 0===er?void 0:null===(et=er.elements)||void 0===et?void 0:et[0],value:tc(null==e?void 0:null===(ev=e.personalinfomobile)||void 0===ev?void 0:null===(es=ev.recognitionMethodSelectionEsim)||void 0===es?void 0:null===(eu=es.elements)||void 0===eu?void 0:null===(ea=eu[0])||void 0===ea?void 0:ea.value),extra:(null==e?void 0:null===(ef=e.personalinfomobile)||void 0===ef?void 0:null===(em=ef.recognitionMethodSelectionEsim)||void 0===em?void 0:null===(ep=em.elements)||void 0===ep?void 0:null===(ec=ep[0])||void 0===ec?void 0:ec.isHighlighted)==="true"?{text:(null==e?void 0:null===(eE=e.personalinfomobile)||void 0===eE?void 0:null===(eg=eE.recognitionMethodSelectionEsim)||void 0===eg?void 0:eg.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}},{...null==e?void 0:null===(ey=e.personalinfomobile)||void 0===ey?void 0:null===(eb=ey.recognitionMethodSelectionEsim)||void 0===eb?void 0:null===(eh=eb.elements)||void 0===eh?void 0:eh[1],value:tc(null==e?void 0:null===(eT=e.personalinfomobile)||void 0===eT?void 0:null===(eI=eT.recognitionMethodSelectionEsim)||void 0===eI?void 0:null===(e_=eI.elements)||void 0===e_?void 0:null===(eC=e_[1])||void 0===eC?void 0:eC.value),extra:(null==e?void 0:null===(eN=e.personalinfomobile)||void 0===eN?void 0:null===(eL=eN.recognitionMethodSelectionEsim)||void 0===eL?void 0:null===(eR=eL.elements)||void 0===eR?void 0:null===(eA=eR[1])||void 0===eA?void 0:eA.isHighlighted)==="true"?{text:(null==e?void 0:null===(ex=e.personalinfomobile)||void 0===ex?void 0:null===(eO=ex.recognitionMethodSelectionEsim)||void 0===eO?void 0:eO.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}}
1]),n&&i&&(e6=[{...null==e?void 0:null===(ek=e.personalinfomobile)||void 0===ek?void 0:null===(eM=ek.recognitionMethodSelectionEsim)||void 0===eM?void 0:null===(eP=eM.elementsMnp)||void 0===eP?void 0:eP[0],value:tc(null==e?void 0:null===(ej=e.personalinfomobile)||void 0===ej?void 0:null===(ew=ej.recognitionMethodSelectionEsim)||void 0===ew?void 0:null===(eB=ew.elementsMnp)||void 0===eB?void 0:null===(eD=eB[0])||void 0===eD?void 0:eD.value),extra:(null==e?void 0:null===(ez=e.personalinfomobile)||void 0===ez?void 0:null===(eG=ez.recognitionMethodSelectionEsim)||void 0===eG?void 0:null===(eF=eG.elementsMnp)||void 0===eF?void 0:null===(eU=eF[0])||void 0===eU?void 0:eU.isHighlighted)==="true"?{text:(null==e?void 0:null===(eY=e.personalinfomobile)||void 0===eY?void 0:null===(eV=eY.recognitionMethodSelectionEsim)||void 0===eV?void 0:eV.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}},{...null==e?void 0:null===(eQ=e.personalinfomobile)||void 0===eQ?void 0:null===(eZ=eQ.recognitionMethodSelectionEsim)||void 0===eZ?void 0:null===(eH=eZ.elementsMnp)||void 0===eH?void 0:eH[1],value:tc(null==e?void 0:null===(eq=e.personalinfomobile)||void 0===eq?void 0:null===(eJ=eq.recognitionMethodSelectionEsim)||void 0===eJ?void 0:null===(eK=eJ.elementsMnp)||void 0===eK?void 0:null===(eW=eK[1])||void 0===eW?void 0:eW.value),extra:(null==e?void 0:null===(e1=e.personalinfomobile)||void 0===e1?void 0:null===(e0=e1.recognitionMethodSelectionEsim)||void 0===e0?void 0:null===(e$=e0.elementsMnp)||void 0===e$?void 0:null===(eX=e$[1])||void 0===eX?void 0:eX.isHighlighted)==="true"?{text:(null==e?void 0:null===(e5=e.personalinfomobile)||void 0===e5?void 0:null===(e2=e5.recognitionMethodSelectionEsim)||void 0===e2?void 0:e2.highlightedLabel)||"",color:"#fff",extraClass:"extraClass"}:{text:""}}]),{title:(0,eS.NI)((null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.recognitionMethodSelection)||void 0===o?void 0:o.title)||"",e3),description:(0,eS.NI)((null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:null===(t=r.recognitionMethodSelection)||void 0===t?void 0:t.description)||"",e3),items:e6}};var tm=e=>{let{isMNP:i,price:n,defaultItem:o,isLoading:l,handleSelect:t}=e,r=(0,I.useQueryClient)(),{simOptions:d}=(0,E.Mg)(),a=(0,g.C)(g.J,nq.b.CMS_GET_PERSONAL_DATA_MOBILE),u=d.simOptions.find(e=>e.selection),s=(0,T.Y2)(u)||!1,v=tp(a,i,s,n),[c,f]=(0,m.useState)((()=>{var e,i;let n=localStorage.getItem("recognition")||"";if(n)return null==v?void 0:v.items.find(e=>e.value===n);let l=null==v?void 0:v.items.find(e=>"true"===e.isPreflagged);if(o)return Object.keys(l||{}).length>0?null==v?void 0:null===(e=v.items)||void 0===e?void 0:e.find(e=>"true"===e.isPreflagged):null==v?void 0:null===(i=v.items)||void 0===i?void 0:i.find(e=>e.value===o.code)})()),h=(0,T.De)(i?"mnp":"new sim","mobile",r);(0,i3.r)({event:["checkout_step4.7"],event_label:"VR: method selection",opts:{...null==h?void 0:h.opts,page_subsection:s?"e-sim":"sim fisica"},cartProduct:null==h?void 0:h.trackingProduct,pageProduct:null==h?void 0:h.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});let b=e=>{t(e)};return(0,m.useEffect)(()=>{c&&b(c)},[]),(0,p.jsx)(n3.k,{isSuccess:!l,title:null==v?void 0:v.title,description:null==v?void 0:v.description,items:null==v?void 0:v.items,value:null==c?void 0:c.value,selectedItem:c,setSelectedItem:f,onSelectItem:b})},tf=n(31558);let tg=(e,i,n,o,l)=>{var t,r,d,a,u,s,v,c;let p=l?null==e?void 0:null===(t=e.personalinfomobile)||void 0===t?void 0:t.recognitionCourierAutowallet:null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:r.recognitionCourier,m=l?null==e?void 0:null===(d=e.personalinfomobile)||void 0===d?void 0:d.recognitionCourierAutowallet:null==e?void 0:null===(a=e.personalinfomobile)||void 0===a?void 0:a.recognitionCourierEsim,f=i?m:p;return{data:{title:(0,eS.NI)((null==f?void 0:f.title)||"",n),description:(0,eS.NI)((null==f?void 0:f.description)||"",n),textBold:(0,eS.NI)(o?null==f?void 0:f.textMnp:(null==f?void 0:f.textBold)||"",n),text:(0,eS.NI)((null==f?void 0:f.text)||"",n)},list:{title:(0,eS.NI)((null==f?void 0:null===(u=f.list)||void 0===u?void 0:u[0].title)||"",n),items:(null==f?void 0:null===(v=f.list)||void 0===v?void 0:null===(s=v[0])||void 0===s?void 0:s.elements)||[{text:"",icon:""}],portabilityItems:(null==f?void 0:null===(c=f.list)||void 0===c?void 0:c[0].portability)||[{text:"",icon:""}]}}};var tE=e=>{var i,n;let{isMNP:o,isAutoWallet:l,price:t}=e,r=(0,I.useQueryClient)(),{simOptions:d}=(0,E.Mg)(),a=d.simOptions.find(e=>e.selection),u=(0,T.Y2)(a)||!1,s=(0,g.C)(g.J,nq.b.CMS_GET_PERSONAL_DATA_MOBILE),v=(0,T.De)(o?"mnp":"new sim","mobile",r);(0,i3.r)({event:["checkout_step4.8"],event_label:"VR: Corriere",opts:{...null==v?void 0:v.opts,page_section:u?"e-sim":"sim fisica"},cartProduct:null==v?void 0:v.trackingProduct,pageProduct:null==v?void 0:v.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});let c=tg(s,u,t||"",o,l),m={title:null==c?void 0:null===(i=c.list)||void 0===i?void 0:i.title,items:o?null==c?void 0:null===(n=c.list)||void 0===n?void 0:n.portabilityItems:c.list.items};return(0,p.jsx)(tf.Z,{data:null==c?void 0:c.data,list:m})};let th=(e,i)=>{var n,o,l,t,r,d,a,u;let s=i?null==e?void 0:null===(n=e.personalinfomobile)||void 0===n?void 0:n.recognitionVideoEsim:null==e?void 0:null===(o=e.personalinfomobile)||void 0===o?void 0:o.recognitionVideo;return{data:{title:(null==s?void 0:s.title)||"",description:(null==s?void 0:s.description)||"",textBold:(null==s?void 0:s.textBold)||"",text:(null==s?void 0:s.text)||""},list:{title:(null==s?void 0:null===(t=s.list)||void 0===t?void 0:null===(l=t[0])||void 0===l?void 0:l.title)||"",items:(null==s?void 0:null===(d=s.list)||void 0===d?void 0:null===(r=d[0])||void 0===r?void 0:r.elements)||[{text:"",icon:""}],portabilityItems:(null==s?void 0:null===(u=s.list)||void 0===u?void 0:null===(a=u[0])||void 0===a?void 0:a.portability)||[{text:"",icon:""}]}}};var tb=e=>{let{isMNP:i}=e,n=(0,I.useQueryClient)(),{simOptions:o}=(0,E.Mg)(),l=o.simOptions.find(e=>e.selection),t=(0,T.Y2)(l)||!1,r=th((0,g.C)(g.J,nq.b.CMS_GET_PERSONAL_DATA_MOBILE),t),d={title:r.list.title,items:i?r.list.portabilityItems:r.list.items},a=(0,T.De)(i?"mnp":"new sim","mobile",n);return(0,i3.r)({event:["checkout_step4.8"],event_label:"VR: Video Recognition",opts:{...null==a?void 0:a.opts,page_subsection:t?"e-sim":"sim fisica"},cartProduct:null==a?void 0:a.trackingProduct,pageProduct:null==a?void 0:a.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()}),(0,p.jsx)(tf.Z,{data:r.data,list:d})};let ty=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b;return{data:{title:(null==e?void 0:null===(n=e.personalinfomobile)||void 0===n?void 0:null===(i=n.recognitionEsim)||void 0===i?void 0:i.title)||"",description:(null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.recognitionEsim)||void 0===o?void 0:o.description)||"",textBold:(null==e?void 0:null===(r=e.personalinfomobile)||void 0===r?void 0:null===(t=r.recognitionEsim)||void 0===t?void 0:t.textBold)||"",text:(null==e?void 0:null===(a=e.personalinfomobile)||void 0===a?void 0:null===(d=a.recognitionEsim)||void 0===d?void 0:d.text)||""},list:{title:(null==e?void 0:null===(v=e.personalinfomobile)||void 0===v?void 0:null===(s=v.recognitionEsim)||void 0===s?void 0:null===(u=s.list)||void 0===u?void 0:u[0].title)||"",items:(null==e?void 0:null===(f=e.personalinfomobile)||void 0===f?void 0:null===(m=f.recognitionEsim)||void 0===m?void 0:null===(p=m.list)||void 0===p?void 0:null===(c=p[
10])||void 0===c?void 0:c.elements)||[{text:"",icon:""}],portability:(null==e?void 0:null===(b=e.personalinfomobile)||void 0===b?void 0:null===(h=b.recognitionEsim)||void 0===h?void 0:null===(E=h.list)||void 0===E?void 0:null===(g=E[0])||void 0===g?void 0:g.portability)||[{text:"",icon:""}]}}};var tC=e=>{var i,n,o;let{isMNP:l}=e,t=(0,I.useQueryClient)(),r=ty((0,g.C)(g.J,nq.b.CMS_GET_PERSONAL_DATA_MOBILE)),d={title:null==r?void 0:null===(i=r.list)||void 0===i?void 0:i.title,items:l?null==r?void 0:null===(n=r.list)||void 0===n?void 0:n.portability:null==r?void 0:null===(o=r.list)||void 0===o?void 0:o.items},a=(0,T.De)(l?"mnp":"new sim","mobile",t);return(0,i3.r)({event:["checkout_step4.8"],event_label:"VR: Video Recognition",opts:{...null==a?void 0:a.opts,page_subsection:"e-sim"},cartProduct:null==a?void 0:a.trackingProduct,pageProduct:null==a?void 0:a.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()}),(0,p.jsx)("div",{children:(0,p.jsx)(tf.Z,{data:null==r?void 0:r.data,list:d})})},t_=e=>{var i,n,o,l,t,r,d;let{handleOnChangeEnableGoNext:a}=e,{product:u}=(0,ts.q)(),s=(0,I.useQueryClient)(),[v,c]=(0,m.useState)(!1),{currentStepKey:f,portability:g,product:h,setPickupPoint:b,customerDeliveryBaseInfo:y,setRecognitionCode:C,simOptions:_,isModalButtonSticky:S}=(0,E.Mg)(),A=(null==g?void 0:g.portabilityWant)||!1,R=null==_?void 0:_.simOptions.find(e=>e.selection),L=(0,T.Y2)(R)||!1,N=null==y?void 0:null===(i=y.deliveryBase)||void 0===i?void 0:i.identificationDetails,O=(null==y?void 0:null===(n=y.deliveryBase)||void 0===n?void 0:n.deliveryOptions)||[],x=null==O?void 0:O.find(e=>"S"===e.code),P=null==x?void 0:null===(o=x.shippingOptions)||void 0===o?void 0:o[0],M=tv((null==P?void 0:null===(l=P.price)||void 0===l?void 0:l.amount)||0),k="0"==M?"":M,D=null==O?void 0:O.find(e=>e.code===l_.V.DI&&e.isSelected),B=Array.isArray(N)?N.find(e=>e.code===l_.V.VR):(null==N?void 0:N.code)===l_.V.VR,w=Array.isArray(N)?N.find(e=>e.code===l_.V.CO):(null==N?void 0:N.code)===l_.V.CO,j=(null==y?void 0:null===(t=y.deliveryBase)||void 0===t?void 0:t.isSuccess)&&(null==y?void 0:null===(r=y.modifySimDevice)||void 0===r?void 0:r.isSuccess),U=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),{portabilitymobile:F}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PORTABILITY_MOBILE),G=(null==F?void 0:null===(d=F.flags)||void 0===d?void 0:d.forceVideoRic)==="true",z=()=>{var e,i,n,o;c(!0);let l=()=>{let e=(null==u?void 0:u.hubPath)||"";window.location.href="".concat((0,ed.e)(),"/").concat(e)};eh.D0.handleError(eh.T_.getSeverityErrorHigh(),{title:(null==U?void 0:null===(e=U.genericerror)||void 0===e?void 0:e.title)||"",message:(null==U?void 0:null===(i=U.genericerror)||void 0===i?void 0:i.description)||"",actionText:(null==U?void 0:null===(n=U.genericerror)||void 0===n?void 0:n.buttonLabel)||"",onClose:l,actionEvent:l,secondButtonText:(null==h?void 0:h.removeCTC)?void 0:null==h?void 0:null===(o=h.genericErrorCallMeNow)||void 0===o?void 0:o.label,isButtonSticky:S,secondActionEvent:()=>{var e;return(0,eb.x)(s,(null==h?void 0:null===(e=h.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",h,l,f)},opts:{product_name:(null==h?void 0:h.slug)||""}})},V=()=>{b(nQ.IS),(0,eh.uY)(s,["deliveryDetailsIsEvolvedMobile","deliveryDetailsIsUltraMobile","deliveryDetailsIsAdvancedMobile","postDeliveryServiceDetails","deliveryAddress","deliveryCreatedAddress","deliveryDetailsIsEditAddress","individual","linkContactAndCustomer"])},Y=()=>{if(Array.isArray(N)){var e;if(0===N.length||1===N.length&&(null==N?void 0:null===(e=N[0])||void 0===e?void 0:e.code)===l_.V.NA)return z()}else if((null==N?void 0:N.code)===l_.V.NA)return z();if(Array.isArray(N)){let e=0===N.length&&(null==N?void 0:N[0].code)===l_.V.NA,i=N.find(e=>e.code===l_.V.CO),n=N.find(e=>e.code===l_.V.VR);e?null==a||a(!1):i&&!n||!i&&n?(localStorage.setItem("recognition",i&&!n?l_.V.CO:l_.V.VR),null==a||a(!0)):null==a||a(!1)}return null};return((0,m.useEffect)(()=>{j&&Y()}
1,[N,j]),v)?null:G?!w||D||B?B||!B&&D?(C("VR"),localStorage.setItem("recognition",l_.V.VR),L)?(0,p.jsx)(tC,{isMNP:A}):(0,p.jsx)(tb,{isMNP:A}):null:(C("CO"),localStorage.setItem("recognition",l_.V.CO),(0,p.jsx)(tE,{isMNP:A,price:k,isAutoWallet:null==h?void 0:h.isAutoWallet})):B&&w&&!D?(0,p.jsx)(tm,{isLoading:!1,isMNP:A,handleSelect:e=>{let i=(null==e?void 0:e.value)||"",n=N.findIndex(e=>e.code===l_.V.VR),o=N.findIndex(e=>e.code===l_.V.CO);N[n]={...N[n],isSelected:e&&(null==e?void 0:e.value)===l_.V.VR||!1},N[o]={...N[o],isSelected:e&&(null==e?void 0:e.value)===l_.V.CO||!1},V(),C(i),localStorage.setItem("recognition",i),null==a||a(!0)},price:k,defaultItem:Array.isArray(N)?N.find(e=>e.isSelected)||void 0:(null==N?void 0:N.isSelected)?N:void 0}):w&&!D?(C("CO"),localStorage.setItem("recognition",l_.V.CO),(0,p.jsx)(tE,{isMNP:A,price:k,isAutoWallet:null==h?void 0:h.isAutoWallet})):B||!B&&D?(C("VR"),localStorage.setItem("recognition",l_.V.VR),L)?(0,p.jsx)(tC,{isMNP:A}):(0,p.jsx)(tb,{isMNP:A}):null},tS=n(60784),tI=n(9399),tT=n(19301),tA=n(777),tR=e=>{var i;let{handleOnChangeEnableGoNext:n}=e,{simOptions:o,portabilityStatus:l,customerDeliveryBaseInfo:t,setSimTypeSelectedOption:r,setSimOptions:d}=(0,E.Mg)(),a=(0,g.C)(g.J,n7.bl.CMS_GET_PERSONAL_DATA_MOBILE),u=(0,g.C)(g.J,n7.bl.CMS_GET_PORTABILITY_MOBILE),s=(0,tT.QY)(a,u),v=(0,tA.P)(),c=(0,T.De)("e-sim option ".concat(null==s?void 0:null===(i=s.modalInfo)||void 0===i?void 0:i.textLink)),{trackView:p}=(0,eh.rS)({event:["view"],disableInitialTrack:!0,opts:c.opts,visitorTrackingOpts:v,cartProduct:c.trackingProduct,pageProduct:c.pageProductsInfo});(0,ef.kg)(p,"e-sim option");let f=()=>{var e,i;p({event_name:"ui_interaction",page_name_override:"e-sim option",event_label_track:"e-sim option ".concat((null==o?void 0:null===(i=o.simOptions)||void 0===i?void 0:null===(e=i.find(e=>null==e?void 0:e.selection))||void 0===e?void 0:e.value)||""),event_category:"users",event_action:"click",tracking_type:"link"})};return(0,m.useEffect)(()=>{let e=document.getElementById("sticky-offer-next");return null==e||e.addEventListener("click",f),()=>{null==e||e.removeEventListener("click",f)}},[o]),(0,m.useEffect)(()=>{null==n||n(!(null==l?void 0:l.isLoadingCheck))},[null==l?void 0:l.isLoadingCheck,null==t?void 0:t.modifySimDevice]),(0,m.useEffect)(()=>{let e=o.simOptions.find(e=>e.selection);null==n||n(!!e)},[]),{organizedDataForSim:s,simOptions:o,getSelectedItem:()=>{var e;let i=null==o?void 0:null===(e=o.simOptions)||void 0===e?void 0:e.find(e=>e.selection);return{title:(null==i?void 0:i.title)||"",value:(null==i?void 0:i.value)||""}},trackOpenModal:()=>{var e;p({event_name:"ui_interaction",page_name_override:"e-sim option",event_label_track:"e-sim option ".concat(null==s?void 0:null===(e=s.modalInfo)||void 0===e?void 0:e.textLink),event_category:"users",event_action:"click",tracking_type:"link"})},handleSelect:e=>{var i,n;if(!e)return;let t=(0,n9.f)("modifyMobileSimDeviceId"),a=null==o?void 0:null===(i=o.simOptions)||void 0===i?void 0:i.find(i=>i.value===e.value);!a||(null==a?void 0:a.id)===(null==t?void 0:t.simOptionId)||(null==l?void 0:l.isLoadingCheck)||r(a),d({...o,simOptions:null==o?void 0:null===(n=o.simOptions)||void 0===n?void 0:n.map(i=>i.value===(null==e?void 0:e.value)?{...i,selection:!0}
1:{...i,selection:!1})})},portabilityStatus:l}};let tL=e=>{var i;let{handleOnChangeEnableGoNext:n}=e,{organizedDataForSim:o,simOptions:l,getSelectedItem:t,trackOpenModal:r,handleSelect:d,portabilityStatus:a}=tR({handleOnChangeEnableGoNext:n});return(0,p.jsx)(n3.k,{title:o.cardTitle,description:o.cardDescription,items:null==l?void 0:null===(i=l.simOptions)||void 0===i?void 0:i.map(e=>({title:e.title||"",value:e.value||"",extra:e.highlight?{text:(null==e?void 0:e.highlightedLabel)||o.bestChoiceLabel||"",color:"#fff",extraClass:"extraClass"}:void 0})),value:t().value,selectedItem:t(),setSelectedItem:()=>{},onSelectItem:d,bottomModal:o.modalInfo,onOpeneModal:r,isSuccess:!(null==a?void 0:a.isLoadingCheck)})};function tN(){let e=(0,D._)(["\n    padding: 0 ",";\n    height: 737px;\n  "]);return tN=function(){return e},e}function tO(){let e=(0,D._)(["\n    padding: 0 ",";\n  "]);return tO=function(){return e},e}function tx(){let e=(0,D._)(["\n  padding: 0 ",";\n  text-align: center;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  height: 492px;\n  gap: ","\n\n  ","\n\n  ","\n"]);return tx=function(){return e},e}function tP(){let e=(0,D._)(["\n    width: 100%;\n    margin-left: 0;\n    margin-right: 0;\n  "]);return tP=function(){return e},e}function tM(){let e=(0,D._)(["\n  height: ",";\n\n  ","\n"]);return tM=function(){return e},e}function tk(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  gap: ",";\n"]);return tk=function(){return e},e}function tD(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-style: normal;\n  text-align: center;\n  font-size: ",";\n  line-height: ",";\n  color: #00697C;\n"]);return tD=function(){return e},e}function tB(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-style: normal;\n  text-align: center;\n  font-size: ",";\n  line-height: ",";\n"]);return tB=function(){return e},e}let tw=B.Z.div(tx(),w.r.spacing.lg,w.r.spacing.md,w.B.tablet(tN(),w.r.spacing.xl),w.B.desktop(tO(),w.r.spacing["3xl"])),tj=B.Z.div(tM(),w.r.spacing.xl,w.B.tablet(tP())),tU=B.Z.div(tk(),w.r.spacing.md),tF=B.Z.div(tD(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.display4,w.r.typography.lineHeight.display4),tG=B.Z.div(tB(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.h5,w.r.typography.lineHeight.display5);var tz=e=>{let{product:i,hasAcceptedFallback:n}=e,{currentStepKey:o}=(0,E.Mg)(),{digitalBundleConfig:l}=i,t=()=>{iV.datadogRum.addError({step:o,message:"La pagina sembra non rispondere in questo momento. Attendi o premi il tasto in basso per essere ricontattato.",error:"stuck"})};return(0,m.useEffect)(()=>{let e=setInterval(()=>{t()},12e4);return()=>clearInterval(e)},[]),{digitalBundleConfig:l,getLoader:()=>{var e;return(null==l?void 0:null===(e=l.loadingCard)||void 0===e?void 0:e.loader)||""}}};let tV=e=>{let{product:i,hasAcceptedFallback:n}=e,{getLoader:o,digitalBundleConfig:l}=tz({product:i,hasAcceptedFallback:n});return(0,p.jsxs)(tw,{children:[(()=>{if(n){var e,i;return(0,p.jsxs)(tU,{children:[(0,p.jsx)(tF,{children:null==l?void 0:null===(e=l.loadingCard)||void 0===e?void 0:e.title}),(0,p.jsx)(tG,{children:null==l?void 0:null===(i=l.loadingCard)||void 0===i?void 0:i.subtitle})]})}return(0,p.jsx)(tj,{})})(),o()?(0,p.jsx)(iz.J5,{src:(0,iF.o)(o()).src||"",className:"player",loop:!0,autoplay:!0}):(0,p.jsx)(iG.Z,{quantity:2,heights:90})]})};var tY=n(90462);function tH(){let e=(0,D._)(["\n    padding: "," 0 0;\n  "]);return tH=function(){return e},e}function tZ(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  /* stylelint-disable-next-line value-no-vendor-prefix */\n  height: -webkit-fill-available;\n  justify-content: space-between;\n  font-family: ",";\n  font-weight: ",";\n  color: ",";\n  text-align: left;\n  /* stylelint-disable-next-line declaration-block-no-duplicate-properties */\n  height: 100%;\n\n  ","\n"]);return tZ=function(){return e},e}function tQ(){let e=(0,D._)(["\n    text-align: ",";\n    margin-bottom: ","\n  "]);return tQ=function(){return e},e}function tW(){let e=(0,D._)(["\n    text-align: left;\n    font-size: ",";\n    line-height: ",";\n    margin-bottom: ","\n  "]);return tW=function(){return e},e}function tK(){let e=(0,D._)(["\n  font-size: ",";\n  line-height: ",";\n  margin-bottom: ","\n\n  ","\n\n  ","\n"]);return tK=function(){return e},e}function tJ(){let e=(0,D._)(["\n  overflow: ",";\n"]);return tJ=function(){return e},e}function tq(){let e=(0,D._)(["\n    margin-bottom: ",";\n  "]);return tq=function(){return e},e}function tX(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n    margin-bottom: ",";\n  "]);return tX=function(){return e},e}function t$(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n    margin-bottom: ",";\n    text-align: center;\n\n  ","\n\n  ","\n"]);return t$=function(){return e},e}function t0(){let e=(0,D._)(["\n      text-align: center;\n      font-size: ",";\n      line-height: ",";\n    "]);return t0=function(){return e},e}function t1(){let e=(0,D._)(["\n      text-align: left;\n    "]);return t1=function(){return e},e}function t2(){let e=(0,D._)(["\n    margin: 0 auto;\n    font-family: ",";\n    font-size: ",";\n    line-height: ",";\n    text-align: left;\n\n    p {\n        margin: 0;\n    }\n\n    ","\n\n    ","\n"]);return t2=function(){return e},e}function t5(){let e=(0,D._)(["\n    margin-top: ","\n    flex-direction: row;\n    gap: ",";\n\n    button {\n      width: 100%;\n      max-width: 258px;\n    }\n  "]);return t5=function(){return e},e}function t3(){let e=(0,D._)(["\n    button {\n      width: 100%;\n      max-width: 296px;\n    }\n  "]);return t3=function(){return e},e}function t6(){let e=(0,D._)(["\n  bottom: 0;\n  display: flex;\n  flex-direction: column;\n  gap: ","\n  justify-content: center;\n\n  button {\n    width: 100%;\n    max-width: inherit;\n  }\n\n  ","\n\n  ","  \n"]);return t6=function(){return e},e}let t4=B.Z.div(tZ(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.colors.text.primary,w.B.tablet(tH(),w.r.spacing.sm)),t7=B.Z.div(tK(),w.r.typography.fontSize.h4,w.r.typography.lineHeight.display4,w.r.spacing.xl,w.B.tablet(tQ(),e=>{let{textAlign:i}=e;return i||"center"},w.r.spacing.lg),w.B.desktop(tW(),w.r.typography.fontSize.h2,w.r.typography.lineHeight.h1,w.r.spacing.xl)),t9=B.Z.div(tJ(),e=>{let{isButtonSticky:i}=e;return i?"auto":"unset"});B.Z.div(t$(),w.r.typography.fontSize.h4,w.r.typography.lineHeight.display4,w.r.spacing.xl,w.B.tablet(tq(),w.r.spacing.lg),w.B.desktop(tX(),w.r.typography.fontSize.h2,w.r.typography.lineHeight.h1,w.r.spacing.xl));let t8=B.Z.div(t2(),lx.R.regular,w.r.typography.fontSize.h6,w.r.typography.lineHeight.h5,w.B.tablet(t0(),w.r.typography.fontSize.body1,w.r.typography.lineHeight.h5),w.B.desktop(t1())),re=B.Z.div(t6(),w.r.spacing.lg,w.B.tablet(t5(),w.r.spacing.xl,w.r.spacing.xl),w.B.desktop(t3())),ri=e=>{let{title:i,description:n,buttonLabel:o,onButtonClick:l,onClose:t,isOpen:r}=e,[d,a]=(0,b.q)([i,n]);return(0,p.jsx)(ek.Z,{isOpen:r,handleClose:t,children:(0,p.jsxs)(t4,{children:[(0,p.jsxs)(t9,{children:[(0,p.jsx)(t7,{dangerouslySetInnerHTML:{__html:d||""}}),(0,p.jsx)(t8,{dangerouslySetInnerHTML:{__html:a||""}})]}),(0,p.jsx)(re,{children:(0,p.jsx)(tY.z,{variant:"primary",onClick:l,children:o})})]})})};var rn=n(71170),ro=n(19042),rl=n(57563),rt=n(68830),rr=n(79487);let rd=e=>{let{enabler:i,product:n}
1=e,{customerFlow:o,portabilityStatus:l,setCustomerFlow:t,setPortabilityStatus:r}=(0,E.Mg)(),{paymean:d}=o,[a,u]=(0,m.useState)(!1),[s,v]=(0,m.useState)(!1),[c,p]=(0,m.useState)(!1),[f,g]=(0,m.useState)(),h=(0,I.useQueryClient)(),b=h.getQueryData("silentLogin"),y=eS.L1.includes(null==b?void 0:b.flowId)||!1,C=(0,n9.f)("customerData"),_=null==C?void 0:C[0],S=(0,rt.L)(),{mutate:T,isError:A,isSuccess:R,error:L}=(0,rr.g)();return(0,m.useEffect)(()=>{R&&(r({...l,portInData:void 0,isLoadingCheck:!1,isSuccessCheck:!1,isErrorCheck:!1,isStartPortIn:!1}),t({...o,billingAccount:{...o.billingAccount,error:void 0,isLoading:!1,isSuccess:!1,isError:!1},paymean:{...o.paymean,error:void 0,isLoading:!1,isSuccess:!1,isError:!1},acceptedFallbackOffer:!0}))},[R]),(0,m.useEffect)(()=>{S.isSuccess&&S.data&&T({cartId:S.data.id})},[S.isSuccess]),(0,m.useEffect)(()=>{if(i&&(null==n?void 0:n.offerId)&&(null==n?void 0:n.planId.toString())){let e=(0,rl.x)(null==n?void 0:n.offerId,null==n?void 0:n.planId.toString(),y,(null==_?void 0:_.id)||"",null==n?void 0:n.isRequiredPortability,!1,(null==n?void 0:n.isRequiredPortability)?{dummyNumber:null==n?void 0:n.portabilityDummyNumber,dummyOperator:null==n?void 0:n.portabilityDummyOperator}:void 0);e?(t({...o,associateCustomer:{isLoading:!1,isSuccess:!1,isError:!1},paymean:{isLoading:!1,isSuccess:!1,isError:!1},billingAccount:{isLoading:!1,isSuccess:!1,isError:!1}}),(0,eh.uY)(h,["associateCustomer","paymentData","billingAccount","payMean","updateProductChatacteristics","doUpdateProductCharacteristic","checkPortInFeasibilityII"]),S.mutate(e),u(!0)):v(!0)}},[i]),(0,m.useEffect)(()=>{S.isError&&(u(!1),v(!0),g((0,ro.n)("shoppingCart",S.error))),A&&(u(!1),v(!0),g((0,ro.n)("simInformation",L)))},[S.isError,A]),(0,m.useEffect)(()=>{o.associateCustomer.isError&&(u(!1),v(!0),g(o.associateCustomer.error)),o.payment.isError&&(u(!1),v(!0),g(o.payment.error)),o.billingAccount.isError&&u(!1),o.paymean.isError&&(u(!1),v(!0),g(o.paymean.error)),o.updateProductChatacteristics.isError&&(u(!1),v(!0),g(o.updateProductChatacteristics.error))},[o.associateCustomer.isError,o.payment.isError,o.billingAccount.isError,o.paymean.isError,o.updateProductChatacteristics.isError]),(0,m.useEffect)(()=>{S.isSuccess&&R&&d.isSuccess&&(u(!1),p(!0),t({...o,acceptedFallbackOffer:!1}))},[S,R,d.isSuccess]),{isError:s,isLoading:a,isSuccess:c,error:f}};var ra=e=>{let{handleOnChangeEnableGoNext:i}=e,{currentStepKey:n,portability:o,ICCID:l,isModalButtonSticky:t,product:r,checkoutErrors:d,portabilityStatus:a,setPortabilityStatus:u,setSlidesGoBack:s,setProduct:c,setCheckoutStepState:p}=(0,E.Mg)(),[f,g]=(0,m.useState)(!1),[b,y]=(0,m.useState)(!1),[C,_]=(0,m.useState)(!1),[S,A]=(0,m.useState)(r),{products:R}=(0,ts.q)(),L=(0,I.useQueryClient)(),N=(0,n9.f)("shoppingCart"),O=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),x=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PERSONAL_DATA_MOBILE),P=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PORTABILITY_MOBILE),M=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_DIGITAL_BUNDLE_OPERATORS)||{},k=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_CLICK_TO_CALL_CONF),D=(0,tT.QY)(x,P),[B,w]=(0,m.useState)({title:"",description:"",buttonLabel:"",isOpen:!1}),j=()=>{window.location.href="/"},{isError:U,isLoading:F,isSuccess:G,error:z}=rd({enabler:C,product:S}),{trackWithNewDatalayer:V,trackView:Y}=(0,eh.rS)({event:["view"],disableInitialTrack:!0});return(0,m.useEffect)(()=>{if(F){var e;let{opts:i}=(0,T.De)("loader","mobile",L);V({event:["checkout_step4.4.3"],event_label:"offer exchange loader",opts:{...i,versatile_prop:(0,tT._J)(null===(e=o.portabilityMigration)||void 0===e?void 0:e.currentProvider)},cartProduct:{cart_id:null==N?void 0:N.id,cart_product_id:"".concat(null==S?void 0:S.offerId),cart_product_name:null==S?void 0:S.slug,cart_product_category:null==S?void 0:S.productCategory,cart_product_price:(null==S?void 0:S.price)&&(0,rn.F)(S.price),cart_product_quantity:"1",cart_total:(null==S?void 0:S.price)&&(0,rn.F)(S.price)},pageProduct:{product_name:(null==S?void 0:S.slug)||"",product_price:(null==S?void 0:S.price)?(0,rn.F)(null==S?void 0:S.price):"",product_id:"".concat(null==S?void 0:S.offerId),product_quantity:"1",product_category:"mobile"},visitorTrackingOpts:(0,T.bG)()})}},[F]),(0,m.useEffect)(()=>{var e,i,n;if(!o.portabilityWant||G&&a.isSuccessCheck||(null===(e=o.portabilityMigration)||void 0===e?void 0:e.currentProvider)&&(0,tT.k3)(o.portabilityMigration.currentProvider,null==M?void 0:null===(i=M.operatorsconfiggroup)||void 0===i?void 0:i.elements,r.offerAvaiability)){let e=(0,T.De)("e-sim option","mobile",L);V({event:["checkout_step4.7"],event_label:"e-sim option",opts:{...null==e?void 0:e.opts,versatile_prop:(0,tT._J)(null===(n=o.portabilityMigration)||void 0===n?void 0:n.currentProvider)},cartProduct:null==e?void 0:e.trackingProduct,pageProduct:null==e?void 0:e.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()})}},[G]),(0,m.useEffect)(()=>{(null==a?void 0:a.isSuccessCheck)&&_(!1)},[null==a?void 0:a.isSuccessCheck]),(0,m.useEffect)(()=>
1{if(null==a?void 0:a.isErrorCheck){var e,i,u,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A;let R=()=>{s(3)},N=(0,eS.nQ)("checkPortInFeasibilityII",{status:"200",url:n7.bl.CHECK_IN_PORT,statusText:"failure"},"failure",null==a?void 0:a.errorMessage,"check portin failure",!1,{body:{currentPlanType:(null==o?void 0:null===(e=o.portabilityMigration)||void 0===e?void 0:e.currentPlan)||"",currentServiceProviderId:(null==o?void 0:null===(i=o.portabilityMigration)||void 0===i?void 0:i.currentProvider)||"",currentServiceProviderIdName:(null==o?void 0:null===(u=o.portabilityMigration)||void 0===u?void 0:u.currentProvider)||"",msisdn:o.portabilityNumber||"",isSimAvailable:l&&(null==l?void 0:l.trim())!==""?"true":"false",transferRemainingBalance:String(null==o?void 0:null===(v=o.portabilityMigration)||void 0===v?void 0:v.transferBalance),simCardNumber:(null==l?void 0:l.trim())||""},response:{...null==a?void 0:a.portInData}});switch(null==a?void 0:a.errorMessage){case e_.S.NUMBER_ERROR:null==d||null===(g=d.showAndTrackError)||void 0===g||g.call(d,O,R,N,null==D?void 0:null===(c=D.numberError)||void 0===c?void 0:c.title,null==D?void 0:null===(p=D.numberError)||void 0===p?void 0:p.description,R,null==D?void 0:null===(m=D.numberError)||void 0===m?void 0:m.buttonLabel,()=>{var e;return(0,eb.x)(L,(null==r?void 0:null===(e=r.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",r,R,n,N)},(null==r?void 0:r.removeCTC)?void 0:null==r?void 0:null===(f=r.genericErrorCallMeNow)||void 0===f?void 0:f.label,t);break;case e_.S.MIGRATION_CODE_ERROR:null==d||null===(C=d.showAndTrackError)||void 0===C||C.call(d,O,R,N,null==D?void 0:null===(E=D.migrationCodeError)||void 0===E?void 0:E.title,null==D?void 0:null===(h=D.migrationCodeError)||void 0===h?void 0:h.description,R,null==D?void 0:null===(b=D.migrationCodeError)||void 0===b?void 0:b.buttonLabel,()=>{var e;return(0,eb.x)(L,(null==r?void 0:null===(e=r.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",r,R,n,N)},(null==r?void 0:r.removeCTC)?void 0:null==r?void 0:null===(y=r.genericErrorCallMeNow)||void 0===y?void 0:y.label,t);break;default:null==d||null===(A=d.showAndTrackError)||void 0===A||A.call(d,O,R,N,null==D?void 0:null===(_=D.genericsError)||void 0===_?void 0:_.title,null==D?void 0:null===(S=D.genericsError)||void 0===S?void 0:S.description,R,null==D?void 0:null===(I=D.genericsError)||void 0===I?void 0:I.buttonLabel,()=>{var e;return(0,eb.x)(L,(null==r?void 0:null===(e=r.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",r,R,n,N)},(null==r?void 0:r.removeCTC)?void 0:null==r?void 0:null===(T=r.genericErrorCallMeNow)||void 0===T?void 0:T.label,t)}}},[null==a?void 0:a.isErrorCheck]),(0,m.useEffect)(()=>{if(U){var e,i,o,l;null==d||null===(l=d.showAndTrackError)||void 0===l||l.call(d,O,j,z,null==D?void 0:null===(e=D.genericsError)||void 0===e?void 0:e.title,null==D?void 0:null===(i=D.genericsError)||void 0===i?void 0:i.description,()=>{var e;return(0,eb.x)(L,(null==r?void 0:null===(e=r.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",r,j,n,z)},(null==r?void 0:r.removeCTC)?void 0:null==r?void 0:null===(o=r.genericErrorCallMeNow)||void 0===o?void 0:o.label,void 0,void 0,t)}},[U]),(0,m.useEffect)(()=>{f&&u({...a,isStartPortIn:!0})},[f]),(0,m.useEffect)(()=>{G&&g(!0)},[G]),(0,m.useEffect)(()=>{i&&i(!F)},[F]),(0,m.useEffect)(()=>{var e,i,n,l,t;if(o.portabilityWant&&(null==o?void 0:null===(e=o.portabilityOtp)||void 0===e?void 0:e.isVerified)){if((null===(i=o.portabilityMigration)||void 0===i?void 0:i.currentProvider)&&!(0,tT.k3)(o.portabilityMigration.currentProvider,null==M?void 0:null===(n=M.operatorsconfiggroup)||void 0===n?void 0:n.elements,r.offerAvaiability)){let e=(0,tT.Vz)(r,o.portabilityMigration.currentProvider,R,null==M?void 0:null===(l=M.operatorsconfiggroup)||void 0===l?void 0:l.elements);if(void 0!==e)A(e),y(!0);else{let e=(0,tT.BL)(null==r?void 0:null===(t=r.digitalBundleConfig)||void 0===t?void 0:t.noOfferError,o.portabilityMigration.currentProvider);w({title:(null==e?void 0:e.title)||"",description:(null==e?void 0:e.description)||"",buttonLabel:(null==e?void 0:e.buttonLabel)||"",isOpen:!0}),Y({event_name:"page_error",event_category:"error",page_error:"_".concat((null==e?void 0:e.title)||"Ops","_").concat((null==e?void 0:e.buttonLabel)||"Ti richiamiamo noi"),page_type:"error page",product_name:(null==r?void 0:r.slug)||""})}}else g(!0)}},[]),(0,m.useEffect)(()=>{p(h.v9.SIM_TYPE_SELECTION_CARD,{})},[]),{cmsOperatorsConfig:M,product:r,buildTrackingObject:e=>{var i,n;let l={event:[""],event_label:"",opts:{},cartProduct:{cart_id:null==N?void 0:N.id,cart_product_id:"".concat(null==S?void 0:S.offerId),cart_product_name:null==S?void 0:S.slug,cart_product_category:null==S?void 0:S.productCategory,cart_product_price:(null==S?void 0:S.price)&&(0,rn.F)(S.price),cart_product_quantity:"1",cart_total:(null==S?void 0:S.price)&&(0,rn.F)(S.price)},pageProduct:{product_name:(null==S?void 0:S.slug)||"",product_price:(null==S?void 0:S.price)?(0,rn.F)(null==S?void 0:S.price):"",product_id:"".concat(null==S?void 0:S.offerId),product_quantity:"1",product_category:"mobile"},visitorTrackingOpts:(0,T.bG)()};switch(e){case v.OFFER_STEP:{let{opts:e}=(0,T.De)("pop up","mobile",L);l={...l,event:["checkout_step4.4.1"],event_label:"offer exchange",opts:{...e,versatile_prop:(0,tT._J)(null===(i=o.portabilityMigration)||void 0===i?void 0:i.currentProvider)}};break}case v.DETAILS_STEP:{let{opts:e}=(0,T.De)("offerDetails","mobile",L);l={...l,event:["checkout_step4.4.2"],event_label:"offer exchange details",opts:{...e,versatile_prop:(0,tT._J)(null===(n=o.portabilityMigration)||void 0===n?void 0:n.currentProvider)}}}}return l},noOfferConfig:B,redirectHomePage:j,volaClickToCallData:k,queryClient:L,portability:o,portabilityStatus:a,avaiableProduct:S,isFallbackModalOpen:b,handleClose:()=>{y(!1),j()},handleAccept:()=>{localStorage.setItem("tProd_backUp",JSON.stringify(r)),c({...S,slug:null==r?void 0:r.slug,shoppingCartUrl:null==r?void 0:r.shoppingCartUrl}),y(!1),_(!0)},hasAccepted:C,isAcceptLoading:F}},ru=n(76855),rs=n(65595);function rv(){let e=(0,D._)(["\n    padding: 0 40px;\n    height: 737px;\n  "]);return rv=function(){return e},e}function rc(){let e=(0,D._)(["\n    padding: 0 74px;\n  "]);return rc=function(){return e},e}function rp(){let e=(0,D._)(["\n  padding: 0 20px;\n  text-align: center;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  height: 492px;\n\n  ","\n\n  ","\n"]);return rp=function(){return e},e}function rm(){let e=(0,D._)(["\n    width: 100%;\n    margin-left: 0;\n    margin-right: 0;\n  "]);return rm=function(){return e},e}function rf(){let e=(0,D._)(["\n  height: 30px;\n\n  ","\n"]);return rf=function(){return e},e}let rg=B.Z.div(rp(),iY.B.tablet(rv()),iY.B.desktop(rc())),rE=B.Z.div(rf(),iY.B.tablet(rm()));var rh=n(63459),rb=n(15277),ry=n(32218),rC=n(57714);let r_={individual:{isLoading:!1,isSuccess:!1,isError:!1},linkContact:{isLoading:!1,isSuccess:!1,isError:!1},validateAddress:{isLoading:!1,isSuccess:!1,isError:!1},createAddress:{isLoading:!1,isSuccess:!1,isError:!1},deliveryEvolved:{isLoading:!1,isSuccess:!1,isError:!1},postDelivery:{isLoading:!1,isSuccess:!1,isError:!1}},rS=e=>{let{pickupPoint:i,shippingAddress:n}=e,o=(0,I.useQueryClient)(),{simOptions:l}=(0,E.Mg)(),[t,r]=(0,m.useState)(r_),[d,a]=(0,m.useState)({shippingAddress:void 0,pickupPoint:void 0}),u=(0,n9.f)("deliveryDetailsIsBaseMobile"),s=null==l?void 0:l.simOptions.find(e=>
1e.selection),v=(0,T.Y2)(s)||!1,{mutate:c,error:p,isError:f,isSuccess:g,isLoading:h}=(0,rb.os)(),{refetch:b,error:y,isError:C,isSuccess:_,isLoading:S}=(0,rb.DR)(null==d?void 0:d.shippingAddress,null==d?void 0:d.pickupPoint,v,{enabled:!1}),{isSuccess:A,error:R,isError:L,isLoading:N,refetch:O}=(0,ry.U)({enabled:!1}),{mutate:x,error:P,data:M,isLoading:k,isSuccess:D,isError:B}=(0,iN.r)(),{mutate:w,error:j,isSuccess:U,isError:F,isLoading:G,data:z}=(0,oa.V)(),{mutate:V,error:Y,isSuccess:H,isError:Z,isLoading:Q}=(0,rC.A)(),W=()=>{V(null==z?void 0:z.id)},K=()=>!!(0,n9.f)("individual");(0,m.useEffect)(()=>{h?r(e=>({...e,postDelivery:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0}})):f?r(e=>({...e,postDelivery:{isLoading:!1,isSuccess:!1,isError:!0,error:(0,eS.nQ)("postDelivery",p)}})):g&&(r(e=>({...e,postDelivery:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0}})),(0,nH.u)(o,["deliveryDetailsIsEvolvedMobile"]))},[f,h,g]),(0,m.useEffect)(()=>{S?r(e=>({...e,deliveryEvolved:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0}})):C?r(e=>({...e,deliveryEvolved:{isLoading:!1,isSuccess:!1,isError:!0,error:(0,eS.nQ)("deliveryEvolved",y)}})):_&&(r(e=>({...e,deliveryEvolved:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0}})),c({isEsim:v,shippingAddress:null==d?void 0:d.shippingAddress,pickupPoint:null==d?void 0:d.pickupPoint}))},[_,C,S]),(0,m.useEffect)(()=>{((null==d?void 0:d.shippingAddress)||(null==d?void 0:d.pickupPoint))&&b()},[d]),(0,m.useEffect)(()=>{Q?r(e=>({...e,linkContact:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0}})):Z?r(e=>({...e,linkContact:{isLoading:!1,isSuccess:!1,isError:!0,error:(0,eS.nQ)("linkContact",Y)}})):H&&(r(e=>({...e,linkContact:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0},postDelivery:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0}})),a({shippingAddress:z,pickupPoint:i}))},[H,Z,Q]),(0,m.useEffect)(()=>{N?r(e=>({...e,individual:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0}})):L?r(e=>({...e,individual:{isLoading:!1,isSuccess:!1,isError:!0,error:(0,eS.nQ)("individual",R)}})):A&&U&&!g&&!h&&(r(e=>({...e,linkContact:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0},individual:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0}})),W())},[A,L,N]),(0,m.useEffect)(()=>{G?r(e=>({...e,createAddress:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0}})):F?r(e=>({...e,createAddress:{isLoading:!1,isSuccess:!1,isError:!0,error:(0,eS.nQ)("createAddress",j)}})):U&&(K()?(r(e=>({...e,linkContact:{isLoading:!0,isError:!1,error:void 0,isSuccess:!1},individual:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0},createAddress:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0}})),W()):(r(e=>({...e,individual:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0},createAddress:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0}})),O()))},[U,F,G]),(0,m.useEffect)(()=>{if(k)r(e=>({...e,validateAddress:{isLoading:!0,isSuccess:!1,isError:!1,error:void 0}}));else if(B)r(e=>({...e,validateAddress:{isLoading:!1,isSuccess:!1,isError:!0,error:(0,eS.nQ)("validateAddress",P)}}));else if(D){var e,i;(null==M?void 0:null===(e=M.validAddressList)||void 0===e?void 0:e[0])?(r(e=>({...e,validateAddress:{isLoading:!1,isSuccess:!0,isError:!1,error:void 0}})),w({address:null==M?void 0:null===(i=M.validAddressList)||void 0===i?void 0:i[0],isDelivery:!0})):r(e=>({...e,validateAddress:{isLoading:!1,isSuccess:!1,isError:!0,error:(0,eS.nQ)("validateAddress")}}))}},[D,B,k]);let J=()=>{let e=(0,rh.v$)(u,n);(null==i?void 0:i.storeId)||e?a({shippingAddress:e,pickupPoint:i}):x({placeObject:n,isDelivery:!0})};return(0,m.useEffect)(()=>{(0,eS.Vz)()||J()},[]),t};var rI=e=>{let{handleGoPrevSlide:i,handleOnChangeEnableGoNext:n}=e,o=(0,I.useQueryClient)(),{isModalButtonSticky:l,product:t,shippingAddress:r,pickupPoint:d,checkoutErrors:a,setIsDisabledBackButton:u,setIsNewShippingAddress:s,setIsStartDeliveryBase:v}=(0,E.Mg)(),{validateAddress:c,deliveryEvolved:f,createAddress:g,postDelivery:h,individual:b,linkContact:y}=rS({pickupPoint:d,shippingAddress:r}),C=(0,ru.CA)(ru.Jn,rs.b.CMS_GET_DELIVERY_INFORMATION_MOBILE),_=(0,ru.CA)(ru.Jn,rs.b.CMS_GET_GENERIC_ERROR_MOBILE),{buttonGenericError:S}=(0,ru.S6)(t),T=()=>(null==c?void 0:c.isLoading)||(null==f?void 0:f.isLoading)||(null==g?void 0:g.isLoading)||h.isLoading||b.isLoading||y.isLoading,A=()=>(null==c?void 0:c.isError)||(null==f?void 0:f.isError)||(null==g?void 0:g.isError)||(null==b?void 0:b.isError)||(null==h?void 0:h.isError)||(null==y?void 0:y.isError),R=()=>(null==c?void 0:c.isError)?null==c?void 0:c.error:(null==f?void 0:f.isError)?null==f?void 0:f.error:(null==g?void 0:g.isError)?null==g?void 0:g.error:(null==b?void 0:b.isError)?null==b?void 0:b.error:(null==h?void 0:h.isError)?null==h?void 0:h.error:(null==y?void 0:y.isError)?null==y?void 0:y.error:void 0,L=()=>
1{if(T()&&(null==n||n(!1)),u(T()),A()){var e,o,t,r,d,s,v;let n=R();null==a||null===(v=a.showAndTrackError)||void 0===v||v.call(a,_,i,n,(null==C?void 0:null===(t=C.deliveryinformationm)||void 0===t?void 0:null===(o=t.errorCards)||void 0===o?void 0:null===(e=o.addressResponse)||void 0===e?void 0:e.title)||"",(null==C?void 0:null===(s=C.deliveryinformationm)||void 0===s?void 0:null===(d=s.errorCards)||void 0===d?void 0:null===(r=d.addressResponse)||void 0===r?void 0:r.message)||"",i,S,void 0,void 0,l)}};return(0,m.useEffect)(()=>{h.isSuccess&&(s(!1),(0,nH.u)(o,["deliveryDetailsIsBaseMobile"]),v(!0))},[h.isSuccess]),(0,m.useEffect)(()=>{L()},[f,c,g,h,b,y]),(()=>{if(T()){var e;return(null==t?void 0:null===(e=t.loaders)||void 0===e?void 0:e.yourAddressCard)?(0,p.jsxs)(rg,{children:[(0,p.jsx)(rE,{}),(0,p.jsx)(iz.J5,{src:(0,rs.o)(t.loaders.yourAddressCard).src,className:"player",loop:!0,autoplay:!0})]}):(0,p.jsx)(iG.Z,{quantity:2,heights:90})}return null})()},rT=n(12206),rA=n(33669);function rR(){let e=(0,D._)(["\n  .check-size {\n    height: 12px;\n    width: 17px;\n    align-self: center;\n    margin-right: 16px;\n    margin-top: -7px;\n  }\n\n  button {\n    padding: 0;\n  }\n\n  display: flex;\n  margin-bottom: 20px;\n"]);return rR=function(){return e},e}function rL(){let e=(0,D._)(["\n    margin: 57px 37px 33px;\n  "]);return rL=function(){return e},e}function rN(){let e=(0,D._)(["\n    margin: 60px 55px 52px;\n  "]);return rN=function(){return e},e}function rO(){let e=(0,D._)(["\n      font-size: ",";\n      line-height: ",";\n    "]);return rO=function(){return e},e}function rx(){let e=(0,D._)(["\n  color: ",";\n  font-style: normal;\n  margin: 32px 20px 41px;\n\n  ","\n\n  ","\n\n  button {\n    background: transparent;\n    border: none;\n    text-align: start;\n    font-family: ",";\n    font-weight: ",";\n    font-size: ",";\n    line-height: ",";\n    text-decoration: underline;\n    text-underline-position: from-font;\n    cursor: pointer;\n\n    ","\n\n    &,\n    &:active,\n    &:visited {\n      color: ",";\n    }\n\n    &:hover {\n      color: ",";\n    }\n  }\n"]);return rx=function(){return e},e}function rP(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return rP=function(){return e},e}function rM(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return rM=function(){return e},e}function rk(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n  margin-top: ",";\n  margin-bottom: ",";\n  ","\n\n  ","\n\n  ","\n"]);return rk=function(){return e},e}function rD(){let e=(0,D._)(["\n    ","\n    margin-bottom: ",";\n  "]);return rD=function(){return e},e}function rB(){let e=(0,D._)(["\n    margin-bottom: ",";\n  "]);return rB=function(){return e},e}function rw(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  text-align: center;\n  margin-bottom: ",";\n\n  ","\n\n  ","\n"]);return rw=function(){return e},e}function rj(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: row;\n  margin-left: -3px;\n"]);return rj=function(){return e},e}function rU(){let e=(0,D._)(["\n    margin-top: 2px;\n  "]);return rU=function(){return e},e}function rF(){let e=(0,D._)(["\n    margin-top: 0;\n  "]);return rF=function(){return e},e}function rG(){let e=(0,D._)(["\n  display: flex;\n  width: 22px;\n  margin-right: 10px;\n\n  ","\n\n  ","\n"]);return rG=function(){return e},e}function rz(){let e=(0,D._)(["\n  input {\n    position: absolute;\n    margin: 0 auto;\n    opacity: 0;\n    cursor: pointer;\n    height: 20px;\n    width: 20px;\n    z-index: 3;\n  }\n\n  .checkmark::after {\n    left: 7px;\n    top: 3px;\n    width: 5px;\n    height: 10px;\n    border: solid white;\n    border-width: 0 2px 2px 0;\n    transform: rotate(45deg);\n    content: '';\n    position: absolute;\n    display: none;\n  }\n\n  .checkmark {\n    position: absolute;\n    height: 20px;\n    width: 20px;\n    border-radius: 3px;\n    border: "," solid ",";\n  }\n\n  &:hover input ~ .checkmark {\n    border: "," solid ",";\n  }\n\n  input:checked ~ .checkmark {\n    background-color: ",";\n    border: none;\n  }\n\n  input:checked ~ .checkmark::after {\n    display: block;\n  }\n"]);return rz=function(){return e},e}function rV(){let e=(0,D._)(["\n    width: 334px;\n    font-size: ",";\n    line-height: ",";\n  "]);return rV=function(){return e},e}function rY(){let e=(0,D._)(["\n    width: 374px;\n  "]);return rY=function(){return e},e}function rH(){let e=(0,D._)(["\n  text-align: start;\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  width: 256px;\n\n  ","\n\n  ","\n"]);return rH=function(){return e},e}function rZ(){let e=(0,D._)(["\n    margin: 40px 0;\n  "]);return rZ=function(){return e},e}function rQ(){let e=(0,D._)(["\n  height: 1px;\n  background: ",";\n  margin: "," 0;\n\n  ","\n"]);return rQ=function(){return e},e}function rW(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n    margin-bottom: ",";\n  "]);return rW=function(){return e},e}function rK(){let e=(0,D._)(["\n  text-align: start;\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  margin-bottom: ",";\n  position: relative;\n\n  ","\n"]);return rK=function(){return e},e}function rJ(){let e=(0,D._)(["\n  position: absolute;\n  right: 0;\n  top: 16px;
1\n\n  div {\n    svg {\n      width: 20px;\n    }\n  }\n"]);return rJ=function(){return e},e}function rq(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n    margin: "," 0;\n  "]);return rq=function(){return e},e}function rX(){let e=(0,D._)(["\n  text-align: start;\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  align-self: stretch;\n  margin-top: 20px;\n  margin-bottom: ",";\n\n  ","\n  }\n"]);return rX=function(){return e},e}function r$(){let e=(0,D._)(["\n  display: flex;\n  padding: 0;\n"]);return r$=function(){return e},e}function r0(){let e=(0,D._)(["\n      margin-bottom: 12px;\n    "]);return r0=function(){return e},e}function r1(){let e=(0,D._)(["\n      padding: 4px 0;\n      ","\n    "]);return r1=function(){return e},e}function r2(){let e=(0,D._)(["\n  div {\n    border: none;\n    padding: 0;\n  }\n\n  .checkbox-container {\n    margin-bottom: 0;\n\n    & input {\n      margin: 0;\n    }\n\n    ","\n  }\n\n  .title {\n    padding: 10px 0;\n    font-size: ",";\n    line-height: ",";\n\n    ","\n  }\n"]);return r2=function(){return e},e}function r5(){let e=(0,D._)(["\n    width: 100%;\n    margin-left: 0;\n    margin-right: 0;\n  "]);return r5=function(){return e},e}function r3(){let e=(0,D._)(["\n  width: inherit;\n  background: linear-gradient(0.25turn, transparent, ",", transparent),\n    linear-gradient(#eee, #eee), linear-gradient(#eee, #eee);\n  background-repeat: no-repeat;\n  animation: loading 1.5s infinite;\n\n  :first-child {\n    margin-top: 60px;\n    margin-bottom: ",";\n    height: 45px;\n  }\n\n  height: 58px;\n  margin-bottom: ",";\n\n  ","\n\n  @keyframes loading {\n    to {\n      background-position: 315px 0, 0 0, 0 190px, 50px 195px;\n    }\n  }\n"]);return r3=function(){return e},e}let r6=B.Z.div(rR()),r4=B.Z.div(rx(),lk.rS.colors.text.primary,lk.BC.tablet(rL()),lk.BC.desktop(rN()),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.bold,lk.rS.typography.fontSize.body2,lk.rS.typography.lineHeight.body2,lk.BC.tablet(rO(),lk.rS.typography.fontSize.body1,lk.rS.typography.lineHeight.body1),lk.rS.colors.text.primary,lk.rS.colors.text.brand),r7=B.Z.div(rk(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.extrabold,lk.rS.spacing.xl,lk.rS.spacing.md,(0,lk.Ln)(30,38),lk.BC.tablet(rP(),lk.rS.typography.fontSize.h1,lk.rS.typography.lineHeight.h1),lk.BC.desktop(rM(),lk.rS.typography.fontSize.h2,lk.rS.typography.lineHeight.h2)),r9=B.Z.div(rw(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.regular,lk.rS.typography.fontSize.h6,lk.rS.typography.lineHeight.h6,lk.rS.spacing.xl,lk.BC.tablet(rD(),(0,lk.Ln)(20,30),(0,lk.Q1)(27.17)),lk.BC.desktop(rB(),(0,lk.Q1)(40))),r8=B.Z.div(rj()),de=B.Z.div(rG(),lk.BC.tablet(rU()),lk.BC.desktop(rF())),di=B.Z.div(rz(),lk.rS.borderWidth.thin,lk.rS.colors.border.default,lk.rS.borderWidth.thin,lk.rS.colors.border.default,lk.DH.cyanDark),dn=B.Z.div(rH(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.bold,lk.rS.typography.fontSize.body2,lk.rS.typography.lineHeight.body2,lk.BC.tablet(rV(),lk.rS.typography.fontSize.body1,lk.rS.typography.lineHeight.body1),lk.BC.desktop(rY()));B.Z.div(rQ(),lk.rS.colors.bg.disabled,lk.rS.spacing.xl,lk.BC.desktop(rZ())),B.Z.div(rK(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.extrabold,lk.rS.typography.fontSize.h6,lk.rS.typography.lineHeight.h6,lk.rS.spacing.md,lk.BC.tablet(rW(),lk.rS.typography.fontSize.h5,lk.rS.typography.lineHeight.h5,lk.rS.spacing.lg)),B.Z.div(rJ()),B.Z.div(rX(),lk.rS.typography.fontFamily.primary,lk.rS.typography.fontWeight.regular,lk.rS.typography.fontSize.body2,lk.rS.typography.lineHeight.body2,lk.rS.spacing.md,lk.BC.tablet(rq(),lk.rS.typography.fontSize.body1,lk.rS.typography.lineHeight.body1,lk.rS.spacing.lg)),B.Z.button(r$()),B.Z.div(r2(),lk.BC.desktop(r0()),lk.rS.typography.fontSize.body2,lk.rS.typography.lineHeight.body2,lk.BC.tablet(r1(),(0,lk.Ln)(20,30))),B.Z.div(r3(),lk.rS.colors.bg.primary,lk.rS.spacing.md,lk.rS.spacing.md,lk.BC.tablet(r5()));let dl=e=>{let{value:i,setNextAble:n}=e,{isDesktop:o,isTablet:l}=(0,oR.h)(),[t,r]=(0,m.useState)((null==i?void 0:i.consensus)||!1),[d,a]=(0,m.useState)({isOpen:!1,text:"",content:"",pdfUrl:"",pdfLabel:""});return(0,m.useEffect)(()=>{null==n||n(t)},[t]),{modalConfig:d,docCheck:t,handleCheckBox:()=>{r(!t)},handleCloseModal:()=>{a({isOpen:!1,text:"",content:"",pdfUrl:"",pdfLabel:""})},setModalHeight:()=>l&&331||o&&370||void 0,handleClick:e=>{a({isOpen:!0,text:e.text,content:e.content,pdfUrl:e.pdfUrl||"",pdfLabel:e.pdfLabel||""}),(0,ef.dw)(e.text)}}};var dt=e=>{var i;let{setNextAble:n,isLoading:o,value:l,pdfContractSummary:t,editorialLabels:r}=e,{docCheck:d,modalConfig:a,handleCheckBox:u,handleClick:s,handleCloseModal:v,setModalHeight:c}=dl({value:l,setNextAble:n});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(r4,{children:[(0,p.jsx)(r7,{children:r.title}),(0,p.jsx)(r9,{children:r.description}),m.Children.toArray(null===(i=r.documents)||void 0===i?void 0:i.map(e=>{var i,n;let l=e;return(null==e?void 0:null===(n=e.text)||void 0===n?void 0:null===(i=n.trim())||void 0===i?void 0:i.toLowerCase().includes("Sintesi".trim().toLowerCase()))&&
1(l={...e,pdfUrl:(null==t?void 0:t.pdfUrl)||e.pdfUrl,pdfLabel:(null==t?void 0:t.pdfLabel)||e.pdfLabel||""}),(0,p.jsxs)(r6,{children:[(0,p.jsx)("div",{className:"check-size",children:(0,p.jsx)(rT.Z,{})}),(0,p.jsx)("button",{type:"button",disabled:o,onClick:()=>s(l),children:e.text})]})})),(0,p.jsxs)(r8,{children:[(0,p.jsx)(de,{children:(0,p.jsxs)(di,{children:[(0,p.jsx)("input",{type:"checkbox","data-testid":"docs-checkbox",disabled:o,checked:d,onClick:u,onChange:()=>{}}),(0,p.jsx)("span",{className:"checkmark"})]})}),(0,p.jsx)(dn,{children:r.documentsCheck})]})]}),(0,p.jsx)(ek.Z,{height:c(),isOpen:a.isOpen,handleClose:v,children:(0,p.jsx)(rA.Z,{title:a.text,description:a.content,secondButtonLabel:a.pdfLabel,secondButtonAction:()=>{(0,eS.oc)(a.pdfUrl),(0,ef.dw)(a.pdfLabel)},options:{size:18,lineHeight:24,sizeMobile:20,lineHeightMobile:26,isModal:!0,textAlign:"left",fontFamily:lx.R.regular}})})]})};let dr=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("contract terms","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step7"],event_label:"terms and conditions",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"terms and conditions"),(0,S.q)(n),null});var dd=n(26099),da=n(44180);let du=e=>{var i,n,o,l;let t=(null==e?void 0:null===(i=e.termsandconditionsmo)||void 0===i?void 0:i.card)||void 0;return{title:(null==t?void 0:t.title)||"",description:(null==t?void 0:t.description)||"",documents:null===(n=e.termsandconditionsmo.modals)||void 0===n?void 0:n.map(e=>({text:(null==e?void 0:e.title)||"",content:(null==e?void 0:e.description)||"",pdfUrl:(null==e?void 0:e.url)||"",pdfLabel:(null==e?void 0:e.buttonLabel)||""})),documentsCheck:t.conditions,titleModal:(null==t?void 0:null===(o=t.modalError)||void 0===o?void 0:o.title)||"",messageModal:(null==t?void 0:null===(l=t.modalError)||void 0===l?void 0:l.message)||""}},ds=e=>{let{handleOnChangeEnableGoNext:i,handleGoPrevSlide:n}=e,o=(0,I.useQueryClient)(),{currentStepKey:l,checkoutErrors:t,termsAndConditions:r,isNewShippingAddress:d,deliveryAdvance:a,isModalButtonSticky:u,product:s,setIsDisabledBackButton:v,setTermsAndConditions:c,setCurrentStepKey:p,setCheckoutStepState:f}=(0,E.Mg)(),{buttonGenericError:g,urlGenericErrorCallMeNow:b}=(0,dd.S6)(s),y=(0,dd.CA)(dd.Jn,da.bl.CMS_GET_TERMS_AND_CONDITIONS_MOBILE),C=(0,dd.CA)(dd.Jn,da.bl.CMS_GET_GENERIC_ERROR_MOBILE),_=du(y),{titleModal:S,messageModal:T}=_;return(0,m.useEffect)(()=>{if(i){if(r.isSuccessTermsAndConditions&&r.consensus)i(r.isSuccessTermsAndConditions);else if(i(!1),!(null==r?void 0:r.isLoadingTermsAndConditions)&&!(null==r?void 0:r.isSuccessTermsAndConditions)&&(null==r?void 0:r.isErrorTermsAndConditions)){var e;let i=(0,dd.nQ)("termsAndConditions",{url:"getTermsAndConditions",status:"500",statusText:"500"});null==t||null===(e=t.showAndTrackError)||void 0===e||e.call(t,C,n,i,S,T,n,"Chiudi",()=>(0,da.xb)(o,b,s,n,l,i),(null==s?void 0:s.removeCTC)?void 0:g,u,!0)}}},[r]),(0,m.useEffect)(()=>{v(null==a?void 0:a.isLoading)},[a]),(0,m.useEffect)(()=>{p(h.Bf.TERMS_AND_CONDITIONS),f(h.v9.TERMS_AND_CONDITIONS_CARD,{}),localStorage.removeItem(dd._9)},[]),{editorialLabels:_,product:s,deliveryAdvance:a,termsAndConditions:r,isNewShippingAddress:d,handleSetNext:e=>{c({...r,consensus:e,optionToReconsider:"no"}),(0,da.dw)(e?"checkbox on":"checkbox off")}}};var dv=n(55059),dc=n(74651);let dp=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I;return{title:(null==e?void 0:null===(n=e.consentsmobile)||void 0===n?void 0:null===(i=n.card)||void 0===i?void 0:i.title)||"",description:(null==e?void 0:null===(l=e.consentsmobile)||void 0===l?void 0:null===(o=l.card)||void 0===o?void 0:o.description)||"",terms:{title:(null==e?void 0:null===(d=e.consentsmobile)||void 0===d?void 0:null===(r=d.card)||void 0===r?void 0:null===(t=r.terms)||void 0===t?void 0:t.title)||"",customLinkLabel:(null==e?void 0:null===(s=e.consentsmobile)||void 0===s?void 0:null===(u=s.card)||void 0===u?void 0:null===(a=u.terms)||void 0===a?void 0:a.customLinkLabel)||"",acceptAll:(null==e?void 0:null===(p=e.consentsmobile)||void 0===p?void 0:null===(c=p.c
1ard)||void 0===c?void 0:null===(v=c.terms)||void 0===v?void 0:v.acceptAll)||""},actionText:(null==e?void 0:null===(g=e.consentsmobile)||void 0===g?void 0:null===(f=g.card)||void 0===f?void 0:null===(m=f.terms)||void 0===m?void 0:m.customLinkLabel)||"",modal:{title:(null==e?void 0:null===(h=e.consentsmobile)||void 0===h?void 0:null===(E=h.modal)||void 0===E?void 0:E.title)||"",description:(null==e?void 0:null===(y=e.consentsmobile)||void 0===y?void 0:null===(b=y.modal)||void 0===b?void 0:b.description)||"",buttonLabel:(null==e?void 0:null===(_=e.consentsmobile)||void 0===_?void 0:null===(C=_.modal)||void 0===C?void 0:C.buttonLabel)||"",list:(null==e?void 0:null===(I=e.consentsmobile)||void 0===I?void 0:null===(S=I.modal)||void 0===S?void 0:S.list.length)>0&&[...e.consentsmobile.modal.list]||[]}}},dm=(e,i)=>e.filter(e=>null==i?void 0:i.some(i=>i.id===e.id)).map(e=>{var n,o,l;let t=null==i?void 0:i.find(i=>e.id===i.id);return{...e,name:(null==t?void 0:t.title)||e.name,description:(null==t?void 0:t.text)||e.description,longDescription:(null==t?void 0:t.description)||e.longDescription,popupText:(null==t?void 0:t.popupText)||"",detailLinkLabel:(null==t?void 0:t.detailLinkLabel)||"",choice:{option1:(null==t?void 0:null===(n=t.choice)||void 0===n?void 0:n.option1)||"",option2:(null==t?void 0:null===(o=t.choice)||void 0===o?void 0:o.option2)||"",option3:(null==t?void 0:null===(l=t.choice)||void 0===l?void 0:l.option3)||""}}}),df={margins:[60,30],tabletMargins:[32,15],groups:[{heights:45,marginBottom:15},{heights:60,marginBottom:32},{heights:60,marginBottom:15},{heights:75,repeat:4,gap:15},{heights:45,marginBottom:15}]},dg=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("consents","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step8"],event_label:"consents",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"consents"),(0,S.q)(n),null});var dE=n(52771),dh=n(21936);let db=()=>{var e;let{product:i,voucher:n,setVoucher:o}=(0,E.Mg)();(0,m.useEffect)(()=>{var e,l,t;(null===(e=i.vouchers)||void 0===e?void 0:e.enableDefaultVoucher)&&n.voucherId===(null==i?void 0:null===(l=i.vouchers)||void 0===l?void 0:l.defaultVoucher)&&(null===(t=n.validateVoucher)||void 0===t?void 0:t.isSuccess)&&o({...n,isApplyVoucher:!0})},[null===(e=n.validateVoucher)||void 0===e?void 0:e.isSuccess]),(0,m.useEffect)(()=>{var e,l,t;(null===(e=i.vouchers)||void 0===e?void 0:e.enableDefaultVoucher)&&(""===n.voucherId||n.voucherId!==(null==i?void 0:null===(l=i.vouchers)||void 0===l?void 0:l.defaultVoucher))&&o({...n,voucherId:null==i?void 0:null===(t=i.vouchers)||void 0===t?void 0:t.defaultVoucher})},[])},dy=e=>{let{handleOnChangeEnableGoNext:i}=e,[n,o]=(0,m.useState)(!0),{consents:l,setConsents:t,setCurrentStepKey:r,setCheckoutStepState:d}=(0,E.Mg)(),a=(0,I.useQueryClient)(),{partyPrivacyItems:u}=(0,dh.m)(),s=(0,dE.BP)();return db(),(0,m.useEffect)(()=>{0===l.partyPrivacyItems.length&&t({partyPrivacyItems:u})},[l,u]),(0,m.useEffect)(()=>{(0,nH.u)(a,["authorize","reserveEquipment"]),r(h.Bf.CONSENTS),d(h.v9.CONSENT_CARD,{}),i&&i(!0)},[]),(0,m.useEffect)(()=>{u.length>0&&o(!1)},[u]),{consents:l,isLoading:n,onUpdateConsents:e=>{t({partyPrivacyItems:e}),s.mutate(e)}}};var dC=n(26382),d_=n(69011),dS=n(10255),dI=n(79753),dT=n(62110),dA=n(23274),dR=n(94941),dL=n(59830);let dN=()=>{let e=(0,n9.f)("shoppingCart"),{portability:i,portabilityStatus:n,setPortabilityStatus:o}=(0,E.Mg)(),[l,t]=(0,m.useState)(!1),[r,d]=(0,m.useState)(!0),[a,u]=(0,m.useState)(!1),[s,v]=(0,m.useState)({errorMessage:"",error:void 0}),c=(0,I.useQueryClient)().getQueryData("modifyPhoneNumberProductQuery"),{mutate:p,isLoading:f,isSuccess:g,isError:h}=(0,dA.x)(),{isTpoOffer:b,isInCampaignTpo:y,isEligible:C,isLoadingCheck:_,token:S,isEnabledFwAmdIntegration:T}=(0,dL.I)(),A=(0,dS.WQ)(),{data:R,error:L,isLoading:N,isSuccess:O,isError:x,mutate:P}=(0,dI.j)(),M=(0,dC.v)(),{isLoading:k,isError:D,isSuccess:B,data:w,error:j,mutate:U}=(0,dT.TT)(),F=(0,d_.d)(),{isLoading:G,isSuccess:z,isError:V,mutate:Y}=(0,dR.n)();(0,m.useEffect)(()=>{!G&&(z||V)&&(u(!1),d(!1),t(!0))},[z,G,V]);let H=()=>{let i=(0,eS.kt)();!i&&b&&y?(u(!1),d(!1),t(!0)):i&&(null==w?void 0:w.fwStatus)==="KO"?(d(!1),t(!1),u(!0),v({errorCode:null==w?void 0:w.fwStatusCode})):i?(eh.KF.log("TPO::Eligible with TOKEN"),Y({t:i,idOrder:null==e?void 0:e.id})):(eh.KF.log("TPO::Eligible without TOKEN"),d(!1),t(!1),u(!0))},Z=()=>{C?(eh.KF.log("TPO::Eligible"),S?(eh.KF.log("TPO::Eligible with TOKEN"),Y({t:S,idOrder:null==e?void 0:e.id})):(eh.KF.log("TPO::Eligible without TOKEN"),d(!1),t(!1),u(!0))):(eh.KF.log("TPO:: NOT Eligible"),u(!1),d(!1),t(!0))};return(0,m.useEffect)(()=>
1{if(B){var e;(null==w?void 0:null===(e=w.status)||void 0===e?void 0:e.toLowerCase())==="softko"?(d(!1),t(!1),u(!0),v((0,eS.nQ)("submit",{status:"200",statusText:"SoftKO",url:n7.bl.SUBMIT}))):T?H():Z()}else D&&(d(!1),t(!1),u(!0),v((0,eS.nQ)("submit",j||{status:"500",statusText:"KO",url:n7.bl.SUBMIT})))},[B,k,D,j]),(0,m.useEffect)(()=>{(null==n?void 0:n.isSuccess)&&(null==n?void 0:n.isStartFinalPortIn)&&(null==M?void 0:M.isSuccess)&&!B&&!k&&!D?U():(null==n?void 0:n.isError)&&(d(!1),t(!1),u(!0),v(c))},[n,null==M?void 0:M.isSuccess,B,k]),(0,m.useEffect)(()=>{if(!M.isLoading){if(M.isSuccess){var e,l,r;(null===(e=Object.entries(M.data))||void 0===e?void 0:e.length)>0&&(null===(l=M.data.lcvStatus)||void 0===l?void 0:l.toUpperCase())==="ROSSO"&&(d(!1),t(!1),u(!0),v((0,eS.nQ)("submit",{status:"200",statusText:"KO due to lcvStatus RED",url:n7.bl.LIGHT_CREDIT_VETTING}))),eh.KF.debug("useCheckoutFlow lightCreditVettingMutation.data",M.data),(null==i?void 0:i.portabilityWant)&&(null==i?void 0:null===(r=i.portabilityOtp)||void 0===r?void 0:r.isVerified)&&(null==n?void 0:n.isSuccessCheck)?o({...n,isStartFinalPortIn:!0}):(null==i?void 0:i.portabilityWant)||U()}else M.isError&&(d(!1),t(!1),u(!0),(null==M?void 0:M.error)&&v((0,eS.nQ)("lightCreditVetting",M.error)))}},[M.isLoading,M.isSuccess,M.isError,i]),(0,m.useEffect)(()=>{!N&&(O?(null==R?void 0:R.status)==="KO"?(d(!1),t(!1),u(!0),v((0,eS.nQ)("reserveEquipment",{status:"200",statusText:"KO",url:n7.bl.RESERVE_EQUIPMENT},"KO"))):M.mutate():x&&(d(!1),t(!1),u(!0),v((0,eS.nQ)("reserveEquipment",L||{status:"500",statusText:"KO",url:n7.bl.RESERVE_EQUIPMENT}))))},[O,x,N]),(0,m.useEffect)(()=>{if(!A.isLoading){if(A.isSuccess){var e;(null===(e=A.data)||void 0===e?void 0:e.error)?(d(!1),t(!1),u(!0),v(A.data)):P()}else A.isError&&(d(!1),t(!1),u(!0),(null==A?void 0:A.error)&&v((0,eS.nQ)("paymentDistribution",A.error)))}},[A.isLoading,A.isSuccess,A.isError]),(0,m.useEffect)(()=>{!f&&(g?(F.mutate(),A.mutate()):h&&(d(!1),t(!1),u(!0)))},[f,g,h]),(0,m.useEffect)(()=>{_||p("No")},[_]),{isLoading:r,isSuccess:l,isError:a,error:s}};var dO=()=>{let[e,i]=(0,m.useState)(!0),{checkoutErrors:n,product:o,portabilityStatus:l,setSlidesGoBack:t,setIsLastCard:r,setIsDisabledBackButton:d,setHideStickyBar:a}=(0,E.Mg)(),{isLoading:u,isSuccess:s,isError:v,error:c}=dN(),p=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_INSTANT_ORDER_ERROR_MOBILE),f=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),g=(0,I.useQueryClient)(),{buttonGenericError:b}=(0,eS.S6)(o),y=(0,T.De)("checkout","mobile",g),C=localStorage.getItem("disableRed"),{goBackErrorOnPayment:_,blockingFormattedError:S,blockingErrors:A}=(0,eS.Uv)(p),{trackView:R}=(0,eh.rS)({event:["order_loading"],event_label:"verifying_payment_information",opts:null==y?void 0:y.opts,cartProduct:null==y?void 0:y.trackingProduct,pageProduct:null==y?void 0:y.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});(0,ef.kg)(R,"verifying_payment_information");let L=()=>{var e;let i=()=>{(0,eh.uY)(g,["paymentMethodPut","getShoppingCartUpdatePayment"]),r(!1),d(!1),a(!1),t(2)},o=null==_?void 0:_.filter(e=>{var i,n;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==c?void 0:null===(n=c.errorType)||void 0===n?void 0:n.toLowerCase())}),l=(null==c?void 0:c.errorCode)?null==o?void 0:o.find(e=>e.errorCode==c.errorCode):(null==o?void 0:o.find(e=>!e.errorCode))||(null==o?void 0:o[0]);R((0,T.yP)({...c,isBlocking:(null==l?void 0:l.isBlocking)==="true"},h.Bf.UPFRONT_PAYMENT,g)),null==n||null===(e=n.showAndTrackError)||void 0===e||e.call(n,f,i,c,null==l?void 0:l.title,null==l?void 0:l.message,i,"Riprova")};return(0,m.useEffect)(()=>{if(u||!s||v){if(!u&&v){var e,i;if(S.includes(null==c?void 0:null===(e=c.errorType)||void 0===e?void 0:e.toLowerCase())){let e=A.filter(e=>{var i,n;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==c?void 0:null===(n=c.errorType)||void 0===n?void 0:n.toLowerCase())}),o=(null==c?void 0:c.errorCode)?null==e?void 0:e.find(e=>e.errorCode==c.errorCode):(null==e?void 0:e.find(e=>!e.errorCode))||(null==e?void 0:e[0]);R((0,T.yP)({...c,isBlocking:(null==o?void 0:o.isBlocking)==="true"},h.Bf.UPFRONT_PAYMENT,g)),null==n||null===(i=n.showAndTrackError)||void 0===i||i.call(n,f,()=>{if(!C){var e,i;null===(i=window)||void 0===i||null===(e=i.location)||void 0===e||e.reload()}},c,null==o?void 0:o.title,null==o?void 0:o.message,()=>{if(!C){var e,i;null===(i=window)||void 0===i||null===(e=i.location)||void 0===e||e.reload()}},b)}else L()}}else C||window.open("".concat((0,ed.e)(),"/").concat(er.Z.THANK_YOU),"_self")},[u,v,s,e]),(0,m.useEffect)(()=>{(null==l?void 0:l.isSuccess)&&i(!1)},[l]),null},dx=n(52275);let dP=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("add payment method","mobile",e),{trackView:n}=(0,S.r)({event:(0,dx.A)()===dx.x.PROSPECT_USER?["checkout_step9.0"]:["checkout_step9.1"],event_label:"add payment method",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"add payment method"),(0,S.q)(n),null});var dM=n(34702),dk=n(71581);let dD=e=>{var i,n,o,l,t,r,d,a;return{title:(null==e?void 0:null===(i=e.paymentsmobile)||void 0===i?void 0:i.title)||"",description:(null==e?void 0:null===(n=e.paymentsmobile)||void 0===n?void 0:n.description)||"",modal:{textLink:(null==e?void 0:null===(l=e.paymentsmobile)||void 0===l?void 0:null===(o=l.modal)||void 0===o?void 0:o.linkLabel)||"",titleModal:(null==e?void 0:null===(r=e.paymentsmobile)||void 0===r?void 0:null===(t=r.modal)||void 0===t?void 0:t.t
1itle)||"",descriptionModal:(null==e?void 0:null===(a=e.paymentsmobile)||void 0===a?void 0:null===(d=a.modal)||void 0===d?void 0:d.description)||""}}},dB=(e,i,n,o,l)=>{let t=[],r=localStorage.getItem(eS._F),d=l?i:i.filter(e=>!e.methodCode.toLowerCase().includes("card"));if(!l){var a,u,s,v,c,p,m;t.push({title:(null==e?void 0:null===(s=e.paymentsmobile)||void 0===s?void 0:null===(u=s.choice)||void 0===u?void 0:null===(a=u.allCards)||void 0===a?void 0:a.title)||"",description:(null==e?void 0:null===(p=e.paymentsmobile)||void 0===p?void 0:null===(c=p.choice)||void 0===c?void 0:null===(v=c.allCards)||void 0===v?void 0:v.description)||"",value:dk.Q.PREPAID_CARD,extra:{text:null==e?void 0:null===(m=e.paymentsmobile)||void 0===m?void 0:m.defaultChoice,color:"#fff",extraClass:"extraClass"},selection:0===n})}d.forEach((i,r)=>{var d,a,u,s;let v=null==i?void 0:i.methodCode;"payPal"===v&&(v=v.toLowerCase());let c=null==e?void 0:null===(a=e.paymentsmobile)||void 0===a?void 0:null===(d=a.choice)||void 0===d?void 0:d[v];c&&(null==o?void 0:null===(u=o.map(e=>e.toLowerCase()))||void 0===u?void 0:u.includes(null==v?void 0:v.toLowerCase()))&&t.push({title:null==c?void 0:c.title,description:(null==c?void 0:c.description)||"",value:"paypal"===v?null===dk.Q||void 0===dk.Q?void 0:dk.Q.PAYPAL:v,extra:0===r&&l?{text:null==e?void 0:null===(s=e.paymentsmobile)||void 0===s?void 0:s.defaultChoice,color:"#fff",extraClass:"extraClass"}:void 0,selection:n===r})});let f=null==t?void 0:t.findIndex(e=>{var i,n;return(null==e?void 0:null===(i=e.value)||void 0===i?void 0:i.toLowerCase())===(null===dk.Q||void 0===dk.Q?void 0:null===(n=dk.Q.WALLET)||void 0===n?void 0:n.toLowerCase())});if(-1!==f){let e=t.splice(f,1)[0];t.push(e)}if(r){if("1"===r)return t.filter(e=>e.value===dk.Q.CREDIT_CARD);if("2"===r)return t.filter(e=>e.value!==dk.Q.WALLET)}return t},dw=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h;return{titleSelectionPaymentError:(null==e?void 0:null===(n=e.paymentsmobile)||void 0===n?void 0:null===(i=n.paymentSelectionError)||void 0===i?void 0:i.title)||"",messageSelectionPaymentError:(null==e?void 0:null===(l=e.paymentsmobile)||void 0===l?void 0:null===(o=l.paymentSelectionError)||void 0===o?void 0:o.description)||"",buttonLabelSelectionPayment:(null==e?void 0:null===(r=e.paymentsmobile)||void 0===r?void 0:null===(t=r.paymentSelectionError)||void 0===t?void 0:t.buttonLabel)||"",iconSelectionPayment:(null==e?void 0:null===(a=e.paymentsmobile)||void 0===a?void 0:null===(d=a.paymentSelectionError)||void 0===d?void 0:d.icon)||"",messageSelectedPaymentError:(null==e?void 0:null===(v=e.paymentsmobile)||void 0===v?void 0:null===(s=v.paymentError)||void 0===s?void 0:null===(u=s.notFound)||void 0===u?void 0:u.message)||"",titleSelectedPaymentError:(null==e?void 0:null===(m=e.paymentsmobile)||void 0===m?void 0:null===(p=m.paymentError)||void 0===p?void 0:null===(c=p.notFound)||void 0===c?void 0:c.title)||"",buttonLabelSelectedPayment:(null==e?void 0:null===(g=e.paymentsmobile)||void 0===g?void 0:null===(f=g.paymentError)||void 0===f?void 0:f.buttonLabel)||"",iconSelectedPayment:(null==e?void 0:null===(h=e.paymentsmobile)||void 0===h?void 0:null===(E=h.paymentError)||void 0===E?void 0:E.icon)||""}},dj={margins:[60,30],tabletMargins:[32,15],groups:[{heights:60,marginBottom:15},{heights:90,marginBottom:32},{heights:60,repeat:4,gap:15}]};var dU=n(74080),dF=n(13409);let dG=(e,i)=>oe.W.put("".concat(f.b.ORDER,"/").concat(e,"/").concat(f.b.PAYMENT_METHOD),i,{searchParams:{salesChannel:"selfService"}}),dz=()=>{let e=(0,I.useQueryClient)(),i="paymentMethod";return(0,I.useMutation)(["paymentMethodPut"],e=>{let i=(0,f.f)("shoppingCart");return oe.K.log("payment method put shoppingCart : ",i),dG(null==i?void 0:i.id,{orderPayment:{orderItemPayments:[{orderItemOnBillPayment:{selectedPaymentMethod:e.selectedPaymentMethod,billingOfferIdForChangePaymentMethod:e.billingOfferIdForChangePaymentMethod},orderActionId:e.orderActionId}]},skipValidation:!1,performSave:!0})},{onSuccess:n=>{localStorage.setItem(i,JSON.stringify(n)),e.setQueryData(i,n)},onError:n=>{oe.K.error("ERROR payment method put - ".concat(i,": "),n),e.setQueryData(i,(0,oi.n)("".concat(i),n)),localStorage.setItem("".concat(i),JSON.stringify((0,oi.n)("".concat(i),n)))}})};var dV=n(41989);let dY=function(e,i){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0,t=arguments.length>5?arguments[5]:void 0,r=arguments.length>6?arguments[6]:void 0,d=(0,I.useQueryClient)(),[a,u]=(0,m.useState)(!1),[s,v]=(0,m.useState)(!1),[c,p]=(0,m.useState)(!1),[f,g]=(0,m.useState)(null),E=(0,n9.f)("shoppingCart");null==E||E.id;let{isSuccess:h,isLoading:b,isError:y,mutate:C,reset:_}=dz(),{mutate:S,isSuccess:T,isError:A,isLoading:R}=(0,dF.Sz)();return(0,m.useEffect)(()=>{!n||!i||b||h||y||R||!o||(C({billingOfferIdForChangePaymentMethod:e,orderActionId:i,selectedPaymentMethod:o}),v(!0))},[n,o,e,i,b,h]),(0,m.useEffect)(()=>
1{if(b||!h||(0,eS.rp)()||!o||(null==o?void 0:o.methodCode)===dk.Q.WALLET||A||S({payMeanType:o.methodCode,...l&&{siaFlowType:l},...t&&{authorizationOperation:t}}),!b&&y){let e=d.getQueryData("paymentMethod");dV.K.debug("paymentMethodPut error!!"),v(!1),p(!0),g(e||null)}if(A){let e=d.getQueryData("authorize");dV.K.debug("authorize error!!"),v(!1),p(!0),g(e||null)}},[b,h,y,A]),(0,m.useEffect)(()=>{A&&!R?(p(!0),v(!1),u(!1)):!R&&T&&(p(!1),v(!1),u(!0))},[T,R,A]),(0,m.useEffect)(()=>{r&&(s?r(!0):r(!1))},[s]),{isSuccess:a,isLoading:s,isError:c,error:f,handleResetState:()=>{v(!1),u(!1),p(!1),g(null),(0,dV.u)(d,["getShoppingCartUpdatePayment"]),_()}}},dH=e=>{var i,n,o,l,t,r,d,a,u,s,v,c;let{handleGoPrevSlide:p}=e||{},f=(0,I.useQueryClient)(),{currentStepKey:g,checkoutErrors:b,availablePaymentMethods:y,customerFlow:C,isModalButtonSticky:_,product:S,setProduct:T,setCurrentStepKey:A,setAvailablePaymentMethods:R,setIsLastCard:L,setHideStickyBar:N,setUpfrontPayment:O,setIsDisabledBackButton:x,setIsPreselectedCard:P}=(0,E.Mg)(),M=(0,eC.CA)(eC.Jn,i7.b.CMS_GET_GENERIC_ERROR_MOBILE),{paymentsmobile:{warningPriceChange:k,warningWaiting:D}}=(0,eC.CA)(eC.Jn,i7.b.CMS_GET_PAYMENTS_MOBILE),B=(0,m.useMemo)(()=>{var e;return{title:(null==D?void 0:D.title)||(null==k?void 0:k.title)||"",subtitle:(null==D?void 0:D.subtitle)||(null==k?void 0:k.subtitle)||"",description:(null==D?void 0:D.description)||(null==k?void 0:k.description)||"",lottie:(null==S?void 0:null===(e=S.loaders)||void 0===e?void 0:e.choosePayment)||""}},[D,k,null==S?void 0:null===(i=S.loaders)||void 0===i?void 0:i.choosePayment]),{buttonPaymentError:w,urlPaymentErrorCallMeNow:j}=(0,eS.S6)(S),{messageSelectionPaymentError:U,titleSelectionPaymentError:F,buttonLabelSelectionPayment:G,iconSelectionPayment:z,titleSelectedPaymentError:V,messageSelectedPaymentError:Y,buttonLabelSelectedPayment:H,iconSelectedPayment:Z}=dw((0,eC.CA)(eC.Jn,i7.b.CMS_GET_PAYMENTS_MOBILE)),[Q,W]=(0,m.useState)(!1),K=null==C?void 0:null===(n=C.payment)||void 0===n?void 0:n.data,J=null==C?void 0:null===(o=C.payment)||void 0===o?void 0:o.isLoading,q=null==C?void 0:null===(l=C.payment)||void 0===l?void 0:l.isError,{isLoading:X,isSuccess:$,isError:ee,error:ei}=dY((null==K?void 0:null===(a=K.orderPayment)||void 0===a?void 0:null===(d=a.orderItemPayments)||void 0===d?void 0:null===(r=d[0])||void 0===r?void 0:null===(t=r.orderItemOnBillPayment)||void 0===t?void 0:t.billingOfferIdForChangePaymentMethod)||[""],(null==K?void 0:null===(v=K.orderPayment)||void 0===v?void 0:null===(s=v.orderItemPayments)||void 0===s?void 0:null===(u=s[0])||void 0===u?void 0:u.orderActionId)||"",Q,null==y?void 0:y.find(e=>e.methodCode===dM.QW.WALLET),dM.K$.RECURRENT);return(0,m.useEffect)(()=>{var e,i,n,o,l,t,r;if(J||q||!K||R((null==K?void 0:null===(i=K.orderPayment.orderOnBillPayment)||void 0===i?void 0:null===(e=i.availablePaymentMethods)||void 0===e?void 0:e.map((e,i)=>{var n;return{...e,selection:null===(n=y[i])||void 0===n?void 0:n.selection}}))||[]),!J&&q){let e=()=>{p&&p()};R((null==K?void 0:null===(r=K.orderPayment.orderOnBillPayment)||void 0===r?void 0:null===(t=r.availablePaymentMethods)||void 0===t?void 0:t.map(e=>({...e,selection:!1})))||[]),N(!1),null==b||null===(l=b.showAndTrackError)||void 0===l||l.call(b,M,e,(null==C?void 0:null===(n=C.paymean)||void 0===n?void 0:n.error)||void 0,V,Y,e,H||w,()=>{var i;return(0,i7.x)(f,j,S,e,g,null==C?void 0:null===(i=C.paymean)||void 0===i?void 0:i.error)},(null==S?void 0:S.removeCTC)?void 0:(null==S?void 0:null===(o=S.genericErrorCallMeNow)||void 0===o?void 0:o.label)||"",_,!0,!1,!1,Z||"")}},[K,q,J,y,R,p,N,b,M,null==C?void 0:null===(c=C.paymean)||void 0===c?void 0:c.error,V,Y,H,w,f,j,S,g,_,Z]),(0,m.useEffect)(()=>{if(X&&localStorage.getItem(nQ.Bm)&&localStorage.removeItem(nQ.Bm),!$||X||ee||T({...S,...(0,dU.vn)(S,dM.ZS.RESET)}),ee&&!X){var e,i,n,o;let l=()=>{p&&p()};R((null==K?void 0:null===(o=K.orderPayment.orderOnBillPayment)||void 0===o?void 0:null===(n=o.availablePaymentMethods)||void 0===n?void 0:n.map(e=>({...e,selection:!1})))||[]),N(!1),null==b||null===(i=b.showAndTrackError)||void 0===i||i.call(b,M,l,ei||void 0,F,U,l,G||w,()=>(0,i7.x)(f,j,S,l,g,ei||void 0),(null==S?void 0:S.removeCTC)?void 0:(null==S?void 0:null===(e=S.genericErrorCallMeNow)||void 0===e?void 0:e.label)||"",_,!0,!1,!1,z||"")}},[$,X,ee,K,R,T,S,p,N,b,M,ei,F,U,G,w,f,j,g,_,z]),(0,m.useEffect)(()=>{Q&&W(!1)},[Q]),(0,m.useEffect)(()=>{window.history.pushState(null,"",window.location.pathname),A(h.Bf.RECURRENT_PAYMENT_CARD),P(!1),O(void 0),localStorage.setItem(eS.aY,dM.QW.WALLET),localStorage.removeItem(eS.f),L(!0),W(!0),x(!0),N(!0)},[A,P,O,L,x,N]),{cmsWarningWaitingOffer:B,enablePut:Q,isSuccessUpdatePaymentMethod:$,isLoadingUpdatePaymentMethod:X,isErrorUpdatePaymentMethod:ee}};var dZ=e=>{let{cmsWarningWaitingOffer:i,enablePut:n,isSuccessUpdatePaymentMethod:o,isLoadingUpdatePaymentMethod:l,isErrorUpdatePaymentMethod:t}=dH(e);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(dP,{}),(0,p.jsx)(i5.Z,{...i}),!n&&o&&!l&&!t&&(0,p.jsx)(dO,{})]})};let dQ=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("add payment method","mobile",e),{trackView:n}=(0,S.r)({event:(0,dx.A)()===dx.x.PROSPECT_USER?["checkout_step9.0"]:["checkout_step9.1"],event_label:"add payment method",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"add payment method"),(0,S.q)(n),null}),dW=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,f,g,b,y;let{handleOnChangeEnableGoNext:C,handleGoPrevSlide:_}=e,{currentStepKey:S,checkoutErrors:T,availablePaymentMethods:A,hideStickyBar:R,customerFlow:L,isModalButtonSticky:N,product:O,setProduct:x,setCurrentStepKey:P,setAvailablePaymentMethods:M,setIsLastCard:k,setUpdateProductPriceCtrl:D,setHideStickyBar:B,setUpfrontPayment:w,setIsDisabledBackButton:j,setIsPreselectedCard:U,setIsLoadingGoNext:F}
1=(0,E.Mg)(),G=(0,I.useQueryClient)(),z=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),{paymentsmobile:{warningPriceChange:V,warningWaiting:Y}}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PAYMENTS_MOBILE),H={title:(null==V?void 0:V.title)||"",subtitle:(null==V?void 0:V.subtitle)||"",description:(null==V?void 0:V.description)||""},Z={title:(null==Y?void 0:Y.title)||(null==V?void 0:V.title)||"",subtitle:(null==Y?void 0:Y.subtitle)||(null==V?void 0:V.subtitle)||"",description:(null==Y?void 0:Y.description)||(null==V?void 0:V.description)||"",lottie:(null==O?void 0:null===(i=O.loaders)||void 0===i?void 0:i.choosePayment)||""},{buttonPaymentError:Q,urlPaymentErrorCallMeNow:W}=(0,eS.S6)(O),K=(null==O?void 0:O.isFamilyPlusProduct)?n7.bl.CMS_GET_FAMILY_PLUS_PAYMENT:n7.bl.CMS_GET_PAYMENTS_MOBILE,J=(0,eC.CA)(eC.Jn,K),{messageSelectionPaymentError:q,titleSelectionPaymentError:X,buttonLabelSelectionPayment:$,iconSelectionPayment:ee,titleSelectedPaymentError:ei,messageSelectedPaymentError:en,buttonLabelSelectedPayment:eo,iconSelectedPayment:el}=dw(J),{title:et,description:er,modal:ed}=dD(J),[ea,eu]=(0,m.useState)([]),[es,ev]=(0,m.useState)(!1),[ec,ep]=(0,m.useState)(!1),em=(0,n9.f)("billingAccount"),eg=null==L?void 0:null===(n=L.payment)||void 0===n?void 0:n.data,eE=null==L?void 0:null===(o=L.payment)||void 0===o?void 0:o.isLoading,ey=null==L?void 0:null===(l=L.payment)||void 0===l?void 0:l.isError,e_=null==L?void 0:null===(t=L.payment)||void 0===t?void 0:t.isSuccess,eI=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GLOBAL_CONFIG),eT=(0,n9.f)("customerData"),eA=(0,n9.f)("findCaller"),eR=(null==eT?void 0:null===(d=eT[0])||void 0===d?void 0:null===(r=d.owningIndividual)||void 0===r?void 0:r.fiscalCode)||(null==eA?void 0:null===(a=eA.individualRef)||void 0===a?void 0:a.fiscalCode),eL=(null==eI?void 0:null===(s=eI.globalconfig)||void 0===s?void 0:null===(u=s.newMop)||void 0===u?void 0:u.enableNewMopMobile)==="true",eN=null==eR?void 0:eR.includes("XBS"),eO=(0,eS.AQ)()===eS.xx.NEXT_USER_ACTIVE&&(null==em?void 0:em.hasPendingDeviceWithInstallments)||!(eN||eL),{isLoading:ex,isSuccess:eP,isError:eM,error:ek,handleResetState:eD}=dY((null==eg?void 0:null===(f=eg.orderPayment)||void 0===f?void 0:null===(p=f.orderItemPayments)||void 0===p?void 0:null===(c=p[0])||void 0===c?void 0:null===(v=c.orderItemOnBillPayment)||void 0===v?void 0:v.billingOfferIdForChangePaymentMethod)||[""],(null==eg?void 0:null===(y=eg.orderPayment)||void 0===y?void 0:null===(b=y.orderItemPayments)||void 0===b?void 0:null===(g=b[0])||void 0===g?void 0:g.orderActionId)||"",es,null==A?void 0:A.find(e=>e.configured),dM.K$.RECURRENT,void 0,F);(0,m.useEffect)(()=>(window.history.pushState(null,"",window.location.pathname),P(h.Bf.RECURRENT_PAYMENT_CARD),U(!1),w(void 0),localStorage.removeItem(eS.f),k(!0),()=>{k(!1)}),[]);let eB=(0,m.useCallback)(e=>{eh.KF.debug("HANDLE SELECT IN AUTHORIZE",e),e&&(M(A.map(i=>({...i,configured:i.methodCode===e.value,selection:i.methodCode===e.value}))),localStorage.setItem(eS.aY,e.value||""),e.value!==dM.QW.WALLET?(ev(!0),k(!0),D({isUpdatePrice:!1,isPriceUpdated:!0}),null==C||C(!1)):(D({isUpdatePrice:!0,isPriceUpdated:!1}),k(!1),ev(!1),null==C||C(!0)))},[A]);return(0,m.useEffect)(()=>{var e,i,n,o,l,t,r,d,a;if(eE||ey||!eg||(M((null==eg?void 0:null===(i=eg.orderPayment.orderOnBillPayment)||void 0===i?void 0:null===(e=i.availablePaymentMethods)||void 0===e?void 0:e.map((e,i)=>{var n;return{...e,selection:null===(n=A[i])||void 0===n?void 0:n.selection}}))||[]),eu(dB(J,(null==eg?void 0:null===(n=eg.orderPayment.orderOnBillPayment)||void 0===n?void 0:n.availablePaymentMethods)||[],-1,(null==em?void 0:em.availableNewPayMeans)||[],eO))),!eE&&ey){let e=()=>{_&&_()};M((null==eg?void 0:null===(d=eg.orderPayment.orderOnBillPayment)||void 0===d?void 0:null===(r=d.availablePaymentMethods)||void 0===r?void 0:r.map(e=>({...e,selection:!1})))||[]),eu(dB(J,(null==eg?void 0:null===(a=eg.orderPayment.orderOnBillPayment)||void 0===a?void 0:a.availablePaymentMethods)||[],-1,(null==em?void 0:em.availableNewPayMeans)||[],eO)),B(!1),null==T||null===(t=T.showAndTrackError)||void 0===t||t.call(T,z,e,(null==L?void 0:null===(o=L.paymean)||void 0===o?void 0:o.error)||void 0,ei,en,e,eo||Q,()=>{var i;return(0,eb.x)(G,W,O,e,S,null==L?void 0:null===(i=L.paymean)||void 0===i?void 0:i.error)},(null==O?void 0:O.removeCTC)?void 0:(null==O?void 0:null===(l=O.genericErrorCallMeNow)||void 0===l?void 0:l.label)||"",N,!0,!1,
1!1,el||"")}},[eg,ey,eE]),(0,m.useEffect)(()=>{if(ex&&localStorage.getItem(nQ.Bm)&&localStorage.removeItem(nQ.Bm),!eP||ex||eM||(ec&&(x({...O,...(0,dU.vn)(O,dM.ZS.RESET)}),B(!1),ep(!1),localStorage.removeItem(eS.B_)),null==C||C(!0),ev(!1),eD()),eM&&!ex){var e,i,n,o,l;ev(!1);let t=()=>{_&&_()};M((null==eg?void 0:null===(o=eg.orderPayment.orderOnBillPayment)||void 0===o?void 0:null===(n=o.availablePaymentMethods)||void 0===n?void 0:n.map(e=>({...e,selection:!1})))||[]),eu(dB(J,(null==eg?void 0:null===(l=eg.orderPayment.orderOnBillPayment)||void 0===l?void 0:l.availablePaymentMethods)||[],-1,(null==em?void 0:em.availableNewPayMeans)||[],eO)),B(!1),null==T||null===(i=T.showAndTrackError)||void 0===i||i.call(T,z,t,ek||void 0,X,q,t,$||Q,()=>(0,eb.x)(G,W,O,t,S,ek||void 0),(null==O?void 0:O.removeCTC)?void 0:(null==O?void 0:null===(e=O.genericErrorCallMeNow)||void 0===e?void 0:e.label)||"",N,!0,!1,!1,ee||"")}},[eP,ex,eM]),(0,m.useEffect)(()=>{let e=document.getElementById("sticky-offer-next"),i=()=>{let e=null==A?void 0:A.find(e=>e.configured),i="";switch(null==e?void 0:e.methodCode){case dM.QW.BANK_ACCOUNT:i="iban";break;case dM.QW.CREDIT_CARD:i="carta di credito";break;case dM.QW.DEBIT_CARD:i="carta di debito";break;case dM.QW.PREPAID_CARD:i="carta prepagata";break;case dM.QW.PAYPAL:i="paypal";break;case dM.QW.WALLET:i="credito residuo"}(0,ef.dw)(i)};return null==e||e.addEventListener("click",i),()=>{null==e||e.removeEventListener("click",i)}},[A,R]),(0,m.useEffect)(()=>{j(ec)},[ec]),{items:ea,title:et,description:er,modal:ed,getSelectedItem:()=>{let e=null==ea?void 0:ea.find(e=>e.selection);return{title:(null==e?void 0:e.title)||"",value:(null==e?void 0:e.value)||""}},handleSelect:eB,paymentIsSuccess:e_,isLoadingUpdatePaymentMethod:ex,isShowUpdatePrice:ec,getWarningConfig:()=>{let e=localStorage.getItem(eS.B_);return(null==O?void 0:O.isUpdatedPriceWallet)||e?H:Z},paymentIsLoading:eE}};var dK=e=>{let{items:i,title:n,description:o,modal:l,getSelectedItem:t,handleSelect:r,paymentIsSuccess:d,isLoadingUpdatePaymentMethod:a,isShowUpdatePrice:u,getWarningConfig:s,paymentIsLoading:v}=dW(e);return v&&!a&&(null==i?void 0:i.length)>0?(0,p.jsx)(N.Z,{...dj}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(dQ,{}),u&&(0,p.jsx)(i5.Z,{...s()}),(0,p.jsx)("div",{style:{display:u?"none":"block"},children:(0,p.jsx)(n3.k,{items:i,title:n||"",description:o,bottomModal:l,selectedItem:t(),value:t().value,setSelectedItem:()=>void 0,onSelectItem:r,isSuccess:d,disableItems:a})})]})},dJ=n(64768),dq=n(34133);let dX=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E;return{title:(null==e?void 0:null===(i=e.paymentsmobile)||void 0===i?void 0:i.title)||"",subtitle:(null==e?void 0:null===(o=e.paymentsmobile)||void 0===o?void 0:null===(n=o.userRegistered)||void 0===n?void 0:n.description)||"",buttonLabel:(null==e?void 0:null===(t=e.paymentsmobile)||void 0===t?void 0:null===(l=t.userRegistered)||void 0===l?void 0:l.changeLabel)||"",yourIbanTitle:(null==e?void 0:null===(d=e.paymentsmobile)||void 0===d?void 0:null===(r=d.paymentMethod)||void 0===r?void 0:r.titleIban)||"",yourCreditCardTitle:(null==e?void 0:null===(u=e.paymentsmobile)||void 0===u?void 0:null===(a=u.paymentMethod)||void 0===a?void 0:a.titleCard)||"",yourDebitCardTitle:(null==e?void 0:null===(v=e.paymentsmobile)||void 0===v?void 0:null===(s=v.paymentMethod)||void 0===s?void 0:s.titleDebitCard)||"La tua carta di debito",yourPrepaidCardTitle:(null==e?void 0:null===(p=e.paymentsmobile)||void 0===p?void 0:null===(c=p.paymentMethod)||void 0===c?void 0:c.titlePrepaidCard)||"La tua carta prepagata",yourPaypalTitle:(null==e?void 0:null===(f=e.paymentsmobile)||void 0===f?void 0:null===(m=f.paymentMethod)||void 0===m?void 0:m.titlePaypal)||"Il tuo account Paypal",expirationLabelTitle:(null==e?void 0:null===(E=e.paymentsmobile)||void 0===E?void 0:null===(g=E.paymentMethod)||void 0===g?void 0:g.expirationLabel)||""}},d$=e=>{var i,n,o,l,t,r,d,a,u,s,v,c;return{titlePaymentError:(null==e?void 0:null===(n=e.paymentsmobile)||void 0===n?void 0:null===(i=n.paymentSelectionError)||void 0===i?void 0:i.title)||"",messagePaymentError:(null==e?void 0:null===(l=e.paymentsmobile)||void 0===l?void 0:null===(o=l.paymentSelectionError)||void 0===o?void 0:o.description)||"",actionLabel:(null==e?void 0:null===(r=e.paymentsmobile)||void 0===r?void 0:null===(t=r.paymentSelectionError)||void 0===t?void 0:t.buttonLabel)||"",messageSelectedPaymentError:(null==e?void 0:null===(u=e.paymentsmobile)||void 0===u?void 0:null===(a=u.paymentError)||void 0===a?void 0:null===(d=a.notFound)||void 0===d?void 0:d.message)||"",titleSelectedPaymentError:(null==e?void 0:null===(c=e.paymentsmobile)||void 0===c?void 0:null===(v=c.paymentError)||void 0===v?void 0:null===(s=v.notFound)||void 0===s?void 0:s.title)||""}},d0=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p;let{handleOnChangeEnableGoNext:f,handleGoNextSlide:g,handleGoPrevSlide:b}=e,y=(0,I.useQueryClient)(),{currentStepKey:C,customerFlow:_,checkoutErrors:S,owningData:T,isModalButtonSticky:A,product:R,setIsLastCard:L,setCurrentStepKey:N,setIsPreselectedCard:O,hasSPC:x,setCheckoutStepState:P}=(0,E.Mg)(),[M,k]=(0,m.useState)(!1),D=null==_?void 0:null===(i=_.payment)||void 0===i?void 0:i.data,B=(0,nY.fF)("payMean"),w=(0,nY.fF)("billingAccount"),j=(0,eS.AQ)()===eS.xx.NEXT_USER_ACTIVE&&(null==w?void 0:w.hasPendingDeviceWithInstallments),U=(0,eS.sJ)(B),{isSuccess:F,isError:G,error:z,handleResetState:V}=dY((null==D?void 0:null===(t=D.orderPayment)||void 0===t?void 0:null===(l=t.orderItemPayments)||void 0===l?void 0:null===(o=l[0])||void 0===o?void 0:null===(n=o.orderItemOnBillPayment)||void 0===n?void 0:n.billingOfferIdForChangePaymentMethod)||[""],(null==D?void 0:null===(a=D.orderPayment)||void 0===a?void 0:null===(d=a.orderItemPayments)||void 0===d?void 0:null===(r=d[0])||void 0===r?void 0:r.orderActionId)||"",!M,null==_?void 0:null===(p=_.payment)||void 0===p?void 0:null===(c=p.data)||void 0===c?void 0:null===(v=c.orderPayment)||void 0===v?void 0:null===(s=v.orderOnBillPayment)||void 0===s?void 0:null===(u=s.availablePaymentMethods)||void 0===u?void 0:u.find(e=>{var i,n;return(null===(i=e.type)||void 0===i?void 0:i.toLowerCase())===(null==U?void 0:null===(n=U.type)||void 0===n?void 0:n.toLowerCase())}),dq.K.RECURRENT,"verify"),Y=null==R?void 0:R.isFamilyPlusProduct,H=(0,eC.CA)(eC.Jn,nY.bl.CMS_GET_GENERIC_ERROR_MOBILE),Z=Y?nY.bl.CMS_GET_FAMILY_PLUS_PAYMENT:nY.bl.CMS_GET_PAYMENTS_MOBILE,Q=(0,eC.CA)(eC.Jn,Z),{title:W,subtitle:K,buttonLabel:J,yourIbanTitle:q,yourCredit
1CardTitle:X,yourDebitCardTitle:$,yourPrepaidCardTitle:ee,yourPaypalTitle:ei,expirationLabelTitle:en}=dX(Q),{titlePaymentError:eo,messagePaymentError:el,actionLabel:et}=d$(Q),er=()=>{f&&f(!0)};return(0,m.useEffect)(()=>{var e,i,n,o;let l=()=>{(0,nH.u)(y,["payMean","authorize"])};if(z){let n=()=>{b&&b()};l();let o=(0,eS.nQ)("authorize",{url:nY.bl.AUTHORIZE,status:"500",statusText:"500"});null==S||null===(i=S.showAndTrackError)||void 0===i||i.call(S,H,n,o,eo,el,n,et,()=>{var e;return(0,nY.xb)(y,(null==R?void 0:null===(e=R.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",R,n,C,o)},(null==R?void 0:R.removeCTC)?void 0:null==R?void 0:null===(e=R.paymentErrorCallMeNow)||void 0===e?void 0:e.label,A,!0)}if(G){let e=()=>{b&&b()};l(),null==S||null===(o=S.showAndTrackError)||void 0===o||o.call(S,H,e,z||void 0,eo,el,e,et,()=>{var i;return(0,nY.xb)(y,(null==R?void 0:null===(i=R.genericErrorCallMeNow)||void 0===i?void 0:i.url)||"",R,e,C,z||void 0)},(null==R?void 0:R.removeCTC)?void 0:null==R?void 0:null===(n=R.paymentErrorCallMeNow)||void 0===n?void 0:n.label,A,!0)}},[G]),(0,m.useEffect)(()=>{F&&er&&(k(!0),er(),null==V||V())},[F]),(0,m.useEffect)(()=>(N(h.Bf.PAYMENT_METHOD),P(h.v9.PAYMENT_METHOD_CARD,{}),O(!0),L(!0),()=>{L(!1)}),[]),{owningData:T,onChangePayment:()=>{L(!1),setTimeout(()=>{(0,nY.Fk)({event_name:"ui_interaction",event_label_track:"change paym method",event_category:"users",event_action:"click",tracking_type:"link"}),g&&g()},300)},handleGoPrevSlide:b,selectedPaymean:U,isSuccessChangePayment:M,isTNPUser:j,hasSPC:x,config:{title:W,subtitle:K,buttonLabel:J,titlePaymentError:eo,messagePaymentError:el,yourIbanTitle:q,yourCreditCardTitle:X,yourDebitCardTitle:$,yourPrepaidCardTitle:ee,yourPaypalTitle:ei,expirationLabelTitle:en}}},d1=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("payment method pre-filled","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step9.0"],event_label:"payment method pre-filled",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"payment method pre-filled"),(0,S.q)(n),null}),d2=e=>({title:e.title||"",subtitle:e.subtitle||"",description:e.description||""}),d5=e=>{var i,n,o,l,t,r,d,a;let{handleGoNextSlide:u,handleGoPrevSlide:s}=e,v=(0,I.useQueryClient)(),[c,p]=(0,m.useState)(!1),{paymentsmobile:{warningPriceChange:f}}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PAYMENTS_MOBILE),g=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR),b=d2(f),y=(0,T.De)("info box","mobile",v),{mutate:C,isSuccess:_,isError:S,error:A,isLoading:R}=(0,dA.x)(),{trackView:L}=(0,i3.r)({event:["checkout_step9.1"],event_label:"credito residuo",opts:null==y?void 0:y.opts,cartProduct:null==y?void 0:y.trackingProduct,pageProduct:null==y?void 0:y.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});(0,ef.kg)(L,"credito residuo");let{currentStepKey:N,checkoutErrors:O,availablePaymentMethods:x,product:P,customerFlow:M,isModalButtonSticky:k,setProduct:D,setHideStickyBar:B,setIsDisabledBackButton:w,setCheckoutStepState:j}=(0,E.Mg)(),U=null==M?void 0:null===(i=M.payment)||void 0===i?void 0:i.data,{isLoading:F,isSuccess:G,isError:z,error:V}=dY((null==U?void 0:null===(t=U.orderPayment)||void 0===t?void 0:null===(l=t.orderItemPayments)||void 0===l?void 0:null===(o=l[0])||void 0===o?void 0:null===(n=o.orderItemOnBillPayment)||void 0===n?void 0:n.billingOfferIdForChangePaymentMethod)||[""],(null==U?void 0:null===(a=U.orderPayment)||void 0===a?void 0:null===(d=a.orderItemPayments)||void 0===d?void 0:null===(r=d[0])||void 0===r?void 0:r.orderActionId)||"",c,null==x?void 0:x.find(e=>e.configured),dM.K$.RECURRENT);return(0,m.useEffect)(()=>{c&&p(!1)},[G]),(0,m.useEffect)(()=>{if(S&&!R){var e,i,n;null==O||null===(n=O.showAndTrackError)||void 0===n||n.call(O,g,s,(0,eS.nQ)("updateProductCharacteristics",A),void 0,void 0,s,(null==g?void 0:null===(e=g.genericerror)||void 0===e?void 0:e.buttonLabel)||"",()=>{var e;return(0,eb.x)(v,(null==P?void 0:null===(e=P.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",P,s,N,(0,eS.nQ)("updateProductCharacteristics",A))},(null==P?void 0:P.removeCTC)?void 0:(null==P?void 0:null===(i=P.genericErrorCallMeNow)||void 0===i?void 0:i.label)||"",k,!0)}else _&&!R&&p(!0)},[_,S,R]),(0,m.useEffect)(()=>
1{if(z&&!F){var e,i,n;null==O||null===(n=O.showAndTrackError)||void 0===n||n.call(O,g,s,V||void 0,void 0,void 0,s,(null==g?void 0:null===(e=g.genericerror)||void 0===e?void 0:e.buttonLabel)||"",()=>{var e;return(0,eb.x)(v,(null==P?void 0:null===(e=P.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",P,s,N,V||void 0)},(null==P?void 0:P.removeCTC)?void 0:(null==P?void 0:null===(i=P.genericErrorCallMeNow)||void 0===i?void 0:i.label)||"",k,!0)}},[z,F]),(0,m.useEffect)(()=>(w(!0),B(!0),C("No"),localStorage.removeItem(eS.f),()=>{w(!1),B(!1)}),[]),(0,m.useEffect)(()=>{!F&&G&&(D({...P,...(0,dU.vn)(P,dM.ZS.EDIT_WALLET)}),localStorage.setItem(eS.B_,"1"),localStorage.setItem(eS.aY,dM.QW.WALLET),setTimeout(()=>{null==u||u()},800))},[G,F]),(0,m.useEffect)(()=>{j(h.v9.WARNING_CARD,{})},[]),{cms:b}};var d3=n(30573),d6=n(37155),d4=n(21880);let d7={displayBrand:"*********",object_type:"*****",id:"***********",type:"*****",accountNumber:"*******",brand:"********",lastFourDigits:"****",holderName:"*********",expiryMonth:"**",expiryYear:"****"},d9=e=>{var i,n,o,l,t;return{title:(null==e?void 0:null===(i=e.paymentsmobile)||void 0===i?void 0:i.title)||"",subtitle:(null==e?void 0:null===(o=e.paymentsmobile)||void 0===o?void 0:null===(n=o.userRegistered)||void 0===n?void 0:n.description)||"",buttonLabel:(null==e?void 0:null===(t=e.paymentsmobile)||void 0===t?void 0:null===(l=t.userRegistered)||void 0===l?void 0:l.changeLabel)||""}},d8=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I;return{titlePaymentError:(null==e?void 0:null===(n=e.paymentsmobile)||void 0===n?void 0:null===(i=n.paymentSelectionError)||void 0===i?void 0:i.title)||"",messagePaymentError:(null==e?void 0:null===(l=e.paymentsmobile)||void 0===l?void 0:null===(o=l.paymentSelectionError)||void 0===o?void 0:o.description)||"",buttonPaymentError:(null==e?void 0:null===(r=e.paymentsmobile)||void 0===r?void 0:null===(t=r.paymentSelectionError)||void 0===t?void 0:t.buttonLabel)||"",messageSelectedPaymentError:(null==e?void 0:null===(u=e.paymentsmobile)||void 0===u?void 0:null===(a=u.paymentError)||void 0===a?void 0:null===(d=a.notFound)||void 0===d?void 0:d.message)||"",titleSelectedPaymentError:(null==e?void 0:null===(c=e.paymentsmobile)||void 0===c?void 0:null===(v=c.paymentError)||void 0===v?void 0:null===(s=v.notFound)||void 0===s?void 0:s.title)||"",titleErrorErrorRetriveCart:(null==e?void 0:null===(m=e.paymentsmobile)||void 0===m?void 0:null===(p=m.errorRetriveCart)||void 0===p?void 0:p.title)||"",messageErrorRetriveCart:(null==e?void 0:null===(g=e.paymentsmobile)||void 0===g?void 0:null===(f=g.errorRetriveCart)||void 0===f?void 0:f.description)||"",buttonLabelErrorRetriveCart:(null==e?void 0:null===(h=e.paymentsmobile)||void 0===h?void 0:null===(E=h.errorRetriveCart)||void 0===E?void 0:E.buttonLabel)||"",titleErrorUpdatePaymentRecharge:(null==e?void 0:null===(y=e.paymentsmobile)||void 0===y?void 0:null===(b=y.errorUpdatePaymentRecharge)||void 0===b?void 0:b.title)||"",messageErrorUpdatePaymentRecharge:(null==e?void 0:null===(_=e.paymentsmobile)||void 0===_?void 0:null===(C=_.errorUpdatePaymentRecharge)||void 0===C?void 0:C.description)||"",buttonLabelErrorUpdatePaymentRecharge:(null==e?void 0:null===(I=e.paymentsmobile)||void 0===I?void 0:null===(S=I.errorUpdatePaymentRecharge)||void 0===S?void 0:S.buttonLabel)||""}},ae=e=>{var i,n,o,l,t;let r=(0,n9.f)("customerData"),d=(0,n9.f)("findCaller"),a=(null==r?void 0:null===(n=r[0])||void 0===n?void 0:null===(i=n.owningIndividual)||void 0===i?void 0:i.fiscalCode)||(null==d?void 0:null===(o=d.individualRef)||void 0===o?void 0:o.fiscalCode),u=(null==e?void 0:null===(t=e.globalconfig)||void 0===t?void 0:null===(l=t.newMopUpfront)||void 0===l?void 0:l.enableNewMopMobile)==="true"||"TRUE"===({NODE_ENV:"production",NEXT_PUBLIC_CONSUMER_CDA_ENABLED:"TRUE",NEXT_PUBLIC_RELATIVE:"true",NEXT_PUBLIC_YEXT_EXP_VER:"PRODUCTION",NEXT_PUBLIC_IS_NEW_AUTOMATIC_RECHARGE:"TRUE",NX_DATADOG_APPLICATION_ID:"39c07e57-2e75-429d-b3fc-a134d084afdc",NX_DATADOG_CLIENT_TOKEN_BUSINESS:"pub6894e18f793db7dba639d9b512a2f5d6",NX_DATADOG_CLIENT_TOKEN_CONSUMER:"pub30b056ef826746c997d0e49fe8a6bce3",NX_WORKSPACE_ROOT:"/home/jenkins/agent/workspace/web-sunrise-prod/web-sunrise-consumer-deploy-prod",NEXT_PUBLIC_DATADOG_SESSION_REPLAY:"0",NEXT_PUBLIC_HOSTNAME:"https://privati.vodafone.it",NEXT_PUBLIC_LOGGER_LEVEL:"ERROR",NEXT_PUBLIC_MEDIA_PATHNAME:"media",NEXT_PUBLIC_NEXT_ENVIRO:"https://az-apicweb.vodafone.it",NX_VERBOSE_LOGGING:"true",NEXT_PUBLIC_CONSUMER_TARIFFE_ESTERO_ENABLE_COUNTERS:"TRUE",NEXT_PUBLIC_ENABLE_IBUY_MOBILE_DEBUG:"FALSE",NX_DATADOG_CLIENT_TOKEN_LANDING:"pub1a1ec58a4f96601a0aa81d197002a199",NEXT_PUBLIC_FW_AMD_INTEGRATION:"TRUE",NEXT_PUBLIC_FASTWEB_POST_COVERAGE:"https://www.fastweb.it/AVT/coveragevf/",NX_S3_BUCKET_BEHIND_CDN:"s3://web-cloud-prod-vf-it",NEXT_PUBLIC_WEBAPI_SERVERLESS:"https://api.privati.vodafone.it/",NX_IGNORE_CYCLES:"true",NEXT_PUBLIC_YEXT_REDIRECT_URL:"https://search.vodafone.it",NX_PUBLIC_VMS_ENVIRO:"https://api-vms.digitalcvm.vodafone.it/",NEXT_PUBLIC_CMS:"https://a-wb.vodafone.it/webconsumer",NEXT_PUBLIC_DATADOG_SERVICE:"web-privati",NEXT_PUBLIC_ENABLE_IBUY_FIXED_DEBUG:"FALSE",NEXT_PUBLIC_FWVAPI:"aHR0cHM6Ly9mYXN0d2ViLml0L215ZmFzdHdlYg==",NEXT_PUBLIC_DATADOG_ENABLED:"true",NEXT_PUBLIC_MOCK_APP:"false",NEXT_PUBLIC_YEXT_BUSINESS_ID:"3461483",NX_DATADOG_APPLICATION_ID_BUSINESS:"b22edac9-c60e-4e56-9f0d-0afa9e3f83f3",NX_DATADOG_APPLICATION_ID_CONSUMER:"39c07e57-2e75-429d-b3fc-a134d084afdc",NEXT_PUBLIC_ONBOARDING_V2:"https://apiv2.privati.vodafone.it/",NEXT_PUBLIC_WEBAPI_CEREBRO:"https://api.privati.vodafone.it/",NX_CLOUDFRONT_ID:"E21LAVRHE5XBFN",NX_MEDIA_ROOT:"apps/consumer",NX_S3_MEDIA_BUCKET:"s3://web-cloud-prod-vf-consumer",NX_TAG_RELEASE_VERSION:"5.3.5",NEXT_PUBLIC_VR_URL:"https://attivasim.vodafone.it",NX_TASK_HASH:"15057693463557861197",NEXT_PUBLIC_DISABLE_2FA:"TRUE",NX_DATADOG_APPLICATION_ID_LANDING:"c38a0928-1c0e-4790-8f3b-baea4864198f",NEXT_PUBLIC_DATADOG_CLIENT_TOKEN:"pub30b056ef826746c997d0e49fe8a6bce3",NX_YEXT_BUSINESS_ID:"3461483",NEXT_PUBLIC_CDA_AMD_LOGIN:"https://www.vodafone.it/content/vodafone-next/it/authorize",NX_YEXT_API_KEY:"07377ddb3ff87208d4fb4d14fed7c6ff",NEXT_PUBLIC_DATADOG_LOGS_SAMPLE:"100",NEXT_PUBLIC_FW_POST_FORM:"https://www.fastweb.it/landing/fastwebenergiavf/",NEXT_PUBLIC_MOCK_WINBACK:"FALSE",NEXT_PUBLIC_UTAG_BASE_URL:"https://tags.tiqcdn.com/utag/fwvf/vf-web-consumer/prod",NEXT_PUBLIC_MOCK_CDA:"FALSE",NX_APP_DYNAMICS_API_KEY:"EC-AAB-MFM",NX_DATADOG_CLIENT_TOKEN:"pub30b056ef826746c997d0e49fe8a6bce3",NX_CLI_SET:"true",NEXT_PUBLIC_AWSAPI_CONSUMER_PREFIX:"https://consumer.api.mvacloud.vodafone.it/prod",NEXT_PUBLIC_DATADOG_ENV:"prod",NEXT_PUBLIC_ENABLE_TOGGLE_DEVTOOLS:"FALSE",NX_TASK_TARGET_TARGET:"custom-build",NEXT_PUBLIC_DATADOG_SESSION_SAMPLE:"5",NEXT_PUBLIC_ENABLE_MULTILANGUAGE:"FALSE",NEXT_PUBLIC_MEDIA_IMG_FORMAT:"webp",NX_GOOGLE_MAPS_API_KEY:"AIzaSyCGPq5-LJvN1i-5HiRAyVQyZoloVyxSsvo",NX_LOAD_DOT_ENV_FILES:"true",NEXT_PUBLIC_LANDING_CEREBRO_REPLACE_FACE_MATCH:"TRUE",NX_YEXT_API_KEY_TO_be_deleted:"07377d
1db3ff87208d4fb4d14fed7c6ff",NX_TASK_TARGET_PROJECT:"consumer",NEXT_PUBLIC_DATADOG_APPLICATION_ID:"39c07e57-2e75-429d-b3fc-a134d084afdc",NEXT_PUBLIC_DXL_CONSUMER_CLOUD:"https://public.dxlcloud.vodafone.it/prod",NEXT_PUBLIC_NEW_ABROAD:"TRUE",NX_DATADOG_SITE:"datadoghq.eu",NEXT_PUBLIC_SHOW_APPOINTMENT:"TRUE",NEXT_PUBLIC_YEXT_EXP_KEY:"vodafone-search-privati",NX_TUI:"false",NEXT_PUBLIC_WEBAPI_VODAFONE_FW:"https://apigw-pro.fastweb.it"}).NEXT_PUBLIC_NEW_MOP_ENABLED;return(null==a?void 0:a.includes("XBS"))||u},ai=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B;let w=ae(i),j=e=>(null==e?void 0:e.toLowerCase())===dk.Q.PAYPAL.toLowerCase(),U=(0,eS.BT)(!0),F=null==e?void 0:null===(l=e.paymentsmobile)||void 0===l?void 0:null===(o=l.upFrontPayment)||void 0===o?void 0:null===(n=o.paymentMethod)||void 0===n?void 0:n.filter(e=>{var i,n,o;return!!w||[null===(i=dk.Q.CREDIT_CARD)||void 0===i?void 0:i.toLowerCase(),null===(n=dk.Q.PAYPAL)||void 0===n?void 0:n.toLowerCase()].includes(null==e?void 0:null===(o=e.value)||void 0===o?void 0:o.toLowerCase())}).map(e=>({title:(null==e?void 0:e.title)||"",description:(null==e?void 0:e.description)||"",value:j(null==e?void 0:e.value)?"creditCardAndPaypal":null==e?void 0:e.value})),G=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),z=(e,i,n)=>{var o;return e&&(null===(o=(0,b.q)([e.replace(RegExp(G(i),"g"),"".concat(n||""))||""]))||void 0===o?void 0:o[0])||""};return{titleUpFront:(null==e?void 0:null===(r=e.paymentsmobile)||void 0===r?void 0:null===(t=r.upFrontPayment)||void 0===t?void 0:t.title)||"Contributo iniziale",descriptionCC:z(null==e?void 0:null===(a=e.paymentsmobile)||void 0===a?void 0:null===(d=a.upFrontPayment)||void 0===d?void 0:d.descriptionCC,eS.MM.PLACEHOLDER_ONETIME,U),descriptionCreditRemaning:z(null==e?void 0:null===(s=e.paymentsmobile)||void 0===s?void 0:null===(u=s.upFrontPayment)||void 0===u?void 0:u.descriptionCreditRemaining,eS.MM.PLACEHOLDER_ONETIME,U),descriptionDC:z(null==e?void 0:null===(c=e.paymentsmobile)||void 0===c?void 0:null===(v=c.upFrontPayment)||void 0===v?void 0:v.descriptionDC,eS.MM.PLACEHOLDER_ONETIME,U),descriptionPrepaid:z(null==e?void 0:null===(m=e.paymentsmobile)||void 0===m?void 0:null===(p=m.upFrontPayment)||void 0===p?void 0:p.descriptionPrepaid,eS.MM.PLACEHOLDER_ONETIME,U),descriptionPaypal:z(null==e?void 0:null===(g=e.paymentsmobile)||void 0===g?void 0:null===(f=g.upFrontPayment)||void 0===f?void 0:f.descriptionPaypal,eS.MM.PLACEHOLDER_ONETIME,U),titleCC:z(null==e?void 0:null===(h=e.paymentsmobile)||void 0===h?void 0:null===(E=h.upFrontPayment)||void 0===E?void 0:E.titleCC,eS.MM.PLACEHOLDER_ONETIME,U),titleDC:z(null==e?void 0:null===(C=e.paymentsmobile)||void 0===C?void 0:null===(y=C.upFrontPayment)||void 0===y?void 0:y.titleDC,eS.MM.PLACEHOLDER_ONETIME,U),titlePrepaid:z(null==e?void 0:null===(S=e.paymentsmobile)||void 0===S?void 0:null===(_=S.upFrontPayment)||void 0===_?void 0:_.titlePrepaid,eS.MM.PLACEHOLDER_ONETIME,U),titlePaypal:z(null==e?void 0:null===(T=e.paymentsmobile)||void 0===T?void 0:null===(I=T.upFrontPayment)||void 0===I?void 0:I.titlePaypal,eS.MM.PLACEHOLDER_ONETIME,U),expirationLabelTitle:(null==e?void 0:null===(R=e.paymentsmobile)||void 0===R?void 0:null===(A=R.paymentMethod)||void 0===A?void 0:A.expirationLabel)||"",paymentMethod:F,bottomModalConfig:{textLink:(null==e?void 0:null===(O=e.paymentsmobile)||void 0===O?void 0:null===(N=O.upFrontPayment)||void 0===N?void 0:null===(L=N.modal)||void 0===L?void 0:L.textLink)||"",titleModal:(null==e?void 0:null===(M=e.paymentsmobile)||void 0===M?void 0:null===(P=M.upFrontPayment)||void 0===P?void 0:null===(x=P.modal)||void 0===x?void 0:x.title)||"",descriptionModal:(null==e?void 0:null===(B=e.paymentsmobile)||void 0===B?void 0:null===(D=B.upFrontPayment)||void 0===D?void 0:null===(k=D.modal)||void 0===k?void 0:k.description)||""}}},an=(e,i)=>(ae(e)?[dk.Q.CREDIT_CARD,dk.Q.DEBIT_CARD,dk.Q.PREPAID_CARD]:[dk.Q.CREDIT_CARD]).includes(null==i?void 0:i.value)||!1;var ao=n(79608),al=n(77286),at=e=>{let{onErrorRetry:i}=e,n=(0,I.useQueryClient)(),[o,l]=(0,m.useState)(!0),{currentStepKey:t,checkoutErrors:r,isModalButtonSticky:d,product:a,portabilityStatus:u}=(0,E.Mg)(),s=null==a?void 0:a.shoppingCartUrl,{isLoading:v,isSuccess:c,isError:f,error:g}=(0,al.D)({ignoreQueryString:!0}),b="".concat((0,ed.e)()),{paymentsmobile:{warningWaitingPayment:y,loadingOrder:C,paymentError:_}}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PAYMENTS_MOBILE),S=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_INSTANT_ORDER_ERROR_MOBILE),A=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),{buttonGenericError:R,urlGenericErrorCallMeNow:L}=(0,eS.S6)(a),N=(0,T.De)("checkout","mobile",n),O=localStorage.getItem("disableRed"),{goBackErrorOnPaymentFormattedErrors:x,goBackErrorOnPayment:P,blockingFormattedError:M,blockingErrors:k}=(0,eS.Uv)(S),D=()=>{O||(localStorage.removeItem(eS._9),window.open(s||b,"_self"))},{trackView:B}=(0,ao.r)({event:["order_loading"],event_label:"verifying_payment_information",opts:null==N?void 0:N.opts,cartProduct:null==N?void 0:N.trackingProduct,pageProduct:null==N?void 0:N.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});(0,ef.kg)(B,"verifying_payment_information");let w={title:(null==y?void 0:y.title)||"",subtitle:(null==y?void 0:y.subtitle)||"",description:(null==y?void 0:y.description)||"",lottie:(null==C?void 0:C.loadingImage)||""},j=()=>{var e;if(x.includes(null==g?void 0:null===(e=g.errorType)||void 0===e?void 0:e.toLowerCase())){let e=null==P?void 0:P.filter(e=>{var i,n;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==g?void 0:null===(n=g.errorType)||void 0===n?void 0:n.toLowerCase())}),o=(null==g?void 0:g.errorCode)?null==e?void 0:e.find(e=>e.errorCode==g.errorCode):(null==e?void 0:e.find(e=>!e.errorCode))||(null==e?void 0:e[0]);B((0,T.yP)({...g,isBlocking:(null==o?void 0:o.isBlocking)==="true"},h.Bf.UPFRONT_PAYMENT,n)),localStorage.setItem(eS.ax,(null==o?void 0:o.title)||""),localStorage.setItem(eS.OC,(null==o?void 0:o.message)||""),(null==o?void 0:o.isClickToCall)==="true"?localStorage.setItem(eS.Gl,"1"):localStorage.removeItem(eS.Gl),localStorage.setItem(eS._9,"1"),setTimeout(()=>{null==i||i(o)},200)}else B((0,T.yP)(g,h.Bf.UPFRONT_PAYMENT,n)),O||(localStorage.removeItem(eS._9),window.open(s||b,"_self"))};return(0,m.useEffect)(()=>
1{if(ao.K.debug("CheckOrderMobile",c,v,f),v||!c||f){if(!v&&f&&!c){var e,i;if(M.includes(null==g?void 0:null===(e=g.errorType)||void 0===e?void 0:e.toLowerCase())){let e=k.filter(e=>{var i,n;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==g?void 0:null===(n=g.errorType)||void 0===n?void 0:n.toLowerCase())}),o=(null==g?void 0:g.errorCode)?null==e?void 0:e.find(e=>e.errorCode==g.errorCode):(null==e?void 0:e.find(e=>!e.errorCode))||(null==e?void 0:e[0]);B((0,T.yP)({...g,isBlocking:(null==o?void 0:o.isBlocking)==="true"},h.Bf.UPFRONT_PAYMENT,n)),null==r||null===(i=r.showAndTrackError)||void 0===i||i.call(r,A,D,void 0,null==o?void 0:o.title,null==o?void 0:o.message,()=>(0,eb.x)(n,(null==o?void 0:o.keyClickToCall)||L,a,()=>{},t,g),(null==a?void 0:a.removeCTC)?void 0:R,void 0,void 0,d,!1,!1,!1,(null==_?void 0:_.icon)||void 0)}else j()}}else O||(localStorage.removeItem(eS._9),window.open("".concat(b,"/").concat(er.Z.THANK_YOU),"_self"))},[v,f,c,o]),(0,m.useEffect)(()=>{(null==u?void 0:u.isSuccess)&&l(!1)},[u]),(0,p.jsx)(p.Fragment,{children:(0,p.jsx)(i5.Z,{...w})})},ar=n(42250);let ad=(e,i,n,o)=>{let[l,t]=(0,m.useState)(!1),[r,d]=(0,m.useState)(!1),[a,u]=(0,m.useState)(!1),[s,v]=(0,m.useState)(""),c=!!e,p=(0,eC.CA)(eC.Jn,f.b.CMS_GET_GLOBAL_CONFIG),{isSuccess:g,isLoading:E,isError:h}=(0,ar.V)({enabled:!(0,eS.Vz)()}),{data:b,isSuccess:y,isError:C}=(0,lS.b)({enabled:g&&!(0,eS.Vz)()},p),{error:_,isSuccess:S,isError:I,mutate:T}=(0,dI.j)(),{data:A,isError:R,error:L,isSuccess:N,mutate:O}=(0,dF.Sz)();return(0,m.useEffect)(()=>{E&&d(!0)},[E]),(0,m.useEffect)(()=>{let o=(0,f.f)("findCaller");iM.K.debug("AUTHORIZE payMeanData :",b),iM.K.debug("AUTHORIZE payMeanData.payMeans :",null==b?void 0:b.payMeans),(null==b?void 0:b.payMeans)&&(null==o?void 0:o.customerHasActiveSubs)&&y&&!S&&!c&&!A&&e&&T(),(null==b?void 0:b.payMeans)&&S&&!N&&e&&O({payMeanType:e,...n&&{authorizationOperation:n},...i&&{siaFlowType:i}})},[y,S,N,c,!!(null==b?void 0:b.payMeans)]),(0,m.useEffect)(()=>{c&&(O({payMeanType:e,...n&&{authorizationOperation:n},...i&&{siaFlowType:i}}),d(!0))},[c,e]),(0,m.useEffect)(()=>{var e,i;h&&(d(!1),u(!0),v("ERROR - payment")),C&&(d(!1),u(!0),v("ERROR - payMean")),I&&(d(!1),u(!0),v(_&&(null===(e=(0,eS.nQ)("reserveEquipment",_))||void 0===e?void 0:e.errorMessage)||"")),R&&(d(!1),u(!0),v(L&&(null===(i=(0,eS.nQ)("authorize",L))||void 0===i?void 0:i.errorMessage)||""))},[h,C,I,R]),(0,m.useEffect)(()=>{N&&(d(!1),t(!0))},[N]),(0,m.useEffect)(()=>{y&&d(!1)},[y]),(0,m.useEffect)(()=>{o&&(r?o(!0):o(!1))},[r]),{isSuccess:l,isLoading:r,isError:a,errorMessage:s,payMeanIsSuccess:y,payMeanIsError:C,paymentIsError:h}};var aa=e=>{let{handleOnChangeEnableGoNext:i,handleGoPrevSlide:n}=e,o=(0,I.useQueryClient)(),l=document.getElementById("sticky-offer-next"),t=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PAYMENTS_MOBILE),r=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_STEPPER_COMMON_LABELS_MOBILE),d=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GLOBAL_CONFIG),{goBackInStepper:a}=(0,oE.j)(r),{buttonLabel:u}=d9(t),{titlePaymentError:s,messagePaymentError:v,buttonPaymentError:c,titleErrorErrorRetriveCart:f,messageErrorRetriveCart:g,titleErrorUpdatePaymentRecharge:b,messageErrorUpdatePaymentRecharge:y}=d8(t),{titleUpFront:C,descriptionCC:_,descriptionDC:S,descriptionPrepaid:A,descriptionPaypal:R,titleCC:L,titleDC:N,titlePrepaid:O,titlePaypal:x,descriptionCreditRemaning:P,expirationLabelTitle:M,paymentMethod:k,bottomModalConfig:D}=ai(t,d),[B,w]=(0,m.useState)(!1),{currentStepKey:j,checkoutErrors:U,owningData:F,recharge:G,upfrontPayment:z,availablePaymentMethods:V,isModalButtonSticky:Y,product:H,setProduct:Z,setHideStickyBar:Q,setIsDisabledBackButton:W,setIsLastCard:K,setCurrentStepKey:J,setUpdateProductPriceCtrl:q,setIsLoadingGoNext:X}=(0,E.Mg)(),$=localStorage.getItem(eS.aY),ee=k.find(e=>{var i;return(null===(i=e.value)||void 0===i?void 0:i.toLowerCase())===(null==$?void 0:$.toLowerCase())}),ei=an(d,ee),[en,eo]=(0,m.useState)(ee),el=(0,n9.f)("shoppingCart"),et=null==el?void 0:el.id,er=null==V?void 0:V.find(e=>(null==e?void 0:e.configured)&&(null==e?void 0:e.methodCode)!==dM.QW.BANK_ACCOUNT&&(null==e?void 0:e.methodCode)!==dM.QW.WALLET),ed=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),ea=(0,T.De)("checkout","mobile",o),{trackView:eu}=(0,eh.rS)({event:["checkout_step10.1"],event_label:"upfront payment",opts:{...null==ea?void 0:ea.opts,...$&&{payment_method:$}},cartProduct:null==ea?void 0:ea.trackingProduct,pageProduct:null==ea?void 0:ea.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});(0,ef.kg)(eu,"upfront payment"),(0,m.useEffect)(()=>{var e;let i=()=>{eu({event_name:"ui_interaction",event_label_track:(null==en?void 0:en.value)==="creditCard"?"Credit Card":(null==en?void 0:en.value)==="creditCardAndPaypal"?"Paypal":(null==en?void 0:en.value)==="debitCard"?"Debit Card":(null==en?void 0:en.value)==="prepaidCard"?"Prepaid Card":"",event_category:"users",event_action:"click",tracking_type:"link"})};return(null==en?void 0:en.value)&&localStorage.setItem(eS._n,(null==en?void 0:null===(e=en.value)||void 0===e?void 0:e.toLowerCase())==="creditcardandpaypal"?dM.QW.PAYPAL:null==en?void 0:en.value),null==l||l.addEventListener("click",i),()=>{null==l||l.removeEventListener("click",i)}},[en]);let{mutate:es,isLoading:ev,isSuccess:ec,isError:ep,error:em}
1=(0,dA.x)(),{error:eg,isSuccess:eE,isLoading:ey,isError:e_,refetch:eI}=(0,d3.ju)(et,{enabled:!1}),{isError:eT,isSuccess:eA,isLoading:eR,payMeanIsError:eL,paymentIsError:eN}=ad(null==en?void 0:en.value,dM.K$.INSTANT,ei?"verify":void 0),eO=()=>{Q(!1),W(!1),w(!1)},ex=e=>{e.stopPropagation(),Q(!0),W(!0),w(!0)},eP=(0,m.useCallback)(()=>{var e,i,n,o,l,t,r;let d=null==z?void 0:null===(e=z.type)||void 0===e?void 0:e.toLowerCase();switch(d){case null===(i=dM.QW.CREDIT_CARD)||void 0===i?void 0:i.toLowerCase():return _;case null===(n=dM.QW.DEBIT_CARD)||void 0===n?void 0:n.toLowerCase():return S;case null===(o=dM.QW.PREPAID_CARD)||void 0===o?void 0:o.toLowerCase():return A;case null===(l=dM.QW.PAYPAL)||void 0===l?void 0:l.toLowerCase():return R;case null===(t=dM.QW.BANK_ACCOUNT)||void 0===t?void 0:t.toLowerCase():case null===(r=dM.QW.WALLET)||void 0===r?void 0:r.toLowerCase():default:return d||""}},[z]);return(0,m.useEffect)(()=>{var e,i,l,t;let r=()=>{(0,eh.uY)(o,["payMean","authorize"])};if(eT){let l=()=>{n&&n()};r();let t=(0,eS.nQ)("authorize",{url:n7.bl.AUTHORIZE,status:"500",statusText:"500"});null==U||null===(i=U.showAndTrackError)||void 0===i||i.call(U,ed,l,t,s,v,l,c||"Chiudi",()=>{var e;return(0,eb.x)(o,(null==H?void 0:null===(e=H.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",H,l,j,t)},(null==H?void 0:H.removeCTC)?void 0:null==H?void 0:null===(e=H.paymentErrorCallMeNow)||void 0===e?void 0:e.label,Y,!0)}if(eN||eL){let e=()=>{n&&n()};r();let i=eN?(0,eS.nQ)("payment",{url:n7.bl.PAYMENT,status:"500",statusText:"500"}):(0,eS.nQ)("paymean",{url:n7.bl.PAYMEAN,status:"500",statusText:"500"});null==U||null===(t=U.showAndTrackError)||void 0===t||t.call(U,ed,e,i,s,v,e,c||"Chiudi",()=>{var n;return(0,eb.x)(o,(null==H?void 0:null===(n=H.genericErrorCallMeNow)||void 0===n?void 0:n.url)||"",H,e,j,i)},(null==H?void 0:H.removeCTC)?void 0:null==H?void 0:null===(l=H.paymentErrorCallMeNow)||void 0===l?void 0:l.label,Y,!0)}},[eT,eL,eN]),(0,m.useEffect)(()=>{eE&&Z({...H,...(0,dU.vn)(H,dM.ZS.EDIT)})},[eE]),(0,m.useEffect)(()=>{X(eR),eR||null==i||i(eA)},[eA,eR]),(0,m.useEffect)(()=>{if(!ey&&e_){var e;null==U||null===(e=U.showAndTrackError)||void 0===e||e.call(U,ed,()=>{null==n||n()},(0,eS.nQ)("shoppingCart",eg,void 0,void 0,"get shopping cart in upfront payment",!0,{selectedPayment:$||"",availablePaymentMethods:V||"no payments"}),f,g,()=>{null==n||n()},a||"Torna indietro",void 0,void 0,Y,!0)}},[ey,e_]),(0,m.useEffect)(()=>{if(!ev&&ep){var e;null==U||null===(e=U.showAndTrackError)||void 0===e||e.call(U,ed,()=>{null==n||n()},(0,eS.nQ)("updateProductCharacteristics",em),b,y,()=>{null==n||n()},a||"Torna indietro",void 0,void 0,Y,!0)}else!ev&&ec&&et&&eI()},[ev,ep,ec]),(0,m.useEffect)(()=>{W(ev||ey)},[ev,ey]),(0,m.useEffect)(()=>(J(h.Bf.UPFRONT_PAYMENT),(0,eh.uY)(o,["getShoppingCart"]),window.history.pushState(null,"",window.location.pathname),q({isPriceUpdated:!0,isUpdatePrice:!1}),es(G.option||"No"),K(!0),er&&ei&&(null==l||l.addEventListener("click",ex),localStorage.setItem(eS._n,dM.QW.CREDIT_CARD)),()=>{null==l||l.removeEventListener("click",ex),K(!1)}),[]),(0,p.jsxs)("div",{children:[B&&(0,p.jsx)(at,{onErrorRetry:e=>{var i;eO();let{buttonPaymentError:n,urlPaymentErrorCallMeNow:l}=(0,eS.S6)(H);null==U||null===(i=U.showAndTrackError)||void 0===i||i.call(U,ed,()=>{},void 0,(null==e?void 0:e.title)||"",(null==e?void 0:e.message)||"",()=>{},"Chiudi",(null==e?void 0:e.isClickToCall)?()=>()=>(0,eb.x)(o,l,H,()=>{},j):void 0,(null==e?void 0:e.isClickToCall)&&!(null==H?void 0:H.removeCTC)?n:void 0,Y,!0)}}),(0,p.jsxs)("div",{style:{display:B?"none":"block",paddingBottom:"32px"},children:[ei&&(0,p.jsx)(d4.Z,{owningIndividual:F.owningIndividual,handleGoPrevSlide:n,payMean:z||d7,showLoader:eR||ev||ey,config:{title:C,subtitle:eP(),buttonLabel:u,titlePaymentError:s,messagePaymentError:v,yourCreditCardTitle:L,yourDebitCardTitle:N,yourPrepaidCardTitle:O,yourPaypalTitle:x,expirationLabelTitle:M}}),!ei&&(0,p.jsx)(d6.Z,{title:C,description:P,items:k,value:!1,setSelectedItem:eo,disableItems:eR,isSuccess:!ev&&!ey,bottomModal:D})]})]})},au=n(94927);let as=()=>{let e=localStorage.getItem(au.aY),i=(null==e?void 0:e.toLowerCase())===dk.Q.WALLET.toLowerCase(),n=(0,f.f)("shoppingCart"),o=null==n?void 0:n.id,[l,t]=(0,m.useState)(!i),[r,d]=(0,m.useState)(!1),a=(0,au.CA)(au.Jn,f.b.CMS_GET_GENERIC_ERROR_MOBILE);return{isWallet:i,cartId:o,isLoading:l,setIsLoading:t,skipImmediatePayment:r,setSkipImmediatePayment:d,genericError:a,orderErrors:(0,au.CA)(au.Jn,f.b.CMS_GET_RECURRENT_ORDER_ERROR_MOBILE),paymentCMS:(0,au.CA)(au.Jn,f.b.CMS_GET_PAYMENTS_MOBILE),commonLabels:(0,au.CA)(au.Jn,f.b.CMS_GET_STEPPER_COMMON_LABELS_MOBILE)}},av=e=>{let{isWallet:i,authorizationAsyncInfo:n,authorizationData:o,isErrorAuthorization:l,isSuccessAuthorization:t,setIsStartAuthorizationAsyncInfo:r}=e,d=(0,I.useQueryClient)(),a=(0,T.De)("checkout","mobile",d),{trackView:u}=(0,i3.r)({event:["checkout_step10.1"],event_label:"upfront payment",opts:null==a?void 0:a.opts,cartProduct:null==a?void 0:a.trackingProduct,pageProduct:null==a?void 0:a.pageProductsInfo,visitorTrackingOpts:(0,T.bG)(),disableInitialTrack:!0});(0,ef.qH)(u);let s=()=>{!l&&(o||t)||i||r(!0)};return(0,m.useEffect)(()=>{let e=setTimeout(()=>{s()},1e4);return()=>clearTimeout(e)},[]),{trackView:u}},ac=e=>{let{authorizationAsyncInfo:i,errorAuthorization:n,isErrorAuthorization:o,authorizationData:l,orderErrors:t,genericError:r,paymentCMS:d,product:a,currentStepKey:u,isModalButtonSticky:s,checkoutErrors:v,handleGoPrevSlide:c,setAuthorizationAsyncInfo:p}=e,f=(0,I.useQueryClient)(),{goBackErrorOnPaymentFormattedErrors:g,goBackErrorOnPayment:E,blockingFormattedError:h,blockingErrors:b}=(0,eS.Uv)(t),{buttonGenericError:y,urlGenericErrorCallMeNow:C}=(0,eS.S6)(a),_=()=>{p({...nQ.$i}),null==c||c()},S=()=>{var e,i,o,t,a,u,c,p,m,f,h,b,y,C,S;let I=(null==d?void 0:null===(i=d.paymentsmobile)||void 0===i?void 0:null===(e=i.paymentError)||void 0===e?void 0:e.title)||(null==r?void 0:null===(o=r.genericerror)||void 0===o?void 0:o.title)||"",A=(null==d?void 0:null===(a=d.paymentsmobile)||void 0===a?void 0:null===(t=a.paymentError)||void 0===t?void 0:t.description)||(null==r?void 0:null===(u=r.genericerror)||void 0===u?void 0:u.description)||"",R=(null==d?void 0:null===(p=d.paymentsmobile)||void 0===p?void 0:null===(c=p.paymentError)||void 0===c?void 0:c.buttonLabel)||(null==r?void 0:null===(m=r.genericerror)||void 0===m?void 0:m.buttonLabel)||"";if(n&&(null==g?void 0:g.includes(null==n?void 0:null===(f=n.errorType)||void 0===f?void 0:f.toLowerCase()))){let e=E.filter(e=>{var i,o;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==n?void 0:null===(o=n.errorType)||void 0===o?void 0:o.toLowerCase())}),i=(null==n?void 0:n.errorCode)?(null==e?void 0:e.find(e=>e.errorCode==n.errorCode))||(null==e?void 0:e.find(e=>{var i,o;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==n?void 0:null===(o=n.errorType)||void 0===o?void 0:o.toLowerCase())})):(null==e?void 0:e.find(e=>!e.errorCode))||(null==e?void 0:e[0]);if((null==i?void 0:i.title)&&(I=i.title),(null==i?void 0:i.message)&&(A=i.message),(null==i?void 0:null===(C=i.button)||void 0===C?void 0:C.title)&&(R=null===(S=i.button)||void 0===S?void 0:S.title),!i){T();return}}null==v||null===(y=v.showAndTrackError)||void 0===y||y.call(v,r,_,n?{...n,otherInfo:{...l}}
1:void 0,I,A,_,R,void 0,void 0,s,!0,!1,!1,(null==d?void 0:null===(b=d.paymentsmobile)||void 0===b?void 0:null===(h=b.paymentError)||void 0===h?void 0:h.icon)||void 0)},T=()=>{var e,i,o,t,c,p,m,g,E,S,I,T;let A=(null==d?void 0:null===(i=d.paymentsmobile)||void 0===i?void 0:null===(e=i.paymentError)||void 0===e?void 0:e.title)||"Ops",R=(null==d?void 0:null===(t=d.paymentsmobile)||void 0===t?void 0:null===(o=t.paymentError)||void 0===o?void 0:o.description)||"Si \xe8 verificato un errore durante il recupero dei pagamenti. Riprovare in seguito",L=(null==d?void 0:null===(p=d.paymentsmobile)||void 0===p?void 0:null===(c=p.paymentError)||void 0===c?void 0:c.buttonLabel)||"CAMBIA METODO DI PAGAMENTO",N=y||"TI RICHIAMIAMO NOI",O=C||"";if(n&&(null==h?void 0:h.includes(null==n?void 0:null===(m=n.errorType)||void 0===m?void 0:m.toLowerCase()))){let e=b.filter(e=>{var i,o;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==n?void 0:null===(o=n.errorType)||void 0===o?void 0:o.toLowerCase())}),i=(null==n?void 0:n.errorCode)?(null==e?void 0:e.find(e=>e.errorCode==n.errorCode))||(null==e?void 0:e.find(e=>{var i,o;return(null===(i=e.error)||void 0===i?void 0:i.toLowerCase())===(null==n?void 0:null===(o=n.errorType)||void 0===o?void 0:o.toLowerCase())})):(null==e?void 0:e.find(e=>!e.errorCode))||(null==e?void 0:e[0]);(null==i?void 0:i.title)&&(A=i.title),(null==i?void 0:i.message)&&(R=i.message),(null==i?void 0:i.keyClickToCall)?O=i.keyClickToCall:(null==i?void 0:null===(g=i.button)||void 0===g?void 0:g.urlForRedirect)&&(O=i.button.urlForRedirect),(null==i?void 0:null===(E=i.button)||void 0===E?void 0:E.title)&&(N=i.button.title),null==v||null===(T=v.showAndTrackError)||void 0===T||T.call(v,r,_,n?{...n,otherInfo:{...l}}:void 0,A,R,_,L,()=>(0,eb.x)(f,O,a,_,u,n),(null==a?void 0:a.removeCTC)?void 0:N,s,!0,!1,!1,(null==d?void 0:null===(I=d.paymentsmobile)||void 0===I?void 0:null===(S=I.paymentError)||void 0===S?void 0:S.icon)||void 0)}};return(0,m.useEffect)(()=>{if(o){var e;!n||n&&(null==g?void 0:g.includes(null==n?void 0:null===(e=n.errorType)||void 0===e?void 0:e.toLowerCase()))?S():T()}},[o,n]),{checkGoBackErrors:S,checkBlockingErrors:T}},ap=e=>{let{cartId:i,isWallet:n,authorizationAsyncInfo:o,genericError:l,paymentCMS:t,commonLabels:r,isModalButtonSticky:d,checkoutErrors:a,handleGoPrevSlide:u,setIsLoading:s,setSkipImmediatePayment:v}=e,{goBackInStepper:c}=(0,oE.j)(r),{data:p,refetch:f,isLoading:g,isSuccess:E,isError:h,error:b}=(0,d3.ju)(i,{enabled:!1});return(0,m.useEffect)(()=>{var e,l;(null==o?void 0:null===(e=o.payMean)||void 0===e?void 0:e.isSuccess)&&(null==o?void 0:null===(l=o.authorization)||void 0===l?void 0:l.isSuccess)&&(n?(v(!1),s(!1)):i&&f())},[o]),(0,m.useEffect)(()=>{if(E&&p){let e=(0,eS.BT)(!1);(0===e||"0"===e)&&v(!0),s(!1)}},[E,p]),(0,m.useEffect)(()=>{if(!g&&h){var e,i,n,o,r;null==a||null===(r=a.showAndTrackError)||void 0===r||r.call(a,l,()=>{null==u||u()},(0,eS.nQ)("shoppingCart",b,void 0,void 0,"get shopping cart in upfront payment",!0,{selectedPayment:"",availablePaymentMethods:"no payments"}),null==t?void 0:null===(i=t.paymentsmobile)||void 0===i?void 0:null===(e=i.errorShoppingCart)||void 0===e?void 0:e.title,null==t?void 0:null===(o=t.paymentsmobile)||void 0===o?void 0:null===(n=o.errorShoppingCart)||void 0===n?void 0:n.description,()=>{null==u||u()},c||"Torna indietro",void 0,void 0,d,!0)}},[g,h]),{shoppingCartData:p,refetchShoppingCart:f,isLoadingShoppingCart:g,isSuccessShoppingCart:E}};var am=n(3053);function af(){let e=(0,D._)(["\n    width: 366px;\n  "]);return af=function(){return e},e}function ag(){let e=(0,D._)(["\n    width: 406px;\n  "]);return ag=function(){return e},e}function aE(){let e=(0,D._)(["\n  margin: 0 auto;\n  width: 287px;\n\n  ","\n\n  ","\n"]);return aE=function(){return e},e}function ah(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n    padding: 60px 0 ",";\n  "]);return ah=function(){return e},e}function ab(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return ab=function(){return e},e}function ay(){let e=(0,D._)(["\n  padding: "," 0 ",";\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n  font-size: 1.875rem;\n  line-height: 1.267;\n\n  ","\n\n  ","\n"]);return ay=function(){return e},e}function aC(){let e=(0,D._)(["\n    line-height: ",";\n  "]);return aC=function(){return e},e}function a_(){let e=(0,D._)(["\n    margin-bottom: 2.5rem;\n  "]);return a_=function(){return e},e}function aS(){let e=(0,D._)(["\n  font-family: ",";\n  font-style: normal;\n  font-weight: ",";\n  text-align: center;\n  margin-top: ",";\n  margin-bottom: ",";\n  font-size: ",";\n  line-height: ",";\n\n  ","\n\n  ","\n"]);return aS=function(){return e},e}function aI(){let e=(0,D._)(["\n    gap: 1.25rem;\n  "]);return aI=function(){return e},e}function aT(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n\n  div {\n    margin-top: 0;\n  }\n\n  p {\n    position: relative;\n    margin-bottom: 0;\n  }\n\n  gap: ",";\n\n  ","\n"]);return aT=function(){return e},e}function aA(){let e=(0,D._)(["\n    margin-top: 1.25rem;\n  "]);return aA=function(){return e},e}function aR(){let e=(0,D._)(["\n  display: flex;\n  font-family: ",";\n  font-style: normal;\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  margin-top: ",";\n  margin-bottom: ",";\n\n  ","\n"]);return aR=function(){return e},e}function aL(){let e=(0,D._)(["\n  margin-top: 3.75rem;\n"]);return aL=function(){return e},e}let aN=B.Z.div(aE(),w.B.tablet(af()),w.B.desktop(ag())),aO=B.Z.div(ay(),w.r.spacing.xl,w.r.spacing.md,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.B.tablet(ah(),w.r.typography.fontSize.h1,w.r.typography.lineHeight.h1,w.r.spacing.md),w.B.desktop(ab(),w.r.typography.fontSize.h2,w.r.typography.lineHeight.h2)),ax=B.Z.div(aS(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.spacing.md,w.r.spacing.xl,w.r.typography.fontSize.h6,w.r.typography.lineHeight.h6,w.B.tablet(aC(),w.r.typography.lineHeight.body1),w.B.desktop(a_())),aP=B.Z.div(aT(),w.r.spacing.md,w.B.tablet(aI()));B.Z.div(aR(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.typography.fontSize.body3,w.r.typography.lineHeight.body3,w.r.spacing.md,w.r.spacing.xl,w.B.tablet(aA()));let aM=B.Z.div(aL()),ak=e=>{var i,n,o,l;return M.object({phoneNumber:M.string().required((null==e?void 0:null===(i=e.phoneNumber)||void 0===i?void 0:i.required)||"").min(1,(null==e?void 0:null===(n=e.phoneNumber)||void 0===n?void 0:n.minimum)||"").max(10,null==e?void 0:null===(o=e.phoneNumber)||void 0===o?void 0:o.maximum).matches(/^0[1-9]([0-9]{6,8})/,(null==e?void 0:null===(l=e.phoneNumber)||void 0===l?void 0:l.nomatch)||"")})};var aD=e=>{var i;let{title:n,description:o,label:l,value:t,validation:r,onChangeData:d,onValidChange:a,isLoading:u,schema:s,disabled:v,disclaimer:c}=e,{register:f,setValue:g,getValues:E,formState:{isValid:h,errors:b}}=(0,L.cI)({resolver:(0,x.X)(ak(r)||s),mode:"all"});return(0,m.useEffect)(()=>{t&&g("phoneNumber",t,{shouldValidate:!!t})},[]),(0,m.useEffect)(()=>{null==a||a(h)},[h]),(0,p.jsx)(aN,{children:u?(0,p.jsx)(aM,{children:(0,p.jsx)(iG.Z,{heights:70,quantity:3})}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(aO,{children:n}),(0,p.jsx)(ax,{children:o}),(0,p.jsx)(aP,{children:(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.TextInput,{"data-cs-mask":"",label:l,placeholder:" ",autoComplete:"off",disabled:v||!1,error:null===(i=b.phoneNumber)||void 0===i?void 0:i.message,...f("phoneNumber",{onChange:()=>{let e=E().phoneNumber;d&&d(e)},setValueAs:e=>e.trim()})})})}),c&&(0,p.jsx)(lO.Z,{text:c,size:20,sizeMobile:14,lineHeight:18,margin:[32,0],fontFamily:lx.R.regular,textAlign:"left"})]})})},aB=n(23649);let aw=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b;return{title:(null==e?void 0:e.winbacknumber.otp.title)||"",description:(null==e?void 0:e.winbacknumber.otp.description)||"",codeResponseDescription:(null==e?void 0:null===(n=e.winbacknumber.otp.co
1deResponse)||void 0===n?void 0:n.description)||"",instructionText:{text:"".concat(null==e?void 0:null===(o=e.winbacknumber.otp.telephoneVerify)||void 0===o?void 0:o.replace("$number",'<b style="color:red">'.concat(i,"</b>"))),fontFamily:aB.R.exbold,size:20,lineHeight:(0,aB.k)(20,26)},alerts:{error:(null==e?void 0:null===(l=e.winbacknumber.otp.codeResponse)||void 0===l?void 0:l.alertWarn)||"",sentNew:(null==e?void 0:null===(t=e.winbacknumber.otp.codeResponse)||void 0===t?void 0:t.alertSuccess)||""},otpError:(null==e?void 0:null===(r=e.winbacknumber.otp.codeResponse)||void 0===r?void 0:r.otpError)||"",detail:(null==e?void 0:e.winbacknumber.otp.codeMissingLabel)||"",links:{sendNew:(null==e?void 0:e.winbacknumber.otp.codeNewLabel)||"",noAccess:(null==e?void 0:e.winbacknumber.otp.codeNotAccessLabel)||"",urlNoAccess:(null==e?void 0:e.winbacknumber.otp.contactNotAccessUrl)||""},warning:{title:(null==e?void 0:null===(a=e.winbacknumber)||void 0===a?void 0:null===(d=a.warning)||void 0===d?void 0:d.title)||"",subtitle:(null==e?void 0:null===(s=e.winbacknumber)||void 0===s?void 0:null===(u=s.warning)||void 0===u?void 0:u.subtitle)||"",description:(null==e?void 0:null===(c=e.winbacknumber)||void 0===c?void 0:null===(v=c.warning)||void 0===v?void 0:v.description)||""},timer:{timerLabel:null==e?void 0:null===(b=e.winbacknumber)||void 0===b?void 0:null===(h=b.otp)||void 0===h?void 0:null===(E=h.timer)||void 0===E?void 0:null===(g=E.label)||void 0===g?void 0:g.replace("$TIME",'<b id="timerAmount">'.concat(null==e?void 0:null===(f=e.winbacknumber)||void 0===f?void 0:null===(m=f.otp)||void 0===m?void 0:null===(p=m.timer)||void 0===p?void 0:p.amount,"</b>"))}}},aj=e=>{var i;let n=null==e?void 0:null===(i=e.winbacknumber)||void 0===i?void 0:i.errorPopup;return{titlePopup:null==n?void 0:n.title,messagePopup:null==n?void 0:n.message,ctaLabel:null==n?void 0:n.ctaLabel,buttonLabel:null==n?void 0:n.secondButtonLabel}};var aU=n(30837),aF=n(99686);let aG=()=>{let e=(0,n9.f)("offeringServiceability");return(0,aF.ay)((null==e?void 0:e.serviceabilityCharacteristic)||[],"Technology")},az=(e,i)=>aU.Wd.post("".concat(nq.b.CAMPAIGN,"/").concat(e,"/accept"),i),aV=()=>{let e=(0,I.useQueryClient)();return(0,I.useMutation)("acceptCampaign",i=>{var n,o;let{phoneNumber:l,campaignId:t}=i,r=e.getQueryData("getSubscriberByResource");return az(t,{audienceType:"SUBSCRIBER_ID",msisdn:l,isWinbackCampaign:"true",audienceId:(null==r?void 0:null===(n=r[0])||void 0===n?void 0:n.subscriberId)||"",customerId:(null==r?void 0:null===(o=r[0])||void 0===o?void 0:o.customerId)||"",...aG()&&{serviceabilityTechnology:aG()||""}})},{onSuccess:i=>{e.setQueryData("acceptCampaign",i)},onError:i=>{eh.KF.error("ERROR - acceptCampaign",i),e.setQueryData("acceptCampaign",(0,eS.nQ)("acceptCampaign",i))}})};var aY=n(76550);let aH=(e,i)=>aY.W.get("".concat(nq.b.CAMPAIGN,"/").concat(e),{searchParams:{salesChannel:"selfService",audienceType:"SUBSCRIBER_ID",audienceId:i}}),aZ=(e,i)=>{let n=(0,I.useQueryClient)();return(0,I.useQuery)(["getCampaignDetails"],()=>{var i;let o=n.getQueryData("getSubscriberByResource");return aH(e,(null==o?void 0:null===(i=o[0])||void 0===i?void 0:i.subscriberId)||"")},{enabled:i||!1})};(d=c||(c={})).SELF="selfService",d.SUBSCRIBER="subscriber",d.DESC="DESC",d.FILTER="status%3D%3DCANCELLED";let aQ=e=>aY.W.get(nq.b.SEARCH_SUBSCRIBER_BY_RESOURCE,{searchParams:{salesChannel:c.SELF,levelOfData:c.SUBSCRIBER,limit:1,sort:c.DESC,filters:decodeURIComponent(c.FILTER),subscriptionMsisdn:e}}),aW=(e,i)=>(0,I.useQuery)(["getSubscriberByResource"],()=>aQ(e),{enabled:i||!1});var aK=n(47929);let aJ=()=>{let e=(0,aK.m)("NEXT_PUBLIC_MOCK_WINBACK")||"";if(e){var i;return(null==e?void 0:null===(i=e.toString())||void 0===i?void 0:i.toLowerCase())==="true"}return!1},aq=e=>{let i=(0,I.useQueryClient)(),[n,o]=(0,m.useState)(!1),[l,t]=(0,m.useState)(!1),[r,d]=(0,m.useState)(!1),a=localStorage.getItem("targetCampaignId")||"",{data:u,isSuccess:s,isLoading:v,isError:c,refetch:p}=aW(e,!1),{isSuccess:f,isLoading:g,isError:E,refetch:h}=aZ(a,!1),{mutate:b,data:y,isSuccess:C,isLoading:_,isError:S}=aV(),{isSuccess:T,isLoading:A,isError:R}=(0,d3.ju)(null==y?void 0:y.orderId,{enabled:!!(null==y?void 0:y.orderId)}),L=i=>{i&&u&&b({phoneNumber:e,campaignId:a})};return(0,m.useEffect)(()=>{s&&(d(!u),r||h())},[s]),(0,m.useEffect)(()=>{L(f)},[f]),(0,m.useEffect)(()=>{t([v,g,_,A].some(Boolean))},[v,g,_,A]),(0,m.useEffect)(()=>{o([s,f,C,T].every(Boolean))},[s,f,C,T]),(0,m.useEffect)(()=>{d([c,E,S,R].some(Boolean))},[c,E,S,R]),{isSuccess:n,isLoading:l,isError:r,refetchFlowStart:()=>{aJ()?o(!0):p()},resetState:()=>{t(!1),o(!1),d(!1),(0,nH.u)(i,["getShoppingCart","getSubscriberByResource","getCampaignDetails","acceptCampaign"])}}};function aX(){let e=(0,D._)(["\n  padding-top: 3.75rem;\n  width: 85%;\n  margin: 0 auto;\n"]);return aX=function(){return e},e}let a$=B.Z.div(aX()),a0=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("e-sim option","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step4.7"],event_label:"e-sim option",opts:null==i?void 0:i.opts,pageProduct:null==i?void 0:i.pageProductsInfo,cartProduct:null==i?void 0:i.trackingProduct,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"e-sim option"),(0,S.q)(n),null}),a1=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w;return{cardTitle:(null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.simType)||void 0===o?void 0:null===(n=o.card)||void 0===n?void 0:n.title)||"",cardDescription:(null==e?void 0:null===(d=e.personalinfomobile)||void 0===d?void 0:null===(r=d.simType)||void 0===r?void 0:null===(t=r.card)||void 0===t?void 0:t.description)||"",bestChoiceLabel:(null==e?void 0:null===(s=e.personalinfomobile)||void 0===s?void 0:null===(u=s.simType)||void 0===u?void 0:null===(a=u.card)||void 0===a?void 0:a.bestChoiceLabel)||"",modalInfo:{textLink:(null==e?void 0:null===(p=e.personalinfomobile)||void 0===p?void 0:null===(c=p.simType)||void 0===c?void 0:null===(v=c.modalInfo)||void 0===v?void 0:v.textLink)||"",titleModal:(null==e?void 0:null===(g=e.personalinfomobile)||void 0===g?void 0:null===(f=g.simType)||void 0===f?void 0:null===(m=f.modalInfo)||void 0===m?void 0:m.title)||"",descriptionModal:(null==e?void 0:null===(b=e.personalinfomobile)||void 0===b?void 0:null===(h=b.simType)||void 0===h?void 0:null===(E=h.modalInfo)||void 0===E?void 0:E.description)||""},migrationCodeError:{title:(null==i?void 0:null===(C=i.portabilitymobile)||void 0===C?void 0:null===(y=C.errorOnPortability)||void 0===y?void 0:y.title)||"",description:(null==i?void 0:null===(S=i.portabilitymobile)||void 0===S?void 0:null===(_=S.errorOnPortability)||void 0===_?void 0:_.message)||"",buttonLabel:(null==i?void 0:null===(T=i.portabilitymobile)||void 0===T?void 0:null===(I=T.errorOnPortability)||void 0===I?void 0:I.buttonLabel)||""},genericsError:{title:(null==i?void 0:null===(R=i.portabilitymobile)||void 0===R?void 0:null===(A=R.errorMod
1al)||void 0===A?void 0:A.title)||"",description:(null==i?void 0:null===(N=i.portabilitymobile)||void 0===N?void 0:null===(L=N.errorModal)||void 0===L?void 0:L.message)||"",buttonLabel:(null==i?void 0:null===(x=i.portabilitymobile)||void 0===x?void 0:null===(O=x.errorModal)||void 0===O?void 0:O.buttonLabel)||""},numberError:{title:(null==i?void 0:null===(M=i.portabilitymobile)||void 0===M?void 0:null===(P=M.errorNumber)||void 0===P?void 0:P.title)||"",description:(null==i?void 0:null===(D=i.portabilitymobile)||void 0===D?void 0:null===(k=D.errorNumber)||void 0===k?void 0:k.message)||"",buttonLabel:(null==i?void 0:null===(w=i.portabilitymobile)||void 0===w?void 0:null===(B=w.errorNumber)||void 0===B?void 0:B.buttonLabel)||""}}};var a2=e=>{let{handleOnChangeEnableGoNext:i}=e,n=(0,I.useQueryClient)(),{currentStepKey:o,simOptions:l,portability:t,portabilityStatus:r,isModalButtonSticky:d,product:a,checkoutErrors:u,ICCID:s,setSimOptions:v,setSlidesGoBack:c,setSimTypeSelectedOption:p,setPortabilityStatus:g,setCheckoutStepState:b}=(0,E.Mg)(),[y,C]=(0,m.useState)(!1),_=(0,f.f)("releaseResource"),S=(0,eC.CA)(eC.Jn,f.b.CMS_GET_GENERIC_ERROR_MOBILE),T=a1((0,eC.CA)(eC.Jn,f.b.CMS_GET_PERSONAL_DATA_MOBILE),(0,eC.CA)(eC.Jn,f.b.CMS_GET_PORTABILITY_MOBILE));or({flowEnabler:y});let A=()=>{var e,i;(0,ef.Fk)({event_name:"ui_interaction",event_label_track:"e-sim option ".concat((null==l?void 0:null===(i=l.simOptions)||void 0===i?void 0:null===(e=i.find(e=>null==e?void 0:e.selection))||void 0===e?void 0:e.value)||""),event_category:"users",event_action:"click",tracking_type:"link"})};return(0,m.useEffect)(()=>{null==i||i(!(null==r?void 0:r.isLoadingCheck))},[null==r?void 0:r.isLoadingCheck]),(0,m.useEffect)(()=>{let e=document.getElementById("sticky-offer-next");return null==e||e.addEventListener("click",A),()=>{null==e||e.removeEventListener("click",A)}},[l]),(0,m.useEffect)(()=>{y&&C(!1)},[y]),(0,m.useEffect)(()=>{if(null==r?void 0:r.isErrorCheck){var e,i,l,v,p,m,g,E,h,b,y,C,_,I,A,R,L,N,O;let x=()=>{c(3)},P=(0,eS.nQ)("checkPortInFeasibilityII",{status:"200",url:f.b.CHECK_IN_PORT,statusText:"failure"},"failure",null==r?void 0:r.errorMessage,"check portin failure winback",!1,{body:{currentPlanType:(null==t?void 0:null===(e=t.portabilityMigration)||void 0===e?void 0:e.currentPlan)||"",currentServiceProviderId:(null==t?void 0:null===(i=t.portabilityMigration)||void 0===i?void 0:i.currentProvider)||"",currentServiceProviderIdName:(null==t?void 0:null===(l=t.portabilityMigration)||void 0===l?void 0:l.currentProvider)||"",msisdn:t.portabilityNumber||"",isSimAvailable:s&&(null==s?void 0:s.trim())!==""?"true":"false",transferRemainingBalance:String(null==t?void 0:null===(v=t.portabilityMigration)||void 0===v?void 0:v.transferBalance),simCardNumber:(null==s?void 0:s.trim())||""},response:{...null==r?void 0:r.portInData}});switch(null==r?void 0:r.errorMessage){case e_.S.NUMBER_ERROR:null==u||null===(h=u.showAndTrackError)||void 0===h||h.call(u,S,x,P,null==T?void 0:null===(p=T.numberError)||void 0===p?void 0:p.title,null==T?void 0:null===(m=T.numberError)||void 0===m?void 0:m.description,x,null==T?void 0:null===(g=T.numberError)||void 0===g?void 0:g.buttonLabel,()=>{var e;return(0,eb.x)(n,(null==a?void 0:null===(e=a.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",a,x,o,P)},(null==a?void 0:a.removeCTC)?void 0:null==a?void 0:null===(E=a.genericErrorCallMeNow)||void 0===E?void 0:E.label,d);break;case e_.S.MIGRATION_CODE_ERROR:null==u||null===(I=u.showAndTrackError)||void 0===I||I.call(u,S,x,P,null==T?void 0:null===(b=T.migrationCodeError)||void 0===b?void 0:b.title,null==T?void 0:null===(y=T.migrationCodeError)||void 0===y?void 0:y.description,x,null==T?void 0:null===(C=T.migrationCodeError)||void 0===C?void 0:C.buttonLabel,()=>{var e;return(0,eb.x)(n,(null==a?void 0:null===(e=a.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",a,x,o,P)},(null==a?void 0:a.removeCTC)?void 0:null==a?void 0:null===(_=a.genericErrorCallMeNow)||void 0===_?void 0:_.label,d);break;default:null==u||null===(O=u.showAndTrackError)||void 0===O||O.call(u,S,x,P,null==T?void 0:null===(A=T.genericsError)||void 0===A?void 0:A.title,null==T?void 0:null===(R=T.genericsError)||void 0===R?void 0:R.description,x,null==T?void 0:null===(L=T.genericsError)||void 0===L?void 0:L.buttonLabel,()=>{var e;return(0,eb.x)(n,(null==a?void 0:null===(e=a.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",a,x,o,P)},(null==a?void 0:a.removeCTC)?void 0:null==a?void 0:null===(N=a.genericErrorCallMeNow)||void 0===N?void 0:N.label,d)}}},[null==r?void 0:r.isErrorCheck]),(0,m.useEffect)(()=>{(null==t?void 0:t.portabilityWant)&&g({...r,isStartPortIn:!0})},[t]),(0,m.useEffect)(()=>{let e=l.simOptions.find(e=>e.selection);null==i||i(!!e),_||C(!0)},[]),(0,m.useEffect)(()=>{b(h.v9.SIM_TYPE_SELECTION_CARD_WINBACK,{})},[]),{organizedDataForSim:T,handleSelect:e=>{var i,n;if(!e)return;let o=(0,f.f)("modifyMobileSimDeviceId"),t=null==l?void 0:null===(i=l.simOptions)||void 0===i?void 0:i.find(i=>i.value===e.value);!t||(null==t?void 0:t.id)===(null==o?void 0:o.simOptionId)||(null==r?void 0:r.isLoadingCheck)||p(t),v({...l,simOptions:null==l?void 0:null===(n=l.simOptions)||void 0===n?void 0:n.map(i=>i.value===(null==e?void 0:e.value)?{...i,selection:!0}
1:{...i,selection:!1})})},getSelectedItem:()=>{var e;let i=null==l?void 0:null===(e=l.simOptions)||void 0===e?void 0:e.find(e=>e.selection);return{title:(null==i?void 0:i.title)||"",value:(null==i?void 0:i.value)||""}},portabilityStatus:r,trackOpenModal:()=>{var e;(0,ef.Fk)({event_name:"ui_interaction",event_label_track:"e-sim option ".concat(null==T?void 0:null===(e=T.modalInfo)||void 0===e?void 0:e.textLink),event_category:"users",event_action:"click",tracking_type:"link"})},simOptions:l}};let a5=lu.ZP.div.withConfig({componentId:"sc-e30092d6-0"})(["padding-top:3.75rem;width:85%;margin:0 auto;"]),a3=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("portability","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step4.1"],event_label:"number portability",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"number portability"),(0,S.q)(n),null}),a6=(e,i)=>{var n,o,l,t;let r=new DOMParser,d=(null==e?void 0:null===(n=e.find(e=>e.id===i))||void 0===n?void 0:n.value)||"",a=r.parseFromString((null===(o=(0,b.q)([d||""]))||void 0===o?void 0:o[0])||"","text/html");return(null==a?void 0:null===(t=a.body)||void 0===t?void 0:null===(l=t.textContent)||void 0===l?void 0:l.replace("\n",""))||""},a4=e=>{var i,n,o,l,t,r,d,a,u,s,v,c;return{title:(null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.telephone)||void 0===i?void 0:i.title)||"",description:(null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.telephone)||void 0===o?void 0:o.description)||"",label:(null==e?void 0:null===(r=e.portabilitymobile)||void 0===r?void 0:null===(t=r.selectInput)||void 0===t?void 0:t.telephone)||"",disclaimer:(null==e?void 0:null===(a=e.portabilitymobile)||void 0===a?void 0:null===(d=a.telephone)||void 0===d?void 0:d.disclaimer)||"",validationMessage:{phoneNumber:{required:a6(null==e?void 0:null===(u=e.editorialconfigs)||void 0===u?void 0:u.elements,"phoneNumberRequired")||"Inserire un numero di telefono valido",minumum:a6(null==e?void 0:null===(s=e.editorialconfigs)||void 0===s?void 0:s.elements,"phoneNumberMin")||"Inserire un numero di telefono valido",maximum:a6(null==e?void 0:null===(v=e.editorialconfigs)||void 0===v?void 0:v.elements,"phoneNumberMax")||"Inserire un numero di telefono valido",matches:a6(null==e?void 0:null===(c=e.editorialconfigs)||void 0===c?void 0:c.elements,"phoneNumberMatches")||"Inserire un numero di telefono valido"}}}},a7=e=>{var i,n,o,l,t,r;return{titleError:(null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.errorModal)||void 0===i?void 0:i.title)||"",messageError:(null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.errorModal)||void 0===o?void 0:o.message)||"",buttonLabelError:(null==e?void 0:null===(r=e.portabilitymobile)||void 0===r?void 0:null===(t=r.errorModal)||void 0===t?void 0:t.buttonLabel)||""}},a9=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p;let{handleOnChangeEnableGoNext:f,handleGoPrevSlide:g,handleOnClose:b}=e,y=(0,I.useQueryClient)(),{currentStepKey:C,portability:_,cartAsyncInfo:S,isModalButtonSticky:A,customerFlow:R,checkoutErrors:L,product:N,setPortability:O,setCurrentStepKey:x,setIsValidNumberPortability:P,setBillingAddress:M,setShippingAddress:k,setSlidesGoBack:D,setIsStartCustomerFlow:B,setCheckoutStepState:w}=(0,E.Mg)(),j=null==N?void 0:N.isWinback,U=null==N?void 0:N.isRequiredPortability,{buttonGenericError:F,urlGenericErrorCallMeNow:G}=(0,eS.S6)(N),z=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),{errorcomponent:V}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_RECURRENT_ORDER_ERROR_MOBILE)||{},{blacklist:Y}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_DIGITAL_BUNDLE_OPERATORS)||{},H=(null==V?void 0:V.errors)||[],{errorcomponent:Z}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_CUSTOMER_ERROR_MOBILE)||{},Q=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_STEPPER_COMMON_LABELS_MOBILE),{goBackInStepper:W}=(0,oE.j)(Q),K=[...H,...(null==Z?void 0:Z.errors)||[]],J=null==S?void 0:null===(i=S.simTypeSelection)||void 0===i?void 0:i.isLoading,q=(null==R?void 0:null===(n=R.postCustomer)||void 0===n?void 0:n.isLoading)||(null==R?void 0:null===(o=R.patchCustomer)||void 0===o?void 0:o.isLoading)||(null==R?void 0:null===(l=R.customerInfo)||void 0===l?void 0:l.isLoading)||(null==R?void 0:null===(t=R.associateCustomer)||void 0===t?void 0:t.isLoading),X=(null==R?void 0:null===(r=R.postCustomer)||void 0===r?void 0:r.isSuccess)||(null==R?void 0:null===(d=R.patchCustomer)||void 0===d?void 0:d.isSuccess),$=(null==R?void 0:null===(a=R.postCustomer)||void 0===a?void 0:a.isError)||(null==R?void 0:null===(u=R.patchCustomer)||void 0===u?void 0:u.isError)||(null==R?void 0:null===(s=R.associateCustomer)||void 0===s?void 0:s.isError),ee=(null==R?void 0:null===(v=R.postCustomer)||void 0===v?void 0:v.error)||(null==R?void 0:null===(c=R.patchCustomer)||void 0===c?void 0:c.error)||(null==R?void 0:null===(p=R.associateCustomer)||void 0===p?void 0:p.error),ei=j?n7.bl.CMS_GET_WINBACK_DATA:n7.bl.CMS_GET_PORTABILITY_MOBILE,en=(0,eC.CA)(eC.Jn,ei),{title:eo,description:el,label:et,disclaimer:er,validationMessage:ed}=a4(en),{titleError:ea,messageError:eu}=a7(en),{isLoading:es,isError:ev,error:ec}=oy(en.portabilitymobile.operatorList,en.portabilitymobile.operatorsOrder,null==Y?void 0:Y.elements),{data:ep,isSuccess:em,isLoading:eg,isError:eE,errorMessage:eh}=os({onConfirmAddress:!0});or({flowEnabler:X});let ey=()=>
1{if(null==_?void 0:_.portabilityNumber){let e=_.portabilityNumber.match(oc.Sz.mobilePhoneNumber);null==f||f(!!e)}};return(0,m.useEffect)(()=>{if($){var e,i,n;let o=(0,T.Tz)(K,(null==ee?void 0:ee.errorCode)||"",{title:(null==z?void 0:null===(e=z.genericerror)||void 0===e?void 0:e.title)||"Ops",description:(null==z?void 0:null===(i=z.genericerror)||void 0===i?void 0:i.description)||""});(0,ef.Fk)({event_name:"page_error",page_error:"".concat(null==ee?void 0:ee.errorType,"| ").concat(null==ee?void 0:ee.errorMessage," | ").concat(o.message),event_category:"error",page_error_code:null==ee?void 0:ee.errorType,page_type:"error page"});let l=()=>{var e;switch(null==R||null===(e=R.resetPatchAndPost)||void 0===e||e.call(R,R),null==ee?void 0:ee.errorCode){case e_.S.CREATE_CUSTOMER_FISCAL_CODE_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_DOCUMENT_ALREADY_PRESENT:D(2);break;case e_.S.CREATE_CUSTOMER_MISSING_NATION_ADDRESS:D(3);break;case e_.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT:D(2);break;case e_.S.ASSOCIATE_CUSTOMER_BLOCKED:(null==o?void 0:o.isPopup)?(0,eb.x)(y,(null==o?void 0:o.url)||G,N,()=>{b&&b()},C,ee):b&&b();break;default:b&&b()}};null==L||null===(n=L.showAndTrackError)||void 0===n||n.call(L,{genericerror:{title:(null==o?void 0:o.title)||"",description:(null==o?void 0:o.message)||"",buttonLabel:(null==o?void 0:o.actionText)||"Ti chiamiamo noi"}},l,ee,"","",()=>l(),"")}},[$]),(0,m.useEffect)(()=>{em&&ep&&(M(ep),k(ep),B(!0))},[em,ep]),(0,m.useEffect)(()=>{if(eE){var e,i;let n=()=>{null==g||g()},o=(0,eS.nQ)("address",{url:"validateAddress",status:"500",statusText:"500"});null==L||null===(i=L.showAndTrackError)||void 0===i||i.call(L,z,n,o,void 0,eh,n,W||"Torna indietro",()=>{var e;return(0,eb.x)(y,(null==N?void 0:null===(e=N.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",N,n,C,o)},(null==N?void 0:N.removeCTC)?void 0:null==N?void 0:null===(e=N.genericErrorCallMeNow)||void 0===e?void 0:e.label,A,!0)}},[eE]),(0,m.useEffect)(()=>{if(ev){var e;let i=()=>{g&&g()};null==L||null===(e=L.showAndTrackError)||void 0===e||e.call(L,z,i,(0,eS.nQ)("portininfo",ec),ea,eu,i,W||"Torna indietro",()=>(0,eb.x)(y,G,N,i,C,(0,eS.nQ)("portininfo",ec)),(null==N?void 0:N.removeCTC)?void 0:F,A,!0)}},[ev]),(0,m.useEffect)(()=>{ey()},[_]),(0,m.useEffect)(()=>{x(h.Bf.PORTABILITY_NUMBER),w(h.v9.PORTABILITY_NUMBER_PORTABILITY_REQUIRED_CARD,{}),ey(),U&&localStorage.setItem("portability","1")},[]),{title:eo,description:el,label:et,disclaimer:er,validationMessage:ed,portability:_,isLoading:es||q||eg||J,isWinBackProduct:j,onChangeData:e=>{P(!1),O({...nQ.XM,portabilityWant:!!U||_.portabilityWant,portabilityNumber:e||""})}}},a8=lu.ZP.div.withConfig({componentId:"sc-e30092d6-0"})(["padding-top:3.75rem;width:85%;margin:0 auto;"]),ue=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("portability","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step4.1"],event_label:"number portability",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"number portability"),(0,S.q)(n),null}),ui=(e,i)=>{var n,o,l,t;let r=new DOMParser,d=(null==e?void 0:null===(n=e.find(e=>e.id===i))||void 0===n?void 0:n.value)||"",a=r.parseFromString((null===(o=(0,b.q)([d||""]))||void 0===o?void 0:o[0])||"","text/html");return(null==a?void 0:null===(t=a.body)||void 0===t?void 0:null===(l=t.textContent)||void 0===l?void 0:l.replace("\n",""))||""},un=e=>{var i,n,o,l,t,r,d,a,u,s;return{title:(null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.telephone)||void 0===i?void 0:i.title)||"",description:(null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.telephone)||void 0===o?void 0:o.description)||"",label:(null==e?void 0:null===(r=e.portabilitymobile)||void 0===r?void 0:null===(t=r.selectInput)||void 0===t?void 0:t.telephone)||"",validationMessage:{phoneNumber:{required:ui(null==e?void 0:null===(d=e.editorialconfigs)||void 0===d?void 0:d.elements,"ph
1oneNumberRequired")||"Inserire un numero di telefono valido",minumum:ui(null==e?void 0:null===(a=e.editorialconfigs)||void 0===a?void 0:a.elements,"phoneNumberMin")||"Inserire un numero di telefono valido",maximum:ui(null==e?void 0:null===(u=e.editorialconfigs)||void 0===u?void 0:u.elements,"phoneNumberMax")||"Inserire un numero di telefono valido",matches:ui(null==e?void 0:null===(s=e.editorialconfigs)||void 0===s?void 0:s.elements,"phoneNumberMatches")||"Inserire un numero di telefono valido"}}}},uo=e=>{var i,n,o,l;return{titleError:(null==e?void 0:null===(n=e.portabilitymobile)||void 0===n?void 0:null===(i=n.errorModal)||void 0===i?void 0:i.title)||"",messageError:(null==e?void 0:null===(l=e.portabilitymobile)||void 0===l?void 0:null===(o=l.errorModal)||void 0===o?void 0:o.message)||""}},ul=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p;let{handleOnChangeEnableGoNext:f,handleGoPrevSlide:g,handleOnClose:b}=e,y=(0,I.useQueryClient)(),{currentStepKey:C,portability:_,isModalButtonSticky:S,product:A,customerFlow:R,checkoutErrors:L,setSlidesGoBack:N,setIsStartCustomerFlow:O,setShippingAddress:x,setBillingAddress:P,setPortability:M,setCurrentStepKey:k,setIsValidNumberPortability:D,setCheckoutStepState:B}=(0,E.Mg)(),{data:w,isSuccess:j,isLoading:U,isError:F,errorMessage:G}=os({onConfirmAddress:!0}),z=(null==R?void 0:null===(i=R.postCustomer)||void 0===i?void 0:i.isLoading)||(null==R?void 0:null===(n=R.patchCustomer)||void 0===n?void 0:n.isLoading)||(null==R?void 0:null===(o=R.customerInfo)||void 0===o?void 0:o.isLoading)||(null==R?void 0:null===(l=R.associateCustomer)||void 0===l?void 0:l.isLoading),V=(null==R?void 0:null===(t=R.postCustomer)||void 0===t?void 0:t.isSuccess)||(null==R?void 0:null===(r=R.patchCustomer)||void 0===r?void 0:r.isSuccess)&&(null==R?void 0:null===(d=R.associateCustomer)||void 0===d?void 0:d.isSuccess),Y=(null==R?void 0:null===(a=R.postCustomer)||void 0===a?void 0:a.isError)||(null==R?void 0:null===(u=R.patchCustomer)||void 0===u?void 0:u.isError)||(null==R?void 0:null===(s=R.associateCustomer)||void 0===s?void 0:s.isError),H=(null==R?void 0:null===(v=R.postCustomer)||void 0===v?void 0:v.error)||(null==R?void 0:null===(c=R.patchCustomer)||void 0===c?void 0:c.error)||(null==R?void 0:null===(p=R.associateCustomer)||void 0===p?void 0:p.error),Z=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),Q=(null==A?void 0:A.isRequiredPortability)||(null==A?void 0:A.isWinbackLegacy),{buttonGenericError:W,urlGenericErrorCallMeNow:K}=(0,eS.S6)(A),J=n7.bl.CMS_GET_WINBACK_DATA,q=(0,eC.CA)(eC.Jn,J),{blacklist:X}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_DIGITAL_BUNDLE_OPERATORS)||{},{title:$,description:ee,label:ei,validationMessage:en}=un(q),{titleError:eo,messageError:el}=uo(q),{errorcomponent:et}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_RECURRENT_ORDER_ERROR_MOBILE)||{},er=(null==et?void 0:et.errors)||[],{errorcomponent:ed}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_CUSTOMER_ERROR_MOBILE)||{},ea=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_STEPPER_COMMON_LABELS_MOBILE),{goBackInStepper:eu}=(0,oE.j)(ea),es=[...er,...(null==ed?void 0:ed.errors)||[]],{isLoading:ev,isError:ec,isSuccess:ep,error:em}=oy(q.portabilitymobile.operatorList,q.portabilitymobile.operatorsOrder,null==X?void 0:X.elements),eg=()=>{if(null==_?void 0:_.portabilityNumber){let e=_.portabilityNumber.match(oc.Sz.mobilePhoneNumber);null==f||f(!!e&&ep&&!U&&V)}};return(0,m.useEffect)(()=>{null==f||f(ep&&!U&&V)},[ev,U,z,V]),(0,m.useEffect)(()=>{j&&w&&(P(w),x(w),O(!0))},[j,w]),(0,m.useEffect)(()=>{if(F){var e,i;let n=()=>{null==g||g()},o=(0,eS.nQ)("address",{url:"validateAddress",status:"500",statusText:"500"});null==L||null===(i=L.showAndTrackError)||void 0===i||i.call(L,Z,n,o,void 0,G,n,eu||"Torna indietro",()=>{var e;return(0,eb.x)(y,(null==A?void 0:null===(e=A.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",A,n,C,o)},(null==A?void 0:A.removeCTC)?void 0:null==A?void 0:null===(e=A.genericErrorCallMeNow)||void 0===e?void 0:e.label,S,!0)}},[F]),(0,m.useEffect)(()=>{if(ec){var e;let i=()=>{g&&g()};null==L||null===(e=L.showAndTrackError)||void 0===e||e.call(L,Z,i,(0,eS.nQ)("portininfo",em),eo,el,i,eu||"Torna indietro",()=>(0,eb.x)(y,K,A,i,C,(0,eS.nQ)("portininfo",em)),(null==A?void 0:A.removeCTC)?void 0:W,S,!0)}},[ec]),(0,m.useEffect)(()=>
1{if(Y){var e,i,n;let o=(0,T.Tz)(es,(null==H?void 0:H.errorCode)||"",{title:(null==Z?void 0:null===(e=Z.genericerror)||void 0===e?void 0:e.title)||"Ops",description:(null==Z?void 0:null===(i=Z.genericerror)||void 0===i?void 0:i.description)||""});(0,ef.Fk)({event_name:"page_error",page_error:"".concat(null==H?void 0:H.errorType,"| ").concat(null==H?void 0:H.errorMessage," | ").concat(o.message),event_category:"error",page_error_code:null==H?void 0:H.errorType,page_type:"error page"});let l=()=>{var e;switch(null==R||null===(e=R.resetPatchAndPost)||void 0===e||e.call(R,R),null==H?void 0:H.errorCode){case e_.S.CREATE_CUSTOMER_FISCAL_CODE_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_DOCUMENT_ALREADY_PRESENT:N(1);break;case e_.S.CREATE_CUSTOMER_MISSING_NATION_ADDRESS:N(2);break;case e_.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT:N(3);break;case e_.S.ASSOCIATE_CUSTOMER_BLOCKED:(null==o?void 0:o.isPopup)?(0,eb.x)(y,(null==o?void 0:o.url)||K,A,()=>{b&&b()},C,H):b&&b();break;default:b&&b()}};null==L||null===(n=L.showAndTrackError)||void 0===n||n.call(L,{genericerror:{title:(null==o?void 0:o.title)||"",description:(null==o?void 0:o.message)||"",buttonLabel:(null==o?void 0:o.actionText)||"Ti chiamiamo noi"}},l,H,"","",()=>l(),"")}},[Y]),(0,m.useEffect)(()=>{eg()},[_]),(0,m.useEffect)(()=>{k(h.Bf.PORTABILITY_NUMBER),B(h.v9.PORTABILITY_NUMBER_CARD_WINBACK,{}),eg(),Q&&localStorage.setItem("portability","1")},[]),{title:$,description:ee,label:ei,validationMessage:en,portability:_,isLoadingPortInfo:ev,isLoadingAddress:U,isLoadingCustomer:z,onChangeData:e=>{D(!1),M({...nQ.XM,portabilityWant:!!Q||_.portabilityWant,portabilityNumber:e||""})}}};var ut=n(3187);let ur="voucherCode",ud=e=>({[ur]:{minLength:{value:3,message:e||""}}}),ua=()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("voucher input","mobile",e),{trackView:n}=(0,i3.r)({event:["checkout_step8.2"],event_label:"insert voucher",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"voucher input"),null},uu=()=>{var e,i,n,o;let{setVoucher:l,setConfiguredStickyStepperLabel:t,setIsLoadingGoNext:r,voucher:d,product:{vouchers:a}}=(0,E.Mg)(),u=(0,ut.CA)(ut.Jn,iO.b.CMS_GET_MOBILE_VOUCHERS),s=(0,ut.Dt)(u);ua();let{register:v,formState:{isValid:c,errors:p},watch:f,setError:g}=(0,L.cI)({mode:"all",defaultValues:{[ur]:localStorage.getItem("voucherId")||((null==a?void 0:a.enableAutoApply)?null==a?void 0:a.voucherToApply:"")}}),h=f(ur),b=()=>{var e,i;(0,iO.d)(null==s?void 0:null===(i=s.voucherstwilight)||void 0===i?void 0:null===(e=i.insertion)||void 0===e?void 0:e.skipLabel)};return(0,m.useEffect)(()=>{var e,i,n;null===(e=d.resetData)||void 0===e||e.call(d),t(null==s?void 0:null===(n=s.voucherstwilight)||void 0===n?void 0:null===(i=n.insertion)||void 0===i?void 0:i.skipLabel);let o=document.getElementById("sticky-offer-next");return localStorage.removeItem("voucherId"),null==o||o.addEventListener("click",b),()=>{t(""),null==o||o.removeEventListener("click",b)}},[]),(0,m.useEffect)(()=>{var e;(null==d?void 0:null===(e=d.validateVoucher)||void 0===e?void 0:e.isSuccess)&&((null==d?void 0:d.isExpiredVoucher)?g(ur,{type:"manual",message:s.voucherstwilight.insertion.expiredMessage}):(null==d?void 0:d.isInvalidVoucher)&&g(ur,{type:"manual",message:s.voucherstwilight.insertion.invalidMessage}))},[null==d?void 0:null===(e=d.validateVoucher)||void 0===e?void 0:e.isSuccess]),(0,m.useEffect)(()=>{var e;(null==d?void 0:null===(e=d.validateVoucher)||void 0===e?void 0:e.isError)&&g(ur,{type:"manual",message:s.voucherstwilight.insertion.invalidMessage})},[null==d?void 0:null===(i=d.validateVoucher)||void 0===i?void 0:i.isError]),(0,m.useEffect)(()=>{var e;r((null==d?void 0:null===(e=d.validateVoucher)||void 0===e?void 0:e.isLoading)||!1)},[null==d?void 0:null===(n=d.validateVoucher)||void 0===n?void 0:n.isLoading]),{voucherCms:s,errors:p,handleClick:()=>{l({...d,voucherId:h})},isLoading:null==d?void 0:null===(o=d.validateVoucher)||void 0===o?void 0:o.isLoading,isValid:c,register:v,watch:f}};function us(){let e=(0,D._)(["\n    margin: "," ",";\n  "]);return us=function(){return e},e}function uv(){let e=(0,D._)(["\n    margin: "," ",";\n  "]);return uv=function(){return e},e}function uc(){let e=(0,D._)(["\n  margin: "," "," ","; \n\n  ","\n\n  ","\n\n  button {\n    margin-top: ",";\n  }\n"]);return uc=function(){return e},e}function up(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n    margin-top: ","; \n  "]);return up=function(){return e},e}function um(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return um=function(){return e},e}function uf(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n  font-size: ","; \n  line-height: ","; \n  margin-top: ",";\n\n  ","\n\n  ","\n"]);return uf=function(){return e},e}function ug(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: ",";\n  "]);return ug=function(){return e},e}function uE(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n  font-size: ",";\n  line-height: ",";\n  margin: 0 0 ","; \n\n  ","\n"]);return uE=function(){return e},e}function uh(){let e=(0,D._)(["\n    div {\n      left: 155px;\n    }\n  "]);return uh=function(){return e},e}function ub(){let e=(0,D._)(["\n  position: absolute;\n\n  div {\n    position: relative;\n    left: 120px;\n    top: 11px;\n\n    svg {\n      width: 25px;\n    }\n  }\n\n  ","\n"]);return ub=function(){return e},e}let uy=B.Z.section(uc(),w.r.spacing.xl,w.r.spacing.lg,w.r.spacing.md,w.B.tablet(us(),w.r.spacing.xl,w.r.spacing.xl),w.B.desktop(uv(),w.r.spacing.xl,w.r.spacing["2xl"]),w.r.spacing.xl),uC=B.Z.h2(uf(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.h2,w.r.typography.lineHeight.h2,w.r.spacing.xl,w.B.tablet(up(),w.r.typography.fontSize.h1,w.r.typography.lineHeight.h1,w.r.spacing["3xl"]),w.B.desktop(um(),w.r.typography.fontSize.h1,w.r.typography.lineHeight.h1)),u_=B.Z.p(uE(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.typography.fontSize.body1,w.r.typography.lineHeight.body1,w.r.spacing.xl,w.B.tablet(ug(),w.r.typography.fontSize.body1,w.r.typography.lineHeight.body1)),uS=B.Z.div(ub(),w.B.tablet(uh()));var uI=n(41745),uT=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,f,g,E;let{handleOnChangeEnableGoNext:h}=e,{voucherCms:b,handleClick:y,errors:C,register:_,isLoading:S}=uu(),I=ud(null==b?void 0:null===(n=b.voucherstwilight)||void 0===n?void 0:null===(i=n.validationMinLength)||void 0===i?void 0:i.message);return(0,m.useEffect)(()=>{null==h||h(!S)},[S]),(0,p.jsxs)(uy,{children:[(null==b?void 0:null===(l=b.voucherstwilight)||void 0===l?void 0:null===(o=l.insertion)||void 0===o?void 0:o.title)&&(0,p.jsx)(uC,{children:null==b?void 0:null===(r=b.voucherstwilight)||void 0===r?void 0:null===(t=r.insertion)||void 0===t?void 0:t.t
1itle}),(null==b?void 0:null===(a=b.voucherstwilight)||void 0===a?void 0:null===(d=a.insertion)||void 0===d?void 0:d.message)&&(0,p.jsx)(u_,{children:null==b?void 0:null===(s=b.voucherstwilight)||void 0===s?void 0:null===(u=s.insertion)||void 0===u?void 0:u.message}),(0,p.jsx)(uI.Z,{error:null==C?void 0:null===(v=C.voucherCode)||void 0===v?void 0:v.message,label:null==b?void 0:null===(f=b.voucherstwilight)||void 0===f?void 0:null===(c=f.insertion)||void 0===c?void 0:c.inputName,disabled:S,..._(ur,I[ur])}),(0,p.jsxs)(tY.z,{disabled:S,variant:(0,ne.k)()?"mva:primary":"primary",onClick:y,children:[null==b?void 0:null===(E=b.voucherstwilight)||void 0===E?void 0:null===(g=E.insertion)||void 0===g?void 0:g.buttonLabel,S&&(0,p.jsx)(uS,{children:(0,p.jsx)(eM.Z,{})})]})]})},uA=n(8013);let uR=()=>{var e,i;let{voucher:n}=(0,E.Mg)(),o=(0,I.useQueryClient)(),l=(0,T.De)("voucher typ","mobile",o),t={event:["checkout_step8.3"],event_label:"voucher applied",opts:null==l?void 0:l.opts,cartProduct:null==l?void 0:l.trackingProduct,pageProduct:null==l?void 0:l.pageProductsInfo,product_discount_value:null==n?void 0:null===(i=n.validateVoucher)||void 0===i?void 0:null===(e=i.data)||void 0===e?void 0:e.finalPrice,transaction_coupon_code:(null==n?void 0:n.voucherId)||"",visitorTrackingOpts:(0,T.bG)()},{trackWithNewDatalayer:r}=(0,i3.r)({...t,disableInitialTrack:!0});return(0,m.useEffect)(()=>{var e;(null==n?void 0:null===(e=n.shoppingCart)||void 0===e?void 0:e.isSuccess)&&r({...t})},[n]),null};var uL=n(83157);let uN=()=>localStorage.getItem(uL.R),uO=()=>localStorage.setItem(uL.R,"1"),ux=e=>{var i,n,o,l,t,r,d,a,u,s,v,c,p,f,g,h,y;let{handleOnChangeEnableGoNext:C,handleGoNextSlide:_}=e,{checkoutErrors:S,voucher:I,product:T,setIsLoadingGoNext:A,setConfiguredStickyStepperLabel:R,setVoucher:L,setProduct:N,setIsDisabledBackButton:O}=(0,E.Mg)();uR();let x=(0,ut.CA)(ut.Jn,iO.b.CMS_GET_MOBILE_VOUCHERS),P=(0,ut.Dt)(x,I.voucherId),M=(0,ut.CA)(ut.Jn,iO.b.CMS_GET_GENERIC_ERROR_MOBILE),k=(null===(i=(0,b.q)([(null==T?void 0:null===(n=T.vouchers)||void 0===n?void 0:n.message)||""]))||void 0===i?void 0:i[0])||"",D=(null===(o=(0,b.q)([(null==T?void 0:null===(l=T.vouchers)||void 0===l?void 0:l.messageHtml)||""]))||void 0===o?void 0:o[0])||k||"",B=(null===(t=(0,b.q)([(null==T?void 0:null===(r=T.vouchers)||void 0===r?void 0:r.description)||""]))||void 0===t?void 0:t[0])||"",w=(null===(d=(0,b.q)([(null==T?void 0:null===(a=T.vouchers)||void 0===a?void 0:a.descriptionHtml)||""]))||void 0===d?void 0:d[0])||B||"",j=e=>{var i;e.stopPropagation(),(null==I?void 0:null===(i=I.validateVoucher)||void 0===i?void 0:i.isSuccess)&&!(null==I?void 0:I.isAppliedVoucher)&&(null==C||C(!1),O(!0),L({...I,isApplyVoucher:!0}))},U=e=>{if(!(null==I?void 0:I.isAppliedVoucher)){var i;e.stopPropagation(),null==I||null===(i=I.resetData)||void 0===i||i.call(I)}},F=()=>{var e,i,n,o,l,t,r,d,a;if((null==I?void 0:null===(e=I.voucher)||void 0===e?void 0:e.isError)||(null==I?void 0:null===(i=I.shoppingCart)||void 0===i?void 0:i.isError)){let e=(null==I?void 0:null===(n=I.voucher)||void 0===n?void 0:n.error)||(null==I?void 0:null===(o=I.shoppingCart)||void 0===o?void 0:o.error),i=()=>{var e;return null==I?void 0:null===(e=I.resetData)||void 0===e?void 0:e.call(I)};null==S||null===(l=S.showAndTrackError)||void 0===l||l.call(S,M,i,e,"","",()=>i())}else(null==I?void 0:I.isAppliedVoucher)&&(null==C||C(!0),O(!1),uN()||(localStorage.setItem("tProd_backUp",JSON.stringify(T)),N({...T,...(0,dU.vn)(T,uA.Z.EDIT),voucherPromoLabel:null==T?void 0:null===(r=T.vouchers)||void 0===r?void 0:null===(t=r.codeApplied)||void 0===t?void 0:t.replace("$VOUCHER",(null==I?void 0:I.voucherId)||""),voucherPromoMessage:D,voucherPromoDetail:w,...(null==T?void 0:T.offerDetailsVoucher)&&(null==T?void 0:null===(d=T.offerDetailsVoucher)||void 0===d?void 0:d.length)>0&&{offerDetails:[...T.offerDetailsVoucher]},...(null==T?void 0:T.conditionsVoucher)&&(null==T?void 0:null===(a=T.conditionsVoucher)||void 0===a?void 0:a.length)>0&&{conditions:[...T.conditionsVoucher]},...(null==T?void 0:T.priceVoucher)&&{price:null==T?void 0:T.priceVoucher}
1,...(null==T?void 0:T.originalPriceVoucher)&&{originalPrice:null==T?void 0:T.originalPriceVoucher},...(null==T?void 0:T.priceActivationRecurringVoucher)&&{priceActivationRecurring:null==T?void 0:T.priceActivationRecurringVoucher},...(null==T?void 0:T.priceActivationVoucher)&&{priceActivation:null==T?void 0:T.priceActivationVoucher},...(null==T?void 0:T.priceRecurringVoucher)&&{priceRecurring:null==T?void 0:T.priceRecurringVoucher},...(null==T?void 0:T.subpriceActivationRecurringVoucher)&&{subpriceActivationRecurring:null==T?void 0:T.subpriceActivationRecurringVoucher},...(null==T?void 0:T.subpriceActivationVoucher)&&{subpriceActivation:null==T?void 0:T.subpriceActivationVoucher},...(null==T?void 0:T.subpriceActivationVoucher)&&{subpriceRecurring:null==T?void 0:T.subpriceRecurringVoucher},...(null==T?void 0:T.recurrenceVoucher)&&{recurrence:null==T?void 0:T.recurrenceVoucher},...(null==T?void 0:T.subpriceVoucher)&&{subprice:null==T?void 0:T.subpriceVoucher},...(null==T?void 0:T.descriptionVoucher)&&{description:null==T?void 0:T.descriptionVoucher},...(null==T?void 0:T.hasEmptySpaceVoucher)&&{hasEmptySpace:null==T?void 0:T.hasEmptySpaceVoucher},...(null==T?void 0:T.descriptionRecurringVoucher)&&{descriptionRecurring:null==T?void 0:T.descriptionRecurring},...(null==T?void 0:T.labelVoucher)&&{label:null==T?void 0:T.labelVoucher},...(null==T?void 0:T.topLabelStickyCheckout)&&{label:null==T?void 0:T.topLabelStickyCheckoutVoucher}}),uO(),null==_||_()))};return(0,m.useEffect)(()=>{F()},[I]),(0,m.useEffect)(()=>{var e,i;A((null==I?void 0:null===(e=I.voucher)||void 0===e?void 0:e.isLoading)||(null==I?void 0:null===(i=I.shoppingCart)||void 0===i?void 0:i.isLoading)||!1)},[null==I?void 0:null===(u=I.voucher)||void 0===u?void 0:u.isLoading,null==I?void 0:null===(s=I.shoppingCart)||void 0===s?void 0:s.isLoading]),(0,m.useEffect)(()=>{var e,i,n,o;R("");let l=document.getElementById("sticky-offer-next"),t=document.getElementById("back-button");return uN()||null==l||l.addEventListener("click",j),null==t||t.addEventListener("click",U),C&&C(!0),(0,iO.d)(null==P?void 0:null===(i=P.voucherstwilight)||void 0===i?void 0:null===(e=i.insertion)||void 0===e?void 0:e.buttonLabel,"users","click","ui interaction","link",(null==I?void 0:I.voucherId)||"",null==I?void 0:null===(o=I.validateVoucher)||void 0===o?void 0:null===(n=o.data)||void 0===n?void 0:n.finalPrice),()=>{null==l||l.removeEventListener("click",j),null==t||t.removeEventListener("click",U)}},[]),{title:uN()?(null==P?void 0:null===(c=P.voucherstwilight)||void 0===c?void 0:null===(v=c.success)||void 0===v?void 0:v.backTitle)||"":(null==P?void 0:null===(f=P.voucherstwilight)||void 0===f?void 0:null===(p=f.success)||void 0===p?void 0:p.title)||"",voucherCms:P,isLoading:(null==I?void 0:null===(g=I.voucher)||void 0===g?void 0:g.isLoading)||(null==I?void 0:null===(h=I.shoppingCart)||void 0===h?void 0:h.isLoading),discountTitle:(null==T?void 0:null===(y=T.vouchers)||void 0===y?void 0:y.discountTitle)||"",message:D}};function uP(){let e=(0,D._)(["\n    margin: 196px 40px; \n  "]);return uP=function(){return e},e}function uM(){let e=(0,D._)(["\n    margin: 202px 54px; \n  "]);return uM=function(){return e},e}function uk(){let e=(0,D._)(["\n  margin: 82px 20px; \n\n  ","\n\n  ","\n"]);return uk=function(){return e},e}function uD(){let e=(0,D._)(["\n    font-size: ","; \n   \n    line-height: ","; \n    margin: 0 0 ","; \n  "]);return uD=function(){return e},e}function uB(){let e=(0,D._)(["\n    margin: 0 0 ",";\n  "]);return uB=function(){return e},e}function uw(){let e=(0,D._)(["\n  font-family: ","; \n  font-weight: ","; \n\n  font-size: ",";\n  line-height: ",";\n  color: ",";\n  margin: 0 0 ","; \n\n  ","\n\n  ","\n"]);return uw=function(){return e},e}function uj(){let e=(0,D._)(["\n  \n    font-size: ",";\n    line-height: ",";\n  "]);return uj=function(){return e},e}function uU(){let e=(0,D._)(["\n  \n\n  font-family: ",";\n  font-weight: ",";\n  font-size: ",";\n  line-height: ",";\n  margin: 0 0 ",";\n\n  ","\n"]);return uU=function(){return e},e}function uF(){let e=(0,D._)(["\n    text-align: left;\n  "]);return uF=function(){return e},e}function uG(){let e=(0,D._)(["\n  border: 1px solid ",";\n  border-radius:  ","; \n  min-height: 100px; \n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n  padding: ","; \n  ","\n"]);return uG=function(){return e},e}function uz(){let e=(0,D._)(["\n\n  font-size: ",";\n  line-height: ",";\n  margin: 0;\n"]);return uz=function(){return e},e}function uV(){let e=(0,D._)(["\n    justify-content: flex-start;\n  "]);return uV=function(){return e},e}function uY(){let e=(0,D._)(["\n  align-items: flex-end;\n  justify-content: center;\n  display: flex;\n\n  ","\n"]);return uY=function(){return e},e}function uH(){let e=(0,D._)(["\n    font-size: ","; \n  "]);return uH=function(){return e},e}function uZ(){let e=(0,D._)(["\n    font-size: ","; \n  "]);return uZ=function(){return e},e}function uQ(){let e=(0,D._)(["\n  margin: "," 0 0; \n\n  ","\n\n  ","\n\n  p {\n    margin: 0;\n  }\n"]);return uQ=function(){return e},e}let uW=B.Z.div(uk(),w.B.tablet(uP()),w.B.desktop(uM())),uK=B.Z.h2(uw(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.h2,w.r.typography.lineHeight.h2,w.r.colors.text.brand,w.r.spacing.md,w.B.tablet(uD(),w.r.typography.fontSize.h1,w.r.typography.lineHeight.h1,w.r.spacing.lg),w.B.desktop(uB(),w.r.spacing.lg)),uJ=B.Z.h3(uU(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.h5,w.r.typography.lineHeight.h5,w.r.spacing.md,w.B.tablet(uj(),w.r.typography.fontSize.h5,w.r.typography.lineHeight.h5)),uq=B.Z.section(uG(),w.r.colors.border.default,w.r.radius.sm,w.r.spacing.md,w.B.tablet(uF())),uX=B.Z.h6(uz(),w.r.typography.fontSize.body1,w.r.typography.lineHeight.body1),u$=B.Z.div(uY(),w.B.tablet(uV())),u0=B.Z.div(uQ(),w.r.spacing.md,w.B.tablet(uH(),w.r.typography.fontSize.body2),w.B.desktop(uZ(),w.r.typography.fontSize.body1));var u1=e=>{var i,n,o,l,t;let{title:r,voucherCms:d,isLoading:a,discountTitle:u,message:s}=ux(e);return(0,p.jsxs)(uW,{children:[r&&(0,p.jsx)(uK,{dangerouslySetInnerHTML:{__html:r}}
1),(null==d?void 0:null===(i=d.voucherstwilight.success)||void 0===i?void 0:i.subtitle)&&(0,p.jsx)(uJ,{children:null==d?void 0:null===(n=d.voucherstwilight.success)||void 0===n?void 0:n.subtitle}),(0,p.jsxs)(uq,{children:[u&&(0,p.jsx)(uX,{children:u}),s&&(0,p.jsx)(u$,{children:(0,p.jsx)("div",{dangerouslySetInnerHTML:{__html:s}})})]}),a&&(null==d?void 0:null===(o=d.voucherstwilight.success)||void 0===o?void 0:o.loadingMessage)&&(0,p.jsx)(u0,{dangerouslySetInnerHTML:{__html:null==d?void 0:null===(t=d.voucherstwilight)||void 0===t?void 0:null===(l=t.success)||void 0===l?void 0:l.loadingMessage}})]})};let u2=()=>{var e,i;let{voucher:n,setCheckoutStepState:o}=(0,E.Mg)(),[l,t]=(0,m.useState)((null==n?void 0:null===(e=n.voucher)||void 0===e?void 0:e.isSuccess)&&(null==n?void 0:null===(i=n.shoppingCart)||void 0===i?void 0:i.isSuccess)&&!(null==n?void 0:n.isInvalidVoucher)&&!(null==n?void 0:n.isExpiredVoucher)||!1),r=()=>{var e;(null==n?void 0:null===(e=n.validateVoucher)||void 0===e?void 0:e.isSuccess)?(null==n?void 0:n.isExpiredVoucher)||(null==n?void 0:n.isInvalidVoucher)||t(!0):t(!1)};return(0,m.useEffect)(()=>{r()},[n]),(0,m.useEffect)(()=>{o(h.v9.VOUCHER_CARD,{})},[]),{isValidVoucher:l}},u5=e=>{var i,n,o,l,t,r,d,a,u,s,v,c;let{handleOnChangeEnableGoNext:p,handleGoPrevSlide:f,handleOnClose:g}=e,b=(0,I.useQueryClient)(),{currentStepKey:y,simOptions:C,customerDeliveryBaseInfo:_,isModalButtonSticky:S,product:A,checkoutErrors:R,customerFlow:L,cartAsyncInfo:N,setCurrentStepKey:O,setSlidesGoBack:x,setSimTypeSelectedOption:P,setSimOptions:M,setBillingAddress:k,setShippingAddress:D,setIsStartCustomerFlow:B,setIsDisabledBackButton:w,setCheckoutStepState:j}=(0,E.Mg)(),{urlGenericErrorCallMeNow:U}=(0,eS.S6)(A),F=(null==N?void 0:null===(i=N.simTypeSelection)||void 0===i?void 0:i.isLoading)||!1,G=(0,eC.CA)(eC.Jn,nY.bl.CMS_GET_GENERIC_ERROR_MOBILE),z=(0,eC.CA)(eC.Jn,nY.bl.CMS_GET_PERSONAL_DATA_MOBILE),V=(0,eC.CA)(eC.Jn,nY.bl.CMS_GET_PORTABILITY_MOBILE),Y=(0,tT.QY)(z,V),{errorcomponent:H}=(0,eC.CA)(eC.Jn,nY.bl.CMS_GET_RECURRENT_ORDER_ERROR_MOBILE)||{},Z=(null==H?void 0:H.errors)||[],{errorcomponent:Q}=(0,eC.CA)(eC.Jn,nY.bl.CMS_GET_CUSTOMER_ERROR_MOBILE)||{},W=[...Z,...(null==Q?void 0:Q.errors)||[]],K=(null==L?void 0:null===(n=L.postCustomer)||void 0===n?void 0:n.isLoading)||(null==L?void 0:null===(o=L.patchCustomer)||void 0===o?void 0:o.isLoading)||(null==L?void 0:null===(l=L.customerInfo)||void 0===l?void 0:l.isLoading)||(null==L?void 0:null===(t=L.associateCustomer)||void 0===t?void 0:t.isLoading),J=(null==L?void 0:null===(r=L.postCustomer)||void 0===r?void 0:r.isError)||(null==L?void 0:null===(d=L.patchCustomer)||void 0===d?void 0:d.isError)||(null==L?void 0:null===(a=L.customerInfo)||void 0===a?void 0:a.isError)||(null==L?void 0:null===(u=L.associateCustomer)||void 0===u?void 0:u.isError),q=(null==L?void 0:null===(s=L.postCustomer)||void 0===s?void 0:s.error)||(null==L?void 0:null===(v=L.patchCustomer)||void 0===v?void 0:v.error)||(null==L?void 0:null===(c=L.associateCustomer)||void 0===c?void 0:c.error),{data:X,isSuccess:$,isLoading:ee,isError:ei}=os({onConfirmAddress:!0}),en=()=>{var e,i;(0,nY.Fk)({event_name:"ui_interaction",event_label_track:"e-sim option ".concat((null==C?void 0:null===(i=C.simOptions)||void 0===i?void 0:null===(e=i.find(e=>null==e?void 0:e.selection))||void 0===e?void 0:e.value)||""),event_category:"users",event_action:"click",tracking_type:"link"})};return(0,m.useEffect)(()=>{$&&X&&(k(X),D(X),B(!0))},[$,X]),(0,m.useEffect)(()=>{if(J){var e,i,n;let o=(0,T.Tz)(W,(null==q?void 0:q.errorCode)||"",{title:(null==G?void 0:null===(e=G.genericerror)||void 0===e?void 0:e.title)||"",description:(null==G?void 0:null===(i=G.genericerror)||void 0===i?void 0:i.description)||""}),l=e=>{var i;switch(null==L||null===(i=L.resetPatchAndPost)||void 0===i||i.call(L,L),null==q?void 0:q.errorCode){case e_.S.CREATE_CUSTOMER_FISCAL_CODE_ALREADY_PRESENT:x(4);break;case e_.S.CREATE_CUSTOMER_DOCUMENT_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_MISSING_NATION_ADDRESS:(null==o?void 0:o.isPopup)&&e?(0,nY.xb)(b,(null==o?void 0:o.url)||U,A,()=>{g&&g()},y,q):x(2);break;case e_.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT:x(3);break;case e_.S.ASSOCIATE_CUSTOMER_BLOCKED:(null==o?void 0:o.isPopup)&&e?(0,nY.xb)(b,(null==o?void 0:o.url)||U,A,()=>{g&&g()},y,q):g&&g();break;default:g&&g()}};null==R||null===(n=R.showAndTrackError)||void 0===n||n.call(R,{genericerror:{title:(null==o?void 0:o.title)||"",description:(null==o?void 0:o.message)||"",buttonLabel:(null==o?void 0:o.actionText)||""}},l,q,"","",()=>l(!0),"")}},[J]),(0,m.useEffect)(()=>
1{if(ei){var e,i;let n=()=>{null==f||f()};null==R||null===(i=R.showAndTrackError)||void 0===i||i.call(R,G,n,(0,eS.nQ)("address",{url:"validateAddress",status:"500",statusText:"500"}),void 0,void 0,n,"Chiudi",()=>{var e;return(0,nY.xb)(b,(null==A?void 0:null===(e=A.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",A,n,y,q)},(null==A?void 0:A.removeCTC)?void 0:null==A?void 0:null===(e=A.genericErrorCallMeNow)||void 0===e?void 0:e.label,S,!0)}},[ei]),(0,m.useEffect)(()=>{w(K||ee||F)},[K,ee,F]),(0,m.useEffect)(()=>{let e=document.getElementById("sticky-offer-next");return null==e||e.addEventListener("click",en),()=>{null==e||e.removeEventListener("click",en)}},[C]),(0,m.useEffect)(()=>{null==p||p(!K&&!ee&&!F)},[K,ee,null==_?void 0:_.modifySimDevice,F]),(0,m.useEffect)(()=>{localStorage.setItem("portability","0");let e=C.simOptions.find(e=>e.selection);null==p||p(!!e),O(h.Bf.RECOGNITION_ESIM_SKIP_MNP),j(h.v9.SIM_TYPE_SELECTION_CARD_MNP_SKIP,{})},[]),{organizedDataForSim:Y,handleSelect:e=>{var i,n;if(!e)return;let o=(0,nY.fF)("modifyMobileSimDeviceId"),l=null==C?void 0:null===(i=C.simOptions)||void 0===i?void 0:i.find(i=>i.value===e.value);l&&(null==l?void 0:l.id)!==(null==o?void 0:o.simOptionId)&&!K&&P(l),M({...C,simOptions:null==C?void 0:null===(n=C.simOptions)||void 0===n?void 0:n.map(i=>i.value===(null==e?void 0:e.value)?{...i,selection:!0}
1:{...i,selection:!1})})},getSelectedItem:()=>{var e;let i=null==C?void 0:null===(e=C.simOptions)||void 0===e?void 0:e.find(e=>e.selection);return{title:(null==i?void 0:i.title)||"",value:(null==i?void 0:i.value)||""}},trackOpenModal:()=>{var e;(0,nY.Fk)({event_name:"ui_interaction",event_label_track:"e-sim option ".concat(null==Y?void 0:null===(e=Y.modalInfo)||void 0===e?void 0:e.textLink),event_category:"users",event_action:"click",tracking_type:"link"})},simOptions:C,isLoadingCustomer:K,isLoadingAddress:ee}},u3=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("e-sim option","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step4.7"],event_label:"e-sim option",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"e-sim option"),(0,S.q)(n),null});var u6=e=>{var i;let{handleOnChangeEnableGoNext:n}=e,o=(0,I.useQueryClient)(),[l,t]=(0,m.useState)(!1),{currentStepKey:r,product:d,customerDeliveryBaseInfo:a,setRecognitionCode:u,isModalButtonSticky:s}=(0,E.Mg)(),v=null==a?void 0:null===(i=a.deliveryBase)||void 0===i?void 0:i.identificationDetails,c=Array.isArray(v)?v.find(e=>e.code===l_.V.VR):(null==v?void 0:v.code)===l_.V.VR,f=(0,g.C)(g.J,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),h=()=>{var e,i,n,l;t(!0);let a=()=>{let e=(null==d?void 0:d.hubPath)||"";window.location.href="".concat((0,ed.e)(),"/").concat(e)};eh.D0.handleError(eh.T_.getSeverityErrorHigh(),{title:(null==f?void 0:null===(e=f.genericerror)||void 0===e?void 0:e.title)||"",message:(null==f?void 0:null===(i=f.genericerror)||void 0===i?void 0:i.description)||"",actionText:(null==f?void 0:null===(n=f.genericerror)||void 0===n?void 0:n.buttonLabel)||"",onClose:a,actionEvent:a,secondButtonText:(null==d?void 0:d.removeCTC)?void 0:null==d?void 0:null===(l=d.genericErrorCallMeNow)||void 0===l?void 0:l.label,isButtonSticky:s,secondActionEvent:()=>{var e;return(0,eb.x)(o,(null==d?void 0:null===(e=d.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",d,a,r)},opts:{product_name:(null==d?void 0:d.slug)||""}})},b=()=>{if(Array.isArray(v)){var e;if(0===v.length||1===v.length&&(null==v?void 0:null===(e=v[0])||void 0===e?void 0:e.code)===l_.V.NA)return h()}else if((null==v?void 0:v.code)===l_.V.NA)return h();if(Array.isArray(v)){let e=0===v.length&&(null==v?void 0:v[0].code)===l_.V.NA,i=v.find(e=>e.code===l_.V.CO),o=v.find(e=>e.code===l_.V.VR);e?null==n||n(!1):i&&!o||!i&&o?(localStorage.setItem("recognition",i&&!o?l_.V.CO:l_.V.VR),null==n||n(!0)):null==n||n(!1)}};return((0,m.useEffect)(()=>{b()},[v]),l)?null:(0,p.jsx)("div",{children:c?(u("VR"),localStorage.setItem("recognition",l_.V.VR),(0,p.jsx)(tC,{isMNP:!1})):(h(),null)})};let u4=A()(()=>{let e=(0,I.useQueryClient)(),i=(0,T.De)("confirm id","mobile",e),{trackView:n}=(0,S.r)({event:["checkout_step1.1"],event_label:"verify id",opts:null==i?void 0:i.opts,cartProduct:null==i?void 0:i.trackingProduct,pageProduct:null==i?void 0:i.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(n,"verify id"),(0,S.q)(n),null});var u7=n(11752);let u9=(e,i)=>{var n,o,l,t,r,d,a,u,s,v;return{titleCms:(null==e?void 0:null===(o=e.personalinfo)||void 0===o?void 0:null===(n=o.clientRecognition)||void 0===n?void 0:n.title)||"",descriptionCms:(null==e?void 0:null===(t=e.personalinfo)||void 0===t?void 0:null===(l=t.clientRecognition)||void 0===l?void 0:l.description)||"",placeholderCms:(null==e?void 0:null===(d=e.personalinfo)||void 0===d?void 0:null===(r=d.selectInput)||void 0===r?void 0:r.contactPlaceholder)||"",ctaLabelCms:(null==e?void 0:null===(u=e.personalinfo)||void 0===u?void 0:null===(a=u.clientRecognition)||void 0===a?void 0:a.codeNotAccessLabel)||"",ctaUrl:(null==e?void 0:null===(v=e.personalinfo)||void 0===v?void 0:null===(s=v.clientRecognition)||void 0===s?void 0:s.contactNotAccessUrl)||(null==i?void 0:i.urlClickToCallOtp)||""}},u8=e=>{let{handleOnChangeEnableGoNext:i}=e,{findCaller:n,setFindCaller:o,product:l}=(0,E.Mg)(),t=(0,I.useQueryClient)(),{descriptionCms:r,placeholderCms:d,titleCms:a,ctaLabelCms:u,ctaUrl:s}=u9((0,u7.CA)(u7.Jn,u7.bl.CMS_GET_PERSONAL_DATA),l),v={getSelectedData:e=>{var i;o({...n,selectedContactMedium:(null===(i=e.field)||void 0===i?void 0:i.trim())?e:void 0})},identityTypeItems:[n.individualRef.email||"",n.individualRef.msisdn||""],title:a,description:r,placeholder:d,cta:{label:u,url:s,action:()=>{(null==l?void 0:l.urlClickToCallOtp)?((0,n0.d)("verify id:".concat(null==u?void 0:u.toLowerCase())),(0,n0.x)(t,null==l?void 0:l.urlClickToCallOtp,l)):s&&((0,n0.d)("verify id:".concat(null==u?void 0:u.toLowerCase())),window.location.href=s)}}};return(0,m.useEffect)(()=>{o({...n,selectedContactMedium:void 0})},[]),(0,m.useEffect)(()=>
1{if(i){var e;i(!!((null===(e=n.selectedContactMedium)||void 0===e?void 0:e.field)&&n.selectedContactMedium.fieldType))}},[n.selectedContactMedium]),{cardConfig:v}};var se=e=>{let{handleOnChangeEnableGoNext:i}=e,{cardConfig:n}=u8({handleOnChangeEnableGoNext:i});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u4,{}),(0,p.jsx)(n1.Z,{data:n}),";"]})};let si={margins:[60,30],tabletMargins:[32,15],groups:[{heights:60,marginBottom:32},{heights:60,marginBottom:15},{heights:75,repeat:4,gap:15}]};var sn=n(89131);let so=e=>{let i=(0,I.useQueryClient)(),{handleOnClose:n}=e,{owningData:o,findCaller:l,isLoadingCart:t,cartAsyncInfo:r,checkoutErrors:d,isModalButtonSticky:a,product:u,setOwningData:s,setFindCaller:v,setCheckoutStepState:c}=(0,E.Mg)(),p=(null==u?void 0:u.isFamilyPlusProduct)||(null==u?void 0:u.forceCampaign),f=!p&&t,g=(0,n9.f)("appSession"),{isError:b,isSuccess:y,data:C,refetch:_}=(0,sn.p)({fiscalCode:(null==g?void 0:g.fiscalcode)||""},{enabled:!1}),S=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),T=()=>{null==n||n()},A=()=>{var e,i;null==d||null===(i=d.showAndTrackError)||void 0===i||i.call(d,S,n,void 0,void 0,void 0,n,(null==S?void 0:null===(e=S.genericerror)||void 0===e?void 0:e.buttonLabel)||"Chiudi",void 0,void 0,a,void 0,!0)};return(0,m.useEffect)(()=>{b&&T()},[b]),(0,m.useEffect)(()=>{let e=document.getElementById("back-button");y&&C&&((null==C?void 0:C.individualRef)?(s({...o,owningIndividual:{...o.owningIndividual,firstName:(null==g?void 0:g.firstname)||"",lastName:(null==g?void 0:g.lastname)||"",fiscalCode:(null==g?void 0:g.fiscalcode)||""},isValid:!0}),v({...C,showOtp:!0,verifyOtp:"",isVerified:!1,selectedContactMedium:void 0})):T());let n=()=>{(0,eh.uY)(i,["findCaller"])};return null==e||e.addEventListener("click",n),()=>{null==e||e.removeEventListener("click",n)}},[y]),(0,m.useEffect)(()=>{if(!f){if(null==g?void 0:g.fiscalcode){var e,i;(null==r?void 0:null===(e=r.simTypeSelection)||void 0===e?void 0:e.isError)?A():(p||(null==r?void 0:null===(i=r.simTypeSelection)||void 0===i?void 0:i.isSuccess))&&_()}else A()}},[f,null==r?void 0:r.simTypeSelection]),(0,m.useEffect)(()=>{c(h.v9.CONFIRM_IDENTITY_APP_CARD,{})},[]),{findCaller:l,isSuccessGetFindCaller:y,isLoadingCart:f}};function sl(){let e=(0,D._)(["\n    width: 366px;\n  "]);return sl=function(){return e},e}function st(){let e=(0,D._)(["\n    width: 406px;\n  "]);return st=function(){return e},e}function sr(){let e=(0,D._)(["\n  margin: 0 auto;\n  width: 287px;\n\n  ","\n\n  ","\n"]);return sr=function(){return e},e}function sd(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: 1.24;\n    padding: 60px 0 ",";\n  "]);return sd=function(){return e},e}function sa(){let e=(0,D._)(["\n    font-size: ",";\n    line-height: 1.25;\n  "]);return sa=function(){return e},e}function su(){let e=(0,D._)(["\n  padding: 32px 0 ",";\n  font-family: ",";\n  font-weight: ",";\n  text-align: center;\n  font-size: ",";\n  line-height: 1.27;\n\n  ","\n\n  ","\n"]);return su=function(){return e},e}function ss(){let e=(0,D._)(["\n    line-height: 1.5;\n  "]);return ss=function(){return e},e}function sv(){let e=(0,D._)(["\n    margin-bottom: 2.5rem;\n  "]);return sv=function(){return e},e}function sc(){let e=(0,D._)(["\n  font-family: ",";\n  font-weight: ",";\n  font-style: normal;\n  font-size: ",";\n  line-height: 1.3;\n  text-align: center;\n  margin-top: ",";\n  margin-bottom: ",";\n\n  ","\n\n  ","\n"]);return sc=function(){return e},e}function sp(){let e=(0,D._)(["\n    gap: 1.25rem;\n  "]);return sp=function(){return e},e}function sm(){let e=(0,D._)(["\n  input::-webkit-outer-spin-button,\n  input::-webkit-inner-spin-button {\n    -webkit-appearance: none;\n    margin: 0;\n  }\n  input[type='number'] {\n    -moz-appearance: textfield;\n  }\n  display: flex;\n  flex-direction: column;\n\n  div {\n    margin-top: 0;\n  }\n\n  p {\n    position: relative;\n    margin-bottom: 0;\n  }\n\n  gap: ",";\n\n  ","\n"]);return sm=function(){return e},e}function sf(){let e=(0,D._)(["\n    margin-top: 1.25rem;\n  "]);return sf=function(){return e},e}function sg(){let e=(0,D._)(["\n  display: flex;\n  font-family: ",";\n  font-weight: ",";\n  font-style: normal;\n  font-size: ",";\n  line-height: 1.29;\n  margin-top: ",";\n  margin-bottom: ",";\n\n  ","\n"]);return sg=function(){return e},e}function sE(){let e=(0,D._)(["\n  margin-top: 3.75rem;\n"]);return sE=function(){return e},e}let sh=B.Z.div(sr(),w.B.tablet(sl()),w.B.desktop(st())),sb=B.Z.div(su(),w.r.spacing.md,w.r.typography.fontFamily.primary,w.r.typography.fontWeight.extrabold,w.r.typography.fontSize.display5,w.B.tablet(sd(),w.r.typography.fontSize.h1,w.r.spacing.md),w.B.desktop(sa(),w.r.typography.fontSize.h2)),sy=B.Z.div(sc(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.typography.fontSize.h6,w.r.spacing.md,w.r.spacing.xl,w.B.tablet(ss()),w.B.desktop(sv())),sC=B.Z.div(sm(),w.r.spacing.md,w.B.tablet(sp()));
1B.Z.div(sg(),w.r.typography.fontFamily.primary,w.r.typography.fontWeight.regular,w.r.typography.fontSize.body3,w.r.spacing.md,w.r.spacing.xl,w.B.tablet(sf()));let s_=B.Z.div(sE()),sS=()=>M.object({phoneNumber:M.string().required("Campo obbligatorio").min(9,"Inserire un numero valido").max(11,"Inserire un numero valido").matches(/^(3)+[0-9]*$/,"Inserire un numero valido")});var sI=e=>{var i;let{title:n,description:o,label:l,value:t,onChangeData:r,onValidChange:d,isLoading:a,schema:u,disabled:s,disclaimer:v}=e,{register:c,setValue:f,getValues:g,formState:{isValid:E,errors:h}}=(0,L.cI)({resolver:(0,x.X)(u||sS()),mode:"all"});return(0,m.useEffect)(()=>{t&&f("phoneNumber",t,{shouldValidate:!!t})},[]),(0,m.useEffect)(()=>{null==d||d(E)},[E]),(0,p.jsx)(sh,{children:a?(0,p.jsx)(s_,{children:(0,p.jsx)(iG.Z,{heights:70,quantity:3})}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(sb,{children:n}),(0,p.jsx)(sy,{children:o}),(0,p.jsx)(sC,{children:(0,p.jsx)("div",{className:"textInput",children:(0,p.jsx)(O.Z.TextInput,{label:l,type:"number",placeholder:" ",autoComplete:"off",disabled:s||!1,error:null===(i=h.phoneNumber)||void 0===i?void 0:i.message,...c("phoneNumber",{onChange:()=>{let e=g().phoneNumber;r&&r(e)},setValueAs:e=>e.trim()})})})}),v&&(0,p.jsx)(lO.Z,{text:v,size:20,sizeMobile:14,lineHeight:18,margin:[32,0],fontFamily:lx.R.regular,textAlign:"left"})]})})};let sT=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p;return{title:(null==e?void 0:e.winbacknumber.otp.title)||"",description:(null==e?void 0:e.winbacknumber.otp.description)||"",codeResponseDescription:(null==e?void 0:null===(n=e.winbacknumber.otp.codeResponse)||void 0===n?void 0:n.description)||"",instructionText:{text:"".concat(null==e?void 0:null===(o=e.winbacknumber.otp.telephoneVerify)||void 0===o?void 0:o.replace("$number",'<b style="color:red">'.concat(i,"</b>"))),fontFamily:aB.R.exbold,size:20,lineHeight:(0,aB.k)(20,26)},alerts:{error:(null==e?void 0:null===(l=e.winbacknumber.otp.codeResponse)||void 0===l?void 0:l.alertWarn)||"",sentNew:(null==e?void 0:null===(t=e.winbacknumber.otp.codeResponse)||void 0===t?void 0:t.alertSuccess)||""},otpError:(null==e?void 0:null===(r=e.winbacknumber.otp.codeResponse)||void 0===r?void 0:r.otpError)||"",detail:(null==e?void 0:e.winbacknumber.otp.codeMissingLabel)||"",links:{sendNew:(null==e?void 0:e.winbacknumber.otp.codeNewLabel)||"",noAccess:(null==e?void 0:e.winbacknumber.otp.codeNotAccessLabel)||"",urlNoAccess:(null==e?void 0:e.winbacknumber.otp.contactNotAccessUrl)||""},timer:{timerLabel:null==e?void 0:null===(p=e.winbacknumber)||void 0===p?void 0:null===(c=p.otp)||void 0===c?void 0:null===(v=c.timer)||void 0===v?void 0:null===(s=v.label)||void 0===s?void 0:s.replace("$TIME",'<b id="timerAmount">'.concat(null==e?void 0:null===(u=e.winbacknumber)||void 0===u?void 0:null===(a=u.otp)||void 0===a?void 0:null===(d=a.timer)||void 0===d?void 0:d.amount,"</b>"))}}},sA=e=>{var i;let n=null==e?void 0:null===(i=e.winbacknumber)||void 0===i?void 0:i.errorPopup;return{titlePopup:null==n?void 0:n.title,messagePopup:null==n?void 0:n.message,ctaLabel:null==n?void 0:n.ctaLabel,buttonLabel:null==n?void 0:n.secondButtonLabel}},sR=e=>{var i,n,o,l,t,r,d,a,u,s,v,c;return{popupTitle:(null==e?void 0:null===(n=e.winbacknumber)||void 0===n?void 0:null===(i=n.expiredPopup)||void 0===i?void 0:i.title)||"",popupMessage:(null==e?void 0:null===(l=e.winbacknumber)||void 0===l?void 0:null===(o=l.expiredPopup)||void 0===o?void 0:o.message)||"",popupCtaText:(null==e?void 0:null===(r=e.winbacknumber)||void 0===r?void 0:null===(t=r.expiredPopup)||void 0===t?void 0:t.ctaText)||"",popupButtonText:(null==e?void 0:null===(a=e.winbacknumber)||void 0===a?void 0:null===(d=a.expiredPopup)||void 0===d?void 0:d.buttonText)||"",popupButtonRedirect:(null==e?void 0:null===(s=e.winbacknumber)||void 0===s?void 0:null===(u=s.expiredPopup)||void 0===u?void 0:u.buttonRedirect)||"",urlClickToCall:(null==e?void 0:null===(c=e.winbacknumber)||void 0===c?void 0:null===(v=c.expiredPopup)||void 0===v?void 0:v.urlClickToCall)||""}};var sL=n(40858);let sN=()=>{let[e,i]=(0,m.useState)(!1),[n,o]=(0,m.useState)(!1),[l,t]=(0,m.useState)(!1),[r,d
1]=(0,m.useState)(!1),[a,u]=(0,m.useState)(!1),{winBackNumber:s}=(0,E.Mg)(),{mutate:v,data:c,isLoading:p,isSuccess:f,isError:g}=(0,sL.W)();return(0,m.useEffect)(()=>{d(p)},[p]),(0,m.useEffect)(()=>{u(g)},[g]),(0,m.useEffect)(()=>{f&&c&&("1002"==c.returnedCode?i(!0):"0"==c.returnedCode?o(!0):t(!0))},[f,c]),{startWinbackFlow:()=>{s&&v({voucherId:s})},isLoading:r,isValidVoucher:n,isExpiredVoucher:e,isInvalidVoucher:l,isError:a}},sO=()=>(0,p.jsx)(sx,{children:(0,p.jsx)(N.Z,{margins:[8,8,8,8]})}),sx=lu.ZP.div.withConfig({componentId:"sc-13aa6270-0"})(["padding:20px"]);var sP=n(6185),sM=n(46474);function sk(){let e=(0,D._)(["\n    margin-top: ",";\n  "]);return sk=function(){return e},e}function sD(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  padding: 0 ",";\n  gap: ",";\n  align-items: center;\n  margin-bottom: ",";\n  margin-top: ",";\n\n  ","\n"]);return sD=function(){return e},e}function sB(){let e=(0,D._)(["\n    ",";\n  "]);return sB=function(){return e},e}function sw(){let e=(0,D._)(["\n  margin: 0;\n  font-family: ",";\n  font-weight: ",";\n  ",";\n  align-self: center;\n\n  p {\n    margin: 0;\n\n    b {\n      font-family: ",";\n      font-weight: ",";\n    }\n  }\n\n  ","\n"]);return sw=function(){return e},e}function sj(){let e=(0,D._)(["\n    width: 288px;\n  "]);return sj=function(){return e},e}function sU(){let e=(0,D._)(["\n  width: 100%;\n\n  ","\n"]);return sU=function(){return e},e}function sF(){let e=(0,D._)(["\n    gap: 40px;\n  "]);return sF=function(){return e},e}function sG(){let e=(0,D._)(["\n  display: flex;\n  flex-direction: column;\n  gap: ",";\n\n  ","\n"]);return sG=function(){return e},e}let sz=B.Z.div(sD(),sM.rS.spacing.md,sM.rS.spacing.lg,sM.rS.spacing["2xl"],sM.rS.spacing.md,sM.BC.desktop(sk(),sM.rS.spacing.xl)),sV=B.Z.p(sw(),sM.rS.typography.fontFamily.primary,sM.rS.typography.fontWeight.light,(0,sM.Ln)(30,38),sM.rS.typography.fontFamily.primary,sM.rS.typography.fontWeight.extrabold,sM.BC.desktop(sB(),(0,sM.Ln)(36,45))),sY=B.Z.div(sU(),sM.BC.desktop(sj())),sH=B.Z.div(sG(),sM.rS.spacing.xl,sM.BC.desktop(sF())),sZ=e=>{let{title:i,ctaLabel:n,addonList:o,addedAddons:l,isLoadingUpdate:t,isLoadingCartUpdate:r,loadingId:d,saveAddon:a,removeAddon:u,goNext:s}=e,[v]=(0,b.q)([i]),c=e=>{var i,n,o,l;let t=(null==e?void 0:null===(n=e.addondetails)||void 0===n?void 0:null===(i=n.common)||void 0===i?void 0:i.priceRecurring)||"",r=(null==e?void 0:null===(l=e.addondetails)||void 0===l?void 0:null===(o=l.common)||void 0===o?void 0:o.recurringLabel)||"";return""!==t&&""!==r?"+".concat(t,"€/").concat(r):""};return(0,p.jsxs)(sz,{children:[(0,p.jsx)(sV,{dangerouslySetInnerHTML:{__html:v||""}}),n&&(0,p.jsx)(sY,{children:(0,p.jsx)(tY.z,{onClick:s,disabled:t||r,variant:"tertiary",children:n})}),(0,p.jsx)(sH,{children:o&&o.map(e=>{var i,n,o,s,v,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M;return(0,p.jsx)(sP.S,{title:(null==e?void 0:null===(n=e.addondetails)||void 0===n?void 0:null===(i=n.card)||void 0===i?void 0:i.title)||(null==e?void 0:null===(o=e.addondetails)||void 0===o?void 0:o.name)||"",price:c(e),subprice:(null==e?void 0:null===(v=e.addondetails)||void 0===v?void 0:null===(s=v.common)||void 0===s?void 0:s.priceActivationLabel)||"",imageUri:(null==e?void 0:null===(f=e.addondetails)||void 0===f?void 0:null===(m=f.card)||void 0===m?void 0:m.cardImage)||"",ctaAddLabel:(null==e?void 0:null===(E=e.addondetails)||void 0===E?void 0:null===(g=E.common)||void 0===g?void 0:g.ctaAddLabel)||"",ctaRemoveLabel:(null==e?void 0:null===(b=e.addondetails)||void 0===b?void 0:null===(h=b.common)||void 0===h?void 0:h.ctaRemoveLabel)||"",ctaAddedLabel:null==e?void 0:null===(C=e.addondetails)||void 0===C?void 0:null===(y=C.common)||void 0===y?void 0:y.ctaAddedLabel,description:(null==e?void 0:null===(S=e.addondetails)||void 0===S?void 0:null===(_=S.card)||void 0===_?void 0:_.description)||"",ctaOpenDetailsLabel:(null==e?void 0:null===(T=e.addondetails)||void 0===T?void 0:null===(I=T.card)||void 0===I?void 0:I.popUpCtaLabel)||"",popupTitle:(null==e?void 0:null===(R=e.addondetails)||void 0===R?void 0:null===(A=R.detailPo
1pup)||void 0===A?void 0:A.popupTitle)||"",popupBody:(null==e?void 0:null===(N=e.addondetails)||void 0===N?void 0:null===(L=N.detailPopup)||void 0===L?void 0:L.popupDescription)||"",closePopupLabel:(null==e?void 0:null===(x=e.addondetails)||void 0===x?void 0:null===(O=x.common)||void 0===O?void 0:O.ctaCloseLabel)||"",noPriceLabel:(null==e?void 0:null===(M=e.addondetails)||void 0===M?void 0:null===(P=M.common)||void 0===P?void 0:P.noPriceLabel)||"",addonId:e.cmsId||"",added:l.some(i=>i===e.cmsId),isLoadingUpdate:t,isLoadingCartUpdate:r,loadingId:d,saveAddon:a,removeAddon:u},e.cmsId)})})]})};var sQ=n(83003),sW=n(42446);let sK=A()(e=>{let{addonIdList:i}=e,{product:n}=(0,E.Mg)(),o=(0,I.useQueryClient)(),l=(0,sQ.fF)("shoppingCart"),{getCartProductsWithAddon:t,retrieveCartAddons:r}=(0,tI.Vz)(o),{trackView:d}=(0,sQ.rS)({event:["view"],event_label:"addons:view",opts:{product_target_segment:"consumer",page_section:"mobile offers",page_subsection:"checkout",page_type:"addons",event_category:"sales",journey_type:"journey",journey_name:"checkout",product_technology:(0,sW.C)()||""},cartProduct:{cart_product_quantity:"1",cart_id:null==l?void 0:l.id,cart_product_technology:(0,sW.C)()||"",cart_product_id:"".concat(null==n?void 0:n.offerId),cart_product_name:null==n?void 0:n.slug,cart_product_category:"mobile",cart_product_price:(null==n?void 0:n.price)&&(0,rn.F)(n.price),...t(n,r(i))},visitorTrackingOpts:(0,T.bG)()});return(0,ef.kg)(d,"addons:"),(0,sQ.qH)(d),null}),sJ=e=>{var i,n,o,l;return{title:(null==e?void 0:null===(n=e.addoncommons)||void 0===n?void 0:null===(i=n.addonStep)||void 0===i?void 0:i.topText)||"",ctaLabel:(null==e?void 0:null===(l=e.addoncommons)||void 0===l?void 0:null===(o=l.addonStep)||void 0===o?void 0:o.skipCtaLabel)||""}},sq=e=>{let{handleGoNextSlide:i,handleOnChangeEnableGoNext:n}=e,{product:o,addons:l,addonState:t,isLoadingCart:r,setAddonState:d,setCurrentStepKey:a,setHasSPC:u,setCheckoutStepState:s}=(0,E.Mg)(),[v,c]=(0,m.useState)(""),[p,f]=(0,m.useState)(!1),[g,b]=(0,m.useState)([]),{availableAddons:y,isLoadingUpdate:C,isLoadingPriceUpdate:_,isLoading:S}=t,I=(0,u7.CA)(u7.Jn,u7.bl.CMS_GET_ADDONS_MOBILE),{title:T,ctaLabel:A}=sJ((0,u7.CA)(u7.Jn,u7.bl.CMS_GET_ADDONS_COMMON_MOBILE)),R=Object.keys(I).filter(e=>{var i;return null==o?void 0:null===(i=o.addonList)||void 0===i?void 0:i.some(i=>i.cmsId===e)}),L=Object.keys(I).filter(e=>{var i;return null==o?void 0:null===(i=o.addonList)||void 0===i?void 0:i.some(i=>i.cmsId===e)}).map(e=>{var i,n,l,t;let r=null==o?void 0:null===(i=o.addonList)||void 0===i?void 0:i.find(i=>i.cmsId===e),d=null==r?void 0:r.boId,a=(null===(l=I[e])||void 0===l?void 0:null===(n=l.addondetails)||void 0===n?void 0:n.id)||"";return{cmsId:e,id:d||a,addondetails:{...null===(t=I[e])||void 0===t?void 0:t.addondetails,id:d||a}}});return(0,m.useEffect)(()=>{a(h.Bf.ADDON_CARD),s(h.v9.ADDON_CARD,{}),localStorage.removeItem("addons"),f(!0)},[]),(0,m.useEffect)(()=>{p&&!r&&(d({...t,callGetAddons:!0}),f(!1))},[p,r]),(0,m.useEffect)(()=>{y.length>0&&(eh.KF.debug("available addons: ",y),b(null==L?void 0:L.filter(e=>{var i;return null==y?void 0:y.includes((null===(i=e.addondetails)||void 0===i?void 0:i.id)||"0")})))},[y]),(0,m.useEffect)(()=>{C||c("")},[C]),(0,m.useEffect)(()=>{null==n||n(!(C||S||r||_))},[C,S,r,_]),{addons:l,addonIdList:R,loadingId:v,addonListFiltered:g,title:T,ctaLabel:A,isLoadingUpdate:C,isLoadingPriceUpdate:_,isLoadingCart:r,isLoadingGetAddons:S,callSaveAddon:e=>{var i,n;let o=g.find(i=>i.cmsId===e),l=(null==o?void 0:null===(i=o.addondetails)||void 0===i?void 0:i.id)||"";(null==o?void 0:null===(n=o.addondetails)||void 0===n?void 0:n.isSPC)==="true"&&u(!0),(0,ef.dw)("aggiungi ".concat(l),"users","click","cart_add"),d({...t,addonCmsId:e,addonMecId:l,callSaveAddon:!0}),c(e)},callRemoveAddon:e=>{var i,n;let o=g.find(i=>i.cmsId===e),l=(null==o?void 0:null===(i=o.addondetails)||void 0===i?void 0:i.id)||"";(null==o?void 0:null===(n=o.addondetails)||void 0===n?void 0:n.isSPC)==="true"&&u(!1),(0,ef.dw)("rimuovi ".concat(l),"users","click","cart_remove"),d({...t,addonCmsId:e,addonMecId:l,callRemoveAddon:!0}
1),c(e)},goNext:()=>{(0,ef.dw)(A),localStorage.setItem("addons",JSON.stringify(l)),null==i||i({},!1)}}},sX=[{title:h.Bf.PERSONAL_INFO_WINBACK,component:e=>{var i;let{setIsDisabledBackButton:n,cartAsyncInfo:o,setCheckoutStepState:l}=(0,E.Mg)(),t=(null==o?void 0:null===(i=o.simTypeSelection)||void 0===i?void 0:i.isLoading)||!1;return((0,m.useEffect)(()=>{n(t)},[t]),(0,m.useEffect)(()=>{l(h.v9.NAME_FISCAL_CODE_CARD_WINBACK,{})},[]),t)?(0,p.jsx)(a$,{children:(0,p.jsx)(iG.Z,{quantity:4,heights:75,space:40})}):(0,p.jsx)(eT,{...e})}},{title:h.Bf.ADDON_CARD,component:e=>{let{handleOnChangeEnableGoNext:i,handleGoNextSlide:n}=e,{addons:o,addonIdList:l,addonListFiltered:t,title:r,ctaLabel:d,loadingId:a,isLoadingCart:u,isLoadingGetAddons:s,isLoadingPriceUpdate:v,isLoadingUpdate:c,callRemoveAddon:m,callSaveAddon:f,goNext:g}=sq({handleGoNextSlide:n,handleOnChangeEnableGoNext:i});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(sK,{addonIdList:l}),(u||s)&&(0,p.jsx)(sO,{}),!u&&!s&&(0,p.jsx)(sZ,{title:r,ctaLabel:d,addonList:t,addedAddons:o,isLoadingUpdate:c,isLoadingCartUpdate:v,loadingId:a,saveAddon:f,removeAddon:m,goNext:g})]})}},{title:h.Bf.PERSONAL_INFO,component:eT},{title:h.Bf.DOCUMENT_ID,component:e=>{var i;let{handleOnChangeEnableGoNext:n}=e,[o,l]=(0,m.useState)(!1),t=(0,f.f)("getCountry"),r=(0,f.f)("customerReference")||y,{owningData:d,findCaller:a,setCurrentStepKey:u,setOwningData:s,setCheckoutStepState:v}=(0,E.Mg)(),c=(0,g.C)(g.J,f.b.CMS_GET_PERSONAL_DATA_MOBILE),b=(null==d?void 0:d.isLogged)||(null==a?void 0:a.customerHasActiveSubs);return(0,m.useEffect)(()=>{setTimeout(()=>null==n?void 0:n(o),1e3)},[o,d]),(0,m.useEffect)(()=>{var e,i,o;null==n||n(!1);let l=null==d?void 0:null===(e=d.owningIndividual)||void 0===e?void 0:e.fiscalCode;localStorage.setItem("customerDataCf",l),localStorage.setItem("name_cus",null==d?void 0:null===(i=d.owningIndividual)||void 0===i?void 0:i.firstName),localStorage.setItem("surname_cus",null==d?void 0:null===(o=d.owningIndividual)||void 0===o?void 0:o.lastName),u(h.Bf.DOCUMENT_ID),v(h.v9.DOCUMENT_ID_CARD,{})},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(R,{}),(0,p.jsx)(eo,{configCms:{...C(c,b)},data:d,onChangeData:e=>{s(e)},identificationType:_((null==r?void 0:r.identificationType)||[],(null==c?void 0:null===(i=c.editorialconfigs)||void 0===i?void 0:i.elements)||[])||[],nationality:(null==t?void 0:t.map(e=>null==e?void 0:e.displayName))||[""],isLoading:!1,setIsValidForm:e=>l(e)})]})}},{title:h.Bf.CONTACT_CARD,component:e=>{let{owningData:i,address:n,contactInfo:o,isReadOnly:l,campaign:t,isLoading:r,setIsValidForm:d,onChangeData:a,onChangeCheck:u}=nW(e);if(r){var s;return(0,p.jsxs)(p.Fragment,{children:[!(null==t?void 0:null===(s=t.updateCart)||void 0===s?void 0:s.isLoading)&&(0,p.jsx)(i2,{}),(0,p.jsx)(nG,{...e})]})}return(0,p.jsx)(iU,{data:i,address:n,checkInfo:o,onChangeData:a,onChangeCheck:u,isReadOnly:l,showEditMail:!0,setIsValidForm:e=>d(e)})}},{title:h.Bf.CONFIRM_IDENDITY,component:e=>{let{handleOnChangeEnableGoNext:i}=e,{findCaller:n,setFindCaller:o,product:l,setCheckoutStepState:t}=(0,E.Mg)(),r=(0,I.useQueryClient)(),{descriptionCms:d,placeholderCms:a,titleCms:u,ctaLabelCms:s,ctaUrl:v}=n2((0,g.C)(g.J,nq.b.CMS_GET_PERSONAL_DATA_MOBILE),l),c={getSelectedData:e=>{var i;o({...n,selectedContactMedium:(null===(i=e.field)||void 0===i?void 0:i.trim())?e:void 0})},identityTypeItems:[n.individualRef.email||"",n.individualRef.msisdn||""],title:u,description:d,placeholder:a,cta:{label:s,url:v,action:()=>{(null==l?void 0:l.urlClickToCallOtp)?((0,n0.d)("verify id:".concat(null==s?void 0:s.toLowerCase())),(0,n0.x)(r,null==l?void 0:l.urlClickToCallOtp,l)):v&&((0,n0.d)("verify id:".concat(null==s?void 0:s.toLowerCase())),window.location.href=v)}}};return(0,m.useEffect)(()=>{o({...n,selectedContactMedium:void 0})},[]),(0,m.useEffect)(()=>{if(i){var e;i(!!((null===(e=n.selectedContactMedium)||void 0===e?void 0:e.field)&&n.selectedContactMedium.fieldType))}},[n.selectedContactMedium]),(0,m.useEffect)(()=>{t(h.v9.CONFIRM_IDENTITY_CARD,{})},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n5,{}),(0,p.jsx)(n1.Z,{data:c})]})}},{title:h.Bf.CONFIRM_IDENDITY_APP,component:e=>{let{findCaller:i,isSuccessGetFindCaller:n,isLoadingCart:o}=so(e);return n&&(null==i?void 0:i.showOtp)&&!o?(0,p.jsx)(se,{...e}):(0,p.jsx)(N.Z,{...si})}},{title:h.Bf.OTP,component:e=>{var i;let{handleOnChangeEnableGoNext:n,handleGoPrevSlide:o}=e,l=(0,I.useQueryClient)(),{currentStepKey:t,checkoutErrors:r,findCaller:d,isModalButtonSticky:a,product:u,timerID:s,setFindCaller:v,setIsDisabledBackButton:c,setTimerID:f,setCheckoutStepState:g}=(0,E.Mg)(),{mutate:b,isError:y,error:C}=(0,nK.Z2)(),{mutate:_,data:S,isSuccess:A,isError:R,isLoading:L,error:N}=(0,nK.US)(),O=(0,nK.CA)(nK.Jn,nq.b.CMS_GET_GENERIC_ERROR_MOBILE),x=(0,nK.CA)(nK.Jn,nq.b.CMS_GET_PERSONAL_DATA_MOBILE),[P,M]=(0,m.useState)(!1),[k,D]=(0,m.useState)(!1),B=(e,i)=>{var n,o,t,r,d,a,u,v,c,p,m,g;(0,nJ.uY)(l,["generateOTP"]),b({identifier:e,identifierType:i}),(null==x?void 0:null===(t=x.personalinfomobile)||void 0===t?void 0:null===(o=t.clientRecognition)||void 0===o?void 0:null===(n=o.timer)||void 0===n?void 0:n.amount)&&!isNaN(parseInt(null==x?void 0:null===(a=x.personalinfomobile)||void 0===a?void 0:null===(d=a.clientRecognition)||void 0===d?void 0:null===(r=d.timer)||void 0===r?void 0:r.amount))&&parseInt(null==x?void 0:null===(c=x.personalinfomobile)||void 0===c?void 0:null===(v=c.clientRecognition)||void 0===v?void 0:null===(u=v.timer)||void 0===u?void 0:u.amount)>0&&(clearInterval(s),D(!0),f((0,nK.Zn)(parseInt(null==x?void 0:null===(g=x.personalinfomobile)||void 0===g?void 0:null===(m=g.clientRecognition)||void 0===m?void 0:null===(p=m.timer)||void 0===p?void 0:p.amount),()=>D(!1))))},w=(0,nK.CA)(nK.Jn,nq.b.CMS_GET_GLOBAL_CONFIG),j=null==w?void 0:w.globalconfig,U=parseInt(localStorage.getItem("numOfOtpFailures")||"0",10);return(0,m.useEffect)(()=>{var e,i;if(y){if(U<((null==j?void 0:null===(e=j.otp)||void 0===e?void 0:e.maxFailureNumber)||0))localStorage.setItem("numOfOtpFailures",(U+1).toString());else{let e=(null==j?void 0:null===(i=j.otp)||void 0===i?void 0:i.adHocError)||{},n=()=>{window.open((null==e?void 0:e.buttonLink)||"","_self")};nJ.D0.handleError(nJ.T_.getSeverityErrorHigh(),{title:(null==e?void 0:e.title)||"",message:(null==e?void 0:e.description)||"",onClose:n,actionEvent:n,actionText:(null==e?void 0:e.buttonLabel)||"",trackError:(0,T.yP)((0,nK.nQ)("generate",C||void 0))})}}},[y]),(0,m.useEffect)(()=>{let e=()=>{localStorage.removeItem("numOfOtpFailures")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[]),(0,m.useEffect)(()=>{(R||!R&&A&&!S)&&(M(!0),N&&(0,nJ.Fk)({...(0,T.yP)((0,nK.nQ)("VerifyOtp",N),"OTP",l),page_error_code:N.status||""}))},[A,S,R,N]),(0,m.useEffect)(()=>
1{if(n){var e;v({...d,isVerified:!!S,verifyOtp:(null==S?void 0:S.id)||""}),localStorage.setItem(nK.V7,(null==d?void 0:null===(e=d.selectedContactMedium)||void 0===e?void 0:e.fieldType)||""),(0,nJ.uY)(l,["findCaller"]),n(!!S)}},[S]),(0,m.useEffect)(()=>{c(L)},[L]),(0,m.useEffect)(()=>{if(y&&o){var e,i,n;null==r||null===(n=r.showAndTrackError)||void 0===n||n.call(r,O,o,(0,nK.nQ)("generateOtp",C),void 0,void 0,o,(null==O?void 0:null===(e=O.genericerror)||void 0===e?void 0:e.buttonLabel)||"",()=>{var e;return(0,nJ.xb)(l,(null==u?void 0:null===(e=u.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",u,()=>o(),t,(0,nK.nQ)("generateOtp",C))},(null==u?void 0:u.removeCTC)?void 0:(null==u?void 0:null===(i=u.genericErrorCallMeNow)||void 0===i?void 0:i.label)||"",a,!0)}},[y]),(0,m.useEffect)(()=>{P&&setTimeout(()=>{M(!1)},3e3)},[P]),(0,m.useEffect)(()=>{var e;(null===(e=d.selectedContactMedium)||void 0===e?void 0:e.field)&&B(d.selectedContactMedium.field,d.selectedContactMedium.fieldType)},[]),(0,m.useEffect)(()=>{g(h.v9.OTP_CARD,{})},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n$,{}),(0,p.jsx)(nX.m,{product:u,contactMedium:d.selectedContactMedium,isError:P,isLoading:L,reSendOtp:B,onVerify:e=>{_(e)},setIsError:()=>{M(!1)},isTimerActive:k,configOtp:(0,nX.z)(null==x?void 0:x.personalinfomobile,(null==d?void 0:null===(i=d.selectedContactMedium)||void 0===i?void 0:i.fieldType)==="msisdn",null==d?void 0:d.selectedContactMedium)})]})}},{title:h.Bf.PORTABILITY,component:e=>{let{handleOnChangeEnableGoNext:i,handleGoPrevSlide:n,handleOnClose:o}=e,{title:l,description:t,items:r,bottomText:d,portability:a,keepsNumber:u,isSuccessAssociate:s,handleSelect:v,setKeepsNumber:c}=ov({handleOnChangeEnableGoNext:i,handleGoPrevSlide:n,handleOnClose:o});return s?(0,p.jsx)(n3.k,{title:l,items:r,description:t,bottomText:d,value:a.portabilityWant||!1,selectedItem:u,setSelectedItem:c,disableItems:!1,onSelectItem:v}):(0,p.jsx)(n4,{children:(0,p.jsx)(iG.Z,{quantity:4,heights:75,space:40})})}},{title:h.Bf.PORTABILITY_NUMBER,component:e=>{let{handleOnChangeEnableGoNext:i,handleGoPrevSlide:n}=e,{title:o,description:l,label:t,disclaimer:r,validationMessage:d,isLoadingPortInfo:a,portability:u,onChangeData:s}=oT({handleOnChangeEnableGoNext:i,handleGoPrevSlide:n});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(of,{}),a&&(0,p.jsx)(om,{children:(0,p.jsx)(iG.Z,{heights:70,quantity:3})}),!a&&(0,p.jsx)(og.Z,{validationMessage:d,title:o,description:l,label:t,disclaimer:r,value:u.portabilityNumber,onChangeData:s,disabled:!1,schema:(0,oc.QT)("phoneNumber")})]})}},{title:h.Bf.PORTABILITY_NUMBER_WINBACK,component:e=>{let{handleOnClose:i,handleOnChangeEnableGoNext:n,handleGoPrevSlide:o}=e,{title:l,description:t,label:r,validationMessage:d,portability:a,isLoadingPortInfo:u,isLoadingAddress:s,isLoadingCustomer:v,onChangeData:c}=ul({handleOnClose:i,handleOnChangeEnableGoNext:n,handleGoPrevSlide:o});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ue,{}),u||s||v?(0,p.jsx)(a8,{children:(0,p.jsx)(iG.Z,{heights:70,quantity:3})}):(0,p.jsx)(og.Z,{validationMessage:d,title:l,description:t,label:r,value:a.portabilityNumber,onChangeData:c,disabled:!0,schema:(0,oc.QT)("phoneNumber")})]})}},{title:h.Bf.PORTABILITY_NUMBER_PORTABILITY_REQUIRED,component:e=>{let{handleOnChangeEnableGoNext:i,handleGoPrevSlide:n,handleOnClose:o}=e,{title:l,description:t,label:r,disclaimer:d,validationMessage:a,portability:u,isLoading:s,isWinBackProduct:v,onChangeData:c}=a9({handleOnChangeEnableGoNext:i,handleGoPrevSlide:n,handleOnClose:o});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a3,{}),s?(0,p.jsx)(a5,{children:(0,p.jsx)(iG.Z,{heights:70,quantity:3})}):(0,p.jsx)(og.Z,{validationMessage:a,title:l,description:t,disclaimer:d,label:r,value:u.portabilityNumber,onChangeData:c,disabled:v,schema:(0,oc.QT)("phoneNumber")})]})}},{title:h.Bf.PORTABILITY_OTP,component:e=>{let{handleOnChangeEnableGoNext:i}=e,n=(0,I.useQueryClient)(),o=(0,lI.Z)(lL.w.MODULE_NAME),{portability:l,product:t,timerID:r,setPortability:d,setTimerID:a,setCheckoutStepState:u}=(0,E.Mg)(),[s,v]=(0,m.useState)(!1),[c,f]=(0,m.useState)(!1),{mutate:g,data:b,isSuccess:y,isError:C,isLoading:_,error:S}=(0,lT.U)(),{portabilitymobile:{otp:A}}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_PORTABILITY_MOBILE),R=(e,i)=>{var l,t,d,u;(0,nH.u)(n,["generateOTP"]),o.mutate({identifier:"39".concat(e),identifierType:i}),(null==A?void 0:null===(l=A.timer)||void 0===l?void 0:l.amount)&&!isNaN(parseInt(null==A?void 0:null===(t=A.timer)||void 0===t?void 0:t.amount))&&parseInt(null==A?void 0:null===(d=A.timer)||void 0===d?void 0:d.amount)>0&&(clearInterval(r),f(!0),a((0,eS.Zn)(parseInt(null==A?void 0:null===(u=A.timer)||void 0===u?void 0:u.amount),()=>f(!1))))},L=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GLOBAL_CONFIG),N=null==L?void 0:L.globalconfig,O=parseInt(localStorage.getItem("numOfOtpFailures")||"0",10);return(0,m.useEffect)(()=>{var e,i;if(o.isError){if(O<((null==N?void 0:null===(e=N.otp)||void 0===e?void 0:e.maxFailureNumber)||0))localStorage.setItem("numOfOtpFailures",(O+1).toString());else{let e=(null==N?void 0:null===(i=N.otp)||void 0===i?void 0:i.adHocError)||{},n=()=>{window.open((null==e?void 0:e.buttonLink)||"","_self")};eh.D0.handleError(eh.T_.getSeverityErrorHigh(),{title:(null==e?void 0:e.title)||"",message:(null==e?void 0:e.description)||"",onClose:n,actionEvent:n,actionText:(null==e?void 0:e.buttonLabel)||"",trackError:(0,T.yP)((0,eS.nQ)("generate",o.error||void 0))})}}},[o.isError]),(0,m.useEffect)(()=>{let e=()=>{localStorage.removeItem("numOfOtpFailures")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[]),(0,m.useEffect)(()=>(R(l.portabilityNumber,lL.w.FIELD_TYPE),()=>{(0,nH.u)(n,["generateOTP","verifyOTP"])}),[]),(0,m.useEffect)(()=>{s&&setTimeout(()=>{v(!1)},3e3)},[s]),(0,m.useEffect)(()=>{C||!C&&y&&!b?(v(!0),S&&(0,ef.Fk)({...(0,T.yP)((0,eS.nQ)("VerifyOtp",S),"OTP",n),page_error_code:S.status||""})):(null==b?void 0:b.id)&&(d({...l,portabilityOtp:{isVerified:!0,numberValidate:l.portabilityNumber}}),setTimeout(()=>{null==i||i(!0)},500))},[y,b,C,S]),(0,m.useEffect)(()=>{u(h.v9.PORTABILITY_OTP_CARD,{})},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(lN,{}),(0,p.jsx)(lA.Z,{product:t,contactMedium:{field:l.portabilityNumber,fieldType:lL.w.FIELD_TYPE},isError:s,isLoading:_,reSendOtp:R,onVerify:e=>{g(e)},setIsError:()=>{v(!1)},noAccessEnabled:!1,configOtp:(0,lR.C9)(A,!0,{field:l.portabilityNumber,fieldType:lL.w.FIELD_TYPE}),isTimerActive:c})]})}},{title:h.Bf.PORTABILITY_DATA,component:e=>{let{handleOnChangeEnableGoNext:i}=e,{availableOperators:n,currentPlan:o,editorialLabels:l,product:t,oldNumber:r,onChangeData:d}=td({handleOnChangeEnableGoNext:i});return(0,p.jsxs)("div",{children:[(0,p.jsx)(tl,{}),(0,p.jsx)(to,{editorialLabels:l,portabilityOperatorsFirstAction:null==t?void 0:t.portabilityOperatorsFirstAction,oldNumber:r,currentPlan:o,currentProvider:n,onChangeData:d,handleOnChangeEnableGoNext:i})]})}}
1,{title:h.Bf.TERMS_AND_CONDITIONS,component:e=>{let{deliveryAdvance:i,editorialLabels:n,product:o,termsAndConditions:l,isNewShippingAddress:t,handleSetNext:r}=ds(e);if((null==i?void 0:i.isLoading)||l.isLoadingTermsAndConditions){var d;return(null==o?void 0:null===(d=o.loaders)||void 0===d?void 0:d.yourAddressCard)?(0,p.jsxs)(rg,{children:[(0,p.jsx)(rE,{}),(0,p.jsx)(iz.J5,{src:(0,iF.o)(o.loaders.yourAddressCard).src,className:"player",loop:!0,autoplay:!0})]}):(0,p.jsx)(iG.Z,{quantity:2,heights:90})}return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(dr,{}),t&&(0,p.jsx)(rI,{...e}),!t&&(0,p.jsx)(dt,{setNextAble:r,isLoading:!1,value:l,pdfContractSummary:null==o?void 0:o.pdfContractSummary,editorialLabels:n})]})}},{title:h.Bf.CONSENTS,component:e=>{let{handleOnChangeEnableGoNext:i}=e,{title:n,terms:o,description:l,actionText:t,modal:r}=dp((0,g.C)(g.J,dv.b.CMS_GET_TERMS_AND_CONDITIONS_MOBILE)),{consents:d,isLoading:a,onUpdateConsents:u}=dy({handleOnChangeEnableGoNext:i});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(dg,{}),a&&(0,p.jsx)(N.Z,{...df}),!a&&(0,p.jsx)(dc.Z,{title:n,description:l,terms:o,partyPrivacyItems:dm(d.partyPrivacyItems,r.list),actionText:t,onUpdateConsents:u,trackView:dv.F,modal:r})]})}},{title:h.Bf.RECOGNITION_ESIM,component:e=>{var i,n,o;let{handleOnChangeEnableGoNext:l}=e,{cmsOperatorsConfig:t,product:r,buildTrackingObject:d,noOfferConfig:a,redirectHomePage:u,volaClickToCallData:s,queryClient:v,portability:c,portabilityStatus:m,avaiableProduct:f,isFallbackModalOpen:g,handleClose:E,handleAccept:h,hasAccepted:b,isAcceptLoading:y}=ra({handleOnChangeEnableGoNext:l});return(0,p.jsxs)(p.Fragment,{children:[!(null==m?void 0:m.isLoadingCheck)&&!y&&!b&&(!c.portabilityWant||(null===(i=c.portabilityMigration)||void 0===i?void 0:i.currentProvider)&&(0,tT.k3)(c.portabilityMigration.currentProvider,null==t?void 0:null===(n=t.operatorsconfiggroup)||void 0===n?void 0:n.elements,r.offerAvaiability))&&(0,p.jsx)(tL,{handleOnChangeEnableGoNext:l}),((null==m?void 0:m.isLoadingCheck)||y||b)&&(0,p.jsx)(tV,{product:f,hasAcceptedFallback:b}),(0,p.jsx)(tS.Z,{isOpen:g,handleClose:E,handleAccept:h,offerData:(0,tT.xP)(f,null===(o=c.portabilityMigration)||void 0===o?void 0:o.currentProvider),buildTrackingObject:d,product:f,taggingPageName:"offer exchange"}),(0,p.jsx)(ri,{...a,onClose:u,onButtonClick:()=>{var e,i,n,o,l,t;eh.Td.handleVolaModal({url:(null==r?void 0:null===(i=r.digitalBundleConfig)||void 0===i?void 0:null===(e=i.noOfferError)||void 0===e?void 0:e.url)||(null==r?void 0:null===(n=r.callMeNowHelp)||void 0===n?void 0:n.url)||"",cmsClickToCallData:{...s},taggingOption:{product_target_segment:"consumer",event_category:"sales",page_subsection:"checkout",versatile_prop:"new ctc"},pageProduct:(0,tI.Vz)(v).getPageProduct(r),onClose:u,...(null==s?void 0:null===(l=s.clicktocall)||void 0===l?void 0:null===(o=l.otpConfig)||void 0===o?void 0:o.enableOtp)==="true"&&{otpConfig:null==s?void 0:null===(t=s.clicktocall)||void 0===t?void 0:t.otpConfig}})}})]})}},{title:h.Bf.RECOGNITION_ESIM_WINBACK,component:e=>{var i;let{handleOnChangeEnableGoNext:n}=e,{organizedDataForSim:o,handleSelect:l,getSelectedItem:t,portabilityStatus:r,trackOpenModal:d,simOptions:a}=a2({handleOnChangeEnableGoNext:n});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a0,{}),(0,p.jsx)(n3.k,{title:o.cardTitle,description:o.cardDescription,items:null==a?void 0:null===(i=a.simOptions)||void 0===i?void 0:i.map(e=>({title:e.title||"",value:e.value||"",extra:e.highlight?{text:o.bestChoiceLabel||"",color:"#fff",extraClass:"extraClass"}:void 0})),value:t().value,selectedItem:t(),setSelectedItem:()=>{},onSelectItem:l,bottomModal:o.modalInfo,isSuccess:!(null==r?void 0:r.isLoadingCheck),onOpeneModal:d})]})}},{title:h.Bf.RECOGNITION_ESIM_SKIP_MNP,component:e=>{var i;let{handleOnChangeEnableGoNext:n,handleGoPrevSlide:o,handleOnClose:l}=e,{organizedDataForSim:t,handleSelect:r,getSelectedItem:d,trackOpenModal:a,simOptions:u,isLoadingCustomer:s,isLoadingAddress:v}=u5({handleOnChangeEnableGoNext:n,handleGoPrevSlide:o,handleOnClose:l});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u3,{}
1),(0,p.jsx)(n3.k,{title:t.cardTitle,description:t.cardDescription,items:null==u?void 0:null===(i=u.simOptions)||void 0===i?void 0:i.map(e=>({title:e.title||"",value:e.value||"",extra:e.highlight?{text:t.bestChoiceLabel||"",color:"#fff",extraClass:"extraClass"}:void 0})),value:d().value,selectedItem:d(),setSelectedItem:()=>{},onSelectItem:r,bottomModal:t.modalInfo,isSuccess:!s&&!v,onOpeneModal:a})]})}},{title:h.Bf.RECOGNITION_CARD,component:e=>{var i,n;let{handleOnChangeEnableGoNext:o}=e,{setIsDisabledBackButton:l,setIsStartRecognition:t,isStartRecognition:r,customerDeliveryBaseInfo:d,setCheckoutStepState:a}=(0,E.Mg)(),u=(null==d?void 0:null===(i=d.deliveryBase)||void 0===i?void 0:i.isSuccess)&&(null==d?void 0:null===(n=d.modifySimDevice)||void 0===n?void 0:n.isSuccess);return(0,m.useEffect)(()=>{null==o||o(u),l(!u)},[u]),(0,m.useEffect)(()=>{r&&t(!1)},[r]),(0,m.useEffect)(()=>{t(!0)},[]),(0,m.useEffect)(()=>{a(h.v9.RECOGNITION_CARD,{})},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{display:u?"none":"block"},children:(0,p.jsx)(tu,{children:(0,p.jsx)(iG.Z,{quantity:4,heights:75,space:40})})}),(0,p.jsx)("div",{style:{display:u?"block":"none"},children:(0,p.jsx)(t_,{...e})})]})}},{title:h.Bf.RECOGNITION_CARD_SKIP_MNP,component:e=>{var i,n,o,l,t,r,d,a,u,s,v,c,f,g;let b=(0,I.useQueryClient)(),{handleOnChangeEnableGoNext:y,handleGoPrevSlide:C,handleOnClose:_}=e,{setIsDisabledBackButton:S,setIsStartRecognition:A,setSlidesGoBack:R,setIsStartCustomerFlow:L,setBillingAddress:N,setShippingAddress:O,setCurrentStepKey:x,currentStepKey:P,product:M,isModalButtonSticky:k,checkoutErrors:D,isStartRecognition:B,customerDeliveryBaseInfo:w,customerFlow:j,setCheckoutStepState:U}=(0,E.Mg)(),{urlGenericErrorCallMeNow:F}=(0,eS.S6)(M),G=(0,eC.CA)(eC.Jn,i7.b.CMS_GET_GENERIC_ERROR_MOBILE),{errorcomponent:z}=(0,eC.CA)(eC.Jn,i7.b.CMS_GET_RECURRENT_ORDER_ERROR_MOBILE)||{},V=(null==z?void 0:z.errors)||[],{errorcomponent:Y}=(0,eC.CA)(eC.Jn,i7.b.CMS_GET_CUSTOMER_ERROR_MOBILE)||{},H=[...V,...(null==Y?void 0:Y.errors)||[]],Z=(null==j?void 0:null===(i=j.postCustomer)||void 0===i?void 0:i.isLoading)||(null==j?void 0:null===(n=j.patchCustomer)||void 0===n?void 0:n.isLoading)||(null==j?void 0:null===(o=j.customerInfo)||void 0===o?void 0:o.isLoading)||(null==j?void 0:null===(l=j.associateCustomer)||void 0===l?void 0:l.isLoading),Q=(null==j?void 0:null===(t=j.postCustomer)||void 0===t?void 0:t.isError)||(null==j?void 0:null===(r=j.patchCustomer)||void 0===r?void 0:r.isError)||(null==j?void 0:null===(d=j.customerInfo)||void 0===d?void 0:d.isError)||(null==j?void 0:null===(a=j.associateCustomer)||void 0===a?void 0:a.isError),W=(null==j?void 0:null===(u=j.postCustomer)||void 0===u?void 0:u.error)||(null==j?void 0:null===(s=j.patchCustomer)||void 0===s?void 0:s.error)||(null==j?void 0:null===(v=j.associateCustomer)||void 0===v?void 0:v.error),K=null==j?void 0:null===(c=j.associateCustomer)||void 0===c?void 0:c.isSuccess,{data:J,isSuccess:q,isLoading:X,isError:$}=os({onConfirmAddress:!0}),ee=(null==w?void 0:null===(f=w.deliveryBase)||void 0===f?void 0:f.isSuccess)&&(null==w?void 0:null===(g=w.modifySimDevice)||void 0===g?void 0:g.isSuccess);return((0,m.useEffect)(()=>{if(Q){var e,i,n;let o=(0,T.Tz)(H,(null==W?void 0:W.errorCode)||"",{title:(null==G?void 0:null===(e=G.genericerror)||void 0===e?void 0:e.title)||"",description:(null==G?void 0:null===(i=G.genericerror)||void 0===i?void 0:i.description)||""}),l=e=>{var i;switch(null==j||null===(i=j.resetPatchAndPost)||void 0===i||i.call(j,j),null==W?void 0:W.errorCode){case e_.S.CREATE_CUSTOMER_FISCAL_CODE_ALREADY_PRESENT:R(4);break;case e_.S.CREATE_CUSTOMER_DOCUMENT_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_MISSING_NATION_ADDRESS:(null==o?void 0:o.isPopup)&&e?(0,i7.x)(b,(null==o?void 0:o.url)||F,M,()=>{_&&_()},P,W):R(2);break;case e_.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT:case e_.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT:R(3);break;case e_.S.ASSOCIATE_CUSTOMER_BLOCKED:(null==o?void 0:o.isPopup)&&e?(0,i7.x)(b,(null==o?void 0:o.url)||F,M,()=>{_&&_()},P,W):_&&_();break;default:_&&_()}};null==D||null===(n=D.showAndTrackError)||void 0===n||n.call(D,{genericerror:{title:(null==o?void 0:o.title)||"",description:(null==o?void 0:o.message)||"",buttonLabel:(null==o?void 0:o.actionText)||""}},l,W,"","",()=>l(!0),"")}},[Q]),(0,m.useEffect)(()=>
1{if($){var e,i;let n=()=>{null==C||C()},o=(0,eS.nQ)("address",{url:"validateAddress",status:"500",statusText:"500"});null==D||null===(i=D.showAndTrackError)||void 0===i||i.call(D,G,n,o,void 0,void 0,n,"Chiudi",()=>{var e;return(0,i7.x)(b,(null==M?void 0:null===(e=M.genericErrorCallMeNow)||void 0===e?void 0:e.url)||"",M,n,P,o)},(null==M?void 0:M.removeCTC)?void 0:null==M?void 0:null===(e=M.genericErrorCallMeNow)||void 0===e?void 0:e.label,k,!0)}},[$]),(0,m.useEffect)(()=>{S(Z||X)},[Z,X]),(0,m.useEffect)(()=>{null==y||y(ee),S(!ee)},[ee]),(0,m.useEffect)(()=>{B&&A(!1)},[B]),(0,m.useEffect)(()=>{A(!0)},[K]),(0,m.useEffect)(()=>{q&&J&&(N(J),O(J),L(!0))},[q,J]),(0,m.useEffect)(()=>{x(h.Bf.RECOGNITION_CARD_SKIP_MNP),U(h.v9.RECOGNITION_CARD_SKIP_MNP,{}),localStorage.setItem("portability","0")},[]),!ee||Z||X)?(0,p.jsx)(tu,{children:(0,p.jsx)(iG.Z,{quantity:4,heights:75,space:40})}):(0,p.jsx)(u6,{...e})}},{title:h.Bf.DELIVERY_ADDRESS,component:e=>{let{handleOnChangeEnableGoNext:i}=e,{addressCmsData:n,isEsimFD:o,isEsimValue:l}=function(e){var i,n;let{handleOnChangeEnableGoNext:o}=e,{owningData:{isLogged:l,owningIndividual:t},billingAddress:r,shippingAddress:d,simOptions:a,termsAndConditions:u,deliveryAdvance:s,recognitionCode:v,customerDeliveryBaseInfo:c,setCurrentStepKey:p,setTermsAndConditions:f,setIsStartAddress:g,setCheckoutStepState:b}=(0,E.Mg)(),y=(0,eC.CA)(eC.Jn,nq.b.CMS_GET_GLOBAL_CONFIG),C=(0,eC.CA)(eC.Jn,nq.b.CMS_GET_DELIVERY_INFORMATION_MOBILE),_=(0,eC.CA)(eC.Jn,nq.b.CMS_GET_EDIT_ADDRESS_MOBILE);(0,lS.b)({enabled:l},y);let S=(0,eR.Yc)(null==_?void 0:_.editaddressconfig);null==s||s.identificationDetails;let I=(null==c?void 0:null===(i=c.deliveryBase)||void 0===i?void 0:i.deliveryOptions)||[],A=null==a?void 0:null===(n=a.simOptions)||void 0===n?void 0:n.find(e=>e.selection),R=null==I?void 0:I.find(e=>e.code===l_.V.DI&&e.isSelected),L=(0,T.Y2)(A),N=!!(L&&R),O="CO"===v,x=lC(C,t,r,d,S,L,N,O);return(0,m.useEffect)(()=>{p(h.Bf.DELIVERY_ADDRESS),b(h.v9.DELIVERY_ADDRESS_CARD,{}),f({...u,preConsensus:!0,optionToReconsider:"no"}),g(!0),L?localStorage.setItem("isEsim","1"):localStorage.removeItem("isEsim"),null==o||o(!0)},[]),{addressCmsData:x,isEsimFD:N,isEsimValue:L,isCourier:O}}({handleOnChangeEnableGoNext:i});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ly,{}),(0,p.jsx)(lb,{...n,isEsimFD:o,isEsim:l})]})}},{title:h.Bf.PAYMENT_METHOD,component:e=>{let{handleOnChangeEnableGoNext:i,handleGoNextSlide:n,handleGoPrevSlide:o}=e,{owningData:l,onChangePayment:t,selectedPaymean:r,isSuccessChangePayment:d,isTNPUser:a,hasSPC:u,config:s}=d0({handleOnChangeEnableGoNext:i,handleGoNextSlide:n,handleGoPrevSlide:o});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d1,{}),(0,p.jsx)(dJ.X,{owningIndividual:l.owningIndividual,handleChangePayment:t,handleGoPrevSlide:o,payMean:r,showLoader:!d,disableNewPaymentMethod:a&&u,config:s})]})}},{title:h.Bf.RECURRENT_PAYMENT_CARD,component:e=>{let{product:i,setCheckoutStepState:n}=(0,E.Mg)();return((0,m.useEffect)(()=>{n(h.v9.RECURRENT_PAYMENT_CARD,{})},[]),null==i?void 0:i.isAutoWallet)?(0,p.jsx)(dZ,{...e}):(0,p.jsx)(dK,{...e})}},{title:h.Bf.WARNING_PRICE_CHANGE,component:e=>{let{handleGoNextSlide:i,handleGoPrevSlide:n}=e,{cms:o}=d5({handleGoNextSlide:i,handleGoPrevSlide:n});return(0,p.jsx)(i5.Z,{...o})}},{title:h.Bf.UPFRONT_PAYMENT,component:e=>{let{handleGoPrevSlide:i}=e,{checkoutErrors:n,authorizationAsyncInfo:o,isModalButtonSticky:l,product:t,currentStepKey:r,setAuthorizationAsyncInfo:d,setIsDisabledBackButton:a,setIsStartAuthorizationAsyncInfo:u,setCheckoutStepState:s}=(0,E.Mg)(),{isWallet:v,cartId:c,isLoading:f,setIsLoading:g,skipImmediatePayment:b,setSkipImmediatePayment:y,genericError:C,orderErrors:_,paymentCMS:S,commonLabels:I}=as(),{data:T,error:A,isError:R,isSuccess:L}=o.authorization;return(av({isWallet:v,authorizationAsyncInfo:o,authorizationData:T,isErrorAuthorization:R,isSuccessAuthorization:L,setIsStartAuthorizationAsyncInfo:u}),ac({authorizationAsyncInfo:o,errorAuthorization:A,isErrorAuthorization:R,authorizationData:T,orderErrors:_,genericError:C,paymentCMS:S,product:t,currentStepKey:r,isModalButtonSticky:l,checkoutErrors:n,handleGoPrevSlide:i,setAuthorizationAsyncInfo:d}),ap({cartId:c,isWallet:v,authorizationAsyncInfo:o,genericError:C,paymentCMS:S,commonLabels:I,isModalButtonSticky:l,checkoutErrors:n,handleGoPrevSlide:i,setIsLoading:g,setSkipImmediatePayment:y}),(0,m.useEffect)(()=>{a(f)},[f,a]),(0,m.useEffect)(()=>{s(h.v9.UPFRONT_PAYMENT_CARD,{})},[]),f)?(0,p.jsx)(i2,{}):b?(0,p.jsx)(at,{onErrorRetry:()=>{var e,i,o,t,r,d,a;null==n||null===(a=n.showAndTrackError)||void 0===a||a.call(n,C,()=>{},void 0,null==S?void 0:null===(i=S.paymentsmobile)||void 0===i?void 0:null===(e=i.submitError)||void 0===e?void 0:e.title,null==S?void 0:null===(t=S.paymentsmobile)||void 0===t?void 0:null===(o=t.submitError)||void 0===o?void 0:o.description,()=>{},null==S?void 0:null===(d=S.paymentsmobile)||void 0===d?void 0:null===(r=d.submitError)||void 0===r?void 0:r.actionText,void 0,void 0,l,!0)}}):(0,p.jsx)(aa,{...e})}},{title:h.Bf.WINBACK_NUMBER,component:e=>{let{handleOnChangeEnableGoNext:i}=e,n=(0,I.useQueryClient)(),{winbacknumber:o}=(0,g.C)(g.J,am.b.CMS_GET_WINBACK_DATA),{title:l,description:t,placeholder:r,disclaimer:d,val
1idation:a}=o,{setCurrentStepKey:u,winBackNumber:s,setWinBackNumber:v,isLoadingCart:c,setCheckoutStepState:f}=(0,E.Mg)(),b=(0,T.De)("winback","mobile",n),{trackView:y}=(0,eh.rS)({event:["view"],event_label:"Verify ID",opts:{event_category:["sales","journey"],journey_name:"winback",journey_type:"journey",page_section:"campaign",page_subsection:"check number",page_type:"Verify ID"},cartProduct:null==b?void 0:b.trackingProduct,pageProduct:null==b?void 0:b.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,am.k)(y,"verify ID"),(0,m.useEffect)(()=>{u(h.Bf.WINBACK_NUMBER),f(h.v9.WINBACK_NUMBER_CARD,{})},[]),(0,m.useEffect)(()=>{let e=!!(null==s?void 0:s.match(oc.Sz.mobilePhoneNumber));null==i||i(e)},[s]),(0,p.jsx)(aD,{title:l,description:t,label:r,value:s,disclaimer:d,validation:a,onChangeData:e=>{v(e)},isLoading:c,disabled:!1,schema:(0,oc.QT)("phoneNumber")})}},{title:h.Bf.WINBACK_OTP,component:e=>{var i,n,o,l;let{handleOnChangeEnableGoNext:t,handleGoPrevSlide:r,handleGoNextSlide:d}=e,{currentStepKey:a,checkoutErrors:u,winBackNumber:s,isModalButtonSticky:v,product:c,timerID:f,setPortability:g,setCurrentStepKey:b,setIsDisabledBackButton:y,setTimerID:C,setCheckoutStepState:_}=(0,E.Mg)(),[S,A]=(0,m.useState)(!1),[R,L]=(0,m.useState)(!1),N=(0,eC.CA)(eC.Jn,am.b.CMS_GET_WINBACK_DATA),{urlGenericErrorCallMeNow:O}=(0,eS.S6)(c),x=aw(N,s),{titlePopup:P,ctaLabel:M,messagePopup:k,buttonLabel:D}=aj(N),B=(0,I.useQueryClient)(),w=(0,lI.Z)(lL.w.MODULE_NAME),{isError:j,error:U}=w,F=(0,T.De)("winback","mobile",B),G={title:(null==x?void 0:null===(i=x.warning)||void 0===i?void 0:i.title)||"",subtitle:(null==x?void 0:null===(n=x.warning)||void 0===n?void 0:n.subtitle)||"",description:(null==x?void 0:null===(o=x.warning)||void 0===o?void 0:o.description)||"",lottie:(null==c?void 0:null===(l=c.loaders)||void 0===l?void 0:l.choosePayment)||""},{mutate:z,data:V,isSuccess:Y,isError:H,isLoading:Z}=(0,lT.U)(),{isError:Q,isSuccess:W,isLoading:K,refetchFlowStart:J,resetState:q}=aq(s),X=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p;(0,eh.uY)(B,["generateOTP"]),w.mutate({identifier:"39".concat(e),identifierType:i,identificationScope:"SUB"}),(null==N?void 0:null===(l=N.winbacknumber)||void 0===l?void 0:null===(o=l.otp)||void 0===o?void 0:null===(n=o.timer)||void 0===n?void 0:n.amount)&&!isNaN(parseInt(null==N?void 0:null===(d=N.winbacknumber)||void 0===d?void 0:null===(r=d.otp)||void 0===r?void 0:null===(t=r.timer)||void 0===t?void 0:t.amount))&&parseInt(null==N?void 0:null===(s=N.winbacknumber)||void 0===s?void 0:null===(u=s.otp)||void 0===u?void 0:null===(a=u.timer)||void 0===a?void 0:a.amount)>0&&(clearInterval(f),L(!0),C((0,eS.Zn)(parseInt(null==N?void 0:null===(p=N.winbacknumber)||void 0===p?void 0:null===(c=p.otp)||void 0===c?void 0:null===(v=c.timer)||void 0===v?void 0:v.amount),()=>L(!1))))},$=()=>{ei({event_name:"ui_interaction",event_label_track:"click on modifica numero",event_category:"users",event_action:"click",tracking_type:"link"}),q(),null==r||r()},ee=e=>{(0,eb.x)(B,O,c,()=>{$()})},{trackView:ei,trackWithNewDatalayer:en}=(0,eh.rS)({event:["view"],event_label:"OTP",opts:{event_category:["sales","journey"],journey_name:"winback",journey_type:"journey",page_section:"campaign",page_subsection:"check number"},cartProduct:null==F?void 0:F.trackingProduct,pageProduct:null==F?void 0:F.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()}),eo=(0,eC.CA)(eC.Jn,am.b.CMS_GET_GENERIC_ERROR_MOBILE);(0,am.k)(ei,"OTP"),(0,ef.qH)(ei);let el=(0,eC.CA)(eC.Jn,am.b.CMS_GET_GLOBAL_CONFIG),et=null==el?void 0:el.globalconfig,er=parseInt(localStorage.getItem("numOfOtpFailures")||"0",10);return(0,m.useEffect)(()=>{var e,i;if(j){if(er<((null==et?void 0:null===(e=et.otp)||void 0===e?void 0:e.maxFailureNumber)||0))localStorage.setItem("numOfOtpFailures",(er+1).toString());else{let e=(null==et?void 0:null===(i=et.otp)||void 0===i?void 0:i.adHocError)||{},n=()=>{window.open((null==e?void 0:e.buttonLink)||"","_self")};eh.D0.handleError(eh.T_.getSeverityErrorHigh(),{title:(null==e?void 0:e.title)||"",message:(null==e?void 0:e.description)||"",onClose:n,actionEvent:n,actionText:(null==e?void 0:e.buttonLabel)||"",trackError:(0,iD.yP)((0,eS.nQ)("generate",U||void 0))})}}},[j]),(0,m.useEffect)(()=>{let e=()=>{localStorage.removeItem("numOfOtpFailures")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[]),(0,m.useEffect)(()=>{(H||!H&&Y&&!V)&&A(!0),Y&&(null==V?void 0:V.id)&&(g({...nQ.XM,portabilityNumber:s,portabilityWant:!0}),J())},[Y,V,H]),(0,m.useEffect)(()=>(b(h.Bf.WINBACK_OTP),X(s,lL.w.FIELD_TYPE),()=>{(0,eh.uY)(B,["generateOTP","verifyOTP"])}),[]),(0,m.useEffect)(()=>{_(h.v9.WINBACK_OTP_CARD,{})},[]),(0,m.useEffect)(()=>{null==t||t(W),W&&(null==d||d())},[W]),(0,m.useEffect)(()=>
1{if(Q){var e;let i=(0,eS.nQ)("campaignWinBack",{url:"campaign",status:"500",statusText:"KO_OTP"});null==u||null===(e=u.showAndTrackError)||void 0===e||e.call(u,eo,$,i,P,k,()=>ee(i),M,$,D,v,!0,!0),en({event:["view"],event_label:"KO OTP",opts:{event_category:["sales","journey"],journey_name:"winback",journey_type:"journey",page_section:"campaign",page_subsection:"check number",page_type:"KO OTP"},cartProduct:null==F?void 0:F.trackingProduct,pageProduct:null==F?void 0:F.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()})}},[Q]),(0,m.useEffect)(()=>{S&&setTimeout(()=>{A(!1)},3e3)},[S]),(0,m.useEffect)(()=>{y(Z||K)},[Z,K]),(0,p.jsxs)(p.Fragment,{children:[(Z||K)&&(0,p.jsx)(i5.Z,{...G}),(0,p.jsx)("div",{style:{display:Z||K||W?"none":"block"},children:(0,p.jsx)(lA.Z,{contactMedium:{field:s,fieldType:lL.w.FIELD_TYPE},isError:S,isLoading:Z||K,reSendOtp:X,onVerify:e=>{z(e)},setIsError:()=>{A(!1)},noAccessEnabled:!1,configOtp:x,isTimerActive:R})})]})}},{title:h.Bf.WINBACK_LEGACY_NUMBER,component:e=>{let{handleOnChangeEnableGoNext:i,handleGoPrevSlide:n}=e,o=(0,I.useQueryClient)(),{winbacknumber:l}=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_WINBACK_LEGACY_DATA),{title:t,description:r,placeholder:d,disclaimer:a}=l,u=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE),{currentStepKey:s,product:v,winBackNumber:c,isModalButtonSticky:f,checkoutErrors:g,forceCartAsyncInfoFlow:b,setForceCartAsyncInfoFlow:y,setCurrentStepKey:C,setWinBackNumber:_,setCheckoutStepState:S}=(0,E.Mg)(),{urlGenericErrorCallMeNow:A}=(0,eS.S6)(v),{data:R,mutate:L,isLoading:N,isSuccess:O,isError:x}=(0,rt.L)(),{isLoading:P,isSuccess:M,isError:k,error:D}=(0,d3.ju)(null==R?void 0:R.id,{enabled:O}),B=e=>{let i=(0,rl.x)(null==e?void 0:e.offerId,null==e?void 0:e.planId.toString(),!1,"",!0,!0);i&&L(i)},w=e=>(0,eb.x)(o,A,v,()=>{null==n||n()},s,e),j=(0,T.De)("winback","mobile",o),{trackView:U}=(0,eh.rS)({event:["view"],event_label:"Verify ID",opts:{event_category:["sales","journey"],journey_name:"winback",journey_type:"journey",page_section:"campaign",page_subsection:"check number",page_type:"Verify ID"},cartProduct:null==j?void 0:j.trackingProduct,pageProduct:null==j?void 0:j.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()});return(0,ef.qH)(U),(0,ef.kg)(U,"verify ID"),(0,m.useEffect)(()=>{let e=!!(null==c?void 0:c.match(oc.Sz.mobilePhoneNumber));null==i||i(e)},[c]),(0,m.useEffect)(()=>{b&&y(!1)},[b]),(0,m.useEffect)(()=>{O&&y(!0)},[O]),(0,m.useEffect)(()=>{if(x||k){var e;let i=(0,ro.n)("shoppingCart",D||{url:n7.bl.SHOPPING_CART,status:"500",statusText:"KO"});null==g||null===(e=g.showAndTrackError)||void 0===e||e.call(g,u,()=>{},i,u.genericerror.title,u.genericerror.description,()=>w(i),u.genericerror.buttonLabel,()=>w(i),"buttonLabel",f)}},[x,k]),(0,m.useEffect)(()=>{!v||N||O||M||B(v)},[v]),(0,m.useEffect)(()=>{C(h.Bf.WINBACK_NUMBER),S(h.v9.WINBACK_LEGACY_NUMBER_CARD,{})},[]),(0,p.jsx)(sI,{title:t,description:r,label:d,value:c,disclaimer:a,onChangeData:e=>{_(e)},isLoading:N||P||!M,disabled:!1,schema:(0,oc.QT)("phoneNumber")})}},{title:h.Bf.WINBACK_LEGACY_OTP,component:e=>{var i;let{handleOnChangeEnableGoNext:n,handleGoPrevSlide:o,handleGoNextSlide:l}=e,{checkoutErrors:t,winBackNumber:r,isModalButtonSticky:d,product:a,timerID:u,setPortability:s,setCurrentStepKey:v,setIsDisabledBackButton:c,setTimerID:f,setCheckoutStepState:g}=(0,E.Mg)(),[b,y]=(0,m.useState)(!1),[C,_]=(0,m.useState)(!1),S=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_WINBACK_LEGACY_DATA),{urlGenericErrorCallMeNow:A}=(0,eS.S6)(a),R=sT(S,r),L=sR(S),{titlePopup:N,ctaLabel:O,messagePopup:x,buttonLabel:P}=sA(S),M=(0,I.useQueryClient)(),k=(0,lI.Z)(lL.w.MODULE_NAME),{isError:D,error:B}=k,w=(0,T.De)("winback","mobile",M),j={title:"Attendere",subtitle:"Stiamo caricando i dati della tua offerta",description:"",lottie:(null==a?void 0:null===(i=a.loaders)||void 0===i?void 0:i.choosePayment)||""},{mutate:U,data:F,isSuccess:G,isError:z,isLoading:V}=(0,lT.U)(),{startWinbackFlow:Y,isLoading:H,isValidVoucher:Z,isExpiredVoucher:Q,isInvalidVoucher:W,isError:K}=sN(),J=(e,i)=>{var n,o,l,t,r,d,a,s,v,c,p,m;(0,eh.uY)(M,["generateOTP"]),k.mutate({identifier:"39".concat(e),identifierType:i,identificationScope:"SUB"}),(null==S?void 0:null===(l=S.winbacknumber)||void 0===l?void 0:null===(o=l.otp)||void 0===o?void 0:null===(n=o.timer)||void 0===n?void 0:n.amount)&&!isNaN(parseInt(null==S?void 0:null===(d=S.winbacknumber)||void 0===d?void 0:null===(r=d.otp)||void 0===r?void 0:null===(t=r.timer)||void 0===t?void 0:t.amount))&&parseInt(null==S?void 0:null===(v=S.winbacknumber)||void 0===v?void 0:null===(s=v.otp)||void 0===s?void 0:null===(a=s.timer)||void 0===a?void 0:a.amount)>0&&(clearInterval(u),_(!0),f((0,eS.Zn)(parseInt(null==S?void 0:null===(m=S.winbacknumber)||void 0===m?void 0:null===(p=m.otp)||void 0===p?void 0:null===(c=p.timer)||void 0===c?void 0:c.amount),()=>_(!1))))},q=()=>{$({event_name:"ui_interaction",event_label_track:"click on modifica numero",event_category:"users",event_action:"click",tracking_type:"link"}),null==o||o()},X=()=>{(0,eb.x)(M,A,a,()=>{q()})},{trackView:$}=(0,eh.rS)({event:["view"],event_label:"OTP",opts:{event_category:["sales","journey"],journey_name:"winback",journey_type:"journey",page_section:"campaign",page_subsection:"check number"},cartProduct:null==w?void 0:w.trackingProduct,pageProduct:null==w?void 0:w.pageProductsInfo,visitorTrackingOpts:(0,T.bG)()}),ee=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GENERIC_ERROR_MOBILE);(0,ef.kg)($,"OTP");let ei=(0,eC.CA)(eC.Jn,n7.bl.CMS_GET_GLOBAL_CONFIG),en=null==ei?void 0:ei.globalconfig,eo=parseInt(localStorage.getItem("numOfOtpFailures")||"0",10);return(0,m.useEffect)(()=>{var e,i;if(D){if(eo<((null==en?void 0:null===(e=en.otp)||void 0===e?void 0:e.maxFailureNumber)||0))localStorage.setItem("numOfOtpFailures",(eo+1).toString());else{let e=(null==en?void 0:null===(i=en.otp)||void 0===i?void 0:i.adHocError)||{},n=()=>{window.open((null==e?void 0:e.buttonLink)||"","_self")};eh.D0.handleError(eh.T_.getSeverityErrorHigh(),{title:(null==e?void 0:e.title)||"",message:(null==e?void 0:e.description)||"",onClose:n,actionEvent:n,actionText:(null==e?void 0:e.buttonLabel)||"",trackError:(0,iD.yP)((0,eS.nQ)("generate",B||void 0))})}}},[D]),(0,m.useEffect)(()=>{let e=()=>{localStorage.removeItem("numOfOtpFailures")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[]),(0,m.useEffect)(()=>{(z||!z&&G&&!F)&&y(!0),G&&(null==F?void 0:F.id)&&(s({...nQ.XM,portabilityNumber:r,portabilityWant:!0}),Y())},[G,F,z]),(0,m.useEffect)(()=>(v(h.Bf.WINBACK_OTP),J(r,lL.w.FIELD_TYPE),()=>{(0,eh.uY)(M,["generateOTP","verifyOTP"])}),[]),(0,m.useEffect)(()=>{null==n||n(Z),Z&&(null==l||l())},[Z]),(0,m.useEffect)(()=>
1{if(K||W){var e;null==t||null===(e=t.showAndTrackError)||void 0===e||e.call(t,ee,q,(0,eS.nQ)("campaignWinBack",{url:"campaign",status:"500",statusText:"KO_OTP"}),N,x,X,O,q,P,d,!0)}},[K,W]),(0,m.useEffect)(()=>{b&&setTimeout(()=>{y(!1)},3e3)},[b]),(0,m.useEffect)(()=>{Q&&($({event_name:"page_error",event_label_track:"error",journey_name:"winback",journey_type:"journey",page_section:"campaign",page_subsection:"error pop up",page_type:"error page",page_error:"campaign_expired_".concat(null==L?void 0:L.popupMessage),page_error_code:"404"}),eh.D0.handleError(eh.T_.getSeverityErrorMedium(),{title:null==L?void 0:L.popupTitle,message:null==L?void 0:L.popupMessage,actionText:null==L?void 0:L.popupCtaText,actionEvent:X,secondButtonText:null==L?void 0:L.popupButtonText,secondActionEvent:()=>{window.location.href=null==L?void 0:L.popupButtonRedirect},onClose:()=>{window.location.href=null==L?void 0:L.popupButtonRedirect},disableTrack:!0}))},[Q]),(0,m.useEffect)(()=>{c(V||H)},[V,H]),(0,m.useEffect)(()=>{g(h.v9.WINBACK_OTP_CARD,{})},[]),(0,p.jsxs)(p.Fragment,{children:[(V||H)&&(0,p.jsx)(i5.Z,{...j}),(0,p.jsx)("div",{style:{display:V||H||Z?"none":"block"},children:(0,p.jsx)(lA.Z,{contactMedium:{field:r,fieldType:lL.w.FIELD_TYPE},isError:b,isLoading:V||H,reSendOtp:J,onVerify:e=>{U(e)},setIsError:()=>{y(!1)},noAccessEnabled:!1,configOtp:R,isTimerActive:C})})]})}},{title:h.Bf.VOUCHER,component:e=>{let{isValidVoucher:i}=u2();return i?(0,p.jsx)(u1,{...e}):(0,p.jsx)(uT,{...e})}}],s$=e=>sX.find(i=>i.title===e)||{},s0={ADDONS:[s$(h.Bf.ADDON_CARD)]},s1={VOUCHER:[s$(h.Bf.VOUCHER)]},s2={WINBACK_NUMBER:[s$(h.Bf.WINBACK_NUMBER)],WINBACK_OTP:[s$(h.Bf.WINBACK_OTP)]},s5={WINBACK_NUMBER:[s$(h.Bf.WINBACK_LEGACY_NUMBER)],WINBACK_OTP:[s$(h.Bf.WINBACK_LEGACY_OTP)]},s3={PERSONAL_INFO:[s$(h.Bf.PERSONAL_INFO),s$(h.Bf.CONTACT_CARD),s$(h.Bf.DOCUMENT_ID)]}
1,s6={PERSONAL_INFO:[s$(h.Bf.PERSONAL_INFO_WINBACK),s$(h.Bf.CONTACT_CARD),s$(h.Bf.DOCUMENT_ID)]},s4={PERSONAL_INFO:[s$(h.Bf.CONTACT_CARD),s$(h.Bf.DOCUMENT_ID)]},s7={OTP:[s$(h.Bf.CONFIRM_IDENDITY),s$(h.Bf.OTP)]},s9={OTP:[s$(h.Bf.CONFIRM_IDENDITY_APP),s$(h.Bf.OTP)]},s8={PORTABILITY:[s$(h.Bf.PORTABILITY)],PORTABILITY_NUMBER:[s$(h.Bf.PORTABILITY_NUMBER),s$(h.Bf.PORTABILITY_DATA)],PORTABILITY_OTP:[s$(h.Bf.PORTABILITY_OTP)]},ve={PORTABILITY_NUMBER:[s$(h.Bf.PORTABILITY_NUMBER_PORTABILITY_REQUIRED),s$(h.Bf.PORTABILITY_DATA)],PORTABILITY_OTP:[s$(h.Bf.PORTABILITY_OTP)]},vi={PORTABILITY_NUMBER:[s$(h.Bf.PORTABILITY_NUMBER_WINBACK),s$(h.Bf.PORTABILITY_DATA)],PORTABILITY_OTP:[s$(h.Bf.PORTABILITY_OTP)]},vn={TERMS:[s$(h.Bf.TERMS_AND_CONDITIONS),s$(h.Bf.CONSENTS)]},vo={RECOGNITION:[s$(h.Bf.RECOGNITION_ESIM),s$(h.Bf.RECOGNITION_CARD)]},vl={RECOGNITION:[s$(h.Bf.RECOGNITION_CARD)]},vt={RECOGNITION:[s$(h.Bf.RECOGNITION_ESIM_WINBACK),s$(h.Bf.RECOGNITION_CARD)]},vr={RECOGNITION:[s$(h.Bf.RECOGNITION_ESIM_SKIP_MNP),s$(h.Bf.RECOGNITION_CARD)]},vd={RECOGNITION:[s$(h.Bf.RECOGNITION_CARD_SKIP_MNP)]},va={DELIVERY:[s$(h.Bf.DELIVERY_ADDRESS)]},vu={PAYMENT_METHOD:[s$(h.Bf.PAYMENT_METHOD)]},vs={RECURRENT_PAYMENT_CARD:[s$(h.Bf.RECURRENT_PAYMENT_CARD)],WARNING_PRICE_CHANGE:[s$(h.Bf.WARNING_PRICE_CHANGE)]},vv={UPFRONT_PAYMENT:[s$(h.Bf.UPFRONT_PAYMENT)]},vc=[{title:"",component:void 0},{title:"",component:void 0}],vp={DEFAULT:[...s9.OTP,...s4.PERSONAL_INFO,...s8.PORTABILITY,...vo.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],ESIM_ONLY:[...s9.OTP,...s4.PERSONAL_INFO,...s8.PORTABILITY,...vl.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],SKIP_MNP:[...s9.OTP,...s4.PERSONAL_INFO,...vr.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],ESIM_ONLY_SKIP_MNP:[...s9.OTP,...s4.PERSONAL_INFO,...vd.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],PORTABILITY_REQUIRED:[...s9.OTP,...s4.PERSONAL_INFO,...ve.PORTABILITY_NUMBER,...vo.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc]},vm={DEFAULT:[...s3.PERSONAL_INFO,...s8.PORTABILITY,...vo.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],ESIM_ONLY:[...s3.PERSONAL_INFO,...s8.PORTABILITY,...vl.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],WINBACK:[...s2.WINBACK_NUMBER,...s2.WINBACK_OTP,...s6.PERSONAL_INFO,...vi.PORTABILITY_NUMBER,...vt.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],WINBACK_LEGACY:[...s5.WINBACK_NUMBER,...s5.WINBACK_OTP,...s6.PERSONAL_INFO,...vi.PORTABILITY_NUMBER,...vt.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],SKIP_MNP:[...s3.PERSONAL_INFO,...vr.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],ESIM_ONLY_SKIP_MNP:[...s3.PERSONAL_INFO,...vd.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc],PORTABILITY_REQUIRED:[...s3.PERSONAL_INFO,...ve.PORTABILITY_NUMBER,...vo.RECOGNITION,...va.DELIVERY,...vn.TERMS,...s1.VOUCHER,...vs.RECURRENT_PAYMENT_CARD,...vv.UPFRONT_PAYMENT,...vc]}},95956:function(e,i,n){n.d(i,{e:function(){return l},j:function(){return o}});let o="phone_cus",l="email_cus"},95294:function(e,i,n){n.d(i,{v_:function(){return A},Tz:function(){return I},wc:function(){return k},wp:function(){return C},mv:function(){return B},GW:function(){return D},gJ:function(){return R},De:function(){return O},yP:function(){return w},J5:function(){return P},bG:function(){return x},SV:function(){return g},C:function(){return N},sU:function(){return L},hH:function(){return h},Y2:function(){return E},b0:function(){return _},sS:function(){return T},Vp:function(){return S},$G:function(){return M}});var o=n(4217),l=n(11946),t=n(11958),r=n(71170),d=n(52378),a=n(3307),u=n(8665),s=n(11403),v=n(12755),c=n(5756),p=n(72631),m=n(57725),f=n(9399);let g=e=>{switch(e){case"CRM-0020":case"CRM-0024":return o.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT;case"CRM-0021":case"CRM-0023":return o.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT;case"CRM-0022":case"CRM-0025":return o.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT;default:return""}},E=e=>{var i,n,o;return(null==e?void 0:null===(o=e.value)||void 0===o?void 0:null===(n=o.trim())||void 0===n?void 0:null===(i=n.toLowerCase())||void 0===i?void 0:i.includes("esim"))||!1},h=()=>{var e,i;return!!(0,d.r)()&&(null===(i=window)||void 0===i?void 0:null===(e=i.location)||void 0===e?void 0:e.search).includes(o.S.ERROR_ON_PAYMENT)},b=()=>{var e,i;return!!(0,d.r)()&&(null===(i=window)||void 0===i?void 0:null===(e=i.location)||void 0===e?void 0:e.search).includes(o.S.MODE_DONE_SIA_RECURRENT)},y=e=>{var i;return e.enableVoucher&&!(null==e?void 0:null===(i=e.vouchers)||void 0===i?void 0:i.enableDefaultVoucher)||!1},C=()=>{let e=(0,m.S4)();return!!e&&(b()?p.Bf.UPFRONT_PAYMENT:(null==e?void 0:e.currentStepKey)||p.xz)},_=(e,i,n,o)=>{let l=e.findIndex(e=>e.title===n),t=e.slice(0,l+1),r=e.slice(l+1);if(i){if(o[0].title===r[0].title)return e;t=(t=t.concat(o)).concat(r)}else if(r[0].title===o[0].title){let e=r.slice(o.length);t=t.concat(e)}else if((null==o?void 0:o.findIndex(e=>e.title===r[0].title))>-1){let e=r.slice(1);t=t.concat(e)}else t=t.concat(r);return t},S=function(e){var i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=null==e?void 0:e.owningIndividual,t=(0,l.NE)(o);if(!o)return v.gE.owningIndividual;let r=null==n?void 0:n.filter(e=>e.id===(null==t?void 0:t.nationality)),d="",a=(null==t?void 0:t.expirationDate)?(e=>{let i=e.toString(),n=i.substring(0,4),o=i.substring(5,7);return i.substring(8).concat("/",o,"/",n)})(t.expirationDate):"";return(null==t?void 0:t.identificationType)==="1"?d="Carta d'identit\xe0":(null==t?void 0:t.identificationType)==="2"?d="Passaporto":(null==t?void 0:t.identificationType)==="3"&&(d="Patente di guida"),{nation:(null==o?void 0:o.nation)||"",firstName:(null==o?void 0:o.firstName)||"",lastName:(null==o?void 0:o.lastName)||"",fiscalCode:(null==o?void 0:o.fiscalCode)||"",identification:[{identificationType:d,nationality:(null==r?void 0:null===(i=r[0])||void 0===i?void 0:i.displayName)||"",identificationNumber:(null==t?void 0:t.identificationNumber)||"",expirationDate:a}],contactMedium:[null==o?void 0:o.contactMedium[0],null==o?void 0:o.contactMedium[1]]}},I=(e,i,n)=>{let l={title:(null==n?void 0:n.title)||"",message:(null==n?void 0:n.description)||"",actionText:(null==n?void 0:n.buttonLabel)||"",url:""},t=(i,n,o)=>{var l,t;let r=null==e?void 0:e.find(e=>e.error===i);return{title:(null==r?void 0:r.title)||n||"",message:(null==r?void 0:r.message)||o||"",actionText:(null==r?void 0:null===(l=r.button)||void 0===l?void 0:l.title)||"",url:(null==r?void 0:null===(t=r.button)||void 0===t?void 0:t.urlForRedirect)||"",isPopup:(null==r?void 0:r.isClickToCall)==="true",disableTrack:!0}};return i===o.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT&&(l=t(o.S.CREATE_CUSTOMER_PHONE_NUMBER_ALREADY_PRESENT,"Attenzione","Il numero di telefono inserito \xe8 gi\xe0 esistente")),i===o.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT&&(l=t(o.S.CREATE_CUSTOMER_EMAIL_ADDRESS_ALREADY_PRESENT,"Attenzione","L'e-mail inserita \xe8 gi\xe0 esistente")),i===o.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT&&(l=t(o.S.CREATE_CUSTOMER_CONTACT_ALREADY_PRESENT,"Attenzione","I dati di contatto inseriti sono associati ad un altro utente")),i===o.S.CREATE_CUSTOMER_FISCAL_CODE_ALREADY_PRESENT&&(l=t(o.S.CREATE_CUSTOMER_FISCAL_CODE_ALREADY_PRESENT,"Attenzione","Esiste gi\xe0 un utente con questo codice fiscale.")),i===o.S.CREATE_CUSTOMER_DOCUMENT_ALREADY_PRESENT&&(l=t(o.S.CREATE_CUSTOMER_DOCUMENT_ALREADY_PRESENT,"Attenzione","Il documento inserito \xe8 gi\xe0 presente")),i===o.S.CREATE_CUSTOMER_MISSING_NATION_ADDRESS&&(l=t(o.S.CREATE_CUSTOMER_MISSING_NATION_ADDRESS,"Attenzione","L'indirizzo selezionato non \xe8 disponibile. Si prega di riprovare pi\xf9 tardi")),i===o.S.ASSOCIATE_CUSTOMER_BLOCKED&&(l=t(o.S.ASSOCIATE_CUSTOMER_BLOCKED,"Attenzione","Questa offerta non \xe8 compatibile per questa tipologia di utente")),l},T=e=>{var i,n,o,l,t,r;return{titleErrorPayment:(null==e?void 0:null===(n=e.paymentsmobile)||void 0===n?void 0:null===(i=n.paymentError)||void 0===i?void 0:i.title)||"",messageErrorPayment:(null==e?void 0:null===(l=e.paymentsmobile)||void 0===l?void 0:null===(o=l.paymentError)||void 0===o?void 0:o.description)||"",actionTextErrorPayment:(null==e?void 0:null===(r=e.paymentsmobile)||void 0===r?void 0:null===(t=r.paymentError)||void 0===t?void 0:t.buttonLabel)||""}},A=e=>{let i=document.getElementById("stepper-cards-container"),n=document.getElementById("sticky-offer-stepper");i&&n&&("hide"===e?(i.style.visibility="hidden",n.style.visibility="hidden"):(i.style.visibility="inherit",n.style.visibility="inherit"))},R=(e,i)=>e.findIndex(e=>e.title===i),L=(e,i)=>{var n;t.KF.debug("product.addonList:",i.addonList);let o=e.getQueryData("getCmsAddonsMobile"),l=(0,a.f)("available_addons");if(!o||!(null==i?void 0:null===(n=i.addonList)||void 0===n?void 0:n.length)||!l.length||!Array.isArray(l))return!1;let r=((null==i?void 0:i.addonList)||[]).map(e=>{var i,n;let l=null===(n=o[e.cmsId||""])||void 0===n?void 0:null===(i=n.addondetails)||void 0===i?void 0:i.id;return(null==e?void 0:e.boId)||l}).filter(e=>"string"==typeof e);t.KF.debug("matchingAddonIds:",r);let d=r.some(e=>l.includes(e));return t.KF.debug("matchFound:",d),d},N=(e,i)=>{var n,o;let l=e.getQueryData("getCmsAddonsMobile");return t.KF.debug("addonListCMS",l),!!l&&null!==(o=null==i?void 0:null===(n=i.addonList)||void 0===n?void 0:n.some(e=>Object.keys(l||{}).some(i=>i===e.cmsId)))&&void 0!==o&&o},O=function(e){var i,n,o;let l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mobile",d=arguments.length>2?arguments[2]:void 0,u=(0,m.YZ)(),s=(0,m.SS)(),v=(0,a.f)("shoppingCart"),c=null===(o=window)||void 0===o?void 0:null===(n=o.location)||void 0===n?void 0:null===(i=n.href)||void 0===i?void 0:i.includes("checkOrder"),p=(null==u?void 0:u.isWinback)||(null==u?void 0:u.isWinbackLegacy);if(u&&d&&s){let{getCartProductsWithAddon:e,retrieveCartAddons:i}=(0,f.Vz)(d);l=e(u,i(s,"mobile"))}let g={cart_id:null==v?void 0:v.id,cart_product_id:"".concat(null==u?void 0:u.offerId),cart_product_name:null==u?void 0:u.slug,cart_product_category:t,cart_product_price:(null==u?void 0:u.price)&&(0,r.F)(u.price),cart_product_quantity:"1",cart_total:(null==u?void 0:u.price)&&(0,r.F)(u.price),...l&&l},E={product_name:(null==u?void 0:u.slug)||"",product_price:(null==u?void 0:u.price)?(0,r.F)(null==u?void 0:u.price):"",product_id:"".concat(null==u?void 0:u.offerId),product_quantity:"1",product_category:t};return{trackingProduct:g,opts:{event_label:e,product_target_segment:"consumer",event_category:"sales",page_subsection:"checkout",page_section:p?"campaign":"".concat(t," offers"),page_type:c?"order_loading":e,journey_type:"journey",journey_name:p?"winback":"checkout"},pageProductsInfo:E}},x=()=>{var e,i,n,o,t,r,u,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w,j,U,F,G,z,V;let{SHA256:Y}=s.default,H=(0,a.f)("user"),Z=(0,a.f)("silentLogin"),Q=(0,a.f)("loginEnriched"),W=l.L1.includes(null==Z?void 0:Z.flowId)||!1,K=(0,a.f)("customerData"),J=(0,d.r)()&&localStorage.getItem("appSession"),q=!!J&&JSON.parse(J),X=null==q?void 0:q.value,$=X||W?"logged in":"logged out";return{visitor_login_type:"web",...!!(0,l.ve)()&&{visitor_type:"returning visitor"},...(null==H?void 0:null===(e=H.customer)||void 0===e?void 0:e[0].id)&&{visitor_customer_id:null==H?void 0:H.customer[0].id},...(null==H?void 0:null===(i=H.taggedInfoCust)||void 0===i?void 0:i.email)&&{visitor_id_email:Y(null==H?void 0:null===(n=H.taggedInfoCust)||void 0===n?void 0:n.email).toString()},...(null==H?void 0:null===(o=H.customer)||void 0===o?void 0:o[0].msisdns)&&{visitor_id_asset_list:null==H?void 0:null===(r=H.customer)||void 0===r?void 0:null===(t=r[0].msisdns)||void 0===t?void 0:t.map(e=>{var i;return(null===(i=Y(e))||void 0===i?void 0:i.toString())||""})},...Q&&(null===(u=Q.items[0])||void 0===u?void 0:u.value)&&{visitor_id_asset_active:Y(null===(v=Q.items[0])||void 0===v?void 0:v.value).toString()},...X&&{visitor_id_asset_active:Y(X).toString()},...$&&{visitor_login_status:$},...K&&(null===(p=K[0])||void 0===p?void 0:null===(c=p.owningIndividual)||void 0===c?void 0:c.birthDate)&&{visitor_customer_dob:null===(f=K[0])||void 0===f?void 0:null===(m=f.owningIndividual)||void 0===m?void 0:m.birthDate},...K&&(null===(E=K[0])||void 0===E?void 0:null===(g=E.owningIndividual)||void 0===g?void 0:g.gender)&&{visitor_customer_gender:null===(b=K[0])||void 0===b?void 0:null===(h=b.owningIndividual)||void 0===h?void 0:h.gender},...K&&(null===(C=K[0])||void 0===C?void 0:null===(y=C.billingAddress)||void 0===y?void 0:y.city)&&{visitor_customer_location_city:null===(S=K[0])||void 0===S?void 0:null===(_=S.billingAddress)||void 0===_?void 0:_.city},...K&&(null===(T=K[0])||void 0===T?void 0:null===(I=T.owningIndividual)||void 0===I?void 0:I.nation)&&{visitor_customer_location_country:null===(R=K[0])||void 0===R?void 0:null===(A=R.owningIndividual)||void 0===A?void 0:A.nation}
1,...K&&(null===(N=K[0])||void 0===N?void 0:null===(L=N.billingAddress)||void 0===L?void 0:L.postalCode)&&{visitor_customer_location_id:null===(x=K[0])||void 0===x?void 0:null===(O=x.billingAddress)||void 0===O?void 0:O.postalCode},...K&&(null===(M=K[0])||void 0===M?void 0:null===(P=M.owningIndividual)||void 0===P?void 0:P.firstName)&&{visitor_customer_name_first:null===(D=K[0])||void 0===D?void 0:null===(k=D.owningIndividual)||void 0===k?void 0:k.firstName},...K&&(null===(w=K[0])||void 0===w?void 0:null===(B=w.owningIndividual)||void 0===B?void 0:B.lastName)&&{visitor_customer_name_last:null===(U=K[0])||void 0===U?void 0:null===(j=U.owningIndividual)||void 0===j?void 0:j.lastName},...K&&(null===(G=K[0])||void 0===G?void 0:null===(F=G.billingAddress)||void 0===F?void 0:F.stateOrProvince)&&{visitor_customer_region:null===(V=K[0])||void 0===V?void 0:null===(z=V.billingAddress)||void 0===z?void 0:z.stateOrProvince}}},P=e=>{if(!e)return[];let i=()=>{let i=c.Cx.DEFAULT;return(null==e?void 0:e.skipMnp)&&!(null==e?void 0:e.isEsimOnly)&&(i=c.Cx.SKIP_MNP),!(null==e?void 0:e.skipMnp)&&(null==e?void 0:e.isEsimOnly)&&(i=c.Cx.ESIM_ONLY),(null==e?void 0:e.skipMnp)&&(null==e?void 0:e.isEsimOnly)&&(i=c.Cx.ESIM_ONLY_SKIP_MNP),(null==e?void 0:e.isWinback)&&(i=c.Cx.WINBACK),(null==e?void 0:e.isWinbackLegacy)&&(i=c.Cx.WINBACK_LEGACY),(null==e?void 0:e.isRequiredPortability)&&(i=c.Cx.PORTABILITY_REQUIRED),y(e)||(i=i.filter(e=>e.title!==p.Bf.VOUCHER)),i};if(u.checkIsApp()){var n;let o;return(0,a.f)("appSession")?(o=c.ie.DEFAULT,(null==e?void 0:e.skipMnp)&&!(null==e?void 0:e.isEsimOnly)&&(o=c.ie.SKIP_MNP),!(null==e?void 0:e.skipMnp)&&(null==e?void 0:e.isEsimOnly)&&(o=c.ie.ESIM_ONLY),(null==e?void 0:e.skipMnp)&&(null==e?void 0:e.isEsimOnly)&&(o=c.ie.ESIM_ONLY_SKIP_MNP),(null==e?void 0:e.isRequiredPortability)&&(o=c.ie.PORTABILITY_REQUIRED),(!y(e)||(null==e?void 0:null===(n=e.vouchers)||void 0===n?void 0:n.enableDefaultVoucher))&&(o=o.filter(e=>e.title!==p.Bf.VOUCHER)),o):i()}return i()},M=e=>{let i=e.map(e=>e.title);localStorage.setItem("sstps",JSON.stringify(i))},k=e=>{let i,n,o;if(!e)return[];let l=(0,a.f)("sstps");return i=l?(null==l?void 0:l.map(e=>c.Mo.find(i=>i.title===e)||{}))||[]:c.Cx.DEFAULT,y(e)||(n=i,o=p.Bf.VOUCHER,i=(null==n?void 0:n.filter(e=>(null==e?void 0:e.title)!==o))||n||[]),i},D=e=>{var i;let n=(0,l.AQ)();if(!(n===l.xx.LOGGED_USER||n===l.xx.NEXT_USER_ACTIVE)||!e)return;let o=(null==e?void 0:null===(i=e.owningIndividual)||void 0===i?void 0:i.contactMedium)||[];return null==o?void 0:o.find(e=>"postalAddress"==e.type)},B=e=>{let i=(0,l.AQ)();if((i===l.xx.LOGGED_USER||i===l.xx.NEXT_USER_ACTIVE)&&e)return null==e?void 0:e.billingAddress},w=(e,i,n)=>{var o,r,d,a,u,s,v,c;let p=(0,m.YZ)(),f=[(null==e?void 0:null===(o=e.error)||void 0===o?void 0:o.url)||"",(null==e?void 0:null===(r=e.error)||void 0===r?void 0:r.status)||"",(null==e?void 0:e.errorType)||"",(null==e?void 0:e.errorCode)||"",(null==e?void 0:e.isBlocking)?"blk":"nblk",i||""].filter(Boolean).join("_"),g=(null===(d=localStorage)||void 0===d?void 0:d.getItem(t.SX))||"",E=(null===(a=localStorage)||void 0===a?void 0:a.getItem(t.R1))||"",h=(null==e?void 0:e.transaction_id)||g,b=(null==e?void 0:e.err_errorMessage)||E,y=O("","mobile",n).trackingProduct,C=(0,l.AQ)();return{flow:"mobile",event_name:"page_error",event_label_track:"page_error",event_category:"error",page_error:f,page_error_code:(null==e?void 0:e.errorCode)||"",page_type:"error page",slug:(null==p?void 0:p.slug)||"",isBlocking:(null==e?void 0:e.isBlocking)?"Y":"N",step:i,...(null==p?void 0:p.offerId)&&{offerId:null==p?void 0:p.offerId},...y&&y,...(null==y?void 0:y.cart_id)&&{cart_id:null==y?void 0:y.cart_id},...h&&{transaction_id:h},...(null==e?void 0:null===(u=e.error)||void 0===u?void 0:u.status)&&{status:null==e?void 0:null===(s=e.error)||void 0===s?void 0:s.status},...(null==e?void 0:null===(v=e.error)||void 0===v?void 0:v.url)&&{service_name:null==e?void 0:null===(c=e.error)||void 0===c?void 0:c.url},...C&&{user_type:C},...b&&{err_errorMessage:b},...(null==e?void 0:e.err_errorCode)&&{err_errorCode:null==e?void 0:e.err_errorCode},...(null==e?void 0:e.err_backendErrorMessage)&&{err_backendErrorMessage:null==e?void 0:e.err_backendErrorMessage},...(null==e?void 0:e.err_backendErrorCode)&&{err_backendErrorCode:null==e?void 0:e.err_backendErrorCode},...(null==e?void 0:e.err_backendSource)&&{err_backendSource:null==e?void 0:e.err_backendSource},...(null==e?void 0:e.otherInfo)&&{otherInfo:e.otherInfo}}}},19301:function(e,i,n){n.d(i,{k3:function(){return u},Vz:function(){return s},_J:function(){return v},xP:function(){return c},BL:function(){return p},QY:function(){return r}});var o,l,t=n(3307);(o=l||(l={})).ATL="atl",o.BTL="btl";let r=(e,i)=>{var n,o,l,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w;return{cardTitle:(null==e?void 0:null===(l=e.personalinfomobile)||void 0===l?void 0:null===(o=l.simType)||void 0===o?void 0:null===(n=o.card)||void 0===n?void 0:n.title)||"",cardDescription:(null==e?void 0:null===(d=e.personalinfomobile)||void 0===d?void 0:null===(r=d.simType)||void 0===r?void 0:null===(t=r.card)||void 0===t?void 0:t.description)||"",bestChoiceLabel:(null==e?void 0:null===(s=e.personalinfomobile)||void 0===s?void 0:null===(u=s.simType)||void 0===u?void 0:null===(a=u.card)||void 0===a?void 0:a.bestChoiceLabel)||"",modalInfo:{textLink:(null==e?void 0:null===(p=e.personalinfomobile)||void 0===p?void 0:null===(c=p.simType)||void 0===c?void 0:null===(v=c.modalInfo)||void 0===v?void 0:v.textLink)||"",titleModal:(null==e?void 0:null===(g=e.personalinfomobile)||void 0===g?void 0:null===(f=g.simType)||void 0===f?void 0:null===(m=f.modalInfo)||void 0===m?void 0:m.title)||"",descriptionModal:(null==e?void 0:null===(b=e.personalinfomobile)||void 0===b?void 0:null===(h=b.simType)||void 0===h?void 0:null===(E=h.modalInfo)||void 0===E?void 0:E.description)||""},migrationCodeError:{title:(null==i?void 0:null===(C=i.portabilitymobile)||void 0===C?void 0:null===(y=C.errorOnPortability)||void 0===y?void 0:y.title)||"",description:(null==i?void 0:null===(S=i.portabilitymobile)||void 0===S?void 0:null===(_=S.errorOnPortability)||void 0===_?void 0:_.message)||"",buttonLabel:(null==i?void 0:null===(T=i.portabilitymobile)||void 0===T?void 0:null===(I=T.errorOnPortability)||void 0===I?void 0:I.buttonLabel)||""},genericsError:{title:(null==i?void 0:null===(R=i.portabilitymobile)||void 0===R?void 0:null===(A=R.errorMod
1al)||void 0===A?void 0:A.title)||"",description:(null==i?void 0:null===(N=i.portabilitymobile)||void 0===N?void 0:null===(L=N.errorModal)||void 0===L?void 0:L.message)||"",buttonLabel:(null==i?void 0:null===(x=i.portabilitymobile)||void 0===x?void 0:null===(O=x.errorModal)||void 0===O?void 0:O.buttonLabel)||""},numberError:{title:(null==i?void 0:null===(M=i.portabilitymobile)||void 0===M?void 0:null===(P=M.errorNumber)||void 0===P?void 0:P.title)||"",description:(null==i?void 0:null===(D=i.portabilitymobile)||void 0===D?void 0:null===(k=D.errorNumber)||void 0===k?void 0:k.message)||"",buttonLabel:(null==i?void 0:null===(w=i.portabilitymobile)||void 0===w?void 0:null===(B=w.errorNumber)||void 0===B?void 0:B.buttonLabel)||""}}},d=e=>parseFloat((null==e?void 0:e.replace(",",".").replace("€",""))||"0"),a=(e,i)=>d(e.price)-d(i.price),u=(e,i,n)=>{var o,l;let t=!1;return(null==n?void 0:null===(o=n.avaiableOperators)||void 0===o?void 0:o.find(i=>{var n;return(null===(n=i.elements)||void 0===n?void 0:n.trim())===e}))!==void 0&&(t=!0),null==n||null===(l=n.avaiableGroups)||void 0===l||l.forEach(n=>{var o;let l=null==i?void 0:i.find(e=>e.id===n.elements);(null==l?void 0:null===(o=l.operator)||void 0===o?void 0:o.find(i=>{var n;return(null==i?void 0:null===(n=i.operators)||void 0===n?void 0:n.trim())===e}))!==void 0&&(t=!0)}),t},s=(e,i,n,o)=>{let t=null==n?void 0:n.filter(i=>i.productCategory===e.productCategory),r=[];switch(e.offerCategorization){case l.BTL:r=null==t?void 0:t.filter(e=>u(i,o,e.offerAvaiability));break;case l.ATL:r=e.fallbackToBtl?null==t?void 0:t.filter(e=>u(i,o,e.offerAvaiability)):null==t?void 0:t.filter(e=>e.offerCategorization===l.ATL).filter(e=>u(i,o,e.offerAvaiability))}if(r&&r.length>0)return 1===r.length?r[0]:r.sort(a)[0]},v=e=>{let i=(0,t.f)("portabilityInfo");if(void 0!==i&&Object.keys(i).length>0){var n,o,l,r;let t=((null==i?void 0:null===(n=i.portInDetails)||void 0===n?void 0:n.mobilePortInDetails)&&(null==i?void 0:null===(r=i.portInDetails)||void 0===r?void 0:null===(l=r.mobilePortInDetails[0])||void 0===l?void 0:null===(o=l.portInProviderCust)||void 0===o?void 0:o.availableValues)||[]).find(i=>i.value===e);return null==t?void 0:t.displayValue}},c=(e,i)=>{var n;let{offerDetails:o,title:l,price:t,conditions:r,description:d,recurrence:a,specs:u,digitalBundleConfig:s,fallbackCtcEnabled:c}=e;return{price:t||"",recurrence:a||"",cTCEnabled:c||!1,offerDetails:{conditions:r||[],offerDetails:o||[],disableSecondAction:(null==s?void 0:s.disableSecondAction)||!1,title:l},priceDescription:d||"",offerProposition:{title:(null==s?void 0:null===(n=s.title)||void 0===n?void 0:n.replace("$OPERATOR",v(i)||""))||"",description:(null==s?void 0:s.description)||"",showDetailLabel:(null==s?void 0:s.showDetail
1sLabel)||""},specs:u||[],firstButtonAction:(null==s?void 0:s.firstAction)||{},secondButtonAction:(null==s?void 0:s.secondAction)||{}}},p=(e,i)=>{var n;return{title:(null==e?void 0:e.title)||"",description:(null==e?void 0:null===(n=e.description)||void 0===n?void 0:n.replace("$OPERATOR",v(i)||""))||"",buttonLabel:(null==e?void 0:e.buttonLabel)||"",url:null==e?void 0:e.url}}},77286:function(e,i,n){n.d(i,{D:function(){return I}});var o=n(2784),l=n(82066),t=n(34759),r=n(11946),d=n(15565),a=n(25184),u=n(26382),s=n(69011),v=n(10255),c=n(79753),p=n(12517),m=n(62110),f=n(74145),g=n(74228),E=n(85363),h=n(27115),b=n(45867),y=n(3307),C=n(94941),_=n(94198),S=n(59830);let I=e=>{let{ignoreQueryString:i}=e,n=(0,y.f)("shoppingCart"),I=window.location.search,{portability:T,portabilityStatus:A,voucher:R,setPortabilityStatus:L}=(0,_.Mg)(),N=(0,t.CA)(t.Jn,b.bl.CMS_GET_GLOBAL_CONFIG),[O,x]=(0,o.useState)(!1),[P,M]=(0,o.useState)(!0),[k,D]=(0,o.useState)(!1),[B,w]=(0,o.useState)({errorMessage:"",error:void 0}),j=(0,l.useQueryClient)(),U=j.getQueryData("authorizationError"),F=j.getQueryData("modifyPhoneNumberProductQuery"),G=(null==R?void 0:R.isAppliedVoucher)||!1,{isTpoOffer:z,isInCampaignTpo:V,isLoadingCheck:Y,isEligible:H,token:Z,isEnabledFwAmdIntegration:Q}=(0,S.I)(),{refetch:W,data:K,isSuccess:J,isError:q,isLoading:X}=(0,d.O)({enabled:!1}),{error:$,isLoading:ee,mutate:ei,isError:en,isSuccess:eo}=(0,g.QJ)(),{isError:el,isLoading:et}=(0,a.b)(void 0,N),er=(0,s.d)(),ed=(0,v.WQ)(),ea=localStorage.getItem(r.aY),{data:eu,error:es,isLoading:ev,isSuccess:ec,isError:ep,mutate:em}=(0,c.j)(),ef=(0,u.v)(),eg=(0,m.TT)(),eE=(0,f.n3)(),{isLoading:eh,isError:eb,isSuccess:ey,data:eC,error:e_,mutate:eS}=(null==ea?void 0:ea.toLowerCase())===h.Q.CREDIT_CARD.toLowerCase()?eg:eE,{isLoading:eI,isSuccess:eT,isError:eA,mutate:eR}=(0,C.n)(),{reset:eL,mutateAsync:eN,isLoading:eO,isSuccess:ex,isError:eP,error:eM,data:ek}=(0,p.H)(),eD=()=>{let e=(0,r.kt)();!e&&z&&V?(D(!1),M(!1),x(!0)):e&&(null==eC?void 0:eC.fwStatus)==="KO"?(M(!1),x(!1),D(!0),w({errorCode:null==eC?void 0:eC.fwStatusCode})):e?eR({t:(0,r.kt)()||"",idOrder:null==n?void 0:n.id}):(D(!1),M(!1),x(!0))},eB=()=>{z&&!V?eR({t:Z||"",idOrder:null==n?void 0:n.id}):(D(!1),M(!1),x(!0))},ew=()=>{var e,i;let n=null==R?void 0:null===(i=R.validateVoucher)||void 0===i?void 0:null===(e=i.data)||void 0===e?void 0:e.parentBoId;G&&n?eN({boArray:[n],voucherId:(null==R?void 0:R.voucherId)||"",status:"unreserve"}):(M(!1),x(!1),D(!0),w((0,r.nQ)("submit",e_||{status:"500",statusText:"KO",url:(null==ea?void 0:ea.toLowerCase())===h.Q.CREDIT_CARD.toLowerCase()?b.bl.SUBMIT:b.bl.SUBMIT_WITH_PAYMENT})))},ej=()=>{var e,i;let n=null==R?void 0:null===(i=R.validateVoucher)||void 0===i?void 0:null===(e=i.data)||void 0===e?void 0:e.parentBoId;G&&n?eN({boArray:[n],voucherId:(null==R?void 0:R.voucherId)||"",status:"reserve"}):eS()};return(0,o.useEffect)(()=>{if(G&&!eb){if(eP)M(!1),x(!1),D(!0),w({errorType:"RESERVE_VOUCHER_ERROR",errorCode:(null==eM?void 0:eM.status)||"500",error:eM,errorMessage:(null==eM?void 0:eM.statusText)||"RESERVE_VOUCHER_ERROR",isBlocking:!0});else if(ex){var e,i,n,o,l;(null==ek?void 0:null===(i=ek.message)||void 0===i?void 0:null===(e=i.trim())||void 0===e?void 0:e.toUpperCase())!=="OK"&&(null==ek?void 0:null===(n=ek.returnedCode)||void 0===n?void 0:n.toString())!=="0"&&(M(!1),x(!1),D(!0),w({errorType:"RESERVE_VOUCHER_ERROR",errorCode:"200",errorMessage:"reserveVoucher is ko",isBlocking:!0})),(null==ek?void 0:null===(l=ek.message)||void 0===l?void 0:null===(o=l.trim())||void 0===o?void 0:o.toUpperCase())==="OK"&&(eS(),eL())}}},[ex,eO,eP]),(0,o.useEffect)(()=>{(null==A?void 0:A.isSuccess)&&(null==A?void 0:A.isStartFinalPortIn)&&(null==ef?void 0:ef.isSuccess)&&!ey&&!eh&&!eb?ej():(null==A?void 0:A.isError)&&(M(!1),x(!1),D(!0),w(F))},[A,null==ef?void 0:ef.isSuccess,ey,eh]),(0,o.useEffect)(()=>{!eI&&(eT||eA)&&(D(!1),M(!1),x(!0))},[eT,eI,eA]),(0,o.useEffect)(()=>{if(!eh){if(ey){var e;(null==eC?void 0:null===(e=eC.status)||void 0===e?void 0:e.toLowerCase())==="softko"?(M(!1),x(!1),D(!0),w((0,r.nQ)("submit",{status:"200",statusText:"SoftKO",url:(null==ea?void 0:ea.toLowerCase())===h.Q.CREDIT_CARD.toLowerCase()?b.bl.SUBMIT:b.bl.SUBMIT_WITH_PAYMENT}))):Q?eD():eB()}else eb&&ew()}},[ey,eh,eb,e_]),(0,o.useEffect)(()=>{en?(M(!1),x(!1),D(!0),w($)):eo&&em()},[eo,ee,en]),(0,o.useEffect)(()=>
1{if(!ef.isLoading){if(ef.isSuccess){var e,i;(null===(e=Object.entries(ef.data))||void 0===e?void 0:e.length)>0&&(null===(i=ef.data.lcvStatus)||void 0===i?void 0:i.toUpperCase())==="ROSSO"&&(M(!1),x(!1),D(!0),w((0,r.nQ)("submit",{status:"200",statusText:"KO due to lcvStatus RED",url:b.bl.LIGHT_CREDIT_VETTING}))),E.K.debug("useCheckoutFlow lightCreditVettingMutation.data",ef.data),(null==T?void 0:T.portabilityWant)&&(null==A?void 0:A.isSuccessCheck)?L({...A,isStartFinalPortIn:!0}):(null==T?void 0:T.portabilityWant)||eb||ej()}else ef.isError&&(M(!1),x(!1),D(!0),w((0,r.nQ)("lightCreditVetting",(null==ef?void 0:ef.error)?null==ef?void 0:ef.error:{status:"500",statusText:"KO",url:b.bl.LIGHT_CREDIT_VETTING})))}},[ef.isLoading,ef.isSuccess,ef.isError,ef.data,T]),(0,o.useEffect)(()=>{!ev&&(ec?(null==eu?void 0:eu.status)==="KO"?(M(!1),x(!1),D(!0),w((0,r.nQ)("reserveEquipment",{status:"200",statusText:"KO",url:b.bl.RESERVE_EQUIPMENT},"KO"))):ef.mutate():ep&&(M(!1),x(!1),D(!0),w((0,r.nQ)("reserveEquipment",es||{status:"500",statusText:"KO",url:b.bl.RESERVE_EQUIPMENT}))))},[ec,ep,ev,es]),(0,o.useEffect)(()=>{if(!ed.isLoading){if(ed.isSuccess){var e,i,n,o;(null===(e=ed.data)||void 0===e?void 0:e.error)?(M(!1),x(!1),D(!0),w(ed.data)):(null==K?void 0:null===(o=K.authorization)||void 0===o?void 0:null===(n=o.payMean)||void 0===n?void 0:null===(i=n.type)||void 0===i?void 0:i.toLowerCase())===h.Q.BANK_ACCOUNT?ei():em()}else ed.isError&&(M(!1),x(!1),D(!0),w((0,r.nQ)("paymentDistribution",(null==ed?void 0:ed.error)?null==ed?void 0:ed.error:{status:"500",statusText:"KO",url:b.bl.PAYMENT_DISTRIBUTION})))}},[ed.isLoading,ed.isSuccess,ed.isError]),(0,o.useEffect)(()=>{if(E.K.debug("queryString",I),(null==I?void 0:I.includes(h.y.URL_FORWARD))||i){if(J&&!X)(null==U?void 0:U.error)?(M(!1),x(!1),D(!0),w(U)):(E.K.debug("useCheckoutFlow authorizationOrderData : ",K),E.K.debug("useCheckoutFlow calling paymentDistributionMutation.mutate()"),er.mutate(),ed.mutate());else if(el&&!et){M(!1),x(!1),D(!0);let e=(0,y.f)("payMean"),i=(0,y.f)("authorizationError");el?w(e):w(i)}}},[X,q,J,el]),(0,o.useEffect)(()=>{!Y&&(!z||z&&H||z&&!Q)&&W()},[Y]),{isLoading:P,isSuccess:O,isError:k,error:B,lightCreditVettingMutation:ef}}},59830:function(e,i,n){n.d(i,{I:function(){return a}});var o=n(11946),l=n(2784),t=n(88638),r=n(35325),d=n(94198);let a=()=>{let{product:e}=(0,d.Mg)(),[i,n]=(0,l.useState)(!0),[a,u]=(0,l.useState)({isStartFlow:!1,customerToken:""}),s=(0,o.kt)(),{isLoading:v,isEligible:c}=(0,r.G)({...a}),p=()=>{t.D.handleError(t.T.getSeverityErrorHigh(),{title:"Ops",message:"Si \xe8 verificato un problema. Riprovare in seguito",fullscreen:!0,disableCloseModalOnClickAction:!0})};return(0,l.useEffect)(()=>{(0,o.RQ)()||(v||c||!s?c&&!v&&n(!1):p())},[v,c]),(0,l.useEffect)(()=>{let i=(0,o.RQ)();(null==e?void 0:e.isTpoOffer)&&!(null==e?void 0:e.forceCampaign)&&s&&!i?u({isStartFlow:!0,customerToken:s}):null==e||!e.isTpoOffer||(null==e?void 0:e.forceCampaign)||i?n(!1):p()},[e]),{isEnabledFwAmdIntegration:!!(0,o.RQ)(),isTpoOffer:(null==e?void 0:e.isTpoOffer)||!1,isInCampaignTpo:(null==e?void 0:e.forceCampaign)||!1,isLoadingCheck:i,isEligible:c,token:s}}},74080:function(e,i,n){n.d(i,{ox:function(){return u},vn:function(){return d},Q_:function(){return a}});var o=n(11946),l=n(68354),t=n(52378),r=n(57725);let d=(e,i)=>{var n,t,r,d,a,u,s,v,c,p,m,f,g,E,h,b,y,C,_,S,I,T,A,R,L,N,O,x,P,M,k,D,B,w,j,U,F,G,z,V,Y,H,Z,Q,W,K,J,q,X,$,ee;let ei=(0,o.k1)(),en=(0,o.Bv)(o.MM.RECURRING),eo=(0,o.Bv)(o.MM.SHIPPING),el=null==eo?void 0:eo.formattedPrice,et=(null==ei?void 0:null===(n=ei.formattedPrice)||void 0===n?void 0:n.toString())||0,er=(null==en?void 0:null===(t=en.formattedPrice)||void 0===t?void 0:t.toString())||0,ed=localStorage.getItem("recognition")||"",ea="1"===localStorage.getItem("isEsim")&&ed===l.V.VR,eu=[o.MM.PLACEHOLDER_ONETIME,o.MM.PLACEHOLDER_RECURRENCE],es=[o.MM.PLACEHOLDER_ONETIME,o.MM.PLACEHOLDER_RECURRENCE,o.MM.PLACEHOLDER_SHIPPING_PRICE],ev=[o.MM.PLACEHOLDER_RECURRING,o.MM.PLACEHOLDER_ONETIME,o.MM.PLACEHOLDER_RECURRENCE],ec=[o.MM.PLACEHOLDER_RECURRING,o.MM.PLACEHOLDER_ONETIME,o.MM.PLACEHOLDER_RECURRENCE,o.MM.PLACEHOLDER_SHIPPING_PRICE],ep=[o.MM.PLACEHOLDER_RECURRING,o.MM.PLACEHOLDER_RECURRENCE],em=[o.MM.PLACEHOLDER_RECURRING,o.MM.PLACEHOLDER_RECURRENCE,o.MM.PLACEHOLDER_SHIPPING_PRICE],ef=(e,i)=>{let n=!1;
1return i.forEach(i=>{n=n||e.includes(i)}),n};if(e){switch(et&&er?(ef((null==e?void 0:e.priceActivationRecurring)||"",ev)&&(e.price=(null===(p=e.priceActivationRecurring)||void 0===p?void 0:null===(c=p.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===c?void 0:null===(v=c.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===v?void 0:v.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),ef((null==e?void 0:e.subpriceActivationRecurring)||"",ev)&&(e.subprice=(null===(g=e.subpriceActivationRecurring)||void 0===g?void 0:null===(f=g.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===f?void 0:null===(m=f.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===m?void 0:m.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),el&&ef((null==e?void 0:e.descriptionActivationRecurringShipping)||"",ec)?e.description=(null===(y=e.descriptionActivationRecurringShipping)||void 0===y?void 0:null===(b=y.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===b?void 0:null===(h=b.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===h?void 0:null===(E=h.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||void 0===E?void 0:E.replace(o.MM.PLACEHOLDER_SHIPPING_PRICE,(null==el?void 0:el.toString())||""))||"":ef((null==e?void 0:e.descriptionActivationRecurring)||"",ev)&&(e.description=(null===(S=e.descriptionActivationRecurring)||void 0===S?void 0:null===(_=S.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===_?void 0:null===(C=_.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===C?void 0:C.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||"")):et&&!er?(ef((null==e?void 0:e.priceActivation)||"",eu)&&(e.price=(null===(T=e.priceActivation)||void 0===T?void 0:null===(I=T.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===I?void 0:I.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),ef((null==e?void 0:e.subpriceActivation)||"",eu)&&(e.subprice=(null===(R=e.subpriceActivation)||void 0===R?void 0:null===(A=R.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===A?void 0:A.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),el&&ef((null==e?void 0:e.descriptionActivationShipping)||"",es)?e.description=(null===(O=e.descriptionActivationShipping)||void 0===O?void 0:null===(N=O.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===N?void 0:null===(L=N.replace(o.MM.PLACEHOLDER_SHIPPING_PRICE,(null==el?void 0:el.toString())||""))||void 0===L?void 0:L.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||"":ef((null==e?void 0:e.descriptionActivation)||"",eu)&&(e.description=(null===(P=e.descriptionActivation)||void 0===P?void 0:null===(x=P.replace(o.MM.PLACEHOLDER_ONETIME,"".concat(et,"€")||0))||void 0===x?void 0:x.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||"")):!et&&er?(ef((null==e?void 0:e.priceRecurring)||"",ep)&&(e.price=(null===(k=e.priceRecurring)||void 0===k?void 0:null===(M=k.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===M?void 0:M.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),ef((null==e?void 0:e.subpriceRecurring)||"",ep)&&(e.subprice=(null===(B=e.subpriceRecurring)||void 0===B?void 0:null===(D=B.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===D?void 0:D.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),el&&ef((null==e?void 0:e.descriptionRecurringShipping)||"",em)?e.description=(null===(U=e.descriptionRecurringShipping)||void 0===U?void 0:null===(j=U.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===j?void 0:null===(w=j.replace(o.MM.PLACEHOLDER_SHIPPING_PRICE,(null==el?void 0:el.toString())||""))||void 0===w?void 0:w.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||"":ef((null==e?void 0:e.descriptionRecurring)||"",ep)&&(e.description=(null===(G=e.descriptionRecurring)||void 0===G?void 0:null===(F=G.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===F?void 0:F.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||"")):(ef((null==e?void 0:e.price)||"",ev)&&(e.price=(null===(Y=e.price)||void 0===Y?void 0:null===(V=Y.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===V?void 0:null===(z=V.replace(o.MM.PLACEHOLDER_ONETIME,et||""))||void 0===z?void 0:z.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),ef((null==e?void 0:e.subprice)||"",ev)&&(e.subprice=(null===(Q=e.subprice)||void 0===Q?void 0:null===(Z=Q.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===Z?void 0:null===(H=Z.replace(o.MM.PLACEHOLDER_ONETIME,et||""))||void 0===H?void 0:H.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),ef((null==e?void 0:e.description)||"",ec)&&
1(e.description=(null===(q=e.description)||void 0===q?void 0:null===(J=q.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===J?void 0:null===(K=J.replace(o.MM.PLACEHOLDER_ONETIME,et||""))||void 0===K?void 0:null===(W=K.replace(o.MM.PLACEHOLDER_SHIPPING_PRICE,(null==el?void 0:el.toString())||""))||void 0===W?void 0:W.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||"")),ea&&(e.description=(null===(ee=e.descriptionESimFD)||void 0===ee?void 0:null===($=ee.replace(o.MM.PLACEHOLDER_RECURRING,er||""))||void 0===$?void 0:null===(X=$.replace(o.MM.PLACEHOLDER_ONETIME,et||""))||void 0===X?void 0:X.replace(o.MM.PLACEHOLDER_RECURRENCE,e.recurrence||""))||""),e.cartPrices={immediatePrice:{amount:(0,o.BT)(!1)},firstInvoicePrice:{amount:(0,o.Y2)()||0},recurringPrice:{oldAmount:null===(r=(0,o.Bv)(o.MM.RECURRING))||void 0===r?void 0:r.originalFormattedPrice,amount:null===(d=(0,o.Bv)(o.MM.RECURRING))||void 0===d?void 0:d.formattedPrice},offerPrice:{amount:(null===(a=(0,o.Ou)())||void 0===a?void 0:a.formattedPrice)||0,oldAmount:(null===(u=(0,o.Ou)())||void 0===u?void 0:u.originalFormattedPrice)||0,recurringPeriod:(null===(s=(0,o.Ou)())||void 0===s?void 0:s.recurringPeriod)||0}},e.recurringCost=(null==en?void 0:en.price)||0,e.oneTimeCost=(null==ei?void 0:ei.price)||0,e.shippingCost=(null==eo?void 0:eo.price)||0,i){case l.Z.EDIT_WALLET:e.backupOfferDetails=JSON.parse(JSON.stringify(e.offerDetails)),e.backupConditions=JSON.parse(JSON.stringify(e.conditions)),e.offerDetails=e.offerDetailsWallet,e.conditions=e.conditionsWallet;break;case l.Z.RESET:e.backupOfferDetails&&(e.offerDetails=e.backupOfferDetails,delete e.backupOfferDetails),e.backupConditions&&(e.conditions=e.backupConditions,delete e.backupConditions)}e.isUpdatedPriceWallet=i===l.Z.EDIT_WALLET,(0,o.nM)(e)}return e},a=e=>{let i=e?(0,o.Ix)(e):"",n=(0,r.YZ)(!0);n&&(0,t.r)()&&(0,o.nM)({...n,...i&&{hubPath:i},shoppingCartUrl:window.location.href})},u=e=>{let i=[],n=null==e?void 0:e.bundledAddOnGroupConfiguration;return n&&n.forEach(e=>{var n;null==e||null===(n=e.bundledAddOnConfiguration)||void 0===n||n.forEach(e=>{i.push(null==e?void 0:e.offeringId)})}),i}},12755:function(e,i,n){n.d(i,{$i:function(){return U},AN:function(){return E},BQ:function(){return O},Bi:function(){return D},Bm:function(){return l},Dw:function(){return L},Ev:function(){return j},FF:function(){return V},IS:function(){return R},Mf:function(){return s},NI:function(){return $},Nd:function(){return K},QV:function(){return _},Qe:function(){return M},R8:function(){return q},UN:function(){return Z},UT:function(){return G},Uq:function(){return k},XH:function(){return y},XM:function(){return a},Xn:function(){return F},Y$:function(){return x},Z:function(){return I},Zm:function(){return en},_F:function(){return z},cZ:function(){return v},cv:function(){return u},dF:function(){return d},e0:function(){return c},e2:function(){return p},er:function(){return X},ex:function(){return N},fn:function(){return t},gE:function(){return r},gP:function(){return J},i:function(){return m},iQ:function(){return w},iV:function(){return B},jQ:function(){return H},k0:function(){return S},kN:function(){return Y},mY:function(){return A},n:function(){return T},n8:function(){return h},nj:function(){return P},ns:function(){return el},oF:function(){return ei},p4:function(){return eo},r_:function(){return W},u7:function(){return Q},vQ:function(){return g},xm:function(){return b},y4:function(){return C},zg:function(){return ee},zl:function(){return f}});var o=n(72631);let l="ctxk",t="",r={owningIndividual:{nation:"",fiscalCode:"",firstName:"",lastName:"",contactMedium:[{type:"email",preferred:!0,emailAddress:""},{type:"phone",preferred:!1,phoneNumber:""}],identification:[{identificationType:"",nationality:"",identificationNumber:"",expirationDate:""}]},isValid:!1,isLogged:!1},d={checkContactProblem:!0},a={portabilityNumber:"",portabilityWant:void 0,portabilityMigration:{currentProvider:"",currentPlan:"",transferBalance:!1}},u={isStartPortIn:!1,isStartFinalPortIn:!1,isSuccessCheck:!1,isLoadingCheck:!1,isErrorCheck:!1,isSuccess:!1,isLoading:!1,isError:!1,errorMessage:""},s={partyPrivacyItems:[]},v={city:"",postalCode:"",stateOrProvince:"",street:"",streetNumber:"",href:"",id:"",country:"",displayCountry:"",formattedAddress:"",formattedAddress1:"",addressStatus:"",externalId:"",homeZone:"",istatCode:""},c={city:"",postalCode:"",stateOrProvince:"",street:"",streetNumber:"",href:"",id:"",country:"",displayCountry:"",formattedAddress:"",formattedAddress1:"",addressStatus:"",externalId:"",homeZone:"",istatCode:""},p={activeSimMobile:!1,individualRef:{msisdn:"",email:""},selectedContactMedium:{field:"",fieldType:""},showOtp:!1,verifyOtp:"",customerHasActiveSubs:!1},m=!1,f=!1,g=!1,E=!1,h=null,b={cartId:"",simOptions:[]},y={consensus:!1,optionToReconsider:"",isSuccessTermsAndConditions:!1,isLoadingTermsAndConditions:!1,isErrorTermsAndConditions:!1},C={option:""},_={option:""},S={option:"Yes"},I=-1,T={placeId:"",city:"",postalCode:"",stateOrProvince:"",street:"",streetNumber:""},A={isSuccess:!1,isLoading:!1,isError:!1,deliveryOptions:[],identificationDetail
1s:[]},R={storeId:"",locationAddress:{id:"",city:"",country:"",displayCountry:"",stateOrProvince:"",displayStateOrProvince:"",longitude:"",latitude:"",postalCode:"",formattedAddress1:"",postalOfficeID:"",postalOfficeDescription:""},aerialDistance:1.521},L=!1,N=void 0,O=!1,x="",P="",M={isUpdatePrice:!1,isPriceUpdated:!0},k={startDeliveryLocateAndPickupPoint:()=>{},global:{isLoading:!1,isSuccess:!1,isError:!1},searchPickupLocations:{isLoading:!1,isSuccess:!1,isError:!1},searchPostalOffice:{isLoading:!1,isSuccess:!1,isError:!1},searchLocateStore:{isLoading:!1,isSuccess:!1,isError:!1}},D={validateAddress:{isLoading:!1,isSuccess:!1,isError:!1},createAddress:{isLoading:!1,isSuccess:!1,isError:!1},replaceAddress:{isLoading:!1,isSuccess:!1,isError:!1},billingPaper:{isLoading:!1,isSuccess:!1,isError:!1},billingEbill:{isLoading:!1,isSuccess:!1,isError:!1}},B={simTypeSelection:{isLoading:!1,isSuccess:!1,isError:!1}},w={deliveryBase:{isLoading:!1,isError:!1,isSuccess:!1,identificationDetails:[],deliveryOptions:[],errorMessage:""},modifySimDevice:{isLoading:!1,isSuccess:!1,isError:!1}},j={retrieveMultilines:{isLoading:!1,isSuccess:!1,isError:!1},termsAndConditions:{isLoading:!1,isSuccess:!1,isError:!1},customerInfo:{isLoading:!1,isSuccess:!1,isError:!1,data:void 0}},U={authorization:{isLoading:!1,isSuccess:!1,isError:!1},payMean:{isLoading:!1,isSuccess:!1,isError:!1}},F={findcaller:{isLoading:!1,isSuccess:!1,isError:!1},updateProductChatacteristics:{isLoading:!1,isSuccess:!1,isError:!1},patchCustomer:{isLoading:!1,isSuccess:!1,isError:!1},postCustomer:{isLoading:!1,isSuccess:!1,isError:!1},associateCustomer:{isLoading:!1,isSuccess:!1,isError:!1},customerInfo:{isLoading:!1,isSuccess:!1,isError:!1},payment:{isLoading:!1,isSuccess:!1,isError:!1,data:void 0},billingAccount:{isLoading:!1,isSuccess:!1,isError:!1},paymean:{isLoading:!1,isSuccess:!1,isError:!1,data:void 0},resetPatchAndPost:()=>{},acceptedFallbackOffer:!1},G={},z={voucherId:"",bo_array:[],isApplyVoucher:!1,isAppliedVoucher:!1,validateVoucher:{isLoading:!1,isSuccess:!1,isError:!1},voucher:{isLoading:!1,isSuccess:!1,isError:!1},shoppingCart:{isLoading:!1,isSuccess:!1,isError:!1}},V={campaign:{isLoading:!1,isSuccess:!1,isError:!1,isEligible:!1,isAccepted:!1,isRejected:!1,campaignProduct:void 0},accept:{isLoading:!1,isSuccess:!1,isError:!1,isAccepted:!1},updateCart:{isLoading:!1,isSuccess:!1,isError:!1}},Y={addonCmsId:"",addonMecId:"",availableAddons:[],callGetAddons:!1,callSaveAddon:!1,callRemoveAddon:!1,isError:!1,isSuccess:!1,isLoading:!1,isLoadingUpdate:!1,isLoadingPriceUpdate:!1,errorMessage:""},H=void 0,Z=!1,Q=!1,W=!1,K=!1,J=!1,q=!1,X=!1,$=!1,ee="",ei={},en="",eo=void 0,el=o.tb.reduce((e,i)=>(e[i.key]={visited:0,hidden:!1,completed:!1},e),{})},94198:function(e,i,n){n.d(i,{Mg:function(){return m},oo:function(){return p}});var o=n(52322),l=n(2784),t=n(85363),r=n(93221),d=n(1771),a=n(12755),u=n(95294),s=n(72631),v=n(57725);let c=l.createContext({customerId:a.fn,owningData:a.gE,contactInfo:a.dF,portability:a.XM,portabilityStatus:a.cv,addonState:a.kN,consents:a.Mf,findCaller:a.e2,isReadOnly:a.i,isLastCard:a.zl,isFlowReady:a.vQ,termsAndConditions:a.XH,invoice:a.y4,slidesGoBack:a.Z,currentStepKey:s.Bf.PERSONAL_INFO,upfrontSelection:a.QV,isDisabledBackButton:a.Dw,address:a.n,pickupPoint:a.IS,selectedPickupPoint:a.IS,offerId:a.nj,oldShippingAddress:a.e0,oldBillingAddress:a.e0,shippingAddress:a.e0,billingAddress:a.cZ,billingEmail:a.Zm,isDelayedICCIDretrive:a.AN,ICCID:a.n8,simOptions:a.xm,availablePaymentMethods:[],recharge:a.k0,hideStickyBar:!1,keepsNumber:a.ex,updateProductPriceCtrl:a.Qe,isValidNumberPortability:a.BQ,billDeliveryDone:!1,upfrontPayment:void 0,isLoadingCart:!0,forceCartAsyncInfoFlow:!1,isPreselectedCard:!1,winBackNumber:a.Y$,pickupLocationStore:a.Uq,simTypeSelectedOption:a.jQ,isStartRecognition:a.UN,isStartAddress:a.u7,deliveryAdvance:a.mY,recognitionCode:a.zg,billingReplace:a.Bi,isNewShippingAddress:a.Nd,isStartDeliveryBase:a.r_,cartAsyncInfo:a.iV,customerDeliveryBaseInfo:a.iQ,customerAsyncInfo:a.Ev,authorizationAsyncInfo:a.$i,isStartAuthorizationAsyncInfo:a.gP,isModalButtonSticky:!1,isStartCampaign:!1,isStartCampaignAccept:!1,isStartCustomerFlow:a.NI,customerFlow:a.Xn,voucher:a._F,configuredStickyStepperLabel:"",checkoutErrors:a.UT,product:a.oF,campaign:a.FF,addons:[],isLoadingGoNext:!1,timerID:a.p4,enablerBilling:!1,hasSP
1C:!1,setCustomerId:()=>{},setICCID:()=>{},setIsDelayedICCIDretrive:()=>{},setOwningData:()=>{},setContactInfo:()=>{},setPortability:()=>{},setPortabilityStatus:()=>{},setAddonState:()=>{},setConsents:()=>{},setBillingAddress:()=>{},setBillingEmail:()=>{},setOldShippingAddress:()=>{},setOldBillingAddress:()=>{},setShippingAddress:()=>{},setFindCaller:()=>{},setIsReadOnly:()=>{},setIsLastCard:()=>{},setIsFlowReady:()=>{},setTermsAndConditions:()=>{},setInvoice:()=>{},printContext:()=>{},setSlidesGoBack:()=>{},setUpfrontSelection:()=>{},setCurrentStepKey:()=>{},serializeContext:()=>{},deleteSerializedContext:()=>{},checkInitContext:()=>!1,setIsDisabledBackButton:()=>{},initContext:()=>!1,setOfferId:()=>{},setAddress:()=>{},setPickupPoint:()=>{},setSelectedPickupPoint:()=>{},setSimOptions:()=>{},setAvailablePaymentMethods:()=>{},setRecharge:()=>{},setHideStickyBar:()=>{},setUpdateProductPriceCtrl:()=>{},setKeepsNumber:()=>{},setIsValidNumberPortability:()=>!1,setBillDeliveryDone:()=>!1,setUpfrontPayment:()=>{},setIsLoadingCart:()=>{},setForceCartAsyncInfoFlow:()=>{},setIsPreselectedCard:()=>!1,setWinBackNumber:()=>{},setPickupLocationStore:()=>{},setSimTypeSelectedOption:()=>{},setIsStartRecognition:()=>{},setIsStartAddress:()=>{},setDeliveryAdvance:()=>{},setRecognitionCode:()=>{},setBillingReplace:()=>{},setIsNewShippingAddress:()=>{},setIsStartDeliveryBase:()=>{},setCartAsyncInfo:()=>{},setCustomerDeliveryBaseInfo:()=>{},setCustomerAsyncInfo:()=>{},setAuthorizationAsyncInfo:()=>{},setIsStartAuthorizationAsyncInfo:()=>{},setIsModalButtonSticky:()=>{},setIsStartCustomerFlow:()=>{},setCustomerFlow:()=>{},setVoucher:()=>{},setConfiguredStickyStepperLabel:()=>{},setCheckoutErrors:()=>{},setProduct:()=>{},setCampaign:()=>{},setIsStartCampaign:()=>!1,setIsStartAcceptCampaign:()=>!1,setAddons:()=>{},setIsLoadingGoNext:()=>{},setTimerID:()=>{},setEnablerChangeBilling:()=>{},setHasSPC:()=>{},checkoutSteps:a.ns,setCheckoutStepState:()=>{}}),p=e=>{let{children:i}=e,[n,p]=(0,l.useState)(""),[m,f]=(0,l.useState)(a.ns),[g,E]=(0,l.useState)({...a.gE}),[h,b]=(0,l.useState)({...a.dF}),[y,C]=(0,l.useState)({...a.XM}),[_,S]=(0,l.useState)({...a.kN}),[I,T]=(0,l.useState)({...a.Mf}),[A,R]=(0,l.useState)(a.Y$),[L,N]=(0,l.useState)({...a.cZ}),[O,x]=(0,l.useState)({...a.cZ}),[P,M]=(0,l.useState)(a.Zm),[k,D]=(0,l.useState)({...a.FF}),[B,w]=(0,l.useState)({...a.e0}),[j,U]=(0,l.useState)({...a.e0}),[F,G]=(0,l.useState)({...a.e2}),[z,V]=(0,l.useState)(a.i),[Y,H]=(0,l.useState)(a.zl),[Z,Q]=(0,l.useState)(a.vQ),[W,K]=(0,l.useState)(a.XH),[J,q]=(0,l.useState)(a.y4),[X,$]=(0,l.useState)(!0),[ee,ei]=(0,l.useState)(!1),[en,eo]=(0,l.useState)(a.Z),[el,et]=(0,l.useState)(a.QV),[er,ed]=(0,l.useState)(s.xz),[ea,eu]=(0,l.useState)(a.Dw),[es,ev]=(0,l.useState)(!1),[ec,ep]=(0,l.useState)(a.nj),[em,ef]=(0,l.useState)({...a.n}),[eg,eE]=(0,l.useState)({...a.IS}),[eh,eb]=(0,l.useState)({...a.IS}),[ey,eC]=(0,l.useState)(!1),[e_,eS]=(0,l.useState)(null),[eI,eT]=(0,l.useState)(a.xm),[eA,eR]=(0,l.useState)(a.k0),[eL,eN]=(0,l.useState)(!1),[eO,ex]=(0,l.useState)(a.Qe),[eP,eM]=(0,l.useState)([]),[ek,eD]=(0,l.useState)(),[eB,ew]=(0,l.useState)(a.BQ),[ej,eU]=(0,l.useState)(a.cv),[eF,eG]=(0,l.useState)(!1),[ez,eV]=(0,l.useState)(void 0),[eY,eH]=(0,l.useState)({...a.Uq}),[eZ,eQ]=(0,l.useState)(a.jQ),[eW,eK]=(0,l.useState)(a.UN),[eJ,eq]=(0,l.useState)(a.R8),[eX,e$]=(0,l.useState)(a.er),[e0,e1]=(0,l.useState)(a.Nd),[e2,e5]=(0,l.useState)(a.r_),[e3,e6]=(0,l.useState)(a.gP),[e4,e7]=(0,l.useState)(a.iQ),[e9,e8]=(0,l.useState)(a.zg),[ie,ii]=(0,l.useState)(a.u7),[io,il]=(0,l.useState)(a.Bi),[it,ir]=(0,l.useState)(a.mY),[id,ia]=(0,l.useState)(a.iV),[iu,is]=(0,l.useState)(a.Ev),[iv,ic]=(0,l.useState)(a.$i),[ip,im]=(0,l.useState)(!1),[ig,iE]=(0,l.useState)(!1),[ih,ib]=(0,l.useState)(a.Xn),[iy,iC]=(0,l.useState)(a._F),[i_,iS]=(0,l.useState)(!1),[iI,iT]=(0,l.useState)(a.UT),[iA,iR]=(0,l.useState)(""),[iL,iN]=(0,l.useState)(a.oF),[iO,ix]=(0,l.useState)([]),[iP,iM]=(0,l.useState)(),[ik,iD]=(0,l.useState)(!1),[iB,iw]=(0,l.useState)(!1),ij=e=>{p(e)},iU=e=>{E({...e})},iF=e=>{b({...e})},iG=e=>{C({...e})},iz=e=>{N({...e})},iV=e=>{iz((null==O?void 0:O.city)?O:e),x({...e})},iY=e=>{M(e)},iH=e=>{U({...e})},iZ=e=>{iH((null==B?void 0:B.city)?B:e),w({...e})},iQ=e=>{G({...e})},iW=e=>{V(e)},iK=e=>{H(e)},iJ=e=>{Q(e)},iq=e=>{eq(e)},iX=e=>{e$(e)},i$=e=>{K({...e})},i0=e=>{q({...e})},i1=e=>{D({...e})},i2=e=>{et(e)},i5=e=>{ed(e)},i3=e=>{e1(e)},i6=e=>{ew(e)},i4=e=>{eU(e)},i7=e=>{eG(e)},i9=e=>{eV(e)},i8=e=>{ev(e)},ne=e=>{eT(e)},ni=e=>{eM(e)},nn=e=>{eE(e)},no=e=>{eb(e)},nl=e=>{eR({...e})},nt=e=>{ex(e)},nr=e=>{$(e)},nd=e=>{ei(e)},na=e=>{eH(e)},nu=e=>{eQ(e)},ns=e=>{eK(e)},nv=e=>{e8(e)},nc=e=>{ii(e)},np=e=>{ir(e)},nm=e=>{il(e)},nf=e=>{e5(e)},ng=e=>{ia(e)},nE=e=>{e7(e)},nh=e=>{is(e)},nb=e=>{ic(e)},ny=e=>
1{e6(e)},nC=e=>{im(e)},n_=e=>{iE(e)},nS=e=>{ib(e)},nI=e=>{iC(e)},nT=e=>{(0,r.n)(e),iN(e)},nA=e=>{ix(e)};return(0,o.jsx)(c.Provider,{value:{customerId:n,setCustomerId:ij,owningData:g,setOwningData:iU,contactInfo:h,setContactInfo:iF,portability:y,setPortability:iG,portabilityStatus:ej,setPortabilityStatus:i4,addonState:_,setAddonState:S,consents:I,setConsents:T,findCaller:F,setFindCaller:iQ,isReadOnly:z,setIsReadOnly:iW,isLastCard:Y,setIsLastCard:iK,isFlowReady:Z,setIsFlowReady:iJ,termsAndConditions:W,setTermsAndConditions:i$,invoice:J,setInvoice:i0,slidesGoBack:en,setSlidesGoBack:e=>{eo(e)},currentStepKey:er,setCurrentStepKey:i5,serializeContext:()=>{let e=(0,d.A)(btoa(encodeURIComponent(JSON.stringify({customerId:n,owningData:{...g},portability:{...y},portabilityStatus:{...ej},addonState:{..._},findCaller:{...F},termsAndConditions:{...W},invoice:{...J},billingAddress:{...O},shippingAddress:{...B},consents:{...I},contactInfo:{...h},upfrontSelection:{...el},simOptions:{...eI},billingEmail:P,isReadOnly:z||!1,isLastCard:Y||!1,isFlowReady:Z||!0,winBackNumber:A||"",address:{...em},pickupPoint:{...eg},selectedPickupPoint:{...eh},offerId:ec,availablePaymentMethods:eP,updateProductPriceCtrl:{...eO},upfrontPayment:{...ez},pickupLocationStore:{...eY},deliveryAdvance:{...it},billingReplace:{...io},cartAsyncInfo:{...id},customerDeliveryBaseInfo:{...e4},customerAsyncInfo:{...iu},authorizationAsyncInfo:{...iv},recharge:{...eA},customerFlow:{...ih},voucher:{...iy},campaign:{...k},simTypeSelectedOption:eZ,isValidNumberPortability:eB,billDeliveryDone:eF,currentStepKey:er,isLoadingCart:X,forceCartAsyncInfoFlow:ee,isStartRecognition:eW,isStartAddress:ie,isNewShippingAddress:e0,isStartDeliveryBase:e2,recognitionCode:e9,isStartAuthorizationAsyncInfo:e3,isModalButtonSticky:ip,isStartCustomerFlow:ig,configuredStickyStepperLabel:iA,isStartCampaign:eJ,isStartCampaignAccept:eX,hasSPC:iB}))));localStorage.setItem(a.Bm,e)},deleteSerializedContext:()=>{localStorage.removeItem(a.Bm)},printContext:()=>{t.K.info("context",{customerId:n,owningData:{...g},portability:{...y},portabilityStatus:{...ej},addonState:{..._},findCaller:{...F},termsAndConditions:{...W},invoice:{...J},billingAddress:{...O},shippingAddress:{...B},consents:{...I},contactInfo:{...h},upfrontSelection:{...el},simOptions:{...eI},billingEmail:P,isReadOnly:z||!1,isLastCard:Y||!1,isFlowReady:Z||!0,isStartCampaign:eJ||!0,isStartCampaignAccept:eX||!0,winBackNumber:A||"",address:{...em},pickupPoint:{...eg},selectedPickupPoint:{...eh},offerId:ec,availablePaymentMethods:eP,updateProductPriceCtrl:{...eO},upfrontPayment:{...ez},pickupLocationStore:{...eY},deliveryAdvance:{...it},billingReplace:{...io},cartAsyncInfo:{...id},customerDeliveryBaseInfo:{...e4},customerAsyncInfo:{...iu},authorizationAsyncInfo:{...iv},customerFlow:{...ih},voucher:{...iy},product:{...iL},campaign:k,recharge:eA,simTypeSelectedOption:eZ,isValidNumberPortability:eB,billDeliveryDone:eF,currentStepKey:er,isLoadingCart:X,forceCartAsyncInfoFlow:ee,isStartRecognition:eW,isStartAddress:ie,isNewShippingAddress:e0,isStartDeliveryBase:e2,recognitionCode:e9,isStartAuthorizationAsyncInfo:e3,isStartCustomerFlow:ig,configuredStickyStepperLabel:iA,hasSPC:iB,checkoutSteps:m})},checkInitContext:()=>!!localStorage.getItem(a.Bm),initContext:e=>{let i;let{customerData:n,countries:o,isLogged:l}=e||{},t=!1;if(n&&o){t=!!l;let e=Array.isArray(n)?null==n?void 0:n[0]:n;i={...(0,u.Vp)(e,o)}}let r=(0,v.S4)();return setTimeout(()=>{var e,n,o;let d=(0,v.YZ)();ij((null==r?void 0:r.customerId)||a.fn),iU({...a.gE,...null==r?void 0:r.owningData,owningIndividual:{...null==r?void 0:null===(e=r.owningData)||void 0===e?void 0:e.owningIndividual,...i},isLogged:(null==r?void 0:null===(n=r.owningData)||void 0===n?void 0:n.isLogged)||l,isValid:(null==r?void 0:null===(o=r.owningData)||void 0===o?void 0:o.isValid)||t}),iF((null==r?void 0:r.contactInfo)||a.dF),iG((null==r?void 0:r.portability)||a.XM),i4((null==r?void 0:r.portabilityStatus)||a.cv),S((null==r?void 0:r.addonState)||a.kN),T((null==r?void 0:r.consents)||a.Mf),iQ((null==r?void 0:r.findCaller)||a.e2),iW((null==r?void 0:r.isReadOnly)||a.i),iK((null==r?void 0:r.isLastCard)||!1),iJ((null==r?void 0:r.isFlowReady)||!0),i$({...a.XH,...W,...null==r?void 0:r.termsAndConditions}),i0((null==r?void 0:r.invoice)||a.y4),iY((null==r?void 0:r.billingEmail)||a.Zm),iV((null==r?void 0:r.billingAddress)||a.cZ),iZ((null==r?void 0:r.shippingAddress)||a.e0),nn((null==r?void 0:r.pickupPoint)||a.IS),no((null==r?void 0:r.selectedPickupPoint)||a.IS),i5((null==r?void 0:r.currentStepKey)||s.xz),i2((null==r?void 0:r.upfrontSelection)||a.QV),ne((null==r?void 0:r.simOptions)||a.xm),nl((null==r?void 0:r.recharge)||a.k0),ni((null==r?void 0:r.availablePaymentMethods)||[]),nt({...a.Qe,...null==r?void 0:r.updateProductPriceCtrl}),i6((null==r?void 0:r.isValidNumberPortability)||a.BQ),i7((null==r?void 0:r.billDeliveryDone)||a.BQ),i9((null==r?void 0:r.upfrontPayment)||void 0),nr((null==r?void 0:r.isLoadingCart)||!0),nd(!1),i8((null==r?void 0:r.isPreselectedCard)||!1),R((null==r?void 0:r.winBackNumber)||a.Y$),na((null==r?void 0:r.pickupLocationStore)||a.Uq),nu((null==r?void 0:r.simTypeSelectedOption)||a.jQ),ns((null==r?void 0:r.isStartRecognition)||a.UN),nc((null==r?void 0:r.isStartAddress)||a.u7),np((null==r?void 0:r.deliveryAdvance)||a.mY),nv((null==r?void 0:r.recognitionCode)||a.zg),nm((null==r?void 0:r.billingReplace)||a.Bi),i3((null==r?void 0:r.isNewShippingAddress)||a.Nd),nf((null==r?void 0:r.isStartDeliveryBase)||a.r_),ng((null==r?void 0:r.cartAsyncInfo)||a.iV),nE((null==r?void 0:r.customerDeliveryBaseInfo)||a.iQ),nh((null==r?void 0:r.customerAsyncInfo)||a.Ev),nb((null==r?void 0:r.authorizationAsyncInfo)||a.$i),ny((null==r?void 0:r.isStartAuthorizationAsyncInfo)||a.gP),nC((null==r?void 0:r.isModalButtonSticky)||!1),n_((null==r?void 0:r.isStartCustomerFlow)||!1),iq((null==r?void 0:r.isStartCampaign)||!1),iX((null==r?void 0:r.isStartCampaignAccept)||!1),nS((null==r?void 0:r.customerFlow)||a.Xn),nI((null==r?void 0:r.voucher)||a._F),iR((null==r?void 0:r.configuredStickyStepperLabel)||""),d&&nT(d),i1((null==r?void 0:r.campaign)||a.FF),nA([])},0),!0},upfrontSelection:el,setUpfrontSelection:i2,isDisabledBackButton:ea,setIsDisabledBackButton:e
1=>{eu(e)},offerId:ec,setOfferId:e=>{ep(e)},address:em,setAddress:e=>{ef({...e})},pickupPoint:eg,setPickupPoint:nn,selectedPickupPoint:eh,setSelectedPickupPoint:no,billingAddress:O,setBillingAddress:iV,oldBillingAddress:L,setOldBillingAddress:iz,oldShippingAddress:j,setOldShippingAddress:iH,shippingAddress:B,setShippingAddress:iZ,isDelayedICCIDretrive:ey,setIsDelayedICCIDretrive:eC,ICCID:e_,setICCID:eS,simOptions:eI,setSimOptions:ne,availablePaymentMethods:eP,setAvailablePaymentMethods:ni,recharge:eA,setRecharge:nl,hideStickyBar:eL,setHideStickyBar:e=>{eN(e)},keepsNumber:ek,setKeepsNumber:eD,updateProductPriceCtrl:eO,setUpdateProductPriceCtrl:nt,isValidNumberPortability:eB,setIsValidNumberPortability:i6,billDeliveryDone:eF,setBillDeliveryDone:i7,upfrontPayment:ez,setUpfrontPayment:i9,isLoadingCart:X,setIsLoadingCart:nr,forceCartAsyncInfoFlow:ee,setForceCartAsyncInfoFlow:nd,isPreselectedCard:es,setIsPreselectedCard:i8,winBackNumber:A,setWinBackNumber:R,deliveryAdvance:it,setDeliveryAdvance:np,pickupLocationStore:eY,setPickupLocationStore:na,simTypeSelectedOption:eZ,setSimTypeSelectedOption:nu,isStartRecognition:eW,setIsStartRecognition:ns,isStartAddress:ie,setIsStartAddress:nc,recognitionCode:e9,setRecognitionCode:nv,billingReplace:io,setBillingReplace:nm,isNewShippingAddress:e0,setIsNewShippingAddress:i3,isStartDeliveryBase:e2,setIsStartDeliveryBase:nf,cartAsyncInfo:id,setCartAsyncInfo:ng,customerDeliveryBaseInfo:e4,setCustomerDeliveryBaseInfo:nE,customerAsyncInfo:iu,setCustomerAsyncInfo:nh,authorizationAsyncInfo:iv,setAuthorizationAsyncInfo:nb,isStartAuthorizationAsyncInfo:e3,setIsStartAuthorizationAsyncInfo:ny,isModalButtonSticky:ip,setIsModalButtonSticky:nC,isStartCustomerFlow:ig,setIsStartCustomerFlow:n_,customerFlow:ih,setCustomerFlow:nS,voucher:iy,setVoucher:nI,configuredStickyStepperLabel:iA,setConfiguredStickyStepperLabel:iR,checkoutErrors:iI,setCheckoutErrors:e=>{iT(e)},product:iL,setProduct:nT,campaign:k,setCampaign:i1,isStartCampaign:eJ,setIsStartCampaign:iq,isStartCampaignAccept:eX,setIsStartAcceptCampaign:iX,billingEmail:P,setBillingEmail:iY,addons:iO,setAddons:nA,isLoadingGoNext:i_,setIsLoadingGoNext:e=>{iS(e)},timerID:iP,setTimerID:e=>{iM(e)},setEnablerChangeBilling:e=>{iD(e)},enablerBilling:ik,hasSPC:iB,setHasSPC:e=>{iw(e)},checkoutSteps:m,setCheckoutStepState:(e,i)=>{f(n=>{var o;return{...n,[e]:{...n[e],visited:(null!==(o=n[e].visited)&&void 0!==o?o:0)+1,...i}}})}},children:i})},m=()=>(0,l.useContext)(c)},57725:function(e,i,n){n.d(i,{An:function(){return r},S4:function(){return a},SS:function(){return s},YZ:function(){return d},l0:function(){return u}});var o=n(98908),l=n(88638),t=n(12755);let r=!1,d=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(0,o.fF)("tProd"),n=(0,o.fF)("tProd_backUp");return e&&n?(localStorage.setItem("tProd",JSON.stringify(n)),localStorage.removeItem("tProd_backUp"),n||null):i||null},a=()=>{let e=localStorage.getItem(t.Bm);if(!e)return null;let i=null==e?void 0:e.split(o.X5),n=(null==i?void 0:i.length)>1?decodeURIComponent(atob(null==i?void 0:i[1]))||"":null;return n&&(0,o.pM)(n)?JSON.parse(n):n},u=()=>{l.D.handleError(l.T.getSeverityErrorHigh(),{title:"Ops!",message:"Si \xe8 verificato un errore durante il recupero del prodotto. Riprova pi\xf9 tardi",actionEvent:()=>{localStorage.removeItem("shoppingCart"),window.location.reload()},actionText:"Riprova",disableTrack:!0})},s=()=>(0,o.fF)("addons")||[]},64185:function(e,i,n){n.d(i,{Z:function(){return m}});var o=n(52322),l=n(63535),t=n(96108),r=n(67862),d=n(92603),a=n(36731);function u(){let e=(0,r._)(["\n  display: flex;\n  align-items: baseline;\n  margin-bottom: ",";\n\n  svg {\n    margin-right: ",";\n    width: 19px;\n    object-fit: contain;\n  }\n"]);return u=function(){return e},e}function s(){let e=(0,r._)(["\n  width: 100%;\n\n  div {\n    margin: 0;\n  }\n"]);return s=function(){return e},e}let v=d.Z.li(u(),a.r.spacing.sm,a.r.spacing.md),c=d.Z.div(s());var p=n(12206),m=e=>{let{icon:i,text:n,hideIcon:r=!1}=e;return(0,o.jsxs)(v,{children:[!r&&(0,o.jsx)(o.Fragment,{children:i?(0,o.jsx)(l.Z,{style:{objectFit:"contain",width:"19px",marginRight:"15px"},nameCard:"listIcon",image:i}):(0,o.jsx)(p.Z,{})}),(0,o.jsx)(c,{children:(0,o.jsx)(t.Z,{text:n,textAlign:"left",fontFamily:"Vodafone Rg",size:18,lineHeight:24})})]})}},36506:function(e,i,n){n.d(i,{Z:function(){return p}});var o=n(52322),l=n(2784),t=n(91464),r=n(67862);function d(){let e=(0,r._)(["\n  display: none;\n"]);return d=function(){return e},e}let a=n(92603).Z.div(d());var u=n(52378);let s={tablet:"608.5px",desktop:"633.5px"},v=e=>{if(!(0,u.r)())return;let i=()=>{var i;let n=null===(i=document)||void 0===i?void 0:i.getElementsByClassName("stepper-children");(null==n?void 0:n.length)>
10&&(Array.from(n).forEach(e=>{e&&(e.style.display="none")}),n[e].style.display="block")};setTimeout(()=>{i()},0)},c=(0,l.forwardRef)((e,i)=>{let{id:n,components:r,isOpen:d,handleClose:u}=e,[c,p]=(0,l.useState)(0);(0,l.useEffect)(()=>{d&&v(c)},[d,c]);let m=()=>{p(e=>e===r.length?e:e+1)},f=()=>{p(e=>e-1==-1?e:e-1)};return(0,l.useImperativeHandle)(i,()=>({_stepperModalGoNext(){m()},_stepperModalGoPrev(){f()}})),(0,o.jsx)(t.Z,{id:n,isOpen:d,showBackCta:0!==c,onBack:f,handleClose:()=>{u(),p(0)},height:s,children:(0,o.jsx)(o.Fragment,{children:l.Children.toArray(null==r?void 0:r.map(e=>(0,o.jsx)(a,{className:"stepper-children",children:e})))})})});var p=(0,l.memo)(c,(e,i)=>(null==e?void 0:e.isOpen)===(null==i?void 0:i.isOpen))},75762:function(e,i,n){n.d(i,{U:function(){return l.UY},b:function(){return o.bl}});var o=n(45867),l=n(72430)},31696:function(e,i,n){n.d(i,{O:function(){return o.Oc},d:function(){return l.dw}});var o=n(81793),l=n(42406)},35067:function(e,i,n){n.d(i,{L:function(){return o.Ln}});var o=n(57349)},35325:function(e,i,n){n.d(i,{G:function(){return d}});var o=n(52378),l=n(86787),t=n(2784),r=n(11946);let d=e=>{let[i,n]=(0,t.useState)({isLoading:!0,isEligible:!1,token:""}),d=new URLSearchParams((0,o.r)()&&window.location.search),a=(null==e?void 0:e.customerToken)||(null==d?void 0:d.get("t")),{data:u,isLoading:s,isSuccess:v,isError:c,mutate:p}=(0,l.N)();return(0,t.useEffect)(()=>{var e,o;s?n({...i,isLoading:!0,isEligible:!1,token:a}):c||v&&(null==u?void 0:null===(e=u.returnMsg)||void 0===e?void 0:e.toLowerCase())!=="success"?n({...i,isLoading:!1,isEligible:!1,token:a}):v&&(null==u?void 0:null===(o=u.returnMsg)||void 0===o?void 0:o.toLowerCase())==="success"&&(n({...i,isEligible:!0,isLoading:!1,token:a}),localStorage.setItem(r.ZV,a))},[v,s,c]),(0,t.useEffect)(()=>{e.isStartFlow&&(a?p({token:a,...(null==e?void 0:e.startFlow)&&{startFlow:e.startFlow}}):n({isLoading:!1,isEligible:!1,token:void 0}))},[e.isStartFlow]),i}}}]);
2//# sourceMappingURL=6789-57d29642e0e18d4b.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.