"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([["t2ds-common-c8fdfd8fbeaf2a58d9f0aacd0223480e"],{345520:function(e,t,n){var o,s=n(7071),i=n.n(s),a=n(354998),r=n.n(a),c=n(70782),u=n(484454),p=n(618170),l=n(405631),d=n(206353),m=n(314370),g=n(826564),f=n(964944),v=n(166008),b=n(847746),C=n(540486),h=n(181690),S=n(555709),I=n(974485),E=n(5829),T=n(294184),P=n.n(T),N=n(363279),O=n(872922),y=n(105539),x=n(428542),_=n(97737),D=n(797523),k=n(29152),A=n(269794),B=n(446105),M=n(940639),L=n(697563),j=n(902088),K=n(505021),R=n(776828),Z=n(596729),F=n(591537),w=n(808038),z=n(674820),U=n(606475),H=n(828937),W=n(495800),Q=n(206841),V=n(497049),G=n(732850),X=n(521508),Y=n(397875),$=n(297819),q=n(317758),J=n(262577),ee=n(999050),te=n(845650),ne=n(932717),oe=n(431687),se=n(74999),ie=n(354385),ae=n(983169),re=n(529042),ce=n(334451),ue=n(330015),pe=n(674017),le=n(21724),de=n(199040),me=n(68215),ge=n(519038),fe=n(785893),ve=["messageId","buttons","buttonsBlockClassName","useKit"],be=["messageId","option","state"],Ce="optionManagementPopup",he="kitOptionManagementPopup",Se="optionConnectButton.popup.heading",Ie="optionConnectButton.popup.headingCapitalized",Ee="optionDisconnectButton.popup.heading",Te="optionDisconnectButton.popup.headingCapitalized",Pe=["SubscriberDetailedRemnants"],Ne=function(e,t,n){var o=t.billingId;return void 0===n&&(n=null),B.mb.service(e.value,o,n)},Oe=function(e){return e.map((function(e){return"\xab"+e.name+"\xbb"})).join(", ")},ye=function(e){return e.some((function(e){return!e.name}))},xe=function(e){return(e.technicalType||e.type)===me.Z.FAMILY_MULTISUBSCRIPTION},_e=function(e){var t=e.heading,n=e.option,o=e.messageParams,s=void 0===o?{}:o,i=e.buttons,a=e.buttonsBlockClassName,r=e.spaceHolder,c=e.showPopupGtmEventLabel,u=void 0===c?"errorOccurred":c,l=e.onCloseDialog,d=e.useKit,m=e.primaryAction,g=void 0===m?void 0:m,f=e.secondaryAction,v=void 0===f?void 0:f,b=e.messageId,C=n.frontName,h=n.themeColor;s.currentService=C,s.servicesList&&(ye(s.servicesList)?b+=".nameless":(s.servicesListCount=s.servicesList.length,s.servicesList=Oe(s.servicesList))),(0,K.AP)({service:n,eventLabel:u});return(0,p.of)((0,le.dt)(n),function(){var e=(0,re.Q)(d),n={heading:t,messageId:b,messageParams:s,onCloseDialog:l};return d?(n.primaryAction=g,n.secondaryAction=v):(n.buttons=i,n.themeColor=h,n.spaceHolder=r,n.buttonsBlockClassName=a),(0,_.mk)(e,n)}())},De=function(e){var t=e.messageId,n=void 0===t?"internalError":t,o=e.buttons,s=void 0===o?[]:o,a=e.buttonsBlockClassName,r=void 0===a?"btns-box center-xs":a,c=e.useKit,u=i()(e,ve),p=c?Ie:Se;return _e(Object.assign({heading:p,messageId:"optionConnectButton.message."+n,buttons:s,buttonsBlockClassName:r,useKit:c},u))},ke=function(e){var t=e.option,n=e.state,o=(0,D.Ub4)(te.M)(n),s=(0,D.DIw)()(n);return[(0,le.dt)(t),(0,_.mk)((0,re.Q)(s),(0,ne.rC)(o,s))]},Ae=function(e){var t=e.messageId,n=void 0===t?"internalError":t,o=e.option,s=e.state,a=i()(e,be),r=(0,D.DIw)()(s),c=r?Te:Ee;return xe(o)?ke({option:o,state:s}):_e(Object.assign({heading:c,messageId:"optionDisconnectButton.message."+n,option:o,useKit:r},a))},Be=function(e){var t=e.messageText,n=e.messageId,o=e.messageParams,s=e.additionalTexts;if(!Array.isArray(s)||!s.length)return{messageText:t,messageId:n};var i=["function","object"].includes(typeof t);return{messageText:(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)("div",{className:"space-holder18",children:i?{messageText:t}:n?(0,fe.jsx)(E.Z,{id:n,values:Object.assign({},o),tagName:"div"}):(0,fe.jsx)(N.InjectHtml,{html:t})}),s.map((function(e,t){return(0,fe.jsx)("div",{className:"space-holder18",children:e.text},t)}))]}),messageId:null}},Me=function(e,t,n){return(0,_.mk)((0,re.Q)(n),{dialogType:"optionManagementLoadingPopup",heading:e,messageText:o||(o=(0,fe.jsxs)("div",{className:"center",children:[(0,fe.jsx)("div",{className:"space-holder18",children:(0,fe.jsx)(E.Z,{id:"subscriberServicesList2.loaderText.wait"})}),(0,fe.jsx)(N.Loader,{isInline:!0})]})),messageParams:{currentService:t.frontName},spaceHolder:0})},Le=function(e){var t=e.heading,n=e.messageId,o=e.messageText,s=void 0===o?null:o,i=e.option,a=e.isButtonCenteredInMobile,r=void 0!==a&&a,c=e.useKit,u={dialogType:"optionManagementCompletedPopup",heading:t,messageParams:{currentService:i.frontName},messageId:n,messageText:s},p=[{title:"app.common.close",className:"btn"}];return c?u.primaryAction={title:p[0].title}:(u.buttons=p,u.buttonsBlockClassName=P()("btns-box left",{"center-xs":r})),(0,_.mk)((0,re.Q)(c),u)},je=function(e){var t=e.responseStatus,n=e.shouldShowExtendedProgressStatus,o=e.option,s=e.dataToRefresh,i=e.useKit,a=[],r=t===ge.ZP.CONNECTED,c=r&&Boolean(o.partner);if(n&&!c){var u=i?"optionDisconnectButton.popup.headingCapitalized.connected":"optionDisconnectButton.popup.heading.connected",p=i?"optionDisconnectButton.popup.headingCapitalized.disconnected":"optionDisconnectButton.popup.heading.disconnected";a.push(Le({heading:r?u:p,option:o,useKit:i}))}return c&&a.push((0,_.mk)("partnerServiceConnectedPopup",{option:o})),a.push.apply(a,[(0,le.pv)(o,t)].concat(s.map((function(e){return(0,k.xZ)({name:e},!0)})))),a},Ke=function(e,t){var n=(0,D.X_3)()(t.value),o=e.payload.notificationsInfo;return n&&!(void 0===o?{}:o).isChecked},Re=function(e){var t=10;return xe(e)&&(t=5),t},Ze=function(e){var t=Object.keys(O.Z.groupBy(e,(function(e){return e.action})));return t.length>1?"multipleActions":t[0]},Fe=function(e){return O.Z.join(O.Z.map(e,(function(e){return e.result.message})),"<br>")};t.Z=(0,u.l)((function(e,t){return e.pipe((0,c.l)(le.MF.CONNECT_BUTTON_CLICKED),(0,v.h)((function(e){return!Ke(e,t)})),(0,b.zg)((function(e){var n=e.payload,o=n.connectStatus,s=n.offerId,i=n.notificationsInfo,a=void 0===i?{}:i,c=n.shouldShowExtendedProgressStatus,u=n.oneClickSlot,d=Object.assign({},e.payload.option),m=t.value,g=e.payload.useKit||(0,D.DIw)()(m);o.billingId&&(d.billingId=o.billingId);var f=o.abonentFeeAtConnection,v=o.connectionAvailabilityStatus,b=o.abonentFeeChargeType,C=o.currentPeriodAbonentFee,h=o.changePrice,S=o.abonentFee,I=o.offer,T=o.isAvailableInBilling,P=d.frontName,N=d.themeColor,y=d.popupInfoTextConnection,k=d.multisubscriptionTerms,B=d.redirectLink,M=d.type,R=d.params,U=d.slug,H=d.technicalType,Q=M===me.Z.MULTISUBSCRIPTION,V=(0,ue.Id)(M),Y="blacklist"===M&&Array.isArray(R),$=L.store.dispatch;if(u)return(0,p.of)((0,_.mk)("skylinkFormRequestPopup",{content:u,parentCartridge:w.M||z.M,frontName:P,type:M}));if(B&&!Y)return(0,G.TO)(B)?window.open(B):L.history.push(B),l.E;var q=g?"kitOptionInfo":"optionInfo",J=g?{secondaryAction:{title:"app.common.clear",onClick:function(){return $((0,_.tB)())}}}:{};if(!(0,x.jl)()(m))return(0,p.of)((0,_.mk)(q,Object.assign({option:d},J)));if((0,ue.fT)(H,U)){var ee=oe.Kq.CONNECT,te=(0,se.RB)({dispatch:$,option:d,action:ee,useKit:g});return(0,p.of)((0,se.Ek)({option:d,action:ee,buttons:te,useKit:g}))}var ne={heading:g?Ie:Se,themeColor:N,messageParams:{currentService:P}};Q||V?(ne.heading=g?"optionConnectButton.popup.subscriptionHeadingCapitalized":"optionConnectButton.popup.subscriptionHeading",ne.messageText=k):y?ne.messageText=y:ne.messageId="optionConnectButton.message.connectConfirm";var ie=(0,re.Q)(g);if((0,D.lm0)()(m))return(0,p.of)((0,_.mk)(ie,Object.assign({},ne,{messageId:"optionConnectButton.message.disabled.userIsB2b"})));if((0,D.sBs)()(m))return(0,p.of)((0,_.mk)(ie,Object.assign({},ne,{messageId:"optionConnectButton.message.disabled.simBlocked"})));if(!d.billingId)return(0,p.of)((0,_.mk)(q,Object.assign({option:d},J)));if(!(0,x.Bj)()(m))return(0,p.of)((0,_.mk)(ie,Object.assign({},ne,{messageId:"optionConnectButton.message.notHomeSite",messageParams:Object.assign({},ne.messageParams,{link:(0,Z.gL)({href:new(r())("/options").absoluteTo((0,x.t9)()(m)).toString()})})})));if(T){var ae=v.conflictedServices||[],ce=v.parentServices||[];if(ae.length||ce.length){var pe="optionConnectButton.message.conflictedOrParentServices.nameless",de={};return ye(ae.concat(ce))||(pe="optionConnectButton.message.conflictedOrParentServices",de={conflictedServicesCount:ae.length,conflictedServicesList:Oe(ae),parentServicesCount:ce.length,parentServicesList:Oe(ce)}),(0,p.of)((0,_.mk)(ie,Object.assign({},ne,{messageId:pe,messageParams:Object.assign({},ne.messageParams,de)})))}}if(!T||!v.canConnect)return(0,p.of)((0,_.mk)(ie,Object.assign({},ne,{messageId:"optionConnectButton.message.unavailable"})));var ve=(0,D.wKe)()(m),be=h||0;f&&(ve&&b===ge.ed.CORP_PACKAGES_PREPAID&&C?be+=C:I&&I.abonentFee?be+=I.abonentFee:be+=S||0);var Ee,Te=(0,D.Ub4)(F.M)(m),Pe=Ce,Ne=function(){$((0,j.Kj)(s)),$((0,le.Zk)(d,c,g)),(0,K.kP)({service:d,elementName:"enableServices"}),(0,K.xz)({dialogType:Pe,service:d,connectStatus:o})},xe=function(){(0,K.kP)({service:d,elementName:"cancel"}),(0,K.OE)({dialogType:Pe,service:d,connectStatus:o})};if(Q){var _e=(Te||{}).multisubscriptionPageLink,De=(0,X.wS)(_e),ke=(0,D.vpV)()(m)?De:(0,G.MC)(De);Ee=[{className:"btn btn-black",title:"app.common.connect",onClick:Ne},{className:"btn",text:null==_e?void 0:_e.name,href:ke,link:ke}]}else Ee=[{title:"app.common.connect",onClick:Ne},{title:"app.common.cancel",className:"cancel",onClick:function(){$((0,le.nW)(d)),$((0,_.tB)()),xe()}}];if(ne.messageParams.cost=be,ve){var Ae=O.Z.get((0,A.Yu)("b2c_profile")(m),"paymentAccount"),Me=O.Z.get((0,A.Yu)("b2c_currentTariff")(m),"period"),Le=O.Z.values((0,A.Yu)("b2c_connectedServices")(m)),je=(0,A.Yu)("b2c_autopayments")(m)||[],Ke=(0,x.W1)()(m),Re=function(e){return[ge.ed.CORP_PACKAGES_PREPAID,ge.ed.ACTIVATE_DATE_CUSTOM_PERIOD_PREPAID].includes(e)};if((null==Te?void 0:Te.autopaymentWarningText)&&Re(b)&&je.some((function(e){return e.msisdn===Ke&&4===e.category.id}))&&"PERSONAL"===Ae&&("month"===Me||Le.some((function(e){return Re(e.abonentFeeChargeType)})))){var Ze=(0,fe.jsxs)(fe.Fragment,{children:[ne.messageId?(0,fe.jsx)(E.Z,{id:ne.messageId,values:ne.messageParams}):ne.messageText,(0,fe.jsx)(W.Z,{warningText:Te.autopaymentWarningText})]});ne.messageText=Ze,ne.messageId=void 0,d.withB2bAutopaymentWarning=!0}}var Fe=Object.assign({},ne,Be(Object.assign({},ne,{additionalTexts:a.texts})),{option:d,onCloseDialog:xe});return g?(0,p.of)((0,_.mk)(he,Object.assign({},Fe,{primaryAction:Ee[0],secondaryAction:Ee[1]}))):(0,p.of)((0,_.mk)(Ce,Object.assign({},Fe,{buttons:Ee,buttonsBlockClassName:"btns-box btns-box__same-width-in-mobile center"})))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.SEND_CONNECTION_REQUEST),(0,b.zg)((function(e){var n=e.payload,o=n.option,s=n.shouldShowExtendedProgressStatus,i=o.offer,a=t.value,r=e.payload.useKit||(0,D.DIw)()(a),c="connectError",u=r?Ie:Se;return(0,d.z)((0,p.of)(s?Me(u,o):(0,_.tB)()),(0,y.R3)(Ne(t,o)).pipe((0,b.zg)((function(e){var t=e.data,n=t.data,u=t.meta.status,l=O.Z.get(n,"status");if(u===ge.ZP.SUCCESS){var d=[(0,le.qI)(o),(0,le.Mt)({option:o,status:ge.ZP.CONNECTING,shouldShowExtendedProgressStatus:s}),(0,J.FS)(ee.yq.CONNECTED_SERVICES)].concat(["b2c_creditLimit","b2c_financeNotices"].map((function(e){return(0,k.xZ)({name:e},!0)})));if((0,D.Ub4)(w.M)(a)||(0,D.Ub4)(z.M)(a)){var m=(0,D.gzQ)()(a),g=m.utm_source,f=m.offerId;if(f&&g){var v=H.hK.CONNECT;(0,Y.cX)(f,v),d.push((0,j.Kj)(f,v))}}if(i){var b,C=Pe.find((function(e){return(0,D.Ub4)(e)(a)}));C&&(b=(0,D.DZy)(C)(a)),d.push((0,j.G9)(i.id,H.hK.CONNECT,b))}return o.withB2bAutopaymentWarning&&d.push((0,Q.uX)((0,D.jRm)()(a))),d}if(l===ge.ZP.CONFLICT_SERVICES||l===ge.ZP.PARENT_SERVICES){var h={servicesList:n.billingServices};return De({option:o,connectionStatus:l,messageParams:h,useKit:r})}var S={errorMessage:(0,M.lZ)(t)};if(u===ge.ZP.ERR_BALANCE_SUM_IS_NOT_ENOUGH){var I="insufficientFunds",E=function(e){return(0,K.j3)({service:o,eventLabel:e,eventContext:I})},T=[{title:"optionConnectButton.popup.promisePay",className:"promise-pay-link",onClick:function(){E("takePromisedPayment"),L.history.push((0,D.ve3)()(a))}},{text:(0,D.Xzh)()(a),className:"btn btn-black",onClick:function(){E("replenishBalance"),L.history.push((0,D.gyx)()(a))},addNewRow:!0},{title:"app.common.close",className:"alternative-link"}],P={title:(0,D.Xzh)()(a),onClick:function(){E("replenishBalance"),L.history.push((0,D.gyx)()(a))}};return De({option:o,messageId:c,messageParams:S,buttons:T,primaryAction:P,secondaryAction:{title:"optionConnectButton.popup.promisePay",onClick:function(){E("takePromisedPayment"),L.history.push((0,D.ve3)()(a))}},buttonsBlockClassName:"btns-box left center-xs low-balance-buttons",spaceHolder:"20",showPopupGtmEventLabel:I,onCloseDialog:function(){return E("cancel")},useKit:r})}return u===ge.ZP.NO_TREES_AVAILABLE?(0,p.of)((0,le.dt)(o),function(e){var t=e.messageText,n=e.useKit,o=[{title:"app.common.close",className:"btn"}],s={dialogType:"optionManagementFailedPlantedTreePopup",heading:n?"optionConnectButton.popup.headingCapitalized.errorPlantedTree":"optionConnectButton.popup.heading.errorPlantedTree",messageText:t};return n?s.primaryAction={title:o[0].title}:(s.buttons=o,s.buttonsBlockClassName="btns-box center-xs left"),(0,_.mk)((0,re.Q)(n),s)}({messageText:S.errorMessage,useKit:r})):De({option:o,messageId:c,messageParams:S,useKit:r})})),(0,C.K)((function(){return De({option:o,useKit:r})}))))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.DISCONNECT_BUTTON_CLICKED),(0,v.h)((function(e){return!Ke(e,t)})),(0,b.zg)((function(e){var n=e.payload,o=n.connectStatus,s=n.notificationsInfo,i=void 0===s?{}:s,a=n.shouldShowExtendedProgressStatus,c=n.isDisconnectingMultisubscription,u=n.profileStr,l=n.isDisconnectingMemberOfFamilyMs,d=t.value,m=(0,D.DIw)()(d),g=Object.assign({},e.payload.option);o.billingId&&(g.billingId=o.billingId);var f=g.frontName,v=g.themeColor,b=g.popupInfoTextDisconnection,C=o.disconnectionAvailabilityStatus,h={heading:m?Te:Ee,themeColor:v,messageParams:{currentService:f}};if(b?h.messageText=b:h.messageId="optionDisconnectButton.message.disconnectConfirm",xe(g))return(0,p.of)((0,le.rX)({option:g,profileStr:u,isDisconnectingMemberOfFamilyMs:l}));if(c){var S=O.Z.get((0,D.Ub4)(w.M)(t.value),"subscriptionMixxConfig")||O.Z.get((0,D.Ub4)(z.M)(t.value),"subscriptionMixxConfig");return O.Z.get(i,"texts.length")&&S?(0,p.of)((0,_.mk)(m?ae.b6:U.M_,{subscriptionMixxConfig:S,option:g,connectStatus:o,notifications:i.texts,forceScreenType:U.TW.NOTIFICATION})):(0,p.of)((0,le.rX)({option:g}))}var I=(0,re.Q)(m);if((0,D.lm0)()(t.value))return(0,p.of)((0,_.mk)(I,Object.assign({},h,{messageId:"optionDisconnectButton.message.disabled.userIsB2b"})));if((0,D.sBs)()(t.value))return(0,p.of)((0,_.mk)(I,Object.assign({},h,{messageId:"optionDisconnectButton.message.disabled.simBlocked"})));if(!(0,x.Bj)()(t.value))return(0,p.of)((0,_.mk)(I,Object.assign({},h,{messageId:"optionDisconnectButton.message.notHomeSite",messageParams:Object.assign({},h.messageParams,{url:(0,Z.gL)({href:new(r())("/options").absoluteTo((0,x.t9)()(t.value)).toString()})})})));if(!C.canDisconnect)return(0,p.of)((0,_.mk)(I,Object.assign({},h,{messageId:"optionDisconnectButton.message.unavailable"})));var E=O.Z.concat(C.childServices||[],C.dependentServices||[]);if(E.length){var T="optionDisconnectButton.message.dependentServices.nameless",P={};return ye(E)||(T="optionDisconnectButton.message.dependentServices",P={servicesListCount:E.length,servicesList:Oe(E)}),(0,p.of)((0,_.mk)(I,Object.assign({},h,{messageId:T,messageParams:Object.assign({},h.messageParams,P)})))}var N=L.store.dispatch,y=m?he:Ce,k=Object.assign({},h,Be(Object.assign({},h,{additionalTexts:i.texts})),{option:g,onCloseDialog:function(){(0,K.zW)({dialogType:y,eventLabel:"cancel",service:g,connectStatus:o})}}),A=[{title:"app.common.disconnect",onClick:function(){N((0,le.rX)({option:g,shouldShowExtendedProgressStatus:a})),(0,K.zW)({dialogType:y,eventLabel:"disableServices",service:g,connectStatus:o})}},{title:"app.common.cancel",className:"cancel",onClick:function(){N((0,le.nW)(g)),N((0,_.tB)()),(0,K.zW)({dialogType:y,eventLabel:"cancel",service:g,connectStatus:o})}}];return m?(0,p.of)((0,_.mk)(y,Object.assign({},k,{primaryAction:Object.assign({},A[0],{variant:ie.Hf.SECONDARY}),secondaryAction:Object.assign({},A[1],{variant:ie.Hf.PLANE})}))):(0,p.of)((0,_.mk)(y,Object.assign({},k,{buttons:A})))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.SEND_DISCONNECTION_REQUEST),(0,b.zg)((function(e){var n=t.value,o=e.payload,s=o.option,i=o.shouldShowExtendedProgressStatus,a=o.profileStr,r=o.isDisconnectingMemberOfFamilyMs,c=(0,D.DIw)()(n)?Te:Ee;return(0,m.T)((0,p.of)(i?Me(c,s):(0,_.tB)()),(0,y.Sp)(Ne(t,s)).pipe((0,b.zg)((function(e){var t=e.data,o=t.data,c=t.meta.status,u=O.Z.get(o,"status");if(c===ge.ZP.SUCCESS)return[(0,le.YC)(s),(0,le.Mt)({option:s,status:ge.ZP.DISCONNECTING,shouldShowExtendedProgressStatus:i,profileStr:a,isDisconnectingMemberOfFamilyMs:r})];if(u===ge.ZP.CHILD_SERVICES||u===ge.ZP.DEPENDENT_SERVICES){var p={servicesList:o.billingServices};return Ae({option:s,messageId:"dependentServices",messageParams:p,state:n})}var l={errorMessage:(0,M.lZ)(t)};return Ae({option:s,messageId:"disconnectError",messageParams:l,state:n})})),(0,C.K)((function(){return Ae({option:s,state:n})}))))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.START_STATUS_CHECK),(0,v.h)((function(e){return e.payload.attemptCount<=Re(e.payload.option)})),(0,h.j)((function(e){return(0,g.F)(1e3*(0,V.p)(e.payload.attemptCount))})),(0,b.zg)((function(e){var n=e.payload,o=n.option,s=n.status,i=n.attemptCount,a=n.shouldShowExtendedProgressStatus,r=n.profileStr,c=n.isDisconnectingMemberOfFamilyMs,u=t.value,l=(0,D.DIw)()(u),d=(0,D.Ub4)(te.M)(u);return(0,y.uL)(Ne(t,o)+"/status").pipe((0,b.zg)((function(e){var n,s=e.data.data.managementStatus,i=s===ge.ZP.CONNECTED,m=s===ge.ZP.DISCONNECTED,g=(0,D.Ub4)(F.M)(u),v=null==g||null==(n=g.mainContent)?void 0:n.dashboardMiaOffers,b=(0,re.Q)(l);if(i||m){var C=["b2c_balance"],h=o.technicalType||o.type;h===me.Z.TRUST_CREDIT&&C.push("b2c_creditLimit"),h===me.Z.PLANT_TREE&&C.push("b2c_profile");if(["b2c_availableServices","b2c_connectedServices"].forEach((function(e){(0,A.kR)(e)(t.value)&&C.push(e)})),xe(o)){if(!m&&c)return(0,f._)(null);var S,I,E={profileStr:r,content:d,isFamilyMsLanding:o.isFamilyMsLanding,useKit:l};if(c){var T=(0,D.vpV)()(u)?d.appLink:(0,D.mx8)()(u);S=(0,ne.Ws)(Object.assign({},E,{redirectLink:T})),I=R.J0.MEMBER}else S=(0,ne.WP)(E),I=R.J0.OWNER;return(0,R.t8)({dialogType:S.dialogType,eventContext:I}),[(0,le.pv)(o,s),(0,_.mk)(b,S)].concat(C.map((function(e){return(0,k.xZ)({name:e},!0)})))}return g&&v&&i?(0,p.of)((0,le.$K)({option:o,dashboardMiaOffersContent:v,responseStatus:s,dataToRefresh:C,shouldShowExtendedProgressStatus:a})):je({responseStatus:s,shouldShowExtendedProgressStatus:a,option:o,dataToRefresh:C,useKit:l})}if(s===ge.ZP.CONNECTION_FAILED||s===ge.ZP.DISCONNECTION_FAILED){var P=[(0,le.dt)(o)];if(xe(o)){var N=(0,ne.rC)(d,l);return P.push((0,_.mk)(b,N)),P}if(a){var O=l?Ie:Se,y=l?Te:Ee;P.push(Le({heading:s===ge.ZP.CONNECTION_FAILED?O:y,messageId:"app.common.somethingWrongTryLater",option:o,useKit:l}))}return P}return(0,f._)(null)})),(0,C.K)((function(){if(i===Re(e.payload.option)){var t=s===ge.ZP.DISCONNECTING;return xe(o)?ke({option:o,state:u}):(t?Ae:De)({option:o,messageId:"statusCheckAttemptsCountExceeded",state:u,useKit:l})}return(0,p.of)((0,le.Mt)({option:o,status:s,attemptCount:i+1,shouldShowExtendedProgressStatus:a,profileStr:r,isDisconnectingMemberOfFamilyMs:c}))})))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.CHECK_MIA_PREVIEW),(0,b.zg)((function(n){var o=n.payload,s=o.option,i=o.dashboardMiaOffersContent,a=o.responseStatus,r=o.dataToRefresh,u=o.shouldShowExtendedProgressStatus,l=t.value,m=(0,D.DIw)()(l);return(0,d.z)((0,p.of)((0,k.xZ)({name:ce.H7.MODAL_SERVICE,params:(0,q.vs)(i)},!0)),e.pipe((0,c.l)(k.MF.API_DATA_LOAD_FINISHED,k.MF.API_DATA_LOAD_FAILURE),(0,v.h)((function(e){return e.payload.name===ce.H7.MODAL_SERVICE})),(0,b.zg)((function(e){var t=e.payload;return(0,M.dg)(t)?[Le({heading:m?"optionDisconnectButton.popup.headingCapitalized.connected":"optionDisconnectButton.popup.heading.connected",option:s,messageText:(0,$.s$)(i,void 0,{isPreviewInPopup:!0}),isButtonCenteredInMobile:!0,useKit:m}),(0,le.pv)(s,a)].concat(r.map((function(e){return(0,k.xZ)({name:e},!0)}))):je({responseStatus:a,shouldShowExtendedProgressStatus:u,option:s,dataToRefresh:r,useKit:m})}))))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.EDIT_OPTION_PARAMETERS_REQUEST),(0,v.h)((function(e){var n=e.payload.option.billingId;return!(0,de.l)(n)(t.value)})),(0,b.zg)((function(e){var n=e.payload,o=n.option,s=n.parameters;return(0,d.z)((0,p.of)((0,le.Q$)(o)),(0,y.B6)(B.mb.serviceParams(t.value,o.billingId),s).pipe((0,S.U)((function(e){var t=e.data;return(0,M.dg)(t)?(0,le.kv)(o,t,new Date):(0,le.bn)(o,Ze(s),Fe(t))})),(0,C.K)((function(e){return(0,p.of)((0,le.bn)(o,Ze(s),e.response?Fe(e.response.data.data):e.stack))}))))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.GET_OPTION_PARAMETERS_REQUEST),(0,b.zg)((function(e){var n=e.payload.option;return(0,d.z)((0,p.of)((0,le.Ic)(n)),(0,y.uL)(Ne(t,n)).pipe((0,b.zg)((function(e){var t=e.data;return(0,M.dg)(t)?(0,p.of)((0,le.Xy)(n,t.data.params,new Date),(0,k.xZ)({name:"b2c_availableServices"},!0),(0,k.xZ)({name:"b2c_connectedServices"},!0)):(0,p.of)((0,le.vH)(n,t.meta))})),(0,C.K)((function(e){return(0,p.of)((0,le.vH)(n,e.response.data?e.response.data.meta:e.stack))}))).pipe((0,I.g)(5e3)))})))}),(function(e){return e.pipe((0,c.l)(le.MF.EDIT_OPTION_PARAMETERS_FINISHED),(0,b.zg)((function(e){var t=e.payload.option;return(0,p.of)((0,le.Fd)({option:t}))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.CONNECT_BUTTON_CLICKED),(0,v.h)((function(e){return Ke(e,t)})),(0,b.zg)((function(e){var n=e.payload,o=n.option,s=n.connectStatus,i=n.searchOfferId,a=n.shouldShowExtendedProgressStatus,r=n.oneClickSlot,c=n.useKit,u=t.value,l=[{billingServiceId:o.billingId,action:"enable"}],d={isChecked:!0};return(0,y.e$)(B.mb.additionalNotificationsCheck(u),{operationType:"change_service",changedServices:l}).pipe((0,b.zg)((function(e){var t=e.data;return(0,M.dg)(t)&&(d.texts=t.data.slice(0,3)),(0,p.of)((0,le.HL)({option:o,connectStatus:s,offerId:i,notificationsInfo:d,shouldShowExtendedProgressStatus:a,oneClickSlot:r,useKit:c}))})),(0,C.K)((function(){return(0,p.of)((0,le.HL)({option:o,connectStatus:s,offerId:i,notificationsInfo:d,shouldShowExtendedProgressStatus:a,oneClickSlot:r,useKit:c}))})))})))}),(function(e,t){return e.pipe((0,c.l)(le.MF.DISCONNECT_BUTTON_CLICKED),(0,v.h)((function(e){return Ke(e,t)})),(0,b.zg)((function(e){var n=e.payload,o=n.option,s=t.value,i=[{billingServiceId:o.billingId,action:"disable"}],a={isChecked:!0},r=Object.assign({},n,{notificationsInfo:a});return(0,y.e$)(B.mb.additionalNotificationsCheck(s),{operationType:"change_service",changedServices:i}).pipe((0,b.zg)((function(e){var t=e.data;return(0,M.dg)(t)&&(a.texts=t.data.slice(0,3)),(0,p.of)((0,le.Fe)(r))})),(0,C.K)((function(){return(0,p.of)((0,le.Fe)(r))})))})))}),pe.Z)}}]);