@tap-payments/os-micro-frontend-shared 0.3.206-test.2 → 0.3.207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_chunks/chunk-2HAFCALW.js +2 -0
- package/build/_chunks/{chunk-6LUO6OBJ.js → chunk-4PSG6SQS.js} +1 -1
- package/build/_chunks/chunk-CMHDU3NK.js +1 -0
- package/build/_chunks/{chunk-A2KZC66L.js → chunk-EZALVOGK.js} +1 -1
- package/build/_chunks/{chunk-RUSK5W42.js → chunk-GQJTYIRS.js} +1 -1
- package/build/_chunks/{chunk-K7BX77NR.js → chunk-MNPOSJOU.js} +1 -1
- package/build/_chunks/chunk-P3UNUMRE.js +1 -0
- package/build/_chunks/{chunk-VAXOBYQH.js → chunk-Q7AI2Q4D.js} +1 -1
- package/build/_chunks/{chunk-2VS35WT4.js → chunk-TITZ4VK4.js} +1 -1
- package/build/_chunks/{chunk-RCTRSOJN.js → chunk-XSLTZPSU.js} +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/MultiSelectDropdownButton/index.js +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/RFH/index.js +1 -1
- package/build/components/ReceiptsViewer/ReceiptViewer.d.ts +3 -0
- package/build/components/ReceiptsViewer/ReceiptsViewer.d.ts +12 -0
- package/build/components/ReceiptsViewer/index.d.ts +1 -0
- package/build/components/ReceiptsViewer/index.js +1 -0
- package/build/components/ReceiptsViewer/style.d.ts +4 -0
- package/build/components/ReceiptsViewer/type.d.ts +11 -0
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.d.ts +1 -6
- package/build/components/index.js +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/utils/number.d.ts +1 -1
- package/package.json +2 -2
- package/build/_chunks/chunk-4YYASHPB.js +0 -1
- package/build/_chunks/chunk-6TZC6ADP.js +0 -1
- package/build/_chunks/chunk-AARAZJSO.js +0 -2
- package/build/_chunks/chunk-F3BU4KEC.js +0 -1
- package/build/_chunks/chunk-JCOA42LB.js +0 -1
- package/build/_chunks/chunk-UZJJQWCT.js +0 -1
- package/build/components/ActionMenu/ActionMenu.d.ts +0 -5
- package/build/components/ActionMenu/ActionMenuDropDown.d.ts +0 -17
- package/build/components/ActionMenu/ActionMenuItem.d.ts +0 -16
- package/build/components/ActionMenu/index.d.ts +0 -5
- package/build/components/ActionMenu/index.js +0 -1
- package/build/components/ActionMenu/style.d.ts +0 -79
- package/build/components/ActionMenu/type.d.ts +0 -15
- package/build/components/AmountConversionFilter/AmountConversionFilter.d.ts +0 -20
- package/build/components/AmountConversionFilter/MultiSelectCurrencyFilter.d.ts +0 -10
- package/build/components/AmountConversionFilter/index.d.ts +0 -1
- package/build/components/AmountConversionFilter/index.js +0 -1
- package/build/components/AmountConversionFilter/style.d.ts +0 -19
- package/build/components/AmountSlider/AmountSlider.d.ts +0 -18
- package/build/components/AmountSlider/index.d.ts +0 -2
- package/build/components/AmountSlider/index.js +0 -1
- package/build/components/AmountSlider/style.d.ts +0 -25
- package/build/components/CurrencyFilter/CurrencyFilter.d.ts +0 -11
- package/build/components/CurrencyFilter/index.d.ts +0 -1
- package/build/components/CurrencyFilter/index.js +0 -1
- package/build/components/LanguageDropdown/LanguageDropdown.d.ts +0 -7
- package/build/components/LanguageDropdown/index.d.ts +0 -2
- package/build/components/LanguageDropdown/index.js +0 -1
- package/build/components/LanguageDropdown/style.d.ts +0 -6
- package/build/components/ResizableHeightInput/ResizableHeightInput.d.ts +0 -11
- package/build/components/ResizableHeightInput/index.d.ts +0 -2
- package/build/components/ResizableHeightInput/index.js +0 -1
- package/build/components/ResizableHeightInput/style.d.ts +0 -7
- package/build/hooks/useActionMenu.d.ts +0 -20
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$4,s}from'./chunk-4PSG6SQS.js';import {f as f$3,b as b$7,g,a as a$l,e as e$1,d as d$5,c as c$5}from'./chunk-AFMJ46QZ.js';import {a as a$5}from'./chunk-4WHJ7C3Y.js';import {a as a$f}from'./chunk-2RBU3WZ4.js';import {b as b$1}from'./chunk-VS4GPQTT.js';import {a as a$h}from'./chunk-MWDLX22N.js';import {a as a$o}from'./chunk-GJCU6ZVE.js';import {a as a$g}from'./chunk-6KQKDDLC.js';import {a as a$q}from'./chunk-UDDOFJHJ.js';import {a as a$a}from'./chunk-FIYSYENR.js';import {a as a$b}from'./chunk-PDRNFDWB.js';import {a as a$k,b as b$8}from'./chunk-ZONDSLTR.js';import {a as a$2}from'./chunk-FPR4MUXK.js';import {a as a$e,h as h$3}from'./chunk-R3H5ZLCU.js';import {b as b$5,d as d$3,c as c$1}from'./chunk-ES5ERGO6.js';import {h as h$1}from'./chunk-RQRTDUVJ.js';import {a as a$c}from'./chunk-HXIYFSTZ.js';import {a as a$p,b as b$9,d as d$6,c as c$6}from'./chunk-CWX3YQHY.js';import {a as a$n}from'./chunk-D5DOI2CG.js';import {a as a$3}from'./chunk-VSI64YFN.js';import {b as b$6}from'./chunk-OQXHFUUW.js';import {a as a$j}from'./chunk-PYBAY4RD.js';import {c as c$4}from'./chunk-6NTTIIW2.js';import {a as a$9}from'./chunk-MW3S7RYL.js';import {a as a$1}from'./chunk-3352EIHQ.js';import {a,j,d,c,h,o,b as b$2,i,f as f$2,k,l as l$2,p as p$1,q,n as n$1,m}from'./chunk-QCWTNVJS.js';import {a as a$i}from'./chunk-4W4V45ZR.js';import {f,a as a$8,b as b$3,d as d$2,c as c$3,e}from'./chunk-Z3B4EDSN.js';import {a as a$6}from'./chunk-TYUXEDNW.js';import {a as a$m}from'./chunk-67EIV5FM.js';import {r as r$2}from'./chunk-TITZ4VK4.js';import {b as b$4,c as c$2,d as d$4}from'./chunk-PIVDC3CV.js';import {a as a$d}from'./chunk-V4IMVJZP.js';import {p,z as z$1,j as j$1,V,t,R,b,f as f$1,l,D,d as d$1,v,r,x as x$1}from'./chunk-XB6KSBAO.js';import {n,o as o$1,r as r$1,a as a$r}from'./chunk-P3UNUMRE.js';import {a as a$7}from'./chunk-K3VCY2Z7.js';import {Wa,wa as wa$1,xa as xa$1,lc,La as La$1,x,Cb as Cb$2,Bb,Ab as Ab$1,Va as Va$1,zc,ac,l as l$1,Aa as Aa$1,Wb,Yb as Yb$1,bb as bb$1,vb as vb$1,wb as wb$2,ob as ob$1,Xb,Mb as Mb$1,yb as yb$1,zb as zb$1,xb as xb$1,_b as _b$1,Cc,Ia as Ia$1,Da as Da$1,Ha,cc,dc,o as o$2,f as f$4,t as t$1,gb as gb$1,wc as wc$1}from'./chunk-ZHEAWCTY.js';import {Ab,xb,zb,Ud as Ud$1,Cj,pc,Bi,zi,Ai,Bh as Bh$1,Mg,Sh as Sh$1,Se,gk,ja,yk,pk,F,E,_o,Kj,Jj,Ij,Gj,Ej,Fj,Hj,hc,ic,fc as fc$1,ma,Jl,Cb as Cb$1,Db as Db$1,Eb,C,Xj,Ah as Ah$1,wb as wb$1,fm as fm$1,Kh as Kh$1,Jh as Jh$1,hb as hb$1,Rd as Rd$1,We,So as So$1,vb,lj,rj,Ui,Zi,oo,vj,uj,Pc,Ve,hm,ui,A,Wc,Vc,Ze as Ze$1,Xe,Ye,Fb,dh as dh$1,ih as ih$1,jh as jh$1,gh,fh as fh$1,ah,bh as bh$1,ch as ch$1,_g,$g,kh,H,io as io$1,G,ub as ub$1,T,wi,yi,xi,vi,Ci,Tg,Pj,Qj,tb as tb$1,ek,hk as hk$1,fk,Kn,va as va$1,ua,qk,h as h$2,Sg,z as z$2,da,ca,na,rk,Ak,sk,ik,kk,vk as vk$1,xk as xk$1,nk,ok,ac as ac$1,bc,Oh,tk,lh as lh$1,wh as wh$1,vh as vh$1,uh,th,sh as sh$1,rh as rh$1,qh,ph as ph$1,oh as oh$1,nh as nh$1,mh as mh$1,Vh as Vh$1,Th as Th$1,Uh as Uh$1,Yh as Yh$1,Xh as Xh$1,ae,Xd,$d as $d$1,Cn,An as An$1,si,ob as ob$2,Yd,rn as rn$1,Zd as Zd$1,pb as pb$1,Dh as Dh$1,Ch as Ch$1,Fh,Hh,Gh as Gh$1,Ih as Ih$1,je,sf,rf,qf,pf,of,tf,nf,Ba as Ba$1,Aa as Aa$2,kf,jf,if as _if,ei,di as di$1,gi,fi,hi,_j,Yj,Zj,tc,Di,uc,Hi,ai as ai$1,yd as yd$1,Lk,Jk,Kk,Rb as Rb$1,vf,yf,xf,wf,uf,Lm,Im as Im$1,Dm as Dm$1,Em,Km as Km$1,wm,Mm,xm as xm$1,Nm,ym,Fm as Fm$1,Am as Am$1,Cm,Jm as Jm$1,Bm as Bm$1,um as um$1,Gm as Gm$1,Hm as Hm$1,vm,zm as zm$1,tm as tm$1,sm as sm$1,rm,qm as qm$1,pm,Yg,zk as zk$1,Vk,$j,Fo,Ho,dk as dk$1,jo,Go}from'./chunk-M5HS3EYQ.js';import hd,{memo,createContext,forwardRef,useMemo,useState,useRef,useCallback,useEffect,useImperativeHandle,useId,useReducer,useContext,Fragment as Fragment$1}from'react';import Un from'@mui/material/Box';import {styled,alpha,useTheme}from'@mui/material/styles';import {styled as styled$1,Box,Paper,Button,TextField,alpha as alpha$1,Typography,Popper,CircularProgress,Stack,Link,useTheme as useTheme$1,TableCell,ClickAwayListener}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTranslation}from'react-i18next';import {motion,AnimatePresence,Reorder,useDragControls}from'framer-motion';import xP from'@mui/material/SvgIcon';import Gt from'lodash/camelCase';import vc from'dayjs';import iA from'dayjs/plugin/timezone';import aA from'dayjs/plugin/utc';import Xh from'lodash/startCase';import ND from'@mui/material/Popover';import _D from'lodash/capitalize';import KR from'@mui/material/ClickAwayListener';import zR from'@mui/material/Popper';import XS from'@mui/material/Typography';import Rb from'@mui/material/Button';import OB from'@mui/material/Menu';import {yupResolver}from'@hookform/resolvers/yup';import {useForm,Controller}from'react-hook-form';import*as Te from'yup';import {useDropzone}from'react-dropzone';import DF from'@mui/material/CircularProgress';import Mc from'@mui/material/LinearProgress';import LV from'lodash/values';import iv from'@mui/material/Stack';import mW from'lodash/debounce';import $c from'memoize-one';var Tx=styled(Un)({display:"flex",alignItems:"center",gap:"12px"});function vv({value:e,format:t,flagIcon:o,hasFlag:n,tableMode:r,...i}){let a$1=o&&jsx(p,{title:La$1(o||""),children:jsx(a$6,{countryCode:o})}),s=useMemo(()=>x(e,t),[e]);return jsx(a,{...i,children:jsxs(Tx,{children:[n&&jsx(b$2,{sx:{visibility:"visible"},className:"geography-box",children:a$1}),jsx(Box,{sx:{...Wa(r)&&{fontSize:"11px"}},children:s})]})})}var pr=vv;function Sx({value:e,currentTimezone:t=io$1.UTC,timezoneOffset:o=0,defaultTimezoneOffset:n=0,hideTimezoneIcon:r=false,...i}){let a=m=>t$1(e,{currentTimezone:t,targetTimezone:m}),s=a(o),l=a(n),p$1=x(l),d=!r&&n!==o;return jsxs(Un,{sx:{display:"flex",gap:"8px"},children:[jsx(pr,{value:s,...i}),d&&jsx(p,{title:p$1,children:jsx("img",{src:H,width:14,alt:"timezone"})})]})}function Dv({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`,a$1=jsx(Fragment,{children:o?.map(s=>{let l=s.name||s.description,p=(l?.length||0)>20?`${l?.slice(0,20)}...`:l;return jsx("div",{children:p},s.id)})});return jsx(p,{title:(o||[]).length>1?a$1:void 0,children:jsx(a,{...n,children:jsx("span",{children:i})})})}var Rv=Dv;function Bv({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`;return jsx(a,{sx:{fontSize:"11px"},...n,children:i})}var kv=Bv;var wx=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),fa=styled("span",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"25ch",flex:1,...Wa(t)&&{fontSize:"11px",color:e.palette.text.primary}})),vx=styled("span")({width:"11.6px",height:"11.6px",flexShrink:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"flex-start"}),Px=styled("img")({width:"11.6px",height:"11.6px",borderRadius:"50%"});function Vv({customerInitiated:e,children:t,isTimezoneIconShown:o,hasCustomerIcon:n,customerIcon:r,customerName:i$1,hideCustomerInitiatedIcon:a$1,hideTimezoneIcon:s,phone:l,email:p$1,id:d,...m}){let{t:c}=useTranslation(),u=e===false?c("merchantInitiated"):"",f=_b$1(i$1),x=i$1?.split(" ")?.map(w=>w?.[0]?.toUpperCase()).join(""),C=useMemo(()=>Aa$1(),[]),S=n&&jsx(p,{title:t,children:jsx(i,{"data-testid":"CustomerCell_customerShownIcon",sx:{background:C},src:r,alt:r,children:x})}),g=useMemo(()=>[{name:"ID",value:d},{name:"Name",value:i$1},{name:"Email",value:p$1},{name:"Phone",value:l}],[p$1,l,d,i$1]),h=useMemo(()=>{if(!g.some(({value:b})=>b))return null;let w=Cc("customer-tooltip");return jsx("div",{"data-testid":"CustomerCell_customerTooltip",children:g.map(({name:b,value:y},T)=>y&&jsx("div",{"data-testid":`CustomerCell_customerTooltip_${b}`,children:b==="Name"?y:`${b}: ${y}`},w(y,T)))})},[g]);return jsx(a,{...m,"data-testid":"CustomerCell_TableCell",children:jsxs(wx,{"data-testid":"CustomerCell_StyledCustomerCell",children:[S,jsx(p,{title:h,children:jsx(fa,{"data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":f,children:t})}),!s&&jsx(vx,{"data-testid":"CustomerCell_StyledCustomerIconContainer",children:o&&jsx(Px,{src:G,"data-testid":"CustomerCell_StyledCustomerIcon"})}),!a$1&&jsx(p,{title:u,children:jsx(f$2,{"data-testid":"CustomerCell_StarBadgeWrapper",className:"geography-box",isShown:!!u,children:u&&jsx("img",{"data-testid":"CustomerCell_merchantInitiatedIcon",src:ub$1,alt:"merchant",style:{width:"16px",height:"16px"}})})})]})})}var Wv=Vv;function Ov({children:e,customerName:t}){let o=_b$1(t);return jsx(fa,{tableMode:"sheet","data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":o,children:e})}var _v=Ov;var ga=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(1)})),Ex=styled("span")(({theme:e,tableMode:t})=>({backgroundColor:e.palette.grey[100],display:"block",borderRadius:"4px",padding:"1.5px 3px",fontSize:Wa(t)?"11px":"10px",lineHeight:"13px",textTransform:"uppercase",fontWeight:e.typography.fontWeightBold})),Mx=styled("span")(({theme:e,tableMode:t})=>({fontSize:Wa(t)?"11px":e.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"})),Rp=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"})),xa=styled("div")(({theme:e,count:t})=>({justifyContent:"space-between",display:"flex",width:"100%",gap:(t||1)<=1?e.spacing(1.5):e.spacing(1)}));var U2=({type:e,selectAmount:t,selectCurrency:o,requestAmount:n,requestCurrency:r,merchantAmount:i,merchantCurrency:a})=>{let s=Ia$1(t,o),l=Ia$1(n,r),p=Ia$1(i,a);return jsxs(Rp,{sx:{textAlign:"right",justifyContent:"flex-end"},children:[jsx("span",{style:{fontWeight:"bold"},children:e?Da$1[e]:""}),jsxs(Rp,{children:[e!=="fx"&&jsxs(xa,{children:[jsx("span",{children:"Customer Selected"})," ",jsxs("span",{children:[jsx(a$j,{currency:o})," ",s.integerAmount,".",s.decimalAmount]})]}),jsxs(xa,{children:[jsx("span",{children:"Charge"})," ",jsxs("span",{children:[jsx(a$j,{currency:r})," ",l.integerAmount,".",l.decimalAmount]})]}),jsxs(xa,{children:[jsx("span",{children:"Settlement"})," ",jsxs("span",{children:[jsx(a$j,{currency:a})," ",p.integerAmount,".",p.decimalAmount]})]})]})]})};var Jo=({tableMode:e,conversionType:t})=>t?jsx(Ex,{tableMode:e,className:"conversion-type",children:t}):jsx(Fragment,{});var Qo=({tableMode:e,amount:t,currency:o})=>jsx(Mx,{tableMode:e,children:t!==void 0?jsxs(Fragment,{children:[jsx("span",{children:jsx(a$j,{currency:o,fontSize:10})})," ",jsx(b$6,{amount:t,currency:o})]}):jsx("span",{children:"-"})});var Dx="default";function Kv({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(a,{...i,children:jsxs(ga,{children:[jsx(p,{title:n||"",children:jsx(Box,{children:jsx(Jo,{tableMode:Dx,conversionType:e})})}),o&&jsx(p,{title:jsx(a$j,{currency:o}),children:jsx(a$6,{currencyCode:o})}),jsx(p,{title:r,children:jsx(Qo,{tableMode:Dx,amount:t,currency:o})})]})})}var jv=Kv;var Rx="text";function Xv({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(a,{...i,children:jsxs(ga,{children:[jsx(p,{title:n||"",children:jsx(Jo,{tableMode:Rx,conversionType:e})}),jsx(p,{title:jsx(a$j,{currency:o}),children:jsx("span",{})}),jsx(p,{title:r,children:jsx(Qo,{tableMode:Rx,amount:t,currency:o})})]})})}var Zv=Xv;var Lx="sheet";function Qv({conversionType:e,amount:t,currency:o}){let{integerAmount:n,decimalAmount:r}=Ia$1(t,o);return jsxs(b$1,{copyTrigger:"press",copyText:t?`${n}.${r}`:"-",children:[jsx(Jo,{tableMode:Lx,conversionType:e}),jsx(Qo,{tableMode:Lx,amount:t,currency:o})]})}var eP=Qv;var kx=styled(motion.img)(()=>({width:"14px",height:"14px"})),Nx=styled(motion.span)(({theme:e})=>({color:e.palette.common.white,borderRadius:e.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:e.palette.secondary.main})),Lp=styled(motion.div)(({theme:e})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.secondary.main}1A`,paddingInline:e.spacing(.5),borderRadius:"56px"})),tn=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}}),on=styled(motion.span)(({isTextShown:e,theme:t})=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e?"auto":"36px",...e&&{border:"none"}})),nn=styled(motion.div,{shouldForwardProp:e=>e!=="order"})(({order:e=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:e+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),rn=styled(motion.div,{shouldForwardProp:e=>e!=="statusesCount"})(({statusesCount:e=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${e*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Fx=styled("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var Vx=e=>e?Object.keys(e).filter(t=>e[t]).reduce((t,o)=>(t[o]=e[o],t),{}):{};var an=({statuses:e,centerIconKey:t})=>{let o=useMemo(()=>Vx(e),[e]),n=useMemo(()=>Object.values(o).filter(Boolean),[o]),r=useMemo(()=>{if(!t)return 0;let i=Object.entries(o).findIndex(([a])=>a===t);return i===-1?Math.floor((n.length-1)/2):i},[o,t,n.length]);return {statusesList:n,centerIconIndex:r}};function nP({statuses:e,centerIconKey:t,...o}){let{statusesList:n}=an({statuses:e,centerIconKey:t}),r=useTheme(),i=n.length||0;return jsx(a,{...o,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(rn,{whileHover:"animate",animate:"start",statusesCount:i,children:n.map((a,s)=>a?jsx(nn,{order:s,variants:tn(s,r.shadows[4],40),children:jsx(on,{children:a})},s):null)})})}var rP=nP;function aP({statuses:e,...t}){let{statusesList:o}=an({statuses:e});return jsx(a,{...t,children:jsx(Fx,{sx:{paddingRight:"30px"},children:o.map((n,r)=>jsx(Fragment$1,{children:n},r))})})}var sP=aP;function pP({statuses:e,centerIconKey:t,xGap:o,...n}){let{statusesList:r}=an({statuses:e,centerIconKey:t}),i=useTheme(),a$1=r.length||0,s=o||120;return jsx(a,{...n,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(rn,{whileHover:"animate",animate:"start",statusesCount:a$1,children:r.map((l,p)=>l?jsx(nn,{order:p,variants:tn(p,i.shadows[4],s),children:jsx(on,{isTextShown:true,children:l})},p):null)})})}var mP=pP;var Ia=styled("section",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",textAlign:"center",borderRadius:"50%",gap:Wa(t)?"4px":e.spacing(1),overflow:"visible"})),ba=styled("span")(({selected:e})=>({overflow:"visible",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative","&:hover":{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},...e&&{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},span:{flexGrow:1}})),Wx=styled("img",{shouldForwardProp:e=>e!=="isActive"})(({isActive:e})=>({width:"18px",height:"18px",...!e&&{pointerEvents:"none",filter:"opacity(0.3)"}})),Ze=styled(motion.img)(({icon:e})=>({width:"13.3px",height:"13.3px",...e==="cancel"&&{padding:"1.15px"}}));function Hx({isAnyActionLoading:e,isAnyActionHasError:t,isAnyActionSuccessful:o,areThereAnyShownActions:n}){let{t:r}=useTranslation();return t?jsx(Ze,{src:hc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"fail-icon"):o?jsx(Ze,{src:ic,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"success-icon"):e?jsx(Ze,{src:fc$1,className:"spinner-loader"},"spinner-icon"):jsx(p,{title:r("moreActions"),children:jsx(Wx,{alt:"more",src:ma,isActive:n},"ellipsis-icon")})}Hx.displayName="ActionIconsVariants";var fr=memo(Hx);var sn={GRAY:{icon:zb,color:"#CFCFCF"},ORANGE:{icon:xb,color:"#FFD503"},RED:{icon:Ab,color:"#FF0000"}},Ta={"#CFCFCF":"gray","#FFD503":"orange","#FF0000":"red",gray:"gray",red:"red",orange:"orange"},Sa={flag:E,dispute:F,refund:pk,void:yk,capture:ja,cancel:gk,clock:Se,reverse:Sh$1,destination:Mg,invoice:Bh$1,users:Ai,brand:zi,clipboard:Bi,viewApi:Ud$1,viewReceipt:pc,delete:Cj};function wa({actions:e,isDropdownShown:t,onCloseDropdown:o,renderDropdown:n}){let[r,i]=useState(null),a=!!r,s=(e||[]).filter(f=>f.isShown!==false),l=s.some(f=>f.isLoading),p=s.some(f=>f.isError),d=s.some(f=>f.isSuccess),m=s.length>0||!!n,c=f=>{l||!m||i(f.currentTarget);},u=()=>{i(null),o?.();};return useEffect(()=>{t||i(null);},[t]),{anchorEl:r,open:a,filteredActions:s,isAnyActionLoading:l,isAnyActionHasError:p,isAnyActionSuccessful:d,areThereAnyShownActions:m,handleClick:c,handleClose:u,setAnchorEl:i}}var Ox=e=>jsx(xP,{sx:{height:12.6,width:13},...e,children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"13",viewBox:"2.67 1.07 10.66 12.66",fill:"none",children:jsxs("g",{transform:"translate(-4 -4)",children:[jsx("path",{d:"M7.5918 15.166C7.5918 16.4041 8.5959 17.4072 9.83398 17.4072H15.5273L15.334 17.6973C15.101 18.0473 14.7079 18.2577 14.2871 18.2578H9.83398C8.12641 18.2578 6.74219 16.8736 6.74219 15.166V8.71289C6.74219 8.2923 6.9526 7.89944 7.30273 7.66602L7.5918 7.47266V15.166ZM10.167 5.74121H15.5C16.4651 5.74121 17.2586 6.534 17.2588 7.49902V14.833C17.2586 15.798 16.4651 16.5908 15.5 16.5908H10.167C9.20193 16.5908 8.40838 15.798 8.4082 14.833V7.49902C8.40838 6.534 9.20193 5.74121 10.167 5.74121ZM10.167 6.59082C9.6596 6.59082 9.25896 6.99168 9.25879 7.49902V14.833C9.25896 15.3404 9.6596 15.7412 10.167 15.7412H15.5C16.0074 15.7412 16.408 15.3404 16.4082 14.833V7.49902C16.408 6.99168 16.0074 6.59082 15.5 6.59082H10.167Z",fill:"#20232B",stroke:"white",strokeWidth:"0.15"}),jsx("path",{d:"M10.7598 12.84V9H11.4851V12.84H10.7598Z",fill:"black"}),jsx("path",{d:"M12.2846 12.84V9H13.5272C13.5574 9 13.6197 9.00089 13.7139 9.00267C13.8081 9.00444 13.8988 9.01067 13.9859 9.02133C14.2952 9.05867 14.5574 9.16622 14.7726 9.344C14.9877 9.52178 15.1512 9.74756 15.2632 10.0213C15.3752 10.2951 15.4312 10.5947 15.4312 10.92C15.4312 11.2453 15.3752 11.5449 15.2632 11.8187C15.1512 12.0924 14.9877 12.3182 14.7726 12.496C14.5574 12.6738 14.2952 12.7813 13.9859 12.8187C13.8988 12.8293 13.8081 12.8356 13.7139 12.8373C13.6197 12.8391 13.5574 12.84 13.5272 12.84H12.2846ZM13.0206 12.1573H13.5272C13.5752 12.1573 13.6401 12.1564 13.7219 12.1547C13.8037 12.1511 13.8774 12.1431 13.9432 12.1307C14.1103 12.0969 14.2463 12.0187 14.3512 11.896C14.4579 11.7733 14.5361 11.6258 14.5859 11.4533C14.6374 11.2809 14.6632 11.1031 14.6632 10.92C14.6632 10.728 14.6366 10.5458 14.5832 10.3733C14.5317 10.2009 14.4526 10.0551 14.3459 9.936C14.2392 9.81689 14.105 9.74133 13.9432 9.70933C13.8774 9.69511 13.8037 9.68711 13.7219 9.68533C13.6401 9.68356 13.5752 9.68267 13.5272 9.68267H13.0206V12.1573Z",fill:"black"})]})})});var zx=".IDButton-root:not(.IDButton-hoverDisabled):hover &",$x=styled("div")(({theme:e})=>({paddingInlineStart:"8px",border:"1px solid transparent",display:"flex",gap:"4px",alignItems:"center",justifyContent:"flex-end",backgroundColor:e.palette.common.white,float:"right",borderRadius:"56px",height:"100%",paddingLeft:"4px",paddingRight:"4px",width:"24px",overflow:"hidden",[zx]:{width:"max-content",overflow:"visible",borderColor:"rgba(92, 92, 92, 0.05)",boxShadow:"-7px 0px 8px 0px #F2F2F2",position:"absolute",right:0,top:0,zIndex:101}})),Ux=styled("div")(({theme:e})=>({color:e.palette.text.primary,fontSize:"11px",lineHeight:"120%",display:"grid",gridTemplateColumns:"0fr",opacity:0,transition:"grid-template-columns 0.1s ease, opacity 0.1s ease","& > span":{overflow:"hidden",minWidth:0,whiteSpace:"nowrap"},[zx]:{gridTemplateColumns:"1fr",opacity:1,transition:"grid-template-columns 0.3s ease, opacity 0.3s ease 0.3s"}}));function bP({icon:e=jsx(Ox,{}),id:t,sx:o,disableOnHoverEffect:n=false,onCopyId:r,className:i,...a}){let{t:s}=useTranslation();return jsx(p,{title:s("copy"),children:jsx(Un,{className:lc("IDButton-root",n&&"IDButton-hoverDisabled",i),sx:{position:"relative",width:"24px",height:"24px",cursor:"pointer",...o},...a,children:jsxs($x,{className:"IDButton-button",children:[t?jsx(Ux,{className:"IDButton-rowId",children:jsx("span",{children:t})}):null,t?jsx(D,{className:"IDButton-icon",icon:e,text:t,onClick:()=>r?.()}):null]})})})}var Np=memo(bP);var XO=memo(({flag:e,actions:t,flagTooltip:o,flagsCount:n,dropdownAction:r,onCloseDropdown:i,isDropdownShown:a$1=true,row:s,showJsonViewer:l=true,isTextShown:p$1,showIdButton:d$1=true,onCopyId:m,rowId:c$1,onJsonViewClick:u,renderDropdown:f$1,startSlot:x,...C})=>{let{t:S}=useTranslation(),{open:g,anchorEl:h$1,filteredActions:w,isAnyActionLoading:b,isAnyActionHasError:y,isAnyActionSuccessful:T,areThereAnyShownActions:v,handleClick:M,handleClose:D,setAnchorEl:A}=wa({actions:t,isDropdownShown:a$1,onCloseDropdown:i,renderDropdown:f$1});return jsx(a,{...C,sx:{overflow:"visible",...C.sx},children:jsxs(Ia,{"data-testid":"ActionCell_ActionCellContainer",children:[x,e&&jsx(Fragment,{children:p$1?jsx(p,{title:o,children:jsx(j,{"data-testid":"ActionCell_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:o})}):jsx(p,{title:o,children:jsxs(d,{"data-testid":"ActionCell_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(Ze,{"data-testid":"ActionCell_FlagIcon",sx:{width:"12px",height:"11px"},src:sn[e]?.icon,alt:"flag-icon"}),(n??0)>1&&jsx(motion.div,{"data-testid":"ActionCell_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z$1,{compact:true,color:Ta[sn[e]?.color]||"orange","data-testid":"ActionCell_StyledBadge",children:[n,"x"]})})]})})}),d$1&&jsx(Np,{id:c$1||s.id,onCopyId:m}),jsxs("div",{"data-testid":"ActionCell_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:[l&&jsx(Fragment,{children:jsx(c,{onClick:u,type:"button","data-testid":"ActionCell_TransparentButton",children:jsx(p,{title:S("jsonViewer"),children:jsx(h,{"data-testid":"ActionCell_IdButtonContainer",children:jsx(motion.img,{src:Ud$1,alt:"icon"},"id-icon")})})})}),jsxs(ba,{id:"styled-popover",selected:!!r||g,"data-testid":"ActionCell_ActionsIconContainer","data-is-active":v,sx:{...!v&&{pointerEvents:"none"}},children:[jsx(c,{onClick:M,"data-testid":"ActionCell_ActionsIconContainer_TransparentButton","data-is-active":v,sx:{...!v&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(fr,{isAnyActionLoading:b,isAnyActionHasError:y,isAnyActionSuccessful:T,areThereAnyShownActions:v})})}),r,f$1?f$1(h$1,A):jsx(Fragment,{children:v&&jsx(f,{style:{zIndex:2e3},open:g,onClose:D,anchorEl:h$1,menuItems:w.map(R=>({...R,onClick:H=>{R?.onClick?.(H),R.hasActionMenu||D();},onRightClick:H=>{R?.onRightClick?.(H),D();},icon:R.customIcon||jsx(Ze,{icon:R.icon,src:R.iconSrc??(R.icon&&Sa[R.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${R.label.trim()}`)}))})})]})]})]})})});function MP({flag:e,flagTooltip:t,flagsCount:o,row:n,showJsonViewer:r=true,isTextShown:i,showIdButton:a$1=true,rowId:s,onJsonViewClick:l,tableMode:p$1,...d$1}){return jsx(a,{...d$1,sx:{overflow:"visible"},children:jsxs(Ia,{"data-testid":"ActionsColumn_ActionCellContainer",tableMode:p$1,children:[e&&jsx(Fragment,{children:i?jsx(p,{title:t,children:jsx(j,{"data-testid":"ActionsColumn_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:t})}):jsx(p,{title:t,children:jsxs(d,{"data-testid":"ActionsColumn_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(Ze,{"data-testid":"ActionsColumn_FlagIcon",sx:{width:"12px",height:"11px"},src:sn[e]?.icon,alt:"flag-icon"}),(o??0)>1&&jsx(motion.div,{"data-testid":"ActionsColumn_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z$1,{compact:true,color:Ta[sn[e]?.color]||"orange","data-testid":"ActionsColumn_StyledBadge",children:[o,"x"]})})]})})}),a$1&&jsx(b$1,{sx:{minWidth:"213px"},children:s||n.id}),jsx("div",{"data-testid":"ActionsColumn_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:r&&jsx(b$1,{onClick:l,children:"View API"})})]})})}var AP=memo(MP);function BP({actions:e,dropdownAction:t,onCloseDropdown:o,isDropdownShown:n=true,renderDropdown:r,...i}){let{open:a$1,anchorEl:s,filteredActions:l,isAnyActionLoading:p,isAnyActionHasError:d,isAnyActionSuccessful:m,areThereAnyShownActions:c$1,handleClick:u,handleClose:f$1,setAnchorEl:x}=wa({actions:e,isDropdownShown:n,onCloseDropdown:o,renderDropdown:r});return jsx(a,{...i,sx:{overflow:"visible"},children:jsx("div",{"data-testid":"ActionIconColumn_Container",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:jsxs(ba,{id:"styled-popover",selected:!!t||a$1,"data-testid":"ActionIconColumn_ActionsIconContainer","data-is-active":c$1,sx:{...!c$1&&{pointerEvents:"none"}},children:[jsx(c,{onClick:u,"data-testid":"ActionIconColumn_ActionsIconContainer_TransparentButton","data-is-active":c$1,sx:{...!c$1&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(fr,{isAnyActionLoading:p,isAnyActionHasError:d,isAnyActionSuccessful:m,areThereAnyShownActions:c$1})})}),r?r(s,x):jsxs(Fragment,{children:[t,c$1&&jsx(f,{style:{zIndex:2e3},open:a$1,onClose:f$1,anchorEl:s,menuItems:l.map(C=>({...C,onClick:S=>{C?.onClick?.(S),C.hasActionMenu||f$1();},onRightClick:S=>{C?.onRightClick?.(S),f$1();},icon:C.customIcon||jsx(Ze,{icon:C.icon,src:C.iconSrc??(C.icon&&Sa[C.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${C.label.trim()}`)}))})]})]})})})}var kP=memo(BP);var va={ORDER:{label:"order",icon:vi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:xi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:yi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:wi,color:"#32ADE6"}},Pa={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled$1("img")(()=>({width:"35px",height:"16px",display:"block"}));styled$1("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled$1("img")(()=>({maxWidth:"100%",width:"100%"}));var Ea=styled$1("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Ma=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function _P({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n}){let r=zc(useId(),"agreement-icon"),i=useTheme$1(),{t:a}=useTranslation(),s=useMemo(()=>[...t?[Pa.SAVED_TOKEN]:[],...(o||0)>0?[Pa.COUNT]:[],...e&&va[e]?[va[e]]:[]],[t,o,e]),l=m=>n?jsx(a$k,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a("totalPaymentCount",{amount:f$4(o)}),children:jsx(Ma,{children:jsxs(Ea,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:Pa.COUNT.color},children:["x",o]})})})},m):jsx(a$q,{value:o,index:m},m),p$1=s.map((m,c)=>m.label==="countBadge"?l(c):jsx(p,{title:a(m.label),children:jsx(a$k,{children:n?jsx(Ma,{children:jsx(Ea,{"data-testid":"AgreementCell_agreementType",sx:{color:m.color},children:a(m.label)})}):jsx(d$1,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:m.icon,alt:"agreement"})},m.color)},m.color)),d=jsx(p,{title:"No agreement",children:jsx(a$k,{children:n?jsx(Ma,{children:jsx(Ea,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(d$1,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ci,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:r,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:p$1?.length>0?p$1:d})}var Kx=_P;var $P=Kx;styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));var qx=styled$1("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),Xx=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled$1("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var Zx=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var Wp={"3DS":{tooltip:"3DS",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Pj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:$g,borderColor:"rgba(31, 136, 208, 0.10)"}},Jx={FAILED:{tooltip:"Failed",icon:Tg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:ah,borderColor:"rgba(255, 61, 0, 0.10)"}};function GP({transactionStatus:e,eci:t,authType:o,isTextShown:n}){let r=zc(useId(),"auth-icons"),i=useMemo(()=>{let s=e?Jx[e]:null,l=s?.tooltip,p=e==="AUTHENTICATED"?null:s?.icon;return [{tooltip:l,content:n?l:p,type:n?"text":"icon"},...o?[{tooltip:o,content:n?Wp[o]?.tooltip:Wp[o]?.icon,type:n?"text":"icon"}]:[],{tooltip:"",content:t?`ECI ${t}`:"",type:"text"}]},[e,n,o,t]),a=useMemo(()=>i.filter(s=>!!s.content).map((s,l)=>{let p$1=s.type==="text"?jsx(Xx,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(qx,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":s.content,children:s.content})}):jsx(d$1,{sx:{width:"16px",height:"16px"},src:s.content,alt:s.tooltip});return jsx(p,{title:s.tooltip,children:p$1},`${s.tooltip}-${l}`)}),[i]);return jsx(Zx,{id:r,"data-testid":"AuthIcons",children:a})}var eC=GP;var YP=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...e>0&&{opacity:0}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t,...e>0&&{opacity:1}}});var KP=eC;var hr={VOID:{icon:fk},CAPTURED:{icon:ek}};var Aa=styled(motion.div)(({theme:e,isCapture:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5),paddingInline:e.spacing(.3),paddingBlock:e.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:t?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),Da=styled("div")(({theme:e,percentage:t,isCapture:o})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} ${o?e.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:o?e.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),Ra=styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`})),La=styled("img")({width:"14px",height:"14px"}),mn=styled(o)({width:"16px",height:"16px"}),ho=styled("img")({width:"16px",height:"16px"}),tC=styled(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function Ba(e){return e<5?5:e===100?95:e}function tE({voidPercentage:e,capturePercentage:t,captureCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:s,remainingAmount:l,isSheetViewShown:p$1,selectionProps:d={}}){let m=Number(t)+Number(e)===100||l<=0,c=zc(useId(),"capture-auto-icon"),u=useTheme(),{t:f}=useTranslation(),x=Ha(l||0),C=useCallback(b=>`Auto ${b} - ${a} ${x.integerAmount}.${x.decimalAmount}`,[a,x.decimalAmount,x.integerAmount]),S=useCallback(b=>{let y=b==="Capture"?r:i,{integerAmount:T,decimalAmount:v}=Ia$1(y,a);return `Partial ${b} - ${a} ${T}.${v}`},[r,i,a]),g=t>0?jsx(p,{title:S("Capture"),children:jsxs(Aa,{isCapture:true,isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:u.shadows[4]}},children:[jsx(La,{src:tb$1,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(Da,{isCapture:true,percentage:t,children:[t,"% ",jsx(Ra,{isCapture:true,percentage:Ba(t)})]}),o>1&&jsxs(z$1,{compact:true,color:"dark",children:[o,"x"]})]})]})}):n==="CAPTURED"&&!m?jsx(p,{title:C("Capture"),children:jsx(mn,{children:jsx(ho,{src:hr.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:C("Capture"),children:jsx(mn,{children:jsx(ho,{src:hr.CAPTURED?.icon,alt:"auto"})})}),h=t===100?jsx(p,{title:f("captured"),children:jsx(tC,{children:jsx(ho,{src:hk$1,alt:"captured"})})}):g,w=useMemo(()=>p$1&&h?jsx(b$1,{copyTrigger:"press",copyText:f("captured"),children:f("captured")}):s&&h?jsx(k,{children:f("captured")}):h,[s,h,p$1,f]);return w&&jsx("div",{id:c,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:w})}var nC=tE;function sE({voidPercentage:e,capturePercentage:t,voidCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:s,isSheetViewShown:l,selectionProps:p$1={},remainingAmount:d}){let m=Number(t)+Number(e)===100||d<=0,c=zc(useId(),"void-auto-icon"),u=useTheme(),{t:f}=useTranslation(),x=Ha(d||0),C=useCallback(b=>`Auto ${b} - ${a} ${x.integerAmount}.${x.decimalAmount}`,[a,x.decimalAmount,x.integerAmount]),S=useCallback(b=>{let y=b==="Capture"?r:i,{integerAmount:T,decimalAmount:v}=Ia$1(y,a);return `Partial ${b} - ${a} ${T}.${v}`},[r,i,a]),g=e>0||i?jsx(p,{title:S("Void"),children:jsxs(Aa,{isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:u.palette.common.white,border:`0.75px solid ${u.palette.grey[600]}1A`},variants:{animate:{boxShadow:u.shadows[4]}},children:[jsx(La,{src:yk,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(Da,{percentage:e,children:[e,"% ",jsx(Ra,{percentage:Ba(e)})]}),o>0&&jsxs(z$1,{compact:true,color:"neutral",children:[o,"x"]})]})]})}):n==="VOID"&&!m?jsx(p,{title:C("Void"),children:jsx(mn,{children:jsx(ho,{src:hr.VOID?.icon,alt:"auto"})})}):null,h=e===100?jsx(p,{title:f("void"),children:jsx(mn,{children:jsx(ho,{src:yk,alt:"void"})})}):g,w=useMemo(()=>l&&h?jsx(b$1,{copyTrigger:"press",copyText:f("void"),children:f("void")}):s&&h?jsx(l$2,{children:f("void")}):h,[s,h,l,f]);return w?jsx("div",{id:c,"data-testid":"VoidAutoIcon",style:{...!l&&{zIndex:11}},children:w}):null}var iC=sE;var lE=nC;var cE=({authorizedStatus:e,isTextShown:t,iconStyles:o,tableMode:n,chipIndex:r=0,selectionProps:i={}})=>{let{t:a}=useTranslation(),s=useTheme(),l=a(Gt(e));return Wa(n)?jsx(b$1,{copyTrigger:"press",copyText:l,children:l}):jsx(p,{title:l,children:t?jsx(j,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:s.palette.info.dark},children:l}):jsx(d$1,{src:f$3[e],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:o})})};var aC=styled(motion.span)(({theme:e})=>({color:e.palette.common.white,display:"block",fontWeight:e.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:e.spacing(.45)})),sC=styled(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Hp=styled("img")(()=>({width:"10px",height:"10px"})),Op=styled(motion.span)(({theme:e})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),_p=styled(motion.div,{shouldForwardProp:e=>e!=="isVisible"})(({isVisible:e})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!e&&{padding:"0 !important"}})),lC=styled(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),pC=styled(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),mC={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},dC={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},cC={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},uC={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},zp={fadeIn:{duration:.3},animate:{duration:.1}},fC={fadeIn:{opacity:1}},gC=styled(j)(()=>({width:"88px",height:"100%"})),$p=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.25),height:"100%"}));function yt({chargeStatus:e,gatewayTooltip:t,acquirerTooltip:o$1,chargeTooltip:n,errorCode:r,isTextShown:i,gatewayCode:a,acquirerCode:s,unCapturedStyles:l,iconStyles:p$2,iconWrapperStyles:d,gatewayIconWrapperStyles:m,gatewayContainerStyles:c,gateWayIconStyles:u,showBadge:f=true,isSheetViewShown:x=false,selectionProps:C={},chipIndex:S=0}){let g$1=e?b$7[e]:null,h=e?g[e]:null,w=useTheme(),{t:b}=useTranslation(),y=zc(useId(),"charge-status-icon"),T=n&&jsx(Fragment,{children:jsx("div",{children:n})}),v=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:o$1})]}),M=t&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:t})]}),D=e&&a$l[e]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:g$1?"50%":"",...d},children:jsx(p$1,{src:a$l[e],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:g$1?"50%":"",width:"16px",height:"16px",...p$2}})});return x?jsxs($p,{children:[jsxs(b$1,{copyTrigger:"press",copyText:b(Gt(e)),children:[b(Gt(e))," ",r]}),g$1&&jsxs(Fragment,{children:[a&&jsxs(b$1,{copyTrigger:"press",copyText:"Gateway",children:["Gateway ",a]}),s&&jsxs(b$1,{copyTrigger:"press",copyText:"Acquirer",children:["Acquirer ",s]})]})]}):i?jsxs($p,{children:[jsx(p,{title:T,children:jsxs(gC,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":Gt(e),sx:{background:g$1?.background||h?.background||"transparent",color:g$1?.color||h?.color||w.palette.info.dark,borderColor:`${g$1?.color||h?.color||w.palette.info.dark}1A`},children:[b(Gt(e))," ",r]})}),g$1&&jsxs(Fragment,{children:[a&&jsx(p,{title:M,children:jsxs(j,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":Gt(e),sx:{background:g$1?.background||h?.background||"transparent",color:g$1?.color||h?.color||w.palette.info.dark},children:["Gateway ",a]})}),s&&jsx(p,{title:v,children:jsxs(j,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":Gt(e),sx:{background:g$1?.background||h?.background||"transparent",color:g$1?.color||h?.color||w.palette.info.dark},children:["Acquirer ",s]})})]})]}):jsx(o,{id:y,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...d},children:Kn?.includes(e||"")&&(T||v||M)?jsxs(pC,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...f&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...l},children:[jsx(lC,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:g$1?.background}},children:jsx(p,{title:T??b(Gt(e)),children:jsxs(Fragment,{children:[D,jsx(sC,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:uC,style:{...r&&{padding:"0 !important"}},children:jsx(aC,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:g$1?.color},transition:mC,variants:fC,initial:{opacity:0},children:r})})]})})}),jsx(_p,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:zp,variants:dC,style:c,isVisible:!!M,children:M&&jsx(p,{title:M,children:jsx(Op,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:g$1?.background,...m},children:jsx(Hp,{src:g$1?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:u})})})}),jsx(_p,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:zp,variants:cC,style:c,isVisible:!!v,children:v&&jsx(p,{title:v,children:jsx(Op,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:g$1?.background,...m},children:jsx(Hp,{src:g$1?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:u})})})})]}):jsx(p,{title:T??b(Gt(e)),children:jsx(o,{children:D})})})}var yE=()=>{let{t:e}=useTranslation(),t=zc(useId(),"customer-initiated-icon");return jsx(p,{title:e("merchantInitiated"),children:jsx("img",{id:t,"data-testid":"merchantInitiatedIcon",src:ub$1,alt:"merchant",style:{width:"16px",height:"16px"}})})};var IE={G:"Global",R:"Regional",L:"Local"},yo=({geographyVariant:e,countryCode:t,isTextShown:o})=>{let n=e?IE[e]:void 0,r=n||t?`${n||""} ${n&&t?"-":""} ${t?`Country - ${t}`:""}`:void 0;return o||!t?null:jsx(p,{title:r,children:jsx(a$6,{countryCode:t})})};var SE=({geographyVariant:e,isTextShown:t,deviceCountry:o,deviceType:n,tableMode:r})=>{let i=zc(useId(),"device-icon-chip");return jsxs(Un,{id:i,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Wa(r)&&{height:"18px"}},children:[jsx(yo,{geographyVariant:e,isTextShown:t,countryCode:o}),jsx(c$4,{type:n,isTextShown:t,tableMode:r})]})};var PE=({isDisputeOpen:e,iconStyles:t})=>{let o=zc(useId(),"dispute-icon");return jsx(p$1,{id:o,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:e?va$1:ua,alt:"dispute-icon",style:t})};var IC=styled(Un,{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",gap:e.spacing(.5),...Wa(t)&&{height:"18px"},alignItems:"center"})),bC=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function Gp({countryCode:e,isTextShown:t,cardNumber:o,bankName:n,tableMode:r}){let i=zc(useId(),"issuer-icon"),a=o?.slice(0,4),s=o?.slice(-4);return jsxs(IC,{id:i,"data-testid":"IssuerIcon",tableMode:r,children:[e&&jsx(yo,{countryCode:e,isTextShown:t}),jsx(p,{title:`${n?`Issuer - ${n}`:""}`,children:jsx(bC,{children:`${a||""} ${s||""}`})})]})}var RE=Gp;styled$1(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:e.palette.text.primary}));var Yp=styled$1("img")(()=>({height:"13.125px",width:"12px"})),Va=styled$1("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),TC=styled$1("div")(({theme:e})=>({color:e.palette.common.white,background:e.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),SC=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var FE=({payoutStatus:e="PENDING",isTextShown:t,payoutTooltip:o,iconStyles:n,isSheetViewShown:r,chipIndex:i=0,selectionProps:a={}})=>{let{t:s}=useTranslation(),l=zc(useId(),"payout-icon"),p$2=s(Gt(e)),d=o||p$2;return r?jsx(b$1,{copyTrigger:"press",copyText:p$2,children:p$2}):jsx(p,{title:d,children:t?jsx(Va,{id:l,"data-testid":"StatusCell_PayoutStatusLabel",children:p$2}):jsx(p$1,{id:l,src:e$1[e],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:n})})};var _E=({isTextShown:e,refundStatus:t="PENDING",refundTooltip:o="",refundCount:n,iconStyles:r,isSheetViewShown:i,chipIndex:a=0,selectionProps:s={}})=>{let{t:l}=useTranslation(),p$2=useTheme(),d=zc(useId(),"refund-icon"),m=(n||0)>1,c=l(Gt(t));if(i)return jsxs(b$1,{copyTrigger:"press",copyText:c,children:[c," ",m?`${n}x`:null]});let u=jsxs(Nx,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[n,"x"]});return e?jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:jsx(Va,{id:d,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d$5[t].color,backgroundColor:d$5[t].backgroundColor,width:"90px"},children:jsxs(Lp,{whileInView:m?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:p$2.shadows[4],gap:p$2.spacing(.5)}},children:[c," ",m?u:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:m?jsxs(Lp,{id:d,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:p$2.shadows[4],gap:p$2.spacing(.5)}},children:[jsx(kx,{src:qk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),u]}):jsx(p$1,{id:d,src:c$5[t],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:r})})},wC=_E;var zE=wC;var $E={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},Ie=e=>$E[e?.toLowerCase()||""]||e;styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var vC=styled$1("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));var PC=styled$1("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),EC=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled$1("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var MC=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function mt({source:e,isTextShown:t,title:o,width:n,height:r,imgSx:i}){let{t:a}=useTranslation(),s=h$2(e);return jsx(p,{title:o,children:t?jsx(EC,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(PC,{"data-testid":"SourceCell_TextLabel","data-source":e,children:a(Gt(e))})}):jsx(vC,{src:s,alt:e,width:n,height:r,onError:l=>{l.currentTarget.src=h$2("card");},sx:i})})}function ZE({payment:e,card:t,isTextShown:o,firstIcon:n}){let r=zc(useId(),"source-icons"),{t:i}=useTranslation(),a=useCallback(()=>{let p=[],d=cc(e),m=e?.method,c=e?.scheme;return Ie(m)?.toLowerCase()===Ie(c)?.toLowerCase()?p.push(Ie(m),Ie(d)):p.push(Ie(m),Ie(d),Ie(c)),p},[e]),s=useMemo(()=>jsx(mt,{source:n,isTextShown:o,title:i(Gt(n))},n),[n,o,i]),l=useMemo(()=>a()?.filter(p=>!!p&&p!==n)?.map((p,d,m)=>{let c=e?.wallet===i("sv_wallet")?i("storedValueWallet"):i("passThruWallet"),u=d===m.length-1&&t?.last_four?`${i(Gt(p))} - ${t?.last_four}`:i(Gt(p));return jsx(mt,{source:p,isTextShown:o,title:d===0&&p==="Wallet"?c:u},`${p}-${d}`)}),[a,e,t,o,i,n]);return jsxs(Box,{id:r,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[n&&s,l,t?.last_four&&jsxs(MC,{children:["\xB7\xB7\xB7 ",t?.last_four]})]})}var Ir={PROCESSED:Sg,FAILED:""};var LC=styled$1("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),BC=styled$1("img")(()=>({width:"16px",height:"16px"})),kC=styled$1("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function _a({status:e,isTextShown:t,isSheetViewShown:o}){let n=useTheme$1(),{t:r}=useTranslation(),i=zc(useId(),"destination-icon"),a=r(Gt(e));return o&&Ir[e]?jsx(b$1,{copyTrigger:"press",copyText:a,children:a}):t&&Ir[e]?jsx(LC,{id:i,"data-testid":"ChargeStatusIcon_isTextShown","data-status":Gt(e),sx:{background:"#1F88D00D",color:e==="PROCESSED"?n.palette.info.dark:n.palette.common.black},children:a}):jsx(kC,{id:i,"data-testid":"DestinationIcon",className:"destination-status",children:e&&Ir[e]&&jsx(p,{title:r(Gt(e)),children:jsx(BC,{src:Ir[e],alt:"destination-icon"})})})}function o1({deviceType:e,geographyVariant:t,isTextShown:o,deviceCountry:n,...r}){return jsx(a,{...r,children:jsxs(Un,{sx:{display:"flex",gap:"8px",alignItems:"center"},children:[jsx(yo,{geographyVariant:t,isTextShown:o,countryCode:n}),jsx(c$4,{type:e,isTextShown:o})]})})}var n1=o1;var NC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),position:"relative",minWidth:"23px",height:"24px"})),FC=styled$1("span")(({theme:e})=>({fontSize:e.typography.pxToRem(12),color:e.palette.info.dark,fontWeight:700,paddingInline:e.spacing(1),borderRadius:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.info.dark}1A`})),VC=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`,paddingInline:e.spacing(1),borderRadius:"56px",height:"24px"}));styled$1("img")(({theme:e,order:t})=>({borderRadius:"50%",backgroundColor:e.palette.common.white,width:"16px",height:"16px",padding:"2px",zIndex:t+1,position:"absolute",left:`${t*9}px`}));var WC=styled$1("img")(({pointLeft:e})=>({width:"12.5px",height:"13px",transform:`scale(${e?"-1":"1"}, 1)`}));styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",backgroundColor:e.palette.common.white,borderRadius:"50%",width:"16px",height:"16px",fontSize:"8px",fontWeight:e.typography.fontWeightBold,lineHeight:"11px",position:"absolute",left:"18px",zIndex:4,textAlign:"center",span:{flexGrow:1}}));function s1({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let s=useMemo(()=>{if(typeof e=="number")return e;let d=Number(e);return Number.isNaN(d)?void 0:d},[e]),l=s!==void 0?s>0:!!e,p$1=s!==void 0&&s>1;return !l||r?null:jsx(Un,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsxs(VC,{children:[jsx(WC,{src:z$2,pointLeft:i==="left"}),p$1&&jsx(NC,{children:jsx(FC,{children:e})})]})})})}var l1=s1;function d1(e){let{destination:t,...o}=e,n={...o};delete n.destinationsCount,delete n.destinationsTooltip,delete n.destinationsAmount,delete n.hidden,delete n.iconDirection,delete n.selectionProps,delete n.flagIcon;let r=t?.destination||[];return jsx(Un,{sx:{display:"flex",gap:"4px",alignItems:"center"},...n,children:r.map((i,a)=>{let s=Ha(i?.amount||0),l=`${s.integerAmount}.${s.decimalAmount}`;return jsxs(b$1,{copyTrigger:"press",copyText:l,children:[i?.id," | ",jsx(a$j,{currency:i?.currency})," ",l]},i?.id||a)})})}var c1=d1;function g1({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let s=o?.destination||[],l=Ha(n||0),p$1=Ha(s?.[0]?.amount||0);return !e||r?null:jsx(Un,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsx(j,{sx:{textAlign:"left",justifyContent:"flex-start",height:"auto"},children:e&&typeof e=="number"&&e>1?jsxs("div",{children:["Destination ",s?.[0]?.id," - ",jsx(a$j,{currency:s?.[0]?.currency})," ",p$1.integerAmount,".",p$1.decimalAmount," +",e-1]}):jsxs("div",{children:["Destination ",s?.[0]?.id," - ",jsx(a$j,{currency:s?.[0]?.currency})," ",l.integerAmount,".",l.decimalAmount]})})})})}var x1=g1;var P8=({destination:e,amount:t})=>{let o=e?.destination||[];return o?.length>1?jsxs("div",{children:[jsx("div",{children:"Destination"}),e?.destination?.map(r=>{let i=Ha(r.amount||0);return jsxs("div",{children:[r?.id," - ",jsx(a$j,{currency:r?.currency})," ",i.integerAmount,".",i.decimalAmount]},r?.id)})]}):jsxs("div",{children:["Destination ",o?.[0]?.id," - ",jsx(a$j,{currency:o?.[0]?.currency})," ",t.integerAmount,".",t.decimalAmount]})};var _C=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",minWidth:"24px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,zIndex:10,position:"absolute"})),zC=styled$1("div")(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function $C(e){return e<5?5:e===100?95:e}function b1({percentage:e=0,days:t,remainingAmount:o=0,currency:n,...r}){let i=useTheme(),a$1=jsx(a$j,{currency:n}),{integerAmount:s,decimalAmount:l}=Ia$1(o,n),p$1=`${s}.${l}`,d=useMemo(()=>jsxs(Fragment,{children:["Remaining Authorized Balance - ",a$1," ",p$1]}),[o,n]);return e===0||o<0?null:jsx(a,{...r,children:jsx(p,{title:d,placement:"top",children:jsx("div",{style:{height:24},children:jsxs(_C,{whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:22},variants:{animate:{...!!t&&{boxShadow:i.shadows[4]}}},children:[jsxs(zC,{percentage:e,children:[e,"% ",jsx(q,{percentage:$C(e)})]}),!!t&&jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px",width:0},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs("span",{children:[t," days left"]})})]})})})})}var T1=b1;function w1({remainingAmount:e,currency:t}){let o=jsx(a$j,{currency:t}),{integerAmount:n,decimalAmount:r}=Ia$1(e,t),i=`${n}.${r}`;return jsxs(b$1,{copyTrigger:"press",copyText:`${n}.${r}`,children:[o," ",i]})}var v1=w1;var em=["authenticationMode","paymentAuth","paymentAgreement"],tm=["paymentIssuer","paymentInitiated","paymentDevice"],UC=["paymentMethod","paymentType","paymentScheme","paymentCardNumber",...tm,...em];var KC=styled(Un)(()=>({marginRight:"8px",display:"flex",alignItems:"center",gap:"4px"})),jC=styled(Un)(()=>({marginLeft:"8px",width:20}));function D1(e){let{centerIcon:t,centerIconId:o}=useMemo(()=>{for(let a of UC)if(e?.[a])return {centerIcon:e?.[a],centerIconId:a};return {centerIcon:null,centerIconId:null}},[e]);if(!o)return null;let n=o!=="paymentScheme"&&e.paymentScheme,r=o!=="paymentCardNumber"&&e.paymentCardNumber,i=o!=="paymentType"&&e.paymentType;return jsx(a$5,{expandedZIndex:0,centerIcon:t,leftIcons:tm.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),rightIcons:em.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),expandableCenterRight:(n||r)&&jsxs(KC,{children:[n&&e.paymentScheme,r&&e.paymentCardNumber]}),expandableCenterLeft:i&&jsx(jC,{children:e.paymentType})})}var R1=memo(D1);var XC=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function Tz({card:e,paymentMethod:t,paymentType:o,paymentScheme:n}){let{t:r}=useTranslation();if(!e.last_four)return null;let i=e?.name||`${r(Gt(dc(t,n)?o:n))} - ${e?.last_four}`;return jsx(p,{title:i,children:jsxs(XC,{children:["\xB7\xB7\xB7 ",e?.last_four]})})}function Mz({method:e}){let{t}=useTranslation();return e?jsx(mt,{source:Ie(e)??e,title:`Payment Method - ${t(Gt(e))}`}):null}function kz({type:e}){let{t}=useTranslation();return e?jsx(mt,{source:Ie(e)??e??"",title:`Payment Type - ${t(Gt(e))}`}):null}function Oz({scheme:e}){let{t}=useTranslation();return e?jsx(mt,{source:Ie(e)??e,title:`Payment Scheme - ${t(Gt(e))}`}):null}var JC=({mode:e})=>e?jsx(p,{title:_o[e],children:jsx(Un,{component:"img",src:e==="C"?da:ca})}):null;var $a={ORDER:{label:"order",icon:vi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:xi,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:yi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:wi,color:"#32ADE6"}},Ua={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled$1("img")(()=>({width:"35px",height:"16px",display:"block"}));styled$1("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled$1("img")(()=>({maxWidth:"100%",width:"100%"}));var Ga=styled$1("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Ya=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),QC=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),eh=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),om=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Ka=(e,t)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}});function Q1({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n,...r}){let i=useTheme(),{t:a$1}=useTranslation(),s=useMemo(()=>[...t?[Ua.SAVED_TOKEN]:[],...(o||0)>0?[Ua.COUNT]:[],...e&&$a[e]?[$a[e]]:[]],[t,o,e]),l=c=>n?jsx(a$k,{"data-testid":"AgreementCell_countBadge",order:c,variants:Ka(c,n?85:0),children:jsx(p,{title:a$1("totalPaymentCount",{amount:f$4(o)}),children:jsx(Ya,{children:jsxs(Ga,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:Ua.COUNT.color},children:["x",o]})})})},c):jsx(a$q,{value:o,index:c},c),p$1=s.map((c,u)=>c.label==="countBadge"?l(u):jsx(p,{title:a$1(c.label),children:jsx(a$k,{order:u,variants:Ka(u,u>1&&n?62:0),sx:{width:n?"auto":"36px"},children:n?jsx(Ya,{children:jsx(Ga,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a$1(c.label)})}):jsx(om,{src:c.icon,alt:"agreement"})},c.color)},c.color)),d=p$1.length,m=jsx(p,{title:"No agreement",children:jsx(a$k,{order:0,variants:Ka(0,0),sx:{width:n?"auto":"36px"},children:n?jsx(Ya,{children:jsx(Ga,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(om,{src:Ci,alt:"no-agreement"})},"no-agreement")},"no-agreement");return jsx(a,{...r,children:jsx(eh,{"data-testid":"AgreementCell",children:jsx(QC,{layout:true,className:"payment-sources-container","data-testid":"AgreementCell_PaymentSourcesContainer",whileHover:"animate",animate:"start",sourcesCount:d||0,variants:{animate:{width:(d||0)*38}},children:p$1?.length>0?p$1:m})})})}var eM=Q1;var oh=styled("img")(()=>({width:"12.67px",height:"15px"}));styled("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));function oM({hasAuth:e,tooltip:t,isTextShown:o,align:n,...r}){return jsx(a,{style:{textAlign:n||"center",overflow:"visible",display:"flex",width:"100%",justifyContent:n==="left"?"flex-start":"center"},...r,children:e?jsx(p,{title:t,children:jsx(d,{"data-testid":"AuthCell_BadgeWrapper",children:o?jsx(j,{"data-testid":"AuthCell_TextLabel",sx:{minWidth:"max-content"},children:t}):jsx(oh,{src:na,alt:"icon","data-testid":"AuthCell_AuthIcon"})})}):null})}var nM=oM;var nh={REFUNDED:ok,PAID_OUT:nk,SETTLED:qk,PENDING:pk,UNKNOWN:xk$1,TIMEDOUT:vk$1,CANCELLED:gk,FAILED:kk,DECLINED:ik,RESTRICTED:sk,IN_PROGRESS:Ak,ACCEPTED:rk},rh={REFUNDED:"refunded"};function ih({status:e,refundTooltip:t}){let{t:o$1}=useTranslation();return jsx(p,{title:jsxs("div",{children:[jsx("div",{children:o$1(Gt(e))}),t]}),children:jsx(o,{children:jsx("img",{src:nh[e],alt:"refund-requested"})})})}function sh({status:e,gatewayTooltip:t,unCapturedTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,refundTooltip:s}){let{t:l}=useTranslation();return Kn?.includes(e??"")?jsx(yt,{chargeStatus:e,gatewayTooltip:t,chargeTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,iconWrapperStyles:{height:17}}):jsx(ih,{status:e,refundTooltip:s})}var lh=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.625),paddingBlock:e.spacing(.625),height:"24px",minWidth:"24px",backgroundColor:"#ede8fb",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),ph=styled("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0})),mh=styled(pr)(({theme:e})=>({fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var dh=styled("img")({width:"14px",height:"14px"}),ch=styled(Un)(({theme:e})=>({position:"relative",zIndex:25,border:`1px solid ${e.palette.divider}`,height:24,borderRadius:"12px",padding:"3px 4px","> div":{paddingTop:0,paddingBottom:0,height:16}}));function nm({status:e,refundIcon:t,refundTooltip:o,refundTooltipLabel:n,date:r,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:s,errorCode:l,acquirerCode:p$1,gatewayCode:d,timezone:m}){let c=useTheme(),{t:u}=useTranslation(),f=t$1(new Date(Number(r)),{currentTimezone:jo,targetTimezone:m?.offset}),x=useMemo(()=>t||(e==="REFUNDED"?ok:qk),[e,t]);return ["REFUNDED","PAID_OUT"].includes(e??"")?jsx(p,{title:jsxs("div",{children:[jsx("div",{children:n??u(rh.REFUNDED)}),o]}),children:jsxs(lh,{whileHover:["animate","fadeIn"],animate:"start",variants:{...r&&{animate:{boxShadow:c.shadows[4]}}},sx:{...!r&&{backgroundColor:"transparent"}},children:[jsx(dh,{sx:{...!r&&{width:"16px",height:"16px"}},src:x,alt:"refunded"}),jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:r&&jsx(ph,{children:jsx(mh,{value:f})})})]})}):jsx(sh,{status:e,refundTooltip:o,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:s,errorCode:l,acquirerCode:p$1,gatewayCode:d})}var fh=()=>{let e=useTheme();return {REFUNDED:{color:e.palette.common.lightPurple,backgroundColor:`${e.palette.common.lightPurple}1A`},PENDING:{color:e.palette.custom[500],backgroundColor:`${e.palette.custom[500]}0d`},PAID_OUT:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},SETTLED:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},UNKNOWN:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},TIMEDOUT:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},FAILED:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},DECLINED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},RESTRICTED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},IN_PROGRESS:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`},CANCELLED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},ACCEPTED:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`}}};function hM({status:e,date:t,refundTooltip:o,isTextShown:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a$1,acquirerCode:s,gatewayCode:l,unCapturedTooltip:p$1,timezone:d,refundTooltipLabel:m,refundIcon:c,...u}){let{t:f}=useTranslation(),x=fh(),C=useCallback(g=>vc(g).format("MMM D, YYYY"),[]),S=Kn.includes(e);return jsx(a,{...u,style:{overflow:"visible"},children:jsx(n$1,{children:jsx(ch,{width:n?"auto":"36px",sx:{...S&&{border:"none"}},children:n?jsx(p,{title:t?C(t):f(Gt(e)),children:jsx(j,{sx:{...x[e]?x[e]:x.PENDING},children:f(Gt(e))})}):jsx(nm,{status:e,refundTooltip:o,date:t,gatewayTooltip:r,unCapturedTooltip:p$1,acquirerTooltip:i,errorCode:a$1,acquirerCode:s,gatewayCode:l,timezone:d,refundTooltipLabel:m,refundIcon:c})})})})}var yM=hM;var xh=styled$1("img")(()=>({width:"16px",height:"16px"})),Ch=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),hh=styled$1("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.info.dark}1a`})),yh=styled$1("span")(({theme:e})=>({color:e.palette.info.dark,fontSize:"14px",lineHeight:"16.8px"}));function IM({walletId:e,country:t,showCountry:o=true,...n}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(Ch,{children:[o&&t&&jsx(p,{title:La$1(t),children:jsx(a$6,{countryCode:t})}),jsxs(hh,{children:[jsx(xh,{src:ac$1,alt:"wallet-icon"}),e&&jsxs(yh,{children:["\xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var bM=IM;var Ih=styled$1("img")(()=>({width:"16px",height:"16px"})),bh=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),Th=styled$1("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.common.white}`,border:`1px solid ${e.palette.divider}`})),Sh=styled$1("span")(({theme:e})=>({color:`${e.palette.text.primary}`,fontSize:"14px",lineHeight:"16.8px"}));styled$1("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function TM({walletId:e,country:t,name:o,...n}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(bh,{children:[t&&jsx(p,{title:La$1(t),children:jsx(a$6,{countryCode:t})}),jsxs(Th,{children:[jsx(Ih,{src:bc,alt:"bank-icon"}),e&&jsxs(Sh,{children:[o," \xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var SM=TM;var am={PAID_OUT:nk,SETTLED:tk,PENDING:Oh,INITIATED:Oh,FAILED:kk};function EM({payoutStatus:e="PAID_OUT",...t}){let{t:o$1}=useTranslation(),n=useTheme();return jsx(a,{...t,children:jsx(n$1,{children:jsx(o,{className:"payout-status",style:{visibility:"visible",width:"36px",borderRadius:"23.1px",backgroundColor:n.palette.common.white,border:`1.029px solid ${n.palette.divider}`},children:e&&am[e]&&jsx(p,{title:o$1(Gt(e)),children:jsx(p$1,{src:am[e],alt:"settled-icon",style:{width:"16px",height:"16px",objectFit:"contain"}})})})})})}var MM=EM;styled(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"}));styled(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"}));styled(motion.span)(({theme:e})=>({color:e.palette.common.white,display:"block",fontWeight:e.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:e.spacing(.45)}));styled("img")(()=>({width:"13px",height:"13px"}));styled(motion.span)(({theme:e})=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"}));styled(motion.div)(()=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0}));styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"}));var AM=styled("span")(({theme:e})=>({textDecorationLine:"underline",color:e.palette.info.dark}));var sm=a$l;function LM({status:e,chargeStatus:t,isTextShown:o,...n}){let{t:r}=useTranslation();return jsx(a,{...n,children:jsxs(n$1,{children:[jsx(_a,{status:e,isTextShown:o}),t&&sm[t]&&jsx(p,{title:r(Gt(t)),children:jsx(p$1,{src:sm[t],alt:"charge-icon"})})]})})}var BM=LM;var NM={FAILED:dh$1,PENDING:kh,INITIATED:$g,ATTEMPTED:_g,EXEMPTED:ch$1,EXEMPTED_WITH_TRANSACTION:ch$1,EXEMPTED_WITHOUT_TRANSACTION:bh$1,REJECTED:ah,UNAVAILABLE:fh$1,UNDETERMINED:gh,SUCCESS:jh$1,AUTHENTICATED:ih$1,AUTHENTICATED_WITH_TRANSACTION:ih$1,AUTHENTICATED_WITHOUT_TRANSACTION:ih$1,AUTHENTICATED_AUTHORIZE_FAILED:dh$1},lm={FAILED:lh$1,PENDING:mh$1,INITIATED:nh$1,ATTEMPTED:oh$1,EXEMPTED:ph$1,EXEMPTED_WITH_TRANSACTION:ph$1,EXEMPTED_WITHOUT_TRANSACTION:qh,REJECTED:rh$1,UNAVAILABLE:sh$1,UNDETERMINED:th,SUCCESS:uh,AUTHENTICATED:vh$1,AUTHENTICATED_WITH_TRANSACTION:vh$1,AUTHENTICATED_WITHOUT_TRANSACTION:wh$1,AUTHENTICATED_AUTHORIZE_FAILED:lh$1},So=a$l;function WM({status:e,authorizedStatus:t,chargeStatus:o,chargeTooltip:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a$1,...s}){let{t:l}=useTranslation(),p$1=useTheme(),d=[e&&lm[e]?jsx(p,{title:l(Gt(e)),children:jsx("img",{src:lm[e],alt:"authentication-icon",style:{width:"36px",height:"24px",objectFit:"scale-down"}})}):null,o&&So[o]?jsx(p,{title:l(Gt(o)),children:jsx(yt,{showAuthorizedStatus:true,chargeStatus:o,gatewayTooltip:r,chargeTooltip:n,acquirerTooltip:i,errorCode:a$1})}):null,t&&f$3[t]?jsx(p,{title:l(Gt(t)),children:jsx("img",{src:f$3[t],alt:"authorized-icon",style:{width:"36px",height:"20px",objectFit:"scale-down"}})}):null].filter(Boolean),m=d.length||0;return jsx(a,{...s,sx:{position:"relative",overflow:"visible"},children:jsx(rn,{whileHover:"animate",animate:"start",statusesCount:m,children:d.map((c,u)=>c?jsx(nn,{order:u,variants:tn(u,p$1.shadows[4],40),children:jsx(on,{children:c})},u):null)})})}var HM=WM;var mm={issuer:Xh$1,scheme:Yh$1,device:Vh$1,app:Uh$1,wallet:Th$1,biometric:Vh$1};function zM({type:e,...t}){let{t:o$1}=useTranslation();return jsx(a,{...t,children:jsx(n$1,{children:jsx(o,{className:"authentication-status",children:e&&mm[e]&&jsx(p,{title:o$1(Gt(e)),children:jsx(p$1,{src:mm[e],alt:"authentication-type"})})})})})}var $M=zM;var wh={SMS:$d$1,EMAIL:Xd,WHATSAPP:ae};var vh=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ph=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Eh=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),Mh=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Ah=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),Dh=(e,t)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}});function KM({channels:e,isTextShown:t,...o}){let{t:n}=useTranslation(),r=useTheme(),i={WHATSAPP:r.palette.custom[700],EMAIL:r.palette.custom[800],SMS:r.palette.custom[900]},s=e?.sort(p=>p==="EMAIL"?-1:p==="SMS"?1:p==="WHATSAPP"?2:0)?.filter(p=>!!p)?.map((p$1,d)=>{if(!p$1)return null;let m=n(p$1?.toLowerCase());return jsx(b$8,{order:d,variants:Dh(d,t?74:0),sx:{width:t?"70px":"36px"},children:jsx(p,{title:m,placement:"top",wrapperProps:{sx:{width:"100%",height:"100%",justifyContent:"center"}},children:t?jsx(Ah,{children:jsx(Mh,{sx:{color:i[p$1]},children:m})}):jsx(Ph,{src:wh[p$1],alt:p$1})})},`${p$1}-${d}`)}),l=s?.length||0;return jsx(a,{...o,children:jsx(vh,{children:s?.length>0?jsx(Eh,{layout:true,className:"payment-sources-container",whileHover:"animate",animate:"start",sourcesCount:l||0,variants:{animate:{width:(l||0)*38}},style:{zIndex:29},children:s}):null})})}var jM=KM;function Dr(e){return x(e,{sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"})}styled$1(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"80px",fontSize:"10px",color:e.palette.text.primary}));styled$1("img")(()=>({width:"16px",height:"16px"}));styled$1("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));styled$1("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));var Rh=styled$1(j$1)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:"#000",cursor:"default"}));function XM({dueDate:e,expiryDate:t,...o}){let n=useMemo(()=>({label:Dr(vc(e).valueOf()),tooltip:"Due Date"}),[e]),r=useMemo(()=>({label:Dr(vc(t).valueOf()),tooltip:"Expiry Date"}),[t]),i=l=>jsx(p,{title:l.tooltip,children:jsx(Rh,{children:l.label})}),a$1=useMemo(()=>e?i(n):t?i(r):null,[n,r,e,t]),s=useMemo(()=>t&&e?[i(r)]:[],[n,r,e,t]);return !e&&!t?null:jsx(a,{...o,sx:{position:"relative",overflow:"visible"},children:jsx(a$5,{sx:{justifyContent:"flex-start"},centerIcon:a$1,rightIcons:s})})}var ZM=XM;var Bh=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),height:"34px",minWidth:"24px",borderRadius:"8px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10,border:"1px solid transparent","&:hover":{backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`}}));styled$1("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled$1("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var dm=styled$1("img")({width:"24px",height:"24px"});function eA({products:e,...t}){let o=Cc("product"),n=e?.map((i,a)=>jsx(dm,{sx:{...i?.toLowerCase()===An$1.tokens.code?.toLowerCase()&&{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.10)"}},className:"app-logo",src:Cn.find(s=>s.code?.toLowerCase()===i?.toLowerCase())?.iconUrl,alt:"product-icon"},o(i,a))),r=jsxs(Bh,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:"10px 0px 8px 0px #F2F2F2"}},children:[jsx(dm,{src:si,alt:"products-icon"}),jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:n})]});return jsx(a,{...t,style:{overflow:"visible"},children:jsx(n$1,{children:jsx("div",{style:{width:"30px",position:"relative",zIndex:24},children:r})})})}var tA=eA;function ts(e){return jsx(m,{...e,children:jsx(p,{title:e.tooltip||e.children,children:e.children})})}var Vh=styled(Un)(()=>({display:"flex",alignItems:"center",gap:"8px"})),Wh=styled(Un)(({theme:e})=>({fontSize:"14px",color:e.palette.text.primary,lineHeight:"16.8px"}));function LG({currency:e}){return jsxs(Vh,{children:[jsx(a$6,{currencyCode:e}),jsx(Wh,{children:e})]})}vc.extend(aA);vc.extend(iA);function _h({value:e,...t}){let o=useMemo(()=>x(e,{sameDay:"[Today]",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM D, YYYY",lastWeek:"MMM D, YYYY",nextWeek:"MMM D, YYYY"}),[e]);return jsx(a,{...t,children:o})}var zh=styled(Un)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:36,height:24,border:`1px solid ${e.palette.divider}`,borderRadius:"24px","&:hover":{boxShadow:e.shadows[4]}}));function JG({reference:e}){return e?jsx(p,{title:`Bank - ${e}`,children:jsx(zh,{children:jsx(Un,{component:"img",src:ob$2,alt:"bank",width:14})})}):jsx(Fragment,{})}var cm={acquirer:ob$2,generic:pb$1,payment:Zd$1,gateway:rn$1,order:Yd};var $h=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Uh=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Gh=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({sourcesCount:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${e*6+36}px `,minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),Yh=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Kh=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));styled$1("div")(()=>({height:"18px"}));var jh=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});var xA=120,CA=50;function hA({isTextShown:e,getTooltipTitle:t,...o}){let[n,r]=useState(false),[i,a$1]=useState(null),s=useRef(null),l=useRef(false),p$1=useRef(false),d=useRef(null),m=useTheme(),c=useMemo(()=>Object.keys(cm).filter(b=>!!o[b]),[o]),u=()=>{d.current&&(clearTimeout(d.current),d.current=null);},f=()=>{a$1(s.current);},x=()=>{l.current=true,p$1.current=false,r(true),a$1(null),u(),d.current=setTimeout(()=>{p$1.current=true,f();},xA);};useEffect(()=>()=>u(),[]);let C=()=>{l.current||x();},S=()=>{u(),s.current=null,l.current=false,p$1.current=false,a$1(null),r(false);},g=b=>{if(s.current=b,p$1.current){u(),a$1(b);return}l.current||x();},h=()=>{s.current=null,p$1.current&&(u(),d.current=setTimeout(f,CA));},w=c.length;return jsx(a,{...o,children:jsx($h,{children:w>0?jsx(Gh,{layout:true,className:"reference-sources-container",whileHover:"animate",onHoverStart:C,onHoverEnd:S,animate:n?"animate":"start",sourcesCount:w,variants:{animate:{width:w*38}},style:{zIndex:29},children:c.map((b,y)=>{let T=t?.(b)||`${Xh(b)} - ${o[b]}`,v=i===b;return jsx(b$8,{order:y,variants:jh(y,m.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},onMouseEnter:()=>g(b),onMouseLeave:h,children:jsx(p,{open:v,disableHoverListener:true,disableInteractive:true,title:v?T:"",children:e?jsx(Kh,{children:jsx(Yh,{children:Xh(b)})}):jsx(Uh,{src:cm[b],alt:b,sx:{...b==="order"&&{width:"11.82px"}}})})},`${b}-${y}`)})}):null})})}var yA=hA;var um={Y:{tooltip:"Authenticated",icon:ih$1,borderColor:"rgba(31, 136, 208, 0.10)"},N:{tooltip:"Failed Authentication",icon:Tg,borderColor:"rgba(240, 130, 0, 0.10)"},R:{tooltip:"Failed Authentication",icon:Tg,borderColor:"rgba(240, 130, 0, 0.10)"},A:{tooltip:"Attempted",icon:_g,borderColor:"rgba(31, 136, 208, 0.10)"},U:{tooltip:"Failed Authentication",icon:Tg,borderColor:"rgba(240, 130, 0, 0.10)"},noAuth:{tooltip:"Not Authenticated",icon:$g,borderColor:"#F2F2F2"}},fm={"3DS":{tooltip:"3DS",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Pj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"}};styled$1("img")(()=>({width:"12.67px",height:"15px"}));var Jh=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Qh=styled$1("img")({width:"16px",height:"16px"});styled$1("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"10px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.primary,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));var ey=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),ty=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...e>0&&{opacity:0}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t,...e>0&&{opacity:1}}}),oy=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}));function bA({transactionStatus:e,isTextShown:t,eci:o,authType:n,...r}){let i=useTheme$1(),a$1=useMemo(()=>{let p=um[e??"noAuth"]??um.noAuth,d=p?.tooltip,m=p?.icon;return [{tooltip:d,content:t?d:m,type:t?"text":"icon"},...n?[{tooltip:n,content:t?fm[n]?.tooltip:fm[n]?.icon,type:t?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[e,o,t]),s=useMemo(()=>a$1.filter(p=>!!p.content).map((p$1,d)=>{let m=p$1.type==="text"?jsx(oy,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(j,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":p$1.content,children:p$1.content})}):jsx(Qh,{src:p$1.content,alt:p$1.tooltip});return jsx(p,{title:p$1.tooltip,children:jsx(b$8,{order:-1*d,variants:ty(d,i.shadows[4],t?124:39),sx:{...p$1.type==="text"&&{width:t?"120px":"58px"}},children:m})},`${p$1.tooltip}-${d}`)}),[r,a$1,t,i]),l=s.length;return jsx(a,{...r,children:jsx(Jh,{children:l>0?jsx(ey,{layout:true,className:"authentication-sources-container",whileHover:"animate",animate:"start",sourcesCount:l,variants:{animate:{width:38}},style:{zIndex:29},children:s}):null})})}var TA=bA;var gm={checkout:Ch$1,checkoutSuccess:Dh$1};function vA({status:e,...t}){let{t:o}=useTranslation();return jsx(a,{...t,sx:{overflow:"visible"},children:jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:e&&gm[e]&&jsx(p,{title:o(Gt(e)),children:jsx(p$1,{src:gm[e],alt:"checkout-icon"})})})})}var PA=vA;var xm={TRANSACTED:Ih$1,INITIATED:Gh$1,CANCELLED:Hh,EXPIRED:Fh};function iy({status:e,chargeStatus:t,...o}){let{t:n}=useTranslation();return jsx(a,{...o,sx:{overflow:"visible"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:[e&&xm[e]&&jsx(p,{title:n(Gt(e)),children:jsx(p$1,{src:xm[e],alt:"intents-icon"})}),t&&So[t]&&jsx(p,{title:n(Gt(t)),children:jsx(yt,{chargeStatus:t})})]})})}var sy=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",fontSize:"10px",color:e.palette.text.primary,zIndex:24,overflow:"visible",position:"absolute",gap:"0px"})),ly=styled$1(motion.div)(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(.5),minWidth:"44px"}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function py(e){return e<5?5:e===100?95:e}var is={PAID_OUT:{color:"#2ACE00",backgroundColor:"#2ACE000D"},PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},SETTLED:{color:"#2ACE00",backgroundColor:""}};function RA({percentage:e,date:t,payoutStatus:o$1,payoutTooltip:n,chargeTooltip:r,refundCount:i,isTextShown:a$1,...s}){let{t:l}=useTranslation(),p$2=useTheme();return e===0?null:jsx(a,{...s,style:{overflow:"visible",position:"relative"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:[jsx(p,{title:r,children:jsxs(sy,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{gap:"4px"}},sx:{...a$1&&{height:"auto",padding:"0",backgroundColor:"transparent"}},children:[jsx(ly,{percentage:e,sx:{backgroundColor:"#eeeeee",...a$1&&{backgroundColor:"transparent",border:"none"}},variants:{...!a$1&&{animate:{boxShadow:p$2.shadows[4]}}},children:a$1?jsxs(j,{children:[e,"%"]}):jsxs(Fragment,{children:[e," % ",jsx(q,{percentage:py(e)})]})}),i>1&&jsx(motion.div,{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:jsx(motion.div,{style:{alignItems:"center",justifyContent:"center",gap:"4px",position:"relative",zIndex:22,overflow:"visible"},initial:{width:0,opacity:0,paddingRight:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",paddingRight:"4px",boxShadow:p$2.shadows[4]},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z$1,{compact:true,color:"neutral",children:[i,"x"]})})})]})}),jsx(o,{className:"payout-status",style:{visibility:o$1==="PENDING"?"hidden":"visible",position:"relative",left:"57px",width:a$1?"auto":"24px"},children:o$1&&e$1[o$1]&&jsx(p,{title:n||l(Gt(o$1)),children:a$1?jsx(j,{sx:{color:is[o$1].color,border:`1px solid ${is[o$1].color}1a`,backgroundColor:is[o$1].backgroundColor},children:l(Gt(o$1))}):jsx(p$1,{src:e$1[o$1],alt:"settled-icon"})})})]})})}var LA=RA;var cy={DELETED:_if,DRAFT:jf,CREATED:kf,CANCELLED:Aa$2,CANCELED:Aa$2,EXPIRED:Ba$1,PAID:nf,REFUNDED:tf,DELIVERED:of,VIEWED:pf,SAVED:qf,SCHEDULED:rf,PENDING:sf,REMINDED:""};function uy(e){switch(e){case "CANCELLED":case "DELETED":return {color:"#FF3D00",background:"#FFF5F2"};case "VIEWED":return {color:"#1F88D0",background:"#e1edf8"};case "REFUNDED":return {color:"#4E1FD0",background:"#ede8fb"};case "PAID":return {color:"#2ACE00",background:"#EAFAE5"};case "EXPIRED":return {color:"#FF7A00",background:"#FFF2E5"};case void 0:return {color:"#FF7A00",background:"transparent"};default:return {color:"#818181",background:"#F2F2F2"}}}function fy({chargeStatus:e,chargeTooltip:t,errorCode:o,iconStyles:n,iconWrapperStyles:r}){let{t:i}=useTranslation(),a=e?b$7[e]:null,s=e&&a$l[e]&&jsx(SC,{style:r,children:jsx(p$1,{src:a$l[e],alt:"charge-icon",style:{width:"16px",height:"16px",...n}})}),l=t&&jsx(Fragment,{children:jsx("div",{children:t})});return e?jsx(p,{title:l??i(Gt(e)),children:jsxs(Un,{sx:{display:"flex",gap:"6px",alignItems:"center"},children:[s,!!Kn?.includes(e||"")&&jsx(TC,{style:{background:a?.color},children:o})]})}):null}function gy({status:e,date:t,viewsCount:o,chargeStatus:n,errorCode:r,chargeTooltip:i,remindedCount:a$1=0,...s}){let{t:l}=useTranslation(),p$1=useTheme(),d=e?cy[e]:null,m=uy(e),c=`${l(e?.toLowerCase()||"")} ${Dr(vc(t).valueOf())}`,u=useMemo(()=>jsx(fy,{chargeStatus:n,errorCode:r,chargeTooltip:i}),[n,r,i]),f=useMemo(()=>jsx(p,{title:l("reminded"),children:jsxs(Un,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[jsx(Yp,{sx:{width:"14px",height:"14px"},src:je,alt:"icon"}),jsx(z$1,{style:{background:p$1.palette.error.main,fontWeight:600,color:p$1.palette.common.white},children:a$1})]})}),[a$1]),x=useMemo(()=>{if(d)return jsx(p,{title:l(c||""),children:jsx(Yp,{src:d,alt:"status icon"})});if(n&&So[n])return u;if(a$1)return f},[d,n,a$1]);return !e&&!n&&!a$1?null:jsx(a,{...s,sx:{position:"relative",overflow:"visible"},children:jsx(a$5,{sx:{justifyContent:"flex-start"},expandableCenterRight:o&&e==="VIEWED"&&d?[jsx(z$1,{style:{marginRight:"8px",color:"#fff",backgroundColor:m.color},children:o})]:void 0,centerIcon:x,leftIcons:a$1&&d?[f]:void 0,rightIcons:n&&So[n]&&d?[u]:void 0})})}function UA({tooltip:e,children:t,badge:o,...n}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...n,children:t?jsx(p,{title:e,children:jsx(d,{"data-testid":"BadgeCell_BadgeWrapper",children:jsxs(j,{"data-testid":"BadgeCell_TextLabel",sx:{minWidth:"max-content",gap:"0.5rem"},children:[t,(o||0)>1&&jsxs(z$1,{color:"dark",style:{fontWeight:"bold"},children:["+",o]})]})})}):null})}var GA=UA;var Im={ACTIVE:gi,EXPIRED:fi,PENDING:gi,SAVED:di$1,TRANSACTED:ei,CONSUMED:ei};var YA=(c=>(c.ABANDONED="ABANDONED",c.IN_PROGRESS="IN_PROGRESS",c.VOID="VOID",c.CANCELLED="CANCELLED",c.CAPTURED="CAPTURED",c.INITIATED="INITIATED",c.FAILED="FAILED",c.DECLINED="DECLINED",c.RESTRICTED="RESTRICTED",c.TIMEDOUT="TIMEDOUT",c.UNKNOWN="UNKNOWN",c.AUTHORIZED="AUTHORIZED",c))(YA||{});function jA({status:e,chargeTooltip:t,gatewayTooltip:o,acquirerTooltip:n,errorCode:r,cardId:i,hasChargeIcon:a$1,hasAuthorizedIcon:s,...l}){let{t:p$2}=useTranslation();return jsx(a,{...l,sx:{position:"relative",overflow:"visible"},children:jsxs(n$1,{sx:{gap:"0.5rem"},children:[e&&Im[e]&&jsx(p,{title:p$2(Gt(e)),children:jsx(p$1,{src:Im[e],alt:"token-icon"})}),i&&jsx(p,{title:p$2(Gt(e)),children:jsx(p$1,{src:hi,alt:"card-icon"})}),a$1&&jsx(p,{title:p$2(Gt("CAPTURED")),children:jsx(yt,{showAuthorizedStatus:true,chargeStatus:"CAPTURED",gatewayTooltip:o,chargeTooltip:t,acquirerTooltip:n,errorCode:r})}),s&&jsx(p,{title:p$2(Gt("AUTHORIZED")),children:jsx(p$1,{src:f$3.AUTHORIZED,alt:"authorized-icon"})})]})})}var qA=jA;var Tm=styled$1("img")(()=>({maxWidth:"13px",maxHeight:"13px"})),Cy=styled$1("div")(({theme:e})=>({width:"24px",height:"24px",border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"})),hy=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));function ZA({brandName:e,brandIcon:t,...o}){return jsx(a,{style:{textAlign:"center",overflow:"visible"},...o,children:jsxs(hy,{children:[jsx(Cy,{children:t?jsx(p,{title:e,children:jsx(Tm,{src:t,alt:"brand icon",onError:r=>{r.currentTarget.src=zi;}})}):jsx(Tm,{src:zi,alt:"brand icon"})}),jsx("span",{children:e})]})})}var JA=ZA;function Iy({metadata:e}){let t=Object.keys(e)[0]??"",o=Object.keys(e)[1]??"",n=Object.keys(e)[2]??"",r=Object.keys(e)[3]??"",i=Object.keys(e)[4]??"",a=t||o||n||r||i?`${e[t]?`${e[t]}${e[o]||e[n]||e[r]||e[i]?",":""}`:""}${e[o]?`${e[o]}${e[n]||e[r]||e[i]?",":""}`:""}${e[n]?`${e[n]}${e[r]||e[i]?",":""}`:""}${e[r]?`${e[r]}${e[i]?",":""}`:""}${e[i]??""}`:"";return a?jsx(p,{title:a,children:jsx(Box,{component:"img",src:_j,alt:"meta",sx:{cursor:"pointer"}})}):null}var Ty=styled("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:"36px",cursor:"pointer"})),Sy=styled(motion.img)(()=>({width:"16px",height:"16px"}));var nD=({onClick:e,isSettlementsAvailable:t,isDownloadError:o,isDownloadLoading:n,isDownloadSuccess:r})=>{let i=useMemo(()=>n||r||o,[n,r,o]),a=useMemo(()=>r?ic:o?hc:Yj,[r,o]);return jsx(p,{title:t?"":"Pending",children:jsx(Ty,{onClick:()=>t&&!i&&e(),children:jsx(AnimatePresence,{mode:"wait",initial:false,children:n?jsx(a$m,{},"spinner"):jsx(Sy,{src:t?a:Zj,alt:"Download Report"})})})})};var iD=({receiptId:e})=>jsx(TableCell,{component:"div",children:jsx(p,{title:`Receipt - ${e}`,children:jsx(j,{sx:{padding:"3px 8px",maxWidth:"50px"},children:jsx("img",{src:pc,alt:"receipt"})})})});var aD=({receiptId:e})=>jsx(m,{children:jsx("span",{children:e})});var sD=({receiptId:e})=>jsx(ts,{children:jsx("span",{children:e})});var Ey=styled$1("div",{shouldForwardProp:e=>!["licenseNumber","hasClick"].includes(e)})(({theme:e,licenseNumber:t,hasClick:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:o?"pointer":"default",...t&&{padding:"3.5px 8px"}})),My=styled$1(Un)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"}));styled$1("img")(()=>({width:"16px",height:"11.73px"}));var Ay=styled$1("div",{shouldForwardProp:e=>!["licenseNumber"].includes(e)})(({theme:e,licenseNumber:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:"0",width:"74px",...!t&&{color:"#B1B1B1",width:"84px"}})),Dy=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),Ry=styled$1("div")({marginLeft:"auto",width:"auto"});var Ly={incomplete:Gj,complete:Fj,reviewed:Fj,verified:Hj};function By({entity:e,country:t,verificationStatus:o,licenseNumber:n,hideStatus:r,...i}){let a$1=Ly[o??"incomplete"];return jsx(a,{...i,sx:{cursor:i?.onClick?"pointer":"default"},children:jsx(p,{title:e,children:jsx(Ey,{hasClick:!!i?.onClick,licenseNumber:n,children:jsxs(My,{children:[jsx(p,{title:t?La$1(t):"",children:jsx(a$6,{countryCode:t})}),jsx(Ay,{licenseNumber:n,children:n||"Not Available"}),!r&&jsx(Ry,{children:jsx(Dy,{src:a$1})})]})})})})}var ky=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ny=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"}));styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));var Fy=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*40,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});function Wy({acceptance:e,payout:t,hideAcceptance:o,hidePayout:n,closed:r,...i}){let a$1=e?.toLowerCase()==="enabled",s=t?.toLowerCase()==="enabled",l=r?.toLowerCase()==="closed",[p$1,d]=useState(false),m=useTheme(),c=useMemo(()=>[{icon:a$1?tc:Di,tooltip:"Acceptance",enabled:a$1,shown:!o,zIndex:a$1&&!s?3:1},{icon:s?uc:Hi,tooltip:"Payout",enabled:s,shown:!n,zIndex:2},{icon:ai$1,tooltip:"Closed",enabled:l,shown:l,zIndex:3}].filter(x=>x.shown),[a$1,s,o,n,l]),u=useMemo(()=>c.map((x,C)=>{let S=x.tooltip;return jsx(b$8,{order:C,variants:Fy(C,m.shadows[4],40),sx:{width:"36px",zIndex:x.zIndex+6},children:jsx(p,{onOpen:()=>{d(true);},onClose:()=>{d(false);},title:S,children:jsx(a$n,{mainIcon:x.icon,mainIconSize:16,containerSize:16,sx:{borderRadius:"40px"},onError:g=>{g.currentTarget.src=x.icon,g.currentTarget.style.borderRadius="0px";},borderColor:"transparent"})})},`${x.tooltip}-${C}`)}),[c,m]),f=c?.length||0;return jsx(a,{...i,children:jsx(ky,{children:f>0?jsx(Ny,{layout:true,className:"reference-sources-container",whileHover:"animate",animate:p$1?"animate":"start",sourcesCount:f,variants:{animate:{width:f*38}},style:{zIndex:29},children:u}):null})})}var Fr={technology:Kk,institution:Jk,payment:Zd$1,developmentHouse:Lk,platform:yd$1};var Hy=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Oy=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),_y=styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),zy=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),$y=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*40,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});var Uy=e=>{let t="";switch(e.type){case "technology":case "institution":t="Payment";break;default:t="";break}return `${t} ${gb$1(e.type)} - ${e.name}`};function hD({isTextShown:e,segments:t,...o}){let[n,r]=useState(false),i=useTheme(),a$1=useMemo(()=>t?.filter(l=>!!l.name).map((l,p$1)=>{let d=l.type?.toLowerCase?.().includes("platform"),m=l.tooltip||Uy(l),c=l.type,u=d?Fr.platform:Fr[c];return jsx(b$8,{order:p$1,variants:$y(p$1,i.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},children:jsx(p,{onOpen:()=>{r(true);},onClose:()=>{r(false);},title:m,children:e?jsx(zy,{children:jsx(_y,{children:Xh(l.name)})}):jsx(a$n,{mainIcon:l.icon||u,mainIconSize:16,containerSize:16,sx:{...l.icon?{borderRadius:"40px"}:{borderRadius:"0px"}},onError:f=>{Fr[c]&&(f.currentTarget.src=Fr[c],f.currentTarget.style.borderRadius="0px");},borderColor:"transparent"})})},`${l.name}-${p$1}`)}),[t,e,i]),s=a$1?.length||0;return jsx(a,{...o,children:jsx(Hy,{children:s>0?jsx(Oy,{layout:true,className:"reference-sources-container",whileHover:"animate",animate:n?"animate":"start",sourcesCount:s,variants:{animate:{width:s*38}},style:{zIndex:29},children:a$1}):null})})}var yD=hD;function Yy({marketPlaceIcon:e,marketPlaceName:t,...o}){return jsx(a,{...o,children:jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:t&&jsxs(Fragment,{children:[jsx(Box,{sx:{width:"24px",height:"24px",border:"1px solid #F2F2F2",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e??jsx("img",{src:Rb$1,alt:"marketplace",style:{maxWidth:"18px",maxHeight:"18px",objectFit:"cover"}})}),jsx(Typography,{noWrap:true,sx:{fontSize:"14px",fontWeight:400},children:t})]})})})}var Ky={incomplete:Gj,complete:Fj,reviewed:Fj,verified:Hj};var jy=styled$1("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1.029px solid #F2F2F2",borderRadius:"44px",padding:"4px 8px",lineHeight:"120%"})),qy=styled$1("div")(({theme:e})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"84px"})),Xy=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),Zy=styled$1("span")(({theme:e})=>({fontSize:"9.5px",fontWeight:400,color:e.palette.common.white,backgroundColor:e.palette.grey[700],borderRadius:"4px",padding:"1px 2px"})),Jy=styled$1("div")({width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"}),Qy=styled$1("div")({display:"flex",alignItems:"center",gap:"8px"}),eI=styled$1("div")({fontWeight:400,fontSize:14,lineHeight:"120%",letterSpacing:0,color:"#B1B1B1",textAlign:"center",width:"100%"});function tI({id:e,status:t,count:o,name:n,...r}){let i=Ky[t??"incomplete"];return jsx(a,{...r,sx:{cursor:"pointer"},children:jsx(p,{title:n,children:jsx(jy,{children:e?jsxs(Jy,{children:[jsx(qy,{children:e}),jsxs(Qy,{children:[jsx(Xy,{src:i}),o>1&&jsx("div",{children:jsxs(Zy,{children:["+",o-1]})})]})]}):jsx(eI,{children:"Not Available"})})})})}var oI=styled$1("div",{shouldForwardProp:e=>!["hasClick"].includes(e)})(({theme:e,hasClick:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:t?"pointer":"default"})),nI=styled$1(Un)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"})),rI=styled$1("p",{shouldForwardProp:e=>!["brandName"].includes(e)})(({theme:e,brandName:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"74px",margin:"0",...!t&&{color:"#B1B1B1",width:"84px"}})),iI=styled$1("img")(()=>({width:"10.5px",height:"10.5px"})),aI=styled$1("div")({marginLeft:"auto",width:"auto"});var sI={incomplete:Gj,complete:Fj,reviewed:Fj,verified:Hj};function lI({brand:e,verificationStatus:t,hideStatus:o,brandLogo:n,...r}){let i=sI[t??"incomplete"];return jsx(a,{...r,children:jsx(p,{title:e.name,children:jsx(oI,{hasClick:!!r.onClick,children:jsxs(nI,{children:[n,jsx(rI,{brandName:e.name,children:e.name||"Not Available"}),!o&&jsx(aI,{children:jsx(iI,{src:i})})]})})})})}var pI=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),mI=styled$1("img")(()=>({maxWidth:"36px",maxHeight:"16px"})),dI=styled$1(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));styled$1("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"}));styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));var cI=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},...o&&{boxShadow:"7px 0px 8px 0px #F2F2F2"}}}),uI=styled$1(Box)(()=>({display:"flex",gap:"4px",maxWidth:"440px",justifyContent:"space-between",height:"18px"}));var ED=e=>!e.startsWith("http://")&&!e.startsWith("https://"),ms=e=>/^https?:\/\//i.test(e),fI=(e,t)=>{switch(t){case "website":return e;case "physical_store":case "call_center":return null;case "linkedin":case "instagram":case "twitter":case "social_media":return MD(e,t);case "ios":case "android":case "mobile_app":return AD(e,t);default:return e}},MD=(e,t)=>{let o=e.toLowerCase();return t==="linkedin"?o.includes("linkedin.com")||o.includes("linked.com")?e:ms(e)?null:`https://linkedin.com/company/${e}`:t==="instagram"?o.includes("instagram.com")?e:ms(e)?null:`https://instagram.com/${e}`:t==="twitter"?o.includes("twitter.com")||o.includes("x.com")?e:ms(e)?null:`https://x.com/${e}`:null},AD=(e,t)=>e.toLowerCase().includes("apps.apple.com")&&t==="ios"?e:t==="android"?ms(e)?e:`https://play.google.com/store/apps/details?id=${e}`:null,gI=e=>{!e||typeof e!="string"||window.open(ED(e)?`https://${e}`:e,"_blank","noopener,noreferrer");};function DD({channels:e,...t}){let o=e?.filter(r=>!!r.address)?.map((r,i)=>{let a=r.address,s=r.code?.replace(/_/g,""),l=i===e?.length-1,p$1=fI(r.address??"",r.code??"");return jsx(p,{title:a,children:jsx(b$8,{order:i,variants:cI(i,0,l),sx:{width:"36px",cursor:p$1?"pointer":"default"},onClick:()=>{r?.address&&gI(p$1);},children:jsx(mI,{src:r.logo,alt:s})})},`${r}-${i}`)}),n=o?.length||0;return jsx(a,{...t,children:jsx(pI,{children:o?.length>0?jsx(dI,{layout:true,className:"sales-channels-container",whileHover:"animate",animate:"start",sourcesCount:n||0,variants:{animate:{width:(n||0)*38}},style:{zIndex:29},children:o}):null})})}var RD=DD;function FD({channels:e}){let t=useRef(null),[o,n]=useState(false),[r,i]=useState(null),a=!!r;useEffect(()=>{t.current&&n(t.current.scrollHeight>20);},[e]);let s=useMemo(()=>(e||[]).filter(l=>!!l.address),[e]);return jsxs(uI,{children:[jsx(Un,{sx:{display:"flex",flexWrap:"wrap",gap:o?"8px":"4px"},ref:t,children:s.map(l=>jsxs(b$1,{copyTrigger:"press",copyText:l.address,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px","& div":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px"}},children:[l.name?.en,": ",l.address]},l.id))}),o&&jsx(Un,{onClick:l=>{i(l.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(ND,{open:a,anchorEl:r,sx:{minWidth:r?.clientWidth},onClose:()=>{i(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:r?.clientWidth,marginTop:"22px"}}},children:jsx(Un,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:s.map(l=>jsxs(b$1,{copyTrigger:"press",copyText:l.address,children:[l.name?.en,": ",l.address]},l.id))})})]})}var VD=FD;var Pm={active:uf,completed:vf,closed:wf,expired:xf,ready:yf,registered:vf};var CI=styled$1("span")(({theme:e})=>({width:"36px",height:"24px",borderRadius:"24px",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:`1px solid ${e.palette.divider}`}));function hI({status:e,...t}){let{t:o}=useTranslation();return jsx(a,{...t,children:e&&Pm[e]&&jsx(p,{title:o(_D(Gt(e))),children:jsx(CI,{children:jsx(a$n,{mainIcon:Pm[e],mainIconSize:16,containerSize:16,borderColor:"transparent"})})})})}var yI={SAVED_CARD:"Card Agreement",ORDER:"Order",SUBSCRIPTION:"Subscription",INSTALLMENT:"Installment"};function UD({type:e,count:t,sx:o,...n}){let{t:r}=useTranslation(),i=t?.toString();return jsxs(Un,{sx:{display:"flex",flexDirection:"row",gap:"4px"},children:[jsx(b$1,{copyTrigger:"press",copyText:e,unknownText:r("noPaymentAgreement"),sx:o,...n,children:e&&yI[e]}),i&&jsx(b$1,{copyTrigger:"press",copyText:i,sx:{minWidth:"38px"},...n,children:i})]})}var GD=UD;var bI={CYBERSOURCE:pm,MPGS:qm$1,NETCETERA:rm,APPLEPAY:sm$1,TAP3DS:tm$1,FSS:zm$1,BENEFIT:vm,QPAY:Hm$1,POSTPAY:Gm$1,BENEFITPAY:um$1,MEEZA:Bm$1,STC_PAY:Jm$1,NGENIUS:Cm,KNET:Am$1,PAYPAL:Fm$1,FAWRY:ym,TPG:Nm,DEEMA:xm$1,TPAY:Mm,"CAREEM PAY":wm,TABBY:Km$1,OMANNET:Em,NPG:Dm$1,SPG:Im$1,TAMARA:Lm};var SI=styled$1(Un)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"24px",gap:"8px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper})),wI=styled$1("img")(()=>({width:"100%",height:"100%",objectFit:"contain"}));function vI({provider:e,...t}){let o=bI[e];return o?jsx(SI,{children:jsx(wI,{src:o,alt:e})}):jsx(a,{...t,children:jsx(j,{children:e})})}var PI={CHARGE:Vk,AUTHORIZE:zk$1,SAVE_TOKEN:Yg},EI={CHARGE:"Charge",AUTHORIZE:"Authorization",SAVE_TOKEN:"Save Token"},MI={CHARGE:{backgroundColor:"#1F88D01A",color:"#1F88D0",border:"none"},AUTHORIZE:{backgroundColor:"#FFFFFF",color:"#1F88D0",border:"#1F88D01A"},SAVE_TOKEN:{backgroundColor:"#1F88D00D",color:"#1F88D0",border:"#1F88D01A"}};var AI=styled$1(Un,{shouldForwardProp:e=>!["purposeType"].includes(e)})(({purposeType:e})=>{let t=MI[e];return {display:"flex",alignItems:"center",justifyContent:"start",gap:"4px",minWidth:"86px",width:"100%",height:"24px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${t.border}`,backgroundColor:t.backgroundColor,color:t.color,fontSize:"12px",fontWeight:400}}),DI=styled$1("img")(()=>({width:"16px",height:"16px",objectFit:"contain",flexShrink:0})),RI=styled$1("span")(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));function BI({purpose:e,...t}){let o=PI[e],n=EI[e];return jsxs(AI,{purposeType:e,...t,children:[jsx(DI,{src:o,alt:e}),jsx(RI,{children:n})]})}var NI=8,XD=16,Jt=NI*2+XD,FI=100,VI=6,ZD=Jt+VI+FI,WI=styled(a)(()=>({position:"relative",overflow:"visible",width:Jt,minWidth:Jt,maxWidth:Jt,display:"inline-flex",padding:0})),HI=styled(Un)(()=>({position:"relative",width:Jt,height:24,flexShrink:0,overflow:"visible"})),OI=styled(Un,{shouldForwardProp:e=>e!=="hasLabel"})(({theme:e,hasLabel:t})=>({position:"absolute",top:0,left:0,width:Jt,minWidth:Jt,maxWidth:Jt,height:24,display:"inline-flex",alignItems:"center",gap:VI,paddingInline:NI,borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper,boxSizing:"border-box",cursor:"pointer",overflow:"hidden",transition:e.transitions.create(["max-width","box-shadow"]),"& img":{flexShrink:0},...t&&{"&:hover":{width:"max-content",maxWidth:ZD,zIndex:100,boxShadow:"0px 0px 16px 0px #00000021","& .link-cell-label":{maxWidth:FI,opacity:1}}}})),_I=styled("span")(({theme:e})=>({display:"inline-block",maxWidth:0,opacity:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:12,lineHeight:"16px",color:e.palette.text.primary,transition:e.transitions.create(["max-width","opacity"],{duration:e.transitions.duration.shorter})}));function QD({url:e,label:t}){let o=n(),n$1=()=>{try{bb$1(e),o.success("Copied!");}catch{o.error("Failed to copy");}};return e?jsx(WI,{children:jsx(HI,{children:jsxs(OI,{hasLabel:!!t,onClick:n$1,children:[jsx(d$1,{src:Jl,alt:"link"}),t&&jsx(_I,{className:"link-cell-label",children:t})]})})}):null}var eR=memo(QD);function iQ({items:e}){let[t,o]=useState(null),n=!!t,r=useCallback(({quantity:s,currency:l,amount:p,name:d})=>`${s?`Qty ${s}`:""} ${d?`- ${d}`:""} ${l||p?"-":""} ${l||""} ${p||""}`,[]);if(!e||!e.length)return null;let[i,...a]=e;return jsxs(Un,{sx:{display:"flex",gap:"4px",alignItems:"center"},children:[jsx(b$1,{children:jsx(j$1,{noWrap:true,sx:{maxWidth:e.length>1?190:220,fontSize:11},children:r(i)})}),e.length>1&&jsx(Un,{onClick:s=>{o(s.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(ND,{open:n,anchorEl:t,sx:{minWidth:t?.clientWidth},onClose:()=>{o(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:t?.clientWidth,marginTop:"22px"}}},children:jsx(Un,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:a?.map(s=>jsx(b$1,{copyTrigger:"press",copyText:r(s),children:r(s)},s.id))})})]})}var zI="ListHeader";var $I=styled$1(Box)(({theme:e})=>({backgroundColor:e.palette.background.default,paddingInline:e.spacing(4),paddingBottom:e.spacing(2),paddingTop:e.spacing(2),overflowX:"clip"})),UI=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%",marginBottom:e.spacing(2.25),marginTop:e.spacing(2)})),GI=styled$1(j$1)(({theme:e})=>({fontSize:"1.75rem",fontWeight:e.v2.typography.fontWeightMedium,lineHeight:"120%"})),YI=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%"})),KI=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)})),jI=styled$1(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"8px",flexShrink:0}));function gs({children:e,component:t="header",...o}){return jsx($I,{component:t,...o,children:e})}function xs({title:e,toolbar:t}){return jsxs(UI,{children:[jsx("span",{children:!!e&&jsx(GI,{children:e})}),t]})}function Cs({status:e,activeFilter:t,beforeStatus:o}){let n=t?.visible??false;return jsxs(KI,{as:"aside",children:[o,jsx(a$h,{status:e?.value,availableStatuses:e?.options,onStatusChange:e?.onChange,isActiveFilterVisible:n,buttonSx:e?.buttonSx}),jsx(a$i,{ids:t?.ids,visible:n,label:t?.label,dismissible:t?.dismissible,onDismiss:t?.onDismiss})]})}var En=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:"4px",background:e.palette.common.white,padding:"8px",border:"1px solid",borderColor:e.palette.divider,gap:8,height:32,cursor:"pointer","&:hover":{border:"1px solid",borderColor:e.palette.info.dark,boxShadow:e.shadows[7]}})),hs=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,display:"flex",gap:e.spacing(1),alignItems:"center",color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,textTransform:"capitalize",position:"relative",transition:"0.5s",paddingRight:0,marginRight:0,"&:after":{content:'""',position:"absolute",left:-8,right:0,width:"100%",height:"100%",boxShadow:e.shadows[11],borderRadius:e.spacing(.5),paddingInlineStart:e.spacing(1),paddingTop:"9px",paddingBottom:"9px",paddingInlineEnd:"9px",zIndex:-1},"& > *:last-child":{marginRight:0,paddingRight:"6px"}})),Mn=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,borderRadius:e.spacing(1),boxShadow:e.shadows[5],border:"1px solid",borderColor:e.palette.divider,zIndex:5,fontSize:"11px",width:192})),An=styled$1(Box)(()=>({minWidth:160,position:"relative",marginRight:0,paddingRight:0})),Dn=styled$1(Box,{shouldForwardProp:e=>e!=="addColumnViewEl"})(({theme:e})=>({padding:e.spacing(1),paddingInlineEnd:2,borderBottom:"1px solid",borderColor:e.palette.divider,display:"flex",alignItems:"center",height:32,cursor:"pointer",img:{height:12},".check-icon":{height:"auto",marginInlineEnd:e.spacing(1)},"&:hover":{color:e.palette.info.dark,fontWeight:e.typography.fontWeightBold},"&.add-column":{justifyContent:"space-between",paddingInlineEnd:e.spacing(1),position:"relative",border:"none",zIndex:5,borderBottom:"1px solid",borderColor:e.palette.divider,borderTopRightRadius:e.spacing(1),borderTopLeftRadius:e.spacing(1),"&:hover":{boxShadow:e.shadows[6]}}})),Rn=styled$1(Box)(()=>({width:15})),_r=styled$1(Box)(()=>({width:16})),JI=styled$1(Box)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 32px)",backgroundColor:e.palette.background.paper,position:"relative"})),QI=styled$1(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:16,paddingRight:16,paddingBottom:64})),eb=styled$1(Box)(()=>({padding:"24px 0",display:"flex",justifyContent:"space-between",alignItems:"center"})),tb=styled$1(Box)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0})),ob=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:e.palette.grey[50],cursor:"pointer","&:hover":{backgroundColor:e.palette.grey[100]}})),nb=styled$1(Box,{shouldForwardProp:e=>e!=="isHovered"&&e!=="isDate"})(({theme:e,isHovered:t,isDate:o})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:t?e.palette.action.hover:e.palette.background.paper,cursor:o?"default":"grab","&:hover":{backgroundColor:o?e.palette.background.paper:e.palette.action.hover},"&:last-child":{borderBottom:"none"}})),Am=styled$1(Box)(()=>({width:20,height:20,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),Dm=styled$1(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0})),rb=styled$1(Box)(({theme:e})=>({position:"absolute",bottom:0,left:0,right:0,height:35,borderTop:"1px solid",borderColor:e.palette.divider,background:"#F6F8FACC",backdropFilter:"blur(24px)"})),ib=styled$1(Box)(({theme:e})=>({position:"absolute",bottom:12,right:16,padding:6,backgroundColor:e.palette.background.paper,border:"1px solid #9F9F9F29",borderRadius:"4px"})),ys=styled$1(Paper)(()=>({paddingTop:4,paddingBottom:4,minWidth:180,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",borderRadius:"8px"}));styled$1(Box)(()=>({display:"flex",alignItems:"center",padding:"8px 12px",cursor:"pointer"}));var ab=styled$1(Button)(({theme:e})=>({color:e.palette.error.main,textTransform:"none",fontSize:10,fontWeight:500,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,"&:hover":{backgroundColor:"transparent"}})),sb=styled$1(Button)(({theme:e})=>({fontSize:9,fontWeight:600,borderRadius:4,paddingLeft:20,paddingRight:20,paddingTop:8,paddingBottom:8,height:28,textTransform:"none",backgroundColor:e.palette.info.dark,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{backgroundColor:e.palette.grey[300],color:e.palette.grey[500]}}));styled$1(TextField)(({theme:e})=>({"& .MuiFilledInput-root":{borderRadius:"8px",backgroundColor:e.palette.background.paper,border:"1px solid",borderColor:e.palette.divider,"&:hover":{backgroundColor:e.palette.background.paper},"&.Mui-focused":{backgroundColor:e.palette.background.paper},"&::before, &::after":{display:"none"}}}));var Rm={display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0,"& .MuiSvgIcon-root":{width:16,height:16},"& img":{width:14,height:14}},lb=styled$1(motion.div)(({theme:e})=>({position:"fixed",display:"flex",flexDirection:"column",maxHeight:"calc(100vh - 46px)",backgroundColor:e.palette.background.paper,boxShadow:"0px 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:12,overflow:"hidden",boxSizing:"border-box"})),pb=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),cursor:"pointer","&:hover":{backgroundColor:e.palette.action.hover}})),mb={p:0,width:14,height:14,minWidth:14,minHeight:14,"& .MuiSvgIcon-root":{width:16,height:16}},db=styled$1(Box)(()=>({minWidth:200,display:"flex",flexDirection:"column",maxHeight:"80vh",overflow:"hidden"})),cb=styled$1(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:6,paddingRight:6,minHeight:0})),ub=styled$1(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-end",gap:12,paddingTop:8,paddingBottom:8,paddingLeft:12,paddingRight:12,flexShrink:0,borderTop:"1px solid",borderColor:e.palette.divider})),fb={fontSize:11,fontWeight:400,textTransform:"none",color:"text.primary",minWidth:80,height:38,borderRadius:"8px",border:"1px solid",borderColor:"divider"},gb=e=>({fontSize:11,fontWeight:500,textTransform:"none",backgroundColor:"info.dark",minWidth:80,height:38,borderRadius:"8px",boxShadow:"none","&:hover":{backgroundColor:e.palette.info.dark}});function Bm(e,t){let[o,n]=useState(null),[r,i]=useState(null),a=useCallback(()=>{n(null),i(null);},[]),s=useCallback((p,d)=>{n(p.currentTarget),i(d);},[]),l=useCallback(()=>{r&&a();},[r,a]);return useEffect(()=>{e||(a(),t?.());},[e,t,a]),{subMenuAnchorEl:o,openSubMenuName:r,handleSubMenuClose:a,handleSubMenuOpen:s,handleMenuScroll:l}}function gR(e){let t=e;for(;t&&t!==document.body;){let n=window.getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement;}return document.documentElement}function km(e){let t=useRef(false),o=useRef(null),n=useRef({x:0,y:0}),r=useRef(1),i=useRef(null),a=useRef(0),s=useRef(false),l=useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null);},[]),p=useCallback((f,x)=>{s.current=true,window.dispatchEvent(new PointerEvent("pointermove",{bubbles:true,cancelable:true,pointerId:r.current,clientX:f,clientY:x+a.current,pointerType:"mouse",isPrimary:true})),s.current=false;},[]),d=useCallback(()=>{if(o.current!==null)return;let f=()=>{let x=i.current;if(!t.current||!x)return;let C=x.getBoundingClientRect(),{x:S,y:g}=n.current,h=g-C.top,w=C.bottom-g;if(h>0&&h<60){let b=(60-h)/60*15;x.scrollTop-=b,a.current-=b,p(S,g);}else if(w>0&&w<60){let b=(60-w)/60*15;x.scrollTop+=b,a.current+=b,p(S,g);}o.current=requestAnimationFrame(f);};o.current=requestAnimationFrame(f);},[p]),m=useCallback(f=>{s.current||(n.current={x:f.clientX,y:f.clientY},r.current=f.pointerId,t.current&&a.current!==0&&(f.stopImmediatePropagation(),p(f.clientX,f.clientY)));},[p]),c=useCallback(()=>{i.current=gR(e.current),a.current=0,t.current=true,window.addEventListener("pointermove",m,{capture:true}),d();},[e,m,d]),u=useCallback(()=>{t.current=false,a.current=0,l(),window.removeEventListener("pointermove",m,{capture:true});},[m,l]);return useEffect(()=>()=>{t.current=false,l(),window.removeEventListener("pointermove",m,{capture:true});},[m,l]),{onDragStart:c,onDragEnd:u}}function Fm({columns:e,setTableViews:t}){let o=useCallback(i=>{let a=i.map(s=>e.find(l=>l.name===s)).filter(s=>!!s);t?.(a);},[e,t]),n=useCallback(i=>{let a=e.map(s=>{if(s.name!==i)return s;let l=s.menuItems&&s.menuItems.length>0,p=!s.selected;if(!l)return {...s,selected:p};let d=s.menuItems?.map(m=>({...m,selected:p}));return {...s,selected:p,menuItems:d}});t?.(a);},[e,t]),r=useCallback((i,a)=>{let s=e.map(l=>{if(l.name!==i)return l;let p=l.menuItems?.map(m=>m.name===a?{...m,selected:!m.selected}:m),d=p?.some(m=>m.selected)??false;return {...l,menuItems:p,selected:d}});t?.(s);},[e,t]);return {reorderColumns:o,toggleColumnSelection:n,toggleSubmenuItem:r}}function Wm({column:e,index:t,openSubMenuName:o,toggleColumnSelection:n,handleSubMenuOpen:r,handleSubMenuClose:i}){let a=e.menuItems&&e.menuItems.length>0,s=o===e.name,l=t===0,p=useMemo(()=>!!(e.selected&&e.menuItems?.some(u=>u.selected)&&!e.menuItems?.every(u=>u.selected)),[e.selected,e.menuItems]),d=useCallback(()=>{n(e.name);},[n,e.name]),m=useCallback(u=>{a&&r(u,e.name);},[a,r,e.name]),c=useCallback(()=>{a||i();},[a,i]);return {isIndeterminate:p,hasSubmenuItems:a,isSubmenuOpen:s,isFirstItem:l,handleColumnClick:d,handleMouseEnter:m,handleMouseLeave:c}}var z=(e="")=>e.toLowerCase()==="date",Je=(e="")=>e.toLowerCase()==="index",Is=(e,t="en")=>{let o=[];return e.forEach(n=>{n.columns.forEach(r=>{let i=r.name.find(s=>s.lang===t)?.text||r.name[0]?.text||r.code,a=r.fields?.length?r.fields.map(s=>({name:s.code,label:s.name?.find(l=>l.lang===t||l.lang==="")?.text||s.code,selected:s.default??false})):void 0;o.push({name:r.code,label:i,selected:z(r.code)?true:r.default??false,menuItems:a?.length?a:void 0});});}),o},CR=(e,t)=>{if(!t?.length)return [];let o=e==="sheet"?"sheet":"advanced",n=t.find(r=>r.code.toLowerCase()===o);return n?Is([n]):[]},Hm=(e,t,o="en")=>{let n=e.map((i,a)=>{let s=i.menuItems?.map(p=>({code:p.name,name:[{text:typeof p.label=="string"?p.label:p.name,lang:o||""}],default:p.selected??false})),l=typeof i.label=="string"?i.label:i.name;return {code:i.name,name:[{text:l,lang:o}],order:a+1,default:i.selected??false,...s?.length?{fields:s}:{}}});return {code:t==="sheet"?"Sheet":"Advanced",columns:n}},hR=e=>{let t=new Map;return e.forEach(o=>{o.layout.forEach(n=>{let r=t.get(n.code);if(r){let i=new Set(r.columns.map(a=>a.code));n.columns.forEach(a=>{i.has(a.code)||r.columns.push(a);});}else t.set(n.code,{...n,columns:[...n.columns]});});}),Array.from(t.values())};var yR=(e,t,o=false)=>({label:e,id:`custom_${Date.now()}`,columns:t.map(n=>n.name),submenu:t,isCustom:true,default:o}),IR=(e,t)=>e.map(o=>({...o,default:o.id===t})),bs=e=>e.role??(e.default?"default":void 0),Mo=e=>!!e.role||!!e.default,Qe=e=>!Mo(e),Cb=e=>Qe(e),$r=e=>e.filter(Cb).length,Om=e=>e.filter(Qe).length,Ts=(e,t="sheet",o="en")=>{let n=[],r=[],i;e.forEach(s=>{let l=t==="sheet"?"sheet":"advanced",p=s.layout.find(y=>y.code.toLowerCase()===l),d=p?Is([p],o):[],m=s.id,c=vb$1,u=wb$2,f=d.some(y=>z(y.name))?d:[u,...d],x=f.findIndex(y=>z(y.name)),S=(x>0?[f[x],...f.filter(y=>!z(y.name))]:f).filter(y=>!Je(y.name)),g=[c,...S],h=bs(s),w=Mo(s),b={id:m,label:s.name,role:h,isCustom:!w,selected:s.selected,default:!!s.default,columns:g.map(y=>y.name),submenu:g};w?(s.default&&!i&&(i=g),r.push(b)):n.push(b);});let a=r.find(s=>s.default)??r[0];return {customViews:n,defaultTemplates:r,defaultTemplateColumns:i,defaultTemplate:a}},_m=(e,t="sheet",o="en")=>{let{customViews:n,defaultTemplates:r,defaultTemplate:i}=Ts(e,t,o),a=[...r,...n];return {customViews:n,defaultTemplates:r,defaultTemplate:i,allTemplates:a}},Ss=(e,t)=>{let o=[];Qe(e)?o=e.submenu??[]:o=e.submenu?.length?e.submenu:t;let n=vb$1;if(!o.some(m=>z(m.name)))return [n,wb$2,...o];let i=o.findIndex(m=>z(m.name)),a=i>=0?o[i]:wb$2,s=o.filter(m=>!z(m.name)&&!Je(m.name)),l=[a,...s],p=l.some(m=>Je(m.name)),d=l.findIndex(m=>Je(m.name));if(p&&d>0){let m=l[d],c=l.filter(u=>!Je(u.name));return [m,...c]}return p&&d===0?l:[n,...l]},bR=(e,t)=>Ss(e,t).length>0,Bn=e=>e.filter(t=>!Je(t.name));var ke=e=>e.toLowerCase(),hb=e=>new Map(e.filter(t=>!z(t.name)).map(t=>[ke(t.name),t])),yb=(e,t)=>e.some(o=>ke(o)===ke(t)),zm=(e,t)=>({...e,selected:t.selected??false,menuItems:e.menuItems?.map(o=>{let n=t.menuItems?.find(r=>ke(r.name)===ke(o.name));return {...o,selected:n?.selected??false}})}),Ur=e=>{if(!e.menuItems?.length)return {checked:e.selected??false,indeterminate:false};let t=e.menuItems.filter(o=>o.selected).length;return {checked:t>0,indeterminate:t>0&&t<e.menuItems.length}},Um=(e,t)=>e.map(o=>{if(o.name!==t)return o;let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),Gr=(e,t,o)=>e.map(n=>{if(n.name!==t)return n;let r=n.menuItems?.map(a=>a.name===o?{...a,selected:!a.selected}:a),i=r?.some(a=>a.selected)??false;return {...n,menuItems:r,selected:i}}),Gm=(e,t)=>e.map(o=>{if(z(o.name))return o;let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),Ym=e=>{let t=e.filter(o=>!z(o.name));return t.length===0?false:t.every(o=>o.menuItems?.length?o.menuItems.every(n=>n.selected):o.selected)},Km=(e,t)=>e.filter(r=>!z(r.name)).some(r=>r.menuItems?.length?r.menuItems.some(i=>i.selected):r.selected)&&!t,jm=(e,t)=>e.trim().length>0&&e.length<=t,ce=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),qm=(e,t)=>e.map(o=>{if(o.name!==t)return o;if(z(o.name))return {...o,selected:true};let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),Xm=(e,t)=>e.map(o=>{if(z(o.name))return {...o,selected:true};let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),Zm=e=>e.length===0?false:e.every(t=>t.menuItems?.length?t.menuItems.every(o=>o.selected):t.selected),Jm=(e,t)=>e.length===0?false:e.some(n=>n.menuItems?.length?n.menuItems.some(r=>r.selected):n.selected)&&!t,$m=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Yr=(e,t)=>{if(e.length!==t.length)return false;let o=$m(e),n=$m(t);for(let r=0;r<o.length;r++){let i=o[r],a=n[r];if(i.name!==a.name||i.selected!==a.selected)return false;if(i.menuItems&&a.menuItems){if(i.menuItems.length!==a.menuItems.length)return false;for(let s=0;s<i.menuItems.length;s++)if(i.menuItems[s].name!==a.menuItems[s].name||i.menuItems[s].selected!==a.menuItems[s].selected)return false}else if(i.menuItems||a.menuItems)return false}return true},TR=e=>e.filter(t=>!z(t.name)).map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Qm=(e,t)=>{let o=e.filter(i=>!z(i.name)).map(i=>i.name),n=hb(t),r=[];for(let i of o){let a=e.find(l=>ke(l.name)===ke(i)),s=n.get(ke(i));s?r.push(a?zm(s,a):{...s,selected:false,menuItems:s.menuItems?.map(l=>({...l,selected:false}))}):a&&r.push(a);}for(let[,i]of n)if(!yb(o,i.name)){let a=e.find(s=>ke(s.name)===ke(i.name));r.push(a?zm(i,a):{...i,selected:false,menuItems:i.menuItems?.map(s=>({...s,selected:false}))});}return r},ed=e=>e.filter(t=>!z(t.name)).map(t=>({...t,selected:false,menuItems:t.menuItems?.map(o=>({...o,selected:false}))})),td=(e,t)=>{let o=hb(e),n=t.filter(i=>!z(i.name)).map(i=>i.name),r=[];for(let i of n){let a=t.find(l=>ke(l.name)===ke(i)),s=o.get(ke(i));s&&a?r.push(zm(s,a)):s&&r.push({...s,selected:false,menuItems:s.menuItems?.map(l=>({...l,selected:false}))});}for(let[,i]of o)yb(n,i.name)||r.push({...i,selected:false,menuItems:i.menuItems?.map(a=>({...a,selected:false}))});return r};function Ib(e,t,o="en"){if(!e?.layout?.length)return [];let n=Wa(t)?"sheet":"advanced",r=e.layout.find(s=>s.code?.toLowerCase()===n);if(!r?.columns?.length)return [];let i=r.columns.map(s=>{let l=s.name?.find(d=>d.lang===o)?.text||s.name?.[0]?.text||s.code,p=s.fields?.length?s.fields.map(d=>({name:d.code,label:d.name?.find(m=>m.lang===o||m.lang==="")?.text||d.code,selected:d.default??false})):void 0;return {name:s.code,label:l,selected:z(s.code)?true:s.default??false,...p&&p.length>0&&{menuItems:p}}});return i.some(s=>z(s.name))?i:[{name:wb$2.name,label:wb$2.label,selected:true},...i]}var ws=e=>{let t=e?.order;if(t==null)return 999;let o=Number(t);return Number.isFinite(o)?o:999};function vs(e){return {...e,layout:e.layout?.map(t=>({...t,columns:[...t.columns??[]]}))??[]}}function SR(e,t){let o=e.layout?.map(r=>({...r,columns:[...r.columns??[]].sort((i,a)=>ws(i)-ws(a))})),n=Ib(e,t);return {id:e.id,label:e.name,layout:o,submenu:n,columns:n.map(r=>r.name),role:bs(e),isCustom:Qe(e),default:e.default}}var Ps=(e,t)=>{if(!e)return [];let o=e;if(e.layout&&Array.isArray(e.layout)&&e.layout.length>0){let n=Va$1(t)?"Advanced":"Sheet",r=e.layout.find(i=>{let a=i.code?.trim();return a===n||a?.toLowerCase()===n.toLowerCase()})||e.layout.find(i=>{let a=i.code?.trim()?.toLowerCase();return Va$1(t)?a==="default"||a==="advanced":a==="sheet"||a==="sheets"});if(r&&r.columns&&r.columns.length>0)return r.columns.map(a=>{let l=!!a.fields?.length&&a.fields.some(d=>d.default??false),p=(a.default??false)||l;return {code:a.code,name:a.name&&a.name.length>0?a.name:[{text:a.code,lang:"en"}],selected:p,sort_order:ws(a),fields:a.fields?.map(d=>({code:d.code.toLowerCase(),type:"single",parameters:[{parameter:d.code.toLowerCase(),code:d.code.toLowerCase(),selected:d.default??false}]}))||[{code:a.code.toLowerCase(),type:"single",parameters:[{parameter:a.code.toLowerCase(),code:a.code.toLowerCase(),selected:a.default??false}]}]}}).sort((a,s)=>(a.sort_order??999)-(s.sort_order??999))}return o.submenu&&Array.isArray(o.submenu)&&o.submenu.length>0?o.submenu.map((r,i)=>{let a=r.name.toLowerCase(),s;r.menuItems&&r.menuItems.length>0?s=r.menuItems.filter(m=>m.selected):s=[{name:a,label:r.label||r.name,selected:true}];let l=s.length>0?s.map(m=>({parameter:m.name.toLowerCase(),code:m.name.toLowerCase()})):[{parameter:a,code:a}],p=s.length>1?"combined":"single";return {code:r.name,name:[{text:r.label||r.name,lang:"en"}],selected:r.selected,sort_order:i+1,fields:[{code:a,type:p,parameters:l}]}}):[]},wR=(e,t)=>{if(!e||!Array.isArray(e)||e.length===0)return [];let o=e?.find(n=>n.default)||e[0];return o?Ps(o,t):[]};function od(e,t,o){let n=e.findIndex(t);if(n===-1)return e;let r=[...e];return r[n]=o,r}function nd(e,t){let o=t?.name??e?.name??"",n=t?.layout,r=Array.isArray(n)?n[0]:n??null,a=[...e?.layout??[]];if(r){let s=r.code?.toLowerCase(),l=a.findIndex(p=>p.code?.toLowerCase()===s);l>=0?a[l]=r:a.push(r);}return {name:o,layout:a}}var rd=e=>{let t=e;return t?!!(t.closest('[role="checkbox"]')||t.closest('input[type="checkbox"]')||t.closest('[class*="CheckboxWrapper"]')):false};var bb=e=>[...yb$1[e]??yb$1.default],vR=e=>zb$1[e]??zb$1.default,PR=(e,t)=>({code:e,name:[{text:xb$1[e],lang:"en"}],selected:true,sort_order:t}),ER=(e,t)=>e?.layout?.some(o=>bb(t).includes(o.code?.toLowerCase()??""))??false,id=(e,t,o)=>{let n=zb$1[t],r=o?.layout?.find(a=>a.code?.toLowerCase()===n.toLowerCase()),i=r?{...r,columns:r.columns?.map(a=>({...a,name:a.name?.map(s=>({...s})),fields:a.fields?.map(s=>({...s,name:s.name?.map(l=>({...l}))}))}))??[]}:{code:n,columns:[]};return [e,i]};var Es=({tableMode:e,templates:t,lang:o="en",mainDefaultTemplate:n})=>useMemo(()=>{let{customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:s}=_m(t,e,o),p=(n?Ts([n],e,o).defaultTemplate:void 0)??a,d=p?.submenu?structuredClone(p.submenu):[],m=$r(t);return {customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:s,defaultColumns:d,customTemplateCount:m}},[t,e,o,n]);var Ms=({mode:e,onViewChange:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:i,defaultTemplate:a,allTemplates:s,customTemplateCount:l})=>{let[p,d]=useState(null),[m,c]=useState(false),[u,f]=useState(null),[x,C]=useState(false),[S,g]=useState(null),[h,w]=useState(null),[b,y]=useState(),[T,v]=useState(s.find(k=>k.selected)?.id??a?.id),M=useRef(s.find(k=>k.selected)?.id??a?.id),D=useCallback(k=>{let O=k.submenu?.filter(oe=>oe.selected)||[];return {...k,submenu:O,columns:O.map(oe=>oe.name)}},[]),A=useCallback(k=>{M.current=k?.id,t?.(k?D(k):void 0);},[t,D]),R=useMemo(()=>T?s.find(k=>k.id===T):a,[s,T,a]),H=useMemo(()=>ce(R?.submenu||i),[R,i]),V=useMemo(()=>({id:T||a?.id||"default",label:R?.label||a?.label||"Default"}),[R,T,a?.id,a?.label]);useEffect(()=>{let k=s.find(Re=>Re.selected)?.id,O=a?.id,oe=T?s.some(Re=>Re.id===T):false;if(!(T&&!oe&&k!==T)){if(k&&k!==T){v(k);return}if(!T){v(k??O);return}oe||v(k??O);}},[s,a?.id,T]),useEffect(()=>{!T||!R||R.id===T&&M.current!==T&&(M.current=T,t?.(D(R)));},[T,R,t,D]);let G=useCallback(k=>{d(O=>O?null:k.currentTarget);},[]),we=useCallback(()=>{d(null);},[]),Ue=useCallback((k,O)=>{v(O?.id),A(O),we();},[we,A]),De=useCallback((k=false,O,oe,Re)=>{l!=null&&l>=3||(f(null),C(k),g(O??null),w(oe?.length?oe:null),y(Re),c(true),d(null));},[l]),$=useCallback(k=>{let O=s.find(oe=>oe.id===k.id)??k;f(O),C(true),g(null),w(O.submenu?.length?ce(O.submenu):null),c(true);},[s]),xt=useCallback(()=>{c(false),f(null),C(false),g(null),w(null),y(void 0);},[]);useEffect(()=>{if(!m||!u?.id)return;let k=s.find(O=>O.id===u.id);k&&(f(k),w(k.submenu?.length?ce(k.submenu):null));},[m,u?.id,s]);let Ul=useCallback(async k=>{if(u){let O=u.id;await n?.(O,k),v(O);let oe=s.find(Re=>Re.id===O)??u;A(oe),we();}else {let O=await o?.({...k,sourceTemplateId:b});if(O?.id){v(O.id);let oe=s.find(Re=>Re.id===O.id);A(oe??{id:O.id,label:O.name,isCustom:true,columns:k.selectedColumns.map(Re=>Re.name),submenu:k.selectedColumns});}}},[u,n,o,we,s,A,b]),Gl=useCallback(async k=>{let O=s.find(oe=>oe.id===k);await r?.(O?.id??k),T===(O?.id??k)&&v(a?.id);},[s,r,T,a]);return {anchorEl:p,isCreateDialogOpen:m,editingView:u,selectedViewInfo:V,shouldUseCurrentState:x,selectedView:R,currentViewColumns:H,initialColumnsForCreate:S,availableColumnsForCreate:h,handleViewButtonClick:G,handleCloseViewDropdown:we,handleSelectedViewInfo:Ue,handleOpenCreateDialog:De,handleOpenEditDialog:$,handleCloseCreateDialog:xt,handleSaveView:Ul,handleDeleteView:Gl}};var kn=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((p,d)=>{r.current&&(clearTimeout(r.current),r.current=null),t(p),n(d);},[]),a=useCallback(()=>{r.current=setTimeout(()=>{t(null),n(null);},0);},[]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]),l=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),t(null),n(null);},[]);return {hoveredColumn:e,anchorEl:o,openSubmenu:i,closeSubmenu:a,cancelClose:s,forceClose:l}};var wb=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((l,p)=>{t(l),n(p);},[]),a=useCallback(()=>{t(null),n(null);},[]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]);return {hoveredNestedColumn:e,nestedSubmenuAnchorEl:o,openNestedSubmenu:i,closeNestedSubmenu:a,cancelNestedClose:s}};var md=({open:e,availableColumns:t,defaultColumns:o,editingView:n,tableViews:r=[]})=>{let[i,a]=useState(()=>n?.label||""),[s,l]=useState([]),p=useRef(false),d=useRef([]),m=useRef(n?.label?.trim()||""),{hoveredColumn:c,anchorEl:u,openSubmenu:f,closeSubmenu:x,cancelClose:C}=kn(),S=vb$1,g=wb$2;useEffect(()=>{if(!e){p.current=false;return}if(!p.current&&e)if(n){let V=n.submenu&&n.submenu.length>0?n.submenu:o,G=t.length>0?t:V,Ue=Qm(V,G).filter(xt=>!Je(xt.name)&&!z(xt.name)),De=[S,g,...Ue];l(De),d.current=ce(De);let $=n.label?.trim()||"";m.current=$,a($);}else {let V=t.length>0?t:r,we=(r&&r.length>0?td(V,r):ed(V)).filter(De=>!Je(De.name)&&!z(De.name)),Ue=[S,g,...we];l(Ue),d.current=ce(Ue),m.current="",a("");}else if(e&&n){let V=n.label?.trim()||"";a(V);}p.current=e;},[e,n?.id,n?.label,n?.submenu,t,o,r,S,g]);let h=useMemo(()=>s.map(H=>H.name),[s]),w=useMemo(()=>Ym(s),[s]),b=useMemo(()=>Km(s,w),[s,w]),y=useMemo(()=>jm(i,20),[i]),T=useMemo(()=>{let H=i.trim()!==m.current,V=d.current.length>0&&!Yr(s,d.current);return H||V},[i,s]);return {templateName:i,setTemplateName:a,selectedColumns:s,columnNames:h,allSelected:w,someSelected:b,isNameValid:y,hasChanges:T,hoveredColumn:c,anchorEl:u,openSubmenu:f,closeSubmenu:x,cancelClose:C,handleReorder:H=>{let V=H.filter(G=>!z(G)).flatMap(G=>s.find(we=>we.name===G)??[]);l([S,g,...V]);},handleColumnToggle:H=>{l(V=>Um(V,H));},handleSubItemToggle:(H,V)=>{l(G=>Gr(G,H,V));},handleSelectAll:()=>{l(H=>Gm(H,!w));},handleResetToDefault:()=>{d.current.length>0&&l(ce(d.current));}}};function cd({templates:e,setTemplates:t,createTemplate:o,updateTemplate:n,deleteTemplate:r,tableMode:i,isTemplatesLoading:a,lang:s="en",mainDefaultTemplate:l}){let p=useMemo(()=>l??e.find(g=>g.default),[e,l]),d=e.find(g=>g.selected)?.id??p?.id,m=useCallback(g=>{t(h=>h.find(b=>b.selected)?.id===g?h:h.map(b=>({...b,selected:g?b.id===g:false})));},[t]),c=useCallback(async({name:g,layout:h,sourceTemplateId:w})=>{if($r(e)>=3)return;let b=e.find(M=>M.id===w)??e.find(M=>M.id===d)??p,y=id(h,i,b),T=await o({name:g,layout:y}),v=vs(T);return t(M=>[...M.filter(A=>A.id!==v.id).map(A=>({...A,selected:false})),{...v,selected:true}]),{id:T.id,name:T.name??""}},[o,t,i,p,e,d]),u=useCallback(async g=>{await r(g),t(h=>h.filter(w=>w.id!==g)),m(d===g?p?.id:d);},[r,t,p,m]),f=useCallback(async(g,h)=>{let w=e.find(M=>M.id===g),{name:b,layout:y}=nd(w,h),T=await n(g,{name:b,layout:y}),v=vs(T);t(M=>od(M,D=>D.id===g,v)),m(v.id);},[e,n,t,m]),x=useMemo(()=>({templates:e,onCreateCustomView:c,onEditCustomView:f,onDeleteCustomView:u,isLoading:a,mainDefaultTemplate:l}),[e,c,f,u,a,l]),C=useCallback(g=>{if(!p){m(void 0);return}if(!g?.id){m(p.id);return}if(Mo(g)){m(g.id);return}let h=e.find(w=>w.id===g.id);if(h){m(h.id);return}Qe(g)&&m(g.id);},[e,p,m]),S=useMemo(()=>{let g=e.find(w=>d?w.id===d:false)??p;if(!g)return [];let h=Ps(g,i);return h.length>0?h:[]},[i,e,d,p]);return {customViews:x,onViewChange:C,columnsView:S,selectedViewId:d}}function FR({column:e,index:t,openSubMenuName:o,subMenuAnchorEl:n,toggleColumnSelection:r,toggleSubmenuItem:i,handleSubMenuOpen:a,handleSubMenuClose:s}){let{t:l}=useTranslation(),p=useTheme(),{isIndeterminate:d,hasSubmenuItems:m,isSubmenuOpen:c,isFirstItem:u,handleColumnClick:f,handleMouseEnter:x,handleMouseLeave:C}=Wm({column:e,index:t,openSubMenuName:o,toggleColumnSelection:r,handleSubMenuOpen:a,handleSubMenuClose:s}),S=g=>g?l(g)??Xh(g):"";return jsxs(Un,{sx:{borderTop:`1px solid ${p.palette.divider}`,...u&&{borderTop:"none",height:33}},children:[jsxs(V,{isIndeterminate:d,isSelected:e.selected,onMouseEnter:x,onMouseLeave:C,onClick:f,children:[jsx(Un,{sx:{flex:1},children:S(e.label)}),m&&jsx("img",{src:vb,className:"arrow-icon",alt:"arrow"})]}),m&&jsx(R,{open:c,anchorEl:n,placement:"right-start",onMouseEnter:()=>{},onMouseLeave:s,children:e.menuItems?.map(g=>jsx(V,{isSelected:e.selected&&g.selected,onClick:()=>i(e.name,g.name),children:S(g.label)},g.name))})]},e.name)}var Mb=FR;function OR({open:e,onSelect:t,setTableViews:o,tableViews:n,anchorEl:r,onClose:i}){let{t:a}=useTranslation(),s=useMemo(()=>n||[],[n]),l=useMemo(()=>s.map(S=>S.name),[s]),{reorderColumns:p,toggleColumnSelection:d,toggleSubmenuItem:m}=Fm({columns:s,setTableViews:o}),{subMenuAnchorEl:c,openSubMenuName:u,handleSubMenuClose:f,handleSubMenuOpen:x,handleMenuScroll:C}=Bm(e,i);return jsxs(An,{"data-testid":"TableView_CustomViews",children:[jsxs(En,{"data-testid":"TableView_CustomViews_Button",onClick:t,children:[jsx("div",{children:a("columns")}),jsx("img",{src:Cb$1,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsxs(R,{open:e,anchorEl:r,"data-testid":"TableView_CustomViews_Popper",sx:{padding:0,marginTop:"8px",borderRadius:1},children:[e&&jsx(a$7,{onClick:i}),jsx(Mn,{component:"article","data-testid":"TableView_CustomViews_List",children:jsx(Reorder.Group,{as:"div",axis:"y",onReorder:p,values:l,onScroll:C,children:s.map((S,g)=>jsx(Mb,{column:S,index:g,openSubMenuName:u,subMenuAnchorEl:c,toggleColumnSelection:d,toggleSubmenuItem:m,handleSubMenuOpen:x,handleSubMenuClose:f},S.name))})})]})]})}var fd=memo(OR);function UR({open:e,selectedViewInfo:t,setSelectedViewInfo:o,onSelect:n,onTableViewOptionClick:r,anchorEl:i}){let{t:a}=useTranslation();return jsxs(An,{"data-testid":"TableView_DefaultViews",children:[jsxs(En,{onClick:s=>{n(s);},children:[jsx("div",{children:t.label}),jsx("img",{src:Cb$1,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsx(zR,{open:e,anchorEl:i,placement:"bottom-start",children:jsxs(Mn,{children:[Cb$2.map(s=>jsxs(Dn,{onClick:()=>{o(s),r?.(s);},children:[s.id===t.id?jsx("img",{className:"check-icon",src:Db$1,alt:"arrow"}):jsx(Rn,{}),jsx("span",{children:s.label}),jsx(_r,{})]},s.id)),jsxs(Dn,{sx:{border:"none"},onClick:s=>{s.stopPropagation(),o(Bb),r?.(Bb);},children:[t.id===Bb.id?jsx("img",{className:"check-icon",src:Db$1,alt:"arrow"}):jsx(Rn,{}),jsx("span",{children:a("createCustomView")}),jsx(_r,{})]})]})})]})}var gd=hd.memo(UR);function jR({onViewChange:e,setIsViewVisible:t,setTableViews:o,tableViews:n,resetTableViews:r,onTableViewOptionClick:i}){let[a,s]=useState(null),[l,p$1]=useState(null),[d,m]=useState(null),[c,u]=useState(Ab$1),{t:f}=useTranslation(),x=h=>{e?.(),s(h.currentTarget),t(true);},C$1=()=>{p$1(null),m(null);},S=()=>{s(null),t(false),u(Ab$1);},g=h=>{u(h),h.id!==Bb.id&&r?.(h),C$1();};return a?jsx(KR,{onClickAway:C$1,children:jsxs(hs,{"data-testid":"TableView",children:[c.id===Bb.id&&jsx(fd,{tableViews:n,setTableViews:o,anchorEl:d,open:!!d,onSelect:h=>{m(d?null:h.currentTarget),p$1(null);},onClose:()=>{m(null);}}),jsx(gd,{open:!!l,anchorEl:l,setSelectedViewInfo:h=>{g(h);},selectedViewInfo:c,onSelect:h=>{p$1(l?null:h.currentTarget),m(null);},onTableViewOptionClick:i}),jsx(En,{sx:{width:32,justifyContent:"center"},onClick:S,children:jsx("img",{src:Eb,alt:"close"})})]})}):jsx(p,{title:f("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d$1,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"TableView_no_anchorViewEl",onClick:x,"aria-label":f("tableView")})})}var xd=memo(jR);var Db=({columns:e,allCurrentSelected:t,someCurrentSelected:o,onSelectAll:n,onReset:r,onColumnToggle:i,onNestedItemToggle:a,isModified:s=false})=>{let{hoveredNestedColumn:l,nestedSubmenuAnchorEl:p,openNestedSubmenu:d,closeNestedSubmenu:m,cancelNestedClose:c}=wb();return jsxs(Fragment,{children:[jsxs(pb,{children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(f$1,{checked:t,indeterminate:o,onChange:u=>{u.stopPropagation(),n();},onClick:u=>{u.stopPropagation();},sx:mb})}),jsx(Typography,{component:"button",disabled:!s,onClick:u=>{u.stopPropagation(),s&&r();},sx:{fontSize:11,fontWeight:500,color:"#1F88D0",background:"none",border:"none",cursor:s?"pointer":"default",padding:0,opacity:s?1:.5,pointerEvents:s?"auto":"none","&:hover":s?{textDecoration:"underline"}:void 0},children:"Reset"})]}),jsx(v,{}),jsx(cb,{onScroll:m,children:jsx(Box,{component:"ul",sx:{listStyle:"none",padding:0,margin:0},children:e.map((u,f)=>{let x=u.menuItems&&u.menuItems.length>0,{checked:C,indeterminate:S}=Ur(u),g=z(u.name);return jsxs(Box,{component:"li",sx:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%"},children:[jsxs(Box,{sx:{position:"relative"},onMouseEnter:h=>x&&d(u.name,h.currentTarget),onMouseLeave:()=>x&&m(),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[jsx(V,{isSelected:x?C:u.selected,isIndeterminate:x?S:false,isDisabled:g,onClick:()=>{g||i(u.name);},sx:{flex:1,display:"flex",alignItems:"center"},children:jsx("span",{children:u.label||u.name})}),x&&jsx(Box,{sx:{display:"flex",alignItems:"center",pr:1,pointerEvents:"none"},children:jsx("img",{src:wb$1,alt:"arrow",style:{height:12}})})]}),x&&jsx(Popper,{open:l===u.name,anchorEl:p,placement:"right-start",sx:{zIndex:1e4},children:jsxs(Box,{onMouseEnter:c,onMouseLeave:m,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(ys,{children:u.menuItems?.map((h,w)=>jsxs(hd.Fragment,{children:[jsx(V,{isSelected:h.selected,isDisabled:g,onClick:()=>{g||a(u.name,h.name);},children:h.label||h.name}),w<(u.menuItems?.length??0)-1&&jsx(v,{})]},h.name))})]})})]}),f<e.length-1&&jsx(v,{})]},u.name)})})})]})};function rL({open:e,selectedViewInfo:t,setSelectedViewInfo:o,anchorEl:n,onClose:r,onCreateCustomView:i,customViews:a=[],onEditCustomView:s,defaultColumns:l=[],defaultTemplate:p$1,defaultTemplates:d=[],customTemplateCount:m,isLoading:c}){let{t:u}=useTranslation(),{hoveredColumn:f,anchorEl:x,openSubmenu:C,closeSubmenu:S,cancelClose:g,forceClose:h}=kn(),[w,b]=hd.useState(null),[y,T]=hd.useState(null),v$1=useMemo(()=>[...d.length?d:p$1?[p$1]:[],...a],[d,p$1,a]),M=useCallback(F=>F.submenu?.length?F.submenu:l,[l]),D=useCallback(F=>F?Ss(F,M(F)):l,[l,M]),A=useCallback(F=>D(F).length>0,[D]),R$1=useMemo(()=>f?v$1.find(F=>F.id===f):void 0,[f,v$1]),H=useMemo(()=>D(R$1),[R$1,D]),V=useMemo(()=>f?y?.length?y:H:[],[f,H,y]),G=useMemo(()=>Zm(V),[V]),we=useMemo(()=>Jm(V,G),[V,G]),Ue=y!=null&&!Yr(y,H),De=(m??Om(a))>=3,$=c||De,xt=$||!Ue;function Ul(F){h(),T(null);let se;if(Mo(F)){let Fe=F.submenu?.length?F.submenu:l.length?l:p$1?.submenu??[];se={...F,submenu:ce(Fe),columns:Fe.map(it=>it.name)};}else Qe(F)&&(se=F);o(F,se);}function Gl(F,se){let Fe=v$1.find(it=>it.id===F);T(ce(D(Fe))),C(F,se);}function k(){T(null),S(),h();}function O(F){if(F.stopPropagation(),xt)return;let se=ce(H),Fe=y?.length?ce(y):se;i?.(true,Fe,se,R$1?.id),T(null),h();}function oe(F){y&&T(qm(y,F));}function Re(F,se){y&&T(Gr(y,F,se));}function hv(){y&&T(Xm(y,!G));}function yv(){T(ce(H));}return jsxs(An,{"data-testid":"ViewsDropdown",children:[jsx(zR,{open:e,anchorEl:n,placement:"bottom-start",children:jsxs(Mn,{onScroll:h,children:[jsx(XS,{sx:{paddingX:1.25,py:1.1,fontWeight:500,fontSize:11,color:"#8D8D94"},children:"View"}),jsx(v,{}),v$1.map(F=>{let se=Qe(F),Fe=!se&&A(F);return jsxs(Dn,{onMouseEnter:it=>{se?b(F.id):Fe&&Gl(F.id,it.currentTarget);},onMouseLeave:()=>{se?b(null):Fe&&S();},onClick:()=>Ul(F),sx:{position:"relative",cursor:"pointer",pr:1.5},children:[F.id===t.id?jsx("img",{style:{width:15,height:15},src:Xj,alt:"check"}):jsx(Rn,{}),jsx("span",{style:{flex:1,fontSize:11},children:F.label}),se&&w===F.id&&jsx("img",{src:Ah$1,alt:"edit",style:{width:12,height:12,cursor:"pointer"},onClick:it=>{it.stopPropagation(),r?.(),s?.(F);}}),Fe&&jsx("img",{src:wb$1,alt:"arrow",style:{height:12}})]},F.id)}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"left",disableHoverListener:!De,children:jsxs(Dn,{sx:{border:"none",opacity:$?.5:1,cursor:$?"not-allowed":"pointer"},onClick:F=>{if(F.stopPropagation(),$)return;let se=ce(D(p$1)),Fe=se.map(it=>({...it,selected:false,menuItems:it.menuItems?.map(Iv=>({...Iv,selected:false}))}));i?.(true,Fe,se,p$1?.id),h();},children:[jsx(Rn,{}),jsxs(Un,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsx("img",{src:fm$1,alt:"",style:{opacity:$?.5:1,width:10,height:10}}),jsx("span",{style:{color:$?"#999":"#1F88D0",fontSize:11,fontWeight:500},children:u("New Custom View")})]}),jsx(_r,{})]})})]})}),f&&x&&V.length>0&&jsx(R,{open:!!x,anchorEl:x,placement:"auto-end",onMouseEnter:g,onMouseLeave:k,children:jsxs(db,{children:[jsx(Db,{columns:Bn(V),allCurrentSelected:G,someCurrentSelected:we,onSelectAll:hv,onReset:yv,onColumnToggle:oe,onNestedItemToggle:Re,anchorEl:x,isModified:Ue}),jsxs(ub,{children:[jsx(Rb,{variant:"text",onClick:k,sx:fb,children:"Cancel"}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"top",disableHoverListener:!De,children:jsx(Rb,{variant:"contained",onClick:O,disabled:xt,sx:gb,children:"Create view"})})]})]})})]})}var yd=hd.memo(rL);var kb=({selectedColumns:e,columnNames:t,allSelected:o,someSelected:n,hoveredColumn:r,anchorEl:i,onReorder:a,onColumnToggle:s,onSubItemToggle:l,onSelectAll:p,onResetToDefault:d,onSubmenuEnter:m,onSubmenuLeave:c,onCancelClose:u})=>{let f=useRef(null),{onDragStart:x,onDragEnd:C$1}=km(f),S=useCallback(g=>{if(rd(g.target)){g.preventDefault();return}x();},[x]);return jsxs(tb,{children:[jsxs(ob,{children:[jsx(Am,{children:jsx("img",{src:C,alt:"drag",style:{width:16,height:16,opacity:.5}})}),jsx(Dm,{onClick:g=>{g.stopPropagation(),p();},children:jsx(f$1,{checked:o,indeterminate:n,size:"small",sx:Rm,onChange:g=>{g.stopPropagation(),p();},onClick:g=>{g.stopPropagation();}})}),jsx(Typography,{onClick:g=>{g.stopPropagation(),p();},sx:{flex:1,fontSize:13,fontWeight:500,color:"text.primary",ml:.75,cursor:"pointer"},children:"Select All"}),jsx(Link,{component:"button",type:"button",onClick:g=>{g.stopPropagation(),d();},underline:"none",sx:{fontSize:13,fontWeight:500,cursor:"pointer",color:"common.blue"},children:"Reset to default"})]}),jsx(Box,{sx:{flex:1,minHeight:0,overflowX:"hidden",overflowY:"auto",position:"relative"},children:jsx(Reorder.Group,{ref:f,axis:"y",onReorder:a,values:t,style:{listStyle:"none",padding:0,margin:0},children:e.map(g=>{let h=z(g.name),w=g.menuItems&&g.menuItems.length>0,{checked:b,indeterminate:y}=Ur(g);return jsxs(Reorder.Item,{value:g.name,drag:h?false:"y",dragListener:!h,dragConstraints:f,dragElastic:{top:0,bottom:0,left:0,right:0},transition:{duration:0},whileDrag:{zIndex:9999,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",scale:1},style:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%",willChange:"transform"},onDragStart:S,onDragEnd:C$1,children:[jsxs(nb,{isHovered:r===g.name,isDate:h,onMouseEnter:T=>w&&m(g.name,T.currentTarget),onMouseLeave:()=>w&&c(),onClick:T=>{(T.target.closest('[role="checkbox"]')||T.target.closest('input[type="checkbox"]'))&&T.stopPropagation();},sx:{width:"100%",position:"relative"},children:[jsx(Am,{children:jsx("img",{src:Fb,alt:"drag",draggable:false,style:{width:16,height:16,cursor:h?"default":"grab",pointerEvents:"none"}})}),jsx(Dm,{onMouseDown:T=>{T.stopPropagation();},onPointerDown:T=>{T.stopPropagation();},children:jsx(f$1,{checked:b,indeterminate:y,onChange:T=>{T.stopPropagation(),s(g.name);},onClick:T=>{T.stopPropagation();},disabled:h,size:"small",sx:Rm})}),jsx(Typography,{sx:{flex:1,fontSize:13,fontWeight:400,color:"text.primary",ml:1},children:g.label||g.name}),w&&jsx(Box,{sx:{display:"flex",alignItems:"center",ml:1,flexShrink:0},children:jsx("img",{src:vb,alt:"arrow",style:{width:12,height:12}})})]}),w&&jsx(Popper,{open:r===g.name,anchorEl:i,placement:"right-start",sx:{zIndex:1e4},modifiers:[{name:"offset",options:{offset:[0,0]}}],children:jsxs(Box,{onMouseEnter:u,onMouseLeave:c,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(ys,{children:g.menuItems?.map((T,v$1)=>jsxs(hd.Fragment,{children:[jsx(V,{isSelected:T.selected,isDisabled:h,onClick:()=>{h||l(g.name,T.name);},sx:{fontSize:13},children:T.label||T.name}),v$1<(g.menuItems?.length??0)-1&&jsx(v,{})]},T.name))})]})})]},g.name)})})})]})};function cL({open:e,onClose:t,onCreate:o,availableColumns:n=[],defaultColumns:r=[],editingView:i,onDelete:a,tableViews:s=[],mode:l="sheet",stackOrder:p=1}){let{t:d}=useTranslation(),m=useDragControls(),[c,u]=useState(false),[f,x]=useState(false);useEffect(()=>{e||(u(false),x(false));},[e]),useEffect(()=>{if(!e)return;let $=xt=>{xt.key==="Escape"&&t();};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[e,t]);let{templateName:C,setTemplateName:S,selectedColumns:g,allSelected:h,someSelected:w,isNameValid:b,hasChanges:y,hoveredColumn:T,anchorEl:v,openSubmenu:M,closeSubmenu:D,cancelClose:A,handleReorder:R,handleColumnToggle:H,handleSubItemToggle:V,handleSelectAll:G,handleResetToDefault:we}=md({open:e,availableColumns:n,defaultColumns:r,editingView:i,tableViews:s}),Ue=async()=>{if(!(!b||!y||f||c)){x(true);try{let $=Hm(g,l);await o?.({name:C,selectedColumns:g,layout:$}),t();}catch{console.warn("Failed to create view");}finally{x(false);}}},De=async()=>{if(!i||c||f)return;let $=i.id;u(true);try{await a?.($),t();}catch{console.warn("Failed to delete view");}finally{u(false);}};return e?jsxs(lb,{role:"dialog","aria-modal":"true","data-testid":"CreateViewDialog",drag:true,dragListener:false,dragControls:m,dragMomentum:false,initial:false,style:{width:450,minWidth:0,maxWidth:"min(100vw - 16px, 450px)",height:600,left:`max(8px, calc(50% - ${450/2}px))`,top:`max(8px, calc(50% - ${600/2}px))`},animate:{zIndex:2+p},transition:{duration:.1},children:[jsx(c$2,{id:"draggable-dialog-title",onPointerDown:$=>m.start($),style:{cursor:"move",flexShrink:0},children:jsx(d$4,{isHovered:true,title:i?"Edit Custom View":d("createCustomView")||"Create Custom View",leftActions:jsx(a$d,{onClick:t,onPointerDown:$=>$.stopPropagation()})})}),jsxs(JI,{children:[jsxs(QI,{onScroll:()=>{D();},children:[jsxs(eb,{children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#9F9F9F",lineHeight:"0.7"},children:"Custom"}),jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#20232B",lineHeight:1.2},children:"View"})]}),i&&jsx(ab,{onClick:De,disabled:c||f,children:c?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:"Deleting..."})]}):"Delete View"})]}),jsx(Box,{sx:{mb:3},children:jsx(a$e,{name:"custom-template-name",label:"Template Name",value:C,onChange:$=>S($),inputProps:{maxLength:20,autoComplete:"off",readOnly:true,"data-form-type":"other",onFocus:$=>$.currentTarget.removeAttribute("readonly")},required:true})}),jsx(kb,{selectedColumns:Bn(g),columnNames:Bn(g).map($=>$.name),allSelected:h,someSelected:w,hoveredColumn:T,anchorEl:v,onReorder:R,onColumnToggle:H,onSubItemToggle:V,onSelectAll:G,onResetToDefault:we,onSubmenuEnter:M,onSubmenuLeave:D,onCancelClose:A})]}),jsx(rb,{}),jsx(ib,{children:jsx(sb,{variant:"contained",onClick:Ue,disabled:!b||!y||f||c,title:b?void 0:`Name is required. Current: "${C}"`,children:f?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:i?"Saving...":"Creating..."})]}):i?"Update View":"Create View"})})]})]}):null}var Id=cL;function xL({onViewChange:e,templates:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,tableMode:i="default",lang:a="en",isLoading:s,mainDefaultTemplate:l}){let{t:p$1}=useTranslation(),{defaultColumns:d,defaultTemplate:m,defaultTemplates:c,customViews:u,allTemplates:f,customTemplateCount:x}=Es({tableMode:i,templates:t,lang:a,mainDefaultTemplate:l}),{anchorEl:C$1,isCreateDialogOpen:S,editingView:g,selectedViewInfo:h,shouldUseCurrentState:w,currentViewColumns:b$1,initialColumnsForCreate:y,availableColumnsForCreate:T,handleViewButtonClick:v,handleCloseViewDropdown:M,handleSelectedViewInfo:D,handleOpenCreateDialog:A,handleOpenEditDialog:R,handleCloseCreateDialog:H,handleSaveView:V,handleDeleteView:G}=Ms({mode:i,onViewChange:e,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:d,defaultTemplate:m,allTemplates:f,customTemplateCount:x});return jsxs(Fragment,{children:[jsx(KR,{onClickAway:M,children:jsxs(hs,{sx:{width:"32px"},"data-testid":"ViewsMenu",children:[jsx(p,{title:p$1("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d$1,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"ViewsMenu_button",onClick:v,"aria-label":p$1("tableView")})}),jsx(yd,{open:!!C$1,anchorEl:C$1,onClose:M,setSelectedViewInfo:D,selectedViewInfo:h,onCreateCustomView:A,customViews:u,onEditCustomView:R,defaultColumns:d,defaultTemplate:m,defaultTemplates:c,customTemplateCount:x,isLoading:s})]})}),jsx(Id,{open:S,onClose:H,availableColumns:T?.length?T:d,defaultColumns:d,onCreate:V,editingView:g,onDelete:G,tableViews:w?y??b$1:void 0,mode:i})]})}var bd=memo(xL);function Td(e=[]){let[t,o]=useState(false),n=useMemo(()=>e.map(({code:r})=>r),[e]);return {isColumnPickerVisible:t,setIsColumnPickerVisible:o,timezoneCountryCodes:n}}function bL({tableMode:e,onToggle:t}){let o=Va$1(e),n=Wa(e);return jsx(b,{variant:"secondary",size:"md",icon:jsx(d$1,{src:n?Kh$1:Jh$1,alt:`${e}-mode`,sx:{width:14,height:14}}),onClick:t,"aria-label":`${e}-mode`,sx:r=>o?{}:{borderColor:r.v2.palette.brand[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}})}var _b=memo(bL);function Xr({children:e,component:t="aside",...o}){return jsx(jI,{component:t,"data-testid":"ListHeaderToolbar",...o,children:e})}function ks({display:e,timezone:t,calendar:o,views:n,search:r,slots:i,reportsVisible:a,lang:s}){let{isColumnPickerVisible:l,setIsColumnPickerVisible:p,timezoneCountryCodes:d}=Td(t?.segmentCountries),m=e?.variant==="acceptance",c=n?.tableMode??"default",u=useMemo(()=>n?.onSheetToggle?jsx(_b,{tableMode:c,onToggle:n.onSheetToggle}):null,[c,n?.onSheetToggle]);return jsxs(Xr,{children:[i?.leading&&!l&&i.leading,!l&&jsxs(Fragment,{children:[r?.onChange&&jsx(a$f,{onSearchChange:r.onChange,placeholder:r.placeholder}),i?.filter,u&&!m&&u,o&&t&&jsx(a$g,{defaultDate:o.date,onDateChange:f=>{let[x,C]=f;x&&C&&o.onDateChange([x,C]);},mode:o.mode,onCalendarModeSwitch:o.onModeChange,maxDateRange:o.maxRange??31,groupBy:o.groupBy,onCalendarGroupChange:o.onGroupByChange,browserTimezone:t.browserTimezone,defaultCountryTimezone:t.defaultCountryTimezone,timezone:t.timezone,onChangeTimezone:t.onChangeTimezone,timezoneCountriesCodes:d}),a&&i?.reports,u&&m&&u]}),n?.onViewChange&&(n.templates?jsx(bd,{onViewChange:n.onViewChange,tableMode:c,lang:s,...n.templates}):jsx(xd,{onViewChange:n.onViewChange,setIsViewVisible:p,tableViews:n.columns,setTableViews:n.setColumns,resetTableViews:n.onPresetReset,onTableViewOptionClick:n.onPresetOptionClick})),i?.trailing&&!l&&i.trailing]})}function ML({title:e,display:t,lang:o,reportsVisible:n,timezone:r,calendar:i,status:a,activeFilter:s,views:l,search:p,slots:d,children:m}){let c=zc(useId(),"list-header"),u=useMemo(()=>jsx(ks,{display:t,timezone:r,calendar:i,views:l,search:p,slots:d,reportsVisible:n,lang:o}),[t,r,i,l,p,d,n,o]);return jsxs(gs,{id:c,"data-testid":zI,children:[t?.maximized&&jsx(xs,{title:e,toolbar:u}),jsxs(YI,{as:"section",children:[jsx(Cs,{status:a,activeFilter:s,beforeStatus:d?.beforeStatus}),!t?.maximized&&u]}),m]})}var Ub=memo(ML);var Yb=styled(Un,{shouldForwardProp:e=>e!=="maximized"})(({theme:e,maximized:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),overflow:"hidden",height:t?"4.75rem":"4.1875rem",paddingBottom:t?"0rem":"1.2rem",paddingInline:e.spacing(4),paddingTop:t?"1.35rem":e.spacing(.5)})),DL=wa$1(),Kb=styled(j$1,{shouldForwardProp:e=>e!=="title"&&e!=="isDropdown"})(({title:e,isDropdown:t,theme:o})=>{let{base:n}=o.v2.palette;return {position:"relative",fontWeight:o.typography.fontWeightMedium,padding:o.spacing(1),color:n.black,fontSize:"11px",lineHeight:"15px",borderRadius:o.shape.borderRadius,transition:o.transitions.create(["backgroundColor","boxShadow"],{easing:o.transitions.easing.sharp,duration:o.transitions.duration.complex}),whiteSpace:"nowrap",textTransform:"capitalize","&:hover, &.active":{...!t&&{backgroundColor:n.white,boxShadow:o.shadows[2]},cursor:"pointer",position:"relative",color:"transparent","&:after":{...e&&{content:`"${e}"`},color:n.black,fontWeight:o.v2.typography.fontWeightBold,overflow:"hidden",position:"absolute",top:0,bottom:0,right:0,left:0,display:"flex",alignItems:"center",justifyContent:t?"flex-start":"center",letterSpacing:DL==="safari"?"-1px":"",padding:8,borderRadius:o.shape.borderRadius}}}});function kL({isDropdown:e=false,name:t,code:o,activeCode:n,navigateToMenuItem:r,onClickServiceItem:i}){let[a,s]=useState(null),{t:l}=useTranslation(),p=!!a,d=()=>{s(null);};return jsxs(Fragment,{children:[jsx(Kb,{isDropdown:e,className:n.toLowerCase()===o.toLowerCase()?"active":"",onClick:m=>{m.preventDefault(),m.stopPropagation(),r(o);},title:t,onContextMenu:m=>{m.preventDefault(),m.stopPropagation(),d(),s(m.currentTarget);},children:t}),jsx(f,{open:p,anchorEl:a,onClose:d,menuItems:[{label:l("openNewWindow"),name:"new",icon:jsx("img",{src:hb$1,alt:"new-window-icon"}),onClick:m=>{m.stopPropagation(),i?.(o),d();}}]})]})}var jb=memo(kL);var UL=e$1=>jsx(e,{src:e$1.className.includes("MuiSelect-iconOpen")?Wc:Vc,alt:"dropdown"});function GL({isMaximized:e,serviceCode:t,dimensions:o,services:n,onChangeServiceCode:r,onClickServiceItem:i}){let a=zc(useId(),"app-services"),[s,l]=useState(0),[p,d]=useState(false),[m,c]=useState(""),u=useRef(null),[f,x]=hd.useState(false),{i18n:C}=useTranslation(),S=y=>{c(y.target.value);},g=()=>{x(y=>!y);},h=useMemo(()=>ac(n.filter(y=>y.code.toLowerCase()===decodeURIComponent(t).toLowerCase())?.[0]?.name,C.language),[n,C.language,t]);useEffect(()=>{c(h);},[h]),useEffect(()=>{l(u.current?.offsetWidth+51+8+3);},[]),useEffect(()=>{d(Number(o?.width)<s+10);},[o?.width,s]);let w=y=>{r?.(y),x(false);},b=y=>jsx(c$3,{children:y});return jsxs(Yb,{id:a,"data-testid":"AppServices",maximized:e,children:[!!n?.length&&!p&&jsx(Box,{ref:u,display:"flex",gap:"8px",flexDirection:"row",sx:{userSelect:"none"},children:n.map((y,T)=>jsx(jb,{activeCode:t,onClickServiceItem:i,navigateToMenuItem:w,name:ac(y.name,C.language)||"",code:y.code},`service-item-${y.code}-${T}`))}),!!n?.length&&p&&jsx(a$8,{open:f,onClick:g,displayEmpty:true,inputProps:{"aria-label":"Without label"},MenuProps:{anchorOrigin:{vertical:40,horizontal:83},PaperProps:{style:{borderRadius:"0.25rem",width:"10.43rem",padding:0}},MenuListProps:{disablePadding:true}},value:m,IconComponent:UL,onChange:S,renderValue:b,sx:{"& .MuiOutlinedInput-root.MuiList-root-MuiMenu-list":{paddingTop:"0px !important",paddingBottom:"0px !important"}},children:n.map((y,T)=>ac(y.name,C.language)?.toLowerCase()===m?.toLowerCase()?null:jsx(b$3,{value:ac(y.name,C.language),onClick:v=>{v.preventDefault(),v.stopPropagation(),w(y.code);},children:jsx(d$2,{children:ac(y.name,C.language)})},`option-${y.code}-${T}`))})]})}var qb=memo(GL);var Ed=qb;var Zb=styled(Un)(({theme:e})=>({color:e.palette.text.primary,border:`1px solid ${e.palette.divider}`,padding:e.spacing(1),borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"flex-end",width:93,height:32,textAlign:"right",input:{fontSize:"11px",border:"none",color:e.palette.text.primary,height:30,padding:0,textAlign:"right"},img:{cursor:"pointer"}})),Jb=styled(a$1)(()=>({padding:0,border:"none",height:24,input:{textAlign:"right",width:"100%"}}));var ZL=xa$1();function JL({amount:e,setAmount:t,maxAmount:o,isError:n,selectedCurrency:r,...i}){let a=zc(useId(),"amount-input"),[s,l]=useState(false),[p,d]=useState(e||""),m=useMemo(()=>l$1(r?.decimals),[r]),c=x=>{let C=Number(x.target.value)||0;if(o&&C>o)return false;d(C),t(C);},u=()=>{l(false),t(Number(p));},f=x=>{ZL&&isNaN(Number(x.key))&&x.key!=="Backspace"&&x.key!=="."&&x.preventDefault();};return jsx(Zb,{id:a,"data-testid":"AmountInput",sx:i.sx,children:s?jsx(Jb,{placeholder:m,value:p,onChange:c,onBlur:u,onKeyDown:f,isError:n,inputProps:{step:"0.01"},hideArrows:true,autoFocus:true}):jsx(a$9,{currencyCode:r?.code?.english,amount:e,onClick:()=>{l(true);}})})}var eT=memo(JL);var Ad=eT;function nB({appCode:e,services:t,isMaximized:o,dimensions:n,serviceCode:r,ui:{onStartDrag:i},onChangeServiceCode:a,onClickServiceItem:s,sx:l}){let p=zc(useId(),"app-services-bar"),[d,m]=useState(false),c=useCallback(f=>{i?.(f),m(true);},[i,m]),u=()=>{m(false);};return !e||!t?.length?null:jsx(b$4,{id:p,"data-testid":"AppServicesBar",onPointerDown:c,onPointerUp:u,isDragging:d,sx:l,children:jsx(Ed,{onClickServiceItem:s,dimensions:{width:n.width},serviceCode:r,services:t,isMaximized:o,onChangeServiceCode:a})})}var oT=memo(nB);var rB=oT;var nT=({width:e,height:t})=>jsx(r,{variant:"circular",width:e,height:t});function pB({data:e,isError:t,isLoading:o,width:n=24,height:r=24,fallbackIconUrl:i=Rd$1,...a}){let s=zc(useId(),"brand-logo"),l=useTheme(),p=useMemo(()=>e?.type?.includes("application/pdf"),[e]),d=useMemo(()=>e?(window.URL?URL:webkitURL).createObjectURL(e):"",[e]),m=useMemo(()=>t||!e?i:p?We:d,[e,t,p,d,i]);return o?jsx(nT,{width:n,height:r}):jsx(d$1,{id:s,"data-testid":"BrandLogo",alt:"brand",src:m,sx:{borderRadius:"50%",backgroundColor:l.palette.common.white,width:n,height:r,objectFit:p?"none":"contain",...a.sx}})}var Rd=memo(pB);var Ld=(e,t)=>{let o=0;return t.percentage>0&&(o=e*(t.percentage/100)),o},_re=(e,t,o)=>({...e,value:Ld(Number(t),e)*o});var sT=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"&&e!=="isOpen"})(({theme:e,isOpen:t,isDisabled:o})=>({display:"flex",gap:e.spacing(1),alignItems:"center",justifyContent:"space-between",fontSize:"11px",border:`1px solid ${e.palette.divider}`,height:32,padding:e.spacing(1),borderRadius:"4px",...t&&{borderColor:e.palette.info.dark,position:"relative"},...o?{color:e.palette.grey[700],cursor:"not-allowed"}:{cursor:"pointer"}})),lT=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"})(({theme:e,isDisabled:t})=>({fontSize:"11px",fontWeight:600,color:e.palette.text.primary,...t&&{color:e.palette.grey[700]}}));var dT=styled$1(Box)(({theme:e})=>({width:112,boxShadow:e.shadows[16],borderRadius:4,backgroundColor:e.palette.common.white,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),cT=styled$1(Box)(({theme:e})=>({fontSize:"11px",paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"},"&:hover":{boxShadow:e.shadows[3]}}));var gT=styled(Un)(({theme:e})=>({width:112,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),Bd=styled(Un)(({theme:e})=>({fontSize:"11px",paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"},"&:hover":{boxShadow:e.shadows[3]}}));function cB({vat:e,onChange:t,setIsDropdownOpen:o}){let{t:n}=useTranslation(),{percentage:r,isInclusive:i,value:a}=e,s=r===So$1.ZERO,l=r===So$1.FIVE,p=r===So$1.TEN,d=r===So$1.FIFTEEN,m=r!==So$1.FIVE&&r!==So$1.TEN&&r!==So$1.FIFTEEN&&r!==So$1.ZERO,c=[{label:n("noVat"),value:So$1.ZERO,selected:s},{label:"5%",value:So$1.FIVE,selected:l},{label:"10%",value:So$1.TEN,selected:p},{label:"15%",value:So$1.FIFTEEN,selected:d}],u=C=>{t({value:a,percentage:C,isInclusive:i});},f=C=>{Number(C.target.value)>100||u(Number(ob$1(C.target.value)));},x=C=>C?jsx("img",{src:Db$1,alt:"check"}):jsx("span",{});return jsxs(gT,{children:[c.map((C,S)=>jsxs(Bd,{className:"option",onClick:()=>{u(C.value),o(false);},children:[x(C.selected),jsx("span",{children:C.label})]},`${C.value}-${S}`)),jsxs(Bd,{className:"option",children:[x(m),jsx(a$2,{placeholder:"%",value:m?String(r):"",onChange:f,sx:{justifyContent:"flex-end"}})]})]})}var Fs=memo(cB);function xB({setVat:e,vat:t,setIsOpen:o,...n}){let[r,i]=useState(null),a=!!r,{t:s}=useTranslation(),l=p=>{if(p.stopPropagation(),a){i(null);return}i(p.currentTarget);};return jsx(dT,{sx:n.sx,children:jsxs(cT,{sx:p=>({...a&&{boxShadow:p.shadows[3]}}),className:"option",onClick:l,children:[jsx("span",{children:s("rate")}),jsx("img",{src:vb,alt:"a"}),jsx(R,{anchorEl:r,open:a,placement:"right-start",children:jsx(Fs,{onChange:e,vat:t,setIsDropdownOpen:o})})]})})}var Vs=memo(xB);function SB({totalGrossAmount:e,totalVat:t,selectedCurrency:o,onChangeTotalVat:n,isDisabled:r}){let[i,a]=useState(false),s=useRef(),{t:l}=useTranslation(),p=()=>{r||a(!i);},d=u=>{n({...u,value:Ld(e,u)});},m=o?.code?.english||"",c=()=>t.percentage===0?l("noVat"):t.isInclusive?jsxs(Un,{sx:{display:"flex",gap:"4px"},children:[jsxs("span",{children:[l("inclusive")," "]}),jsx(a$9,{amount:t.value,currencyCode:m})]}):jsx(a$9,{currencyCode:m,amount:t.value});return jsxs(sT,{isDisabled:r,isOpen:i,onClick:p,ref:s,sx:{...r&&{pointerEvents:"none",opacity:.7}},children:[jsx("img",{src:lj,alt:"p"}),jsx(lT,{isDisabled:r,children:c()}),jsx(Un,{component:"img",src:i?rj:Ui,alt:"a"}),i&&jsx(a$7,{onClick:p}),jsx(zR,{open:!!i,anchorEl:s.current,placement:"bottom-start",children:jsx(Vs,{setIsOpen:a,vat:t,setVat:d,sx:{position:"absolute",top:8,left:0,display:i?"block":"none"}})})]})}var CT=memo(SB);var Fd=(e,t)=>{let o=0;return t.type==="flat"&&t.flat&&t.flat>0&&(o=t.flat),t.type==="percent"&&t.percentage&&t.percentage>0&&(o=e*(t.percentage/100)),o},Fie=(e,t,o)=>({...e,value:Fd(t,e)*o});var hT=styled(Un)(({theme:e})=>({width:106,boxShadow:e.shadows[16],borderRadius:4,backgroundColor:e.palette.common.white,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),Ws=styled(Un)(({theme:e})=>({fontSize:"11px",padding:e.spacing(1),display:"flex",justifyContent:"flex-end",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"}})),yT=styled(Un,{shouldForwardProp:e=>e!=="isOpen"})(({isOpen:e,theme:t})=>({display:e?"block":"none",position:"absolute",left:"100%",top:0,background:t.palette.common.white,padding:"8px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px",overflow:"hidden",minWidth:112,height:39}));var TT=styled(Un)(({theme:e})=>({width:112,boxShadow:e.shadows[16],borderRadius:4,backgroundColor:e.palette.common.white,".option + .option":{borderTop:`1px solid ${e.palette.divider}`},zIndex:3})),Hd=styled(Un)(({theme:e})=>({fontSize:"11px",paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),cursor:"pointer",height:40,input:{height:24,width:47,textAlign:"right"},"&:hover":{boxShadow:e.shadows[3]}}));function PB({discount:e,setDiscount:t,setIsDropdownOpen:o,setIsOpen:n,...r}){let i=zc(useId(),"discount-rate-dropdown"),{percentage:a,value:s}=e,l=a===So$1.FIVE,p=a===So$1.TEN,d=a===So$1.FIFTEEN,m=a!==So$1.FIVE&&a!==So$1.TEN&&a!==So$1.FIFTEEN&&a!==So$1.ZERO&&s!==So$1.ZERO,c=[{label:"5%",value:So$1.FIVE,selected:l},{label:"10%",value:So$1.TEN,selected:p},{label:"15%",value:So$1.FIFTEEN,selected:d}],u=C=>{t({value:s,percentage:C,type:"percent"}),n(false);},f=C=>{if(Number(C.target.value||!Number(C.target.value))>100)return false;t({value:Number(C.target.value),percentage:Number(ob$1(C.target.value)),type:"percent"});},x=C=>C?jsx("img",{src:Db$1,alt:"c"}):jsx("span",{});return jsxs(TT,{id:i,"data-testid":"DiscountRateDropdown",sx:r.sx,children:[c.map(C=>jsxs(Hd,{className:"option",onClick:()=>{u(C.value),o&&o(false);},children:[x(C.selected),jsx("span",{children:C.label})]},C.value)),jsxs(Hd,{className:"option",children:[x(m),jsx(a$2,{placeholder:"%",sx:{input:{width:"100% !important"}},value:m?a:"",onChange:f})]})]})}var Os=memo(PB);function DB({discount:e,maxDiscount:t,setDiscount:o,setIsOpen:n,selectedCurrency:r,...i}){let a=zc(useId(),"discount-dropdown"),[s,l]=useState(false),[p,d]=useState(false),{t:m}=useTranslation(),c=e.type==="noDiscount",u=e.type==="percent",f=g=>{o(g);},x=g=>{g.stopPropagation(),n(false),f({type:"noDiscount",value:0,percentage:0,flat:0}),s&&l(false),p&&d(false);},C=g=>{g.stopPropagation(),l(true),p&&d(false);},S=g=>{g.stopPropagation(),d(true),s&&l(false);};return jsxs(hT,{id:a,"data-testid":"DiscountDropdown",sx:{...i.sx,...p&&{borderBottomRightRadius:0}},children:[jsxs(Ws,{className:"option",onClick:x,sx:{justifyContent:"flex-start"},children:[c?jsx("img",{src:Db$1,alt:"c"}):jsx(Un,{width:"12px"}),jsx("span",{children:m("none")})]}),jsxs(Ws,{className:"option",onClick:C,sx:g=>({justifyContent:"space-between",position:"relative",...s&&{boxShadow:g.shadows[3]}}),children:[jsxs(Un,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[u?jsx("img",{src:Db$1,alt:"check"}):jsx(Un,{width:"12px"}),jsx("span",{children:"%"})]}),jsx("img",{src:vb,alt:"r"}),jsx(Os,{sx:{position:"absolute",left:"100%",top:0,display:s?"block":"none",borderTopLeftRadius:0},setIsOpen:n,discount:e,setDiscount:o})]}),jsxs(Ws,{className:"option",onClick:S,sx:g=>({justifyContent:"space-between",position:"relative",...p&&{boxShadow:g.shadows[3]}}),children:[jsxs(Un,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[e.type==="flat"?jsx("img",{src:Db$1,alt:"c"}):jsx(Un,{width:"12px"}),jsx("span",{children:m("flat")})]}),jsx("img",{src:vb,alt:"r"}),jsx(yT,{isOpen:p,children:jsx(Ad,{selectedCurrency:r,sx:{height:24,width:"100%",input:{height:20,width:"100%",textAlign:"right",flexGrow:1}},amount:e.type==="flat"?Number(e.flat):"",setAmount:g=>{f({...e,type:"flat",flat:Number(g)});},maxAmount:t})})]})]})}var _s=memo(DB);var PT=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"&&e!=="isOpen"})(({theme:e,isOpen:t,isDisabled:o})=>({display:"flex",gap:e.spacing(1),alignItems:"center",justifyContent:"space-between",fontSize:"11px",border:`1px solid ${e.palette.divider}`,height:32,padding:e.spacing(1),borderRadius:"4px",...t&&{borderColor:e.palette.info.dark,position:"relative"},...o?{color:e.palette.grey[700],cursor:"not-allowed"}:{cursor:"pointer"}})),ET=styled$1(Box,{shouldForwardProp:e=>e!=="isDisabled"})(({theme:e,isDisabled:t})=>({fontSize:"11px",fontWeight:600,color:e.palette.text.primary,...t&&{color:e.palette.grey[700]}}));function VB({selectedCurrency:e,totalGrossAmount:t,totalDiscount:o,onChangeTotalDiscount:n,isDisabled:r}){let i=zc(useId(),"total-discount"),[a,s]=useState(false),l=useRef(),{t:p}=useTranslation(),d=()=>{r||s(!a);},m=u=>{n({...u,value:Fd(t,u)});},c=()=>o.value===0?p("noDiscount"):jsxs(Un,{sx:{display:"flex",gap:"2px"},children:[jsx("span",{children:"-"}),jsx(a$9,{amount:o.value,currencyCode:e?.code?.english})]});return jsxs(PT,{id:i,"data-testid":"TotalDiscount",isOpen:a,isDisabled:r,onClick:d,ref:l,sx:{...r&&{pointerEvents:"none",opacity:.7}},children:[jsx("img",{src:Zi,alt:"p"}),jsx(ET,{isDisabled:r,children:c()}),jsx(Un,{component:"img",src:a?rj:Ui,alt:"a"}),a&&jsx(a$7,{onClick:d}),jsx(zR,{open:!!a,anchorEl:l.current,placement:"bottom-start",children:jsx(_s,{sx:{position:"absolute",top:8,left:0,display:a?"block":"none"},selectedCurrency:e,discount:o,setDiscount:m,setIsOpen:s,maxDiscount:Number(t)})})]})}var DT=memo(VB);var LT=styled(Rd)(({theme:e})=>({filter:"drop-shadow(0px 0px 28px rgba(0, 0, 0, 0.09))",borderRadius:"50%",backgroundColor:e.palette.common.white})),BT=styled(Un)(()=>({display:"flex",alignItems:"center",justifyContent:"center"}));function NT({data:e,width:t=51,height:o=51,...n}){let r=zc(useId(),"merchant-logo");return jsx(BT,{id:r,"data-testid":"MerchantLogo",width:t,height:o,children:jsx(LT,{data:e,width:t,height:o,...n})})}var VT=styled(Un,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:t})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,minHeight:32,minWidth:30,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:e.palette.common.white,":hover":{opacity:.7},...t&&{boxShadow:`0px 0px 4px 0px ${e.palette.info.dark}80`,border:`1px solid ${e.palette.info.dark}`,backgroundColor:`${e.palette.info.dark}0D`,gap:"6px",padding:"0 8px"}})),WT=styled(Un)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",minWidth:14,height:14,borderRadius:"50%",background:e.palette.background.gradient.shadedBlue,color:e.palette.common.white,fontSize:"8px",fontWeight:700,lineHeight:"14px",flexShrink:0})),HT=styled(Un)(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"2px","& img":{width:14,height:14}})),OT=styled(OB)(({theme:e})=>({marginTop:e.spacing(1),marginBottom:e.spacing(1),minWidth:193,"& .MuiPaper-root":{borderRadius:e.spacing(.5),"&>.MuiList-root":{padding:0}}})),_T=styled(j$1)(({theme:e})=>{let{grey:t}=e.v2.palette;return {fontWeight:e.v2.typography.fontWeightMedium,fontSize:"0.6875rem",color:t[500],paddingInlineStart:e.v2.spacing(16),paddingTop:e.v2.spacing(8),paddingBottom:e.v2.spacing(8),paddingInlineEnd:e.v2.spacing(8),borderBottom:`1px solid ${t[100]}`,display:"block"}}),_d=styled(Un)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",backgroundColor:e.palette.common.white,borderTop:`1px solid ${e.palette.divider}`})),zd=styled(Rb)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.info.dark}`,backgroundColor:e.palette.info.dark,fontWeight:700,fontSize:"11px",color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{color:"#fff !important",opacity:.5}})),$d=styled(Rb)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,fontWeight:500,fontSize:"11px",color:e.palette.text.primary,"&:hover":{background:"transparent"}}));var Ud=createContext(null);function $B(){let e=useContext(Ud);if(!e)throw new Error("useFilterDropdown must be used inside a FilterDropdown");return e}function $T({onConfirm:e,onCancel:t,isOkayButDisabled:o,children:n,isDisabled:r,icon:i,title:a,menuStyle:s,hideTitle:l=false,hideFooter:p=false,activeFiltersCount:d,onClearFilters:m,renderButton:c,onOpenChange:u,menuProps:f,...x}){let C=zc(useId(),"filter-dropdown"),[S,g]=useState(null),h=!!S,{t:w}=useTranslation(),b=()=>{g(null),u?.(false);},y=A=>{if(!r){if(!h){g(A.currentTarget),u?.(true);return}b();}},T=()=>{h&&(t?.(),b());},v=()=>{e?.(),b();},M=typeof d=="number"&&d>0,D=A=>{A.stopPropagation(),m?.();};return jsx(Ud.Provider,{value:{onConfirm:v,onCancel:T,onClose:b},children:jsx(KR,{onClickAway:T,children:jsxs(Un,{id:C,"data-testid":"FilterDropdown",...x,children:[jsx(VT,{className:"filter-button",isActive:h||M,onClick:y,sx:{...r&&{pointerEvents:"none",opacity:.5,...x.sx}},children:c??jsxs(Fragment,{children:[jsx(Un,{component:"img",src:i??$j,alt:"filter"}),M&&jsxs(Fragment,{children:[jsx(WT,{children:d}),jsx(HT,{onClick:D,"aria-label":"clear filters",children:jsx(Un,{component:"img",src:Eb,alt:"clear"})})]})]})}),jsxs(OT,{anchorEl:S,open:h,onClose:T,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{marginTop:"8px",marginBottom:"8px",width:193,...s},...f,children:[!l&&jsx(_T,{component:"span",children:a??w("filterBy")}),n,!p&&jsxs(_d,{children:[jsx($d,{onClick:T,children:w("cancel")}),jsx(zd,{disabled:o,onClick:v,children:w("okay")})]})]}),h&&jsx(a$7,{onClick:b})]})})})}var UT=styled(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),GT=styled(Un)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),YT=styled(Un)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),KT=styled(Un)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"178px"}));function jd({brand:e,merchantsIds:t,onChangeMerchant:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,anchorEl:i}){let[a,s]=useState(""),l=!!i,p=useCallback(S=>t.includes(S),[t]),d=(S,g)=>{if(S.stopPropagation(),p(g)){o?.(t.filter(w=>w!==g));return}let h=[...new Set([...t,g])];o?.(h);},m=S=>t.length===1&&t[0]===S&&n,c=S=>{s(S);},u=()=>{s("");},f=useMemo(()=>e.merchants??[],[e.merchants]),x=useMemo(()=>{if(!a?.trim())return f;let S=a.trim().toLowerCase();return f?.filter(g=>(g?.display_name??"").toLowerCase().includes(S)||(g?.legacy_id??"").toLowerCase().includes(S))},[a,f]),C=useMemo(()=>r?x:f,[x,f,r]);return jsxs(R,{open:l,anchorEl:i,placement:"right-start",children:[r&&f.length>1&&jsx(a$a,{placeholder:"Merchants",name:"merchants",value:a,onSearchChange:c,onSearchReset:u,sx:{px:"8px"}}),C?.map(S=>jsx(UT,{isDisabled:m(S.legacy_id),isSelected:p(S.legacy_id),onClick:g=>{m(S.legacy_id)||d(g,S.legacy_id);},sx:{maxHeight:36,minHeight:36},children:jsxs(GT,{children:[jsx(KT,{component:"span",children:S.display_name}),jsx(YT,{component:"span",children:S.legacy_id})]})},S?.legacy_id))]})}var Gs=jd;var qT=styled(Un)(()=>({display:"flex",gap:"4px",alignItems:"center",flex:1,marginInlineEnd:"8px"}));function Zd({brand:e,merchantsIds:t,isDisabled:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,renderBrandLogo:i,onChangeMerchant:a}){let[s,l]=useState(null),p=!!s,d=C=>{l(C.currentTarget);},m=()=>{l(null);},c=useMemo(()=>e.merchants?.filter(C=>t.includes(C.legacy_id)),[t,e.merchants]),u=useMemo(()=>c?.length===e.merchants?.length,[c?.length,e.merchants?.length]),f=useMemo(()=>!u&&c.length>0,[u,c]),x=C=>{if(C.stopPropagation(),u){a?.(t.filter(S=>!e.merchants.some(({legacy_id:g})=>S===g)));return}if(f){let S=[...new Set([...t,...c.map(({legacy_id:g})=>g)])];a?.(S);return}a?.([...t,...e.merchants.map(({legacy_id:S})=>S)]);};return jsxs(V,{isSelected:u,isIndeterminate:f,onMouseEnter:d,onMouseLeave:m,onClick:C=>{o||x(C);},isDisabled:o,sx:{maxHeight:35,minHeight:35,...p&&{boxShadow:"0px 0px 16px 0px #00000021"}},children:[jsxs(qT,{children:[i?.(e.logo),jsx(j$1,{sx:{fontSize:"11px"},children:ac(e.name)})]}),e.merchants?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(Gs,{anchorEl:s,brand:e,merchantsIds:t,onChangeMerchant:a,atLeastOneMerchantSelected:n,showSearchInput:r})]})}var ZT=Zd;function Jd({brands:e,isLoading:t,onFilterChange:o,merchantsIds:n=[],atLeastOneMerchantSelected:r=false,showSearchInput:i=false,hideCheckbox:a=false,renderBrandLogo:s}){let[l,p]=useState(null),[d,m]=useState(""),c=!!l,{t:u}=useTranslation(),f=M=>{p(M.currentTarget);},x=()=>{p(null);},C=useMemo(()=>e.length?e.every(M=>M.merchants?.every(({legacy_id:D})=>n.includes(D))):false,[n,e,a]),S=useMemo(()=>!C&&n.length>0,[n,C]),g=useMemo(()=>e.filter(M=>M.merchants?.some(D=>n?.includes(D.legacy_id))).length,[e,n]),h=()=>{if(C&&!r){o?.([]);return}let M=e.flatMap(D=>D.merchants?.map(({legacy_id:A})=>A));o?.(M);},w=t||!e?.length,b=M=>{m(M);},y=()=>{m("");},T=useMemo(()=>{if(!d.trim())return e;let M=d.trim().toLowerCase();return e.filter(D=>ac(D.name)?.toLowerCase()?.includes(M)||D.merchants?.some(A=>A.legacy_id?.toLowerCase().includes(M)))},[d,e]),v=useMemo(()=>i?T:e,[e,T,i]);return jsxs(V,{isDisabled:w,isSelected:C,startAdornment:a?null:void 0,isIndeterminate:S,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...c&&{boxShadow:"0px 0px 16px 0px #00000021"},...w&&{pointerEvents:"none",opacity:.5,cursor:"default"}},onMouseEnter:f,onMouseLeave:x,onClick:h,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:u("merchant")}),e.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),e?.length===1?jsx(Gs,{anchorEl:l,brand:e[0],merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i}):jsxs(R,{open:c,anchorEl:l,placement:"right-start",children:[i&&e.length>1&&jsx(a$a,{placeholder:"Brands",name:"brands",value:d,onSearchChange:b,onSearchReset:y,sx:{px:"8px"}}),v?.map(M=>jsx(ZT,{isDisabled:g===1&&r,brand:M,merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i,renderBrandLogo:s},M.id))]})]})}var eS=styled(Un)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"164px"}));function ak({retailersIds:e=[],isLoading:t,retailers:o=[],onFilterChange:n,atLeastOneRetailerSelected:r=false,showSearchInput:i=false,hideCheckbox:a=false}){let[s,l]=useState(null),p=!!s,{t:d,i18n:m}=useTranslation(),[c,u]=useState(""),f=A=>{l(A.currentTarget);},x=()=>{l(null);},C=useCallback(A=>e?.includes(A),[e]),S=useMemo(()=>o.length?o.every(A=>C(A.id)):false,[o,C,a]),g=useMemo(()=>!S&&e.length>0,[e,S]),h=()=>{if(S&&!r){n?.([]);return}n?.(o.map(A=>A.id));},w=A=>e.length===1&&e[0]===A&&r,b=(A,R)=>{if(A.stopPropagation(),w(R))return;if(C(R)){n?.(e.filter(V=>V!==R));return}let H=[...new Set([...e,R])];n?.(H);},y=t||!o?.length,T=A=>{u(A);},v=()=>{u("");},M=useMemo(()=>c?.trim()?o?.filter(A=>(A?.brand?.name?.[m.language]??A?.brand?.name?.en??"").toLowerCase().includes(c.trim().toLowerCase())):o,[c,o,m.language]),D=useMemo(()=>i?M:o,[M,o,i]);return jsxs(V,{isDisabled:y,isSelected:S,startAdornment:a?null:void 0,isIndeterminate:g,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...p&&{boxShadow:"0px 0px 16px 0px #00000021"},...y&&{opacity:.5,pointerEvents:"none",cursor:"default"}},onMouseEnter:f,onMouseLeave:x,onClick:h,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:d("retailers")}),o?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsxs(R,{open:p,anchorEl:s,placement:"right-start",sx:{height:300,width:200,overflow:"auto"},children:[i&&jsx(a$a,{placeholder:"Retailers",name:"retailers",value:c,onSearchChange:T,onSearchReset:v,sx:{px:"8px"}}),D?.map((A,R)=>jsx(V,{isSelected:C(A.id),isDisabled:t||w(A.id),onClick:H=>{b(H,A.id);},sx:{maxHeight:35,minHeight:35},children:jsx(eS,{children:A?.brand?.name?.[m.language]??A?.brand?.name?.en})},`key-${A?.id}-${R}`))]})]})}var nS=memo(ak);function dk({countriesIds:e=[],isLoading:t,countries:o=[],onFilterChange:n,atLeastOneCountrySelected:r=false,hideCheckbox:i=false}){let[a,s]=useState(null),l=!!a,{t:p}=useTranslation(),d=h=>{l||s(h.currentTarget);},m=()=>{l&&s(null);},c=useCallback(h=>e?.includes(h),[e]),u=useMemo(()=>o.length?o.every(h=>c(h)):false,[o,c]),f=useMemo(()=>!u&&e.length>0,[e,u]),x=()=>{if(!r){if(u){n?.([]);return}n?.(o);}},C=h=>e.length===1&&e[0]===h&&r,S=(h,w)=>{if(h.stopPropagation(),C(w))return;if(c(w)){n?.(e.filter(y=>y!==w));return}let b=[...new Set([...e,w])];n?.(b);},g=t||o?.length<=0||r;return jsxs(V,{isDisabled:g,isSelected:u,startAdornment:i?null:void 0,isIndeterminate:f,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...l&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:d,onMouseLeave:m,onClick:x,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:p("walletCountry")}),o?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:l,anchorEl:a,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((h,w)=>jsxs(V,{isSelected:c(h),isDisabled:t||C(h),onClick:b=>{S(b,h);},sx:{maxHeight:35,minHeight:35},children:[jsx(a$6,{countryCode:h}),jsx(j$1,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:La$1(h)})]},`key-${h}-${w}`))})]})}var aS=memo(dk);function xk({currenciesIds:e=[],isLoading:t,currencies:o=[],onFilterChange:n,atLeastOneCurrencySelected:r=false,hideCheckbox:i=false}){let[a,s]=useState(null),l=!!a,{t:p}=useTranslation(),d=h=>{l||s(h.currentTarget);},m=()=>{l&&s(null);},c=useCallback(h=>e?.includes(h),[e]),u=useMemo(()=>o.length?o.every(h=>c(h)):false,[o,c]),f=useMemo(()=>!u&&e.length>0,[e,u]),x=()=>{if(!r){if(u){n?.([]);return}n?.(o);}},C=h=>e.length===1&&e[0]===h&&r,S=(h,w)=>{if(h.stopPropagation(),C(w))return;if(c(w)){n?.(e.filter(y=>y!==w));return}let b=[...new Set([...e,w])];n?.(b);},g=t||o?.length<=0||r;return jsxs(V,{isDisabled:g,isSelected:u,startAdornment:i?null:void 0,isIndeterminate:f,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...l&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:d,onMouseLeave:m,onClick:x,children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:p("currency")}),o?.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:l,anchorEl:a,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((h,w)=>oo[h]?.country?jsxs(V,{isSelected:c(h),isDisabled:t||C(h),onClick:y=>{S(y,h);},sx:{maxHeight:35,minHeight:35},children:[jsx(a$6,{countryCode:oo[h].country})," ",jsx(j$1,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:h})]},`key-${h}-${w}`):null)})]})}var pS=memo(xk);var Ck=(r=>(r.BRAND="BRAND",r.COUNTRY="COUNTRY",r.ENTITY="ENTITY",r.MERCHANT="MERCHANT",r))(Ck||{});var hk="/",ai=5,mS=(...e)=>e.join(hk),Qd=e=>[e.label,e.id],dS=(e,t)=>{if(e.levelKey==="MERCHANT")return e.id.toLowerCase().includes(t)?e:null;let o=(e.children??[]).map(i=>dS(i,t)).filter(i=>i!==null);if(!o.length)return null;let{searchProps:n,...r}=e;return {...r,children:o,...o.length>=ai&&{searchProps:n}}},cS=(e,t,o)=>{let n=e.map(r=>{let i=r.entities??[],s=Array.from(new Set(i.map(l=>l.country).filter(Boolean))).map(l=>{let d=i.filter(m=>m.country===l).map(m=>{let u=(m.merchants??[]).map(f=>({id:f.legacy_id,label:f.display_name,levelKey:"MERCHANT",status:t.includes(f.legacy_id)?"CHECKED":"UNCHECKED",hintText:f.legacy_id}));return {id:mS(r.id,l,m.id),label:ac(m.legal_name,o)??m.id,levelKey:"ENTITY",children:u,header:"Merchants",...u.length>=ai&&{searchProps:{getValues:Qd}}}});return {id:mS(r.id,l),label:La$1(l)??l,levelKey:"COUNTRY",children:d,header:"Entities",iconComponent:jsx(a$6,{countryCode:l,width:14}),...d.length>=ai&&{searchProps:{getValues:Qd}}}});return {id:r.id,label:ac(r.name,o)??r.id,levelKey:"BRAND",children:s,header:"Countries",icon:{fileId:r.logo},...s.length>=ai&&{searchProps:{getValues:Qd}}}});return {levelKey:"BRAND",children:n,header:"Brands",...n.length>=ai&&{searchProps:{filterItem:(r,i)=>(typeof r.label=="string"?r.label.toLowerCase():"").includes(i)?r:dS(r,i)}}}};var Sk=e=>{let{brands:t,isLoading:o,initialValue:n,onFilterChange:r,BrandLogoComponent:i,hideCheckbox:a}=e,[s,l]=useState(null),[p,d]=useState("UNCHECKED"),m=useRef(null),c=!!s,{t:u,i18n:f}=useTranslation(),x=useMemo(()=>cS(t,n,f.language),[t,n,f.language]),C=x.children??[],S=o||!C.length,g=useCallback(y=>{let T=y.filter(M=>M.status==="CHECKED"),v=y.filter(M=>M.status==="INDETERMINATE");return T.length===C.length?"CHECKED":v.length>0||T.length>0?"INDETERMINATE":"UNCHECKED"},[C]),h=useCallback(({selectedTree:y})=>{d(g(y));},[g]),w=useCallback(y=>{d(g(y));let T=Me.filterNodesByLevelKey(y,"MERCHANT").map(({id:v})=>v);r?.(T);},[r,g]),b=useCallback(()=>{m.current?.toggleAll(p!=="CHECKED");},[p]);return jsxs(V,{startAdornment:a?null:void 0,isSelected:p==="CHECKED",isIndeterminate:p==="INDETERMINATE",isDisabled:S,onMouseEnter:y=>l(y.currentTarget),onMouseLeave:()=>l(null),onClick:b,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...c&&{boxShadow:"0px 0px 16px 0px #00000021"},...S&&{pointerEvents:"none",opacity:.5,cursor:"default"}},children:[jsx(j$1,{sx:{fontSize:"11px",flex:1},children:u("merchant")}),t.length>0&&jsx("img",{src:vb,alt:"arrow",style:{height:12}}),!o&&jsx(oc,{ref:m,placement:"right-start",anchorEl:s,exposeOnlySelectedTree:true,treeDefinition:x,onChange:w,onMounted:h,IconComponent:i})]})},fS=Sk;var vk=fS;function gS({onPhoneChange:e,onCountryChange:t,selectedPhone:o,selectedCountry:n,countriesOptions:r,isCountriesLoading:i}){let a=zc(useId(),"phone-filter");return jsx(h$3,{id:a,"data-testid":"ColumnFilterInputs_PhoneInput",phoneValue:o,onPhoneChange:s=>{e(s);},countryValue:n,onCountryChange:s=>{t(s?.countryId);},countries:r||[],isCountriesLoading:i||false,hasError:false,disabled:i,placeholder:"User Mobile",sx:{"&.MuiInputBase-root":{paddingLeft:"0px !important"}}})}var CS=styled(Un)(()=>({position:"relative",flexGrow:0})),hS=styled(Un)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,display:"flex",padding:e.spacing(1),gap:e.spacing(1),border:`1px solid ${e.palette.divider}`,borderRadius:"4px",backgroundColor:e.palette.common.white,alignItems:"center",height:32,textTransform:"capitalize",cursor:"pointer"})),yS=styled(t)(({theme:e})=>({width:16,height:16,cursor:"pointer",fontSize:"5.667px",color:e.palette.common.white,fontWeight:500,border:`1px solid ${e.palette.common.white}`}));var IS=styled(Un)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,display:"flex",position:"relative",paddingInline:"8px",alignItems:"center",borderRadius:"4px",height:"40px"}));styled(Un)(()=>({display:"flex",alignItems:"center"}));var io=styled(Un)(({theme:e})=>({padding:"8px",display:"flex",flexDirection:"column",gap:"8px",position:"relative",background:e.palette.common.white,borderRadius:"4px",width:"max-content",maxWidth:230,boxShadow:e.shadows[3]})),On=styled(Rb)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",textTransform:"capitalize",padding:"8px 13px",minWidth:89,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,color:e.palette.common.white,textAlign:"center","&.Mui-disabled":{backgroundColor:alpha(e.palette.grey[700],.5),color:e.palette.common.white,cursor:"not-allowed"},"&:hover":{background:e.palette.info.dark}})),be=styled(a$2,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}})),bS=styled(a$1,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}})),pe=styled(a$3)(()=>({borderTopLeftRadius:0,borderTopRightRadius:0,height:25}));var TS=Te.object().shape({email:Te.string().matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,"invalidEmail").required("requiredEmail"),firstName:Te.string().required("requiredFirstName").min(3,"invalidFirstName"),lastName:Te.string().required("requiredLastName").min(3,"invalidLastName")}),js=e=>Te.object().shape({email:Te.string().transform((t,o)=>{if(o!=="")return t}).matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i,"invalidEmail").optional(),phoneNumber:Te.string().transform((t,o)=>{if(o)return t}).length(e,"invalidMobile").optional(),firstName:Te.string().min(3,"invalidFirstName").required("requiredFirstName"),lastName:Te.string().min(3,"invalidLastName").required("requiredLastName")}).test("atLeastOne","atLeastOne",function(o,n){let{email:r,phoneNumber:i}=this.originalValue??{};return !r&&!i?n.createError({message:"atLeastOne"}):true}),SS=e=>Te.object().shape({firstName:Te.string().required("requiredFirstName").min(3,"invalidFirstName"),lastName:Te.string().required("requiredLastName").min(3,"invalidLastName"),phoneNumber:Te.string().length(e,"invalidMobile").required("requiredMobile")});function Nk({customer:e,country:t,defaultCountry:o,countries:n,isCountriesLoading:r,onCustomerChange:i,onCountryChange:a,isCustomerNotValid:s}){let l=zc(useId(),"customer-full-info"),p=useRef(),d=useRef(),m=useRef(),c=useRef(),{t:u}=useTranslation(),{control:f,watch:x,formState:{errors:C,isValid:S}}=useForm({mode:"onChange",resolver:yupResolver(js(t.max_digits)),defaultValues:{firstName:e.firstName,email:e.email,lastName:e.lastName,phoneNumber:e.phoneNumber}});useEffect(()=>{x(({firstName:w="",lastName:b="",email:y="",phoneNumber:T=""})=>{i({firstName:w,lastName:b,email:y,phoneNumber:T});});},[x,C,e]);let g=useCallback(()=>C.firstName?.message??C.lastName?.message??C.email?.message??C.phoneNumber?.message,[C]);return useEffect(()=>{s?.(!S,g());},[S,g]),jsxs(io,{id:l,"data-testid":"CustomerFullInfo",onMouseLeave:w=>{w.stopPropagation();},children:[jsx(Controller,{control:f,name:"firstName",render:({field:{ref:w,...b},fieldState:{error:y}})=>jsxs(Un,{ref:p,children:[jsx(be,{...b,placeholder:u("firstName"),inputProps:{autoComplete:"off"},error:!!y?.message}),y?.message&&jsx(pe,{error:u(y.message)})]})},"fullInfoFirstName"),jsx(Controller,{control:f,name:"lastName",render:({field:{ref:w,...b},fieldState:{error:y}})=>jsxs(Un,{ref:d,children:[jsx(be,{...b,placeholder:u("lastName"),inputProps:{autoComplete:"off"},error:!!y?.message}),y?.message&&jsx(pe,{error:u(y.message)})]})},"fullInfoLastName"),jsx(Controller,{control:f,name:"email",render:({field:{ref:w,...b},fieldState:{error:y}})=>jsxs(Un,{ref:m,children:[jsx(be,{...b,placeholder:u("email"),inputProps:{autoComplete:"off"},error:!!y?.message}),y?.message&&jsx(pe,{error:u(y.message)})]})},"fullInfoEmail"),jsx(Controller,{control:f,name:"phoneNumber",render:({field:{ref:w,...b},fieldState:{error:y}})=>jsxs(Un,{ref:c,children:[jsxs(IS,{sx:{...y?.message&&{borderBottom:"none"}},children:[jsx(d$3,{defaultCountry:t?.iso2??o?.code??"SA",value:t,onChangeCountry:a,countries:n,isLoading:r}),jsx(bS,{...b,placeholder:u("mobile"),inputProps:{autoComplete:"off"},error:!!y?.message,sx:{border:"none",paddingInlineEnd:0},hideArrows:true})]}),y?.message&&jsx(pe,{error:u(y.message,{numberLen:t.max_digits})})]})},"fullInfoPhoneNumber")]})}var vS=Nk;function zk({...e}){let t=zc(useId(),"customer-dropdown"),[o,n]=useState(null),{firstName:r,lastName:i}=e.customer,{t:a}=useTranslation(),s=!!o,l=m=>{s||n(m.currentTarget);},p=()=>{s&&n(null);},d=useMemo(()=>Aa$1(),[]);return jsxs(CS,{id:t,"data-testid":"CustomerDropdown",sx:{...e.isDisabled&&{pointerEvents:"none",opacity:.7}},children:[jsxs(hS,{onClick:l,children:[(!r||!i)&&jsxs(Fragment,{children:[jsx("img",{src:vj,alt:"c"}),jsx("span",{children:a("customer")})]}),r&&i&&jsxs(Fragment,{children:[jsx(yS,{src:"#",alt:"a",sx:{background:d},children:`${r[0]?.toUpperCase()}${i[0]?.toUpperCase()||""}`}),`${r} ${i}`]})]}),s&&jsx(a$7,{onClick:p}),jsx(zR,{open:s,anchorEl:o,placement:"bottom-start",children:jsx(vS,{...e})})]})}var ES=memo(zk);function jk({submitButtonText:e,onSubmit:t,customer:o,isItemsNotValid:n,items:r,onCustomerChange:i}){let a=zc(useId(),"customer-email-form"),s=useRef(),l=useRef(),p=useRef(),{t:d}=useTranslation(),{control:m,formState:{isValid:c,errors:u},watch:f,trigger:x}=useForm({mode:"onChange",resolver:yupResolver(TS),defaultValues:{firstName:o.firstName,email:o.email,lastName:o.lastName}});return useEffect(()=>{o.firstName&&o.email&&o.lastName&&x();},[]),useEffect(()=>{f(({firstName:S="",lastName:g="",email:h=""})=>{i({...o,email:h,firstName:S,lastName:g});});},[f,u,o]),jsxs(io,{id:a,"data-testid":"CustomerEmailForm",onMouseLeave:S=>{S.stopPropagation();},children:[jsx(Controller,{control:m,name:"email",render:({field:{ref:S,...g},fieldState:{error:h}})=>jsxs(Un,{ref:p,children:[jsx(be,{...g,"data-testid":"EmailForm_email",placeholder:d("email"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(pe,{error:d(h.message)})]})}),jsx(Controller,{control:m,name:"firstName",render:({field:{ref:S,...g},fieldState:{error:h}})=>jsxs(Un,{ref:s,children:[jsx(be,{...g,"data-testid":"EmailForm_firstName",placeholder:d("firstName"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(pe,{error:d(h.message)})]})}),jsx(Controller,{control:m,name:"lastName",render:({field:{ref:S,...g},fieldState:{error:h}})=>jsxs(Un,{ref:l,children:[jsx(be,{...g,"data-testid":"EmailForm_lastName",placeholder:d("lastName"),inputProps:{autoComplete:"off",form:{autoComplete:"off"}},error:!!h?.message}),h?.message&&jsx(pe,{error:d(h.message)})]})}),jsx(On,{type:"button","data-testid":"EmailForm_submit",onClick:t,disabled:!c||n||!r.length,children:e})]})}var AS=memo(jk);function Qk({submitButtonText:e,onSubmit:t,customer:o,country:n,items:r,isItemsNotValid:i,defaultCountry:a,countries:s,isCountriesLoading:l,onCustomerChange:p,onCountryChange:d}){let m=useRef(),c=useRef(),u=useRef(),f=useRef(),{t:x}=useTranslation(),{control:C,watch:S,trigger:g,formState:{isValid:h,errors:w}}=useForm({mode:"onChange",resolver:yupResolver(js(n.max_digits)),defaultValues:{firstName:o.firstName,email:o.email,lastName:o.lastName,phoneNumber:o.phoneNumber}});return useEffect(()=>{S(({firstName:b="",lastName:y="",email:T="",phoneNumber:v=""})=>{p({email:T,firstName:b,lastName:y,phoneNumber:v});});},[S,w,o]),useEffect(()=>{o.firstName&&o.lastName&&(o.email||o.phoneNumber)&&g();},[]),jsxs(io,{onMouseLeave:b=>{b.stopPropagation();},children:[jsx(Controller,{control:C,name:"firstName",render:({field:{ref:b,...y},fieldState:{error:T}})=>jsxs(Un,{ref:m,children:[jsx(be,{...y,placeholder:x("firstName"),inputProps:{autoComplete:"off"},error:!!T?.message}),T?.message&&jsx(pe,{error:x(T.message)})]})},"fullInfoFormFirstName"),jsx(Controller,{control:C,name:"lastName",render:({field:{ref:b,...y},fieldState:{error:T}})=>jsxs(Un,{ref:c,children:[jsx(be,{...y,placeholder:x("lastName"),inputProps:{autoComplete:"off"},error:!!T?.message}),T?.message&&jsx(pe,{error:x(T.message)})]})},"fullInfoFormLastName"),jsx(Controller,{control:C,name:"email",render:({field:{ref:b,...y},fieldState:{error:T}})=>jsxs(Un,{ref:u,children:[jsx(be,{...y,placeholder:x("email"),inputProps:{autoComplete:"off"},error:!!T?.message}),T?.message&&jsx(pe,{error:x(T.message)})]})},"fullInfoFormEmail"),jsx(Controller,{control:C,name:"phoneNumber",render:({field:{ref:b,...y},fieldState:{error:T}})=>jsxs(Un,{ref:f,children:[jsxs(b$5,{sx:{...T?.message&&{borderBottom:"none"}},children:[jsx(d$3,{defaultCountry:n?.iso2??a?.code??"SA",value:n,onChangeCountry:d,countries:s,isLoading:l}),jsx(c$1,{...y,placeholder:x("mobile"),inputProps:{autoComplete:"off"},error:!!T?.message,sx:{border:"none",paddingInlineEnd:0},hideArrows:true})]}),T?.message&&jsx(pe,{error:x(T.message,{numberLen:n.max_digits})})]})}),jsx(On,{onClick:t,disabled:!h||i||!r.length,children:e})]})}var RS=memo(Qk);function iN({submitButtonText:e,onSubmit:t,customer:o,country:n,isItemsNotValid:r,items:i,defaultCountry:a,countries:s,isCountriesLoading:l,onCustomerChange:p,onCountryChange:d}){let m=zc(useId(),"customer-phone-number-form"),c=useRef(),u=useRef(),f=useRef(),{t:x}=useTranslation(),{control:C,formState:{isValid:S,errors:g},watch:h,trigger:w}=useForm({mode:"onChange",resolver:yupResolver(SS(n.max_digits)),defaultValues:{firstName:o.firstName,phoneNumber:o.phoneNumber,lastName:o.lastName}});return useEffect(()=>{o.firstName&&o.phoneNumber&&o.lastName&&w();},[]),useEffect(()=>{h(({firstName:y="",lastName:T="",phoneNumber:v=""})=>{p({...o,firstName:y,lastName:T,phoneNumber:v});});},[h,g,o]),jsxs(io,{id:m,"data-testid":"CustomerPhoneNumberForm",onMouseLeave:y=>{y.stopPropagation();},children:[jsx(Controller,{control:C,name:"phoneNumber",render:({field:{ref:y,...T},fieldState:{error:v}})=>jsxs(Un,{ref:f,children:[jsxs(b$5,{sx:{...v?.message&&{borderBottom:"none"}},children:[jsx(d$3,{defaultCountry:n?.iso2??a?.code??"SA",value:n,onChangeCountry:d,countries:s,isLoading:l}),jsx(c$1,{...T,placeholder:x("mobile"),error:!!v?.message,sx:{border:"none",paddingInlineEnd:0},inputProps:{autoComplete:"off",form:{autoComplete:"off"}},hideArrows:true})]}),v?.message&&jsx(pe,{error:x(v.message,{numberLen:n.max_digits})})]})},"phoneNumberFormPhone"),jsx(Controller,{control:C,name:"firstName",render:({field:{ref:y,...T},fieldState:{error:v}})=>jsxs(Un,{ref:c,children:[jsx(be,{...T,placeholder:x("firstName"),inputProps:{autoComplete:"off"},error:!!v?.message}),v?.message&&jsx(pe,{error:x(v.message)})]})},"phoneNumberFormFirstName"),jsx(Controller,{control:C,name:"lastName",render:({field:{ref:y,...T},fieldState:{error:v}})=>jsxs(Un,{ref:u,children:[jsx(be,{...T,placeholder:x("lastName"),inputProps:{autoComplete:"off"},error:!!v?.message}),v?.message&&jsx(pe,{error:x(v.message)})]})},"phoneNumberFormLastName"),jsx(On,{onClick:t,disabled:!S||r||!i.length,children:e})]})}var BS=memo(iN);var li=styled(Un)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",cursor:"pointer",padding:"8px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,borderRadius:"4px",fontSize:"14px",fontWeight:500,".logo":{width:17},color:e.palette.text.primary,height:32})),kS=styled(Un)(({theme:e})=>({width:109,boxShadow:e.shadows[9],backgroundColor:e.palette.common.white,borderRadius:"4px",fontSize:"14px",fontWeight:500,color:e.palette.text.primary,maxHeight:210,overflow:"auto",marginTop:"8px",".currecy+.currency":{marginTop:"4px"}})),NS=styled(Un)(({theme:e})=>({display:"flex",alignItems:"center",paddingInlineStart:e.spacing(1),paddingInlineEnd:e.spacing(2),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),gap:"4px",cursor:"pointer",height:42,".logo":{width:20,borderRadius:"2px",border:`1px solid ${e.palette.divider}`},"&:hover":{boxShadow:e.shadows[4]}})),FS=styled(Un)(({theme:e})=>({fontSize:"14px",fontWeight:500,color:e.palette.text.primary,textTransform:"uppercase",display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"8px",img:{width:17,borderRadius:"4px"}}));function pi({selectedCurrencyCode:e}){let t=zc(useId(),"selected-currency");return jsxs(FS,{id:t,"data-testid":"SelectedCurrency",sx:{padding:0},children:[jsx(a$6,{currencyCode:e}),jsxs("span",{children:[" ",e]})]})}function cN({merchantCurrencies:e,isLoading:t,onChangeCurrency:o,isDisabled:n,selectedCurrency:r}){let i=zc(useId(),"merchant-currency-dropdown"),[a,s]=useState(null),l=!!a,p=c=>{l||s(c.currentTarget);},d=()=>{l&&s(null);},m=c=>{o?.(c),d();};return t||!e?jsxs(li,{sx:{pointerEvents:"none"},children:[jsx(j$1,{sx:{fontSize:"11px"},children:"Select"}),t?jsx(a$b,{}):jsx(Un,{component:"img",src:uj,alt:"c",sx:{marginTop:"2px"}})]}):e.length===0?jsxs(li,{sx:{pointerEvents:"none",opacity:.5},children:[jsx(j$1,{sx:{fontSize:"11px"},children:"Select"}),jsx(Un,{sx:{width:25,textAlign:"center"},children:jsx(Un,{component:"img",src:uj,alt:"c",sx:{marginTop:"2px"}})})]}):e.length===1?jsx(li,{sx:{border:"none",pointerEvents:"none"},children:jsx(pi,{selectedCurrencyCode:e?.[0]?.code?.english??""})}):jsxs(li,{id:i,"data-testid":"MerchantCurrencyDropdown",onClick:p,sx:{...n&&{pointerEvents:"none",opacity:.7}},children:[jsx(pi,{selectedCurrencyCode:r?.code?.english??""}),jsx(Un,{component:"img",src:uj,alt:"c",sx:{marginTop:"2px",...l&&{transform:"rotate(180deg)"}}}),l&&jsx(a$7,{onClick:d}),jsx(zR,{open:l,anchorEl:a,placement:"bottom-start",children:jsx(kS,{children:e.map((c,u)=>jsx(NS,{className:"currency",onClick:()=>{m(c);},children:jsx(pi,{selectedCurrencyCode:c.code.english})},`${c.symbol}-${u}`))})})]})}var uN=memo(cN);var HS=styled(Un,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:t})=>({display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:t?e.palette.grey[400]:e.palette.common.white,...t&&{cursor:"default",pointerEvents:"none"}})),OS=styled(j$1)(({theme:e})=>({color:e.v2.palette.grey[500],fontSize:"10px",fontWeight:500,marginBottom:"8px",margin:0}));var gN=(e,t)=>e.name===t.name&&e.size===t.size,_S=(e,t)=>t?.length?t.some(o=>Xb(o)?gN(o.file,e):o.name===e.name):false;function TN({options:e,error:t,files:o,label:n,disabled:r,hideUpload:i=false,preventDuplicates:a,onChangeFiles:s,onRemoveFile:l,renderBrandLogo:p,renderOpenFileInNewTab:d}){let m=zc(useId(),"file-input-preview"),{t:c}=useTranslation(),[u,f]=useState(null),{getRootProps:x,getInputProps:C,open:S,isDragReject:g,fileRejections:h}=useDropzone({...e,disabled:r||e?.disabled}),w=Wb(e?.maxSize||0,0).toUpperCase(),b=useMemo(()=>{let v=h.length&&h[0].errors.some(D=>D.code==="file-invalid-type"),M=h.length&&h[0].errors.some(D=>D.code==="file-too-large");return g||v?c("invalidFileType"):M?`File is larger than ${w}`:u||t},[g,t,h,u,c,w]);return jsxs(HS,{id:m,"data-testid":"FileInputPreview",disabled:r,children:[jsx(OS,{children:n}),jsx(h$1,{files:o,onRemoveFile:l,disabled:r,getFilePreview:v=>v.type.includes("image")?URL.createObjectURL(v):v.name.includes(".pdf")?We:v.name,renderBrandLogo:p,renderOpenFileInNewTab:d}),!i&&jsx(a$c,{getRootProps:x,getInputProps:C,open:S,onChangeFiles:s,processFiles:v=>{if(f(null),!a)return v.map(A=>({file:A,id:A.name}));let{duplicates:M,uniqueFiles:D}=v.reduce((A,R)=>(_S(R,o)?A.duplicates.push(R.name):A.uniqueFiles.push({file:R,id:R.name}),A),{duplicates:[],uniqueFiles:[]});if(M.length>0){let A=M.length===1?"file":"files";f(`Duplicate ${A} detected: ${M.join(", ")}`);}return D},disabled:r,errorMessage:b,maxFileSize:w,preventDuplicates:a})]})}var SN=memo(TN);var zS=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,width:"100%",height:"100%",overflow:"auto"}));function fc({isOpen:e,receipt:t,order:o,appWindow:n,onClose:r}){let i=zc(useId(),"receipt-viewer"),{width:a}=a$r();return jsx(r$2,{isOpen:e,onClose:()=>r(t.id),initialPosition:{x:a-1e3+20*o},windowProps:{titleBarText:"Receipt",mainAppIsMinimized:n?.isMinimized,mainAppOrder:n?.order,showSectionsButton:false},defaultWindowWidth:502,defaultWindowHeight:745,children:jsx(zS,{id:i,"data-testid":"ReceiptViewer",children:jsx(Un,{sx:{height:715,overflow:"auto"},dangerouslySetInnerHTML:{__html:wc$1(t.content)}})})})}function US({receipts:e,onCloseReceipt:t,appWindow:o}){return e.length?jsx(Fragment,{children:e.map((n,r)=>jsx(fc,{order:r,isOpen:true,onClose:i=>t(i),receipt:n,appWindow:o},n.id))}):null}var al=styled(Un)(({theme:e})=>({borderRadius:"50%",background:e.palette.divider,width:13,height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px"})),mi=styled(Un)(()=>({display:"flex",alignItems:"center",gap:"4px",".arrow-icon":{height:12}})),sl=styled(Un)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center"})),GS=styled(Un)(()=>({display:"flex",flexDirection:"column"})),YS=styled(Un,{shouldForwardProp:e=>e!=="isOpen"})(({isOpen:e,theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"5px",cursor:"pointer",padding:"8px",border:`1px solid ${t.palette.divider}`,color:t.palette.text.primary,background:t.palette.common.white,borderRadius:"4px",height:32,width:"fit-content",minWidth:"89px",img:{marginTop:"1px"},...e&&{borderColor:t.palette.info.dark},"&:hover":{background:t.palette.divider}})),KS=styled(XS)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:e.palette.text.primary})),jS=styled("img",{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:t})=>({transform:t?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})})),qS=styled(Un)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"})),Gn=styled(R)({"& .MuiPopper-dropdown":{maxHeight:700,overflow:"visible"}});var gc=styled(V)({"--menuitem-border-rad":"4px",backgroundColor:"#fff",minHeight:36,"&:first-of-type":{borderTopLeftRadius:"var(--menuitem-border-rad)",borderTopRightRadius:"var(--menuitem-border-rad)"},"&:last-of-type":{borderBottomLeftRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"},"&.Mui-Submenu-open":{borderTopRightRadius:0,borderBottomRightRadius:0,"&.Mui-Submenu-flipped":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"}},"&.Mui-selected":{boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.13)",zIndex:1}}),di=styled(gc)({"&:first-of-type":{borderTopLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)","&.Mui-flipped":{borderTopLeftRadius:"var(--menuitem-border-rad)",borderTopRightRadius:0}},"&:last-of-type":{borderBottomLeftRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"},"&.Mui-Submenu-open":{borderTopRightRadius:0,borderBottomRightRadius:0,"&.Mui-Submenu-flipped":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"}},"&.Mui-only-one":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)","&.Mui-flipped":{borderTopLeftRadius:"var(--menuitem-border-rad)",borderBottomLeftRadius:"var(--menuitem-border-rad)",borderTopRightRadius:0,borderBottomRightRadius:0},"&.Mui-Submenu-open":{borderTopRightRadius:0,borderBottomRightRadius:0,"&.Mui-Submenu-flipped":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:"var(--menuitem-border-rad)",borderBottomRightRadius:"var(--menuitem-border-rad)"}}}});styled(di)({backgroundColor:"#FAFAFA",color:"#8D8D94",padding:"10px 16px",borderBottom:"1px solid #F2F2F2"});var kN=e=>{let{merchant:t,selectedValue:o,onClick:n,onlyOne:r,menuFlipped:i}=e,a=t.id===o?.merchantId,s=useMemo(()=>{let l=[];return a&&l.push("Mui-selected"),r&&l.push("Mui-only-one"),i&&l.push("Mui-flipped"),l.join(" ")},[a,r,i]);return jsxs(di,{"data-testid":"MerchantItem",className:s,sx:{py:"4.5px",pl:1,pr:2},onClick:n,startAdornment:null,children:[a?jsx("img",{src:Pc,alt:"Selected"}):jsx(Un,{width:15}),jsxs(GS,{children:[jsx(XS,{component:"span",fontSize:11,children:t.display_name}),jsx(XS,{color:l=>alpha(l.palette.text.primary,.5),fontSize:8,children:t.legacy_id})]})]},t.id)},QS=kN;var FN=e=>{let{items:t,value:o,onItemClick:n,menuFlipped:r}=e,i=t.length===1,a=useMemo(()=>{let s=[];return i&&s.push("Mui-only-one"),r&&s.push("Mui-flipped"),s.join(" ")},[i,r]);return jsx(Fragment,{children:t.map(s=>jsx(QS,{className:a,onlyOne:t.length===1,selectedValue:o,merchant:s,onClick:l=>n?.(l,s),menuFlipped:r},s.id))})},pl=FN;var tw=e=>e?.length===1?e[0]:void 0,ow=e=>{let t=(e.entities??[]).flatMap(o=>(o.merchants??[]).map(n=>({entityId:o.id,merchant:n})));return t.length===1?t[0]:void 0},nw=e=>e.reduce((o,n)=>o+(n.entities??[]).reduce((r,i)=>r+(i.merchants?.length??0),0),0)===1;function _N(e){let{entity:t,brandId:o,selectedValue:n,onValueChange:r,onlyOne:i,menuFlipped:a}=e,[s,l]=useState(null),{i18n:p}=useTranslation(),[d,m]=useState(false),c=!!s,u=(t.merchants?.length??0)>0,f=useMemo(()=>tw(t.merchants),[t.merchants]),x=!!f,C=o===n?.brandId&&t.id===n?.entityId,S=useCallback(y=>{u&&!x&&l(y.currentTarget);},[u,x]),g=useCallback(()=>{s&&l(null);},[s]),h=useCallback((y,T)=>{r({merchantId:T.id,brandId:o,entityId:y,legacyId:T.legacy_id});},[o,r]),w=useCallback(y=>{f&&(y.stopPropagation(),h(t.id,f));},[t.id,h,f]),b=useMemo(()=>{let y=[];return C&&y.push("Mui-selected"),i&&y.push("Mui-only-one"),a&&y.push("Mui-flipped"),c&&y.push("Mui-Submenu-open"),d&&y.push("Mui-Submenu-flipped"),y.join(" ")},[C,c,d,i,a]);return jsxs(di,{"data-testid":"EntityItem",className:b,onClick:w,onMouseEnter:S,onMouseLeave:g,startAdornment:null,children:[jsxs(sl,{children:[jsxs(mi,{children:[C?jsx("img",{src:Pc,alt:"Selected"}):jsx(Un,{width:15}),jsx(a$6,{countryCode:t.country}),jsx("span",{children:ac(t.legal_name,p.language)})]}),u&&!x&&jsxs(mi,{children:[jsx(al,{children:t.merchants?.length}),jsx("img",{src:vb,className:"arrow-icon",alt:"Expand"})]})]}),jsx(Gn,{open:c&&!x,anchorEl:s,placement:"right-start",modifiers:[{name:"placementTracker",enabled:true,phase:"write",fn({state:y}){m(y.placement==="left-start");}}],sx:{"& .MuiPopper-dropdown":{minWidth:"141px"}},children:jsx(pl,{items:t.merchants||[],onItemClick:(y,T)=>{y.stopPropagation(),h(t.id,T);},menuFlipped:d,value:n})})]})}var aw=memo(_N);var zN=e=>{let{items:t,brand:o,value:n,onChange:r,menuFlipped:i}=e;return jsx(Fragment,{children:t.map(a=>jsx(aw,{entity:a,brandId:o.id,selectedValue:n,onValueChange:r,onlyOne:t.length===1,menuFlipped:i},a.id))})},lw=zN;function jN({brand:e,onClose:t,selectedValue:o,onValueChange:n,renderBrandLogo:r}){let[i,a]=useState(null),{i18n:s}=useTranslation(),[l,p]=useState(false),d=!!i,m=(e.entities?.length??0)>0,c=e.id===o?.brandId,u=useMemo(()=>ow(e),[e]),f=!!u,x=useCallback(y=>{m&&!f&&a(y.currentTarget);},[m,f]),C=useCallback(()=>{i&&a(null);},[i]),S=useMemo(()=>{let y=[];return c&&y.push("Mui-selected"),d&&y.push("Mui-Submenu-open"),l&&y.push("Mui-Submenu-flipped"),y.join(" ")},[c,d,l]),g=e.entities?.length===1,h=e.entities?.[0],w=useCallback((y,T)=>{n({merchantId:T.id,brandId:e.id,entityId:y,legacyId:T.legacy_id}),t();},[e.id,n,t]),b=useCallback(y=>{!f||!u||(y.stopPropagation(),w(u.entityId,u.merchant));},[w,f,u]);return jsxs(gc,{"data-testid":"BrandItem",className:S,onClick:b,onMouseEnter:x,onMouseLeave:C,startAdornment:null,children:[jsxs(sl,{sx:{gap:"2.5px"},"data-testid":"Content",children:[c?jsx("img",{src:Pc,alt:"Selected"}):jsx(Un,{width:15}),r?.(e.logo),jsx(XS,{flex:1,noWrap:true,fontSize:"inherit",component:"span",children:ac(e.name,s.language)}),m&&!f&&jsxs(mi,{children:[jsx(al,{children:g?h?.merchants?.length:e.entities.length}),jsx("img",{src:wb$1,height:10,className:"arrow-icon",alt:"Expand"})]})]}),jsx(Gn,{open:d&&!f,anchorEl:i,placement:"right-start",modifiers:[{name:"placementTracker",enabled:true,phase:"write",fn({state:y}){p(y.placement==="left-start");}}],sx:{"& .MuiPopper-dropdown":{minWidth:"157px"}},children:g?jsx(pl,{items:h?.merchants||[],onItemClick:(y,T)=>{y.stopPropagation(),w(h?.id,T);},menuFlipped:l,value:o}):jsx(lw,{items:e.entities,value:o,onChange:y=>{t(),n(y);},brand:e,menuFlipped:l})})]})}var dw=memo(jN);var uw=()=>{let[e,t]=useState(null),o=!!e,n=useCallback(i=>{t(i.currentTarget);},[]),r=useCallback(()=>{t(null);},[]);return {anchorElement:e,isOpen:o,openMenu:n,closeMenu:r}},fw=(e,t,o)=>{useEffect(()=>{if(t?.merchantId)return;let n=e.find(a=>a.entities?.length>0&&a.entities.some(s=>(s.merchants?.length??0)>0));if(!n)return;let r=n.entities.find(a=>(a.merchants?.length??0)>0);if(!r?.merchants?.[0])return;let i=r.merchants[0];o({merchantId:i.id,brandId:n.id,entityId:r.id,legacyId:i.legacy_id});},[e,t?.merchantId,o]);};var oF=({isLoading:e,isSingleMerchant:t,isOpen:o})=>e?jsx(a$b,{}):t?null:jsx(jS,{src:Cb$1,alt:"Toggle dropdown",expanded:o});function nF({brands:e,isLoading:t=true,label:o,sx:n,selectedValue:r,isDisabled:i,isFetchingNextPage:a,renderBrandLogo:s$1,onValueChange:l,showSearchInput:p}){let{anchorElement:d,isOpen:m,openMenu:c,closeMenu:u}=uw(),f=zc(useId(),"merchants-dropdown"),x=useRef(null),[C,S]=useState("");fw(e,r,l);let g=useMemo(()=>nw(e),[e]),h=g||i||t,w=useCallback(D=>{h||c(D);},[h,c]),b=useCallback(()=>{m&&u();},[m,u]),y=D=>{S(D);},T=()=>{S("");},v=useMemo(()=>C.trim()?e.filter(D=>ac(D.name)?.trim().toLowerCase()?.includes(C.trim().toLowerCase())||D?.id?.toLowerCase().includes(C.trim().toLowerCase())):e,[C,e]),M=useMemo(()=>p?v:e,[e,v,p]);return jsx(KR,{onClickAway:b,children:jsxs(YS,{id:f,"data-testid":"MerchantsDropdown",isOpen:m,onClick:w,sx:{...h&&{pointerEvents:"none",opacity:.7},...n},ref:x,children:[typeof o=="string"?jsx(KS,{noWrap:true,sx:{...o.length>16&&{width:100}},children:o}):o,jsx(oF,{isLoading:t,isSingleMerchant:g,isOpen:m}),jsxs(Gn,{open:m,anchorEl:d,sx:{"& .MuiPopper-dropdown":{mt:"5px",overflowY:"auto",maxHeight:432,...x.current&&{width:x.current.offsetWidth??"auto"},minWidth:180}},children:[p&&e.length>1&&jsx(a$a,{placeholder:"Brands",name:"brands",value:C,onSearchChange:y,onSearchReset:T,sx:{px:"8px"}}),M?.map(D=>jsx(dw,{brand:D,selectedValue:r,onClose:u,onValueChange:l,renderBrandLogo:s$1},D.id)),a&&jsx(qS,{children:jsx(s,{isLoadingRow:true})})]})]})})}var rF=memo(nF);var hw=styled(R)(()=>({marginTop:"-1px","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),yw=styled(V)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,paddingLeft:"16px",maxHeight:"35px",".label":{flexGrow:1}}));function fl({menuLabel:e,options:t,selectedValue:o,onValueChange:n}){let r=zc(useId(),"view-column-radio-filter"),[i,a]=useState(null),[s,l]=useState(o),p=useRef(null);return useEffect(()=>{l(o);},[o]),jsxs(yw,{id:r,ref:p,onMouseEnter:f=>{a(f.currentTarget);},onMouseLeave:()=>{a(null);},onClick:f=>{f.stopPropagation(),a(f.currentTarget);},startAdornment:null,children:[jsx("span",{className:"label",children:e}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(hw,{open:!!i,anchorEl:i,placement:"right-start",children:jsx(a$o,{options:t,value:s||"",onOptionChange:f=>{l(f),n(f);},defaultValue:t[0].value})})]})}var bw=(e,t)=>{let o=e||{},n={};return t?.forEach(({value:r})=>{let i=o?.[r];n[r]=i===void 0?"all":i;}),n};function Sw({anchorEl:e,options:t,apiKey:o="statuses",initialStatuses:n,onCloseDropdown:r,onClear:i,onConfirm:a}){let s=!!e,l=zc(useId(),"status-filter"),{t:p}=useTranslation(),[d,m]=useState(()=>bw(n,t)),c=useRef(null),[u,f]=useState(null),[x,C]=useState(null),S=(v,M)=>{f(v.currentTarget),C(M);},g=useCallback(()=>{f(null),C(null);},[]),h=useCallback(v=>{r(v),g();},[g,r]),w=()=>{let v=Object.keys(d).reduce((D,A)=>{let R=d[A];return R!=="all"&&(D[A]=R),D},{});Object.values(d).every(D=>D==="all")?i([o]):a({[o]:v});},b=r$1(w,r),y=v=>{w(),r(v);},T=v=>{x&&m(M=>({...M,[x]:v}));};return jsx(ClickAwayListener,{onClickAway:v=>{v.stopPropagation(),r(v);},children:jsxs(Un,{id:l,"data-testid":"StatusFilter",ref:c,tabIndex:-1,onKeyDown:b,children:[jsxs(R,{open:s,anchorEl:e,children:[jsx(a$p,{component:"span",children:p("filterBy")}),t.map(({value:v,label:M})=>jsxs(V,{onClick:D=>{f(D.currentTarget);},onMouseOver:D=>{S(D,v);},sx:{minHeight:"35px",padding:"8px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}},startAdornment:null,children:[jsx(Un,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:M}),jsx(Un,{component:"img",src:vb,width:16,height:12,sx:{marginLeft:"auto"}})]},v)),jsxs(b$9,{children:[jsx(d$6,{onClick:h,children:p("cancel")}),jsx(c$6,{onClick:y,children:p("okay")})]})]}),jsx(Popper,{open:!!u,anchorEl:u,placement:"right-start",onMouseLeave:g,children:jsx(Un,{sx:{backgroundColor:"#fff",borderEndEndRadius:"8px",border:"1px solid #F2F2F2"},children:jsx(a$o,{options:[{value:"all",label:"All"},{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}],value:d[x||""],onOptionChange:T})})})]})})}var ww=styled$1(motion.div,{shouldForwardProp:e=>!["notificationState","open","loading","ready","failed"].includes(e)})(({theme:e,notificationState:t,open:o,loading:n,ready:r,failed:i})=>({position:"relative",border:`1px solid ${e.palette.divider}`,padding:"0 8px",height:32,borderRadius:"4px",display:"flex",alignItems:"center",overflow:"hidden",fontSize:"11px",fontWeight:500,color:e.palette.text.primary,transition:"width 2s ease-in-out",cursor:"pointer",...(t?.success||t?.failed)&&!n&&!r&&!i&&{"&:after":{content:'""',width:7,height:7,backgroundColor:t?.failed?e.palette.common.red:e.palette.success.dark,borderRadius:"50%",position:"absolute",top:5,border:`1px solid ${e.palette.common.white}`,right:6}},...o&&{border:`1px solid ${e.palette.info.dark}`,boxShadow:e.shadows[7]}})),vw=styled$1(Box)(()=>({position:"relative"})),Pw=styled$1(Box)(({theme:e})=>({background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:"4px",marginTop:"8px"})),Ew=styled$1(Box)(({theme:e})=>({background:e.palette.background.transparent[2],backdropFilter:"blur(2px)",color:e.palette.text.primary,fontSize:"11px",fontWeight:500,height:31,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",overflow:"hidden",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"})),Mw=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",padding:"5.5px 8px",minHeight:48,height:"auto",borderBottom:`1px solid ${e.palette.divider}`,cursor:"pointer","&:hover":{boxShadow:e.shadows[3]}})),Aw=styled$1("img")(()=>({width:16,height:16,objectFit:"contain",flexShrink:0,display:"block"})),Dw=styled$1(Box)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),Rw=styled$1(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"space-between",flex:1})),Lw=styled$1(Box)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:500,wordBreak:"break-all",paddingInlineEnd:"8px"})),Bw=styled$1(Box)(({theme:e})=>({fontSize:"9px",color:e.palette.text.textSecondary,fontWeight:600})),kw=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",height:32,padding:"4px 8px",borderBottom:`1px solid ${e.palette.divider}`,cursor:"pointer","&:hover":{boxShadow:e.shadows[3]}})),Nw=styled$1(Box)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:400,textTransform:"uppercase"})),yc=styled$1(Box)(({theme:e})=>({borderTop:`2px solid ${e.palette.divider}`})),Cl=styled$1(Box)(({theme:e})=>({position:"absolute",bottom:0,right:0,left:0,".MuiLinearProgress-root":{backgroundColor:e.palette.divider,height:2},".MuiLinearProgress-bar":{background:e.palette.background.gradient.shadedBlue},"&.done .MuiLinearProgress-bar":{background:e.palette.success.dark},"&.failed .MuiLinearProgress-bar":{background:e.palette.common.red}})),lo=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",".MuiCircularProgress-root":{width:"14px !important",height:"14px !important",display:"flex"},".MuiCircularProgress-circle":{strokeWidth:"1.017px",stroke:alpha$1(e.palette.common.black,.62)}})),hl=styled$1(Box)(()=>({position:"relative"})),yl=styled$1(Box)(({theme:e})=>({position:"absolute",color:e.palette.common.black,fontSize:"7.875px",fontWeight:700,width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center"})),Il=styled$1("img")(()=>({width:14,height:14})),Fw=styled$1(Box)(()=>({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",padding:"8px"}));var Ww=e=>{let t=new Date,o=vc(e).isSame(t,"year"),n={sameDay:"DD MMM, YYYY",nextDay:"DD MMM, YYYY",lastDay:"DD MMM, YYYY",sameElse:"DD MMM, YYYY",lastWeek:"DD MMM, YYYY",nextWeek:"DD MMM, YYYY"};return o&&(n={sameDay:"DD MMM",nextDay:"DD MMM",lastDay:"DD MMM",sameElse:"DD MMM",lastWeek:"DD MMM",nextWeek:"DD MMM"}),vc(e).calendar(null,n)},Hw=(e,t)=>{let o=new Date().toISOString().split("T")[0],n=t??`file_${o}`,i=/\.(xlx|xlsx|csv|txt|doc|docx|pdf|jpg|png|gif|zip|rar)$/i.exec(e),a=i?i[0]:".csv";return `${n}${a}`};var Ic={loading:false,success:false,error:null},hF=(e=Ic,t)=>{switch(t.type){case "RESET":return Ic;case "LOADING":return {...e,loading:true};case "SUCCESS":return {...e,success:true};case "ERROR":return {...e,error:t.error};default:return e}},bl=({onDownload:e})=>{let t=n(),[{loading:o,error:n$1,success:r},i]=useReducer(hF,Ic),a=useCallback(()=>i({type:"LOADING"}),[]),s=useCallback(()=>i({type:"SUCCESS"}),[]),l=useCallback(m=>i({type:"ERROR",error:m}),[]),p=useCallback(()=>i({type:"RESET"}),[]);useEffect(()=>{(r||n$1)&&setTimeout(()=>{p();},3e3);},[r,n$1,p]);let d=useCallback(()=>{e&&(a(),e().then(m=>{s(),Mb$1(m.url,Hw(m.result_file,m.id));}).catch(m=>{l(m),t.error(m?.response?.data?.error?.message||m?.message||"Failed to download report");}));},[e,a,s,l]);return {loading:o,error:n$1,success:r,handleDownloadReport:d}};function IF({onDownload:e}){let{loading:t,error:o,success:n,handleDownloadReport:r}=bl({onDownload:e});return t?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(lo,{children:jsxs(hl,{children:[jsx(yl,{children:"1"}),jsx(CircularProgress,{})]})})}):n?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(lo,{children:jsx(Il,{src:Ze$1,alt:"done"})})}):o?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(lo,{children:jsx(Il,{src:Ij,alt:"failed"})})}):jsx(Il,{onClick:r,src:Xe,alt:"reports"})}var Tc=IF;function wc(){return jsxs(Fw,{children:[jsx(r,{width:"16px",height:"16px",variant:"rectangular"}),jsx(r,{width:"100%",variant:"text"}),jsx(r,{width:"12px",height:"12px",variant:"circular"})]})}function vF({reports:e,isLoading:t=false,onDownloadReport:o}){let n=useCallback(i=>o?o(i):Promise.reject(new Error("No download report function provided")),[o]),r=e.map(i=>{let a=vc(i.created_at).isBefore(vc().subtract(1,"day")),s=Yb$1(i.result_file);return jsxs(Mw,{children:[jsx(Aw,{src:s,alt:"download"}),jsxs(Rw,{children:[jsxs(Dw,{children:[jsx(Lw,{children:i.result_file}),jsx(Bw,{children:a?Ww(new Date(i.created_at)):vc(new Date(i.created_at)).fromNow()})]}),jsx(Tc,{onDownload:()=>n(i.id)})]})]},i.id)});return t?jsxs(yc,{children:[jsx(wc,{}),jsx(wc,{})]}):jsx(yc,{children:r})}var Ow=memo(vF);function LF(e){let{progress:t,reportsQueryResult:o,isStatusReady:n,isStatusFailed:r,isLoading:i,notificationState:a,onOpenDropdown:s,onRequestReportFile:l,onOpenReportsApp:p$1,hideOpenReportsApp:d=false,onDownloadReport:m,customContent:c}=e,[u,f]=useState(null),{t:x}=useTranslation(),C=!!u,{data:S,isLoading:g}=o,h=useCallback(v=>{i||n||(s?.(),f(v.currentTarget));},[i,n,s]),w=useCallback(()=>{f(null);},[]),b=useCallback(()=>{i||(w(),l?.());},[i,w,l]),y=v=>{v.stopPropagation(),p$1?.(),w();},T=()=>i?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(lo,{children:[jsxs(hl,{children:[jsx(yl,{children:"1"}),jsx(DF,{})]}),jsx("span",{children:x("preparing")}),jsx(Cl,{children:jsx(Mc,{variant:"determinate",value:t})})]})}):n?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(lo,{children:[jsx("img",{src:Ze$1,alt:"done"}),jsx("span",{children:x("ready")}),jsx(Cl,{className:"done",children:jsx(Mc,{variant:"determinate",value:100})})]})}):r?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(lo,{children:[jsx("img",{src:Ij,alt:"failed"}),jsx("span",{children:x("failed")}),jsx(Cl,{className:"failed",children:jsx(Mc,{variant:"determinate",value:100})})]})}):jsx("img",{src:Ye,alt:"reports"});return jsxs(vw,{"data-testid":"TableReports_ReportsWrapper",children:[jsx(AnimatePresence,{children:jsx(p,{title:x("reports"),children:jsx(ww,{"data-testid":"TableReports_ExportButton",onClick:h,notificationState:a,open:C,loading:i,ready:n,failed:r,sx:{...(i||n||r)&&{borderBottom:"none"}},initial:{width:"auto"},transition:{duration:.25},children:T()})})}),C&&jsx(a$7,{onClick:w}),jsx(zR,{open:C,anchorEl:u,placement:"bottom-end",children:jsxs(Pw,{sx:{width:208},children:[c?.({closeDropdown:w})??jsxs(kw,{onClick:b,children:[jsx("img",{src:Ve,alt:"download"}),jsx(Nw,{children:"csv"})]}),jsx(Ow,{reports:S?.reports??[],isLoading:g,onDownloadReport:m}),!d&&jsx(Ew,{onClick:y,children:x("openReportsApp")})]})})]})}var _w=memo(LF);var zw=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:54,height:18,backgroundColor:"#1F88D0",borderRadius:"2px",fontSize:"8px",fontWeight:600,color:e.palette.common.white}));function OF({onDownload:e}){let t=zc(useId(),"download-button"),{loading:o,error:n,success:r,handleDownloadReport:i}=bl({onDownload:e}),{t:a}=useTranslation(),s=!o&&!n&&!r;return jsx(zw,{id:t,"data-testid":"DownloadButton",onClick:i,children:jsxs(AnimatePresence,{mode:"wait",initial:false,children:[o&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{display:"flex",alignItems:"center"},children:jsx(DF,{size:"10px",sx:{color:"rgba(255, 255, 255, 0.62)"}})},"loading"),!!n&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(d$1,{src:hm,sx:{width:"auto",height:"auto"},alt:"error"})},"error"),s&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:a("download")},"text")]})})}var $w=memo(OF);var zF=$w;var $F=_w;var xe=styled(V)(({theme:e})=>({height:40,flex:"unset",paddingTop:0,paddingBottom:0,borderBottom:`1px solid ${e.palette.divider}`,".label":{flexGrow:1}})),Gw=styled(Un)(({theme:e})=>({width:36,height:24,border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"12px"}));function Sl({type:e}){return jsx(Gw,{children:jsx(Un,{component:"img",src:h$2(e),sx:{width:18,height:12,objectFit:"contain"},onError:t=>{t.currentTarget.src=h$2("card");}})})}function Dc({icon:e,name:t,options:o=[],filters:n,setFilters:r}){let[i,a]=useState(null),s=n?.payment_methods??[],l=x=>{a(x.currentTarget);},p=()=>{a(null);},d=useCallback(x=>s.includes(x)??false,[s.length]),m=useMemo(()=>o?.every(x=>d(x.type)),[s.length]),c=useMemo(()=>!m&&o?.some(x=>d(x.type)),[s.length]),u=x=>{if(x.stopPropagation(),m){let C=o?.reduce((h,w)=>h.filter(b=>b!==w.type),s)??[],{payment_methods:S,...g}=n;r(C?.length>0?{...n,payment_methods:C}:g);}else r({...n,payment_methods:[...s,...o?.map(C=>C.type)??[]]});},f=(x,C)=>{x.stopPropagation(),d(C)?r({...n,payment_methods:s?.filter(S=>S!==C)??[]}):r({...n,payment_methods:[...s??[],C]});};return jsxs(xe,{isSelected:m,isIndeterminate:c,onMouseEnter:l,onMouseLeave:p,onClick:u,children:[jsx("img",{src:e,alt:t}),jsx("span",{className:"label",children:t}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!i,anchorEl:i,placement:"right-end",children:o?.map(x=>jsx(xe,{isSelected:d(x.type),onClick:C=>f(C,x.type),children:jsx(Sl,{type:x.type})},x.type))})]})}function vl({paymentMethodsSource:e,filters:t,setFilters:o}){let[n,r]=useState(null),i=t?.payment_methods??[],a=!e?.options?.length,s=u=>{r(u.currentTarget);},l=()=>{r(null);},p=useMemo(()=>(e?.options??[])?.reduce((u,f)=>(u.push(...(f.options??[])?.map(x=>x.type)??[]),u),[])??[],[]),d=useMemo(()=>p?.length===i.length&&i.length>0,[i.length,p?.length]),m=useMemo(()=>!d&&i.length>0,[i.length,d]);return jsxs(xe,{isSelected:d,isIndeterminate:m,onMouseEnter:s,onMouseLeave:l,onClick:()=>{if(!a){if(d){let{payment_methods:u,...f}=t;o(f);return}o({...t,payment_methods:p});}},sx:{...a&&{opacity:.5,pointerEvents:"none"}},children:[jsx("span",{className:"label",children:e?.name}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!n,anchorEl:n,placement:"right-start",children:e?.options?.map(u=>jsx(Dc,{...u,filters:t,setFilters:o},u.type))})]})}function Pl({paymentSchemesSource:e,filters:t,setFilters:o}){let[n,r]=useState(null),i=t?.payment_scheme??[],a=!e?.options?.length,s=f=>{r(f.currentTarget);},l=()=>{r(null);},p=useMemo(()=>i?.length===e?.options?.length&&i.length>0,[i?.length,e?.options?.length]),d=useMemo(()=>!p&&i.length>0,[i.length,p]),m=useCallback(f=>i.includes(f)??false,[i]),c=()=>{if(!a){if(p){let{payment_scheme:f,...x}=t;o(x);return}o({...t,payment_scheme:e?.options?.map(f=>f.type)??[]});}},u=(f,x)=>{f.stopPropagation(),m(x)?o({...t,payment_scheme:i.filter(C=>C!==x)??[]}):o({...t,payment_scheme:[...t?.payment_scheme??[],x]});};return jsxs(xe,{isSelected:p,isIndeterminate:d,onMouseEnter:s,onMouseLeave:l,onClick:c,sx:{...a&&{opacity:.5,pointerEvents:"none"}},children:[jsx("span",{className:"label",children:e?.name}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!n,anchorEl:n,placement:"right-start",children:e?.options?.map(f=>jsx(xe,{isSelected:m(f.type),onClick:x=>u(x,f.type),children:jsx(Sl,{type:f.type})},f.type))})]})}function Ml({filters:e,setFilters:t}){let[o,n]=useState(null),{t:r}=useTranslation(),i=useMemo(()=>e?.payment_initiated??[],[e?.payment_initiated]),a=c=>{n(c.currentTarget);},s=()=>{n(null);},l=useCallback(c=>i.includes(c),[i]),p=i?.length===Fo.length,d=()=>{t?.({...e,payment_initiated:p?[]:Fo.map(({key:c})=>c)});},m=c=>{t?.({...e,payment_initiated:l(c)?i?.filter(u=>u!==c):[...i,c]});};return jsxs(xe,{onMouseEnter:a,onMouseLeave:s,isSelected:p,isIndeterminate:i.length===1,onClick:d,children:[jsx("span",{className:"label",children:r("paymentInitiated")}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!o,anchorEl:o,placement:"right-start",children:Fo.map(({label:c,key:u})=>jsx(V,{isSelected:l(u),onClick:f=>{f.stopPropagation(),m(u);},children:c},u))})]})}function Lc({filters:e,setFilters:t}){let[o,n]=useState(null),r=useMemo(()=>e?.payment_locations??[],[e?.payment_locations]),i=m=>{n(m.currentTarget);},a=()=>{n(null);},s=useCallback(m=>r.includes(m),[r]),l=r?.length===Go.length,p=()=>{t?.({...e,payment_locations:l?[]:Go.map(({key:m})=>m)});},d=m=>{t?.({...e,payment_locations:s(m)?r?.filter(c=>c!==m):[...r,m]});};return jsxs(xe,{onMouseEnter:i,onMouseLeave:a,isSelected:l,isIndeterminate:r.length>0&&r.length<Go.length,onClick:p,children:[jsx("span",{className:"label",children:"Payment Locations"}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!o,anchorEl:o,placement:"right-start",children:Go.map(({label:m,key:c})=>jsxs(V,{isSelected:s(c),onClick:u=>{u.stopPropagation(),d(c);},children:[jsx(Un,{sx:u=>({border:`1px solid ${u.palette.divider}`,borderRadius:"20px",width:36,height:24,display:"flex",alignItems:"center",justifyContent:"center"}),children:jsx(b$2,{sx:{visibility:"visible",width:15,height:9.176},variant:m})}),m]},c))})]})}function Dl({filters:e,setFilters:t}){let[o,n]=useState(null),{t:r}=useTranslation(),i=useMemo(()=>e?.authentication_type??[],[e?.authentication_type]),a=c=>{n(c.currentTarget);},s=()=>{n(null);},l=useCallback(c=>i.includes(c),[i]),p=i?.length===Ho.length,d=()=>{t?.({...e,authentication_type:p?[]:Ho.map(({key:c})=>c)});},m=c=>{t?.({...e,authentication_type:l(c)?i?.filter(u=>u!==c):[...i,c]});};return jsxs(xe,{onMouseEnter:a,onMouseLeave:s,isSelected:p,isIndeterminate:i.length>0&&i.length<Ho.length,onClick:d,children:[jsx("span",{className:"label",children:r("authenticationType")}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:!!o,anchorEl:o,placement:"right-start",children:Ho.map(({label:c,key:u})=>jsx(V,{isSelected:l(u),onClick:f=>{f.stopPropagation(),m(u);},children:c},u))})]})}function Zw({filters:e,setFilters:t,anchorEl:o,showPaymentSchemes:n=true,showPaymentMethods:r=true,showPaymentInitiated:i=true,showPaymentLocations:a=false,showAuthenticationType:s=false,paymentMethodsSource:l,paymentSchemesSource:p,onCloseDropdown:d,onConfirm:m}){let{t:c}=useTranslation(),u=zc(useId(),"payment-source-filter"),f=!!o,x=()=>m?.(),C=r$1(x,d),S=g=>{x(),d(g);};return jsxs(R,{id:u,"data-testid":"PaymentSourceFilter",open:f,anchorEl:o,sx:{marginTop:"8px",marginBottom:"8px"},onKeyDown:C,panelProps:{tabIndex:-1,autoFocus:true},children:[jsx(a$p,{component:"span",children:c("filterBy")}),r&&jsx(vl,{filters:e,setFilters:t,paymentMethodsSource:l}),n&&jsx(Pl,{filters:e,setFilters:t,paymentSchemesSource:p}),i&&jsx(Ml,{filters:e,setFilters:t}),s&&jsx(Dl,{filters:e,setFilters:t}),a&&jsx(Lc,{filters:e,setFilters:t}),jsxs(b$9,{children:[jsx(d$6,{onClick:d,children:c("cancel")}),jsx(c$6,{onClick:S,children:c("okay")})]})]})}var kc=[{label:_o.C,value:"C"},{label:_o.F,value:"F"}],hV=({filters:e,setFilters:t})=>{let[o,n]=useState(null),r=!!o,i=e?.auth_mode??[],a=f=>{r||n(f.currentTarget);},s=()=>{r&&n(null);},l=useMemo(()=>kc.map(f=>f.value),[]),p=useMemo(()=>kc.length===i.length&&i.length>0,[i.length,l?.length]),d=useMemo(()=>!p&&i.length>0,[i.length,p]),m=()=>{if(p){let{auth_mode:f,...x}=e;t(x);return}t({...e,auth_mode:l});},c=useCallback(f=>i.includes(f)??false,[i.length]),u=(f,x)=>{f.stopPropagation(),c(x)?t({...e,auth_mode:i?.filter(C=>C!==x)??[]}):t({...e,auth_mode:[...i??[],x]});};return jsxs(xe,{isSelected:p,isIndeterminate:d,onMouseEnter:a,onMouseLeave:s,onClick:m,children:[jsx("span",{className:"label",children:"Authentication Mode"}),jsx("img",{src:vb,alt:"arrow",style:{height:12}}),jsx(R,{open:r,anchorEl:o,placement:"right-start",children:kc.map(f=>jsxs(V,{isSelected:c(f.value),onClick:x=>u(x,f.value),children:[jsx(JC,{mode:f.value}),f.label]},f.value))})]})};var yV=styled(j$1)(()=>({fontSize:"11px"})),Qw=styled(Un)(()=>({display:"flex",alignItems:"center",gap:"4px",width:"100%",paddingInline:"16px"})),e0=styled(Un)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",position:"sticky",bottom:0,backgroundColor:"white",zIndex:99999,borderTop:`1px solid ${e.palette.divider}`})),t0=styled(b)(()=>({minWidth:"auto",width:70})),o0=styled(b)(()=>({minWidth:"auto",width:70})),n0=styled(Un)(()=>({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"})),Nc=styled(yV)(()=>({fontSize:"11px",fontWeight:500,color:"#8D8D94",padding:"8px 16px"})),r0=styled(Un)(({theme:e})=>({borderBlock:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"2px",width:"100%"})),i0=styled(Un)(({theme:e})=>({...a$4(e),width:"auto",marginTop:"8px","&:focus":{outline:"none"}})),a0=styled(Nc)(()=>({color:"#1F88D0",padding:"4px 24px",cursor:"pointer"})),s0=styled(b,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:t})=>{let{brand:o}=t.v2.palette;return {fontSize:"11px",fontWeight:t.v2.typography.fontWeightMedium,padding:t.v2.spacing(8),width:"100%",height:32,justifyContent:"space-between",gap:t.v2.spacing(4),...e&&{borderColor:o[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}}});function p0({dateRange:e,onDateRangeChange:t,calendarMode:o,onCalendarModeChange:n,timezone:r,browserTimezone:i,defaultCountryTimezone:a,onTimezoneChange:s,timezoneCountriesCodes:l=[],onConfirm:p,onCloseDropdown:d}){let m=zc(useId(),"date-filter"),{t:c}=useTranslation(),u=useRef(null),f=()=>p(e),x=r$1(f,d),C=w=>{t(w),requestAnimationFrame(()=>u.current?.focus());},S=w=>{f(),d(w);},g=useCallback(w=>n(w),[n]),h=w=>{if(!w)return "";let[b,y]=w,T=vc(b).format("MMM D"),v=vc(y).format("MMM D");return T===v?T:`${T} - ${v}`};return jsxs(i0,{ref:u,tabIndex:-1,onKeyDown:x,id:m,"data-testid":"DateFilter",children:[jsxs(n0,{children:[jsx(r0,{children:jsx(Nc,{component:"span",children:c("filterBy")})}),jsx(Qw,{children:jsx(a$g,{defaultDate:e||o$2(0),onDateChange:C,maxDateRange:365,mode:o,onCalendarModeSwitch:g,browserTimezone:i,defaultCountryTimezone:a,timezone:r,onChangeTimezone:s,timezoneCountriesCodes:l,mainSx:{width:"100%"},popperProps:{placement:"right-start"},renderCalendarButton:(w,b)=>jsxs(s0,{variant:"secondary",size:"md",fullWidth:true,open:w,onClick:b,children:[jsx("span",{children:h(e)||"Date"}),jsx(d$1,{src:dk$1,alt:"selected",sx:{width:16,height:16}})]})},h(e))}),e&&jsx(a0,{component:"span",onClick:()=>t(void 0),children:"Clear"})]}),jsxs(e0,{children:[jsx(o0,{variant:"secondary",size:"md",onClick:d,children:c("cancel")}),jsx(t0,{variant:"primary",size:"md",onClick:S,children:c("okay")})]})]})}function c0({options:e,selectedFilters:t,onChange:o}){let[n,r]=useState(null),[i,a]=useState(null),s=useCallback(()=>{r(null),a(null);},[]),l=m=>m==="all"?void 0:m==="enabled",p=m=>{i&&o({[i]:l(m)});},d=useMemo(()=>{let m=t?.[i||""];return m===void 0?"all":m?"enabled":"disabled"},[t,i]);return jsxs(Fragment,{children:[e.map(({label:m,value:c},u)=>jsxs(V,{onMouseOver:f=>{r(f.currentTarget),a(c);},sx:{minHeight:"35px",padding:"8px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"},...u===e.length-1&&{borderBottom:"1px solid #F2F2F2"}},startAdornment:null,children:[jsx(Un,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:m}),jsx(Un,{component:"img",src:vb,width:16,height:12,sx:{marginLeft:"auto"}})]},c)),jsx(Popper,{open:!!n,anchorEl:n,placement:"right-start",onMouseLeave:s,children:jsx(Un,{sx:{backgroundColor:"#fff",borderEndEndRadius:"8px",border:"1px solid #F2F2F2"},children:jsx(a$o,{options:[{value:"all",label:"All"},{value:"enabled",label:"Available"},{value:"disabled",label:"Not Available"}],value:d,onOptionChange:p})})})]})}var f0=styled(R)(()=>({marginBottom:"8px"})),g0=styled(a$2)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,".icon":{width:14}})),x0=styled(Un)(()=>({padding:"8px 16px","> div + div":{marginTop:"8px"}})),C0=styled(Rb)(({theme:e})=>({color:e.palette.info.dark,fontSize:"11px",textTransform:"capitalize",padding:"4px 9px",minWidth:"auto","&:hover":{background:"transparent"}})),h0=styled(Un)(({theme:e})=>({padding:"0 16px 8px",textAlign:"left",borderBottom:`1px solid ${e.palette.divider}`}));function I0({selectedRadioValue:e,onRadioButtonChange:t,radioOptions:o,label:n,onConfirm:r,onClear:i,inputValues:a,onInputValuesChange:s,anchorEl:l,onCloseDropdown:p,inputFilters:d=[]}){let m=zc(useId(),"reference-type-filter"),{t:c}=useTranslation(),u=()=>r(),f=r$1(u,p),x=b=>{u(),p(b);},C=b=>{i(),p(b);},S=b=>a?.[b]!==void 0&&a?.[b].length>0,g=b=>{S(b)&&s({...a,[b]:""});},h=useMemo(()=>LV(a).some(b=>!!b),[a]),w=()=>{s(d.reduce((b,{apiKey:y})=>({...b,[y]:""}),{}));};return jsxs(f0,{id:m,"data-testid":"ReferenceTypeFilter",open:!!l,anchorEl:l,onKeyDown:f,children:[jsx(a$p,{component:"span",children:c("filterBy")}),jsx(fl,{menuLabel:n,options:o,selectedValue:e,onValueChange:t}),d.length>0&&jsx(x0,{"data-testid":"ColumnFilterInputs_inputs",component:"main",children:d.map(({apiKey:b,placeholder:y})=>jsx(g0,{className:"input","data-testid":"ColumnFilterInputs_InputStyled",name:b,placeholder:y,onChange:T=>{s({...a,[b]:T.target.value});},defaultValue:a?.[b]??"",value:a?.[b],inputProps:{autoComplete:"off","data-testid":"ColumnFilterInputs_input"},endAdornment:jsx(Box,{component:"img","data-testid":"ColumnFilterInputs_icon","data-icon":S(b)?"close":"search",src:S(b)?ui:A,alt:"search",className:"icon",sx:{cursor:S(b)?"pointer":"default"},onClick:()=>{g(b);}})},b))}),jsx(x$1,{in:h,component:"section","data-testid":"ColumnFilterInputs_Collapse",children:jsx(h0,{"data-testid":"ColumnFilterInputs_ClearWrapper",children:jsx(C0,{type:"button",onClick:w,"data-testid":"ColumnFilterInputs_ClearButton",children:c("clear")})})}),jsxs(b$9,{children:[jsx(d$6,{onClick:C,children:c("cancel")}),jsx(c$6,{onClick:x,children:c("okay")})]})]})}var b0=styled(Un)(()=>({maxHeight:"210px",maxWidth:"177px",overflowY:"auto",padding:0})),T0=styled(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},maxHeight:35,minHeight:35})),S0=styled(Un)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),w0=styled(Un)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),v0=styled(Un)(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"120px"})),P0=styled(R)(()=>({marginBottom:"8px"}));function M0({anchorEl:e,onCloseDropdown:t,list:o,apiKey:n,placeholder:r,onConfirm:i,onClear:a,onClickItem:s,inputValue:l,onInputValueChange:p,selectedListItems:d}){let m=zc(useId(),"list-column-filter"),{t:c}=useTranslation(),u=()=>i(),f=r$1(u,t),x=T=>{u(),t(T);},C=T=>{a?.(),t(T);},S=!!l.trim().length,g=()=>{S&&p("");},h=T=>{p(T);},w=useMemo(()=>S?o?.filter(T=>T.name.toLowerCase().includes(l.trim().toLowerCase())):o,[l,S,o]),b=S&&!w.length||!o.length,y=useMemo(()=>new Set(d),[d]);return jsxs(P0,{id:m,"data-testid":"ListColumnFilter",open:!!e,anchorEl:e,onKeyDown:f,children:[jsx(a$p,{component:"span",children:c("filterBy")}),!!o?.length&&jsx(a$a,{value:l,name:n,placeholder:r,onSearchChange:h,onSearchReset:g}),jsx(b0,{children:b?jsx(Box,{sx:{p:1,textAlign:"center",fontSize:"11px"},children:"No data available"}):w?.map((T,v)=>jsx(T0,{isSelected:y.has(T?.id),onClick:()=>{s(T?.id);},children:jsxs(S0,{children:[jsx(v0,{children:T.name}),jsx(w0,{component:"span",children:T.id})]})},`${T.id}-${v}`))}),jsxs(b$9,{children:[jsx(d$6,{onClick:C,children:c("cancel")}),jsx(c$6,{onClick:x,children:c("okay")})]})]})}var A0="os-shared-VerificationIcon",kl={root:`${A0}-root`,img:`${A0}-img`},D0=(s=>(s.Verified="verified",s.Reviewed="reviewed",s.Completed="completed",s.Incomplete="incomplete",s.Rejected="rejected",s.Closed="closed",s.Archived="archived",s))(D0||{});var Nl={verified:Hj,reviewed:Fj,completed:Ej,incomplete:Gj,rejected:Ij,closed:Jj,archived:Kj},Fl={verified:"#2ACE0029",reviewed:"#11D0FA29",completed:"#11D0FA29",incomplete:"#D9D9D929",rejected:"#FF3D0029",closed:"#D9D9D929",archived:"#D9D9D929"};var HV=2.3,R0=styled("span",{shouldForwardProp:e=>!["$variant","$bgColor","$size"].includes(e)})(({$variant:e="default",$bgColor:t,$size:o=10.5})=>{let n=Math.round(o*HV);return {display:"inline-flex",alignItems:"center",justifyContent:"center",...e==="circle"&&{width:`${n}px`,height:`${n}px`,borderRadius:"50%",backgroundColor:t||"#D9D9D929"}}});var L0=forwardRef(({className:e,sx:t,icon:o,label:n,variant:r="default",size:i=10.5,width:a,height:s,...l},p$1)=>{let d=Nl[o]||Nl.incomplete,m=Fl[o]||Fl.incomplete,c=n===null?"":n||Xh(o),u=a??i,f=s??i,x=jsx(R0,{ref:p$1,className:lc(kl.root,e),sx:t,"data-testid":"VerificationIcon",$variant:r,$bgColor:m,$size:i,...l,children:jsx("img",{className:kl.img,loading:"lazy",src:d,alt:c||o,width:u,height:f})});return n===null?x:jsx(p,{title:c,wrapperProps:{display:"inline-flex"},children:x})});L0.displayName="VerificationIcon";var $V=memo(L0);var ec=(n=>(n.CHECKED="CHECKED",n.UNCHECKED="UNCHECKED",n.INDETERMINATE="INDETERMINATE",n))(ec||{});styled("img",{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:t})=>({transform:t?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})}));styled(Un)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"}));var Hc=styled(V)({minWidth:120,minHeight:36,maxHeight:36,paddingTop:0,paddingBottom:0,backgroundColor:"#fff","--menuitem-border-rad":"4px","&:hover":{boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.13)",zIndex:1}}),Oc=styled(e=>jsx(Hc,{startAdornment:null,...e}))(({theme:e})=>({fontSize:11,fontWeight:500,color:e.palette.grey[700],minHeight:36,maxHeight:"auto",cursor:"auto",":hover":{boxShadow:"none",zIndex:1}}));var _c=createContext({treeMapper:{},handleSelect:()=>{},multiple:false}),jV=({children:e,treeMapper:t,handleSelect:o,multiple:n,IconComponent:r})=>{let i=useMemo(()=>({treeMapper:t,handleSelect:o,multiple:n,IconComponent:r}),[t,o,n,r]);return jsx(_c.Provider,{value:i,children:e})},B0=jV;var ZV=()=>{let e=useContext(_c);if(!e)throw new Error("'useTreeDropdown' must be used within an 'TreeDropdownProvider'");return e},Wl=ZV;var F0=styled(f$1)({padding:0,paddingRight:"4px",width:"14px !important",".MuiSvgIcon-root":{width:"12px !important",height:"12px !important"}}),V0=styled(l)({padding:0}),W0=styled(Un)(()=>({display:"flex",gap:"8px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center",minWidth:0})),H0=styled(e=>jsx(XS,{noWrap:true,component:"span",...e}))(({theme:e})=>({flex:1,fontSize:"inherit",width:"100%",display:"inline-block",color:e.palette.text.primary})),O0=styled(e=>jsx(XS,{noWrap:true,...e}))(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:8})),_0=styled(Un,{shouldForwardProp:e=>e!=="isOneDigit"})(({theme:e,isOneDigit:t=true})=>({borderRadius:t?"50%":"4px",background:e.palette.divider,width:t?13:"auto",height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px",...!t&&{padding:"0 3px"}})),z0=styled("img")(()=>({height:12}));var eW=e=>{let{checked:t,indeterminate:o,onSelect:n}=e,{multiple:r}=Wl(),i=useCallback(a=>{a.stopPropagation(),n(a);},[n]);return r?jsx(F0,{size:"small",checked:t,indeterminate:o,onChange:i}):jsx(V0,{checked:t,onChange:i})},G0=eW;var rW=e=>{let{renderItem:t,header:o,footer:n,...r}=e,{treeMapper:i,handleSelect:a,multiple:s,IconComponent:l}=Wl(),{label:p,icon:d,iconComponent:m,levelIndex:c=0,children:u,nestedMenuSx:f,hintText:x,disableHovering:C,itemProps:S,searchProps:g,subLevelKey:h}=r,[w,b]=useState(null),y=!!u,T=u?.length,v=useCallback(G=>{C||b(G.currentTarget);},[C]),M=useCallback(()=>{C||b(null);},[C]);useEffect(()=>{C&&b(null);},[C]);let D=useMemo(()=>m||(d&&l?jsx(l,{fileId:d.fileId,width:d.width??20,height:d.height??20}):null),[m,d,l]),A=i[r.id]?.status==="CHECKED",R=s?i[r.id]?.status==="INDETERMINATE":false,H=s||!y,V=useCallback(G=>{G.stopPropagation(),a(G.target.checked,r);},[a,r]);return jsxs(Hc,{startAdornment:null,onMouseEnter:v,onMouseLeave:M,"data-testid":r.id,onClick:()=>{a(!A,r);},...S,children:[t?t({nodeProps:r,checked:A,indeterminate:R,onSelect:V}):jsxs(W0,{width:"100%","data-testid":"Content",children:[H&&jsx(G0,{checked:A,indeterminate:R,onSelect:V}),D,jsxs(Stack,{flex:1,width:"100%",minWidth:0,children:[jsx(H0,{title:typeof p=="string"?p:void 0,children:p}),x&&jsx(O0,{title:typeof x=="string"?x:void 0,children:x})]}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[T&&jsx(_0,{isOneDigit:Math.floor(T/10)===0,children:T}),y&&jsx(z0,{src:wb$1,alt:"Expand"})]})]}),!!u&&jsx(Ol,{anchorEl:w,menuItems:u,levelIndex:c+1,sx:f,header:o,levelKey:h,footer:n,searchProps:g})]})},K0=rW;var j0=K0;var q0=styled(R)({maxHeight:"100%"}),X0=styled("div")({position:"relative","&:before, &:after":{display:"none"},"&.scrollable":{position:"relative","&::before, &::after":{display:"block",content:'""',position:"absolute",left:0,width:"100%",height:"20px",opacity:1,pointerEvents:"none",zIndex:2,transition:"opacity 0.3s ease-out"},"&::before":{top:0,background:"linear-gradient(to top, transparent, rgba(255, 255, 255, 1))"},"&::after":{bottom:0,background:"linear-gradient(to bottom, transparent, rgba(255, 255, 255, 1))"}},"&.scrolled-to-top":{"&::before":{opacity:0}},"&.scrolled-to-bottom":{"&::after":{opacity:0}}}),Z0=styled("ul")({listStyle:"none",padding:0,margin:0,maxHeight:300,overflow:"auto"}),J0=styled(a$2)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,"& .MuiInputBase-input":{color:"#000000"},".icon":{width:14}}));var lW=({children:e,onScroll:t})=>{let o=useRef(null),{scrolledToBottom:n,scrolledToTop:r,scrollable:i,handleScroll:a}=o$1({containerRef:o}),s=useMemo(()=>[n&&"scrolled-to-bottom",r&&"scrolled-to-top",i&&"scrollable"].filter(Boolean).join(" "),[n,r,i]),l=useCallback(p=>{t(p),a(p);},[t,a]);return jsx(X0,{sx:{position:"relative"},className:s,children:jsx(Z0,{ref:o,onScroll:l,children:e})})},ev=lW;var dW=e=>{let{initialValue:t="",getValues:o,filterItem:n,onChange:r,items:i,enabled:a=false,debounceMs:s=300}=e,[l,p]=useState(t),[d,m]=useState(t),c=useMemo(()=>mW(C=>{m(C);},s),[s]);useEffect(()=>(c(l),()=>c.cancel()),[c,l]);let u=useCallback(C=>{let S=C.target.value;p(S),c(S),r?.(C);},[r,c]),f=useCallback(()=>{p(""),m(""),c.cancel(),r?.({target:{value:""}});},[r,c]),x=useMemo(()=>{if(!a||!d.trim())return i;let C=d.toLowerCase();return n?i.reduce((S,g)=>{let h=n(g,C);return h&&S.push(h),S},[]):o?i.filter(S=>o(S).some(g=>g.toLowerCase().includes(C))):(console.error("`searchProps.getValues` is required for searching, provide it on the tree node level or the global search props"),i)},[i,d,o,n,a]);return {searchText:l,filteredItems:x,handleSearch:u,handleReset:f}},rv=dW;var hW=e=>{let{anchorEl:t,sx:o,levelIndex:n=0,placement:r,menuItems:i,header:a,footer:s,levelKey:l,searchProps:p}=e,[d,m]=useState(false),c=!!t,u=!!p,{searchText:f,filteredItems:x,handleSearch:C,handleReset:S}=rv({...p,enabled:u,items:i}),g=useRef(),h=useCallback(()=>{m(true),clearTimeout(g.current),g.current=setTimeout(()=>{m(false);},100);},[]);return useEffect(()=>()=>clearTimeout(g.current),[]),jsx(q0,{open:c,anchorEl:t,placement:n>0?"right-start":r,"data-level":n,"data-level-key":l,onClick:w=>w.stopPropagation(),sx:{...o,"&.MuiPopper-dropdown":{"&:after":{display:"none"}}},children:jsxs(iv,{divider:jsx(v,{flexItem:true}),children:[a&&jsx(Oc,{children:a}),u&&jsxs(iv,{divider:jsx(v,{flexItem:true,sx:{my:1}}),children:[jsx(Un,{sx:{p:1},children:jsx(J0,{...p?.inputProps,placeholder:p?.inputProps?.placeholder??"Search...",onChange:C,value:f,inputProps:{autoComplete:"off"},endAdornment:jsx(Un,{component:"img","data-icon":f?"close":"search",src:f?ui:A,alt:"search",className:"icon",...f&&{sx:{cursor:"pointer"}},onClick:S})})}),x.length===0&&p?.noResultsText&&jsx(XS,{component:"div",fontSize:10,color:w=>alpha(w.palette.text.primary,.4),textAlign:"center",minHeight:36,fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",children:jsx("span",{children:"No results found"})})]}),jsx(ev,{onScroll:h,children:x.map((w,b)=>jsx(j0,{disableHovering:d,...w,levelIndex:n,subLevelKey:w.levelKey,nestedMenuSx:o},`${n}-${w.id}-${b}`))}),s&&jsx(Oc,{children:s})]})})},Ol=hW;function yW(e){function t(o){let n=o.children?o.children.map(t):void 0;if(n?.length===1&&n[0].children?.length&&!n[0].disablePromotion){let r=n[0];n=r.children,o={...o,header:r.header??o.header,footer:r.footer??o.footer,searchProps:r.searchProps??o.searchProps};}return {...o,children:n}}return e.map(t)}function pv(e,t,o=[]){for(let n of e)n.status==="CHECKED"&&o.push(n.id),n.children&&pv(n.children,t,o);return o}function mv(e,t=[],o={},n=false){for(let r of e){let i=n?"CHECKED":r.status??"UNCHECKED";o[r.id]={status:i,...t.length?{_parents:t}:{}},r.children&&mv(r.children,[...t,r.id],o,i==="CHECKED");}return o}function dv(e,t){let o=mv(e),n=pv(e,t),r=o;for(let i of n)r=Uc(r,i,true);return r}function cv(e,t){return e.map(o=>({...o,status:t[o.id]?.status??"UNCHECKED",children:o.children?cv(o.children,t):void 0}))}function IW(e){let t={};for(let o of Object.keys(e)){let n=e[o]._parents;if(!n?.length)continue;let r=n[n.length-1];t[r]??(t[r]=[]),t[r].push(o);}return t}function Uc(e,t,o){let n=structuredClone(e),r=IW(e),i=o?"CHECKED":"UNCHECKED";function a(l){n[l].status=i;for(let p of r[l]??[])a(p);}function s(l){let p=n[l]._parents;if(!p?.length)return;let d=p[p.length-1],c=(r[d]??[]).map(u=>n[u].status);c.every(u=>u==="CHECKED")?n[d].status="CHECKED":c.every(u=>u==="UNCHECKED")?n[d].status="UNCHECKED":n[d].status="INDETERMINATE",s(d);}return a(t),s(t),n}function bW(e){function t(o){let n=o.children?.map(t).filter(Boolean);return o.status==="CHECKED"||o.status==="INDETERMINATE"||n&&n.length>0?{...o,children:n}:null}return e.map(t).filter(Boolean)}function lv(e){let t={};for(let o in e)t[o]={status:"UNCHECKED",...e[o]._parents?{_parents:e[o]._parents}:{}};return t}function uv(e,t,o,n){if(n)return Uc(e,t,o);if(!o)return lv(e);let r=lv(e);return Uc(r,t,true)}function TW(e,t){let o=[];function n(r){r.levelKey===t&&o.push(r),r.children?.forEach(i=>n(i));}return e.forEach(n),o}var Me={denormalizeTree:$c((e,t)=>cv(e,t)),extractSelectedBranches:$c(e=>bW(e)),filterNodesByLevelKey:$c((e,t)=>TW(e,t))};function Gc(e){let t=yW(e.children??[]);if(t.length===1&&t[0].children?.length&&!t[0].disablePromotion){let[o]=t;return Gc({levelKey:o.levelKey,children:o.children,header:o.header??e.header,footer:o.footer??e.footer,searchProps:o.searchProps??e.searchProps})}return {...e,children:t}}var AW=forwardRef((e,t)=>{let{anchorEl:o,placement:n="bottom-start",treeDefinition:r,sx:i,onChange:a,multiple:s=true,exposeOnlySelectedTree:l=false,IconComponent:p,onMounted:d}=e,{children:m=[]}=r,c=useMemo(()=>Gc(r),[r]),{header:u,footer:f,children:x=[],searchProps:C,levelKey:S}=c,[g,h]=useState({}),w=useRef(d);w.current=d;let b=useCallback(()=>Me.denormalizeTree(m,g),[m,g]),y=useCallback(()=>Me.extractSelectedBranches(b()),[b]),T=useCallback((M,D)=>{let A=uv(g,D.id,M,s);h(A),a&&a(l?Me.extractSelectedBranches(Me.denormalizeTree(m,A)):Me.denormalizeTree(m,A));},[a,m,g,s,l]),v=useCallback(M=>{let A=((R,H)=>{let V={...R};return Object.keys(V).forEach(G=>{V[G]={...V[G],status:H?"CHECKED":"UNCHECKED"};}),V})(g,M);h(A),a&&a(l?Me.extractSelectedBranches(Me.denormalizeTree(m,A)):Me.denormalizeTree(m,A));},[g,a,m,l]);return useEffect(()=>{let M=dv(m||[],s);h(M);let D=Me.denormalizeTree(m,M),A=Me.extractSelectedBranches(D);w.current?.({state:M,tree:D,selectedTree:A});},[m,s]),useImperativeHandle(t,()=>({treeMapper:g,getFullTree:b,getSelectedTree:y,toggleAll:v}),[g,b,y,v]),jsx(B0,{treeMapper:g,IconComponent:p,handleSelect:T,multiple:s,children:jsx(Ol,{anchorEl:o,sx:i,header:u,footer:f,menuItems:x,levelKey:S,searchProps:C,placement:n})})}),gv=AW;var oc=gv;var $l="32px";var jc=styled(Un,{shouldForwardProp:e=>e!=="isMaximized"})(({theme:e,isMaximized:t})=>({background:alpha(e.palette.common.white,.7),backdropFilter:"blur(8px)",width:183,position:"sticky",padding:"16px 8px",paddingTop:t?$l:"16px",height:"100%",overflow:"auto"})),qc=styled(Un)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),xv=styled(Un,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:t})=>({background:t?"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)":"transparent",borderRadius:"4px",padding:"4px 8px",color:t?e.palette.common.white:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer"}));function kW({sections:e,isMaximized:t,onClick:o,activeSection:n}){let r=zc(useId(),"window-side-bar"),i=n||e?.[0]?.id;return jsx(jc,{id:r,"data-testid":"WindowSideBar",isMaximized:t,children:jsx(qc,{children:e?.map(a=>jsx(xv,{onClick:()=>{o?.(a);},isActive:i===a.id,children:a.title},a.id))})})}var Cv=memo(kW);var DW=Cv;
|
|
2
|
+
export{v1 as $,eR as $a,Ms as $b,zF as $c,XO as A,yA as Aa,jm as Ab,zd as Ac,AP as B,TA as Ba,ce as Bb,$d as Bc,kP as C,PA as Ca,qm as Cb,$B as Cc,$P as D,iy as Da,Xm as Db,$T as Dc,YP as E,LA as Ea,Zm as Eb,Jd as Ec,KP as F,gy as Fa,Jm as Fb,nS as Fc,iC as G,GA as Ga,$m as Gb,aS as Gc,lE as H,YA as Ha,Yr as Hb,pS as Hc,cE as I,qA as Ia,TR as Ib,Ck as Ic,yt as J,JA as Ja,Qm as Jb,hk as Jc,yE as K,Iy as Ka,ed as Kb,ai as Kc,yo as L,nD as La,td as Lb,mS as Lc,SE as M,iD as Ma,Ib as Mb,cS as Mc,PE as N,aD as Na,ws as Nb,vk as Nc,RE as O,sD as Oa,vs as Ob,gS as Oc,FE as P,By as Pa,SR as Pb,ES as Pc,zE as Q,Wy as Qa,Ps as Qb,AS as Qc,Ie as R,yD as Ra,wR as Rb,RS as Rc,mt as S,Yy as Sa,od as Sb,BS as Sc,ZE as T,tI as Ta,nd as Tb,uN as Tc,_a as U,lI as Ua,rd as Ub,SN as Uc,n1 as V,RD as Va,bb as Vb,US as Vc,l1 as W,VD as Wa,vR as Wb,rF as Wc,c1 as X,hI as Xa,PR as Xb,fl as Xc,x1 as Y,GD as Ya,ER as Yb,Sw as Yc,P8 as Z,vI as Za,id as Zb,bl as Zc,T1 as _,BI as _a,Es as _b,Tc as _c,$l as a,R1 as aa,iQ as ab,kn as ac,$F as ad,jc as b,Tz as ba,z as bb,cd as bc,vl as bd,qc as c,Mz as ca,Je as cb,fd as cc,Pl as cd,DW as d,kz as da,Is as db,gd as dc,Ml as dd,pr as e,Oz as ea,CR as eb,xd as ec,Dl as ed,Sx as f,JC as fa,Hm as fb,yd as fc,Zw as fd,Rv as g,eM as ga,hR as gb,Id as gc,hV as gd,kv as h,nM as ha,yR as hb,bd as hc,p0 as hd,Wv as i,ih as ia,IR as ib,Xr as ic,c0 as id,_v as j,sh as ja,bs as jb,Ub as jc,I0 as jd,ga as k,yM as ka,Mo as kb,Ed as kc,M0 as kd,Ex as l,bM as la,Qe as lb,Ad as lc,kl as ld,Mx as m,SM as ma,Cb as mb,rB as mc,D0 as md,Rp as n,MM as na,$r as nb,Rd as nc,Nl as nd,xa as o,AM as oa,Om as ob,Ld as oc,Fl as od,U2 as p,BM as pa,Ts as pb,_re as pc,$V as pd,Jo as q,NM as qa,_m as qb,Fs as qc,ec as qd,Qo as r,HM as ra,Ss as rb,Vs as rc,Me as rd,jv as s,$M as sa,bR as sb,CT as sc,oc as sd,Zv as t,jM as ta,Bn as tb,Fd as tc,eP as u,ZM as ua,Ur as ub,Fie as uc,rP as v,tA as va,Um as vb,Os as vc,sP as w,ts as wa,Gr as wb,_s as wc,mP as x,LG as xa,Gm as xb,DT as xc,fr as y,_h as ya,Ym as yb,NT as yc,Np as z,JG as za,Km as zb,_d as zc};
|