1import{q as U,d as G,Z as V,_ as q,Y as W,c as K,$ as Z,E as D,o,j as e,a0 as w,z as u,a1 as X,k as J,a as Q,a2 as S,a3 as ee,N as ne,a4 as re,a5 as oe,a6 as F,a7 as se,p as ce,B as L,a8 as ae,K as ie}from"./index-878ce38c.js";import{r as m}from"./react-0e2a0c96.js";import{A as te}from"./AnnouncementSection-ec30fd4a.js";import{aV as z,au as le,aW as me,a as ue,b as _e,aR as pe,aG as de}from"./images-0c2231a1.js";import{c as he}from"./Toast-96c1bf3c.js";import{g as ye}from"./assets-c9ac44d9.js";import{g as ge}from"./error-d088b380.js";import{R as fe}from"./ResultLayout-f07e9ea3.js";import{B as be,D as Ne}from"./BonusDisplayList-c7325f4c.js";import{u as ve}from"./usePost-5fbe5765.js";function we(n){const{region:s,lang:_}=U(),{post:c,...h}=ve(),{refreshUserInfo:b}=G(),{refreshPendingTxnCount:p}=V();return{postPoll:m.useCallback(()=>c("/shop/pay/poll?".concat(new URLSearchParams({region:s,language:_})),{display_id:n}).then(async a=>(window.gtag("event","msp.complete-purchase",{appId:a.app.app_id,channelId:a.channel_id,currencyAmount:a.currency_amount,currency:a.currency}),window.fbq("track","Purchase",{content_category:a.app.app_id,channel_id:a.channel_id}),await b().catch(()=>{}),q.includes(W)&&await p().catch(()=>{}),a)),[s,_,n,c,b,p]),...h}}const f=({children:n})=>e("dt",{className:"py-3 text-sm/none",children:n}),T=({children:n})=>e("dd",{className:"break-words py-3 text-end text-sm/[18px] font-medium",children:n}),Te=[221179,221201],Ie=({txnState:n})=>{var I,E,d,g,P,A;const{t:s}=K(),{region:_,lang:c}=U(),h=((I=n.promo)==null?void 0:I.promo_amount)||0,b=n.mystery_topup_percentage_bonus||0,p=Z(n.point_amount,b),t=n.promo_code&&n.promo_code.promo_code_amount&&!n.promo_code.promo_code_error?n.promo_code.promo_code_amount:0,a=(E=n.promo.promo_item.map(l=>({name:l})))!=null?E:[],R=n.point_amount+h+p+t;let y,N,v=!1;n.rebate_card?(y=me,N=n.rebate_card.name):n.app_item?N=n.app_item.name:(v=!0,y=n.app.point_icon,N=D(R,_));const r=[],i=n.original_currency_amount?Math.max(n.original_currency_amount-n.currency_amount-((d=n.deducted_currency_amount)!=null?d:0),0):0;return i&&r.push({label:s("lbl__promo_discount"),value:o("div",{className:"flex text-text-content2",children:[e("div",{children:"-"}),e(w,{currencyFormat:n.currency_symbol,currencyAmount:i,justifyEnd:!0})]})}),n.deducted_ticket_amount&&n.deducted_currency_amount&&r.push({label:s("lbl__loyalty_coin_deduction"),value:o("div",{className:"flex items-center",children:[o("div",{className:"flex text-text-content2",children:[e("div",{children:"-"}),e(w,{currencyFormat:n.currency_symbol,currencyAmount:n.deducted_currency_amount,justifyEnd:!0})]}),e("div",{className:"ms-2",children:"(-"}),e(z,{className:"mx-0.5"}),e("div",{children:"".concat(D(n.deducted_ticket_amount,_),")")})]})}),n.tax_amount&&r.push({label:s("lbl__tax"),value:e(w,{currencyFormat:n.currency_symbol,currencyAmount:n.tax_amount,justifyEnd:!0})}),o("dl",{className:"grid grid-cols-2 gap-x-3.5",children:[e(f,{children:s(v?"lbl__total_amount":"lbl__selected_product")}),e(T,{children:o("div",{className:"flex items-center justify-end",children:[y&&e("img",{className:"me-1.5 h-3 w-3",src:y}),N,a.length>0&&o("span",{className:"whitespace-nowrap",children:[e("span",{className:"mx-1",children:"+"}),e(le,{className:"inline align-bottom text-bonus"})]})]})}),e(be,{className:"col-span-2 my-1 w-full",appPointIcon:n.app.point_icon,appPointName:n.app.point_name,appPointAmount:n.point_amount,generalPromo:h,mysteryTopupPromo:p,promoCodeAmount:t,promoItems:a}),((g=n.promo_code)==null?void 0:g.promo_code)&&o(u,{children:[e(f,{children:s("lbl__promo_code_used")}),o(T,{children:[n.promo_code.promo_code," ",n.promo_code.promo_code_error&&"(".concat(s(n.promo_code.promo_code_error),")")]})]}),!Te.includes(n.channel_id)&&(r.length?o(u,{children:[e(f,{children:s("lbl__payment_breakdown")}),e(Ne,{className:"col-span-2 mb-2 w-full",displayItems:[{label:s("lbl__original_price"),value:e(w,{currencyFormat:n.currency_symbol,currencyAmount:(P=n.original_currency_amount)!=null?P:n.currency_amount,justifyEnd:!0})},...r,{label:s("title__total_payment"),value:e(w,{currencyFormat:n.currency_symbol,currencyAmount:(A=n.currency_amount_with_tax)!=null?A:n.currency_amount,justifyEnd:!0}),hasDivider:!0}]})]}):o(u,{children:[e(f,{children:s("lbl__price")}),e(T,{children:e(w,{currencyFormat:n.currency_symbol,currencyAmount:n.currency_amount,justifyEnd:!0})})]})),e(f,{children:s("lbl__game")}),e(T,{children:n.app.app_name}),e(f,{children:s("lbl__payment_method")}),e(T,{children:n.channel}),e(f,{children:s("lbl__transaction_time")}),e(T,{children:"".concat(new Date(n.update_time*1e3).toLocaleStr
1ing(X(_,c)))})]})},Ee=1e3*120,Pe=3e3,Ae=1e4,xe=[231252,231253,231254,231255,231315,231317],Le=[205070],Be=({successTitle:n,failedTitle:s,buttons:_})=>{var j,M,$,H;const{t:c}=K(),h=J(),{region:b}=U(),[p]=Q(),t=p.get("display_id")||"",a=Number(p.get("channel_id")),{init:R,idauth:y,oauth:N}=G(),{postPoll:v,data:r,error:i}=we(t),[I,E]=m.useState(!0),d=m.useRef(null),g=m.useRef(null),P=(r==null?void 0:r.app.app_id)||((M=(j=i==null?void 0:i.cause)==null?void 0:j.app)==null?void 0:M.app_id)||0,A=ye(P),l=m.useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null),g.current&&(window.clearInterval(g.current),g.current=null),E(!1)},[]);if(m.useEffect(()=>{if(t)return E(!0),v().catch(()=>{}),g.current=window.setInterval(()=>{v().catch(()=>{})},Pe),xe.includes(a)?d.current=window.setTimeout(()=>{l(),h("/pending?display_id=".concat(t))},Ae):d.current=window.setTimeout(()=>{l()},Ee),()=>l()},[t,v,l,a,h]),m.useEffect(()=>{r&&l()},[r,l]),m.useEffect(()=>{var B;(B=window.top)==null||B.postMessage(S,window.location.origin)},[]),m.useEffect(()=>{i&&i.message!==ee&&l()},[i,l]),R&&!N&&!y)return e(ne,{to:"/"});const k="mb-2 text-xl/none font-bold text-text-title",C="text-sm/[22px] text-text-primary link-inside",x=r&&!I&&!i,Y=x&&(($=r==null?void 0:r.tickets)!=null?$:0)>0,O=r!=null&&r.rebate_card?r.rebate_card.confirmation_text:r!=null&&r.app_item?r.app_item.confirmation_text:"";return o(fe,{bgResult:A,header:I?e(re,{}):i?o(u,{children:[e(ue,{className:"mb-5 text-[80px]"}),i.message===oe?o(u,{children:[e("div",{className:k,children:c("title__unauthorized_txn")}),e("div",{className:C,children:y?c("msg__unauthorized_txn_player_id_login"):o(F,{i18nKey:"msg__unauthorized_txn_platform_login",children:["This page is no longer available. You can check your transaction result anytime in ",e(se,{to:"/txn",children:"Transaction History"})," or in game."]})})]}):o(u,{children:[e("div",{className:k,children:s||c("msg__transaction_failure")}),e("div",{className:C,children:c(ge(i.message))})]})]}):o(u,{children:[e(_e,{className:"mb-5 text-[80px]"}),e("div",{className:k,children:n||c("title__complete_payment")}),o("div",{className:ce(C,"flex flex-col gap-5"),children:[o("div",{children:[c("lbl__transaction_id"),e("br",{}),t,e("button",{className:"ms-1 align-middle",onClick:async()=>{await window.navigator.clipboard.writeText(t),he({children:c("msg__copied_successfully")})},"aria-label":"Copy",children:e(pe,{className:"text-text-title"})})]}),(r==null?void 0:r.mystery_topup_percentage_bonus)&&e("div",{children:o(F,{i18nKey:"lbl__mystery_topup_txn_result_message_revamp",values:{percentage_bonus:r.mystery_topup_percentage_bonus},children:["*",e("a",{href:r.mystery_topup_event_site,children:"event website"}),"*"]})}),(r==null?void 0:r.display_success_message)&&e("div",{children:r.display_success_message}),O&&e("div",{children:O})]})]}),children:[x&&o(u,{children:[e(Ie,{txnState:r}),Y&&e("div",{className:"rounded-[5px] border border-primary-red bg-bg-selected px-4 py-3",children:o("div",{className:"flex items-center justify-between gap-4",children:[o("div",{className:"flex min-w-0 items-center gap-1",children:[e(z,{"aria-hidden":!0,className:"h-11 w-11 shrink-0"}),e("div",{className:"text-sm/none font-bold text-text-primary",children:c("lbl__result_loyalty_coins_earned",{coin_amount:
1D(r.tickets,b)})})]}),o(L,{height:ae.H32,className:"shrink-0",href:"/loyalty?app=".concat(r.app.app_id),children:[e("span",{className:"-me-0.5 -ms-0.5 text-xs/none",children:c("btn__go_to_view")}),e(de,{"aria-hidden":!0,className:"-me-2 -rotate-90 text-base rtl:rotate-90"})]})]})}),e(te,{announcements:(H=r==null?void 0:r.announcements)==null?void 0:H.non_revamp_successful_txn_page,position:"non_revamp_successful_txn_page"})]}),_||o(u,{children:[e(L,{className:"mt-4",fluid:!0,href:"/",children:c("btn__back_to_home_page")}),x&&Le.includes(r.channel_id)&&o("div",{children:[e(L,{fluid:!0,isOutlined:!0,href:"/buy?".concat(new URLSearchParams({app:"".concat(P),channel:"".concat(r.channel_id),item:"".concat(r.item_pricing_id)})),children:c("btn__buy_item_again")}),e("div",{className:"mt-3 text-sm/[22px] text-text-secondary",children:c("msg__buy_item_again")})]}),ie&&x&&r.app.open_app_url&&e(L,{fluid:!0,isOutlined:!0,href:r.app.open_app_url,children:c("btn__open_app",{app_name:r.app.app_name})})]})]})};export{Be 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.