@zydon/common 2.8.85 → 2.8.86

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 (44) hide show
  1. package/dist/{chunk-NMGWHSNZ.js → chunk-7ZCLS5N5.js} +2 -2
  2. package/dist/chunk-A7QSCOUE.js +8 -0
  3. package/dist/chunk-A7QSCOUE.js.map +1 -0
  4. package/dist/{chunk-Z275MVEP.js → chunk-E4Q7LX5L.js} +2 -2
  5. package/dist/{chunk-JM3SE72J.js → chunk-ENNGRPXU.js} +2 -2
  6. package/dist/{chunk-7IG7ZHY7.js → chunk-J3T26XV2.js} +2 -2
  7. package/dist/components/Analytics/OverviewAnalytics/index.js +5 -5
  8. package/dist/components/Analytics/PartnerAnalysis/index.js +5 -5
  9. package/dist/components/Analytics/index.js +1 -1
  10. package/dist/components/AvatarButton/index.js +3 -3
  11. package/dist/components/BulkEditModal/index.js +1 -1
  12. package/dist/components/Common/index.js +3 -3
  13. package/dist/components/DataCards/index.js +2 -2
  14. package/dist/components/DataGrid/index.js +2 -2
  15. package/dist/components/DataView/index.d.ts +1 -1
  16. package/dist/components/DataView/index.js +4 -4
  17. package/dist/components/DynamicDataView/index.js +6 -6
  18. package/dist/components/FileUpload/index.js +2 -2
  19. package/dist/components/SavedChanges/index.js +1 -1
  20. package/dist/components/ToggleTheme/index.js +3 -3
  21. package/dist/components/form/Address/index.js +1 -1
  22. package/dist/components/form/FileUpload/index.js +2 -2
  23. package/dist/hooks/useInfiniteScroll.d.ts +33 -0
  24. package/dist/hooks/useInfiniteScroll.js +6 -0
  25. package/dist/hooks/useInfiniteScroll.js.map +1 -0
  26. package/dist/hooks/useThemeToggle.js +3 -3
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +3 -3
  29. package/dist/theme/core/index.d.ts +1 -1
  30. package/dist/theme/styles/index.d.ts +12 -12
  31. package/dist/theme/theme-provider.js +3 -3
  32. package/dist/types/pagination.d.ts +11 -0
  33. package/dist/types/pagination.js +2 -0
  34. package/dist/types/pagination.js.map +1 -0
  35. package/dist/utils/formatTime.d.ts +2 -1
  36. package/dist/utils/formatTime.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-N7IK5EUP.js +0 -8
  39. package/dist/chunk-N7IK5EUP.js.map +0 -1
  40. package/dist/{chunk-NMGWHSNZ.js.map → chunk-7ZCLS5N5.js.map} +0 -0
  41. package/dist/{chunk-Z275MVEP.js.map → chunk-E4Q7LX5L.js.map} +0 -0
  42. package/dist/{chunk-JM3SE72J.js.map → chunk-ENNGRPXU.js.map} +0 -0
  43. package/dist/{chunk-7IG7ZHY7.js.map → chunk-J3T26XV2.js.map} +0 -0
  44. package/dist/{index-c8f1e6e7.d.ts → index-5a5e5dc8.d.ts} +12 -12
@@ -1,5 +1,5 @@
1
- import { a } from './chunk-6U5LS7MP.js';
2
1
  import { a as a$1 } from './chunk-LZQ7OFKO.js';
2
+ import { a } from './chunk-6U5LS7MP.js';
3
3
  import { a as a$2 } from './chunk-RBTYTONM.js';
4
4
  import { useState } from 'react';
5
5
  import { GRID_CHECKBOX_SELECTION_COL_DEF, DataGridPremium, GridToolbarContainer, GridToolbarColumnsButton, GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExport } from '@mui/x-data-grid-premium';
@@ -9,4 +9,4 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
9
9
  var H=({showToolbar:i,disableExport:r,setFilterButtonEl:l,toolbarContent:n})=>{if(i)return jsxs(GridToolbarContainer,{children:[jsx(GridToolbarColumnsButton,{slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarFilterButton,{ref:l,slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarDensitySelector,{slotProps:{button:{color:"inherit"}}}),!r&&jsx(GridToolbarExport,{slotProps:{button:{color:"inherit"}}}),jsx(x,{sx:{flexGrow:1}}),n]})},m=H;var _=({columns:i,rows:r=[],loading:l,fetching:n,hideFooter:p,sx:u,showToolbar:d,disableExport:b,columnHeaderHeight:f=56,rowHeight:h=76,rowSpacingType:C="margin",getRowSpacing:G=()=>({top:0,bottom:0}),autoHeight:c=!1,toolbarContent:P,slots:g,...T})=>{let[E,S]=useState(null),w=[{...GRID_CHECKBOX_SELECTION_COL_DEF,width:71},...i];return jsxs(Fragment,{children:[n&&jsx(a,{sx:{zIndex:1}}),jsx(DataGridPremium,{columns:w,rows:r,loading:l,autoHeight:c,hideFooter:r.length===0?!0:p,rowHeight:h,columnHeaderHeight:f,getRowSpacing:G,rowSpacingType:C,slots:{toolbar:m,noRowsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),noResultsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),loadingOverlay:a$2,...g},slotProps:{panel:{anchorEl:E},toolbar:{setFilterButtonEl:S,showQuickFilter:!0,disableExport:b,showToolbar:d,toolbarContent:P}},sx:u,...T})]})},Z=_;
10
10
 
11
11
  export { Z as a };
12
- //# sourceMappingURL=chunk-NMGWHSNZ.js.map
12
+ //# sourceMappingURL=chunk-7ZCLS5N5.js.map
@@ -0,0 +1,8 @@
1
+ import t from 'dayjs';
2
+ import p from 'dayjs/plugin/duration';
3
+ import D from 'dayjs/plugin/relativeTime';
4
+
5
+ t.extend(p);t.extend(D);var c={dateTime:"DD/MM/YYYY HH:mm",date:"DD/MM/YYYY",time:"HH:mm",split:{dateTime:"DD/MM/YYYY HH:mm",date:"DD/MM/YYYY"},paramCase:{dateTime:"DD/MM/YYYY HH:mm",date:"DD/MM/YYYY"}};function x(r){return t(new Date).startOf("day").format(r)}function P(r,i){return r?t(r).isValid()?t(r).format(i??c.dateTime):"Invalid time value":null}function f(r,i){return r?t(r).isValid()?t(r).format(i??c.date):"Invalid time value":null}function M(r,i){return r?t(r).isValid()?t(r).format(i??c.time):"Invalid time value":null}function m(r){return r?t(r).isValid()?t(r).valueOf():"Invalid time value":null}function k(r){return r?t(r).isValid()?t(r).toNow(!0):"Invalid time value":null}function F(r){if(!r)return null;let i=t(r);if(!i.isValid())return "Invalid time value";let e=t(),n=i.startOf("day").diff(e.startOf("day"),"day");if(n<0)return "vencido";if(n===0)return "hoje";if(n<7)return n===1?"1 dia":`${n} dias`;let a=i.diff(e,"year");if(a>=1)return a===1?"1 ano":`${a} anos`;let o=i.diff(e,"month");if(o>=1)return o===1?"1 m\xEAs":`${o} meses`;let s=Math.floor(n/7);return s===1?"1 semana":`${s} semanas`}function b(r,i,e){if(!r||!i||!e)return !1;let n=m(r),a=m(i),o=m(e);return n&&a&&o?n>=a&&n<=o:!1}function Y(r,i){return t(r).isAfter(i)}function l(r,i,e){return !r||!i?!1:t(r).isValid()&&t(i).isValid()?t(r).isSame(i,e??"year"):"Invalid time value"}function I(r,i,e){let n=t(r).isValid()&&t(i).isValid(),a=Y(r,i);if(!n||a)return "Invalid time value";let o=`${f(r)} - ${f(i)}`;if(e)return o;let s=l(r,i,"year"),u=l(r,i,"month"),d=l(r,i,"day");return s&&!u?o=`${f(r,"DD MMM")} - ${f(i)}`:s&&u&&!d?o=`${f(r,"DD")} - ${f(i)}`:s&&u&&d&&(o=`${f(i)}`),o}function T({years:r=0,months:i=0,days:e=0,hours:n=0,minutes:a=0,seconds:o=0,milliseconds:s=0}){return t().add(t.duration({years:r,months:i,days:e,hours:n,minutes:a,seconds:o,milliseconds:s})).format()}function $({years:r=0,months:i=0,days:e=0,hours:n=0,minutes:a=0,seconds:o=0,milliseconds:s=0}){return t().subtract(t.duration({years:r,months:i,days:e,hours:n,minutes:a,seconds:o,milliseconds:s})).format()}var h=(r,i)=>!r||!i?null:t(i).diff(t(r),"day");
6
+
7
+ export { c as a, x as b, P as c, f as d, M as e, m as f, k as g, F as h, b as i, Y as j, l as k, I as l, T as m, $ as n, h as o };
8
+ //# sourceMappingURL=chunk-A7QSCOUE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/formatTime.ts"],"names":["dayjs","duration","relativeTime","formatStr","today","format","fDateTime","date","fDate","fTime","fTimestamp","fToNow","fTimeLeft","target","now","diffDays","diffYears","diffMonths","diffWeeks","fIsBetween","inputDate","startDate","endDate","formattedInputDate","formattedStartDate","formattedEndDate","fIsAfter","fIsSame","units","fDateRangeShortLabel","initial","isValid","isAfter","label","isSameYear","isSameMonth","isSameDay","fAdd","years","months","days","hours","minutes","seconds","milliseconds","fSub","getDifferenceInDays"],"mappings":"AACA,OAAOA,MAAW,QAClB,OAAOC,MAAc,wBACrB,OAAOC,MAAkB,4BAIzBF,EAAM,OAAOC,CAAQ,EACrBD,EAAM,OAAOE,CAAY,EAYlB,IAAMC,EAAY,CACvB,SAAU,mBACV,KAAM,aACN,KAAM,QACN,MAAO,CACL,SAAU,mBACV,KAAM,YACR,EACA,UAAW,CACT,SAAU,mBACV,KAAM,YACR,CACF,EAEO,SAASC,EAAMC,EAAiB,CACrC,OAAOL,EAAM,IAAI,IAAM,EAAE,QAAQ,KAAK,EAAE,OAAOK,CAAM,CACvD,CAEO,SAASC,EAAUC,EAAwBF,EAAiB,CACjE,OAAKE,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAGhCP,EAAMO,CAAI,EAAE,OAAOF,GAAUF,EAAU,QAAQ,EAC/C,qBAPK,IAQX,CAEO,SAASK,EAAMD,EAAwBF,EAAiB,CAC7D,OAAKE,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAGhCP,EAAMO,CAAI,EAAE,OAAOF,GAAUF,EAAU,IAAI,EAC3C,qBAPK,IAQX,CAEO,SAASM,EAAMF,EAAwBF,EAAiB,CAC7D,OAAKE,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAGhCP,EAAMO,CAAI,EAAE,OAAOF,GAAUF,EAAU,IAAI,EAC3C,qBAPK,IAQX,CAEO,SAASO,EAAWH,EAAwB,CACjD,OAAKA,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAEnBP,EAAMO,CAAI,EAAE,QAAQ,EAAI,qBALhC,IAMX,CAEO,SAASI,EAAOJ,EAAwB,CAC7C,OAAKA,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAEnBP,EAAMO,CAAI,EAAE,MAAM,EAAI,EAAI,qBALlC,IAMX,CAEO,SAASK,EAAUL,EAAwB,CAChD,GAAI,CAACA,EACH,OAAO,KAGT,IAAMM,EAASb,EAAMO,CAAI,EAEzB,GAAI,CAACM,EAAO,QAAQ,EAClB,MAAO,qBAGT,IAAMC,EAAMd,EAAM,EACZe,EAAWF,EAAO,QAAQ,KAAK,EAAE,KAAKC,EAAI,QAAQ,KAAK,EAAG,KAAK,EAErE,GAAIC,EAAW,EAAG,MAAO,UACzB,GAAIA,IAAa,EAAG,MAAO,OAC3B,GAAIA,EAAW,EAAG,OAAOA,IAAa,EAAI,QAAU,GAAGA,SAEvD,IAAMC,EAAYH,EAAO,KAAKC,EAAK,MAAM,EAEzC,GAAIE,GAAa,EACf,OAAOA,IAAc,EAAI,QAAU,GAAGA,SAGxC,IAAMC,EAAaJ,EAAO,KAAKC,EAAK,OAAO,EAE3C,GAAIG,GAAc,EAChB,OAAOA,IAAe,EAAI,WAAU,GAAGA,UAGzC,IAAMC,EAAY,KAAK,MAAMH,EAAW,CAAC,EAEzC,OAAOG,IAAc,EAAI,WAAa,GAAGA,WAC3C,CAEO,SAASC,EACdC,EACAC,EACAC,EACA,CACA,GAAI,CAACF,GAAa,CAACC,GAAa,CAACC,EAC/B,MAAO,GAGT,IAAMC,EAAqBb,EAAWU,CAAS,EACzCI,EAAqBd,EAAWW,CAAS,EACzCI,EAAmBf,EAAWY,CAAO,EAE3C,OAAIC,GAAsBC,GAAsBC,EAE5CF,GAAsBC,GACtBD,GAAsBE,EAInB,EACT,CAEO,SAASC,EACdL,EACAC,EACA,CACA,OAAOtB,EAAMqB,CAAS,EAAE,QAAQC,CAAO,CACzC,CAEO,SAASK,EACdN,EACAC,EACAM,EACA,CACA,MAAI,CAACP,GAAa,CAACC,EACV,GAGOtB,EAAMqB,CAAS,EAAE,QAAQ,GAAKrB,EAAMsB,CAAO,EAAE,QAAQ,EAM9DtB,EAAMqB,CAAS,EAAE,OAAOC,EAASM,GAAS,MAAM,EAH9C,oBAIX,CAEO,SAASC,EACdR,EACAC,EACAQ,EACA,CACA,IAAMC,EAAU/B,EAAMqB,CAAS,EAAE,QAAQ,GAAKrB,EAAMsB,CAAO,EAAE,QAAQ,EAE/DU,EAAUN,EAASL,EAAWC,CAAO,EAE3C,GAAI,CAACS,GAAWC,EACd,MAAO,qBAGT,IAAIC,EAAQ,GAAGzB,EAAMa,CAAS,OAAOb,EAAMc,CAAO,IAElD,GAAIQ,EACF,OAAOG,EAGT,IAAMC,EAAaP,EAAQN,EAAWC,EAAS,MAAM,EAC/Ca,EAAcR,EAAQN,EAAWC,EAAS,OAAO,EACjDc,EAAYT,EAAQN,EAAWC,EAAS,KAAK,EAEnD,OAAIY,GAAc,CAACC,EACjBF,EAAQ,GAAGzB,EAAMa,EAAW,QAAQ,OAAOb,EAAMc,CAAO,IAC/CY,GAAcC,GAAe,CAACC,EACvCH,EAAQ,GAAGzB,EAAMa,EAAW,IAAI,OAAOb,EAAMc,CAAO,IAC3CY,GAAcC,GAAeC,IACtCH,EAAQ,GAAGzB,EAAMc,CAAO,KAGnBW,CACT,CAYO,SAASI,EAAK,CACnB,MAAAC,EAAQ,EACR,OAAAC,EAAS,EACT,KAAAC,EAAO,EACP,MAAAC,EAAQ,EACR,QAAAC,EAAU,EACV,QAAAC,EAAU,EACV,aAAAC,EAAe,CACjB,EAAkB,CAehB,OAde5C,EAAM,EAClB,IACCA,EAAM,SAAS,CACb,MAAAsC,EACA,OAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,QAAAC,EACA,aAAAC,CACF,CAAC,CACH,EACC,OAAO,CAGZ,CAEO,SAASC,EAAK,CACnB,MAAAP,EAAQ,EACR,OAAAC,EAAS,EACT,KAAAC,EAAO,EACP,MAAAC,EAAQ,EACR,QAAAC,EAAU,EACV,QAAAC,EAAU,EACV,aAAAC,EAAe,CACjB,EAAkB,CAehB,OAde5C,EAAM,EAClB,SACCA,EAAM,SAAS,CACb,MAAAsC,EACA,OAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,QAAAC,EACA,aAAAC,CACF,CAAC,CACH,EACC,OAAO,CAGZ,CAEO,IAAME,EAAsB,CAACzB,EAAkBC,IAChD,CAACD,GAAa,CAACC,EAAgB,KAE5BtB,EAAMsB,CAAO,EAAE,KAAKtB,EAAMqB,CAAS,EAAG,KAAK","sourcesContent":["import type { Dayjs, OpUnitType } from 'dayjs';\nimport dayjs from 'dayjs';\nimport duration from 'dayjs/plugin/duration';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\n// ----------------------------------------------------------------------\n\ndayjs.extend(duration);\ndayjs.extend(relativeTime);\n\n// ----------------------------------------------------------------------\n\nexport type DatePickerFormat =\n | Dayjs\n | Date\n | string\n | number\n | null\n | undefined;\n\nexport const formatStr = {\n dateTime: 'DD/MM/YYYY HH:mm',\n date: 'DD/MM/YYYY',\n time: 'HH:mm',\n split: {\n dateTime: 'DD/MM/YYYY HH:mm',\n date: 'DD/MM/YYYY',\n },\n paramCase: {\n dateTime: 'DD/MM/YYYY HH:mm',\n date: 'DD/MM/YYYY',\n },\n};\n\nexport function today(format?: string) {\n return dayjs(new Date()).startOf('day').format(format);\n}\n\nexport function fDateTime(date: DatePickerFormat, format?: string) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid\n ? dayjs(date).format(format ?? formatStr.dateTime)\n : 'Invalid time value';\n}\n\nexport function fDate(date: DatePickerFormat, format?: string) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid\n ? dayjs(date).format(format ?? formatStr.date)\n : 'Invalid time value';\n}\n\nexport function fTime(date: DatePickerFormat, format?: string) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid\n ? dayjs(date).format(format ?? formatStr.time)\n : 'Invalid time value';\n}\n\nexport function fTimestamp(date: DatePickerFormat) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid ? dayjs(date).valueOf() : 'Invalid time value';\n}\n\nexport function fToNow(date: DatePickerFormat) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid ? dayjs(date).toNow(true) : 'Invalid time value';\n}\n\nexport function fTimeLeft(date: DatePickerFormat) {\n if (!date) {\n return null;\n }\n\n const target = dayjs(date);\n\n if (!target.isValid()) {\n return 'Invalid time value';\n }\n\n const now = dayjs();\n const diffDays = target.startOf('day').diff(now.startOf('day'), 'day');\n\n if (diffDays < 0) return 'vencido';\n if (diffDays === 0) return 'hoje';\n if (diffDays < 7) return diffDays === 1 ? '1 dia' : `${diffDays} dias`;\n\n const diffYears = target.diff(now, 'year');\n\n if (diffYears >= 1) {\n return diffYears === 1 ? '1 ano' : `${diffYears} anos`;\n }\n\n const diffMonths = target.diff(now, 'month');\n\n if (diffMonths >= 1) {\n return diffMonths === 1 ? '1 mês' : `${diffMonths} meses`;\n }\n\n const diffWeeks = Math.floor(diffDays / 7);\n\n return diffWeeks === 1 ? '1 semana' : `${diffWeeks} semanas`;\n}\n\nexport function fIsBetween(\n inputDate: DatePickerFormat,\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n) {\n if (!inputDate || !startDate || !endDate) {\n return false;\n }\n\n const formattedInputDate = fTimestamp(inputDate);\n const formattedStartDate = fTimestamp(startDate);\n const formattedEndDate = fTimestamp(endDate);\n\n if (formattedInputDate && formattedStartDate && formattedEndDate) {\n return (\n formattedInputDate >= formattedStartDate &&\n formattedInputDate <= formattedEndDate\n );\n }\n\n return false;\n}\n\nexport function fIsAfter(\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n) {\n return dayjs(startDate).isAfter(endDate);\n}\n\nexport function fIsSame(\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n units?: OpUnitType,\n) {\n if (!startDate || !endDate) {\n return false;\n }\n\n const isValid = dayjs(startDate).isValid() && dayjs(endDate).isValid();\n\n if (!isValid) {\n return 'Invalid time value';\n }\n\n return dayjs(startDate).isSame(endDate, units ?? 'year');\n}\n\nexport function fDateRangeShortLabel(\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n initial?: boolean,\n) {\n const isValid = dayjs(startDate).isValid() && dayjs(endDate).isValid();\n\n const isAfter = fIsAfter(startDate, endDate);\n\n if (!isValid || isAfter) {\n return 'Invalid time value';\n }\n\n let label = `${fDate(startDate)} - ${fDate(endDate)}`;\n\n if (initial) {\n return label;\n }\n\n const isSameYear = fIsSame(startDate, endDate, 'year');\n const isSameMonth = fIsSame(startDate, endDate, 'month');\n const isSameDay = fIsSame(startDate, endDate, 'day');\n\n if (isSameYear && !isSameMonth) {\n label = `${fDate(startDate, 'DD MMM')} - ${fDate(endDate)}`;\n } else if (isSameYear && isSameMonth && !isSameDay) {\n label = `${fDate(startDate, 'DD')} - ${fDate(endDate)}`;\n } else if (isSameYear && isSameMonth && isSameDay) {\n label = `${fDate(endDate)}`;\n }\n\n return label;\n}\n\nexport type DurationProps = {\n years?: number;\n months?: number;\n days?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n};\n\nexport function fAdd({\n years = 0,\n months = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n}: DurationProps) {\n const result = dayjs()\n .add(\n dayjs.duration({\n years,\n months,\n days,\n hours,\n minutes,\n seconds,\n milliseconds,\n }),\n )\n .format();\n\n return result;\n}\n\nexport function fSub({\n years = 0,\n months = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n}: DurationProps) {\n const result = dayjs()\n .subtract(\n dayjs.duration({\n years,\n months,\n days,\n hours,\n minutes,\n seconds,\n milliseconds,\n }),\n )\n .format();\n\n return result;\n}\n\nexport const getDifferenceInDays = (startDate?: Date, endDate?: Date) => {\n if (!startDate || !endDate) return null;\n\n return dayjs(endDate).diff(dayjs(startDate), 'day');\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import { a as a$9 } from './chunk-R2BCPHRH.js';
2
2
  import { a as a$6 } from './chunk-4F2NKGF6.js';
3
- import { a as a$3 } from './chunk-NMGWHSNZ.js';
3
+ import { a as a$3 } from './chunk-7ZCLS5N5.js';
4
4
  import { a as a$7 } from './chunk-6U5LS7MP.js';
5
5
  import { a as a$5 } from './chunk-PRWQQJDL.js';
6
6
  import { i, r, k, n, l, a as a$2, p, j, m, b as b$1, c, d, q, h, f, e, o, g } from './chunk-XUDTPZHF.js';
@@ -24,4 +24,4 @@ import { GridToolbarColumnsButton } from '@mui/x-data-grid-premium';
24
24
  var Fo=(o,e)=>typeof o=="function"?o(e):!!o,Ae=(o,e)=>{if(o)return o===!0?{}:typeof o=="function"?o(e):o},ke=({actions:o,context:e})=>{let[t,r]=useState(null),[a$1,i]=useState(null),l=useMemo(()=>o.filter(n=>!Fo(n.hidden,e)),[o,e]),s=useCallback(async n=>{i(n.actionId);try{await n.handler(e);}finally{i(null);}},[e]),d=useCallback(n=>{if(n.confirmation){r(n);return}s(n).catch(()=>{});},[s]),m$1=useCallback(async()=>{t&&(await s(t),r(null));},[t,s]),f=useCallback(()=>{a$1||r(null);},[a$1]),c=Ae(t?.confirmation,e);return jsxs(Fragment,{children:[jsx(m,{children:l.map(n=>{let h=!!a$1||Fo(n.disabled,e),k=a$1===n.actionId;return jsx(Ce,{size:"small",variant:"text",onClick:()=>d(n),loading:k,disabled:h,sx:{color:"text.primary"},startIcon:typeof n.icon=="string"?jsx(a,{icon:n.icon}):n.icon,children:n.label},n.actionId)})}),t&&jsx(a$5,{open:!0,onClose:f,onConfirm:()=>{m$1().catch(()=>{});},confirming:a$1===t.actionId,modalTitle:c?.title??`${t.action??"Excluir"} ${e.selectedCount} ${t.entityName??"registro"}${e.selectedCount!==1?"s":""}?`,message:c?.message??"Esta a\xE7\xE3o n\xE3o poder\xE1 ser desfeita.",cancelButtonText:c?.cancelButtonText??"Cancelar",confirmButtonText:c?.confirmButtonText??"Sim, excluir"})]})},zo=ke;var Re=({title:o,breakpoint:e,actions:t,showActions:r,showAdd:a$1,showHeaderMoreActions:i,showActionsContainer:l,onAdd:s,onOpenMoreActions:d$1})=>jsxs(b$1,{breakpoint:e,children:[jsx(Xo,{variant:"overline",color:"text.secondary",noWrap:!0,children:o}),l&&jsxs(c,{breakpoint:e,children:[r&&t,a$1&&jsxs(Fragment,{children:[r&&jsx(d,{orientation:"vertical",flexItem:!0}),jsx(_o,{startIcon:jsx(a,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:s,children:"Adicionar"})]}),i&&jsxs(Fragment,{children:[(r||a$1)&&jsx(d,{orientation:"vertical",flexItem:!0}),jsx(_o,{color:"inherit",startIcon:jsx(a,{icon:"MORE_BOLD"}),size:"small",onClick:d$1,children:"Mais"})]})]})]}),$o=Re;var De=({fetching:o,loading:e,rows:t,mobileSlots:r$1,mobileSlotsProps:a,slots:i,scrollableNodeRef:l,mobileRender:s,hideFooter:d,onPaginationChange:m,rowCount:f,paginationModel:c})=>jsxs(a$6,{isFetching:o,fetching:jsx(a$7,{}),isLoading:e,loading:jsx(q,{}),isEmpty:t.length===0,empty:jsxs(to,{flex:1,direction:"column",...a,children:[r$1&&r$1,jsx(to,{flex:1,alignItems:"center",justifyContent:"center",children:i?.noRowsOverlay?jsx(i.noRowsOverlay,{}):jsx(Xo,{variant:"body2",color:"text.secondary",children:"Nenhum registro encontrado"})})]}),children:[jsxs(to,{direction:"column",flex:1,minHeight:0,...a,children:[r$1&&r$1,jsx(a$8,{fillContent:!0,ref:l,children:t.map(n=>jsx(Fragment$1,{children:s(n)},n.id))})]}),!d&&m&&jsx(h,{children:jsx(r,{count:f,page:c.page,rowsPerPage:c.pageSize,onPageChange:n=>m?.(n,c.pageSize),onRowsPerPageChange:n=>m?.(0,n)})})]}),qo=De;var z="datagrid-actions";var Ko=(o,e)=>Children.map(o,t=>{if(!isValidElement(t))return t;let r=t.props.onClick,a={};a.onClick=(...l)=>{e(),r&&r(...l);};let i=t.props;return i?.children&&(a.children=Ko(i.children,e)),cloneElement(t,a)}),ve=({children:o,onClose:e})=>o?Ko(o,e):null,ro=memo(ve);var Ve=({breakpoint:o$1,isMobile:e$1,showSearch:t,showMoreActions:r,showTopbarMoreActions:a$1,showHeaderMoreActions:i,filterButton:l,searchValue:s,onSearch:d,onSearchChange:m,moreActions:f$1,popover:c})=>jsxs(f,{breakpoint:o$1,children:[jsxs(to,{flex:1,direction:"row",alignItems:"center",id:z,gap:.5,children:[r&&jsxs(Fragment,{children:[a$1&&jsxs(Fragment,{children:[jsx(_o,{color:"inherit",startIcon:jsx(a,{icon:"MORE_BOLD"}),size:"small",onClick:c.onOpen,children:"Mais"}),!e$1&&jsx(e,{orientation:"vertical",flexItem:!0})]}),(a$1||i)&&jsx(o,{open:c.open,anchorEl:c.open,onClose:c.onClose,disabledArrow:!0,children:jsx(ro,{onClose:c.onClose,children:f$1})})]}),!e$1&&l&&jsxs(Fragment,{children:[l,a$1&&jsx(e,{orientation:"vertical",flexItem:!0})]})]}),t&&jsxs(g,{breakpoint:o$1,children:[jsx(a$9,{value:s,placeholder:"Buscar",onSearch:n=>d(n??""),onChange:n=>m?.(n.target.value),size:"small",fullWidth:!0,iconPosition:"start"}),e$1&&l&&jsx(to,{ml:1,children:l})]})]}),Jo=Ve;var Oe=({rowCount:o,page:e,rowsPerPage:t,onPaginationChange:r$1})=>jsxs(i,{children:[jsxs(to,{direction:"row",alignItems:"center",gap:.5,children:[jsx(Xo,{variant:"body2",color:"text.disabled",children:"Total de itens:"}),jsx(Xo,{variant:"body2",children:o})]}),jsx(r,{count:o,page:e,rowsPerPage:t,onPageChange:a=>r$1(a,t),onRowsPerPageChange:a=>r$1(0,a)})]}),lo=memo(Oe);var ze=forwardRef(({children:o,...e},t)=>jsx(_o,{...e,ref:t,color:"inherit",startIcon:jsx(a,{icon:"COLUMNS"}),children:o??"Colunas"}));ze.displayName="ColumnsButton";var _e=({setFilterButtonEl:o})=>{let e=useCallback(t=>{o(t);},[o]);return jsx(a$4,{container:z,children:jsx(GridToolbarColumnsButton,{ref:e,slotProps:{button:{color:"inherit",startIcon:jsx(a,{icon:"COLUMNS"}),children:"Colunas"}}})})},so=_e;var qe=({slots:o,showColumnButton:e,rowCount:t,paginationModel:r,onPaginationChange:a})=>{let i=useCallback(()=>a?jsx(lo,{rowCount:t,page:r.page,rowsPerPage:r.pageSize,onPaginationChange:a}):null,[t,r,a]);return {dataGridSlots:useMemo(()=>({...o,footer:i,...e&&!o?.toolbar&&{toolbar:so}}),[o,i,e])}},Zo=qe;var Qe=({rows:o,rowSelectionModel:e,onRowSelectionModelChange:t,getRowId:r,bulkActions:a})=>{let i=useMemo(()=>Array.isArray(e)?e:[],[e]),l=i.length,s=useMemo(()=>o.map(S=>r(S)),[o,r]),d=useMemo(()=>new Set(s),[s]),m=useMemo(()=>i.reduce((S,C)=>S+(d.has(C)?1:0),0),[i,d]),f=s.length>0&&m===s.length,c=m>0&&!f,n=useCallback(S=>{t&&t(S);},[t]),h=useCallback(()=>{n([]);},[n]),k=useMemo(()=>new Set(i),[i]),I=useMemo(()=>o.filter(S=>k.has(r(S))),[o,k,r]),_=useMemo(()=>({selectedIds:i,selectedRowsInPage:I,selectedCount:l,clearSelection:h}),[i,I,l,h]),W=!!a?.length,v=useCallback((S,C)=>{if(!t)return;if(C){let M=new Set(i),V=[...i];s.forEach(x=>{M.has(x)||V.push(x);}),n(V);return}let G=i.filter(M=>!d.has(M));n(G);},[t,i,s,d,n]);return {selectionModel:i,numSelected:l,allSelected:f,someSelected:c,hasBulkActions:W,bulkActionContext:_,clearSelection:h,handleSelectAllToggle:v}},jo=Qe;var nt=({title:o,header:e,headerProps:t,breakpoint:r="md",columns:a$4,rows:i=[],mobileSlots:l$1,mobileSlotsProps:s,mobileRender:d,rowCount:m=0,paginationModel:f={page:0,pageSize:25},onPaginationChange:c,actions:n$1,moreActions:h,onAdd:k$1,onSearch:I,searchValue:_,onSearchChange:W,slots:v,slotProps:S,loading:C,fetching:G,fetchingNextPage:M,containerProps:V={height:562,maxHeight:562},hideFooter:x,showColumnButton:mo=!1,filterButton:po,activeFilters:uo,bulkActions:fo,onRowsScrollEnd:E,scrollEndThreshold:$=200,...R})=>{let So=a$1(),T=b("down",r),[te,ne]=useState(null),go=useRef(null);useEffect(()=>{let P=go.current;if(!P||!T||!E)return;let wo=()=>{let{scrollTop:fe,scrollHeight:Se,clientHeight:ge}=P;Se-fe-ge<=$&&E();};return P.addEventListener("scroll",wo,{passive:!0}),()=>{P.removeEventListener("scroll",wo);}},[T,E,$,i.length]);let re=useMemo(()=>R.getRowId??(P=>P.id),[R.getRowId]),{numSelected:q,allSelected:ie,someSelected:ae,hasBulkActions:le,bulkActionContext:se,clearSelection:ce,handleSelectAllToggle:de}=jo({rows:i,rowSelectionModel:Array.isArray(R.rowSelectionModel)?R.rowSelectionModel:void 0,onRowSelectionModelChange:R.onRowSelectionModelChange,getRowId:re,bulkActions:fo}),{dataGridSlots:me}=Zo({slots:v,showColumnButton:mo,rowCount:m,paginationModel:f,onPaginationChange:c}),ho=!!I,Co=!!k$1,Ao=!!n$1,K=!!h,Q=T&&K,ko=!T&&K,pe=Ao||Co||Q,To=ko||ho||mo||!!po||!T,ue=le&&q>0&&jsxs(k,{children:[jsxs(to,{flexDirection:"row",alignItems:"center",gap:1,flex:1,children:[jsx(ee,{title:"Selecione todos nessa pagina",children:jsx(n,{size:"small",checked:ie,indeterminate:ae,onChange:de})}),jsxs(l,{variant:"body2",children:[q," selecionado",q>1?"s":""]}),jsx(ee,{title:"Desselecionar tudo",children:jsx(et,{size:"small",onClick:ce,"aria-label":"Desselecionar tudo",sx:{color:"primary.main"},children:jsx(a,{icon:"CLOSE_MARK_BUTTON",width:18,height:18})})})]}),jsx(zo,{actions:fo??[],context:se})]});return jsxs(a$2,{breakpoint:r,...V,flex:C?1:void 0,minHeight:C||i.length===0?562:void 0,children:[e?jsx(to,{p:3,...t,children:e}):jsxs(Fragment,{children:[jsx($o,{title:o,breakpoint:r,actions:n$1,showActions:Ao,showAdd:Co,showHeaderMoreActions:Q,showActionsContainer:pe,onAdd:k$1,onOpenMoreActions:So.onOpen}),To&&jsx(Jo,{breakpoint:r,isMobile:T,showSearch:ho,showMoreActions:K,showTopbarMoreActions:ko,showHeaderMoreActions:Q,filterButton:po,searchValue:_,onSearch:I,onSearchChange:W,moreActions:h,popover:So}),uo&&uo,!To&&jsx(p,{})]}),T?jsx(qo,{fetching:G,loading:C,rows:i,mobileSlots:l$1,mobileSlotsProps:s,slots:v,scrollableNodeRef:go,mobileRender:d,hideFooter:x,onPaginationChange:c,rowCount:m,paginationModel:f}):jsxs(j,{children:[ue,jsx(a$3,{columns:a$4,rows:i,slots:me,slotProps:{panel:{anchorEl:te},toolbar:{setFilterButtonEl:ne,showQuickFilter:!0},...S},columnHeaderHeight:48,getRowHeight:()=>68,loading:C,fetching:G,hideFooter:x,onRowsScrollEnd:E,scrollEndThreshold:$,...R})]}),M&&jsx(tt,{})]})},yn=memo(nt,ot);
25
25
 
26
26
  export { ro as a, lo as b, so as c, yn as d };
27
- //# sourceMappingURL=chunk-Z275MVEP.js.map
27
+ //# sourceMappingURL=chunk-E4Q7LX5L.js.map
@@ -1,8 +1,8 @@
1
1
  import { a } from './chunk-373WGZZL.js';
2
+ import { a as a$3, b } from './chunk-Q2AVS24Z.js';
2
3
  import { a as a$5 } from './chunk-WUFEPE2G.js';
3
4
  import { c, b as b$1 } from './chunk-BX2DSNRV.js';
4
5
  import { a as a$1, e } from './chunk-X4F3O7PX.js';
5
- import { a as a$3, b } from './chunk-Q2AVS24Z.js';
6
6
  import { p, r, a as a$2 } from './chunk-YPL4KIKN.js';
7
7
  import { d, a as a$4 } from './chunk-GLRLKFPS.js';
8
8
  import { useEffect, useMemo } from 'react';
@@ -14,4 +14,4 @@ import { jsx, jsxs } from 'react/jsx-runtime';
14
14
  var W=t=>({lighter:lighten(t,.815),light:lighten(t,.225),main:t,dark:darken(t,.15),darker:darken(t,.35),contrastText:"#000"});function x(t,o,r$1="app"){let e$1=W(o.primaryColor),m=F(p);a(m,"dark.palette.primary",e$1),a(m,"light.palette.primary",e$1);let a$4={mode:o.colorScheme,colorSchemes:m,shadows:a$1(o.colorScheme),customShadows:r(o.colorScheme,e$1.main),shape:{borderRadius:8},components:a$2,typography:{...e,fontFamily:d(o.fontFamily)},cssVarPrefix:r$1,shouldSkipGeneratingVar:I},s=a$3(a$4,o);return experimental_extendTheme(s,t,b(o))}function I(t,o){let r=["mixins","overlays","direction","breakpoints","cssVarPrefix","unstable_sxConfig","typography","colorSchemes"],e={global:["tonalOffset","dividerChannel","contrastThreshold"],grey:["A100","A200","A400","A700"],text:["icon"]};if(t[0]==="palette"){let a=t[1],s=e[a]||e.global;return t.some(i=>s?.includes(i))}return t.some(a=>r?.includes(a))}var $=({children:t,primaryColor:o="#4E5BEC",cssVarPrefix:r="app"})=>{let{settings:e}=b$1();useEffect(()=>{localStorage.setItem(`${e.storageKey}`,e.colorScheme),localStorage.setItem(`${e.storageKey}-light`,"light"),localStorage.setItem(`${e.storageKey}-dark`,"dark");},[e.storageKey,e.colorScheme]);let m=useMemo(()=>{let s=x(a$5[1].systemValue,{primaryColor:o,colorScheme:e.colorScheme,contrast:e.contrast,navLayout:e.navLayout,navColor:e.navColor,compactLayout:e.compactLayout,fontFamily:e.fontFamily,storageKey:e.storageKey},r);return s.palette=s.colorSchemes?.[e.colorScheme]?.palette,s},[e,o,r]),a=useMemo(()=>({theme:m,mode:e.colorScheme,defaultMode:e.colorScheme,defaultColorScheme:e.colorScheme,modeStorageKey:e.storageKey,colorSchemeStorageKey:e.storageKey,attribute:a$4.ATTRIBUTE}),[m,e.colorScheme,e.storageKey]);return jsxs(Experimental_CssVarsProvider,{...a,children:[jsx(M,{enableColorScheme:!0}),jsx(B,{children:t})]})},B=({children:t})=>{let{settings:o,updateSettings:r}=b$1(),{mode:e,setMode:m}=useColorScheme();return useEffect(()=>{let a=o.colorScheme;document?.documentElement.setAttribute(a$4.ATTRIBUTE,a),m(a);},[o.colorScheme,m]),useEffect(()=>{e!==o.colorScheme&&r({colorScheme:e==="system"?o.colorScheme:e});},[e,o.colorScheme,r]),t},w=({children:t,cssVarPrefix:o,primaryColor:r="#4E5BEC",fontFamily:e="Public Sans",compactLayout:m=!0,contrast:a="default",navColor:s="integrate",navLayout:i="vertical",colorScheme:A="light"})=>{let k=`${o?`${o}-`:""}${a$4.STORAGE_KEY}`;return jsx(c,{primaryColor:r,fontFamily:e,compactLayout:m,contrast:a,navColor:s,navLayout:i,colorScheme:A,cssVarPrefix:o,storageKey:k,children:jsx($,{primaryColor:r,cssVarPrefix:o,children:t})})};var te=w;
15
15
 
16
16
  export { x as a, te as b };
17
- //# sourceMappingURL=chunk-JM3SE72J.js.map
17
+ //# sourceMappingURL=chunk-ENNGRPXU.js.map
@@ -1,5 +1,5 @@
1
- import { a } from './chunk-SYOUADDE.js';
2
1
  import { a as a$5 } from './chunk-JFLONZMC.js';
2
+ import { a } from './chunk-SYOUADDE.js';
3
3
  import { a as a$2 } from './chunk-EN24URDV.js';
4
4
  import { e } from './chunk-OF6623HG.js';
5
5
  import { a as a$6 } from './chunk-6U5LS7MP.js';
@@ -31,4 +31,4 @@ import ni from '@mui/material/CircularProgress';
31
31
  var pr=({helperText:e,disabled:o,isError:r})=>e?jsx(sr,{error:r,sx:a=>({mx:"14px",color:o?a.palette.grey[500]:void 0}),children:e}):null,S=memo(pr);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:a})=>({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},...a&&{opacity:.48,pointerEvents:"none"},"&:hover":{opacity:.72}})),so=styled(cr)(({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:a})=>({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"},...a&&{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:a,isLoading:t,isUploading:s,fill:n})=>({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,...n&&{width:"100%",height:"100%"},...!n&&Math.abs(o)>=1&&{maxWidth:r,maxHeight:a,aspectRatio:Math.abs(o),width:"calc(100% - 16px)",height:void 0},...!n&&Math.abs(o)<1&&{maxWidth:r,maxHeight:a,aspectRatio:Math.abs(o),width:void 0,height:"calc(100% - 16px)"},transition:"all 0.3s ease-in-out",...t||s?{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(mr)(({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:a,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"},...a&&{borderColor:"error.main"},...t&&{...a&&{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 xr=({onRemove:e,sx:o,file:r,disableDrag:a,attributes:t,listeners:s,innerWidth:n,isDragging:d})=>{let c=r?.id;return c?jsx(gr,{anchorOrigin:{vertical:"top",horizontal:"left"},children:jsxs(co,{width:n,isDragging:d,"data-testid":`preview-multi-img-${c}`,...j().inUp,sx:o,children:[jsx(a$2,{disableDrag:a,...t,...s}),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(xr);var Fr=({file:e$1,thumbnail:o,onRemove:r,sx:a$1,disableDrag:t=!1,disableTransitions:s=!1})=>{let n=e$1.size||0,d=e$1.name||e$1.id,c=e$1.id,m=typeof e$1=="string",l=t?70:80,{attributes:x,listeners:b,setNodeRef:I,transform:M,transition:E,isDragging:k}=useSortable({id:c,disabled:t}),z={transform:s?void 0:CSS.Transform.toString(M),transition:s?"none":E,opacity:s?.2:1,display:"inline-block",alignItems:"center",justifyContent:"center",width:`${l+8}px`,height:"68px"};return o&&e$1?jsx(Xe,{ref:I,style:z,children:jsx(Eo,{innerWidth:l,isDragging:k,sx:a$1,file:e$1,disableDrag:t,attributes:x,listeners:b,onRemove:r})}):jsx(Xe,{ref:I,style:{...z,height:"80px",width:`${l+38}px`},children:jsxs(po,{width:l+30,isDragging:k,"data-testid":`preview-multi-img-${c}`,...j().inUp,sx:a$1,children:[jsx(a$2,{disableDrag:t,...x,...b}),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(n)})]}),jsx(ke,{children:r&&jsx(a,{size:"small",label:"Remover arquivo",onClick:()=>r(e$1),icon:"DELETE_MARK_BUTTON_02"})})]})})},Ao=memo(Fr);var kr=({thumbnail:e,files:o,onRemove:r,onReorder:a,sx:t})=>{let[s,n]=useState(!1),d=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),c=useCallback(l=>{let{active:x,over:b}=l;if(!(!x||!b||x.id===b.id)&&a){let I=o.findIndex(({id:E})=>E===x.id),M=o.findIndex(({id:E})=>E===b.id);I!==-1&&M!==-1&&(a(I,M,o),n(!0),setTimeout(()=>{n(!1);},300));}},[o,a]),m=jsx(AnimatePresence,{initial:!1,children:o.map(l=>jsx(Ao,{sx:t,id:`preview-file-${l.id}`,file:l,onRemove:r,thumbnail:e,disableDrag:!a,disableTransitions:s},`preview-file-${l.id}`))});return a?jsx(DndContext,{sensors:d,collisionDetection:closestCenter,onDragEnd:c,modifiers:[restrictToHorizontalAxis,restrictToParentElement,restrictToWindowEdges],children:jsx(SortableContext,{items:o.map(l=>l.id),strategy:horizontalListSortingStrategy,children:m})}):m},De=memo(kr);var Mo=forwardRef(({onLoading:e,aspectRatio:o,cropSize:r,...a},t)=>{let{maxWidth:s,maxHeight:n}=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]);let d=useCallback(()=>{e?.(!1);},[e]);return jsx(go,{...a,maxWidth:s,maxHeight:n,ref:t,aspectRatio:o,onLoad:d,onError:d})});Mo.displayName="LoadingPreviewImage";var Do=Mo;var qr=({file:e,aspectRatio:o=1,isUploading:r,isLoading:a,onLoading:t,cropSize:s,maxWidth:n,maxHeight:d,hoverAlt:c,fill:m})=>{let l=useRef(null),x=e?.id||"",b=e?.name||"",I=useMemo(()=>URL.createObjectURL(e),[e]);return useEffect(()=>()=>URL.revokeObjectURL(I),[I]),x?jsxs(uo,{className:"single-file-preview-box",children:[jsx(Do,{className:"single-file-preview-img",aspectRatio:o,cropSize:s,isLoading:a,isUploading:r,alt:b,src:I,ref:l,loading:"lazy",onLoading:t,onLoad:()=>t?.(!1),onError:()=>t?.(!1),maxWidth:n,maxHeight:d,fill:m},`image-preview-${x}`),jsx(xo,{className:"single-file-preview-bg",alt:b,src:I,isLoading:a,isUploading:r}),c&&jsx(ho,{className:"single-file-preview-hover-overlay",children:c})]}):null},Ke=memo(qr);var yo=["pdf"],_o=["txt"],Lo=["psd"],So=["doc","docx"],Oo=["xls","xlsx"],Uo=["zip","rar","iso"],To=["ai","eps"],Co=["ppt","pptx"],ko=["wav","aif","mp3","aac"],No=["jpg","jpeg","gif","bmp","png","svg","webp"],Bo=["m4v","avi","mpg","mp4","webm"];function Kr(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":e==="application/pdf"?"pdf":e==="text/plain"?"txt":e==="application/msword"||e==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?"word":e==="application/vnd.ms-excel"||e==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"excel":e==="application/vnd.ms-powerpoint"||e==="application/vnd.openxmlformats-officedocument.presentationml.presentation"?"powerpoint":e==="application/zip"||e==="application/x-rar-compressed"||e==="application/x-iso9660-image"?"zip":e==="image/vnd.adobe.photoshop"?"photoshop":e==="application/illustrator"||e==="application/postscript"?"illustrator":null}function Wo(e,o){if(o){let a=Kr(o);if(a)return a}let r=jo(e);return _o.includes(r)?"txt":Uo.includes(r)?"zip":ko.includes(r)?"audio":No.includes(r)?"image":Bo.includes(r)?"video":So.includes(r)?"word":Oo.includes(r)?"excel":Co.includes(r)?"powerpoint":yo.includes(r)?"pdf":Lo.includes(r)?"photoshop":To.includes(r)?"illustrator":"file"}function Jr(e){let o=jo(e);return _o.includes(o)?"txt":Uo.includes(o)?"zip":ko.includes(o)?"audio":No.includes(o)?"image":Bo.includes(o)?"video":So.includes(o)?"word":Oo.includes(o)?"excel":Co.includes(o)?"powerpoint":yo.includes(o)?"pdf":Lo.includes(o)?"photoshop":To.includes(o)?"illustrator":e?.startsWith("http")?"image":o||"file"}function Go(e){let o;switch(Jr(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 jo(e){return e&&e.split(".").pop()||""}function Ia(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:a,imageView:t,slotProps:s,onDownload:n,...d})=>{let c=useMemo(()=>o.size>0?URL.createObjectURL(o):o.url,[o]),m=o?.name||"",l=Wo(m,o.type);useEffect(()=>{if(o.size>0)return ()=>URL.revokeObjectURL(c)},[o,c]);let x=jsx(ze,{component:"img",src:c,className:Be.img,sx:{width:1,height:1,objectFit:"cover",borderRadius:"inherit",...s?.img}}),b=jsx(a$4,{icon:Go(l),sx:{width:32,height:32,flexShrink:0,...e}}),I=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:[l==="image"&&t?x:b,a&&jsx(ot,{"aria-label":"Remover arquivo",onClick:a,className:Be.removeBtn,sx:s?.removeBtn,children:jsx(a$4,{icon:"CLOSE_MARK_BUTTON",width:24})}),n&&jsx(cr,{"aria-label":"Baixar arquivo",onClick:n,className:Be.downloadBtn,sx:s?.downloadBtn,size:"small",children:jsx(a$4,{icon:"ARROW_DOWN_CICLE",width:12})})]});return r?jsx(it,{arrow:!0,title:m,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,-12]}}]}},children:I}):I};var _a=e=>e.startsWith("image/"),Zo=(e,o=.8)=>new Promise((r,a)=>{let t=document.createElement("canvas"),s=t.getContext("2d"),n=new Image;n.onload=()=>{t.width=n.width,t.height=n.height,s?(s.drawImage(n,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 a(new Error("Falha ao converter para WebP"));},"image/webp",o)):a(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},n.onerror=()=>a(new Error("Falha ao carregar imagem")),n.src=URL.createObjectURL(e);}),Ho=(e,o=.8,r,a)=>new Promise((t,s)=>{let n=document.createElement("canvas"),d=n.getContext("2d"),c=new Image;c.onload=()=>{let{width:m,height:l}=c;r&&m>r&&(l=l*r/m,m=r),a&&l>a&&(m=m*a/l,l=a),n.width=m,n.height=l,d?(d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(c,0,0,m,l),n.toBlob(x=>{if(x){let b=new File([x],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});t(b);}else s(new Error("Falha ao comprimir imagem"));},"image/webp",o)):s(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},c.onerror=()=>s(new Error("Falha ao carregar imagem")),c.src=URL.createObjectURL(e);}),$o=e=>{let o=e.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i);return o?.[1]||o?.[2]||""},Xo=e=>`UTF-8''${encodeURIComponent(e)}`;var dt=({onFilesSelect:e$1,onFileSelect:o,onReorder:r,onRemove:a,uploadFiles:t,filesPreview:s,dropzoneOptions:n,enableCrop:d=!1,customAspectRatio:c,convertToWebp:m=!0,cropSize:l,maxFiles:x,compressionQuality:b=.8,maxCompressedWidth:I,maxCompressedHeight:M})=>{let{showErrorMessage:E}=a$7(),k=useMemo(()=>c||(l&&typeof l!="number"?l.width/l.height:1),[c,l]),[z,P]=useState([]),[R,u]=useState(!1),[A,U]=useState(null),[C,v]=useState(null),[f,w]=useState(""),[D,T]=useState(!1),[y,_]=useState([]),[W,K]=useState(0),[re,Z]=useState(0),se=g=>{if(g.length<1)return;let h=g[0];U(h),K(L=>L+1);let F=new FileReader;F.onload=()=>{w(F.result),u(!0);},F.readAsDataURL(h);},ge=(g,h)=>{v(h);},pe=async g=>!A||!C?null:new Promise(h=>{let F=document.createElement("canvas"),L=F.getContext("2d"),N=new Image;N.onload=async()=>{let{width:G,height:ce,x:ye,y:ir}=C,ar=Math.abs(k),_e=G,Le=ce;l&&typeof l=="object"?(_e=l.width,Le=l.height):l&&typeof l=="number"&&(_e=l,Le=l/ar),F.width=_e,F.height=Le,L?(L.drawImage(N,ye,ir,G,ce,0,0,_e,Le),F.toBlob(async io=>{if(io){let $e=new File([io],A.name,{type:A.type,lastModified:Date.now()});if(m)try{$e=await Zo($e,b);}catch(nr){E(nr,"Erro ao converter para WebP");}let ao=$e;ao.id=g,h(ao);}else h(null);},"image/png")):h(null);},N.src=f;}),de=async()=>{if(!(!A||!C||y.length===0)){T(!0);try{let g=y[0],h=await pe(g.id);if(h){let L=await t([h]);L&&(!e$1&&!o&&P(N=>[...N,...L]),e$1?.([...s||[],...L]),o?.(h));}u(!1),T(!1),w(""),U(null);let F=y.slice(1);_(F),se(F);}catch(g){E(g,"Erro ao processar imagem"),T(!1);}}},H=()=>{u(!1),T(!1),w(""),U(null),_([]),K(0),Z(0);},J=async g=>{if(g.length===0)return;let h=Object.keys(n?.accept||{}).some(L=>L.includes("image/")),F=z.length+g.length;if(x&&F>x){E(new Error(`M\xE1ximo de ${x} arquivos`),"Erro ao fazer upload");return}try{if(h&&d){let N=g.filter(G=>G.type.startsWith("image/")).map((G,ce)=>{let ye=G;return ye.id=`temp-crop-${Date.now()}-${ce}`,ye});Z(N.length),K(0),_(N),se(N);}else {let L=[];for(let G of g)if(G.type.startsWith("image/")&&m)try{let ce=await Ho(G,b,I,M);L.push(ce);}catch(ce){E(ce,"Erro ao comprimir imagem"),L.push(G);}else L.push(G);let N=await t(L);N&&(!e$1&&!o&&P(G=>[...G,...N]),e$1?.([...s||[],...N]),o?.(N[0]));}}catch(L){E(L,"Erro ao processar arquivos");}},Q=g=>{if(!g.length)return;let h=g[0]?.errors[0]?.code,F=n?.maxSize||3145728;E(h==="file-too-large"?new Error(`O arquivo excede o tamanho m\xE1ximo de ${e(F)}`):h==="file-invalid-type"?new Error("Formato de arquivo n\xE3o suportado"):g[0]?.errors[0]||new Error("Erro ao enviar arquivo"),"Erro ao fazer upload");},{getRootProps:te,getInputProps:ie,isDragActive:p,isDragReject:ae,fileRejections:Y}=useDropzone({onDrop:J,onDropRejected:Q,...n}),Ie=g=>{if(!g){a||P([]),a?.(void 0);return}let h=z.filter(F=>F.id!==g.id);a||P(h),a?.(g);},we=(g,h,F)=>{r?.(g,h,F);},xe=useRef("");return useEffect(()=>{let g=s?.map(h=>h.id).join(",")||"";g!==xe.current&&(xe.current=g,P(s||[]));},[s]),{file:z?.[0],files:z,aspectRatio:k,dropzoneProps:{getRootProps:te,getInputProps:ie,isDragActive:p,isDragReject:ae,fileRejections:Y},cropState:{cropModalOpen:R,imagePreview:f,cropLoading:D,setCropModalOpen:u,onCropInitialized:ge,handleCropSave:de,handleCropCancel:H,currentImageIndex:W,totalPendingImages:re},setInitialFiles:P,handleRemove:Ie,handleReorder:we}},X=dt;var Je=(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))(Je||{}),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 ut=({createFilesMutation:e,filesDetails:o})=>{let{showErrorMessage:r}=a$7(),[a,t]=useState(!1),[s,n]=useState(!1),[d,c]=useState(null),[m,l]=useState([]),x=useMemo(()=>m?.[0],[m]),b=s||a,I=useCallback(async P=>{if(!P.length){l([]),n(!1);return}n(!0);try{let u=(await Promise.all(P.map(async({url:A,id:U,name:C})=>{try{if(!A)return null;let v=await fetch(A);if(!v.ok)throw new Error(v.statusText);let f=await v.blob(),w=null;if(!C){let y=v.headers.get("content-disposition")||void 0;if(y){let _=$o(y);if(_)try{w=decodeURIComponent(_);}catch{w=_;}}}let D=w||C||U,T=new File([f],D,{type:f.type});return T.id=U,T.url=A,T}catch{return null}}))).filter(Boolean);l(u),n(!1);}catch(R){r(R,"Erro ao carregar arquivos"),l([]),n(!1);}},[r]),M=useRef("");useEffect(()=>{let P=o?.map(({id:R})=>R).join(",")||"";P!==M.current&&(async()=>(M.current=P,await I(o)))();},[o,I]);let E=async P=>{if(!P||!Array.isArray(P))throw new Error("Arquivos inv\xE1lidos");let R=P.filter(u=>u instanceof File);if(R?.length){t(!0);try{let u=R.map(v=>{let f=v.type||"application/octet-stream",w=We[f];if(!w)throw new Error(`Tipo de arquivo n\xE3o suportado: ${f}`);return {file:v,mimeType:f,contentTypeEnum:w}}),A=await e({files:u.map(({file:v,contentTypeEnum:f})=>({content_type:f,name:v.name}))}).unwrap(),U=A.files.map((v,f)=>{let w=u[f].file,D=w;return D.id=v.id,D.url=URL.createObjectURL(w),D});return await(await Promise.all(A.files.map((v,f)=>{let{mimeType:w}=u[f],D=U[f];return fetch(v.url,{method:"PUT",headers:{"Content-Type":w,"Content-Disposition":`inline; filename*=${Xo(D.name)}`,"X-File-Id":v.id},body:D})}))).forEach(async v=>{if(!v.ok)throw new Error("Erro no upload do arquivo.")}),U}catch(u){throw c(u),r(u,"Erro no upload"),u}finally{t(!1);}}},k=useMemo(()=>d&&d instanceof Error?d.message:d,[d]),z=useMemo(()=>o.filter(P=>!m.some(R=>R.id===P.id)),[o,m]);return {setFilesPreview:l,uploadFiles:E,filesPreview:m,filePreview:x,isLoadingPreview:s,isUploadingFiles:a,isUploadOrLoadingFiles:b,uploadErrorText:k,invalidFiles:z}},q=ut;var xt=({sx:e,id:o,name:r,tabIndex:a,uploading:t,getRootProps:s,getInputProps:n,isDragActive:d,isError:c,disabled:m,dropZoneSxProps:l,dropZoneContent:x,children:b,...I})=>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,{...s(),"data-testid":"drop-zone-styled-area",isError:c,isDragActive:d,disabled:!!m,sx:l,...I,children:[jsx("input",{...n(),id:o,tabIndex:a,name:r}),x]}),b]})]}),me=xt;function Ko(){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 Et({hideBackground:e,sx:o,...r}){let a=useTheme(),t=a.vars.palette.primary.main,s=a.vars.palette.primary.dark,n=a.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(Ko,{}),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:n,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:s,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:n,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:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M91.113 247.808s8.353 12.115 9.968 12.647"}),jsx("path",{stroke:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M90.344 249.701L92.293 249.701"}),jsx("path",{stroke:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M92.68 254.132L95.738 254.263"}),jsx("path",{stroke:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M94.542 250.586L94.21 252.179"}),jsx("path",{stroke:n,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:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M111.051 247.808s-8.371 12.115-9.97 12.647"}),jsx("path",{stroke:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M111.82 249.701L109.871 249.701"}),jsx("path",{stroke:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M109.485 254.132L106.426 254.263"}),jsx("path",{stroke:n,strokeLinecap:"round",strokeWidth:"0.5",d:"M107.622 250.586L107.954 252.179"}),jsx("path",{stroke:n,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:s,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:s,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 Qo=memo(Et);var At=({header:e,description:o,sx:r,...a})=>jsxs(he,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...a,children:[jsx(Qo,{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"]})})]})]}),fe=memo(At);var _t=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:a,filesDetails:t=[],id:s,disabled:n,error:d,helperText:c,thumbnail:m,dropZoneSxProps:l,uploading:x,tabIndex:b,maxFiles:I,placeholderAlt:M,placeholderProps:E,...k})=>{let{filesPreview:z,isUploadOrLoadingFiles:P,uploadErrorText:R,uploadFiles:u}=q({createFilesMutation:a,filesDetails:t}),{files:A,dropzoneProps:U,handleRemove:C,handleReorder:v}=X({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:z,dropzoneOptions:{multiple:!0,disabled:n,...k},maxFiles:I,uploadFiles:u}),{getRootProps:f,getInputProps:w,isDragActive:D,isDragReject:T}=U,y=!!A?.filter(W=>!!W.id).length,_=T||!!d||!!R;return jsxs(me,{id:s,uploading:x||P,disabled:n,dropZoneSxProps:l,tabIndex:b,getRootProps:f,getInputProps:w,isDragActive:D,isError:_,dropZoneContent:jsx(Fragment,{children:M?jsx(he,{children:M}):jsx(fe,{header:E?.header,description:E?.description})}),children:[jsx(S,{disabled:n,helperText:c,isError:_}),d?jsx(S,{helperText:d,isError:!0}):null,R?jsx(S,{helperText:R,isError:!0}):null,y&&jsx(ze,{sx:{my:3},children:jsx(De,{files:A,thumbnail:!!m,onRemove:e?C:void 0,onReorder:o?v:void 0})})]})},Lt=memo(_t);var kt=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:a,filesDetails:t=[],id:s,disabled:n,error:d,helperText:c,dropZoneSxProps:m,placeholderProps:l,placeholderAlt:x,uploading:b,tabIndex:I,maxFiles:M,aspectRatio:E,enableCrop:k=!0,convertToWebp:z=!0,cropSize:P,name:R,label:u,keepInvalidFiles:A=!1,...U})=>{let{filesPreview:C,isUploadOrLoadingFiles:v,uploadErrorText:f,uploadFiles:w,invalidFiles:D}=q({createFilesMutation:a,filesDetails:t}),T=b||v,{files:y,dropzoneProps:_,cropState:W,aspectRatio:K,handleRemove:re,handleReorder:Z}=X({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:C,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!0,disabled:n,...U},enableCrop:k,customAspectRatio:E,convertToWebp:z,maxFiles:M,cropSize:P,uploadFiles:w}),{getRootProps:se,getInputProps:ge,isDragActive:pe,isDragReject:de}=_,{cropModalOpen:H,imagePreview:J,cropLoading:Q,onCropInitialized:te,handleCropSave:ie,handleCropCancel:p,currentImageIndex:ae,totalPendingImages:Y}=W,Ie=useMemo(()=>{if(!A)return y;let h=D.map(F=>({...new File([],F.name??"invalid-file"),id:F.id,url:"url.invalid"}));return [...y,...h]},[A,y,D]),we=!!Ie?.filter(h=>!!h.id).length,xe=de||!!d||!!f,g=useMemo(()=>{let h=u??"Ajustar Imagem",F=Y>1||ae>1?` (${ae} de ${Y})`:"";return `${h}${F}`},[u,Y,ae]);return jsxs(me,{id:s,name:R,uploading:T,disabled:n,dropZoneSxProps:m,tabIndex:I,getRootProps:se,getInputProps:ge,isDragActive:pe,isError:xe,dropZoneContent:jsx(Fragment,{children:x?jsx(he,{children:x}):jsx(fe,{header:l?.header,description:l?.description})}),children:[jsx(S,{disabled:n,helperText:c,isError:xe}),d?jsx(S,{helperText:d,isError:!0}):null,f?jsx(S,{helperText:f,isError:!0}):null,we&&jsx(ze,{sx:{my:3,ml:.5},children:jsx(De,{files:Ie,thumbnail:!0,onRemove:re,onReorder:o?Z:void 0})}),jsx(a$5,{open:H,onClose:p,label:g,imageSrc:J,aspectRatio:K,onInitialized:te,onSave:ie,loading:Q,cropSize:P})]})},Nt=memo(kt);var Ht=({onFileSelect:e$1,onRemove:o,createFilesMutation:r,fileDetails:a,id:t,disabled:s,error:n,helperText:d,sx:c,dropZoneSxProps:m$1,uploading:l,tabIndex:x,placeholderAlt:b,placeholderProps:I,...M})=>{let{filesPreview:E,isUploadOrLoadingFiles:k,uploadErrorText:z,uploadFiles:P}=q({createFilesMutation:r,filesDetails:a?[a]:[]}),R=k||l,{file:u,dropzoneProps:A,handleRemove:U}=X({uploadFiles:P,onFileSelect:e$1,onRemove:o,filesPreview:E,dropzoneOptions:{multiple:!1,disabled:s,...M}}),{getRootProps:C,getInputProps:v,isDragActive:f,isDragReject:w}=A,D=useCallback(W=>{W.stopPropagation(),U(u||void 0);},[u,U]),T=!!u,y=typeof u=="string",_=w||!!n||!!z;return jsxs(me,{id:t,uploading:R,disabled:s,dropZoneSxProps:m$1,tabIndex:x,getRootProps:C,getInputProps:v,isDragActive:f,isError:_,dropZoneContent:jsxs(Fragment,{children:[!T&&(b?jsx(he,{...I,children:b}):jsx(fe,{})),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:u}),jsxs(he,{flexGrow:1,sx:{minWidth:0},children:[jsx(eo,{variant:"subtitle2",noWrap:!0,children:y?u:u.name}),jsx(eo,{variant:"caption",sx:{color:"text.secondary"},children:y?"":e(u.size)})]}),o&&jsx(a$3,{title:"Remover arquivo",children:jsx(so,{edge:"end",size:"small",disabled:s,"aria-label":"Remover arquivo",onClick:D,children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})})})]})]}),children:[jsx(S,{disabled:s,helperText:d,isError:_}),n?jsx(S,{helperText:n,isError:!0}):null,z?jsx(S,{helperText:z,isError:!0}):null]})},$t=memo(Ht);var Yt=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:a,id:t,disabled:s,error:n,helperText:d,dropZoneSxProps:c,placeholderProps:m,placeholderAlt:l,hoverAlt:x,uploading:b,tabIndex:I,aspectRatio:M,enableCrop:E=!0,convertToWebp:k=!0,name:z,label:P,cropSize:R,sx:u,maxWidth:A,maxHeight:U,compressionQuality:C=.8,maxCompressedWidth:v,maxCompressedHeight:f,fill:w,...D})=>{let{filesPreview:T,isUploadOrLoadingFiles:y,uploadErrorText:_,uploadFiles:W}=q({createFilesMutation:r,filesDetails:a?[a]:[]}),[K,re]=useState(!1),{file:Z,dropzoneProps:se,cropState:ge,handleRemove:pe,aspectRatio:de}=X({onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:s,...D},filesPreview:T,enableCrop:E,customAspectRatio:M,convertToWebp:k,cropSize:R,uploadFiles:W,compressionQuality:C,maxCompressedWidth:v,maxCompressedHeight:f}),{getRootProps:H,getInputProps:J,isDragActive:Q,isDragReject:te}=se,{cropModalOpen:ie,imagePreview:p,cropLoading:ae,onCropInitialized:Y,handleCropSave:Ie,handleCropCancel:we}=ge,xe=useCallback(()=>{pe(Z||void 0);},[Z,pe]),g=!!Z,h=te||!!n||!!_,F=b||y,L=g?{opacity:0}:{opacity:1},N=c?.width;return useEffect(()=>{g||re(!1);},[g]),jsxs(Ce,{sx:{...u,...N&&{width:N}},children:[(F||K)&&jsx(a$6,{}),jsxs(me,{id:t,uploading:F,disabled:s,dropZoneSxProps:c,tabIndex:I,getRootProps:H,getInputProps:J,isDragActive:Q,isError:h,name:z,dropZoneContent:jsxs(Fragment,{children:[l?jsx(he,{sx:L,children:l}):jsx(fe,{sx:L,header:m?.title,description:m?.description}),g&&jsx(Ke,{file:Z,cropSize:R,isLoading:K,isUploading:F,onLoading:re,aspectRatio:de,maxWidth:A,maxHeight:U,hoverAlt:x,fill:w})]}),children:[jsx(S,{disabled:s,helperText:d,isError:h}),n?jsx(S,{helperText:n,isError:!0}):null,_?jsx(S,{helperText:_,isError:!0}):null,g&&e&&jsx(mo,{size:"small",onClick:xe,disabled:s,label:"Remover arquivo",children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})}),jsx(a$5,{open:ie,onClose:we,label:P??"Ajustar Imagem",imageSrc:p,aspectRatio:de,onInitialized:Y,onSave:Ie,loading:ae,cropSize:R})]})]})},ei=memo(Yt);var li=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:a,disabled:t,label:s,id:n,tabIndex:d,error:c,helperText:m,sx:l,name:x,maxSize:b,uploading:I,aspectRatio:M=1,enableCrop:E=!0,convertToWebp:k=!0,cropSize:z,...P})=>{let[R,u]=useState(!1),{filesPreview:A,isUploadOrLoadingFiles:U,uploadErrorText:C,uploadFiles:v}=q({createFilesMutation:r,filesDetails:a?[a]:[]}),{file:f,dropzoneProps:w,cropState:D,handleRemove:T}=X({filesPreview:A,onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:t,maxSize:b,...P},enableCrop:E,customAspectRatio:M,convertToWebp:k,cropSize:z,uploadFiles:v}),{getRootProps:y,getInputProps:_,isDragActive:W,isDragReject:K}=w,{cropModalOpen:re,imagePreview:Z,cropLoading:se,onCropInitialized:ge,handleCropSave:pe,handleCropCancel:de}=D,H=K||!!c||!!C,J=R||U||I,Q=!!e,te=useRef(a?.url||""),ie=useRef(void 0);useEffect(()=>{if(!f){te.current="",ie.current=void 0;return}if(ie.current===f.id)return;ie.current=f.id,u(!0);let Y=URL.createObjectURL(f);return te.current=Y,()=>{URL.revokeObjectURL(Y);}},[f]);let p=()=>{u(!1);},ae=useCallback(()=>Q&&f?()=>T(f):y().onClick,[Q,f,y,T]);return jsxs(Fragment,{children:[jsxs(he,{sx:{alignItems:"center"},children:[jsxs(Po,{sx:l,isError:H,isDragActive:W,hasFile:!!f,...y(),onClick:ae(),children:[jsxs(bo,{children:[J&&jsx(Io,{children:jsx(ni,{size:135,thickness:2,color:"primary"})}),f&&jsx(vo,{alt:"Avatar Preview",src:te.current,onLoad:p,...J&&{sx:{filter:"blur(5px) !important",scale:1.2,opacity:.7}}}),!f&&!J&&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&&!J&&jsxs(qe,{isError:H,hasFile:!0,children:[jsx(a$4,{icon:Q?"DELETE_MARK_BUTTON_02":"ADD_IMAGE",width:32}),jsx(eo,{variant:"caption",textAlign:"center",sx:{color:H?"error.main":"common.white"},children:Q?"Remover foto":"Alterar foto"})]})]}),jsx("input",{name:x,id:n,tabIndex:d,..._()})]}),jsx(he,{sx:{alignItems:"center",mt:-.5},children:jsx(S,{helperText:m,disabled:t,isError:H})}),C?jsx(S,{helperText:C,isError:!0}):null,c?jsx(S,{helperText:c,isError:!0}):null]}),re&&Z&&jsx(a$5,{open:re,onClose:de,label:s??"Ajustar Imagem",imageSrc:Z,aspectRatio:M,onInitialized:ge,onSave:pe,loading:se,cropSize:z,cropShape:"round"})]})},si=memo(li);var mi=({error:e,name:o,disabled:r,sx:a,...t})=>{let{getRootProps:s,getInputProps:n,isDragActive:d,isDragReject:c}=useDropzone({disabled:r,...t}),m=c||e;return jsxs(fo,{...s(),isDragActive:d,hasError:!!m,disabled:!!r,sx:a,"data-testid":"upload-box",children:[jsx("input",{name:o,...n()}),"Selecionar arquivo"]})},fi=memo(mi);
32
32
 
33
33
  export { S as a, De as b, Ke as c, Kr as d, Wo as e, Jr as f, Go as g, jo as h, Ia as i, Be as j, Ee as k, _a as l, Zo as m, Ho as n, $o as o, Xo as p, X as q, Je as r, We as s, q as t, Lt as u, Nt as v, $t as w, ei as x, si as y, fi as z };
34
- //# sourceMappingURL=chunk-7IG7ZHY7.js.map
34
+ //# sourceMappingURL=chunk-J3T26XV2.js.map
@@ -5,23 +5,23 @@ import { a as a$7 } from '../../../chunk-DRGARBKB.js';
5
5
  import { a as a$6 } from '../../../chunk-J5XGGHQ7.js';
6
6
  import { a as a$4 } from '../../../chunk-J5B2YJSR.js';
7
7
  import { a as a$3 } from '../../../chunk-CBW32OUQ.js';
8
- import { d as d$2 } from '../../../chunk-N7IK5EUP.js';
8
+ import { d as d$2 } from '../../../chunk-A7QSCOUE.js';
9
9
  import { h, d as d$1, c as c$2 } from '../../../chunk-OF6623HG.js';
10
- import { d } from '../../../chunk-Z275MVEP.js';
10
+ import { d } from '../../../chunk-E4Q7LX5L.js';
11
11
  import { a as a$2 } from '../../../chunk-R2BCPHRH.js';
12
12
  import { a as a$1 } from '../../../chunk-4F2NKGF6.js';
13
- import '../../../chunk-NMGWHSNZ.js';
14
- import '../../../chunk-6U5LS7MP.js';
13
+ import '../../../chunk-7ZCLS5N5.js';
15
14
  import '../../../chunk-LZQ7OFKO.js';
16
15
  import '../../../chunk-NIQW2J3M.js';
16
+ import '../../../chunk-6U5LS7MP.js';
17
17
  import '../../../chunk-PRWQQJDL.js';
18
18
  import '../../../chunk-5J35UAV6.js';
19
19
  import '../../../chunk-XUDTPZHF.js';
20
20
  import '../../../chunk-UVPQR2Q2.js';
21
21
  import '../../../chunk-RBTYTONM.js';
22
+ import '../../../chunk-CO2KQFUN.js';
22
23
  import '../../../chunk-F65ZXAGV.js';
23
24
  import '../../../chunk-I4PPSW36.js';
24
- import '../../../chunk-CO2KQFUN.js';
25
25
  import '../../../chunk-2GTD4JW2.js';
26
26
  import '../../../chunk-PBLSVXV5.js';
27
27
  import '../../../chunk-LQRRMVFN.js';
@@ -4,22 +4,22 @@ import { a, b as b$1, m, n, c } from '../../../chunk-XQZPUMVQ.js';
4
4
  import { a as a$8 } from '../../../chunk-DRGARBKB.js';
5
5
  import { a as a$4 } from '../../../chunk-J5B2YJSR.js';
6
6
  import { a as a$3 } from '../../../chunk-CBW32OUQ.js';
7
- import { d as d$2 } from '../../../chunk-N7IK5EUP.js';
7
+ import { d as d$2 } from '../../../chunk-A7QSCOUE.js';
8
8
  import { h, d, a as a$6, c as c$1 } from '../../../chunk-OF6623HG.js';
9
- import { d as d$1 } from '../../../chunk-Z275MVEP.js';
9
+ import { d as d$1 } from '../../../chunk-E4Q7LX5L.js';
10
10
  import { a as a$2 } from '../../../chunk-R2BCPHRH.js';
11
11
  import { a as a$1 } from '../../../chunk-4F2NKGF6.js';
12
- import '../../../chunk-NMGWHSNZ.js';
13
- import '../../../chunk-6U5LS7MP.js';
12
+ import '../../../chunk-7ZCLS5N5.js';
14
13
  import '../../../chunk-LZQ7OFKO.js';
15
14
  import '../../../chunk-NIQW2J3M.js';
15
+ import '../../../chunk-6U5LS7MP.js';
16
16
  import '../../../chunk-PRWQQJDL.js';
17
17
  import '../../../chunk-XUDTPZHF.js';
18
18
  import '../../../chunk-UVPQR2Q2.js';
19
19
  import '../../../chunk-RBTYTONM.js';
20
+ import '../../../chunk-CO2KQFUN.js';
20
21
  import { a as a$7 } from '../../../chunk-F65ZXAGV.js';
21
22
  import '../../../chunk-I4PPSW36.js';
22
- import '../../../chunk-CO2KQFUN.js';
23
23
  import '../../../chunk-2GTD4JW2.js';
24
24
  import '../../../chunk-PBLSVXV5.js';
25
25
  import '../../../chunk-LQRRMVFN.js';
@@ -10,9 +10,9 @@ import { a as a$1 } from '../../chunk-J5B2YJSR.js';
10
10
  import { a } from '../../chunk-CBW32OUQ.js';
11
11
  import { a as a$3 } from '../../chunk-4F2NKGF6.js';
12
12
  import { c } from '../../chunk-VGTQYKAC.js';
13
+ import { a as a$6 } from '../../chunk-CO2KQFUN.js';
13
14
  import '../../chunk-F65ZXAGV.js';
14
15
  import { a as a$a } from '../../chunk-6N456D64.js';
15
- import { a as a$6 } from '../../chunk-CO2KQFUN.js';
16
16
  import { a as a$4 } from '../../chunk-2GTD4JW2.js';
17
17
  import '../../chunk-PBLSVXV5.js';
18
18
  import { a as a$2 } from '../../chunk-E3R7W7GK.js';
@@ -6,13 +6,13 @@ import '../../chunk-PBLSVXV5.js';
6
6
  import { a as a$2 } from '../../chunk-VR3K2Y2C.js';
7
7
  import { a as a$1 } from '../../chunk-LQRRMVFN.js';
8
8
  import '../../chunk-U4I7JPER.js';
9
- import '../../chunk-JM3SE72J.js';
9
+ import '../../chunk-ENNGRPXU.js';
10
10
  import '../../chunk-373WGZZL.js';
11
+ import '../../chunk-Q2AVS24Z.js';
12
+ import '../../chunk-LNESYSHP.js';
11
13
  import '../../chunk-WUFEPE2G.js';
12
14
  import '../../chunk-BX2DSNRV.js';
13
15
  import '../../chunk-X4F3O7PX.js';
14
- import '../../chunk-Q2AVS24Z.js';
15
- import '../../chunk-LNESYSHP.js';
16
16
  import '../../chunk-YPL4KIKN.js';
17
17
  import '../../chunk-HBOBTNB5.js';
18
18
  import '../../chunk-GLRLKFPS.js';
@@ -2,9 +2,9 @@ import { a } from '../../chunk-DLASFJON.js';
2
2
  import { r } from '../../chunk-XUDTPZHF.js';
3
3
  import '../../chunk-UVPQR2Q2.js';
4
4
  import { a as a$1 } from '../../chunk-RBTYTONM.js';
5
+ import '../../chunk-CO2KQFUN.js';
5
6
  import { a as a$3 } from '../../chunk-I4PPSW36.js';
6
7
  import '../../chunk-6N456D64.js';
7
- import '../../chunk-CO2KQFUN.js';
8
8
  import { a as a$2 } from '../../chunk-2GTD4JW2.js';
9
9
  import '../../chunk-PBLSVXV5.js';
10
10
  import { memo, useEffect, useState, useMemo, useCallback } from 'react';
@@ -1,12 +1,12 @@
1
1
  import { a } from '../../chunk-2GTD4JW2.js';
2
2
  import '../../chunk-PBLSVXV5.js';
3
- import { b } from '../../chunk-JM3SE72J.js';
3
+ import { b } from '../../chunk-ENNGRPXU.js';
4
4
  import '../../chunk-373WGZZL.js';
5
+ import '../../chunk-Q2AVS24Z.js';
6
+ import '../../chunk-LNESYSHP.js';
5
7
  import '../../chunk-WUFEPE2G.js';
6
8
  import '../../chunk-BX2DSNRV.js';
7
9
  import '../../chunk-X4F3O7PX.js';
8
- import '../../chunk-Q2AVS24Z.js';
9
- import '../../chunk-LNESYSHP.js';
10
10
  import '../../chunk-YPL4KIKN.js';
11
11
  import '../../chunk-HBOBTNB5.js';
12
12
  import { k } from '../../chunk-GLRLKFPS.js';
@@ -1,8 +1,8 @@
1
1
  import { c } from '../../chunk-FG2BVR7Y.js';
2
- import { a as a$1 } from '../../chunk-6U5LS7MP.js';
2
+ import { a } from '../../chunk-X2NG6VDB.js';
3
3
  import { a as a$2 } from '../../chunk-LZQ7OFKO.js';
4
4
  import '../../chunk-NIQW2J3M.js';
5
- import { a } from '../../chunk-X2NG6VDB.js';
5
+ import { a as a$1 } from '../../chunk-6U5LS7MP.js';
6
6
  import '../../chunk-GLRLKFPS.js';
7
7
  import { memo, useMemo } from 'react';
8
8
  import pt from 'react-fast-compare';
@@ -1,7 +1,7 @@
1
- export { a as default } from '../../chunk-NMGWHSNZ.js';
2
- import '../../chunk-6U5LS7MP.js';
1
+ export { a as default } from '../../chunk-7ZCLS5N5.js';
3
2
  import '../../chunk-LZQ7OFKO.js';
4
3
  import '../../chunk-NIQW2J3M.js';
4
+ import '../../chunk-6U5LS7MP.js';
5
5
  import '../../chunk-RBTYTONM.js';
6
6
  import '../../chunk-GLRLKFPS.js';
7
7
  //# sourceMappingURL=index.js.map
@@ -90,7 +90,7 @@ declare const SelectionOverlay: _emotion_styled.StyledComponent<_mui_material_St
90
90
  }, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
91
91
  declare const SelectionCount: _emotion_styled.StyledComponent<_mui_material_Typography.TypographyOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
92
92
  ref?: ((instance: HTMLSpanElement | null) => void) | react.RefObject<HTMLSpanElement> | null | undefined;
93
- }, "fontFamily" | "children" | "pt" | "className" | "style" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
93
+ }, "typography" | "zIndex" | "fontFamily" | "fontWeight" | "children" | "pt" | "className" | "style" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
94
94
  declare const SelectionActions: _emotion_styled.StyledComponent<_mui_material_Stack.StackOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
95
95
  ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
96
96
  }, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
@@ -1,17 +1,17 @@
1
- export { b as DesktopFooter, a as EnhancedMoreActions, c as Toolbar, d as default } from '../../chunk-Z275MVEP.js';
1
+ export { b as DesktopFooter, a as EnhancedMoreActions, c as Toolbar, d as default } from '../../chunk-E4Q7LX5L.js';
2
2
  import '../../chunk-R2BCPHRH.js';
3
3
  import '../../chunk-4F2NKGF6.js';
4
- import '../../chunk-NMGWHSNZ.js';
5
- import '../../chunk-6U5LS7MP.js';
4
+ import '../../chunk-7ZCLS5N5.js';
6
5
  import '../../chunk-LZQ7OFKO.js';
7
6
  import '../../chunk-NIQW2J3M.js';
7
+ import '../../chunk-6U5LS7MP.js';
8
8
  import '../../chunk-PRWQQJDL.js';
9
9
  export { c as ActionsContainer, d as ActionsDivider, a as Container, j as DataGridWrapper, b as Header, h as MobilePaginationContainer, o as MoreActionsPopover, g as SearchContainer, m as SelectionActions, l as SelectionCount, k as SelectionOverlay, e as ToolbarActionsDivider, f as Topbar } from '../../chunk-XUDTPZHF.js';
10
10
  import '../../chunk-UVPQR2Q2.js';
11
11
  import '../../chunk-RBTYTONM.js';
12
+ import '../../chunk-CO2KQFUN.js';
12
13
  import '../../chunk-F65ZXAGV.js';
13
14
  import '../../chunk-I4PPSW36.js';
14
- import '../../chunk-CO2KQFUN.js';
15
15
  import '../../chunk-2GTD4JW2.js';
16
16
  import '../../chunk-PBLSVXV5.js';
17
17
  import '../../chunk-LQRRMVFN.js';
@@ -1,30 +1,30 @@
1
1
  import '../../chunk-4P2L7UJA.js';
2
2
  export { a as FilterOperator, b as SortType } from '../../chunk-P64QBDAO.js';
3
3
  import { a as a$4 } from '../../chunk-WLRSUL67.js';
4
- import { d, c } from '../../chunk-N7IK5EUP.js';
4
+ import { d, c } from '../../chunk-A7QSCOUE.js';
5
5
  import { h, a as a$6 } from '../../chunk-OF6623HG.js';
6
- import { d as d$1 } from '../../chunk-Z275MVEP.js';
6
+ import { d as d$1 } from '../../chunk-E4Q7LX5L.js';
7
7
  import '../../chunk-R2BCPHRH.js';
8
8
  import '../../chunk-4F2NKGF6.js';
9
- import '../../chunk-NMGWHSNZ.js';
10
- import '../../chunk-6U5LS7MP.js';
9
+ import '../../chunk-7ZCLS5N5.js';
11
10
  import '../../chunk-LZQ7OFKO.js';
12
11
  import '../../chunk-NIQW2J3M.js';
12
+ import '../../chunk-6U5LS7MP.js';
13
13
  import '../../chunk-PRWQQJDL.js';
14
14
  import { a as a$5 } from '../../chunk-3PMDTIVB.js';
15
15
  import '../../chunk-5J35UAV6.js';
16
16
  import { e } from '../../chunk-XUDTPZHF.js';
17
17
  import '../../chunk-UVPQR2Q2.js';
18
18
  import '../../chunk-RBTYTONM.js';
19
+ import '../../chunk-CO2KQFUN.js';
20
+ import { a as a$8 } from '../../chunk-F6H765KA.js';
19
21
  import '../../chunk-F65ZXAGV.js';
20
22
  import '../../chunk-I4PPSW36.js';
21
23
  import { a as a$3 } from '../../chunk-6N456D64.js';
22
- import '../../chunk-CO2KQFUN.js';
23
24
  import { a } from '../../chunk-2GTD4JW2.js';
24
25
  import '../../chunk-PBLSVXV5.js';
25
26
  import '../../chunk-IAOMC4C4.js';
26
27
  import { a as a$1 } from '../../chunk-E3R7W7GK.js';
27
- import { a as a$8 } from '../../chunk-F6H765KA.js';
28
28
  import '../../chunk-LQRRMVFN.js';
29
29
  import { b } from '../../chunk-2ZJUGM2S.js';
30
30
  import '../../chunk-GLRLKFPS.js';
@@ -1,7 +1,7 @@
1
- export { r as ContentType, s as FileContentType, k as FileThumbnail, a as HelperText, b as MultiFilePreview, u as MultipleFileUpload, v as MultipleImageUpload, c as SingleFilePreview, w as SingleFileUpload, x as SingleImageUpload, y as UploadAvatar, z as UploadSimpleBox, n as compressImageWithoutCrop, m as convertToWebP, p as encodeFilenameForHeader, f as fileFormat, d as fileFormatByMimeType, e as fileFormatByName, i as fileNameByUrl, g as fileThumb, j as fileThumbnailClasses, h as fileTypeByUrl, o as getFileNameFromContentDisposition, l as isImageFile, q as useDropzoneUploader, t as useFileUploadService } from '../../chunk-7IG7ZHY7.js';
2
- import '../../chunk-SYOUADDE.js';
1
+ export { r as ContentType, s as FileContentType, k as FileThumbnail, a as HelperText, b as MultiFilePreview, u as MultipleFileUpload, v as MultipleImageUpload, c as SingleFilePreview, w as SingleFileUpload, x as SingleImageUpload, y as UploadAvatar, z as UploadSimpleBox, n as compressImageWithoutCrop, m as convertToWebP, p as encodeFilenameForHeader, f as fileFormat, d as fileFormatByMimeType, e as fileFormatByName, i as fileNameByUrl, g as fileThumb, j as fileThumbnailClasses, h as fileTypeByUrl, o as getFileNameFromContentDisposition, l as isImageFile, q as useDropzoneUploader, t as useFileUploadService } from '../../chunk-J3T26XV2.js';
3
2
  import '../../chunk-JFLONZMC.js';
4
3
  import '../../chunk-KGLU4CR2.js';
4
+ import '../../chunk-SYOUADDE.js';
5
5
  import '../../chunk-J5B2YJSR.js';
6
6
  import '../../chunk-EN24URDV.js';
7
7
  import '../../chunk-OF6623HG.js';
@@ -1,4 +1,4 @@
1
- import { d } from '../../chunk-N7IK5EUP.js';
1
+ import { d } from '../../chunk-A7QSCOUE.js';
2
2
  import s from '@mui/material/Typography';
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
4
 
@@ -1,12 +1,12 @@
1
1
  export { a as default } from '../../chunk-UJMWTYPH.js';
2
2
  import '../../chunk-U4I7JPER.js';
3
- import '../../chunk-JM3SE72J.js';
3
+ import '../../chunk-ENNGRPXU.js';
4
4
  import '../../chunk-373WGZZL.js';
5
+ import '../../chunk-Q2AVS24Z.js';
6
+ import '../../chunk-LNESYSHP.js';
5
7
  import '../../chunk-WUFEPE2G.js';
6
8
  import '../../chunk-BX2DSNRV.js';
7
9
  import '../../chunk-X4F3O7PX.js';
8
- import '../../chunk-Q2AVS24Z.js';
9
- import '../../chunk-LNESYSHP.js';
10
10
  import '../../chunk-YPL4KIKN.js';
11
11
  import '../../chunk-HBOBTNB5.js';
12
12
  import '../../chunk-GLRLKFPS.js';
@@ -1,6 +1,6 @@
1
1
  import { a as a$3 } from '../../../chunk-MSCOIJQ5.js';
2
- import { a } from '../../../chunk-X64QHBVQ.js';
3
2
  import { a as a$1 } from '../../../chunk-YXRL4O4H.js';
3
+ import { a } from '../../../chunk-X64QHBVQ.js';
4
4
  import '../../../chunk-RTC7H5E5.js';
5
5
  import { a as a$2 } from '../../../chunk-DLASFJON.js';
6
6
  import '../../../chunk-6N456D64.js';
@@ -1,7 +1,7 @@
1
- import { x, u, v, w } from '../../../chunk-7IG7ZHY7.js';
2
- import '../../../chunk-SYOUADDE.js';
1
+ import { x, u, v, w } from '../../../chunk-J3T26XV2.js';
3
2
  import '../../../chunk-JFLONZMC.js';
4
3
  import '../../../chunk-KGLU4CR2.js';
4
+ import '../../../chunk-SYOUADDE.js';
5
5
  import '../../../chunk-J5B2YJSR.js';
6
6
  import '../../../chunk-EN24URDV.js';
7
7
  import '../../../chunk-OF6623HG.js';
@@ -0,0 +1,33 @@
1
+ import { Pagination } from '../types/pagination.js';
2
+
3
+ interface UseInfiniteScrollOptions<TParams, TResponse, TRow, TPagination extends Pagination = Pagination> {
4
+ fetchFn: (params: TParams) => {
5
+ unwrap: () => Promise<TResponse>;
6
+ };
7
+ params: TParams;
8
+ getRows: (response: TResponse) => TRow[];
9
+ getPagination: (response: TResponse) => TPagination;
10
+ getNextPageParams: (pagination: TPagination) => Partial<TParams>;
11
+ }
12
+ declare const useInfiniteScroll: <TParams, TResponse, TRow, TPagination extends {
13
+ last_seek_id: string;
14
+ has_next: boolean;
15
+ processed_at: Date;
16
+ } = {
17
+ last_seek_id: string;
18
+ has_next: boolean;
19
+ processed_at: Date;
20
+ }>({ fetchFn, params, getRows, getPagination, getNextPageParams, }: UseInfiniteScrollOptions<TParams, TResponse, TRow, TPagination>) => {
21
+ rows: TRow[];
22
+ isLoading: boolean;
23
+ isFetching: boolean;
24
+ isFetchingNextPage: boolean;
25
+ isError: boolean;
26
+ pagination: TPagination | undefined;
27
+ refetch: () => Promise<void>;
28
+ prependRows: (newRows: TRow[]) => void;
29
+ updateRow: (predicate: (row: TRow) => boolean, updater: (row: TRow) => TRow) => void;
30
+ handleRowsScrollEnd: () => Promise<void>;
31
+ };
32
+
33
+ export { UseInfiniteScrollOptions, useInfiniteScroll as default };
@@ -0,0 +1,6 @@
1
+ import { useState, useRef, useCallback, useEffect } from 'react';
2
+
3
+ var k=({fetchFn:r,params:o,getRows:w,getPagination:d,getNextPageParams:m})=>{let[S,i]=useState([]),[E,x]=useState(!0),[N,I]=useState(!1),[l,h]=useState(!1),[O,c]=useState(!1),t=useRef(void 0),f=useRef(w),g=useRef(d),y=useRef(m);f.current=w,g.current=d,y.current=m;let T=useRef(!1),P=useCallback(async()=>{T.current?I(!0):x(!0);try{let e=await r(o).unwrap();t.current=g.current(e),i(f.current(e)),c(!1);}catch{c(!0);}finally{T.current?I(!1):(T.current=!0,x(!1));}},[r,o]),U=useCallback(async()=>{if(!t.current?.has_next||l)return;let e=y.current(t.current);h(!0);try{let n=await r({...o,...e}).unwrap();t.current=g.current(n),i(R=>[...R,...f.current(n)]),c(!1);}catch{c(!0);}finally{h(!1);}},[r,o,l]);useEffect(()=>{P();},[P]);let b=useCallback(e=>{i(n=>[...e,...n]);},[]),F=useCallback((e,n)=>{i(R=>R.map(p=>e(p)?n(p):p));},[]);return {rows:S,isLoading:E,isFetching:N,isFetchingNextPage:l,isError:O,pagination:t.current,refetch:P,prependRows:b,updateRow:F,handleRowsScrollEnd:U}},C=k;
4
+
5
+ export { C as default };
6
+ //# sourceMappingURL=useInfiniteScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/hooks/useInfiniteScroll.ts"],"names":["useCallback","useEffect","useRef","useState","useInfiniteScroll","fetchFn","params","getRows","getPagination","getNextPageParams","rows","setRows","isLoading","setIsLoading","isFetching","setIsFetching","isFetchingNextPage","setIsFetchingNextPage","isError","setIsError","paginationRef","getRowsRef","getPaginationRef","getNextPageParamsRef","initializedRef","fetchInitial","result","handleRowsScrollEnd","nextPageParams","prev","prependRows","newRows","updateRow","predicate","updater","row","useInfiniteScroll_default"],"mappings":"AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAiBzD,IAAMC,EAAoB,CAKxB,CACA,QAAAC,EACA,OAAAC,EACA,QAAAC,EACA,cAAAC,EACA,kBAAAC,CACF,IAAuE,CACrE,GAAM,CAACC,EAAMC,CAAO,EAAIR,EAAiB,CAAC,CAAC,EAErC,CAACS,EAAWC,CAAY,EAAIV,EAAS,EAAI,EACzC,CAACW,EAAYC,CAAa,EAAIZ,EAAS,EAAK,EAC5C,CAACa,EAAoBC,CAAqB,EAAId,EAAS,EAAK,EAE5D,CAACe,EAASC,CAAU,EAAIhB,EAAS,EAAK,EAEtCiB,EAAgBlB,EAAgC,MAAS,EAEzDmB,EAAanB,EAAOK,CAAO,EAC3Be,EAAmBpB,EAAOM,CAAa,EACvCe,EAAuBrB,EAAOO,CAAiB,EAErDY,EAAW,QAAUd,EACrBe,EAAiB,QAAUd,EAC3Be,EAAqB,QAAUd,EAE/B,IAAMe,EAAiBtB,EAAO,EAAK,EAE7BuB,EAAezB,EAAY,SAAY,CACtCwB,EAAe,QAGlBT,EAAc,EAAI,EAFlBF,EAAa,EAAI,EAKnB,GAAI,CACF,IAAMa,EAAS,MAAMrB,EAAQC,CAAM,EAAE,OAAO,EAE5Cc,EAAc,QAAUE,EAAiB,QAAQI,CAAM,EACvDf,EAAQU,EAAW,QAAQK,CAAM,CAAC,EAClCP,EAAW,EAAK,CAClB,MAAE,CACAA,EAAW,EAAI,CACjB,QAAE,CACKK,EAAe,QAIlBT,EAAc,EAAK,GAHnBS,EAAe,QAAU,GACzBX,EAAa,EAAK,EAItB,CACF,EAAG,CAACR,EAASC,CAAM,CAAC,EAEdqB,EAAsB3B,EAAY,SAAY,CAClD,GAAI,CAACoB,EAAc,SAAS,UAAYJ,EAAoB,OAE5D,IAAMY,EAAiBL,EAAqB,QAAQH,EAAc,OAAO,EAEzEH,EAAsB,EAAI,EAE1B,GAAI,CACF,IAAMS,EAAS,MAAMrB,EAAQ,CAC3B,GAAGC,EACH,GAAGsB,CACL,CAAC,EAAE,OAAO,EAEVR,EAAc,QAAUE,EAAiB,QAAQI,CAAM,EACvDf,EAAQkB,GAAQ,CAAC,GAAGA,EAAM,GAAGR,EAAW,QAAQK,CAAM,CAAC,CAAC,EACxDP,EAAW,EAAK,CAClB,MAAE,CACAA,EAAW,EAAI,CACjB,QAAE,CACAF,EAAsB,EAAK,CAC7B,CACF,EAAG,CAACZ,EAASC,EAAQU,CAAkB,CAAC,EAExCf,EAAU,IAAM,CACdwB,EAAa,CACf,EAAG,CAACA,CAAY,CAAC,EAEjB,IAAMK,EAAc9B,EAAa+B,GAAoB,CACnDpB,EAAQkB,GAAQ,CAAC,GAAGE,EAAS,GAAGF,CAAI,CAAC,CACvC,EAAG,CAAC,CAAC,EAECG,EAAYhC,EAChB,CAACiC,EAAmCC,IAAiC,CACnEvB,EAAQkB,GAAQA,EAAK,IAAIM,GAAQF,EAAUE,CAAG,EAAID,EAAQC,CAAG,EAAIA,CAAI,CAAC,CACxE,EACA,CAAC,CACH,EAEA,MAAO,CACL,KAAAzB,EAEA,UAAAE,EACA,WAAAE,EACA,mBAAAE,EAEA,QAAAE,EAEA,WAAYE,EAAc,QAC1B,QAASK,EAET,YAAAK,EACA,UAAAE,EAEA,oBAAAL,CACF,CACF,EAEOS,EAAQhC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Pagination } from 'types/pagination';\n\ninterface UseInfiniteScrollOptions<\n TParams,\n TResponse,\n TRow,\n TPagination extends Pagination = Pagination,\n> {\n fetchFn: (params: TParams) => { unwrap: () => Promise<TResponse> };\n params: TParams;\n getRows: (response: TResponse) => TRow[];\n getPagination: (response: TResponse) => TPagination;\n getNextPageParams: (pagination: TPagination) => Partial<TParams>;\n}\n\nconst useInfiniteScroll = <\n TParams,\n TResponse,\n TRow,\n TPagination extends Pagination = Pagination,\n>({\n fetchFn,\n params,\n getRows,\n getPagination,\n getNextPageParams,\n}: UseInfiniteScrollOptions<TParams, TResponse, TRow, TPagination>) => {\n const [rows, setRows] = useState<TRow[]>([]);\n\n const [isLoading, setIsLoading] = useState(true);\n const [isFetching, setIsFetching] = useState(false);\n const [isFetchingNextPage, setIsFetchingNextPage] = useState(false);\n\n const [isError, setIsError] = useState(false);\n\n const paginationRef = useRef<TPagination | undefined>(undefined);\n\n const getRowsRef = useRef(getRows);\n const getPaginationRef = useRef(getPagination);\n const getNextPageParamsRef = useRef(getNextPageParams);\n\n getRowsRef.current = getRows;\n getPaginationRef.current = getPagination;\n getNextPageParamsRef.current = getNextPageParams;\n\n const initializedRef = useRef(false);\n\n const fetchInitial = useCallback(async () => {\n if (!initializedRef.current) {\n setIsLoading(true);\n } else {\n setIsFetching(true);\n }\n\n try {\n const result = await fetchFn(params).unwrap();\n\n paginationRef.current = getPaginationRef.current(result);\n setRows(getRowsRef.current(result));\n setIsError(false);\n } catch {\n setIsError(true);\n } finally {\n if (!initializedRef.current) {\n initializedRef.current = true;\n setIsLoading(false);\n } else {\n setIsFetching(false);\n }\n }\n }, [fetchFn, params]);\n\n const handleRowsScrollEnd = useCallback(async () => {\n if (!paginationRef.current?.has_next || isFetchingNextPage) return;\n\n const nextPageParams = getNextPageParamsRef.current(paginationRef.current);\n\n setIsFetchingNextPage(true);\n\n try {\n const result = await fetchFn({\n ...params,\n ...nextPageParams,\n }).unwrap();\n\n paginationRef.current = getPaginationRef.current(result);\n setRows(prev => [...prev, ...getRowsRef.current(result)]);\n setIsError(false);\n } catch {\n setIsError(true);\n } finally {\n setIsFetchingNextPage(false);\n }\n }, [fetchFn, params, isFetchingNextPage]);\n\n useEffect(() => {\n fetchInitial();\n }, [fetchInitial]);\n\n const prependRows = useCallback((newRows: TRow[]) => {\n setRows(prev => [...newRows, ...prev]);\n }, []);\n\n const updateRow = useCallback(\n (predicate: (row: TRow) => boolean, updater: (row: TRow) => TRow) => {\n setRows(prev => prev.map(row => (predicate(row) ? updater(row) : row)));\n },\n [],\n );\n\n return {\n rows,\n\n isLoading,\n isFetching,\n isFetchingNextPage,\n\n isError,\n\n pagination: paginationRef.current,\n refetch: fetchInitial,\n\n prependRows,\n updateRow,\n\n handleRowsScrollEnd,\n };\n};\n\nexport default useInfiniteScroll;\nexport type { UseInfiniteScrollOptions };\n"]}
@@ -1,11 +1,11 @@
1
1
  export { a as useThemeToggle } from '../chunk-U4I7JPER.js';
2
- import '../chunk-JM3SE72J.js';
2
+ import '../chunk-ENNGRPXU.js';
3
3
  import '../chunk-373WGZZL.js';
4
+ import '../chunk-Q2AVS24Z.js';
5
+ import '../chunk-LNESYSHP.js';
4
6
  import '../chunk-WUFEPE2G.js';
5
7
  import '../chunk-BX2DSNRV.js';
6
8
  import '../chunk-X4F3O7PX.js';
7
- import '../chunk-Q2AVS24Z.js';
8
- import '../chunk-LNESYSHP.js';
9
9
  import '../chunk-YPL4KIKN.js';
10
10
  import '../chunk-HBOBTNB5.js';
11
11
  import '../chunk-GLRLKFPS.js';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CustomShadows } from './index-c8f1e6e7.js';
2
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-c8f1e6e7.js';
1
+ import { C as CustomShadows } from './index-5a5e5dc8.js';
2
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-5a5e5dc8.js';
3
3
  export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-38d09283.js';
4
4
  export { THEME_CONFIG, default as ThemeProvider } from './theme/theme-provider.js';
5
5
  import { S as SettingsState } from './settings-583c107c.js';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  export { a as useThemeToggle } from './chunk-U4I7JPER.js';
2
- export { b as ThemeProvider, a as createTheme } from './chunk-JM3SE72J.js';
2
+ export { b as ThemeProvider, a as createTheme } from './chunk-ENNGRPXU.js';
3
3
  import './chunk-373WGZZL.js';
4
+ import './chunk-Q2AVS24Z.js';
5
+ import './chunk-LNESYSHP.js';
4
6
  import './chunk-WUFEPE2G.js';
5
7
  export { c as SettingsProvider, b as useSettingsContext } from './chunk-BX2DSNRV.js';
6
8
  export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-X4F3O7PX.js';
7
- import './chunk-Q2AVS24Z.js';
8
- import './chunk-LNESYSHP.js';
9
9
  export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from './chunk-YPL4KIKN.js';
10
10
  import './chunk-HBOBTNB5.js';
11
11
  export { a as THEME_CONFIG, q as bgBlur, p as bgGradient, o as borderGradient, j as createPaletteChannel, h as hexToRgbChannel, i as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, c as mediaQueries, t as menuItem, s as paper, f as pxToRem, e as remToPx, g as responsiveFontSizes, d as setFont, b as stylesMode, n as textGradient, k as varAlpha } from './chunk-GLRLKFPS.js';
@@ -1,4 +1,4 @@
1
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-c8f1e6e7.js';
1
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-5a5e5dc8.js';
2
2
  import '@mui/lab/TimelineConnector';
3
3
  import '@mui/system';
4
4
  import '@mui/lab/TimelineDot';
@@ -173,7 +173,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
173
173
  float?: csstype.Property.Float | readonly NonNullable<csstype.Property.Float | undefined>[] | readonly csstype.Property.Float[] | undefined;
174
174
  floodColor?: readonly string[] | csstype.Property.FloodColor | readonly csstype.Property.FloodColor[] | undefined;
175
175
  floodOpacity?: readonly ((string & {}) | csstype.Globals)[] | csstype.Property.FloodOpacity | readonly NonNullable<csstype.Property.FloodOpacity | undefined>[] | undefined;
176
- fontFamily?: readonly string[] | csstype.Property.FontFamily | readonly csstype.Property.FontFamily[] | undefined;
176
+ fontFamily?: csstype.Property.FontFamily | readonly string[] | readonly csstype.Property.FontFamily[] | undefined;
177
177
  fontFeatureSettings?: readonly string[] | csstype.Property.FontFeatureSettings | readonly csstype.Property.FontFeatureSettings[] | undefined;
178
178
  fontKerning?: csstype.Property.FontKerning | readonly NonNullable<csstype.Property.FontKerning | undefined>[] | readonly csstype.Property.FontKerning[] | undefined;
179
179
  fontLanguageOverride?: readonly string[] | csstype.Property.FontLanguageOverride | readonly csstype.Property.FontLanguageOverride[] | undefined;
@@ -197,7 +197,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
197
197
  fontVariantNumeric?: readonly string[] | csstype.Property.FontVariantNumeric | readonly csstype.Property.FontVariantNumeric[] | undefined;
198
198
  fontVariantPosition?: csstype.Property.FontVariantPosition | readonly NonNullable<csstype.Property.FontVariantPosition | undefined>[] | readonly csstype.Property.FontVariantPosition[] | undefined;
199
199
  fontVariationSettings?: readonly string[] | csstype.Property.FontVariationSettings | readonly csstype.Property.FontVariationSettings[] | undefined;
200
- fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ("bold" | (string & {}) | csstype.Globals | "normal" | "bolder" | "lighter")[] | undefined;
200
+ fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "bold" | "normal" | "bolder" | "lighter")[] | undefined;
201
201
  fontWidth?: readonly string[] | csstype.Property.FontWidth | readonly csstype.Property.FontWidth[] | undefined;
202
202
  forcedColorAdjust?: csstype.Property.ForcedColorAdjust | readonly NonNullable<csstype.Property.ForcedColorAdjust | undefined>[] | readonly csstype.Property.ForcedColorAdjust[] | undefined;
203
203
  gridAutoColumns?: readonly (string | (string & {}))[] | csstype.Property.GridAutoColumns<string | number> | readonly NonNullable<csstype.Property.GridAutoColumns<string | number> | undefined>[] | undefined;
@@ -462,7 +462,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
462
462
  zIndex?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
463
463
  zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
464
464
  all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
465
- animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
465
+ animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
466
466
  animationRange?: readonly (string | (string & {}))[] | csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | undefined;
467
467
  background?: readonly (string | (string & {}))[] | csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | undefined;
468
468
  border?: readonly (string | (string & {}))[] | csstype.Property.Border<string | number> | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
@@ -474,7 +474,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
474
474
  borderBlockWidth?: readonly (string | (string & {}))[] | csstype.Property.BorderBlockWidth<string | number> | readonly NonNullable<csstype.Property.BorderBlockWidth<string | number> | undefined>[] | undefined;
475
475
  borderBottom?: readonly (string | (string & {}))[] | csstype.Property.BorderBottom<string | number> | readonly NonNullable<csstype.Property.BorderBottom<string | number> | undefined>[] | undefined;
476
476
  borderColor?: readonly string[] | csstype.Property.BorderColor | readonly csstype.Property.BorderColor[] | undefined;
477
- borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
477
+ borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
478
478
  borderInline?: readonly (string | (string & {}))[] | csstype.Property.BorderInline<string | number> | readonly NonNullable<csstype.Property.BorderInline<string | number> | undefined>[] | undefined;
479
479
  borderInlineColor?: readonly string[] | csstype.Property.BorderInlineColor | readonly csstype.Property.BorderInlineColor[] | undefined;
480
480
  borderInlineEnd?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineEnd<string | number> | readonly NonNullable<csstype.Property.BorderInlineEnd<string | number> | undefined>[] | undefined;
@@ -509,7 +509,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
509
509
  marginBlock?: readonly (string | (string & {}))[] | csstype.Property.MarginBlock<string | number> | readonly NonNullable<csstype.Property.MarginBlock<string | number> | undefined>[] | undefined;
510
510
  marginInline?: readonly (string | (string & {}))[] | csstype.Property.MarginInline<string | number> | readonly NonNullable<csstype.Property.MarginInline<string | number> | undefined>[] | undefined;
511
511
  mask?: readonly (string | (string & {}))[] | csstype.Property.Mask<string | number> | readonly NonNullable<csstype.Property.Mask<string | number> | undefined>[] | undefined;
512
- maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
512
+ maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
513
513
  motion?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
514
514
  offset?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
515
515
  outline?: readonly (string | (string & {}))[] | csstype.Property.Outline<string | number> | readonly NonNullable<csstype.Property.Outline<string | number> | undefined>[] | undefined;
@@ -758,8 +758,8 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
758
758
  WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
759
759
  WebkitUserSelect?: csstype.Property.WebkitUserSelect | readonly NonNullable<csstype.Property.WebkitUserSelect | undefined>[] | readonly csstype.Property.WebkitUserSelect[] | undefined;
760
760
  WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
761
- MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
762
- MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
761
+ MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
762
+ MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
763
763
  MozColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
764
764
  MozColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
765
765
  MozOutlineRadius?: readonly (string | (string & {}))[] | csstype.Property.MozOutlineRadius<string | number> | readonly NonNullable<csstype.Property.MozOutlineRadius<string | number> | undefined>[] | undefined;
@@ -771,16 +771,16 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
771
771
  msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
772
772
  msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
773
773
  msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
774
- WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
774
+ WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
775
775
  WebkitBorderBefore?: readonly (string | (string & {}))[] | csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | undefined;
776
- WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
776
+ WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
777
777
  WebkitBorderRadius?: readonly (string | (string & {}))[] | csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | undefined;
778
778
  WebkitColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
779
779
  WebkitColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
780
780
  WebkitFlex?: readonly (string | (string & {}))[] | csstype.Property.Flex<string | number> | readonly NonNullable<csstype.Property.Flex<string | number> | undefined>[] | undefined;
781
781
  WebkitFlexFlow?: readonly string[] | csstype.Property.FlexFlow | readonly csstype.Property.FlexFlow[] | undefined;
782
782
  WebkitMask?: readonly (string | (string & {}))[] | csstype.Property.WebkitMask<string | number> | readonly NonNullable<csstype.Property.WebkitMask<string | number> | undefined>[] | undefined;
783
- WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
783
+ WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
784
784
  WebkitTextEmphasis?: readonly string[] | csstype.Property.TextEmphasis | readonly csstype.Property.TextEmphasis[] | undefined;
785
785
  WebkitTextStroke?: readonly (string | (string & {}))[] | csstype.Property.WebkitTextStroke<string | number> | readonly NonNullable<csstype.Property.WebkitTextStroke<string | number> | undefined>[] | undefined;
786
786
  WebkitTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
@@ -861,7 +861,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
861
861
  MozUserFocus?: csstype.Property.MozUserFocus | readonly NonNullable<csstype.Property.MozUserFocus | undefined>[] | readonly csstype.Property.MozUserFocus[] | undefined;
862
862
  MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
863
863
  msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
864
- OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
864
+ OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
865
865
  OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
866
866
  OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
867
867
  OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
@@ -871,7 +871,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
871
871
  OAnimationPlayState?: readonly string[] | csstype.Property.AnimationPlayState | readonly csstype.Property.AnimationPlayState[] | undefined;
872
872
  OAnimationTimingFunction?: readonly string[] | csstype.Property.AnimationTimingFunction | readonly csstype.Property.AnimationTimingFunction[] | undefined;
873
873
  OBackgroundSize?: readonly (string | (string & {}))[] | csstype.Property.BackgroundSize<string | number> | readonly NonNullable<csstype.Property.BackgroundSize<string | number> | undefined>[] | undefined;
874
- OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
874
+ OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
875
875
  OObjectFit?: csstype.Property.ObjectFit | readonly NonNullable<csstype.Property.ObjectFit | undefined>[] | readonly csstype.Property.ObjectFit[] | undefined;
876
876
  OObjectPosition?: readonly (string | (string & {}))[] | csstype.Property.ObjectPosition<string | number> | readonly NonNullable<csstype.Property.ObjectPosition<string | number> | undefined>[] | undefined;
877
877
  OTabSize?: readonly (string | (string & {}))[] | csstype.Property.TabSize<string | number> | readonly NonNullable<csstype.Property.TabSize<string | number> | undefined>[] | undefined;
@@ -1,10 +1,10 @@
1
- export { b as default } from '../chunk-JM3SE72J.js';
1
+ export { b as default } from '../chunk-ENNGRPXU.js';
2
2
  import '../chunk-373WGZZL.js';
3
+ import '../chunk-Q2AVS24Z.js';
4
+ import '../chunk-LNESYSHP.js';
3
5
  import '../chunk-WUFEPE2G.js';
4
6
  export { b as useSettingsContext } from '../chunk-BX2DSNRV.js';
5
7
  import '../chunk-X4F3O7PX.js';
6
- import '../chunk-Q2AVS24Z.js';
7
- import '../chunk-LNESYSHP.js';
8
8
  import '../chunk-YPL4KIKN.js';
9
9
  import '../chunk-HBOBTNB5.js';
10
10
  export { a as THEME_CONFIG } from '../chunk-GLRLKFPS.js';
@@ -0,0 +1,11 @@
1
+ type Pagination<T = unknown> = {
2
+ last_seek_id: string;
3
+ has_next: boolean;
4
+ processed_at: Date;
5
+ } & T;
6
+ type PaginationRequest<T = unknown> = {
7
+ last_seek_id?: string;
8
+ limit?: number;
9
+ } & T;
10
+
11
+ export { Pagination, PaginationRequest };
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -20,6 +20,7 @@ declare function fDate(date: DatePickerFormat, format?: string): string | null;
20
20
  declare function fTime(date: DatePickerFormat, format?: string): string | null;
21
21
  declare function fTimestamp(date: DatePickerFormat): number | "Invalid time value" | null;
22
22
  declare function fToNow(date: DatePickerFormat): string | null;
23
+ declare function fTimeLeft(date: DatePickerFormat): string | null;
23
24
  declare function fIsBetween(inputDate: DatePickerFormat, startDate: DatePickerFormat, endDate: DatePickerFormat): boolean;
24
25
  declare function fIsAfter(startDate: DatePickerFormat, endDate: DatePickerFormat): boolean;
25
26
  declare function fIsSame(startDate: DatePickerFormat, endDate: DatePickerFormat, units?: OpUnitType): boolean | "Invalid time value";
@@ -37,4 +38,4 @@ declare function fAdd({ years, months, days, hours, minutes, seconds, millisecon
37
38
  declare function fSub({ years, months, days, hours, minutes, seconds, milliseconds, }: DurationProps): string;
38
39
  declare const getDifferenceInDays: (startDate?: Date, endDate?: Date) => number | null;
39
40
 
40
- export { DatePickerFormat, DurationProps, fAdd, fDate, fDateRangeShortLabel, fDateTime, fIsAfter, fIsBetween, fIsSame, fSub, fTime, fTimestamp, fToNow, formatStr, getDifferenceInDays, today };
41
+ export { DatePickerFormat, DurationProps, fAdd, fDate, fDateRangeShortLabel, fDateTime, fIsAfter, fIsBetween, fIsSame, fSub, fTime, fTimeLeft, fTimestamp, fToNow, formatStr, getDifferenceInDays, today };
@@ -1,2 +1,2 @@
1
- export { l as fAdd, d as fDate, k as fDateRangeShortLabel, c as fDateTime, i as fIsAfter, h as fIsBetween, j as fIsSame, m as fSub, e as fTime, f as fTimestamp, g as fToNow, a as formatStr, n as getDifferenceInDays, b as today } from '../chunk-N7IK5EUP.js';
1
+ export { m as fAdd, d as fDate, l as fDateRangeShortLabel, c as fDateTime, j as fIsAfter, i as fIsBetween, k as fIsSame, n as fSub, e as fTime, h as fTimeLeft, f as fTimestamp, g as fToNow, a as formatStr, o as getDifferenceInDays, b as today } from '../chunk-A7QSCOUE.js';
2
2
  //# sourceMappingURL=formatTime.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.8.85",
3
+ "version": "2.8.86",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -1,8 +0,0 @@
1
- import t from 'dayjs';
2
- import p from 'dayjs/plugin/duration';
3
- import D from 'dayjs/plugin/relativeTime';
4
-
5
- t.extend(p);t.extend(D);var c={dateTime:"DD/MM/YYYY HH:mm",date:"DD/MM/YYYY",time:"HH:mm",split:{dateTime:"DD/MM/YYYY HH:mm",date:"DD/MM/YYYY"},paramCase:{dateTime:"DD/MM/YYYY HH:mm",date:"DD/MM/YYYY"}};function P(r){return t(new Date).startOf("day").format(r)}function v(r,i){return r?t(r).isValid()?t(r).format(i??c.dateTime):"Invalid time value":null}function u(r,i){return r?t(r).isValid()?t(r).format(i??c.date):"Invalid time value":null}function M(r,i){return r?t(r).isValid()?t(r).format(i??c.time):"Invalid time value":null}function l(r){return r?t(r).isValid()?t(r).valueOf():"Invalid time value":null}function k(r){return r?t(r).isValid()?t(r).toNow(!0):"Invalid time value":null}function F(r,i,e){if(!r||!i||!e)return !1;let o=l(r),a=l(i),n=l(e);return o&&a&&n?o>=a&&o<=n:!1}function Y(r,i){return t(r).isAfter(i)}function f(r,i,e){return !r||!i?!1:t(r).isValid()&&t(i).isValid()?t(r).isSame(i,e??"year"):"Invalid time value"}function b(r,i,e){let o=t(r).isValid()&&t(i).isValid(),a=Y(r,i);if(!o||a)return "Invalid time value";let n=`${u(r)} - ${u(i)}`;if(e)return n;let m=f(r,i,"year"),s=f(r,i,"month"),d=f(r,i,"day");return m&&!s?n=`${u(r,"DD MMM")} - ${u(i)}`:m&&s&&!d?n=`${u(r,"DD")} - ${u(i)}`:m&&s&&d&&(n=`${u(i)}`),n}function I({years:r=0,months:i=0,days:e=0,hours:o=0,minutes:a=0,seconds:n=0,milliseconds:m=0}){return t().add(t.duration({years:r,months:i,days:e,hours:o,minutes:a,seconds:n,milliseconds:m})).format()}function T({years:r=0,months:i=0,days:e=0,hours:o=0,minutes:a=0,seconds:n=0,milliseconds:m=0}){return t().subtract(t.duration({years:r,months:i,days:e,hours:o,minutes:a,seconds:n,milliseconds:m})).format()}var S=(r,i)=>!r||!i?null:t(i).diff(t(r),"day");
6
-
7
- export { c as a, P as b, v as c, u as d, M as e, l as f, k as g, F as h, Y as i, f as j, b as k, I as l, T as m, S as n };
8
- //# sourceMappingURL=chunk-N7IK5EUP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/formatTime.ts"],"names":["dayjs","duration","relativeTime","formatStr","today","format","fDateTime","date","fDate","fTime","fTimestamp","fToNow","fIsBetween","inputDate","startDate","endDate","formattedInputDate","formattedStartDate","formattedEndDate","fIsAfter","fIsSame","units","fDateRangeShortLabel","initial","isValid","isAfter","label","isSameYear","isSameMonth","isSameDay","fAdd","years","months","days","hours","minutes","seconds","milliseconds","fSub","getDifferenceInDays"],"mappings":"AACA,OAAOA,MAAW,QAClB,OAAOC,MAAc,wBACrB,OAAOC,MAAkB,4BAIzBF,EAAM,OAAOC,CAAQ,EACrBD,EAAM,OAAOE,CAAY,EAYlB,IAAMC,EAAY,CACvB,SAAU,mBACV,KAAM,aACN,KAAM,QACN,MAAO,CACL,SAAU,mBACV,KAAM,YACR,EACA,UAAW,CACT,SAAU,mBACV,KAAM,YACR,CACF,EAEO,SAASC,EAAMC,EAAiB,CACrC,OAAOL,EAAM,IAAI,IAAM,EAAE,QAAQ,KAAK,EAAE,OAAOK,CAAM,CACvD,CAEO,SAASC,EAAUC,EAAwBF,EAAiB,CACjE,OAAKE,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAGhCP,EAAMO,CAAI,EAAE,OAAOF,GAAUF,EAAU,QAAQ,EAC/C,qBAPK,IAQX,CAEO,SAASK,EAAMD,EAAwBF,EAAiB,CAC7D,OAAKE,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAGhCP,EAAMO,CAAI,EAAE,OAAOF,GAAUF,EAAU,IAAI,EAC3C,qBAPK,IAQX,CAEO,SAASM,EAAMF,EAAwBF,EAAiB,CAC7D,OAAKE,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAGhCP,EAAMO,CAAI,EAAE,OAAOF,GAAUF,EAAU,IAAI,EAC3C,qBAPK,IAQX,CAEO,SAASO,EAAWH,EAAwB,CACjD,OAAKA,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAEnBP,EAAMO,CAAI,EAAE,QAAQ,EAAI,qBALhC,IAMX,CAEO,SAASI,EAAOJ,EAAwB,CAC7C,OAAKA,EAIWP,EAAMO,CAAI,EAAE,QAAQ,EAEnBP,EAAMO,CAAI,EAAE,MAAM,EAAI,EAAI,qBALlC,IAMX,CAEO,SAASK,EACdC,EACAC,EACAC,EACA,CACA,GAAI,CAACF,GAAa,CAACC,GAAa,CAACC,EAC/B,MAAO,GAGT,IAAMC,EAAqBN,EAAWG,CAAS,EACzCI,EAAqBP,EAAWI,CAAS,EACzCI,EAAmBR,EAAWK,CAAO,EAE3C,OAAIC,GAAsBC,GAAsBC,EAE5CF,GAAsBC,GACtBD,GAAsBE,EAInB,EACT,CAEO,SAASC,EACdL,EACAC,EACA,CACA,OAAOf,EAAMc,CAAS,EAAE,QAAQC,CAAO,CACzC,CAEO,SAASK,EACdN,EACAC,EACAM,EACA,CACA,MAAI,CAACP,GAAa,CAACC,EACV,GAGOf,EAAMc,CAAS,EAAE,QAAQ,GAAKd,EAAMe,CAAO,EAAE,QAAQ,EAM9Df,EAAMc,CAAS,EAAE,OAAOC,EAASM,GAAS,MAAM,EAH9C,oBAIX,CAEO,SAASC,EACdR,EACAC,EACAQ,EACA,CACA,IAAMC,EAAUxB,EAAMc,CAAS,EAAE,QAAQ,GAAKd,EAAMe,CAAO,EAAE,QAAQ,EAE/DU,EAAUN,EAASL,EAAWC,CAAO,EAE3C,GAAI,CAACS,GAAWC,EACd,MAAO,qBAGT,IAAIC,EAAQ,GAAGlB,EAAMM,CAAS,OAAON,EAAMO,CAAO,IAElD,GAAIQ,EACF,OAAOG,EAGT,IAAMC,EAAaP,EAAQN,EAAWC,EAAS,MAAM,EAC/Ca,EAAcR,EAAQN,EAAWC,EAAS,OAAO,EACjDc,EAAYT,EAAQN,EAAWC,EAAS,KAAK,EAEnD,OAAIY,GAAc,CAACC,EACjBF,EAAQ,GAAGlB,EAAMM,EAAW,QAAQ,OAAON,EAAMO,CAAO,IAC/CY,GAAcC,GAAe,CAACC,EACvCH,EAAQ,GAAGlB,EAAMM,EAAW,IAAI,OAAON,EAAMO,CAAO,IAC3CY,GAAcC,GAAeC,IACtCH,EAAQ,GAAGlB,EAAMO,CAAO,KAGnBW,CACT,CAYO,SAASI,EAAK,CACnB,MAAAC,EAAQ,EACR,OAAAC,EAAS,EACT,KAAAC,EAAO,EACP,MAAAC,EAAQ,EACR,QAAAC,EAAU,EACV,QAAAC,EAAU,EACV,aAAAC,EAAe,CACjB,EAAkB,CAehB,OAderC,EAAM,EAClB,IACCA,EAAM,SAAS,CACb,MAAA+B,EACA,OAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,QAAAC,EACA,aAAAC,CACF,CAAC,CACH,EACC,OAAO,CAGZ,CAEO,SAASC,EAAK,CACnB,MAAAP,EAAQ,EACR,OAAAC,EAAS,EACT,KAAAC,EAAO,EACP,MAAAC,EAAQ,EACR,QAAAC,EAAU,EACV,QAAAC,EAAU,EACV,aAAAC,EAAe,CACjB,EAAkB,CAehB,OAderC,EAAM,EAClB,SACCA,EAAM,SAAS,CACb,MAAA+B,EACA,OAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,QAAAC,EACA,aAAAC,CACF,CAAC,CACH,EACC,OAAO,CAGZ,CAEO,IAAME,EAAsB,CAACzB,EAAkBC,IAChD,CAACD,GAAa,CAACC,EAAgB,KAE5Bf,EAAMe,CAAO,EAAE,KAAKf,EAAMc,CAAS,EAAG,KAAK","sourcesContent":["import type { Dayjs, OpUnitType } from 'dayjs';\nimport dayjs from 'dayjs';\nimport duration from 'dayjs/plugin/duration';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\n// ----------------------------------------------------------------------\n\ndayjs.extend(duration);\ndayjs.extend(relativeTime);\n\n// ----------------------------------------------------------------------\n\nexport type DatePickerFormat =\n | Dayjs\n | Date\n | string\n | number\n | null\n | undefined;\n\nexport const formatStr = {\n dateTime: 'DD/MM/YYYY HH:mm',\n date: 'DD/MM/YYYY',\n time: 'HH:mm',\n split: {\n dateTime: 'DD/MM/YYYY HH:mm',\n date: 'DD/MM/YYYY',\n },\n paramCase: {\n dateTime: 'DD/MM/YYYY HH:mm',\n date: 'DD/MM/YYYY',\n },\n};\n\nexport function today(format?: string) {\n return dayjs(new Date()).startOf('day').format(format);\n}\n\nexport function fDateTime(date: DatePickerFormat, format?: string) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid\n ? dayjs(date).format(format ?? formatStr.dateTime)\n : 'Invalid time value';\n}\n\nexport function fDate(date: DatePickerFormat, format?: string) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid\n ? dayjs(date).format(format ?? formatStr.date)\n : 'Invalid time value';\n}\n\nexport function fTime(date: DatePickerFormat, format?: string) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid\n ? dayjs(date).format(format ?? formatStr.time)\n : 'Invalid time value';\n}\n\nexport function fTimestamp(date: DatePickerFormat) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid ? dayjs(date).valueOf() : 'Invalid time value';\n}\n\nexport function fToNow(date: DatePickerFormat) {\n if (!date) {\n return null;\n }\n\n const isValid = dayjs(date).isValid();\n\n return isValid ? dayjs(date).toNow(true) : 'Invalid time value';\n}\n\nexport function fIsBetween(\n inputDate: DatePickerFormat,\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n) {\n if (!inputDate || !startDate || !endDate) {\n return false;\n }\n\n const formattedInputDate = fTimestamp(inputDate);\n const formattedStartDate = fTimestamp(startDate);\n const formattedEndDate = fTimestamp(endDate);\n\n if (formattedInputDate && formattedStartDate && formattedEndDate) {\n return (\n formattedInputDate >= formattedStartDate &&\n formattedInputDate <= formattedEndDate\n );\n }\n\n return false;\n}\n\nexport function fIsAfter(\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n) {\n return dayjs(startDate).isAfter(endDate);\n}\n\nexport function fIsSame(\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n units?: OpUnitType,\n) {\n if (!startDate || !endDate) {\n return false;\n }\n\n const isValid = dayjs(startDate).isValid() && dayjs(endDate).isValid();\n\n if (!isValid) {\n return 'Invalid time value';\n }\n\n return dayjs(startDate).isSame(endDate, units ?? 'year');\n}\n\nexport function fDateRangeShortLabel(\n startDate: DatePickerFormat,\n endDate: DatePickerFormat,\n initial?: boolean,\n) {\n const isValid = dayjs(startDate).isValid() && dayjs(endDate).isValid();\n\n const isAfter = fIsAfter(startDate, endDate);\n\n if (!isValid || isAfter) {\n return 'Invalid time value';\n }\n\n let label = `${fDate(startDate)} - ${fDate(endDate)}`;\n\n if (initial) {\n return label;\n }\n\n const isSameYear = fIsSame(startDate, endDate, 'year');\n const isSameMonth = fIsSame(startDate, endDate, 'month');\n const isSameDay = fIsSame(startDate, endDate, 'day');\n\n if (isSameYear && !isSameMonth) {\n label = `${fDate(startDate, 'DD MMM')} - ${fDate(endDate)}`;\n } else if (isSameYear && isSameMonth && !isSameDay) {\n label = `${fDate(startDate, 'DD')} - ${fDate(endDate)}`;\n } else if (isSameYear && isSameMonth && isSameDay) {\n label = `${fDate(endDate)}`;\n }\n\n return label;\n}\n\nexport type DurationProps = {\n years?: number;\n months?: number;\n days?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n};\n\nexport function fAdd({\n years = 0,\n months = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n}: DurationProps) {\n const result = dayjs()\n .add(\n dayjs.duration({\n years,\n months,\n days,\n hours,\n minutes,\n seconds,\n milliseconds,\n }),\n )\n .format();\n\n return result;\n}\n\nexport function fSub({\n years = 0,\n months = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n}: DurationProps) {\n const result = dayjs()\n .subtract(\n dayjs.duration({\n years,\n months,\n days,\n hours,\n minutes,\n seconds,\n milliseconds,\n }),\n )\n .format();\n\n return result;\n}\n\nexport const getDifferenceInDays = (startDate?: Date, endDate?: Date) => {\n if (!startDate || !endDate) return null;\n\n return dayjs(endDate).diff(dayjs(startDate), 'day');\n};\n"]}
@@ -286,13 +286,10 @@ declare const components: {
286
286
  MuiTimelineDot: {
287
287
  defaultProps?: Partial<_mui_lab_TimelineDot.TimelineDotProps> | undefined;
288
288
  styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<keyof _mui_lab_TimelineDot.TimelineDotClasses, "MuiTimelineDot", {
289
- cssVarPrefix: string;
290
- zIndex: _mui_material.ZIndex;
291
- direction: _mui_system.Direction;
292
- opacity: _mui_material.Opacity;
293
- typography: _mui_material.TypographyVariants;
289
+ transitions: _mui_material.Transitions;
294
290
  palette: _mui_material.Palette;
295
291
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
292
+ cssVarPrefix: string;
296
293
  vars: _mui_material.ThemeVars;
297
294
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
298
295
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -303,13 +300,16 @@ declare const components: {
303
300
  spacing: _mui_system.Spacing;
304
301
  breakpoints: _mui_system.Breakpoints;
305
302
  shape: _mui_system.Shape;
306
- transitions: _mui_material.Transitions;
303
+ typography: _mui_material.TypographyVariants;
307
304
  shadows: _mui_material.Shadows;
308
305
  mixins: _mui_material.Mixins;
306
+ zIndex: _mui_material.ZIndex;
307
+ direction: _mui_system.Direction;
309
308
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
310
309
  unstable_sxConfig: _mui_system.SxConfig;
311
310
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
312
311
  applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
312
+ opacity: _mui_material.Opacity;
313
313
  overlays: _mui_material.Overlays;
314
314
  customShadows: CustomShadows;
315
315
  unstable_strictMode?: boolean | undefined;
@@ -326,13 +326,10 @@ declare const components: {
326
326
  MuiTimelineConnector: {
327
327
  defaultProps?: Partial<_mui_lab_TimelineConnector.TimelineConnectorProps> | undefined;
328
328
  styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<"root", "MuiTimelineConnector", {
329
- cssVarPrefix: string;
330
- zIndex: _mui_material.ZIndex;
331
- direction: _mui_system.Direction;
332
- opacity: _mui_material.Opacity;
333
- typography: _mui_material.TypographyVariants;
329
+ transitions: _mui_material.Transitions;
334
330
  palette: _mui_material.Palette;
335
331
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
332
+ cssVarPrefix: string;
336
333
  vars: _mui_material.ThemeVars;
337
334
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
338
335
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -343,13 +340,16 @@ declare const components: {
343
340
  spacing: _mui_system.Spacing;
344
341
  breakpoints: _mui_system.Breakpoints;
345
342
  shape: _mui_system.Shape;
346
- transitions: _mui_material.Transitions;
343
+ typography: _mui_material.TypographyVariants;
347
344
  shadows: _mui_material.Shadows;
348
345
  mixins: _mui_material.Mixins;
346
+ zIndex: _mui_material.ZIndex;
347
+ direction: _mui_system.Direction;
349
348
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
350
349
  unstable_sxConfig: _mui_system.SxConfig;
351
350
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
352
351
  applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
352
+ opacity: _mui_material.Opacity;
353
353
  overlays: _mui_material.Overlays;
354
354
  customShadows: CustomShadows;
355
355
  unstable_strictMode?: boolean | undefined;