1import{a as tt,b as it}from"./chunk-HPFLNQ6U.js";import{a as et}from"./chunk-AEM26G3S.js";import{a as Q}from"./chunk-CLU2SV7I.js";import{a as X}from"./chunk-GVFFMUQG.js";import{b as Z}from"./chunk-2HZUZXBZ.js";import"./chunk-QJQQZDRG.js";import"./chunk-4PH7MLCE.js";import{a as D}from"./chunk-UNVQ5NXZ.js";import{f as q}from"./chunk-6P5FJ3ME.js";import"./chunk-KJKOVUXC.js";import"./chunk-H5UP2OAC.js";import"./chunk-YVHMR5AX.js";import"./chunk-4WV4YYVY.js";import{a as J,b as H}from"./chunk-HPPOTNKQ.js";import{j as $,n as W}from"./chunk-VUASBBXJ.js";import{e as K}from"./chunk-O6L37FVV.js";import"./chunk-EN33RNOB.js";import{a as w,b as F}from"./chunk-YGRMDJRB.js";import{a as k}from"./chunk-55WYSX2S.js";import{E as O,F as Y,Ha as G,b as L,qa as N,ua as V,va as z}from"./chunk-MGYJXOAP.js";import{a as f,b as U}from"./chunk-THXBBYWB.js";import{H as P,O as B}from"./chunk-J4K66FRB.js";import{F as j,Hb as g,Ib as p,Jc as M,Nb as S,Nc as m,Ob as s,Oc as d,Pb as o,Qb as x,Ub as R,Vb as T,Xb as E,ac as _,bb as n,cc as l,i as A,ma as C,mb as r,na as b,qc as c,rc as v,sb as y,sc as u}from"./chunk-7DQSQO6M.js";import{a as I}from"./chunk-EQDQRRRY.js";function at(i){return i?{roamingStatus:i.activeRoaming===!0,canRoamingBeChanged:!0}:{roamingStatus:!1,canRoamingBeChanged:!1}}var St=i=>({number:i});function vt(i,h){if(i&1&&(s(0,"div",0),x(1,"mat-progress-spinner",1),o()),i&2){let t=l();n(),S("mode",t.commonService.mode)("strokeWidth",2)("diameter",80)}}function ft(i,h){if(i&1&&(s(0,"div",0),x(1,"mat-progress-spinner",1),o()),i&2){let t=l(2);n(),S("mode",t.commonService.mode)("strokeWidth",2)("diameter",80)}}function Ct(i,h){if(i&1){let t=E();s(0,"p",4),c(1),m(2,"translate"),o(),s(3,"div",5)(4,"p",6),c(5),o(),s(6,"mat-slide-toggle",7),_("change",function(){C(t);let a=l(3);return b(a.changeStatus())}),o()(),s(7,"div",8)(8,"button",9),_("click",function(){C(t);let a=l(3);return b(a.openAskingConfirmationDialog())}),c(9),m(10,"translate"),o()(),R(11),s(12,"p",10)(13,"b"),c(14),m(15,"translate"),o(),c(16),m(17,"translate"),o(),s(18,"p",11),c(19),m(20,"translate"),o(),s(21,"ul",12)(22,"li"),c(23),m(24,"translate"),o(),s(25,"li"),c(26),m(27,"translate"),o()(),T()}if(i&2){let t=l(3);n(),v(d(2,12,"adjustYourSubscription.manageRoamingDesc")),n(4),v(t.trs.trsTsParams("adjustYourSubscription.enableRoaming",M(26,St,t.commonService.pageSubtitle))),n(),S("disabled",t.isChangeRoamingSubmitted)("checked",t.isChecked()),n(2),S("ladda",t.isChangeRoamingSubmitted)("disabled",t.roamingStatus===t.roamingStatusOriginal),n(),u(" ",d(10,14,"save")," "),n(5),v(d(15,16,"adjustYourSubscription.roamingStaticText.note")),n(2),u(" ",d(17,18,"adjustYourSubscription.roamingStaticText.text01")," "),n(3),u(" ",d(20,20,"adjustYourSubscription.roamingStaticText.text02")," "),n(4),u(" ",d(24,22,"adjustYourSubscription.roamingStaticText.text03")," "),n(3),u(" ",d(27,24,"adjustYourSubscription.roamingStaticText.text04")," ")}}function bt(i,h){if(i&1){let t=E();s(0,"p",13),c(1),m(2,"translate"),o(),s(3,"div",8)(4,"button",9),_("click",function(){C(t);let a=l(3);return b(a.navigateToPayBills())}),c(5),m(6,"translate"),o()()}if(i&2){let t=l(3);n(),v(d(2,4,"adjustYourSubscription.roamingStaticText.preApprovedFalse")),n(3),S("ladda",t.isLaddaActivated)("disabled",t.isLaddaActivated),n(),u(" ",d(6,6,"adjustYourSubscription.roamingStaticText.makeAPayment")," ")}}function _t(i,h){if(i&1&&(s(0,"div",2)(1,"div",3),g(2,Ct,28,28),g(3,bt,7,8),o()()),i&2){let t=l(2);n(2),p(t.isPreApproved||!t.isPreApproved&&t.roamingStatusOriginal?2:-1),n(),p(!t.isPreApproved&&!t.roamingStatusOriginal?3:-1)}}function xt(i,h){i&1&&(s(0,"div",2)(1,"div",3)(2,"p",14),c(3),m(4,"translate"),o()()()),i&2&&(n(3),v(d(4,1,"adjustYourSubscription.cantManageRoaming")))}function Rt(i,h){if(i&1&&(g(0,ft,2,3,"div",0),R(1),g(2,_t,4,2,"div",2),g(3,xt,5,3,"div",2),T()),i&2){let t=l();p(t.isServiceLoading?0:-1),n(2),p(!t.isServiceLoading&&t.canRoamingBeChanged?2:-1),n(),p(!t.canRoamingBeChanged&&!t.isServiceLoading?3:-1)}}var nt=(()=>{class i{constructor(t,e,a,ot,rt,st,ct,mt,dt,lt,gt,pt,ut,ht){this.commonService=t,this.dialog=e,this.trs=a,this.customerService=ot,this.adjustSubscriptionService=rt,this.route=st,this.navigationService=ct,this.contractDetailsService=mt,this.billsCustomerService=dt,this.sanitizer=lt,this.gtmService=gt,this.storageService=pt,this.dashboardDataService=ut,this.addonsService=ht,this.config=L,this.isServiceLoading=!1,this.roamingStatus=!1,this.roamingStatusOriginal=!1,this.canRoamingBeChanged=!1,this.isChangeRoamingSubmitted=!1,this.isPreApproved=!0,this.isLaddaActivated=!1,this.commonService.setPageTitle(this.trs.trsTs("adjustYourSubscription.manageRoaming"),"mobile-manage-roaming"),this.commonService.isPageSubtitleActivated=!0,this.commonService.isBackButtonActivated=!0,this.commonService.pageSubtitle=this.customerService?.selectedContractObj?.contractNo}ngOnInit(){this.customerService.selectedContract||this.customerService.setSelectedContract(this.customerService.getSelectedContract()),this.getRoamingStatus()}navigateToPayBills(){if(!this.isPreApproved&&!this.roamingStatusOriginal){let t={contractIdentityToken:this.customerService?.selectedContract?.contractIdentity??"",customerCode:this.customerService?.selectedContract?.customerIdentity??""};this.manageRoamingDepositPayment(t)}else this.route.navigate(["/bills/pay-bills"])}manageRoamingDepositPayment(t){this.isLaddaActivated=!0,this.adjustSubscriptionService.depositPayment(t).pipe(j(e=>(console.log("Catch error occurred while deposit payment for preApproved false: ",e),this.isLaddaActivated=!1,this.handleErrorDepositPayment(e),A))).subscribe(e=>{if(console.log("result depositPayment",e),e.status&&e.status==="OK"&&e?.redirectUrl){let a=this.billsCustomerService.setPayUrl(e?.redirectUrl);a&&(this.billsCustomerService.iframePayUrl=this.sanitizer.bypassSecurityTrustResourceUrl(a)),this.storageService.set(f.PAYMENT_DEPOSIT,"true"),this.billsCustomerService.iframePayUrl&&setTimeout(()=>{this.route.navigate(["/bills/pay-bills"]),this.isLaddaActivated=!1},500)}else this.openConfirmationDialog("error","httpErrorCode.default"),this.isLaddaActivated=!1})}openConfirmationDialog(t,e){this.dialog.open(D,{width:"812px",panelClass:["global-dialog","gd-v3","text-align-center","confirmation-dialog-v3"],data:{image:t==="success"?"assets/img/success-dialog-icon.svg":"assets/img/unsuccess-dialog-icon.svg",desc:t==="error"?this.trs.trsTs(e??"")||this.trs.trsTs("httpErrorCode.default"):this.roamingStatus?this.trs.trsTs("adjustYourSubscription.roamingSuccessEnabled"):this.trs.trsTs("adjustYourSubscription.roamingSuccessDisabled"),close:this.trs.trsTs("close")}}).afterClosed().subscribe(()=>{t==="success"&&this.navigationService.navigateBack("/service-details/adjust-subscription")})}openAskingConfirmationDialog(){this.dialog.open(Q,{width:"812px",panelClass:["global-dialog","gd-v3","text-align-center","confirmation-dialog-v3"],data:{title:this.trs.trsTs("adjustYourSubscription.manageRoaming"),desc:this.askingDialogDesc()}}).afterClosed().subscribe(e=>{e==="confirm"&&this.changeSettings()})}askingDialogDesc(){return this.isChecked()===!0?this.trs.trsTsParams("adjustYourSubscription.enableRoaming",{number:this.commonService.pageSubtitle}):this.trs.trsTsParams("adjustYourSubscription.disableRoaming",{number:this.commonService.pageSubtitle})}isChecked(){return this.roamingStatus}changeStatus(){return this.roamingStatus=!this.roamingStatus}getRoamingStatus(){let t=this.getServiceId();if(!t){this.canRoamingBeChanged=!1,this.isServiceLoading=!1;return}this.isServiceLoading=!0,this.adjustSubscriptionService.fetchRoamingStatus(t).subscribe(e=>{let a=at(e);this.roamingStatus=a.roamingStatus,this.roamingStatusOriginal=a.roamingStatus,this.canRoamingBeChanged=a.canRoamingBeChanged,this.isServiceLoading=!1},e=>{console.log("Error occurred while fetching roaming status: ",e),this.canRoamingBeChanged=!1,this.isServiceLoading=!1})}getServiceId(){let t=this.storageService.getJson(f.SELECTED_CONTRACT);return this.customerService.selectedContractObj?.contractNo||t?.contractNo||this.storageService.get(f.MSISDN)||""}changeSettings(){let t=this.getServiceId();if(!t){this.openConfirmationDialog("error","httpErrorCode.default");return}this.isChangeRoamingSubmitted=!0,(this.roamingStatus?this.adjustSubscriptionService.activateRoaming(t):this.adjustSubscriptionService.deactivateRoaming(t)).subscribe(()=>{this.openConfirmationDialog("success"),this.isChangeRoamingSubmitted=!1,this.roamingStatusOriginal=this.roamingStatus,this.setGtmManageRoamingLayerData()},a=>{console.log("Error occurred while changing roaming settings: ",a),this.isChangeRoamingSubmitted=!1,this.roamingStatus=this.roamingStatusOriginal,this.handleError(a)})}setGtmManageRoamingLayerData(){let t={user_id:this.storageService.get(f.NOTIFICATION_UUID)||this.gtmService?.userAuthIdentity};this.roamingStatus&&(t.roaming_activation=!0),this.roamingStatus||(t.roaming_deactivation=!0),this.gtmService.pushToDataLayer(w.SELFCARE_ACTIONS,I({},t))}handleError(t){if(t.status===466){this.openConfirmationDialog("error","httpErrorCode.error466");return}this.dialog.open(D,{width:"812px",panelClass:["global-dialog","gd-v3","text-align-center","confirmation-dialog-v3"],data:{image:"assets/img/unsuccess-dialog-icon.svg",title:tt(this.trs,t.status),desc:it(this.trs,t.status),close:this.trs.trsTs("close")}})}handleErrorDepositPayment(t){let e=`manageRoamingDeposit${t.status}`,a=this.trs.trsTs(`httpErrorCode.${[e]}`)||this.trs.trsTs("httpErrorCode.default");this.openConfirmationDialog("error",a)}ngOnDestroy(){this.commonService.isPageSubtitleActivated=!1,this.commonService.isBackButtonActivated=!1,this.commonService.pageSubtitle=""}static{this.\u0275fac=function(e){return new(e||i)(r(G),r(N),r(V),r(W),r(et),r(B),r(z),r(Z),r(q),r(P),r(F),r(U),r($),r(K))}}static{this.\u0275cmp=y({type:i,selectors:[["app-manage-roaming"]],decls:2,vars:2,consts:[[1,"page-spinner"],[3,"mode","strokeWidth","diameter"],[1,"manage-roaming","mt-60"],[1,"container-400"],[1,"font-size-14","font-light","mb-25"],[1,"terms-resp-wrap","mb
1-60"],[1,"font-size-14","font-bold"],[1,"global-mat-slide-toggle",3,"change","disabled","checked"],[1,"text-align-center"],[1,"radius16","btn-1-v3","bg-main","ladda-fix-v3","black-with-ladda",3,"click","ladda","disabled"],[1,"mb-25","mt-60"],[1,"mb-15"],[1,"has-style"],[1,"font-size-14","font-light","mb-60"],[1,"page-text-2","font-light","mb-25"]],template:function(e,a){e&1&&(g(0,vt,2,3,"div",0),g(1,Rt,4,3)),e&2&&(p(a.isServiceLoading?0:-1),n(),p(a.dashboardDataService.isDashboardDataLoaded()&&a.addonsService.isAddonsLoaded()?1:-1))},dependencies:[k,X,H,J,Y,O],encapsulation:2})}}return i})();var ni=[{path:"",redirectTo:"manage-roaming",pathMatch:"full"},{path:"manage-roaming",component:nt}];export{ni as MANAGE_ROAMING_ROUTES};
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.