@tap-payments/os-micro-frontend-shared 0.3.299 → 0.3.301

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.
Files changed (213) hide show
  1. package/build/_chunks/{chunk-MPXLNM5H.js → chunk-26OK5BYP.js} +1 -1
  2. package/build/_chunks/{chunk-ZWEVMVLG.js → chunk-4EOSR5FI.js} +1 -1
  3. package/build/_chunks/{chunk-I5DP4JJP.js → chunk-4IQ3J4LF.js} +1 -1
  4. package/build/_chunks/{chunk-ON73ZZC4.js → chunk-4NHNAJKD.js} +1 -1
  5. package/build/_chunks/{chunk-WO7POLIC.js → chunk-57D57K75.js} +1 -1
  6. package/build/_chunks/chunk-5OC2QXZL.js +1 -0
  7. package/build/_chunks/{chunk-RRCCQYTR.js → chunk-6LO7PI3V.js} +1 -1
  8. package/build/_chunks/{chunk-CUKFER4H.js → chunk-6UMTGWFW.js} +1 -1
  9. package/build/_chunks/{chunk-LLM6NHYM.js → chunk-6ZPNLCMN.js} +1 -1
  10. package/build/_chunks/{chunk-XGCSZNS4.js → chunk-76GQ37UR.js} +1 -1
  11. package/build/_chunks/{chunk-IFP6SF7C.js → chunk-7S2LHLZC.js} +1 -1
  12. package/build/_chunks/{chunk-CFSPFRLR.js → chunk-AN56DE5R.js} +1 -1
  13. package/build/_chunks/{chunk-G6PIEK53.js → chunk-BFBJOTG2.js} +1 -1
  14. package/build/_chunks/{chunk-LON5JVKL.js → chunk-BNKBYTQ3.js} +1 -1
  15. package/build/_chunks/{chunk-2HMREFM4.js → chunk-CFZR2VK2.js} +1 -1
  16. package/build/_chunks/{chunk-IBZBQ24S.js → chunk-D7JDLT2O.js} +1 -1
  17. package/build/_chunks/{chunk-JECD3SUJ.js → chunk-DFN7XD7P.js} +1 -1
  18. package/build/_chunks/{chunk-E4LADATG.js → chunk-DOK4RXSY.js} +1 -1
  19. package/build/_chunks/{chunk-K53Y4LIP.js → chunk-GDIPXZTC.js} +1 -1
  20. package/build/_chunks/{chunk-WFI7MJL2.js → chunk-GFEQDSYL.js} +1 -1
  21. package/build/_chunks/{chunk-MZ6XDK2C.js → chunk-HIGHKQAD.js} +1 -1
  22. package/build/_chunks/{chunk-VI3D56OM.js → chunk-HXJSH3G2.js} +1 -1
  23. package/build/_chunks/{chunk-VGYJZKKP.js → chunk-IHXFOGTQ.js} +1 -1
  24. package/build/_chunks/{chunk-DCMZFHWU.js → chunk-IM4LTXAH.js} +1 -1
  25. package/build/_chunks/chunk-JSTCL624.js +1 -0
  26. package/build/_chunks/{chunk-O2DVDEYE.js → chunk-JY4U45C5.js} +1 -1
  27. package/build/_chunks/{chunk-IPAS7KUG.js → chunk-K6633DSY.js} +1 -1
  28. package/build/_chunks/{chunk-TQTPWNPP.js → chunk-L2GLBT5H.js} +1 -1
  29. package/build/_chunks/{chunk-TIRLOG6N.js → chunk-LJWTINBT.js} +1 -1
  30. package/build/_chunks/{chunk-2OJIEX5A.js → chunk-LVK5VG43.js} +1 -1
  31. package/build/_chunks/{chunk-E5IKW34T.js → chunk-LZKPVI6B.js} +1 -1
  32. package/build/_chunks/chunk-MDHPSQZO.js +2 -0
  33. package/build/_chunks/{chunk-6HNOCQKM.js → chunk-MMXWSV6V.js} +1 -1
  34. package/build/_chunks/{chunk-XSKYIV6B.js → chunk-N57Z6DIM.js} +1 -1
  35. package/build/_chunks/{chunk-CJ3XF5H7.js → chunk-NOLYKMU3.js} +1 -1
  36. package/build/_chunks/{chunk-GZT6TVCH.js → chunk-NR5II44J.js} +1 -1
  37. package/build/_chunks/{chunk-2GYKNKWP.js → chunk-OBELDQWE.js} +1 -1
  38. package/build/_chunks/{chunk-2JVB4CBT.js → chunk-OHT5KJVT.js} +1 -1
  39. package/build/_chunks/{chunk-4WGNULKV.js → chunk-OJS6C6S6.js} +1 -1
  40. package/build/_chunks/{chunk-YUT3GEP2.js → chunk-P4S7PQWK.js} +1 -1
  41. package/build/_chunks/{chunk-TYSOX6NR.js → chunk-PEOYN7GO.js} +1 -1
  42. package/build/_chunks/{chunk-NK2VZN5J.js → chunk-PNLHCTCW.js} +1 -1
  43. package/build/_chunks/{chunk-ZBMJOLJG.js → chunk-PPO3PSE7.js} +1 -1
  44. package/build/_chunks/{chunk-H7V3RMFL.js → chunk-QLASTW76.js} +1 -1
  45. package/build/_chunks/chunk-RD4DGYOQ.js +1 -0
  46. package/build/_chunks/{chunk-O4DC2S3X.js → chunk-RL2HFGDQ.js} +1 -1
  47. package/build/_chunks/{chunk-IKGDJDP5.js → chunk-RXCJF7BB.js} +1 -1
  48. package/build/_chunks/{chunk-JRXEVVE6.js → chunk-S3EORDGB.js} +1 -1
  49. package/build/_chunks/{chunk-XS7CI5J5.js → chunk-SHUOO4XL.js} +1 -1
  50. package/build/_chunks/{chunk-4TI3DO2I.js → chunk-SXXIPX35.js} +1 -1
  51. package/build/_chunks/{chunk-WDPW2DRV.js → chunk-THSE46VC.js} +1 -1
  52. package/build/_chunks/{chunk-MXFH4OXG.js → chunk-TZZV6XFT.js} +1 -1
  53. package/build/_chunks/{chunk-Y4RJCNYA.js → chunk-UF4J7JEY.js} +1 -1
  54. package/build/_chunks/{chunk-DE3IY3MT.js → chunk-VBGXGFX5.js} +1 -1
  55. package/build/_chunks/{chunk-ZFPXHFBW.js → chunk-VDGOANGT.js} +1 -1
  56. package/build/_chunks/chunk-VYVRCIYJ.js +1 -0
  57. package/build/_chunks/{chunk-PIQOM3XU.js → chunk-W77B5KVI.js} +1 -1
  58. package/build/_chunks/{chunk-X5C35MQV.js → chunk-WE7OB4CG.js} +1 -1
  59. package/build/_chunks/{chunk-UPMCMJEB.js → chunk-WM3AFXCW.js} +1 -1
  60. package/build/_chunks/{chunk-KS662THD.js → chunk-WXWRA4VU.js} +1 -1
  61. package/build/_chunks/{chunk-YZFTHJHW.js → chunk-WYH4IUDI.js} +1 -1
  62. package/build/_chunks/{chunk-R36BQKUP.js → chunk-XFEWBGH5.js} +1 -1
  63. package/build/_chunks/{chunk-FREJYXH4.js → chunk-ZGVTCYRV.js} +1 -1
  64. package/build/components/ActionsDropdownMenu/index.js +1 -1
  65. package/build/components/Alert/index.js +1 -1
  66. package/build/components/AreaChart/index.js +1 -1
  67. package/build/components/Autocomplete/index.js +1 -1
  68. package/build/components/AvatarStack/index.js +1 -1
  69. package/build/components/Calender/index.js +1 -1
  70. package/build/components/Card/index.js +1 -1
  71. package/build/components/CardList/index.js +1 -1
  72. package/build/components/ColorPicker/index.js +1 -1
  73. package/build/components/ColumnViews/index.js +1 -1
  74. package/build/components/ConfirmDialog/index.js +1 -1
  75. package/build/components/CountryFlag/index.js +1 -1
  76. package/build/components/CurrenciesMenu/index.js +1 -1
  77. package/build/components/CurrencyAmount/index.js +1 -1
  78. package/build/components/CurrencyAmountInput/index.js +1 -1
  79. package/build/components/CurrencySymbol/index.js +1 -1
  80. package/build/components/DateFilter/index.js +1 -1
  81. package/build/components/DateInput/index.js +1 -1
  82. package/build/components/DeviceIcon/index.js +1 -1
  83. package/build/components/EmptyState/index.js +1 -1
  84. package/build/components/ErrorToast/index.js +1 -1
  85. package/build/components/ExpandableChip/index.js +1 -1
  86. package/build/components/ExportReportButton/index.js +1 -1
  87. package/build/components/FileDropbox/index.js +1 -1
  88. package/build/components/FilePreview/index.js +1 -1
  89. package/build/components/FileUploader/index.js +1 -1
  90. package/build/components/FilterBar/index.js +1 -1
  91. package/build/components/FilterButton/FilterButton.d.ts +4 -0
  92. package/build/components/FilterButton/constants.d.ts +22 -0
  93. package/build/components/FilterButton/icons.d.ts +3 -0
  94. package/build/components/FilterButton/index.d.ts +3 -0
  95. package/build/components/FilterButton/index.js +1 -0
  96. package/build/components/FilterButton/style.d.ts +10 -0
  97. package/build/components/FilterButton/type.d.ts +44 -0
  98. package/build/components/FilterChip/index.js +1 -1
  99. package/build/components/FilterPopover/FilterPopover.d.ts +4 -0
  100. package/build/components/FilterPopover/constants.d.ts +21 -0
  101. package/build/components/FilterPopover/hooks/useFilterPopover.d.ts +9 -0
  102. package/build/components/FilterPopover/index.d.ts +5 -0
  103. package/build/components/FilterPopover/index.js +1 -0
  104. package/build/components/FilterPopover/style.d.ts +26 -0
  105. package/build/components/FilterPopover/type.d.ts +64 -0
  106. package/build/components/FlipCard/index.js +1 -1
  107. package/build/components/GroupedSelect/index.js +1 -1
  108. package/build/components/HeatMap/index.js +1 -1
  109. package/build/components/ListHeader/components/index.d.ts +0 -1
  110. package/build/components/ListHeader/index.js +1 -1
  111. package/build/components/Loader/index.js +1 -1
  112. package/build/components/Logo/index.js +1 -1
  113. package/build/components/MaskedText/index.js +1 -1
  114. package/build/components/MultiLevelMenu/index.js +1 -1
  115. package/build/components/MultiLevelSelect/index.js +1 -1
  116. package/build/components/PhoneInput/index.js +1 -1
  117. package/build/components/ProgressRing/index.js +1 -1
  118. package/build/components/RadioGroup/index.js +1 -1
  119. package/build/components/RangeCalender/index.js +1 -1
  120. package/build/components/RatingCount/index.js +1 -1
  121. package/build/components/SearchButton/index.js +1 -1
  122. package/build/components/SearchInput/index.js +1 -1
  123. package/build/components/Select/index.js +1 -1
  124. package/build/components/SheetViewChip/index.js +1 -1
  125. package/build/components/Sidebar/index.js +1 -1
  126. package/build/components/StatusIcons/index.js +1 -1
  127. package/build/components/TableCells/index.js +1 -1
  128. package/build/components/TableViewToggleButton/TableViewToggleButton.d.ts +4 -0
  129. package/build/components/TableViewToggleButton/constants.d.ts +24 -0
  130. package/build/components/TableViewToggleButton/icons.d.ts +3 -0
  131. package/build/components/TableViewToggleButton/index.d.ts +3 -0
  132. package/build/components/TableViewToggleButton/index.js +1 -0
  133. package/build/components/TableViewToggleButton/style.d.ts +7 -0
  134. package/build/components/TableViewToggleButton/type.d.ts +26 -0
  135. package/build/components/TextInput/index.js +1 -1
  136. package/build/components/Timeline/index.js +1 -1
  137. package/build/components/Timepicker/index.js +1 -1
  138. package/build/components/VerificationIcon/index.js +1 -1
  139. package/build/components/VirtualTables/index.js +1 -1
  140. package/build/components/Window/index.js +1 -1
  141. package/build/components/WindowServices/index.js +1 -1
  142. package/build/components/WindowToolbar/index.js +1 -1
  143. package/build/components/index.d.ts +6 -7
  144. package/build/components/index.js +1 -1
  145. package/build/components/modules/JSONViewWindow/index.js +1 -1
  146. package/build/components/modules/RangeCalender/index.js +1 -1
  147. package/build/components/modules/VirtualTables/index.js +1 -1
  148. package/build/components/modules/WindowShell/index.js +1 -1
  149. package/build/components/modules/WindowShell/type.d.ts +1 -1
  150. package/build/components/modules/index.js +1 -1
  151. package/build/components/primitives/index.js +1 -1
  152. package/build/datetime/components/index.js +1 -1
  153. package/build/hooks/index.js +1 -1
  154. package/build/index.js +1 -1
  155. package/build/utils/index.js +1 -1
  156. package/build/utils/style.d.ts +3 -1
  157. package/package.json +1 -1
  158. package/build/_chunks/chunk-3DVDHBR2.js +0 -1
  159. package/build/_chunks/chunk-FZV63FZF.js +0 -1
  160. package/build/_chunks/chunk-LDGSDPQG.js +0 -1
  161. package/build/_chunks/chunk-S5UJ7YPE.js +0 -2
  162. package/build/_chunks/chunk-UIPXZKRC.js +0 -1
  163. package/build/components/CountryFilter/CountryFilter.d.ts +0 -14
  164. package/build/components/CountryFilter/index.d.ts +0 -3
  165. package/build/components/CountryFilter/index.js +0 -1
  166. package/build/components/CountryFilter/style.d.ts +0 -16
  167. package/build/components/FilterDropdown/FilterDropdown.d.ts +0 -22
  168. package/build/components/FilterDropdown/FilterDropdownContext.d.ts +0 -9
  169. package/build/components/FilterDropdown/components/BrandItem/BrandItem.d.ts +0 -12
  170. package/build/components/FilterDropdown/components/BrandItem/index.d.ts +0 -2
  171. package/build/components/FilterDropdown/components/BrandItem/style.d.ts +0 -4
  172. package/build/components/FilterDropdown/components/CountriesItem/CountriesItem.d.ts +0 -12
  173. package/build/components/FilterDropdown/components/CountriesItem/index.d.ts +0 -1
  174. package/build/components/FilterDropdown/components/CurrenciesItem/CurrenciesItem.d.ts +0 -12
  175. package/build/components/FilterDropdown/components/CurrenciesItem/index.d.ts +0 -1
  176. package/build/components/FilterDropdown/components/FlatMerchantsListMenu/FlatMerchantsListMenu.d.ts +0 -12
  177. package/build/components/FilterDropdown/components/FlatMerchantsListMenu/index.d.ts +0 -2
  178. package/build/components/FilterDropdown/components/FlatMerchantsListMenu/style.d.ts +0 -14
  179. package/build/components/FilterDropdown/components/MerchantItem/MerchantItem.d.ts +0 -13
  180. package/build/components/FilterDropdown/components/MerchantItem/index.d.ts +0 -2
  181. package/build/components/FilterDropdown/components/MerchantsFilterItem/MerchantsFilterItem.d.ts +0 -4
  182. package/build/components/FilterDropdown/components/MerchantsFilterItem/index.d.ts +0 -4
  183. package/build/components/FilterDropdown/components/MerchantsFilterItem/type.d.ts +0 -24
  184. package/build/components/FilterDropdown/components/MerchantsFilterItem/utils.d.ts +0 -20
  185. package/build/components/FilterDropdown/components/RetailersItem/RetailersItem.d.ts +0 -14
  186. package/build/components/FilterDropdown/components/RetailersItem/index.d.ts +0 -1
  187. package/build/components/FilterDropdown/components/RetailersItem/style.d.ts +0 -4
  188. package/build/components/FilterDropdown/components/index.d.ts +0 -6
  189. package/build/components/FilterDropdown/index.d.ts +0 -5
  190. package/build/components/FilterDropdown/index.js +0 -1
  191. package/build/components/FilterDropdown/style.d.ts +0 -25
  192. package/build/components/FilterDropdown/type.d.ts +0 -4
  193. package/build/components/Filters/index.d.ts +0 -1
  194. package/build/components/Filters/index.js +0 -1
  195. package/build/components/Filters/style.d.ts +0 -13
  196. package/build/components/ListColumnFilter/ListColumnFilter.d.ts +0 -17
  197. package/build/components/ListColumnFilter/index.d.ts +0 -1
  198. package/build/components/ListColumnFilter/index.js +0 -1
  199. package/build/components/ListColumnFilter/style.d.ts +0 -19
  200. package/build/components/ListHeader/components/ListHeaderSheetToggle.d.ts +0 -9
  201. package/build/components/ListLayout/ListLayout.d.ts +0 -4
  202. package/build/components/ListLayout/constants.d.ts +0 -4
  203. package/build/components/ListLayout/index.d.ts +0 -3
  204. package/build/components/ListLayout/index.js +0 -1
  205. package/build/components/ListLayout/style.d.ts +0 -4
  206. package/build/components/ListLayout/type.d.ts +0 -14
  207. package/build/components/PhoneFilter/PhoneFilter.d.ts +0 -10
  208. package/build/components/PhoneFilter/index.d.ts +0 -1
  209. package/build/components/PhoneFilter/index.js +0 -1
  210. package/build/components/StatusFilter/StatusFilter.d.ts +0 -15
  211. package/build/components/StatusFilter/index.d.ts +0 -1
  212. package/build/components/StatusFilter/index.js +0 -1
  213. package/build/components/StatusFilter/utils.d.ts +0 -4
@@ -1 +1 @@
1
- import {d,j}from'./chunk-LLM6NHYM.js';import {rb,ob,Hb}from'./chunk-6HNOCQKM.js';import {Lj,Re,Gb}from'./chunk-VRGBJY4Q.js';import {forwardRef,useState,useCallback,useMemo,memo}from'react';import {useDropzone}from'react-dropzone';import {styled}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var p="os-shared-FileUploader",a={root:`${p}-root`,content:`${p}-content`,iconWrapper:`${p}-iconWrapper`,textWrapper:`${p}-textWrapper`,upload:`${p}-upload`,maximum:`${p}-maximum`,errorMessage:`${p}-errorMessage`,closeButton:`${p}-closeButton`};var E=styled("div",{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:o})=>{let{grey:s}=e.v2.palette;return {width:"100%",borderRadius:e.v2.radius(4),padding:`${e.v2.spacing(4)} ${e.v2.spacing(8)}`,display:"flex",alignItems:"center",justifyContent:"flex-start",backgroundColor:s[50],gap:e.v2.spacing(8),cursor:o?"default":"pointer",position:"relative",'& [data-slot="input"]':{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:1,margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:1,whiteSpace:"nowrap"},...o&&{'& [data-slot="content"], & [data-slot="icon-wrapper"]':{cursor:"default",opacity:.6}}}}),V=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",color:"inherit",cursor:"pointer",gap:e.v2.spacing(8)})),v=styled("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:e.v2.spacing(4),color:"inherit"})),G=styled("div")(({theme:e})=>{let{grey:o,base:s}=e.v2.palette;return {display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:32,height:32,flexShrink:0,padding:e.v2.spacing(7),backgroundColor:s.white,borderRadius:e.v2.radius(4),border:`1px solid ${o[100]}`}}),H=styled("button")(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"transparent",border:"none",width:16,height:16,padding:0,marginLeft:"auto"}));function J(e,o){return e||(o?`PDF, JPG or PNG files up to ${o}`:"PDF, JPG or PNG files")}var pe="Click to upload",L=forwardRef(function({options:o,files:s,onChange:$,processFiles:U,disabled:f,error:I,invalidFileTypeText:P="Invalid file type",fileTooLargePrefix:W="File is larger than",maxFileSize:F,preventDuplicates:y,label:A=pe,hintText:K,onResetError:C,className:O,sx:Q,id:w},Y){let[S,g]=useState(null),T=useCallback(t=>{if(g(null),U)return U(t);if(!y)return t.map(r=>({file:r,id:r.name}));let l=[],n=[];for(let r of t)rb(r,s??[])?l.push(r.name):n.push({file:r,id:r.name});if(l.length>0){let r=l.length===1?"file":"files";g(`Duplicate ${r} detected: ${l.join(", ")}`);}return n},[s,y,U]),Z=useCallback(t=>{if(t.length===0){g(null);return}let l=T(t);(l.length>0||!y)&&$?.(l);},[T,y,$]),{getRootProps:_,getInputProps:ee,open:te,isDragReject:j$1,fileRejections:d$1}=useDropzone({...o,disabled:f||o?.disabled,onDrop:(t,l,n)=>{o?.onDrop?.(t,l,n),Z(t);}}),x=useMemo(()=>{if(F)return F;if(o?.maxSize)return ob(o.maxSize,0).toUpperCase()},[F,o?.maxSize]),c=useMemo(()=>{let t=!!d$1?.length&&d$1.some(n=>n.errors?.some(r=>r.code==="file-invalid-type"));return !!d$1?.length&&d$1.some(n=>n.errors?.some(r=>r.code==="file-too-large"))&&x?`${W} ${x}`:t||j$1?P:S||I},[j$1,d$1,x,S,I,P,W]),oe=J(K,x),re=useCallback(t=>{t.stopPropagation(),g(null),C?.(t);},[C]);return jsxs(E,{ref:Y,id:w,"data-testid":w??"FileUploader",..._(),className:Hb(a.root,O),sx:Q,$disabled:f,onClick:f?void 0:te,children:[jsx("input",{"data-slot":"input",...ee(),disabled:f}),jsxs(V,{"data-slot":"content",className:a.content,children:[jsx(G,{"data-slot":"icon-wrapper",className:a.iconWrapper,children:jsx(d,{src:c?Lj:Re,alt:c?"Upload error":"Upload file",sx:{width:16,height:16}})}),c?jsxs(v,{className:a.textWrapper,children:[jsx(j,{textVariant:"micro.medium",className:a.errorMessage,sx:t=>({color:t.v2.palette.error[500]}),children:c}),jsx(j,{textVariant:"caption.medium",className:a.upload,children:"Click to upload again"})]}):jsxs(v,{className:a.textWrapper,children:[jsx(j,{textVariant:"caption.medium",className:a.upload,children:A}),jsx(j,{textVariant:"micro.medium",className:a.maximum,sx:{opacity:.7},children:oe})]})]}),c&&C&&jsx(H,{type:"button","data-slot":"close-icon-wrapper",className:a.closeButton,onClick:re,"aria-label":"Dismiss upload error",children:jsx(d,{src:Gb,alt:"Dismiss",sx:{width:10,height:10}})})]})});L.displayName="FileUploader";var X=memo(L);export{a,X as b};
1
+ import {d,j}from'./chunk-6ZPNLCMN.js';import {rb,ob,Hb}from'./chunk-MMXWSV6V.js';import {Lj,Re,Gb}from'./chunk-VRGBJY4Q.js';import {forwardRef,useState,useCallback,useMemo,memo}from'react';import {useDropzone}from'react-dropzone';import {styled}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var p="os-shared-FileUploader",a={root:`${p}-root`,content:`${p}-content`,iconWrapper:`${p}-iconWrapper`,textWrapper:`${p}-textWrapper`,upload:`${p}-upload`,maximum:`${p}-maximum`,errorMessage:`${p}-errorMessage`,closeButton:`${p}-closeButton`};var E=styled("div",{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:o})=>{let{grey:s}=e.v2.palette;return {width:"100%",borderRadius:e.v2.radius(4),padding:`${e.v2.spacing(4)} ${e.v2.spacing(8)}`,display:"flex",alignItems:"center",justifyContent:"flex-start",backgroundColor:s[50],gap:e.v2.spacing(8),cursor:o?"default":"pointer",position:"relative",'& [data-slot="input"]':{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:1,margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:1,whiteSpace:"nowrap"},...o&&{'& [data-slot="content"], & [data-slot="icon-wrapper"]':{cursor:"default",opacity:.6}}}}),V=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",color:"inherit",cursor:"pointer",gap:e.v2.spacing(8)})),v=styled("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:e.v2.spacing(4),color:"inherit"})),G=styled("div")(({theme:e})=>{let{grey:o,base:s}=e.v2.palette;return {display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:32,height:32,flexShrink:0,padding:e.v2.spacing(7),backgroundColor:s.white,borderRadius:e.v2.radius(4),border:`1px solid ${o[100]}`}}),H=styled("button")(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"transparent",border:"none",width:16,height:16,padding:0,marginLeft:"auto"}));function J(e,o){return e||(o?`PDF, JPG or PNG files up to ${o}`:"PDF, JPG or PNG files")}var pe="Click to upload",L=forwardRef(function({options:o,files:s,onChange:$,processFiles:U,disabled:f,error:I,invalidFileTypeText:P="Invalid file type",fileTooLargePrefix:W="File is larger than",maxFileSize:F,preventDuplicates:y,label:A=pe,hintText:K,onResetError:C,className:O,sx:Q,id:w},Y){let[S,g]=useState(null),T=useCallback(t=>{if(g(null),U)return U(t);if(!y)return t.map(r=>({file:r,id:r.name}));let l=[],n=[];for(let r of t)rb(r,s??[])?l.push(r.name):n.push({file:r,id:r.name});if(l.length>0){let r=l.length===1?"file":"files";g(`Duplicate ${r} detected: ${l.join(", ")}`);}return n},[s,y,U]),Z=useCallback(t=>{if(t.length===0){g(null);return}let l=T(t);(l.length>0||!y)&&$?.(l);},[T,y,$]),{getRootProps:_,getInputProps:ee,open:te,isDragReject:j$1,fileRejections:d$1}=useDropzone({...o,disabled:f||o?.disabled,onDrop:(t,l,n)=>{o?.onDrop?.(t,l,n),Z(t);}}),x=useMemo(()=>{if(F)return F;if(o?.maxSize)return ob(o.maxSize,0).toUpperCase()},[F,o?.maxSize]),c=useMemo(()=>{let t=!!d$1?.length&&d$1.some(n=>n.errors?.some(r=>r.code==="file-invalid-type"));return !!d$1?.length&&d$1.some(n=>n.errors?.some(r=>r.code==="file-too-large"))&&x?`${W} ${x}`:t||j$1?P:S||I},[j$1,d$1,x,S,I,P,W]),oe=J(K,x),re=useCallback(t=>{t.stopPropagation(),g(null),C?.(t);},[C]);return jsxs(E,{ref:Y,id:w,"data-testid":w??"FileUploader",..._(),className:Hb(a.root,O),sx:Q,$disabled:f,onClick:f?void 0:te,children:[jsx("input",{"data-slot":"input",...ee(),disabled:f}),jsxs(V,{"data-slot":"content",className:a.content,children:[jsx(G,{"data-slot":"icon-wrapper",className:a.iconWrapper,children:jsx(d,{src:c?Lj:Re,alt:c?"Upload error":"Upload file",sx:{width:16,height:16}})}),c?jsxs(v,{className:a.textWrapper,children:[jsx(j,{textVariant:"micro.medium",className:a.errorMessage,sx:t=>({color:t.v2.palette.error[500]}),children:c}),jsx(j,{textVariant:"caption.medium",className:a.upload,children:"Click to upload again"})]}):jsxs(v,{className:a.textWrapper,children:[jsx(j,{textVariant:"caption.medium",className:a.upload,children:A}),jsx(j,{textVariant:"micro.medium",className:a.maximum,sx:{opacity:.7},children:oe})]})]}),c&&C&&jsx(H,{type:"button","data-slot":"close-icon-wrapper",className:a.closeButton,onClick:re,"aria-label":"Dismiss upload error",children:jsx(d,{src:Gb,alt:"Dismiss",sx:{width:10,height:10}})})]})});L.displayName="FileUploader";var X=memo(L);export{a,X as b};
@@ -1 +1 @@
1
- import {T,S as S$1,b as b$1}from'./chunk-LLM6NHYM.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 x=styled(T)(({theme:o})=>({[`& .${S$1.title}`]:{fontSize:"13px",fontWeight:700,lineHeight:o.typography.h6.lineHeight,borderBottom:`1px solid ${o.palette.divider}`,margin:0,padding:"16px 16px 16px 12px",color:o.palette.text.primary}})),y=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing(2),minWidth:"256px",padding:o.spacing(2)})),p=styled(b$1)(({theme:o})=>({paddingInline:o.spacing(3),paddingBlock:o.spacing(1),borderRadius:o.spacing(.5),minWidth:64,fontSize:"11px",fontWeight:o.typography.fontWeightMedium,color:o.palette.text.primary,textTransform:"none",border:`1px solid ${o.palette.divider}`,boxShadow:"none","&:hover":{boxShadow:"none",backgroundColor:o.palette.action.hover}})),D=styled("p")(({theme:o})=>({margin:0,fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:o.typography.body1.lineHeight})),S=styled("div")(({theme:o})=>({display:"flex",gap:o.spacing(1),justifyContent:"flex-end"}));var b=forwardRef(({message:o,title:t,confirmText:a,cancelText:i,onConfirm:r,onCancel:s,className:m,sx:e,...n},d)=>jsx(x,{ref:d,"data-testid":"ConfirmDialog",heading:t,className:m,sx:e,...n,children:jsxs(y,{children:[jsx(D,{children:o}),jsxs(S,{children:[jsx(p,{variant:"ghost",onClick:s,children:i||"No"}),jsx(p,{variant:"ghost",onClick:r,children:a||"Yes"})]})]})}));b.displayName="ConfirmDialog";var h=memo(b);var g=createContext(null);function M(){let o=useContext(g);if(!o)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return o}var H={open:false,message:null,title:void 0,confirmText:void 0,cancelText:void 0,sx:void 0,dismissible:true};function z({children:o}){let[t,a]=useState(H),i=useRef(null),r=useCallback(e=>{let n=i.current;n&&(i.current=null,a(d=>({...d,open:false})),n(e));},[]),s=useCallback(e=>new Promise(n=>{i.current?.(false),i.current=n,a({open:true,dismissible:e.dismissible??true,message:e.message,title:e.title,confirmText:e.confirmText,cancelText:e.cancelText,sx:e.sx});}),[]),m=useMemo(()=>({confirm:s}),[s]);return jsxs(g.Provider,{value:m,children:[o,jsx(h,{open:t.open,message:t.message,title:t.title,confirmText:t.confirmText,cancelText:t.cancelText,onConfirm:()=>r(true),onCancel:()=>r(false),onClose:t.dismissible?()=>r(false):void 0,sx:t.sx})]})}var O=memo(z);export{M as a,O as b};
1
+ import {T,S as S$1,b as b$1}from'./chunk-6ZPNLCMN.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 x=styled(T)(({theme:o})=>({[`& .${S$1.title}`]:{fontSize:"13px",fontWeight:700,lineHeight:o.typography.h6.lineHeight,borderBottom:`1px solid ${o.palette.divider}`,margin:0,padding:"16px 16px 16px 12px",color:o.palette.text.primary}})),y=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing(2),minWidth:"256px",padding:o.spacing(2)})),p=styled(b$1)(({theme:o})=>({paddingInline:o.spacing(3),paddingBlock:o.spacing(1),borderRadius:o.spacing(.5),minWidth:64,fontSize:"11px",fontWeight:o.typography.fontWeightMedium,color:o.palette.text.primary,textTransform:"none",border:`1px solid ${o.palette.divider}`,boxShadow:"none","&:hover":{boxShadow:"none",backgroundColor:o.palette.action.hover}})),D=styled("p")(({theme:o})=>({margin:0,fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:o.typography.body1.lineHeight})),S=styled("div")(({theme:o})=>({display:"flex",gap:o.spacing(1),justifyContent:"flex-end"}));var b=forwardRef(({message:o,title:t,confirmText:a,cancelText:i,onConfirm:r,onCancel:s,className:m,sx:e,...n},d)=>jsx(x,{ref:d,"data-testid":"ConfirmDialog",heading:t,className:m,sx:e,...n,children:jsxs(y,{children:[jsx(D,{children:o}),jsxs(S,{children:[jsx(p,{variant:"ghost",onClick:s,children:i||"No"}),jsx(p,{variant:"ghost",onClick:r,children:a||"Yes"})]})]})}));b.displayName="ConfirmDialog";var h=memo(b);var g=createContext(null);function M(){let o=useContext(g);if(!o)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return o}var H={open:false,message:null,title:void 0,confirmText:void 0,cancelText:void 0,sx:void 0,dismissible:true};function z({children:o}){let[t,a]=useState(H),i=useRef(null),r=useCallback(e=>{let n=i.current;n&&(i.current=null,a(d=>({...d,open:false})),n(e));},[]),s=useCallback(e=>new Promise(n=>{i.current?.(false),i.current=n,a({open:true,dismissible:e.dismissible??true,message:e.message,title:e.title,confirmText:e.confirmText,cancelText:e.cancelText,sx:e.sx});}),[]),m=useMemo(()=>({confirm:s}),[s]);return jsxs(g.Provider,{value:m,children:[o,jsx(h,{open:t.open,message:t.message,title:t.title,confirmText:t.confirmText,cancelText:t.cancelText,onConfirm:()=>r(true),onCancel:()=>r(false),onClose:t.dismissible?()=>r(false):void 0,sx:t.sx})]})}var O=memo(z);export{M as a,O as b};
@@ -1,2 +1,2 @@
1
- import {V,f,l,R,n,v,L as L$1,da,Q}from'./chunk-LLM6NHYM.js';import {Hb}from'./chunk-6HNOCQKM.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:Hb(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:Hb(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:Hb(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-6ZPNLCMN.js';import {Hb}from'./chunk-MMXWSV6V.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:Hb(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:Hb(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:Hb(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 {h as h$1,i,b as b$1,c as c$2,f as f$2,e,d as d$1,j as j$1}from'./chunk-GZT6TVCH.js';import {f,g,h as h$2,i as i$1,b}from'./chunk-YUT3GEP2.js';import {d,c as c$1}from'./chunk-MXFH4OXG.js';import {h,c,f as f$1}from'./chunk-ISC5KT5E.js';import {Gb,Hb}from'./chunk-6HNOCQKM.js';import'./chunk-VRGBJY4Q.js';import {memo,forwardRef,useState,useEffect,useRef}from'react';import {createPortal}from'react-dom';import oo from'@mui/material/Backdrop';import {styled,alpha}from'@mui/material/styles';import v from'@mui/material/Box';import {motion,animate}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var H="os-shared-WindowShell",x={root:`${H}-root`,sidebar:`${H}-sidebar`,body:`${H}-body`,panel:`${H}-panel`};var we=styled(v)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",backgroundColor:"transparent"})),xe=styled(v)(()=>({flexShrink:0,overflow:"hidden auto",backgroundColor:"transparent",transition:"none"})),be=styled(v)(({theme:e})=>({flexShrink:0,overflow:"hidden auto",borderLeft:`1px solid ${e.palette.divider}`,backgroundColor:"transparent",transition:"none"})),ye=styled(v)(()=>({display:"flex",flexDirection:"column",flex:1,minWidth:0,minHeight:0})),ze=styled(v,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative",width:e})),Ne=styled(motion.div)(()=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative"})),Ce=styled(motion.div,{shouldForwardProp:e=>e!=="$slotWidth"})(({$slotWidth:e})=>({width:e,minWidth:e,minHeight:"100%",height:"100%",overflow:"hidden"})),Ie=styled(v,{shouldForwardProp:e=>e!=="$visible"&&e!=="$duration"})(({$visible:e=true,$duration:o=h})=>({display:"flex",alignItems:"center",overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,maxWidth:e?160:0,opacity:e?1:0,pointerEvents:e?"auto":"none",transition:o>0?`max-width ${.3*o}s ease-in-out, opacity ${.24*o}s ease-in-out`:"none"})),Te=styled(h$1,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e}:null})),Pe=styled(i,{shouldForwardProp:e=>e!=="$width"&&e!=="$justifyContent"})(({$width:e,$justifyContent:o="flex-start"})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e,justifyContent:o}:null}));var Ue=220;function ge(e,o,a){return Math.min(Math.max(e,o??0),a??1/0)}function Ae(e,o,a,n){if(Math.abs(e-o)<=1)return;let r=animate(0,1,{duration:a,onUpdate:t=>{n(s=>({...s,width:e+(o-e)*t}));}});return ()=>r.stop()}function G(e,o){if(e===false)return {duration:0,resize:o};let a=typeof e=="object"?e:void 0,n=a?.duration;return {duration:typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):h,resize:a?.resize??o}}function j(e){return e?.children==null||e.expand?.isExpanded===false?false:e.expand?.isExpanded===true}function F(e,o=Ue){let a=Array.isArray(e)?e.flat():[e];for(let n=a.length-1;n>=0;n--){let r=a[n];if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.width=="number")return r.width}return o}function Ee(e){let o=e["data-id"]??e.id;return o!=null?{"data-id":o}:{}}function Me({kind:e,slot:o,isOpen:a,fullWidth:n,wrapperWidth:r,animateWrapperWidth:t,animation:s}){let p=e==="sidebar"?xe:be,d=e==="sidebar"?x.sidebar:x.panel,m=o["data-testid"]?`${o["data-testid"]}Wrapper`:e==="sidebar"?"WindowShellSidebarWrapper":"WindowShellPanelWrapper",i=o["data-testid"]??o.id??(e==="sidebar"?"WindowShellSidebar":"WindowShellPanel"),l=Ee(o),u=jsx(p,{id:o.id,className:Hb(d,o.className),"data-testid":i,...l,sx:Gb({width:n,minWidth:0},o.sx),children:jsx(Ce,{$slotWidth:n,initial:false,animate:{x:a?0:-n},transition:{duration:s.duration},children:o.children})});return t?jsx(Ne,{"data-testid":m,...l,initial:false,animate:{width:r},transition:{duration:s.duration},children:u}):jsx(ze,{"data-testid":m,...l,$width:r,children:u})}Me.displayName="WindowShellSlotColumn";var J=memo(Me);function De({baseWindowWidth:e,sidebar:o,panel:a,content:n,bodyContent:r,sidebarOpen:t,showPanel:s,sidebarFullWidth:p,panelFullWidth:d,sidebarAnimation:m,panelAnimation:i}){let{size:l}=b(),u=i.resize==="window",W=typeof e=="number"?Math.max(0,e-(u?d:0)-(m.resize==="window"&&!t?p:0)):l.width,b$1=u?s?Math.min(d,Math.max(0,l.width-W)):0:s?d:0,y=t?p:0;return jsxs(we,{className:Hb(x.root),children:[o?.children?jsx(J,{kind:"sidebar",slot:o,isOpen:t,fullWidth:p,wrapperWidth:y,animateWrapperWidth:true,animation:m}):null,jsx(ye,{id:n?.id?`${n.id}Body`:void 0,className:Hb(x.body,n?.className),"data-testid":n?.["data-testid"]?`${n["data-testid"]}Body`:n?.id?`${n.id}Body`:"WindowShellBody",...(n?.["data-id"]??n?.id)!=null?{"data-id":n?.["data-id"]?`${n["data-id"]}Body`:`${n?.id}Body`}:null,sx:n?.sx,children:r}),a?.children?jsx(J,{kind:"panel",slot:a,isOpen:s,fullWidth:d,wrapperWidth:b$1,animateWrapperWidth:!u,animation:i}):null]})}De.displayName="WindowShellSlotsLayout";var Re=memo(De);function $e({sidebarOpen:e,showPanel:o,sidebarResize:a,panelResize:n,sidebarDuration:r,panelDuration:t}){let{size:s,setSize:p,defaultSize:d,minSize:m,maxSize:i}=b(),l=useRef(s);l.current=s;let u=useRef(d.width),W=useRef(e),b$1=useRef(o),y=useRef(d.width);return useEffect(()=>{let C=b$1.current!==o,w=W.current!==e,E=y.current!==d.width;b$1.current=o,W.current=e,y.current=d.width;let S;if(w&&a==="window"?S=r:(C&&n==="window"||E&&!C&&!w)&&(S=t),S==null)return;let h=ge(d.width,m?.width,i?.width);return u.current=h,Ae(l.current.width,h,S,p)},[d.width,o,e,a,n,r,t,m?.width,i?.width,p]),null}$e.displayName="WindowShellAnimator";var Oe=memo($e);function ve({toolbar:e$1,sidebar:o,panel:a,animationDuration:n=h}){let{title:r,titleIcon:t,onClose:s,onMinimize:p,onMaximize:d,startAdornment:m,endAdornment:i,id:l,className:u,"data-testid":W,"data-id":b$2,sx:y}=e$1??{},{isMaximized:C}=b(),w=typeof s=="function"?s:void 0,E=typeof p=="function"?p:void 0,S=typeof d=="function"?d:void 0,h=o?.expand,c=a?.expand,z=j(a),L=h?.isExpanded??true,M=h!=null&&o?.children!=null,D=c!=null&&a?.children!=null&&z,k=M&&D,V=F(a?.sx),_=o!=null?F(o.sx):0,I=Math.max(_,V),T=k&&L?I:void 0,Z=D?I:void 0,X=D;return jsxs(b$1,{id:l??f$1,className:u,"data-testid":W??l??"WindowToolbar","data-id":b$2??l,sx:y,children:[jsxs(Te,{$width:T,children:[w?jsx(c$2,{onClick:w}):null,E?jsx(f$2,{onClick:E}):null,S?jsx(e,{isMaximized:C,onClick:S}):null,M&&h?jsx(d$1,{direction:h.isExpanded??true?"left":"right",active:h.isExpanded??true,onClick:h.onExpand,children:h.label}):null,m]}),jsx(j$1,{title:r,icon:t}),jsxs(Pe,{$width:Z,$justifyContent:i?"space-between":"flex-start",children:[D?jsx(Ie,{$visible:X,$duration:n,children:jsx(d$1,{sx:{flexShrink:0},direction:c?.isExpanded??true?"left":"right",active:z,onClick:c?.onExpand,children:c?.label})}):null,i]})]})}ve.displayName="WindowShellToolbar";var Fe=memo(ve);var Be=forwardRef(function({isOpen:o,className:a,sx:n,toolbar:r,services:t,sidebar:s,panel:p,footer:d$1,content:m,window:i,backdrop:l},u){let W=t?.list??[],b=(t?.isLoading??false)||W.length>0,y=d$1!=null&&(d$1.isVisible??true),C=s?.children,w=F(s?.sx),E=p?.children,S=p!=null?F(p.sx):0,h=m?.children,c$2=s?.expand?.isExpanded??C!=null,z=j(p),L=!!(C||E),[M,D]=useState(w),[k,V]=useState(S);useEffect(()=>{c$2&&D(w),z&&V(S);},[c$2,w,z,S]);let _=r?.onClose??r?.onMinimize??(()=>{}),I=G(s?.animation,"in-place"),T=G(p?.animation,"in-place"),Z=(()=>{let P=i?.defaultSize;if(typeof P?.width!="number")return P;let oe=(I.resize==="window"&&!c$2?M:0)+(T.resize==="window"&&!z?k:0);return oe>0?{...P,width:Math.max(0,P.width-oe)}:P})(),X={height:i?.minSize?.height??i?.defaultSize?.height??c,...i?.minSize?.width!=null?{width:i.minSize.width}:null},Le=l!=null&&(l.isVisible??true)&&o&&!i?.isMinimized,_e=(i?.order??0)+10-1,ee=jsx(oo,{open:true,onClick:_,id:l?.id,className:l?.className,"data-testid":l?.["data-testid"]??l?.id??"WindowShellBackdrop",...(l?.["data-id"]??l?.id)!=null?{"data-id":l?.["data-id"]??l?.id}:null,sx:Gb({zIndex:_e,backgroundColor:P=>alpha(P.palette.common.black,.3)},l?.sx)});return jsxs(Fragment,{children:[Le&&(i?.disablePortal?ee:createPortal(ee,document.body)),jsxs(f,{ref:u,isOpen:o,onClose:_,defaultSize:Z,minSize:X,maxSize:i?.maxSize,defaultPosition:i?.defaultPosition,containerRef:i?.containerRef,order:i?.order,isMinimized:i?.isMinimized,isMaximized:i?.isMaximized,id:i?.id,className:Hb(x.root,i?.className,a),sx:n,onResize:i?.onResize,onDragStart:i?.onDragStart,onMouseDown:i?.onMouseDown,onClick:i?.onClick,disablePortal:i?.disablePortal,"data-testid":i?.["data-testid"]??i?.id,"data-id":i?.["data-id"]??i?.id,children:[jsx(Oe,{sidebarOpen:c$2,showPanel:z,sidebarWidth:M,panelWidth:k,sidebarResize:I.resize,panelResize:T.resize,sidebarDuration:I.duration,panelDuration:T.duration}),jsx(Fe,{toolbar:r,sidebar:s,panel:p,animationDuration:T.duration}),b?t?.isLoading?jsx(d,{appCode:t?.appCode,id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:Gb({height:"auto",flexShrink:0},t?.sx)}):jsx(c$1,{services:W,serviceCode:t?.activeCode??"",onOpenService:t?.onOpen,onOpenServiceInNewWindow:t?.onOpenInNewWindow,language:t?.language??"en",openInNewWindowLabel:t?.openInNewWindowLabel??"Open in new window",id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:t?.sx}):null,jsx(g,{id:m?.id,className:m?.className,"data-testid":m?.["data-testid"]??m?.id,"data-id":m?.["data-id"]??m?.id,sx:L?void 0:m?.sx,children:L?jsx(Re,{baseWindowWidth:typeof i?.defaultSize?.width=="number"?i.defaultSize.width:void 0,sidebar:s,panel:p,content:m,bodyContent:h,sidebarOpen:c$2,showPanel:z,sidebarFullWidth:M,panelFullWidth:k,sidebarAnimation:I,panelAnimation:T}):h}),y?jsxs(h$2,{id:d$1?.id,className:d$1?.className,"data-testid":d$1?.["data-testid"]??d$1?.id,"data-id":d$1?.["data-id"]??d$1?.id,sx:d$1?.isVisible===true?Gb(d$1?.sx??{},{"&:empty, &:has(> :only-child:empty)":{display:"flex"}}):d$1?.sx,children:[d$1?.children,d$1?.actions?jsx(i$1,{children:d$1.actions}):null]}):null]})]})});Be.displayName="WindowShell";var to=memo(Be);export{x as a,to as b};
1
+ import {f,g,h as h$2,i as i$1,b}from'./chunk-P4S7PQWK.js';import {d,c as c$1}from'./chunk-TZZV6XFT.js';import {h as h$1,i,b as b$1,c as c$2,f as f$2,e,d as d$1,j as j$1}from'./chunk-NR5II44J.js';import {h,c,f as f$1}from'./chunk-ISC5KT5E.js';import {Gb,Hb}from'./chunk-MMXWSV6V.js';import'./chunk-VRGBJY4Q.js';import {memo,forwardRef,useState,useEffect,useRef}from'react';import {createPortal}from'react-dom';import oo from'@mui/material/Backdrop';import {styled,alpha}from'@mui/material/styles';import v from'@mui/material/Box';import {motion,animate}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var H="os-shared-WindowShell",x={root:`${H}-root`,sidebar:`${H}-sidebar`,body:`${H}-body`,panel:`${H}-panel`};var we=styled(v)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",backgroundColor:"transparent"})),xe=styled(v)(()=>({flexShrink:0,overflow:"hidden auto",backgroundColor:"transparent",transition:"none"})),be=styled(v)(({theme:e})=>({flexShrink:0,overflow:"hidden auto",borderLeft:`1px solid ${e.palette.divider}`,backgroundColor:"transparent",transition:"none"})),ye=styled(v)(()=>({display:"flex",flexDirection:"column",flex:1,minWidth:0,minHeight:0})),ze=styled(v,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative",width:e})),Ne=styled(motion.div)(()=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative"})),Ce=styled(motion.div,{shouldForwardProp:e=>e!=="$slotWidth"})(({$slotWidth:e})=>({width:e,minWidth:e,minHeight:"100%",height:"100%",overflow:"hidden"})),Ie=styled(v,{shouldForwardProp:e=>e!=="$visible"&&e!=="$duration"})(({$visible:e=true,$duration:o=h})=>({display:"flex",alignItems:"center",overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,maxWidth:e?160:0,opacity:e?1:0,pointerEvents:e?"auto":"none",transition:o>0?`max-width ${.3*o}s ease-in-out, opacity ${.24*o}s ease-in-out`:"none"})),Te=styled(h$1,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e}:null})),Pe=styled(i,{shouldForwardProp:e=>e!=="$width"&&e!=="$justifyContent"})(({$width:e,$justifyContent:o="flex-start"})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e,justifyContent:o}:null}));var Ue=220;function ge(e,o,a){return Math.min(Math.max(e,o??0),a??1/0)}function Ae(e,o,a,n){if(Math.abs(e-o)<=1)return;let r=animate(0,1,{duration:a,onUpdate:t=>{n(s=>({...s,width:e+(o-e)*t}));}});return ()=>r.stop()}function G(e,o){if(e===false)return {duration:0,resize:o};let a=typeof e=="object"?e:void 0,n=a?.duration;return {duration:typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):h,resize:a?.resize??o}}function j(e){return e?.children==null||e.expand?.isExpanded===false?false:e.expand?.isExpanded===true}function F(e,o=Ue){let a=Array.isArray(e)?e.flat():[e];for(let n=a.length-1;n>=0;n--){let r=a[n];if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.width=="number")return r.width}return o}function Ee(e){let o=e["data-id"]??e.id;return o!=null?{"data-id":o}:{}}function Me({kind:e,slot:o,isOpen:a,fullWidth:n,wrapperWidth:r,animateWrapperWidth:t,animation:s}){let p=e==="sidebar"?xe:be,d=e==="sidebar"?x.sidebar:x.panel,m=o["data-testid"]?`${o["data-testid"]}Wrapper`:e==="sidebar"?"WindowShellSidebarWrapper":"WindowShellPanelWrapper",i=o["data-testid"]??o.id??(e==="sidebar"?"WindowShellSidebar":"WindowShellPanel"),l=Ee(o),u=jsx(p,{id:o.id,className:Hb(d,o.className),"data-testid":i,...l,sx:Gb({width:n,minWidth:0},o.sx),children:jsx(Ce,{$slotWidth:n,initial:false,animate:{x:a?0:-n},transition:{duration:s.duration},children:o.children})});return t?jsx(Ne,{"data-testid":m,...l,initial:false,animate:{width:r},transition:{duration:s.duration},children:u}):jsx(ze,{"data-testid":m,...l,$width:r,children:u})}Me.displayName="WindowShellSlotColumn";var J=memo(Me);function De({baseWindowWidth:e,sidebar:o,panel:a,content:n,bodyContent:r,sidebarOpen:t,showPanel:s,sidebarFullWidth:p,panelFullWidth:d,sidebarAnimation:m,panelAnimation:i}){let{size:l}=b(),u=i.resize==="window",W=typeof e=="number"?Math.max(0,e-(u?d:0)-(m.resize==="window"&&!t?p:0)):l.width,b$1=u?s?Math.min(d,Math.max(0,l.width-W)):0:s?d:0,y=t?p:0;return jsxs(we,{className:Hb(x.root),children:[o?.children?jsx(J,{kind:"sidebar",slot:o,isOpen:t,fullWidth:p,wrapperWidth:y,animateWrapperWidth:true,animation:m}):null,jsx(ye,{id:n?.id?`${n.id}Body`:void 0,className:Hb(x.body,n?.className),"data-testid":n?.["data-testid"]?`${n["data-testid"]}Body`:n?.id?`${n.id}Body`:"WindowShellBody",...(n?.["data-id"]??n?.id)!=null?{"data-id":n?.["data-id"]?`${n["data-id"]}Body`:`${n?.id}Body`}:null,sx:n?.sx,children:r}),a?.children?jsx(J,{kind:"panel",slot:a,isOpen:s,fullWidth:d,wrapperWidth:b$1,animateWrapperWidth:!u,animation:i}):null]})}De.displayName="WindowShellSlotsLayout";var Re=memo(De);function $e({sidebarOpen:e,showPanel:o,sidebarResize:a,panelResize:n,sidebarDuration:r,panelDuration:t}){let{size:s,setSize:p,defaultSize:d,minSize:m,maxSize:i}=b(),l=useRef(s);l.current=s;let u=useRef(d.width),W=useRef(e),b$1=useRef(o),y=useRef(d.width);return useEffect(()=>{let C=b$1.current!==o,w=W.current!==e,E=y.current!==d.width;b$1.current=o,W.current=e,y.current=d.width;let S;if(w&&a==="window"?S=r:(C&&n==="window"||E&&!C&&!w)&&(S=t),S==null)return;let h=ge(d.width,m?.width,i?.width);return u.current=h,Ae(l.current.width,h,S,p)},[d.width,o,e,a,n,r,t,m?.width,i?.width,p]),null}$e.displayName="WindowShellAnimator";var Oe=memo($e);function ve({toolbar:e$1,sidebar:o,panel:a,animationDuration:n=h}){let{title:r,titleIcon:t,onClose:s,onMinimize:p,onMaximize:d,startAdornment:m,endAdornment:i,id:l,className:u,"data-testid":W,"data-id":b$2,sx:y}=e$1??{},{isMaximized:C}=b(),w=typeof s=="function"?s:void 0,E=typeof p=="function"?p:void 0,S=typeof d=="function"?d:void 0,h=o?.expand,c=a?.expand,z=j(a),L=h?.isExpanded??true,M=h!=null&&o?.children!=null,D=c!=null&&a?.children!=null&&z,k=M&&D,V=F(a?.sx),_=o!=null?F(o.sx):0,I=Math.max(_,V),T=k&&L?I:void 0,Z=D?I:void 0,X=D;return jsxs(b$1,{id:l??f$1,className:u,"data-testid":W??l??"WindowToolbar","data-id":b$2??l,sx:y,children:[jsxs(Te,{$width:T,children:[w?jsx(c$2,{onClick:w}):null,E?jsx(f$2,{onClick:E}):null,S?jsx(e,{isMaximized:C,onClick:S}):null,M&&h?jsx(d$1,{direction:h.isExpanded??true?"left":"right",active:h.isExpanded??true,onClick:h.onExpand,children:h.label}):null,m]}),jsx(j$1,{title:r,icon:t}),jsxs(Pe,{$width:Z,$justifyContent:i?"space-between":"flex-start",children:[D?jsx(Ie,{$visible:X,$duration:n,children:jsx(d$1,{sx:{flexShrink:0},direction:c?.isExpanded??true?"left":"right",active:z,onClick:c?.onExpand,children:c?.label})}):null,i]})]})}ve.displayName="WindowShellToolbar";var Fe=memo(ve);var Be=forwardRef(function({isOpen:o,className:a,sx:n,toolbar:r,services:t,sidebar:s,panel:p,footer:d$1,content:m,window:i,backdrop:l},u){let W=t?.list??[],b=(t?.isLoading??false)||W.length>0,y=d$1!=null&&(d$1.isVisible??true),C=s?.children,w=F(s?.sx),E=p?.children,S=p!=null?F(p.sx):0,h=m?.children,c$2=s?.expand?.isExpanded??C!=null,z=j(p),L=!!(C||E),[M,D]=useState(w),[k,V]=useState(S);useEffect(()=>{c$2&&D(w),z&&V(S);},[c$2,w,z,S]);let _=r?.onClose??r?.onMinimize??(()=>{}),I=G(s?.animation,"in-place"),T=G(p?.animation,"in-place"),Z=(()=>{let P=i?.defaultSize;if(typeof P?.width!="number")return P;let oe=(I.resize==="window"&&!c$2?M:0)+(T.resize==="window"&&!z?k:0);return oe>0?{...P,width:Math.max(0,P.width-oe)}:P})(),X={height:i?.minSize?.height??i?.defaultSize?.height??c,...i?.minSize?.width!=null?{width:i.minSize.width}:null},Le=l!=null&&(l.isVisible??true)&&o&&!i?.isMinimized,_e=(i?.order??0)+10-1,ee=jsx(oo,{open:true,onClick:_,id:l?.id,className:l?.className,"data-testid":l?.["data-testid"]??l?.id??"WindowShellBackdrop",...(l?.["data-id"]??l?.id)!=null?{"data-id":l?.["data-id"]??l?.id}:null,sx:Gb({zIndex:_e,backgroundColor:P=>alpha(P.palette.common.black,.3)},l?.sx)});return jsxs(Fragment,{children:[Le&&(i?.disablePortal?ee:createPortal(ee,document.body)),jsxs(f,{ref:u,isOpen:o,onClose:_,defaultSize:Z,minSize:X,maxSize:i?.maxSize,defaultPosition:i?.defaultPosition,containerRef:i?.containerRef,order:i?.order,isMinimized:i?.isMinimized,isMaximized:i?.isMaximized,id:i?.id,className:Hb(x.root,i?.className,a),sx:n,onResize:i?.onResize,onDragStart:i?.onDragStart,onMouseDown:i?.onMouseDown,onClick:i?.onClick,disablePortal:i?.disablePortal,"data-testid":i?.["data-testid"]??i?.id,"data-id":i?.["data-id"]??i?.id,children:[jsx(Oe,{sidebarOpen:c$2,showPanel:z,sidebarWidth:M,panelWidth:k,sidebarResize:I.resize,panelResize:T.resize,sidebarDuration:I.duration,panelDuration:T.duration}),jsx(Fe,{toolbar:r,sidebar:s,panel:p,animationDuration:T.duration}),b?t?.isLoading?jsx(d,{appCode:t?.appCode,id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:Gb({height:"auto",flexShrink:0},t?.sx)}):jsx(c$1,{services:W,serviceCode:t?.activeCode??"",onOpenService:t?.onOpen,onOpenServiceInNewWindow:t?.onOpenInNewWindow,language:t?.language??"en",openInNewWindowLabel:t?.openInNewWindowLabel??"Open in new window",id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:t?.sx}):null,jsx(g,{id:m?.id,className:m?.className,"data-testid":m?.["data-testid"]??m?.id,"data-id":m?.["data-id"]??m?.id,sx:L?void 0:m?.sx,children:L?jsx(Re,{baseWindowWidth:typeof i?.defaultSize?.width=="number"?i.defaultSize.width:void 0,sidebar:s,panel:p,content:m,bodyContent:h,sidebarOpen:c$2,showPanel:z,sidebarFullWidth:M,panelFullWidth:k,sidebarAnimation:I,panelAnimation:T}):h}),y?jsxs(h$2,{id:d$1?.id,className:d$1?.className,"data-testid":d$1?.["data-testid"]??d$1?.id,"data-id":d$1?.["data-id"]??d$1?.id,sx:d$1?.isVisible===true?Gb(d$1?.sx??{},{"&:empty, &:has(> :only-child:empty)":{display:"flex"}}):d$1?.sx,children:[d$1?.children,d$1?.actions?jsx(i$1,{children:d$1.actions}):null]}):null]})]})});Be.displayName="WindowShell";var to=memo(Be);export{x as a,to as b};
@@ -1 +1 @@
1
- import {L,K,j}from'./chunk-LLM6NHYM.js';import {T,ca,Hb}from'./chunk-6HNOCQKM.js';import {h}from'./chunk-53X3U5WT.js';import {forwardRef,useState,useMemo,memo}from'react';import V from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var r="os-shared-CurrencyAmountInput",t={root:`${r}-root`,field:`${r}-field`,display:`${r}-display`,integer:`${r}-integer`,separator:`${r}-separator`,decimal:`${r}-decimal`};var N=styled(V)(({theme:e})=>({color:e.v2.palette.foreground.primary,border:`1px solid ${e.v2.palette.border.default}`,padding:e.v2.spacing(8),borderRadius:e.v2.radius(4),display:"flex",alignItems:"center",justifyContent:"flex-end",width:93,height:32,textAlign:"right",input:{fontSize:"11px",border:"none",color:e.v2.palette.foreground.primary,height:30,padding:0,textAlign:"right"}})),I=styled(L)(({theme:e})=>({flexGrow:1,maxWidth:"100%",padding:0,border:"none",backgroundColor:"transparent",borderRadius:"none",height:24,[`& .${K.input}`]:{padding:0},input:{textAlign:"right",width:"100%",fontWeight:e.v2.typography.fontWeightRegular}})),b=styled(j)(({theme:e})=>({...e.v2.typography.textVariants.body.small.bold,display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",overflow:"auto"})),v=styled("span")(({theme:e})=>({fontWeight:e.v2.typography.fontWeightRegular}));var q=T(),D=forwardRef(({amount:e,setAmount:u,maxAmount:l,isError:R,placeholder:E,selectedCurrency:p,id:o,className:k,sx:P,...B},M)=>{let[W,m]=useState(false),[c,S]=useState(e||""),{integerAmount:F,decimalAmount:d}=ca(e,p?.code?.english),K=useMemo(()=>h(p?.decimals),[p]),T=n=>{let i=Number(n.target.value)||0;if(l&&i>l)return false;S(i),u(i);},H=()=>{m(false),u(Number(c));},L=n=>{q&&isNaN(Number(n.key))&&n.key!=="Backspace"&&n.key!=="."&&n.preventDefault();};return jsx(N,{id:o,"data-testid":o??"CurrencyAmountInput",className:Hb(t.root,k),sx:P,...B,children:W?jsx(I,{ref:M,id:o,className:t.field,type:"number",placeholder:E??K,value:c,onChange:T,onBlur:H,onKeyDown:L,error:!!R,inputProps:{step:"0.01"},hideArrows:true,autoFocus:true,disableFocusRing:true}):jsxs(b,{id:o?`${o}-display`:void 0,"data-testid":o?`${o}-display`:"CurrencyAmount",className:t.display,component:"span",onClick:()=>{m(true);},children:[jsx("span",{className:t.integer,children:F}),d?jsxs(Fragment,{children:[jsx("span",{className:t.separator,children:"."}),jsx(v,{className:t.decimal,children:d})]}):null]})})});D.displayName="CurrencyAmountInput";var J=memo(D);export{t as a,J as b};
1
+ import {L,K,j}from'./chunk-6ZPNLCMN.js';import {T,ca,Hb}from'./chunk-MMXWSV6V.js';import {h}from'./chunk-53X3U5WT.js';import {forwardRef,useState,useMemo,memo}from'react';import V from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var r="os-shared-CurrencyAmountInput",t={root:`${r}-root`,field:`${r}-field`,display:`${r}-display`,integer:`${r}-integer`,separator:`${r}-separator`,decimal:`${r}-decimal`};var N=styled(V)(({theme:e})=>({color:e.v2.palette.foreground.primary,border:`1px solid ${e.v2.palette.border.default}`,padding:e.v2.spacing(8),borderRadius:e.v2.radius(4),display:"flex",alignItems:"center",justifyContent:"flex-end",width:93,height:32,textAlign:"right",input:{fontSize:"11px",border:"none",color:e.v2.palette.foreground.primary,height:30,padding:0,textAlign:"right"}})),I=styled(L)(({theme:e})=>({flexGrow:1,maxWidth:"100%",padding:0,border:"none",backgroundColor:"transparent",borderRadius:"none",height:24,[`& .${K.input}`]:{padding:0},input:{textAlign:"right",width:"100%",fontWeight:e.v2.typography.fontWeightRegular}})),b=styled(j)(({theme:e})=>({...e.v2.typography.textVariants.body.small.bold,display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",overflow:"auto"})),v=styled("span")(({theme:e})=>({fontWeight:e.v2.typography.fontWeightRegular}));var q=T(),D=forwardRef(({amount:e,setAmount:u,maxAmount:l,isError:R,placeholder:E,selectedCurrency:p,id:o,className:k,sx:P,...B},M)=>{let[W,m]=useState(false),[c,S]=useState(e||""),{integerAmount:F,decimalAmount:d}=ca(e,p?.code?.english),K=useMemo(()=>h(p?.decimals),[p]),T=n=>{let i=Number(n.target.value)||0;if(l&&i>l)return false;S(i),u(i);},H=()=>{m(false),u(Number(c));},L=n=>{q&&isNaN(Number(n.key))&&n.key!=="Backspace"&&n.key!=="."&&n.preventDefault();};return jsx(N,{id:o,"data-testid":o??"CurrencyAmountInput",className:Hb(t.root,k),sx:P,...B,children:W?jsx(I,{ref:M,id:o,className:t.field,type:"number",placeholder:E??K,value:c,onChange:T,onBlur:H,onKeyDown:L,error:!!R,inputProps:{step:"0.01"},hideArrows:true,autoFocus:true,disableFocusRing:true}):jsxs(b,{id:o?`${o}-display`:void 0,"data-testid":o?`${o}-display`:"CurrencyAmount",className:t.display,component:"span",onClick:()=>{m(true);},children:[jsx("span",{className:t.integer,children:F}),d?jsxs(Fragment,{children:[jsx("span",{className:t.separator,children:"."}),jsx(v,{className:t.decimal,children:d})]}):null]})})});D.displayName="CurrencyAmountInput";var J=memo(D);export{t as a,J as b};
@@ -1 +1 @@
1
- import {n,j,k,l,h,f,b,g,i,m as m$1,c,e,d}from'./chunk-YZFTHJHW.js';import {X,V,W,Y,k as k$1,a,O,Q,b as b$1,_,P,R,S,T,U,F,m,$,I,G,H,Z,L,M,ba as ba$1,aa,c as c$1,J,K,N}from'./chunk-XGCSZNS4.js';import {ba}from'./chunk-LLM6NHYM.js';import {Xb,Hb,Gb}from'./chunk-6HNOCQKM.js';import {forwardRef,useState,useCallback,useMemo,memo}from'react';import pe from'@mui/material/Box';import At from'@mui/material/InputLabel';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function Nt({endAdornmentProp:h,isLoading:o,showClear:S,showMenuArrow:i,menuOpen:b,ClearIconComponent:c=$,ChevronIconComponent:u=aa,onClear:p,onClearDefault:R}){if(!h&&!S&&!o&&!i)return null;let m=C=>{C.preventDefault(),C.stopPropagation(),p?p():R();};return jsxs(pe,{className:Hb("Select-endAdornmentRoot",o&&"Select-endAdornmentRoot--loading"),component:"span",children:[h,o?jsx(pe,{component:"span",className:"Select-menuTriggerIcon Select-menuTriggerIcon--loading","aria-hidden":true,children:jsx(ba$1,{})}):null,!o&&S?jsx(pe,{component:"button",className:"Select-clearIconButton","data-select-clear":"",type:"button",tabIndex:0,"aria-label":"Clear selection",onMouseDown:m,onClick:m,children:jsx(c,{})}):null,!o&&i?jsx(pe,{component:"span",className:`Select-menuTriggerIcon${b?" Select-menuTriggerIcon-open":""}`,"aria-hidden":true,children:jsx(u,{})}):null]})}var Et=forwardRef(function({isMultiple:o=false,options:S,value:i,onChange:b,label:c="",disabled:u,required:p,hasError:R=false,helperText:m,feedback:C,showClearIcon:K=false,ClearIconComponent:me,ChevronIconComponent:q,onClear:Q,isLoading:F,MenuProps:j$1,children:ye,id:z="Select",className:J,open:w,onOpen:X$1,onClose:k$1,name:Y$1,inputProps:P,endAdornment:Z,renderValue:D,valueAlignment:_},g){let[fe,ee]=useState(false),I=w??fe,x=!!(u||F),{isProvided:te,isVisible:T,type:le}=Xb(C),L=`${z}-label`,B=Array.isArray(i)?i:i!=null?[i]:[],V$1=useCallback((t,$)=>{$?X$1?.(t):k$1?.(t),w===void 0&&ee($);},[X$1,k$1,w]),ne=t=>{t.button===0&&(m$1(t)||t.target.closest('.MuiSelect-select[role="combobox"]')||x||(t.preventDefault(),t.stopPropagation(),V$1(t,!I)));},oe=t=>{m$1(t)||t.target.closest('.MuiSelect-select[role="combobox"]')||(t.preventDefault(),t.stopPropagation());},ae=t=>{let ce=t.target.value.map(A=>S.find(W=>j(W)===A||String(W.value)===String(A))).filter(A=>A!=null);b?.(ce);},re=jsx(Nt,{endAdornmentProp:Z,isLoading:!!F,showClear:K&&n(i)&&!x,showMenuArrow:!F,menuOpen:I,ClearIconComponent:me,ChevronIconComponent:q,onClear:Q,onClearDefault:()=>b?.(o?[]:null)}),H=o?B.map(j):j(B[0]??null);return jsxs(X,{$hasFeedback:T,onMouseDown:ne,onClick:oe,children:[jsxs(V,{variant:"filled",required:p,className:J,children:[jsx(At,{id:L,children:c}),jsx(W,{multiple:o,ref:g,value:H,error:R&&!T,feedbackType:le,hasFeedback:T,valueAlignment:_,disableUnderline:true,required:p,hasLabel:!!c.trim(),labelId:L,id:z,name:Y$1,open:I,onOpen:t=>V$1(t,true),onClose:t=>{k(t)||o&&l(t)||V$1(t,false);},onChange:o?ae:void 0,renderValue:D,inputProps:P,disabled:x,IconComponent:()=>null,autoWidth:false,endAdornment:re,MenuProps:j$1,children:ye})]}),te?jsx(ba,{...C}):m!=null&&m!==""?jsx(Y,{children:m}):null]})}),Pe=Et;function Rt({options:h,maxVisibleValues:o,valueAlignment:S=m}){let b$1=typeof o=="number"&&Number.isFinite(o)?Math.max(0,Math.floor(o)):h.length,c=h.slice(0,b$1),u=h.length-c.length,p=c.map(b).join(", ");return jsxs(L,{className:a.values,$valueAlignment:S,children:[jsx(M,{className:a.value,children:p}),u>0?jsxs(N,{className:a.valueOverflow,children:["+",u," more"]}):null]})}var Ct=Rt;var vt=forwardRef(function({options:o,isMultiple:S$1=false,hasCheckbox:i$1,maxVisibleValues:b$2,value:c$2,onChange:u,label:p,placeholder:R$1,disabled:m$1,required:C,error:K$1=false,helperText:me,feedback:q,hasClearIcon:Q$1=false,ClearIconComponent:F$1,ChevronIconComponent:j,SearchIconComponent:ye,onClear:z,isLoading:J$1,isSearchable:w=false,searchPlaceholder:X,hasSelectionSummary:k=false,hasSelectedCheckmark:Y=false,valueAlignment:P$1=m,menuDirection:Z$1=k$1,MenuProps:D,children:_$1,id:g$1="Select",className:fe,sx:ee,selectClassNames:I$1,inputRef:x,open:te,onOpen:T$1,onClose:le,name:L$1,inputProps:B,endAdornment:V,renderValue:ne,renderOption:oe},ae){let[re,H$1]=useState(""),[t,$$1]=useState(Z$1),[ce,A]=useState(void 0),W=p??"",Ae=R$1??"",Ne=me??void 0,Ee=X??b$1,Mt=ye??_,Re=i$1??S$1,y=useMemo(()=>h(o),[o]),ke=Hb(a.root,I$1?.root,fe),De=useMemo(()=>f(D,t,ce),[D,t,ce]),Te=e$1=>{let s=c(e$1);s?.width&&A(s.width),$$1(e({preferred:Z$1,anchorRect:s,menuMaxHeight:d(D,w,k),gapPx:c$1})),T$1?.(e$1);},N=w?re.toLowerCase().trim():"",Le=e=>!N||b(e).toLowerCase().includes(N),Be=e=>oe?jsx(J,{className:a.option,$customLayout:true,children:oe(e)}):jsx(J,{className:a.option,children:jsx(K,{title:b(e),children:b(e)})}),wt=useMemo(()=>N?y.filter(e=>b(e).toLowerCase().includes(N)):y,[y,N]),It=!!N&&wt.length===0,se=()=>{u?.(S$1?[]:null),z?.();},He=w?jsx(O,{className:a.search,disableGutters:true,"data-select-menu-search":"",onMouseDown:g,onClick:g,onKeyDown:g,children:jsx(Q,{placeholder:Ee,value:re,onChange:e=>H$1(e.target.value),onMouseDown:g,onClick:g,onKeyDown:e=>e.stopPropagation(),onKeyUp:e=>e.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":Ee,onMouseDown:g,onClick:g},endAdornment:jsx(Mt,{})})}):null,$e=It?jsx(P,{disableGutters:true,onMouseDown:g,onClick:g,children:"No results found"}):null;if(S$1){let e=Array.isArray(c$2)?c$2:[],s=y.filter(l=>e.some(f=>f===l.value||String(f)===String(l.value))),U$1=s.length,Ft=k&&U$1>0?jsx(R,{className:a.summary,disableGutters:true,disableSticky:true,"data-select-menu-keep-open":"",onMouseDown:g,onClick:g,onKeyDown:g,children:jsxs(S,{children:[jsxs(T,{children:[U$1," selected"]}),jsx(U,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:l=>{l.preventDefault(),l.stopPropagation(),se();},onClick:l=>{l.preventDefault(),l.stopPropagation(),se();},children:"Clear"})]})}):null;return jsx(F,{id:g$1,"data-testid":g$1??"Select",className:ke,sx:Gb(ee??{}),children:jsxs(Pe,{ref:x??ae,isMultiple:true,id:g$1,className:Hb(a.field,I$1?.field),options:y,value:s,onChange:l=>{u?.(Array.isArray(l)?l.map(f=>f.value):[]);},label:W,disabled:m$1,required:C,hasError:K$1,helperText:Ne,feedback:q,showClearIcon:Q$1,ClearIconComponent:F$1??$,ChevronIconComponent:j,onClear:se,isLoading:J$1,MenuProps:De,open:te,onOpen:Te,onClose:l=>{H$1(""),le?.(l);},name:L$1,inputProps:B,endAdornment:V,valueAlignment:P$1,renderValue:()=>s.length>0?jsx(Ct,{options:s,maxVisibleValues:b$2,valueAlignment:P$1}):Ae,children:[_$1,He,Ft,$e,y.map(l=>{let f=e.some(Ue=>Ue===l.value||String(Ue)===String(l.value)),We=Be(l);return jsx(I,{value:String(l.value),disabled:l.disabled,$selected:f,$hidden:!Le(l),className:a.option,onMouseDown:g,onClick:g,children:Re?jsxs(G,{children:[jsx(H,{checked:f,$mutedRect:f&&l.disabled,tabIndex:-1,disableRipple:true}),We]}):jsxs(Fragment,{children:[We,Y&&f?jsx(Z,{}):null]})},l.id)})]})})}let Ot=Array.isArray(c$2)?c$2[0]??null:c$2??null,O$1=i(y,Ot);return jsx(F,{id:g$1,"data-testid":g$1??"Select",className:ke,sx:Gb(ee??{}),children:jsxs(Pe,{ref:x??ae,id:g$1,className:Hb(a.field,I$1?.field),options:y,value:O$1,onChange:e=>{u?.(e==null||Array.isArray(e)?null:e.value);},label:W,disabled:m$1,required:C,hasError:K$1,helperText:Ne,feedback:q,showClearIcon:Q$1,ClearIconComponent:F$1??$,ChevronIconComponent:j,onClear:se,isLoading:J$1,MenuProps:De,open:te,onOpen:Te,onClose:e=>{H$1(""),le?.(e);},name:L$1,inputProps:B,endAdornment:V,valueAlignment:P$1,renderValue:()=>{if(!O$1)return Ae;if(ne)return ne(O$1);let e=b(O$1);return jsx(L,{className:a.values,$valueAlignment:P$1,children:jsx(M,{className:a.value,title:e,children:e})})},children:[_$1,He,$e,y.map(e=>{let s=O$1!=null&&(O$1.value===e.value||String(O$1.value)===String(e.value)),U=Be(e);return jsx(I,{value:String(e.value),disabled:e.disabled,$selected:s,$hidden:!Le(e),onMouseDown:g,onClick:()=>u?.(e.value),className:a.option,children:Re?jsxs(G,{children:[jsx(H,{checked:s,tabIndex:-1,disableRipple:true}),U]}):jsxs(Fragment,{children:[U,Y&&s?jsx(Z,{}):null]})},e.id)})]})})});vt.displayName="Select";var Lt=memo(vt);export{Lt as a};
1
+ import {n,j,k,l,h,f,b,g,i,m as m$1,c,e,d}from'./chunk-WYH4IUDI.js';import {X,V,W,Y,k as k$1,a,O,Q,b as b$1,_,P,R,S,T,U,F,m,$,I,G,H,Z,L,M,ba as ba$1,aa,c as c$1,J,K,N}from'./chunk-76GQ37UR.js';import {ba}from'./chunk-6ZPNLCMN.js';import {Xb,Hb,Gb}from'./chunk-MMXWSV6V.js';import {forwardRef,useState,useCallback,useMemo,memo}from'react';import pe from'@mui/material/Box';import At from'@mui/material/InputLabel';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function Nt({endAdornmentProp:h,isLoading:o,showClear:S,showMenuArrow:i,menuOpen:b,ClearIconComponent:c=$,ChevronIconComponent:u=aa,onClear:p,onClearDefault:R}){if(!h&&!S&&!o&&!i)return null;let m=C=>{C.preventDefault(),C.stopPropagation(),p?p():R();};return jsxs(pe,{className:Hb("Select-endAdornmentRoot",o&&"Select-endAdornmentRoot--loading"),component:"span",children:[h,o?jsx(pe,{component:"span",className:"Select-menuTriggerIcon Select-menuTriggerIcon--loading","aria-hidden":true,children:jsx(ba$1,{})}):null,!o&&S?jsx(pe,{component:"button",className:"Select-clearIconButton","data-select-clear":"",type:"button",tabIndex:0,"aria-label":"Clear selection",onMouseDown:m,onClick:m,children:jsx(c,{})}):null,!o&&i?jsx(pe,{component:"span",className:`Select-menuTriggerIcon${b?" Select-menuTriggerIcon-open":""}`,"aria-hidden":true,children:jsx(u,{})}):null]})}var Et=forwardRef(function({isMultiple:o=false,options:S,value:i,onChange:b,label:c="",disabled:u,required:p,hasError:R=false,helperText:m,feedback:C,showClearIcon:K=false,ClearIconComponent:me,ChevronIconComponent:q,onClear:Q,isLoading:F,MenuProps:j$1,children:ye,id:z="Select",className:J,open:w,onOpen:X$1,onClose:k$1,name:Y$1,inputProps:P,endAdornment:Z,renderValue:D,valueAlignment:_},g){let[fe,ee]=useState(false),I=w??fe,x=!!(u||F),{isProvided:te,isVisible:T,type:le}=Xb(C),L=`${z}-label`,B=Array.isArray(i)?i:i!=null?[i]:[],V$1=useCallback((t,$)=>{$?X$1?.(t):k$1?.(t),w===void 0&&ee($);},[X$1,k$1,w]),ne=t=>{t.button===0&&(m$1(t)||t.target.closest('.MuiSelect-select[role="combobox"]')||x||(t.preventDefault(),t.stopPropagation(),V$1(t,!I)));},oe=t=>{m$1(t)||t.target.closest('.MuiSelect-select[role="combobox"]')||(t.preventDefault(),t.stopPropagation());},ae=t=>{let ce=t.target.value.map(A=>S.find(W=>j(W)===A||String(W.value)===String(A))).filter(A=>A!=null);b?.(ce);},re=jsx(Nt,{endAdornmentProp:Z,isLoading:!!F,showClear:K&&n(i)&&!x,showMenuArrow:!F,menuOpen:I,ClearIconComponent:me,ChevronIconComponent:q,onClear:Q,onClearDefault:()=>b?.(o?[]:null)}),H=o?B.map(j):j(B[0]??null);return jsxs(X,{$hasFeedback:T,onMouseDown:ne,onClick:oe,children:[jsxs(V,{variant:"filled",required:p,className:J,children:[jsx(At,{id:L,children:c}),jsx(W,{multiple:o,ref:g,value:H,error:R&&!T,feedbackType:le,hasFeedback:T,valueAlignment:_,disableUnderline:true,required:p,hasLabel:!!c.trim(),labelId:L,id:z,name:Y$1,open:I,onOpen:t=>V$1(t,true),onClose:t=>{k(t)||o&&l(t)||V$1(t,false);},onChange:o?ae:void 0,renderValue:D,inputProps:P,disabled:x,IconComponent:()=>null,autoWidth:false,endAdornment:re,MenuProps:j$1,children:ye})]}),te?jsx(ba,{...C}):m!=null&&m!==""?jsx(Y,{children:m}):null]})}),Pe=Et;function Rt({options:h,maxVisibleValues:o,valueAlignment:S=m}){let b$1=typeof o=="number"&&Number.isFinite(o)?Math.max(0,Math.floor(o)):h.length,c=h.slice(0,b$1),u=h.length-c.length,p=c.map(b).join(", ");return jsxs(L,{className:a.values,$valueAlignment:S,children:[jsx(M,{className:a.value,children:p}),u>0?jsxs(N,{className:a.valueOverflow,children:["+",u," more"]}):null]})}var Ct=Rt;var vt=forwardRef(function({options:o,isMultiple:S$1=false,hasCheckbox:i$1,maxVisibleValues:b$2,value:c$2,onChange:u,label:p,placeholder:R$1,disabled:m$1,required:C,error:K$1=false,helperText:me,feedback:q,hasClearIcon:Q$1=false,ClearIconComponent:F$1,ChevronIconComponent:j,SearchIconComponent:ye,onClear:z,isLoading:J$1,isSearchable:w=false,searchPlaceholder:X,hasSelectionSummary:k=false,hasSelectedCheckmark:Y=false,valueAlignment:P$1=m,menuDirection:Z$1=k$1,MenuProps:D,children:_$1,id:g$1="Select",className:fe,sx:ee,selectClassNames:I$1,inputRef:x,open:te,onOpen:T$1,onClose:le,name:L$1,inputProps:B,endAdornment:V,renderValue:ne,renderOption:oe},ae){let[re,H$1]=useState(""),[t,$$1]=useState(Z$1),[ce,A]=useState(void 0),W=p??"",Ae=R$1??"",Ne=me??void 0,Ee=X??b$1,Mt=ye??_,Re=i$1??S$1,y=useMemo(()=>h(o),[o]),ke=Hb(a.root,I$1?.root,fe),De=useMemo(()=>f(D,t,ce),[D,t,ce]),Te=e$1=>{let s=c(e$1);s?.width&&A(s.width),$$1(e({preferred:Z$1,anchorRect:s,menuMaxHeight:d(D,w,k),gapPx:c$1})),T$1?.(e$1);},N=w?re.toLowerCase().trim():"",Le=e=>!N||b(e).toLowerCase().includes(N),Be=e=>oe?jsx(J,{className:a.option,$customLayout:true,children:oe(e)}):jsx(J,{className:a.option,children:jsx(K,{title:b(e),children:b(e)})}),wt=useMemo(()=>N?y.filter(e=>b(e).toLowerCase().includes(N)):y,[y,N]),It=!!N&&wt.length===0,se=()=>{u?.(S$1?[]:null),z?.();},He=w?jsx(O,{className:a.search,disableGutters:true,"data-select-menu-search":"",onMouseDown:g,onClick:g,onKeyDown:g,children:jsx(Q,{placeholder:Ee,value:re,onChange:e=>H$1(e.target.value),onMouseDown:g,onClick:g,onKeyDown:e=>e.stopPropagation(),onKeyUp:e=>e.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":Ee,onMouseDown:g,onClick:g},endAdornment:jsx(Mt,{})})}):null,$e=It?jsx(P,{disableGutters:true,onMouseDown:g,onClick:g,children:"No results found"}):null;if(S$1){let e=Array.isArray(c$2)?c$2:[],s=y.filter(l=>e.some(f=>f===l.value||String(f)===String(l.value))),U$1=s.length,Ft=k&&U$1>0?jsx(R,{className:a.summary,disableGutters:true,disableSticky:true,"data-select-menu-keep-open":"",onMouseDown:g,onClick:g,onKeyDown:g,children:jsxs(S,{children:[jsxs(T,{children:[U$1," selected"]}),jsx(U,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:l=>{l.preventDefault(),l.stopPropagation(),se();},onClick:l=>{l.preventDefault(),l.stopPropagation(),se();},children:"Clear"})]})}):null;return jsx(F,{id:g$1,"data-testid":g$1??"Select",className:ke,sx:Gb(ee??{}),children:jsxs(Pe,{ref:x??ae,isMultiple:true,id:g$1,className:Hb(a.field,I$1?.field),options:y,value:s,onChange:l=>{u?.(Array.isArray(l)?l.map(f=>f.value):[]);},label:W,disabled:m$1,required:C,hasError:K$1,helperText:Ne,feedback:q,showClearIcon:Q$1,ClearIconComponent:F$1??$,ChevronIconComponent:j,onClear:se,isLoading:J$1,MenuProps:De,open:te,onOpen:Te,onClose:l=>{H$1(""),le?.(l);},name:L$1,inputProps:B,endAdornment:V,valueAlignment:P$1,renderValue:()=>s.length>0?jsx(Ct,{options:s,maxVisibleValues:b$2,valueAlignment:P$1}):Ae,children:[_$1,He,Ft,$e,y.map(l=>{let f=e.some(Ue=>Ue===l.value||String(Ue)===String(l.value)),We=Be(l);return jsx(I,{value:String(l.value),disabled:l.disabled,$selected:f,$hidden:!Le(l),className:a.option,onMouseDown:g,onClick:g,children:Re?jsxs(G,{children:[jsx(H,{checked:f,$mutedRect:f&&l.disabled,tabIndex:-1,disableRipple:true}),We]}):jsxs(Fragment,{children:[We,Y&&f?jsx(Z,{}):null]})},l.id)})]})})}let Ot=Array.isArray(c$2)?c$2[0]??null:c$2??null,O$1=i(y,Ot);return jsx(F,{id:g$1,"data-testid":g$1??"Select",className:ke,sx:Gb(ee??{}),children:jsxs(Pe,{ref:x??ae,id:g$1,className:Hb(a.field,I$1?.field),options:y,value:O$1,onChange:e=>{u?.(e==null||Array.isArray(e)?null:e.value);},label:W,disabled:m$1,required:C,hasError:K$1,helperText:Ne,feedback:q,showClearIcon:Q$1,ClearIconComponent:F$1??$,ChevronIconComponent:j,onClear:se,isLoading:J$1,MenuProps:De,open:te,onOpen:Te,onClose:e=>{H$1(""),le?.(e);},name:L$1,inputProps:B,endAdornment:V,valueAlignment:P$1,renderValue:()=>{if(!O$1)return Ae;if(ne)return ne(O$1);let e=b(O$1);return jsx(L,{className:a.values,$valueAlignment:P$1,children:jsx(M,{className:a.value,title:e,children:e})})},children:[_$1,He,$e,y.map(e=>{let s=O$1!=null&&(O$1.value===e.value||String(O$1.value)===String(e.value)),U=Be(e);return jsx(I,{value:String(e.value),disabled:e.disabled,$selected:s,$hidden:!Le(e),onMouseDown:g,onClick:()=>u?.(e.value),className:a.option,children:Re?jsxs(G,{children:[jsx(H,{checked:s,tabIndex:-1,disableRipple:true}),U]}):jsxs(Fragment,{children:[U,Y&&s?jsx(Z,{}):null]})},e.id)})]})})});vt.displayName="Select";var Lt=memo(vt);export{Lt as a};
@@ -1 +1 @@
1
- import {B}from'./chunk-LLM6NHYM.js';import {Vb,wb}from'./chunk-6HNOCQKM.js';import {Ei,Ak,ja,Xd,Vj,E,ol,C,xb}from'./chunk-VRGBJY4Q.js';import {useId,useMemo,useState,useCallback}from'react';import {useTranslation}from'react-i18next';import b from'@mui/material/Box';import V from'@mui/material/Popper';import {styled}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var L=styled(b)(({theme:n})=>({background:n.palette.common.white,borderRadius:"4px",filter:"drop-shadow(0px 8px 30px rgba(0, 0, 0, 0.16))",minWidth:148,width:"max-content",marginTop:"8px"})),l=styled(b,{shouldForwardProp:n=>n!=="open"})(({theme:n,open:s})=>({display:"flex",alignItems:"center",justifyContent:"space-between",height:32,padding:"8px 8px 8px 12px",cursor:"pointer",fontSize:"11px",fontWeight:500,color:n.palette.text.primary,"&:hover":{boxShadow:n.shadows[3]},...s&&{boxShadow:n.shadows[3]}})),u=styled(b)(()=>({display:"flex",alignItems:"center",gap:"8px"})),d=styled("img")(()=>({width:16,height:16,objectFit:"contain"})),$=styled(b)(()=>({height:27,display:"flex",alignItems:"center",padding:"0 12px",fontFamily:"Tap Sans",fontWeight:500,fontSize:"11px",lineHeight:"100%",letterSpacing:"0%",color:"#8D8D94",pointerEvents:"none",userSelect:"none"}));var F={refund:ol,flag:E,viewReceipt:Vj,viewApi:Xd,capture:ja,void:Ak,clipboard:Ei};var X=({anchorEl:n,onClose:s,actions:h=[],linkedActions:M=[]})=>{let v=Vb(useId(),"actions-dropdown-menu"),{t:E}=useTranslation(),I=!!n,f=useMemo(()=>h.filter(e=>e.isShown!==false),[h]),g=useMemo(()=>M.filter(e=>e.isShown!==false),[M]);return I?jsxs(b,{id:v,"data-testid":"ActionsDropdownMenu",children:[jsx(B,{onClick:s}),jsx(V,{open:I,anchorEl:n,placement:"bottom-end",sx:{zIndex:1e3},children:jsxs(L,{children:[f.map((e,r)=>jsx(l,{onClick:p=>{p.stopPropagation(),e.onClick?.(p);},sx:r===f.length-1&&g.length>0?{borderBottom:"1px solid",borderColor:"divider"}:void 0,children:jsxs(u,{children:[jsx(d,{src:F[e.icon]??e.icon??C,alt:"action-icon"}),jsx("span",{children:e.label})]})},`direct-${r}`)),g.length>0&&jsx($,{children:E("linkedActions")}),g.map(({render:e,icon:r,label:p,onClick:T,onRightClick:i},c)=>{let m=e?.();return e&&!m?null:m?jsx(b,{children:m},`linked-${c}`):jsxs(l,{onClick:a=>{a.stopPropagation(),T?.(a),s();},onContextMenu:i?a=>{i(a);}:void 0,children:[jsxs(u,{children:[r&&jsx(d,{src:r,alt:"linked-action-icon"}),jsx("span",{children:p})]}),jsx("img",{src:xb,alt:""})]},`linked-${c}`)})]})})]}):null};var ne=({appCode:n,appIcon:s,appName:h,appInfo:M,menuItems:v})=>{let[E,I]=useState(null),f=!!E,g=useCallback(i=>{let c=i.currentTarget.firstElementChild;I(c);},[]),e=useCallback(()=>{I(null);},[]),r=useMemo(()=>v?.filter(({isShown:i=true})=>i),[v]);if(!r?.length)return null;let p=M?.iconUrl??s,T=wb(M?.name)??h;return jsxs(b,{onMouseEnter:g,onMouseLeave:e,children:[jsxs(l,{open:f,children:[jsxs(u,{children:[p&&jsx(d,{src:p,alt:"app"}),jsx("span",{children:T})]}),jsx("img",{src:xb,alt:""})]}),jsx(V,{open:f,anchorEl:E,placement:"left-start",sx:{zIndex:1301},children:jsx(L,{sx:{marginTop:0},children:r.map(({render:i,label:c,icon:m,onClick:a,onContextMenu:k},J)=>jsx(b,{children:i?.()??jsx(l,{onClick:C=>{C.stopPropagation(),a?.(C);},onContextMenu:k?C=>{k(C);}:void 0,children:jsxs(u,{children:[m&&jsx(d,{src:m,alt:"icon"}),jsx("span",{children:c})]})})},`app-${J}`))})})]})};export{X as a,ne as b};
1
+ import {B}from'./chunk-6ZPNLCMN.js';import {Vb,wb}from'./chunk-MMXWSV6V.js';import {Ei,Ak,ja,Xd,Vj,E,ol,C,xb}from'./chunk-VRGBJY4Q.js';import {useId,useMemo,useState,useCallback}from'react';import {useTranslation}from'react-i18next';import b from'@mui/material/Box';import V from'@mui/material/Popper';import {styled}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var L=styled(b)(({theme:n})=>({background:n.palette.common.white,borderRadius:"4px",filter:"drop-shadow(0px 8px 30px rgba(0, 0, 0, 0.16))",minWidth:148,width:"max-content",marginTop:"8px"})),l=styled(b,{shouldForwardProp:n=>n!=="open"})(({theme:n,open:s})=>({display:"flex",alignItems:"center",justifyContent:"space-between",height:32,padding:"8px 8px 8px 12px",cursor:"pointer",fontSize:"11px",fontWeight:500,color:n.palette.text.primary,"&:hover":{boxShadow:n.shadows[3]},...s&&{boxShadow:n.shadows[3]}})),u=styled(b)(()=>({display:"flex",alignItems:"center",gap:"8px"})),d=styled("img")(()=>({width:16,height:16,objectFit:"contain"})),$=styled(b)(()=>({height:27,display:"flex",alignItems:"center",padding:"0 12px",fontFamily:"Tap Sans",fontWeight:500,fontSize:"11px",lineHeight:"100%",letterSpacing:"0%",color:"#8D8D94",pointerEvents:"none",userSelect:"none"}));var F={refund:ol,flag:E,viewReceipt:Vj,viewApi:Xd,capture:ja,void:Ak,clipboard:Ei};var X=({anchorEl:n,onClose:s,actions:h=[],linkedActions:M=[]})=>{let v=Vb(useId(),"actions-dropdown-menu"),{t:E}=useTranslation(),I=!!n,f=useMemo(()=>h.filter(e=>e.isShown!==false),[h]),g=useMemo(()=>M.filter(e=>e.isShown!==false),[M]);return I?jsxs(b,{id:v,"data-testid":"ActionsDropdownMenu",children:[jsx(B,{onClick:s}),jsx(V,{open:I,anchorEl:n,placement:"bottom-end",sx:{zIndex:1e3},children:jsxs(L,{children:[f.map((e,r)=>jsx(l,{onClick:p=>{p.stopPropagation(),e.onClick?.(p);},sx:r===f.length-1&&g.length>0?{borderBottom:"1px solid",borderColor:"divider"}:void 0,children:jsxs(u,{children:[jsx(d,{src:F[e.icon]??e.icon??C,alt:"action-icon"}),jsx("span",{children:e.label})]})},`direct-${r}`)),g.length>0&&jsx($,{children:E("linkedActions")}),g.map(({render:e,icon:r,label:p,onClick:T,onRightClick:i},c)=>{let m=e?.();return e&&!m?null:m?jsx(b,{children:m},`linked-${c}`):jsxs(l,{onClick:a=>{a.stopPropagation(),T?.(a),s();},onContextMenu:i?a=>{i(a);}:void 0,children:[jsxs(u,{children:[r&&jsx(d,{src:r,alt:"linked-action-icon"}),jsx("span",{children:p})]}),jsx("img",{src:xb,alt:""})]},`linked-${c}`)})]})})]}):null};var ne=({appCode:n,appIcon:s,appName:h,appInfo:M,menuItems:v})=>{let[E,I]=useState(null),f=!!E,g=useCallback(i=>{let c=i.currentTarget.firstElementChild;I(c);},[]),e=useCallback(()=>{I(null);},[]),r=useMemo(()=>v?.filter(({isShown:i=true})=>i),[v]);if(!r?.length)return null;let p=M?.iconUrl??s,T=wb(M?.name)??h;return jsxs(b,{onMouseEnter:g,onMouseLeave:e,children:[jsxs(l,{open:f,children:[jsxs(u,{children:[p&&jsx(d,{src:p,alt:"app"}),jsx("span",{children:T})]}),jsx("img",{src:xb,alt:""})]}),jsx(V,{open:f,anchorEl:E,placement:"left-start",sx:{zIndex:1301},children:jsx(L,{sx:{marginTop:0},children:r.map(({render:i,label:c,icon:m,onClick:a,onContextMenu:k},J)=>jsx(b,{children:i?.()??jsx(l,{onClick:C=>{C.stopPropagation(),a?.(C);},onContextMenu:k?C=>{k(C);}:void 0,children:jsxs(u,{children:[m&&jsx(d,{src:m,alt:"icon"}),jsx("span",{children:c})]})})},`app-${J}`))})})]})};export{X as a,ne as b};
@@ -1 +1 @@
1
- import {r,p as p$1}from'./chunk-LLM6NHYM.js';import {Vb}from'./chunk-6HNOCQKM.js';import {useId,Fragment}from'react';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var u=styled(p)(({rows:e,columns:t})=>({display:"grid",gridTemplateColumns:`auto repeat(${t}, 1fr)`,gridTemplateRows:`auto repeat(${e}, 1fr)`,gap:"6px"})),L=styled(p)(()=>({width:24,position:"sticky",top:0,left:0,zIndex:3})),g=styled(p)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",fontSize:"10px",fontWeight:500,color:e.palette.grey[700],lineHeight:"100%",letterSpacing:"0",position:"sticky",top:0,zIndex:2,backgroundColor:"#fbfbfb"})),M=styled(p)(({theme:e,percentage:t=0})=>({width:"24px",height:"8px",borderRadius:"1px",backgroundColor:t===0?alpha(e.palette.grey[700],.1):alpha(e.palette.info.dark,t)})),O=styled(g)(()=>({fontSize:"9px",top:"auto",left:0,zIndex:1})),w=styled(p)(()=>({padding:"22px 12px",overflow:"auto",maxHeight:"480px"}));function x({xAxis:e,yAxis:t,series:n,isLoading:s,tooltip:l}){let c=Vb(useId(),"heat-map"),d=e.labels,y=t.labels;return jsxs(w,{id:c,"data-testid":"HeatMap",children:[jsxs(u,{className:"x-labels",rows:1,columns:d.length,children:[jsx(L,{}),d.map((r,i)=>jsx(g,{children:e.render?e.render(r):r},`x-${i}-${r}`))]}),jsx(u,{className:"y-labels",rows:y.length,columns:d.length,children:y.map((r$1,i)=>jsxs(Fragment,{children:[jsx(O,{sx:{minWidth:"25px"},children:t.render?t.render(r$1):r$1},`y-${i}-${r$1}`),d.map((m,h)=>{if(s)return jsx(r,{variant:"rectangular",width:"24px",height:"8px"},`${m}-${h}`);let f=n?.[m]?.[r$1]??{};return jsx(p$1,{title:l?.render&&f?.value?l.render(f,m,r$1):null,children:jsx(M,{percentage:f?.colorOpacityDegree})},`${m}-${h}`)})]},`y-${i}-${r$1}`))})]})}var H=[.06,.1,.2,.3,.4,.5,.6,.7,.8,.9,1];function D(e,t,n){if(t===n)return 0;let s=n-t,l=(e-t)/s,c=Math.floor(l*10);return H[Math.max(0,Math.min(10,c))]}var j=x;export{D as a,j as b};
1
+ import {r,p as p$1}from'./chunk-6ZPNLCMN.js';import {Vb}from'./chunk-MMXWSV6V.js';import {useId,Fragment}from'react';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var u=styled(p)(({rows:e,columns:t})=>({display:"grid",gridTemplateColumns:`auto repeat(${t}, 1fr)`,gridTemplateRows:`auto repeat(${e}, 1fr)`,gap:"6px"})),L=styled(p)(()=>({width:24,position:"sticky",top:0,left:0,zIndex:3})),g=styled(p)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",fontSize:"10px",fontWeight:500,color:e.palette.grey[700],lineHeight:"100%",letterSpacing:"0",position:"sticky",top:0,zIndex:2,backgroundColor:"#fbfbfb"})),M=styled(p)(({theme:e,percentage:t=0})=>({width:"24px",height:"8px",borderRadius:"1px",backgroundColor:t===0?alpha(e.palette.grey[700],.1):alpha(e.palette.info.dark,t)})),O=styled(g)(()=>({fontSize:"9px",top:"auto",left:0,zIndex:1})),w=styled(p)(()=>({padding:"22px 12px",overflow:"auto",maxHeight:"480px"}));function x({xAxis:e,yAxis:t,series:n,isLoading:s,tooltip:l}){let c=Vb(useId(),"heat-map"),d=e.labels,y=t.labels;return jsxs(w,{id:c,"data-testid":"HeatMap",children:[jsxs(u,{className:"x-labels",rows:1,columns:d.length,children:[jsx(L,{}),d.map((r,i)=>jsx(g,{children:e.render?e.render(r):r},`x-${i}-${r}`))]}),jsx(u,{className:"y-labels",rows:y.length,columns:d.length,children:y.map((r$1,i)=>jsxs(Fragment,{children:[jsx(O,{sx:{minWidth:"25px"},children:t.render?t.render(r$1):r$1},`y-${i}-${r$1}`),d.map((m,h)=>{if(s)return jsx(r,{variant:"rectangular",width:"24px",height:"8px"},`${m}-${h}`);let f=n?.[m]?.[r$1]??{};return jsx(p$1,{title:l?.render&&f?.value?l.render(f,m,r$1):null,children:jsx(M,{percentage:f?.colorOpacityDegree})},`${m}-${h}`)})]},`y-${i}-${r$1}`))})]})}var H=[.06,.1,.2,.3,.4,.5,.6,.7,.8,.9,1];function D(e,t,n){if(t===n)return 0;let s=n-t,l=(e-t)/s,c=Math.floor(l*10);return H[Math.max(0,Math.min(10,c))]}var j=x;export{D as a,j as b};
@@ -1,2 +1,2 @@
1
- import {Hb}from'./chunk-6HNOCQKM.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:Hb(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);
1
+ import {Hb}from'./chunk-MMXWSV6V.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:Hb(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 {v}from'./chunk-LLM6NHYM.js';import {Hb,X as X$1,Y as Y$1}from'./chunk-6HNOCQKM.js';import {Gb,Yc}from'./chunk-VRGBJY4Q.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:Hb(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-6ZPNLCMN.js';import {Hb,X as X$1,Y as Y$1}from'./chunk-MMXWSV6V.js';import {Gb,Yc}from'./chunk-VRGBJY4Q.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:Hb(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};