1import{bo as b,be as n,by as _,bl as c,bf as s,bg as r,bj as a,bk as i,bm as g,bu as d,bq as H,cs as I,bx as h,bT as N,bh as $,bt as T,bw as U,ct as j,bs as C,cu as O,cv as z,cw as G}from"./Dus7iMKz.js";import{C as B}from"./xd4S6CyB.js";import{A as w}from"./BOKV-M25.js";import{_ as S}from"./BiChG7el.js";import{_ as R}from"./CBWAfL2f.js";import{_ as D}from"./UJHpA1U-.js";import{_ as L}from"./Bk6Ldugo.js";import{_ as W}from"./CZi9Qp6m.js";import{_ as A}from"./CYdCeek1.js";import"./_rforvXH.js";import"./B4wlGpwE.js";import"./BMVEEE2Y.js";import"./YQ4jXBDF.js";import"./Bii2ooBM.js";import"./D4Hqk9tz.js";import"./BILo_GaG.js";import"./CIR3dMIJ.js";import"./NtVjWzlQ.js";import"./CnEho_q9.js";import"./QgGM4E4p.js";import"./CBSlkiRM.js";import"./DdopVrzO.js";import"./BvEueam4.js";import"./DpP8VIUm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4a2ec599-a66e-4b88-9df5-51fd42843cb9",e._sentryDebugIdIdentifier="sentry-dbid-4a2ec599-a66e-4b88-9df5-51fd42843cb9")}catch{}})();const J={name:"VoucherClaimModalWarning",components:{AwesomeButton:w},props:{showModal:{type:Boolean,required:!0,default:!1}},emits:["continue","close"],data(){return{show:!1,showInsideModal:!1}},watch:{showModal(e){this.show=e,this.show&&this.$nextTick(()=>{this.showInsideModal=!0})},showInsideModal(e){e||this.$nextTick(()=>{this.$emit("close")})}}},K={key:0,class:"voucher-claim-modal-warning"},Q={key:0,class:"voucher-claim-modal-warning__content"},X={class:"voucher-claim-modal-warning__header-container"},Y={class:"voucher-claim-modal-warning__header"},Z={class:"voucher-claim-modal-warning__description"};function x(e,t,l,V,o,m){const v=w,f=D,p=L;return n(),_(p,null,{default:c(()=>[o.show?(n(),s("div",K,[r(f,null,{default:c(()=>[o.showInsideModal?(n(),s("div",Q,[a("div",X,[a("img",{class:"voucher-claim-modal-warning__close-img",src:W,alt:"Close modal",onClick:t[0]||(t[0]=u=>o.showInsideModal=!1)}),a("h3",Y,i(e.$t("pages.p2p.warning")),1)]),a("p",Z,i(e.$t("payment-summary.verify")),1),r(v,{onContinue:t[1]||(t[1]=u=>{o.showInsideModal=!1,e.$emit("continue")})},{default:c(()=>[g(i(e.$t("account-module.my-vouchers.show-voucher")),1)]),_:1})])):d("",!0)]),_:1})])):d("",!0)]),_:1})}const ee=Object.assign(b(J,[["render",x]]),{__name:"PaymentSummaryVoucherClaimModalWarning"}),oe={name:"ClaimVoucherVerificationCodeModal",components:{VerificationCodeInput:A},props:{modelValue:{type:String,required:!0},showModal:{type:Boolean,required:!0,default:!1},invalid:{type:Boolean,required:!0},type:{type:String,required:!0},resendLoader:{type:Boolean,required:!0},verificationCodeSentAt:{type:Date,required:!0},errors:{type:Array}},emits:["entered","resendCode"],data(){return{show:!1,showInsideModal:!1,secondsToResend:120,canResend:!1,interval:null,presentDate:null}},computed:{code:{get(){return this.modelValue},set(e){return this.$emit("update:modelValue",e)}}},watch:{presentDate(){const e=I(this.presentDate),t=I(this.verificationCodeSentAt);this.secondsToResend=120-e.diff(t,"seconds"),this.secondsToResend<0&&(this.secondsToResend=0),this.canResend=this.secondsToResend<=0},showModal(e){this.show=e,this.show&&this.$nextTick(()=>{this.showInsideModal=!0})},showInsideModal(e){e||this.$nextTick(()=>{this.$emit("close")})}},mounted(){this.setTimeInterval()},beforeUnmount(){this.clearTimeInterval()},methods:{setTimeInterval(){this.interval=H(()=>{this.presentDate=new Date},1e3)},clearTimeInterval(){clearInterval(this.interval)},getTimeLeft(e){const t=Math.floor(e/60),l=Math.floor(e-60*t);return`${t<10?`0${t}`:t}:${l<10?`0${l}`:l}`}}},te={key:0,class:"claim-voucher-verification-code"},ne={key:0,class:"claim-voucher-verification-code__content"},ie={class:"claim-voucher-verification-code__header"},se={class:"claim-voucher-verification-code__description"},re={class:"claim-voucher-verification-code__code-container"},ae={class:"claim-voucher-verification-code__code-label"},ce={key:0,class:"claim-voucher-verification-code__result claim-voucher-verification-code__result--wrong"},de={key:1,class:"claim-voucher-verification-code__result claim-voucher-verification-code__result--correct"},le={key:0,class:"claim-voucher-verification-code__spinner"};function ue(e,t,l,V,o,m){const v=A,f=D,p=L;return n(),_(p,null,{default:c(()=>[o.show?(n(),s("div",te,[r(f,null,{default:c(()=>[o.showInsideModal?(n(),s("div",ne,[a("img",{class:"claim-voucher-verification-code__close-img",src:W,alt:"Close modal",onClick:t[0]||(t[0]=u=>o.showInsideModal=!1)}),a("h3",ie,i(l.type==="email"?"Email":"SMS")+" "+i(e.$t("c2.account.verification")),1),a("p",se,i(l.type==="email"?"Email":"SMS")+i(e.$t("payment-summary.send-to"))+" "+i(l.type==="email"?"email address":"phone number")+i(e.$t("payment-summary.token")),1),a("div",re,[a("label",ae,i(l.type==="email"?"Email":"SMS")+" "+i(e.$t("payment-summary.code")),1),r(v,{modelValue:m.code,"onUpdate:modelValue":t[1]||(t[1]=u=>m.code=u),class:"claim-voucher-verification-code__code",invalid:l.invalid,onEntered:t[2]||(t[2]=u=>e.$emit("entered"))}
1,null,8,["modelValue","invalid"]),r(h,{name:"fade",mode:"out-in"},{default:c(()=>[l.errors[0]==="wrong-code"?(n(),s("span",ce,"Invalid code")):l.errors[0]==="correct-code"?(n(),s("span",de,"Code verified. Redirecting...")):d("",!0)]),_:1})]),r(h,{name:"fade",mode:"out-in",duration:150},{default:c(()=>[l.resendLoader?(n(),s("div",le,[...t[4]||(t[4]=[a("span",null,null,-1)])])):d("",!0)]),_:1}),r(h,{name:"fade",mode:"out-in",duration:150},{default:c(()=>[(n(),s("span",{key:o.canResend,class:N(["claim-voucher-verification-code__resend",{"claim-voucher-verification-code__resend--clickable":o.canResend}]),onClick:t[3]||(t[3]=u=>o.canResend?e.$emit("resendCode"):null)},i(o.canResend?"Resend":`Resend in: ${m.getTimeLeft(o.secondsToResend)}`),3))]),_:1})])):d("",!0)]),_:1})])):d("",!0)]),_:1})}const he=Object.assign(b(oe,[["render",ue]]),{__name:"PaymentSummaryClaimVoucherVerificationCodeModal"}),me={name:"ClaimP2pVoucher",components:{ClaimVoucherVerificationCodeModal:he,VoucherClaimModalWarning:ee,AwesomeButton:w,VoucherCodeFieldWithCopy:S,CompanyHeader:B,CompanyHeaderClean:$,TextShimmer:R},data(){return{loader:!0,buttonLoader:!1,resendLoader:!1,showWarningModal:!1,showVerificationCodeModal:!1,voucherCode:null,code:null,transactionSentBy:null,verificationCodeSentAt:null}},watch:{code(){this.$refs.code.reset()}},async mounted(){await this.canClaimVoucher()},beforeUnmount(){this.voucherCode&&confirm(`${this.$t("pages.p2p.forget")} ${this.voucherCode}`)},methods:{async claimVoucher(){this.buttonLoader=!0;try{const{encrypted:e}=await G({voucherBatchTransactionId:(this._.provides[C]||this.$route).params.voucherBatchTransactionId});this.voucherCode=e}catch{return this.$router.push({path:"/"})}finally{this.buttonLoader=!1}},async sendVerificationCode(){try{this.verificationCodeSentAt=new Date,await z({voucherBatchTransactionId:(this._.provides[C]||this.$route).params.voucherBatchTransactionId})}catch{return this.$router.push({path:"/"})}},async validateCode(){this.resendLoader=!0;try{const{valid:e}=await O({voucherBatchTransactionId:(this._.provides[C]||this.$route).params.voucherBatchTransactionId,code:this.code});e?(this.$refs.code.setErrors(["correct-code"]),setTimeout(()=>{this.showVerificationCodeModal=!1,this.claimVoucher(),this.$refs.code.rest()},1500)):this.$refs.code.setErrors(["wrong-code"])}catch{return this.$router.push({path:"/"})}finally{this.resendLoader=!1}},async canClaimVoucher(){this.loader=!0;try{const{canClaim:e,transactionSentBy:t}=await j({voucherBatchTransactionId:(this._.provides[C]||this.$route).params.voucherBatchTransactionId});if(!e)return this.$router.push({path:"/"});this.transactionSentBy=t}catch{return this.$router.push({path:"/"})}finally{this.loader=!1}}}},pe={class:"claim-p2p-voucher page"},_e={class:"claim-p2p-voucher__title-container"},ve={key:0},fe={key:1,class:"claim-p2p-voucher__description"},ye={class:"claim-p2p-voucher__voucher-title"},Ce={key:0,class:"claim-p2p-voucher__warning-container"},we={class:"claim-p2p-voucher__warning"},ge={class:"claim-p2p-voucher__warning-description"},be={key:0,class:"claim-p2p-voucher__content-loader"},Ve={class:"claim-p2p-voucher__title-container"},ke={key:0,class:"claim-p2p-voucher__header claim-p2p-voucher__header--mobile"},Me={key:1,class:"claim-p2p-voucher__description claim-p2p-voucher__description--mobile"},Ie={class:"claim-p2p-voucher__voucher-title claim-p2p-voucher__voucher-title--mobile"},Te={key:0,class:"claim-p2p-voucher__warning-container"},$e={class:"claim-p2p-voucher__warning claim-p2p-voucher__warning--mobile"},Be={class:"claim-p2p-voucher__warning-description claim-p2p-voucher__warning-description--mobile"},Se={key:0,class:"claim-p2p-voucher__mobile-content-loader"};function Re(e,t,l,V,o,m){const v=$,f=B,p=w,u=S,k=R,E=T("VoucherClaimModalWarning"),q=T("ClaimVoucherVerificationCodeModal"),P=U;return n(),s("div",pe,[r(v,{class:"claim-p2p-voucher__desktop-header"}),r(f,{class:"claim-p2p-voucher__mobile-header"}),r(h,{name:"fade",mode:"out-in",duration:200},{default:c(()=>[(n(),s("div",{key:o.loader,class:"claim-p2p-voucher__content"},[a("div",_e,[o.loader?d("",!0):(n(),s("h2",ve,i(e.$t("pages.p2p.claim")),1)),o.loader?d("",!0):(n(),s("p",fe,i(e.$t("pages.p2p.send")),1))]),r(h,{name:"fade",mode:"out-in",duration:300},{default:c(()=>[o.loader?d("",!0):(n(),s("div",{key:o.voucherCode,class:"claim-p2p-voucher__voucher-container"}
1,[a("span",ye,i(e.$t("pages.p2p.code")),1),o.voucherCode?(n(),_(u,{key:1,class:"claim-p2p-voucher__voucher-code","voucher-code":o.voucherCode},null,8,["voucher-code"])):(n(),_(p,{key:0,class:"claim-p2p-voucher__button",loader:o.buttonLoader,onContinue:t[0]||(t[0]=y=>o.showWarningModal=!0)},{default:c(()=>[g(i(e.$t("pages.p2p.show")),1)]),_:1},8,["loader"]))]))]),_:1}),r(h,{name:"fade",mode:"out-in",duration:150},{default:c(()=>[!o.loader&&o.voucherCode?(n(),s("div",Ce,[a("h4",we,i(e.$t("pages.p2p.warning")),1),a("p",ge,i(e.$t("pages.p2p.refresh")),1)])):d("",!0)]),_:1}),o.loader?(n(),s("div",be,[r(k,{height:200})])):d("",!0)]))]),_:1}),r(h,{name:"fade",mode:"out-in",duration:200},{default:c(()=>[(n(),s("div",{key:o.loader,class:"claim-p2p-voucher__mobile-content"},[a("div",Ve,[o.loader?d("",!0):(n(),s("h3",ke,i(e.$t("pages.p2p.claim")),1)),o.loader?d("",!0):(n(),s("p",Me,i(e.$t("pages.p2p.send")),1))]),r(h,{name:"fade",mode:"out-in",duration:300},{default:c(()=>[o.loader?d("",!0):(n(),s("div",{key:o.voucherCode,class:"claim-p2p-voucher__voucher-container"},[a("span",Ie,i(e.$t("pages.p2p.code")),1),o.voucherCode?(n(),_(u,{key:1,class:"claim-p2p-voucher__voucher-code","voucher-code":o.voucherCode},null,8,["voucher-code"])):(n(),_(p,{key:0,class:"claim-p2p-voucher__button",loader:o.buttonLoader,onContinue:t[1]||(t[1]=y=>o.showWarningModal=!0)},{default:c(()=>[g(i(e.$t("pages.p2p.show")),1)]),_:1},8,["loader"]))]))]),_:1}),r(h,{name:"fade",mode:"out-in",duration:150},{default:c(()=>[!o.loader&&o.voucherCode?(n(),s("div",Te,[a("h4",$e,i(e.$t("pages.p2p.warning")),1),a("p",Be,i(e.$t("pages.p2p.refresh")),1)])):d("",!0)]),_:1}),o.loader?(n(),s("div",Se,[r(k,{height:200})])):d("",!0)]))]),_:1}),r(E,{"show-modal":o.showWarningModal,onClose:t[2]||(t[2]=y=>o.showWarningModal=!1),onContinue:t[3]||(t[3]=y=>{m.sendVerificationCode(),o.showVerificationCodeModal=!0})},null,8,["show-modal"]),r(P,{ref:"code",as:"div"},{default:c(({errors:y,invalid:F})=>[r(q,{modelValue:o.code,"onUpdate:modelValue":t[4]||(t[4]=M=>o.code=M),"show-modal":o.showVerificationCodeModal,type:o.transactionSentBy,invalid:F,"resend-loader":o.resendLoader,"verification-code-sent-at":o.verificationCodeSentAt,errors:y,onClose:t[5]||(t[5]=M=>o.showVerificationCodeModal=!1),onEntered:m.validateCode,onResendCode:m.sendVerificationCode}
1,null,8,["modelValue","show-modal","type","invalid","resend-loader","verification-code-sent-at","errors","onEntered","onResendCode"])]),_:1},512)])}const to=b(me,[["render",Re]]);export{to as default};
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.