@tap-payments/os-micro-frontend-shared 0.3.312 → 0.3.313
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-YFL4D5VW.js → chunk-2NXWQKL2.js} +1 -1
- package/build/_chunks/{chunk-V4ZKOYOF.js → chunk-2QQBLC6G.js} +1 -1
- package/build/_chunks/{chunk-UHP2ZQJO.js → chunk-3WBNWMDN.js} +1 -1
- package/build/_chunks/{chunk-3ZUUAIFN.js → chunk-44TFMXB6.js} +1 -1
- package/build/_chunks/{chunk-B2OUV4UE.js → chunk-4OVITNFA.js} +1 -1
- package/build/_chunks/{chunk-AO5BBZSP.js → chunk-7HIX5YFK.js} +1 -1
- package/build/_chunks/{chunk-ETLDR6XW.js → chunk-A7PVLX7Y.js} +1 -1
- package/build/_chunks/{chunk-FXTZ22TS.js → chunk-AJCSDJRM.js} +1 -1
- package/build/_chunks/{chunk-JBD7LBKC.js → chunk-BEUZZ5TZ.js} +1 -1
- package/build/_chunks/{chunk-PEQGKPA2.js → chunk-BH7A52ZR.js} +1 -1
- package/build/_chunks/{chunk-FXXY2XGL.js → chunk-BYTVQ5U6.js} +1 -1
- package/build/_chunks/{chunk-WE5WS7B2.js → chunk-C5HOVU2E.js} +1 -1
- package/build/_chunks/{chunk-VLOXMCB3.js → chunk-CDF5QBAR.js} +1 -1
- package/build/_chunks/{chunk-3YBLN7RZ.js → chunk-CR4VUKDZ.js} +1 -1
- package/build/_chunks/{chunk-7UR5RTMD.js → chunk-D3XPFXOK.js} +1 -1
- package/build/_chunks/{chunk-637LQKFX.js → chunk-DT5OXK73.js} +1 -1
- package/build/_chunks/{chunk-U6HZMYNW.js → chunk-DUZDYYXE.js} +1 -1
- package/build/_chunks/{chunk-R6E5X56S.js → chunk-E232MG7N.js} +1 -1
- package/build/_chunks/{chunk-AIKE5IVU.js → chunk-EMARPL4U.js} +1 -1
- package/build/_chunks/{chunk-Z7GYOTVN.js → chunk-EVKDUD7R.js} +1 -1
- package/build/_chunks/{chunk-XBJ4RS2B.js → chunk-FHV4S2B3.js} +1 -1
- package/build/_chunks/{chunk-YZF24X6P.js → chunk-G7KM5KZB.js} +1 -1
- package/build/_chunks/{chunk-L2SDX2MP.js → chunk-GHKKBQNX.js} +1 -1
- package/build/_chunks/{chunk-673TILTX.js → chunk-HPLZO5T5.js} +1 -1
- package/build/_chunks/{chunk-KLN3YM53.js → chunk-IA5ABHBS.js} +1 -1
- package/build/_chunks/{chunk-AM66KDGG.js → chunk-J5F6PRTA.js} +1 -1
- package/build/_chunks/{chunk-SMGH6EBP.js → chunk-JXR5GHFJ.js} +1 -1
- package/build/_chunks/{chunk-QIUS47UY.js → chunk-JZ5PJEJ3.js} +1 -1
- package/build/_chunks/{chunk-PI263RZJ.js → chunk-KPSBWLN2.js} +1 -1
- package/build/_chunks/{chunk-Z6D3LMCU.js → chunk-KRRCTTGN.js} +1 -1
- package/build/_chunks/{chunk-TKWUFXNT.js → chunk-L2OVTNK5.js} +1 -1
- package/build/_chunks/{chunk-U3ZJP2GE.js → chunk-LUX6XI5Q.js} +1 -1
- package/build/_chunks/{chunk-SKDHJYOO.js → chunk-M3HYB5CL.js} +1 -1
- package/build/_chunks/{chunk-W755BEL7.js → chunk-NUNYEGYR.js} +1 -1
- package/build/_chunks/{chunk-TJ3OEL7X.js → chunk-OE4U2LSL.js} +1 -1
- package/build/_chunks/{chunk-XJOPGP7Y.js → chunk-P4PBCAJO.js} +1 -1
- package/build/_chunks/{chunk-RF6JK6KJ.js → chunk-PAOZ6T3I.js} +1 -1
- package/build/_chunks/{chunk-JGXI5MLK.js → chunk-PTPGJAQY.js} +1 -1
- package/build/_chunks/{chunk-VLXDIIDL.js → chunk-PX5JVPLZ.js} +1 -1
- package/build/_chunks/{chunk-MXZD4IG6.js → chunk-PXEKSEVO.js} +1 -1
- package/build/_chunks/{chunk-Q6MQJAZI.js → chunk-Q7YAKV4E.js} +1 -1
- package/build/_chunks/{chunk-MUBZJUHH.js → chunk-QFTJ5ABI.js} +1 -1
- package/build/_chunks/{chunk-EGIKB732.js → chunk-QGS4PD2V.js} +1 -1
- package/build/_chunks/{chunk-2BU56HDE.js → chunk-RCTBWGYW.js} +1 -1
- package/build/_chunks/{chunk-A3T5KTSC.js → chunk-T3IFS7C5.js} +1 -1
- package/build/_chunks/{chunk-TRXHMROX.js → chunk-T5VU5QUN.js} +1 -1
- package/build/_chunks/{chunk-U2JLXSW5.js → chunk-TDHNYSIB.js} +1 -1
- package/build/_chunks/chunk-TF7BQNJV.js +2 -0
- package/build/_chunks/{chunk-3YZF4W2L.js → chunk-THQ7CZYC.js} +1 -1
- package/build/_chunks/{chunk-NFDDJIRN.js → chunk-TWCYN3JC.js} +1 -1
- package/build/_chunks/{chunk-GGX2FEQV.js → chunk-U2UE6E3A.js} +1 -1
- package/build/_chunks/{chunk-LQSTGJBJ.js → chunk-VKDF5MAO.js} +1 -1
- package/build/_chunks/{chunk-HNVAFVUA.js → chunk-VVXNNZDR.js} +1 -1
- package/build/_chunks/{chunk-S7AZOXFD.js → chunk-W6KKPIHK.js} +1 -1
- package/build/_chunks/{chunk-4V64TJJW.js → chunk-WDYLJ45H.js} +1 -1
- package/build/_chunks/{chunk-OL6JOGIF.js → chunk-WIDRYXRC.js} +1 -1
- package/build/_chunks/{chunk-632OM3TB.js → chunk-WR5IPYWX.js} +1 -1
- package/build/_chunks/{chunk-G4W4TPFT.js → chunk-XE67FQI7.js} +1 -1
- package/build/_chunks/{chunk-565FQDLE.js → chunk-YCNRGXTF.js} +1 -1
- package/build/components/ActionMenu/index.js +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/AreaChart/index.js +1 -1
- package/build/components/Autocomplete/index.js +1 -1
- package/build/components/AvatarStack/index.js +1 -1
- package/build/components/Card/index.js +1 -1
- package/build/components/CardList/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/CountryFlag/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyAmountInput/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/EmptyState/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/ExpandableChip/index.js +1 -1
- package/build/components/ExportReportButton/index.js +1 -1
- package/build/components/FileDropbox/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUploader/index.js +1 -1
- package/build/components/FilterBar/index.js +1 -1
- package/build/components/FilterButton/index.js +1 -1
- package/build/components/FilterChip/index.js +1 -1
- package/build/components/FilterPopover/index.js +1 -1
- package/build/components/FlipCard/index.js +1 -1
- package/build/components/GroupedSelect/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/Loader/index.js +1 -1
- package/build/components/Logo/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/MultiLevelMenu/index.js +1 -1
- package/build/components/MultiLevelSelect/index.js +1 -1
- package/build/components/PhoneInput/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/Select/index.js +1 -1
- package/build/components/SheetViewChip/index.js +1 -1
- package/build/components/Sidebar/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableViewToggleButton/index.js +1 -1
- package/build/components/TextInput/index.js +1 -1
- package/build/components/Timeline/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Window/index.js +1 -1
- package/build/components/WindowServices/index.js +1 -1
- package/build/components/WindowToolbar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/modules/JSONViewWindow/index.js +1 -1
- package/build/components/modules/VirtualTables/index.js +1 -1
- package/build/components/modules/WindowShell/index.js +1 -1
- package/build/components/modules/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/constants/apps.d.ts +3 -0
- package/build/constants/index.js +1 -1
- package/build/datetime/components/index.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-EYLBXWXJ.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-
|
|
1
|
+
import {d}from'./chunk-KRRCTTGN.js';import {Db,Eb}from'./chunk-FHV4S2B3.js';import {Pj,j,m}from'./chunk-TF7BQNJV.js';import {forwardRef,memo}from'react';import {styled}from'@mui/material/styles';import {jsx}from'react/jsx-runtime';var x="os-shared-CountryFlag",a={root:`${x}-root`};var p=styled(d)({width:"auto",height:"auto"});var f=forwardRef(({countryCode:o,currencyCode:t,width:y=16,height:i,alt:u,id:s,className:F,sx:C},c)=>jsx(p,{ref:c,id:s,"data-testid":s??"CountryFlag",src:o&&j(o)||t&&m(t)||Pj,alt:u??o??t??"flag",loading:"lazy",onError:d=>{d.currentTarget.src=Pj;},className:Eb(a.root,F),sx:Db({width:y,height:i},C)}));f.displayName="CountryFlag";var P=memo(f);export{a,P as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {v}from'./chunk-Z6D3LMCU.js';import {Eb,X as X$1,Y as Y$1}from'./chunk-XBJ4RS2B.js';import {Gb,Yc}from'./chunk-EYLBXWXJ.js';import {forwardRef,useState,useRef,useCallback,memo,useEffect,useMemo}from'react';import H from'@mui/material/Box';import ko from'@mui/material/ClickAwayListener';import Po from'@mui/material/Popper';import go from'@mui/material/Stack';import ro from'@mui/material/Typography';import {RgbColorPicker,RgbaColorPicker}from'react-colorful';import eo from'@mui/material/MenuItem';import {styled,alpha}from'@mui/material/styles';import K from'@mui/material/Button';import Co from'@mui/material/TextField';import ho from'@mui/material/MenuList';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import v$1 from'color';import no from'@mui/material/InputAdornment';var m="os-shared-ColorPicker",n={root:`${m}-root`,controls:`${m}-controls`,swatch:`${m}-swatch`,actions:`${m}-actions`,valueLabel:`${m}-valueLabel`,editButton:`${m}-editButton`,resetButton:`${m}-resetButton`,panel:`${m}-panel`,panelFields:`${m}-panelFields`,panelFooter:`${m}-panelFooter`,panelCancel:`${m}-panelCancel`,panelConfirm:`${m}-panelConfirm`,schemeTrigger:`${m}-schemeTrigger`,schemeList:`${m}-schemeList`,channelInput:`${m}-channelInput`},F={hideReset:false,disableAlpha:false},I={cancel:"Cancel",confirm:"Okay"},w="Edit";var V=styled(go)(({theme:o})=>({backgroundColor:o.palette.grey[400],borderRadius:"4px",padding:o.spacing(.5),paddingRight:o.spacing(1.5)})),X=styled("button")({background:"transparent",border:"none",padding:0,margin:0,cursor:"pointer",width:10,height:10,display:"flex",justifyContent:"center",alignItems:"center","&:disabled, &.Mui-disabled":{opacity:.5,cursor:"not-allowed"}}),Z=styled(H)(({theme:o})=>({boxShadow:"0px 8px 30px rgba(0, 0, 0, 0.16)",width:264,backgroundColor:o.palette.common.white,padding:"12px",borderRadius:o.spacing(1),"& .react-colorful":{width:"100%","&__saturation":{minHeight:152,borderRadius:"4px",marginBottom:o.spacing(2),border:0,"&-pointer":{width:13,height:13}},"&__hue":{borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}},"&__alpha":{marginTop:o.spacing(2),marginBottom:0,border:0,borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}}}})),j=styled(H)(()=>({display:"flex",gap:"8px",justifyContent:"flex-end"})),q=styled("button")(({theme:o})=>({fontWeight:500,fontSize:"9px",color:o.palette.info.dark,textDecoration:"underline",cursor:"pointer",background:"transparent",border:"none",padding:0,margin:0,fontFamily:"inherit","&:disabled, &.Mui-disabled":{color:alpha(o.palette.info.dark,.5),textDecoration:"none",cursor:"not-allowed"},"&:hover:not(:disabled)":{textDecoration:"none"}})),J=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.info.dark}`,backgroundColor:o.palette.info.dark,fontWeight:700,fontSize:"11px",color:o.palette.common.white,"&:hover":{backgroundColor:o.palette.info.dark}})),Q=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.common.white,fontWeight:500,fontSize:"11px",color:o.palette.text.primary,"&:hover":{background:"transparent"}})),Y=styled("button",{shouldForwardProp:o=>o!=="active"})(({theme:o,active:a})=>({display:"flex",justifyContent:"space-between",alignItems:"center",color:o.palette.text.primary,border:"1px solid #F2F2F2",fontSize:12,fontWeight:500,backgroundColor:"transparent",padding:"4px 8px",borderRadius:"4px",minWidth:70,cursor:"pointer",...a&&{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}})),oo=styled(ho)({backgroundColor:"#ffffff",borderRadius:"4px",boxShadow:"0px 8px 30px 0px #00000029",minWidth:70,"& .MuiMenuItem-root":{fontSize:12,fontWeight:500,padding:"4px 8px"}}),b=styled(Co)(({theme:o})=>({"& .MuiOutlinedInput-root":{fontSize:"12px",fontWeight:500,borderRadius:"4px","& input":{padding:"4px","&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"&[type=number]":{MozAppearance:"textfield"}},"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"},"&:hover, &.Mui-focused":{"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"}}}}));var yo=({scheme:o,setScheme:a})=>{let[l,t]=useState(null),u=!!l,i=useCallback(c=>{t(l?null:c.currentTarget);},[l]),s=useCallback(()=>{t(null);},[]),d=useCallback(c=>{s(),a(c);},[s,a]);return jsxs(Fragment,{children:[jsxs(Y,{type:"button",active:u,onClick:i,className:n.schemeTrigger,children:[o,jsx(H,{component:"img",sx:{transform:u?"rotateZ(180deg)":"rotateZ(0)",transition:"200ms transform ease-out"},src:Yc,alt:""})]}),jsx(Po,{anchorEl:l,open:u,placement:"bottom",disablePortal:true,keepMounted:true,modifiers:[{name:"offset",options:{offset:[0,4]}}],children:jsx(ko,{onClickAway:c=>{l?.contains(c.target)||s();},children:jsxs(oo,{className:n.schemeList,children:[jsx(eo,{onClick:()=>d("RGB"),children:"RGB"}),jsx(eo,{onClick:()=>d("HEX"),children:"HEX"})]})})})]})},to=yo;function B(o,a){return Number.isNaN(o)||o<0?0:o>a?a:o}var Ao=({value:o,onChange:a,disableAlpha:l=false})=>{let t=useMemo(()=>v$1.rgb(o.r,o.g,o.b,o.a).hex().replace("#",""),[o]),[u,i]=useState(t),s=Math.round(o.a*100);useEffect(()=>{let e=v$1.rgb(o.r,o.g,o.b).hex().replace("#","");i(e);},[o.r,o.g,o.b]);let d=e=>{let r=e.target.value.replace(/[^0-9a-fA-F]/g,"").toUpperCase();r.length>6&&(r=r.slice(0,6)),i(r);},c=()=>{let e=u;if(e.length===3&&(e=e.split("").map(r=>r+r).join(""),i(e)),e.length===6)try{let r=v$1(`#${e}`).alpha(o.a);a({r:r.red(),g:r.green(),b:r.blue(),a:r.alpha()});}catch{i(t);}else i(t);},C=e=>{let r=B(parseInt(e.target.value,10),100);a({...o,a:r/100});},f=n.channelInput;return jsxs(go,{direction:"row",spacing:1,alignItems:"flex-start",children:[jsx(b,{className:f,value:u,onChange:d,onBlur:c,placeholder:"FFFFFF",sx:{flex:1.4,"& .MuiOutlinedInput-root":{pl:1}},InputProps:{startAdornment:jsx(no,{position:"start",sx:{m:0},children:jsx(ro,{component:"span",color:e=>alpha(e.palette.text.primary,.5),display:"inline-block",fontSize:12,fontWeight:500,children:"#"})})}}),!l&&jsx(b,{className:f,type:"number",value:s,onChange:C,inputProps:{min:0,max:100},sx:{flex:.8,"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",color:"text.primary",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})}})]})},ao=Ao;var _o=({value:o,onChange:a,disableAlpha:l=false})=>{let[t,u]=useState(o),{r:i,g:s,b:d,a:c}=t;useEffect(()=>{u(o);},[o]);let C=useCallback((r,x)=>p=>{u({...t,[r]:B(+p.target.value,x)});},[t]),f=useCallback((r,x)=>{a({...t,[r]:B(t[r],x)});},[a,t]),e=n.channelInput;return jsxs(go,{direction:"row",spacing:1,...l&&{flex:1},children:[jsx(b,{className:e,type:"number",value:i,onBlur:()=>f("r",255),onChange:C("r",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:s,onBlur:()=>f("g",255),onChange:C("g",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:d,onBlur:()=>f("b",255),onChange:C("b",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),!l&&jsx(b,{className:e,type:"number",value:c,onBlur:()=>f("a",100),onChange:C("a",100),inputProps:{min:0,max:100,style:{textAlign:"center"}},variant:"outlined",sx:{"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})},size:"small"})]})},io=_o;var zo=({initialValue:o="#ffffff",onCancel:a,onConfirm:l,disableAlpha:t=false})=>{let[u,i]=useState("RGB"),[s,d]=useState(()=>{let{alpha:p,...k}=X$1(o).value;return {...k,a:p}}),c=useCallback(()=>{let{alpha:p,...k}=X$1(o).value;d({...k,a:p}),a();},[o,a]),C=useCallback(()=>{let{a:p,...k}=s;l(Y$1({...k,alpha:t?1:p}));},[s,l,t]),f=useCallback(p=>{d(t?{...p,a:1}:p);},[t]),e=useCallback(p=>{d({...p,a:p.a/100});},[]),r=useCallback(p=>{d({...p,a:p.a});},[]),x=t?RgbColorPicker:RgbaColorPicker;return jsxs(Z,{className:n.panel,children:[jsx(x,{color:s,onChange:f}),jsxs(go,{mt:2,spacing:1,direction:"row",className:n.panelFields,children:[jsx(to,{scheme:u,setScheme:i}),u==="RGB"?jsx(io,{value:{...s,a:Math.round(s.a*100)},onChange:e,disableAlpha:t}):jsx(ao,{value:{...s,a:s.a},onChange:r,disableAlpha:t})]}),jsx(v,{sx:{my:"12px"}}),jsxs(j,{className:n.panelFooter,children:[jsx(Q,{className:n.panelCancel,onClick:c,children:I.cancel}),jsx(J,{className:n.panelConfirm,onClick:C,children:I.confirm})]})]})},po=zo;var co=forwardRef(({value:o="#ffffff",onChange:a,onReset:l,sx:t,options:u,disabled:i=false,id:s,className:d},c)=>{let[C,f]=useState(null),{disableAlpha:e,hideReset:r}={...F,...u},x=useRef(null),p=useCallback(y=>{x.current=y,typeof c=="function"?c(y):c&&(c.current=y);},[c]),k=useCallback(()=>{i||f(x.current);},[i]),mo=useCallback(()=>{i||f(null);},[i]),uo=useCallback(y=>{a(e?y.substring(0,7):y),f(null);},[a,e]);return jsx(ko,{onClickAway:()=>f(null),children:jsxs(V,{ref:p,id:s,"data-testid":s??"ColorPicker",direction:"row",justifyContent:"space-between",spacing:1,alignItems:"center",className:Eb(n.root,d),sx:t,children:[jsxs(go,{direction:"row",spacing:1,alignItems:"center",className:n.controls,children:[jsx(H,{borderRadius:"5px",width:32,height:32,sx:{backgroundColor:o},className:n.swatch}),jsxs(H,{className:n.actions,children:[jsx(ro,{className:n.valueLabel,fontWeight:500,fontSize:9,color:"text.primary",textTransform:"uppercase",children:o}),jsx(q,{className:n.editButton,type:"button",onClick:k,disabled:i,children:w})]})]}),r?jsx("div",{}):jsx(X,{className:n.resetButton,type:"button",disabled:i,onClick:l,children:jsx(H,{component:"img",src:Gb,width:10,height:10,alt:""})}),jsx(Po,{anchorEl:C,open:!!C,placement:"top",children:jsx(po,{initialValue:o,onCancel:mo,onConfirm:uo,disableAlpha:e})})]})})});co.displayName="ColorPicker";var qo=memo(co);export{m as a,n as b,F as c,I as d,w as e,qo as f};
|
|
1
|
+
import {v}from'./chunk-KRRCTTGN.js';import {Eb,X as X$1,Y as Y$1}from'./chunk-FHV4S2B3.js';import {Gb,Yc}from'./chunk-TF7BQNJV.js';import {forwardRef,useState,useRef,useCallback,memo,useEffect,useMemo}from'react';import H from'@mui/material/Box';import ko from'@mui/material/ClickAwayListener';import Po from'@mui/material/Popper';import go from'@mui/material/Stack';import ro from'@mui/material/Typography';import {RgbColorPicker,RgbaColorPicker}from'react-colorful';import eo from'@mui/material/MenuItem';import {styled,alpha}from'@mui/material/styles';import K from'@mui/material/Button';import Co from'@mui/material/TextField';import ho from'@mui/material/MenuList';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import v$1 from'color';import no from'@mui/material/InputAdornment';var m="os-shared-ColorPicker",n={root:`${m}-root`,controls:`${m}-controls`,swatch:`${m}-swatch`,actions:`${m}-actions`,valueLabel:`${m}-valueLabel`,editButton:`${m}-editButton`,resetButton:`${m}-resetButton`,panel:`${m}-panel`,panelFields:`${m}-panelFields`,panelFooter:`${m}-panelFooter`,panelCancel:`${m}-panelCancel`,panelConfirm:`${m}-panelConfirm`,schemeTrigger:`${m}-schemeTrigger`,schemeList:`${m}-schemeList`,channelInput:`${m}-channelInput`},F={hideReset:false,disableAlpha:false},I={cancel:"Cancel",confirm:"Okay"},w="Edit";var V=styled(go)(({theme:o})=>({backgroundColor:o.palette.grey[400],borderRadius:"4px",padding:o.spacing(.5),paddingRight:o.spacing(1.5)})),X=styled("button")({background:"transparent",border:"none",padding:0,margin:0,cursor:"pointer",width:10,height:10,display:"flex",justifyContent:"center",alignItems:"center","&:disabled, &.Mui-disabled":{opacity:.5,cursor:"not-allowed"}}),Z=styled(H)(({theme:o})=>({boxShadow:"0px 8px 30px rgba(0, 0, 0, 0.16)",width:264,backgroundColor:o.palette.common.white,padding:"12px",borderRadius:o.spacing(1),"& .react-colorful":{width:"100%","&__saturation":{minHeight:152,borderRadius:"4px",marginBottom:o.spacing(2),border:0,"&-pointer":{width:13,height:13}},"&__hue":{borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}},"&__alpha":{marginTop:o.spacing(2),marginBottom:0,border:0,borderRadius:"4px",height:"8px","&-pointer":{width:10,height:10}}}})),j=styled(H)(()=>({display:"flex",gap:"8px",justifyContent:"flex-end"})),q=styled("button")(({theme:o})=>({fontWeight:500,fontSize:"9px",color:o.palette.info.dark,textDecoration:"underline",cursor:"pointer",background:"transparent",border:"none",padding:0,margin:0,fontFamily:"inherit","&:disabled, &.Mui-disabled":{color:alpha(o.palette.info.dark,.5),textDecoration:"none",cursor:"not-allowed"},"&:hover:not(:disabled)":{textDecoration:"none"}})),J=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.info.dark}`,backgroundColor:o.palette.info.dark,fontWeight:700,fontSize:"11px",color:o.palette.common.white,"&:hover":{backgroundColor:o.palette.info.dark}})),Q=styled(K)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.common.white,fontWeight:500,fontSize:"11px",color:o.palette.text.primary,"&:hover":{background:"transparent"}})),Y=styled("button",{shouldForwardProp:o=>o!=="active"})(({theme:o,active:a})=>({display:"flex",justifyContent:"space-between",alignItems:"center",color:o.palette.text.primary,border:"1px solid #F2F2F2",fontSize:12,fontWeight:500,backgroundColor:"transparent",padding:"4px 8px",borderRadius:"4px",minWidth:70,cursor:"pointer",...a&&{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}})),oo=styled(ho)({backgroundColor:"#ffffff",borderRadius:"4px",boxShadow:"0px 8px 30px 0px #00000029",minWidth:70,"& .MuiMenuItem-root":{fontSize:12,fontWeight:500,padding:"4px 8px"}}),b=styled(Co)(({theme:o})=>({"& .MuiOutlinedInput-root":{fontSize:"12px",fontWeight:500,borderRadius:"4px","& input":{padding:"4px","&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"&[type=number]":{MozAppearance:"textfield"}},"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"},"&:hover, &.Mui-focused":{"& .MuiOutlinedInput-notchedOutline":{borderColor:o.palette.divider,borderWidth:"1px"}}}}));var yo=({scheme:o,setScheme:a})=>{let[l,t]=useState(null),u=!!l,i=useCallback(c=>{t(l?null:c.currentTarget);},[l]),s=useCallback(()=>{t(null);},[]),d=useCallback(c=>{s(),a(c);},[s,a]);return jsxs(Fragment,{children:[jsxs(Y,{type:"button",active:u,onClick:i,className:n.schemeTrigger,children:[o,jsx(H,{component:"img",sx:{transform:u?"rotateZ(180deg)":"rotateZ(0)",transition:"200ms transform ease-out"},src:Yc,alt:""})]}),jsx(Po,{anchorEl:l,open:u,placement:"bottom",disablePortal:true,keepMounted:true,modifiers:[{name:"offset",options:{offset:[0,4]}}],children:jsx(ko,{onClickAway:c=>{l?.contains(c.target)||s();},children:jsxs(oo,{className:n.schemeList,children:[jsx(eo,{onClick:()=>d("RGB"),children:"RGB"}),jsx(eo,{onClick:()=>d("HEX"),children:"HEX"})]})})})]})},to=yo;function B(o,a){return Number.isNaN(o)||o<0?0:o>a?a:o}var Ao=({value:o,onChange:a,disableAlpha:l=false})=>{let t=useMemo(()=>v$1.rgb(o.r,o.g,o.b,o.a).hex().replace("#",""),[o]),[u,i]=useState(t),s=Math.round(o.a*100);useEffect(()=>{let e=v$1.rgb(o.r,o.g,o.b).hex().replace("#","");i(e);},[o.r,o.g,o.b]);let d=e=>{let r=e.target.value.replace(/[^0-9a-fA-F]/g,"").toUpperCase();r.length>6&&(r=r.slice(0,6)),i(r);},c=()=>{let e=u;if(e.length===3&&(e=e.split("").map(r=>r+r).join(""),i(e)),e.length===6)try{let r=v$1(`#${e}`).alpha(o.a);a({r:r.red(),g:r.green(),b:r.blue(),a:r.alpha()});}catch{i(t);}else i(t);},C=e=>{let r=B(parseInt(e.target.value,10),100);a({...o,a:r/100});},f=n.channelInput;return jsxs(go,{direction:"row",spacing:1,alignItems:"flex-start",children:[jsx(b,{className:f,value:u,onChange:d,onBlur:c,placeholder:"FFFFFF",sx:{flex:1.4,"& .MuiOutlinedInput-root":{pl:1}},InputProps:{startAdornment:jsx(no,{position:"start",sx:{m:0},children:jsx(ro,{component:"span",color:e=>alpha(e.palette.text.primary,.5),display:"inline-block",fontSize:12,fontWeight:500,children:"#"})})}}),!l&&jsx(b,{className:f,type:"number",value:s,onChange:C,inputProps:{min:0,max:100},sx:{flex:.8,"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",color:"text.primary",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})}})]})},ao=Ao;var _o=({value:o,onChange:a,disableAlpha:l=false})=>{let[t,u]=useState(o),{r:i,g:s,b:d,a:c}=t;useEffect(()=>{u(o);},[o]);let C=useCallback((r,x)=>p=>{u({...t,[r]:B(+p.target.value,x)});},[t]),f=useCallback((r,x)=>{a({...t,[r]:B(t[r],x)});},[a,t]),e=n.channelInput;return jsxs(go,{direction:"row",spacing:1,...l&&{flex:1},children:[jsx(b,{className:e,type:"number",value:i,onBlur:()=>f("r",255),onChange:C("r",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:s,onBlur:()=>f("g",255),onChange:C("g",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),jsx(b,{className:e,type:"number",value:d,onBlur:()=>f("b",255),onChange:C("b",255),inputProps:{min:0,max:255,style:{textAlign:"center"}},variant:"outlined",size:"small",...l&&{sx:{flex:1}}}),!l&&jsx(b,{className:e,type:"number",value:c,onBlur:()=>f("a",100),onChange:C("a",100),inputProps:{min:0,max:100,style:{textAlign:"center"}},variant:"outlined",sx:{"& .MuiOutlinedInput-root":{pr:1}},InputProps:{endAdornment:jsx(no,{position:"end",sx:{m:0},children:jsx(ro,{component:"span",display:"inline-block",fontSize:12,fontWeight:500,children:"%"})})},size:"small"})]})},io=_o;var zo=({initialValue:o="#ffffff",onCancel:a,onConfirm:l,disableAlpha:t=false})=>{let[u,i]=useState("RGB"),[s,d]=useState(()=>{let{alpha:p,...k}=X$1(o).value;return {...k,a:p}}),c=useCallback(()=>{let{alpha:p,...k}=X$1(o).value;d({...k,a:p}),a();},[o,a]),C=useCallback(()=>{let{a:p,...k}=s;l(Y$1({...k,alpha:t?1:p}));},[s,l,t]),f=useCallback(p=>{d(t?{...p,a:1}:p);},[t]),e=useCallback(p=>{d({...p,a:p.a/100});},[]),r=useCallback(p=>{d({...p,a:p.a});},[]),x=t?RgbColorPicker:RgbaColorPicker;return jsxs(Z,{className:n.panel,children:[jsx(x,{color:s,onChange:f}),jsxs(go,{mt:2,spacing:1,direction:"row",className:n.panelFields,children:[jsx(to,{scheme:u,setScheme:i}),u==="RGB"?jsx(io,{value:{...s,a:Math.round(s.a*100)},onChange:e,disableAlpha:t}):jsx(ao,{value:{...s,a:s.a},onChange:r,disableAlpha:t})]}),jsx(v,{sx:{my:"12px"}}),jsxs(j,{className:n.panelFooter,children:[jsx(Q,{className:n.panelCancel,onClick:c,children:I.cancel}),jsx(J,{className:n.panelConfirm,onClick:C,children:I.confirm})]})]})},po=zo;var co=forwardRef(({value:o="#ffffff",onChange:a,onReset:l,sx:t,options:u,disabled:i=false,id:s,className:d},c)=>{let[C,f]=useState(null),{disableAlpha:e,hideReset:r}={...F,...u},x=useRef(null),p=useCallback(y=>{x.current=y,typeof c=="function"?c(y):c&&(c.current=y);},[c]),k=useCallback(()=>{i||f(x.current);},[i]),mo=useCallback(()=>{i||f(null);},[i]),uo=useCallback(y=>{a(e?y.substring(0,7):y),f(null);},[a,e]);return jsx(ko,{onClickAway:()=>f(null),children:jsxs(V,{ref:p,id:s,"data-testid":s??"ColorPicker",direction:"row",justifyContent:"space-between",spacing:1,alignItems:"center",className:Eb(n.root,d),sx:t,children:[jsxs(go,{direction:"row",spacing:1,alignItems:"center",className:n.controls,children:[jsx(H,{borderRadius:"5px",width:32,height:32,sx:{backgroundColor:o},className:n.swatch}),jsxs(H,{className:n.actions,children:[jsx(ro,{className:n.valueLabel,fontWeight:500,fontSize:9,color:"text.primary",textTransform:"uppercase",children:o}),jsx(q,{className:n.editButton,type:"button",onClick:k,disabled:i,children:w})]})]}),r?jsx("div",{}):jsx(X,{className:n.resetButton,type:"button",disabled:i,onClick:l,children:jsx(H,{component:"img",src:Gb,width:10,height:10,alt:""})}),jsx(Po,{anchorEl:C,open:!!C,placement:"top",children:jsx(po,{initialValue:o,onCancel:mo,onConfirm:uo,disableAlpha:e})})]})})});co.displayName="ColorPicker";var qo=memo(co);export{m as a,n as b,F as c,I as d,w as e,qo as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {m as m$1,n}from'./chunk-
|
|
1
|
+
import {m as m$1,n}from'./chunk-KRRCTTGN.js';import {Eb}from'./chunk-FHV4S2B3.js';import {forwardRef,memo}from'react';import y from'@mui/material/Box';import {circularProgressClasses}from'@mui/material/CircularProgress';import {styled}from'@mui/material/styles';import {jsx}from'react/jsx-runtime';var u="os-shared-Loader",a={root:`${u}-root`},m=24,t=5,d=3.2,L="inherit",i="rgba(0, 0, 0, 0.62)";function x(r,e){if(e==="inherit")return i;let o=r.palette[e];return o&&typeof o=="object"&&"main"in o&&typeof o.main=="string"?o.main:i}var c=styled(y,{shouldForwardProp:r=>r!=="$size"&&r!=="$color"})(({theme:r,$size:e,$color:o})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxSizing:"border-box",width:r.v2.spacing(e),height:r.v2.spacing(e),padding:r.v2.spacing(t),[`& .${m$1.progress}`]:{background:"transparent",color:x(r,o)},[`& .${m$1.progress} .${circularProgressClasses.circle}`]:{strokeLinecap:"butt"}}));var E=forwardRef(({size:r=m,thickness:e=d,color:o=L,id:n$1,className:D,sx:C,"data-testid":A,...N},_)=>{let g=typeof r=="number"?r-t*2:"100%";return jsx(c,{ref:_,$size:r,$color:o,id:n$1,"data-testid":A??n$1??"Loader",className:Eb(a.root,D),sx:C,children:jsx(n,{...N,size:g,thickness:e,color:o,variant:"indeterminate",hasLabel:false})})});E.displayName="Loader";var T=memo(E);export{a,T as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,r}from'./chunk-
|
|
1
|
+
import {d,r}from'./chunk-KRRCTTGN.js';import {Db,Eb}from'./chunk-FHV4S2B3.js';import {Ud,Ze}from'./chunk-TF7BQNJV.js';import {forwardRef,useState,useMemo,useCallback,memo}from'react';import {styled}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var S="os-shared-Logo",n={root:`${S}-root`,skeleton:`${S}-skeleton`},C="logo";var R=styled(d)(({theme:s})=>({borderRadius:"50%",backgroundColor:s.palette.common.white}));var I=forwardRef(({className:s,sx:f,id:a,src:o,width:g=24,height:d=24,isError:E,isLoading:P,fallback:e,onError:u,alt:U=C},v)=>{let[w,H]=useState(),m=useMemo(()=>typeof o!="string"&&!!o?.type?.includes("application/pdf"),[o]),t=useMemo(()=>o?typeof o=="string"?o:(window.URL?URL:webkitURL).createObjectURL(o):"",[o]),r$1=E||!!t&&w===t,M=useMemo(()=>r$1||!o?typeof e=="string"&&e?e:Ud:m?Ze:t,[o,e,r$1,m,t]),h=useCallback(j=>{H(t),u?.(j);},[t,u]);return P?jsx(r,{variant:"circular",className:n.skeleton,sx:Db({width:g,height:d,flexShrink:0},f),"data-testid":a??"Logo"}):(r$1||!o)&&e!==void 0&&typeof e!="string"?jsx(Fragment,{children:e}):jsx(R,{ref:v,id:a,"data-testid":a??"Logo",alt:U,src:M,onError:h,className:Eb(n.root,s),sx:Db({width:g,height:d,objectFit:m&&o&&!r$1?"none":"contain"},f)})});I.displayName="Logo";var $=memo(I);export{n as a,$ as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Eb}from'./chunk-
|
|
1
|
+
import {Eb}from'./chunk-FHV4S2B3.js';import {forwardRef,memo}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled}from'@mui/material/styles';var o="os-shared-MaskedText",t={root:`${o}-root`,start:`${o}-start`,mask:`${o}-mask`,end:`${o}-end`};var p=()=>jsxs("svg",{width:"16",height:"8",viewBox:"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,children:[jsx("circle",{cx:"3",cy:"4",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"8",cy:"4",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"13",cy:"4",r:"1.5",fill:"currentColor"})]});var k=styled("span")(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.v2.spacing(2),minWidth:0,color:"inherit",font:"inherit",lineHeight:1,whiteSpace:"nowrap"})),m=styled("span")({minWidth:0}),c=styled("span")({display:"inline-flex",alignItems:"center",flexShrink:0,lineHeight:0,"& svg":{display:"block",width:16,height:8}});function M(e,d,n){let s=Math.max(0,d),a=Math.max(0,n);return !e||s+a>=e.length?{start:e,end:"",isMasked:false}:{start:e.slice(0,s),end:e.slice(e.length-a),isMasked:true}}var T=forwardRef(({className:e,sx:d,text:n,startLength:s=8,endLength:a=4,separator:y,id:h,...g},S)=>{let{start:C,end:N,isMasked:u}=M(n,s,a);return jsxs(k,{ref:S,id:h??"MaskedText",className:Eb(t.root,e),sx:d,"data-testid":"MaskedText",...g,children:[jsx(m,{className:t.start,children:C}),u&&jsxs(Fragment,{children:[jsx(c,{className:t.mask,children:y??jsx(p,{})}),jsx(m,{className:t.end,children:N})]})]})});T.displayName="MaskedText";var P=memo(T);
|
|
2
2
|
export{t as a,P as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Eb}from'./chunk-
|
|
1
|
+
import {Eb}from'./chunk-FHV4S2B3.js';import {forwardRef,useState,useCallback,memo}from'react';import m from'@mui/material/Box';import {styled}from'@mui/material/styles';import {motion}from'framer-motion';import {jsx,jsxs}from'react/jsx-runtime';var o="os-shared-FlipCard",t={root:`${o}-root`,container:`${o}-container`,inner:`${o}-inner`,front:`${o}-front`,back:`${o}-back`,faceContent:`${o}-faceContent`},h=.3;var D=styled(m,{shouldForwardProp:e=>e!=="$interactive"})(({$interactive:e})=>({width:"100%",height:"100%",cursor:e?"pointer":void 0})),I=styled(m)(()=>({width:"inherit",height:"inherit",perspective:"1000px"})),b=styled(motion.div)(()=>({width:"100%",height:"100%",position:"relative",transformStyle:"preserve-3d"})),u=styled(m,{shouldForwardProp:e=>e!=="$side"&&e!=="$direction"})(({$side:e,$direction:y})=>({position:"absolute",backfaceVisibility:"hidden",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",...e==="back"&&{transform:y==="vertical"?"rotateX(180deg)":"rotateY(180deg)"}})),v=styled(m)(()=>({width:"100%",height:"100%"}));var T=forwardRef(function({front:y,back:w,isFlipped:S,defaultFlipped:L=false,onFlip:N,direction:s="horizontal",trigger:P,duration:A=h,disabled:a=false,id:k,className:R,sx:l,"data-testid":M,...c},U){let p=S!==void 0,r=P??(p?void 0:"click"),[_,K]=useState(L),C=p?S:_,f=useCallback(i=>{a||(p||K(i),N?.(i));},[a,p,N]),$=useCallback(()=>{f(!C);},[C,f]),O=()=>{r==="click"&&$();},H=()=>{r==="hover"&&f(true);},X=()=>{r==="hover"&&f(false);},F=!a&&r==="click",Y=i=>{F&&(i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),$()));},g=C?180:0,j=s==="vertical"?{rotateX:g}:{rotateY:g},z=!a&&(r==="click"||r==="hover"),B=a?[{pointerEvents:"none",opacity:.6},...Array.isArray(l)?l:l?[l]:[]]:l;return jsx(D,{...c,ref:U,id:k,"data-testid":M??k??"FlipCard","data-direction":s,className:Eb(t.root,R),$interactive:z,role:F?"button":c.role,tabIndex:F?a?-1:0:c.tabIndex,"aria-pressed":F?C:c["aria-pressed"],onClick:O,onKeyDown:Y,onMouseEnter:r==="hover"?H:void 0,onMouseLeave:r==="hover"?X:void 0,sx:B,children:jsx(I,{className:t.container,children:jsxs(b,{className:t.inner,animate:j,transition:{duration:A},children:[jsx(u,{className:t.front,$side:"front",$direction:s,children:jsx(v,{className:t.faceContent,children:y})}),jsx(u,{className:t.back,$side:"back",$direction:s,children:jsx(v,{className:t.faceContent,children:w})})]})})})});T.displayName="FlipCard";var Q=memo(T);export{o as a,t as b,h as c,Q as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-KRRCTTGN.js';import {Eb}from'./chunk-FHV4S2B3.js';import {kf}from'./chunk-TF7BQNJV.js';import {forwardRef,memo}from'react';import {styled,Box}from'@mui/material';import {jsxs,jsx}from'react/jsx-runtime';var a="os-shared-ErrorToast",t={root:`${a}-root`,message:`${a}-message`,icon:`${a}-icon`};var i=styled(Box,{shouldForwardProp:o=>o!=="toastPosition"})(({theme:o,toastPosition:r})=>({width:160,position:"absolute",bottom:12,zIndex:1e3,display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:o.v2.palette.background.primary,height:31,gap:o.v2.spacing(8),borderRadius:o.v2.radius(8),borderWidth:1,padding:o.v2.spacing(8),border:`1px solid ${o.v2.palette.border.default}`,boxShadow:"0px 0px 16px 0px #00000014",animation:"slideIn 0.5s ease-out",...r==="bottom-center"&&{left:"50%",transform:"translateX(-50%)"},...r==="bottom-right"&&{right:12,transform:"none"},...r==="bottom-left"&&{left:12,transform:"none"},"@keyframes slideIn":{"0%":{opacity:0,transform:r==="bottom-center"?"translate(-50%, 100%)":r==="bottom-right"?"translateX(100%)":"translateX(-100%)"},"100%":{opacity:1,transform:r==="bottom-center"?"translate(-50%, 0)":"translateX(0)"}}})),l=styled("img")({cursor:"pointer"});var c=forwardRef(({message:o="Something went wrong",onRetry:r,position:f="bottom-center",id:e,className:T,sx:y,...g},x)=>jsxs(i,{ref:x,...g,className:Eb(t.root,T),sx:y,id:e,"data-testid":e??"ErrorToast",toastPosition:f,children:[jsx(j,{component:"p",textVariant:"body.small.medium",noWrap:true,className:t.message,children:o}),jsx(l,{className:t.icon,onClick:b=>r?.(b),src:kf,alt:"toast-icon"})]}));c.displayName="ErrorToast";var N=memo(c);export{t as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {T as T$1,S as S$1,b as b$1}from'./chunk-
|
|
1
|
+
import {T as T$1,S as S$1,b as b$1}from'./chunk-KRRCTTGN.js';import {Eb}from'./chunk-FHV4S2B3.js';import {forwardRef,memo,createContext,useState,useRef,useCallback,useMemo,useContext}from'react';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var l="os-shared-ConfirmDialog",n={root:`${l}-root`,body:`${l}-body`,message:`${l}-message`,actions:`${l}-actions`,cancel:`${l}-cancel`,confirm:`${l}-confirm`},I="Yes",O="No",T=256,S=13,R=64,A={open:false,message:null,dismissible:true};var v=styled(T$1)(({theme:e})=>{let{grey:o}=e.v2.palette,{spacing:t}=e.v2;return {[`& .${S$1.title}`]:{margin:0,padding:`${t(16)} ${t(16)} ${t(16)} ${t(12)}`,fontSize:t(S),fontWeight:e.v2.typography.textVariants.body.default.bold.fontWeight,lineHeight:"normal",color:o[900],borderBottom:`1px solid ${o[100]}`}}}),b=styled("div")(({theme:e})=>{let{spacing:o}=e.v2;return {display:"flex",flexDirection:"column",gap:o(16),minWidth:o(T),padding:o(16)}}),L=styled("p")(({theme:e})=>({...e.v2.typography.textVariants.body.default.medium,margin:0,fontFamily:"inherit"})),M=styled("div")(({theme:e})=>({display:"flex",justifyContent:"flex-end",gap:e.v2.spacing(8)})),D=styled(b$1)(({theme:e})=>{let{grey:o}=e.v2.palette,{spacing:t,radius:r}=e.v2;return {...e.v2.typography.textVariants.body.small.medium,fontFamily:"inherit",minWidth:t(R),paddingInline:t(24),paddingBlock:t(8),borderRadius:r(4),color:o[900],textTransform:"none",border:`1px solid ${o[100]}`,boxShadow:"none","&:hover":{boxShadow:"none",backgroundColor:o[50]}}});var E=forwardRef(({id:e,message:o,title:t,confirmText:r,cancelText:i,onConfirm:p,onCancel:f,className:c,sx:g,...a},s)=>jsx(v,{ref:s,id:e,heading:t,className:Eb(n.root,c),sx:g,...a,"data-testid":e??"ConfirmDialog",children:jsxs(b,{className:n.body,children:[jsx(L,{className:n.message,children:o}),jsxs(M,{className:n.actions,children:[jsx(D,{variant:"ghost",className:n.cancel,onClick:f,children:i||O}),jsx(D,{variant:"ghost",className:n.confirm,onClick:p,children:r||I})]})]})}));E.displayName="ConfirmDialog";var h=memo(E);var u=createContext(null);function W(){let e=useContext(u);if(!e)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return e}function X({children:e}){let[o,t]=useState(A),r=useRef(null),i=useCallback(a=>{let s=r.current;s&&(r.current=null,t($=>({...$,open:false})),s(a));},[]),p=useCallback(()=>i(true),[i]),f=useCallback(()=>i(false),[i]),c=useCallback(a=>new Promise(s=>{r.current?.(false),r.current=s,t({...a,open:true,dismissible:a.dismissible??true});}),[]),g=useMemo(()=>({confirm:c}),[c]);return jsxs(u.Provider,{value:g,children:[e,jsx(h,{open:o.open,id:o.id,message:o.message,title:o.title,confirmText:o.confirmText,cancelText:o.cancelText,onConfirm:p,onCancel:f,onClose:o.dismissible?f:void 0,className:o.className,sx:o.sx})]})}var Z=memo(X);export{n as a,W as b,Z as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {h,g,f,j,c as c$1,d,i,E as E$1,a,e}from'./chunk-
|
|
1
|
+
import {h,g,f,j,c as c$1,d,i,E as E$1,a,e}from'./chunk-KPSBWLN2.js';import {Db,Eb}from'./chunk-FHV4S2B3.js';function c(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(c).join(""):typeof e=="object"&&"props"in e?c(e.props.children):""}function E(e){return typeof e.label=="string"||typeof e.label=="number"?String(e.label):c(e.label).trim()||(e.value!=null?String(e.value):"")}function N(e){let t=e?.currentTarget??e?.target;return t instanceof Element?(t.closest(".MuiInputBase-root")??t).getBoundingClientRect():null}function w(e,t,n){let o=e?.PaperProps?.style?.maxHeight;if(typeof o=="number"&&Number.isFinite(o))return o;if(typeof o=="string"){let r=Number.parseFloat(o);if(Number.isFinite(r))return r}return t&&n?h:t?g:f}function R({preferred:e,anchorRect:t,menuMaxHeight:n,gapPx:o}){if(e===j.top||t==null)return e;let r=window.innerHeight-t.bottom-o,p=t.top-o;return r>=n?j.bottom:p>r?j.top:j.bottom}function F(e$1,t,n){let o=e$1?.PaperProps,r=t===j.top,f$1={marginTop:`${r?-c$1:c$1}px`,marginBottom:0},g=n!=null&&Number.isFinite(n)&&n>0,h=g?{width:n,minWidth:n,maxWidth:n}:{};return {...e$1,autoFocus:false,disableAutoFocus:true,disableAutoFocusItem:true,disableEnforceFocus:true,variant:"menu",marginThreshold:0,anchorOrigin:{vertical:r?"top":"bottom",horizontal:"left"},transformOrigin:{vertical:r?"bottom":"top",horizontal:"left"},MenuListProps:{...e$1?.MenuListProps,autoFocus:false,autoFocusItem:false,sx:Db({padding:0,display:"flex",flexDirection:"column",gap:`${e}px`,flex:1,minHeight:0,overflowX:"hidden",overflowY:"auto"},e$1?.MenuListProps?.sx??{})},PaperProps:{...o,className:Eb(a.menu,o?.className),style:{...o?.style,...f$1,...h,maxHeight:o?.style?.maxHeight??f},sx:Db({...f$1,...E$1,borderRadius:`${i}px`,boxSizing:"border-box",display:"flex",flexDirection:"column",padding:`${d}px`,overflow:"hidden",overflowX:"hidden",overflowY:"hidden",...g&&{width:`${n}px`,minWidth:`${n}px`,maxWidth:`${n}px`,boxSizing:"border-box"}},o?.sx??{})}}}function T(e){e.stopPropagation();}var I=e=>"options"in e,s=e=>({...e,id:String(e.value)});function H(e){let t=[];for(let n of e){if(I(n)){n.options.length&&t.push({key:`group-${t.length}`,label:n.label,isGroup:true,options:n.options.map(s)});continue}let o=t[t.length-1];o&&!o.isGroup?o.options.push(s(n)):t.push({key:`flat-${t.length}`,isGroup:false,options:[s(n)]});}return t}function B(e,t){return t==null?null:e.find(n=>n.value===t||String(n.value)===String(t))??null}function D(e){return e==null?"":String(e.value)}function A(e){let t=e?.target;return t instanceof Element&&t.closest("[data-select-menu-search], [data-select-menu-keep-open]")!=null}function G(e){if(e==null||typeof e!="object")return false;let t=e;if(t.key==="Escape"||t.type==="keydown")return false;let n=t.target;return n instanceof Element&&n.closest('[role="option"], .MuiMenuItem-root')!=null}function $(e){let t=e?.target;return t instanceof Element&&t.closest(".Select-clearIconButton, [data-select-clear]")!=null}function L(e){return e==null?false:Array.isArray(e)?e.length>0:typeof e=="object"?String(e.value??"")!=="":String(e)!==""}export{c as a,E as b,N as c,w as d,R as e,F as f,T as g,H as h,B as i,D as j,A as k,G as l,$ as m,L as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Kn as Kn$1,oo as oo$1,po,Fn as Fn$1,Mn as Mn$1,ro as ro$1,mo as mo$1,lo,ko as ko$1,jo as jo$1,io as io$1,ho as ho$1,Un as Un$1,Zn,go as go$1,bo,co,ao as ao$1,eo,$n as $n$1,_n as _n$1,Xn as Xn$1,fo,Yn as Yn$1,Vn as Vn$1,do as _do,Wn as Wn$1,Nn,On,cp,Ye as Ye$1,Do as Do$1,Co as Co$1,Eo as Eo$1}from'./chunk-EYLBXWXJ.js';import We from'lodash/orderBy';import Te from'lodash/get';import Ye from'axios';import Ge from'lodash/forOwn';import Oe from'color';import ke from'lodash/capitalize';import Ne from'lodash/startCase';import {getTimezone,getCountryForTimezone,getCountry}from'countries-and-timezones';import Me from'dompurify';function Ft({list:e,sortBy:t,orders:r}){return t?.length&&r?.length?We(e,t,r):e}var Nt=(e=[],t)=>e.length?e.sort((r,n)=>Te(r,t).localeCompare(Te(n,t))):[];function Pt(e){return (e||[]).filter(t=>!!t)}var Dt=(e,t)=>[...new Map(e.map(r=>[r[t],r])).values()];var he=e=>{let r=e.reduce((n,o)=>{let s=o.entities?.find(i=>i.default);return s&&n.push({entityId:s.id,country:o}),n},[])[0]?.country||e[0];return e.find(n=>n.id===r?.id)};var Se=(e,t,r)=>{let n=e.find(a=>a.id===t)??{},o=r.find(a=>a.id===t)??{},s=o.countries.length===1?n.countries.find(a=>a.id===o.countries?.[0].id):he(n?.countries),i=s?.entities?.find(a=>a.default);return {...n,defaultCountry:s,defaultEntity:i}},ze=({merchantsIds:e,options:t})=>!e||!e?.length?{}:{business:{merchant:e,...t}},He=e=>["payment_facilitator_14po8231419aIsi1fN7F385"].includes(e),Bt=({segmentCode:e,segmentId:t,segmentTypeCode:r,merchantsIds:n=[],options:o={}})=>{let s="PSP"===r?e:r;return He(t)?ze({merchantsIds:n,options:o}):s==="PAYMENT_TECHNOLOGY"?{payment_provider:{technology:{orchestrator:[t],...o}}}:s==="PAYMENT_GATEWAY"||s==="PAYMENT_GATEWAY_PROVIDER"?{payment_provider:{technology:{gateway:[t],...o}}}:s==="PAYMENT_FACILITATOR"?{payment_provider:{institution:{facilitator:[t],...o}}}:s==="PAYMENT_ACQUIRER"?{payment_provider:{institution:{acquirer:[t],...o}}}:s==="PLATFORM"?{platform:[t],...o}:s==="DEVELOPMENT"?{development_agency:[t],...o}:{}};var Ee="Test_Fixed_Secret_Key",T="tap-dashboard-navigation-data",be="tap-dashboard-user-data",h="tap-dashboard-user-jwt",S="tap-dashboard-report",E="tap-dashboard-calender-timezone",b="tap-dashboard-calender-timezone-history",_="tap-dashboard-global-table-mode",_e="sheetview_columns",w="dock-preview-windows",C="views";function Wt(){localStorage.setItem(Ee,Mn$1);}function we(){return localStorage.getItem(Ee)}function zt(e){localStorage.setItem(T,JSON.stringify(e));}function Ht(){try{let e=localStorage.getItem(T);if(!e)return null;let t=JSON.parse(e);return Ge(t,r=>{r?.forEach(n=>{n.payload&&n.payload.dateRange&&(n.payload.dateRange=n.payload.dateRange.map(o=>new Date(o)));});})}catch{return null}}function Gt(){localStorage.removeItem(T);}var Kt=e=>{localStorage.setItem(h,e);},A=()=>localStorage.getItem(h),Yt=()=>{localStorage.removeItem(h);},Jt=e=>{localStorage.setItem(be,JSON.stringify(e));},I=()=>{let e=localStorage.getItem(be);if(!e)return null;try{return JSON.parse(e)}catch{return null}},jt=()=>{let e=I();return e?Se(e?.segments,e?.active_segment_id,e?.active_segments):null},qt=()=>{let e=I();return e?e?.active_segments.find(t=>t.id===e.active_segment_id):null},Ke=()=>{let e=A();if(!e)return true;try{let[,t]=e.split(".");if(!t)return !0;let r=t.replace(/-/g,"+").replace(/_/g,"/"),n=r.padEnd(Math.ceil(r.length/4)*4,"="),{exp:o}=JSON.parse(atob(n));return typeof o!="number"?!0:Date.now()>=o*1e3}catch{return true}},Xt=()=>!Ke()&&!!I(),Zt=(e,t)=>{localStorage.setItem(`${S}-${e}`,t);},Qt=e=>localStorage.getItem(`${S}-${e}`),er=e=>{localStorage.removeItem(`${S}-${e}`);},tr=e=>{localStorage.setItem(E,JSON.stringify(e));},rr=e=>{localStorage.setItem(b,JSON.stringify(e));},nr=()=>{try{let e=localStorage.getItem(E);return e?JSON.parse(e):null}catch{return null}},or=()=>{try{let e=localStorage.getItem(b);return e?JSON.parse(e):null}catch{return null}},sr=()=>{localStorage.removeItem(E);},ir=()=>{localStorage.removeItem(b);},ar=e=>{localStorage.setItem(_,e);},cr=()=>localStorage.getItem(_)||"default",lr=()=>{localStorage.removeItem(_);},ur=e=>localStorage.setItem(_e,JSON.stringify(e)),dr=()=>JSON.parse(localStorage.getItem(_e)||"{}"),pr=e=>{try{localStorage.setItem(w,JSON.stringify(e));}catch(t){console.warn("Failed to save preview cache:",t);}},mr=()=>{try{let e=localStorage.getItem(w);return e?JSON.parse(e):[]}catch{return []}},gr=()=>{try{localStorage.removeItem(w);}catch(e){console.warn("Failed to remove preview storage:",e);}},fr=(e,t,r)=>{try{return JSON.parse(localStorage.getItem(C)??"{}")?.[e]?.[t]?.[r]?.selectedViewId??null}catch{return null}},xr=(e,t,r,n)=>{try{let o=JSON.parse(localStorage.getItem(C)??"{}");localStorage.setItem(C,JSON.stringify({...o,[e]:{...o[e],[t]:{...o[e]?.[t],[r]:{...o[e]?.[t]?.[r],selectedViewId:n}}}}));}catch{return null}},Ae=()=>{localStorage.clear();};var Je={headers:{"Content-Type":"application/json",Accept:"application/json"}},O=Ye.create({baseURL:Kn$1,headers:{...Je}}),je=["users/switch-segment","users/update-segment"];O.interceptors.request.use(e=>new Promise(t=>{let r=false;if(je.includes(e.url??"")){t(e);return}let n=s=>{let i=s.data;if(i==="network_request_waiting"){r=true;return}i==="resume_network_request"&&(r=false);};window.addEventListener("message",n);let o=setInterval(()=>{r||(t(e),clearInterval(o),window.removeEventListener("message",n));},0);}));O.interceptors.request.use(e=>{e.headers.Authorization=A();let t=we();return t&&!e.headers["x-test-secret"]&&(e.headers["x-test-secret"]=t),e});O.interceptors.response.use(e=>e,e=>(e.response?.data?.force_logout&&(Ae(),window.location.href="/login"),Promise.reject(e)));function Er(e){let{sandboxMode:t,fixedSecretKey:r,applicationId:n,serviceId:o,functionId:s,userFunctionId:i,segmentId:a,...l}=e??{};return {...l,live_mode:t?"false":"true",...!!r&&{"x-test-secret":r},...!!n&&{application_id:n},...!!o&&{service_id:o},...!!s&&{function_id:s},...!!i&&{user_function_id:i}}}function _r(e){let r=(e??(typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"")).toLowerCase();if(r.includes("edg"))return "edge";if(r.includes("opr")||r.includes("opera"))return "opera";if(r.includes("chrome")&&!r.includes("edg")&&!r.includes("opr"))return "chrome";if(r.includes("safari")&&!r.includes("chrome"))return "safari";if(r.includes("firefox"))return "firefox";if(r.includes("msie")||r.includes("trident"))return "ie";if(r.includes("tor"))return "tor";if(r.includes("uc"))return "uc";if(r.includes("yandex"))return "yandex"}var wr=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Ar=e=>{let t=e??(typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"");if(!t)return;let r=t.toLowerCase();if(/ipad|tablet|playbook|silk|(android(?!.*mobile))/.test(r))return "TABLET";if(/mobile|iphone|ipod|android.*mobile|blackberry|iemobile|opera mini|windows phone/.test(r))return "MOBILE";if(/desktop|laptop|macintosh|windows|linux|unix|freebsd|openbsd|netbsd|chromeos|solaris|beos|os/.test(r))return "DESKTOP"};function Fr(){let e=["#D6D6D6","#BFF192","#E4EE92","#FDFCAB","#FFE78E","#FFCE6B","#FFBC8C","#FF947C","#C88FA3","#B988C9","#9A8BBB","#89B6FF","#ACD4E1","#ADBABE","#C0DAAA","#D5DA91","#EAE7A2","#DFCE9C","#C9A997","#858585","#000000"];return e[Math.trunc(Math.random()*e.length)]}function Nr(){let e=["linear-gradient(135deg, #31D5C8 0%, #1186C5 100%)","linear-gradient(135deg, #A2E9BD 0%, #44BB74 100%)","linear-gradient(0deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.10) 100%), linear-gradient(135deg, #6BF6EB 0%, #32D6C9 100%)","linear-gradient(135deg, #61AFC9 0%, #7FBFD4 100%)","linear-gradient(135deg, #9DB7A4 0%, #7FBFD4 100%)","linear-gradient(135deg, #D7B38C 0%, #FFE09F 100%)","linear-gradient(135deg, #ADD6A2 0%, #FFDDB2 100%)"];return e[Math.trunc(Math.random()*e.length)]}var Ie={r:0,g:0,b:0,alpha:1},Pr=e=>{try{let t=Oe(e).rgb(),{r,g:n,b:o,alpha:s=1}=t.object();return {value:{r,g:n,b:o,alpha:s},stringified:`rgba(${r},${n},${o},${s})`}}catch(t){console.error(t),console.warn(`Invalid hex color: "${e}". Falling back to black.`);let{r,g:n,b:o,alpha:s}=Ie;return {value:Ie,stringified:`rgba(${r},${n},${o},${s})`}}},Dr=e=>Oe(e).hexa();var kr={fx:"Foreign Exchange",dcc:"Dynamic Currency Conversion"},Le={BHD:3,KWD:3,JOD:3,OMR:3},L=new Map,Br=(e,t)=>{if(Number.isNaN(e))return "0";try{return L.has(t)||L.set(t,new Intl.NumberFormat("en-US",{currency:t,minimumFractionDigits:Le[t]?3:2})),L.get(t).format(e)}catch(r){return console.error(r),"0"}},qe=e=>e%1===0,Xe=e=>e%.1===0,Ze=e=>Math.abs(e*10%1)===.1,Ur=(e,t)=>{let r=Le[t],n=e.toString();return Number.isInteger(e)&&qe(e)?n=e.toFixed(r?3:2):Ze(e)?n=`${n}${r?"00":"0"}`:Xe(e)&&(n=`${n}${r?"00":"0"}`),n};function Qe(e,t=2){let r=parseFloat(e.toString());if(isNaN(r)){let[a,l]=0 .toFixed(t).split("."),u=`${a}.${l}`;return {integerAmount:a,decimalAmount:l,fullAmount:u}}let n=r.toFixed(t),[o,s]=n.split("."),i=parseInt(o).toLocaleString();return {integerAmount:i,decimalAmount:s,fullAmount:`${i}.${s}`}}function Mr(e=0,t=""){return Qe(e,ro$1[t]?.decimals??2)}function Vr(e){let t=e.request.currency,r=e.select.currency,n=e.merchant.currency,o=r!==n&&r===t&&t&&n&&r,s=r!==t&&t&&n&&r,i=o?"fx":void 0;i=s?"dcc":i;let a=o?e.merchant:void 0;return a=s?e.request:a,{type:i,shownAmount:a}}var Wr=e=>typeof e=="number"?e:Number(e.replace(/,/g,""));var et=new Intl.DisplayNames(["en"],{type:"region"});function Fe(e){try{return et.of(e)}catch(t){console.error(t?.response?.data?.error?.message);}}function Hr(e){return e==="SA"}function Gr(e){return e==="OM"}var Jr=(e,t)=>{let{isFirst:r,isLast:n}=t||{};return `${(e+0)/898*100}%`},jr=({table:e,cellID:t,tableMode:r})=>{switch(e){case "charge":return Wn$1[t][r];case "refund":return _do[t][r];case "authorization":return Vn$1[t][r];case "intents":return Yn$1[t][r];case "topups":return fo[t][r];case "destinations":return Xn$1[t][r];case "leads":return _n$1[t][r];case "orders":return $n$1[t][r];case "tokens":return eo[t][r];case "payouts":return ao$1[t][r];case "protectCharges":return co[t][r];case "protectAuthorizations":return bo[t][r];case "wallet":return go$1[t][r];case "invoices":return Zn[t][r];case "authentications":return Un$1[t][r];case "walletDetails":return ho$1[t][r];case "walletStatement":return io$1[t][r];case "merchants":return jo$1[t][r];case "terminals":return ko$1[t][r];case "orchestrationTerminals":return lo[t][r];case "orchestrationRouting":return mo$1[t][r];default:return "100px"}},qr=(e,t)=>{let r,n=window.innerHeight-24-264;return e?r=window.innerHeight/1.7:t?r=n-100:r=n-20,Math.floor(r/(e||t?52:70))},tt=()=>{let e=window.innerHeight*.82/1.24-57;return Math.floor(e/70)},Xr=e=>{let t=tt();return e<t+1},Zr=e=>e==="default",Qr=e=>e==="sheet",en=()=>({charge:{prefixes:["chg_","payout_","settlement_","terminal_"],accessor:e=>[e.id,e.capture?.charge?.map(t=>t.id),e.charge?.id,e.transactions?.map(t=>t.id),e.charge_id],label:"Charge",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.charges.code,icon:"capture"},authorize:{prefixes:["auth_"],keys:["id","authorize.id","source.id","charge.source.id"],label:"Authorization",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.authorization.code,icon:"capture"},intents:{prefixes:["intent_"],keys:[],label:"Intents",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.intents.code,icon:"capture"},refunds:{prefixes:["re_","payout_"],accessor:e=>[e?.refunds?.refund?.map(t=>t.id),e?.id,...e?.refunds?.length?[e?.refunds?.map(t=>t.id)]:[]],label:"Refunds",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.refunds.code,icon:"refund"},authentication:{prefixes:["auth_payer_"],keys:["authentication.id"],label:"Authentication",appCode:Fn$1.authentication.code,serviceCode:Fn$1.authentication.services.authentication.code,icon:"capture"},order:{prefixes:["order_","ord_"],keys:["order.id"],label:"Order",appCode:Fn$1.order.code,serviceCode:Fn$1.order.services.orders.code,icon:"capture"},chargeFlags:{prefixes:["flag_"],accessor:e=>e?.flags?.flag?.map(t=>t.id),label:"Flags",appCode:Fn$1.protect.code,serviceCode:Fn$1.protect.services.chargesFlags.code,icon:"flag"},authorizationFlags:{prefixes:["flag_"],accessor:e=>e?.flags?.flag?.map(t=>t.id),label:"Flags",appCode:Fn$1.protect.code,serviceCode:Fn$1.protect.services.authorizationsFlags.code,icon:"flag"},token:{prefixes:["tok_"],keys:["source.id"],label:"Token",appCode:Fn$1.tokens.code,serviceCode:Fn$1.tokens.services.tokens.code,icon:"capture"},destination:{prefixes:["trf_","payout_"],accessor:e=>[e?.destinations?.destination?.map(t=>t?.transfer?.id),e?.id],label:"Destination",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.destinations.code,icon:"destination"},payout:{prefixes:["payout_"],keys:["balance.payout.id"],label:"Payout",appCode:Fn$1.payouts.code,serviceCode:Fn$1.payouts.services.payouts.code,icon:"capture"},settlement:{prefixes:["settlement_"],keys:["settlement.id"],label:"Settlement",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.settlements.code,icon:"capture"},intent:{prefixes:["intent_"],keys:["intent.id"],label:"Intent",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.intents.code,icon:"capture"},topup:{prefixes:["topup_"],keys:["topup.id"],label:"Topup",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.topups.code,icon:"capture"}});var on=e=>typeof e=="string"&&e.trim().length>0,N=(e,t)=>{if(!t)return e;let r=e.indexOf(t);return e.substring(r+t.length)},F=new Map,P=(e,t)=>(F.has(t)||F.set(t,new RegExp(t,"gi")),e.match(F.get(t))?.length??0),sn=e=>e.reduce((t,r)=>(t.push(r[0]),t),[]),an=()=>crypto?.randomUUID?.()||Math.random().toString(36).substring(2,15),cn=e=>{if(navigator.clipboard)navigator.clipboard.writeText(e);else {let t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove();}},ln=e=>typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1),un=e=>{let[t]=e.split("%");return parseFloat(t)||0},dn=e=>`\u2022\u2022\u2022 ${e.slice(-4)}`,pn=(e,t=/_/g,r=" ")=>{let n=e.replace(t,r);return Ne(n)},mn=e=>ke(Ne(e));var fn=(e,t)=>!e?.last_four||!t?"":`${t?.toLowerCase()} - ${e?.last_four}`,xn=(e,t)=>!t||!e?"":`${e?.toLowerCase()||"ID"} \u2022 ${t?.slice(-4)}`;function Cn({unCapturedCode:e,unCapturedMessage:t,acquirerCode:r,acquirerMessage:n,gatewayCode:o,gatewayMessage:s}){let i=e&&t&&`${e} - ${t}`,a=r&&n&&`${r} - ${n}`,l=o&&s&&`${o} - ${s}`;return {unCapturedTooltip:i,acquirerTooltip:a,gatewayTooltip:l}}function hn(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var D=e=>e==null||e==="";function Sn(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>Array.isArray(t)?t.length>0&&t?.some(r=>!D(r)):typeof t=="object"?Object.values(t||{}).some(r=>!D(r)):!D(t)))}var _n=()=>Nn===On.TAPSTERS_FRONTEND;var An=e=>e.replace(/[^0-9]/g,"");function Fn({rowData:e,prefixes:t,keys:r=[],accessor:n}){let o=!!n;return (o?n?.(e):r)?.filter(Boolean)?.reduce((a,l)=>{let u=o?l:Te(e,l);return typeof u=="string"&&t?.some(p=>u.includes(p)&&P(N(u,p),"_")===0)&&a.push(u),Array.isArray(u)&&u.length>0&&u.every(p=>typeof p=="string"&&t?.some(m=>p.includes(m)&&P(N(p,m),"_")===0))&&a.push(...u),a},[])}var Pn=450,Dn=600;var Rn=3;var vn=20,ot=(r=>(r.Index="index",r.Date="date",r))(ot||{}),kn={name:"index",label:"",selected:true,menuItems:void 0,order:0,pinned:"start",isDefaultPinned:true,pinnable:true},Bn={name:"date",label:"Date",selected:true,menuItems:void 0,order:1,pinned:"start",isDefaultPinned:true,pinnable:true},Un={date:"Date",index:"Index"},Mn={sheet:["sheet"],default:["advanced","default"],text:["text"]},$n={sheet:"Advanced",default:"Sheet",text:"text"},st={id:"default",label:"Default"},Vn={id:"custom",label:"Custom view"},Wn=[st];function Kn(e,t,r){return e.filter(n=>{let o=n?.id?.toString(),s=t.find(m=>{let $e=m.code?.toLowerCase()===o?.toLowerCase(),Ve=m.name?.toLowerCase()===o?.toLowerCase();return ($e||Ve)&&m.selected}),i=!!n.tableViewId&&(s?.menuItems?.length||0)>0,a=s?.menuItems?.find(m=>m.name?.toLowerCase()===n.tableViewId?.toString()?.toLowerCase())?.selected,l=!!s&&(a||!i),p=["actions","action_icon",...r?["index","date"]:[]].includes(o?.toLowerCase()??"");return !!(l||p)})}function Yn(e,t){if(t.toLowerCase()==="index")return 0;let r=e.findIndex(o=>o.code?.toLowerCase()===t?.toLowerCase()),n=e[r];return r>=0?n?.sort_order??r:999}function Jn(e,t,r){return e?.find(n=>{let o=n.code?.toLowerCase()===t.toLowerCase(),s=n.name?.toLowerCase()===t.toLowerCase();return o||s})?.menuItems?.find(n=>n.name?.toLowerCase()===r.toLowerCase()&&n.selected)?.selected||false}function jn(e,t){return e?.filter(r=>!!r.name?.[0]?.text)?.map(r=>({code:r.code,label:f(r.name,t),name:f(r.name,t)||"",selected:r?.selected!==false,sort_order:r.sort_order,menuItems:r.fields?.map(n=>n.parameters?.filter(o=>!!o.code)?.map(o=>({code:o.code,label:Ne(o.code),name:`${o.code}`,selected:o?.selected!==false})))?.flat()?.filter(n=>!!n.name)}))||[]}function qn(e){return e.map(t=>({...t.code?{code:t.code}:{},name:[{text:t.name,lang:"en"}],selected:t.selected,sort_order:1,sorting:"descending",fields:t.menuItems?.map(r=>({code:r.name,type:"single",parameters:[{parameter:r.name,code:r.name,selected:r.selected}]}))||[]}))}var Xn=({columnsView:e,columnsIds:t,selected:r})=>{let n=new Set(t.map(s=>s?.toLowerCase())),o=s=>({...s,selected:r,fields:s.fields?.map(i=>({...i,parameters:i.parameters?.map(a=>({...a,selected:r}))??[]}))});return e.map(s=>n.has(s.code?.toLowerCase()??"")||n.has(s.name?.[0]?.text?.toLowerCase()??"")?o(s):s)};function Qn(e){return {fullPhone:e?.number?`${e?.country_code||""} ${e?.number}`:"",code:e?.country_code||"",number:e?.number||""}}var Pe=(e,t)=>{let r=e.type==="url"?e.url:window.URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=r,n.setAttribute("download",t),document.body.appendChild(n),n.click(),n.remove(),e.type==="content"&&window.URL.revokeObjectURL(r);},to=(e,t)=>Pe({type:"content",content:e},t),ro=(e,t)=>Pe({type:"url",url:e},t);var at=e=>!!(e?.isAxiosError&&!e?.response),oo=(e,t="")=>e?.response?.data?.error?.message?.trim()||t,so=e=>!!e,ct=e=>(e?.code==="ECONNABORTED"||e?.message?.toLowerCase().includes("timeout"))??false,io=e=>!!(e?.response?.status===404||e?.response?.status===400&&e?.response?.data?.error?.message?.toLowerCase().includes("not found")),x=({code:e,message:t})=>e?`${t} - ${e}`:t,ao=({error:e,fallbackMessage:t})=>{if(at(e)){let n=t??"networkError";return {code:null,message:n,formatted:x({code:null,message:n})}}if(ct(e)){let n=t??"yourRequestOutPleaseTryAgain";return {code:null,message:n,formatted:x({code:null,message:n})}}if(e?.response&&typeof e.response.data=="object"&&"error"in e.response.data){let{code:n,message:o}=e.response.data.error;return {code:n,message:o,formatted:x({code:n,message:o})}}let r=t??"somethingWentWrong";return {code:null,message:r,formatted:x({code:null,message:r})}};var uo=()=>["passport","national_id","iqamah","civil_id"].map(e=>({id:e,label:Ne(e)}));function mo(e,t=2){let n=e??0;if(!n)return "0 kb";let o=n/1024;return o>1024?`${(o/1024).toFixed(t)} mb`:`${o.toFixed(t)} kb`}function ut(e){return e?.file?.size!==void 0&&e?.file?.name!==void 0}function dt(e,t){return e.name===t.name&&e.size===t.size}function go(e,t){return t?.length?t.some(r=>ut(r)?dt(r.file,e):r.name===e.name):false}var yo=e=>{let t=e?.split(".").pop()?.toLowerCase()??"";return cp[t]??Ye$1},Co=(e,t,r)=>`${e}-${t}-${r}`;var ho=e=>e?/[\u0600-\u06FF]/g.test(e):false;function So(e,t="en"){return (e||[]).find(r=>(r?.lang||r?.locale)===t)||e?.[0]}var f=(e,t="en")=>(e||[]).find(r=>r?.lang===t)?.text,Eo=(e,t="en")=>(e||[]).find(r=>r?.lang===t);var _o=e=>{let t=e?.wallet==="SV Wallet"?"walletStoredValue":"walletPassThru";return e?.type==="Wallet"?t:e?.type},pt={AMERICAN_EXPRESS:"AMEX"},De=e=>pt[e.toUpperCase()]??e.toUpperCase(),wo=(e,t)=>!!e&&!!t&&De(e)===De(t);var Io=e=>({Local:e.success.light,Regional:e.info.light,Global:e.warning.light});var Fo=(e,t)=>{if(t==null)return "";let r=Do$1[e];return e===Co$1.COUNT?t===1?r:`${r}s`:r};var d={primary:"#1F88D0",background:"white",border:"#F2F2F2",transparent:"transparent"},g={thin:"0.5px",thick:"1px",none:"0px"},Re={minHeight:"28px",fullHeight:"100%"},Po=({isSelected:e,isCellSelected:t,isColumnSelected:r,isRowSelected:n,isLastRow:o})=>e?n?mt():t&&!r?gt():r?ft(o):{}:{},mt=()=>({backgroundColor:d.background,color:d.primary}),gt=()=>({border:`${g.thin} solid ${d.primary}`,backgroundColor:d.background,color:d.primary,borderRadius:"2px"}),ft=e=>{let t=xt(),r=yt(e);return {borderWidth:t,borderStyle:"solid",borderColor:d.primary,borderBottom:r,height:Re.fullHeight,minHeight:Re.minHeight,display:"flex",alignItems:"center"}},xt=()=>{let{none:e,thin:t}=g;return `${e} ${t} ${t} ${t}`},yt=e=>e?`${g.thick} solid ${d.primary}`:`${g.thin} solid ${d.border}`,Do=({effectiveFirst:e,isPinnedStart:t,isPinnedEnd:r})=>({borderTop:`${g.thin} solid ${d.primary}`,borderBottom:`${g.thin} solid ${d.primary}`,borderRight:`${g.thin} solid ${r?d.primary:"none"}`,borderLeft:`${g.thin} solid ${t&&e?d.primary:"transparent"}`}),Ro={left:"flex-start",center:"center",right:"flex-end"};function vo(e,t){if(t==null)return e;let r=n=>Array.isArray(n)?n:[n];return [...r(e),...r(t)]}function ko(...e){return e.filter(Boolean).join(" ")||void 0}var R=v("SA",po,oo$1);function v(e,t,r){let n=getTimezone(r);return n?{countryCode:e,label:`(GMT${n.utcOffsetStr}) ${Fe(e)??t}`,timezone:r,offset:n.utcOffset/60}:R}var ht=e=>{let t=getCountry(e),r=t?.timezones[0];if(!(!t||!r))return v(e,t.name,r)},Vo=e=>ht(e)??R,Wo=e=>{let t=getCountryForTimezone(e),r=getTimezone(e);return !t||!r?R:v(t.id,t.name,e)};function Jo(e){return {name:"Payment Methods",type:"payment_methods",options:e?.map(t=>({name:ke(Ne(f(t?.name))),type:t?.code,icon:Eo$1[t.code]??Eo$1.CARD,options:t.payment_methods?.map(r=>({name:f(r.name),type:r.code}))}))}}function jo(e=[]){return {name:"Payment Schemes",type:"payment_scheme",options:e.filter(t=>t.code).map(t=>({name:ke(Ne(f(t?.name))),type:t?.code}))}}var Ue=["120px","180px","100px","150px","200px","140px","160px","110px","190px","130px"],St={id:"index",header:"",width:"34px",order:0,hidden:false,sortable:false,pinned:"start",isDefaultPinned:true,pinnable:true},Et={id:"date",header:"",width:"120px",order:1,hidden:false,sortable:false,pinned:"start",isDefaultPinned:true,pinnable:true},bt={id:"action_icon",header:"",width:"36px",order:Ue.length+3,hidden:false,sortable:false,pinned:"end",pinnable:true,isDefaultPinned:true},_t=(e=Ue)=>{let t=e.map((r,n)=>({id:`skeleton-col-${n}`,header:"",width:r,order:n+2,hidden:false,sortable:false,pinnable:false}));return [St,Et,...t,bt]},Xo=(e,t,r)=>r&&t?_t():[...e];var Qo=(e,t)=>e.map(r=>{let n=Object.entries(t);if(!r.default||!r.layout?.length||!n.length)return r;let o=new Map(n.map(([i,a])=>[i.toLowerCase(),a])),s=r.layout.map(i=>({...i,columns:i.columns?.map(a=>{let l=a.code?.toLowerCase();if(!l||!o.has(l))return a;let u=o.get(l)??false;return {...a,default:u,fields:a.fields?.map(p=>({...p,default:u}))}})}));return {...r,layout:s}});var rs=(e,t)=>t.some(r=>!!e[r]),ns=(e,t,r)=>t?e:e.map(n=>{if(r.hiddenFilterColumnIds.includes(n.id)){let{filter:s,...i}=n,a=n.id,l=typeof i.header=="function"?Ne(a):i.header;return {...i,header:l}}let{hiddenFilterOptionKeys:o}=r;if(o&&n.filter&&"options"in n.filter&&n.filter.options){let s=n.filter.options,i=s.filter(a=>!a.apiKey||!o.includes(a.apiKey));if(i.length!==s.length)return {...n,filter:{...n.filter,options:i}}}return n});typeof window<"u"&&Me.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer");});var At={USE_PROFILES:{html:true},ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|blob):|[^a-z]|[-a-z.+]+(?:[^-a-z.+:]|$))/i,WHOLE_DOCUMENT:true},is=e=>typeof window>"u"?"":String(Me.sanitize(e||"",At));var cs=e=>window?.__TAPOS_NEWRELIC_TRACKING_EVENTS__?.trackFeatureEvent?.(e),ls=e=>e.toISOString();function ds(e,t){let r=e.replace(/:/g,"");return t?`${t}-${r}`:r}function It(e){return e!=null&&e!==""}function ms(e,t){let r=e!=null,n=t&&"message"in t?t.message:e?.message,o=It(n);return {isProvided:r,isVisible:o,type:o?e?.type:void 0}}export{Br as $,Xn as $a,rr as A,fn as Aa,Po as Ab,nr as B,xn as Ba,Do as Bb,or as C,Cn as Ca,Ro as Cb,sr as D,hn as Da,vo as Db,ir as E,D as Ea,ko as Eb,ar as F,Sn as Fa,Vo as Fb,cr as G,_n as Ga,Wo as Gb,lr as H,An as Ha,Jo as Hb,ur as I,Fn as Ia,jo as Ib,dr as J,Pn as Ja,Ue as Jb,pr as K,Dn as Ka,_t as Kb,mr as L,Rn as La,Xo as Lb,gr as M,vn as Ma,Qo as Mb,fr as N,ot as Na,rs as Nb,xr as O,kn as Oa,ns as Ob,Ae as P,Bn as Pa,is as Pb,O as Q,Un as Qa,cs as Qb,Er as R,Mn as Ra,ls as Rb,_r as S,$n as Sa,ds as Sb,wr as T,st as Ta,It as Tb,Ar as U,Vn as Ua,ms as Ub,Fr as V,Wn as Va,Nr as W,Kn as Wa,Pr as X,Yn as Xa,Dr as Y,Jn as Ya,kr as Z,jn as Za,Le as _,qn as _a,Ft as a,Ur as aa,Qn as ab,Nt as b,Qe as ba,Pe as bb,Pt as c,Mr as ca,to as cb,Dt as d,Vr as da,ro as db,Se as e,Wr as ea,at as eb,ze as f,Fe as fa,oo as fb,He as g,Hr as ga,so as gb,Bt as h,Gr as ha,ct as hb,Wt as i,Jr as ia,io as ib,we as j,jr as ja,ao as jb,zt as k,qr as ka,uo as kb,Ht as l,Xr as la,mo as lb,Gt as m,Zr as ma,ut as mb,Kt as n,Qr as na,dt as nb,A as o,en as oa,go as ob,Yt as p,on as pa,yo as pb,Jt as q,N as qa,Co as qb,I as r,P as ra,ho as rb,jt as s,sn as sa,So as sb,qt as t,an as ta,f as tb,Ke as u,cn as ua,Eo as ub,Xt as v,ln as va,_o as vb,Zt as w,un as wa,wo as wb,Qt as x,dn as xa,Io as xb,er as y,pn as ya,Fo as yb,tr as z,mn as za,d as zb};
|
|
1
|
+
import {Kn as Kn$1,oo as oo$1,po,Fn as Fn$1,Mn as Mn$1,ro as ro$1,mo as mo$1,lo,ko as ko$1,jo as jo$1,io as io$1,ho as ho$1,Un as Un$1,Zn,go as go$1,bo,co,ao as ao$1,eo,$n as $n$1,_n as _n$1,Xn as Xn$1,fo,Yn as Yn$1,Vn as Vn$1,do as _do,Wn as Wn$1,Nn,On,cp,Ye as Ye$1,Do as Do$1,Co as Co$1,Eo as Eo$1}from'./chunk-TF7BQNJV.js';import We from'lodash/orderBy';import Te from'lodash/get';import Ye from'axios';import Ge from'lodash/forOwn';import Oe from'color';import ke from'lodash/capitalize';import Ne from'lodash/startCase';import {getTimezone,getCountryForTimezone,getCountry}from'countries-and-timezones';import Me from'dompurify';function Ft({list:e,sortBy:t,orders:r}){return t?.length&&r?.length?We(e,t,r):e}var Nt=(e=[],t)=>e.length?e.sort((r,n)=>Te(r,t).localeCompare(Te(n,t))):[];function Pt(e){return (e||[]).filter(t=>!!t)}var Dt=(e,t)=>[...new Map(e.map(r=>[r[t],r])).values()];var he=e=>{let r=e.reduce((n,o)=>{let s=o.entities?.find(i=>i.default);return s&&n.push({entityId:s.id,country:o}),n},[])[0]?.country||e[0];return e.find(n=>n.id===r?.id)};var Se=(e,t,r)=>{let n=e.find(a=>a.id===t)??{},o=r.find(a=>a.id===t)??{},s=o.countries.length===1?n.countries.find(a=>a.id===o.countries?.[0].id):he(n?.countries),i=s?.entities?.find(a=>a.default);return {...n,defaultCountry:s,defaultEntity:i}},ze=({merchantsIds:e,options:t})=>!e||!e?.length?{}:{business:{merchant:e,...t}},He=e=>["payment_facilitator_14po8231419aIsi1fN7F385"].includes(e),Bt=({segmentCode:e,segmentId:t,segmentTypeCode:r,merchantsIds:n=[],options:o={}})=>{let s="PSP"===r?e:r;return He(t)?ze({merchantsIds:n,options:o}):s==="PAYMENT_TECHNOLOGY"?{payment_provider:{technology:{orchestrator:[t],...o}}}:s==="PAYMENT_GATEWAY"||s==="PAYMENT_GATEWAY_PROVIDER"?{payment_provider:{technology:{gateway:[t],...o}}}:s==="PAYMENT_FACILITATOR"?{payment_provider:{institution:{facilitator:[t],...o}}}:s==="PAYMENT_ACQUIRER"?{payment_provider:{institution:{acquirer:[t],...o}}}:s==="PLATFORM"?{platform:[t],...o}:s==="DEVELOPMENT"?{development_agency:[t],...o}:{}};var Ee="Test_Fixed_Secret_Key",T="tap-dashboard-navigation-data",be="tap-dashboard-user-data",h="tap-dashboard-user-jwt",S="tap-dashboard-report",E="tap-dashboard-calender-timezone",b="tap-dashboard-calender-timezone-history",_="tap-dashboard-global-table-mode",_e="sheetview_columns",w="dock-preview-windows",C="views";function Wt(){localStorage.setItem(Ee,Mn$1);}function we(){return localStorage.getItem(Ee)}function zt(e){localStorage.setItem(T,JSON.stringify(e));}function Ht(){try{let e=localStorage.getItem(T);if(!e)return null;let t=JSON.parse(e);return Ge(t,r=>{r?.forEach(n=>{n.payload&&n.payload.dateRange&&(n.payload.dateRange=n.payload.dateRange.map(o=>new Date(o)));});})}catch{return null}}function Gt(){localStorage.removeItem(T);}var Kt=e=>{localStorage.setItem(h,e);},A=()=>localStorage.getItem(h),Yt=()=>{localStorage.removeItem(h);},Jt=e=>{localStorage.setItem(be,JSON.stringify(e));},I=()=>{let e=localStorage.getItem(be);if(!e)return null;try{return JSON.parse(e)}catch{return null}},jt=()=>{let e=I();return e?Se(e?.segments,e?.active_segment_id,e?.active_segments):null},qt=()=>{let e=I();return e?e?.active_segments.find(t=>t.id===e.active_segment_id):null},Ke=()=>{let e=A();if(!e)return true;try{let[,t]=e.split(".");if(!t)return !0;let r=t.replace(/-/g,"+").replace(/_/g,"/"),n=r.padEnd(Math.ceil(r.length/4)*4,"="),{exp:o}=JSON.parse(atob(n));return typeof o!="number"?!0:Date.now()>=o*1e3}catch{return true}},Xt=()=>!Ke()&&!!I(),Zt=(e,t)=>{localStorage.setItem(`${S}-${e}`,t);},Qt=e=>localStorage.getItem(`${S}-${e}`),er=e=>{localStorage.removeItem(`${S}-${e}`);},tr=e=>{localStorage.setItem(E,JSON.stringify(e));},rr=e=>{localStorage.setItem(b,JSON.stringify(e));},nr=()=>{try{let e=localStorage.getItem(E);return e?JSON.parse(e):null}catch{return null}},or=()=>{try{let e=localStorage.getItem(b);return e?JSON.parse(e):null}catch{return null}},sr=()=>{localStorage.removeItem(E);},ir=()=>{localStorage.removeItem(b);},ar=e=>{localStorage.setItem(_,e);},cr=()=>localStorage.getItem(_)||"default",lr=()=>{localStorage.removeItem(_);},ur=e=>localStorage.setItem(_e,JSON.stringify(e)),dr=()=>JSON.parse(localStorage.getItem(_e)||"{}"),pr=e=>{try{localStorage.setItem(w,JSON.stringify(e));}catch(t){console.warn("Failed to save preview cache:",t);}},mr=()=>{try{let e=localStorage.getItem(w);return e?JSON.parse(e):[]}catch{return []}},gr=()=>{try{localStorage.removeItem(w);}catch(e){console.warn("Failed to remove preview storage:",e);}},fr=(e,t,r)=>{try{return JSON.parse(localStorage.getItem(C)??"{}")?.[e]?.[t]?.[r]?.selectedViewId??null}catch{return null}},xr=(e,t,r,n)=>{try{let o=JSON.parse(localStorage.getItem(C)??"{}");localStorage.setItem(C,JSON.stringify({...o,[e]:{...o[e],[t]:{...o[e]?.[t],[r]:{...o[e]?.[t]?.[r],selectedViewId:n}}}}));}catch{return null}},Ae=()=>{localStorage.clear();};var Je={headers:{"Content-Type":"application/json",Accept:"application/json"}},O=Ye.create({baseURL:Kn$1,headers:{...Je}}),je=["users/switch-segment","users/update-segment"];O.interceptors.request.use(e=>new Promise(t=>{let r=false;if(je.includes(e.url??"")){t(e);return}let n=s=>{let i=s.data;if(i==="network_request_waiting"){r=true;return}i==="resume_network_request"&&(r=false);};window.addEventListener("message",n);let o=setInterval(()=>{r||(t(e),clearInterval(o),window.removeEventListener("message",n));},0);}));O.interceptors.request.use(e=>{e.headers.Authorization=A();let t=we();return t&&!e.headers["x-test-secret"]&&(e.headers["x-test-secret"]=t),e});O.interceptors.response.use(e=>e,e=>(e.response?.data?.force_logout&&(Ae(),window.location.href="/login"),Promise.reject(e)));function Er(e){let{sandboxMode:t,fixedSecretKey:r,applicationId:n,serviceId:o,functionId:s,userFunctionId:i,segmentId:a,...l}=e??{};return {...l,live_mode:t?"false":"true",...!!r&&{"x-test-secret":r},...!!n&&{application_id:n},...!!o&&{service_id:o},...!!s&&{function_id:s},...!!i&&{user_function_id:i}}}function _r(e){let r=(e??(typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"")).toLowerCase();if(r.includes("edg"))return "edge";if(r.includes("opr")||r.includes("opera"))return "opera";if(r.includes("chrome")&&!r.includes("edg")&&!r.includes("opr"))return "chrome";if(r.includes("safari")&&!r.includes("chrome"))return "safari";if(r.includes("firefox"))return "firefox";if(r.includes("msie")||r.includes("trident"))return "ie";if(r.includes("tor"))return "tor";if(r.includes("uc"))return "uc";if(r.includes("yandex"))return "yandex"}var wr=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Ar=e=>{let t=e??(typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"");if(!t)return;let r=t.toLowerCase();if(/ipad|tablet|playbook|silk|(android(?!.*mobile))/.test(r))return "TABLET";if(/mobile|iphone|ipod|android.*mobile|blackberry|iemobile|opera mini|windows phone/.test(r))return "MOBILE";if(/desktop|laptop|macintosh|windows|linux|unix|freebsd|openbsd|netbsd|chromeos|solaris|beos|os/.test(r))return "DESKTOP"};function Fr(){let e=["#D6D6D6","#BFF192","#E4EE92","#FDFCAB","#FFE78E","#FFCE6B","#FFBC8C","#FF947C","#C88FA3","#B988C9","#9A8BBB","#89B6FF","#ACD4E1","#ADBABE","#C0DAAA","#D5DA91","#EAE7A2","#DFCE9C","#C9A997","#858585","#000000"];return e[Math.trunc(Math.random()*e.length)]}function Nr(){let e=["linear-gradient(135deg, #31D5C8 0%, #1186C5 100%)","linear-gradient(135deg, #A2E9BD 0%, #44BB74 100%)","linear-gradient(0deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.10) 100%), linear-gradient(135deg, #6BF6EB 0%, #32D6C9 100%)","linear-gradient(135deg, #61AFC9 0%, #7FBFD4 100%)","linear-gradient(135deg, #9DB7A4 0%, #7FBFD4 100%)","linear-gradient(135deg, #D7B38C 0%, #FFE09F 100%)","linear-gradient(135deg, #ADD6A2 0%, #FFDDB2 100%)"];return e[Math.trunc(Math.random()*e.length)]}var Ie={r:0,g:0,b:0,alpha:1},Pr=e=>{try{let t=Oe(e).rgb(),{r,g:n,b:o,alpha:s=1}=t.object();return {value:{r,g:n,b:o,alpha:s},stringified:`rgba(${r},${n},${o},${s})`}}catch(t){console.error(t),console.warn(`Invalid hex color: "${e}". Falling back to black.`);let{r,g:n,b:o,alpha:s}=Ie;return {value:Ie,stringified:`rgba(${r},${n},${o},${s})`}}},Dr=e=>Oe(e).hexa();var kr={fx:"Foreign Exchange",dcc:"Dynamic Currency Conversion"},Le={BHD:3,KWD:3,JOD:3,OMR:3},L=new Map,Br=(e,t)=>{if(Number.isNaN(e))return "0";try{return L.has(t)||L.set(t,new Intl.NumberFormat("en-US",{currency:t,minimumFractionDigits:Le[t]?3:2})),L.get(t).format(e)}catch(r){return console.error(r),"0"}},qe=e=>e%1===0,Xe=e=>e%.1===0,Ze=e=>Math.abs(e*10%1)===.1,Ur=(e,t)=>{let r=Le[t],n=e.toString();return Number.isInteger(e)&&qe(e)?n=e.toFixed(r?3:2):Ze(e)?n=`${n}${r?"00":"0"}`:Xe(e)&&(n=`${n}${r?"00":"0"}`),n};function Qe(e,t=2){let r=parseFloat(e.toString());if(isNaN(r)){let[a,l]=0 .toFixed(t).split("."),u=`${a}.${l}`;return {integerAmount:a,decimalAmount:l,fullAmount:u}}let n=r.toFixed(t),[o,s]=n.split("."),i=parseInt(o).toLocaleString();return {integerAmount:i,decimalAmount:s,fullAmount:`${i}.${s}`}}function Mr(e=0,t=""){return Qe(e,ro$1[t]?.decimals??2)}function Vr(e){let t=e.request.currency,r=e.select.currency,n=e.merchant.currency,o=r!==n&&r===t&&t&&n&&r,s=r!==t&&t&&n&&r,i=o?"fx":void 0;i=s?"dcc":i;let a=o?e.merchant:void 0;return a=s?e.request:a,{type:i,shownAmount:a}}var Wr=e=>typeof e=="number"?e:Number(e.replace(/,/g,""));var et=new Intl.DisplayNames(["en"],{type:"region"});function Fe(e){try{return et.of(e)}catch(t){console.error(t?.response?.data?.error?.message);}}function Hr(e){return e==="SA"}function Gr(e){return e==="OM"}var Jr=(e,t)=>{let{isFirst:r,isLast:n}=t||{};return `${(e+0)/898*100}%`},jr=({table:e,cellID:t,tableMode:r})=>{switch(e){case "charge":return Wn$1[t][r];case "refund":return _do[t][r];case "authorization":return Vn$1[t][r];case "intents":return Yn$1[t][r];case "topups":return fo[t][r];case "destinations":return Xn$1[t][r];case "leads":return _n$1[t][r];case "orders":return $n$1[t][r];case "tokens":return eo[t][r];case "payouts":return ao$1[t][r];case "protectCharges":return co[t][r];case "protectAuthorizations":return bo[t][r];case "wallet":return go$1[t][r];case "invoices":return Zn[t][r];case "authentications":return Un$1[t][r];case "walletDetails":return ho$1[t][r];case "walletStatement":return io$1[t][r];case "merchants":return jo$1[t][r];case "terminals":return ko$1[t][r];case "orchestrationTerminals":return lo[t][r];case "orchestrationRouting":return mo$1[t][r];default:return "100px"}},qr=(e,t)=>{let r,n=window.innerHeight-24-264;return e?r=window.innerHeight/1.7:t?r=n-100:r=n-20,Math.floor(r/(e||t?52:70))},tt=()=>{let e=window.innerHeight*.82/1.24-57;return Math.floor(e/70)},Xr=e=>{let t=tt();return e<t+1},Zr=e=>e==="default",Qr=e=>e==="sheet",en=()=>({charge:{prefixes:["chg_","payout_","settlement_","terminal_"],accessor:e=>[e.id,e.capture?.charge?.map(t=>t.id),e.charge?.id,e.transactions?.map(t=>t.id),e.charge_id],label:"Charge",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.charges.code,icon:"capture"},authorize:{prefixes:["auth_"],keys:["id","authorize.id","source.id","charge.source.id"],label:"Authorization",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.authorization.code,icon:"capture"},intents:{prefixes:["intent_"],keys:[],label:"Intents",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.intents.code,icon:"capture"},refunds:{prefixes:["re_","payout_"],accessor:e=>[e?.refunds?.refund?.map(t=>t.id),e?.id,...e?.refunds?.length?[e?.refunds?.map(t=>t.id)]:[]],label:"Refunds",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.refunds.code,icon:"refund"},authentication:{prefixes:["auth_payer_"],keys:["authentication.id"],label:"Authentication",appCode:Fn$1.authentication.code,serviceCode:Fn$1.authentication.services.authentication.code,icon:"capture"},order:{prefixes:["order_","ord_"],keys:["order.id"],label:"Order",appCode:Fn$1.order.code,serviceCode:Fn$1.order.services.orders.code,icon:"capture"},chargeFlags:{prefixes:["flag_"],accessor:e=>e?.flags?.flag?.map(t=>t.id),label:"Flags",appCode:Fn$1.protect.code,serviceCode:Fn$1.protect.services.chargesFlags.code,icon:"flag"},authorizationFlags:{prefixes:["flag_"],accessor:e=>e?.flags?.flag?.map(t=>t.id),label:"Flags",appCode:Fn$1.protect.code,serviceCode:Fn$1.protect.services.authorizationsFlags.code,icon:"flag"},token:{prefixes:["tok_"],keys:["source.id"],label:"Token",appCode:Fn$1.tokens.code,serviceCode:Fn$1.tokens.services.tokens.code,icon:"capture"},destination:{prefixes:["trf_","payout_"],accessor:e=>[e?.destinations?.destination?.map(t=>t?.transfer?.id),e?.id],label:"Destination",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.destinations.code,icon:"destination"},payout:{prefixes:["payout_"],keys:["balance.payout.id"],label:"Payout",appCode:Fn$1.payouts.code,serviceCode:Fn$1.payouts.services.payouts.code,icon:"capture"},settlement:{prefixes:["settlement_"],keys:["settlement.id"],label:"Settlement",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.settlements.code,icon:"capture"},intent:{prefixes:["intent_"],keys:["intent.id"],label:"Intent",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.intents.code,icon:"capture"},topup:{prefixes:["topup_"],keys:["topup.id"],label:"Topup",appCode:Fn$1.acceptance.code,serviceCode:Fn$1.acceptance.services.topups.code,icon:"capture"}});var on=e=>typeof e=="string"&&e.trim().length>0,N=(e,t)=>{if(!t)return e;let r=e.indexOf(t);return e.substring(r+t.length)},F=new Map,P=(e,t)=>(F.has(t)||F.set(t,new RegExp(t,"gi")),e.match(F.get(t))?.length??0),sn=e=>e.reduce((t,r)=>(t.push(r[0]),t),[]),an=()=>crypto?.randomUUID?.()||Math.random().toString(36).substring(2,15),cn=e=>{if(navigator.clipboard)navigator.clipboard.writeText(e);else {let t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove();}},ln=e=>typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1),un=e=>{let[t]=e.split("%");return parseFloat(t)||0},dn=e=>`\u2022\u2022\u2022 ${e.slice(-4)}`,pn=(e,t=/_/g,r=" ")=>{let n=e.replace(t,r);return Ne(n)},mn=e=>ke(Ne(e));var fn=(e,t)=>!e?.last_four||!t?"":`${t?.toLowerCase()} - ${e?.last_four}`,xn=(e,t)=>!t||!e?"":`${e?.toLowerCase()||"ID"} \u2022 ${t?.slice(-4)}`;function Cn({unCapturedCode:e,unCapturedMessage:t,acquirerCode:r,acquirerMessage:n,gatewayCode:o,gatewayMessage:s}){let i=e&&t&&`${e} - ${t}`,a=r&&n&&`${r} - ${n}`,l=o&&s&&`${o} - ${s}`;return {unCapturedTooltip:i,acquirerTooltip:a,gatewayTooltip:l}}function hn(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var D=e=>e==null||e==="";function Sn(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>Array.isArray(t)?t.length>0&&t?.some(r=>!D(r)):typeof t=="object"?Object.values(t||{}).some(r=>!D(r)):!D(t)))}var _n=()=>Nn===On.TAPSTERS_FRONTEND;var An=e=>e.replace(/[^0-9]/g,"");function Fn({rowData:e,prefixes:t,keys:r=[],accessor:n}){let o=!!n;return (o?n?.(e):r)?.filter(Boolean)?.reduce((a,l)=>{let u=o?l:Te(e,l);return typeof u=="string"&&t?.some(p=>u.includes(p)&&P(N(u,p),"_")===0)&&a.push(u),Array.isArray(u)&&u.length>0&&u.every(p=>typeof p=="string"&&t?.some(m=>p.includes(m)&&P(N(p,m),"_")===0))&&a.push(...u),a},[])}var Pn=450,Dn=600;var Rn=3;var vn=20,ot=(r=>(r.Index="index",r.Date="date",r))(ot||{}),kn={name:"index",label:"",selected:true,menuItems:void 0,order:0,pinned:"start",isDefaultPinned:true,pinnable:true},Bn={name:"date",label:"Date",selected:true,menuItems:void 0,order:1,pinned:"start",isDefaultPinned:true,pinnable:true},Un={date:"Date",index:"Index"},Mn={sheet:["sheet"],default:["advanced","default"],text:["text"]},$n={sheet:"Advanced",default:"Sheet",text:"text"},st={id:"default",label:"Default"},Vn={id:"custom",label:"Custom view"},Wn=[st];function Kn(e,t,r){return e.filter(n=>{let o=n?.id?.toString(),s=t.find(m=>{let $e=m.code?.toLowerCase()===o?.toLowerCase(),Ve=m.name?.toLowerCase()===o?.toLowerCase();return ($e||Ve)&&m.selected}),i=!!n.tableViewId&&(s?.menuItems?.length||0)>0,a=s?.menuItems?.find(m=>m.name?.toLowerCase()===n.tableViewId?.toString()?.toLowerCase())?.selected,l=!!s&&(a||!i),p=["actions","action_icon",...r?["index","date"]:[]].includes(o?.toLowerCase()??"");return !!(l||p)})}function Yn(e,t){if(t.toLowerCase()==="index")return 0;let r=e.findIndex(o=>o.code?.toLowerCase()===t?.toLowerCase()),n=e[r];return r>=0?n?.sort_order??r:999}function Jn(e,t,r){return e?.find(n=>{let o=n.code?.toLowerCase()===t.toLowerCase(),s=n.name?.toLowerCase()===t.toLowerCase();return o||s})?.menuItems?.find(n=>n.name?.toLowerCase()===r.toLowerCase()&&n.selected)?.selected||false}function jn(e,t){return e?.filter(r=>!!r.name?.[0]?.text)?.map(r=>({code:r.code,label:f(r.name,t),name:f(r.name,t)||"",selected:r?.selected!==false,sort_order:r.sort_order,menuItems:r.fields?.map(n=>n.parameters?.filter(o=>!!o.code)?.map(o=>({code:o.code,label:Ne(o.code),name:`${o.code}`,selected:o?.selected!==false})))?.flat()?.filter(n=>!!n.name)}))||[]}function qn(e){return e.map(t=>({...t.code?{code:t.code}:{},name:[{text:t.name,lang:"en"}],selected:t.selected,sort_order:1,sorting:"descending",fields:t.menuItems?.map(r=>({code:r.name,type:"single",parameters:[{parameter:r.name,code:r.name,selected:r.selected}]}))||[]}))}var Xn=({columnsView:e,columnsIds:t,selected:r})=>{let n=new Set(t.map(s=>s?.toLowerCase())),o=s=>({...s,selected:r,fields:s.fields?.map(i=>({...i,parameters:i.parameters?.map(a=>({...a,selected:r}))??[]}))});return e.map(s=>n.has(s.code?.toLowerCase()??"")||n.has(s.name?.[0]?.text?.toLowerCase()??"")?o(s):s)};function Qn(e){return {fullPhone:e?.number?`${e?.country_code||""} ${e?.number}`:"",code:e?.country_code||"",number:e?.number||""}}var Pe=(e,t)=>{let r=e.type==="url"?e.url:window.URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=r,n.setAttribute("download",t),document.body.appendChild(n),n.click(),n.remove(),e.type==="content"&&window.URL.revokeObjectURL(r);},to=(e,t)=>Pe({type:"content",content:e},t),ro=(e,t)=>Pe({type:"url",url:e},t);var at=e=>!!(e?.isAxiosError&&!e?.response),oo=(e,t="")=>e?.response?.data?.error?.message?.trim()||t,so=e=>!!e,ct=e=>(e?.code==="ECONNABORTED"||e?.message?.toLowerCase().includes("timeout"))??false,io=e=>!!(e?.response?.status===404||e?.response?.status===400&&e?.response?.data?.error?.message?.toLowerCase().includes("not found")),x=({code:e,message:t})=>e?`${t} - ${e}`:t,ao=({error:e,fallbackMessage:t})=>{if(at(e)){let n=t??"networkError";return {code:null,message:n,formatted:x({code:null,message:n})}}if(ct(e)){let n=t??"yourRequestOutPleaseTryAgain";return {code:null,message:n,formatted:x({code:null,message:n})}}if(e?.response&&typeof e.response.data=="object"&&"error"in e.response.data){let{code:n,message:o}=e.response.data.error;return {code:n,message:o,formatted:x({code:n,message:o})}}let r=t??"somethingWentWrong";return {code:null,message:r,formatted:x({code:null,message:r})}};var uo=()=>["passport","national_id","iqamah","civil_id"].map(e=>({id:e,label:Ne(e)}));function mo(e,t=2){let n=e??0;if(!n)return "0 kb";let o=n/1024;return o>1024?`${(o/1024).toFixed(t)} mb`:`${o.toFixed(t)} kb`}function ut(e){return e?.file?.size!==void 0&&e?.file?.name!==void 0}function dt(e,t){return e.name===t.name&&e.size===t.size}function go(e,t){return t?.length?t.some(r=>ut(r)?dt(r.file,e):r.name===e.name):false}var yo=e=>{let t=e?.split(".").pop()?.toLowerCase()??"";return cp[t]??Ye$1},Co=(e,t,r)=>`${e}-${t}-${r}`;var ho=e=>e?/[\u0600-\u06FF]/g.test(e):false;function So(e,t="en"){return (e||[]).find(r=>(r?.lang||r?.locale)===t)||e?.[0]}var f=(e,t="en")=>(e||[]).find(r=>r?.lang===t)?.text,Eo=(e,t="en")=>(e||[]).find(r=>r?.lang===t);var _o=e=>{let t=e?.wallet==="SV Wallet"?"walletStoredValue":"walletPassThru";return e?.type==="Wallet"?t:e?.type},pt={AMERICAN_EXPRESS:"AMEX"},De=e=>pt[e.toUpperCase()]??e.toUpperCase(),wo=(e,t)=>!!e&&!!t&&De(e)===De(t);var Io=e=>({Local:e.success.light,Regional:e.info.light,Global:e.warning.light});var Fo=(e,t)=>{if(t==null)return "";let r=Do$1[e];return e===Co$1.COUNT?t===1?r:`${r}s`:r};var d={primary:"#1F88D0",background:"white",border:"#F2F2F2",transparent:"transparent"},g={thin:"0.5px",thick:"1px",none:"0px"},Re={minHeight:"28px",fullHeight:"100%"},Po=({isSelected:e,isCellSelected:t,isColumnSelected:r,isRowSelected:n,isLastRow:o})=>e?n?mt():t&&!r?gt():r?ft(o):{}:{},mt=()=>({backgroundColor:d.background,color:d.primary}),gt=()=>({border:`${g.thin} solid ${d.primary}`,backgroundColor:d.background,color:d.primary,borderRadius:"2px"}),ft=e=>{let t=xt(),r=yt(e);return {borderWidth:t,borderStyle:"solid",borderColor:d.primary,borderBottom:r,height:Re.fullHeight,minHeight:Re.minHeight,display:"flex",alignItems:"center"}},xt=()=>{let{none:e,thin:t}=g;return `${e} ${t} ${t} ${t}`},yt=e=>e?`${g.thick} solid ${d.primary}`:`${g.thin} solid ${d.border}`,Do=({effectiveFirst:e,isPinnedStart:t,isPinnedEnd:r})=>({borderTop:`${g.thin} solid ${d.primary}`,borderBottom:`${g.thin} solid ${d.primary}`,borderRight:`${g.thin} solid ${r?d.primary:"none"}`,borderLeft:`${g.thin} solid ${t&&e?d.primary:"transparent"}`}),Ro={left:"flex-start",center:"center",right:"flex-end"};function vo(e,t){if(t==null)return e;let r=n=>Array.isArray(n)?n:[n];return [...r(e),...r(t)]}function ko(...e){return e.filter(Boolean).join(" ")||void 0}var R=v("SA",po,oo$1);function v(e,t,r){let n=getTimezone(r);return n?{countryCode:e,label:`(GMT${n.utcOffsetStr}) ${Fe(e)??t}`,timezone:r,offset:n.utcOffset/60}:R}var ht=e=>{let t=getCountry(e),r=t?.timezones[0];if(!(!t||!r))return v(e,t.name,r)},Vo=e=>ht(e)??R,Wo=e=>{let t=getCountryForTimezone(e),r=getTimezone(e);return !t||!r?R:v(t.id,t.name,e)};function Jo(e){return {name:"Payment Methods",type:"payment_methods",options:e?.map(t=>({name:ke(Ne(f(t?.name))),type:t?.code,icon:Eo$1[t.code]??Eo$1.CARD,options:t.payment_methods?.map(r=>({name:f(r.name),type:r.code}))}))}}function jo(e=[]){return {name:"Payment Schemes",type:"payment_scheme",options:e.filter(t=>t.code).map(t=>({name:ke(Ne(f(t?.name))),type:t?.code}))}}var Ue=["120px","180px","100px","150px","200px","140px","160px","110px","190px","130px"],St={id:"index",header:"",width:"34px",order:0,hidden:false,sortable:false,pinned:"start",isDefaultPinned:true,pinnable:true},Et={id:"date",header:"",width:"120px",order:1,hidden:false,sortable:false,pinned:"start",isDefaultPinned:true,pinnable:true},bt={id:"action_icon",header:"",width:"36px",order:Ue.length+3,hidden:false,sortable:false,pinned:"end",pinnable:true,isDefaultPinned:true},_t=(e=Ue)=>{let t=e.map((r,n)=>({id:`skeleton-col-${n}`,header:"",width:r,order:n+2,hidden:false,sortable:false,pinnable:false}));return [St,Et,...t,bt]},Xo=(e,t,r)=>r&&t?_t():[...e];var Qo=(e,t)=>e.map(r=>{let n=Object.entries(t);if(!r.default||!r.layout?.length||!n.length)return r;let o=new Map(n.map(([i,a])=>[i.toLowerCase(),a])),s=r.layout.map(i=>({...i,columns:i.columns?.map(a=>{let l=a.code?.toLowerCase();if(!l||!o.has(l))return a;let u=o.get(l)??false;return {...a,default:u,fields:a.fields?.map(p=>({...p,default:u}))}})}));return {...r,layout:s}});var rs=(e,t)=>t.some(r=>!!e[r]),ns=(e,t,r)=>t?e:e.map(n=>{if(r.hiddenFilterColumnIds.includes(n.id)){let{filter:s,...i}=n,a=n.id,l=typeof i.header=="function"?Ne(a):i.header;return {...i,header:l}}let{hiddenFilterOptionKeys:o}=r;if(o&&n.filter&&"options"in n.filter&&n.filter.options){let s=n.filter.options,i=s.filter(a=>!a.apiKey||!o.includes(a.apiKey));if(i.length!==s.length)return {...n,filter:{...n.filter,options:i}}}return n});typeof window<"u"&&Me.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer");});var At={USE_PROFILES:{html:true},ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|blob):|[^a-z]|[-a-z.+]+(?:[^-a-z.+:]|$))/i,WHOLE_DOCUMENT:true},is=e=>typeof window>"u"?"":String(Me.sanitize(e||"",At));var cs=e=>window?.__TAPOS_NEWRELIC_TRACKING_EVENTS__?.trackFeatureEvent?.(e),ls=e=>e.toISOString();function ds(e,t){let r=e.replace(/:/g,"");return t?`${t}-${r}`:r}function It(e){return e!=null&&e!==""}function ms(e,t){let r=e!=null,n=t&&"message"in t?t.message:e?.message,o=It(n);return {isProvided:r,isVisible:o,type:o?e?.type:void 0}}export{Br as $,Xn as $a,rr as A,fn as Aa,Po as Ab,nr as B,xn as Ba,Do as Bb,or as C,Cn as Ca,Ro as Cb,sr as D,hn as Da,vo as Db,ir as E,D as Ea,ko as Eb,ar as F,Sn as Fa,Vo as Fb,cr as G,_n as Ga,Wo as Gb,lr as H,An as Ha,Jo as Hb,ur as I,Fn as Ia,jo as Ib,dr as J,Pn as Ja,Ue as Jb,pr as K,Dn as Ka,_t as Kb,mr as L,Rn as La,Xo as Lb,gr as M,vn as Ma,Qo as Mb,fr as N,ot as Na,rs as Nb,xr as O,kn as Oa,ns as Ob,Ae as P,Bn as Pa,is as Pb,O as Q,Un as Qa,cs as Qb,Er as R,Mn as Ra,ls as Rb,_r as S,$n as Sa,ds as Sb,wr as T,st as Ta,It as Tb,Ar as U,Vn as Ua,ms as Ub,Fr as V,Wn as Va,Nr as W,Kn as Wa,Pr as X,Yn as Xa,Dr as Y,Jn as Ya,kr as Z,jn as Za,Le as _,qn as _a,Ft as a,Ur as aa,Qn as ab,Nt as b,Qe as ba,Pe as bb,Pt as c,Mr as ca,to as cb,Dt as d,Vr as da,ro as db,Se as e,Wr as ea,at as eb,ze as f,Fe as fa,oo as fb,He as g,Hr as ga,so as gb,Bt as h,Gr as ha,ct as hb,Wt as i,Jr as ia,io as ib,we as j,jr as ja,ao as jb,zt as k,qr as ka,uo as kb,Ht as l,Xr as la,mo as lb,Gt as m,Zr as ma,ut as mb,Kt as n,Qr as na,dt as nb,A as o,en as oa,go as ob,Yt as p,on as pa,yo as pb,Jt as q,N as qa,Co as qb,I as r,P as ra,ho as rb,jt as s,sn as sa,So as sb,qt as t,an as ta,f as tb,Ke as u,cn as ua,Eo as ub,Xt as v,ln as va,_o as vb,Zt as w,un as wa,wo as wb,Qt as x,dn as xa,Io as xb,er as y,pn as ya,Fo as yb,tr as z,mn as za,d as zb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Eb}from'./chunk-
|
|
1
|
+
import {Eb}from'./chunk-FHV4S2B3.js';import {forwardRef,useRef,useState,useCallback,useLayoutEffect,memo}from'react';import g from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var s="os-shared-CardList",e={root:`${s}-root`,item:`${s}-item`,itemContent:`${s}-itemContent`,itemStartAdornment:`${s}-itemStartAdornment`,itemText:`${s}-itemText`,itemEndAdornment:`${s}-itemEndAdornment`};var b=styled(g,{shouldForwardProp:t=>t!=="$showShadow"})(({theme:t,$showShadow:a})=>({borderRadius:"8px",overflow:"auto",flexGrow:1,height:"100%",listStyle:"none",margin:0,padding:0,boxSizing:"border-box",[`& .${e.item}:last-of-type`]:{borderBottom:"none"},"&::after":{content:'""',position:"sticky",bottom:0,display:"block",height:"32px",marginTop:"-32px",background:"linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(251, 251, 251, 0.8) 100%)",borderRadius:"0 0 8px 8px",pointerEvents:"none",zIndex:1,transition:t.transitions.create("opacity",{duration:250}),opacity:a?1:0}})),N=styled(g)(({theme:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingInlineStart:"12px",paddingInlineEnd:"8px",borderBottom:`1px solid ${t.palette.divider}`,height:40,boxSizing:"border-box"})),E=styled("aside")({display:"flex",alignItems:"center",gap:"8px"}),T=styled("span")(({theme:t})=>({color:t.v2.palette.base.black,fontSize:"11px",fontWeight:500,lineHeight:"13.2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),$=styled("aside")({display:"flex",alignItems:"center"}),A=styled("aside")({display:"flex",alignItems:"center",gap:"4px"});var v=forwardRef(({hasShadow:t=true,children:a,onScroll:i,id:d,className:l,sx:p,"data-testid":c,...C},r)=>{let L=useRef(null),[P,H]=useState(true),f=useCallback(()=>{let o=L.current;if(!o)return;let{scrollTop:S,scrollHeight:u,clientHeight:I}=o,h=u>I+1&&(S===0||I<u-S-1);H(w=>w===h?w:h);},[]);useLayoutEffect(()=>{f();});let z=useCallback(o=>{L.current=o,typeof r=="function"?r(o):r&&(r.current=o);},[r]),B=useCallback(o=>{f(),i?.(o);},[i,f]);return jsx(b,{...C,component:"ul",ref:z,id:d,"data-testid":c??d??"CardList",onScroll:B,className:Eb(e.root,l),sx:p,$showShadow:P&&t,children:a})});v.displayName="CardList";var G=memo(v);var k=forwardRef(({children:t,startAdornment:a,endAdornment:i,id:d,className:l,sx:p,"data-testid":c,...C},r)=>jsxs(N,{...C,component:"li",ref:r,id:d,"data-testid":c??d??"CardListItem",className:Eb(e.item,l),sx:p,children:[jsxs(E,{className:e.itemContent,children:[a&&jsx($,{className:e.itemStartAdornment,children:a}),jsx(T,{className:e.itemText,children:t})]}),i&&jsx(A,{className:e.itemEndAdornment,children:i})]}));k.displayName="CardListItem";var J=memo(k);export{e as a,G as b,J as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,k,d,l}from'./chunk-
|
|
1
|
+
import {j,k,d,l}from'./chunk-KRRCTTGN.js';import {Eb}from'./chunk-FHV4S2B3.js';import {forwardRef,memo}from'react';import B from'@mui/material/FormControl';import j$1 from'@mui/material/FormControlLabel';import q from'@mui/material/RadioGroup';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var i="os-shared-RadioGroup",t={root:`${i}-root`,title:`${i}-title`,group:`${i}-group`,item:`${i}-item`,label:`${i}-label`,icon:`${i}-icon`},V=["sm","md","lg"],W=["vertical","horizontal"],u="sm",S="vertical",I=0,A={sm:[7.5,16,7.5,8],md:[9,16,9,10],lg:[11,16,11,12]},T={sm:35,md:40,lg:45},U={sm:o=>({...o.v2.typography.textVariants.body.small.medium}),md:o=>({...o.v2.typography.textVariants.body.medium.medium}),lg:o=>({...o.v2.typography.textVariants.body.large.semibold,fontWeight:o.v2.typography.fontWeightMedium})};function J(o,r){let[e,a,s,d]=A[r];return `${o.v2.spacing(e)} ${o.v2.spacing(a)} ${o.v2.spacing(s)} ${o.v2.spacing(d)}`}var D=styled(B)({display:"flex",flexDirection:"column",width:"100%",minWidth:0}),C=styled(j)(({theme:o})=>({color:o.v2.palette.grey[700],marginBottom:o.v2.spacing(4)})),N=styled(q,{shouldForwardProp:o=>o!=="$layout"&&o!=="$spacing"})(({theme:o,$layout:r,$spacing:e})=>({display:"flex",flexDirection:r==="horizontal"?"row":"column",gap:o.v2.spacing(e),...r==="horizontal"&&{[`& .${t.item}`]:{width:"auto",flexShrink:0}}})),v=styled(j$1,{shouldForwardProp:o=>o!=="$size"})(({theme:o,$size:r})=>{let{brand:e,grey:a}=o.v2.palette;return {margin:0,width:"100%",cursor:"pointer",padding:J(o,r),maxHeight:o.v2.spacing(T[r]),"& .MuiFormControlLabel-label":{...U[r](o),color:a[900],display:"block",width:"100%",cursor:"pointer"},[`& .${k.root}`]:{cursor:"pointer",color:"#8C9196","&.Mui-checked":{color:e[500]}}}}),E=styled("span")(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:o.v2.spacing(8),width:"100%",minWidth:0})),$=styled(d)({flexShrink:0,display:"block",marginLeft:"auto"});var z=forwardRef(({option:o,size:r=u,customLabelRenderer:e,labelPosition:a="end",customRadioProps:s,labelSx:d,className:R,sx:y,...G},f)=>{let m=e?e(o):o.label,{src:l$1,...g}=o.icon??{};return jsx(v,{ref:f,value:o.value,control:jsx(l,{...s,...o.customProps}),label:jsxs(E,{className:t.label,sx:d,children:[m,l$1?jsx($,{...g,src:l$1,className:Eb(t.icon,o.icon?.className)}):null]}),disabled:o.disabled,labelPlacement:a,$size:r,className:Eb(t.item,R),sx:y,...G})});z.displayName="RadioItem";var F=memo(z);var w=forwardRef(({options:o,onOptionChange:r,size:e=u,customLabelRenderer:a,layout:s=S,spacing:d=I,labelPosition:R="end",customRadioProps:y,labelSx:G,onChange:f,title:m,id:l,className:g,sx:M,"data-testid":k,...H},Z)=>{let Y=(c,b)=>{r?.(b),f?.(c,b);};return jsxs(D,{ref:Z,id:l,"data-testid":k??l??"RadioGroup",className:Eb(t.root,g),sx:M,children:[typeof m=="string"?jsx(C,{component:"span",textVariant:"body.small.medium",className:t.title,children:m}):m,jsx(N,{className:t.group,$layout:s,$spacing:d,onChange:Y,...H,children:o.map(c=>jsx(F,{option:c,size:e,customLabelRenderer:a,labelPosition:R,customRadioProps:y,labelSx:G},c.value))})]})});w.displayName="RadioGroup";var to=memo(w);export{t as a,V as b,W as c,u as d,S as e,I as f,to as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Sb,ua,Eb,Db,rb}from'./chunk-
|
|
1
|
+
import {Sb,ua,Eb,Db,rb}from'./chunk-FHV4S2B3.js';import {Uo,ta,ra}from'./chunk-TF7BQNJV.js';import {forwardRef,useId,useRef,useState,useEffect,useCallback,memo}from'react';import {useTranslation}from'react-i18next';import {useForkRef}from'@mui/material/utils';import R from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var f="os-shared-SheetViewChip",r={root:`${f}-root`,chip:`${f}-chip`,text:`${f}-text`,copyButton:`${f}-copyButton`},J=2e3,K=.3;var Q=styled("div")({position:"relative",width:"fit-content",maxWidth:"100%",'[data-column-align="right"] &':{marginLeft:"auto"}}),x=styled(R,{shouldForwardProp:e=>!["chipTextColor","chipBgColor","chipBorderColor","disabled","isSelected","disableAnimation"].includes(e)})(({theme:e,isSelected:w,chipTextColor:s=e.palette.text.primary,chipBgColor:i="#EFF1F2",chipBorderColor:o="#EFF1F2",disabled:h=false,disableAnimation:y})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",height:"18px",padding:"0px 8px",borderRadius:"30px",border:`1px solid ${o}`,backgroundColor:i,color:s,cursor:h?"not-allowed":"pointer",opacity:h?.5:1,whiteSpace:"nowrap",fontSize:"11px",minWidth:"67px",maxWidth:"none",width:"fit-content",overflow:"hidden",textOverflow:"unset",boxSizing:"border-box",...w&&{boxShadow:"white 7px 0px 8px 2px"},...y&&{transition:"none !important",animation:"none !important",transform:"none !important","& *":{transform:"none !important"}}})),L=styled(R)(()=>({gap:"4px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1})),U=styled(R)(()=>({position:"absolute",top:0,height:"100%",width:"12px",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center"})),Y=styled("img",{shouldForwardProp:e=>e!=="isVisible"})(({isVisible:e})=>({height:12,width:12,objectFit:"contain",opacity:e?1:0,transform:`translateX(${e?0:-5}px)`,pointerEvents:e?"auto":"none",transition:"opacity 100ms ease, transform 100ms ease"}));var oe=forwardRef(({id:e,className:w,children:s,copyText:i,copyTrigger:o="hover",animationDirection:h="right",animationDuration:y=200,disableAnimation:S=false,disabled:v=false,unknownText:ie,fullWidth:a=false,containerStyles:ne,sx:b,onClick:g,onMouseEnter:V,onMouseLeave:E,...N},k)=>{let F=Sb(useId(),"sheet-view-chip"),{t:se}=useTranslation(),$=useRef(null),re=useForkRef($,k),M=useRef(),[P,c]=useState(false),[W,A]=useState(false),p=o==="always"||P,I=p&&!!i,l=h==="left",H=Math.max(0,y),T=K*1e3,ae=p?0:T;useEffect(()=>{if(o!=="click"||!P)return;let t=me=>{$.current?.contains(me.target)||c(false);};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[o,P]),useEffect(()=>()=>clearTimeout(M.current),[]);let pe=useCallback(t=>{o==="click"&&c(true),g?.(t);},[o,g]),le=useCallback(t=>{o==="hover"&&i&&c(true),V?.(t);},[o,i,V]),de=useCallback(t=>{o==="hover"&&c(false),E?.(t);},[o,E]),he=useCallback(t=>{t.stopPropagation(),i&&(A(true),ua(i),clearTimeout(M.current),M.current=setTimeout(()=>A(false),J));},[i]),B=Eb(r.chip,w);if(!s)return jsx(x,{...N,chipBgColor:Uo.bgColor,chipBorderColor:Uo.borderColor,chipTextColor:Uo.textColor,ref:k,id:e??F,"data-testid":"SheetViewChip",className:Eb(r.root,B),disabled:v,disableAnimation:S,onClick:g,onMouseEnter:V,onMouseLeave:E,sx:Db(b??{},t=>({borderColor:t.palette.divider,width:a?"100%":"auto"})),children:se(ie??"unknown")});let ce=S?"none":`z-index 0ms linear ${p?0:T+H}ms`,z={zIndex:p?3:0,transition:ce};return jsxs(Q,{ref:re,id:e??F,"data-testid":"SheetViewChip",className:r.root,style:{...z,...ne,...a&&{width:"100%",minWidth:0,marginLeft:0}},children:[jsx(x,{...N,"aria-hidden":true,className:B,disabled:v,sx:Db(b??{},{visibility:"hidden",pointerEvents:"none",width:a?"100%":"fit-content"}),children:jsx(L,{children:s})}),jsx("div",{style:{position:"absolute",top:0,...z,width:a?"100%":"max-content",left:l?"auto":0,right:l?0:"auto"},children:jsxs(x,{...N,className:B,isSelected:p,disabled:v,disableAnimation:S,onClick:pe,onMouseEnter:le,onMouseLeave:de,sx:Db({width:a?"100%":"auto"},b),children:[jsx("div",{style:{display:"flex",gap:"4px",...a&&{maxWidth:"100%",width:"100%"},paddingRight:I&&!l?12:0,paddingLeft:I&&l?12:0,transition:`padding ${H}ms ease ${ae}ms`},children:jsx(L,{className:r.text,"data-is-arabic":typeof s=="string"&&rb(s),children:s})}),i&&jsx(U,{className:r.copyButton,sx:l?{left:"8px"}:{right:"8px"},children:jsx(Y,{isVisible:I,src:W?ta:ra,alt:W?"copied":"copy",onClick:he})})]})})]})});oe.displayName="SheetViewChip";var ye=memo(oe);export{r as a,ye as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {L,ba,aa}from'./chunk-
|
|
1
|
+
import {L,ba,aa}from'./chunk-KRRCTTGN.js';import {Sb,Ub,Db,Eb,pa}from'./chunk-FHV4S2B3.js';import {i,j}from'./chunk-TIPJC5YT.js';import {forwardRef,useId,useRef,useLayoutEffect,memo}from'react';import ge from'@mui/material/Box';import {styled,alpha,useTheme}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var p="os-shared-TextInput",a={root:`${p}-root`,field:`${p}-field`,label:`${p}-label`,input:`${p}-input`,helperText:`${p}-helperText`},A=new Set(["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"]);var F=styled(ge)(()=>({display:"flex",flexDirection:"column",gap:"4px",width:"100%"}));function R(e,t){let{borderColor:r}=aa(e,t),l=e.v2.radius(4);return {borderColor:r,borderBottom:"none",borderRadius:`${l} ${l} 0 0`,"&:focus-within":{borderColor:r,boxShadow:"none"}}}var $=styled("small",{shouldForwardProp:e=>e!=="$error"})(({theme:e,$error:t})=>({color:t?e.palette.error.main:alpha(e.v2.palette.base.black,.6),fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));function K(e,t){let r=typeof e=="string"&&pa(e)?e:void 0;return {resolvedLabel:r??t??void 0,resolvedPlaceholder:r&&typeof t=="string"?t:void 0}}function D(e,t){!(e.metaKey||e.ctrlKey||e.altKey)&&!A.has(e.key)&&(e.key==="."?String(e.currentTarget.value??"").replace(/,/g,"").includes(".")&&e.preventDefault():/^[0-9]$/.test(e.key)||e.preventDefault()),t?.(e);}var B=forwardRef(({onChange:e,error:t=false,helperText:r,feedback:l,label:g,placeholder:O,disabled:V,fullWidth:z=true,startAdornment:U,endAdornment:_,readOnly:j$1,inputProps:q,InputProps:G,InputLabelProps:Ce,className:J,sx:Q,id:m="TextInput",type:X,value:d,defaultValue:f,onKeyDown:b,hasThousandSeparator:n=false,...Y},u)=>{let Z=useTheme(),ee=Sb(useId(),"text-input"),x=useRef(null),s=useRef(null),te=o=>{x.current=o,typeof u=="function"?u(o):u&&(u.current=o);},re=o=>{if(!n){e?.(o.target.value??"");return}let T=o.target.value??"",Te=o.target.selectionStart??T.length,Ie=T.slice(0,Te).replace(/,/g,"").length,h=i(T);s.current=j(h,Ie),e?.(h);};useLayoutEffect(()=>{!n||s.current==null||!x.current||(x.current.setSelectionRange(s.current,s.current),s.current=null);},[n,d]);let{isProvided:y,isVisible:oe,type:ne}=Ub(l),{resolvedLabel:le,resolvedPlaceholder:se}=K(g,O),S=!!t&&!y,{sx:pe,startAdornment:ae,endAdornment:de,readOnly:ue,inputProps:ie,disabled:ce}=G??{},me=oe?R(Z,ne):{},fe=Db(Db(me,pe),Q),xe=n&&d!=null?i(String(d)):d,ye=n&&f!=null?i(String(f)):f;return jsxs(ge,{className:a.root,children:[jsx(F,{id:ee,"data-testid":"TextInput",children:jsx(L,{id:m,...Y,ref:te,type:n?"text":X,value:xe,defaultValue:ye,label:le,placeholder:se,disabled:V??ce,fullWidth:z,error:S,startAdornment:U??ae,endAdornment:_??de,readOnly:j$1??ue,inputProps:{...n?{inputMode:"decimal"}:{},...ie,...q},onKeyDown:n?o=>D(o,b):b,onChange:re,className:Eb(a.field,J),sx:fe})}),y?jsx(ba,{...l}):null,!y&&r?jsx($,{className:a.helperText,id:m?`${m}-helper-text`:void 0,$error:S,children:r}):null]})});B.displayName="TextInput";var W=memo(B);export{a,W as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {V,f,l,R,n,v,L as L$1,da,Q}from'./chunk-Z6D3LMCU.js';import {Eb}from'./chunk-XBJ4RS2B.js';import {createContext,memo,forwardRef,useId,useRef,useState,useCallback,useMemo,useEffect,useImperativeHandle,useContext}from'react';import In from'@mui/material/ClickAwayListener';import un from'lodash/debounce';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import G from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';var L="os-shared-MultiLevelMenu",a={root:`${L}-root`,panel:`${L}-panel`,submenu:`${L}-submenu`,header:`${L}-header`,footer:`${L}-footer`,search:`${L}-search`,searchButton:`${L}-searchButton`,list:`${L}-list`,item:`${L}-item`,itemActive:`${L}-itemActive`,itemAction:`${L}-itemAction`,itemOpen:`${L}-itemOpen`,itemFlipped:`${L}-itemFlipped`,startAdornment:`${L}-startAdornment`,content:`${L}-content`,label:`${L}-label`,hint:`${L}-hint`,count:`${L}-count`,chevron:`${L}-chevron`,endAdornment:`${L}-endAdornment`,empty:`${L}-empty`,loader:`${L}-loader`},me="data-multi-level-submenu",Me="data-multi-level-submenu-anchor",pe="data-multi-level-item",Ze=80,qe=100,Ue=300,fe=300,Qe={strategy:"fixed"},Ye={ArrowDown:1,ArrowUp:-1,Home:"first",End:"last"},Ge=["searchText","label"],Ne="Search",Je="No results found";var ke=createContext(null),Jt=()=>{let e=useContext(ke);if(!e)throw new Error("MultiLevelMenu parts must render inside MultiLevelMenu.");return e},Xe=Jt;var Y=e=>Array.isArray(e.options),_=e=>e.kind==="action",et=e=>(e.options??[]).filter(t=>!_(t)),tt=e=>Y(e)?et(e).length:null;function nt(e,t,n,l){if(_(l)||t==="none")return false;if(l.isSelectable!==void 0)return l.isSelectable;let o=t==="multiple"?true:!Y(l);return e===void 0?o:typeof e=="boolean"?e:typeof e=="function"?e(n,l):(e[n]??o)}function lt(e){let t=new Map,n=[],l=(o,u,c)=>{for(let s of o)t.set(s.id,{node:s,parentId:u,depth:c}),n.push(s.id),s.options&&l(s.options,s.id,c+1);};return l(e,null,0),{entries:t,order:n}}function ot(e,t){let n=[],l=t?e.entries.get(t):void 0;for(;l;)n.unshift(l.node),l=l.parentId?e.entries.get(l.parentId):void 0;return n}var it=(e,t=[])=>{for(let n of e.options??[])t.push(n.id),it(n,t);return t},rt=(e,t,n)=>!_(e)&&!e.isDisabled&&n(e,t);function Ie(e,t,n,l){let o=new Set(e),u=new Set,c=new Set;if(n)for(let i of Array.from(o)){let r=t.entries.get(i);if(!r||!Y(r.node))continue;let M=(p,S)=>{for(let y of p.options??[])(rt(y,S+1,l)||Y(y))&&o.add(y.id),M(y,S+1);};M(r.node,r.depth);}let s=(i,r)=>{let M=et(i).filter(v=>!v.isDisabled),p=(i.options??[]).map(v=>s(v,r+1)),S,y=p.some(v=>v!=="unchecked");if(n&&M.length>0){if(S=M.every(T=>u.has(T.id))?"checked":y?"indeterminate":"unchecked",S==="checked"&&!l(i,r))return u.add(i.id),o.delete(i.id),S;S==="checked"?o.add(i.id):o.delete(i.id);}else S=o.has(i.id)?"checked":y?"indeterminate":"unchecked";return S==="checked"&&u.add(i.id),S==="indeterminate"&&c.add(i.id),S};for(let i of t.order){let r=t.entries.get(i);r&&r.parentId===null&&s(r.node,0);}let d=t.order.filter(i=>o.has(i)),C=Array.from(o).filter(i=>!t.entries.has(i));return {value:[...d,...C],checked:u,indeterminate:c}}function ut(e,t,n,l,o,u,c){if(l==="none")return e;if(l==="single")return n?[t]:e.filter(i=>i!==t);let s=new Set(e),d=u.entries.get(t);if(!o||!d)return n?s.add(t):s.delete(t),Array.from(s);let C=[t,...it(d.node)];if(n)for(let i of C){let r=u.entries.get(i);r&&(i===t||rt(r.node,r.depth,c)||Y(r.node))&&s.add(i);}else {for(let r of C)s.delete(r);let i=d.parentId;for(;i;)s.delete(i),i=u.entries.get(i)?.parentId??null;}return Array.from(s)}var st=(e,t)=>e.order.filter(n=>{let l=e.entries.get(n);return !!(l&&!l.node.isDisabled&&!_(l.node)&&t(l.node,l.depth))});function Ee(e,t,n){return e.reduce((l,o)=>{let u=o.options?Ee(o.options,t,n):void 0;return (t.has(o.id)||n.has(o.id)||u&&u.length>0)&&l.push({...o,...o.options?{options:u}:{}}),l},[])}var Xt=(e,t)=>{let n=e[t],l=e.data&&typeof e.data=="object"?e.data[t]:void 0,o=n??l;return typeof o=="string"||typeof o=="number"?String(o):""},_t=(e,t,n)=>n.some(l=>Xt(e,l).toLowerCase().includes(t));function Te(e,t,n,l){return !t||n.isServerSide?e:n.filterNode?e.reduce((o,u)=>{let c=n.filterNode?.(u,t);return c&&o.push(c),o},[]):e.reduce((o,u)=>{if(_t(u,t,l))return o.push(u),o;if(u.options){let c=Te(u.options,t,n,l);c.length>0&&o.push({...u,options:c});}return o},[])}var ve=e=>e?.length===1&&Y(e[0])&&!_(e[0])?e[0]:null,at=e=>{let t=e.options?{...e,options:e.options.map(at)}:e,n=ve(t.options);for(;n;)t={...t,options:n.options,submenu:{...t.submenu,...n.submenu}},n=ve(t.options);return t};function ct(e,t){let n=e.map(at),l=t,o=ve(n);for(;o;)l={...l,...o.submenu},n=o.options??[],o=ve(n);return {options:n,level:l}}var en=(e,t="right")=>{let n=e?.closest(`.${Q.panel}`);if(!e||!n)return 0;let l=e.getBoundingClientRect(),o=n.getBoundingClientRect(),u=t.startsWith("left")?l.left-o.left:o.right-l.right;return Math.max(0,u)},dt=(e,t)=>[{name:"flip",enabled:true,options:{rootBoundary:"viewport",padding:8,fallbackPlacements:["left-start","right-end","left-end"]}},{name:"preventOverflow",enabled:true,options:{rootBoundary:"viewport",altAxis:true,padding:8}},{name:"offset",options:{offset:({placement:n})=>[0,en(e.current,n)]}},{name:"multiLevelMenuPlacementTracker",enabled:true,phase:"afterWrite",fn:({state:n})=>t(n.placement)}],_e=(e,t)=>t instanceof Node&&!!e?.contains(t),mt=(e,t,n)=>{if(_e(t,e)||_e(n,e))return true;if(!(e instanceof Element)||!n)return false;let l=e.closest(`[${me}]`)?.getAttribute(Me),o=l?document.getElementById(l):null;return !!(o&&n.contains(o))},he=e=>Array.from(e?.querySelectorAll(`[${pe}]:not([aria-disabled="true"])`)??[]);function ge(e,t,n){let l=he(e);if(l.length===0)return;if(n==="first")return l[0].focus();if(n==="last")return l[l.length-1].focus();let o=l.findIndex(c=>c===t),u=o===-1?n===1?0:l.length-1:(o+n+l.length)%l.length;l[u].focus();}function Re(e,t=20){window.setTimeout(()=>{let n=e();if(he(n).length>0){ge(n,null,"first");return}t>1&&Re(e,t-1);},16);}var ln=({options:e,selectionMode:t,isCascading:n,isSelectable:l,value:o,defaultValue:u,onChange:c})=>{let[s,d]=useState(u??[]),C=o!==void 0,i=C?o:s,r=useMemo(()=>lt(e),[e]),M=t==="multiple"&&n,p=useCallback((h,g)=>nt(l,t,g,h),[l,t]),S=useCallback((h,g)=>{let D=r.entries.get(h.id);return D?p(D.node,D.depth):p(h,g)},[r,p]),y=useMemo(()=>Ie(i,r,M,p),[i,r,M,p]),v=useRef(y);v.current=y;let T=useCallback(h=>h.map(g=>r.entries.get(g)?.node).filter(g=>!!g),[r]),k=useCallback((h,g,D)=>{let O=Ie(h,r,M,p);C||d(O.value),c?.(O.value,{node:g,isSelected:D,selectedNodes:T(O.value)});},[r,M,p,C,c,T]),K=useCallback((h,g)=>{k(ut(v.current.value,h.id,g,t,M,r,p),h,g);},[k,t,M,r,p]),R=useCallback(()=>{t==="multiple"&&k(st(r,p),null,true);},[k,t,r,p]),H=useCallback(()=>k([],null,false),[k]),V=useCallback(()=>T(v.current.value),[T]),J=useCallback(()=>Ee(e,v.current.checked,v.current.indeterminate),[e]);return {index:r,canSelectRow:S,snapshot:y,toggle:K,selectAll:R,clear:H,getSelectedNodes:V,getSelectedTree:J}},pt=ln;var sn=(e,t)=>{let[n,l]=useState(""),[o,u]=useState(""),c=useRef(t?.onSearch);c.current=t?.onSearch;let s=t?.debounceMs??Ue,d=useMemo(()=>un(p=>{u(p.toLowerCase()),c.current?.(p);},s),[s]);useEffect(()=>()=>d.cancel(),[d]);let C=useCallback(p=>{l(p),d(p.trim());},[d]),i=useCallback(()=>{d.cancel(),l(""),u(""),c.current?.("");},[d]),r=t?.searchBy??Ge,M=useMemo(()=>t?Te(e,o,t,r):e,[e,o,t,r]);return {inputValue:n,query:o,filteredOptions:M,isSearching:!!(t&&o),handleChange:C,handleClear:i}},gt=sn;var Lt=()=>jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,focusable:"false",children:jsx("path",{d:"M0.40999 4.88245e-05C0.327141 0.00131442 0.246554 0.0272714 0.178541 0.0745982C0.110529 0.121925 0.0581841 0.188469 0.0282057 0.265715C-0.00177272 0.34296 -0.00802105 0.427394 0.01026 0.508211C0.0285411 0.589028 0.0705201 0.662552 0.130825 0.719375L4.54108 5.0001L0.130825 9.28083C0.0907115 9.3187 0.0585239 9.36416 0.0361329 9.41458C0.0137419 9.465 0.00159394 9.51937 0.00039481 9.57452C-0.000804325 9.62967 0.00896913 9.68452 0.0291477 9.73586C0.0493262 9.7872 0.0795072 9.83403 0.117937 9.87361C0.156367 9.91319 0.202279 9.94473 0.253007 9.96641C0.303734 9.9881 0.358264 9.99948 0.413429 9.99991C0.468594 10.0003 0.523294 9.98979 0.57435 9.9689C0.625406 9.948 0.6718 9.91717 0.710837 9.87819L5.42899 5.29878C5.46895 5.25997 5.50071 5.21354 5.52241 5.16224C5.5441 5.11094 5.55527 5.0558 5.55527 5.0001C5.55527 4.9444 5.5441 4.88926 5.52241 4.83796C5.50071 4.78666 5.46895 4.74023 5.42899 4.70142L0.710837 0.122015C0.671414 0.0825733 0.62447 0.0514536 0.572791 0.0305023C0.521111 0.00955091 0.465749 -0.00080514 0.40999 4.88245e-05Z",fill:"currentColor"})}),St=()=>jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,focusable:"false",children:jsx("path",{d:"M7.68817 8.21429L7.6463 8.17242L7.60036 8.20978C6.88378 8.79249 5.97154 9.14299 4.97917 9.14299C2.68489 9.14299 0.815625 7.27372 0.815625 4.97943C0.815625 2.68514 2.68489 0.815869 4.97917 0.815869C7.27345 0.815869 9.14271 2.68514 9.14271 4.97943C9.14271 5.9718 8.79221 6.88405 8.2095 7.60064L8.17215 7.64657L8.21401 7.68844L11.0754 10.5499L11.0754 10.5499L11.0764 10.5508C11.1121 10.5851 11.1406 10.6261 11.1602 10.6715C11.1798 10.7169 11.1902 10.7658 11.1907 10.8153C11.1912 10.8648 11.1818 10.9139 11.1631 10.9597C11.1444 11.0055 11.1168 11.0471 11.0818 11.0821C11.0468 11.1171 11.0052 11.1447 10.9594 11.1634C10.9136 11.1821 10.8645 11.1915 10.815 11.191C10.7655 11.1905 10.7167 11.1801 10.6712 11.1605C10.6258 11.1409 10.5848 11.1124 10.5505 11.0767L10.5496 11.0757L7.68817 8.21429ZM7.43625 7.35711L7.43682 7.35789L7.44469 7.34971C8.03496 6.73571 8.39896 5.90202 8.39896 4.97943C8.39896 3.08554 6.87305 1.55962 4.97917 1.55962C3.08528 1.55962 1.55937 3.08554 1.55937 4.97943C1.55937 6.87332 3.08528 8.39924 4.97917 8.39924C5.90175 8.39924 6.73544 8.03524 7.34944 7.44496L7.35011 7.44566L7.35683 7.43652C7.37913 7.40618 7.40591 7.37941 7.43625 7.35711Z",fill:"#20232B",stroke:"white",strokeWidth:.13125})}),yt=()=>jsxs("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,focusable:"false",children:[jsx("rect",{width:"13",height:"13",rx:"6.5",fill:"#F2F2F2"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.69808 4.16259C8.78018 4.16065 8.86095 4.18356 8.92981 4.22833C8.99866 4.27309 9.05239 4.33762 9.08393 4.41344C9.11548 4.48927 9.12338 4.57286 9.10659 4.65325C9.08981 4.73365 9.04911 4.80708 8.98986 4.86395L7.07755 6.77626L8.98839 8.68713L8.98986 8.68854C9.02896 8.72608 9.06018 8.77105 9.08169 8.82081C9.1032 8.87057 9.11456 8.92413 9.11511 8.97833C9.11566 9.03254 9.10539 9.08631 9.0849 9.1365C9.06441 9.18669 9.03411 9.23229 8.99578 9.27062C8.95745 9.30895 8.91185 9.33925 8.86166 9.35974C8.81147 9.38023 8.7577 9.3905 8.70349 9.38995C8.64928 9.3894 8.59573 9.37804 8.54597 9.35653C8.49621 9.33502 8.45125 9.30379 8.41371 9.26469L6.50141 7.35239L4.59054 9.26323L4.58913 9.2647C4.55159 9.30381 4.50662 9.33502 4.45685 9.35653C4.40709 9.37804 4.35354 9.3894 4.29933 9.38995C4.24513 9.3905 4.19135 9.38023 4.14116 9.35974C4.09098 9.33925 4.04538 9.30895 4.00705 9.27062C3.96872 9.23229 3.93842 9.18669 3.91793 9.1365C3.89744 9.08631 3.88717 9.03254 3.88772 8.97833C3.88827 8.92413 3.89963 8.87057 3.92114 8.82081C3.94264 8.77105 3.97388 8.7261 4.01298 8.68855L5.92528 6.77626L4.01443 4.86539L4.01339 4.86438C3.95522 4.80788 3.91524 4.73531 3.89855 4.65596C3.88186 4.5766 3.88923 4.49407 3.91971 4.41893C3.95019 4.34379 4.00239 4.27945 4.06964 4.23414C4.13689 4.18884 4.21615 4.16462 4.29722 4.1646C4.30093 4.1646 4.30464 4.16465 4.30835 4.16475C4.35906 4.16614 4.4091 4.17699 4.45589 4.19678C4.5061 4.21801 4.55154 4.24911 4.58952 4.28822L6.50141 6.20012L8.41228 4.28928L8.4137 4.2878C8.43812 4.26236 8.4655 4.24043 8.49507 4.22235C8.55578 4.18521 8.62571 4.1643 8.69808 4.16259Z",fill:"#8D8D94"})]});var Mn=()=>{let[e,t]=useState(null),n=useRef(null),l=useCallback(()=>{n.current!==null&&(window.clearTimeout(n.current),n.current=null);},[]),o=useCallback(s=>{l(),t(s);},[l]),u=useCallback(s=>{l(),t(d=>s===void 0||d===s?null:d);},[l]),c=useCallback((s,d,C,i)=>{mt(d,C,i)||(l(),n.current=window.setTimeout(()=>{n.current=null,t(r=>r===s?null:r);},Ze));},[l]);return useEffect(()=>l,[l]),{openId:e,open:o,close:u,scheduleClose:c,cancelClose:l}},bt=Mn;var Ct=styled(G)({display:"flex",flexDirection:"column",maxWidth:340}),Ae={flexShrink:0},wt=styled(G)(({theme:e})=>({...Ae,...e.v2.typography.textVariants.body.small.medium,display:"flex",alignItems:"center",minHeight:36,padding:`0 ${e.v2.spacing(8)}`,color:e.v2.palette.grey[500],cursor:"default"})),Nt=styled(G)(({theme:e})=>({...Ae,...e.v2.typography.textVariants.body.small.medium,display:"flex",alignItems:"center",minHeight:36,padding:`0 ${e.v2.spacing(8)}`,color:e.v2.palette.grey[500],cursor:"default"})),kt=styled(G)(({theme:e})=>({...Ae,padding:e.v2.spacing(8)})),It=styled(G)({display:"flex",flexDirection:"column",maxHeight:fe,overflowY:"auto",overscrollBehavior:"contain"}),re=styled(G)(({theme:e})=>({...e.v2.typography.textVariants.body.small.medium,fontSize:10,display:"flex",alignItems:"center",justifyContent:"center",minHeight:36,padding:`${e.v2.spacing(4)} ${e.v2.spacing(12)}`,color:alpha(e.v2.palette.base.black,.4),cursor:"default",textAlign:"center"})),Et=styled(V)(({theme:e})=>{let{brand:t,base:n}=e.v2.palette,l={boxShadow:e.v2.elevation[200],zIndex:1};return {minWidth:120,minHeight:36,maxHeight:36,paddingTop:0,paddingBottom:0,textTransform:"none",backgroundColor:n.white,outline:"none","&:hover":l,[`&.${a.itemOpen}`]:l,[`&.${a.itemActive}`]:l,"&:focus-visible":{boxShadow:`inset 0 0 0 1px ${t[500]}, ${e.v2.elevation[200]}`,zIndex:1},[`&.${a.itemAction}`]:{color:t[500]}}}),Tt=styled("span")({display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& img, & svg":{display:"block",maxWidth:20,maxHeight:20}}),De=styled(G)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.v2.spacing(8),flex:1,minWidth:0})),Rt=styled(G)({display:"flex",flexDirection:"column",flex:1,minWidth:0}),At={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Dt=styled("span")(({theme:e})=>({...e.v2.typography.textVariants.body.small.regular,...At,lineHeight:"normal",color:"inherit"})),Pt=styled("span")(({theme:e})=>({...e.v2.typography.textVariants.caption.regular,...At,fontSize:8,lineHeight:"normal",color:alpha(e.v2.palette.base.black,.5)})),Ht=styled("span",{shouldForwardProp:e=>e!=="$isOneDigit"})(({theme:e,$isOneDigit:t=true})=>({...e.v2.typography.textVariants.caption.semibold,fontSize:8,fontWeight:700,lineHeight:"10px",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,height:14,boxSizing:"border-box",...t?{width:13,borderRadius:"50%"}:{padding:`0 ${e.v2.spacing(3)}`,borderRadius:e.v2.radius(4)},backgroundColor:e.v2.palette.grey[100],color:e.v2.palette.grey[900]})),$t=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.v2.spacing(4),flexShrink:0})),Bt=styled("span")({display:"flex",alignItems:"center",flexShrink:0}),Ot=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:8,flexShrink:0,color:e.v2.palette.grey[900],transition:"transform 120ms ease",[`.${a.itemFlipped} &`]:{transform:"rotate(180deg)"}})),Ft=styled(f)({padding:0,paddingRight:"4px",width:"14px !important",".MuiSvgIcon-root, svg":{width:"12px !important",height:"12px !important"}}),Kt=styled(l)({padding:0}),Pe=styled("button")({display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxSizing:"border-box",width:16,height:16,padding:0,margin:"1px 0 0 8px",border:0,borderRadius:"50%",background:"transparent",cursor:"pointer","&:disabled":{cursor:"default"},"& svg":{display:"block"}});function gn({node:e,depth:t,path:n,isSubmenuOpen:l,isHoverDisabled:o,isTabStop:u,onSubmenuOpen:c,onSubmenuClose:s,onSubmenuScheduleClose:d,onSubmenuCancelClose:C}){let i=Xe(),{selectionMode:r,submenuTrigger:M,checked:p,indeterminate:S,activePath:y,canSelectRow:v,getItemCount:T,renderItem:k}=i,K=useId(),R$1=useRef(null),[H,V]=useState(null),J=useCallback(f=>{R$1.current=f,V(f);},[]),h=useRef(null),[g,D]=useState(false),O=useMemo(()=>dt(R$1,f=>D(f.startsWith("left"))),[]),b=Y(e),W=_(e),A=!!e.isDisabled,I=v(e,t),E=p.has(e.id),z=!E&&S.has(e.id),q=y.has(e.id),w=b&&l&&!A,F=b?T(e):null,j=useRef(i.onSubmenuOpen);j.current=i.onSubmenuOpen,useEffect(()=>{w&&j.current?.(e);},[w]);let U=useCallback(()=>{A||(I&&i.toggle(e,r==="single"?true:!E),b&&(M==="click"||!I)&&(w&&M==="click"?s(e.id):c(e.id)),e.onClick?.(e,n),i.onNodeClick?.(e,n),!b&&i.isClosingOnSelect&&(I||r==="none"||W)&&i.requestClose("select"));},[i,b,W,A,w,I,E,e,s,c,n,r,M]),m=f=>{f.stopPropagation(),U();},$=()=>{M!=="hover"||o||A||!b||c(e.id);},ue=f=>{M!=="hover"||!b||d(e.id,f.relatedTarget,R$1.current,h.current);},le=()=>Re(()=>h.current?.querySelector(`.${a.list}`)??null),se=f=>{if(!(f.target===R$1.current)){w&&(f.key==="ArrowLeft"||f.key==="Escape")&&(f.preventDefault(),f.stopPropagation(),s(e.id),R$1.current?.focus());return}if(f.key==="Enter"||f.key===" "){f.preventDefault(),f.stopPropagation(),U(),b&&!I&&le();return}f.key==="ArrowRight"&&b&&!A&&(f.preventDefault(),f.stopPropagation(),c(e.id),le());},ae={depth:t,path:n,isSelected:E,isIndeterminate:z,isActive:q,isDisabled:A,isSelectable:I,hasOptions:b,isSubmenuOpen:w,isSubmenuFlipped:g,itemCount:F},ee=null;I&&r==="multiple"&&(ee=jsx(Ft,{size:"small",checked:E,indeterminate:z,tabIndex:-1})),I&&r==="single"&&(ee=jsx(Kt,{checked:E,tabIndex:-1}));let Q=null;e.endAdornment!==void 0?Q=e.endAdornment===null?null:jsx(Bt,{className:a.endAdornment,children:e.endAdornment}):(b||W)&&(Q=jsx(Ot,{className:a.chevron,"aria-hidden":true,children:jsx(Lt,{})}));let X="menuitem";return I&&r==="multiple"&&(X="menuitemcheckbox"),I&&r==="single"&&(X="menuitemradio"),jsxs(Et,{ref:J,id:K,role:X,tabIndex:u?0:-1,"aria-checked":I?z?"mixed":E:void 0,"aria-haspopup":b?"menu":void 0,"aria-expanded":b?w:void 0,"aria-disabled":A||void 0,"aria-current":q||void 0,"data-testid":"MultiLevelMenuItem","data-node-id":e.id,[pe]:"",className:Eb(a.item,q&&a.itemActive,W&&a.itemAction,w&&a.itemOpen,w&&g&&a.itemFlipped),isSelected:E,isIndeterminate:z,isDisabled:A,startAdornment:ee,onClick:m,onMouseEnter:$,onMouseLeave:ue,onKeyDown:se,children:[k?jsx(De,{className:a.content,children:k(e,ae)}):jsxs(De,{className:a.content,children:[e.startAdornment?jsx(Tt,{className:a.startAdornment,children:e.startAdornment}):null,jsxs(Rt,{children:[jsx(Dt,{className:a.label,title:typeof e.label=="string"?e.label:void 0,children:e.label}),e.hint?jsx(Pt,{className:a.hint,title:typeof e.hint=="string"?e.hint:void 0,children:e.hint}):null]})]}),F&&!k||Q!==null?jsxs($t,{children:[F&&!k?jsx(Ht,{className:a.count,$isOneDigit:F<10,children:F}):null,Q]}):null,b?jsx(R,{ref:h,[me]:"",[Me]:K,open:w&&H!==null,anchorEl:H,placement:"right-start",modifiers:O,popperOptions:Qe,sx:i.submenuSx,panelProps:{role:"menu",className:Eb(a.panel,a.submenu,i.className),"data-depth":t+1,"data-level-key":e.submenu?.levelKey},onClick:f=>f.stopPropagation(),onMouseEnter:C,onMouseLeave:f=>d(e.id,f.relatedTarget,R$1.current,h.current),children:jsx(ye,{options:e.options??[],level:e.submenu??{},depth:t+1,path:n})}):null]})}var zt=memo(gn);function bn({options:e,level:t,depth:n$1,path:l}){let{header:o,footer:u,search:c,emptyState:s,isLoading:d,hasMore:C,isLoadingMore:i,onLoadMore:r}=t,M=useRef(null),p=useRef(null),[S,y]=useState(void 0),v$1=useRef(null),[T,k]=useState(false),{openId:K,open:R,close:H,scheduleClose:V,cancelClose:J}=bt(),{inputValue:h,filteredOptions:g,isSearching:D,handleChange:O,handleClear:b}=gt(e,c),W=m=>{m&&!h&&y(p.current?.getBoundingClientRect().width),m||y(void 0),O(m);},A=()=>{y(void 0),b();};useEffect(()=>()=>{v$1.current!==null&&window.clearTimeout(v$1.current);},[]);let I=useCallback(()=>{k(true),H(),v$1.current!==null&&window.clearTimeout(v$1.current),v$1.current=window.setTimeout(()=>{v$1.current=null,k(false);},qe);},[H]),E=m=>{let $=Ye[m.key];$===void 0||!he(M.current).includes(m.target)||(m.preventDefault(),m.stopPropagation(),ge(M.current,m.target,$));},z=m=>{m.key==="ArrowDown"&&(m.preventDefault(),ge(M.current,null,"first"));},q=g.find(m=>!m.isDisabled)?.id,w=g.map(m=>jsx(zt,{node:m,depth:n$1,path:[...l,m],isSubmenuOpen:K===m.id,isHoverDisabled:T,isTabStop:m.id===q,onSubmenuOpen:R,onSubmenuClose:H,onSubmenuScheduleClose:V,onSubmenuCancelClose:J},m.id)),F=!d&&g.length===0&&D,j=null;d?j=jsx(re,{className:a.loader,role:"status","aria-live":"polite",children:jsx(n,{size:14})}):F?j=jsx(re,{className:a.empty,role:"status",children:c?.noResults??Je}):g.length===0&&s&&(j=jsx(re,{className:a.empty,role:"status",children:s}));let U=i?jsx(re,{className:a.loader,role:"status","aria-live":"polite",children:jsx(n,{size:14})}):null;return jsxs(Ct,{ref:p,"data-depth":n$1,sx:S?{minWidth:S}:void 0,children:[o?jsxs(Fragment,{children:[jsx(wt,{className:a.header,children:o}),jsx(v,{flexItem:true})]}):null,c?jsxs(Fragment,{children:[jsx(kt,{className:a.search,children:jsx(L$1,{fullWidth:true,size:"md",placeholder:c.placeholder??Ne,value:h,onChange:m=>W(m.target.value),onKeyDown:z,inputProps:{autoComplete:"off","aria-label":c.placeholder??Ne},endAdornment:h?jsx(Pe,{type:"button",className:a.searchButton,"aria-label":"Clear search",onMouseDown:m=>m.preventDefault(),onClick:m=>{m.stopPropagation(),A();},children:jsx(yt,{})}):jsx(Pe,{type:"button",className:a.searchButton,"aria-label":"Search",tabIndex:-1,disabled:true,children:jsx(St,{})})})}),jsx(v,{flexItem:true})]}):null,j??(r?jsxs(da,{ref:M,className:a.list,loadMoreItems:async()=>r(),hasMore:C,isFetchingNextPage:!!i,onScroll:I,onKeyDown:E,sx:{maxHeight:fe,overflowY:"auto",overscrollBehavior:"contain"},children:[w,U]}):jsxs(It,{ref:M,className:a.list,onScroll:I,onKeyDown:E,children:[w,U]})),u?jsxs(Fragment,{children:[jsx(v,{flexItem:true}),jsx(Nt,{className:a.footer,children:u})]}):null]})}var ye=memo(bn);function En(e,t){let{id:n,options:l,anchorEl:o,open:u,placement:c="bottom-start",onClose:s,selectionMode:d="multiple",isCascading:C=true,isSelectable:i,value:r,defaultValue:M,onChange:p,activeId:S,onNodeClick:y,onSubmenuOpen:v,isClosingOnSelect:T=d!=="multiple",submenuTrigger:k="hover",shouldPromoteSingleChild:K=false,getItemCount:R$1=tt,renderItem:H,className:V,sx:J,submenuSx:h,popperProps:g,header:D,footer:O,search:b,emptyState:W,isLoading:A,hasMore:I,isLoadingMore:E,onLoadMore:z,levelKey:q}=e,w=u??!!o,F=useRef(null),j=pt({options:l,selectionMode:d,isCascading:C,isSelectable:i,value:r,defaultValue:M,onChange:p}),{index:U,canSelectRow:m,snapshot:$,toggle:ue,selectAll:le,clear:se,getSelectedNodes:ae,getSelectedTree:ee}=j,Q=useMemo(()=>({header:D,footer:O,search:b,emptyState:W,isLoading:A,hasMore:I,isLoadingMore:E,onLoadMore:z,levelKey:q}),[D,O,b,W,A,I,E,z,q]),X=useMemo(()=>K?ct(l,Q):{options:l,level:Q},[K,l,Q]),f=useMemo(()=>new Set(ot(U,S).map(B=>B.id)),[U,S]),Ce=useRef(s);Ce.current=s;let oe=useCallback(B=>Ce.current?.(B),[]);useEffect(()=>{if(!w)return;let B=Oe=>{Oe.key==="Escape"&&!Oe.defaultPrevented&&oe("escape");};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[w,oe]),useImperativeHandle(t,()=>({get element(){return F.current},getValue:()=>$.value,getSelectedNodes:ae,getSelectedTree:ee,selectAll:le,clear:se}),[$.value,ae,ee,le,se]);let Ut=useMemo(()=>({selectionMode:d,submenuTrigger:k,isClosingOnSelect:T,checked:$.checked,indeterminate:$.indeterminate,activePath:f,className:V,submenuSx:h,canSelectRow:m,getItemCount:R$1,toggle:ue,requestClose:oe,onNodeClick:y,onSubmenuOpen:v,renderItem:H}),[d,k,T,$.checked,$.indeterminate,f,V,h,m,R$1,ue,oe,y,v,H]),Qt=B=>{w&&(o&&B.target instanceof Node&&o.contains(B.target)||oe("clickAway"));};return jsx(ke.Provider,{value:Ut,children:jsx(In,{onClickAway:Qt,children:jsx(R,{...g,ref:F,id:n,"data-testid":n??"MultiLevelMenu",open:w,anchorEl:o,placement:c,sx:J,onClick:B=>B.stopPropagation(),panelProps:{role:"menu",className:Eb(a.root,a.panel,V),"aria-multiselectable":d==="multiple"||void 0,"data-depth":0,"data-level-key":X.level.levelKey},children:jsx(ye,{options:X.options,level:X.level,depth:0,path:[]})})})})}var qt=memo(forwardRef(En));qt.displayName="MultiLevelMenu";var Tn=qt;
|
|
1
|
+
import {V,f,l,R,n,v,L as L$1,da,Q}from'./chunk-KRRCTTGN.js';import {Eb}from'./chunk-FHV4S2B3.js';import {createContext,memo,forwardRef,useId,useRef,useState,useCallback,useMemo,useEffect,useImperativeHandle,useContext}from'react';import In from'@mui/material/ClickAwayListener';import un from'lodash/debounce';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import G from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';var L="os-shared-MultiLevelMenu",a={root:`${L}-root`,panel:`${L}-panel`,submenu:`${L}-submenu`,header:`${L}-header`,footer:`${L}-footer`,search:`${L}-search`,searchButton:`${L}-searchButton`,list:`${L}-list`,item:`${L}-item`,itemActive:`${L}-itemActive`,itemAction:`${L}-itemAction`,itemOpen:`${L}-itemOpen`,itemFlipped:`${L}-itemFlipped`,startAdornment:`${L}-startAdornment`,content:`${L}-content`,label:`${L}-label`,hint:`${L}-hint`,count:`${L}-count`,chevron:`${L}-chevron`,endAdornment:`${L}-endAdornment`,empty:`${L}-empty`,loader:`${L}-loader`},me="data-multi-level-submenu",Me="data-multi-level-submenu-anchor",pe="data-multi-level-item",Ze=80,qe=100,Ue=300,fe=300,Qe={strategy:"fixed"},Ye={ArrowDown:1,ArrowUp:-1,Home:"first",End:"last"},Ge=["searchText","label"],Ne="Search",Je="No results found";var ke=createContext(null),Jt=()=>{let e=useContext(ke);if(!e)throw new Error("MultiLevelMenu parts must render inside MultiLevelMenu.");return e},Xe=Jt;var Y=e=>Array.isArray(e.options),_=e=>e.kind==="action",et=e=>(e.options??[]).filter(t=>!_(t)),tt=e=>Y(e)?et(e).length:null;function nt(e,t,n,l){if(_(l)||t==="none")return false;if(l.isSelectable!==void 0)return l.isSelectable;let o=t==="multiple"?true:!Y(l);return e===void 0?o:typeof e=="boolean"?e:typeof e=="function"?e(n,l):(e[n]??o)}function lt(e){let t=new Map,n=[],l=(o,u,c)=>{for(let s of o)t.set(s.id,{node:s,parentId:u,depth:c}),n.push(s.id),s.options&&l(s.options,s.id,c+1);};return l(e,null,0),{entries:t,order:n}}function ot(e,t){let n=[],l=t?e.entries.get(t):void 0;for(;l;)n.unshift(l.node),l=l.parentId?e.entries.get(l.parentId):void 0;return n}var it=(e,t=[])=>{for(let n of e.options??[])t.push(n.id),it(n,t);return t},rt=(e,t,n)=>!_(e)&&!e.isDisabled&&n(e,t);function Ie(e,t,n,l){let o=new Set(e),u=new Set,c=new Set;if(n)for(let i of Array.from(o)){let r=t.entries.get(i);if(!r||!Y(r.node))continue;let M=(p,S)=>{for(let y of p.options??[])(rt(y,S+1,l)||Y(y))&&o.add(y.id),M(y,S+1);};M(r.node,r.depth);}let s=(i,r)=>{let M=et(i).filter(v=>!v.isDisabled),p=(i.options??[]).map(v=>s(v,r+1)),S,y=p.some(v=>v!=="unchecked");if(n&&M.length>0){if(S=M.every(T=>u.has(T.id))?"checked":y?"indeterminate":"unchecked",S==="checked"&&!l(i,r))return u.add(i.id),o.delete(i.id),S;S==="checked"?o.add(i.id):o.delete(i.id);}else S=o.has(i.id)?"checked":y?"indeterminate":"unchecked";return S==="checked"&&u.add(i.id),S==="indeterminate"&&c.add(i.id),S};for(let i of t.order){let r=t.entries.get(i);r&&r.parentId===null&&s(r.node,0);}let d=t.order.filter(i=>o.has(i)),C=Array.from(o).filter(i=>!t.entries.has(i));return {value:[...d,...C],checked:u,indeterminate:c}}function ut(e,t,n,l,o,u,c){if(l==="none")return e;if(l==="single")return n?[t]:e.filter(i=>i!==t);let s=new Set(e),d=u.entries.get(t);if(!o||!d)return n?s.add(t):s.delete(t),Array.from(s);let C=[t,...it(d.node)];if(n)for(let i of C){let r=u.entries.get(i);r&&(i===t||rt(r.node,r.depth,c)||Y(r.node))&&s.add(i);}else {for(let r of C)s.delete(r);let i=d.parentId;for(;i;)s.delete(i),i=u.entries.get(i)?.parentId??null;}return Array.from(s)}var st=(e,t)=>e.order.filter(n=>{let l=e.entries.get(n);return !!(l&&!l.node.isDisabled&&!_(l.node)&&t(l.node,l.depth))});function Ee(e,t,n){return e.reduce((l,o)=>{let u=o.options?Ee(o.options,t,n):void 0;return (t.has(o.id)||n.has(o.id)||u&&u.length>0)&&l.push({...o,...o.options?{options:u}:{}}),l},[])}var Xt=(e,t)=>{let n=e[t],l=e.data&&typeof e.data=="object"?e.data[t]:void 0,o=n??l;return typeof o=="string"||typeof o=="number"?String(o):""},_t=(e,t,n)=>n.some(l=>Xt(e,l).toLowerCase().includes(t));function Te(e,t,n,l){return !t||n.isServerSide?e:n.filterNode?e.reduce((o,u)=>{let c=n.filterNode?.(u,t);return c&&o.push(c),o},[]):e.reduce((o,u)=>{if(_t(u,t,l))return o.push(u),o;if(u.options){let c=Te(u.options,t,n,l);c.length>0&&o.push({...u,options:c});}return o},[])}var ve=e=>e?.length===1&&Y(e[0])&&!_(e[0])?e[0]:null,at=e=>{let t=e.options?{...e,options:e.options.map(at)}:e,n=ve(t.options);for(;n;)t={...t,options:n.options,submenu:{...t.submenu,...n.submenu}},n=ve(t.options);return t};function ct(e,t){let n=e.map(at),l=t,o=ve(n);for(;o;)l={...l,...o.submenu},n=o.options??[],o=ve(n);return {options:n,level:l}}var en=(e,t="right")=>{let n=e?.closest(`.${Q.panel}`);if(!e||!n)return 0;let l=e.getBoundingClientRect(),o=n.getBoundingClientRect(),u=t.startsWith("left")?l.left-o.left:o.right-l.right;return Math.max(0,u)},dt=(e,t)=>[{name:"flip",enabled:true,options:{rootBoundary:"viewport",padding:8,fallbackPlacements:["left-start","right-end","left-end"]}},{name:"preventOverflow",enabled:true,options:{rootBoundary:"viewport",altAxis:true,padding:8}},{name:"offset",options:{offset:({placement:n})=>[0,en(e.current,n)]}},{name:"multiLevelMenuPlacementTracker",enabled:true,phase:"afterWrite",fn:({state:n})=>t(n.placement)}],_e=(e,t)=>t instanceof Node&&!!e?.contains(t),mt=(e,t,n)=>{if(_e(t,e)||_e(n,e))return true;if(!(e instanceof Element)||!n)return false;let l=e.closest(`[${me}]`)?.getAttribute(Me),o=l?document.getElementById(l):null;return !!(o&&n.contains(o))},he=e=>Array.from(e?.querySelectorAll(`[${pe}]:not([aria-disabled="true"])`)??[]);function ge(e,t,n){let l=he(e);if(l.length===0)return;if(n==="first")return l[0].focus();if(n==="last")return l[l.length-1].focus();let o=l.findIndex(c=>c===t),u=o===-1?n===1?0:l.length-1:(o+n+l.length)%l.length;l[u].focus();}function Re(e,t=20){window.setTimeout(()=>{let n=e();if(he(n).length>0){ge(n,null,"first");return}t>1&&Re(e,t-1);},16);}var ln=({options:e,selectionMode:t,isCascading:n,isSelectable:l,value:o,defaultValue:u,onChange:c})=>{let[s,d]=useState(u??[]),C=o!==void 0,i=C?o:s,r=useMemo(()=>lt(e),[e]),M=t==="multiple"&&n,p=useCallback((h,g)=>nt(l,t,g,h),[l,t]),S=useCallback((h,g)=>{let D=r.entries.get(h.id);return D?p(D.node,D.depth):p(h,g)},[r,p]),y=useMemo(()=>Ie(i,r,M,p),[i,r,M,p]),v=useRef(y);v.current=y;let T=useCallback(h=>h.map(g=>r.entries.get(g)?.node).filter(g=>!!g),[r]),k=useCallback((h,g,D)=>{let O=Ie(h,r,M,p);C||d(O.value),c?.(O.value,{node:g,isSelected:D,selectedNodes:T(O.value)});},[r,M,p,C,c,T]),K=useCallback((h,g)=>{k(ut(v.current.value,h.id,g,t,M,r,p),h,g);},[k,t,M,r,p]),R=useCallback(()=>{t==="multiple"&&k(st(r,p),null,true);},[k,t,r,p]),H=useCallback(()=>k([],null,false),[k]),V=useCallback(()=>T(v.current.value),[T]),J=useCallback(()=>Ee(e,v.current.checked,v.current.indeterminate),[e]);return {index:r,canSelectRow:S,snapshot:y,toggle:K,selectAll:R,clear:H,getSelectedNodes:V,getSelectedTree:J}},pt=ln;var sn=(e,t)=>{let[n,l]=useState(""),[o,u]=useState(""),c=useRef(t?.onSearch);c.current=t?.onSearch;let s=t?.debounceMs??Ue,d=useMemo(()=>un(p=>{u(p.toLowerCase()),c.current?.(p);},s),[s]);useEffect(()=>()=>d.cancel(),[d]);let C=useCallback(p=>{l(p),d(p.trim());},[d]),i=useCallback(()=>{d.cancel(),l(""),u(""),c.current?.("");},[d]),r=t?.searchBy??Ge,M=useMemo(()=>t?Te(e,o,t,r):e,[e,o,t,r]);return {inputValue:n,query:o,filteredOptions:M,isSearching:!!(t&&o),handleChange:C,handleClear:i}},gt=sn;var Lt=()=>jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,focusable:"false",children:jsx("path",{d:"M0.40999 4.88245e-05C0.327141 0.00131442 0.246554 0.0272714 0.178541 0.0745982C0.110529 0.121925 0.0581841 0.188469 0.0282057 0.265715C-0.00177272 0.34296 -0.00802105 0.427394 0.01026 0.508211C0.0285411 0.589028 0.0705201 0.662552 0.130825 0.719375L4.54108 5.0001L0.130825 9.28083C0.0907115 9.3187 0.0585239 9.36416 0.0361329 9.41458C0.0137419 9.465 0.00159394 9.51937 0.00039481 9.57452C-0.000804325 9.62967 0.00896913 9.68452 0.0291477 9.73586C0.0493262 9.7872 0.0795072 9.83403 0.117937 9.87361C0.156367 9.91319 0.202279 9.94473 0.253007 9.96641C0.303734 9.9881 0.358264 9.99948 0.413429 9.99991C0.468594 10.0003 0.523294 9.98979 0.57435 9.9689C0.625406 9.948 0.6718 9.91717 0.710837 9.87819L5.42899 5.29878C5.46895 5.25997 5.50071 5.21354 5.52241 5.16224C5.5441 5.11094 5.55527 5.0558 5.55527 5.0001C5.55527 4.9444 5.5441 4.88926 5.52241 4.83796C5.50071 4.78666 5.46895 4.74023 5.42899 4.70142L0.710837 0.122015C0.671414 0.0825733 0.62447 0.0514536 0.572791 0.0305023C0.521111 0.00955091 0.465749 -0.00080514 0.40999 4.88245e-05Z",fill:"currentColor"})}),St=()=>jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,focusable:"false",children:jsx("path",{d:"M7.68817 8.21429L7.6463 8.17242L7.60036 8.20978C6.88378 8.79249 5.97154 9.14299 4.97917 9.14299C2.68489 9.14299 0.815625 7.27372 0.815625 4.97943C0.815625 2.68514 2.68489 0.815869 4.97917 0.815869C7.27345 0.815869 9.14271 2.68514 9.14271 4.97943C9.14271 5.9718 8.79221 6.88405 8.2095 7.60064L8.17215 7.64657L8.21401 7.68844L11.0754 10.5499L11.0754 10.5499L11.0764 10.5508C11.1121 10.5851 11.1406 10.6261 11.1602 10.6715C11.1798 10.7169 11.1902 10.7658 11.1907 10.8153C11.1912 10.8648 11.1818 10.9139 11.1631 10.9597C11.1444 11.0055 11.1168 11.0471 11.0818 11.0821C11.0468 11.1171 11.0052 11.1447 10.9594 11.1634C10.9136 11.1821 10.8645 11.1915 10.815 11.191C10.7655 11.1905 10.7167 11.1801 10.6712 11.1605C10.6258 11.1409 10.5848 11.1124 10.5505 11.0767L10.5496 11.0757L7.68817 8.21429ZM7.43625 7.35711L7.43682 7.35789L7.44469 7.34971C8.03496 6.73571 8.39896 5.90202 8.39896 4.97943C8.39896 3.08554 6.87305 1.55962 4.97917 1.55962C3.08528 1.55962 1.55937 3.08554 1.55937 4.97943C1.55937 6.87332 3.08528 8.39924 4.97917 8.39924C5.90175 8.39924 6.73544 8.03524 7.34944 7.44496L7.35011 7.44566L7.35683 7.43652C7.37913 7.40618 7.40591 7.37941 7.43625 7.35711Z",fill:"#20232B",stroke:"white",strokeWidth:.13125})}),yt=()=>jsxs("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,focusable:"false",children:[jsx("rect",{width:"13",height:"13",rx:"6.5",fill:"#F2F2F2"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.69808 4.16259C8.78018 4.16065 8.86095 4.18356 8.92981 4.22833C8.99866 4.27309 9.05239 4.33762 9.08393 4.41344C9.11548 4.48927 9.12338 4.57286 9.10659 4.65325C9.08981 4.73365 9.04911 4.80708 8.98986 4.86395L7.07755 6.77626L8.98839 8.68713L8.98986 8.68854C9.02896 8.72608 9.06018 8.77105 9.08169 8.82081C9.1032 8.87057 9.11456 8.92413 9.11511 8.97833C9.11566 9.03254 9.10539 9.08631 9.0849 9.1365C9.06441 9.18669 9.03411 9.23229 8.99578 9.27062C8.95745 9.30895 8.91185 9.33925 8.86166 9.35974C8.81147 9.38023 8.7577 9.3905 8.70349 9.38995C8.64928 9.3894 8.59573 9.37804 8.54597 9.35653C8.49621 9.33502 8.45125 9.30379 8.41371 9.26469L6.50141 7.35239L4.59054 9.26323L4.58913 9.2647C4.55159 9.30381 4.50662 9.33502 4.45685 9.35653C4.40709 9.37804 4.35354 9.3894 4.29933 9.38995C4.24513 9.3905 4.19135 9.38023 4.14116 9.35974C4.09098 9.33925 4.04538 9.30895 4.00705 9.27062C3.96872 9.23229 3.93842 9.18669 3.91793 9.1365C3.89744 9.08631 3.88717 9.03254 3.88772 8.97833C3.88827 8.92413 3.89963 8.87057 3.92114 8.82081C3.94264 8.77105 3.97388 8.7261 4.01298 8.68855L5.92528 6.77626L4.01443 4.86539L4.01339 4.86438C3.95522 4.80788 3.91524 4.73531 3.89855 4.65596C3.88186 4.5766 3.88923 4.49407 3.91971 4.41893C3.95019 4.34379 4.00239 4.27945 4.06964 4.23414C4.13689 4.18884 4.21615 4.16462 4.29722 4.1646C4.30093 4.1646 4.30464 4.16465 4.30835 4.16475C4.35906 4.16614 4.4091 4.17699 4.45589 4.19678C4.5061 4.21801 4.55154 4.24911 4.58952 4.28822L6.50141 6.20012L8.41228 4.28928L8.4137 4.2878C8.43812 4.26236 8.4655 4.24043 8.49507 4.22235C8.55578 4.18521 8.62571 4.1643 8.69808 4.16259Z",fill:"#8D8D94"})]});var Mn=()=>{let[e,t]=useState(null),n=useRef(null),l=useCallback(()=>{n.current!==null&&(window.clearTimeout(n.current),n.current=null);},[]),o=useCallback(s=>{l(),t(s);},[l]),u=useCallback(s=>{l(),t(d=>s===void 0||d===s?null:d);},[l]),c=useCallback((s,d,C,i)=>{mt(d,C,i)||(l(),n.current=window.setTimeout(()=>{n.current=null,t(r=>r===s?null:r);},Ze));},[l]);return useEffect(()=>l,[l]),{openId:e,open:o,close:u,scheduleClose:c,cancelClose:l}},bt=Mn;var Ct=styled(G)({display:"flex",flexDirection:"column",maxWidth:340}),Ae={flexShrink:0},wt=styled(G)(({theme:e})=>({...Ae,...e.v2.typography.textVariants.body.small.medium,display:"flex",alignItems:"center",minHeight:36,padding:`0 ${e.v2.spacing(8)}`,color:e.v2.palette.grey[500],cursor:"default"})),Nt=styled(G)(({theme:e})=>({...Ae,...e.v2.typography.textVariants.body.small.medium,display:"flex",alignItems:"center",minHeight:36,padding:`0 ${e.v2.spacing(8)}`,color:e.v2.palette.grey[500],cursor:"default"})),kt=styled(G)(({theme:e})=>({...Ae,padding:e.v2.spacing(8)})),It=styled(G)({display:"flex",flexDirection:"column",maxHeight:fe,overflowY:"auto",overscrollBehavior:"contain"}),re=styled(G)(({theme:e})=>({...e.v2.typography.textVariants.body.small.medium,fontSize:10,display:"flex",alignItems:"center",justifyContent:"center",minHeight:36,padding:`${e.v2.spacing(4)} ${e.v2.spacing(12)}`,color:alpha(e.v2.palette.base.black,.4),cursor:"default",textAlign:"center"})),Et=styled(V)(({theme:e})=>{let{brand:t,base:n}=e.v2.palette,l={boxShadow:e.v2.elevation[200],zIndex:1};return {minWidth:120,minHeight:36,maxHeight:36,paddingTop:0,paddingBottom:0,textTransform:"none",backgroundColor:n.white,outline:"none","&:hover":l,[`&.${a.itemOpen}`]:l,[`&.${a.itemActive}`]:l,"&:focus-visible":{boxShadow:`inset 0 0 0 1px ${t[500]}, ${e.v2.elevation[200]}`,zIndex:1},[`&.${a.itemAction}`]:{color:t[500]}}}),Tt=styled("span")({display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& img, & svg":{display:"block",maxWidth:20,maxHeight:20}}),De=styled(G)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.v2.spacing(8),flex:1,minWidth:0})),Rt=styled(G)({display:"flex",flexDirection:"column",flex:1,minWidth:0}),At={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Dt=styled("span")(({theme:e})=>({...e.v2.typography.textVariants.body.small.regular,...At,lineHeight:"normal",color:"inherit"})),Pt=styled("span")(({theme:e})=>({...e.v2.typography.textVariants.caption.regular,...At,fontSize:8,lineHeight:"normal",color:alpha(e.v2.palette.base.black,.5)})),Ht=styled("span",{shouldForwardProp:e=>e!=="$isOneDigit"})(({theme:e,$isOneDigit:t=true})=>({...e.v2.typography.textVariants.caption.semibold,fontSize:8,fontWeight:700,lineHeight:"10px",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,height:14,boxSizing:"border-box",...t?{width:13,borderRadius:"50%"}:{padding:`0 ${e.v2.spacing(3)}`,borderRadius:e.v2.radius(4)},backgroundColor:e.v2.palette.grey[100],color:e.v2.palette.grey[900]})),$t=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.v2.spacing(4),flexShrink:0})),Bt=styled("span")({display:"flex",alignItems:"center",flexShrink:0}),Ot=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:8,flexShrink:0,color:e.v2.palette.grey[900],transition:"transform 120ms ease",[`.${a.itemFlipped} &`]:{transform:"rotate(180deg)"}})),Ft=styled(f)({padding:0,paddingRight:"4px",width:"14px !important",".MuiSvgIcon-root, svg":{width:"12px !important",height:"12px !important"}}),Kt=styled(l)({padding:0}),Pe=styled("button")({display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxSizing:"border-box",width:16,height:16,padding:0,margin:"1px 0 0 8px",border:0,borderRadius:"50%",background:"transparent",cursor:"pointer","&:disabled":{cursor:"default"},"& svg":{display:"block"}});function gn({node:e,depth:t,path:n,isSubmenuOpen:l,isHoverDisabled:o,isTabStop:u,onSubmenuOpen:c,onSubmenuClose:s,onSubmenuScheduleClose:d,onSubmenuCancelClose:C}){let i=Xe(),{selectionMode:r,submenuTrigger:M,checked:p,indeterminate:S,activePath:y,canSelectRow:v,getItemCount:T,renderItem:k}=i,K=useId(),R$1=useRef(null),[H,V]=useState(null),J=useCallback(f=>{R$1.current=f,V(f);},[]),h=useRef(null),[g,D]=useState(false),O=useMemo(()=>dt(R$1,f=>D(f.startsWith("left"))),[]),b=Y(e),W=_(e),A=!!e.isDisabled,I=v(e,t),E=p.has(e.id),z=!E&&S.has(e.id),q=y.has(e.id),w=b&&l&&!A,F=b?T(e):null,j=useRef(i.onSubmenuOpen);j.current=i.onSubmenuOpen,useEffect(()=>{w&&j.current?.(e);},[w]);let U=useCallback(()=>{A||(I&&i.toggle(e,r==="single"?true:!E),b&&(M==="click"||!I)&&(w&&M==="click"?s(e.id):c(e.id)),e.onClick?.(e,n),i.onNodeClick?.(e,n),!b&&i.isClosingOnSelect&&(I||r==="none"||W)&&i.requestClose("select"));},[i,b,W,A,w,I,E,e,s,c,n,r,M]),m=f=>{f.stopPropagation(),U();},$=()=>{M!=="hover"||o||A||!b||c(e.id);},ue=f=>{M!=="hover"||!b||d(e.id,f.relatedTarget,R$1.current,h.current);},le=()=>Re(()=>h.current?.querySelector(`.${a.list}`)??null),se=f=>{if(!(f.target===R$1.current)){w&&(f.key==="ArrowLeft"||f.key==="Escape")&&(f.preventDefault(),f.stopPropagation(),s(e.id),R$1.current?.focus());return}if(f.key==="Enter"||f.key===" "){f.preventDefault(),f.stopPropagation(),U(),b&&!I&&le();return}f.key==="ArrowRight"&&b&&!A&&(f.preventDefault(),f.stopPropagation(),c(e.id),le());},ae={depth:t,path:n,isSelected:E,isIndeterminate:z,isActive:q,isDisabled:A,isSelectable:I,hasOptions:b,isSubmenuOpen:w,isSubmenuFlipped:g,itemCount:F},ee=null;I&&r==="multiple"&&(ee=jsx(Ft,{size:"small",checked:E,indeterminate:z,tabIndex:-1})),I&&r==="single"&&(ee=jsx(Kt,{checked:E,tabIndex:-1}));let Q=null;e.endAdornment!==void 0?Q=e.endAdornment===null?null:jsx(Bt,{className:a.endAdornment,children:e.endAdornment}):(b||W)&&(Q=jsx(Ot,{className:a.chevron,"aria-hidden":true,children:jsx(Lt,{})}));let X="menuitem";return I&&r==="multiple"&&(X="menuitemcheckbox"),I&&r==="single"&&(X="menuitemradio"),jsxs(Et,{ref:J,id:K,role:X,tabIndex:u?0:-1,"aria-checked":I?z?"mixed":E:void 0,"aria-haspopup":b?"menu":void 0,"aria-expanded":b?w:void 0,"aria-disabled":A||void 0,"aria-current":q||void 0,"data-testid":"MultiLevelMenuItem","data-node-id":e.id,[pe]:"",className:Eb(a.item,q&&a.itemActive,W&&a.itemAction,w&&a.itemOpen,w&&g&&a.itemFlipped),isSelected:E,isIndeterminate:z,isDisabled:A,startAdornment:ee,onClick:m,onMouseEnter:$,onMouseLeave:ue,onKeyDown:se,children:[k?jsx(De,{className:a.content,children:k(e,ae)}):jsxs(De,{className:a.content,children:[e.startAdornment?jsx(Tt,{className:a.startAdornment,children:e.startAdornment}):null,jsxs(Rt,{children:[jsx(Dt,{className:a.label,title:typeof e.label=="string"?e.label:void 0,children:e.label}),e.hint?jsx(Pt,{className:a.hint,title:typeof e.hint=="string"?e.hint:void 0,children:e.hint}):null]})]}),F&&!k||Q!==null?jsxs($t,{children:[F&&!k?jsx(Ht,{className:a.count,$isOneDigit:F<10,children:F}):null,Q]}):null,b?jsx(R,{ref:h,[me]:"",[Me]:K,open:w&&H!==null,anchorEl:H,placement:"right-start",modifiers:O,popperOptions:Qe,sx:i.submenuSx,panelProps:{role:"menu",className:Eb(a.panel,a.submenu,i.className),"data-depth":t+1,"data-level-key":e.submenu?.levelKey},onClick:f=>f.stopPropagation(),onMouseEnter:C,onMouseLeave:f=>d(e.id,f.relatedTarget,R$1.current,h.current),children:jsx(ye,{options:e.options??[],level:e.submenu??{},depth:t+1,path:n})}):null]})}var zt=memo(gn);function bn({options:e,level:t,depth:n$1,path:l}){let{header:o,footer:u,search:c,emptyState:s,isLoading:d,hasMore:C,isLoadingMore:i,onLoadMore:r}=t,M=useRef(null),p=useRef(null),[S,y]=useState(void 0),v$1=useRef(null),[T,k]=useState(false),{openId:K,open:R,close:H,scheduleClose:V,cancelClose:J}=bt(),{inputValue:h,filteredOptions:g,isSearching:D,handleChange:O,handleClear:b}=gt(e,c),W=m=>{m&&!h&&y(p.current?.getBoundingClientRect().width),m||y(void 0),O(m);},A=()=>{y(void 0),b();};useEffect(()=>()=>{v$1.current!==null&&window.clearTimeout(v$1.current);},[]);let I=useCallback(()=>{k(true),H(),v$1.current!==null&&window.clearTimeout(v$1.current),v$1.current=window.setTimeout(()=>{v$1.current=null,k(false);},qe);},[H]),E=m=>{let $=Ye[m.key];$===void 0||!he(M.current).includes(m.target)||(m.preventDefault(),m.stopPropagation(),ge(M.current,m.target,$));},z=m=>{m.key==="ArrowDown"&&(m.preventDefault(),ge(M.current,null,"first"));},q=g.find(m=>!m.isDisabled)?.id,w=g.map(m=>jsx(zt,{node:m,depth:n$1,path:[...l,m],isSubmenuOpen:K===m.id,isHoverDisabled:T,isTabStop:m.id===q,onSubmenuOpen:R,onSubmenuClose:H,onSubmenuScheduleClose:V,onSubmenuCancelClose:J},m.id)),F=!d&&g.length===0&&D,j=null;d?j=jsx(re,{className:a.loader,role:"status","aria-live":"polite",children:jsx(n,{size:14})}):F?j=jsx(re,{className:a.empty,role:"status",children:c?.noResults??Je}):g.length===0&&s&&(j=jsx(re,{className:a.empty,role:"status",children:s}));let U=i?jsx(re,{className:a.loader,role:"status","aria-live":"polite",children:jsx(n,{size:14})}):null;return jsxs(Ct,{ref:p,"data-depth":n$1,sx:S?{minWidth:S}:void 0,children:[o?jsxs(Fragment,{children:[jsx(wt,{className:a.header,children:o}),jsx(v,{flexItem:true})]}):null,c?jsxs(Fragment,{children:[jsx(kt,{className:a.search,children:jsx(L$1,{fullWidth:true,size:"md",placeholder:c.placeholder??Ne,value:h,onChange:m=>W(m.target.value),onKeyDown:z,inputProps:{autoComplete:"off","aria-label":c.placeholder??Ne},endAdornment:h?jsx(Pe,{type:"button",className:a.searchButton,"aria-label":"Clear search",onMouseDown:m=>m.preventDefault(),onClick:m=>{m.stopPropagation(),A();},children:jsx(yt,{})}):jsx(Pe,{type:"button",className:a.searchButton,"aria-label":"Search",tabIndex:-1,disabled:true,children:jsx(St,{})})})}),jsx(v,{flexItem:true})]}):null,j??(r?jsxs(da,{ref:M,className:a.list,loadMoreItems:async()=>r(),hasMore:C,isFetchingNextPage:!!i,onScroll:I,onKeyDown:E,sx:{maxHeight:fe,overflowY:"auto",overscrollBehavior:"contain"},children:[w,U]}):jsxs(It,{ref:M,className:a.list,onScroll:I,onKeyDown:E,children:[w,U]})),u?jsxs(Fragment,{children:[jsx(v,{flexItem:true}),jsx(Nt,{className:a.footer,children:u})]}):null]})}var ye=memo(bn);function En(e,t){let{id:n,options:l,anchorEl:o,open:u,placement:c="bottom-start",onClose:s,selectionMode:d="multiple",isCascading:C=true,isSelectable:i,value:r,defaultValue:M,onChange:p,activeId:S,onNodeClick:y,onSubmenuOpen:v,isClosingOnSelect:T=d!=="multiple",submenuTrigger:k="hover",shouldPromoteSingleChild:K=false,getItemCount:R$1=tt,renderItem:H,className:V,sx:J,submenuSx:h,popperProps:g,header:D,footer:O,search:b,emptyState:W,isLoading:A,hasMore:I,isLoadingMore:E,onLoadMore:z,levelKey:q}=e,w=u??!!o,F=useRef(null),j=pt({options:l,selectionMode:d,isCascading:C,isSelectable:i,value:r,defaultValue:M,onChange:p}),{index:U,canSelectRow:m,snapshot:$,toggle:ue,selectAll:le,clear:se,getSelectedNodes:ae,getSelectedTree:ee}=j,Q=useMemo(()=>({header:D,footer:O,search:b,emptyState:W,isLoading:A,hasMore:I,isLoadingMore:E,onLoadMore:z,levelKey:q}),[D,O,b,W,A,I,E,z,q]),X=useMemo(()=>K?ct(l,Q):{options:l,level:Q},[K,l,Q]),f=useMemo(()=>new Set(ot(U,S).map(B=>B.id)),[U,S]),Ce=useRef(s);Ce.current=s;let oe=useCallback(B=>Ce.current?.(B),[]);useEffect(()=>{if(!w)return;let B=Oe=>{Oe.key==="Escape"&&!Oe.defaultPrevented&&oe("escape");};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[w,oe]),useImperativeHandle(t,()=>({get element(){return F.current},getValue:()=>$.value,getSelectedNodes:ae,getSelectedTree:ee,selectAll:le,clear:se}),[$.value,ae,ee,le,se]);let Ut=useMemo(()=>({selectionMode:d,submenuTrigger:k,isClosingOnSelect:T,checked:$.checked,indeterminate:$.indeterminate,activePath:f,className:V,submenuSx:h,canSelectRow:m,getItemCount:R$1,toggle:ue,requestClose:oe,onNodeClick:y,onSubmenuOpen:v,renderItem:H}),[d,k,T,$.checked,$.indeterminate,f,V,h,m,R$1,ue,oe,y,v,H]),Qt=B=>{w&&(o&&B.target instanceof Node&&o.contains(B.target)||oe("clickAway"));};return jsx(ke.Provider,{value:Ut,children:jsx(In,{onClickAway:Qt,children:jsx(R,{...g,ref:F,id:n,"data-testid":n??"MultiLevelMenu",open:w,anchorEl:o,placement:c,sx:J,onClick:B=>B.stopPropagation(),panelProps:{role:"menu",className:Eb(a.root,a.panel,V),"aria-multiselectable":d==="multiple"||void 0,"data-depth":0,"data-level-key":X.level.levelKey},children:jsx(ye,{options:X.options,level:X.level,depth:0,path:[]})})})})}var qt=memo(forwardRef(En));qt.displayName="MultiLevelMenu";var Tn=qt;
|
|
2
2
|
export{a,Tn as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,d,n}from'./chunk-
|
|
1
|
+
import {j,d,n}from'./chunk-KRRCTTGN.js';import {lb,Eb}from'./chunk-FHV4S2B3.js';import {Ej,Lj,Re}from'./chunk-TF7BQNJV.js';import {forwardRef,useState,useCallback,useImperativeHandle,useEffect,useMemo,memo}from'react';import {useDropzone}from'react-dropzone';import {styled,alpha}from'@mui/material/styles';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var i="os-shared-FileDropbox",e={root:`${i}-root`,header:`${i}-header`,title:`${i}-title`,format:`${i}-format`,zone:`${i}-zone`,content:`${i}-content`,textWrapper:`${i}-textWrapper`,maximum:`${i}-maximum`,upload:`${i}-upload`,uploadAgain:`${i}-uploadAgain`};var y=styled("div")(({theme:o})=>({textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:o.v2.spacing(32)})),f=styled("div")(()=>({paddingInline:"40px"})),s=styled(j,{shouldForwardProp:o=>o!=="$isError"})(({theme:o,$isError:l})=>{let{base:n,error:b}=o.v2.palette;return {color:l?b[500]:n.black,fontSize:"18px",fontWeight:600,lineHeight:"20px",marginBottom:o.v2.spacing(8)}});styled(j)(({theme:o})=>{let{base:l}=o.v2.palette;return {color:alpha(l.black,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"}});var u=styled("div",{shouldForwardProp:o=>o!=="$width"})(({theme:o,$width:l})=>{let{grey:n}=o.v2.palette;return {width:l||431,minHeight:176,border:"1px dashed #DDDDDD",borderRadius:o.v2.radius(8),padding:"24px 0",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n[50]}}),g=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:o.v2.spacing(24),color:"inherit",fontSize:"14px",lineHeight:"20px",cursor:"default"})),I=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:o.v2.spacing(8),color:"inherit"})),w=styled("div")(({theme:o})=>{let{base:l}=o.v2.palette;return {color:alpha(l.black,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"}}),O=styled("span")(()=>({fontWeight:600,textDecorationLine:"underline",cursor:"pointer"})),Q=styled("button")(({theme:o})=>{let{base:l,grey:n}=o.v2.palette;return {color:l.black,fontSize:"12px",fontWeight:500,lineHeight:"20px",padding:"4px 12px",borderRadius:o.v2.radius(4),border:`1px solid ${n[100]}`,backgroundColor:l.white,cursor:"pointer"}});var _=forwardRef(function({accept:l,footer:n$1,options:b,isLoading:S,progress:ee,error:P,errorHint:oe,subtitle:h,isSuccess:T,action:te,title:a,width:N,progressVariant:re,className:C,sx:$,id:d$1,invalidFileTypeText:R="Invalid file type",fileTooLargePrefix:j="File is larger than",uploadingText:le="Uploading...",waitText:ae="Please wait",uploadBulkFileText:ie="Upload bulk file",uploadAgainText:pe="Upload again",clickToUploadText:ne="Click to upload",orDragAndDropText:se="or drag and drop",maximumFileSizePrefix:de="Maximum file size",supportedFormatsPrefix:A="Supported formats"},xe){let[x,M]=useState([]),{getRootProps:ce,getInputProps:me,open:D,acceptedFiles:Z,isDragReject:E,fileRejections:m}=useDropzone(b),B=useCallback(()=>{M([]);},[]);useImperativeHandle(xe,()=>({open:D,clear:B}),[D,B]),useEffect(()=>{M(Z);},[Z]);let v=lb(b?.maxSize||0,0).toUpperCase(),c=useMemo(()=>{let be=m.length>0&&m[0].errors.some(W=>W.code==="file-invalid-type"),De=m.length>0&&m[0].errors.some(W=>W.code==="file-too-large");return E||be?R:De?`${j} ${v}`:P},[E,P,m,v,R,j]),z=useMemo(()=>x.length?jsxs(I,{className:e.textWrapper,children:[jsx("span",{children:x[0].name}),jsx(w,{className:e.maximum,children:lb(x[0].size)})]}):null,[x]);return T&&x.length&&!S?jsxs(y,{id:d$1,"data-testid":d$1??"FileDropbox",className:Eb(e.root,C),sx:$,children:[jsxs(f,{className:e.header,children:[typeof a=="string"?jsx(s,{className:e.title,children:a}):a??jsx(s,{className:e.title,children:"File uploaded"}),h]}),jsx(u,{className:e.zone,$width:N,children:jsxs(g,{"data-slot":"content",className:e.content,children:[T&&jsx(d,{src:Ej,alt:"Upload complete",sx:{width:56,height:56}}),z]})}),n$1]}):S&&x.length?jsxs(y,{id:d$1,"data-testid":d$1??"FileDropbox",className:Eb(e.root,C),sx:$,children:[jsxs(f,{className:e.header,children:[a&&typeof a!="string"?a:jsxs(Fragment,{children:[jsx(s,{className:e.title,children:typeof a=="string"?a:le}),jsx("span",{className:e.format,children:ae})]}),h]}),jsx(u,{className:e.zone,$width:N,children:jsxs(g,{"data-slot":"content",className:e.content,children:[S&&jsx(n,{size:56,value:ee,variant:re??"determinate"}),z]})}),n$1]}):jsxs(y,{id:d$1,"data-testid":d$1??"FileDropbox",className:Eb(e.root,C),sx:$,children:[jsxs(f,{className:e.header,children:[c?jsx(s,{$isError:true,className:e.title,children:c}):typeof a=="string"?jsx(s,{className:e.title,children:a}):a??jsx(s,{className:e.title,children:ie}),h||!!c&&jsx("span",{className:e.format,children:`${A}: xls, xlsx`})]}),jsxs(u,{className:e.zone,$width:N,...ce(),children:[jsx("input",{...me()}),jsxs(g,{"data-slot":"content",className:e.content,children:[jsx(d,{src:c?Lj:Re,alt:c?"Upload error":"Upload file",sx:{width:56,height:56}}),oe,z,te??jsx(Fragment,{children:c?jsx(Q,{type:"button",className:e.uploadAgain,onClick:D,children:pe}):jsxs(I,{className:e.textWrapper,children:[jsxs("span",{children:[jsx(O,{className:e.upload,onClick:D,children:ne})," ",se]}),jsxs(w,{className:e.maximum,children:[de," ",v]}),l&&jsxs("span",{className:e.format,children:[A," ",l]})]})})]})]}),n$1]})});_.displayName="FileDropbox";var L=memo(_);export{e as a,L as b};
|