PageSourceSearch

https://www.heroplusgroup.com/_next/static/chunks/pages/orders/process/[id]-6abccf8b62479a20.js

js heroplusgroup.com collected 2026-10-02 16:03:09 UTC 33,610 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aa779f26-afe4-4de3-89ba-75274801635c",e._sentryDebugIdIdentifier="sentry-dbid-aa779f26-afe4-4de3-89ba-75274801635c")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8190],{12839:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/orders/process/[id]",function(){return i(38258)}])},38258:function(e,n,i){"use strict";i.r(n),i.d(n,{__N_SSP:function(){return eE},default:function(){return eM}});var t=i(85893),r=i(71207),o=i.n(r),a=i(90512),l=i(37340),d=i(67294),s=i(11163),c=i(86896),u=i(44012),m=i(186),p=i(27634),v=i(35005),h=i(36968),f=i(92247),_=i(93228),g=i(66263),x=i(43205),b=i(74231),y=i(255);async function j(e,n,i){let t=i.formatMessage({id:"validation.phone_number_required",defaultMessage:"validation.phone_number_required",description:"validation.phone_number_required"}),r=i.formatMessage({id:"validation.country_code_required",defaultMessage:"validation.country_code_required",description:"validation.country_code_required"}),o=i.formatMessage({id:"payment_link.enter_otp.error_msg.invalid_passcode",defaultMessage:"payment_link.enter_otp.error_msg.invalid_passcode",description:"payment_link.enter_otp.error_msg.invalid_passcode"}),a=(0,b.Ry)({country_code:(0,b.Z_)().typeError(r).required(r),phone_number:(0,b.Z_)().typeError(t).required(t),password:(0,b.Z_)().length(6,o).typeError(o).required(o)}),l=await a.validate(e).catch(e=>e);return void 0!=l.errors?{isValid:!1,errorMsg:(0,y.a)(l,i,!1),status:"error",message:l.errors}:{isValid:!0,errorMsg:void 0}}async function k(e,n,i){let t=i.formatMessage({id:"validation.phone_number_required",defaultMessage:"validation.phone_number_required",description:"validation.phone_number_required"}),r=i.formatMessage({id:"validation.country_code_required",defaultMessage:"validation.country_code_required",description:"validation.country_code_required"}),o=i.formatMessage({id:"validation.id_required",defaultMessage:"validation.id_required",description:"validation.id_required"}),a=(0,b.Ry)({country_code:(0,b.Z_)().typeError(r).required(r),phone_number:(0,b.Z_)().typeError(t).required(t),id:(0,b.Z_)().typeError(o).required(o)}),l=await a.validate(e).catch(e=>e);return void 0!=l.errors?{isValid:!1,errorMsg:(0,y.a)(l,i,!1)}:{isValid:!0,errorMsg:void 0}}async function N(e,n){let i=e.user,t=await j(i,!0,n);if(!t.isValid)return{isErrored:!0,errorPayload:(0,y.a)(t,n,!1)};console.log("signIn: ".concat(JSON.stringify(i)));let r={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user:i})},o=await fetch("".concat("https://app.heroplusgroup.com","/signin.json"),r),a=await o.json();console.log("signIn data: ".concat(JSON.stringify(a)));let l=await k(a,!1,n);if(!l.isValid)return{isErrored:!0,errorPayload:(0,y.a)(a,n,!1)};let d=o.headers.get("Authorization");return console.log("signIn authToken: ".concat(d)),e.setAuthorization(d),a}function w(){let e=(0,l._)(["\n  width: 100%;\n  margin: 0;\n\n  --ReactInputVerificationCode-itemWidth: 3rem !important;\n  --ReactInputVerificationCode-itemHeight: 3rem !important;\n\n  .ReactInputVerificationCode__container {\n    width: 100%;\n  }\n  \n  .ReactInputVerificationCode__item {\n    border-radius: 0.5rem;\n    box-shadow: inset 0 0 0 1px ",";\n    \n    &.is-active {\n      box-shadow: inset 0 0 0 1px #ff9e0c;\n    }\n\n    &.is-errored {\n      box-shadow: inset 0 0 0 1px #d93025;\n    }\n  }\n"]);return w=function(){return e},e}let E=m.ZP.div(w(),e=>(null==e?void 0:e.isErrored)?"#d93025":"#d6d6d6");var M=e=>{let{onBackClick:n}=e,i=(0,s.useRouter)(),r=(0,c.Z)(),a=(0,g.aC)(),{user:l,setUser:m}=a,b=(0,x.Aj)(),{setStage:y}=b,{locale:j,defaultLocale:k}=i,[w,M]=(0,d.useState)(60),[C,S]=(0,d.useState)(!1),[T,Z]=(0,d.useState)("");(0,d.useEffect)(()=>{w>0&&setTimeout(()=>M(w-1),1e3)},[w]);let A=async e=>{await (0,p.y)(a,r),M(60)},U=e=>{Z(""),m({...l,password:e})},P=async()=>{var e;S(!0);let n=await N(a,r);!n||(null==n?void 0:n.isErrored)?null==n||null===(e=n.errorPayload)||void 0===e||e.then(e=>{Z(e)}):(m(n),y(x.Ud.CREATE_PAYMENT)),S(!1)};return(0,t.jsxs)("div",{className:"jsx-7ab8887c6a79fc1d common-payment-link-card",children:[(0,t.jsx)(_.Z,{title:"payment_link.otp.title",onBackClick:n}),(0,t.jsx)("div",{className:"jsx-7ab8887c6a79fc1d otp-view-container",children:(0,t.jsx)("div",{className:"jsx-7ab8887c6a79fc1d otp-card-padding-wrapper",children:(0,t.jsxs)("div",{className:"jsx-7ab8887c6a79fc1d otp-card-content-container",children:[(0,t.jsxs)("div",{className:"jsx-7ab8887c6a79fc1d sent-to-phone-number-section-container",children:[(0,t.jsxs)("div",{className:"jsx-7ab8887c6a79fc1d otp-instruction-text",children:[(0,t.jsx)(u.Z,{id:"sign-in.verification_code_is_sent_to",defaultMessage:"sign-in.verification_code_is_sent_to",de
1scription:"sign-in.verification_code_is_sent_to"}),(0,t.jsx)("span",{className:"jsx-7ab8887c6a79fc1d sent-to-phone-number",children:" ".concat(null==l?void 0:l.country_code," ").concat(null==l?void 0:l.phone_number)})]}),(0,t.jsx)("span",{className:"jsx-7ab8887c6a79fc1d otp-instruction-text",children:(0,t.jsx)(u.Z,{id:"sign-in.please_enter_below",defaultMessage:"sign-in.please_enter_below",description:"sign-in.please_enter_below"})})]}),(0,t.jsxs)("div",{className:"jsx-7ab8887c6a79fc1d otp-code-input-container",children:[(0,t.jsx)(E,{isErrored:(null==T?void 0:T.length)>0,children:(0,t.jsx)(f.Z,{autoFocus:!0,length:6,type:"password",placeholder:"",onChange:U,onCompleted:U})}),(null==T?void 0:T.length)>0&&(0,t.jsx)("span",{className:"jsx-7ab8887c6a79fc1d error-msg",children:T})]}),(0,t.jsxs)("div",{className:"jsx-7ab8887c6a79fc1d action-buttons-container",children:[(0,t.jsx)(v.Z,{variant:"primary",className:"btn-verify",disabled:C,onClick:P,children:C?(0,t.jsx)(h.Z,{animation:"border",role:"login-status",children:(0,t.jsx)("span",{className:"jsx-7ab8887c6a79fc1d visually-hidden",children:"Loading..."})}):(0,t.jsx)(u.Z,{id:"sign-in.verify",defaultMessage:"sign-in.verify",description:"sign-in.verify"})}),(0,t.jsxs)(t.Fragment,{children:[(()=>{if(w<1)return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{children:(0,t.jsx)("button",{onClick:A,style:{background:"transparent",border:"transparent"},disabled:C,children:(0,t.jsx)("span",{className:"opt-timer-label opt-orange-label",children:(0,t.jsx)(u.Z,{id:"payment_link.otp.btn.resend_code",defaultMessage:"payment_link.otp.btn.resend_code",description:"payment_link.otp.btn.resend_code"})})})})})})(),(()=>{if(w>0)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"jsx-ed05147e37bd2499 opt-timer-label opt-grey-label",children:(0,t.jsx)(u.Z,{id:"sign-in.resend_timer",defaultMessage:"sign-in.resend_timer",description:"sign-in.resend_timer",values:{seconds:w}})}),(0,t.jsx)(o(),{id:"ed05147e37bd2499",children:".opt-timer-label{font-size:.875rem;line-height:20px;text-align:center}.opt-grey-label{color:#7e7e7e}.opt-orange-label{color:#ff9e0c}"})]})})(),(0,t.jsx)(o(),{id:"738e3e0ab5282f89",children:".opt-timer-label{font-size:.875rem;line-height:20px;text-align:center}.opt-grey-label{color:#7e7e7e}.opt-orange-label{color:#ff9e0c}"})]})]})]})})}),(0,t.jsx)(o(),{id:"7ab8887c6a79fc1d",children:'.form-select{-webkit-border-radius:30px;-moz-border-radius:30px;border-radius:30px}.form-control{font-size:1rem;line-height:24px}.form-check-input:checked{background-divor:#ffaa2b;border-divor:#ffaa2b}.phonenumber{divor:"#212121";font-weight:"500";font-weight:"bold";margin-top:98;margin-bottom:1;margin-left:5}.form-label{divor:"#212121";fontsize:14;marginbottom:8}.opt-container{margin-top:132px;margin-left:40px;margin-right:40px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}.opt-title{color:#212121;font-size:14px;letter-spacing:0}.opt-row-container{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-direction:row;flex-direction:row;margin-bottom:8px}'})]})},C=i(55875),S=i(41361),T=i(70237),Z=i(78182);i(2914),i(34051),i(31555);var A=i(89419);async function U(e,n,i){let t=n.purchase;console.log("Get Offer authorization: ".concat(e.authorization));let r={method:"POST",headers:{"Content-Type":"application/json",Authorization:e.authorization,"User-Agent":"xyz.heroplus.app.web"},body:JSON.stringify({purchase:t})},o=await fetch("".concat("https://app.heroplusgroup.com","/purchases/offers.json"),r),a=await o.json();return(console.log("Get Offer data: ".concat(JSON.stringify(a))),Array.isArray(a))?a:((0,y.a)(a,i,!0),[])}i(40556),i(99196);var P=i(90948),R=i(96689),I=i(55827),z=i(54656),O=i(51368),Y=i(28858),L=i(10027),q=i(71496);async function B(e,n,i,t){var r,o,a;let{authorization:l}=e,{purchase:d}=n,s=new URLSearchParams({page:null!==(o=null==t?void 0:t.toString())&&void 0!==o?o:"1",store_id:null!==(a=null==d?void 0:null===(r=d.store)||void 0===r?void 0:r.id)&&void 0!==a?a:""}),c=await fetch("".concat("https://app.heroplusgroup.com","/vouchers.json?").concat(s),{method:"GET",headers:{"Content-Type":"application/json",Authorization:l,"User-Agent":"xyz.heroplus.app.web"}}),u=await c.json();return Array.isArray(null==u?void 0:u.vouchers)?null==u?void 0:u.vouchers:((0,y.a)(u,i,!0),[])}var D=i(25675),V=i.n(D),H=i(44924);let F=(0,P.ZP)(R.Z)({height:33,borderRadius:8,fontSize:14,lineHeight:"16px",color:"#212121",["& > .".concat(I.Z.input)]:{height:33,padding:"8.5px 10.5px"},"& > fieldset":{borderColor:"#d6d6d6"},"&:hover, &.Mui-focused, &:active, &.Mui-disabled":{"& > fieldset":{borderColor:"#d6d6d6",borderWidth:1},["& .".concat(z.Z.notchedOutline)]:{borderColor:"#d6d6d6",borderWidth:1}},["&.".concat(I.Z.error)]:{"& > fieldset":{borderColor:"#d93025"},"&:hover, &.Mui-focused, &:active":{"& > fieldset":{borderColor:"#d93025",borderWidth:1},["& .".concat(z.Z.notchedOutline)]:{borderColor:"#d93025",borderWidth:1}}}});var G=e=>{var n,i,r,o;let{onBackClick:l}
1=e,s=(0,c.Z)(),m=(0,g.aC)(),{user:p,vouchers:f,setVouchers:b}=m,y=(0,x.Aj)(),{order:j,purchase:k,setPurchase:N,offers:w,offer:E,setOffer:M,setStage:C,setOrderVouchers:S,setPaymentSummary:T}=y,[P,R]=(0,d.useState)(!1),[I,z]=(0,d.useState)(null),[D,G]=(0,d.useState)(""),W={title:s.formatMessage({id:"payment_link.modal.title.registration_required",defaultMessage:"Registration Required",description:"Registration Required"}),description:s.formatMessage({id:"payment_link.modal.content.registration_required",defaultMessage:"Please complete the registration in your Hero Plus app to proceed with the payment.",description:"Please complete the registration in your Hero Plus app to proceed with the payment."}),actionBtns:[{variant:"confirm",text:s.formatMessage({id:"payment_link.modal.action_btn.ok",defaultMessage:"OK",description:"OK"}),onClick:()=>{window.location.href="heroplus://",setTimeout(()=>{window.location.reload()},500)}}]},K={title:s.formatMessage({id:"payment_link.modal.title.payment_method_required",defaultMessage:"Payment Method Required",description:"Payment Method Required"}),description:s.formatMessage({id:"payment_link.modal.content.payment_method_required",defaultMessage:"Please add a required default payment method in your Hero Plus app to proceed with the payment.",description:"Please add a required default payment method in your Hero Plus app to proceed with the payment."}),actionBtns:[{variant:"confirm",text:s.formatMessage({id:"payment_link.modal.action_btn.ok",defaultMessage:"OK",description:"OK"}),onClick:()=>{window.location.href="heroplus://",setTimeout(()=>{window.location.reload()},500)}}]},J={title:s.formatMessage({id:"payment_link.modal.title.voucher_available",defaultMessage:"Voucher Available",description:"Voucher Available"}),description:s.formatMessage({id:"payment_link.modal.content.voucher_available",defaultMessage:"You have a voucher in your account. Do you want to use it now?",description:"You have a voucher in your account. Do you want to use it now?"}),actionBtns:[{variant:"cancel",text:s.formatMessage({id:"payment_link.modal.action_btn.no",defaultMessage:"No",description:"No"}),onClick:()=>{C(x.Ud.PAYMENT_LIST)}},{variant:"confirm",text:s.formatMessage({id:"payment_link.modal.action_btn.use_voucher",defaultMessage:"Use Voucher",description:"Use Voucher"}),onClick:()=>{C(x.Ud.VOUCHERS_SELECTION)}}]};(0,d.useEffect)(()=>{M(null),N({...k,voucher_ids:[]}),S({usedVouchers:[],voucherIds:[],voucher_applied_value:0}),T(null)},[]),(0,d.useEffect)(()=>{var e;if((null==p?void 0:p.identity_check_status)!=="completed"){z(W);return}if((null==p?void 0:null===(e=p.payment_methods)||void 0===e?void 0:e.length)<=0){z(K);return}(async function(){try{let e=await U(m,y,s);y.setOffers(e)}catch(e){}})(),y.setOffer(null),y.setPurchase({...y.purchase,remark:null,total_tenors:null}),(async()=>{var e,n;if((null==m?void 0:m.authorization)&&(null==y?void 0:null===(n=y.purchase)||void 0===n?void 0:null===(e=n.store)||void 0===e?void 0:e.id)){let e=await B(m,y,s,1);b(e)}})()},[]);let Q=async e=>{var n;if(null==y.offer){G(s.formatMessage({id:"validation.total_tenors_required",defaultMessage:"validation.total_tenors_required",description:"validation.total_tenors_required"}));return}if(y.setPurchase({...y.purchase,total_tenors:y.offer.total_tenors}),(null==f?void 0:null===(n=f.filter(e=>(null==e?void 0:e.status)==="active"))||void 0===n?void 0:n.length)>0){z(J);return}y.setStage(x.Ud.PAYMENT_LIST)};return(0,t.jsxs)("div",{className:"common-payment-link-card",children:[(0,t.jsx)(_.Z,{title:"payment.pay",onBackClick:l}),(0,t.jsxs)("div",{className:"select-offer-view-container",children:[(0,t.jsxs)("div",{className:"merchant-amount-offer-section",children:[(0,t.jsx)(Z.Z.Img,{className:"merchant-icon",src:null!==(o=null==j?void 0:null===(n=j.store)||void 0===n?void 0:n.merchant_icon_image_service_url)&&void 0!==o?o:""}),(0,t.jsx)("span",{className:"merchant-store-name",children:null==j?void 0:null===(i=j.store)||void 0===i?void 0:i.name}),(null==j?void 0:j.first_payment_amount)>=0&&(0,t.jsx)("span",{className:"view-order-amount",children:"".concat(null==j?void 0:j.currency," ").concat((0,L.Bg)(null==j?void 0:j.first_payment_amount))}),(0,t.jsx)(F,{IconComponent:q.Z,onChange:e=>{var n;G("");let i=null==e?void 0:null===(n=e.target)||void 0===n?void 0:n.value;Number(i)>-1?M(w[i]):M(null)},native:!0,children:(()=>{let e=[];e.push((0,t.jsx)("option",{value:"-1",children:s.formatMessage({id:"payment.choose_offer",defaultMessage:"payment.choose_offer",description:"payment.choose_offer"})},"-1"));for(let n=1;n<=y.offers.length;n++)e.push((0,t.jsx)("option",{value:n-1,children:s.formatMessage({id:"payment.tenor_default",defaultMessage:"payment.tenor_default",description:"payment.tenor_default"},{tenor:y.offers[n-1].total_tenors})},n-1));return e})()}),(null==D?void 0:D.length)>0&&(0,t.jsxs)("div",{className:"input-error-flex",children:[(0,t.jsx)(V(),{className:"icon-alert",src:H.Z,alt:"Select Offer Required"}),(0,t.jsx)("span",{className:"error-text",children:D})]})]}),(0,t.jsx)("div",{className:"section-divider"}),(0,t.jsxs)("div",{className:"section-container",children:[(0,t.jsx)("span",{className:"section-title",children:(0,t.jsx)(u.Z,{id:"payment.pay_date",defaultMessage:"payment.pay_date",description:"payment.pay_date"})}),(0,t.jsx)(Y.Z,{receivables:null==E?void 0:E.receivables})]}),(0,t.jsx)("div",{className:"section-divider"}),(0,t.jsxs)("div",{className:"section-container",children:[(0,t.jsx)("span",{className:"section-title",children:(0,t.jsx)(u.Z,{id:"payment_link.instalment_form.input.field_label.remarks",defaultMessage:"payment_link.instalment_form.input.field_label.remarks",description:"payment_link.instalment_form.input.field_label.remarks"})}),(0,t.jsx)(O.Z,{maxRows:5,className:"remarks-input-field",placeholder:s.formatMessage({id:"payment_link.instalment_form.input.name.remarks",defaultMessage:"payment_link.instalment_form.input.name.remarks",description:"payment_link.instalment_form.input.name.remarks"}),value:null==k?void 0:k.remarks,onChange:e=>{var n;N({...k,remark:null==e?void 0:null===(n=e.target)||void 0===n?void 0:n.value})}})]}),(0,t.jsx)("div",{className:"action-buttons-container",children:(0,t.jsx)(v.Z,{className:"btn-next",onClick:Q,disabled:P,children:P?(0,t.jsx)(h.Z,{animation:"border",role:"login-status",children:(0,t.jsx)("span",{className:"visually-hidden",children:"Loading..."})}):(0,t.jsx)(u.Z,{id:"payment.next",defaultMessage:"payment.next",description:"payment.next"})})}),(0,t.jsx)(A.Z,{className:"prompt-error-dialog",centered:!0,show:null!==I,children:(0,t.jsxs)("div",{className:"error-modal-content-container",children:[(0,t.jsx)("span",{className:"error-modal-title",children:null==I?void 0:I.title}),(0,t.jsx)("span",{className:"error-modal-description",children:null==I?void 0:I.description}),(0,t.jsx)("div",{className:"error-modal-action-buttons-container",children:null==I?void 0:null===(r=I.actionBtns)||void 0===r?void 0:r.map((e,n)=>(0,t.jsx)(v.Z,{className:(0,a.Z)("btn-modal-action-button",{"btn-cancel":(null==e?void 0:e.variant)==="c
1ancel","btn-confirm":(null==e?void 0:e.variant)==="confirm"}),onClick:()=>{(null==e?void 0:e.onClick)&&((null==e?void 0:e.variant)==="confirm"?null==e||e.onClick():null==e||e.onClick(I))},children:null==e?void 0:e.text},"error-modal-action-btn-".concat(n)))})]})})]})]})},W=e=>{let{orientation:n="horizontal",textContent:i,children:r}=e;return(0,t.jsxs)("div",{className:(0,a.W)("divider-with-text-container",{"align-horizontal":"horizontal"===n,"align-vertical":"vertical"===n}),children:[(0,t.jsx)("span",{className:"divider-line"}),"string"==typeof i?(0,t.jsx)("p",{className:"divider-text",children:i}):r,(0,t.jsx)("span",{className:"divider-line"})]})},K=i(27624),J=i(22594),Q=i(1647),X=i(93756),$=i(46451),ee=i(37864),en=i(51869),ei=i(3506),et=i(87026),er=i(19539),eo=i(49601),ea=i(82087),el=i(47120),ed=i(73138),es=i(6640),ec=i(8260);let eu=(0,P.ZP)(ea.Z)({width:"100%",justifyContent:"center",alignItems:"center",gap:16}),em=(0,P.ZP)(el.Z)({width:"100%",padding:0,backgroundColor:"#fff",minHeight:104,borderRadius:11,borderColor:"transparent",borderWidth:2,["&.".concat(ed.Z.root,".").concat(es.Z.grouped,":not(last-of-type)")]:{borderBottomLeftRadius:11,borderBottomRightRadius:11,"&.Mui-selected":{border:"solid 2px #ff9e0c"}},["&.".concat(ed.Z.root,".").concat(es.Z.grouped,":not(first-of-type)")]:{marginTop:-2,borderTop:"solid 2px transparent",borderTopLeftRadius:11,borderTopRightRadius:11,"&.Mui-selected":{border:"solid 2px #ff9e0c !important"}}});var ep=e=>{let{onBackClick:n}=e,i=(0,g.aC)(),{vouchers:r}=i,o=(0,x.Aj)(),{purchase:a,setPurchase:l,setStage:s,setOrderVouchers:c}=o,[m,p]=(0,d.useState)(!1),[f,b]=(0,d.useState)(null),[y,j]=(0,d.useState)(null),k=e=>{let n=null==e?void 0:e.split("-");return(null==n?void 0:n.length)===3?"".concat(n[2],"/").concat(n[1],"/").concat(n[0]):(0,ec.Z)(new Date,"dd/MM/yyyy")},N=e=>{var n,i;return(0,t.jsxs)("div",{className:"voucher-container",children:[(0,t.jsx)("div",{className:"voucher-left-container",children:(0,t.jsxs)("div",{className:"voucher-left-content-wrapper",children:[(0,t.jsx)("div",{className:"voucher-left-background"}),(0,t.jsx)("img",{className:"merchant-store-icon",src:null==e?void 0:null===(n=e.merchant)||void 0===n?void 0:n.icon_image_service_url,alt:"Store's icon"})]})}),(0,t.jsxs)("div",{className:"voucher-right-container",children:[Array(11).fill(0).map((e,n)=>(0,t.jsx)("div",{className:"voucher-dotted-line",style:{top:10+8*n}},"voucher-dotted-line-".concat(n))),(0,t.jsxs)("div",{className:"voucher-details-container",children:[(0,t.jsx)("span",{className:"merchant-store-name",children:null==e?void 0:null===(i=e.merchant)||void 0===i?void 0:i.display_name}),(0,t.jsx)("span",{className:"voucher-description",children:null==e?void 0:e.title}),(0,t.jsx)("span",{className:"voucher-expiry-date",children:(0,t.jsx)(u.Z,{id:"payment_link.voucher_list.valid_until_date",defaultMessage:"Expiry date",description:"Expiry date",values:{date:k(null==e?void 0:e.valid_end_date)}})})]})]})]})};return(0,t.jsxs)("div",{className:"common-payment-link-card",children:[(0,t.jsx)(_.Z,{title:"payment_link.voucher_list.view.title",onBackClick:n}),(0,t.jsxs)("div",{className:"vouchers-selection-view-container",children:[(0,t.jsx)(eu,{orientation:"vertical",value:y,onChange:(e,n)=>{let i=[];null==n||n.forEach(e=>{i.push(null==r?void 0:r.find(n=>(null==n?void 0:n.id)===e))}),b(i),j(n)},children:null==r?void 0:r.map((e,n)=>(0,t.jsx)(em,{value:null==e?void 0:e.id,children:N(e)},"user-available-voucher-".concat(n)))}),(0,t.jsx)(v.Z,{className:"btn-after-selected-vouchers",onClick:()=>{if(y&&(null==y?void 0:y.length)>0){l({...a,voucher_ids:y});let e=0;null==f||f.forEach(n=>{e+=parseFloat(null==n?void 0:n.face_value)}),c({usedVouchers:f,voucherIds:y,voucher_applied_value:e})}s(x.Ud.PAYMENT_LIST)},disabled:m,children:m?(0,t.jsx)(h.Z,{animation:"border",role:"login-status",children:(0,t.jsx)("span",{className:"visually-hidden",children:"Loading..."})}):(0,t.jsx)(u.Z,{id:"payment.next",defaultMessage:"Next",description:"Next"})})]})]})},ev=i(42355),eh=i(3573),ef=i(70604),e_=i(5152),eg=i.n(e_),ex=i(45881),eb=i(64863);i(15945);var ey=i(13721),ej=i(75252),ek=i(5975),eN=i.n(ek);let ew=eg()(()=>i.e(1081).then(i.bind(i,71081)),{loadableGenerated:{webpack:()=>[71081]},ssr:!1});var eE=!0,eM=e=>{var n,i,r,l,m,p,v,h,f,g,b,y,j,k,N,w,E,U,P,R,I,z,O,Y;let L=(0,c.Z)(),q=(0,s.useRouter)(),{locale:B,query:D}=q,V=(0,x.Aj)(),H=null==V?void 0:V.merchant,[F,ea]=(0,d.useState)(!1),el=null!==(R=null!==(P=null===(i=e.order)||void 0===i?void 0:null===(n=i.store)||void 0===n?void 0:n.merchant_branding)&&void 0!==P?P:null===(l=e.order)||void 0===l?void 0:null===(r=l.merchant)||void 0===r?void 0:r.parent_merchant_branding)&&void 0!==R?R:null,ed=(0,ey.fq)({region:null===(p=e.order)||void 0===p?void 0:null===(m=p.merchant)||void 0===m?void 0:m.region,settlementCurrency:null===(h=e.order)||void 0===h?void 0:null===(v=h.store)||void 0===v?void 0:v.merchant_currency});(0,eb.v)(null==el?void 0:el.design_tokens),(0,d.useEffect)(()=>{(0,ej.B6)(el),(0,ej.H3)(ed.id)},[el,ed.id]);let es=(0,d.useMemo)(()=>null==H?void 0:H.single_payment_enabled,[null==H?void 0:H.single_payment_enabled]),ec=(0,d.useMemo)(()=>null==H?void 0:H.instalment_enabled,[null==H?void 0:H.instalment_enabled]),eu=(0,d.useMemo)(()=>{var n;let i=e_(),t=ef.Dy[i].supportedPaymentGateways,r=ef.Dy[i].fallbackPaymentGateway,o=(null==e?void 0:null===(n=e.order)||void 0===n?void 0:n.enabled_payment_gateways)||[],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,t=new Set(n);for(let n of(0===e.length&&console.warn("No enabled payment gateways provided. Falling back to default."),e))if(t.has(n))return n;if(!t.has(i))throw Error("Default gateway ".concat(i," is not supported in region ").concat(e_()));return i}(o,t,r);return a},[e_(),null==e?void 0:null===(f=e.order)||void 0===f?void 0:f.enabled_payment_gateways]);function em(){var n,i,t;if(V.stage!=x.Ud.ORDER_SUMMERY){if(V.stage===x.Ud.CREATE_SINGLE_PAYMENT){V.setStage(x.Ud.ORDER_SUMMERY);return}if(V.stage==x.Ud.ENTRY){V.setStage(x.Ud.CREATE_SINGLE_PAYMENT);return}if(V.stage==x.Ud.OTP){V.setStage(x.Ud.ENTRY);return}if(V.stage==x.Ud.CREATE_PAYMENT){(null==e?void 0:null===(n=e.order)||void 0===n?void 0:n.cancel_url)?q.push(e.order.cancel_url):null==V||V.setStage(x.Ud.ENTRY);return}if(V.stage==x.Ud.PAYMENT_LIST||V.stage===x.Ud.VOUCHERS_SELECTION){V.setStage(x.Ud.CREATE_PAYMENT);return}if(V.stage==x.Ud.PAYMENT_CONFIRMATION){V.setStage(x.Ud.PAYMENT_LIST);return}if(V.stage==x.Ud.PAYMENT_PASSCODE){V.setStage(x.Ud.PAYMENT_CONFIRMATION);return}if(V.stage==x.Ud.PAYMENT_SUCCESS){q.replace(null!==(t=null==e?void 0:null===(i=e.order)||void 0===i?void 0:i.return_url)&&void 0!==t?t:"https://www.heroplusgroup.com/".concat(B));return}if((null==V?void 0:V.stage)===x.Ud.PAYMENT_UNSUCCESS||(null==V?void 0:V.stage)===x.Ud.ALIPAY_QR||(null==V?void 0:V.stage)===x.Ud.INSTALMENT_QR){V.setStage(x.Ud.CREATE_SINGLE_PAYMENT);return}if(V.stage===x.Ud.SEND_TO_EMAIL){V.setStage(x.Ud.PAYMENT_SUCCESS);return}if(V.stage===x.Ud.EMAIL_FAILED){V.setStage(x.Ud.SEND_TO_EMAIL);return}}}function e_(){var n,i;let t=null===(i=e.order)||void 0===i?void 0:null===(n=i.store)||void 0===n?void 0:n.merchant_currency;return ef.cv[t]||(null==B?void 0:B.split("-")[1])||"HK"}(0,d.useEffect)(()=>{console.log("[InitiateOrder - OrderPLP]",{query:D,order:null==e?void 0:e.order,paymentGateway:eu,fetchUrl:"".concat("https://app.heroplusgroup.com","/orders/").concat(null==D?void 0:D.id,".json?locale=").concat(B,"&encrypted_order_shared_token=").concat(null==D?void 0:D.encrypted_order_shared_token)})},[]),(0,d.useEffect)(()=>{var n,i,t,r;let o=(null==e?void 0:null===(n=e.order)||void 0===n?void 0:n.status)==="completed",a=V.stage!==x.Ud.PAYMENT_SUCCESS,l="hp_paid_".concat(null==e?void 0:null===(i=e.order)||void 0===i?void 0:i.id),d="true"===sessionStorage.getItem(l);a&&(o||d)&&q.replace(null!==(r=null==e?void 0:null===(t=e.order)||void 0===t?void 0:t.return_url)&&void 0!==r?r:"https://www.heroplusgroup.com/".concat(B))},[null==e?void 0:null===(g=e.order)||void 0===g?void 0:g.status]),(0,d.useEffect)(()=>{var n;V.setOrder(e.order),V.setPurchase({...V.purchase,currency:e.order.currency||null,total_amount:e.order.first_payment_amount||null,first_payment_amount:e.order.first_payment_amount||null,store_id:e.order.store_id||null,order_id:e.order.id||null,store:e.order.store||null}),V.setMerchant({...null==V?void 0:V.merchant,...null==e?void 0:null===(n=e.order)||void 0===n?void 0:n.merchant})},[null==e?void 0:null===(b=e.order)||void 0===b?void 0:b.id,null==V?void 0:null===(y=V.purchase)||void 0===y?void 0:y.id]),(0,d.useEffect)(()=>{var n,i,t,r;if(["en-SG","ms-SG","zh-SG","en-MY","ms-MY","zh-MY"].includes(null!=B?B:"en-HK")||(null!==(t=null===(n=e.order.store)||void 0===n?void 0:n.store_type)&&void 0!==t?t:"physical")==="herorent"){V.setStage(x.Ud.CREATE_SINGLE_PAYMENT);return}if(["SGD","MYR"].includes(null!==(r=null==e?void 0:null===(i=e.order)||void 0===i?void 0:i.currency)&&void 0!==r?r:"HKD")){null==V||V.setStage(x.Ud.CREATE_SINGLE_PAYMENT);return}},[]),(0,d.useEffect)(()=>{var e,n;if(es&&!ec){null==V||V.setStage(null===(e=x.Ud)||void 0===e?void 0:e.CREATE_SINGLE_PAYMENT);return}if(!es&&ec){null==V||V.setStage(null===(n=x.Ud)||void 0===n?void 0:n.ENTRY);return}},[es,ec]);let eg=()=>(0,t.jsx)(ev.Z,{linkVariant:"order",region:e_(),paymentGateway:eu,order:null==e?void 0:e.order}),ek=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"jsx-260ca66317bd8e10 common-payment-link-card",children:[(0,t.jsx)(_.Z,{title:"order.process.pay_with_hero_plus_instalment",onBackClick:!es&&ec?void 0:em}),(0,t.jsx)("div",{className:"jsx-260ca66317bd8e10 card-white-border-wrapper",children:(0,t.jsxs)("div",{className:"jsx-260ca66317bd8e10 order-link-instalment-section-wrapper",children:[(0,t.jsxs)("div",{className:"jsx-260ca66317bd8e10 content-entry-container",children:[(0,t.jsx)("span",{className:"jsx-260ca66317bd8e10 content-section-title",children:(0,t.jsx)(u.Z,{id:"payment_link.order_summary.pay_using_app",defaultMessage:"payment_link.order_summary.pay_using_app",description:"payment_link.order_summary.pay_using_app"})}),(0,t.jsx)(T.Z,{onHowToUseClick:()=>ea(!0),onCloseHowToUseClick:()=>ea(!1)})]}),(0,t.jsx)("div",{className:"jsx-260ca66317bd8e10 vertical-divider",children:(0,t.jsx)(W,{orientation:"vertical",children:(0,t.jsx)("p",{className:"jsx-260ca66317bd8e10 divider-text keep-text-as-horizontal",children:(0,t.jsx)(u.Z,{id:"payment_link.order_summary.or",defaultMessage:"payment_link.order_summary.or",description:"payment_link.order_summary.or"})})})}),(0,t.jsx)("div",{className:"jsx-260ca66317bd8e10 horizontal-divider",children:(0,t.jsx)(W,{orientation:"horizontal",children:(0,t.jsx)("p",{className:"jsx-260ca66317bd8e10 divider-text",children:(0,t.jsx)(u.Z,{id:"payment_link.order_summary.or_continue_in_browser",defaultMessage:"payment_link.order_summary.or_continue_in_browser",description:"payment_link.order_summary.or_continue_in_browser"})})})}),(0,t.jsxs)("div",{className:"jsx-260ca66317bd8e10 content-entry-container",children:[(0,t.jsx)("span",{className:"jsx-260ca66317bd8e10 content-section-title",children:(0,t.jsx)(u.Z,{id:"payment_link.order_summary.continue_in_browser",defaultMessage:"payment_link.order_summary.continue_in_browser",description:"payment_link.order_summary.continue_in_browser"})}),(0,t.jsx)(C.Z,{})]})]})})]}),(0,t.jsx)(o(),{id:"260ca66317bd8e10",children:".enter-container{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-moz-box-orient:horizontal;-moz-box-direction:normal;-ms-flex-direction:row;flex-direction:row}@media(max-width:820px){.enter-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}"})]}),eE=()=>{var n,i,r,o,a;if(V.stage==x.Ud.ENTRY)return ek();if(V.stage==x.Ud.OTP)return(0,t.jsx)(M,{onBackClick:em});if(V.stage===x.Ud.CREATE_SINGLE_PAYMENT)return eg();if(V.stage==x.Ud.CREATE_PAYMENT)return(0,t.jsx)(G,{onBackClick:em});if(V.stage==x.Ud.PAYMENT_LIST)return(0,t.jsx)(Q.Z,{onBackClick:em});if(V.stage===x.Ud.VOUCHERS_SELECTION)return(0,t.jsx)(ep,{onBackClick:em});if(V.stage==x.Ud.PAYMENT_CONFIRMATION)return(0,t.jsx)(J.Z,{onBackClick:em});if(V.stage==x.Ud.PAYMENT_PASSCODE)return(0,t.jsx)(X.Z,{onBackClick:em});if(V.stage==x.Ud.PAYMENT_SUCCESS){if((null!==(r=null==V?void 0:null===(i=V.purchase)||void 0===i?void 0:null===(n=i.store)||void 0===n?void 0:n.store_type)&&void 0!==r?r:"physical")!="herorent")return(0,t.jsx)(ee.Z,{});q.replace(null!==(a=null==e?void 0:null===(o=e.order)||void 0===o?void 0:o.return_url)&&void 0!==a?a:"")}return(null==V?void 0:V.stage)===x.Ud.PAYMENT_UNSUCCESS?(0,t.jsx)(en.Z,{}):V.stage==x.Ud.SEND_TO_EMAIL?(0,t.jsx)(ei.Z,{onBackClick:em}):V.stage==x.Ud.EMAIL_FAILED?(0,t.jsx)($.Z,{onBackClick:em}):eg()};return void 0==e.order?(0,t.jsx)(u.Z,{id:"order.fail_to_load",defaultMessage:"Failed to Load",description:"Failed to Load"}):V.stage==x.Ud.ALIPAY_QR?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(er.Z,{onBackClick:em,linkVariant:"order",brand:ed,merchantBranding:el}),((null===(I=V.purchase)||void 0===I?void 0:I.id)||(null==e?void 0:null===(z=e.order)||void 0===z?void 0:z.id))&&(0,t.jsx)(ew,{orderId:null==e?void 0:null===(O=e.order)||void 0===O?void 0:O.id,purchaseId:null===(Y=V.purchase)||void 0===Y?void 0:Y.id})]}):V.stage==x.Ud.INSTALMENT_QR?(0,t.jsx)(eo.Z,{onBackClick:em,linkVariant:"order"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eh.H,{title:ed.displayName,description:L.formatMessage({id:"seo.payment_link.description",defaultMessage:"{brand}, a better way to pay",description:"{brand}, a better way to pay"},{brand:ed.displayName}),siteName:ed.displayName,favicon:ed.favicon,themeColor:"#fff",shouldDownloadTc2p:null==e?void 0:null===(k=e.order)||void 0===k?void 0:null===(j=k.enabled_payment_gateways)||void 0===j?void 0:j.includes(ef.g$.TC2P)}),V.initializeActionCable&&((null===(N=V.purchase)||void 0===N?void 0:N.id)||(null==e?void 0:null===(w=e.order)||void 0===w?void 0:w.id))&&
1(0,t.jsx)(ew,{orderId:null==e?void 0:null===(E=e.order)||void 0===E?void 0:E.id,purchaseId:null===(U=V.purchase)||void 0===U?void 0:U.id}),(0,t.jsxs)("div",{className:"jsx-70aebdab4e804c9d",children:[V.stage==x.Ud.ENTRY?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Z.Z,{className:(0,a.Z)("common-payment-link-card-container","allow-login-max-width"),children:eE()}),(0,t.jsx)(o(),{id:"b0d82662d7e37d22",children:".register-container{width:820px}@media(max-width:820px){.register-container{width:414px}}"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Z.Z,{className:"common-payment-link-card-container",children:eE()}),(0,t.jsx)(ex.Z,{region:e_(),stage:V.stage,isWhitelabelMerchant:!!el,brand:ed})]}),(0,t.jsxs)("div",{className:"jsx-70aebdab4e804c9d common-payment-link-page-footer",children:[(0,t.jsx)(et.Z,{brand:ed,merchantBranding:el}),(0,t.jsx)(K.Z,{regionLocalesMapping:ef.Dr})]}),(0,t.jsx)(A.Z,{contentClassName:eN().howToUsePopup,centered:!0,show:F,onHide:()=>ea(!1),children:(0,t.jsx)(S.Z,{onCloseHowToUseClick:()=>ea(!1)})})]}),(0,t.jsx)(o(),{id:"70aebdab4e804c9d",children:"body{background-color:#f5f5f5!important}.logo-container{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}@media(max-width:594px){body{background-color:#fff!important}.logo-container{display:none!important}.upper-space{height:0}}"})]})}},5975:function(e){e.exports={howToUsePopup:"_id__howToUsePopup__EZyp0"}}},function(e){e.O(0,[5006,2751,5675,1549,4564,9448,2003,4357,7829,912,3170,729,9774,2888,179],function(){return e(e.s=12839)}),_N_E=e.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.