PageSourceSearch

https://partners.meridianbet.pe/build/assets/Transactions-Bt6p34EH.js

js meridianbet.pe collected 2026-10-02 06:58:54 UTC 14,576 bytes, 1 lines download raw bytes

1import{j as e,S as de,B as Le,p as ke,a8 as _e,L as Pe,E as ie,D as le}from"./main-CMViuH_f.js";import{k as K,R as t,d as Fe}from"./vendor-react-Bjxsyr_G.js";import{u as De}from"./usePermissions-BMwlS-_T.js";import{T as re}from"./TableData-rsaJzmAi.js";import{B as A}from"./Button-DzyKh4DA.js";import{P as Be}from"./PaginationControls-BTJ-3hRF.js";import{L as Me}from"./ListPageHeader-BMU8lTAw.js";import{u as oe}from"./useMediaQuery-Bzu3CIqR.js";import{u as Ue}from"./useListUrlState-Gg9ZqxAl.js";import{u as B}from"./vendor-i18n-CmmgQqfv.js";import{b as He,c as ze,d as qe,e as Ge,f as We,g as Ke}from"./transactionsApi-Tm-v68Yf.js";import{a as Qe,b as $e}from"./transactionsColumns-CIvAGXAb.js";import{m as Ve}from"./filterOptions-BFwkiKTT.js";import{u as ce}from"./useExportWithNotification-B5bzP4e_.js";import"./vendor-redux-CkTbKByD.js";import"./vendor-forms-Chlqk9RW.js";import"./permissions-CCOu_b7F.js";import"./Filters-B_zORFkG.js";import"./Checkbox-103DDomz.js";import"./filterStyles-Dc9vUaM-.js";import"./DateTimePicker-DzJlOK33.js";import"./dateUtils-Cn8z919x.js";import"./formatDate-C6Vg3jtv.js";import"./reportApiHelpers-Cv5qnHgV.js";import"./reportFormatters-B4n4--ce.js";import"./downloadBlob-B7c8Dpai.js";function Ye({open:n,selectedItems:l,action:s,actionOptions:x,showError:o,preventClick:a,onActionChange:m,onClose:N,onSave:b}){const{t:d}=B();return n?K.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white rounded-[4px] shadow-lg max-w-[700px] w-full mx-4",children:[e.jsx("div",{className:"p-6 pb-0",children:e.jsxs("h3",{className:"text-lg font-semibold",children:[d?d("TRANSACTIONS.CREATE_NEW_TRANSACTION_FOR_USERS"):"Kreiraj novu transakciju za korisnike",":",e.jsx("span",{className:"ml-2",children:l.map((c,h)=>e.jsxs("span",{children:[c.name,h<l.length-1?", ":""]},c.id))})]})}),e.jsxs("div",{className:"px-6 py-2",children:[e.jsx(de,{value:s,onChange:m,defaultText:d?d("TRANSACTIONS.CHOOSE_ACTION"):"Izaberi akciju",items:[...x],buttonClassName:"h-10 w-full border border-[var(--mdn-border-38)] text-[#2e3740] text-[14px] rounded-none focus:outline-none focus:ring-0 focus:border-[#243138] hover:border-[#243138]",wrapperClassName:"w-full",iconClassName:"text-[24px] text-[var(--mdn-text-54)]"}),o&&!s&&e.jsx("p",{className:"text-red-500 text-sm mt-2",children:d?d("TRANSACTIONS.YOU_NEED_TO_CHOOSE_ACTION"):"Morate izabrati akciju"})]}),e.jsxs("div",{className:"px-6 flex justify-end gap-3",children:[e.jsx(A,{variant:"text",className:"text-[var(--mdn-grey-500)]",onClick:N,children:d?d("TRANSACTIONS.CANCEL"):"Otkaži"}),e.jsx(A,{variant:"text",className:"text-[var(--mdn-green-d2)]",disabled:a,onClick:b,children:d?d("TRANSACTIONS.SAVE"):"Sačuvaj"})]})]})}),document.body):null}function Je({open:n,selectedUsers:l,onChangeSelectedUsers:s,onCancel:x,onSave:o}){const{t:a}=B(),[m,N]=t.useState(null),b=t.useMemo(()=>{const r=typeof window<"u"&&window.roles?window.roles:{};return[{id:"affiliate",value:r.affiliate??2,label:a?a("AFFILIATES.AFFILIATES"):"Saradnici"},{id:"cashier",value:r.cashier??5,label:a?a("CASHIERS.CASHIERS"):"Blagajnici"}]},[a]),d=t.useMemo(()=>m?{isRequest:0,noPagination:1,type:m}:null,[m]),{data:c=[],isFetching:h}=He(d,{skip:!d}),C=t.useMemo(()=>(c||[]).map(r=>({id:r.id,name:r.name})),[c]),v=t.useMemo(()=>(l||[]).map(r=>String(r.id)),[l]),M=t.useCallback(r=>{const p=Array.isArray(r)?r.map(String):[],j=C.filter(H=>p.includes(String(H.id)));s(j)},[C,s]),T=()=>{x==null||x()},U=()=>{!l||l.length===0||o==null||o()};return t.useEffect(()=>{n||N(null)},[n]),n?K.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-[var(--mdn-white)] rounded-[4px] shadow-lg max-w-[700px] w-full mx-4",children:[e.jsxs("div",{className:"px-6 pt-6 pb-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-[var(--mdn-text-strong)] mb-2",children:a?a("TRANSACTIONS.CREATE_NEW_TRANSACTION_FOR_USERS"):"Kreirajte novu transakciju za korisnike"}),e.jsx("p",{className:"text-sm text-[var(--mdn-text-60)] mb-6",children:a?a("TRANSACTIONS.PAYOUT_SUBTITLE"):"Da b
1iste uspešno isplatili korisnike potrebno je da izaberete tip korisnika i izaberete korisnike za isplatu. Uspešna isplata će resetovati stanje novčanika na 0 za svakog izabranog korisnika."}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start gap-6",children:[e.jsxs("div",{className:"md:w-1/3 flex flex-col gap-3",children:[b.map(r=>{const p=m===r.value;return e.jsxs("button",{type:"button",onClick:()=>N(r.value),className:"flex items-center gap-2 text-left",children:[e.jsx("span",{className:`inline-flex items-center justify-center w-5 h-5 rounded-full border-2 ${p?"border-[var(--mdn-green-500)]":"border-[var(--mdn-border-38)]"}`,children:p?e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-[var(--mdn-green-500)]"}):null}),e.jsx("span",{className:"text-[14px] text-[var(--mdn-text-87)]",children:r.label})]},r.id)}),h&&e.jsx("div",{className:"absolute inset-0 z-[60] bg-black/20 flex items-center justify-center",children:e.jsx("div",{className:"w-12 h-12 rounded-full border-4 border-[var(--mdn-border)] border-t-[var(--mdn-green-500)] animate-spin"})})]}),e.jsx("div",{className:"md:flex-1",children:m&&e.jsx(de,{className:"w-full min-[960px]:max-w-[270px]",items:C,value:v,onChange:M,defaultText:a?a("TRANSACTIONS.CHOOSE_USERS"):"Izaberi korisnike",isMultiple:!0,hasSelectAllOption:!0,searchable:!0,showSearchBox:!0,buttonClassName:"h-10 w-full border border-[var(--mdn-border-38)] text-[#2e3740] text-[14px] rounded-none focus:outline-none focus:ring-0 focus:border-[#243138] hover:border-[#243138] bg-[var(--mdn-white)]",iconClassName:"text-[24px] text-[var(--mdn-text-54)]",labels:{selectAll:a?a("TRANSACTIONS.SELECT_ALL"):"Select All"},searchPlaceholderKey:"USERS.SEARCH",searchBoxAfterSelectAll:!0,searchUnderline:!0,showMultipleCountBadge:!1,multipleCountAsText:!0,autoHighlightFirst:!1,showFirstPlusOthersWhenAll:!0,disabled:h})})]})]}),e.jsxs("div",{className:"px-6 py-4  flex justify-end",children:[e.jsx(A,{variant:"text",className:"min-w-[120px] text-[var(--mdn-grey-500)]",onClick:T,children:a?a("TRANSACTIONS.CANCEL"):"ODUSTANI"}),e.jsx(A,{variant:"text",className:"min-w-[120px] text-[var(--mdn-green-d2)] disabled:bg-transparent",disabled:!l||l.length===0,onClick:U,children:a?a("TRANSACTIONS.SAVE"):"SAČUVAJ"})]})]})}),document.body):null}function Xe({open:n,selectedUsers:l,preventClick:s,onBack:x,onConfirm:o}){const{t:a}=B();return n?K.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white rounded-[4px] shadow-lg max-w-[700px] w-full mx-4",children:[e.jsxs("div",{className:"p-6",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:a?a("TRANSACTIONS.DIALOG_QUESTION_FIRST_PART"):"Da li ste sigurni da želite isplatiti sledeće korisnike?"}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto mb-4",children:l.map((m,N)=>e.jsxs("p",{className:"text-sm",children:[N+1,". ",m.name]},m.id))}),e.jsx("h4",{className:"font-medium",children:a?a("TRANSACTIONS.DIALOG_QUESTION_SECOND_PART"):"Potvrdite isplatu?"})]}),e.jsxs("div",{className:"p-6 flex justify-end gap-3",children:[e.jsx(A,{variant:"text",className:"text-[var(--mdn-grey-500)]",onClick:x,children:a?a("AFFILIATES.BACK"):"Nazad"}),e.jsx(A,{variant:"text",className:"text-[var(--mdn-green-d2)]",disabled:s,onClick:o,children:a?a("USERS.YES"):"Da"})]})]})}),document.body):null}function Ze({t:n,options:l={}}){const s=n,x=[];typeof window<"u"&&window.roles&&x.push({id:"all",name:s?s("REPORTS.ALL"):"All"},{id:window.roles.affiliate,name:s?s("TRANSACTIONS.AFFILIATE"):"Affiliate"},{id:window.roles.cashier,name:s?s("TRANSACTIONS.CASHIER"):"Cashier"});const o=[{id:"all",name:s?s("REPORTS.ALL"):"All"},...Ve(l.managers)],a=[{id:"",name:s?s("TRANSACTIONS.ALL_ELIGIBLE_NOT_ELIGIBLE"):"All/Eligible/Not Eligible"},{id:1,name:s?s("TRANSACTIONS.ELIGIBLE"):"Eligible"},{id:0,name:s?s("TRANSACTIONS.NOT_ELIGIBLE"):"Not Eligible"}];return{filtersConfig:[{type:"input",filterOption:"search",placeholder:s?s("USERS.SEARCH"):"Search",grow:!0},{type:"select",filterOption:"type",placeholder:s?s("TRANSACTIONS.AFFILIATE"):"Affiliate",options:x,grow:!0},{type:"select",filterOption:"manager",placeholder:s?s("TRANSACTIONS.ASSIGNED_MANAGER"):"Manager",options:o,grow:!0},{type:"select",filterOption:"eligible",placeholder:s?s("TRANSACTIONS.ALL_ELIGIBLE_NOT_ELIGIBLE"):"All/Eligible/Not Eligible",options:a,grow:!0}],secConfig:[]}}const es=[{id:1,value:"approved",labelKey:"TRANSACTIONS.APPROVED"},{id:2,value:"paid",labelKey:"TRANSACTIONS.PAID"},{id:3,value:"rejected",labelKey:"TRANSACTIONS.REJECTED"}];function Es(){const{t:n}=B(),l=Fe(),s=oe(Le),x=oe("(max-width: 600px)"),{query:o,sortBy:a,sortDesc:m,onFiltersChanged:N,onSort:b,goToPage:d}=Ue({extraFilters:["type","eligible"],defaultStatus:"",defaultFilters:{type:typeof window<"u"&&window.roles?window.roles.affiliate:""}}),[c,h]=t.useState([]),[C,v]=t.useState(!1),[M,T]=t.useState(!1),[U,r]=t.useState(!1),[p,j]=t.useState(""),[H,z]=t.useState(!1),[w,I]=t.useState([]),[ue,Q]=t.useState(!1),[me,q]=t.useState(!1),[G,xe]=t.useState(!1),{data:E,isFetching:$,isLoading:pe,refetch:R}=ze(o),{data:u,isFetching:V,isLoading:fe,refetch:y}=qe(o);t.useEffect(()=>{(E||u)&&!G&&xe(!0)},[E,u,G]);const{data:Y}=ke({role:o.type||void 0}),{data:f}=_e(),[J]=Ge(),[X]=We(),[Z]=Ke(),{user:g,canSeeManagerControls:ee}=De(),se=ce(Z,"withdrawal-requests.xlsx"),te=ce(Z,"other-transactions.xlsx"),Ne=((E==null?void 0:E.items)||[]).map((i,S)=>({...i,_index:S+1})),he=(u==null?void 0:u.items)||[],Se=(u==null?void 0:u.totalPages)||1,ae=(u==null?void 0:u.currentPage)||1,Ae=(u==null?void 0:u.perPage)||20,Te=Math.max(0,(ae-1)*Ae),{filtersConfig:ge,secConfig:be}=t.useMemo(()=>Ze({t:n,options:{managers:ee?Y||[]:[]}}),[n,Y,ee]),Ce=t.useMemo(()=>es.map(i=>
1({id:i.value,name:n?n(i.labelKey):i.value})),[n]),L=t.useMemo(()=>new Date().getDate()>=3,[]),k=t.useMemo(()=>!(g!=null&&g.finance_permission)||(g==null?void 0:g.view_only_permission),[g]),_=t.useCallback(i=>{var S;l(`/wallet-balance-list-flow/${(S=i.user)==null?void 0:S.id}`)},[l]),P=t.useCallback(i=>{var S;l(`/manual-transactions/${(S=i.user)==null?void 0:S.id}`)},[l]),F=t.useCallback(i=>{i&&l(`/account-details/${i}`)},[l]),ne=t.useCallback((i,S)=>{h(S?W=>{var D,O;return[...W,{id:(D=i.user)==null?void 0:D.id,name:(O=i.user)==null?void 0:O.name}]}:W=>W.filter(D=>{var O;return D.id!==((O=i.user)==null?void 0:O.id)}))},[]),ve=t.useCallback(async()=>{if(!p){z(!0);return}if(p&&c.length>0)try{Q(!0),await J({users:c,type:p}).unwrap(),v(!1),h([]),j(""),R(),y()}catch{Q(!1)}},[p,c,J,R,y]),je=t.useCallback(async()=>{try{q(!0),await X({users:w.map(i=>i.id)}).unwrap(),r(!1),T(!1),I([]),R(),y()}catch{q(!1)}},[w,X,R,y]),we=t.useCallback(()=>{se({...o,isRequest:1})},[se,o]),Ee=t.useCallback(()=>{te({...o,isRequest:0})},[te,o]),Oe=t.useMemo(()=>Qe({t:n,isSmall:s,onDetails:_,onManual:P,selectedItems:c,onToggleSelect:ne,onUserClick:F}),[n,s,x,_,P,c,ne,F]),Ie=t.useMemo(()=>$e({t:n,isSmall:s,onDetails:_,onManual:P,onUserClick:F}),[n,s,_,P,F]),Re=t.useMemo(()=>!!(c.length===0||!L&&c.length>0||k&&c.length>0),[c.length,L,k]),ye=t.useMemo(()=>!!(!(f!=null&&f.enable_multiple_transactions)||!L&&(f!=null&&f.enable_multiple_transactions)||k&&(f!=null&&f.enable_multiple_transactions)),[f,L,k]);return!G&&(pe||fe||$||V)?e.jsx(Pe,{}):e.jsxs("div",{className:"pb-4 pt-[6px] md:pb-6 md:pt-[14px]",children:[e.jsx(Me,{title:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:n?n("TRANSACTIONS.TRANSACTIONS"):"Transactions"}),e.jsx("span",{className:"normal-case capitalize font-medium",children:n?` - ${n("TRANSACTIONS.WALLET_BALANCE_FLOW_LIST")}`:" - Wallet Balance Flow List"})]}),titleClassName:"text-left uppercase text-[20px] mb-[15px] font-normal",filtersConfig:ge,secConfig:be,onFiltersChanged:N,rightClassName:"shrink-0 w-full flex justify-end pt-2 gap-[10px] min-[960px]:w-auto min-[960px]:flex-col min-[960px]:items-start",keepActionsInlineOnMobile:!0,filtersProps:{isDashboard:!0,controlsUnderline:!0,singleRowLayout:!0,gridLayoutMd:!0},actionsRight:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"action",className:"rounded-none w-[220px] h-[40px] text-sm uppercase tracking-[1.25px] bg-[var(--mdn-grey-500)]",disabled:Re,onClick:()=>v(!0),children:n?n("TRANSACTIONS.CREATE_TRANSACTION"):"Create transaction"}),e.jsx(A,{variant:"action",className:"rounded-none w-[220px] h-[40px] text-sm uppercase tracking-[1.25px] bg-[var(--mdn-grey-500)] text-white",disabled:ye,onClick:()=>{q(!1),I([]),T(!0)},children:n?n("TRANSACTIONS.PAY_OUT"):"Pay out"})]})}),e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-0",children:[e.jsx("h3",{className:"uppercase text-[20px] mt-3 mb-0 font-medium",children:n?n("TRANSACTIONS.WITHDRAWAL_REQUESTS"):"Withdrawal requests"}),e.jsx("button",{type:"button",className:ie,"aria-label":"Export",onClick:we,children:e.jsx("i",{className:"mdi mdi-upload","aria-hidden":"true"})})]}),e.jsx("div",{className:"bg-[var(--mdn-white)] overflow-x-auto",children:e.jsx("div",{className:"min-w-[540px]",children:e.jsx(re,{columns:Oe,items:Ne,loading:$,...le,showIndex:!1,disableRowHover:!0,disableResponsivePercentCols:!1,wrapHeaderTwoLines:!0,emptyMessage:"No data available"})})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-0",children:[e.jsx("h3",{className:"uppercase text-[20px] font-normal mt-4 mb-0",children:n?n("TRANSACTIONS.OTHER"):"Other"}),e.jsx("button",{type:"button",className:ie,"aria-label":"Export",onClick:Ee,children:e.jsx("i",{className:"mdi mdi-upload","aria-hidden":"true"})})]}),e.jsx("div",{className:"bg-[var(--mdn-white)] overflow-x-auto",children:e.jsx("div",{className:"min-w-[540px]",children:e.jsx(re,{columns:Ie,items:he,loading:V,...le,showIndex:!s,sortBy:a,sortDesc:m,onSort:b,indexOffset:Te,disableRowHover:!0,disableResponsivePercentCols:!1,wrapHeaderTwoLines:!0})})}),e.jsx(Be,{currentPage:ae,totalPages:Se,onChange:d})]}),e.jsx(Ye,{open:C,selectedItems:c,action:p,actionOptions:Ce,showError:H,preventClick:ue,onActionChange:i=>{j(i),z(!1)},onClose:()=>
1{v(!1),h([]),j(""),z(!1)},onSave:ve}),e.jsx(Je,{open:M,selectedUsers:w,onChangeSelectedUsers:I,onCancel:()=>{T(!1),I([])},onSave:()=>{w.length&&(T(!1),r(!0))}}),e.jsx(Xe,{open:U,selectedUsers:w,preventClick:me,onBack:()=>{r(!1),T(!0)},onConfirm:je})]})}export{Es 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.