@zydon/common 2.7.78 → 2.7.79

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 (70) hide show
  1. package/dist/chunk-6UWD6IZZ.js +25 -0
  2. package/dist/chunk-6UWD6IZZ.js.map +1 -0
  3. package/dist/chunk-BLVCNBTJ.js +7 -0
  4. package/dist/chunk-BLVCNBTJ.js.map +1 -0
  5. package/dist/{chunk-45OMMG7D.js → chunk-FBN7HCBY.js} +2 -2
  6. package/dist/chunk-FBN7HCBY.js.map +1 -0
  7. package/dist/{chunk-HWYA3EGC.js → chunk-HYJEAKVR.js} +2 -2
  8. package/dist/{chunk-ZGSSTXUO.js → chunk-LQZSZV2W.js} +2 -2
  9. package/dist/{chunk-5LQLLZ5L.js → chunk-PSWJSHGP.js} +2 -2
  10. package/dist/{chunk-IGOVBLZ2.js → chunk-QLGWOE3Q.js} +2 -2
  11. package/dist/chunk-QLGWOE3Q.js.map +1 -0
  12. package/dist/{chunk-YDLDZVF5.js → chunk-QXRGT442.js} +3 -3
  13. package/dist/chunk-QXRGT442.js.map +1 -0
  14. package/dist/{chunk-23NOJPUV.js → chunk-YHKVYGTG.js} +2 -2
  15. package/dist/{chunk-23NOJPUV.js.map → chunk-YHKVYGTG.js.map} +1 -1
  16. package/dist/{chunk-WYJV57WG.js → chunk-YKV6FK6D.js} +2 -2
  17. package/dist/components/Autocomplete/index.js +1 -1
  18. package/dist/components/AutocompleteDetailed/index.js +1 -1
  19. package/dist/components/Avatar/index.d.ts +1 -3
  20. package/dist/components/BulkEditModal/index.js +2 -2
  21. package/dist/components/CopyButton/index.js +2 -2
  22. package/dist/components/DataView/index.d.ts +7 -21
  23. package/dist/components/DataView/index.js +1 -1
  24. package/dist/components/DragButton/index.d.ts +1 -3
  25. package/dist/components/DragContainer/index.d.ts +1 -3
  26. package/dist/components/DynamicDataView/index.d.ts +2 -2
  27. package/dist/components/DynamicDataView/index.js +5 -5
  28. package/dist/components/FieldMentions/index.js +3 -3
  29. package/dist/components/FieldMentions/index.js.map +1 -1
  30. package/dist/components/FileUpload/index.js +2 -2
  31. package/dist/components/FrameSkeleton/index.js +3 -3
  32. package/dist/components/InfoCircle/index.js +1 -1
  33. package/dist/components/ListBundles/index.d.ts +2 -1
  34. package/dist/components/Result/index.d.ts +1 -1
  35. package/dist/components/Tooltip/index.js +1 -1
  36. package/dist/components/carousel/index.d.ts +3 -9
  37. package/dist/components/form/Address/index.js +2 -2
  38. package/dist/components/form/Autocomplete/index.js +2 -2
  39. package/dist/components/form/AutocompleteDetailed/index.js +1 -1
  40. package/dist/components/form/Codes/index.js +1 -1
  41. package/dist/components/form/FileUpload/index.js +2 -2
  42. package/dist/components/form/Webhook/index.js +2 -2
  43. package/dist/hooks/useCollapseSidebarOnMount.js +3 -3
  44. package/dist/hooks/useDatagrid.d.ts +2 -2
  45. package/dist/hooks/useDatagrid.js +2 -2
  46. package/dist/hooks/useDatagrid.js.map +1 -1
  47. package/dist/hooks/useDeepCompareEffect.js +2 -2
  48. package/dist/hooks/useDeepCompareEffect.js.map +1 -1
  49. package/dist/hooks/useEventListener.d.ts +2 -2
  50. package/dist/hooks/useEventListener.js +1 -1
  51. package/dist/hooks/useLocalStorage.js +2 -2
  52. package/dist/hooks/useOnClickOutside.js +1 -1
  53. package/dist/hooks/useScrollOffSetTop.d.ts +1 -1
  54. package/dist/hooks/useScrollOffSetTop.js +1 -1
  55. package/dist/hooks/useScrollOffSetTop.js.map +1 -1
  56. package/dist/hooks/useSnackbar.d.ts +8 -8
  57. package/dist/theme/styles/index.d.ts +203 -116
  58. package/dist/types/sectionProps.d.ts +2 -2
  59. package/package.json +7 -7
  60. package/dist/chunk-45OMMG7D.js.map +0 -1
  61. package/dist/chunk-IGOVBLZ2.js.map +0 -1
  62. package/dist/chunk-L5URMM57.js +0 -7
  63. package/dist/chunk-L5URMM57.js.map +0 -1
  64. package/dist/chunk-UJGDCLUU.js +0 -25
  65. package/dist/chunk-UJGDCLUU.js.map +0 -1
  66. package/dist/chunk-YDLDZVF5.js.map +0 -1
  67. /package/dist/{chunk-HWYA3EGC.js.map → chunk-HYJEAKVR.js.map} +0 -0
  68. /package/dist/{chunk-ZGSSTXUO.js.map → chunk-LQZSZV2W.js.map} +0 -0
  69. /package/dist/{chunk-5LQLLZ5L.js.map → chunk-PSWJSHGP.js.map} +0 -0
  70. /package/dist/{chunk-WYJV57WG.js.map → chunk-YKV6FK6D.js.map} +0 -0
@@ -0,0 +1,25 @@
1
+ import { a as a$5 } from './chunk-RPPQBAVO.js';
2
+ import { a as a$6 } from './chunk-IJZCVZ32.js';
3
+ import { a as a$9 } from './chunk-IDFJFFIV.js';
4
+ import { a as a$7 } from './chunk-6U5LS7MP.js';
5
+ import { i, j, a as a$3, b as b$2, c, d, f, e, g, h } from './chunk-TB4Y7LXN.js';
6
+ import { a as a$1 } from './chunk-IN7SP2ND.js';
7
+ import { a as a$4 } from './chunk-CO2KQFUN.js';
8
+ import { a } from './chunk-NQNNMRLC.js';
9
+ import { a as a$8 } from './chunk-XWUVJ22J.js';
10
+ import { a as a$2 } from './chunk-LQRRMVFN.js';
11
+ import { b as b$1 } from './chunk-RPO7AI5K.js';
12
+ import { memo, forwardRef, Children, isValidElement, cloneElement, useCallback, useState, useMemo } from 'react';
13
+ import I from '@mui/material/Button';
14
+ import Lo from '@mui/material/CircularProgress';
15
+ import Fo from '@mui/material/Divider';
16
+ import po from '@mui/material/Stack';
17
+ import eo from '@mui/material/Typography';
18
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
+ import { GridToolbarColumnsButton } from '@mui/x-data-grid-premium';
20
+
21
+ var b="datagrid-actions";var Ao=({rowCount:t,page:e,rowsPerPage:r,onPaginationChange:i$1})=>jsxs(i,{children:[jsxs(po,{direction:"row",alignItems:"center",gap:.5,children:[jsx(eo,{variant:"body2",color:"text.disabled",children:"Total de itens:"}),jsx(eo,{variant:"body2",children:t})]}),jsx(j,{count:t,page:e,rowsPerPage:r,onPageChange:n=>i$1(n,r),onRowsPerPageChange:n=>i$1(e,n)})]}),ao=memo(Ao);var io=(t,e)=>Children.map(t,r=>{if(!isValidElement(r))return r;let i=r.props.onClick,n={};n.onClick=(...m)=>{e(),i&&i(...m);};let P=r.props;return P?.children&&(n.children=io(P.children,e)),cloneElement(r,n)}),Ro=({children:t,onClose:e})=>t?io(t,e):null,so=memo(Ro);var Bo=forwardRef(({children:t,...e},r)=>jsx(I,{...e,ref:r,color:"inherit",startIcon:jsx(a,{icon:"COLUMNS"}),children:t??"Colunas"}));Bo.displayName="ColumnsButton";var Oo=({setFilterButtonEl:t})=>{let e=useCallback(r=>{t(r);},[t]);return jsx(a$1,{container:b,children:jsx(GridToolbarColumnsButton,{ref:e,slotProps:{button:{color:"inherit",startIcon:jsx(a,{icon:"COLUMNS"}),children:"Colunas"}}})})},co=Oo;var zo=({title:t,headerContent:e$1,breakpoint:r="md",columns:i,rows:n=[],mobileRender:P,rowCount:m=0,paginationModel:s={page:0,pageSize:25},onPaginationChange:C,actions:E,moreActions:M,onAdd:x,onSearch:B,searchValue:mo,onSearchChange:fo,slots:f$1,slotProps:uo,loading:u,fetching:O,containerProps:ho={height:562,maxHeight:562},hideFooter:G,hideHeader:N=!1,showColumnButton:D=!1,...go})=>{let l=a$2(),d$1=b$1("down",r),[Po,Co]=useState(null),H=!!B,A=!!x,k=!!E,T=!!M,v=d$1&&T,w=!d$1&&T,ko=k||A||v,L=w||H||D||!d$1,F=useCallback(()=>jsx(ao,{rowCount:m,page:s.page,rowsPerPage:s.pageSize,onPaginationChange:C}),[m,s,C]),So=useMemo(()=>({...f$1,footer:F,...D&&!f$1?.toolbar&&{toolbar:co}}),[f$1,F,D]);return jsxs(a$3,{breakpoint:r,...ho,flex:u?1:void 0,minHeight:!u&&n.length===0?562:void 0,children:[!N&&jsxs(Fragment,{children:[jsxs(b$2,{breakpoint:r,children:[jsx(eo,{variant:"overline",color:"text.secondary",noWrap:!0,children:t}),ko&&jsxs(c,{breakpoint:r,children:[k&&E,A&&jsxs(Fragment,{children:[k&&jsx(d,{orientation:"vertical",flexItem:!0}),jsx(I,{startIcon:jsx(a,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:x,children:"Adicionar"})]}),v&&jsxs(Fragment,{children:[(k||A)&&jsx(d,{orientation:"vertical",flexItem:!0}),jsx(I,{color:"inherit",startIcon:jsx(a,{icon:"MORE_BOLD"}),size:"small",onClick:l.onOpen,children:"Mais"})]})]})]}),L&&jsxs(f,{breakpoint:r,children:[jsx(po,{flex:1,direction:"row",alignItems:"center",id:b,gap:.5,children:T&&jsxs(Fragment,{children:[w&&jsxs(Fragment,{children:[jsx(I,{color:"inherit",startIcon:jsx(a,{icon:"MORE_BOLD"}),size:"small",onClick:l.onOpen,children:"Mais"}),!d$1&&jsx(e,{orientation:"vertical",flexItem:!0})]}),(w||v)&&jsx(a$4,{open:l.open,anchorEl:l.open,onClose:l.onClose,sx:{minWidth:160},disabledArrow:!0,children:jsx(so,{onClose:l.onClose,children:M})})]})}),H&&jsx(g,{breakpoint:r,children:jsx(a$5,{value:mo,placeholder:"Buscar",onSearch:B,onChange:c=>fo?.(c.target.value),size:"small",fullWidth:!0,iconPosition:"start"})})]})]}),!L&&!N&&jsx(Fo,{sx:{mt:2}}),e$1&&e$1,d$1?jsxs(a$6,{isFetching:O,fetching:jsx(a$7,{}),isLoading:u,loading:jsx(Lo,{sx:{m:"160px auto"}}),isEmpty:n.length===0,empty:jsx(po,{flex:1,alignItems:"center",justifyContent:"center",children:f$1?.noRowsOverlay?jsx(f$1.noRowsOverlay,{}):jsx(eo,{variant:"body2",color:"text.secondary",children:"Nenhum registro encontrado"})}),children:[jsx(a$8,{fillContent:!0,children:n.map(c=>P(c))}),!G&&jsx(h,{children:jsx(j,{count:m,page:s.page,rowsPerPage:s.pageSize,onPageChange:c=>C(c,s.pageSize),onRowsPerPageChange:c=>C(s.page,c)})})]}):jsx(a$9,{columns:i,rows:n,slots:So,slotProps:{panel:{anchorEl:Po},toolbar:{setFilterButtonEl:Co,showQuickFilter:!0},...uo},columnHeaderHeight:48,getRowHeight:()=>68,loading:u,fetching:O,hideFooter:G,...go})]},u?"loading":"data")},Ir=zo;
22
+
23
+ export { ao as a, so as b, co as c, Ir as d };
24
+ //# sourceMappingURL=out.js.map
25
+ //# sourceMappingURL=chunk-6UWD6IZZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/DataView/index.tsx","../src/components/DataView/contants.ts","../src/components/DataView/DesktopFooter.tsx","../src/components/DataView/EnhancedMoreActions.tsx","../src/components/DataView/Toolbar.tsx"],"names":["useCallback","useMemo","useState","Button","CircularProgress","Divider","Stack","Typography","DATAGRID_ACTIONS","memo","jsx","jsxs","DesktopFooter","rowCount","page","rowsPerPage","onPaginationChange","DesktopPaginationContainer","Pagination_default","newPage","newRowsPerPage","DesktopFooter_default","Children","cloneElement","isValidElement","createEnhanceMoreActions","children","onClose","child","originalOnClick","enhancedProps","args","childProps","EnhancedMoreActions","EnhancedMoreActions_default","forwardRef","GridToolbarColumnsButton","ColumnsButton","props","ref","Icon_default","Toolbar","setFilterButtonEl","handleColumnsButtonRef","button","Portal_default","Toolbar_default","Fragment","DataView","title","headerContent","breakpoint","columns","rows","mobileRender","paginationModel","actions","moreActions","onAdd","onSearch","searchValue","onSearchChange","slots","slotProps","loading","fetching","containerProps","hideFooter","hideHeader","showColumnButton","others","popover","usePopover_default","isMobile","useResponsive_default","filterButtonEl","showSearch","showAdd","showActions","showMoreActions","showHeaderMoreActions","showTopbarMoreActions","showActionsContainer","showTopbar","FooterComponent","dataGridSlots","Container","Header","ActionsContainer","ActionsDivider","Topbar","ToolbarActionsDivider","MenuPopover_default","SearchContainer","SearchInput_default","e","Result_default","FixedProgressBar_default","Scrollbar_default","row","MobilePaginationContainer","DataGrid_default","DataView_default"],"mappings":"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","sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport Button from '@mui/material/Button';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport Divider from '@mui/material/Divider';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\nimport { GridSlotsComponentsProps } from '@mui/x-data-grid-premium';\n\nimport DataGrid from 'components/DataGrid';\nimport FixedProgressBar from 'components/FixedProgressBar';\nimport Icon from 'components/Icon';\nimport MenuPopover from 'components/MenuPopover';\nimport Result from 'components/Result';\nimport Scrollbar from 'components/Scrollbar';\nimport SearchInput from 'components/SearchInput';\nimport usePopover from 'hooks/usePopover';\nimport useResponsive from 'hooks/useResponsive';\n\nimport { DATAGRID_ACTIONS } from './contants';\nimport DesktopFooter from './DesktopFooter';\nimport EnhancedMoreActions from './EnhancedMoreActions';\nimport Pagination from './Pagination';\nimport { DataGridSlotsProps, DataViewProps } from './props';\nimport {\n ActionsContainer,\n ActionsDivider,\n Container,\n Header,\n MobilePaginationContainer,\n SearchContainer,\n ToolbarActionsDivider,\n Topbar,\n} from './styles';\nimport Toolbar from './Toolbar';\n\nconst DataView = ({\n title,\n headerContent,\n breakpoint = 'md',\n columns,\n rows = [],\n mobileRender,\n rowCount = 0,\n paginationModel = { page: 0, pageSize: 25 },\n onPaginationChange,\n actions,\n moreActions,\n onAdd,\n onSearch,\n searchValue,\n onSearchChange,\n slots,\n slotProps,\n loading,\n fetching,\n containerProps = { height: 562, maxHeight: 562 },\n hideFooter,\n hideHeader = false,\n showColumnButton = false,\n ...others\n}: DataViewProps) => {\n const popover = usePopover();\n const isMobile = useResponsive('down', breakpoint);\n const [filterButtonEl, setFilterButtonEl] =\n useState<HTMLButtonElement | null>(null);\n\n const showSearch = !!onSearch;\n const showAdd = !!onAdd;\n const showActions = !!actions;\n const showMoreActions = !!moreActions;\n const showHeaderMoreActions = isMobile && showMoreActions;\n const showTopbarMoreActions = !isMobile && showMoreActions;\n const showActionsContainer = showActions || showAdd || showHeaderMoreActions;\n const showTopbar =\n showTopbarMoreActions || showSearch || showColumnButton || !isMobile;\n\n const FooterComponent = useCallback(\n () => (\n <DesktopFooter\n rowCount={rowCount}\n page={paginationModel.page}\n rowsPerPage={paginationModel.pageSize}\n onPaginationChange={onPaginationChange}\n />\n ),\n [rowCount, paginationModel, onPaginationChange],\n );\n\n const dataGridSlots: DataGridSlotsProps = useMemo(\n () => ({\n ...slots,\n footer: FooterComponent as unknown as DataGridSlotsProps['footer'],\n ...(showColumnButton &&\n !slots?.toolbar && {\n toolbar: Toolbar as unknown as DataGridSlotsProps['toolbar'],\n }),\n }),\n [slots, FooterComponent, showColumnButton],\n );\n\n return (\n <Container\n key={loading ? 'loading' : 'data'}\n breakpoint={breakpoint}\n {...containerProps}\n flex={loading ? 1 : undefined}\n minHeight={!loading && rows.length === 0 ? 562 : undefined}\n >\n {!hideHeader && (\n <>\n <Header breakpoint={breakpoint}>\n <Typography variant=\"overline\" color=\"text.secondary\" noWrap>\n {title}\n </Typography>\n\n {showActionsContainer && (\n <ActionsContainer breakpoint={breakpoint}>\n {showActions && actions}\n\n {showAdd && (\n <>\n {showActions && (\n <ActionsDivider orientation=\"vertical\" flexItem />\n )}\n\n <Button\n startIcon={<Icon icon=\"SIMPLE_ADD\" />}\n variant=\"contained\"\n onClick={onAdd}\n >\n Adicionar\n </Button>\n </>\n )}\n\n {showHeaderMoreActions && (\n <>\n {(showActions || showAdd) && (\n <ActionsDivider orientation=\"vertical\" flexItem />\n )}\n\n <Button\n color=\"inherit\"\n startIcon={<Icon icon=\"MORE_BOLD\" />}\n size=\"small\"\n onClick={popover.onOpen}\n >\n Mais\n </Button>\n </>\n )}\n </ActionsContainer>\n )}\n </Header>\n\n {showTopbar && (\n <Topbar breakpoint={breakpoint}>\n <Stack\n flex={1}\n direction=\"row\"\n alignItems=\"center\"\n id={DATAGRID_ACTIONS}\n gap={0.5}\n >\n {showMoreActions && (\n <>\n {showTopbarMoreActions && (\n <>\n <Button\n color=\"inherit\"\n startIcon={<Icon icon=\"MORE_BOLD\" />}\n size=\"small\"\n onClick={popover.onOpen}\n >\n Mais\n </Button>\n\n {!isMobile && (\n <ToolbarActionsDivider\n orientation=\"vertical\"\n flexItem\n />\n )}\n </>\n )}\n\n {(showTopbarMoreActions || showHeaderMoreActions) && (\n <MenuPopover\n open={popover.open}\n anchorEl={popover.open}\n onClose={popover.onClose}\n sx={{\n minWidth: 160,\n }}\n disabledArrow={true}\n >\n <EnhancedMoreActions onClose={popover.onClose}>\n {moreActions}\n </EnhancedMoreActions>\n </MenuPopover>\n )}\n </>\n )}\n </Stack>\n\n {showSearch && (\n <SearchContainer breakpoint={breakpoint}>\n <SearchInput\n value={searchValue}\n placeholder=\"Buscar\"\n onSearch={onSearch}\n onChange={e => onSearchChange?.(e.target.value)}\n size=\"small\"\n fullWidth\n iconPosition=\"start\"\n />\n </SearchContainer>\n )}\n </Topbar>\n )}\n </>\n )}\n\n {!showTopbar && !hideHeader && <Divider sx={{ mt: 2 }} />}\n\n {headerContent && headerContent}\n\n {isMobile ? (\n <Result\n isFetching={fetching}\n fetching={<FixedProgressBar />}\n isLoading={loading}\n loading={<CircularProgress sx={{ m: '160px auto' }} />}\n isEmpty={rows.length === 0}\n empty={\n <Stack flex={1} alignItems=\"center\" justifyContent=\"center\">\n {slots?.noRowsOverlay ? (\n <slots.noRowsOverlay />\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n Nenhum registro encontrado\n </Typography>\n )}\n </Stack>\n }\n >\n <Scrollbar fillContent>\n {rows.map(row => mobileRender(row))}\n </Scrollbar>\n\n {!hideFooter && (\n <MobilePaginationContainer>\n <Pagination\n count={rowCount}\n page={paginationModel.page}\n rowsPerPage={paginationModel.pageSize}\n onPageChange={newPage =>\n onPaginationChange(newPage, paginationModel.pageSize)\n }\n onRowsPerPageChange={newRowsPerPage =>\n onPaginationChange(paginationModel.page, newRowsPerPage)\n }\n />\n </MobilePaginationContainer>\n )}\n </Result>\n ) : (\n <DataGrid\n columns={columns}\n rows={rows}\n slots={dataGridSlots}\n slotProps={{\n panel: { anchorEl: filterButtonEl },\n toolbar: {\n setFilterButtonEl,\n showQuickFilter: true,\n } as unknown as GridSlotsComponentsProps['toolbar'],\n ...slotProps,\n }}\n columnHeaderHeight={48}\n getRowHeight={() => 68}\n loading={loading}\n fetching={fetching}\n hideFooter={hideFooter}\n {...others}\n />\n )}\n </Container>\n );\n};\n\nexport default DataView;\nexport {\n ActionsContainer,\n ActionsDivider,\n Container,\n DesktopFooter,\n EnhancedMoreActions,\n Header,\n MobilePaginationContainer,\n SearchContainer,\n Toolbar,\n ToolbarActionsDivider,\n Topbar,\n};\n","export const DATAGRID_ACTIONS = 'datagrid-actions';\n","import { memo } from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport Pagination from './Pagination';\nimport { DesktopFooterProps } from './props';\nimport { DesktopPaginationContainer } from './styles';\n\nconst DesktopFooter = ({\n rowCount,\n page,\n rowsPerPage,\n onPaginationChange,\n}: DesktopFooterProps) => {\n return (\n <DesktopPaginationContainer>\n <Stack direction=\"row\" alignItems=\"center\" gap={0.5}>\n <Typography variant=\"body2\" color=\"text.disabled\">\n Total de itens:\n </Typography>\n <Typography variant=\"body2\">{rowCount}</Typography>\n </Stack>\n\n <Pagination\n count={rowCount}\n page={page}\n rowsPerPage={rowsPerPage}\n onPageChange={newPage => onPaginationChange(newPage, rowsPerPage)}\n onRowsPerPageChange={newRowsPerPage =>\n onPaginationChange(page, newRowsPerPage)\n }\n />\n </DesktopPaginationContainer>\n );\n};\n\nexport default memo(DesktopFooter);\n","import {\n Children,\n cloneElement,\n isValidElement,\n memo,\n ReactElement,\n ReactNode,\n} from 'react';\n\nimport { EnhancedMoreActionsProps } from './props';\n\nconst createEnhanceMoreActions = (\n children: ReactNode,\n onClose: () => void,\n): ReactNode => {\n return Children.map(children, child => {\n if (!isValidElement(child)) {\n return child;\n }\n\n const originalOnClick = (\n child.props as { onClick?: (...args: unknown[]) => void }\n ).onClick;\n\n const enhancedProps: {\n onClick?: (...args: unknown[]) => void;\n children?: ReactNode;\n } = {};\n\n enhancedProps.onClick = (...args: unknown[]) => {\n onClose();\n if (originalOnClick) {\n originalOnClick(...args);\n }\n };\n\n const childProps = child.props as { children?: ReactNode };\n if (childProps?.children) {\n enhancedProps.children = createEnhanceMoreActions(\n childProps.children,\n onClose,\n );\n }\n\n return cloneElement(child as ReactElement, enhancedProps);\n });\n};\n\nconst EnhancedMoreActions = ({\n children,\n onClose,\n}: EnhancedMoreActionsProps) => {\n if (!children) return null;\n return createEnhanceMoreActions(children, onClose);\n};\n\nexport default memo(EnhancedMoreActions);\n","import { forwardRef, useCallback } from 'react';\nimport Button, { ButtonProps } from '@mui/material/Button';\nimport { GridToolbarColumnsButton } from '@mui/x-data-grid-premium';\n\nimport Icon from 'components/Icon';\nimport Portal from 'components/Portal';\n\nimport { DATAGRID_ACTIONS } from './contants';\nimport { ToolbarProps } from './props';\n\nconst ColumnsButton = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ children, ...props }, ref) => (\n <Button\n {...props}\n ref={ref}\n color=\"inherit\"\n startIcon={<Icon icon=\"COLUMNS\" />}\n >\n {children ?? 'Colunas'}\n </Button>\n ),\n);\n\nColumnsButton.displayName = 'ColumnsButton';\n\nconst Toolbar = ({ setFilterButtonEl }: ToolbarProps) => {\n const handleColumnsButtonRef = useCallback(\n (button: HTMLButtonElement | null) => {\n setFilterButtonEl(button);\n },\n [setFilterButtonEl],\n );\n\n return (\n <Portal container={DATAGRID_ACTIONS}>\n <GridToolbarColumnsButton\n ref={handleColumnsButtonRef}\n slotProps={{\n button: {\n color: 'inherit',\n startIcon: <Icon icon=\"COLUMNS\" />,\n children: 'Colunas',\n },\n }}\n />\n </Portal>\n );\n};\n\nexport default Toolbar;\n"]}
@@ -0,0 +1,7 @@
1
+ import { useEffectEvent, useEffect } from 'react';
2
+
3
+ function l(n,v,t,o){let d=useEffectEvent(v);useEffect(()=>{let e=t?.current||window;if(!(e&&e.addEventListener))return;let i=s=>d(s);return e.addEventListener(n,i,o),()=>{e.removeEventListener(n,i);}},[t,n,o,d]);}var u=l;
4
+
5
+ export { u as a };
6
+ //# sourceMappingURL=out.js.map
7
+ //# sourceMappingURL=chunk-BLVCNBTJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useEventListener.ts"],"names":["useEffect","useEffectEvent","useEventListener","eventName","handler","element","options","stableHandler","targetElement","eventListener","event","useEventListener_default"],"mappings":"AAAA,OAAoB,aAAAA,EAAW,kBAAAC,MAAsB,QA6BrD,SAASC,EAKPC,EACAC,EAGAC,EACAC,EACA,CACA,IAAMC,EAAgBN,EAAeG,CAAO,EAE5CJ,EAAU,IAAM,CACd,IAAMQ,EAA4BH,GAAS,SAAW,OACtD,GAAI,EAAEG,GAAiBA,EAAc,kBACnC,OAGF,IAAMC,EAAgCC,GAASH,EAAcG,CAAK,EAElE,OAAAF,EAAc,iBAAiBL,EAAWM,EAAeH,CAAO,EAEzD,IAAM,CACXE,EAAc,oBAAoBL,EAAWM,CAAa,CAC5D,CACF,EAAG,CAACJ,EAASF,EAAWG,EAASC,CAAa,CAAC,CACjD,CAEA,IAAOI,EAAQT","sourcesContent":["import { RefObject, useEffect, useEffectEvent } from 'react';\n\n// Window Event based useEventListener interface\nfunction useEventListener<K extends keyof WindowEventMap>(\n eventName: K,\n handler: (event: WindowEventMap[K]) => void,\n element?: undefined,\n options?: boolean | AddEventListenerOptions,\n): void;\n\n// Element Event based useEventListener interface\nfunction useEventListener<\n K extends keyof HTMLElementEventMap,\n T extends HTMLElement = HTMLDivElement,\n>(\n eventName: K,\n handler: (event: HTMLElementEventMap[K]) => void,\n element: RefObject<T | null>,\n options?: boolean | AddEventListenerOptions,\n): void;\n\n// Document Event based useEventListener interface\nfunction useEventListener<K extends keyof DocumentEventMap>(\n eventName: K,\n handler: (event: DocumentEventMap[K]) => void,\n element: RefObject<Document | null>,\n options?: boolean | AddEventListenerOptions,\n): void;\n\nfunction useEventListener<\n KW extends keyof WindowEventMap,\n KH extends keyof HTMLElementEventMap,\n T extends HTMLElement | void = void,\n>(\n eventName: KW | KH,\n handler: (\n event: WindowEventMap[KW] | HTMLElementEventMap[KH] | Event,\n ) => void,\n element?: RefObject<T | null>,\n options?: boolean | AddEventListenerOptions,\n) {\n const stableHandler = useEffectEvent(handler);\n\n useEffect(() => {\n const targetElement: T | Window = element?.current || window;\n if (!(targetElement && targetElement.addEventListener)) {\n return;\n }\n\n const eventListener: typeof handler = event => stableHandler(event);\n\n targetElement.addEventListener(eventName, eventListener, options);\n\n return () => {\n targetElement.removeEventListener(eventName, eventListener);\n };\n }, [element, eventName, options, stableHandler]);\n}\n\nexport default useEventListener;\n"]}
@@ -2,8 +2,8 @@ import { cloneElement } from 'react';
2
2
  import p from '@mui/material/Tooltip';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
5
- var i=({children:t,...e})=>{let o=t;return jsx(p,{...e,children:cloneElement(o,{style:{userSelect:"none",...o.props.style}})})},T=i;
5
+ var r=({children:e,...t})=>{let o=e;return jsx(p,{...t,children:cloneElement(o,{style:{userSelect:"none",...o.props.style}})})},T=r;
6
6
 
7
7
  export { T as a };
8
8
  //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-45OMMG7D.js.map
9
+ //# sourceMappingURL=chunk-FBN7HCBY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Tooltip/index.tsx"],"names":["cloneElement","MuiTooltip","jsx","Tooltip","children","props","childElement","Tooltip_default"],"mappings":"AAAA,OAAS,gBAAAA,MAAiD,QAC1D,OAAOC,MAAkC,wBAMrC,cAAAC,MAAA,oBAJJ,IAAMC,EAAU,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAM,IAAoB,CACxD,IAAMC,EAAeF,EAErB,OACEF,EAACD,EAAA,CAAY,GAAGI,EACb,SAAAL,EAAaM,EAAc,CAC1B,MAAO,CAAE,WAAY,OAAQ,GAAGA,EAAa,MAAM,KAAM,CAC3D,CAAC,EACH,CAEJ,EAEOC,EAAQJ","sourcesContent":["import { cloneElement, CSSProperties, ReactElement } from 'react';\nimport MuiTooltip, { TooltipProps } from '@mui/material/Tooltip';\n\nconst Tooltip = ({ children, ...props }: TooltipProps) => {\n const childElement = children as ReactElement<{ style?: CSSProperties }>;\n\n return (\n <MuiTooltip {...props}>\n {cloneElement(childElement, {\n style: { userSelect: 'none', ...childElement.props.style },\n })}\n </MuiTooltip>\n );\n};\n\nexport default Tooltip;\n"]}
@@ -1,9 +1,9 @@
1
1
  import { a } from './chunk-POTVACYB.js';
2
- import { a as a$1 } from './chunk-L5URMM57.js';
2
+ import { a as a$1 } from './chunk-BLVCNBTJ.js';
3
3
  import { useCallback, useState, useEffect } from 'react';
4
4
 
5
5
  var h=typeof window>"u",p=(r,t,o={})=>{let{initializeWithValue:l=!0}=o,S=useCallback(e=>o.serializer?o.serializer(e):JSON.stringify(e),[o]),d=useCallback(e=>{if(o.deserializer)return o.deserializer(e);if(e==="undefined")return;let n=t instanceof Function?t():t,g;try{g=JSON.parse(e);}catch{return n}return g},[o,t]),a$2=useCallback(()=>{let e=t instanceof Function?t():t;if(h)return e;try{let n=window.localStorage.getItem(r);return n?d(n):e}catch{return e}},[t,r,d]),[w,s]=useState(()=>l?a$2():t instanceof Function?t():t),T=a(e=>{try{let n=e instanceof Function?e(a$2()):e;window.localStorage.setItem(r,S(n)),s(n),window.dispatchEvent(new StorageEvent("local-storage",{key:r}));}catch{}}),m=a(()=>{let e=t instanceof Function?t():t;window.localStorage.removeItem(r),s(e),window.dispatchEvent(new StorageEvent("local-storage",{key:r}));});useEffect(()=>{s(a$2());},[r]);let f=useCallback(e=>{e.key&&e.key!==r||s(a$2());},[r,a$2]);return a$1("storage",f),a$1("local-storage",f),[w,T,m]},I=p;
6
6
 
7
7
  export { I as a };
8
8
  //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-HWYA3EGC.js.map
9
+ //# sourceMappingURL=chunk-HYJEAKVR.js.map
@@ -1,4 +1,4 @@
1
- import { a as a$2 } from './chunk-45OMMG7D.js';
1
+ import { a as a$2 } from './chunk-FBN7HCBY.js';
2
2
  import { a as a$3 } from './chunk-NQNNMRLC.js';
3
3
  import { a as a$1 } from './chunk-IAOMC4C4.js';
4
4
  import { a } from './chunk-CFNATBO2.js';
@@ -10,4 +10,4 @@ var l=({label:t="Copiar conte\xFAdo",message:c="Conte\xFAdo copiado!",toCopy:m})
10
10
 
11
11
  export { I as a };
12
12
  //# sourceMappingURL=out.js.map
13
- //# sourceMappingURL=chunk-ZGSSTXUO.js.map
13
+ //# sourceMappingURL=chunk-LQZSZV2W.js.map
@@ -1,8 +1,8 @@
1
1
  import { a as a$1 } from './chunk-XNKYJHNL.js';
2
- import { a } from './chunk-HWYA3EGC.js';
2
+ import { a } from './chunk-HYJEAKVR.js';
3
3
 
4
4
  var s=(t=!0)=>{let[,a$2]=a("isNavMini",!1);a$1(()=>{a$2(t);});},r=s;
5
5
 
6
6
  export { r as a };
7
7
  //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-5LQLLZ5L.js.map
8
+ //# sourceMappingURL=chunk-PSWJSHGP.js.map
@@ -12,8 +12,8 @@ import st from '@mui/material/useMediaQuery';
12
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
13
  import lt from '@mui/material/Popper';
14
14
 
15
- var D=8,pt=r=>{let{data:n,index:i,style:c}=r,o=n[i],{showValueInLabel:s,key:y,...g}=o[0],u={...c,top:c.top+D,paddingTop:8};return Object.prototype.hasOwnProperty.call(o,"group")?jsx(ot,{component:"div",style:u,children:o.group},`list-box-item-group-${y}`):jsx(H,{component:"li",...g,noWrap:!0,style:u,children:jsxs(nt,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[o[1].icon&&jsx(a,{icon:o[1].icon}),o[1].label,s&&jsxs(H,{variant:"inherit",color:"grey.400",children:["(",o[1].value,")"]})]})},`list-box-item-${y}`)},X=createContext({}),J=forwardRef((r,n)=>{let i=useContext(X);return jsx("div",{ref:n,...r,...i})});J.displayName="OuterElementType";var ut=r=>{let n=useRef(null);return useEffect(()=>{n.current!=null&&n.current.resetAfterIndex(0,!0);},[r]),n},at=forwardRef(function(n,i){let{children:c,...o}=n,s=[];c.forEach(p=>{s.push(p),s.push(...p.children||[]);});let y=useTheme(),g=st(y.breakpoints.up("sm")),u=s.length,h=g?36:48,l=p=>Object.prototype.hasOwnProperty.call(p,"group")?48:h,x=()=>u>8?8*h:s.map(l).reduce((p,a)=>p+a,0),A=ut(u);return jsx("div",{ref:i,children:jsx(X.Provider,{value:o,children:jsx(VariableSizeList,{itemData:s,height:x()+2*D,width:"100%",ref:A,outerElementType:J,innerElementType:"ul",itemSize:p=>l(s[p]),overscanCount:5,itemCount:u,children:pt})})})}),W=at;var $=styled(lt)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var ht=r=>r&&typeof r=="object"?r.value.toString():r.toString(),U=forwardRef(({name:r,label:n,value:i,options:c=[],loading:o,noOptionsText:s="Nenhum resultado encontrado.",loadingText:y="Carregando op\xE7\xF5es...",error:g,helperText:u,placeholder:h,onChange:l,groupBy:x,showValueInLabel:A,disabled:p,multiple:a$1,required:I,renderOption:S,tabIndex:M,onInputChange:O,onSearch:T,onBlur:R,InputLabelProps:k,...B},V)=>{let v=useMemo(()=>new Map(c.map(t=>[t.value.toString(),t])),[c]),m=useMemo(()=>a$1?(Array.isArray(i)?i:[]).map(e=>v.get(e.toString())).filter(Boolean):i?.toString()&&v.get(i.toString())||null,[v,i,a$1]),j=(t,e)=>{let d=e.inputValue.toLocaleUpperCase();return t.filter(C=>`${C.value} ${C.label}`.toLocaleUpperCase().includes(d))},F=useMemo(()=>S?void 0:W,[S]),w=useMemo(()=>{let t=typeof m=="string",e=Array.isArray(m);return m&&!t&&!e&&m?.icon?jsx(a,{icon:m.icon}):null},[m]),G=useCallback((t,e,d)=>{if(O&&O(t,e,d),d==="input"){T&&T(e);return}},[O,T]),_=useCallback((t,e)=>{if(!e){l(a$1?[]:null);return}if(Array.isArray(e)){l(e.map(ht));return}if(typeof e=="string"){l(e.toString());return}l(e.value.toString());},[l,a$1]),Q=useCallback(t=>{R&&R(t);},[R]),q=useCallback(t=>jsx(gt,{...t,name:r,placeholder:h,fullWidth:!0,error:!!g,helperText:u,label:n,required:I,InputProps:{...t.InputProps,...!a$1&&{startAdornment:w},endAdornment:jsxs(Fragment,{children:[o?jsx(yt,{color:"primary",size:20}):null,t.InputProps.endAdornment]})},inputProps:{...t.inputProps,name:r,tabIndex:M},InputLabelProps:k}),[r,h,g,u,n,I,a$1,w,o,M,k]),K=useCallback((t,e,d,C)=>S?S(t,e,d,C):[{...t,showValueInLabel:A},e],[S,A]);return jsx(ft,{ref:V,value:m,onInputChange:G,options:c,loading:o,noOptionsText:s,loadingText:y,disabled:o||p,disableListWrap:!0,PopperComponent:$,ListboxComponent:F,filterOptions:j,onChange:_,onBlur:Q,renderOption:K,renderGroup:t=>t,groupBy:x,multiple:a$1,renderInput:q,...B})});U.displayName="Autocomplete";var Qt=U;
15
+ var X=8,pt=r=>{let{data:n,index:i,style:c}=r,o=n[i],{showValueInLabel:s,key:y,...g}=o[0],u={...c,top:c.top+X,paddingTop:8};return Object.prototype.hasOwnProperty.call(o,"group")?jsx(ot,{component:"div",style:u,children:o.group},`list-box-item-group-${y}`):jsx(H,{component:"li",...g,noWrap:!0,style:u,children:jsxs(nt,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[o[1].icon&&jsx(a,{icon:o[1].icon}),o[1].label,s&&jsxs(H,{variant:"inherit",color:"grey.400",children:["(",o[1].value,")"]})]})},`list-box-item-${y}`)},D=createContext({}),J=forwardRef((r,n)=>{let i=useContext(D);return jsx("div",{ref:n,...r,...i})});J.displayName="OuterElementType";var ut=r=>{let n=useRef(null);return useEffect(()=>{n.current!=null&&n.current.resetAfterIndex(0,!0);},[r]),n},at=forwardRef(function(n,i){let{children:c,...o}=n,s=[];c.forEach(p=>{s.push(p),s.push(...p.children||[]);});let y=useTheme(),g=st(y.breakpoints.up("sm")),u=s.length,h=g?36:48,l=p=>Object.prototype.hasOwnProperty.call(p,"group")?48:h,x=()=>u>8?8*h:s.map(l).reduce((p,a)=>p+a,0),A=ut(u);return jsx("div",{ref:i,children:jsx(D.Provider,{value:o,children:jsx(VariableSizeList,{itemData:s,height:x()+2*X,width:"100%",ref:A,outerElementType:J,innerElementType:"ul",itemSize:p=>l(s[p]),overscanCount:5,itemCount:u,children:pt})})})}),W=at;var $=styled(lt)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var ht=r=>r&&typeof r=="object"?r.value.toString():r.toString(),U=forwardRef(({name:r,label:n,value:i,options:c=[],loading:o,noOptionsText:s="Nenhum resultado encontrado.",loadingText:y="Carregando op\xE7\xF5es...",error:g,helperText:u,placeholder:h,onChange:l,groupBy:x,showValueInLabel:A,disabled:p,multiple:a$1,required:I,renderOption:S,tabIndex:M,onInputChange:O,onSearch:T,onBlur:R,InputLabelProps:k,...B},V)=>{let v=useMemo(()=>new Map(c.map(t=>[t.value.toString(),t])),[c]),m=useMemo(()=>a$1?(Array.isArray(i)?i:[]).map(e=>v.get(e.toString())).filter(Boolean):i?.toString()&&v.get(i.toString())||null,[v,i,a$1]),j=(t,e)=>{let d=e.inputValue.toLocaleUpperCase();return t.filter(C=>`${C.value} ${C.label}`.toLocaleUpperCase().includes(d))},F=useMemo(()=>S?void 0:W,[S]),w=useMemo(()=>{let t=typeof m=="string",e=Array.isArray(m);return m&&!t&&!e&&m?.icon?jsx(a,{icon:m.icon}):null},[m]),G=useCallback((t,e,d)=>{if(O&&O(t,e,d),d==="input"){T&&T(e);return}},[O,T]),_=useCallback((t,e)=>{if(!e){l(a$1?[]:null);return}if(Array.isArray(e)){l(e.map(ht));return}if(typeof e=="string"){l(e.toString());return}l(e.value.toString());},[l,a$1]),Q=useCallback(t=>{R&&R(t);},[R]),q=useCallback(t=>jsx(gt,{...t,name:r,placeholder:h,fullWidth:!0,error:!!g,helperText:u,label:n,required:I,InputProps:{...t.InputProps,...!a$1&&{startAdornment:w},endAdornment:jsxs(Fragment,{children:[o?jsx(yt,{color:"primary",size:20}):null,t.InputProps.endAdornment]})},inputProps:{...t.inputProps,name:r,tabIndex:M},InputLabelProps:k}),[r,h,g,u,n,I,a$1,w,o,M,k]),K=useCallback((t,e,d,C)=>S?S(t,e,d,C):[{...t,showValueInLabel:A},e],[S,A]);return jsx(ft,{ref:V,value:m,onInputChange:G,options:c,loading:o,noOptionsText:s,loadingText:y,disabled:o||p,disableListWrap:!0,PopperComponent:$,ListboxComponent:F,filterOptions:j,onChange:_,onBlur:Q,renderOption:K,renderGroup:t=>t,groupBy:x,multiple:a$1,renderInput:q,...B})});U.displayName="Autocomplete";var Qt=U;
16
16
 
17
17
  export { Qt as a };
18
18
  //# sourceMappingURL=out.js.map
19
- //# sourceMappingURL=chunk-IGOVBLZ2.js.map
19
+ //# sourceMappingURL=chunk-QLGWOE3Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Autocomplete/index.tsx","../src/components/Autocomplete/Listbox.tsx","../src/components/Autocomplete/styles.ts"],"names":["forwardRef","useCallback","useMemo","MuiAutocomplete","CircularProgress","TextField","createContext","useContext","useEffect","useRef","VariableSizeList","ListSubheader","Stack","useTheme","Typography","useMediaQuery","jsx","jsxs","LISTBOX_PADDING","renderRow","props","data","index","style","dataSet","showValueInLabel","key","itemProps","inlineStyle","Icon_default","OuterElementContext","OuterElementType","ref","outerProps","useResetCache","ListboxComponent","children","other","itemData","item","theme","smUp","itemCount","itemSize","getChildSize","child","getHeight","a","b","gridRef","Listbox_default","autocompleteClasses","Popper","styled","StyledPopper","Fragment","getOptionValue","optionValue","Autocomplete","name","label","value","options","loading","noOptionsText","loadingText","error","helperText","placeholder","onChange","groupBy","disabled","multiple","required","renderOption","tabIndex","onInputChange","onSearch","onBlur","InputLabelProps","optionsMap","opt","formattedValue","v","filterOptions","optionsFilter","state","searchUpper","listboxComponentWithoutRenderOption","startAdornment","isString","isArray","handleInputChange","event","eventValue","reason","handleChange","_event","option","handleBlur","renderInput","params","renderOptionWrapper","ownerState","Autocomplete_default"],"mappings":"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","sourcesContent":["import { forwardRef, ReactNode, useCallback, useMemo } from 'react';\nimport MuiAutocomplete, {\n AutocompleteInputChangeReason,\n AutocompleteRenderInputParams,\n AutocompleteRenderOptionState,\n} from '@mui/material/Autocomplete';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport TextField from '@mui/material/TextField';\n\nimport { AutocompleteProps } from 'types/autoCompleteProps';\nimport { Option } from 'types/option';\n\nimport Icon, { IconEnum } from '../Icon';\n\nimport ListboxComponent from './Listbox';\nimport { StyledPopper } from './styles';\n\nconst getOptionValue = (optionValue: Option | string | number) =>\n optionValue && typeof optionValue === 'object'\n ? optionValue.value.toString()\n : optionValue.toString();\n\nconst Autocomplete = forwardRef<unknown, AutocompleteProps>(\n (\n {\n name,\n label,\n value,\n options = [],\n loading,\n noOptionsText = 'Nenhum resultado encontrado.',\n loadingText = 'Carregando opções...',\n error,\n helperText,\n placeholder,\n onChange,\n groupBy,\n showValueInLabel,\n disabled,\n multiple,\n required,\n renderOption,\n tabIndex,\n onInputChange,\n onSearch,\n onBlur,\n InputLabelProps,\n ...other\n },\n ref,\n ) => {\n const optionsMap = useMemo(\n () => new Map(options.map(opt => [opt.value.toString(), opt])),\n [options],\n );\n\n const formattedValue = useMemo(() => {\n if (multiple) {\n const values = Array.isArray(value) ? value : [];\n return values\n .map(v => optionsMap.get(v.toString()))\n .filter(Boolean) as Option[];\n }\n\n if (value?.toString()) return optionsMap.get(value.toString()) || null;\n\n return null;\n }, [optionsMap, value, multiple]);\n\n const filterOptions = (\n optionsFilter: Option[],\n state: { inputValue: string },\n ) => {\n const searchUpper = state.inputValue.toLocaleUpperCase();\n return optionsFilter.filter(opt => {\n const search = `${opt.value} ${opt.label}`;\n return search.toLocaleUpperCase().includes(searchUpper);\n });\n };\n\n const listboxComponentWithoutRenderOption = useMemo(\n () => (renderOption ? undefined : ListboxComponent),\n [renderOption],\n );\n\n const startAdornment = useMemo(() => {\n const isString = typeof formattedValue === 'string';\n const isArray = Array.isArray(formattedValue);\n const existsIcon =\n formattedValue && !isString && !isArray && formattedValue?.icon;\n\n if (existsIcon) {\n return <Icon icon={formattedValue.icon as IconEnum} />;\n }\n\n return null;\n }, [formattedValue]);\n\n const handleInputChange = useCallback(\n (\n event: React.SyntheticEvent,\n eventValue: string,\n reason: AutocompleteInputChangeReason,\n ) => {\n if (onInputChange) onInputChange(event, eventValue, reason);\n\n if (reason === 'input') {\n if (onSearch) {\n onSearch(eventValue);\n }\n\n return;\n }\n },\n [onInputChange, onSearch],\n );\n\n const handleChange = useCallback(\n (\n _event: React.SyntheticEvent,\n option: NonNullable<string | Option> | (string | Option)[] | null,\n ) => {\n if (!option) {\n onChange(multiple ? [] : null);\n return;\n }\n\n if (Array.isArray(option)) {\n onChange(option.map(getOptionValue));\n return;\n }\n\n if (typeof option === 'string') {\n onChange(option.toString());\n return;\n }\n\n onChange(option.value.toString());\n return;\n },\n [onChange, multiple],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n if (onBlur) onBlur(event);\n },\n [onBlur],\n );\n\n const renderInput = useCallback(\n (params: AutocompleteRenderInputParams) => (\n <TextField\n {...params}\n name={name}\n placeholder={placeholder}\n fullWidth\n error={!!error}\n helperText={helperText}\n label={label}\n required={required}\n InputProps={{\n ...params.InputProps,\n ...(!multiple && { startAdornment }),\n endAdornment: (\n <>\n {loading ? (\n <CircularProgress color=\"primary\" size={20} />\n ) : null}\n {params.InputProps.endAdornment}\n </>\n ),\n }}\n inputProps={{\n ...params.inputProps,\n name,\n tabIndex,\n }}\n InputLabelProps={InputLabelProps}\n />\n ),\n [\n name,\n placeholder,\n error,\n helperText,\n label,\n required,\n multiple,\n startAdornment,\n loading,\n tabIndex,\n InputLabelProps,\n ],\n );\n\n const renderOptionWrapper = useCallback(\n (\n props: React.HTMLAttributes<HTMLLIElement> & { key: unknown },\n option: Option,\n state: AutocompleteRenderOptionState,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ownerState: any,\n ) =>\n renderOption\n ? renderOption(props, option, state, ownerState)\n : ([{ ...props, showValueInLabel }, option] as ReactNode),\n [renderOption, showValueInLabel],\n );\n\n return (\n <MuiAutocomplete\n ref={ref}\n value={formattedValue}\n onInputChange={handleInputChange}\n options={options}\n loading={loading}\n noOptionsText={noOptionsText}\n loadingText={loadingText}\n disabled={loading || disabled}\n disableListWrap\n PopperComponent={StyledPopper}\n ListboxComponent={listboxComponentWithoutRenderOption}\n filterOptions={filterOptions}\n onChange={handleChange}\n onBlur={handleBlur}\n renderOption={renderOptionWrapper}\n renderGroup={params => params as unknown as ReactNode}\n groupBy={groupBy}\n multiple={multiple}\n renderInput={renderInput}\n {...other}\n />\n );\n },\n);\n\nAutocomplete.displayName = 'Autocomplete';\n\nexport default Autocomplete;\n","import {\n createContext,\n forwardRef,\n HTMLAttributes,\n type JSX,\n useContext,\n useEffect,\n useRef,\n} from 'react';\nimport { ListChildComponentProps, VariableSizeList } from 'react-window';\nimport ListSubheader from '@mui/material/ListSubheader';\nimport Stack from '@mui/material/Stack';\nimport { useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport Icon from '../Icon';\n\nconst LISTBOX_PADDING = 8;\n\nconst renderRow = (props: ListChildComponentProps) => {\n const { data, index, style } = props;\n const dataSet = data[index];\n const { showValueInLabel, key, ...itemProps } = dataSet[0];\n\n const inlineStyle = {\n ...style,\n top: (style.top as number) + LISTBOX_PADDING,\n paddingTop: 8,\n };\n\n if (Object.prototype.hasOwnProperty.call(dataSet, 'group'))\n return (\n <ListSubheader\n key={`list-box-item-group-${key}`}\n component=\"div\"\n style={inlineStyle}\n >\n {dataSet.group}\n </ListSubheader>\n );\n\n return (\n <Typography\n component=\"li\"\n key={`list-box-item-${key}`}\n {...itemProps}\n noWrap\n style={inlineStyle}\n >\n <Stack\n component=\"div\"\n direction=\"row\"\n flex={1}\n gap={1}\n justifyContent=\"start\"\n >\n {dataSet[1].icon && <Icon icon={dataSet[1].icon} />}\n {dataSet[1].label}\n\n {showValueInLabel && (\n <Typography variant=\"inherit\" color=\"grey.400\">\n ({dataSet[1].value})\n </Typography>\n )}\n </Stack>\n </Typography>\n );\n};\n\nconst OuterElementContext = createContext({});\n\nconst OuterElementType = forwardRef<HTMLDivElement>((props, ref) => {\n const outerProps = useContext(OuterElementContext);\n return <div ref={ref} {...props} {...outerProps} />;\n});\n\nOuterElementType.displayName = 'OuterElementType';\n\nconst useResetCache = (data: number) => {\n const ref = useRef<VariableSizeList>(null);\n\n useEffect(() => {\n if (ref.current != null) {\n ref.current.resetAfterIndex(0, true);\n }\n }, [data]);\n\n return ref;\n};\n\nconst ListboxComponent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLElement>\n>(function ListboxComponent(props, ref) {\n const { children, ...other } = props;\n const itemData: JSX.Element[] = [];\n (children as JSX.Element[]).forEach(\n (item: JSX.Element & { children?: JSX.Element[] }) => {\n itemData.push(item);\n itemData.push(...(item.children || []));\n },\n );\n\n const theme = useTheme();\n const smUp = useMediaQuery(theme.breakpoints.up('sm'));\n const itemCount = itemData.length;\n const itemSize = smUp ? 36 : 48;\n\n const getChildSize = (child: JSX.Element) => {\n if (Object.prototype.hasOwnProperty.call(child, 'group')) {\n return 48;\n }\n\n return itemSize;\n };\n\n const getHeight = () => {\n if (itemCount > 8) {\n return 8 * itemSize;\n }\n return itemData.map(getChildSize).reduce((a, b) => a + b, 0);\n };\n\n const gridRef = useResetCache(itemCount);\n\n return (\n <div ref={ref}>\n <OuterElementContext.Provider value={other}>\n <VariableSizeList\n itemData={itemData}\n height={getHeight() + 2 * LISTBOX_PADDING}\n width=\"100%\"\n ref={gridRef}\n outerElementType={OuterElementType}\n innerElementType=\"ul\"\n itemSize={index => getChildSize(itemData[index])}\n overscanCount={5}\n itemCount={itemCount}\n >\n {renderRow}\n </VariableSizeList>\n </OuterElementContext.Provider>\n </div>\n );\n});\n\nexport default ListboxComponent;\n","import { autocompleteClasses } from '@mui/material/Autocomplete';\nimport Popper from '@mui/material/Popper';\nimport { styled } from '@mui/material/styles';\n\nexport const StyledPopper = styled(Popper)({\n [`& .${autocompleteClasses.listbox}`]: {\n boxSizing: 'border-box',\n '& ul': {\n padding: 0,\n margin: 0,\n },\n },\n});\n"]}
@@ -2,7 +2,7 @@ import { a } from './chunk-LNXA53QR.js';
2
2
  import { a as a$5 } from './chunk-KEOOC3EL.js';
3
3
  import { a as a$2 } from './chunk-N4DW7EIC.js';
4
4
  import { e } from './chunk-OF6623HG.js';
5
- import { a as a$3 } from './chunk-45OMMG7D.js';
5
+ import { a as a$3 } from './chunk-FBN7HCBY.js';
6
6
  import { a as a$6 } from './chunk-6U5LS7MP.js';
7
7
  import { j } from './chunk-VITOOMKK.js';
8
8
  import { a as a$4 } from './chunk-NQNNMRLC.js';
@@ -28,8 +28,8 @@ import Kr from '@mui/material/Tooltip';
28
28
  import { useDropzone } from 'react-dropzone';
29
29
  import Yt from '@mui/material/CircularProgress';
30
30
 
31
- var Jo=({helperText:e,disabled:o,isError:r})=>e?jsx(Ko,{error:r,sx:n=>({mx:"14px",color:o?n.palette.grey[500]:void 0}),children:e}):null,_=memo(Jo);var Ce=styled(he)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),ke=styled(he)({position:"absolute",top:4,right:4,gap:.5,"& svg":{width:16,height:16}}),lo=styled(ze,{shouldForwardProp:e=>!["isDragActive","isError","disabled"].includes(e)})(({theme:e,isDragActive:o,isError:r,disabled:n})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`dashed 1px ${e.palette.divider}`,...o&&{opacity:.72},...r&&{color:e.palette.error.main,backgroundColor:e.palette.error.lighter,borderColor:e.palette.error.light},...n&&{opacity:.48,pointerEvents:"none"},"&:hover":{opacity:.72}})),so=styled(Yo)(({theme:e})=>({position:"relative",zIndex:999,pointerEvents:"auto",color:e.palette.grey[700],backgroundColor:e.palette.grey[100],"&:hover":{color:e.palette.grey[900],backgroundColor:e.palette.grey[300]}})),Xe=styled("div")({position:"relative",zIndex:1,userSelect:"none","&:hover":{zIndex:2}}),po=styled(he,{shouldForwardProp:e=>!["isDragging"].includes(e)})(({theme:e,width:o,isDragging:r})=>({width:o,height:100,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2,1,2,1),gap:e.spacing(1),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),co=styled(m.div)(({theme:e,width:o,isDragging:r})=>({width:o,height:60,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),mo=styled(a)(({theme:e})=>({top:16,right:16,zIndex:9,position:"absolute",color:e.palette.common.white,backgroundColor:alpha(e.palette.grey[900],.72),"&:hover":{backgroundColor:alpha(e.palette.grey[900],.48)}})),fo=styled(ze,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="disabled"&&e!=="hasError"})(({theme:e,isDragActive:o,disabled:r,hasError:n})=>({width:64,height:64,flexShrink:0,display:"flex",borderRadius:1,cursor:"pointer",alignItems:"center",color:e.palette.text.disabled,justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),border:`dashed 1px ${alpha(e.palette.grey[500],.16)}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...n&&{color:e.palette.error.main,borderColor:e.palette.error.main,backgroundColor:alpha(e.palette.error.main,.08)},"&:hover":{opacity:.72}})),uo=styled(ze)(({theme:e})=>({padding:e.spacing(1),top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out",filter:"blur(0)","&:hover .single-file-preview-img":{filter:"blur(3px)",transition:"all 0.1s ease-in-out"},"&:hover .single-file-preview-hover-overlay":{opacity:1}})),go=styled("img",{shouldForwardProp:e=>e!=="aspectRatio"&&e!=="isLoading"&&e!=="isUploading"&&e!=="maxWidth"&&e!=="maxHeight"&&e!=="cropSize"&&e!=="fill"})(({theme:e,aspectRatio:o,maxWidth:r,maxHeight:n,isLoading:t,isUploading:l,fill:a})=>({borderRadius:e.shape.borderRadius,objectFit:"cover",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)",filter:"blur(0)",zIndex:1,backgroundColor:e.palette.background.paper,...a&&{width:"100%",height:"100%"},...!a&&Math.abs(o)>=1&&{maxWidth:r,maxHeight:n,aspectRatio:Math.abs(o),width:"calc(100% - 16px)",height:void 0},...!a&&Math.abs(o)<1&&{maxWidth:r,maxHeight:n,aspectRatio:Math.abs(o),width:void 0,height:"calc(100% - 16px)"},transition:"all 0.3s ease-in-out",...t||l?{opacity:0,filter:"blur(1.5rem)",transform:"translate(-50%, -50%) scale(0.7)"}:{}})),xo=styled("img",{shouldForwardProp:e=>e!=="isLoading"&&e!=="isUploading"})(({isLoading:e,isUploading:o})=>({width:"100%",height:"100%",objectFit:"cover",top:0,left:0,filter:"blur(1.5rem)",transform:"scale(1.1)",position:"absolute",zIndex:0,transition:"opacity 0.3s ease-in-out",...e&&{opacity:0},...o&&{opacity:.7,filter:"blur(2rem)"}})),ho=styled(he)(({theme:e})=>({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:alpha(e.palette.primary.darker,.75),zIndex:2,pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease-in-out"})),bo=styled(he)({width:"100%",height:"100%",position:"relative",overflow:"hidden",borderRadius:"50%",justifyContent:"center",alignItems:"center"});styled(er)(({theme:e})=>({py:1,px:2,mt:3,textAlign:"left",borderStyle:"dashed",borderColor:"error.main",backgroundColor:alpha(e.palette.error.main,.08)}));var qe=styled(ze,{shouldForwardProp:e=>e!=="isError"&&e!=="hasFile"})(({theme:e,isError:o,hasFile:r})=>({top:0,gap:e.spacing(1),left:0,width:"100%",height:"100%",zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:e.palette.text.disabled,flexDirection:"column",justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter}),"&:hover":{opacity:.92},...o&&{color:e.palette.error.main},...r&&{zIndex:9,opacity:0,color:e.palette.common.white,backgroundColor:alpha(e.palette.common.black,.54)}})),Io=styled(he)({top:0,left:0,right:0,bottom:0,position:"absolute",zIndex:10,alignItems:"center",justifyContent:"center",opacity:.8});styled(he)(({theme:e})=>({padding:20,justifyContent:"center",alignItems:"center",gap:4,alignSelf:"stretch",borderRadius:12,background:e.palette.divider,color:e.palette.text.disabled,height:160}));var Po=styled(ze,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="isError"&&e!=="hasFile"})(({theme:e,isDragActive:o,disabled:r,isError:n,hasFile:t})=>({padding:e.spacing(1),margin:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:`1px dashed ${e.palette.divider}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...n&&{borderColor:"error.main"},...t&&{...n&&{bgcolor:alpha(e.palette.error.main,.08)},"&:hover .upload-placeholder":{opacity:1},"& img":{filter:"blur(0)"},"&:hover img":{filter:"blur(3px)"}}})),vo=styled("img")({width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",transition:"all 0.3s ease-in-out"}),Fo=styled(a)(({theme:e})=>({backgroundColor:alpha(e.palette.grey[900],.72),color:e.palette.common.white,"&:hover":{backgroundColor:alpha(e.palette.grey[600],.64),color:e.palette.common.white},"& svg":{width:14,height:14}}));var ir=({onRemove:e,sx:o,file:r,disableDrag:n,attributes:t,listeners:l,innerWidth:a,isDragging:d})=>{let c=r?.id;return c?jsx(tr,{anchorOrigin:{vertical:"top",horizontal:"left"},children:jsxs(co,{width:a,isDragging:d,"data-testid":`preview-multi-img-${c}`,...j().inUp,sx:o,children:[jsx(a$2,{disableDrag:n,...t,...l}),jsx(Ee,{imageView:!0,file:r}),jsx(ke,{sx:{position:"absolute",right:3,top:3,zIndex:1},children:e&&jsx(Fo,{size:"small",label:"Remover arquivo",onClick:()=>e(r),icon:"DELETE_MARK_BUTTON_02"})})]})},`badge-${c}`):null},Eo=memo(ir);var dr=({file:e$1,thumbnail:o,onRemove:r,sx:n,disableDrag:t=!1,disableTransitions:l=!1})=>{let a$1=e$1.size||0,d=e$1.name||e$1.id,c=e$1.id,m=typeof e$1=="string",s=t?70:80,{attributes:u,listeners:h,setNodeRef:P,transform:A,transition:v,isDragging:U}=useSortable({id:c,disabled:t}),b={transform:l?void 0:CSS.Transform.toString(A),transition:l?"none":v,opacity:l?.2:1,display:"inline-block",alignItems:"center",justifyContent:"center",width:`${s+8}px`,height:"68px"};return o&&e$1?jsx(Xe,{ref:P,style:b,children:jsx(Eo,{innerWidth:s,isDragging:U,sx:n,file:e$1,disableDrag:t,attributes:u,listeners:h,onRemove:r})}):jsx(Xe,{ref:P,style:{...b,height:"80px",width:`${s+38}px`},children:jsxs(po,{width:s+30,isDragging:U,"data-testid":`preview-multi-img-${c}`,...j().inUp,sx:n,children:[jsx(a$2,{disableDrag:t,...u,...h}),e$1&&jsx(Ee,{file:e$1}),jsxs(he,{flexGrow:1,sx:{width:"100%"},children:[jsx(a$3,{title:d,children:jsx(eo,{variant:"subtitle2",noWrap:!0,children:d})}),jsx(eo,{variant:"caption",sx:{color:"text.secondary"},children:m?"":e(a$1)})]}),jsx(ke,{children:r&&jsx(a,{size:"small",label:"Remover arquivo",onClick:()=>r(e$1),icon:"DELETE_MARK_BUTTON_02"})})]})})},Ao=memo(dr);var Ar=({thumbnail:e,files:o,onRemove:r,onReorder:n,sx:t})=>{let[l,a]=useState(!1),d=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),c=useCallback(s=>{let{active:u,over:h}=s;if(!(!u||!h||u.id===h.id)&&n){let P=o.findIndex(({id:v})=>v===u.id),A=o.findIndex(({id:v})=>v===h.id);P!==-1&&A!==-1&&(n(P,A,o),a(!0),setTimeout(()=>{a(!1);},300));}},[o,n]),m=jsx(AnimatePresence,{initial:!1,children:o.map(s=>jsx(Ao,{sx:t,id:`preview-file-${s.id}`,file:s,onRemove:r,thumbnail:e,disableDrag:!n,disableTransitions:l},`preview-file-${s.id}`))});return n?jsx(DndContext,{sensors:d,collisionDetection:closestCenter,onDragEnd:c,modifiers:[restrictToHorizontalAxis,restrictToParentElement,restrictToWindowEdges],children:jsx(SortableContext,{items:o.map(s=>s.id),strategy:horizontalListSortingStrategy,children:m})}):m},ye=memo(Ar);var Mo=forwardRef(({onLoading:e,aspectRatio:o,cropSize:r,...n},t)=>{let{maxWidth:l,maxHeight:a}=useMemo(()=>r&&typeof r=="object"?{maxWidth:r.width,maxHeight:r.height}:r&&typeof r=="number"?{maxWidth:r,maxHeight:r}:{maxWidth:"100%",maxHeight:"100%"},[r]);a$1(()=>{e?.(!0);}),useLayoutEffect(()=>{typeof t=="object"&&t?.current?e?.(!t.current.complete):e?.(!1);},[t,e]);function d(){e?.(!1);}return jsx(go,{...n,maxWidth:l,maxHeight:a,ref:t,aspectRatio:o,onLoad:d,onError:d})});Mo.displayName="LoadingPreviewImage";var yo=Mo;var Sr=({file:e,aspectRatio:o=1,isUploading:r,isLoading:n,onLoading:t,cropSize:l,maxWidth:a,maxHeight:d,hoverAlt:c,fill:m})=>{let s=useRef(null),u=e?.id||"",h=e?.name||"",P=URL.createObjectURL(e);return u?jsxs(uo,{className:"single-file-preview-box",children:[jsx(yo,{className:"single-file-preview-img",aspectRatio:o,cropSize:l,isLoading:n,isUploading:r,alt:h,src:P,ref:s,loading:"lazy",onLoading:t,onLoad:()=>t?.(!1),onError:()=>t?.(!1),maxWidth:a,maxHeight:d,fill:m},`image-preview-${u}`),jsx(xo,{className:"single-file-preview-bg",alt:h,src:P,isLoading:n,isUploading:r}),c&&jsx(ho,{className:"single-file-preview-hover-overlay",children:c})]}):null},Ke=memo(Sr);var Or=["pdf"],Ur=["txt"],Cr=["psd"],kr=["doc","docx"],Nr=["xls","xlsx"],Br=["zip","rar","iso"],Wr=["ai","eps"],Gr=["ppt","pptx"],jr=["wav","aif","mp3","aac"],Zr=["jpg","jpeg","gif","bmp","png","svg","webp"],Hr=["m4v","avi","mpg","mp4","webm"];function Je(e){let o,r=Do(e);return Ur.includes(r)?o="txt":Br.includes(r)?o="zip":jr.includes(r)?o="audio":Zr.includes(r)?o="image":Hr.includes(r)?o="video":kr.includes(r)?o="word":Nr.includes(r)?o="excel":Gr.includes(r)?o="powerpoint":Or.includes(r)?o="pdf":Cr.includes(r)?o="photoshop":Wr.includes(r)?o="illustrator":e?.startsWith("http")?o="image":o=Do(e),o}function _o(e){let o;switch(Je(e)){case"folder":o="IC_FOLDER";break;case"txt":o="IC_TXT";break;case"zip":o="IC_ZIP";break;case"audio":o="IC_AUDIO";break;case"video":o="IC_VIDEO";break;case"word":o="IC_WORD";break;case"excel":o="IC_EXCEL";break;case"powerpoint":o="IC_POWER_POINT";break;case"pdf":o="IC_PDF";break;case"photoshop":o="IC_PTS";break;case"illustrator":o="IC_AI";break;case"image":o="IC_IMG";break;default:o="IC_FILE";}return o}function Do(e){return e&&e.split(".").pop()||""}function ma(e){return e.split("/").pop()}var Be={root:"mnl__file__thumbnail__root",img:"mnl__file__thumbnail__img",icon:"mnl__file__thumbnail__icon",removeBtn:"mnl__file__thumbnail__remove__button",downloadBtn:"mnl__file__thumbnail__download__button"},Ee=({sx:e,file:o,tooltip:r,onRemove:n,imageView:t,slotProps:l,onDownload:a,...d})=>{let c=URL.createObjectURL(o),m=o?.name||"",u=o.type.startsWith("image/")?"image":Je(c),h=jsx(ze,{component:"img",src:c,className:Be.img,sx:{width:1,height:1,objectFit:"cover",borderRadius:"inherit",...l?.img}}),P=jsx(a$4,{icon:_o(u),sx:{width:32,height:32,flexShrink:0,...e}}),A=jsxs(he,{component:"span",className:Be.root,sx:{width:36,height:36,flexShrink:0,borderRadius:1.25,alignItems:"center",position:"relative",display:"inline-flex",justifyContent:"center",...e},...d,children:[u==="image"&&t?h:P,n&&jsx(Xr,{onClick:n,className:Be.removeBtn,sx:l?.removeBtn,children:jsx(a$4,{icon:"CLOSE_MARK_BUTTON",width:24})}),a&&jsx(Yo,{onClick:a,className:Be.downloadBtn,sx:l?.downloadBtn,size:"small",children:jsx(a$4,{icon:"ARROW_DOWN_CICLE",width:12})})]});return r?jsx(Kr,{arrow:!0,title:m,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,-12]}}]}},children:A}):A};var Ea=e=>e.startsWith("image/"),Lo=(e,o=.8)=>new Promise((r,n)=>{let t=document.createElement("canvas"),l=t.getContext("2d"),a=new Image;a.onload=()=>{t.width=a.width,t.height=a.height,l?(l.drawImage(a,0,0),t.toBlob(d=>{if(d){let c=new File([d],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});r(c);}else n(new Error("Falha ao converter para WebP"));},"image/webp",o)):n(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},a.onerror=()=>n(new Error("Falha ao carregar imagem")),a.src=URL.createObjectURL(e);}),So=(e,o=.8,r,n)=>new Promise((t,l)=>{let a=document.createElement("canvas"),d=a.getContext("2d"),c=new Image;c.onload=()=>{let{width:m,height:s}=c;r&&m>r&&(s=s*r/m,m=r),n&&s>n&&(m=m*n/s,s=n),a.width=m,a.height=s,d?(d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(c,0,0,m,s),a.toBlob(u=>{if(u){let h=new File([u],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});t(h);}else l(new Error("Falha ao comprimir imagem"));},"image/webp",o)):l(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},c.onerror=()=>l(new Error("Falha ao carregar imagem")),c.src=URL.createObjectURL(e);}),To=e=>{let o=e.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i);return o?.[1]||o?.[2]||""},Oo=e=>`UTF-8''${encodeURIComponent(e)}`;var rt=({onFilesSelect:e$1,onFileSelect:o,onReorder:r,onRemove:n,uploadFiles:t,filesPreview:l,dropzoneOptions:a,enableCrop:d=!1,customAspectRatio:c,convertToWebp:m=!0,cropSize:s,maxFiles:u,compressionQuality:h=.8,maxCompressedWidth:P,maxCompressedHeight:A})=>{let{showErrorMessage:v}=a$7(),U=useMemo(()=>c||(s&&typeof s!="number"?s.width/s.height:1),[c,s]),[b,R]=useState([]),[F,I]=useState(!1),[y,O]=useState(null),[g,E]=useState(null),[f,M]=useState(""),[N,T]=useState(!1),[S,C]=useState([]),[W,J]=useState(0),[re,Z]=useState(0),le=x=>{if(x.length<1)return;let w=x[0];O(w),J(D=>D+1);let z=new FileReader;z.onload=()=>{M(z.result),I(!0);},z.readAsDataURL(w);},ue=(x,w)=>{E(w);},se=async x=>!y||!g?null:new Promise(w=>{let z=document.createElement("canvas"),D=z.getContext("2d"),k=new Image;k.onload=async()=>{let{width:G,height:de,x:De,y:$o}=g,Xo=Math.abs(U),_e=G,Le=de;s&&typeof s=="object"?(_e=s.width,Le=s.height):s&&typeof s=="number"&&(_e=s,Le=s/Xo),z.width=_e,z.height=Le,D?(D.drawImage(k,De,$o,G,de,0,0,_e,Le),z.toBlob(async io=>{if(io){let $e=new File([io],y.name,{type:y.type,lastModified:Date.now()});if(m)try{$e=await Lo($e,h);}catch(qo){v(qo,"Erro ao converter para WebP");}let ao=$e;ao.id=x,w(ao);}else w(null);},"image/png")):w(null);},k.src=f;}),pe=async()=>{if(!(!y||!g||S.length===0)){T(!0);try{let x=S[0],w=await se(x.id);if(w){let D=await t([w]);D&&(!e$1&&!o&&R(k=>[...k,...D]),e$1?.([...l||[],...D]),o?.(w));}I(!1),T(!1),M(""),O(null);let z=S.slice(1);C(z),le(z);}catch(x){v(x,"Erro ao processar imagem"),T(!1);}}},H=()=>{I(!1),T(!1),M(""),O(null),C([]),J(0),Z(0);},Q=async x=>{if(x.length===0)return;let w=Object.keys(a?.accept||{}).some(D=>D.includes("image/")),z=b.length+x.length;if(u&&z>u){v(new Error(`M\xE1ximo de ${u} arquivos`),"Erro ao fazer upload");return}try{if(w&&d){let k=x.filter(G=>G.type.startsWith("image/")).map((G,de)=>{let De=G;return De.id=`temp-crop-${Date.now()}-${de}`,De});Z(k.length),J(0),C(k),le(k);}else {let D=[];for(let G of x)if(G.type.startsWith("image/")&&m)try{let de=await So(G,h,P,A);D.push(de);}catch(de){v(de,"Erro ao comprimir imagem"),D.push(G);}else D.push(G);let k=await t(D);k&&(!e$1&&!o&&R(G=>[...G,...k]),e$1?.([...l||[],...k]),o?.(k[0]));}}catch(D){v(D,"Erro ao processar arquivos");}},Y=x=>{if(!x.length)return;let w=x[0]?.errors[0]?.code,z=a?.maxSize||3145728;v(w==="file-too-large"?new Error(`O arquivo excede o tamanho m\xE1ximo de ${e(z)}`):w==="file-invalid-type"?new Error("Formato de arquivo n\xE3o suportado"):x[0]?.errors[0]||new Error("Erro ao enviar arquivo"),"Erro ao fazer upload");},{getRootProps:te,getInputProps:$,isDragActive:p,isDragReject:ge,fileRejections:ie}=useDropzone({onDrop:Q,onDropRejected:Y,...a}),we=x=>{if(!x){n||R([]),n?.(void 0);return}let w=b.filter(z=>z.id!==x.id);n||R(w),n?.(x);},xe=(x,w,z)=>{r?.(x,w,z);},Ie=useRef("");return useEffect(()=>{let x=l?.map(w=>w.id).join(",")||"";x!==Ie.current&&(Ie.current=x,R(l||[]));},[l]),{file:b?.[0],files:b,aspectRatio:U,dropzoneProps:{getRootProps:te,getInputProps:$,isDragActive:p,isDragReject:ge,fileRejections:ie},cropState:{cropModalOpen:F,imagePreview:f,cropLoading:N,setCropModalOpen:I,onCropInitialized:ue,handleCropSave:pe,handleCropCancel:H,currentImageIndex:W,totalPendingImages:re},setInitialFiles:R,handleRemove:we,handleReorder:xe}},q=rt;var Qe=(p=>(p.APPLICATION_OCTET_STREAM="application/octet-stream",p.IMAGE_JPEG="image/jpeg",p.IMAGE_JPG="image/jpg",p.IMAGE_PNG="image/png",p.IMAGE_GIF="image/gif",p.IMAGE_WEBP="image/webp",p.IMAGE_SVG="image/svg+xml",p.IMAGE_BMP="image/bmp",p.IMAGE_TIFF="image/tiff",p.IMAGE_ICO="image/x-icon",p.IMAGE_AVIF="image/avif",p.APPLICATION_PDF="application/pdf",p.TEXT_PLAIN="text/plain",p.TEXT_CSV="text/csv",p.APPLICATION_RTF="application/rtf",p.APPLICATION_MSWORD="application/msword",p.APPLICATION_DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",p.APPLICATION_MSEXCEL="application/vnd.ms-excel",p.APPLICATION_XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",p.APPLICATION_MSPOWERPOINT="application/vnd.ms-powerpoint",p.APPLICATION_PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",p.APPLICATION_ODT="application/vnd.oasis.opendocument.text",p.APPLICATION_ODS="application/vnd.oasis.opendocument.spreadsheet",p.APPLICATION_ODP="application/vnd.oasis.opendocument.presentation",p.APPLICATION_XML="application/xml",p.TEXT_XML="text/xml",p.TEXT_HTML="text/html",p.TEXT_CSS="text/css",p.APPLICATION_JSON="application/json",p.TEXT_JAVASCRIPT="text/javascript",p.APPLICATION_ZIP="application/zip",p.APPLICATION_GZIP="application/gzip",p.APPLICATION_RAR="application/vnd.rar",p.APPLICATION_7Z="application/x-7z-compressed",p.AUDIO_MPEG="audio/mpeg",p.AUDIO_WAV="audio/wav",p.AUDIO_OGG="audio/ogg",p.AUDIO_WEBM="audio/webm",p.AUDIO_AAC="audio/aac",p.VIDEO_MP4="video/mp4",p.VIDEO_MPEG="video/mpeg",p.VIDEO_OGG="video/ogg",p.VIDEO_WEBM="video/webm",p.VIDEO_QUICKTIME="video/quicktime",p))(Qe||{}),We=(e=>(e["application/octet-stream"]="APPLICATION_OCTET_STREAM",e["image/jpeg"]="IMAGE_JPEG",e["image/jpg"]="IMAGE_JPG",e["image/png"]="IMAGE_PNG",e["image/gif"]="IMAGE_GIF",e["image/webp"]="IMAGE_WEBP",e["image/svg+xml"]="IMAGE_SVG",e["image/bmp"]="IMAGE_BMP",e["image/tiff"]="IMAGE_TIFF",e["image/x-icon"]="IMAGE_ICO",e["image/avif"]="IMAGE_AVIF",e["application/pdf"]="APPLICATION_PDF",e["text/plain"]="TEXT_PLAIN",e["text/csv"]="TEXT_CSV",e["application/rtf"]="APPLICATION_RTF",e["application/msword"]="APPLICATION_MSWORD",e["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]="APPLICATION_DOCX",e["application/vnd.ms-excel"]="APPLICATION_MSEXCEL",e["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]="APPLICATION_XLSX",e["application/vnd.ms-powerpoint"]="APPLICATION_MSPOWERPOINT",e["application/vnd.openxmlformats-officedocument.presentationml.presentation"]="APPLICATION_PPTX",e["application/vnd.oasis.opendocument.text"]="APPLICATION_ODT",e["application/vnd.oasis.opendocument.spreadsheet"]="APPLICATION_ODS",e["application/vnd.oasis.opendocument.presentation"]="APPLICATION_ODP",e["application/xml"]="APPLICATION_XML",e["text/xml"]="TEXT_XML",e["text/html"]="TEXT_HTML",e["text/css"]="TEXT_CSS",e["application/json"]="APPLICATION_JSON",e["text/javascript"]="TEXT_JAVASCRIPT",e["application/zip"]="APPLICATION_ZIP",e["application/gzip"]="APPLICATION_GZIP",e["application/vnd.rar"]="APPLICATION_RAR",e["application/x-7z-compressed"]="APPLICATION_7Z",e["audio/mpeg"]="AUDIO_MPEG",e["audio/wav"]="AUDIO_WAV",e["audio/ogg"]="AUDIO_OGG",e["audio/webm"]="AUDIO_WEBM",e["audio/aac"]="AUDIO_AAC",e["video/mp4"]="VIDEO_MP4",e["video/mpeg"]="VIDEO_MPEG",e["video/ogg"]="VIDEO_OGG",e["video/webm"]="VIDEO_WEBM",e["video/quicktime"]="VIDEO_QUICKTIME",e))(We||{});var nt=({createFilesMutation:e,filesDetails:o})=>{let{showErrorMessage:r}=a$7(),[n,t]=useState(!1),[l,a]=useState(!1),[d,c]=useState(null),[m,s]=useState([]),u=useMemo(()=>m?.[0],[m]),h=l||n,P=useCallback(async b=>{if(!b.length){s([]),a(!1);return}a(!0);try{let F=(await Promise.all(b.map(async({url:I,id:y,name:O})=>{try{if(!I)return null;let g=await fetch(I);if(!g.ok)throw new Error(g.statusText);let E=await g.blob(),f=null;if(!O){let T=g.headers.get("content-disposition")||void 0;if(T){let S=To(T);if(S)try{f=decodeURIComponent(S);}catch{f=S;}}}let M=f||O||y,N=new File([E],M,{type:E.type});return N.id=y,N.url=I,N}catch{return null}}))).filter(Boolean);s(F),a(!1);}catch(R){r(R,"Erro ao carregar arquivos"),s([]),a(!1);}},[r]),A=useRef("");useEffect(()=>{let b=o?.map(({id:R})=>R).join(",")||"";b!==A.current&&(async()=>(A.current=b,await P(o)))();},[o,P]);let v=async b=>{if(!b||!Array.isArray(b))throw new Error("Arquivos inv\xE1lidos");let R=b.filter(F=>F instanceof File);if(R?.length){t(!0);try{let F=R.map(g=>{let E=g.type||"application/octet-stream",f=We[E];if(!f)throw new Error(`Tipo de arquivo n\xE3o suportado: ${E}`);return {file:g,mimeType:E,contentTypeEnum:f}}),I=await e({files:F.map(({file:g,contentTypeEnum:E})=>({content_type:E,name:g.name}))}).unwrap(),y=I.files.map((g,E)=>{let f=F[E].file,M=f;return M.id=g.id,M.url=URL.createObjectURL(f),M});return await(await Promise.all(I.files.map((g,E)=>{let{mimeType:f}=F[E],M=y[E];return fetch(g.url,{method:"PUT",headers:{"Content-Type":f,"Content-Disposition":`inline; filename*=${Oo(M.name)}`,"X-File-Id":g.id},body:M})}))).forEach(async g=>{if(!g.ok)throw new Error("Erro no upload do arquivo.")}),y}catch(F){throw c(F),r(F,"Erro no upload"),F}finally{t(!1);}}},U=useMemo(()=>d&&d instanceof Error?d.message:d,[d]);return {setFilesPreview:s,uploadFiles:v,filesPreview:m,filePreview:u,isLoadingPreview:l,isUploadingFiles:n,isUploadOrLoadingFiles:h,uploadErrorText:U}},V=nt;var st=({sx:e,id:o,name:r,tabIndex:n,uploading:t,getRootProps:l,getInputProps:a,isDragActive:d,isError:c,disabled:m,dropZoneSxProps:s,dropZoneContent:u,children:h,...P})=>jsxs(Ce,{children:[t&&jsx(a$6,{"data-testid":"uploading-progress-bar",sx:{zIndex:1}}),jsxs(ze,{sx:{width:1,position:"relative",...e},children:[jsxs(lo,{...l(),"data-testid":"drop-zone-styled-area",isError:c,isDragActive:d,disabled:!!m,sx:s,...P,children:[jsx("input",{...a(),id:o,tabIndex:n,name:r}),u]}),h]})]}),ce=st;function No(){let e=useTheme(),o=useId(),r=e.vars.palette.primary.main;return jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:o,x1:"19.496%",x2:"77.479%",y1:"71.822%",y2:"16.69%",children:[jsx("stop",{offset:"0%",stopColor:r}),jsx("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),jsx("path",{fill:`url(#${o})`,fillRule:"nonzero",d:"M0 198.78c0 41.458 14.945 79.236 39.539 107.786 28.214 32.765 69.128 53.365 114.734 53.434a148.44 148.44 0 0056.495-11.036c9.051-3.699 19.182-3.274 27.948 1.107a75.779 75.779 0 0033.957 8.01c5.023 0 9.942-.494 14.7-1.433 13.58-2.67 25.94-8.99 36.09-17.94 6.378-5.627 14.547-8.456 22.897-8.446h.142c27.589 0 53.215-8.732 74.492-23.696 19.021-13.36 34.554-31.696 44.904-53.224C474.92 234.58 480 213.388 480 190.958c0-76.93-59.774-139.305-133.498-139.305-7.516 0-14.88.663-22.063 1.899C305.418 21.42 271.355 0 232.499 0a103.651 103.651 0 00-45.88 10.661c-13.24 6.487-25.011 15.705-34.64 26.939-32.698.544-62.931 11.69-87.676 30.291C25.351 97.155 0 144.882 0 198.781z",opacity:"0.2"})]})}function gt({hideBackground:e,sx:o,...r}){let n=useTheme(),t=n.vars.palette.primary.main,l=n.vars.palette.primary.dark,a=n.vars.palette.primary.darker;return jsxs(ze,{component:"svg",width:"100%",height:"100%",viewBox:"0 0 480 360",xmlns:"http://www.w3.org/2000/svg",sx:{width:320,maxWidth:1,flexShrink:0,height:"auto",...o},...r,children:[!e&&jsx(No,{}),jsx("defs",{children:jsxs("linearGradient",{id:"linearGradient-2",x1:"30.113%",x2:"30.113%",y1:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopOpacity:"0"}),jsx("stop",{offset:"100%"})]})}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M293.006 206.192c-2.248 2.672-4.676 2.628-6.123 2.251l.054-1.384s5.979-2.733 5.827-2.159c-.057.215.057.733.242 1.292zM309.393 209.217c-3.818 2.206-6.058-.38-6.578-1.112.32-.84.801-2.204.703-2.592-.144-.577 5.827 2.155 5.827 2.155l.048 1.549zM305.303 187.204s3.632-2.093 4.425-1.151c.792.942-4.425 1.151-4.425 1.151zM307.497 188.355s-.598.299.721.681c1.318.383-.721-.681-.721-.681zM285.532 182.599c-.123.036 3.022 2.123 5.862.395-.012 0-5.154-.61-5.862-.395zM291.239 186.591s-.861 1.692-2.625 1.943c-1.764.251 2.625-1.943 2.625-1.943zM302.785 190.262s4.138 6.578 3.346 8.129c-.793 1.552-3.346-8.129-3.346-8.129zM294.62 216.416c0 .368 0 .712-.036.996-.107 1.33-3.381.828-3.381.828-2.99.416-4.066-1.019-4.422-2.392a5.444 5.444 0 01-.164-1.363 5.606 5.606 0 01.054-.819v-.272a1.998 1.998 0 011.859.379c1.331 1.08 3.095.252 3.095.252s1.294.107 1.793.538c.281.242.745-.341 1.098-.897.021.359.054 1.007.074 1.701.024.356.03.714.03 1.049z",opacity:"0.05"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M289.37 216.339s-.897.879-2.589-.479a5.444 5.444 0 01-.164-1.363c.864.658 2.466 1.842 2.753 1.842zM294.62 216.416a.67.67 0 01-.519.132.672.672 0 01-.452-.287c.348-.266.669-.566.956-.897.009.359.015.717.015 1.052zM301.637 217.032c0 .371 0 .715.033.996.108 1.333 3.382.828 3.382.828 2.989.419 4.066-1.017 4.421-2.392a5.728 5.728 0 00.111-2.182v-.272a2.024 2.024 0 00-1.862.379c-1.331 1.08-3.092.251-3.092.251s-1.294.111-1.794.542c-.281.242-.744-.341-1.094-.897a61.426 61.426 0 00-.078 1.701c-.024.35-.03.708-.027 1.046z",opacity:"0.05"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M306.887 216.949s.897.879 2.587-.479c.112-.444.169-.901.167-1.36-.867.655-2.47 1.839-2.754 1.839zM301.637 217.032a.67.67 0 00.969-.155 6.35 6.35 0 01-.957-.897c-.009.356-.014.714-.012 1.052zM319.614 106.269c.063-.138.123-.275.18-.41.057-.134.077-.209.11-.317-.11.237-.206.48-.29.727z",opacity:"0.05"}),jsx("path",{fill:a,fillRule:"nonzero",d:"M157.592 279.461a4.114 4.114 0 01-.917-3.131l13.196-107.979 1.094-8.97a4.142 4.142 0 014.078-3.635l38.654-.257a4.135 4.135 0 004.108-4.249l-.015-.409a4.14 4.14 0 014.135-4.279h40.619a4.134 4.134 0 014.098 4.682 4.137 4.137 0 003.995 4.682l39.01.996a4.13 4.13 0 013.97 4.831l-19.502 113.909-.368 2.152a4.042 4.042 0 01-.598 1.543l-135.557.114z"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M251.256817 123.296578L274.098317 123.296578 274.098317 200.823078 251.256817 200.823078z",transform:"rotate(34.64 262.678 162.06)"}),jsx("path",{fill:"#FFC107",fillRule:"nonzero",d:"M270.624591 129.857671L286.750291 129.857671 286.750291 145.983371 270.624591 145.983371z",transform:"rotate(34.804 278.687 137.92)"}),jsx("path",{fill:"#FFC107",fillRule:"nonzero",d:"M260.275579 145.813111L276.423079 145.813111 276.423079 161.960611 260.275579 161.960611z",opacity:"0.5",transform:"rotate(34.64 268.35 153.887)"}),jsx("path",{fill:"#FFC107",fillRule:"nonzero",d:"M249.191579 161.852111L265.339079 161.852111 265.339079 177.999611 249.191579 177.999611z",opacity:"0.3",transform:"rotate(34.64 257.265 169.926)"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M237.472537 121.334214L260.314037 121.334214 260.314037 198.567714 237.472537 198.567714z",transform:"rotate(16.29 248.893 159.951)"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M249.053192 123.761554L265.200692 123.761554 265.200692 139.909054 249.053192 139.909054z",transform:"rotate(16.29 257.127 131.835)"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M243.584192 142.473554L259.731692 142.473554 259.731692 158.621053 243.584192 158.621053z",opacity:"0.5",transform:"rotate(16.29 251.658 150.547)"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M238.116192 161.182554L254.263692 161.182554 254.263692 177.330054 238.116192 177.330054z",opacity:"0.3",transform:"rotate(16.29 246.19 169.256)"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M230.099192 121.641542L252.940692 121.641542 252.940692 198.875042 230.099192 198.875042z",transform:"rotate(4.6 241.52 160.258)"}),jsx("path",{fill:"#1890FF",fillRule:"nonzero",d:"M235.800489 122.985499L251.947989 122.985499 251.947989 139.132999 235.800489 139.132999z",transform:"rotate(4.6 243.874 131.06)"}),jsx("path",{fill:"#1890FF",fillRule:"nonzero",d:"M234.234488 142.413498L250.381988 142.413498 250.381988 158.560998 234.234488 158.560998z",opacity:"0.5",transform:"rotate(4.6 242.308 150.487)"}),jsx("path",{fill:"#1890FF",fillRule:"nonzero",d:"M232.672488 161.846499L248.819988 161.846499 248.819988 177.993999 232.672488 177.993999z",opacity:"0.3",transform:"rotate(4.6 240.746 169.92)"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M224.736657 123.384871L247.578157 123.384871 247.578157 200.618371 224.736657 200.618371z",transform:"rotate(-2.61 236.157 162.002)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M226.751283 124.659968L242.898783 124.659968 242.898783 140.807468 226.751283 140.807468z",transform:"rotate(-2.61 234.825 132.734)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M228.305601 143.479224L244.473301 143.479224 244.473301 159.646924 228.305601 159.646924z",opacity:"0.5",transform:"rotate(-2.862 236.39 151.563)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M228.525282 163.608968L244.672782 163.608968 244.672782 179.756468 228.525282 179.756468z",opacity:"0.3",transform:"rotate(-2.61 236.599 171.683)"}),jsx("path",{fill:"#F4F6F8",fillRule:"nonzero",d:"M232.679 225.726l-20.294 7.851-29.661 11.466c-1.121-2.093-2.771-4.921-4.813-8.297-7.026-11.642-18.65-29.75-29.001-45.665-11.66-17.938-21.696-33.075-21.696-33.075l7.265-2.093 59.346-17.23 38.854 87.043z"}),jsx("path",{fill:"#000",fillRule:"nonzero",d:"M232.679 225.726l-20.294 7.851a152.535 152.535 0 01-34.484 3.169c-7.026-11.642-18.65-29.75-29-45.665l-14.42-35.18 59.343-17.218 38.855 87.043z",opacity:"0.1"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M247.777 220.841s-31.526 18.65-78.596 14.432l-37.525-91.486 17.984-3.091 62.168-10.677 35.279 89.043.69 1.779z"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M247.075 219.074c-7.424.365-16.013.329-24.654-.702-9.351-1.101-18.757-3.367-26.82-7.523-6.742-3.471-12.506-7.247-17.532-11.776-13.074-11.759-21.164-28.579-28.429-58.365l62.168-10.677 35.267 89.043z",opacity:"0.1"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M270.203 213.959s-23.239 4.55-46.894 1.749c-9.351-1.1-18.757-3.367-26.82-7.522-6.742-3.471-12.503-7.247-17.532-11.777-16.181-14.557-24.725-36.866-33.536-81.918 0 0 38.633 9.325 76.836-11.101-.012.015 12.865 80.373 47.946 110.569z"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M165.405 131.03s31.416-1.776 40.187-8.548l1.331 4.276s-20.758 9.157-41.518 9.268v-4.996zM165.405 152.137s30.417-1.665 53.399-12.766l.777 1.776s-18.237 10.647-54.176 13.433v-2.443zM167.853 160.362s30.418-1.665 53.397-12.766l.777 1.776s-18.237 10.643-54.174 13.433v-2.443zM170.299 168.599s30.417-1.666 53.399-12.766l.774 1.775s-18.237 10.647-54.173 13.433v-2.442zM172.748 176.835s30.417-1.665 53.396-12.766l.777 1.776s-18.237 10.647-54.173 13.433v-2.443zM175.193 185.075s30.417-1.665 53.399-12.766l.774 1.776s-18.237 10.643-54.173 13.433v-2.443z",opacity:"0.3"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M389.069 287.344s-12.641-.762-11.152 8.097c0 0-.299 1.563 1.124 2.275 0 0 .021-.658 1.295-.434.454.077.916.099 1.375.066a2.832 2.832 0 001.677-.694c.468-.409 3.555-1.468 4.936-7.274 0 0 1.023-1.267.981-1.593l-2.132.897s.73 1.54.156 2.816c0 0-.069-2.759-.479-2.691-.083 0-1.109.533-1.109.533s1.253 2.69.299 4.628c0 0 .359-3.304-.699-4.434l-1.495.876s1.465 2.768.472 5.029c0 0 .254-3.465-.789-4.817l-1.361 1.062s1.379 2.729.539 4.604c0 0-.111-4.036-.835-4.341 0 0-1.195 1.049-1.369 1.494 0 0 .942 1.98.356 3.026 0 0-.359-2.691-.652-2.691 0 0-1.196 1.794-1.309 2.99 0 0 .051-1.818 1.022-3.172a3.593 3.593 0 00-1.818.942s.186-1.262 2.111-1.37c0 0 .981-1.351 1.241-1.435 0 0-1.914-.158-3.074.356 0 0 1.023-1.196 3.427-.649l1.342-1.094s-2.52-.347-3.588.036c0 0 1.229-1.052 3.95-.299l1.462-.873s-2.147-.463-3.426-.299c0 0 1.348-.729 3.856.06l1.044-.47s-1.573-.299-2.033-.358c-.461-.06-.488-.174-.488-.174a5.426 5.426 0 012.957.329s2.222-.813 2.186-.954z"}),jsx("ellipse",{cx:"380.363",cy:"298.487",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"8.945",ry:"1.513"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M394.956 258.102s-7.125-.43-6.279 4.565a1.218 1.218 0 00.631 1.283s.015-.371.733-.245c.255.042.515.054.774.036.349-.023.681-.159.945-.389.264-.23 2.003-.828 2.783-4.102 0 0 .577-.714.553-.897l-1.196.511s.41.87.087 1.591c0 0-.039-1.558-.269-1.522-.048 0-.625.299-.625.299s.706 1.495.173 2.61c0 0 .204-1.862-.394-2.502l-.846.496s.825 1.561.266 2.834c0 0 .143-1.955-.446-2.714l-.765.598s.774 1.539.299 2.595c0 0-.063-2.275-.469-2.446a4.75 4.75 0 00-.775.834s.532 1.118.204 1.707c0 0-.204-1.515-.368-1.521 0 0-.67 1.001-.739 1.689a3.671 3.671 0 01.577-1.794 2.007 2.007 0 00-1.025.532s.104-.711 1.196-.771c0 0 .553-.763.699-.81 0 0-1.079-.09-1.734.2 0 0 .577-.67 1.932-.365l.759-.619s-1.423-.194-2.024.021c0 0 .694-.598 2.227-.161l.826-.494a7.445 7.445 0 00-1.935-.164s.763-.413 2.174.033l.598-.263s-.897-.177-1.148-.203c-.252-.027-.275-.099-.275-.099a3.078 3.078 0 011.668.185s1.232-.46 1.208-.538z"}),jsx("ellipse",{cx:"390.052",cy:"264.383",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"5.044",ry:"1"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M352.896 262.437s-8.604-.52-7.588 5.51a1.47 1.47 0 00.763 1.549s0-.449.897-.299c.309.052.623.067.935.045a1.923 1.923 0 001.142-.473c.318-.279 2.419-.998 3.361-4.951 0 0 .697-.861.667-1.085l-1.468.622s.496 1.046.104 1.916c0 0-.048-1.877-.326-1.835-.056 0-.753.364-.753.364s.852 1.824.209 3.152c0 0 .245-2.249-.475-3.02l-1.023.598s.996 1.886.32 3.423c0 0 .174-2.359-.535-3.289l-.927.724s.939 1.857.365 3.133c0 0-.072-2.747-.565-2.954 0 0-.81.715-.933 1.008 0 0 .64 1.348.242 2.06 0 0-.245-1.83-.445-1.839 0 0-.804 1.214-.897 2.042.04-.768.28-1.512.697-2.159a2.427 2.427 0 00-1.235.643s.125-.858 1.435-.933c0 0 .667-.92.846-.974 0 0-1.303-.111-2.093.239 0 0 .694-.807 2.329-.44l.915-.747s-1.713-.233-2.442.024c0 0 .837-.715 2.69-.191l.996-.598s-1.462-.314-2.335-.201c0 0 .921-.496 2.625.042l.711-.32s-1.07-.209-1.384-.242c-.314-.033-.329-.119-.329-.119a3.69 3.69 0 012.012.221s1.519-.553 1.492-.646z"}),jsx("ellipse",{cx:"346.97",cy:"270.022",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"6.09",ry:"1.028"}),jsx("rect",{width:"51.026",height:"91.312",x:"303.926",y:"69.211",fill:"#FFF",fillRule:"nonzero",rx:"4.737",transform:"rotate(-71.99 329.44 114.867)"}),jsx("circle",{cx:"303.613",cy:"103.507",r:"9.376",fill:t,fillRule:"nonzero",opacity:"0.2"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M344.582495 86.4883769L347.150665 86.4883769 347.150665 127.336977 344.582495 127.336977z",opacity:"0.2",transform:"rotate(-71.99 345.867 106.913)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M333.028401 99.6373982L335.596571 99.6373982 335.596571 120.445898 333.028401 120.445898z",opacity:"0.2",transform:"rotate(-71.99 334.312 110.042)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M337.109071 101.431004L339.677241 101.431004 339.677241 135.086304 337.109071 135.086304z",opacity:"0.2",transform:"rotate(-71.99 338.393 118.259)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M338.505494 105.174377L341.073664 105.174377 341.073664 146.022978 338.505494 146.022978z",opacity:"0.2",transform:"rotate(-71.99 339.79 125.599)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M348.060839 134.648161L353.026769 134.648161 353.026769 145.952261 348.060839 145.952261z",opacity:"0.5",transform:"rotate(-71.99 350.544 140.3)"}),jsx("rect",{width:"50.3",height:"78.305",x:"291.549",y:"174.486",fill:"#FFF",fillRule:"nonzero",rx:"4",transform:"rotate(-57.265 316.7 213.638)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M278.038439 203.88874L292.269539 203.88874 292.269539 207.23723 278.038439 207.23723z",transform:"rotate(-57.57 285.154 205.563)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M283.007935 199.201889L314.262535 199.201889 314.262535 202.272339 283.007935 202.272339z",transform:"rotate(-57.57 298.635 200.737)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M288.543935 202.715889L319.798535 202.715889 319.798535 205.786339 288.543935 205.786339z",transform:"rotate(-57.57 304.171 204.251)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M294.078936 206.235889L325.333536 206.235889 325.333536 209.306339 294.078936 209.306339z",transform:"rotate(-57.57 309.706 207.771)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M299.879919 211.40702L331.090719 211.40702 331.090719 214.47316 299.879919 214.47316z",transform:"rotate(-57.265 315.485 212.94)"}),jsx("path",{fill:"#F4F6F8",fillRule:"nonzero",d:"M305.149936 213.268889L336.404536 213.268889 336.404536 216.339339 305.149936 216.339339z",transform:"rotate(-57.57 320.777 214.804)"}),jsx("path",{fill:"#F4F6F8",fillRule:"nonzero",d:"M310.685935 216.782889L341.940535 216.782889 341.940535 219.853339 310.685935 219.853339z",transform:"rotate(-57.57 326.313 218.318)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M341.417983 210.406958L349.511163 210.406958 349.511163 218.500138 341.417983 218.500138z",transform:"rotate(-57.57 345.465 214.454)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M269.277 168.76l-45.767.493a3.127 3.127 0 00-3.094 3.125v3.782a3.127 3.127 0 01-3.05 3.124l-33.024.792a3.124 3.124 0 01-3.095-2.308l-1.551-5.701a3.124 3.124 0 00-3.053-2.308l-44.113.475a3.125 3.125 0 00-3.05 3.648l17.747 104.449a3.129 3.129 0 003.071 2.604l139.363.598a3.129 3.129 0 003.082-3.714l-20.366-106.521a3.125 3.125 0 00-3.1-2.538z"}),jsx("path",{fill:l,fillRule:"nonzero",d:"M269.277 168.76l-45.767.493a3.127 3.127 0 00-3.094 3.125v3.782a3.127 3.127 0 01-3.05 3.124l-33.024.792a3.124 3.124 0 01-3.095-2.308l-1.551-5.701a3.124 3.124 0 00-3.053-2.308l-44.113.475a3.125 3.125 0 00-3.05 3.648l17.747 104.449a3.129 3.129 0 003.071 2.604l139.363.598a3.129 3.129 0 003.082-3.714l-20.366-106.521a3.125 3.125 0 00-3.1-2.538z",opacity:"0.243"}),jsx("path",{fill:"url(#linearGradient-2)",fillRule:"nonzero",d:"M269.277 168.76l-45.767.493a3.127 3.127 0 00-3.094 3.125v3.782a3.127 3.127 0 01-3.05 3.124l-33.024.792a3.124 3.124 0 01-3.095-2.308l-1.551-5.701a3.124 3.124 0 00-3.053-2.308l-44.113.475a3.125 3.125 0 00-3.05 3.648l17.747 104.449a3.129 3.129 0 003.071 2.604l139.363.598a3.129 3.129 0 003.082-3.714l-20.366-106.521a3.125 3.125 0 00-3.1-2.538z",opacity:"0.32"}),jsx("ellipse",{cx:"119.593",cy:"258.664",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"4.846",ry:"1"}),jsx("ellipse",{cx:"101.03",cy:"260.545",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"4.846",ry:"1"}),jsx("ellipse",{cx:"108.459",cy:"265.905",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"3.444",ry:"1"}),jsx("ellipse",{cx:"89.193",cy:"265.433",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"3.444",ry:"1"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M100.925 260.398s6.796-22.279-1.064-31.204c-5.881-6.676-12.557-5.877-15.547-5.052a5.528 5.528 0 00-3.564 2.963c-1.046 2.254-.858 5.913 6.521 10.186 12.35 7.151 13.119 16.96 13.119 16.96l.535 6.147z"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M85.382 227.302s20.031 6.278 15.546 33.096M97.083 229.547s-2.76 1.86-1.88 4.655M87.39 231.203s1.687-1.716 3.741-.768M95.31 239.832s2.963-1.495 3.728.379M102.638 242.962s-2.224-.176-2.263.897"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M101.2 260.575s-7.961-16.193-10.147-15.846c-1.037.17-1.516 1.196-1.734 2.218a6.516 6.516 0 00.434 3.941c1.13 2.601 4.165 7.519 11.447 9.687z"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M91.113 247.808s8.353 12.115 9.968 12.647"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M90.344 249.701L92.293 249.701"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M92.68 254.132L95.738 254.263"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M94.542 250.586L94.21 252.179"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M97.792 255.432L97.732 256.879"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M100.964 260.575s7.959-16.193 10.144-15.846c1.041.17 1.519 1.196 1.734 2.218a6.514 6.514 0 01-.433 3.941c-1.13 2.601-4.168 7.519-11.445 9.687z"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M111.051 247.808s-8.371 12.115-9.97 12.647"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M111.82 249.701L109.871 249.701"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M109.485 254.132L106.426 254.263"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M107.622 250.586L107.954 252.179"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M104.372 255.432L104.432 256.879"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M87.295 264.357a1.375 1.375 0 01-.452-.685.599.599 0 01.317-.697c.3-.11.598.09.837.299.24.21.512.431.81.38a1.237 1.237 0 01-.382-1.16.47.47 0 01.105-.236c.161-.174.454-.099.648.039.598.43.787 1.264.79 2.018.03-.277.03-.555 0-.831a.853.853 0 01.334-.727.938.938 0 01.476-.114.988.988 0 01.774.222.767.767 0 01-.03.947c-.229.257-.5.474-.801.64a1.805 1.805 0 00-.571.547.399.399 0 00-.042.096h-1.74a4.826 4.826 0 01-1.073-.738zM117.626 257.833a1.355 1.355 0 01-.452-.682.599.599 0 01.314-.696c.299-.111.598.089.837.299.239.209.509.436.817.391a1.236 1.236 0 01-.386-1.157.472.472 0 01.107-.236c.162-.173.455-.099.649.036.613.433.787 1.268.79 2.021a4.008 4.008 0 000-.834.852.852 0 01.299-.736.955.955 0 01.475-.11.998.998 0 01.774.218.768.768 0 01-.033.951 2.996 2.996 0 01-.798.64 1.767 1.767 0 00-.571.544.499.499 0 00-.042.098h-1.701a4.78 4.78 0 01-1.079-.747zM107.518 264.357a1.406 1.406 0 01-.455-.685.6.6 0 01.317-.697c.299-.11.598.09.837.299.239.21.505.437.816.395a1.247 1.247 0 01-.385-1.16.472.472 0 01.107-.236c.162-.174.455-.099.649.039.613.43.783 1.264.789 2.018.03-.277.03-.555 0-.832a.855.855 0 01.314-.735.93.93 0 01.476-.114.988.988 0 01.774.222.764.764 0 01-.033.947 3.028 3.028 0 01-.798.64 1.798 1.798 0 00-.571.547.411.411 0 00-.042.096h-1.734c-.385-.2-.742-.45-1.061-.744z"}),jsx("circle",{cx:"84.467",cy:"87.003",r:"6.467",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("circle",{cx:"395.425",cy:"138.681",r:"6.467",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("circle",{cx:"279.178",cy:"66.467",r:"6.467",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("circle",{cx:"97.4",cy:"122.68",r:"10.838",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("path",{fill:l,fillRule:"nonzero",d:"M206.029 209.911c-7.975 0-14.44 6.465-14.44 14.44s6.465 14.44 14.44 14.44 14.44-6.465 14.44-14.44-6.465-14.44-14.44-14.44z"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M206.029 211.59c7.047 0 12.761 5.714 12.761 12.761 0 7.048-5.714 12.761-12.761 12.761-7.048 0-12.761-5.713-12.761-12.761.006-7.045 5.716-12.754 12.761-12.761",opacity:"0.72"}),jsx("path",{fill:l,fillRule:"nonzero",d:"M200.058 225.406l-.699-.681a.721.721 0 010-1.065l6.127-5.984a.753.753 0 01.546-.231c.206 0 .404.083.545.231l6.127 5.978a.733.733 0 010 1.065l-.699.682a.768.768 0 01-1.091 0l-3.622-3.727v8.843a.725.725 0 01-.219.523.76.76 0 01-.534.217h-1.009a.75.75 0 01-.759-.74v-8.832l-3.622 3.726a.768.768 0 01-1.091-.005z"})]})}var Wo=memo(gt);var bt=({header:e,description:o,sx:r,...n})=>jsxs(he,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...n,children:[jsx(Wo,{sx:{width:220}}),jsxs("div",{children:[jsx(eo,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),jsx(eo,{variant:"body2",sx:{color:"text.secondary"},children:o||jsxs(Fragment,{children:["Solte os arquivos aqui ou clique",jsx(eo,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua m\xE1quina"]})})]})]}),me=memo(bt);var Et=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:n,filesDetails:t=[],id:l,disabled:a,error:d,helperText:c,thumbnail:m,dropZoneSxProps:s,uploading:u,tabIndex:h,maxFiles:P,placeholderAlt:A,placeholderProps:v,...U})=>{let{filesPreview:b,isUploadOrLoadingFiles:R,uploadErrorText:F,uploadFiles:I}=V({createFilesMutation:n,filesDetails:t}),{files:y,dropzoneProps:O,handleRemove:g,handleReorder:E}=q({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:b,dropzoneOptions:{multiple:!0,disabled:a,...U},maxFiles:P,uploadFiles:I}),{getRootProps:f,getInputProps:M,isDragActive:N,isDragReject:T}=O,S=!!y?.filter(W=>!!W.id).length,C=T||!!d||!!F;return jsxs(ce,{id:l,uploading:u||R,disabled:a,dropZoneSxProps:s,tabIndex:h,getRootProps:f,getInputProps:M,isDragActive:N,isError:C,dropZoneContent:jsx(Fragment,{children:A?jsx(he,{children:A}):jsx(me,{header:v?.header,description:v?.description})}),children:[jsx(_,{disabled:a,helperText:c,isError:C}),d?jsx(_,{helperText:d,isError:!0}):null,F?jsx(_,{helperText:F,isError:!0}):null,S&&jsx(ze,{sx:{my:3},children:jsx(ye,{files:y,thumbnail:!!m,onRemove:e?g:void 0,onReorder:o?E:void 0})})]})},Rt=memo(Et);var _t=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:n,filesDetails:t=[],id:l,disabled:a,error:d,helperText:c,dropZoneSxProps:m,placeholderProps:s,placeholderAlt:u,uploading:h,tabIndex:P,maxFiles:A,aspectRatio:v,enableCrop:U=!0,convertToWebp:b=!0,cropSize:R,name:F,label:I,...y})=>{let{filesPreview:O,isUploadOrLoadingFiles:g,uploadErrorText:E,uploadFiles:f}=V({createFilesMutation:n,filesDetails:t}),M=h||g,{files:N,dropzoneProps:T,cropState:S,aspectRatio:C,handleRemove:W,handleReorder:J}=q({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:O,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!0,disabled:a,...y},enableCrop:U,customAspectRatio:v,convertToWebp:b,maxFiles:A,cropSize:R,uploadFiles:f}),{getRootProps:re,getInputProps:Z,isDragActive:le,isDragReject:ue}=T,{cropModalOpen:se,imagePreview:pe,cropLoading:H,onCropInitialized:Q,handleCropSave:Y,handleCropCancel:te,currentImageIndex:$,totalPendingImages:p}=S,ge=!!N?.filter(xe=>!!xe.id).length,ie=ue||!!d||!!E,we=useMemo(()=>{let xe=I??"Ajustar Imagem",Ie=p>1||$>1?` (${$} de ${p})`:"";return `${xe}${Ie}`},[I,p,$]);return jsxs(ce,{id:l,name:F,uploading:M,disabled:a,dropZoneSxProps:m,tabIndex:P,getRootProps:re,getInputProps:Z,isDragActive:le,isError:ie,dropZoneContent:jsx(Fragment,{children:u?jsx(he,{children:u}):jsx(me,{header:s?.header,description:s?.description})}),children:[jsx(_,{disabled:a,helperText:c,isError:ie}),d?jsx(_,{helperText:d,isError:!0}):null,E?jsx(_,{helperText:E,isError:!0}):null,ge&&jsx(ze,{sx:{my:3,ml:.5},children:jsx(ye,{files:N,thumbnail:!0,onRemove:W,onReorder:o?J:void 0})}),jsx(a$5,{open:se,onClose:te,label:we,imageSrc:pe,aspectRatio:C,onInitialized:Q,onSave:Y,loading:H,cropSize:R})]})},Lt=memo(_t);var kt=({onFileSelect:e$1,onRemove:o,createFilesMutation:r,fileDetails:n,id:t,disabled:l,error:a,helperText:d,sx:c,dropZoneSxProps:m$1,uploading:s,tabIndex:u,placeholderAlt:h,placeholderProps:P,...A})=>{let{filesPreview:v,isUploadOrLoadingFiles:U,uploadErrorText:b,uploadFiles:R}=V({createFilesMutation:r,filesDetails:n?[n]:[]}),F=U||s,{file:I,dropzoneProps:y,handleRemove:O}=q({uploadFiles:R,onFileSelect:e$1,onRemove:o,filesPreview:v,dropzoneOptions:{multiple:!1,disabled:l,...A}}),{getRootProps:g,getInputProps:E,isDragActive:f,isDragReject:M}=y,N=useCallback(W=>{W.stopPropagation(),O(I||void 0);},[I,O]),T=!!I,S=typeof I=="string",C=M||!!a||!!b;return jsxs(ce,{id:t,uploading:F,disabled:l,dropZoneSxProps:m$1,tabIndex:u,getRootProps:g,getInputProps:E,isDragActive:f,isError:C,dropZoneContent:jsxs(Fragment,{children:[!T&&(h?jsx(he,{...P,children:h}):jsx(me,{})),T&&jsxs(he,{component:m.div,...j().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:W=>`solid 1px ${W.palette.divider}`,...c},children:[jsx(Ee,{file:I}),jsxs(he,{flexGrow:1,sx:{minWidth:0},children:[jsx(eo,{variant:"subtitle2",noWrap:!0,children:S?I:I.name}),jsx(eo,{variant:"caption",sx:{color:"text.secondary"},children:S?"":e(I.size)})]}),o&&jsx(a$3,{title:"Remover arquivo",children:jsx(so,{edge:"end",size:"small",disabled:l,"aria-label":"Remover arquivo",onClick:N,children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})})})]})]}),children:[jsx(_,{disabled:l,helperText:d,isError:C}),a?jsx(_,{helperText:a,isError:!0}):null,b?jsx(_,{helperText:b,isError:!0}):null]})},Nt=memo(kt);var $t=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:n,id:t,disabled:l,error:a,helperText:d,dropZoneSxProps:c,placeholderProps:m,placeholderAlt:s,hoverAlt:u,uploading:h,tabIndex:P,aspectRatio:A,enableCrop:v=!0,convertToWebp:U=!0,name:b,label:R,cropSize:F,sx:I,maxWidth:y,maxHeight:O,compressionQuality:g=.8,maxCompressedWidth:E,maxCompressedHeight:f,fill:M,...N})=>{let{filesPreview:T,isUploadOrLoadingFiles:S,uploadErrorText:C,uploadFiles:W}=V({createFilesMutation:r,filesDetails:n?[n]:[]}),[J,re]=useState(!1),{file:Z,dropzoneProps:le,cropState:ue,handleRemove:se,aspectRatio:pe}=q({onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:l,...N},filesPreview:T,enableCrop:v,customAspectRatio:A,convertToWebp:U,cropSize:F,uploadFiles:W,compressionQuality:g,maxCompressedWidth:E,maxCompressedHeight:f}),{getRootProps:H,getInputProps:Q,isDragActive:Y,isDragReject:te}=le,{cropModalOpen:$,imagePreview:p,cropLoading:ge,onCropInitialized:ie,handleCropSave:we,handleCropCancel:xe}=ue,Ie=useCallback(()=>{se(Z||void 0);},[Z,se]),x=!!Z,w=te||!!a||!!C,z=h||S,D=x?{opacity:0}:{opacity:1},k=c?.width;return useEffect(()=>{x||re(!1);},[x]),jsxs(Ce,{sx:{...I,...k&&{width:k}},children:[(z||J)&&jsx(a$6,{}),jsxs(ce,{id:t,uploading:z,disabled:l,dropZoneSxProps:c,tabIndex:P,getRootProps:H,getInputProps:Q,isDragActive:Y,isError:w,name:b,dropZoneContent:jsxs(Fragment,{children:[s?jsx(he,{sx:D,children:s}):jsx(me,{sx:D,header:m?.title,description:m?.description}),x&&jsx(Ke,{file:Z,cropSize:F,isLoading:J,isUploading:z,onLoading:re,aspectRatio:pe,maxWidth:y,maxHeight:O,hoverAlt:u,fill:M})]}),children:[jsx(_,{disabled:l,helperText:d,isError:w}),a?jsx(_,{helperText:a,isError:!0}):null,C?jsx(_,{helperText:C,isError:!0}):null,x&&e&&jsx(mo,{size:"small",onClick:Ie,disabled:l,label:"Remover arquivo",children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})}),jsx(a$5,{open:$,onClose:xe,label:R??"Ajustar Imagem",imageSrc:p,aspectRatio:pe,onInitialized:ie,onSave:we,loading:ge,cropSize:F})]})]})},Xt=memo($t);var ei=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:n,disabled:t,label:l,id:a,tabIndex:d,error:c,helperText:m,sx:s,name:u,maxSize:h,uploading:P,aspectRatio:A=1,enableCrop:v=!0,convertToWebp:U=!0,cropSize:b,...R})=>{let[F,I]=useState(!1),{filesPreview:y,isUploadOrLoadingFiles:O,uploadErrorText:g,uploadFiles:E}=V({createFilesMutation:r,filesDetails:n?[n]:[]}),{file:f,dropzoneProps:M,cropState:N,handleRemove:T}=q({filesPreview:y,onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:t,maxSize:h,...R},enableCrop:v,customAspectRatio:A,convertToWebp:U,cropSize:b,uploadFiles:E}),{getRootProps:S,getInputProps:C,isDragActive:W,isDragReject:J}=M,{cropModalOpen:re,imagePreview:Z,cropLoading:le,onCropInitialized:ue,handleCropSave:se,handleCropCancel:pe}=N,H=J||!!c||!!g,Q=F||O||P,Y=!!e,te=useRef(n?.url||""),$=useRef();useEffect(()=>{if(!f){te.current="",$.current=void 0;return}if($.current===f.id)return;$.current=f.id,I(!0);let ie=URL.createObjectURL(f);return te.current=ie,()=>{URL.revokeObjectURL(ie);}},[f]);let p=()=>{I(!1);},ge=useCallback(()=>Y&&f?()=>T(f):S().onClick,[Y,f,S,T]);return jsxs(Fragment,{children:[jsxs(he,{sx:{alignItems:"center"},children:[jsxs(Po,{sx:s,isError:H,isDragActive:W,hasFile:!!f,...S(),onClick:ge(),children:[jsxs(bo,{children:[Q&&jsx(Io,{children:jsx(Yt,{size:135,thickness:2,color:"primary"})}),f&&jsx(vo,{alt:"Avatar Preview",src:te.current,onLoad:p,...Q&&{sx:{filter:"blur(5px) !important",scale:1.2,opacity:.7}}}),!f&&!Q&&jsxs(qe,{isError:H,hasFile:!1,children:[jsx(a$4,{icon:"ADD_IMAGE",width:32}),jsx(eo,{variant:"caption",textAlign:"center",sx:{color:H?"error.main":"text.disabled"},children:"Adicionar foto"})]}),f&&!Q&&jsxs(qe,{isError:H,hasFile:!0,children:[jsx(a$4,{icon:Y?"DELETE_MARK_BUTTON_02":"ADD_IMAGE",width:32}),jsx(eo,{variant:"caption",textAlign:"center",sx:{color:H?"error.main":"common.white"},children:Y?"Remover foto":"Alterar foto"})]})]}),jsx("input",{name:u,id:a,tabIndex:d,...C()})]}),jsx(he,{sx:{alignItems:"center",mt:-.5},children:jsx(_,{helperText:m,disabled:t,isError:H})}),g?jsx(_,{helperText:g,isError:!0}):null,c?jsx(_,{helperText:c,isError:!0}):null]}),re&&Z&&jsx(a$5,{open:re,onClose:pe,label:l??"Ajustar Imagem",imageSrc:Z,aspectRatio:A,onInitialized:ue,onSave:se,loading:le,cropSize:b,cropShape:"round"})]})},oi=memo(ei);var ai=({error:e,name:o,disabled:r,sx:n,...t})=>{let{getRootProps:l,getInputProps:a,isDragActive:d,isDragReject:c}=useDropzone({disabled:r,...t}),m=c||e;return jsxs(fo,{...l(),isDragActive:d,hasError:!!m,disabled:!!r,sx:n,"data-testid":"upload-box",children:[jsx("input",{name:o,...a()}),"Selecionar arquivo"]})},ni=memo(ai);
31
+ var Jo=({helperText:e,disabled:o,isError:r})=>e?jsx(Ko,{error:r,sx:n=>({mx:"14px",color:o?n.palette.grey[500]:void 0}),children:e}):null,_=memo(Jo);var Ce=styled(he)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),ke=styled(he)({position:"absolute",top:4,right:4,gap:.5,"& svg":{width:16,height:16}}),lo=styled(ze,{shouldForwardProp:e=>!["isDragActive","isError","disabled"].includes(e)})(({theme:e,isDragActive:o,isError:r,disabled:n})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`dashed 1px ${e.palette.divider}`,...o&&{opacity:.72},...r&&{color:e.palette.error.main,backgroundColor:e.palette.error.lighter,borderColor:e.palette.error.light},...n&&{opacity:.48,pointerEvents:"none"},"&:hover":{opacity:.72}})),so=styled(Yo)(({theme:e})=>({position:"relative",zIndex:999,pointerEvents:"auto",color:e.palette.grey[700],backgroundColor:e.palette.grey[100],"&:hover":{color:e.palette.grey[900],backgroundColor:e.palette.grey[300]}})),Xe=styled("div")({position:"relative",zIndex:1,userSelect:"none","&:hover":{zIndex:2}}),po=styled(he,{shouldForwardProp:e=>!["isDragging"].includes(e)})(({theme:e,width:o,isDragging:r})=>({width:o,height:100,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2,1,2,1),gap:e.spacing(1),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),co=styled(m.div)(({theme:e,width:o,isDragging:r})=>({width:o,height:60,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),mo=styled(a)(({theme:e})=>({top:16,right:16,zIndex:9,position:"absolute",color:e.palette.common.white,backgroundColor:alpha(e.palette.grey[900],.72),"&:hover":{backgroundColor:alpha(e.palette.grey[900],.48)}})),fo=styled(ze,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="disabled"&&e!=="hasError"})(({theme:e,isDragActive:o,disabled:r,hasError:n})=>({width:64,height:64,flexShrink:0,display:"flex",borderRadius:1,cursor:"pointer",alignItems:"center",color:e.palette.text.disabled,justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),border:`dashed 1px ${alpha(e.palette.grey[500],.16)}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...n&&{color:e.palette.error.main,borderColor:e.palette.error.main,backgroundColor:alpha(e.palette.error.main,.08)},"&:hover":{opacity:.72}})),uo=styled(ze)(({theme:e})=>({padding:e.spacing(1),top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out",filter:"blur(0)","&:hover .single-file-preview-img":{filter:"blur(3px)",transition:"all 0.1s ease-in-out"},"&:hover .single-file-preview-hover-overlay":{opacity:1}})),go=styled("img",{shouldForwardProp:e=>e!=="aspectRatio"&&e!=="isLoading"&&e!=="isUploading"&&e!=="maxWidth"&&e!=="maxHeight"&&e!=="cropSize"&&e!=="fill"})(({theme:e,aspectRatio:o,maxWidth:r,maxHeight:n,isLoading:t,isUploading:l,fill:a})=>({borderRadius:e.shape.borderRadius,objectFit:"cover",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)",filter:"blur(0)",zIndex:1,backgroundColor:e.palette.background.paper,...a&&{width:"100%",height:"100%"},...!a&&Math.abs(o)>=1&&{maxWidth:r,maxHeight:n,aspectRatio:Math.abs(o),width:"calc(100% - 16px)",height:void 0},...!a&&Math.abs(o)<1&&{maxWidth:r,maxHeight:n,aspectRatio:Math.abs(o),width:void 0,height:"calc(100% - 16px)"},transition:"all 0.3s ease-in-out",...t||l?{opacity:0,filter:"blur(1.5rem)",transform:"translate(-50%, -50%) scale(0.7)"}:{}})),xo=styled("img",{shouldForwardProp:e=>e!=="isLoading"&&e!=="isUploading"})(({isLoading:e,isUploading:o})=>({width:"100%",height:"100%",objectFit:"cover",top:0,left:0,filter:"blur(1.5rem)",transform:"scale(1.1)",position:"absolute",zIndex:0,transition:"opacity 0.3s ease-in-out",...e&&{opacity:0},...o&&{opacity:.7,filter:"blur(2rem)"}})),ho=styled(he)(({theme:e})=>({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:alpha(e.palette.primary.darker,.75),zIndex:2,pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease-in-out"})),bo=styled(he)({width:"100%",height:"100%",position:"relative",overflow:"hidden",borderRadius:"50%",justifyContent:"center",alignItems:"center"});styled(er)(({theme:e})=>({py:1,px:2,mt:3,textAlign:"left",borderStyle:"dashed",borderColor:"error.main",backgroundColor:alpha(e.palette.error.main,.08)}));var qe=styled(ze,{shouldForwardProp:e=>e!=="isError"&&e!=="hasFile"})(({theme:e,isError:o,hasFile:r})=>({top:0,gap:e.spacing(1),left:0,width:"100%",height:"100%",zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:e.palette.text.disabled,flexDirection:"column",justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter}),"&:hover":{opacity:.92},...o&&{color:e.palette.error.main},...r&&{zIndex:9,opacity:0,color:e.palette.common.white,backgroundColor:alpha(e.palette.common.black,.54)}})),Io=styled(he)({top:0,left:0,right:0,bottom:0,position:"absolute",zIndex:10,alignItems:"center",justifyContent:"center",opacity:.8});styled(he)(({theme:e})=>({padding:20,justifyContent:"center",alignItems:"center",gap:4,alignSelf:"stretch",borderRadius:12,background:e.palette.divider,color:e.palette.text.disabled,height:160}));var Po=styled(ze,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="isError"&&e!=="hasFile"})(({theme:e,isDragActive:o,disabled:r,isError:n,hasFile:t})=>({padding:e.spacing(1),margin:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:`1px dashed ${e.palette.divider}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...n&&{borderColor:"error.main"},...t&&{...n&&{bgcolor:alpha(e.palette.error.main,.08)},"&:hover .upload-placeholder":{opacity:1},"& img":{filter:"blur(0)"},"&:hover img":{filter:"blur(3px)"}}})),vo=styled("img")({width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",transition:"all 0.3s ease-in-out"}),Fo=styled(a)(({theme:e})=>({backgroundColor:alpha(e.palette.grey[900],.72),color:e.palette.common.white,"&:hover":{backgroundColor:alpha(e.palette.grey[600],.64),color:e.palette.common.white},"& svg":{width:14,height:14}}));var ir=({onRemove:e,sx:o,file:r,disableDrag:n,attributes:t,listeners:l,innerWidth:a,isDragging:d})=>{let c=r?.id;return c?jsx(tr,{anchorOrigin:{vertical:"top",horizontal:"left"},children:jsxs(co,{width:a,isDragging:d,"data-testid":`preview-multi-img-${c}`,...j().inUp,sx:o,children:[jsx(a$2,{disableDrag:n,...t,...l}),jsx(Ee,{imageView:!0,file:r}),jsx(ke,{sx:{position:"absolute",right:3,top:3,zIndex:1},children:e&&jsx(Fo,{size:"small",label:"Remover arquivo",onClick:()=>e(r),icon:"DELETE_MARK_BUTTON_02"})})]})},`badge-${c}`):null},Eo=memo(ir);var dr=({file:e$1,thumbnail:o,onRemove:r,sx:n,disableDrag:t=!1,disableTransitions:l=!1})=>{let a$1=e$1.size||0,d=e$1.name||e$1.id,c=e$1.id,m=typeof e$1=="string",s=t?70:80,{attributes:u,listeners:h,setNodeRef:P,transform:A,transition:v,isDragging:U}=useSortable({id:c,disabled:t}),b={transform:l?void 0:CSS.Transform.toString(A),transition:l?"none":v,opacity:l?.2:1,display:"inline-block",alignItems:"center",justifyContent:"center",width:`${s+8}px`,height:"68px"};return o&&e$1?jsx(Xe,{ref:P,style:b,children:jsx(Eo,{innerWidth:s,isDragging:U,sx:n,file:e$1,disableDrag:t,attributes:u,listeners:h,onRemove:r})}):jsx(Xe,{ref:P,style:{...b,height:"80px",width:`${s+38}px`},children:jsxs(po,{width:s+30,isDragging:U,"data-testid":`preview-multi-img-${c}`,...j().inUp,sx:n,children:[jsx(a$2,{disableDrag:t,...u,...h}),e$1&&jsx(Ee,{file:e$1}),jsxs(he,{flexGrow:1,sx:{width:"100%"},children:[jsx(a$3,{title:d,children:jsx(eo,{variant:"subtitle2",noWrap:!0,children:d})}),jsx(eo,{variant:"caption",sx:{color:"text.secondary"},children:m?"":e(a$1)})]}),jsx(ke,{children:r&&jsx(a,{size:"small",label:"Remover arquivo",onClick:()=>r(e$1),icon:"DELETE_MARK_BUTTON_02"})})]})})},Ao=memo(dr);var Ar=({thumbnail:e,files:o,onRemove:r,onReorder:n,sx:t})=>{let[l,a]=useState(!1),d=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),c=useCallback(s=>{let{active:u,over:h}=s;if(!(!u||!h||u.id===h.id)&&n){let P=o.findIndex(({id:v})=>v===u.id),A=o.findIndex(({id:v})=>v===h.id);P!==-1&&A!==-1&&(n(P,A,o),a(!0),setTimeout(()=>{a(!1);},300));}},[o,n]),m=jsx(AnimatePresence,{initial:!1,children:o.map(s=>jsx(Ao,{sx:t,id:`preview-file-${s.id}`,file:s,onRemove:r,thumbnail:e,disableDrag:!n,disableTransitions:l},`preview-file-${s.id}`))});return n?jsx(DndContext,{sensors:d,collisionDetection:closestCenter,onDragEnd:c,modifiers:[restrictToHorizontalAxis,restrictToParentElement,restrictToWindowEdges],children:jsx(SortableContext,{items:o.map(s=>s.id),strategy:horizontalListSortingStrategy,children:m})}):m},ye=memo(Ar);var Mo=forwardRef(({onLoading:e,aspectRatio:o,cropSize:r,...n},t)=>{let{maxWidth:l,maxHeight:a}=useMemo(()=>r&&typeof r=="object"?{maxWidth:r.width,maxHeight:r.height}:r&&typeof r=="number"?{maxWidth:r,maxHeight:r}:{maxWidth:"100%",maxHeight:"100%"},[r]);a$1(()=>{e?.(!0);}),useLayoutEffect(()=>{typeof t=="object"&&t?.current?e?.(!t.current.complete):e?.(!1);},[t,e]);function d(){e?.(!1);}return jsx(go,{...n,maxWidth:l,maxHeight:a,ref:t,aspectRatio:o,onLoad:d,onError:d})});Mo.displayName="LoadingPreviewImage";var yo=Mo;var Sr=({file:e,aspectRatio:o=1,isUploading:r,isLoading:n,onLoading:t,cropSize:l,maxWidth:a,maxHeight:d,hoverAlt:c,fill:m})=>{let s=useRef(null),u=e?.id||"",h=e?.name||"",P=URL.createObjectURL(e);return u?jsxs(uo,{className:"single-file-preview-box",children:[jsx(yo,{className:"single-file-preview-img",aspectRatio:o,cropSize:l,isLoading:n,isUploading:r,alt:h,src:P,ref:s,loading:"lazy",onLoading:t,onLoad:()=>t?.(!1),onError:()=>t?.(!1),maxWidth:a,maxHeight:d,fill:m},`image-preview-${u}`),jsx(xo,{className:"single-file-preview-bg",alt:h,src:P,isLoading:n,isUploading:r}),c&&jsx(ho,{className:"single-file-preview-hover-overlay",children:c})]}):null},Ke=memo(Sr);var Or=["pdf"],Ur=["txt"],Cr=["psd"],kr=["doc","docx"],Nr=["xls","xlsx"],Br=["zip","rar","iso"],Wr=["ai","eps"],Gr=["ppt","pptx"],jr=["wav","aif","mp3","aac"],Zr=["jpg","jpeg","gif","bmp","png","svg","webp"],Hr=["m4v","avi","mpg","mp4","webm"];function Je(e){let o,r=Do(e);return Ur.includes(r)?o="txt":Br.includes(r)?o="zip":jr.includes(r)?o="audio":Zr.includes(r)?o="image":Hr.includes(r)?o="video":kr.includes(r)?o="word":Nr.includes(r)?o="excel":Gr.includes(r)?o="powerpoint":Or.includes(r)?o="pdf":Cr.includes(r)?o="photoshop":Wr.includes(r)?o="illustrator":e?.startsWith("http")?o="image":o=Do(e),o}function _o(e){let o;switch(Je(e)){case"folder":o="IC_FOLDER";break;case"txt":o="IC_TXT";break;case"zip":o="IC_ZIP";break;case"audio":o="IC_AUDIO";break;case"video":o="IC_VIDEO";break;case"word":o="IC_WORD";break;case"excel":o="IC_EXCEL";break;case"powerpoint":o="IC_POWER_POINT";break;case"pdf":o="IC_PDF";break;case"photoshop":o="IC_PTS";break;case"illustrator":o="IC_AI";break;case"image":o="IC_IMG";break;default:o="IC_FILE";}return o}function Do(e){return e&&e.split(".").pop()||""}function ma(e){return e.split("/").pop()}var Be={root:"mnl__file__thumbnail__root",img:"mnl__file__thumbnail__img",icon:"mnl__file__thumbnail__icon",removeBtn:"mnl__file__thumbnail__remove__button",downloadBtn:"mnl__file__thumbnail__download__button"},Ee=({sx:e,file:o,tooltip:r,onRemove:n,imageView:t,slotProps:l,onDownload:a,...d})=>{let c=URL.createObjectURL(o),m=o?.name||"",u=o.type.startsWith("image/")?"image":Je(c),h=jsx(ze,{component:"img",src:c,className:Be.img,sx:{width:1,height:1,objectFit:"cover",borderRadius:"inherit",...l?.img}}),P=jsx(a$4,{icon:_o(u),sx:{width:32,height:32,flexShrink:0,...e}}),A=jsxs(he,{component:"span",className:Be.root,sx:{width:36,height:36,flexShrink:0,borderRadius:1.25,alignItems:"center",position:"relative",display:"inline-flex",justifyContent:"center",...e},...d,children:[u==="image"&&t?h:P,n&&jsx(Xr,{onClick:n,className:Be.removeBtn,sx:l?.removeBtn,children:jsx(a$4,{icon:"CLOSE_MARK_BUTTON",width:24})}),a&&jsx(Yo,{onClick:a,className:Be.downloadBtn,sx:l?.downloadBtn,size:"small",children:jsx(a$4,{icon:"ARROW_DOWN_CICLE",width:12})})]});return r?jsx(Kr,{arrow:!0,title:m,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,-12]}}]}},children:A}):A};var Ea=e=>e.startsWith("image/"),Lo=(e,o=.8)=>new Promise((r,n)=>{let t=document.createElement("canvas"),l=t.getContext("2d"),a=new Image;a.onload=()=>{t.width=a.width,t.height=a.height,l?(l.drawImage(a,0,0),t.toBlob(d=>{if(d){let c=new File([d],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});r(c);}else n(new Error("Falha ao converter para WebP"));},"image/webp",o)):n(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},a.onerror=()=>n(new Error("Falha ao carregar imagem")),a.src=URL.createObjectURL(e);}),So=(e,o=.8,r,n)=>new Promise((t,l)=>{let a=document.createElement("canvas"),d=a.getContext("2d"),c=new Image;c.onload=()=>{let{width:m,height:s}=c;r&&m>r&&(s=s*r/m,m=r),n&&s>n&&(m=m*n/s,s=n),a.width=m,a.height=s,d?(d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(c,0,0,m,s),a.toBlob(u=>{if(u){let h=new File([u],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});t(h);}else l(new Error("Falha ao comprimir imagem"));},"image/webp",o)):l(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},c.onerror=()=>l(new Error("Falha ao carregar imagem")),c.src=URL.createObjectURL(e);}),To=e=>{let o=e.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i);return o?.[1]||o?.[2]||""},Oo=e=>`UTF-8''${encodeURIComponent(e)}`;var rt=({onFilesSelect:e$1,onFileSelect:o,onReorder:r,onRemove:n,uploadFiles:t,filesPreview:l,dropzoneOptions:a,enableCrop:d=!1,customAspectRatio:c,convertToWebp:m=!0,cropSize:s,maxFiles:u,compressionQuality:h=.8,maxCompressedWidth:P,maxCompressedHeight:A})=>{let{showErrorMessage:v}=a$7(),U=useMemo(()=>c||(s&&typeof s!="number"?s.width/s.height:1),[c,s]),[b,R]=useState([]),[F,I]=useState(!1),[y,O]=useState(null),[g,E]=useState(null),[f,M]=useState(""),[N,T]=useState(!1),[S,C]=useState([]),[W,J]=useState(0),[re,Z]=useState(0),le=x=>{if(x.length<1)return;let w=x[0];O(w),J(D=>D+1);let z=new FileReader;z.onload=()=>{M(z.result),I(!0);},z.readAsDataURL(w);},ue=(x,w)=>{E(w);},se=async x=>!y||!g?null:new Promise(w=>{let z=document.createElement("canvas"),D=z.getContext("2d"),k=new Image;k.onload=async()=>{let{width:G,height:de,x:De,y:$o}=g,Xo=Math.abs(U),_e=G,Le=de;s&&typeof s=="object"?(_e=s.width,Le=s.height):s&&typeof s=="number"&&(_e=s,Le=s/Xo),z.width=_e,z.height=Le,D?(D.drawImage(k,De,$o,G,de,0,0,_e,Le),z.toBlob(async io=>{if(io){let $e=new File([io],y.name,{type:y.type,lastModified:Date.now()});if(m)try{$e=await Lo($e,h);}catch(qo){v(qo,"Erro ao converter para WebP");}let ao=$e;ao.id=x,w(ao);}else w(null);},"image/png")):w(null);},k.src=f;}),pe=async()=>{if(!(!y||!g||S.length===0)){T(!0);try{let x=S[0],w=await se(x.id);if(w){let D=await t([w]);D&&(!e$1&&!o&&R(k=>[...k,...D]),e$1?.([...l||[],...D]),o?.(w));}I(!1),T(!1),M(""),O(null);let z=S.slice(1);C(z),le(z);}catch(x){v(x,"Erro ao processar imagem"),T(!1);}}},H=()=>{I(!1),T(!1),M(""),O(null),C([]),J(0),Z(0);},Q=async x=>{if(x.length===0)return;let w=Object.keys(a?.accept||{}).some(D=>D.includes("image/")),z=b.length+x.length;if(u&&z>u){v(new Error(`M\xE1ximo de ${u} arquivos`),"Erro ao fazer upload");return}try{if(w&&d){let k=x.filter(G=>G.type.startsWith("image/")).map((G,de)=>{let De=G;return De.id=`temp-crop-${Date.now()}-${de}`,De});Z(k.length),J(0),C(k),le(k);}else {let D=[];for(let G of x)if(G.type.startsWith("image/")&&m)try{let de=await So(G,h,P,A);D.push(de);}catch(de){v(de,"Erro ao comprimir imagem"),D.push(G);}else D.push(G);let k=await t(D);k&&(!e$1&&!o&&R(G=>[...G,...k]),e$1?.([...l||[],...k]),o?.(k[0]));}}catch(D){v(D,"Erro ao processar arquivos");}},Y=x=>{if(!x.length)return;let w=x[0]?.errors[0]?.code,z=a?.maxSize||3145728;v(w==="file-too-large"?new Error(`O arquivo excede o tamanho m\xE1ximo de ${e(z)}`):w==="file-invalid-type"?new Error("Formato de arquivo n\xE3o suportado"):x[0]?.errors[0]||new Error("Erro ao enviar arquivo"),"Erro ao fazer upload");},{getRootProps:te,getInputProps:$,isDragActive:p,isDragReject:ge,fileRejections:ie}=useDropzone({onDrop:Q,onDropRejected:Y,...a}),we=x=>{if(!x){n||R([]),n?.(void 0);return}let w=b.filter(z=>z.id!==x.id);n||R(w),n?.(x);},xe=(x,w,z)=>{r?.(x,w,z);},Ie=useRef("");return useEffect(()=>{let x=l?.map(w=>w.id).join(",")||"";x!==Ie.current&&(Ie.current=x,R(l||[]));},[l]),{file:b?.[0],files:b,aspectRatio:U,dropzoneProps:{getRootProps:te,getInputProps:$,isDragActive:p,isDragReject:ge,fileRejections:ie},cropState:{cropModalOpen:F,imagePreview:f,cropLoading:N,setCropModalOpen:I,onCropInitialized:ue,handleCropSave:pe,handleCropCancel:H,currentImageIndex:W,totalPendingImages:re},setInitialFiles:R,handleRemove:we,handleReorder:xe}},q=rt;var Qe=(p=>(p.APPLICATION_OCTET_STREAM="application/octet-stream",p.IMAGE_JPEG="image/jpeg",p.IMAGE_JPG="image/jpg",p.IMAGE_PNG="image/png",p.IMAGE_GIF="image/gif",p.IMAGE_WEBP="image/webp",p.IMAGE_SVG="image/svg+xml",p.IMAGE_BMP="image/bmp",p.IMAGE_TIFF="image/tiff",p.IMAGE_ICO="image/x-icon",p.IMAGE_AVIF="image/avif",p.APPLICATION_PDF="application/pdf",p.TEXT_PLAIN="text/plain",p.TEXT_CSV="text/csv",p.APPLICATION_RTF="application/rtf",p.APPLICATION_MSWORD="application/msword",p.APPLICATION_DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",p.APPLICATION_MSEXCEL="application/vnd.ms-excel",p.APPLICATION_XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",p.APPLICATION_MSPOWERPOINT="application/vnd.ms-powerpoint",p.APPLICATION_PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",p.APPLICATION_ODT="application/vnd.oasis.opendocument.text",p.APPLICATION_ODS="application/vnd.oasis.opendocument.spreadsheet",p.APPLICATION_ODP="application/vnd.oasis.opendocument.presentation",p.APPLICATION_XML="application/xml",p.TEXT_XML="text/xml",p.TEXT_HTML="text/html",p.TEXT_CSS="text/css",p.APPLICATION_JSON="application/json",p.TEXT_JAVASCRIPT="text/javascript",p.APPLICATION_ZIP="application/zip",p.APPLICATION_GZIP="application/gzip",p.APPLICATION_RAR="application/vnd.rar",p.APPLICATION_7Z="application/x-7z-compressed",p.AUDIO_MPEG="audio/mpeg",p.AUDIO_WAV="audio/wav",p.AUDIO_OGG="audio/ogg",p.AUDIO_WEBM="audio/webm",p.AUDIO_AAC="audio/aac",p.VIDEO_MP4="video/mp4",p.VIDEO_MPEG="video/mpeg",p.VIDEO_OGG="video/ogg",p.VIDEO_WEBM="video/webm",p.VIDEO_QUICKTIME="video/quicktime",p))(Qe||{}),We=(e=>(e["application/octet-stream"]="APPLICATION_OCTET_STREAM",e["image/jpeg"]="IMAGE_JPEG",e["image/jpg"]="IMAGE_JPG",e["image/png"]="IMAGE_PNG",e["image/gif"]="IMAGE_GIF",e["image/webp"]="IMAGE_WEBP",e["image/svg+xml"]="IMAGE_SVG",e["image/bmp"]="IMAGE_BMP",e["image/tiff"]="IMAGE_TIFF",e["image/x-icon"]="IMAGE_ICO",e["image/avif"]="IMAGE_AVIF",e["application/pdf"]="APPLICATION_PDF",e["text/plain"]="TEXT_PLAIN",e["text/csv"]="TEXT_CSV",e["application/rtf"]="APPLICATION_RTF",e["application/msword"]="APPLICATION_MSWORD",e["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]="APPLICATION_DOCX",e["application/vnd.ms-excel"]="APPLICATION_MSEXCEL",e["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]="APPLICATION_XLSX",e["application/vnd.ms-powerpoint"]="APPLICATION_MSPOWERPOINT",e["application/vnd.openxmlformats-officedocument.presentationml.presentation"]="APPLICATION_PPTX",e["application/vnd.oasis.opendocument.text"]="APPLICATION_ODT",e["application/vnd.oasis.opendocument.spreadsheet"]="APPLICATION_ODS",e["application/vnd.oasis.opendocument.presentation"]="APPLICATION_ODP",e["application/xml"]="APPLICATION_XML",e["text/xml"]="TEXT_XML",e["text/html"]="TEXT_HTML",e["text/css"]="TEXT_CSS",e["application/json"]="APPLICATION_JSON",e["text/javascript"]="TEXT_JAVASCRIPT",e["application/zip"]="APPLICATION_ZIP",e["application/gzip"]="APPLICATION_GZIP",e["application/vnd.rar"]="APPLICATION_RAR",e["application/x-7z-compressed"]="APPLICATION_7Z",e["audio/mpeg"]="AUDIO_MPEG",e["audio/wav"]="AUDIO_WAV",e["audio/ogg"]="AUDIO_OGG",e["audio/webm"]="AUDIO_WEBM",e["audio/aac"]="AUDIO_AAC",e["video/mp4"]="VIDEO_MP4",e["video/mpeg"]="VIDEO_MPEG",e["video/ogg"]="VIDEO_OGG",e["video/webm"]="VIDEO_WEBM",e["video/quicktime"]="VIDEO_QUICKTIME",e))(We||{});var nt=({createFilesMutation:e,filesDetails:o})=>{let{showErrorMessage:r}=a$7(),[n,t]=useState(!1),[l,a]=useState(!1),[d,c]=useState(null),[m,s]=useState([]),u=useMemo(()=>m?.[0],[m]),h=l||n,P=useCallback(async b=>{if(!b.length){s([]),a(!1);return}a(!0);try{let F=(await Promise.all(b.map(async({url:I,id:y,name:O})=>{try{if(!I)return null;let g=await fetch(I);if(!g.ok)throw new Error(g.statusText);let E=await g.blob(),f=null;if(!O){let T=g.headers.get("content-disposition")||void 0;if(T){let S=To(T);if(S)try{f=decodeURIComponent(S);}catch{f=S;}}}let M=f||O||y,N=new File([E],M,{type:E.type});return N.id=y,N.url=I,N}catch{return null}}))).filter(Boolean);s(F),a(!1);}catch(R){r(R,"Erro ao carregar arquivos"),s([]),a(!1);}},[r]),A=useRef("");useEffect(()=>{let b=o?.map(({id:R})=>R).join(",")||"";b!==A.current&&(async()=>(A.current=b,await P(o)))();},[o,P]);let v=async b=>{if(!b||!Array.isArray(b))throw new Error("Arquivos inv\xE1lidos");let R=b.filter(F=>F instanceof File);if(R?.length){t(!0);try{let F=R.map(g=>{let E=g.type||"application/octet-stream",f=We[E];if(!f)throw new Error(`Tipo de arquivo n\xE3o suportado: ${E}`);return {file:g,mimeType:E,contentTypeEnum:f}}),I=await e({files:F.map(({file:g,contentTypeEnum:E})=>({content_type:E,name:g.name}))}).unwrap(),y=I.files.map((g,E)=>{let f=F[E].file,M=f;return M.id=g.id,M.url=URL.createObjectURL(f),M});return await(await Promise.all(I.files.map((g,E)=>{let{mimeType:f}=F[E],M=y[E];return fetch(g.url,{method:"PUT",headers:{"Content-Type":f,"Content-Disposition":`inline; filename*=${Oo(M.name)}`,"X-File-Id":g.id},body:M})}))).forEach(async g=>{if(!g.ok)throw new Error("Erro no upload do arquivo.")}),y}catch(F){throw c(F),r(F,"Erro no upload"),F}finally{t(!1);}}},U=useMemo(()=>d&&d instanceof Error?d.message:d,[d]);return {setFilesPreview:s,uploadFiles:v,filesPreview:m,filePreview:u,isLoadingPreview:l,isUploadingFiles:n,isUploadOrLoadingFiles:h,uploadErrorText:U}},V=nt;var st=({sx:e,id:o,name:r,tabIndex:n,uploading:t,getRootProps:l,getInputProps:a,isDragActive:d,isError:c,disabled:m,dropZoneSxProps:s,dropZoneContent:u,children:h,...P})=>jsxs(Ce,{children:[t&&jsx(a$6,{"data-testid":"uploading-progress-bar",sx:{zIndex:1}}),jsxs(ze,{sx:{width:1,position:"relative",...e},children:[jsxs(lo,{...l(),"data-testid":"drop-zone-styled-area",isError:c,isDragActive:d,disabled:!!m,sx:s,...P,children:[jsx("input",{...a(),id:o,tabIndex:n,name:r}),u]}),h]})]}),ce=st;function No(){let e=useTheme(),o=useId(),r=e.vars.palette.primary.main;return jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:o,x1:"19.496%",x2:"77.479%",y1:"71.822%",y2:"16.69%",children:[jsx("stop",{offset:"0%",stopColor:r}),jsx("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),jsx("path",{fill:`url(#${o})`,fillRule:"nonzero",d:"M0 198.78c0 41.458 14.945 79.236 39.539 107.786 28.214 32.765 69.128 53.365 114.734 53.434a148.44 148.44 0 0056.495-11.036c9.051-3.699 19.182-3.274 27.948 1.107a75.779 75.779 0 0033.957 8.01c5.023 0 9.942-.494 14.7-1.433 13.58-2.67 25.94-8.99 36.09-17.94 6.378-5.627 14.547-8.456 22.897-8.446h.142c27.589 0 53.215-8.732 74.492-23.696 19.021-13.36 34.554-31.696 44.904-53.224C474.92 234.58 480 213.388 480 190.958c0-76.93-59.774-139.305-133.498-139.305-7.516 0-14.88.663-22.063 1.899C305.418 21.42 271.355 0 232.499 0a103.651 103.651 0 00-45.88 10.661c-13.24 6.487-25.011 15.705-34.64 26.939-32.698.544-62.931 11.69-87.676 30.291C25.351 97.155 0 144.882 0 198.781z",opacity:"0.2"})]})}function gt({hideBackground:e,sx:o,...r}){let n=useTheme(),t=n.vars.palette.primary.main,l=n.vars.palette.primary.dark,a=n.vars.palette.primary.darker;return jsxs(ze,{component:"svg",width:"100%",height:"100%",viewBox:"0 0 480 360",xmlns:"http://www.w3.org/2000/svg",sx:{width:320,maxWidth:1,flexShrink:0,height:"auto",...o},...r,children:[!e&&jsx(No,{}),jsx("defs",{children:jsxs("linearGradient",{id:"linearGradient-2",x1:"30.113%",x2:"30.113%",y1:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopOpacity:"0"}),jsx("stop",{offset:"100%"})]})}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M293.006 206.192c-2.248 2.672-4.676 2.628-6.123 2.251l.054-1.384s5.979-2.733 5.827-2.159c-.057.215.057.733.242 1.292zM309.393 209.217c-3.818 2.206-6.058-.38-6.578-1.112.32-.84.801-2.204.703-2.592-.144-.577 5.827 2.155 5.827 2.155l.048 1.549zM305.303 187.204s3.632-2.093 4.425-1.151c.792.942-4.425 1.151-4.425 1.151zM307.497 188.355s-.598.299.721.681c1.318.383-.721-.681-.721-.681zM285.532 182.599c-.123.036 3.022 2.123 5.862.395-.012 0-5.154-.61-5.862-.395zM291.239 186.591s-.861 1.692-2.625 1.943c-1.764.251 2.625-1.943 2.625-1.943zM302.785 190.262s4.138 6.578 3.346 8.129c-.793 1.552-3.346-8.129-3.346-8.129zM294.62 216.416c0 .368 0 .712-.036.996-.107 1.33-3.381.828-3.381.828-2.99.416-4.066-1.019-4.422-2.392a5.444 5.444 0 01-.164-1.363 5.606 5.606 0 01.054-.819v-.272a1.998 1.998 0 011.859.379c1.331 1.08 3.095.252 3.095.252s1.294.107 1.793.538c.281.242.745-.341 1.098-.897.021.359.054 1.007.074 1.701.024.356.03.714.03 1.049z",opacity:"0.05"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M289.37 216.339s-.897.879-2.589-.479a5.444 5.444 0 01-.164-1.363c.864.658 2.466 1.842 2.753 1.842zM294.62 216.416a.67.67 0 01-.519.132.672.672 0 01-.452-.287c.348-.266.669-.566.956-.897.009.359.015.717.015 1.052zM301.637 217.032c0 .371 0 .715.033.996.108 1.333 3.382.828 3.382.828 2.989.419 4.066-1.017 4.421-2.392a5.728 5.728 0 00.111-2.182v-.272a2.024 2.024 0 00-1.862.379c-1.331 1.08-3.092.251-3.092.251s-1.294.111-1.794.542c-.281.242-.744-.341-1.094-.897a61.426 61.426 0 00-.078 1.701c-.024.35-.03.708-.027 1.046z",opacity:"0.05"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M306.887 216.949s.897.879 2.587-.479c.112-.444.169-.901.167-1.36-.867.655-2.47 1.839-2.754 1.839zM301.637 217.032a.67.67 0 00.969-.155 6.35 6.35 0 01-.957-.897c-.009.356-.014.714-.012 1.052zM319.614 106.269c.063-.138.123-.275.18-.41.057-.134.077-.209.11-.317-.11.237-.206.48-.29.727z",opacity:"0.05"}),jsx("path",{fill:a,fillRule:"nonzero",d:"M157.592 279.461a4.114 4.114 0 01-.917-3.131l13.196-107.979 1.094-8.97a4.142 4.142 0 014.078-3.635l38.654-.257a4.135 4.135 0 004.108-4.249l-.015-.409a4.14 4.14 0 014.135-4.279h40.619a4.134 4.134 0 014.098 4.682 4.137 4.137 0 003.995 4.682l39.01.996a4.13 4.13 0 013.97 4.831l-19.502 113.909-.368 2.152a4.042 4.042 0 01-.598 1.543l-135.557.114z"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M251.256817 123.296578L274.098317 123.296578 274.098317 200.823078 251.256817 200.823078z",transform:"rotate(34.64 262.678 162.06)"}),jsx("path",{fill:"#FFC107",fillRule:"nonzero",d:"M270.624591 129.857671L286.750291 129.857671 286.750291 145.983371 270.624591 145.983371z",transform:"rotate(34.804 278.687 137.92)"}),jsx("path",{fill:"#FFC107",fillRule:"nonzero",d:"M260.275579 145.813111L276.423079 145.813111 276.423079 161.960611 260.275579 161.960611z",opacity:"0.5",transform:"rotate(34.64 268.35 153.887)"}),jsx("path",{fill:"#FFC107",fillRule:"nonzero",d:"M249.191579 161.852111L265.339079 161.852111 265.339079 177.999611 249.191579 177.999611z",opacity:"0.3",transform:"rotate(34.64 257.265 169.926)"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M237.472537 121.334214L260.314037 121.334214 260.314037 198.567714 237.472537 198.567714z",transform:"rotate(16.29 248.893 159.951)"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M249.053192 123.761554L265.200692 123.761554 265.200692 139.909054 249.053192 139.909054z",transform:"rotate(16.29 257.127 131.835)"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M243.584192 142.473554L259.731692 142.473554 259.731692 158.621053 243.584192 158.621053z",opacity:"0.5",transform:"rotate(16.29 251.658 150.547)"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M238.116192 161.182554L254.263692 161.182554 254.263692 177.330054 238.116192 177.330054z",opacity:"0.3",transform:"rotate(16.29 246.19 169.256)"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M230.099192 121.641542L252.940692 121.641542 252.940692 198.875042 230.099192 198.875042z",transform:"rotate(4.6 241.52 160.258)"}),jsx("path",{fill:"#1890FF",fillRule:"nonzero",d:"M235.800489 122.985499L251.947989 122.985499 251.947989 139.132999 235.800489 139.132999z",transform:"rotate(4.6 243.874 131.06)"}),jsx("path",{fill:"#1890FF",fillRule:"nonzero",d:"M234.234488 142.413498L250.381988 142.413498 250.381988 158.560998 234.234488 158.560998z",opacity:"0.5",transform:"rotate(4.6 242.308 150.487)"}),jsx("path",{fill:"#1890FF",fillRule:"nonzero",d:"M232.672488 161.846499L248.819988 161.846499 248.819988 177.993999 232.672488 177.993999z",opacity:"0.3",transform:"rotate(4.6 240.746 169.92)"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M224.736657 123.384871L247.578157 123.384871 247.578157 200.618371 224.736657 200.618371z",transform:"rotate(-2.61 236.157 162.002)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M226.751283 124.659968L242.898783 124.659968 242.898783 140.807468 226.751283 140.807468z",transform:"rotate(-2.61 234.825 132.734)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M228.305601 143.479224L244.473301 143.479224 244.473301 159.646924 228.305601 159.646924z",opacity:"0.5",transform:"rotate(-2.862 236.39 151.563)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M228.525282 163.608968L244.672782 163.608968 244.672782 179.756468 228.525282 179.756468z",opacity:"0.3",transform:"rotate(-2.61 236.599 171.683)"}),jsx("path",{fill:"#F4F6F8",fillRule:"nonzero",d:"M232.679 225.726l-20.294 7.851-29.661 11.466c-1.121-2.093-2.771-4.921-4.813-8.297-7.026-11.642-18.65-29.75-29.001-45.665-11.66-17.938-21.696-33.075-21.696-33.075l7.265-2.093 59.346-17.23 38.854 87.043z"}),jsx("path",{fill:"#000",fillRule:"nonzero",d:"M232.679 225.726l-20.294 7.851a152.535 152.535 0 01-34.484 3.169c-7.026-11.642-18.65-29.75-29-45.665l-14.42-35.18 59.343-17.218 38.855 87.043z",opacity:"0.1"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M247.777 220.841s-31.526 18.65-78.596 14.432l-37.525-91.486 17.984-3.091 62.168-10.677 35.279 89.043.69 1.779z"}),jsx("path",{fill:"#FF4842",fillRule:"nonzero",d:"M247.075 219.074c-7.424.365-16.013.329-24.654-.702-9.351-1.101-18.757-3.367-26.82-7.523-6.742-3.471-12.506-7.247-17.532-11.776-13.074-11.759-21.164-28.579-28.429-58.365l62.168-10.677 35.267 89.043z",opacity:"0.1"}),jsx("path",{fill:"#FFF",fillRule:"nonzero",d:"M270.203 213.959s-23.239 4.55-46.894 1.749c-9.351-1.1-18.757-3.367-26.82-7.522-6.742-3.471-12.503-7.247-17.532-11.777-16.181-14.557-24.725-36.866-33.536-81.918 0 0 38.633 9.325 76.836-11.101-.012.015 12.865 80.373 47.946 110.569z"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M165.405 131.03s31.416-1.776 40.187-8.548l1.331 4.276s-20.758 9.157-41.518 9.268v-4.996zM165.405 152.137s30.417-1.665 53.399-12.766l.777 1.776s-18.237 10.647-54.176 13.433v-2.443zM167.853 160.362s30.418-1.665 53.397-12.766l.777 1.776s-18.237 10.643-54.174 13.433v-2.443zM170.299 168.599s30.417-1.666 53.399-12.766l.774 1.775s-18.237 10.647-54.173 13.433v-2.442zM172.748 176.835s30.417-1.665 53.396-12.766l.777 1.776s-18.237 10.647-54.173 13.433v-2.443zM175.193 185.075s30.417-1.665 53.399-12.766l.774 1.776s-18.237 10.643-54.173 13.433v-2.443z",opacity:"0.3"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M389.069 287.344s-12.641-.762-11.152 8.097c0 0-.299 1.563 1.124 2.275 0 0 .021-.658 1.295-.434.454.077.916.099 1.375.066a2.832 2.832 0 001.677-.694c.468-.409 3.555-1.468 4.936-7.274 0 0 1.023-1.267.981-1.593l-2.132.897s.73 1.54.156 2.816c0 0-.069-2.759-.479-2.691-.083 0-1.109.533-1.109.533s1.253 2.69.299 4.628c0 0 .359-3.304-.699-4.434l-1.495.876s1.465 2.768.472 5.029c0 0 .254-3.465-.789-4.817l-1.361 1.062s1.379 2.729.539 4.604c0 0-.111-4.036-.835-4.341 0 0-1.195 1.049-1.369 1.494 0 0 .942 1.98.356 3.026 0 0-.359-2.691-.652-2.691 0 0-1.196 1.794-1.309 2.99 0 0 .051-1.818 1.022-3.172a3.593 3.593 0 00-1.818.942s.186-1.262 2.111-1.37c0 0 .981-1.351 1.241-1.435 0 0-1.914-.158-3.074.356 0 0 1.023-1.196 3.427-.649l1.342-1.094s-2.52-.347-3.588.036c0 0 1.229-1.052 3.95-.299l1.462-.873s-2.147-.463-3.426-.299c0 0 1.348-.729 3.856.06l1.044-.47s-1.573-.299-2.033-.358c-.461-.06-.488-.174-.488-.174a5.426 5.426 0 012.957.329s2.222-.813 2.186-.954z"}),jsx("ellipse",{cx:"380.363",cy:"298.487",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"8.945",ry:"1.513"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M394.956 258.102s-7.125-.43-6.279 4.565a1.218 1.218 0 00.631 1.283s.015-.371.733-.245c.255.042.515.054.774.036.349-.023.681-.159.945-.389.264-.23 2.003-.828 2.783-4.102 0 0 .577-.714.553-.897l-1.196.511s.41.87.087 1.591c0 0-.039-1.558-.269-1.522-.048 0-.625.299-.625.299s.706 1.495.173 2.61c0 0 .204-1.862-.394-2.502l-.846.496s.825 1.561.266 2.834c0 0 .143-1.955-.446-2.714l-.765.598s.774 1.539.299 2.595c0 0-.063-2.275-.469-2.446a4.75 4.75 0 00-.775.834s.532 1.118.204 1.707c0 0-.204-1.515-.368-1.521 0 0-.67 1.001-.739 1.689a3.671 3.671 0 01.577-1.794 2.007 2.007 0 00-1.025.532s.104-.711 1.196-.771c0 0 .553-.763.699-.81 0 0-1.079-.09-1.734.2 0 0 .577-.67 1.932-.365l.759-.619s-1.423-.194-2.024.021c0 0 .694-.598 2.227-.161l.826-.494a7.445 7.445 0 00-1.935-.164s.763-.413 2.174.033l.598-.263s-.897-.177-1.148-.203c-.252-.027-.275-.099-.275-.099a3.078 3.078 0 011.668.185s1.232-.46 1.208-.538z"}),jsx("ellipse",{cx:"390.052",cy:"264.383",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"5.044",ry:"1"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M352.896 262.437s-8.604-.52-7.588 5.51a1.47 1.47 0 00.763 1.549s0-.449.897-.299c.309.052.623.067.935.045a1.923 1.923 0 001.142-.473c.318-.279 2.419-.998 3.361-4.951 0 0 .697-.861.667-1.085l-1.468.622s.496 1.046.104 1.916c0 0-.048-1.877-.326-1.835-.056 0-.753.364-.753.364s.852 1.824.209 3.152c0 0 .245-2.249-.475-3.02l-1.023.598s.996 1.886.32 3.423c0 0 .174-2.359-.535-3.289l-.927.724s.939 1.857.365 3.133c0 0-.072-2.747-.565-2.954 0 0-.81.715-.933 1.008 0 0 .64 1.348.242 2.06 0 0-.245-1.83-.445-1.839 0 0-.804 1.214-.897 2.042.04-.768.28-1.512.697-2.159a2.427 2.427 0 00-1.235.643s.125-.858 1.435-.933c0 0 .667-.92.846-.974 0 0-1.303-.111-2.093.239 0 0 .694-.807 2.329-.44l.915-.747s-1.713-.233-2.442.024c0 0 .837-.715 2.69-.191l.996-.598s-1.462-.314-2.335-.201c0 0 .921-.496 2.625.042l.711-.32s-1.07-.209-1.384-.242c-.314-.033-.329-.119-.329-.119a3.69 3.69 0 012.012.221s1.519-.553 1.492-.646z"}),jsx("ellipse",{cx:"346.97",cy:"270.022",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"6.09",ry:"1.028"}),jsx("rect",{width:"51.026",height:"91.312",x:"303.926",y:"69.211",fill:"#FFF",fillRule:"nonzero",rx:"4.737",transform:"rotate(-71.99 329.44 114.867)"}),jsx("circle",{cx:"303.613",cy:"103.507",r:"9.376",fill:t,fillRule:"nonzero",opacity:"0.2"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M344.582495 86.4883769L347.150665 86.4883769 347.150665 127.336977 344.582495 127.336977z",opacity:"0.2",transform:"rotate(-71.99 345.867 106.913)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M333.028401 99.6373982L335.596571 99.6373982 335.596571 120.445898 333.028401 120.445898z",opacity:"0.2",transform:"rotate(-71.99 334.312 110.042)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M337.109071 101.431004L339.677241 101.431004 339.677241 135.086304 337.109071 135.086304z",opacity:"0.2",transform:"rotate(-71.99 338.393 118.259)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M338.505494 105.174377L341.073664 105.174377 341.073664 146.022978 338.505494 146.022978z",opacity:"0.2",transform:"rotate(-71.99 339.79 125.599)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M348.060839 134.648161L353.026769 134.648161 353.026769 145.952261 348.060839 145.952261z",opacity:"0.5",transform:"rotate(-71.99 350.544 140.3)"}),jsx("rect",{width:"50.3",height:"78.305",x:"291.549",y:"174.486",fill:"#FFF",fillRule:"nonzero",rx:"4",transform:"rotate(-57.265 316.7 213.638)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M278.038439 203.88874L292.269539 203.88874 292.269539 207.23723 278.038439 207.23723z",transform:"rotate(-57.57 285.154 205.563)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M283.007935 199.201889L314.262535 199.201889 314.262535 202.272339 283.007935 202.272339z",transform:"rotate(-57.57 298.635 200.737)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M288.543935 202.715889L319.798535 202.715889 319.798535 205.786339 288.543935 205.786339z",transform:"rotate(-57.57 304.171 204.251)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M294.078936 206.235889L325.333536 206.235889 325.333536 209.306339 294.078936 209.306339z",transform:"rotate(-57.57 309.706 207.771)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M299.879919 211.40702L331.090719 211.40702 331.090719 214.47316 299.879919 214.47316z",transform:"rotate(-57.265 315.485 212.94)"}),jsx("path",{fill:"#F4F6F8",fillRule:"nonzero",d:"M305.149936 213.268889L336.404536 213.268889 336.404536 216.339339 305.149936 216.339339z",transform:"rotate(-57.57 320.777 214.804)"}),jsx("path",{fill:"#F4F6F8",fillRule:"nonzero",d:"M310.685935 216.782889L341.940535 216.782889 341.940535 219.853339 310.685935 219.853339z",transform:"rotate(-57.57 326.313 218.318)"}),jsx("path",{fill:"#DFE3E8",fillRule:"nonzero",d:"M341.417983 210.406958L349.511163 210.406958 349.511163 218.500138 341.417983 218.500138z",transform:"rotate(-57.57 345.465 214.454)"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M269.277 168.76l-45.767.493a3.127 3.127 0 00-3.094 3.125v3.782a3.127 3.127 0 01-3.05 3.124l-33.024.792a3.124 3.124 0 01-3.095-2.308l-1.551-5.701a3.124 3.124 0 00-3.053-2.308l-44.113.475a3.125 3.125 0 00-3.05 3.648l17.747 104.449a3.129 3.129 0 003.071 2.604l139.363.598a3.129 3.129 0 003.082-3.714l-20.366-106.521a3.125 3.125 0 00-3.1-2.538z"}),jsx("path",{fill:l,fillRule:"nonzero",d:"M269.277 168.76l-45.767.493a3.127 3.127 0 00-3.094 3.125v3.782a3.127 3.127 0 01-3.05 3.124l-33.024.792a3.124 3.124 0 01-3.095-2.308l-1.551-5.701a3.124 3.124 0 00-3.053-2.308l-44.113.475a3.125 3.125 0 00-3.05 3.648l17.747 104.449a3.129 3.129 0 003.071 2.604l139.363.598a3.129 3.129 0 003.082-3.714l-20.366-106.521a3.125 3.125 0 00-3.1-2.538z",opacity:"0.243"}),jsx("path",{fill:"url(#linearGradient-2)",fillRule:"nonzero",d:"M269.277 168.76l-45.767.493a3.127 3.127 0 00-3.094 3.125v3.782a3.127 3.127 0 01-3.05 3.124l-33.024.792a3.124 3.124 0 01-3.095-2.308l-1.551-5.701a3.124 3.124 0 00-3.053-2.308l-44.113.475a3.125 3.125 0 00-3.05 3.648l17.747 104.449a3.129 3.129 0 003.071 2.604l139.363.598a3.129 3.129 0 003.082-3.714l-20.366-106.521a3.125 3.125 0 00-3.1-2.538z",opacity:"0.32"}),jsx("ellipse",{cx:"119.593",cy:"258.664",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"4.846",ry:"1"}),jsx("ellipse",{cx:"101.03",cy:"260.545",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"4.846",ry:"1"}),jsx("ellipse",{cx:"108.459",cy:"265.905",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"3.444",ry:"1"}),jsx("ellipse",{cx:"89.193",cy:"265.433",fill:t,fillRule:"nonzero",opacity:"0.1",rx:"3.444",ry:"1"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M100.925 260.398s6.796-22.279-1.064-31.204c-5.881-6.676-12.557-5.877-15.547-5.052a5.528 5.528 0 00-3.564 2.963c-1.046 2.254-.858 5.913 6.521 10.186 12.35 7.151 13.119 16.96 13.119 16.96l.535 6.147z"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M85.382 227.302s20.031 6.278 15.546 33.096M97.083 229.547s-2.76 1.86-1.88 4.655M87.39 231.203s1.687-1.716 3.741-.768M95.31 239.832s2.963-1.495 3.728.379M102.638 242.962s-2.224-.176-2.263.897"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M101.2 260.575s-7.961-16.193-10.147-15.846c-1.037.17-1.516 1.196-1.734 2.218a6.516 6.516 0 00.434 3.941c1.13 2.601 4.165 7.519 11.447 9.687z"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M91.113 247.808s8.353 12.115 9.968 12.647"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M90.344 249.701L92.293 249.701"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M92.68 254.132L95.738 254.263"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M94.542 250.586L94.21 252.179"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M97.792 255.432L97.732 256.879"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M100.964 260.575s7.959-16.193 10.144-15.846c1.041.17 1.519 1.196 1.734 2.218a6.514 6.514 0 01-.433 3.941c-1.13 2.601-4.168 7.519-11.445 9.687z"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M111.051 247.808s-8.371 12.115-9.97 12.647"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M111.82 249.701L109.871 249.701"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M109.485 254.132L106.426 254.263"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M107.622 250.586L107.954 252.179"}),jsx("path",{stroke:a,strokeLinecap:"round",strokeWidth:"0.5",d:"M104.372 255.432L104.432 256.879"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M87.295 264.357a1.375 1.375 0 01-.452-.685.599.599 0 01.317-.697c.3-.11.598.09.837.299.24.21.512.431.81.38a1.237 1.237 0 01-.382-1.16.47.47 0 01.105-.236c.161-.174.454-.099.648.039.598.43.787 1.264.79 2.018.03-.277.03-.555 0-.831a.853.853 0 01.334-.727.938.938 0 01.476-.114.988.988 0 01.774.222.767.767 0 01-.03.947c-.229.257-.5.474-.801.64a1.805 1.805 0 00-.571.547.399.399 0 00-.042.096h-1.74a4.826 4.826 0 01-1.073-.738zM117.626 257.833a1.355 1.355 0 01-.452-.682.599.599 0 01.314-.696c.299-.111.598.089.837.299.239.209.509.436.817.391a1.236 1.236 0 01-.386-1.157.472.472 0 01.107-.236c.162-.173.455-.099.649.036.613.433.787 1.268.79 2.021a4.008 4.008 0 000-.834.852.852 0 01.299-.736.955.955 0 01.475-.11.998.998 0 01.774.218.768.768 0 01-.033.951 2.996 2.996 0 01-.798.64 1.767 1.767 0 00-.571.544.499.499 0 00-.042.098h-1.701a4.78 4.78 0 01-1.079-.747zM107.518 264.357a1.406 1.406 0 01-.455-.685.6.6 0 01.317-.697c.299-.11.598.09.837.299.239.21.505.437.816.395a1.247 1.247 0 01-.385-1.16.472.472 0 01.107-.236c.162-.174.455-.099.649.039.613.43.783 1.264.789 2.018.03-.277.03-.555 0-.832a.855.855 0 01.314-.735.93.93 0 01.476-.114.988.988 0 01.774.222.764.764 0 01-.033.947 3.028 3.028 0 01-.798.64 1.798 1.798 0 00-.571.547.411.411 0 00-.042.096h-1.734c-.385-.2-.742-.45-1.061-.744z"}),jsx("circle",{cx:"84.467",cy:"87.003",r:"6.467",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("circle",{cx:"395.425",cy:"138.681",r:"6.467",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("circle",{cx:"279.178",cy:"66.467",r:"6.467",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("circle",{cx:"97.4",cy:"122.68",r:"10.838",fill:t,fillRule:"nonzero",opacity:"0.1"}),jsx("path",{fill:l,fillRule:"nonzero",d:"M206.029 209.911c-7.975 0-14.44 6.465-14.44 14.44s6.465 14.44 14.44 14.44 14.44-6.465 14.44-14.44-6.465-14.44-14.44-14.44z"}),jsx("path",{fill:t,fillRule:"nonzero",d:"M206.029 211.59c7.047 0 12.761 5.714 12.761 12.761 0 7.048-5.714 12.761-12.761 12.761-7.048 0-12.761-5.713-12.761-12.761.006-7.045 5.716-12.754 12.761-12.761",opacity:"0.72"}),jsx("path",{fill:l,fillRule:"nonzero",d:"M200.058 225.406l-.699-.681a.721.721 0 010-1.065l6.127-5.984a.753.753 0 01.546-.231c.206 0 .404.083.545.231l6.127 5.978a.733.733 0 010 1.065l-.699.682a.768.768 0 01-1.091 0l-3.622-3.727v8.843a.725.725 0 01-.219.523.76.76 0 01-.534.217h-1.009a.75.75 0 01-.759-.74v-8.832l-3.622 3.726a.768.768 0 01-1.091-.005z"})]})}var Wo=memo(gt);var bt=({header:e,description:o,sx:r,...n})=>jsxs(he,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...n,children:[jsx(Wo,{sx:{width:220}}),jsxs("div",{children:[jsx(eo,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),jsx(eo,{variant:"body2",sx:{color:"text.secondary"},children:o||jsxs(Fragment,{children:["Solte os arquivos aqui ou clique",jsx(eo,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua m\xE1quina"]})})]})]}),me=memo(bt);var Et=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:n,filesDetails:t=[],id:l,disabled:a,error:d,helperText:c,thumbnail:m,dropZoneSxProps:s,uploading:u,tabIndex:h,maxFiles:P,placeholderAlt:A,placeholderProps:v,...U})=>{let{filesPreview:b,isUploadOrLoadingFiles:R,uploadErrorText:F,uploadFiles:I}=V({createFilesMutation:n,filesDetails:t}),{files:y,dropzoneProps:O,handleRemove:g,handleReorder:E}=q({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:b,dropzoneOptions:{multiple:!0,disabled:a,...U},maxFiles:P,uploadFiles:I}),{getRootProps:f,getInputProps:M,isDragActive:N,isDragReject:T}=O,S=!!y?.filter(W=>!!W.id).length,C=T||!!d||!!F;return jsxs(ce,{id:l,uploading:u||R,disabled:a,dropZoneSxProps:s,tabIndex:h,getRootProps:f,getInputProps:M,isDragActive:N,isError:C,dropZoneContent:jsx(Fragment,{children:A?jsx(he,{children:A}):jsx(me,{header:v?.header,description:v?.description})}),children:[jsx(_,{disabled:a,helperText:c,isError:C}),d?jsx(_,{helperText:d,isError:!0}):null,F?jsx(_,{helperText:F,isError:!0}):null,S&&jsx(ze,{sx:{my:3},children:jsx(ye,{files:y,thumbnail:!!m,onRemove:e?g:void 0,onReorder:o?E:void 0})})]})},Rt=memo(Et);var _t=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:n,filesDetails:t=[],id:l,disabled:a,error:d,helperText:c,dropZoneSxProps:m,placeholderProps:s,placeholderAlt:u,uploading:h,tabIndex:P,maxFiles:A,aspectRatio:v,enableCrop:U=!0,convertToWebp:b=!0,cropSize:R,name:F,label:I,...y})=>{let{filesPreview:O,isUploadOrLoadingFiles:g,uploadErrorText:E,uploadFiles:f}=V({createFilesMutation:n,filesDetails:t}),M=h||g,{files:N,dropzoneProps:T,cropState:S,aspectRatio:C,handleRemove:W,handleReorder:J}=q({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:O,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!0,disabled:a,...y},enableCrop:U,customAspectRatio:v,convertToWebp:b,maxFiles:A,cropSize:R,uploadFiles:f}),{getRootProps:re,getInputProps:Z,isDragActive:le,isDragReject:ue}=T,{cropModalOpen:se,imagePreview:pe,cropLoading:H,onCropInitialized:Q,handleCropSave:Y,handleCropCancel:te,currentImageIndex:$,totalPendingImages:p}=S,ge=!!N?.filter(xe=>!!xe.id).length,ie=ue||!!d||!!E,we=useMemo(()=>{let xe=I??"Ajustar Imagem",Ie=p>1||$>1?` (${$} de ${p})`:"";return `${xe}${Ie}`},[I,p,$]);return jsxs(ce,{id:l,name:F,uploading:M,disabled:a,dropZoneSxProps:m,tabIndex:P,getRootProps:re,getInputProps:Z,isDragActive:le,isError:ie,dropZoneContent:jsx(Fragment,{children:u?jsx(he,{children:u}):jsx(me,{header:s?.header,description:s?.description})}),children:[jsx(_,{disabled:a,helperText:c,isError:ie}),d?jsx(_,{helperText:d,isError:!0}):null,E?jsx(_,{helperText:E,isError:!0}):null,ge&&jsx(ze,{sx:{my:3,ml:.5},children:jsx(ye,{files:N,thumbnail:!0,onRemove:W,onReorder:o?J:void 0})}),jsx(a$5,{open:se,onClose:te,label:we,imageSrc:pe,aspectRatio:C,onInitialized:Q,onSave:Y,loading:H,cropSize:R})]})},Lt=memo(_t);var kt=({onFileSelect:e$1,onRemove:o,createFilesMutation:r,fileDetails:n,id:t,disabled:l,error:a,helperText:d,sx:c,dropZoneSxProps:m$1,uploading:s,tabIndex:u,placeholderAlt:h,placeholderProps:P,...A})=>{let{filesPreview:v,isUploadOrLoadingFiles:U,uploadErrorText:b,uploadFiles:R}=V({createFilesMutation:r,filesDetails:n?[n]:[]}),F=U||s,{file:I,dropzoneProps:y,handleRemove:O}=q({uploadFiles:R,onFileSelect:e$1,onRemove:o,filesPreview:v,dropzoneOptions:{multiple:!1,disabled:l,...A}}),{getRootProps:g,getInputProps:E,isDragActive:f,isDragReject:M}=y,N=useCallback(W=>{W.stopPropagation(),O(I||void 0);},[I,O]),T=!!I,S=typeof I=="string",C=M||!!a||!!b;return jsxs(ce,{id:t,uploading:F,disabled:l,dropZoneSxProps:m$1,tabIndex:u,getRootProps:g,getInputProps:E,isDragActive:f,isError:C,dropZoneContent:jsxs(Fragment,{children:[!T&&(h?jsx(he,{...P,children:h}):jsx(me,{})),T&&jsxs(he,{component:m.div,...j().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:W=>`solid 1px ${W.palette.divider}`,...c},children:[jsx(Ee,{file:I}),jsxs(he,{flexGrow:1,sx:{minWidth:0},children:[jsx(eo,{variant:"subtitle2",noWrap:!0,children:S?I:I.name}),jsx(eo,{variant:"caption",sx:{color:"text.secondary"},children:S?"":e(I.size)})]}),o&&jsx(a$3,{title:"Remover arquivo",children:jsx(so,{edge:"end",size:"small",disabled:l,"aria-label":"Remover arquivo",onClick:N,children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})})})]})]}),children:[jsx(_,{disabled:l,helperText:d,isError:C}),a?jsx(_,{helperText:a,isError:!0}):null,b?jsx(_,{helperText:b,isError:!0}):null]})},Nt=memo(kt);var $t=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:n,id:t,disabled:l,error:a,helperText:d,dropZoneSxProps:c,placeholderProps:m,placeholderAlt:s,hoverAlt:u,uploading:h,tabIndex:P,aspectRatio:A,enableCrop:v=!0,convertToWebp:U=!0,name:b,label:R,cropSize:F,sx:I,maxWidth:y,maxHeight:O,compressionQuality:g=.8,maxCompressedWidth:E,maxCompressedHeight:f,fill:M,...N})=>{let{filesPreview:T,isUploadOrLoadingFiles:S,uploadErrorText:C,uploadFiles:W}=V({createFilesMutation:r,filesDetails:n?[n]:[]}),[J,re]=useState(!1),{file:Z,dropzoneProps:le,cropState:ue,handleRemove:se,aspectRatio:pe}=q({onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:l,...N},filesPreview:T,enableCrop:v,customAspectRatio:A,convertToWebp:U,cropSize:F,uploadFiles:W,compressionQuality:g,maxCompressedWidth:E,maxCompressedHeight:f}),{getRootProps:H,getInputProps:Q,isDragActive:Y,isDragReject:te}=le,{cropModalOpen:$,imagePreview:p,cropLoading:ge,onCropInitialized:ie,handleCropSave:we,handleCropCancel:xe}=ue,Ie=useCallback(()=>{se(Z||void 0);},[Z,se]),x=!!Z,w=te||!!a||!!C,z=h||S,D=x?{opacity:0}:{opacity:1},k=c?.width;return useEffect(()=>{x||re(!1);},[x]),jsxs(Ce,{sx:{...I,...k&&{width:k}},children:[(z||J)&&jsx(a$6,{}),jsxs(ce,{id:t,uploading:z,disabled:l,dropZoneSxProps:c,tabIndex:P,getRootProps:H,getInputProps:Q,isDragActive:Y,isError:w,name:b,dropZoneContent:jsxs(Fragment,{children:[s?jsx(he,{sx:D,children:s}):jsx(me,{sx:D,header:m?.title,description:m?.description}),x&&jsx(Ke,{file:Z,cropSize:F,isLoading:J,isUploading:z,onLoading:re,aspectRatio:pe,maxWidth:y,maxHeight:O,hoverAlt:u,fill:M})]}),children:[jsx(_,{disabled:l,helperText:d,isError:w}),a?jsx(_,{helperText:a,isError:!0}):null,C?jsx(_,{helperText:C,isError:!0}):null,x&&e&&jsx(mo,{size:"small",onClick:Ie,disabled:l,label:"Remover arquivo",children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})}),jsx(a$5,{open:$,onClose:xe,label:R??"Ajustar Imagem",imageSrc:p,aspectRatio:pe,onInitialized:ie,onSave:we,loading:ge,cropSize:F})]})]})},Xt=memo($t);var ei=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:n,disabled:t,label:l,id:a,tabIndex:d,error:c,helperText:m,sx:s,name:u,maxSize:h,uploading:P,aspectRatio:A=1,enableCrop:v=!0,convertToWebp:U=!0,cropSize:b,...R})=>{let[F,I]=useState(!1),{filesPreview:y,isUploadOrLoadingFiles:O,uploadErrorText:g,uploadFiles:E}=V({createFilesMutation:r,filesDetails:n?[n]:[]}),{file:f,dropzoneProps:M,cropState:N,handleRemove:T}=q({filesPreview:y,onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:t,maxSize:h,...R},enableCrop:v,customAspectRatio:A,convertToWebp:U,cropSize:b,uploadFiles:E}),{getRootProps:S,getInputProps:C,isDragActive:W,isDragReject:J}=M,{cropModalOpen:re,imagePreview:Z,cropLoading:le,onCropInitialized:ue,handleCropSave:se,handleCropCancel:pe}=N,H=J||!!c||!!g,Q=F||O||P,Y=!!e,te=useRef(n?.url||""),$=useRef(void 0);useEffect(()=>{if(!f){te.current="",$.current=void 0;return}if($.current===f.id)return;$.current=f.id,I(!0);let ie=URL.createObjectURL(f);return te.current=ie,()=>{URL.revokeObjectURL(ie);}},[f]);let p=()=>{I(!1);},ge=useCallback(()=>Y&&f?()=>T(f):S().onClick,[Y,f,S,T]);return jsxs(Fragment,{children:[jsxs(he,{sx:{alignItems:"center"},children:[jsxs(Po,{sx:s,isError:H,isDragActive:W,hasFile:!!f,...S(),onClick:ge(),children:[jsxs(bo,{children:[Q&&jsx(Io,{children:jsx(Yt,{size:135,thickness:2,color:"primary"})}),f&&jsx(vo,{alt:"Avatar Preview",src:te.current,onLoad:p,...Q&&{sx:{filter:"blur(5px) !important",scale:1.2,opacity:.7}}}),!f&&!Q&&jsxs(qe,{isError:H,hasFile:!1,children:[jsx(a$4,{icon:"ADD_IMAGE",width:32}),jsx(eo,{variant:"caption",textAlign:"center",sx:{color:H?"error.main":"text.disabled"},children:"Adicionar foto"})]}),f&&!Q&&jsxs(qe,{isError:H,hasFile:!0,children:[jsx(a$4,{icon:Y?"DELETE_MARK_BUTTON_02":"ADD_IMAGE",width:32}),jsx(eo,{variant:"caption",textAlign:"center",sx:{color:H?"error.main":"common.white"},children:Y?"Remover foto":"Alterar foto"})]})]}),jsx("input",{name:u,id:a,tabIndex:d,...C()})]}),jsx(he,{sx:{alignItems:"center",mt:-.5},children:jsx(_,{helperText:m,disabled:t,isError:H})}),g?jsx(_,{helperText:g,isError:!0}):null,c?jsx(_,{helperText:c,isError:!0}):null]}),re&&Z&&jsx(a$5,{open:re,onClose:pe,label:l??"Ajustar Imagem",imageSrc:Z,aspectRatio:A,onInitialized:ue,onSave:se,loading:le,cropSize:b,cropShape:"round"})]})},oi=memo(ei);var ai=({error:e,name:o,disabled:r,sx:n,...t})=>{let{getRootProps:l,getInputProps:a,isDragActive:d,isDragReject:c}=useDropzone({disabled:r,...t}),m=c||e;return jsxs(fo,{...l(),isDragActive:d,hasError:!!m,disabled:!!r,sx:n,"data-testid":"upload-box",children:[jsx("input",{name:o,...a()}),"Selecionar arquivo"]})},ni=memo(ai);
32
32
 
33
33
  export { _ as a, ye as b, Ke as c, Je as d, _o as e, Do as f, ma as g, Be as h, Ee as i, Ea as j, Lo as k, So as l, To as m, Oo as n, q as o, Qe as p, We as q, V as r, Rt as s, Lt as t, Nt as u, Xt as v, oi as w, ni as x };
34
34
  //# sourceMappingURL=out.js.map
35
- //# sourceMappingURL=chunk-YDLDZVF5.js.map
35
+ //# sourceMappingURL=chunk-QXRGT442.js.map