PageSourceSearch

https://www.setel.com/PETRONAS-Shop/_next/static/chunks/8492-4f5c39ce05808712.js

js setel.com collected 2026-10-02 03:58:59 UTC 30,712 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8492],{22493:e=>{e.exports={dialogTitle:"button-re-pay_dialogTitle__X87d3",dialogMessage:"button-re-pay_dialogMessage___48t1"}},36203:(e,l,n)=>{"use strict";n.d(l,{EV:()=>a,He:()=>c,TH:()=>r,bF:()=>o});var t=n(90365),i=n(33176);let s="".concat(i.$W.apiUCommPBaseUrl,"/api/ecom-rewards/gamification");async function r(){try{return(await t.Cv.get("".concat(s,"/get-user-coin-information"))).data}catch(e){return e}}async function c(e){try{return(await t.Cv.post("".concat(s,"/earn-coin"),{streak:e.streak,coin:e.coin})).data}catch(e){return e}}async function a(e,l,n,i){try{return(await t.Cv.post("".concat(s,"/redeem-coins"),{merchantId:l,companyId:n,isRedeemDefaultVoucher:i},{headers:{"x-tenant-id":e}})).data}catch(e){return e}}async function o(e){let{page:l,perPage:n}=e;try{return(await t.Cv.get("".concat(s,"/get-user-coin-history?perPage=").concat(n,"&page=").concat(l))).data}catch(e){return e}}},56111:(e,l,n)=>{"use strict";n.r(l),n.d(l,{SkeletonForMesraAndDailyCheckInBanner:()=>eM,__N_SSP:()=>eR,default:()=>eI});var t=n(28888),i=n(37876),s=n(99492),r=n(15039),c=n.n(r),a=n(62867),o=n(48230),d=n.n(o),u=n(89099),m=n(14232),h=n(65212),x=n(33176),v=n(20339),p=n(52529);function g(){var e,l,n;let{t}=(0,h.Bd)(),{dailyCheckInFeatureData:s}=(0,m.useContext)(v.BR),r=null==s||null==(e=s.daily_check_in)?void 0:e.daily_coins_values,c=r?Object.values(r).reduce((e,l)=>e+l,0):0,a=((null==s||null==(l=s.rate_earn)?void 0:l.item_photo_review_earning)||0)+((null==s||null==(n=s.rate_earn)?void 0:n.item_text_review_earning)||0),o=[{id:1,title:t("daily-check-in.check-in-daily-up-to-coins",{coins:c}),src:"calendar.png"},{id:2,title:t("daily-check-in.earn-coins-when-you-rate-review-an-item",{coins:a}),src:"estore-product-details.png"},{id:3,title:t("daily-check-in.convert-coins-to-rm",{coins:1,rm:1}),src:"send-money.png"}],d=(0,m.useMemo)(()=>({drag:!0,mode:"snap",rtl:!1,loop:!0,slides:{perView:1.32,spacing:20},breakpoints:{[p.W1]:{drag:!0,loop:!0,slides:{perView:2,spacing:20}},[p.wx]:{drag:!1,loop:!1,slides:{perView:3,spacing:20}}}}),[]);return(0,i.jsx)("div",{className:"-mr-5 mt-4 md:mr-0",children:(0,i.jsx)(p.RC,{options:d,children:o.map(e=>(0,i.jsx)(p.qr,{children:(0,i.jsxs)("div",{className:"flex h-full items-center gap-3 rounded-lg bg-grey-100 px-4 py-5",children:[(0,i.jsx)("div",{className:"h-12 w-12 flex-shrink-0",children:(0,i.jsx)("img",{className:"h-12 w-12",alt:"icon-coins-notes",src:"".concat(x.ZX,"/images/").concat(e.src)})}),(0,i.jsx)("p",{className:"text-2sm font-medium",children:e.title})]},e.id)},e.id))})})}var f=n(47554),y=n(86734),_=n(77148),j=n(81864),k=n(71632),b=n(13422),N=n(36203),C=n(90887),w=n(51188),E=n(54587),R=n.n(E),I=n(82514),M=n(85504),T=n.n(M),S=n(93677);function D(){let e=(0,t._)(["daily-check-in.coins-redemption-failed"]);return D=function(){return e},e}function A(){let e=(0,t._)(["daily-check-in.redeem-coins"]);return A=function(){return e},e}function O(){let e=(0,t._)(["daily-check-in.T&C"]);return O=function(){return e},e}function B(){let e=(0,t._)(["daily-check-in.processing-redemption-please-check-the-coins-history-after-maximum-5-minutes"]);return B=function(){return e},e}function V(){let e=(0,t._)(["daily-check-in.coins-redemption-failed-content"]);return V=function(){return e},e}function L(){let e=(0,t._)(["common.ok"]);return L=function(){return e},e}function P(){let e=(0,t._)(["common.close"]);return P=function(){return e},e}function F(){let e=(0,t._)(["common.ok"]);return F=function(){return e},e}let H=e=>{var l,n;let{isShowClaim5RMVoucherModal:t,setIsShowClaim5RMVoucherModal:r,setToggleFetchUserCoins:a,toggleFetchUserCoins:o,isRedeemVoucher5:d}=e,{t:u}=(0,h.Bd)(),{dailyCheckInFeatureData:p,userCoinsInfo:g,merchant:y,setHistoryCoins:_,setUserCoinsInfo:b}=(0,m.useContext)(v.BR),[E,M]=(0,m.useState)(void 0),[H,U]=(0,m.useState)(!1),[G,Z]=(0,m.useState)(!1),[X,Y]=(0,m.useState)(!1),{isAuthenticated:q}=(0,k.As)(),[z,K]=(0,m.useState)(!1),W=null==p?void 0:p.redeem_voucher_10,Q=null==W?void 0:W.redeem_voucher_modal_content_10,J=null==W?void 0:W.voucher_setup,$=null==p?void 0:p.daily_check_in,ee=null==$?void 0:$.redeem_voucher_modal_content,el=null==$?void 0:$.voucher_setup,en=d?null==ee?void 0:ee.title:null==Q?void 0:Q.title,et=d?null==ee?void 0:ee.CTA:null==Q?void 0:Q.CTA,ei=d?null==ee?void 0:ee.terms_and_conditions:null==Q?void 0:Q.terms_and_conditions,es=d?null==el?void 0:el.redeem_voucher_coins:null==J?void 0:J.redeem_voucher_10_coins,er
1=(null==g?void 0:g.accumulatedCoins)&&(null==g?void 0:g.accumulatedCoins)>=(null!=es?es:500),ec=async()=>{z&&!E&&(a(!o),_(await (0,N.bF)({page:1,perPage:5}))),r(!1),M(void 0),U(!1),Y(!1)},ea=(()=>{if(X)return(0,i.jsx)("div",{className:"flex w-[48px] justify-center",children:(0,i.jsx)(s.L,{type:"spinner-blue",className:T().loader_style})});if(E)return H?(0,i.jsx)(C.SK,{}):(0,i.jsx)(C.uo,{});let e="".concat(x.ZX,"/images/redeem-voucher-").concat(d?S.R2:S.lr,".png");return(0,i.jsx)(R(),{src:e,alt:"img-5rm-voucher",height:80,width:140})})(),eo=(()=>{if(X)return null;if(E){var e,l;return(0,i.jsx)("p",{className:"w-full text-center",children:H?u(D()):u("daily-check-in.enjoy-your-RM",{value:null!=(l=null==E||null==(e=E.discount)?void 0:e.value)?l:5})})}return(0,i.jsx)("p",{className:"w-60 text-center",children:en})})();return(0,m.useEffect)(()=>()=>K(!1),[]),(0,i.jsxs)(w.aFV,{overlayClassName:"bg-overlay-65",onDismiss:ec,showCloseButton:!1,isOpen:t,className:c()("relative !m-auto !mx-0 !mb-0 flex max-h-full w-full flex-col overflow-hidden rounded-none rounded-t-2xl sm:mx-auto lg:!m-auto lg:!mb-auto lg:w-[380px] lg:rounded-2xl"),style:{minHeight:"auto"},"data-testid":"claim-voucher-modal",children:[(0,i.jsx)("div",{className:"h-[56px]",children:(0,i.jsx)("div",{className:"flex justify-center border py-4 text-base font-medium leading-[23px] text-grey-dark",children:u(A())})}),(0,i.jsxs)(w.aFV.Body,{className:c()("no-scrollbar flex-1 overflow-auto border-b px-5 !pt-0 pb-4",E&&"border-b-0 !pt-5 pb-0 lg:!pb-5 lg:!pt-0",E&&!H&&"!pb-10"),children:[(0,i.jsx)("div",{className:c()("flex justify-center pt-5",E&&"!pt-0 lg:!pt-5"),children:ea}),(0,i.jsx)("div",{className:c()("flex flex-col items-center py-2 text-xl font-semibold",E&&"pt-4"),children:eo}),(0,i.jsx)("div",{className:"text-2sm text-grey-medium",children:E?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:c()("text-center",!H&&E&&"mb-10"),children:H?u(V()):u("daily-check-in.coins-redeemed-success-content",{count:null!=(l=null==E?void 0:E.redeemVoucherCoins)?l:500,coins:(0,j.u)(null!=(n=null==E?void 0:E.redeemVoucherCoins)?n:500)})}),!H&&(null==E?void 0:E.discount)&&(0,i.jsx)(I.A,{isDailyCheckInPage:!0,voucher:E.discount}),H&&!X&&(0,i.jsx)("div",{className:"pt-4 md:hidden",children:(0,i.jsx)(f.H,{onClick:ec,className:"w-full bg-petronas-500 tracking-13-percent",children:u(L())})})]}):(0,i.jsx)(i.Fragment,{children:X?(0,i.jsx)("p",{className:"px-5 text-center text-2sm text-grey-medium",children:u(B())}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{children:u(O())}),(0,i.jsx)("div",{children:(0,i.jsx)("ul",{className:"ml-[23px] list-disc",children:null==ei?void 0:ei.map((e,l)=>(0,i.jsx)("li",{children:e},l))})})]})})})]}),(0,i.jsxs)("div",{className:c()("flex flex-col justify-center px-5 pb-5 pt-4",E&&"!pt-0 lg:!pt-5",X&&"!pt-0"),children:[!er&&!E&&(0,i.jsx)("p",{className:"pb-4 text-center text-2sm text-red-bright",children:u("daily-check-in.you-need-coins-to-get-this-voucher",{count:null!=es?es:500,coins:null!=es?es:500})}),!E&&!X&&(0,i.jsx)(f.H,{onClick:()=>{Z(!0),K(!0),q&&(0,N.EV)(y.tenantId,y.merchantId,y.companyId,d).then(e=>{var l,n;e||setTimeout(()=>{Y(!0),Z(!1)},5e3),(null==e||null==(l=e.response)?void 0:l.status)&&(null==e||null==(n=e.response)?void 0:n.status)!==201?U(!0):U(!1),e&&(Z(!1),Y(!1),M(e),(0,N.bF)({page:1,perPage:5}).then(e=>{_(e)}),(0,N.TH)().then(e=>{b(null!=e?e:void 0)}))}).catch(e=>{console.log({err:e}),U(!0)}).finally(()=>{a(!o)})},variant:"primary",className:"w-full rounded tracking-13-percent",isLoading:G,disabled:!er||G,"data-testid":"redeem-voucher-cta-btn",children:et}),!H&&(0,i.jsx)(f.H,{variant:"outline",className:c()("w-full rounded tracking-13-percent !ring-0",!E&&"mt-4"),onClick:ec,disabled:G,"data-testid":"close-btn",children:u(P())}),E&&H&&!X&&(0,i.jsx)(f.H,{onClick:ec,className:"hidden w-full rounded bg-petronas-500 tracking-13-percent md:block",children:u(F())})]})]})};var U=n(16076),G=n(66196),Z=n(77346),X=n(99130);function Y(){return(0,i.jsxs)(X.B,{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("g",{"clip-path":"url(#clip0_3379_42222)",children:(0,i.jsx)("path",{d:"M8 0.832031C11.958 0.832031 15.167 4.04098 15.167 7.99902C15.167 11.95
171 11.958 15.166 8 15.166C4.04196 15.166 0.833008 11.9571 0.833008 7.99902C0.833008 4.04098 4.04196 0.832031 8 0.832031ZM8 1.83203C4.59424 1.83203 1.83301 4.59327 1.83301 7.99902C1.83301 11.4048 4.59424 14.166 8 14.166C11.4058 14.166 14.167 11.4048 14.167 7.99902C14.167 4.59327 11.4058 1.83203 8 1.83203ZM8.00488 10.666C8.37043 10.6663 8.66699 10.9625 8.66699 11.3281C8.6669 11.6632 8.41773 11.9404 8.09473 11.9844L7.99609 11.9902C7.6304 11.9902 7.33311 11.6938 7.33301 11.3281C7.33301 10.993 7.58227 10.7159 7.90527 10.6719L8.00488 10.666ZM5.58789 5.83301C5.99239 4.68313 7.16774 3.99231 8.36914 4.19824C9.57063 4.40433 10.4481 5.44772 10.4463 6.66602C10.4462 7.45156 9.97334 8.08223 9.22363 8.58203C9.01475 8.72125 8.80749 8.83706 8.61621 8.92969L8.44629 9.00684V9.53125C8.44609 9.78417 8.25852 9.99324 8.01465 10.0264L7.94629 10.0312C7.69334 10.031 7.48426 9.84255 7.45117 9.59863L7.44629 9.53125V8.66602C7.44629 8.4508 7.58489 8.25946 7.78906 8.19141L7.86719 8.16211C7.9167 8.14298 7.98092 8.1172 8.05566 8.08398C8.26565 7.99066 8.47595 7.87862 8.66895 7.75C9.1691 7.41656 9.44625 7.04672 9.44629 6.66504C9.44737 5.93361 8.92109 5.30822 8.2002 5.18457C7.47932 5.06094 6.77396 5.47508 6.53125 6.16504C6.43957 6.42526 6.15485 6.56205 5.89453 6.4707C5.63406 6.37907 5.4963 6.09348 5.58789 5.83301Z",fill:"#525B65"})}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_3379_42222",children:(0,i.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})}function q(){let e=(0,t._)(["daily-check-in.coins-expiry.title"]);return q=function(){return e},e}function z(){let e=(0,t._)(["common.learn-more"]);return z=function(){return e},e}function K(){let e=(0,t._)(["common.ok"]);return K=function(){return e},e}let W=e=>{var l,n;let{userCoinsInfo:t}=e,{t:s}=(0,h.Bd)(),{isAuthenticated:r}=(0,k.As)(),c=(0,u.useRouter)(),{dailyCheckInFeatureData:a}=(0,m.useContext)(v.BR),[o,d]=(0,m.useState)(!1),x=null!=(n=null==a||null==(l=a.daily_check_in)?void 0:l.coins_expiry_month)?n:0,p=()=>{d(!1)};return r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex cursor-pointer items-center gap-1 text-xs leading-[18px] text-grey-medium md:text-sm",onClick:()=>{d(!0)},"data-testid":"coins-expiring-by-month",children:[(0,U.gD_)(null==t?void 0:t.monthlyExpiringCoins)||!(t.monthlyExpiringCoins>0)||(0,U.gD_)(null==t?void 0:t.monthlyExpiredAt)?(0,i.jsx)("span",{children:s("daily-check-in.no-coins-expiring")}):(0,i.jsx)("span",{children:s("daily-check-in.coins-expiring-on",{coins:t.monthlyExpiringCoins,date:(0,U.Yq5)(String(t.monthlyExpiredAt),{formatType:"dateOnly"})})}),(0,i.jsx)(w.K0,{className:"h-fit w-fit p-0",children:(0,i.jsx)(Y,{})})]}),o&&(0,i.jsx)(Z.A,{iShowModal:o,title:s(q()),message:s("daily-check-in.coins-expiry.description",{months:x}),cancelLabel:s(z()),handleCancel:p,confirmLabel:s(K()),handleConfirm:p,customClassModal:"m-5 mt-auto sm:m-auto",classNameMessage:"text-2sm md:text-base md:leading-[23px]",extraActionButton:()=>{c.push((0,G.mxb)())}})]}):null};function Q(){let e=(0,t._)(["daily-check-in.daily-check-in-text"]);return Q=function(){return e},e}function J(){let e=(0,t._)(["daily-check-in.check-in-today"]);return J=function(){return e},e}function $(){let e=(0,t._)(["daily-check-in.come-back-tomorrow"]);return $=function(){return e},e}function ee(){let e=(0,t._)(["daily-check-in.coins"]);return ee=function(){return e},e}function el(){let e=(0,t._)(["daily-check-in.check-in-today"]);return el=function(){return e},e}function en(){let e=(0,t._)(["daily-check-in.come-back-tomorrow"]);return en=function(){return e},e}function et(){let e=(0,t._)(["daily-check-in.today"]);return et=function(){return e},e}function ei(){let e=(0,t._)(["daily-check-in.today"]);return ei=function(){return e},e}let es="w-9 h-9 absolute lg:relative lg:w-[52px] lg:h-[52px]",er={10:(0,i.jsx)(C.gT,{className:es}),20:(0,i.jsx)(C.VA,{className:es}),30:(0,i.jsx)(C.ap,{className:es}),40:(0,i.jsx)(C.je,{className:es}),50:(0,i.jsx)(C.UF,{className:es})},ec={10:(0,i.jsx)(C.lH,{className:es}),20:(0,i.jsx)(C.aX,{className:es}),30:(0,i.jsx)(C.hM,{className:es}),40:(0,i.jsx)(C.WO,{className:es}),50:(0,i.jsx)(C.hj,{className:es})},ea={10:(0,i.jsx)(C.lo,{className:es}
1),20:(0,i.jsx)(C.Oy,{className:es}),30:(0,i.jsx)(C.nc,{className:es}),40:(0,i.jsx)(C.uj,{className:es}),50:(0,i.jsx)(C.ZG,{className:es})},eo={done:(0,i.jsx)(C.iO,{})};function ed(){var e,l,n,t;let{t:s}=(0,h.Bd)(),{dailyCheckInFeatureData:r,userCoinsInfo:a,setUserCoinsInfo:o,setDailyCheckInFeatureData:d,setHistoryCoins:u,openLoginPopup:x}=(0,m.useContext)(v.BR),{setWebUIToasts:p}=(0,m.useContext)(y.$),[g,w]=(0,m.useState)(!1),{isAuthenticated:E}=(0,k.As)(),R=null==r||null==(e=r.daily_check_in)?void 0:e.daily_coins_values,[I,M]=(0,m.useState)({coin:0,streak:0}),[T,S]=(0,m.useState)(!1),[D,A]=(0,m.useState)(!1);(0,m.useEffect)(()=>{var e,l;let n=R&&R["Day_".concat((null!=(e=null==a?void 0:a.streak)?e:0)+1)];M({coin:null!=n?n:0,streak:(null!=(l=null==a?void 0:a.streak)?l:0)+1})},[R,null==a?void 0:a.streak]),(0,m.useEffect)(()=>{let e=async()=>{var e;let l=await (0,N.TH)(),n=await (0,b.q2)([b.rQ.ECOM_DAILY_CHECK_IN]);d(null==(e=(0,_.F)(n,b.rQ.ECOM_DAILY_CHECK_IN))?void 0:e.value),o(null!=l?l:void 0)};E&&e()},[T,E]);let O=async()=>{if(!E)return x();if(E){var e,l,n,t;w(!0);let i=await (0,N.He)(I);if(i&&u(await (0,N.bF)({page:1,perPage:5})),w(!1),(null==i||null==(e=i.response)?void 0:e.status)&&(null==i||null==(l=i.response)?void 0:l.status)!==201)return null==p?void 0:p({message:null==i||null==(t=i.response)||null==(n=t.data)?void 0:n.message,variant:"error",dismissable:!0},{hideAfterMs:2300,removeAfterMs:2300});S(!T)}};return(0,i.jsxs)("div",{className:"rounded-2xl border border-yellow-orange bg-warning-100",children:[D&&(0,i.jsx)(H,{setToggleFetchUserCoins:S,toggleFetchUserCoins:T,setIsShowClaim5RMVoucherModal:A,isShowClaim5RMVoucherModal:D}),(0,i.jsxs)("div",{className:"flex items-center p-4 lg:hidden",children:[(0,i.jsx)("div",{className:"mr-1 flex items-center lg:block",children:(null==a?void 0:a.accumulatedCoins)?(0,i.jsx)(C.E4,{}):(0,i.jsx)(C.Eg,{})}),(0,i.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,i.jsx)("h4",{className:"text-2xl font-semibold leading-[34px] text-black",children:s("daily-check-in.coins-balance",{count:null!=(l=null==a?void 0:a.accumulatedCoins)?l:0,coins:(0,j.u)(null!=(n=null==a?void 0:a.accumulatedCoins)?n:0)})}),(0,i.jsx)(W,{userCoinsInfo:a})]})]}),(0,i.jsxs)("div",{className:"border-t border-warning-200 p-4 lg:border-none lg:p-5",children:[(0,i.jsx)("h4",{className:"mb-3 text-2sm font-medium text-grey-dark lg:mb-5 lg:text-xl lg:font-semibold",children:s(Q())}),(0,i.jsx)("div",{className:"grid grid-cols-7 gap-2 lg:hidden",children:Object.values(null!=R?R:{}).map((e,l)=>(0,i.jsx)(eu,{val:String(e),index:l,userCoinsInfo:a},l))}),(0,i.jsx)("div",{className:c()("hidden gap-2 lg:grid lg:grid-cols-7",!E&&"gap-3"),children:Object.values(null!=R?R:{}).map((e,l)=>(0,i.jsx)(eu,{val:String(e),index:l,userCoinsInfo:a},l))})]}),(0,i.jsx)("div",{className:"flex justify-center rounded-b-2xl bg-warning-50 p-4 lg:hidden",children:(0,i.jsx)(f.H,{onClick:O,variant:"primary",className:"w-[260px]",disabled:!(null==a?void 0:a.canCheckIn)&&E,isLoading:g,children:s((null==a?void 0:a.canCheckIn)||!E?J():$())})}),(0,i.jsxs)("div",{className:"hidden items-center justify-between rounded-b-2xl bg-warning-50 p-5 lg:flex",children:[(0,i.jsxs)("div",{className:"flex",children:[(0,i.jsx)("div",{className:"mr-1",children:(null==a?void 0:a.accumulatedCoins)?(0,i.jsx)(C.E4,{}):(0,i.jsx)(C.Eg,{})}),(0,i.jsxs)("div",{className:"gap-0.5 lg:flex lg:flex-col lg:justify-center",children:[(0,i.jsxs)("h4",{className:"text-xl font-semibold text-black",children:[(0,j.u)(null!=(t=null==a?void 0:a.accumulatedCoins)?t:0)," ",(0,i.jsx)("span",{className:"lowercase",children:s(ee())})]}),(0,i.jsx)(W,{userCoinsInfo:a})]})]}),(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(f.H,{onClick:O,variant:"primary",className:"w-[260px]",disabled:!(null==a?void 0:a.canCheckIn)&&E,isLoading:g,"data-testid":"check-in-btn",children:s((null==a?void 0:a.canCheckIn)||!E?el():en())})})]})]})}let eu=e=>{var l,n,t,s;let{val:r,index:a,userCoinsInfo:o}=e,{t:d}=(0,h.Bd)(),{isAuthenticated:u}=(0,k.As)(),x=(null==o?void 0:o.canCheckIn)?a===(null!=(n=null==o?void 0:o.streak)?n:0):a===(null!=(l=null==o?void 0:o.streak)?l:0)-1,v=a<(null!=(t=null==o?void 0:o.streak)?t:0),[p,g]=(0,m.useState)(!1);(0,m.useEffect)(()=>{let e=()=>{g(window.innerWidth>=1024)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]);
1let f=null!=(s=null==o?void 0:o.coinHistories)?s:[];f&&(null==f||f.sort((e,l)=>{let n=new Date(e.createdAt),t=new Date(l.createdAt);return n.getTime()-t.getTime()}));let y=(0,m.useMemo)(()=>{var e,l,n,t;return u||0!==a?v?p?(null==(e=f[a])?void 0:e.totalCoins)?ea[null!=(n=null==(l=f[a])?void 0:l.totalCoins)?n:0]:ea[r]:eo.done:(a===(null!=(t=null==o?void 0:o.streak)?t:0)||!u&&0===a)&&(null==o?void 0:o.canCheckIn)?ec[r]:er[r]:ec[r]},[v,a,null==o?void 0:o.streak,null==o?void 0:o.canCheckIn,u,r,p,f]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"text-center lg:hidden",children:[(0,i.jsx)("div",{className:c()("mb-2 flex h-[60px] items-center justify-center rounded-lg bg-white py-3",(x&&(null==o?void 0:o.canCheckIn)||!u&&0===a)&&"border-2 border-yellow-orange"),children:y}),(0,i.jsx)("div",{className:c()("text-0.5xs font-bold leading-[10px] text-grey-lightgrey",x&&(null==o?void 0:o.canCheckIn)&&"text-warning-800"),children:x||!u&&0===a?d(et()):d("daily-check-in.day-num",{day:a+1})})]}),(0,i.jsxs)("div",{className:c()("hidden flex-col items-center rounded-lg bg-white lg:flex lg:h-24",(x&&(null==o?void 0:o.canCheckIn)||!u&&0===a)&&"border-2 border-yellow-orange"),children:[(0,i.jsx)("div",{className:c()(x&&(null==o?void 0:o.canCheckIn)||!u&&0===a?"lg:h-[52px]":"lg:h-[54px]"),children:y}),(0,i.jsx)("h6",{className:c()("flex w-full items-center justify-center text-center text-2sm font-bold lg:h-[42px]",x&&(null==o?void 0:o.canCheckIn)||!u&&0===a?"bg-yellow-orange text-warning-800":"rounded-b-lg bg-grey-100 text-grey-lightgrey"),children:x||!u&&0===a?d(ei()):d("daily-check-in.day-num",{day:a+1})})]},a)]})};var em=function(e){return e.PROCESSING="PROCESSING",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e}({});function eh(e){var l,n;let{className:t,status:s}=e,{t:r}=(0,h.Bd)(),a=(0,u.useRouter)(),o={[em.PROCESSING]:{label:r("daily-check-in.redeem-status.processing"),className:"bg-yellow-orange"}};return s?[em.COMPLETED].includes(s)?(0,i.jsx)(h.x6,{i18nKey:"daily-check-in.view-voucher",components:{link1:(0,i.jsx)(d(),{href:(0,G.Gpi)(a),className:"text-petronas-500"})}}):(0,i.jsx)("p",{className:c()("uppercase font-bold text-xs leading-[18px] text-white whitespace-nowrap py-[1px] px-[6px] rounded w-fit h-fit tracking-[0.13em]",t,null==(l=o[s])?void 0:l.className),children:null==(n=o[s])?void 0:n.label}):null}function ex(){let e=(0,t._)(["order.load-more"]);return ex=function(){return e},e}function ev(){let{t:e}=(0,h.Bd)(),{historyCoins:l}=(0,m.useContext)(v.BR),[n,t]=(0,m.useState)(S.L3),[s,r]=(0,m.useState)(!1),[c,a]=(0,m.useState)(5),{isAuthenticated:o}=(0,k.As)();return((0,m.useEffect)(()=>{async function e(){r(!0),t(await (0,N.bF)({page:1,perPage:c})),r(!1)}o&&e()},[c,o]),(0,m.useEffect)(()=>{t(l)},[l]),!n.totalDocs||n.totalDocs<=0)?null:(0,i.jsxs)("div",{className:"mt-4",children:[(0,i.jsx)("h3",{className:"border-b border-gray-base py-6 text-xl font-semibold",children:e("daily-check-in.history-coins")}),n.docs.map(l=>{let{label:n,isReviewCoin:t}=function(e,l){var n;let t=!(0,U.gD_)(null==e?void 0:e.referenceId)&&!(0,U.gD_)(null==e?void 0:e.referenceType),s=(null==e?void 0:e.referenceType)===S.zP.BUY_ORDER,r=(null==e?void 0:e.referenceType)===S.zP.RATE_ORDER&&(null==e?void 0:e.type)===S.T0.REMOVE,c={isReviewCoin:t},a={[S.T0.EXPIRED]:l("daily-check-in.expired-coins"),[S.T0.EARNED]:e.referenceType===S.zP.ADMIN_UPDATE?null==e?void 0:e.description:l("daily-check-in.daily-check-in-text"),[S.T0.REDEEMED]:[em.COMPLETED,em.PROCESSING].includes(null==e?void 0:e.status)?(0,i.jsxs)("div",{className:"flex flex-col gap-1 md:flex-row md:gap-1",children:[(0,i.jsx)("p",{children:l("daily-check-in.redeem-coins-history",{value:(null==e?void 0:e.voucherValue)||5})}),(0,i.jsx)(eh,{status:null==e?void 0:e.status})]}):l("daily-check-in.failed-to-redeem-coins-for-RM-5-voucher-No-coins-deducted"),[S.T0.REVERT]:l("daily-check-in.failed-to-redeem-coins-for-RM-5-voucher-No-coins-deducted"),[S.T0.REMOVE]:null==e?void 0:e.description,[S.T0.MONTHLY_EXPIRED]:l("daily-check-in.monthly-expiry")};return(null==e?void 0:e.type)?t?s?{...c,label:l("daily-check-in.completed-purchase")}:r?{...c,label:l("daily-check-in.deduction-for-inappropriate-review")}:{...c,label:l("daily-check-in.review-coins")}:{...c,label:null!=(n=a[e.type])?n:null}:{...c,label:null}}(l,e);return(0,i.jsxs)("div",{className:"flex justify-between border-b border-gray-base py-4 last:border-none",children:[(0,i.jsxs)("div",{className:"text-2sm font-medium text-grey-dark",children:[n&&(0,i.jsx)("h4",{className:"mb-1 flex w-[247px] lg:w-fit lg:items-center",children:n}),t&&(0,i.jsx)("p",{className:"text-sm font-normal text-grey-lightgrey",children:e("daily-check-in.order-id",{orderId:null==l?void 0:l.referenceId})}),[S.T0.REDEEMED].includes(l.type)&&(0,i.jsxs)("p",{className:"text-sm font-normal text-grey-lightgrey",children:[e("daily-check-in.redemption-id")," ",null==l?void 0:l.redemptionCode]}),(0,i.jsx)("p",{className:"text-sm font-normal text-grey-lightgrey",children:(0,U.Yq5)(l.createdAt,{formatType:"dateOnly"})})]}),!([S.T0.REDEEMED].includes(l.type)&&[em.FAILED].includes(null==l?void 0:l.status)||[S.T0.REVERT].includes(l.type))&&(0,i.jsxs)("p",{className:"text-2sm font-medium lowercase",children:[[S.T0.EARNED].includes(l.type)?"+":"-",l.totalCoins," ",e("daily-check-in.coins")]})]},l._id)}),n.totalPages>1&&(0,i.jsx)("div",{className:"m-auto w-full py-6 lg:w-[280px]",children:(0,i.jsx)(f.H,{variant:"outline",className:"h-10 w-full hover:bg-white",onClick:()=>a(c+5),disabled:n.totalPages<2,isLoading:s,"data-testid":"load-more-btn",children:e(ex())})})]})}function ep(){return(0,i.jsxs)("div",{className:"h-[188px] w-[188px] animate-pulse overflow-hidden rounded-xl","data-testid":"skeleton-block",children:[(0,i.jsx)("div",{className:"h-24 bg-gray-300 rounded-xl","data-testid":"skeleton-block"}),(0,i.jsxs)("div",{className:"py-4 space-y-2",children:[(0,i.jsx)("div",{className:"w-1/2 h-4 bg-gray-300 rounded","data-testid":"skeleton-block"}),(0,i.jsx)("div",{className:"w-3/4 h-4 bg-gray-300 rounded","data-testid":"skeleton-block"}),(0,i.jsx)("div",{className:"w-1/2 h-4 bg-gray-300 rounded","data-testid":"skeleton-block"})]})]})}function eg(){var e,l;let{t:n}=(0,h.Bd)(),{isAuthenticated:t}=(0,k.As)(),[s,r]=(0,m.useState)(!1),[c,a]=(0,m.useState)(!1),[o,d]=(0,m.useState)(!1),{dailyCheckInFeatureData:u,openLoginPopup:x}=(0,m.useContext)(v.BR);return(null==u||null==(e=u.daily_check_in)?void 0:e.feature_toggle)||(null==u||null==(l=u.redeem_voucher_10)?void 0:l.enable)?(0,i.jsxs)("div",{className:"-mr-5 mt-9 md:mr-0",children:[(0,i.jsx)("div",{className:"mb-5 text-xl font-semibold text-grey-dark",children:n("daily-check-in.redeem-voucher")}),(0,i.jsx)("div",{className:"cursor-pointer",children:(0,i.jsx)(ef,{onClick:e=>t?(r(!0),e===S.R2)?d(!0):d(!1):x()})}),s&&(0,i.jsx)(H,{setToggleFetchUserCoins:a,toggleFetchUserCoins:c,setIsShowClaim5RMVoucherModal:r,isShowClaim5RMVoucherModal:s,isRedeemVoucher5:o})]}):null}let ef=e=>{var l,n,t,s;let{onClick:r}=e,{dailyCheckInFeatureData:a,isFetchingDailyCheckIn:o,userCoinsInfo:d,openLoginPopup:u}=(0,m.useContext)(v.BR),{t:g}=(0,h.Bd)(),{isAuthenticated:f}=(0,k.As)(),y=(null==d?void 0:d.accumulatedCoins)&&(null==d?void 0:d.accumulatedCoins)>=((null==a||null==(n=a.daily_check_in)||null==(l=n.voucher_setup)?void 0:l.redeem_voucher_coins)||S.rJ.REDEEM_VOUCHER_COINS),_=(null==d?void 0:d.accumulatedCoins)&&(null==d?void 0:d.accumulatedCoins)>=((null==a||null==(s=a.redeem_voucher_10)||null==(t=s.voucher_setup)?void 0:t.redeem_voucher_10_coins)||S.rJ.REDEEM_VOUCHER_10_COINS),b=(0,m.useMemo)(()=>({drag:!0,mode:"snap",rtl:!1,loop:!0,slides:{perView:1.8,spacing:20},breakpoints:{[p.W1]:{drag:!1,slides:{perView:"auto",spacing:20}}}}),[]),N=(0,m.useMemo)(()=>{var e,l,n,t,i;if(!(null==a?void 0:a.daily_check_in)||!(null==a||null==(e=a.daily_check_in)?void 0:e.feature_toggle))return[];let{enable:s,...r}=(null==a?void 0:a.redeem_voucher_10)||{},c=null==a||null==(l=a.redeem_voucher_10)?void 0:l.enable,o=[{...null==a?void 0:a.daily_check_in,voucher:S.R2}];return c?[...o,{...r,feature_toggle:null==a||null==(n=a.redeem_voucher_10)?void 0:n.enable,redeem_voucher_modal_content:null==a||null==(t=a.redeem_voucher_10)?void 0:t.redeem_voucher_modal_content_10,voucher:S.lr,voucher_setup:{...r.voucher_setup,redeem_voucher_coins:null==a||null==(i=a.redeem_voucher_10)?void 0:i.voucher_setup.redeem_voucher_10_coins}}]:o},[null==a?void 0:a.daily_check_in,null==a?void 0:a.redeem_voucher_10]);return o?(0,i.jsx)(ep,{}):(0,i.jsx)(p.RC,{options:b,children:!o&&(null==N?void 0:N.map((e,l)=>{var n,t,s,a;return(0,i.jsx)(p.qr,{className:c()("!min-w-[188px] !max-w-[188px]"),onClick:()=>(e=>{if(!f)return u();(e===S.R2&&y||e===S.lr&&_)&&r(e)})(null==e?void 0:e.voucher),children:(0,i.jsxs)("div",{className:"w-[188px] text-2sm",children:[(0,i.jsx)("div",{className:c()("h-[188px] w-[188px] rounded-lg bg-background",(!y&&f&&e.voucher===S.R2||!_&&f&&e.voucher===S.lr)&&"opacity-50"),children:(0,i.jsx)("img",{className:"h-full w-full",src:"".concat(x.ZX,"/images/redeem-voucher-").concat((null==e?void 0:e.voucher)===S.lr?S.lr:S.R2,".png"),alt:"coins"})}),(0,i.jsxs)("div",{className:"w-[188px] py-3",children:[(0,i.jsx)("p",{className:"mb-1 font-bold text-grey-dark",children:g("daily-check-in.coins-balance",{count:null==e||null==(n=e.voucher_setup)?void 0:n.redeem_voucher_coins,coins:(0,j.u)(null!=(a=null==e||null==(t=e.voucher_setup)?void 0:t.redeem_voucher_coins)?a:0)})}),(0,i.jsx)("p",{className:"mb-1 font-medium text-grey-dark",children:null==e||null==(s=e.redeem_voucher_modal_content)?void 0:s.title})]})]})},l)}))})};var ey=n(43764),e_=n(87928),ej=n(15411),ek=n(94843),eb=n(59836);function eN(){let e=(0,t._)(["common.all-page-description"]);return eN=function(){return e},e}function eC(){let e=(0,t._)(["daily-check-in.coins"]);return eC=function(){return e},e}function ew(){let e=(0,t._)(["daily-check-in.check-in-daily-and-collect-coins-to-enjoy-amazing-discounts"]);return ew=function(){return e},e}function eE(){let e=(0,t._)(["common.learn-more"]);return eE=function(){return e},e}var eR=!0;function eI(e){var l,n,t,s,r,o;let{merchant:x}=e,{t:p}=(0,h.Bd)(),{dailyCheckInFeatureData:f,isFetchingDailyCheckIn:y}=(0,m.useContext)(v.BR),_=(0,u.useRouter)(),{isAuthenticated:j,authLoading:b}=(0,k.As)(),N=e_.Y.get()===ej.Qe.MINIAPP,C=(0,ey.A)();return(0,m.useEffect)(()=>{var e;(null==f||null==(e=f.daily_check_in)?void 0:e.feature_toggle)||y||b||_.push((0,G.KhS)(_))},[b,f,j,y,_]),(0,i.jsxs)("div",{className:"flex justify-center",children:[(0,i.jsx)(a.bV,{title:"".concat(null==x?void 0:x.name," Coins"),description:p(eN())}),(0,i.jsx)(ek.O,{children:(null==f||null==(l=f.daily_check_in)?void 0:l.feature_toggle)?(0,i.jsxs)("main",{className:"flex w-screen justify-center lg:max-w-[1200px] lg:py-10 lg:pb-24",children:[j&&(0,i.jsx)(eb.ld,{}),(0,i.jsxs)("div",{className:c()("w-full max-w-[880px] p-5 lg:pt-0",N&&"min-h-screen"),children:[(0,i.jsx)("h1",{className:"mb-5 text-xl font-semibold text-black lg:text-2xl lg:leading-[34px]",children:p(eC())}),(0,i.jsx)(ed,{}),(0,i.jsxs)("div",{className:"w-full font-medium text-left mt-7 text-2sm",children:["".concat(null==f||null==(t=f.daily_check_in)||null==(n=t.check_in_feature_header)?void 0:n.header_text)||p(ew()),(0,i.jsx)(d(),{target:N||C?"_self":"_blank",href:null!=(o=null==f||null==(r=f.daily_check_in)||null==(s=r.check_in_feature_header)?void 0:s.learn_more_url)?o:"#",children:(0,i.jsx)("span",{className:"text-petronas-500",children:p(eE())})})]}),(0,i.jsx)(g,{}),(0,i.jsx)(eg,{}),(0,i.jsx)(ev,{})]})]}):(0,i.jsx)(i.Fragment,{})})]})}function eM(){return(0,i.jsx)(s.L,{type:"skeleton",className:"w-full h-40 mt-5 bg-gray-400 rounded lg:h-24"})}},77346:(e,l,n)=>{"use strict";n.d(l,{A:()=>m});var t=n(37876),i=n(51188),s=n(47554),r=n(15039),c=n.n(r),a=n(14232),o=n(65212),d=n(22493),u=n.n(d);function m(e){let{iShowModal:l,title:n,message:r,handleConfirm:d,handleCancel:m,isShowCloseButton:h=!0,cancelLabel:x,confirmLabel:v,cancelButtonVarian:p="outline",confirmButtonVarian:g="primary",isConfirmOrderDialogLoading:f=!1,customClassModal:y,
1classNameMessage:_,classNameFooter:j,classNameCancelBtn:k,classNameConfirmBtn:b,extraActionButton:N}=e,{t:C}=(0,o.Bd)(),w=(0,a.useRef)(null);return x=null!=x?x:C("auth.cancel"),v=null!=v?v:C("auth.confirm"),(0,t.jsxs)(i.lGe,{isOpen:l,onDismiss:m,leastDestructiveRef:w,className:y,children:[(0,t.jsx)(i.lGe.Content,{header:n,className:u().dialogTitle,children:(0,t.jsx)("p",{className:_,children:r})}),(0,t.jsxs)(i.lGe.Footer,{className:c()("px-[16px] py-3 lg:px-7 lg:py-4",j),children:[h&&(0,t.jsx)(s.H,{variant:p,onClick:null!=N?N:m,ref:w,className:c()("h-12 lg:h-10",k),children:x}),d&&(0,t.jsx)(s.H,{className:c()("h-12 lg:h-10",b),variant:g,onClick:d,ref:w,isLoading:f,children:v})]})]})}},85504:e=>{e.exports={loader_style:"claim-voucher-modal_loader_style__x6mdd"}},94843:(e,l,n)=>{"use strict";n.d(l,{O:()=>a});var t=n(89099),i=n(14232),s=n(66196),r=n(4385),c=n(71632);function a(e){let l=(0,t.useRouter)(),n=l.pathname,{isAuthenticated:a,authLoading:o}=(0,c.As)();return((0,i.useEffect)(()=>{let e;return e=setTimeout(()=>{var e;!a&&(null==(e=l.query)?void 0:e.voucher)&&!o&&(r.BV.get().includes("voucher=")||r.BV.set(l.asPath),l.push((0,s.uPd)(l,{isClaimVoucher:"true"})))},500),()=>clearTimeout(e)},[o,a,l]),o||!a&&s.hfZ.has(n))?null:e.children}}}]);

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.