1"use strict";(self.webpackChunkDCP_Web=self.webpackChunkDCP_Web||[]).push([["libs_motor-sme-product_src_lib_components_otp_motor-sme-payment-otp_motor-sme-payment-otp_com-72ac84"],{53060:(R,a,s)=>{s.r(a),s.d(a,{MotorSmePaymentOtpComponent:()=>T});var e=s(23214),h=s(98434),l=s(92947),c=s(68018),_=s(89079),m=s(70980),p=s(80288),d=s(29040),u=s(7872),g=s(32334),O=s(92286),i=s(21336),P=s(42577),E=s(98390),v=s(80891);function M(o,D){1&o&&e.nrm(0,"art-animation",2),2&o&&e.Y8G("hasBackground",!0)}function f(o,D){if(1&o){const t=e.RV6();e.DNE(0,M,1,1,"art-animation",0),e.j41(1,"art-otp",1),e.bIt("changeOTP",function(r){e.eBV(t);const C=e.XpG();return e.Njj(C.onOtpChange(r))})("resendOTP",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.onResendOtp())})("changePhoneNumber",function(){e.eBV(t);const r=e.XpG();return e.Njj(r.onChangePhoneNumber())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("ngIf",t.isLoading()),e.R7$(),e.Y8G("config",t.otpConfig())("phoneNumber",t.phoneNo())("timerDisplay",t.timerDisplay())("enableResend",t.enableResend())("isCounterEnabled",!0)("isResendEnabled",!0)("phoneNumberHide",!1)("errorMessage",t.errorMessage())("invalidOTP",t.isOtpInvalid())}}let T=(()=>{class o{storage=(0,e.WQX)(p.s);motorSmeService=(0,e.WQX)(O.i);router=(0,e.WQX)(l.Ix);languageService=(0,e.WQX)(d.g);destroyRef=(0,e.WQX)(e.abz);isLoading=(0,e.vPA)(!1);otpEnabled=(0,e.vPA)(!1);otpConfig=(0,e.vPA)({length:6});phoneNo=(0,e.vPA)("");errorMessage=(0,e.vPA)("");isOtpInvalid=(0,e.vPA)(!1);enableResend=(0,e.vPA)(!1);timerDisplay=(0,e.vPA)("05:00");txId="";timerSubscription=null;currentLang=this.languageService.currentLang;redirectUrl="";ngOnInit(){const t=this.storage.GetValue(this.motorSmeService.STORAGE_KEY);t?.currentStep===P.Dq.QUOTATION_SUMMARY?(this.otpEnabled.set(!0),this.redirectUrl=t?.redirectUrl||"",this.phoneNo.set(t?.data?.userInfo?.phone_no||t?.mobileNumber||""),this.sendOtp()):this.router.navigateByUrl(this.languageService.translateRoute(i.Z.QUOTATION_SUMMARY))}sendOtp(){this.isLoading.set(!0),this.errorMessage.set(""),this.isOtpInvalid.set(!1);const t=this.motorSmeService.getReferenceNumber();this.motorSmeService.viewQuote(t).pipe((0,_.pQ)(this.destroyRef),(0,m.j)(()=>this.isLoading.set(!1))).subscribe({next:n=>{this.txId=n?.txId||"",this.phoneNo.set(n?.phone_no||this.phoneNo()),this.storage.mergeIntoExistValue(this.motorSmeService.STORAGE_KEY,{txId:n?.txId,phone_no:n?.phone_no}),this.startTimer()},error:n=>{this.errorMessage.set(n)}})}onOtpChange(t){6===t?.length&&this.verifyOtp(t)}verifyOtp(t){this.isLoading.set(!0),this.errorMessage.set(""),this.isOtpInvalid.set(!1),this.motorSmeService.verifyOtp({TxId:this.txId,value:t}).pipe((0,_.pQ)(this.destroyRef),(0,m.j)(()=>this.isLoading.set(!1))).subscribe({next:n=>{n&&n.status?this.redirectUrl?this.router.navigate([this.redirectUrl]):this.router.navigateByUrl(this.languageService.translateRoute(i.Z.PAYMENT)):(this.isOtpInvalid.set(!0),this.errorMessage.set("en"===this.currentLang()?"Wrong OTP entered. Please enter correct OTP":"\u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0645\u062f\u062e\u0644 \u063a\u064a\u0631 \u0635\u062d\u064a\u062d\u060c \u0627\u0644\u0631\u062c\u0627\u0621 \u0627\u062f\u062e\u0627\u0644 \u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0635\u062d\u064a\u062d."))},error:()=>{this.isOtpInvalid.set(!0),this.errorMessage.set("en"===this.currentLang()?"Wrong OTP entered. Please enter correct OTP":"\u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0645\u062f\u062e\u0644 \u063a\u064a\u0631 \u0635\u062d\u064a\u062d\u060c \u0627\u0644\u0631\u062c\u0627\u0621 \u0627\u062f\u062e\u0627\u0644 \u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0635\u062d\u064a\u062d.")}})}onResendOtp(){this.enableResend.set(!1),this.sendOtp()}onChangePhoneNumber(){this.router.navigateByUrl(this.languageService.translateRoute(i.Z.CHANGE_PHONE_NUMBER))}startTimer(){this.enableResend.set(!1),this.timerSubscription&&this.timerSubscription.unsubscribe(),this.timerSubscription=(0,g.u$)(E.DE).subscribe({next:t=>{this.timerDisplay.set(t.time)},complete:()=>{this.enableResend.set(!0)}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["art-motor-sme-payment-otp"]],decls:1,vars:1,consts:[["height","150px","name","spinner",3,"hasBackgroun
1d",4,"ngIf"],[3,"changeOTP","resendOTP","changePhoneNumber","config","phoneNumber","timerDisplay","enableResend","isCounterEnabled","isResendEnabled","phoneNumberHide","errorMessage","invalidOTP"],["height","150px","name","spinner",3,"hasBackground"]],template:function(n,r){1&n&&e.DNE(0,f,2,10),2&n&&e.vxM(r.otpEnabled()?0:-1)},dependencies:[h.bT,c.h,u.x,v.C6],encapsulation:2,changeDetection:0})}return o})()}}]);
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.