@tap-payments/os-micro-frontend-shared 0.3.174 → 0.3.176-test.1
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-3BMEC32B.js → chunk-3TKFTDUU.js} +1 -1
- package/build/_chunks/{chunk-6I4SV7SI.js → chunk-4GAZ3SQE.js} +1 -1
- package/build/_chunks/{chunk-WBXKAK6S.js → chunk-4HKGRDJQ.js} +1 -1
- package/build/_chunks/{chunk-RU4U2U3Q.js → chunk-64P2IJTK.js} +1 -1
- package/build/_chunks/{chunk-WMNFDDLA.js → chunk-6F5QS6LW.js} +1 -1
- package/build/_chunks/{chunk-WHLBHLAV.js → chunk-6Z5EAN7R.js} +1 -1
- package/build/_chunks/{chunk-MCLIRRED.js → chunk-7IA2JOEA.js} +1 -1
- package/build/_chunks/{chunk-Q7LSE3VS.js → chunk-7Q6MEXUY.js} +1 -1
- package/build/_chunks/chunk-7T76F7UP.js +1 -0
- package/build/_chunks/{chunk-IP74OBDP.js → chunk-ABGVWUYE.js} +1 -1
- package/build/_chunks/{chunk-IEVFY2WC.js → chunk-ATOLL6Z7.js} +1 -1
- package/build/_chunks/{chunk-QUZFTQK2.js → chunk-C3LIADHQ.js} +1 -1
- package/build/_chunks/{chunk-VMRBPJIQ.js → chunk-EGOELNBL.js} +1 -1
- package/build/_chunks/{chunk-KDIWOP4E.js → chunk-ESF4WBBN.js} +1 -1
- package/build/_chunks/{chunk-IFOPQWIG.js → chunk-HNYQHLED.js} +1 -1
- package/build/_chunks/{chunk-NYQZZ67B.js → chunk-HQ6V36KP.js} +1 -1
- package/build/_chunks/chunk-HQC2DKSG.js +1 -0
- package/build/_chunks/{chunk-KDXJYLPY.js → chunk-IH5OWVNN.js} +1 -1
- package/build/_chunks/{chunk-2HLBUAAA.js → chunk-IW6GAFMI.js} +2 -2
- package/build/_chunks/{chunk-UHVHKDC4.js → chunk-JINGHAGM.js} +1 -1
- package/build/_chunks/{chunk-3QCEOE6H.js → chunk-JKH2UKMC.js} +1 -1
- package/build/_chunks/{chunk-ERJ6W263.js → chunk-KA5OW6KM.js} +1 -1
- package/build/_chunks/{chunk-2DGIC6NG.js → chunk-KC4A5BKD.js} +1 -1
- package/build/_chunks/{chunk-K3VPGX5Y.js → chunk-LDK7QJZB.js} +1 -1
- package/build/_chunks/chunk-LQVULVAB.js +2 -0
- package/build/_chunks/{chunk-IQUDUXM2.js → chunk-MRUYYZH7.js} +1 -1
- package/build/_chunks/{chunk-VPT2PY7N.js → chunk-NA3ZJGND.js} +1 -1
- package/build/_chunks/{chunk-BSXGYGFB.js → chunk-NXZOAMNR.js} +1 -1
- package/build/_chunks/{chunk-4FDNCCKY.js → chunk-O6WQFHOA.js} +1 -1
- package/build/_chunks/{chunk-BTLYVVUV.js → chunk-OMWYCWCN.js} +1 -1
- package/build/_chunks/{chunk-UXQVTNUQ.js → chunk-PTY3O5PM.js} +1 -1
- package/build/_chunks/{chunk-UIEX72JY.js → chunk-QCB5IDK3.js} +1 -1
- package/build/_chunks/{chunk-6UU3RN3Y.js → chunk-QEDWP7RH.js} +1 -1
- package/build/_chunks/{chunk-GSDLUQMD.js → chunk-S7BDJA6H.js} +1 -1
- package/build/_chunks/{chunk-DLYIC7LX.js → chunk-TNKGHZZM.js} +1 -1
- package/build/_chunks/{chunk-R25W3CPM.js → chunk-TSKIEYMO.js} +1 -1
- package/build/_chunks/{chunk-3OA3MOS3.js → chunk-UCGGUCR5.js} +1 -1
- package/build/_chunks/{chunk-JQARTVZE.js → chunk-V5ACKQNH.js} +1 -1
- package/build/_chunks/chunk-WPRI37BB.js +1 -0
- package/build/_chunks/{chunk-Q322CKA2.js → chunk-WZ7VMCB6.js} +1 -1
- package/build/_chunks/{chunk-2RQRGSYA.js → chunk-Y3RKRLVZ.js} +1 -1
- package/build/_chunks/chunk-ZH35RF3I.js +2 -0
- package/build/_chunks/{chunk-LF53Q3HW.js → chunk-ZPYQXJ2S.js} +1 -1
- package/build/_chunks/{chunk-LPJZD5IN.js → chunk-ZZAZC5EN.js} +1 -1
- package/build/components/ActionMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/AmountConversionFilter/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AmountSlider/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/Button/index.js +1 -1
- package/build/components/ChipStack/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CurrencyFilter/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/Dialog/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/Dropdown2/index.js +1 -1
- package/build/components/DropdownButton/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FileUpload/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- package/build/components/InputBase/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/LanguageDropdown/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MenuItem/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/MultiSelectWithSearch/index.js +1 -1
- package/build/components/NestedDropdown/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/ProgressRing/index.js +1 -1
- package/build/components/RFH/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/ReceiptsViewer/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/SalesChannelFilter/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SelectWithSearch/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TooltipChip/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/WindowSideBar/index.js +1 -1
- package/build/components/index.d.ts +1 -2
- package/build/components/index.js +1 -1
- package/build/components/primitives/ToggleButtons/constants.d.ts +12 -26
- package/build/components/primitives/ToggleButtons/index.d.ts +2 -2
- package/build/components/primitives/ToggleButtons/style.d.ts +1 -2
- package/build/components/primitives/ToggleButtons/type.d.ts +3 -7
- package/build/components/primitives/Typography/constants.d.ts +2 -0
- package/build/components/primitives/Typography/index.d.ts +1 -1
- package/build/components/primitives/Typography/style.d.ts +5 -1
- package/build/components/primitives/Typography/type.d.ts +12 -12
- package/build/components/primitives/index.d.ts +3 -3
- package/build/components/primitives/index.js +1 -1
- package/build/index.js +1 -1
- package/build/theme/_v2/index.d.ts +1 -0
- package/build/theme/_v2/type.d.ts +37 -0
- package/build/theme/_v2/typography.d.ts +3 -0
- package/build/theme/index.js +1 -1
- package/package.json +2 -2
- package/build/_chunks/chunk-EOKPA2D5.js +0 -1
- package/build/_chunks/chunk-GZA5TJGA.js +0 -2
- package/build/_chunks/chunk-KWTIOGYK.js +0 -1
- package/build/_chunks/chunk-KZ6MYQ5Z.js +0 -1
- package/build/_chunks/chunk-MCX337WI.js +0 -2
- package/build/_chunks/chunk-UJSTHVLW.js +0 -1
- package/build/components/IOSSwitch/IOSSwitch.d.ts +0 -8
- package/build/components/IOSSwitch/index.d.ts +0 -2
- package/build/components/IOSSwitch/index.js +0 -1
- package/build/components/IOSSwitch/styles.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$
|
|
1
|
+
import {a as a$4}from'./chunk-6G45KTCP.js';import {a,b,f as f$1,d,c,h as h$1,i,e}from'./chunk-QEDWP7RH.js';import {a as a$5}from'./chunk-MXXAZH6N.js';import {a as a$2}from'./chunk-XQYCJYZI.js';import {a as a$3,b as b$1}from'./chunk-MUR4ILTY.js';import {f,ba,P,O,h,ca}from'./chunk-ZH35RF3I.js';import {a as a$1}from'./chunk-GNY2VGGW.js';import {yc,Ac}from'./chunk-W6W4YZ7G.js';import {Qc,B}from'./chunk-3YAJNHQC.js';import*as de from'react';import de__default,{useId,useState,useEffect,useMemo,useRef,useCallback}from'react';import {useFormContext,Controller,FormProvider,useForm}from'react-hook-form';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import ne from'@mui/material/Box';import Ft from'@mui/material/Button';import Ct from'@mui/material/Input';import lo from'@mui/material/ListSubheader';import io from'@mui/material/MenuItem';import {keyframes,styled,alpha}from'@mui/material/styles';import Rt from'@mui/material/Popper';import Lt from'@mui/material/TextField';function st({onSubmit:e,methods:o,children:t}){let r=yc(useId(),"default-form");return jsx(FormProvider,{...o,children:jsx("form",{id:r,"data-testid":"DefaultForm",onSubmit:e,noValidate:true,children:t})})}var ut=de__default.memo(st);var Xe=de.forwardRef(({name:e,helperText:o,hideArrows:t,feedback:r,...n},l)=>{let{control:s}=useFormContext();return jsx(Controller,{name:e,control:s,defaultValue:n.defaultValue,render:({field:d,fieldState:u})=>jsx(a,{...n,...d,ref:l,hasError:!!u.error,helperText:o??u.error?.message,feedback:r,hideArrows:t,onChange:h=>{d.onChange(h),n.onChange?.(h);},onWheel:h=>{h.target instanceof HTMLElement&&h.target.blur();}})})});Xe.displayName="RFHFormInput";var Ze=de.memo(Xe);var ht=Ze;function oo({phoneName:e,countries:o,countryName:t,helperText:r,isCountriesLoading:n,disabled:l,feedback:s,...d}){let{control:u,watch:h,setValue:f}=useFormContext(),F=h(t),S=x=>{f(t,x);};return jsx(Controller,{name:e,control:u,render:({field:{onChange:x,value:m},fieldState:a})=>jsx(h$1,{...d,phoneValue:m,countries:o,hasError:!!a.error,helperText:r??a.error?.message,feedback:s,onPhoneChange:C=>{x(C);},disabled:l,countryValue:F,onCountryChange:S,isCountriesLoading:n})})}oo.displayName="RFHPhoneInput";var to=oo;var gt=to;var Ie=(e,o)=>e.toFixed(o);function ro({amountName:e,currencies:o,currencyName:t,helperText:r,isCurrenciesLoading:n,...l}){let{control:s,watch:d,setValue:u}=useFormContext(),h=d(t),f=d(e),F=S=>{u(t,S),u(e,Ie(Number(f),S?.decimals||2));};return jsx(Controller,{name:e,control:s,render:({field:{onChange:S,value:x},fieldState:m})=>jsx(i,{...l,amountValue:x??"",currencies:o,hasError:!!m.error,helperText:r??m.error?.message,onAmountChange:a=>{S(a);},onAmountBlur:a=>{S(Ie(Number(a),h?.decimals||2));},currencyValue:h,onCurrencyChange:F,isCurrenciesLoading:n})})}ro.displayName="RFHAmountInput";var ao=ro;var yt=ao;var Mt=keyframes`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(-90deg);
|
|
4
4
|
}
|
|
@@ -12,4 +12,4 @@ import {a as a$5}from'./chunk-6G45KTCP.js';import {a,b,f as f$1,d,c,h,i,e}from'.
|
|
|
12
12
|
100% {
|
|
13
13
|
transform: rotate(270deg);
|
|
14
14
|
}
|
|
15
|
-
`,Fo=styled(ne)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${kt} 2s linear infinite`}),he=styled(ne)(({theme:e})=>({position:"relative",width:11,height:11,transform:"rotate(0deg)",color:e.palette.common.black,"& svg":{width:"100%",height:"100%",display:"block"}})),Co=styled(z)({paddingTop:"8px"}),Pe=styled("ul")({listStyle:"none",margin:0,padding:0}),Io=styled(io)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",padding:"8px",justifyContent:"space-between",fontSize:"10px",fontWeight:500,cursor:"default",pointerEvents:"none",backgroundColor:e.palette.common.white,"&.Mui-disabled":{opacity:1,color:"#8D8D94"}})),Mo=styled(io,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:o})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),backgroundColor:o?e.palette.action.hover:e.palette.common.white})),fe=styled("span")({flex:1,minWidth:0}),Se=styled("img")({width:10,height:7.5,flexShrink:0}),Po=styled("li",{shouldForwardProp:e=>!["$selected","$optionDisabled"].includes(String(e))})(({theme:e,$selected:o,$optionDisabled:t})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),minHeight:48,paddingLeft:e.spacing(2),paddingRight:e.spacing(2),backgroundColor:o?e.palette.action.hover:e.palette.common.white,"&.Mui-focused":{backgroundColor:e.palette.action.hover},...t&&{opacity:.38,pointerEvents:"none"}})),Re=styled("span")({fontSize:"10px",fontWeight:500,color:"#8D8D94"}),Ro=styled(Lt,{shouldForwardProp:e=>!["feedbackType","hasFeedback","hasLabel"].includes(e)})(({theme:e,error:o,feedbackType:t,hasFeedback:r,hasLabel:n})=>{let{borderColor:l}=t?ca(e,t):{borderColor:void 0},s=r?"4px 4px 0 0":"4px";return {width:"100%","& .MuiInputLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)",color:`${e.palette.grey[700]} !important`},"& .MuiInputLabel-root.MuiInputLabel-shrink":{transform:"translate(8px, 8px) scale(0.75)"},"& .MuiInputLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)"},"& .MuiFilledInput-root":{height:"40px",maxHeight:"40px",overflow:"hidden",borderRadius:s,backgroundColor:e.palette.grey[400],paddingTop:n?"11px":"0px",paddingBottom:n?"4px":"0px",paddingLeft:"8px",boxSizing:"border-box",display:"inline-flex",alignItems:n?"stretch":"center","&:before, &:after":{display:"none"},"&:hover":{backgroundColor:e.palette.grey[400]},"&.Mui-focused":{backgroundColor:e.palette.grey[400]},"&.Mui-disabled":{backgroundColor:e.palette.grey[400]}},"& .MuiFilledInput-input":{padding:"0 !important",minHeight:0,height:"auto",boxSizing:"border-box",display:"flex",alignItems:n?"flex-end":"center",alignSelf:n?"flex-end":"center",fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,paddingBottom:n?"1px !important":"0 !important"},"& .MuiFilledInput-root.MuiInputBase-adornedEnd .MuiAutocomplete-input":{flex:"1 1 0%",minWidth:30,width:0,maxWidth:"100%"},"& .MuiAutocomplete-endAdornment":{display:"flex",alignItems:"center",gap:"8px",top:"50%",transform:"translateY(-50%)",right:9},"& .MuiAutocomplete-popupIndicator":{transform:"none",padding:"1px",marginRight:0,marginLeft:0},"& .MuiAutocomplete-popupIndicator.MuiAutocomplete-popupIndicatorOpen":{transform:"none"},"& .MuiAutocomplete-clearIndicator":{visibility:"visible",padding:"1px",marginRight:0,marginLeft:0},...t&&l&&{"& .MuiFilledInput-root":{border:`1px solid ${l}`}},...r&&{"& .MuiFilledInput-root":{borderBottom:"none",borderBottomLeftRadius:0,borderBottomRightRadius:0}},...o&&{"& .MuiFilledInput-root":{border:`1px solid ${e.palette.error.main}`}}}}),bo=e=>({display:"flex",alignItems:"center",gap:"8px",padding:"8px",justifyContent:"space-between",fontSize:"10px",fontWeight:500,cursor:"default",pointerEvents:"none",backgroundColor:e.palette.common.white,color:"#8D8D94"}),Lo=styled(Rt,{shouldForwardProp:e=>!["$menuHasLoadingText","$suppressAutocompleteNoOptions","$suppressEmptyMenuSurface"].includes(e)})(({theme:e,$menuHasLoadingText:o,$suppressAutocompleteNoOptions:t,$suppressEmptyMenuSurface:r})=>({"& .MuiPaper-root":r?{boxShadow:"none",border:"none",backgroundColor:"transparent",margin:0,marginTop:0,padding:0,maxHeight:0,minHeight:0,overflow:"hidden",borderRadius:0,pointerEvents:"none"}:{marginTop:4,borderRadius:4,boxShadow:e.shadows[8],border:"1px solid #F2F2F2",backgroundColor:e.palette.common.white},"& .MuiAutocomplete-listbox":{padding:0,...r?{maxHeight:0,minHeight:0,overflow:"hidden"}:{maxHeight:320}},"& .MuiAutocomplete-noOptions":t?{display:"none !important"}:bo(e),"& .MuiAutocomplete-loading":{...bo(e),...!o&&{display:"none"}}}));function ge({placeholder:e,value:o,onValueChange:t,isLoading:r}){let n=yc(useId(),"form-select-menu-search-input"),l=useCallback(s=>{s.stopPropagation();},[]);return jsx(me,{id:n,"data-testid":"FormSelectMenuSearchInput",placeholder:e,value:o,onChange:s=>t(s.target.value),onKeyDown:l,onKeyUp:l,onMouseDown:l,onClick:l,disableUnderline:true,fullWidth:true,inputProps:{"aria-label":e},endAdornment:r?jsx(Fo,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(he,{"aria-hidden":true,children:jsx(a$4,{})})})}var be=jsx(Re,{children:"No results found"}),wo=jsx(Re,{children:"Loading\u2026"});function xe(e,o,t){return o?o(e):t?t(e):e?.label}function Le(e,o,t){let r=o.toLowerCase().trim(),n=(t?t(e):e?.label)??"";return String(n).toLowerCase().includes(r)}function ko(e){return e}function Ao(e){let o=de__default.forwardRef(function(r,n){let{children:l,className:s,...d}=r,u=e.current;return u?jsxs(Fragment,{children:[jsx(Co,{disableSticky:true,children:jsx(ge,{placeholder:u.menuSearchPlaceholder,value:u.searchValue,onValueChange:u.setSearchValue,isLoading:u.isLoading})}),jsx(Pe,{ref:n,className:s,...d,children:l})]}):jsx(Pe,{ref:n,className:s,...d,children:l})});return o.displayName="FormSelectMenuSearchListbox",o}function To({menuSearchPlaceholder:e,searchValue:o,onSearchChange:t,isLoading:r,menuHasNoOptionsText:n,menuNoOptionsText:l,optionsWithoutEmptyValue:s,getOptionValue:d,getOptionLabel:u,renderOption:h,isOptionEqualToValue:f,menuHasSelectedCheckMark:F,valueOnly:S,getOptionId:x,field:m}){return jsxs(Fragment,{children:[jsx(z,{disableSticky:true,onMouseDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),children:jsx(ge,{placeholder:e,value:o,onValueChange:t,isLoading:r})}),n&&o.trim()&&s.length===0?jsx(Io,{disabled:true,value:"__form_select_no_results__",children:l??be}):s.map((a,C)=>{let i=f?f(a,m.value):a?.id===m.value?.id,g=xe(a,h,u);return jsxs(Mo,{disabled:!!a.disabled,$selected:i,value:(d?d(a):a?.id)??"",onClick:()=>{m.onChange(S?x(a):a);},children:[jsx(fe,{children:g}),F&&i?jsx(Se,{src:Qc,alt:""}):null]},`form-select-item-${(d?d(a):a?.id)??C}`)})]})}var ye={menuHasLoadingText:false,suppressAutocompleteNoOptions:false,suppressEmptyMenuSurface:false};function Vt(e,o){e!=null&&(typeof e=="function"?e(o):e.current=o);}function Nt(...e){return o=>{for(let t of e)Vt(t,o);}}function Dt(e){let o=t=>{let r=e.current;return jsx(Lo,{...t,$menuHasLoadingText:r.menuHasLoadingText,$suppressAutocompleteNoOptions:r.suppressAutocompleteNoOptions,$suppressEmptyMenuSurface:r.suppressEmptyMenuSurface})};return o.displayName="FormSelectSearchableAutocompletePopper",o}function Ho(e){let o=yc(useId(),"form-select-searchable-field"),t=useRef(null),r=useRef(ye);t.current=e.menuSearchable?{searchValue:e.inMenuSearchContextValue.searchValue,setSearchValue:e.inMenuSearchContextValue.setSearchValue,menuSearchPlaceholder:e.inMenuSearchContextValue.menuSearchPlaceholder,isLoading:e.inMenuSearchContextValue.isLoading}:null,r.current=e.searchableAutocompletePopperFlags;let n=useMemo(()=>Ao(t),[]),l=useMemo(()=>Dt(r),[]),s=e.feedback,{isProvided:d$1,isVisible:u,type:h}=Ac(s),f=!!e.fieldState.error&&!u,F=e.helperText??e.fieldState.error?.message,S=e.internalValue!=null&&e.internalValue!==""&&typeof e.internalValue=="object"?e.internalValue:null,x=e.getOptionLabel??(i=>String(i?.label??"")),m=e.isOptionEqualToValue??((i,g)=>i&&g?i.id===g.id:i===g),a=e.ClearIconComponent??b,C=e.label!=null&&e.label!=="";return jsxs(d,{id:o,"data-testid":"FormSelectSearchableField",children:[jsx(a$3,{...e.autocompleteRest,disableClearable:!e.showClearIcon,clearIcon:jsx(a,{sx:{fontSize:8,width:8,height:8}}),ListboxComponent:e.menuSearchable?n:void 0,PopperComponent:l,options:e.optionsWithClearFilterOnly,value:S,onChange:(i,g,M)=>{if(g==null&&e.onClear&&M==="clear"){e.onClear();return}if(e.valueOnly){let R=g==null?null:e.getOptionId(g);e.field.onChange(R);}else e.field.onChange(g);},onInputChange:(i,g,M)=>{e.setSearchableInputValue(g),(M==="input"||M==="clear")&&e.scheduleSearchNotification(g);},slotProps:e.slotProps??{},filterOptions:e.menuSearchable?e.autocompleteFilterOptions:ko,loading:!!e.isLoading,disabled:!!e.disabled,getOptionLabel:x,getOptionDisabled:i=>!!i.disabled,isOptionEqualToValue:m,renderOption:e.renderAutocompleteOption,noOptionsText:e.menuNoOptionsText??be,loadingText:e.menuHasLoadingText?e.menuLoadingText??wo:null,popupIcon:jsx(he,{children:jsx(a$4,{})}),renderInput:i=>{let{inputProps:g,...M}=i,{ref:R,...U}=g;return jsx(Ro,{...M,variant:"filled",label:e.label,placeholder:e.placeholder,required:e.required,error:f,helperText:null,feedbackType:h,hasFeedback:u,hasLabel:C,inputRef:Nt(R,e.field.ref,e.inputRef),InputProps:{...i.InputProps,disableUnderline:true},inputProps:{...U,name:e.field.name,onBlur:e.field.onBlur}})}}),d$1?jsx(da,{...s}):jsx(c,{children:F})]})}function Do(e){let{name:o,helperText:t,feedback:r,menuSearchable:n=false,showClearIcon:l=false,ClearIconComponent:s=b,onClear:d,menuSearchPlaceholder:u="Search",getOptionValue:h,getOptionLabel:f,renderOption:F,isOptionEqualToValue:S,options:x,MenuProps:m,valueOnly:a=false,menuHasSelectedCheckMark:C=false,searchable:i=false,onSearchInputChange:g,searchDebounceMs:M=300,minSearchLength:R,menuLoadingText:U,menuHasLoadingText:b$1=false,menuHasNoOptionsText:w=true,menuNoOptionsText:v,label:re,placeholder:K,required:c,disabled:N,isLoading:k,inputRef:Ce,...G}=e,{control:D}=useFormContext(),[I,Y]=useState(""),[j,J]=useState("");useEffect(()=>{i||J("");},[i]);let Xo=useMemo(()=>({searchValue:I,setSearchValue:Y,menuSearchPlaceholder:u,isLoading:!!k}),[I,u,k]),Q=useRef(void 0),ae=useRef(g);ae.current=g,useEffect(()=>()=>{Q.current&&clearTimeout(Q.current);},[]);let Zo=useCallback(p=>{if(!ae.current)return;let y=p.trim();Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{if(y===""){ae.current?.("");return}R!=null&&y.length<R||ae.current?.(y);},M);},[M,R]),W=useMemo(()=>{let p=x??[];return !l||!h?p:p.filter(y=>{let A=h(y);return A!=null&&A!==""})},[l,h,x]),Oe=useMemo(()=>!n||!I.trim()?W:W.filter(p=>Le(p,I,f)),[n,I,W,f]),X=useMemo(()=>n?Oe:W,[n,Oe,W]),et=useCallback(p=>!n||!I.trim()?p:p.filter(y=>Le(y,I,f)),[n,I,f]),ot=useMemo(()=>{if(!i)return ye;let p=j.trim(),y=p.length===0||R!=null&&p.length>0&&p.length<R,A=n&&!!I.trim()&&X.length===0,B=y&&!A||!w,ie=X.length>0;return {menuHasLoadingText:b$1,suppressAutocompleteNoOptions:B,suppressEmptyMenuSurface:!ie&&!(!B&&!ie)&&!!!(k&&b$1)}},[i,j,R,n,I,X,w,k,b$1]),tt={...m,autoFocus:false,disableEnforceFocus:true},le=p=>(h?h(p):p?.id)??"",nt=p=>!a||!p?p:x?.find(y=>le(y)===p)??p,rt=useCallback((p,y,A)=>{let B=xe(y,F,f),ie=!!y.disabled;return jsxs(Po,{...p,$selected:A.selected,$optionDisabled:ie,children:[jsx(fe,{children:B}),C&&A.selected?jsx(Se,{src:Qc,alt:""}):null]})},[f,F,C]),Te={...G};for(let p of ["IconComponent","startComponent"])delete Te[p];let{slotProps:at={},...lt}=Te;return jsx(Controller,{name:o,control:D,render:({field:p,fieldState:y})=>{let A=nt(p.value);return i?jsx(Ho,{menuSearchable:n,inMenuSearchContextValue:Xo,searchableAutocompletePopperFlags:ot,optionsWithClearFilterOnly:W,autocompleteFilterOptions:et,slotProps:at,autocompleteRest:lt,inputRef:Ce,showClearIcon:l,ClearIconComponent:s,menuHasLoadingText:b$1,menuLoadingText:U,menuNoOptionsText:v,isLoading:k,disabled:N,label:re,placeholder:K,required:c,valueOnly:a,getOptionId:le,scheduleSearchNotification:Zo,setSearchableInputValue:J,renderAutocompleteOption:rt,onClear:d,feedback:r,helperText:t,field:p,fieldState:y,internalValue:A,getOptionLabel:f,isOptionEqualToValue:S}):jsx(f$1,{...G,...p,label:re,placeholder:K,required:c,disabled:N,isLoading:k,value:A,menuHasSelectedCheckMark:C,showClearIcon:l,ClearIconComponent:s,onClear:d,options:X,getOptionValue:h,getOptionLabel:f,renderOption:F,isOptionEqualToValue:S,hasError:!!y.error,helperText:t??y.error?.message,feedback:r,onChange:B=>p.onChange(a?le(B):B),MenuProps:tt,children:n?jsx(To,{menuSearchPlaceholder:u,searchValue:I,onSearchChange:Y,isLoading:k,menuHasNoOptionsText:w,menuNoOptionsText:v,optionsWithoutEmptyValue:X,getOptionValue:h,getOptionLabel:f,renderOption:F,isOptionEqualToValue:S,menuHasSelectedCheckMark:C,valueOnly:a,getOptionId:le,field:p}):void 0})}})}Do.displayName="RFHSelect";var Wo=de__default.memo(Do);var ke=Wo;function qo({name:e,disabled:o,...t}){let{control:r}=useFormContext();return jsx(Controller,{name:e,control:r,render:({field:{name:n,onBlur:l,onChange:s,value:d,disabled:u}})=>jsx(a$2,{...t,onChange:s,onBlur:l,name:n,disabled:u||o,checked:d??false})})}qo.displayName="RFHSWitch";var _o=de.memo(qo);var Gt=_o;var Uo=styled(a$1)(({theme:e})=>({fontSize:"10px",color:e.palette.grey[700],fontWeight:600,lineHeight:"10px"}));styled(a$1)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:600,lineHeight:"14.3px",width:200}));var Ko=styled(ne)(()=>({display:"flex",flexDirection:"column",maxHeight:180,overflow:"auto",scrollbarWidth:"thin",scrollbarColor:"#E5E5E5 #E5E5E5"})),Go=styled(P)(({theme:e})=>{let o=`1px solid ${alpha(e.palette.common.black,.1)}`;return {flexShrink:0,border:0,borderRadius:0,"&.Mui-expanded:not(:last-of-type)":{borderBottom:o},[`&:last-of-type .${O.summary}`]:{borderBottom:"none"},[`&.Mui-expanded:last-of-type .${O.summary}`]:{borderBottom:o},[`& .${O.summary}`]:{backgroundColor:e.palette.common.white,borderBottom:o,minHeight:28,height:"auto","& .MuiAccordionSummary-content":{margin:"auto"},"&.Mui-expanded":{backgroundColor:"#F8F8F8",minHeight:28,height:"auto"}},[`& .${O.content}`]:{borderTop:"none"}}});styled(Ct)(({theme:e})=>({width:"inherit",height:32,padding:"11px 12px",fontSize:"10px",borderRadius:"5px",backgroundColor:"#F9F9F9",border:"1px solid transparent","&.Mui-focused":{borderColor:e.palette.info.dark}}));var Yo=styled(ne)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));styled(ne)(()=>({display:"flex",gap:"8px",padding:"4px",flexWrap:"wrap",paddingInlineEnd:"20px"}));styled(ne)(({theme:e,maxWidth:o})=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:`${e.palette.info.dark}1a`,fontSize:"10px",fontWeight:500,cursor:"pointer",...o&&{maxWidth:`${o}%`}}));var jo=styled(a$1)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",fontSize:"10px",fontWeight:500,color:e.palette.common.black,cursor:"pointer",padding:"8px 20px"}));styled(ne)(({theme:e})=>({width:"100%",flexDirection:"column",border:`1px solid ${e.palette.grey[100]}`,borderRadius:"4px",backgroundColor:e.palette.grey[400]}));function Xt({name:e,options:o,...t}){let r=yc(useId(),"select-with-accordion"),[n,l]=useState(null),[s,d]=useState(0),u=!!n,h=m=>{l(u?null:m.currentTarget);},f=()=>{l(null);},{watch:F,setValue:S}=useFormContext(),x=F(e);return jsx(a$5,{id:r,"data-testid":"SelectWithAccordion",open:u,anchorEl:n,onOpen:h,onClose:f,trigger:jsx(ke,{name:e,options:[],...t,open:false}),hideArrow:true,listWrapperSx:{padding:0,margin:0},children:jsx(Yo,{onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:jsx(Ko,{"data-testid":"AccordionWrapper",children:o.map?.((m,a)=>jsx(Go,{expanded:s===a,onChange:i=>d(i?a:null),label:jsx(Uo,{variant:"caption",children:m.group}),content:(m?.options||[]).map((i,g)=>{let M=t?.isOptionEqualToValue?.(i,x);return jsxs(jo,{onClick:()=>{S(e,i,{shouldDirty:true,shouldTouch:true,shouldValidate:true}),f();},children:[t.renderOption?.(i)||i.label,M&&jsx(a$6,{src:Qc,alt:"blue-check",sx:{width:14,height:10}})]},`${i.value}-${i.label}-${g}`)})},`${m.group}-group-${a}`))})})})}var Qo=Xt;var en=Qo;function Ae({name:e$1,helperText:o,getOptionValue:t,getOptionLabel:r,renderOption:n,isOptionEqualToValue:l,getOptionDisabled:s,menuSearchable:d=false,menuSearchPlaceholder:u="Search",showCheckbox:h=true,menuHasSelectionSummary:f=false,valueOnly:F=false,options:S,isLoading:x,...m}){let{control:a}=useFormContext(),[C,i]=useState(""),g=b=>(t?t(b):b?.id)??"",M=b=>!F||!b?.length?b??[]:b.map(w=>S?.find(v=>g(v)===w)).filter(Boolean),R=b=>b?.map(g)??[],U=useMemo(()=>{if(!d||!C.trim())return S??[];let b=C.toLowerCase().trim();return (S??[]).filter(w=>{let v=(r?r(w):w?.label)??"";return String(v).toLowerCase().includes(b)})},[S,d,C,r]);return jsx(Controller,{name:e$1,control:a,defaultValue:[],render:({field:b,fieldState:w})=>{let v=Array.isArray(b.value)?b.value.filter(c=>c!=null).length:0,re=f&&v>0,K=M(b.value);return jsxs(e,{...m,isLoading:x,...b,options:S??[],value:K,getOptionLabel:r,hasError:!!w.error,helperText:o??w.error?.message,onChange:c=>b.onChange(F?R(c):c),MenuProps:{...m.MenuProps,autoFocus:false,disableEnforceFocus:true},children:[d&&jsx(z,{disableSticky:true,children:jsx(me,{placeholder:u,value:C,onChange:c=>i(c.target.value),onKeyDown:c=>c.stopPropagation(),onKeyUp:c=>c.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":u},endAdornment:x?jsx(co,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(ho,{src:B,alt:"search"})})}),re&&jsx(uo,{disableSticky:true,children:jsxs(so,{children:[jsxs(po,{children:[v," selected"]}),jsx(mo,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:c=>{c.preventDefault(),c.stopPropagation();},onClick:c=>{c.preventDefault(),c.stopPropagation(),m.onClear?m.onClear():b.onChange([]);},children:"Clear"})]})}),U?.map(c=>{let N=K?.some(D=>{if(D==null)return false;if(l)return l(c,D);if(t){let j=t(c),J=t(D);return j===J||String(j)===String(J)}let I=c?.id,Y=D?.id;return I===Y||String(I)===String(Y)}),k=s?s(c):false,Ce=r?r(c):c.label,G=n?n(c):Ce;return jsx(So,{value:(t?t(c):c?.id)??"",disabled:k,$selected:N,children:h?jsxs(fo,{children:[jsx(go,{checked:N,$mutedRect:N&&k}),G]}):G},(t?t(c):c?.id)??"")})]})}})}var ln=useForm;export{ut as a,ht as b,gt as c,yt as d,ke as e,Gt as f,en as g,Ae as h,ln as i};
|
|
15
|
+
`,Fo=styled(ne)({width:12,height:12,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:"100%",height:"100%",display:"block"},animation:`${kt} 2s linear infinite`}),he=styled(ne)(({theme:e})=>({position:"relative",width:11,height:11,transform:"rotate(0deg)",color:e.palette.common.black,"& svg":{width:"100%",height:"100%",display:"block"}})),Co=styled(z)({paddingTop:"8px"}),Pe=styled("ul")({listStyle:"none",margin:0,padding:0}),Io=styled(io)(({theme:e})=>({display:"flex",alignItems:"center",gap:"8px",padding:"8px",justifyContent:"space-between",fontSize:"10px",fontWeight:500,cursor:"default",pointerEvents:"none",backgroundColor:e.palette.common.white,"&.Mui-disabled":{opacity:1,color:"#8D8D94"}})),Mo=styled(io,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:o})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),backgroundColor:o?e.palette.action.hover:e.palette.common.white})),fe=styled("span")({flex:1,minWidth:0}),Se=styled("img")({width:10,height:7.5,flexShrink:0}),Po=styled("li",{shouldForwardProp:e=>!["$selected","$optionDisabled"].includes(String(e))})(({theme:e,$selected:o,$optionDisabled:t})=>({fontSize:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(1),minHeight:48,paddingLeft:e.spacing(2),paddingRight:e.spacing(2),backgroundColor:o?e.palette.action.hover:e.palette.common.white,"&.Mui-focused":{backgroundColor:e.palette.action.hover},...t&&{opacity:.38,pointerEvents:"none"}})),Re=styled("span")({fontSize:"10px",fontWeight:500,color:"#8D8D94"}),Ro=styled(Lt,{shouldForwardProp:e=>!["feedbackType","hasFeedback","hasLabel"].includes(e)})(({theme:e,error:o,feedbackType:t,hasFeedback:r,hasLabel:n})=>{let{borderColor:l}=t?ba(e,t):{borderColor:void 0},s=r?"4px 4px 0 0":"4px";return {width:"100%","& .MuiInputLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)",color:`${e.palette.grey[700]} !important`},"& .MuiInputLabel-root.MuiInputLabel-shrink":{transform:"translate(8px, 8px) scale(0.75)"},"& .MuiInputLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)"},"& .MuiFilledInput-root":{height:"40px",maxHeight:"40px",overflow:"hidden",borderRadius:s,backgroundColor:e.palette.grey[400],paddingTop:n?"11px":"0px",paddingBottom:n?"4px":"0px",paddingLeft:"8px",boxSizing:"border-box",display:"inline-flex",alignItems:n?"stretch":"center","&:before, &:after":{display:"none"},"&:hover":{backgroundColor:e.palette.grey[400]},"&.Mui-focused":{backgroundColor:e.palette.grey[400]},"&.Mui-disabled":{backgroundColor:e.palette.grey[400]}},"& .MuiFilledInput-input":{padding:"0 !important",minHeight:0,height:"auto",boxSizing:"border-box",display:"flex",alignItems:n?"flex-end":"center",alignSelf:n?"flex-end":"center",fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,paddingBottom:n?"1px !important":"0 !important"},"& .MuiFilledInput-root.MuiInputBase-adornedEnd .MuiAutocomplete-input":{flex:"1 1 0%",minWidth:30,width:0,maxWidth:"100%"},"& .MuiAutocomplete-endAdornment":{display:"flex",alignItems:"center",gap:"8px",top:"50%",transform:"translateY(-50%)",right:9},"& .MuiAutocomplete-popupIndicator":{transform:"none",padding:"1px",marginRight:0,marginLeft:0},"& .MuiAutocomplete-popupIndicator.MuiAutocomplete-popupIndicatorOpen":{transform:"none"},"& .MuiAutocomplete-clearIndicator":{visibility:"visible",padding:"1px",marginRight:0,marginLeft:0},...t&&l&&{"& .MuiFilledInput-root":{border:`1px solid ${l}`}},...r&&{"& .MuiFilledInput-root":{borderBottom:"none",borderBottomLeftRadius:0,borderBottomRightRadius:0}},...o&&{"& .MuiFilledInput-root":{border:`1px solid ${e.palette.error.main}`}}}}),bo=e=>({display:"flex",alignItems:"center",gap:"8px",padding:"8px",justifyContent:"space-between",fontSize:"10px",fontWeight:500,cursor:"default",pointerEvents:"none",backgroundColor:e.palette.common.white,color:"#8D8D94"}),Lo=styled(Rt,{shouldForwardProp:e=>!["$menuHasLoadingText","$suppressAutocompleteNoOptions","$suppressEmptyMenuSurface"].includes(e)})(({theme:e,$menuHasLoadingText:o,$suppressAutocompleteNoOptions:t,$suppressEmptyMenuSurface:r})=>({"& .MuiPaper-root":r?{boxShadow:"none",border:"none",backgroundColor:"transparent",margin:0,marginTop:0,padding:0,maxHeight:0,minHeight:0,overflow:"hidden",borderRadius:0,pointerEvents:"none"}:{marginTop:4,borderRadius:4,boxShadow:e.shadows[8],border:"1px solid #F2F2F2",backgroundColor:e.palette.common.white},"& .MuiAutocomplete-listbox":{padding:0,...r?{maxHeight:0,minHeight:0,overflow:"hidden"}:{maxHeight:320}},"& .MuiAutocomplete-noOptions":t?{display:"none !important"}:bo(e),"& .MuiAutocomplete-loading":{...bo(e),...!o&&{display:"none"}}}));function ge({placeholder:e,value:o,onValueChange:t,isLoading:r}){let n=yc(useId(),"form-select-menu-search-input"),l=useCallback(s=>{s.stopPropagation();},[]);return jsx(me,{id:n,"data-testid":"FormSelectMenuSearchInput",placeholder:e,value:o,onChange:s=>t(s.target.value),onKeyDown:l,onKeyUp:l,onMouseDown:l,onClick:l,disableUnderline:true,fullWidth:true,inputProps:{"aria-label":e},endAdornment:r?jsx(Fo,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(he,{"aria-hidden":true,children:jsx(a$3,{})})})}var be=jsx(Re,{children:"No results found"}),wo=jsx(Re,{children:"Loading\u2026"});function xe(e,o,t){return o?o(e):t?t(e):e?.label}function Le(e,o,t){let r=o.toLowerCase().trim(),n=(t?t(e):e?.label)??"";return String(n).toLowerCase().includes(r)}function ko(e){return e}function Ao(e){let o=de__default.forwardRef(function(r,n){let{children:l,className:s,...d}=r,u=e.current;return u?jsxs(Fragment,{children:[jsx(Co,{disableSticky:true,children:jsx(ge,{placeholder:u.menuSearchPlaceholder,value:u.searchValue,onValueChange:u.setSearchValue,isLoading:u.isLoading})}),jsx(Pe,{ref:n,className:s,...d,children:l})]}):jsx(Pe,{ref:n,className:s,...d,children:l})});return o.displayName="FormSelectMenuSearchListbox",o}function To({menuSearchPlaceholder:e,searchValue:o,onSearchChange:t,isLoading:r,menuHasNoOptionsText:n,menuNoOptionsText:l,optionsWithoutEmptyValue:s,getOptionValue:d,getOptionLabel:u,renderOption:h,isOptionEqualToValue:f,menuHasSelectedCheckMark:F,valueOnly:S,getOptionId:x,field:m}){return jsxs(Fragment,{children:[jsx(z,{disableSticky:true,onMouseDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),children:jsx(ge,{placeholder:e,value:o,onValueChange:t,isLoading:r})}),n&&o.trim()&&s.length===0?jsx(Io,{disabled:true,value:"__form_select_no_results__",children:l??be}):s.map((a,C)=>{let i=f?f(a,m.value):a?.id===m.value?.id,g=xe(a,h,u);return jsxs(Mo,{disabled:!!a.disabled,$selected:i,value:(d?d(a):a?.id)??"",onClick:()=>{m.onChange(S?x(a):a);},children:[jsx(fe,{children:g}),F&&i?jsx(Se,{src:Qc,alt:""}):null]},`form-select-item-${(d?d(a):a?.id)??C}`)})]})}var ye={menuHasLoadingText:false,suppressAutocompleteNoOptions:false,suppressEmptyMenuSurface:false};function Vt(e,o){e!=null&&(typeof e=="function"?e(o):e.current=o);}function Nt(...e){return o=>{for(let t of e)Vt(t,o);}}function Dt(e){let o=t=>{let r=e.current;return jsx(Lo,{...t,$menuHasLoadingText:r.menuHasLoadingText,$suppressAutocompleteNoOptions:r.suppressAutocompleteNoOptions,$suppressEmptyMenuSurface:r.suppressEmptyMenuSurface})};return o.displayName="FormSelectSearchableAutocompletePopper",o}function Ho(e){let o=yc(useId(),"form-select-searchable-field"),t=useRef(null),r=useRef(ye);t.current=e.menuSearchable?{searchValue:e.inMenuSearchContextValue.searchValue,setSearchValue:e.inMenuSearchContextValue.setSearchValue,menuSearchPlaceholder:e.inMenuSearchContextValue.menuSearchPlaceholder,isLoading:e.inMenuSearchContextValue.isLoading}:null,r.current=e.searchableAutocompletePopperFlags;let n=useMemo(()=>Ao(t),[]),l=useMemo(()=>Dt(r),[]),s=e.feedback,{isProvided:d$1,isVisible:u,type:h}=Ac(s),f=!!e.fieldState.error&&!u,F=e.helperText??e.fieldState.error?.message,S=e.internalValue!=null&&e.internalValue!==""&&typeof e.internalValue=="object"?e.internalValue:null,x=e.getOptionLabel??(i=>String(i?.label??"")),m=e.isOptionEqualToValue??((i,g)=>i&&g?i.id===g.id:i===g),a=e.ClearIconComponent??b,C=e.label!=null&&e.label!=="";return jsxs(d,{id:o,"data-testid":"FormSelectSearchableField",children:[jsx(a$2,{...e.autocompleteRest,disableClearable:!e.showClearIcon,clearIcon:jsx(a,{sx:{fontSize:8,width:8,height:8}}),ListboxComponent:e.menuSearchable?n:void 0,PopperComponent:l,options:e.optionsWithClearFilterOnly,value:S,onChange:(i,g,M)=>{if(g==null&&e.onClear&&M==="clear"){e.onClear();return}if(e.valueOnly){let R=g==null?null:e.getOptionId(g);e.field.onChange(R);}else e.field.onChange(g);},onInputChange:(i,g,M)=>{e.setSearchableInputValue(g),(M==="input"||M==="clear")&&e.scheduleSearchNotification(g);},slotProps:e.slotProps??{},filterOptions:e.menuSearchable?e.autocompleteFilterOptions:ko,loading:!!e.isLoading,disabled:!!e.disabled,getOptionLabel:x,getOptionDisabled:i=>!!i.disabled,isOptionEqualToValue:m,renderOption:e.renderAutocompleteOption,noOptionsText:e.menuNoOptionsText??be,loadingText:e.menuHasLoadingText?e.menuLoadingText??wo:null,popupIcon:jsx(he,{children:jsx(a$3,{})}),renderInput:i=>{let{inputProps:g,...M}=i,{ref:R,...U}=g;return jsx(Ro,{...M,variant:"filled",label:e.label,placeholder:e.placeholder,required:e.required,error:f,helperText:null,feedbackType:h,hasFeedback:u,hasLabel:C,inputRef:Nt(R,e.field.ref,e.inputRef),InputProps:{...i.InputProps,disableUnderline:true},inputProps:{...U,name:e.field.name,onBlur:e.field.onBlur}})}}),d$1?jsx(ca,{...s}):jsx(c,{children:F})]})}function Do(e){let{name:o,helperText:t,feedback:r,menuSearchable:n=false,showClearIcon:l=false,ClearIconComponent:s=b,onClear:d,menuSearchPlaceholder:u="Search",getOptionValue:h,getOptionLabel:f,renderOption:F,isOptionEqualToValue:S,options:x,MenuProps:m,valueOnly:a=false,menuHasSelectedCheckMark:C=false,searchable:i=false,onSearchInputChange:g,searchDebounceMs:M=300,minSearchLength:R,menuLoadingText:U,menuHasLoadingText:b$1=false,menuHasNoOptionsText:w=true,menuNoOptionsText:v,label:re,placeholder:K,required:c,disabled:N,isLoading:k,inputRef:Ce,...G}=e,{control:D}=useFormContext(),[I,Y]=useState(""),[j,J]=useState("");useEffect(()=>{i||J("");},[i]);let Xo=useMemo(()=>({searchValue:I,setSearchValue:Y,menuSearchPlaceholder:u,isLoading:!!k}),[I,u,k]),Q=useRef(void 0),ae=useRef(g);ae.current=g,useEffect(()=>()=>{Q.current&&clearTimeout(Q.current);},[]);let Zo=useCallback(p=>{if(!ae.current)return;let y=p.trim();Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{if(y===""){ae.current?.("");return}R!=null&&y.length<R||ae.current?.(y);},M);},[M,R]),W=useMemo(()=>{let p=x??[];return !l||!h?p:p.filter(y=>{let A=h(y);return A!=null&&A!==""})},[l,h,x]),Oe=useMemo(()=>!n||!I.trim()?W:W.filter(p=>Le(p,I,f)),[n,I,W,f]),X=useMemo(()=>n?Oe:W,[n,Oe,W]),et=useCallback(p=>!n||!I.trim()?p:p.filter(y=>Le(y,I,f)),[n,I,f]),ot=useMemo(()=>{if(!i)return ye;let p=j.trim(),y=p.length===0||R!=null&&p.length>0&&p.length<R,A=n&&!!I.trim()&&X.length===0,B=y&&!A||!w,ie=X.length>0;return {menuHasLoadingText:b$1,suppressAutocompleteNoOptions:B,suppressEmptyMenuSurface:!ie&&!(!B&&!ie)&&!!!(k&&b$1)}},[i,j,R,n,I,X,w,k,b$1]),tt={...m,autoFocus:false,disableEnforceFocus:true},le=p=>(h?h(p):p?.id)??"",nt=p=>!a||!p?p:x?.find(y=>le(y)===p)??p,rt=useCallback((p,y,A)=>{let B=xe(y,F,f),ie=!!y.disabled;return jsxs(Po,{...p,$selected:A.selected,$optionDisabled:ie,children:[jsx(fe,{children:B}),C&&A.selected?jsx(Se,{src:Qc,alt:""}):null]})},[f,F,C]),Te={...G};for(let p of ["IconComponent","startComponent"])delete Te[p];let{slotProps:at={},...lt}=Te;return jsx(Controller,{name:o,control:D,render:({field:p,fieldState:y})=>{let A=nt(p.value);return i?jsx(Ho,{menuSearchable:n,inMenuSearchContextValue:Xo,searchableAutocompletePopperFlags:ot,optionsWithClearFilterOnly:W,autocompleteFilterOptions:et,slotProps:at,autocompleteRest:lt,inputRef:Ce,showClearIcon:l,ClearIconComponent:s,menuHasLoadingText:b$1,menuLoadingText:U,menuNoOptionsText:v,isLoading:k,disabled:N,label:re,placeholder:K,required:c,valueOnly:a,getOptionId:le,scheduleSearchNotification:Zo,setSearchableInputValue:J,renderAutocompleteOption:rt,onClear:d,feedback:r,helperText:t,field:p,fieldState:y,internalValue:A,getOptionLabel:f,isOptionEqualToValue:S}):jsx(f$1,{...G,...p,label:re,placeholder:K,required:c,disabled:N,isLoading:k,value:A,menuHasSelectedCheckMark:C,showClearIcon:l,ClearIconComponent:s,onClear:d,options:X,getOptionValue:h,getOptionLabel:f,renderOption:F,isOptionEqualToValue:S,hasError:!!y.error,helperText:t??y.error?.message,feedback:r,onChange:B=>p.onChange(a?le(B):B),MenuProps:tt,children:n?jsx(To,{menuSearchPlaceholder:u,searchValue:I,onSearchChange:Y,isLoading:k,menuHasNoOptionsText:w,menuNoOptionsText:v,optionsWithoutEmptyValue:X,getOptionValue:h,getOptionLabel:f,renderOption:F,isOptionEqualToValue:S,menuHasSelectedCheckMark:C,valueOnly:a,getOptionId:le,field:p}):void 0})}})}Do.displayName="RFHSelect";var Wo=de__default.memo(Do);var ke=Wo;function qo({name:e,disabled:o,...t}){let{control:r}=useFormContext();return jsx(Controller,{name:e,control:r,render:({field:{name:n,onBlur:l,onChange:s,value:d,disabled:u}})=>jsx(h,{...t,onChange:s,onBlur:l,name:n,disabled:u||o,checked:d??false})})}qo.displayName="RFHSwitch";var _o=de.memo(qo);var Gt=_o;var Uo=styled(a$1)(({theme:e})=>({fontSize:"10px",color:e.palette.grey[700],fontWeight:600,lineHeight:"10px"}));styled(a$1)(({theme:e})=>({fontSize:"11px",color:e.palette.text.primary,fontWeight:600,lineHeight:"14.3px",width:200}));var Ko=styled(ne)(()=>({display:"flex",flexDirection:"column",maxHeight:180,overflow:"auto",scrollbarWidth:"thin",scrollbarColor:"#E5E5E5 #E5E5E5"})),Go=styled(P)(({theme:e})=>{let o=`1px solid ${alpha(e.palette.common.black,.1)}`;return {flexShrink:0,border:0,borderRadius:0,"&.Mui-expanded:not(:last-of-type)":{borderBottom:o},[`&:last-of-type .${O.summary}`]:{borderBottom:"none"},[`&.Mui-expanded:last-of-type .${O.summary}`]:{borderBottom:o},[`& .${O.summary}`]:{backgroundColor:e.palette.common.white,borderBottom:o,minHeight:28,height:"auto","& .MuiAccordionSummary-content":{margin:"auto"},"&.Mui-expanded":{backgroundColor:"#F8F8F8",minHeight:28,height:"auto"}},[`& .${O.content}`]:{borderTop:"none"}}});styled(Ct)(({theme:e})=>({width:"inherit",height:32,padding:"11px 12px",fontSize:"10px",borderRadius:"5px",backgroundColor:"#F9F9F9",border:"1px solid transparent","&.Mui-focused":{borderColor:e.palette.info.dark}}));var Yo=styled(ne)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));styled(ne)(()=>({display:"flex",gap:"8px",padding:"4px",flexWrap:"wrap",paddingInlineEnd:"20px"}));styled(ne)(({theme:e,maxWidth:o})=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:`${e.palette.info.dark}1a`,fontSize:"10px",fontWeight:500,cursor:"pointer",...o&&{maxWidth:`${o}%`}}));var jo=styled(a$1)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",fontSize:"10px",fontWeight:500,color:e.palette.common.black,cursor:"pointer",padding:"8px 20px"}));styled(ne)(({theme:e})=>({width:"100%",flexDirection:"column",border:`1px solid ${e.palette.grey[100]}`,borderRadius:"4px",backgroundColor:e.palette.grey[400]}));function Xt({name:e,options:o,...t}){let r=yc(useId(),"select-with-accordion"),[n,l]=useState(null),[s,d]=useState(0),u=!!n,h=m=>{l(u?null:m.currentTarget);},f=()=>{l(null);},{watch:F,setValue:S}=useFormContext(),x=F(e);return jsx(a$4,{id:r,"data-testid":"SelectWithAccordion",open:u,anchorEl:n,onOpen:h,onClose:f,trigger:jsx(ke,{name:e,options:[],...t,open:false}),hideArrow:true,listWrapperSx:{padding:0,margin:0},children:jsx(Yo,{onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:jsx(Ko,{"data-testid":"AccordionWrapper",children:o.map?.((m,a)=>jsx(Go,{expanded:s===a,onChange:i=>d(i?a:null),label:jsx(Uo,{variant:"caption",children:m.group}),content:(m?.options||[]).map((i,g)=>{let M=t?.isOptionEqualToValue?.(i,x);return jsxs(jo,{onClick:()=>{S(e,i,{shouldDirty:true,shouldTouch:true,shouldValidate:true}),f();},children:[t.renderOption?.(i)||i.label,M&&jsx(a$5,{src:Qc,alt:"blue-check",sx:{width:14,height:10}})]},`${i.value}-${i.label}-${g}`)})},`${m.group}-group-${a}`))})})})}var Qo=Xt;var en=Qo;function Ae({name:e$1,helperText:o,getOptionValue:t,getOptionLabel:r,renderOption:n,isOptionEqualToValue:l,getOptionDisabled:s,menuSearchable:d=false,menuSearchPlaceholder:u="Search",showCheckbox:h=true,menuHasSelectionSummary:f=false,valueOnly:F=false,options:S,isLoading:x,...m}){let{control:a}=useFormContext(),[C,i]=useState(""),g=b=>(t?t(b):b?.id)??"",M=b=>!F||!b?.length?b??[]:b.map(w=>S?.find(v=>g(v)===w)).filter(Boolean),R=b=>b?.map(g)??[],U=useMemo(()=>{if(!d||!C.trim())return S??[];let b=C.toLowerCase().trim();return (S??[]).filter(w=>{let v=(r?r(w):w?.label)??"";return String(v).toLowerCase().includes(b)})},[S,d,C,r]);return jsx(Controller,{name:e$1,control:a,defaultValue:[],render:({field:b,fieldState:w})=>{let v=Array.isArray(b.value)?b.value.filter(c=>c!=null).length:0,re=f&&v>0,K=M(b.value);return jsxs(e,{...m,isLoading:x,...b,options:S??[],value:K,getOptionLabel:r,hasError:!!w.error,helperText:o??w.error?.message,onChange:c=>b.onChange(F?R(c):c),MenuProps:{...m.MenuProps,autoFocus:false,disableEnforceFocus:true},children:[d&&jsx(z,{disableSticky:true,children:jsx(me,{placeholder:u,value:C,onChange:c=>i(c.target.value),onKeyDown:c=>c.stopPropagation(),onKeyUp:c=>c.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":u},endAdornment:x?jsx(co,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(ho,{src:B,alt:"search"})})}),re&&jsx(uo,{disableSticky:true,children:jsxs(so,{children:[jsxs(po,{children:[v," selected"]}),jsx(mo,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:c=>{c.preventDefault(),c.stopPropagation();},onClick:c=>{c.preventDefault(),c.stopPropagation(),m.onClear?m.onClear():b.onChange([]);},children:"Clear"})]})}),U?.map(c=>{let N=K?.some(D=>{if(D==null)return false;if(l)return l(c,D);if(t){let j=t(c),J=t(D);return j===J||String(j)===String(J)}let I=c?.id,Y=D?.id;return I===Y||String(I)===String(Y)}),k=s?s(c):false,Ce=r?r(c):c.label,G=n?n(c):Ce;return jsx(So,{value:(t?t(c):c?.id)??"",disabled:k,$selected:N,children:h?jsxs(fo,{children:[jsx(go,{checked:N,$mutedRect:N&&k}),G]}):G},(t?t(c):c?.id)??"")})]})}})}var ln=useForm;export{ut as a,ht as b,gt as c,yt as d,ke as e,Gt as f,en as g,Ae as h,ln as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,b as b$1,g,a as a$2,e,d,c as c$1}from'./chunk-GB5N3AEY.js';import {a as a$4}from'./chunk-R25W3CPM.js';import {a as a$1}from'./chunk-MXXAZH6N.js';import {c}from'./chunk-BSXGYGFB.js';import {a}from'./chunk-ZONDSLTR.js';import {o,j as j$1,k,l,p as p$1}from'./chunk-IEVFY2WC.js';import {p,z}from'./chunk-MCX337WI.js';import {a as a$3}from'./chunk-SUBIH236.js';import {b}from'./chunk-UYDM5BBG.js';import {Va,yc,Ha,Ia,bc,f as f$1}from'./chunk-W6W4YZ7G.js';import {s}from'./chunk-N372QRVU.js';import {U,zi,Bi,Ai,yi,Fi,dh,Wg,ch,Sj,Tj,ub,hk,kk,Bk,ik,vb,wa,va,tk,h,Vg}from'./chunk-3YAJNHQC.js';import {useId,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Box,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {motion}from'framer-motion';import {styled as styled$1,useTheme as useTheme$1}from'@mui/material/styles';import _ from'lodash/camelCase';import Qe from'@mui/material/Box';var lt={ORDER:{label:"order",icon:yi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:Ai,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Bi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:zi,color:"#32ADE6"}},dt={SAVED_TOKEN:{label:"savedToken",icon:U,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var ct=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),mt=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function Ie({type:t,hasSavedCard:o,totalPaymentsCount:e,isTextShown:r}){let l=yc(useId(),"agreement-icon"),p$1=useTheme(),{t:a$2}=useTranslation(),n=useMemo(()=>[...o?[dt.SAVED_TOKEN]:[],...(e||0)>0?[dt.COUNT]:[],...t&<[t]?[lt[t]]:[]],[o,e,t]),d=c=>r?jsx(a,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a$2("totalPaymentCount",{amount:f$1(e)}),children:jsx(mt,{children:jsxs(ct,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:dt.COUNT.color},children:["x",e]})})})},c):jsx(a$4,{value:e,index:c},c),s=n.map((c,g)=>c.label==="countBadge"?d(g):jsx(p,{title:a$2(c.label),children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a$2(c.label)})}):jsx(a$1,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:c.icon,alt:"agreement"})},c.color)},c.color)),f=jsx(p,{title:"No agreement",children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:p$1.palette.text.secondary},children:"No agreement"})}):jsx(a$1,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Fi,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:l,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:s?.length>0?s:f})}var To=Ie;var Ce=To;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var Ao=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),Po=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var Wo=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var kt={"3DS":{tooltip:"3DS",icon:Tj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:ch,borderColor:"rgba(31, 136, 208, 0.10)"}},vo={FAILED:{tooltip:"Failed",icon:Wg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:dh,borderColor:"rgba(255, 61, 0, 0.10)"}};function be({transactionStatus:t,eci:o,authType:e,isTextShown:r}){let l=yc(useId(),"auth-icons"),p$1=useMemo(()=>{let n=t?vo[t]:null,d=n?.tooltip,s=t==="AUTHENTICATED"?null:n?.icon;return [{tooltip:d,content:r?d:s,type:r?"text":"icon"},...e?[{tooltip:e,content:r?kt[e]?.tooltip:kt[e]?.icon,type:r?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[t,r,e,o]),a=useMemo(()=>p$1.filter(n=>!!n.content).map((n,d)=>{let s=n.type==="text"?jsx(Po,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Ao,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":n.content,children:n.content})}):jsx(a$1,{sx:{width:"16px",height:"16px"},src:n.content,alt:n.tooltip});return jsx(p,{title:n.tooltip,children:s},`${n.tooltip}-${d}`)}),[p$1]);return jsx(Wo,{id:l,"data-testid":"AuthIcons",children:a})}var ko=be;var Se=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...t>0&&{opacity:0}},animate:{x:e?t*e:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o,...t>0&&{opacity:1}}});var Te=ko;var tt={VOID:{icon:ik},CAPTURED:{icon:hk}};var ut=styled$1(motion.div)(({theme:t,isCapture:o})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:t.spacing(.5),paddingInline:t.spacing(.3),paddingBlock:t.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:o?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:t.palette.text.primary,position:"relative",zIndex:10})),ft=styled$1("div")(({theme:t,percentage:o,isCapture:e})=>({border:`0.6px ${[0,100].includes(o)?"solid":"dashed"} ${e?t.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:t.spacing(.316),paddingLeft:t.spacing(.516),fontSize:"7px",fontWeight:t.typography.fontWeightBold,color:e?t.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)})),xt=styled$1("div")(({percentage:t,isCapture:o,theme:e})=>({background:`conic-gradient(${o?e.palette.info.dark:"#656565"} ${t}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${o?e.palette.info.dark:"#656565"}`})),gt=styled$1("img")({width:"14px",height:"14px"}),j=styled$1(o)({width:"16px",height:"16px"}),N=styled$1("img")({width:"16px",height:"16px"}),Bo=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function It(t){return t<5?5:t===100?95:t}function Be({voidPercentage:t,capturePercentage:o,captureCount:e,autoType:r,captureAmount:l,voidAmount:p$1,currency:a,isTextShown:n,remainingAmount:d,isSheetViewShown:s,selectionProps:f={}}){let c=Number(o)+Number(t)===100||d<=0,g=yc(useId(),"capture-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(d||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l,p$1,a]),x=o>0?jsx(p,{title:J("Capture"),children:jsxs(ut,{isCapture:true,isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:ub,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(ft,{isCapture:true,percentage:o,children:[o,"% ",jsx(xt,{isCapture:true,percentage:It(o)})]}),e>1&&jsxs(z,{compact:true,color:"dark",children:[e,"x"]})]})]})}):r==="CAPTURED"&&!c?jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}),I=o===100?jsx(p,{title:A("captured"),children:jsx(Bo,{children:jsx(N,{src:kk,alt:"captured"})})}):x,W=useMemo(()=>s&&I?jsx(b,{chipIndex:4,copyText:A("captured"),selectionProps:f,children:A("captured")}):n&&I?jsx(k,{children:A("captured")}):I,[n,I,s,f]);return W&&jsx("div",{id:g,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:W})}var Do=Be;function Ve({voidPercentage:t,capturePercentage:o,voidCount:e,autoType:r,captureAmount:l$1,voidAmount:p$1,currency:a,isTextShown:n,isSheetViewShown:d,selectionProps:s={},remainingAmount:f}){let c=Number(o)+Number(t)===100||f<=0,g=yc(useId(),"void-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(f||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l$1:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l$1,p$1,a]),x=t>0||p$1?jsx(p,{title:J("Void"),children:jsxs(ut,{isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:T.palette.common.white,border:`0.75px solid ${T.palette.grey[600]}1A`},variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:Bk,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(ft,{percentage:t,children:[t,"% ",jsx(xt,{percentage:It(t)})]}),e>0&&jsxs(z,{compact:true,color:"neutral",children:[e,"x"]})]})]})}):r==="VOID"&&!c?jsx(p,{title:L("Void"),children:jsx(j,{children:jsx(N,{src:tt.VOID?.icon,alt:"auto"})})}):null,I=t===100?jsx(p,{title:A("void"),children:jsx(j,{children:jsx(N,{src:Bk,alt:"void"})})}):x,W=useMemo(()=>d&&I?jsx(b,{chipIndex:5,copyText:A("void"),selectionProps:s,children:A("void")}):n&&I?jsx(l,{children:A("void")}):I,[n,I,d,s]);return W?jsx("div",{id:g,"data-testid":"VoidAutoIcon",style:{...!d&&{zIndex:11}},children:W}):null}var $o=Ve;var Me=Do;var Fe=({authorizedStatus:t,isTextShown:o,iconStyles:e,tableMode:r,chipIndex:l=0,selectionProps:p$1={}})=>{let{t:a}=useTranslation(),n=useTheme$1(),d=a(_(t));return Va(r)?jsx(b,{copyText:d,chipIndex:l,selectionProps:p$1,children:d}):jsx(p,{title:d,children:o?jsx(j$1,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:n.palette.info.dark},children:d}):jsx(a$1,{src:f[t],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:e})})};var _o=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,display:"block",fontWeight:t.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:t.spacing(.45)})),Vo=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Bt=styled$1("img")(()=>({width:"10px",height:"10px"})),Lt=styled$1(motion.span)(({theme:t})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:t.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),Dt=styled$1(motion.div,{shouldForwardProp:t=>t!=="isVisible"})(({isVisible:t})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!t&&{padding:"0 !important"}})),Mo=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),zo=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),No={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},Go={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Fo={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},Uo={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},Et={fadeIn:{duration:.3},animate:{duration:.1}},Oo={fadeIn:{opacity:1}},jo=styled$1(j$1)(()=>({width:"88px",height:"100%"})),$t=styled$1(Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.25),height:"100%"}));function qe({chargeStatus:t,gatewayTooltip:o$1,acquirerTooltip:e,chargeTooltip:r,errorCode:l,isTextShown:p$2,gatewayCode:a,acquirerCode:n,unCapturedStyles:d,iconStyles:s$1,iconWrapperStyles:f,gatewayIconWrapperStyles:c,gatewayContainerStyles:g$1,gateWayIconStyles:T,showBadge:A=true,isSheetViewShown:P=false,selectionProps:L={},chipIndex:J=0}){let x=t?b$1[t]:null,I=t?g[t]:null,W=useTheme$1(),{t:C}=useTranslation(),X=yc(useId(),"charge-status-icon"),D=r&&jsx(Fragment,{children:jsx("div",{children:r})}),v=e&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:e})]}),Y=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:o$1})]}),Ft=t&&a$2[t]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:x?"50%":"",...f},children:jsx(p$1,{src:a$2[t],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:x?"50%":"",width:"16px",height:"16px",...s$1}})});return P?jsxs($t,{children:[jsxs(b,{copyText:C(_(t)),chipIndex:J,selectionProps:L,children:[C(_(t))," ",l]}),x&&jsxs(Fragment,{children:[a&&jsxs(b,{copyText:"Gateway",chipIndex:1,selectionProps:L,children:["Gateway ",a]}),n&&jsxs(b,{copyText:"Acquirer",chipIndex:2,selectionProps:L,children:["Acquirer ",n]})]})]}):p$2?jsxs($t,{children:[jsx(p,{title:D,children:jsxs(jo,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark,borderColor:`${x?.color||I?.color||W.palette.info.dark}1A`},children:[C(_(t))," ",l]})}),x&&jsxs(Fragment,{children:[a&&jsx(p,{title:Y,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Gateway ",a]})}),n&&jsx(p,{title:v,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Acquirer ",n]})})]})]}):jsx(o,{id:X,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...f},children:s?.includes(t||"")&&(D||v||Y)?jsxs(zo,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...A&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...d},children:[jsx(Mo,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:x?.background}},children:jsx(p,{title:D??C(_(t)),children:jsxs(Fragment,{children:[Ft,jsx(Vo,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:Uo,style:{...l&&{padding:"0 !important"}},children:jsx(_o,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:x?.color},transition:No,variants:Oo,initial:{opacity:0},children:l})})]})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Go,style:g$1,isVisible:!!Y,children:Y&&jsx(p,{title:Y,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:T})})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Fo,style:g$1,isVisible:!!v,children:v&&jsx(p,{title:v,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:T})})})})]}):jsx(p,{title:D??C(_(t)),children:jsx(o,{children:Ft})})})}var Xe=()=>{let{t}=useTranslation(),o=yc(useId(),"customer-initiated-icon");return jsx(p,{title:t("merchantInitiated"),children:jsx("img",{id:o,"data-testid":"merchantInitiatedIcon",src:vb,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Ye={G:"Global",R:"Regional",L:"Local"},ot=({geographyVariant:t,countryCode:o,isTextShown:e})=>{let r=t?Ye[t]:void 0,l=r||o?`${r||""} ${r&&o?"-":""} ${o?`Country - ${o}`:""}`:void 0;return e||!o?null:jsx(p,{title:l,children:jsx(a$3,{countryCode:o})})};var tr=({geographyVariant:t,isTextShown:o,deviceCountry:e,deviceType:r,tableMode:l})=>{let p=yc(useId(),"device-icon-chip");return jsxs(Qe,{id:p,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Va(l)&&{height:"18px"}},children:[jsx(ot,{geographyVariant:t,isTextShown:o,countryCode:e}),jsx(c,{type:r,isTextShown:o,tableMode:l})]})};var rr=({isDisputeOpen:t,iconStyles:o})=>{let e=yc(useId(),"dispute-icon");return jsx(p$1,{id:e,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:t?wa:va,alt:"dispute-icon",style:o})};var Xo=styled$1(Qe,{shouldForwardProp:t=>t!=="tableMode"})(({theme:t,tableMode:o})=>({display:"flex",gap:t.spacing(.5),...Va(o)&&{height:"18px"},alignItems:"center"})),Yo=styled$1("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function Vt({countryCode:t,isTextShown:o,cardNumber:e,bankName:r,tableMode:l}){let p$1=yc(useId(),"issuer-icon"),a=e?.slice(0,4),n=e?.slice(-4);return jsxs(Xo,{id:p$1,"data-testid":"IssuerIcon",tableMode:l,children:[t&&jsx(ot,{countryCode:t,isTextShown:o}),jsx(p,{title:`${r?`Issuer - ${r}`:""}`,children:jsx(Yo,{children:`${a||""} ${n||""}`})})]})}var sr=Vt;styled(motion.div)(({theme:t,background:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5),paddingInline:t.spacing(.75),paddingBlock:t.spacing(.5),backgroundColor:o,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:t.palette.text.primary}));var Ra=styled("img")(()=>({height:"13.125px",width:"12px"})),bt=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),ka=styled("div")(({theme:t})=>({color:t.palette.common.white,background:t.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Ba=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var ur=({payoutStatus:t="PENDING",isTextShown:o,payoutTooltip:e$1,iconStyles:r,isSheetViewShown:l,chipIndex:p$2=0,selectionProps:a={}})=>{let{t:n}=useTranslation(),d=yc(useId(),"payout-icon"),s=n(_(t)),f=e$1||s;return l?jsx(b,{chipIndex:p$2,copyText:s,selectionProps:a,children:s}):jsx(p,{title:f,children:o?jsx(bt,{id:d,"data-testid":"StatusCell_PayoutStatusLabel",children:s}):jsx(p$1,{id:d,src:e[t],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:r})})};var Qo=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Zo=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,borderRadius:t.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:t.palette.secondary.main})),Mt=styled$1(motion.div)(({theme:t})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${t.palette.secondary.main}1A`,paddingInline:t.spacing(.5),borderRadius:"56px"})),qa=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:e?t*e:t*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o}}),Ka=styled$1(motion.span)(({isTextShown:t,theme:o})=>({border:`1px solid ${o.palette.divider}`,borderRadius:"12px",backgroundColor:o.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:t?"auto":"36px",...t&&{border:"none"}})),Ja=styled$1(motion.div,{shouldForwardProp:t=>t!=="order"})(({order:t=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:t+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),Xa=styled$1(motion.div,{shouldForwardProp:t=>t!=="statusesCount"})(({statusesCount:t=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${t*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Ya=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var hr=({isTextShown:t,refundStatus:o="PENDING",refundTooltip:e="",refundCount:r,iconStyles:l,isSheetViewShown:p$2,chipIndex:a=0,selectionProps:n={}})=>{let{t:d$1}=useTranslation(),s=useTheme$1(),f=yc(useId(),"refund-icon"),c=(r||0)>1,g=d$1(_(o));if(p$2)return jsxs(b,{chipIndex:a,selectionProps:n,copyText:g,children:[g," ",c?`${r}x`:null]});let T=jsxs(Zo,{"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:[r,"x"]});return t?jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:jsx(bt,{id:f,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d[o].color,backgroundColor:d[o].backgroundColor,width:"90px"},children:jsxs(Mt,{whileInView:c?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[g," ",c?T:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:c?jsxs(Mt,{id:f,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[jsx(Qo,{src:tk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),T]}):jsx(p$1,{id:f,src:c$1[o],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:l})})},te=hr;var Cr=te;var yr={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},B=t=>yr[t?.toLowerCase()||""]||t;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var oe=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var ee=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),re=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var ne=styled("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function At({source:t,isTextShown:o,title:e,width:r,height:l,imgSx:p$1}){let{t:a}=useTranslation(),n=h(t);return jsx(p,{title:e,children:o?jsx(re,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(ee,{"data-testid":"SourceCell_TextLabel","data-source":t,children:a(_(t))})}):jsx(oe,{src:n,alt:t,width:r,height:l,onError:d=>{d.currentTarget.src=h("card");},sx:p$1})})}function vr({payment:t,card:o,isTextShown:e,firstIcon:r}){let l=yc(useId(),"source-icons"),{t:p}=useTranslation(),a=useCallback(()=>{let s=[],f=bc(t),c=t?.method,g=t?.scheme;return B(c)?.toLowerCase()===B(g)?.toLowerCase()?s.push(B(c),B(f)):s.push(B(c),B(f),B(g)),s},[t]),n=useMemo(()=>jsx(At,{source:r,isTextShown:e,title:p(_(r))},r),[r,e,p]),d=useMemo(()=>a()?.filter(s=>!!s&&s!==r)?.map((s,f,c)=>{let g=t?.wallet===p("sv_wallet")?p("storedValueWallet"):p("passThruWallet"),T=f===c.length-1&&o?.last_four?`${p(_(s))} - ${o?.last_four}`:p(_(s));return jsx(At,{source:s,isTextShown:e,title:f===0&&s==="Wallet"?g:T},`${s}-${f}`)}),[a,t,o,e,p,r]);return jsxs(Box,{id:l,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[r&&n,d,o?.last_four&&jsxs(ne,{children:["\xB7\xB7\xB7 ",o?.last_four]})]})}var rt={PROCESSED:Vg,FAILED:""};var se=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),le=styled("img")(()=>({width:"16px",height:"16px"})),de=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ce({status:t,isTextShown:o,isSheetViewShown:e,chipIndex:r=0,selectionProps:l={}}){let p$1=useTheme(),{t:a}=useTranslation(),n=yc(useId(),"destination-icon"),d=a(_(t));return e&&rt[t]?jsx(b,{copyText:d,chipIndex:r,selectionProps:l,children:d}):o&&rt[t]?jsx(se,{id:n,"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:"#1F88D00D",color:t==="PROCESSED"?p$1.palette.info.dark:p$1.palette.common.black},children:d}):jsx(de,{id:n,"data-testid":"DestinationIcon",className:"destination-status",children:t&&rt[t]&&jsx(p,{title:a(_(t)),children:jsx(le,{src:rt[t],alt:"destination-icon"})})})}export{qa as a,Ka as b,Ja as c,Xa as d,Ya as e,Ce as f,Se as g,Te as h,$o as i,Me as j,Fe as k,qe as l,Xe as m,ot as n,tr as o,rr as p,sr as q,Ra as r,ka as s,Ba as t,ur as u,Cr as v,B as w,At as x,vr as y,ce as z};
|
|
1
|
+
import {f,b as b$1,g,a as a$2,e,d,c as c$1}from'./chunk-GB5N3AEY.js';import {a as a$4}from'./chunk-TSKIEYMO.js';import {a as a$1}from'./chunk-MXXAZH6N.js';import {c}from'./chunk-NXZOAMNR.js';import {a}from'./chunk-ZONDSLTR.js';import {o,j as j$1,k,l,p as p$1}from'./chunk-ATOLL6Z7.js';import {p,z}from'./chunk-ZH35RF3I.js';import {a as a$3}from'./chunk-SUBIH236.js';import {b}from'./chunk-UYDM5BBG.js';import {Va,yc,Ha,Ia,bc,f as f$1}from'./chunk-W6W4YZ7G.js';import {s}from'./chunk-N372QRVU.js';import {U,zi,Bi,Ai,yi,Fi,dh,Wg,ch,Sj,Tj,ub,hk,kk,Bk,ik,vb,wa,va,tk,h,Vg}from'./chunk-3YAJNHQC.js';import {useId,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Box,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {motion}from'framer-motion';import {styled as styled$1,useTheme as useTheme$1}from'@mui/material/styles';import _ from'lodash/camelCase';import Qe from'@mui/material/Box';var lt={ORDER:{label:"order",icon:yi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:Ai,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Bi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:zi,color:"#32ADE6"}},dt={SAVED_TOKEN:{label:"savedToken",icon:U,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var ct=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),mt=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"}));function Ie({type:t,hasSavedCard:o,totalPaymentsCount:e,isTextShown:r}){let l=yc(useId(),"agreement-icon"),p$1=useTheme(),{t:a$2}=useTranslation(),n=useMemo(()=>[...o?[dt.SAVED_TOKEN]:[],...(e||0)>0?[dt.COUNT]:[],...t&<[t]?[lt[t]]:[]],[o,e,t]),d=c=>r?jsx(a,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a$2("totalPaymentCount",{amount:f$1(e)}),children:jsx(mt,{children:jsxs(ct,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:dt.COUNT.color},children:["x",e]})})})},c):jsx(a$4,{value:e,index:c},c),s=n.map((c,g)=>c.label==="countBadge"?d(g):jsx(p,{title:a$2(c.label),children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:c.color},children:a$2(c.label)})}):jsx(a$1,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:c.icon,alt:"agreement"})},c.color)},c.color)),f=jsx(p,{title:"No agreement",children:jsx(a,{children:r?jsx(mt,{children:jsx(ct,{"data-testid":"AgreementCell_agreementType",sx:{color:p$1.palette.text.secondary},children:"No agreement"})}):jsx(a$1,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Fi,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:l,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:s?.length>0?s:f})}var To=Ie;var Ce=To;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var Ao=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),Po=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var Wo=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var kt={"3DS":{tooltip:"3DS",icon:Tj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:ch,borderColor:"rgba(31, 136, 208, 0.10)"}},vo={FAILED:{tooltip:"Failed",icon:Wg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:dh,borderColor:"rgba(255, 61, 0, 0.10)"}};function be({transactionStatus:t,eci:o,authType:e,isTextShown:r}){let l=yc(useId(),"auth-icons"),p$1=useMemo(()=>{let n=t?vo[t]:null,d=n?.tooltip,s=t==="AUTHENTICATED"?null:n?.icon;return [{tooltip:d,content:r?d:s,type:r?"text":"icon"},...e?[{tooltip:e,content:r?kt[e]?.tooltip:kt[e]?.icon,type:r?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[t,r,e,o]),a=useMemo(()=>p$1.filter(n=>!!n.content).map((n,d)=>{let s=n.type==="text"?jsx(Po,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Ao,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":n.content,children:n.content})}):jsx(a$1,{sx:{width:"16px",height:"16px"},src:n.content,alt:n.tooltip});return jsx(p,{title:n.tooltip,children:s},`${n.tooltip}-${d}`)}),[p$1]);return jsx(Wo,{id:l,"data-testid":"AuthIcons",children:a})}var ko=be;var Se=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...t>0&&{opacity:0}},animate:{x:e?t*e:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o,...t>0&&{opacity:1}}});var Te=ko;var tt={VOID:{icon:ik},CAPTURED:{icon:hk}};var ut=styled$1(motion.div)(({theme:t,isCapture:o})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:t.spacing(.5),paddingInline:t.spacing(.3),paddingBlock:t.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:o?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:t.palette.text.primary,position:"relative",zIndex:10})),ft=styled$1("div")(({theme:t,percentage:o,isCapture:e})=>({border:`0.6px ${[0,100].includes(o)?"solid":"dashed"} ${e?t.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:t.spacing(.316),paddingLeft:t.spacing(.516),fontSize:"7px",fontWeight:t.typography.fontWeightBold,color:e?t.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5)})),xt=styled$1("div")(({percentage:t,isCapture:o,theme:e})=>({background:`conic-gradient(${o?e.palette.info.dark:"#656565"} ${t}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${o?e.palette.info.dark:"#656565"}`})),gt=styled$1("img")({width:"14px",height:"14px"}),j=styled$1(o)({width:"16px",height:"16px"}),N=styled$1("img")({width:"16px",height:"16px"}),Bo=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function It(t){return t<5?5:t===100?95:t}function Be({voidPercentage:t,capturePercentage:o,captureCount:e,autoType:r,captureAmount:l,voidAmount:p$1,currency:a,isTextShown:n,remainingAmount:d,isSheetViewShown:s,selectionProps:f={}}){let c=Number(o)+Number(t)===100||d<=0,g=yc(useId(),"capture-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(d||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l,p$1,a]),x=o>0?jsx(p,{title:J("Capture"),children:jsxs(ut,{isCapture:true,isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:ub,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(ft,{isCapture:true,percentage:o,children:[o,"% ",jsx(xt,{isCapture:true,percentage:It(o)})]}),e>1&&jsxs(z,{compact:true,color:"dark",children:[e,"x"]})]})]})}):r==="CAPTURED"&&!c?jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:L("Capture"),children:jsx(j,{children:jsx(N,{src:tt.CAPTURED?.icon,alt:"auto"})})}),I=o===100?jsx(p,{title:A("captured"),children:jsx(Bo,{children:jsx(N,{src:kk,alt:"captured"})})}):x,W=useMemo(()=>s&&I?jsx(b,{chipIndex:4,copyText:A("captured"),selectionProps:f,children:A("captured")}):n&&I?jsx(k,{children:A("captured")}):I,[n,I,s,f]);return W&&jsx("div",{id:g,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:W})}var Do=Be;function Ve({voidPercentage:t,capturePercentage:o,voidCount:e,autoType:r,captureAmount:l$1,voidAmount:p$1,currency:a,isTextShown:n,isSheetViewShown:d,selectionProps:s={},remainingAmount:f}){let c=Number(o)+Number(t)===100||f<=0,g=yc(useId(),"void-auto-icon"),T=useTheme$1(),{t:A}=useTranslation(),P=Ha(f||0),L=useCallback(C=>`Auto ${C} - ${a} ${P.integerAmount}.${P.decimalAmount}`,[a,P.decimalAmount,P.integerAmount]),J=useCallback(C=>{let X=C==="Capture"?l$1:p$1,{integerAmount:D,decimalAmount:v}=Ia(X,a);return `Partial ${C} - ${a} ${D}.${v}`},[l$1,p$1,a]),x=t>0||p$1?jsx(p,{title:J("Void"),children:jsxs(ut,{isFullyUsed:c,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:T.palette.common.white,border:`0.75px solid ${T.palette.grey[600]}1A`},variants:{animate:{boxShadow:T.shadows[4]}},children:[jsx(gt,{src:Bk,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(ft,{percentage:t,children:[t,"% ",jsx(xt,{percentage:It(t)})]}),e>0&&jsxs(z,{compact:true,color:"neutral",children:[e,"x"]})]})]})}):r==="VOID"&&!c?jsx(p,{title:L("Void"),children:jsx(j,{children:jsx(N,{src:tt.VOID?.icon,alt:"auto"})})}):null,I=t===100?jsx(p,{title:A("void"),children:jsx(j,{children:jsx(N,{src:Bk,alt:"void"})})}):x,W=useMemo(()=>d&&I?jsx(b,{chipIndex:5,copyText:A("void"),selectionProps:s,children:A("void")}):n&&I?jsx(l,{children:A("void")}):I,[n,I,d,s]);return W?jsx("div",{id:g,"data-testid":"VoidAutoIcon",style:{...!d&&{zIndex:11}},children:W}):null}var $o=Ve;var Me=Do;var Fe=({authorizedStatus:t,isTextShown:o,iconStyles:e,tableMode:r,chipIndex:l=0,selectionProps:p$1={}})=>{let{t:a}=useTranslation(),n=useTheme$1(),d=a(_(t));return Va(r)?jsx(b,{copyText:d,chipIndex:l,selectionProps:p$1,children:d}):jsx(p,{title:d,children:o?jsx(j$1,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:n.palette.info.dark},children:d}):jsx(a$1,{src:f[t],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:e})})};var _o=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,display:"block",fontWeight:t.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:t.spacing(.45)})),Vo=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),Bt=styled$1("img")(()=>({width:"10px",height:"10px"})),Lt=styled$1(motion.span)(({theme:t})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:t.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),Dt=styled$1(motion.div,{shouldForwardProp:t=>t!=="isVisible"})(({isVisible:t})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!t&&{padding:"0 !important"}})),Mo=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),zo=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),No={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},Go={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Fo={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},Uo={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},Et={fadeIn:{duration:.3},animate:{duration:.1}},Oo={fadeIn:{opacity:1}},jo=styled$1(j$1)(()=>({width:"88px",height:"100%"})),$t=styled$1(Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.25),height:"100%"}));function qe({chargeStatus:t,gatewayTooltip:o$1,acquirerTooltip:e,chargeTooltip:r,errorCode:l,isTextShown:p$2,gatewayCode:a,acquirerCode:n,unCapturedStyles:d,iconStyles:s$1,iconWrapperStyles:f,gatewayIconWrapperStyles:c,gatewayContainerStyles:g$1,gateWayIconStyles:T,showBadge:A=true,isSheetViewShown:P=false,selectionProps:L={},chipIndex:J=0}){let x=t?b$1[t]:null,I=t?g[t]:null,W=useTheme$1(),{t:C}=useTranslation(),X=yc(useId(),"charge-status-icon"),D=r&&jsx(Fragment,{children:jsx("div",{children:r})}),v=e&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:e})]}),Y=o$1&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:o$1})]}),Ft=t&&a$2[t]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:x?"50%":"",...f},children:jsx(p$1,{src:a$2[t],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:x?"50%":"",width:"16px",height:"16px",...s$1}})});return P?jsxs($t,{children:[jsxs(b,{copyText:C(_(t)),chipIndex:J,selectionProps:L,children:[C(_(t))," ",l]}),x&&jsxs(Fragment,{children:[a&&jsxs(b,{copyText:"Gateway",chipIndex:1,selectionProps:L,children:["Gateway ",a]}),n&&jsxs(b,{copyText:"Acquirer",chipIndex:2,selectionProps:L,children:["Acquirer ",n]})]})]}):p$2?jsxs($t,{children:[jsx(p,{title:D,children:jsxs(jo,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark,borderColor:`${x?.color||I?.color||W.palette.info.dark}1A`},children:[C(_(t))," ",l]})}),x&&jsxs(Fragment,{children:[a&&jsx(p,{title:Y,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Gateway ",a]})}),n&&jsx(p,{title:v,children:jsxs(j$1,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:x?.background||I?.background||"transparent",color:x?.color||I?.color||W.palette.info.dark},children:["Acquirer ",n]})})]})]}):jsx(o,{id:X,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...f},children:s?.includes(t||"")&&(D||v||Y)?jsxs(zo,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...A&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...d},children:[jsx(Mo,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:x?.background}},children:jsx(p,{title:D??C(_(t)),children:jsxs(Fragment,{children:[Ft,jsx(Vo,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:Uo,style:{...l&&{padding:"0 !important"}},children:jsx(_o,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:x?.color},transition:No,variants:Oo,initial:{opacity:0},children:l})})]})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Go,style:g$1,isVisible:!!Y,children:Y&&jsx(p,{title:Y,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:T})})})}),jsx(Dt,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:Et,variants:Fo,style:g$1,isVisible:!!v,children:v&&jsx(p,{title:v,children:jsx(Lt,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:x?.background,...c},children:jsx(Bt,{src:x?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:T})})})})]}):jsx(p,{title:D??C(_(t)),children:jsx(o,{children:Ft})})})}var Xe=()=>{let{t}=useTranslation(),o=yc(useId(),"customer-initiated-icon");return jsx(p,{title:t("merchantInitiated"),children:jsx("img",{id:o,"data-testid":"merchantInitiatedIcon",src:vb,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Ye={G:"Global",R:"Regional",L:"Local"},ot=({geographyVariant:t,countryCode:o,isTextShown:e})=>{let r=t?Ye[t]:void 0,l=r||o?`${r||""} ${r&&o?"-":""} ${o?`Country - ${o}`:""}`:void 0;return e||!o?null:jsx(p,{title:l,children:jsx(a$3,{countryCode:o})})};var tr=({geographyVariant:t,isTextShown:o,deviceCountry:e,deviceType:r,tableMode:l})=>{let p=yc(useId(),"device-icon-chip");return jsxs(Qe,{id:p,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Va(l)&&{height:"18px"}},children:[jsx(ot,{geographyVariant:t,isTextShown:o,countryCode:e}),jsx(c,{type:r,isTextShown:o,tableMode:l})]})};var rr=({isDisputeOpen:t,iconStyles:o})=>{let e=yc(useId(),"dispute-icon");return jsx(p$1,{id:e,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:t?wa:va,alt:"dispute-icon",style:o})};var Xo=styled$1(Qe,{shouldForwardProp:t=>t!=="tableMode"})(({theme:t,tableMode:o})=>({display:"flex",gap:t.spacing(.5),...Va(o)&&{height:"18px"},alignItems:"center"})),Yo=styled$1("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function Vt({countryCode:t,isTextShown:o,cardNumber:e,bankName:r,tableMode:l}){let p$1=yc(useId(),"issuer-icon"),a=e?.slice(0,4),n=e?.slice(-4);return jsxs(Xo,{id:p$1,"data-testid":"IssuerIcon",tableMode:l,children:[t&&jsx(ot,{countryCode:t,isTextShown:o}),jsx(p,{title:`${r?`Issuer - ${r}`:""}`,children:jsx(Yo,{children:`${a||""} ${n||""}`})})]})}var sr=Vt;styled(motion.div)(({theme:t,background:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(.5),paddingInline:t.spacing(.75),paddingBlock:t.spacing(.5),backgroundColor:o,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:t.palette.text.primary}));var Ra=styled("img")(()=>({height:"13.125px",width:"12px"})),bt=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),ka=styled("div")(({theme:t})=>({color:t.palette.common.white,background:t.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Ba=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));var ur=({payoutStatus:t="PENDING",isTextShown:o,payoutTooltip:e$1,iconStyles:r,isSheetViewShown:l,chipIndex:p$2=0,selectionProps:a={}})=>{let{t:n}=useTranslation(),d=yc(useId(),"payout-icon"),s=n(_(t)),f=e$1||s;return l?jsx(b,{chipIndex:p$2,copyText:s,selectionProps:a,children:s}):jsx(p,{title:f,children:o?jsx(bt,{id:d,"data-testid":"StatusCell_PayoutStatusLabel",children:s}):jsx(p$1,{id:d,src:e[t],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:r})})};var Qo=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Zo=styled$1(motion.span)(({theme:t})=>({color:t.palette.common.white,borderRadius:t.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:t.palette.secondary.main})),Mt=styled$1(motion.div)(({theme:t})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${t.palette.secondary.main}1A`,paddingInline:t.spacing(.5),borderRadius:"56px"})),qa=(t,o,e)=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:e?t*e:t*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:o}}),Ka=styled$1(motion.span)(({isTextShown:t,theme:o})=>({border:`1px solid ${o.palette.divider}`,borderRadius:"12px",backgroundColor:o.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:t?"auto":"36px",...t&&{border:"none"}})),Ja=styled$1(motion.div,{shouldForwardProp:t=>t!=="order"})(({order:t=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:t+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),Xa=styled$1(motion.div,{shouldForwardProp:t=>t!=="statusesCount"})(({statusesCount:t=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${t*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Ya=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var hr=({isTextShown:t,refundStatus:o="PENDING",refundTooltip:e="",refundCount:r,iconStyles:l,isSheetViewShown:p$2,chipIndex:a=0,selectionProps:n={}})=>{let{t:d$1}=useTranslation(),s=useTheme$1(),f=yc(useId(),"refund-icon"),c=(r||0)>1,g=d$1(_(o));if(p$2)return jsxs(b,{chipIndex:a,selectionProps:n,copyText:g,children:[g," ",c?`${r}x`:null]});let T=jsxs(Zo,{"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:[r,"x"]});return t?jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:jsx(bt,{id:f,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d[o].color,backgroundColor:d[o].backgroundColor,width:"90px"},children:jsxs(Mt,{whileInView:c?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[g," ",c?T:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:e})}),children:c?jsxs(Mt,{id:f,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:s.shadows[4],gap:s.spacing(.5)}},children:[jsx(Qo,{src:tk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),T]}):jsx(p$1,{id:f,src:c$1[o],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:l})})},te=hr;var Cr=te;var yr={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},B=t=>yr[t?.toLowerCase()||""]||t;styled("span")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:t.spacing(1)}));var oe=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:t=>t!=="sourcesCount"})(({theme:t,sourcesCount:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${o*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:t.palette.background.paper,borderRadius:"16px"}));var ee=styled("span")(({theme:t})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:t.palette.text.primary})),re=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:t})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var ne=styled("span")(({theme:t})=>({fontSize:"10px",fontWeight:500,color:t.palette.text.primary}));function At({source:t,isTextShown:o,title:e,width:r,height:l,imgSx:p$1}){let{t:a}=useTranslation(),n=h(t);return jsx(p,{title:e,children:o?jsx(re,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(ee,{"data-testid":"SourceCell_TextLabel","data-source":t,children:a(_(t))})}):jsx(oe,{src:n,alt:t,width:r,height:l,onError:d=>{d.currentTarget.src=h("card");},sx:p$1})})}function vr({payment:t,card:o,isTextShown:e,firstIcon:r}){let l=yc(useId(),"source-icons"),{t:p}=useTranslation(),a=useCallback(()=>{let s=[],f=bc(t),c=t?.method,g=t?.scheme;return B(c)?.toLowerCase()===B(g)?.toLowerCase()?s.push(B(c),B(f)):s.push(B(c),B(f),B(g)),s},[t]),n=useMemo(()=>jsx(At,{source:r,isTextShown:e,title:p(_(r))},r),[r,e,p]),d=useMemo(()=>a()?.filter(s=>!!s&&s!==r)?.map((s,f,c)=>{let g=t?.wallet===p("sv_wallet")?p("storedValueWallet"):p("passThruWallet"),T=f===c.length-1&&o?.last_four?`${p(_(s))} - ${o?.last_four}`:p(_(s));return jsx(At,{source:s,isTextShown:e,title:f===0&&s==="Wallet"?g:T},`${s}-${f}`)}),[a,t,o,e,p,r]);return jsxs(Box,{id:l,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[r&&n,d,o?.last_four&&jsxs(ne,{children:["\xB7\xB7\xB7 ",o?.last_four]})]})}var rt={PROCESSED:Vg,FAILED:""};var se=styled("span")(({theme:t})=>({fontSize:"11px",padding:"2px 0",color:t.palette.text.primary})),le=styled("img")(()=>({width:"16px",height:"16px"})),de=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ce({status:t,isTextShown:o,isSheetViewShown:e,chipIndex:r=0,selectionProps:l={}}){let p$1=useTheme(),{t:a}=useTranslation(),n=yc(useId(),"destination-icon"),d=a(_(t));return e&&rt[t]?jsx(b,{copyText:d,chipIndex:r,selectionProps:l,children:d}):o&&rt[t]?jsx(se,{id:n,"data-testid":"ChargeStatusIcon_isTextShown","data-status":_(t),sx:{background:"#1F88D00D",color:t==="PROCESSED"?p$1.palette.info.dark:p$1.palette.common.black},children:d}):jsx(de,{id:n,"data-testid":"DestinationIcon",className:"destination-status",children:t&&rt[t]&&jsx(p,{title:a(_(t)),children:jsx(le,{src:rt[t],alt:"destination-icon"})})})}export{qa as a,Ka as b,Ja as c,Xa as d,Ya as e,Ce as f,Se as g,Te as h,$o as i,Me as j,Fe as k,qe as l,Xe as m,ot as n,tr as o,rr as p,sr as q,Ra as r,ka as s,Ba as t,ur as u,Cr as v,B as w,At as x,vr as y,ce as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {h,g,a,f,e,d,c}from'./chunk-
|
|
1
|
+
import {h,g,a,f,e,d,c}from'./chunk-ZPYQXJ2S.js';import {z}from'./chunk-ZH35RF3I.js';import {yc,Ka,g as g$1}from'./chunk-W6W4YZ7G.js';import {Al,ka,Ua,Qg,kl,Za,Ta,Zg,Yg,_g,Xg,ah,Ab,zb,Ck,kk,hb,xk,C,w,B,E,Vh,jk,u,Dk}from'./chunk-3YAJNHQC.js';import {memo,useId,useState,useRef,useEffect,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function L({isActive:p,disableHover:n}){let[c,C]=useState(false),s=useTheme(),e=()=>{n||C(true);},i=()=>{C(false);},h=p?s.palette.common.white:s.palette.grey[700],u=c?s.palette.common.black:"transparent";return jsx("svg",{width:"27",height:"30",viewBox:"0 0 27 32",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{id:"Group 140343",children:[jsx("path",{id:"Active",d:"M0 0H11C19.8366 0 27 7.16344 27 16C27 24.8366 19.8366 32 11 32H0V0Z",fill:u,fillOpacity:"0.1",onMouseEnter:e,onMouseLeave:i}),jsx("path",{id:"Union",fillRule:"evenodd",clipRule:"evenodd",d:"M15.6941 15.0078C15.6494 15.0193 15.6083 15.043 15.5758 15.0769L12.5026 18.1501L12.5025 18.1501L15.5756 15.0769C15.6082 15.043 15.6493 15.0193 15.6941 15.0078ZM12.5619 18.7465C12.5426 18.7512 12.5227 18.7536 12.5026 18.7536C12.4363 18.7536 12.3727 18.7273 12.3258 18.6804L9.07581 15.4304C9.04012 15.3957 9.01559 15.3512 9.00535 15.3025C8.99511 15.2538 8.99963 15.2032 9.01833 15.1571C9.03703 15.111 9.06907 15.0715 9.11033 15.0437C9.13446 15.0275 9.16112 15.0156 9.18904 15.0086C9.16105 15.0156 9.13433 15.0275 9.11013 15.0438C9.06887 15.0716 9.03684 15.111 9.01814 15.1571C8.99944 15.2032 8.99492 15.2539 9.00516 15.3026C9.0154 15.3513 9.03993 15.3958 9.07562 15.4305L12.3256 18.6805C12.3725 18.7273 12.4361 18.7537 12.5024 18.7537C12.5226 18.7537 12.5426 18.7512 12.5619 18.7465ZM16.1965 15.342C16.1781 15.4301 16.1338 15.5105 16.0693 15.5731L12.8205 18.8219C12.7361 18.9063 12.6217 18.9537 12.5024 18.9537C12.3831 18.9537 12.2686 18.9062 12.1842 18.8219L8.93507 15.5728C8.87148 15.5105 8.82775 15.4308 8.80944 15.3437C8.79101 15.2561 8.79914 15.165 8.8328 15.082C8.86646 14.999 8.92412 14.9279 8.99839 14.8779C9.07266 14.8279 9.16022 14.8011 9.24978 14.8011C9.30998 14.8011 9.36958 14.8132 9.42503 14.8366C9.47997 14.8599 9.52973 14.8938 9.57144 14.9364L12.5024 17.8673L15.433 14.9368C15.5151 14.852 15.6273 14.803 15.7454 14.8002C15.836 14.798 15.9252 14.8233 16.0013 14.8728C16.0773 14.9222 16.1367 14.9935 16.1715 15.0772C16.2063 15.1609 16.2151 15.2533 16.1965 15.342Z",fill:h})]})})}var vt={inProgress:Dk,initiated:Dk,abandoned:u,cancelled:jk,reversed:Vh,reports:E,search:B,chevronDown:w,unAuthorized:C,unSettled:xk,unCaptured:hb,captured:kk,authorized:Ck,openFlag:zb,closedFlag:Ab,unauthenticated:ah,authenticated:Xg,paidOut:_g,scheduled:Yg,checked:Zg,dashedChecked:Ta,deactivated:Za,destination:kl,destinationReversed:Qg,outstanding:Ua,active:ka,inactive:Al};var Nt=memo(p=>{let{variant:n="inActive",badgeCount:c$1,icon:C,label:s,dropdownOptions:e$1,selectedStatus:i,onButtonBodyClick:h$1,iconMapper:u=vt,buttonSx:Bt,...bt}=p,St=yc(useId(),"status-button"),[Lt,M]=useState(0),{t:y}=useTranslation(),E=useRef(null),[x,f$1]=useState(null),[o,H]=useState(i??e$1?.[0]?.status);useEffect(()=>{i!==void 0&&H(i);},[i]);let d$1=useMemo(()=>!!e$1?.length,[e$1]),I=!!x&&Lt>1,l=n==="active",P=useMemo(()=>l?"active":"inactive",[l]),m=useMemo(()=>o?e$1?.find(t=>t.status===o):null,[o,e$1]),kt=useMemo(()=>{if(m?.icon)return jsx(h,{variant:n,children:m.icon});let t=o&&u[o]?o:C;if(t&&u[t])return jsx(g,{icon:t,variant:n,src:u[t],alt:`${t}-icon`})},[m,o,u,C,n]),wt=useMemo(()=>!c$1||Number.isNaN(Ka(c$1))?null:jsx(z,{color:P,children:g$1(Number(c$1))}),[c$1,P]),T=useMemo(()=>d$1?jsx(L,{isActive:l}):null,[d$1,l]);useEffect(()=>{l||(M(0),f$1(null));},[l]);let g$2=useCallback(()=>{f$1(null);},[]),A=useCallback(()=>{d$1&&f$1(I?null:E.current);},[d$1,I]),Mt=useCallback(t=>{t.stopPropagation(),p?.onClick?.(t),h$1?.(o||e$1?.[0]?.status||"all"),A(),M(B=>B+1);},[p,h$1,o,e$1,A]),D=useCallback(t=>B=>{t?.onClick?.(B),H(t.status),g$2();},[g$2]),yt=useMemo(()=>e$1?.map(t=>({...t,onClick:D(t)}))||[],[e$1,D]),Et=a[n],xt=useMemo(()=>m?.label||(o?y(o):s),[m,o,y,s]);return jsxs(Fragment,{children:[jsx(Et,{id:St,"data-testid":"StatusButton",...bt,ref:E,onClick:Mt,statusVariant:n,sx:{...d$1&&{paddingInlineEnd:"27px"},...Bt},children:jsxs(f,{children:[jsxs(e,{variant:n,children:[kt,xt,wt]}),T&&jsx(d,{children:T})]})}),I&&d$1&&jsx(c,{open:I,onClose:g$2,anchorEl:x,menuItems:yt})]})}),gt=Nt;var oo=gt;
|
|
2
2
|
export{L as a,oo as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-ZH35RF3I.js';import {yc}from'./chunk-W6W4YZ7G.js';import {Ci}from'./chunk-3YAJNHQC.js';import {useState,useId}from'react';import T from'@mui/material/Skeleton';import i from'@mui/material/Box';import {styled,Box}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var h=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:12,border:"1.03px solid"})),c=styled(Box)`
|
|
2
2
|
position: absolute;
|
|
3
3
|
`;function d({mainIcon:B,overlayIcon:p$1,mainIconAlt:u="main icon",mainIconSize:t=20,containerSize:a=24,overlayPosition:b={top:10,left:17},borderColor:w="#F2F2F2",label:y="",sx:I,onError:W,containerSx:C}){let[e,s]=useState(true),F=yc(useId(),"icon-with-badge");return jsx(p,{title:y,children:jsx(i,{id:F,"data-testid":"IconWithBadge",display:"flex",alignItems:"center",gap:1,sx:{position:"relative",...C},children:jsxs(h,{style:{borderColor:w,width:a,height:a},children:[t&&e&&jsx(i,{width:t,height:t,children:e&&jsx(T,{variant:"circular",width:`${t}px`,height:`${t}px`})}),jsxs(Fragment,{children:[p$1&&jsx(c,{sx:b,children:p$1}),jsx(i,{width:t,height:t,component:"img",src:B||Ci,alt:u,sx:{borderRadius:"50%",objectFit:"scale-down",opacity:e?0:1,...I},onError:n=>{s(false),n.currentTarget.src=Ci,W?.(n);},onLoad:()=>{s(false);}})]})]})})})}var M=d;export{M as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {r}from'./chunk-
|
|
1
|
+
import {r}from'./chunk-ZH35RF3I.js';import {yc,cb}from'./chunk-W6W4YZ7G.js';import {useId}from'react';import {motion}from'framer-motion';import {Box,Typography}from'@mui/material';import {styled}from'@mui/material/styles';import I from'@mui/material/Box';import {jsxs,jsx}from'react/jsx-runtime';var u=styled(Box)(({size:t})=>({display:"flex",flexDirection:"column",alignItems:"center",width:t,height:t,position:"relative"})),y=styled(Box)({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}),b=styled(Typography,{shouldForwardProp:t=>t!=="isEmpty"})(({isEmpty:t})=>({fontSize:"17px",fontWeight:700,color:t?"#CFD0D2":"#000"})),D=styled(Typography,{shouldForwardProp:t=>t!=="isEmpty"})(({isEmpty:t})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:t?"#CFD0D2":"#8D8D94",fontSize:"11px",fontWeight:500,letterSpacing:"0%",textAlign:"right",verticalAlign:"middle"}));var C=()=>jsxs(I,{component:"span",sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px"},children:[jsx(r,{width:51,height:16}),jsx(r,{width:84,height:8})]});var v=({value:t,label:k,size:o=172,strokeWidth:p=22,isLoading:l=false})=>{let E=yc(useId(),"progress-ring"),m=t==null||t==="",F=cb(t||"0"),s=Math.min(Math.max(F??0,0),100),c=(o-p)/2,n=2*Math.PI*c,r=o/2;return jsxs(u,{id:E,"data-testid":"ProgressRing",size:o,children:[jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,style:{position:"absolute",top:0,left:0},children:[jsx("defs",{children:jsxs("linearGradient",{id:"progressGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[jsx("stop",{offset:"0.67%",stopColor:"#3DA6E1"}),jsx("stop",{offset:"98.91%",stopColor:"#147DC5"})]})}),jsx("circle",{cx:r,cy:r,r:c,stroke:"#F3F3F3",strokeWidth:p,fill:"transparent"}),jsx(motion.circle,{cx:r,cy:r,r:c,stroke:"url(#progressGradient)",strokeWidth:p,fill:"transparent",strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:n,transform:`rotate(-90 ${r} ${r})`,animate:{strokeDashoffset:l?n:n-n*s/100},transition:{duration:1,ease:"easeOut"}})]}),jsxs(y,{children:[jsx(b,{isEmpty:m,children:l?jsx(C,{}):m?"----":jsxs(motion.span,{initial:{opacity:0},animate:{opacity:1},transition:{ease:"easeOut",duration:.5},children:[Number.isInteger(s)?s:s.toFixed(1),"%"]})}),!l&&jsx(D,{isEmpty:m,children:k})]})]})},T=v;var U=T;export{U as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-ZH35RF3I.js';import {memo}from'react';import d from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx}from'react/jsx-runtime';var n=styled(d,{shouldForwardProp:t=>t!=="isActive"&&t!=="isDisabled"&&t!=="hasImageFilter"})(({isActive:t,isDisabled:o,hasImageFilter:e=true,theme:i})=>({minWidth:32,height:32,width:"fit-content",borderRadius:"4px",padding:"9px 8px",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${i.palette.divider}`,cursor:"pointer",...t&&{boxShadow:i.shadows[7],borderColor:i.palette.info.dark},...o&&{opacity:.5,pointerEvents:"none"},...e&&{img:{filter:"brightness(0) invert(0)"}}}));function m({children:t,title:o,...e}){return jsx(p,{title:o,children:jsx(n,{...e,children:t})})}var l=memo(m);var P=l;export{P as a};
|