1import{u as na,l as ca,A as f,I as g,a as ia,b as ra,t as la,c as da,M as ua,r as z,d as $,e as _a,f as Ta}from"./index-CN4xOLzz.js";import{v as Sa,c as d,r as x,b as J,a as R,F as ea,q as sa,l as m,n as L,h as n,p as y,I as N,e as W,M as Q,o as u,a7 as P,al as Aa,b4 as Ca,U as ha,k as A,t as I,J as Oa,D as M,B as F,s as D}from"./vendors-D_z06TSl.js";import{l as ma,a as _,F as V,_ as Z,y as pa,z as j,D as Ia,E as fa,d as oa,G as Ha,g as Ra,H as Ea}from"./ui-lib-CSML94fI.js";import{C as va}from"./CashboxOverallBalance-Czazk4yB.js";import{C as ba}from"./CashboxWithdrawRequests-DD0lDtQe.js";import{u as Da}from"./hookAfterLoadCashbox-CDMlG-DY.js";import"./BoxInformer-CNwnDdym.js";import"./AccountForm-KqMgiedz.js";import"./CurrenciesSelect-BjdV5Ctb.js";const K=10,l="all",E="dep",p="withdrawal",aa={[E]:f.DEPOSIT,[p]:f.CASHOUT,[l]:""};function xa(s){return s===E||s===p?s:l}function ta(s,i){const r=new Map(s.map(e=>[e.id,e])),t=i.map(e=>r.get(e.id)||e),o=new Set(t.map(({id:e})=>e));return[...t,...s.filter(({id:e})=>!o.has(e))]}function ya(){const{historyDeposits:s,historyPayouts:i,paymentHistory:r,hasMorePages:t}=Sa(na()),o=x(l),e=x({[l]:!1,[E]:!1,[p]:!1}),T=x({[l]:[],[E]:[],[p]:[]}),c=x({[l]:0,[E]:0,[p]:0}),C=x({[l]:!0,[E]:!0,[p]:!0});function H(a){return a===E?s.value:a===p?i.value:r.value}function S(a){return ta(H(a),T.value[a])}function h(a){return a===l?Math.max(c.value[l],Math.floor(r.value.length/K)):c.value[a]}function w(a){return a===l&&!c.value[l]?t.value[aa[l]]??!0:C.value[a]}async function v(a,O){if(!e.value[a]){e.value[a]=!0;try{const{items:G,pagination:q}=await ca({type:aa[a],page:O,pageSize:K});T.value[a]=ta(G,S(a)),c.value[a]=O,C.value[a]=q.page*q.per_page<q.total_count}catch(G){ma.error("CASHBOX_HISTORY_LOAD_ERROR",G)}finally{e.value[a]=!1}}}async function b(a){const O=xa(a);o.value!==O&&(o.value=O,O!==l&&!c.value[O]&&await v(O,1))}async function X(){const a=o.value;await v(a,h(a)+1)}const U=d(()=>S(o.value)),B=d(()=>[...U.value].sort((a,O)=>O.id-a.id)),Y=d(()=>S(l).some(({action:a})=>a===f.CASHOUT)||S(p).length>0),k=d(()=>{const a=o.value;return w(a)&&!e.value[a]&&U.value.length>=K});return{items:B,hasPayouts:Y,canLoadMore:k,setActiveTab:b,loadMore:X}}const Na={[f.DEPOSIT]:{[g.pending]:[{icon:_.fill.checkInput,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.DEPOSIT.PENDING[0].TEXT",done:!0,active:!1},{icon:_.fill.timer,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.DEPOSIT.PENDING[1].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.DEPOSIT.PENDING[1].DESC",active:!0}]},[f.CASHOUT]:{[g.reserved]:[{icon:_.fill.timer,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.RESERVED[0].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.RESERVED[0].DESC",done:!1,active:!0},{text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.RESERVED[1].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.RESERVED[1].DESC",done:!1,active:!1},{text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.RESERVED[2].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.RESERVED[2].DESC",done:!1,active:!1}],[g.processing]:[{icon:_.fill.checkInput,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.PROCESSING[0].TEXT",done:!0,active:!1},{icon:_.fill.timer,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.PROCESSING[1].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.PROCESSING[1].DESC",done:!1,active:!0},{text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.PROCESSING[2].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.PROCESSING[2].DESC",done:!1,active:!1}],[g.succeeded]:[{icon:_.fill.checkInput,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.SUCCEEDED[0].TEXT",done:!0},{icon:_.fill.checkInput,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.SUCCEEDED[1].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.SUCCEEDED[1].DESC",done:!0},{icon:_.fill.checkInput,text:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.SUCCEEDED[2].TEXT",description:"CASHBOX.TRANSACTION_HISTORY.ROADMAP.CASHOUT.SUCCEEDED[2].DESC",done:!0}]}};function Ba(s){return{roadmap:d(()=>{var r;return s.action?((r=Na[s.action])==null?void 0:r[s.state])||[]:[]})}}const Pa={class:"roadmap"},ga={class:"roadmap-item__icon"},Ma={key:1,class:"roadmap-item__icon-blank"},wa={class:"roadmap-item__title"},Xa={key:0,class:"roadmap-item__desc"},Ua=J({__name:"CashboxHistoryItemRoadmap",props:{transaction:{}},setup(s){const i=s,{roadmap:r}=Ba(i.transaction);function t(o,e){return{"roadmap-item--done":o.done,"roadmap-item--active":o.active,"roadmap-item--wait":!o.done&&!o.active,"roadmap-item--last":e===r.value.length-1}}return(o,e)=>{const T=Q("t");return u(),R("ul",Pa,[(u(!0),R(ea,null,sa(m(r),(c,C)=>(u(),R("li",{key:c.text,class:L(["roadmap-item",t(c,C)])},[n("div",ga,[c.icon?(u(),y(V,{key:0,icon:c.icon},null,8,["icon"])):(u(),R("div",Ma))]),n("div",null,[N(n("span",wa,null,512),[[T,c.text]]),e[0]||(e[0]=n("br",null,null,-1)),!c.done&&c.description?N((u(),R("span",Xa,null,512)),[[T,c.description]]):W("",!0)])],2))),128))])}}}),Ya=Z(Ua,[["__scopeId","data-v-663175ee"]]),ka=["data-item-id"],$a={class:"cashbox-history-item__main-info"},La={class:"cashbox-history-item__brand flex"},Fa={class:"cashbox-history-item__small-info"},Va={class:"font__small-caption--bold color-text-body"},Wa={class:"font__caption-1"},Ga={class:"cashbox-history-item__expand-wrap grid gap-y-8 lg:gap-y-16 auto-cols-fr"},qa={class:"flex justify-between items-center font__caption-2--normal color-text-body"},za={class:"text--color--alt"},ja={class:"flex justify-between items-center font__caption-2--normal color-text-body mb-8"},Ka={class:"text--color--alt"},Ja=J({__name:"CashboxHistoryItemExtended",props:{data:{}},setup(s){P.extend(Aa),P.extend(Ca);const{t:i,te:r}=ha(),t=s,o=x(!1),e=d(()=>({[`action--${t.data.action}`]:t.data.action})),T=d(()=>({[`state--${t.data.state}`]:t.data.state})),{getSubunitsToUnitsByCode:c}=ia(),C=d(()=>`${t.data.action===f.DEPOSIT?"+":"-"} ${da(t.data.amount_cents,t.data.currency,null,c(t.data.currency))}`),H=d(()=>({expanded:o.value})),S=d(()=>!!t.data.finished_at),h=d(()=>t.data.finished_at||t.data.created_at),w=d(()=>P(h.value).utc().format("DD.MM.YYYY, HH:mm:ss")),v=P.tz.guess(),b=d(()=>P(h.value).tz(v).format("DD.MM.YYYY, HH:mm:ss")),X=d(()=>
1{if(t.data.action===f.CASHOUT&&t.data.state===g.rejected&&t.data.cancellation_reason)return i(`CASHBOX.TRANSACTION_HISTORY.STATE_CANCELLATION_REASON.${t.data.cancellation_reason}`);const B=`CASHBOX.TRANSACTION_HISTORY.STATES_MESSAGES.${f.CASHOUT}.${t.data.state}`;if(r(B))return i(B)}),U=d(()=>t.data.action===f.DEPOSIT?_.fill.deposit:_.fill.withdrawMoney);return(B,Y)=>{const k=Q("t");return u(),R("div",{class:L(["cashbox-history-item",[e.value,H.value]]),"data-item-id":t.data.id,"data-test":"cashbox-history__item"},[n("div",$a,[n("div",La,[A(V,{icon:U.value,class:"mx-auto cursor-default"},null,8,["icon"])]),n("div",null,[n("div",Fa,[A(V,{class:"cashbox-history-item__type-icon",icon:m(_).outline.typeTransactionArrow},null,8,["icon"]),n("span",Va,I(t.data.action)+" â¢Â ",1),n("span",{class:L(["font__small-caption--bold color-text-body",T.value])},I(t.data.state),3)]),n("span",Wa,I(C.value),1)]),A(V,{icon:m(_).fill.dropdownDown,class:L(["cashbox-history-item__icon-expand",H.value]),onClick:Y[0]||(Y[0]=()=>o.value=!o.value)},null,8,["icon","class"])]),N(n("div",Ga,[X.value?(u(),y(ra,{key:0,theme:m(la).PrimarySmall,message:X.value,icon:m(_).fill.attention2},null,8,["theme","message","icon"])):W("",!0),A(Ya,{transaction:t.data},null,8,["transaction"]),n("div",null,[n("div",qa,[N(n("span",null,null,512),[[k,`CASHBOX.TRANSACTION_HISTORY.DATE.${S.value?"FINISHED":"CREATED"}_UTC`]]),n("div",za,I(w.value),1)]),n("div",ja,[N(n("span",null,null,512),[[k,`CASHBOX.TRANSACTION_HISTORY.DATE.${S.value?"FINISHED":"CREATED"}`]]),n("div",Ka,I(b.value),1)])])],512),[[Oa,o.value]])],10,ka)}}}),Qa=Z(Ja,[["__scopeId","data-v-a05e29d0"]]),Za={class:"font__body--bold padding-x-s"},at={key:1,class:"padding-x-s"},tt=J({__name:"CashboxHistory",setup(s){const i=new j(l,"CASHBOX.TRANSACTION_HISTORY.TABS"),r=new j(E,"CASHBOX.DEPOSITS_TAB"),t=new j(p,"CASHBOX.PAYOUTS_TAB"),o=new pa("transactionHistory",[i,r,t],i),{items:e,hasPayouts:T,canLoadMore:c,setActiveTab:C,loadMore:H}=ya();async function S(h){await C(h.name)}return(h,w)=>{const v=Q("t");return u(),y(Ia,{theme:Ha.SecondaryDark,class:"cashbox-history grid gap-y-16 lg:gap-y-24 auto-cols-fr","data-test":"cashbox-history__list"},{default:M(()=>[N(n("p",Za,null,512),[[v,"CASHBOX.HISTORY"]]),m(T)?(u(),y(fa,{key:0,tabs:m(o),class:"padding-x-s",onSetActiveTab:S},null,8,["tabs"])):W("",!0),n("div",null,[(u(!0),R(ea,null,sa(m(e),b=>(u(),y(Qa,{key:b.id,data:b},null,8,["data"]))),128))]),m(c)?(u(),R("div",at,[A(oa,{variant:"secondary",size:"sm","full-width":"",class:"fe-cashbox-history__action-hide","data-test":"cashbox-history__action--hide",onClick:m(H)},{default:M(()=>[F(I(h.$t("CASHBOX.TRANSACTION_HISTORY.SHOW_MODE_BUTTON")),1)]),_:1},8,["onClick"])])):W("",!0)]),_:1},8,["theme"])}}}),et="/dist/pci-dss-BQ6zU3jR.svg",st={name:"CashboxDashboard",components:{UiButton:oa,FeImage:Ra,ModalCommonSlot:ua,CashboxWithdrawRequests:ba,CashBoxTransactionHistory:tt,CashboxOverallBalance:va},props:{closeHandler:{type:Function,required:!0}},data(){return{FeCardConfig:Ea,pciDssIcon:et,routeNames:z,isLoaded:!1}},mounted(){const{hookAfterLoadCashbox:s}=Da();_a(async()=>{try{await s(),await Ta(),this.isLoaded=!0,$.markReady()}catch(i){$.markLoadFailed({stage:"data_load",err:i})}}).catch(i=>{$.markLoadFailed({stage:"lib_load",err:i})})},beforeUnmount(){$.markAbandon({step:"dashboard"})},methods:{async openCashboxWithdraw(){this.$gtm.customTrackEvent({...this.$gtm.CASHBOX_EVENTS.WITHDRAW.CLICK_BUTTON_OPEN_POPUP,location:"CashboxDashboard"}),await this.$router.push({name:z.cashboxWithdraw,query:{from:"cashbox_dashboard"}}),this.closeHandler()},async openCashboxDeposit(){this.$gtm.customTrackEvent({...this.$gtm.CASHBOX_EVENTS.DEPOSIT.CLICK_OPEN_DEPOSIT_MAIN,location:"CashboxDashboard"}),await this.$router.push({name:z.cashboxDeposit,query:{from:"cashbox_dashboard"}}),this.closeHandler()}}},ot={class:"cashbox-dashboard__top-nav gap-8 lg:gap-16","data-test":"cashbox-dashboard-nav"},nt={class:"cashbox-dashboard__info"};function ct(s,i,r,t,o,e){const T=D("UiButton"),c=D("CashboxOverallBalance"),C=D("CashboxWithdrawRequests"),H=D("CashBoxTransactionHistory"),S=D("FeImage"),h=D("ModalCommonSlot");return u(),y(h,{"show-loader":!o.isLoaded,title:s.$t("CASHBOX.TITLE"),class:"cashbox-dashboard","data-test":"cashbox-dashboard"},{default:M(()=>[n("div",ot,[A(T,{"full-width":"",onClick:e.openCashboxDeposit},{default:M(()=>[F(I(s.$t("COMMON.DEPOSIT")),1)]),_:1},8,["onClick"]),A(T,{variant:"tertiary","full-width":"",onClick:e.openCashboxWithdraw},{default:M(()=>[F(I(s.$t("COMMON.WITHDRAW")),1)]),_:1},8,["onClick"])]),A(c),A(C,{"close-handler":r.closeHandler,theme:o.FeCardConfig.themes.Secondary
1Dark,class:"cashbox-dashboard__request","data-test":"cashbox-withdraw-requests"},null,8,["close-handler","theme"]),A(H),n("div",nt,[A(S,{src:o.pciDssIcon,class:"cashbox-dashboard__pci-logo"},null,8,["src"]),F(" "+I(s.$t("CASHBOX.TRANSACTION_HISTORY.PCI_DSS")),1)])]),_:1},8,["show-loader","title"])}const Ct=Z(st,[["render",ct],["__scopeId","data-v-c232f506"]]);export{Ct as default}; 2//# sourceMappingURL=CashboxDashboard-emnFiYn5.js.map
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.