@zydon/common 2.8.68 → 2.8.69

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 (96) hide show
  1. package/dist/{chunk-CYWFK4OE.js → chunk-2HAPOY5M.js} +2 -2
  2. package/dist/chunk-2ZJUGM2S.js +7 -0
  3. package/dist/chunk-2ZJUGM2S.js.map +1 -0
  4. package/dist/{chunk-5PUQMKA5.js → chunk-3BQAO7XM.js} +5 -5
  5. package/dist/chunk-3BQAO7XM.js.map +1 -0
  6. package/dist/{chunk-JSL5OEWZ.js → chunk-5J35UAV6.js} +1 -1
  7. package/dist/chunk-5J35UAV6.js.map +1 -0
  8. package/dist/{chunk-GODJQLB7.js → chunk-5VTCWA4D.js} +2 -2
  9. package/dist/chunk-65DNEETS.js +34 -0
  10. package/dist/chunk-65DNEETS.js.map +1 -0
  11. package/dist/{chunk-PWR4GBUH.js → chunk-73KFQXIW.js} +2 -2
  12. package/dist/{chunk-6JTWZZRD.js → chunk-7GF4KRVL.js} +2 -2
  13. package/dist/{chunk-D7UUJ7FJ.js → chunk-BVPBGV4Y.js} +2 -2
  14. package/dist/{chunk-CWRUW77O.js → chunk-C2G7TCA7.js} +2 -2
  15. package/dist/chunk-FJBC6QA5.js +7 -0
  16. package/dist/chunk-FJBC6QA5.js.map +1 -0
  17. package/dist/{chunk-2A4XOLBZ.js → chunk-I3B772WD.js} +2 -2
  18. package/dist/chunk-JINCDD7Q.js +6 -0
  19. package/dist/chunk-JINCDD7Q.js.map +1 -0
  20. package/dist/chunk-L7AW7XP5.js +12 -0
  21. package/dist/chunk-L7AW7XP5.js.map +1 -0
  22. package/dist/chunk-Q3OO4DAC.js +16 -0
  23. package/dist/chunk-Q3OO4DAC.js.map +1 -0
  24. package/dist/{chunk-QMFFV7WM.js → chunk-TY7VOTWV.js} +2 -2
  25. package/dist/{chunk-LG2B5RFV.js → chunk-WLRSUL67.js} +2 -2
  26. package/dist/{chunk-O7SN6FIA.js → chunk-ZTTBPQJZ.js} +2 -2
  27. package/dist/components/AutocompleteDetailed/index.js +2 -2
  28. package/dist/components/CopyButton/index.js +2 -2
  29. package/dist/components/DataView/index.js +3 -3
  30. package/dist/components/DynamicDataView/index.js +18 -18
  31. package/dist/components/DynamicDataView/index.js.map +1 -1
  32. package/dist/components/EasyCropModal/index.js +2 -2
  33. package/dist/components/FileUpload/index.js +5 -5
  34. package/dist/components/FrameSkeleton/index.js +3 -3
  35. package/dist/components/Incrementer/index.js +1 -1
  36. package/dist/components/InfoCircle/index.js +1 -1
  37. package/dist/components/ListBundles/index.js +2 -2
  38. package/dist/components/ResponsivePopover/index.js +2 -2
  39. package/dist/components/Result/index.d.ts +1 -2
  40. package/dist/components/Result/index.js +1 -1
  41. package/dist/components/SelectList/index.js +2 -2
  42. package/dist/components/SelectableCards/index.js +2 -2
  43. package/dist/components/SeoPreview/index.js +2 -2
  44. package/dist/components/SmartText/index.js +2 -2
  45. package/dist/components/SmartText/index.js.map +1 -1
  46. package/dist/components/SwapList/index.js +1 -1
  47. package/dist/components/TextMaxLine/index.js +2 -2
  48. package/dist/components/Tooltip/index.js +1 -1
  49. package/dist/components/animate/index.js +2 -2
  50. package/dist/components/carousel/index.js +1 -1
  51. package/dist/components/form/AutocompleteDetailed/index.js +2 -2
  52. package/dist/components/form/Codes/index.js +1 -1
  53. package/dist/components/form/FileUpload/index.js +5 -5
  54. package/dist/components/form/Incrementer/index.js +1 -1
  55. package/dist/components/form/SelectList/index.js +2 -2
  56. package/dist/components/form/SelectableCards/index.js +2 -2
  57. package/dist/components/form/Webhook/index.js +11 -10
  58. package/dist/components/form/Webhook/index.js.map +1 -1
  59. package/dist/hooks/useActiveElement.js +1 -1
  60. package/dist/hooks/useActiveElement.js.map +1 -1
  61. package/dist/hooks/useCollapseSidebarOnMount.js +3 -3
  62. package/dist/hooks/useEventListener.js +1 -1
  63. package/dist/hooks/useLocalStorage.js +2 -2
  64. package/dist/hooks/useOnClickOutside.js +1 -1
  65. package/dist/hooks/useResponsive.d.ts +1 -1
  66. package/dist/hooks/useResponsive.js +1 -1
  67. package/dist/hooks/useUpload.js +3 -3
  68. package/dist/hooks/useUpload.js.map +1 -1
  69. package/dist/utils/sanitize-html.d.ts +3 -0
  70. package/dist/utils/sanitize-html.js +6 -0
  71. package/dist/utils/sanitize-html.js.map +1 -0
  72. package/package.json +2 -1
  73. package/dist/chunk-2MCLMTFV.js +0 -16
  74. package/dist/chunk-2MCLMTFV.js.map +0 -1
  75. package/dist/chunk-5PUQMKA5.js.map +0 -1
  76. package/dist/chunk-FQOV5EGQ.js +0 -12
  77. package/dist/chunk-FQOV5EGQ.js.map +0 -1
  78. package/dist/chunk-IJZCVZ32.js +0 -6
  79. package/dist/chunk-IJZCVZ32.js.map +0 -1
  80. package/dist/chunk-JSL5OEWZ.js.map +0 -1
  81. package/dist/chunk-KKVRDMSE.js +0 -7
  82. package/dist/chunk-KKVRDMSE.js.map +0 -1
  83. package/dist/chunk-RPO7AI5K.js +0 -7
  84. package/dist/chunk-RPO7AI5K.js.map +0 -1
  85. package/dist/chunk-TBFQ5PEL.js +0 -34
  86. package/dist/chunk-TBFQ5PEL.js.map +0 -1
  87. /package/dist/{chunk-CYWFK4OE.js.map → chunk-2HAPOY5M.js.map} +0 -0
  88. /package/dist/{chunk-GODJQLB7.js.map → chunk-5VTCWA4D.js.map} +0 -0
  89. /package/dist/{chunk-PWR4GBUH.js.map → chunk-73KFQXIW.js.map} +0 -0
  90. /package/dist/{chunk-6JTWZZRD.js.map → chunk-7GF4KRVL.js.map} +0 -0
  91. /package/dist/{chunk-D7UUJ7FJ.js.map → chunk-BVPBGV4Y.js.map} +0 -0
  92. /package/dist/{chunk-CWRUW77O.js.map → chunk-C2G7TCA7.js.map} +0 -0
  93. /package/dist/{chunk-2A4XOLBZ.js.map → chunk-I3B772WD.js.map} +0 -0
  94. /package/dist/{chunk-QMFFV7WM.js.map → chunk-TY7VOTWV.js.map} +0 -0
  95. /package/dist/{chunk-LG2B5RFV.js.map → chunk-WLRSUL67.js.map} +0 -0
  96. /package/dist/{chunk-O7SN6FIA.js.map → chunk-ZTTBPQJZ.js.map} +0 -0
@@ -2,10 +2,10 @@ import { a } from '../../chunk-UVPQR2Q2.js';
2
2
  import { a as a$2 } from '../../chunk-F65ZXAGV.js';
3
3
  import { a as a$3 } from '../../chunk-FBVAHVU3.js';
4
4
  import '../../chunk-DGCPCUVB.js';
5
- import { a as a$1 } from '../../chunk-CWRUW77O.js';
6
- import '../../chunk-CYWFK4OE.js';
5
+ import { a as a$1 } from '../../chunk-C2G7TCA7.js';
6
+ import '../../chunk-2HAPOY5M.js';
7
7
  import '../../chunk-XNKYJHNL.js';
8
- import '../../chunk-KKVRDMSE.js';
8
+ import '../../chunk-FJBC6QA5.js';
9
9
  import '../../chunk-POTVACYB.js';
10
10
  import '../../chunk-ET3WPQIO.js';
11
11
  import $ from '@mui/material/IconButton';
@@ -1,4 +1,4 @@
1
- export { a as default } from '../../chunk-FQOV5EGQ.js';
1
+ export { a as default } from '../../chunk-L7AW7XP5.js';
2
2
  import '../../chunk-W3CK33IH.js';
3
3
  import '../../chunk-OF6623HG.js';
4
4
  import '../../chunk-FBVAHVU3.js';
@@ -1,4 +1,4 @@
1
- import { a } from '../../chunk-JSL5OEWZ.js';
1
+ import { a } from '../../chunk-5J35UAV6.js';
2
2
  import { a as a$1 } from '../../chunk-FBVAHVU3.js';
3
3
  import '../../chunk-DGCPCUVB.js';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -1,6 +1,6 @@
1
1
  import { a as a$2 } from '../../chunk-RUABKHIV.js';
2
- import { a as a$1 } from '../../chunk-IJZCVZ32.js';
3
- import { o, a, f, k as k$1 } from '../../chunk-2MCLMTFV.js';
2
+ import { a as a$1 } from '../../chunk-JINCDD7Q.js';
3
+ import { o, a, f, k as k$1 } from '../../chunk-Q3OO4DAC.js';
4
4
  import '../../chunk-FBVAHVU3.js';
5
5
  import '../../chunk-DGCPCUVB.js';
6
6
  import '../../chunk-GLRLKFPS.js';
@@ -1,3 +1,3 @@
1
- export { a as default } from '../../chunk-LG2B5RFV.js';
2
- import '../../chunk-RPO7AI5K.js';
1
+ export { a as default } from '../../chunk-WLRSUL67.js';
2
+ import '../../chunk-2ZJUGM2S.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,4 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
2
  import { ReactNode } from 'react';
4
3
 
5
4
  interface ResultProps<TData = unknown> {
@@ -15,6 +14,6 @@ interface ResultProps<TData = unknown> {
15
14
  children?: ReactNode | ((data: TData) => ReactNode);
16
15
  }
17
16
 
18
- declare const Result: <TData>({ isFetching, fetching, isLoading, loading, anError, error, isEmpty, empty, data, children, }: ResultProps<TData>) => string | number | true | Iterable<react.ReactNode> | react_jsx_runtime.JSX.Element;
17
+ declare const Result: <TData>({ isFetching, fetching, isLoading, loading, anError, error, isEmpty, empty, data, children, }: ResultProps<TData>) => react_jsx_runtime.JSX.Element;
19
18
 
20
19
  export { Result as default };
@@ -1,2 +1,2 @@
1
- export { a as default } from '../../chunk-IJZCVZ32.js';
1
+ export { a as default } from '../../chunk-JINCDD7Q.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- export { a as default } from '../../chunk-GODJQLB7.js';
1
+ export { a as default } from '../../chunk-5VTCWA4D.js';
2
2
  import '../../chunk-RUABKHIV.js';
3
3
  import '../../chunk-Y3TJIK6E.js';
4
- import '../../chunk-IJZCVZ32.js';
4
+ import '../../chunk-JINCDD7Q.js';
5
5
  import '../../chunk-6U5LS7MP.js';
6
6
  import '../../chunk-N2UR3W55.js';
7
7
  import '../../chunk-FBVAHVU3.js';
@@ -1,7 +1,7 @@
1
- export { a as default } from '../../chunk-6JTWZZRD.js';
1
+ export { a as default } from '../../chunk-7GF4KRVL.js';
2
2
  import '../../chunk-6ZSTKYGL.js';
3
3
  import '../../chunk-Y3TJIK6E.js';
4
- import '../../chunk-IJZCVZ32.js';
4
+ import '../../chunk-JINCDD7Q.js';
5
5
  import '../../chunk-NIQW2J3M.js';
6
6
  import '../../chunk-F65ZXAGV.js';
7
7
  import '../../chunk-FBVAHVU3.js';
@@ -1,7 +1,7 @@
1
- import { a as a$1 } from '../../chunk-O7SN6FIA.js';
1
+ import { a as a$1 } from '../../chunk-ZTTBPQJZ.js';
2
2
  import { a } from '../../chunk-FBVAHVU3.js';
3
3
  import '../../chunk-DGCPCUVB.js';
4
- import '../../chunk-RPO7AI5K.js';
4
+ import '../../chunk-2ZJUGM2S.js';
5
5
  import p from '@mui/material/Box';
6
6
  import o from '@mui/material/Stack';
7
7
  import r from '@mui/material/Typography';
@@ -1,7 +1,7 @@
1
1
  import t from '@mui/material/Typography';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
- var d=e=>{try{return new URL(e),!0}catch{return !1}},i=({text:e,component:n="div",...o})=>{let r=d(e);return jsx(t,{href:r?e:void 0,target:r?"_blank":void 0,rel:r?"noopener noreferrer":void 0,color:r?"primary":void 0,underline:r?"hover":void 0,...o,component:r?"a":n,children:e})},f=i;
4
+ var p=e=>{try{let o=new URL(e);return o.protocol==="http:"||o.protocol==="https:"}catch{return !1}},d=({text:e,component:o="div",...n})=>{let r=p(e);return jsx(t,{href:r?e:void 0,target:r?"_blank":void 0,rel:r?"noopener noreferrer":void 0,color:r?"primary":void 0,underline:r?"hover":void 0,...n,component:r?"a":o,children:e})},l=d;
5
5
 
6
- export { f as default };
6
+ export { l as default };
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SmartText/index.tsx"],"names":["Typography","jsx","isValidUrl","str","SmartText","text","component","other","isLink","SmartText_default"],"mappings":"AAAA,OAAOA,MAAgB,2BAiBnB,cAAAC,MAAA,oBAbJ,IAAMC,EAAcC,GAAyB,CAC3C,GAAI,CACF,WAAI,IAAIA,CAAG,EACJ,EACT,MAAE,CACA,MAAO,EACT,CACF,EAEMC,EAAY,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,MAAO,GAAGC,CAAM,IAAsB,CAC3E,IAAMC,EAASN,EAAWG,CAAI,EAE9B,OACEJ,EAACD,EAAA,CACC,KAAMQ,EAASH,EAAO,OACtB,OAAQG,EAAS,SAAW,OAC5B,IAAKA,EAAS,sBAAwB,OACtC,MAAOA,EAAS,UAAY,OAC5B,UAAWA,EAAS,QAAU,OAC7B,GAAGD,EACJ,UAAWC,EAAS,IAAMF,EAEzB,SAAAD,EACH,CAEJ,EAEOI,EAAQL","sourcesContent":["import Typography from '@mui/material/Typography';\n\nimport { SmartTextProps } from './props';\n\nconst isValidUrl = (str: string): boolean => {\n try {\n new URL(str);\n return true;\n } catch {\n return false;\n }\n};\n\nconst SmartText = ({ text, component = 'div', ...other }: SmartTextProps) => {\n const isLink = isValidUrl(text);\n\n return (\n <Typography\n href={isLink ? text : undefined}\n target={isLink ? '_blank' : undefined}\n rel={isLink ? 'noopener noreferrer' : undefined}\n color={isLink ? 'primary' : undefined}\n underline={isLink ? 'hover' : undefined}\n {...other}\n component={isLink ? 'a' : component}\n >\n {text}\n </Typography>\n );\n};\n\nexport default SmartText;\n"]}
1
+ {"version":3,"sources":["../../../src/components/SmartText/index.tsx"],"names":["Typography","jsx","isValidUrl","str","url","SmartText","text","component","other","isLink","SmartText_default"],"mappings":"AAAA,OAAOA,MAAgB,2BAiBnB,cAAAC,MAAA,oBAbJ,IAAMC,EAAcC,GAAyB,CAC3C,GAAI,CACF,IAAMC,EAAM,IAAI,IAAID,CAAG,EACvB,OAAOC,EAAI,WAAa,SAAWA,EAAI,WAAa,QACtD,MAAE,CACA,MAAO,EACT,CACF,EAEMC,EAAY,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,MAAO,GAAGC,CAAM,IAAsB,CAC3E,IAAMC,EAASP,EAAWI,CAAI,EAE9B,OACEL,EAACD,EAAA,CACC,KAAMS,EAASH,EAAO,OACtB,OAAQG,EAAS,SAAW,OAC5B,IAAKA,EAAS,sBAAwB,OACtC,MAAOA,EAAS,UAAY,OAC5B,UAAWA,EAAS,QAAU,OAC7B,GAAGD,EACJ,UAAWC,EAAS,IAAMF,EAEzB,SAAAD,EACH,CAEJ,EAEOI,EAAQL","sourcesContent":["import Typography from '@mui/material/Typography';\n\nimport { SmartTextProps } from './props';\n\nconst isValidUrl = (str: string): boolean => {\n try {\n const url = new URL(str);\n return url.protocol === 'http:' || url.protocol === 'https:';\n } catch {\n return false;\n }\n};\n\nconst SmartText = ({ text, component = 'div', ...other }: SmartTextProps) => {\n const isLink = isValidUrl(text);\n\n return (\n <Typography\n href={isLink ? text : undefined}\n target={isLink ? '_blank' : undefined}\n rel={isLink ? 'noopener noreferrer' : undefined}\n color={isLink ? 'primary' : undefined}\n underline={isLink ? 'hover' : undefined}\n {...other}\n component={isLink ? 'a' : component}\n >\n {text}\n </Typography>\n );\n};\n\nexport default SmartText;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { a as a$2 } from '../../chunk-6ZSTKYGL.js';
2
2
  import { a } from '../../chunk-Y3TJIK6E.js';
3
- import { a as a$1 } from '../../chunk-IJZCVZ32.js';
3
+ import { a as a$1 } from '../../chunk-JINCDD7Q.js';
4
4
  import '../../chunk-NIQW2J3M.js';
5
5
  import { a as a$3 } from '../../chunk-F65ZXAGV.js';
6
6
  import { a as a$4 } from '../../chunk-FBVAHVU3.js';
@@ -1,3 +1,3 @@
1
- export { a as default } from '../../chunk-O7SN6FIA.js';
2
- import '../../chunk-RPO7AI5K.js';
1
+ export { a as default } from '../../chunk-ZTTBPQJZ.js';
2
+ import '../../chunk-2ZJUGM2S.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export { a as default } from '../../chunk-JSL5OEWZ.js';
1
+ export { a as default } from '../../chunk-5J35UAV6.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- export { t as AnimatePresence, r as MotionContainer, s as MotionViewport, l as TRANSITION, u as m, v as useMotionValueEvent, w as useScroll, b as varBgColor, c as varBgKenburns, d as varBgPan, h as varBounce, i as varContainer, j as varFade, k as varFlip, a as varHover, m as varPath, n as varRotate, o as varScale, p as varSlide, f as varTranEnter, g as varTranExit, e as varTranHover, q as varZoom } from '../../chunk-2A4XOLBZ.js';
2
- import '../../chunk-RPO7AI5K.js';
1
+ export { t as AnimatePresence, r as MotionContainer, s as MotionViewport, l as TRANSITION, u as m, v as useMotionValueEvent, w as useScroll, b as varBgColor, c as varBgKenburns, d as varBgPan, h as varBounce, i as varContainer, j as varFade, k as varFlip, a as varHover, m as varPath, n as varRotate, o as varScale, p as varSlide, f as varTranEnter, g as varTranExit, e as varTranHover, q as varZoom } from '../../chunk-I3B772WD.js';
2
+ import '../../chunk-2ZJUGM2S.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { j as ArrowButton, f as Carousel, g as CarouselArrowBasicButtons, i as CarouselArrowFloatButtons, h as CarouselArrowNumberButtons, k as CarouselDotButtons, l as CarouselProgressBar, c as CarouselSlide, n as CarouselThumb, m as CarouselThumbs, e as StyledContainer, d as StyledRoot, a as carouselBreakpoints, b as carouselClasses, o as useCarousel } from '../../chunk-2MCLMTFV.js';
1
+ export { j as ArrowButton, f as Carousel, g as CarouselArrowBasicButtons, i as CarouselArrowFloatButtons, h as CarouselArrowNumberButtons, k as CarouselDotButtons, l as CarouselProgressBar, c as CarouselSlide, n as CarouselThumb, m as CarouselThumbs, e as StyledContainer, d as StyledRoot, a as carouselBreakpoints, b as carouselClasses, o as useCarousel } from '../../chunk-Q3OO4DAC.js';
2
2
  import '../../chunk-FBVAHVU3.js';
3
3
  import '../../chunk-DGCPCUVB.js';
4
4
  import '../../chunk-GLRLKFPS.js';
@@ -1,6 +1,6 @@
1
- import { a } from '../../../chunk-D7UUJ7FJ.js';
1
+ import { a } from '../../../chunk-BVPBGV4Y.js';
2
2
  import '../../../chunk-VR3K2Y2C.js';
3
- import '../../../chunk-RPO7AI5K.js';
3
+ import '../../../chunk-2ZJUGM2S.js';
4
4
  import { useFormContext, Controller } from 'react-hook-form';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-KKVRDMSE.js';
1
+ import { a } from '../../../chunk-FJBC6QA5.js';
2
2
  import '../../../chunk-POTVACYB.js';
3
3
  import '../../../chunk-ET3WPQIO.js';
4
4
  import { useRef } from 'react';
@@ -1,16 +1,16 @@
1
- import { x, u, v, w } from '../../../chunk-TBFQ5PEL.js';
1
+ import { x, u, v, w } from '../../../chunk-65DNEETS.js';
2
2
  import '../../../chunk-3ELMAXMX.js';
3
- import '../../../chunk-PWR4GBUH.js';
3
+ import '../../../chunk-73KFQXIW.js';
4
4
  import '../../../chunk-KGLU4CR2.js';
5
5
  import '../../../chunk-KZFKHQ5P.js';
6
6
  import '../../../chunk-YKLRB3EJ.js';
7
7
  import '../../../chunk-OF6623HG.js';
8
8
  import '../../../chunk-6U5LS7MP.js';
9
- import '../../../chunk-JSL5OEWZ.js';
10
- import '../../../chunk-2A4XOLBZ.js';
9
+ import '../../../chunk-5J35UAV6.js';
10
+ import '../../../chunk-I3B772WD.js';
11
11
  import '../../../chunk-FBVAHVU3.js';
12
12
  import '../../../chunk-DGCPCUVB.js';
13
- import '../../../chunk-RPO7AI5K.js';
13
+ import '../../../chunk-2ZJUGM2S.js';
14
14
  import '../../../chunk-SVX7EWV4.js';
15
15
  import '../../../chunk-XNKYJHNL.js';
16
16
  import { useFormContext, Controller } from 'react-hook-form';
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-FQOV5EGQ.js';
1
+ import { a } from '../../../chunk-L7AW7XP5.js';
2
2
  import '../../../chunk-W3CK33IH.js';
3
3
  import '../../../chunk-OF6623HG.js';
4
4
  import '../../../chunk-FBVAHVU3.js';
@@ -1,7 +1,7 @@
1
- import { a } from '../../../chunk-GODJQLB7.js';
1
+ import { a } from '../../../chunk-5VTCWA4D.js';
2
2
  import '../../../chunk-RUABKHIV.js';
3
3
  import '../../../chunk-Y3TJIK6E.js';
4
- import '../../../chunk-IJZCVZ32.js';
4
+ import '../../../chunk-JINCDD7Q.js';
5
5
  import '../../../chunk-6U5LS7MP.js';
6
6
  import '../../../chunk-N2UR3W55.js';
7
7
  import '../../../chunk-FBVAHVU3.js';
@@ -1,7 +1,7 @@
1
- import { a } from '../../../chunk-6JTWZZRD.js';
1
+ import { a } from '../../../chunk-7GF4KRVL.js';
2
2
  import '../../../chunk-6ZSTKYGL.js';
3
3
  import '../../../chunk-Y3TJIK6E.js';
4
- import '../../../chunk-IJZCVZ32.js';
4
+ import '../../../chunk-JINCDD7Q.js';
5
5
  import '../../../chunk-NIQW2J3M.js';
6
6
  import '../../../chunk-F65ZXAGV.js';
7
7
  import '../../../chunk-FBVAHVU3.js';
@@ -1,20 +1,21 @@
1
- import { a } from '../../../chunk-YXRL4O4H.js';
1
+ import { a as a$1 } from '../../../chunk-YXRL4O4H.js';
2
2
  import { a as a$2 } from '../../../chunk-T53CFFZY.js';
3
3
  import { a as a$3 } from '../../../chunk-N2UR3W55.js';
4
4
  import '../../../chunk-EPMAHRQO.js';
5
- import { a as a$1 } from '../../../chunk-FBVAHVU3.js';
5
+ import { a } from '../../../chunk-FBVAHVU3.js';
6
6
  import '../../../chunk-DGCPCUVB.js';
7
+ import { useCallback, useMemo } from 'react';
7
8
  import { useFormContext, useFieldArray } from 'react-hook-form';
8
- import q from '@mui/material/Divider';
9
- import W from '@mui/material/IconButton';
10
- import _ from '@mui/material/InputAdornment';
9
+ import w from '@mui/material/Divider';
10
+ import x from '@mui/material/IconButton';
11
+ import F from '@mui/material/InputAdornment';
11
12
  import n from '@mui/material/Stack';
12
- import x from '@mui/material/Typography';
13
- import B from '@mui/material/Alert';
13
+ import M from '@mui/material/Typography';
14
+ import W from '@mui/material/Alert';
14
15
  import { styled, alpha } from '@mui/material/styles';
15
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
16
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
17
 
17
- var s=[{label:"XML",value:"XML"},{label:"JSON",value:"JSON"},{label:"BYTEA",value:"BYTEA"}],c=[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"DELETE",value:"DELETE"},{label:"PUT",value:"PUT"}];var b=styled(W)(({theme:o})=>({svg:{color:`${o.palette.primary.main} !important`}})),T=styled(x)(()=>({textDecoration:"underline",fontWeight:"600",cursor:"pointer"})),y=styled(B)(({theme:o})=>({backgroundColor:`${alpha(o.palette.primary.main,.03)}`,border:`1px solid ${alpha(o.palette.primary.main,.4)}`,flexDirection:"row",alignItems:"center",padding:"2px 12px",gap:8,borderRadius:8,marginBottom:16,"& svg":{color:o.palette.primary.main}}));var L=()=>{let o=()=>{let a="https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks";window.open(a,"_blank");};return jsx(y,{severity:"info",children:jsxs(x,{color:"grey",variant:"caption",children:["Webhooks permitem que servi\xE7os externos sejam notificados quando determinados eventos acontecem. Saiba mais"," ",jsx(T,{variant:"caption",color:"primary",onClick:()=>o(),children:"acessando a documenta\xE7\xE3o do Webhook"})]})})},f=L;var F=({webhookData:o,isEditing:a$4=!1,haveTip:v=!1,hasFilter:S=!0,hasType:k=!0})=>{let{control:E}=useFormContext(),{fields:C,append:A,remove:P}=useFieldArray({name:"headers",control:E}),I=()=>{A({value:"",name:""});};return jsxs(Fragment,{children:[v&&jsx(f,{}),a$4&&jsx(a,{name:"name",label:"Nome do webhook"}),jsxs(n,{direction:"row",gap:2,children:[jsx(a,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url \xE9 obrigat\xF3rio"}}}),S&&jsx(a,{name:"filter",label:"Filtro"})]}),a$4&&o&&jsxs(Fragment,{children:[jsx(a,{variant:"filled",name:"solution",label:"Solu\xE7\xE3o",disabled:!0}),jsxs(n,{direction:"row",gap:2,children:[jsx(a,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),jsx(a,{variant:"filled",name:"resource_id",label:"ID origem",disabled:!0,InputProps:{endAdornment:jsx(_,{position:"end",children:jsx(b,{"aria-label":"Copiar ID origem",onClick:()=>navigator.clipboard.writeText(o.resource_id),children:jsx(a$1,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),jsx(a,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),jsxs(n,{direction:"row",gap:2,alignItems:"center",children:[k&&jsx(a$2,{fullWidth:!0,options:s,name:"content_type",label:"Tipo de conte\xFAdo",required:!0,rules:{required:{value:!0,message:"Campo Tipo de conte\xFAdo \xE9 obrigat\xF3rio"}}}),jsx(a$2,{fullWidth:!0,options:c,name:"http_method",label:"M\xE9todo HTTP",required:!0,rules:{required:{value:!0,message:"Campo M\xE9todo HTTP \xE9 obrigat\xF3rio"}}})]}),jsx(x,{variant:"overline",color:"grey",children:"Cabe\xE7alho"}),C?.map((O,l)=>jsxs(n,{direction:"row",gap:2,alignItems:"center",children:[jsx(a,{name:`headers.${l}.name`,label:"Chave",required:!0,rules:{required:{value:!0,message:""}}}),jsx(a,{name:`headers.${l}.value`,label:"Valor"}),jsx(W,{"aria-label":"Remover cabe\xE7alho",color:"error",onClick:()=>P(l),children:jsx(a$1,{icon:"DELETE_MARK_BUTTON_02"})})]},O.id)),jsx(a$3,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>I(),children:"Adicionar novo cabe\xE7alho"}),jsx(q,{})]})},ce=F;
18
+ var u=[{label:"XML",value:"XML"},{label:"JSON",value:"JSON"},{label:"BYTEA",value:"BYTEA"}],T=[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"DELETE",value:"DELETE"},{label:"PUT",value:"PUT"}];var y=styled(x)(({theme:o})=>({svg:{color:`${o.palette.primary.main} !important`}})),h=styled(M)(()=>({textDecoration:"underline",fontWeight:"600",cursor:"pointer"})),f=styled(W)(({theme:o})=>({backgroundColor:`${alpha(o.palette.primary.main,.03)}`,border:`1px solid ${alpha(o.palette.primary.main,.4)}`,flexDirection:"row",alignItems:"center",padding:"2px 12px",gap:8,borderRadius:8,marginBottom:16,"& svg":{color:o.palette.primary.main}}));var N=()=>{let o=()=>{let a="https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks";window.open(a,"_blank");};return jsx(f,{severity:"info",children:jsxs(M,{color:"grey",variant:"caption",children:["Webhooks permitem que servi\xE7os externos sejam notificados quando determinados eventos acontecem. Saiba mais"," ",jsx(h,{variant:"caption",color:"primary",onClick:()=>o(),children:"acessando a documenta\xE7\xE3o do Webhook"})]})})},v=N;var G={required:{value:!0,message:"Campo Tipo de conte\xFAdo \xE9 obrigat\xF3rio"}},J={required:{value:!0,message:"Campo M\xE9todo HTTP \xE9 obrigat\xF3rio"}},X={required:{value:!0,message:"Url \xE9 obrigat\xF3rio"}},z={required:{value:!0,message:""}},K=({webhookData:o,isEditing:a$4=!1,haveTip:k=!1,hasFilter:C=!0,hasType:A=!0})=>{let{control:P}=useFormContext(),{fields:I,append:d,remove:O}=useFieldArray({name:"headers",control:P}),_=useCallback(()=>{d({value:"",name:""});},[d]),m=useCallback(()=>{o?.resource_id&&navigator.clipboard.writeText(o.resource_id).catch(()=>{});},[o?.resource_id]),L=useMemo(()=>({endAdornment:jsx(F,{position:"end",children:jsx(y,{"aria-label":"Copiar ID origem",onClick:m,children:jsx(a,{className:"copyIcon",icon:"COPY_CONTENT"})})})}),[m]);return jsxs(Fragment,{children:[k&&jsx(v,{}),a$4&&jsx(a$1,{name:"name",label:"Nome do webhook"}),jsxs(n,{direction:"row",gap:2,children:[jsx(a$1,{name:"url",label:"URL de endpoint",rules:X}),C&&jsx(a$1,{name:"filter",label:"Filtro"})]}),a$4&&o&&jsxs(Fragment,{children:[jsx(a$1,{variant:"filled",name:"solution",label:"Solu\xE7\xE3o",disabled:!0}),jsxs(n,{direction:"row",gap:2,children:[jsx(a$1,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),jsx(a$1,{variant:"filled",name:"resource_id",label:"ID origem",disabled:!0,InputProps:L}),jsx(a$1,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),jsxs(n,{direction:"row",gap:2,alignItems:"center",children:[A&&jsx(a$2,{fullWidth:!0,options:u,name:"content_type",label:"Tipo de conte\xFAdo",required:!0,rules:G}),jsx(a$2,{fullWidth:!0,options:T,name:"http_method",label:"M\xE9todo HTTP",required:!0,rules:J})]}),jsx(M,{variant:"overline",color:"grey",children:"Cabe\xE7alho"}),I?.map((B,l)=>jsxs(n,{direction:"row",gap:2,alignItems:"center",children:[jsx(a$1,{name:`headers.${l}.name`,label:"Chave",required:!0,rules:z}),jsx(a$1,{name:`headers.${l}.value`,label:"Valor"}),jsx(x,{"aria-label":"Remover cabe\xE7alho",color:"error",onClick:()=>O(l),children:jsx(a,{icon:"DELETE_MARK_BUTTON_02"})})]},B.id)),jsx(a$3,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:_,children:"Adicionar novo cabe\xE7alho"}),jsx(w,{})]})},Ee=K;
18
19
 
19
- export { ce as default };
20
+ export { Ee as default };
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/form/Webhook/index.tsx","../../../../src/components/form/Webhook/props.ts","../../../../src/components/form/Webhook/styles.ts","../../../../src/components/form/Webhook/WebhookAlert.tsx"],"names":["useFieldArray","useFormContext","Divider","IconButton","InputAdornment","Stack","Typography","ContentTypeOptions","HttpMethodOptions","Alert","alpha","styled","SyledIconButton","theme","StyledTypography","StyledAlert","jsx","jsxs","WebhookAlert","handleLinkClick","url","WebhookAlert_default","Fragment","Webhook","webhookData","isEditing","haveTip","hasFilter","hasType","control","headers","append","remove","handleCreateField","Field_default","Icon_default","Autocomplete_default","item","index","ActionButton_default","Webhook_default"],"mappings":"kQAAA,OAAS,iBAAAA,EAAe,kBAAAC,MAAsB,kBAC9C,OAAOC,MAAa,wBACpB,OAAOC,MAAgB,2BACvB,OAAOC,MAAoB,+BAC3B,OAA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AQ,GACX,CAEJ,EAEOsC,GAAQjB","sourcesContent":["import { useFieldArray, useFormContext } from 'react-hook-form';\nimport Divider from '@mui/material/Divider';\nimport IconButton from '@mui/material/IconButton';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport ActionButton from 'components/ActionButton';\nimport Icon from 'components/Icon';\n\nimport Autocomplete from '../Autocomplete';\nimport Field from '../Field';\n\nimport { ContentTypeOptions, HttpMethodOptions, WebhookProps } from './props';\nimport { SyledIconButton } from './styles';\nimport WebhookAlert from './WebhookAlert';\n\nconst Webhook = ({\n webhookData,\n isEditing = false,\n haveTip = false,\n hasFilter = true,\n hasType = true,\n}: WebhookProps) => {\n const { control } = useFormContext();\n\n const {\n fields: headers,\n append,\n remove,\n } = useFieldArray({\n name: 'headers',\n control,\n });\n\n const handleCreateField = () => {\n append({\n value: '',\n name: '',\n });\n };\n\n return (\n <>\n {haveTip && <WebhookAlert />}\n {isEditing && <Field name=\"name\" label=\"Nome do webhook\" />}\n <Stack direction=\"row\" gap={2}>\n <Field\n name=\"url\"\n label=\"URL de endpoint\"\n rules={{ required: { value: true, message: 'Url é obrigatório' } }}\n />\n {hasFilter && <Field name=\"filter\" label=\"Filtro\" />}\n </Stack>\n {isEditing && webhookData && (\n <>\n <Field variant=\"filled\" name=\"solution\" label=\"Solução\" disabled />\n <Stack direction=\"row\" gap={2}>\n <Field variant=\"filled\" name=\"resource\" label=\"Origem\" disabled />\n <Field\n variant=\"filled\"\n name=\"resource_id\"\n label=\"ID origem\"\n disabled\n InputProps={{\n endAdornment: (\n <InputAdornment position=\"end\">\n <SyledIconButton\n aria-label=\"Copiar ID origem\"\n onClick={() =>\n navigator.clipboard.writeText(webhookData.resource_id)\n }\n >\n <Icon className=\"copyIcon\" icon=\"COPY_CONTENT\" />\n </SyledIconButton>\n </InputAdornment>\n ),\n }}\n />\n <Field variant=\"filled\" name=\"event\" label=\"Evento\" disabled />\n </Stack>\n </>\n )}\n <Stack direction=\"row\" gap={2} alignItems=\"center\">\n {hasType && (\n <Autocomplete\n fullWidth\n options={ContentTypeOptions}\n name=\"content_type\"\n label=\"Tipo de conteúdo\"\n required\n rules={{\n required: {\n value: true,\n message: 'Campo Tipo de conteúdo é obrigatório',\n },\n }}\n />\n )}\n <Autocomplete\n fullWidth\n options={HttpMethodOptions}\n name=\"http_method\"\n label=\"Método HTTP\"\n required\n rules={{\n required: {\n value: true,\n message: 'Campo Método HTTP é obrigatório',\n },\n }}\n />\n </Stack>\n <Typography variant=\"overline\" color=\"grey\">\n Cabeçalho\n </Typography>\n {headers?.map((item, index) => (\n <Stack key={item.id} direction=\"row\" gap={2} alignItems=\"center\">\n <Field\n name={`headers.${index}.name`}\n label=\"Chave\"\n required\n rules={{\n required: {\n value: true,\n message: '',\n },\n }}\n />\n <Field name={`headers.${index}.value`} label=\"Valor\" />\n <IconButton\n aria-label=\"Remover cabeçalho\"\n color=\"error\"\n onClick={() => remove(index)}\n >\n <Icon icon=\"DELETE_MARK_BUTTON_02\" />\n </IconButton>\n </Stack>\n ))}\n <ActionButton\n actionType=\"NEW\"\n size=\"large\"\n variant=\"outlined\"\n color=\"inherit\"\n fullWidth\n onClick={() => handleCreateField()}\n >\n Adicionar novo cabeçalho\n </ActionButton>\n <Divider />\n </>\n );\n};\n\nexport default Webhook;\n","import { WebhookType } from 'types/webhook';\n\nexport interface WebhookProps {\n webhookData?: WebhookType;\n isEditing?: boolean;\n haveTip?: boolean;\n hasFilter?: boolean;\n hasType?: boolean;\n}\nexport enum ContentTypeStatus {\n XML = 'XML',\n JSON = 'JSON',\n BYTEA = 'BYTEA',\n}\n\nexport enum HttpMethodStatus {\n GET = 'GET',\n POST = 'POST',\n PATCH = 'PATCH',\n DELETE = 'DELETE',\n PUT = 'PUT',\n}\n\nexport const ContentTypeOptions = [\n {\n label: ContentTypeStatus.XML,\n value: ContentTypeStatus.XML,\n },\n {\n label: ContentTypeStatus.JSON,\n value: ContentTypeStatus.JSON,\n },\n {\n label: ContentTypeStatus.BYTEA,\n value: ContentTypeStatus.BYTEA,\n },\n];\n\nexport const HttpMethodOptions = [\n {\n label: HttpMethodStatus.GET,\n value: HttpMethodStatus.GET,\n },\n {\n label: HttpMethodStatus.POST,\n value: HttpMethodStatus.POST,\n },\n {\n label: HttpMethodStatus.DELETE,\n value: HttpMethodStatus.DELETE,\n },\n {\n label: HttpMethodStatus.PUT,\n value: HttpMethodStatus.PUT,\n },\n];\n","import Alert from '@mui/material/Alert';\nimport IconButton from '@mui/material/IconButton';\nimport { alpha, styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nexport const SyledIconButton = styled(IconButton)(({ theme }) => ({\n svg: {\n color: `${theme.palette.primary.main} !important`,\n },\n}));\n\nexport const StyledTypography = styled(Typography)(() => ({\n textDecoration: 'underline',\n fontWeight: '600',\n cursor: 'pointer',\n}));\n\nexport const StyledAlert = styled(Alert)(({ theme }) => ({\n backgroundColor: `${alpha(theme.palette.primary.main, 0.03)}`,\n border: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n flexDirection: 'row',\n alignItems: 'center',\n padding: '2px 12px',\n gap: 8,\n borderRadius: 8,\n marginBottom: 16,\n\n '& svg': {\n color: theme.palette.primary.main,\n },\n}));\n","import Typography from '@mui/material/Typography';\n\nimport { StyledAlert, StyledTypography } from './styles';\n\nconst WebhookAlert = () => {\n const handleLinkClick = () => {\n const url =\n 'https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks';\n window.open(url, '_blank');\n };\n\n return (\n <StyledAlert severity=\"info\">\n <Typography color=\"grey\" variant=\"caption\">\n Webhooks permitem que serviços externos sejam notificados quando\n determinados eventos acontecem. Saiba mais{' '}\n <StyledTypography\n variant=\"caption\"\n color=\"primary\"\n onClick={() => handleLinkClick()}\n >\n acessando a documentação do Webhook\n </StyledTypography>\n </Typography>\n </StyledAlert>\n );\n};\n\nexport default WebhookAlert;\n"]}
1
+ {"version":3,"sources":["../../../../src/components/form/Webhook/index.tsx","../../../../src/components/form/Webhook/props.ts","../../../../src/components/form/Webhook/styles.ts","../../../../src/components/form/Webhook/WebhookAlert.tsx"],"names":["useCallback","useMemo","useFieldArray","useFormContext","Divider","IconButton","InputAdornment","Stack","Typography","ContentTypeOptions","HttpMethodOptions","Alert","alpha","styled","SyledIconButton","theme","StyledTypography","StyledAlert","jsx","jsxs","WebhookAlert","handleLinkClick","url","WebhookAlert_default","Fragment","CONTENT_TYPE_RULES","HTTP_METHOD_RULES","URL_RULES","HEADER_KEY_RULES","Webhook","webhookData","isEditing","haveTip","hasFilter","hasType","control","headers","append","remove","handleCreateField","handleCopyResourceId","resourceIdInputProps","Icon_default","Field_default","Autocomplete_default","item","index","ActionButton_default","Webhook_default"],"mappings":"kQAAA,OAAS,eAAAA,EAAa,WAAAC,MAAe,QACrC,OAAS,iBAAAC,EAAe,kBAAAC,MAAsB,kBAC9C,OAAOC,MAAa,wBACpB,OAAOC,MAAgB,2BACvB,OAAOC,MAAoB,+BAC3B,OAAOC,MAAW,sBAClB,OAAOC,MAAgB,2BCiBhB,IAAMC,EAAqB,CAChC,CACE,MAAO,MACP,MAAO,KACT,EACA,CACE,MAAO,OACP,MAAO,MACT,EACA,CACE,MAAO,QACP,MAAO,OACT,CACF,EAEaC,EAAoB,CAC/B,CACE,MAAO,MACP,MAAO,KACT,EACA,CACE,MAAO,OACP,MAAO,MACT,EACA,CACE,MAAO,SACP,MAAO,QACT,EACA,CACE,MAAO,MACP,MAAO,KACT,CACF,ECvDA,OAAOC,MAAW,sBAClB,OAAON,MAAgB,2BACvB,OAAS,SAAAO,EAAO,UAAAC,MAAc,uBAC9B,OAAOL,MAAgB,2BAEhB,IAAMM,EAAkBD,EAAOR,CAAU,EAAE,CAAC,CAAE,MAAAU,CAAM,KAAO,CAChE,IAAK,CACH,MAAO,GAAGA,EAAM,QAAQ,QAAQ,iBAClC,CACF,EAAE,EAEWC,EAAmBH,EAAOL,CAAU,EAAE,KAAO,C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B,EAAA,CAAM,QAAQ,SAAS,KAAK,QAAQ,MAAM,SAAS,SAAQ,GAAC,GAC/D,GACF,EAEFxB,EAACZ,EAAA,CAAM,UAAU,MAAM,IAAK,EAAG,WAAW,SACvC,UAAA2B,GACChB,EAAC0B,EAAA,CACC,UAAS,GACT,QAASnC,EACT,KAAK,eACL,MAAM,sBACN,SAAQ,GACR,MAAOgB,EACT,EAEFP,EAAC0B,EAAA,CACC,UAAS,GACT,QAASlC,EACT,KAAK,cACL,MAAM,iBACN,SAAQ,GACR,MAAOgB,EACT,GACF,EACAR,EAACV,EAAA,CAAW,QAAQ,WAAW,MAAM,OAAO,wBAE5C,EACC4B,GAAS,IAAI,CAACS,EAAMC,IACnB3B,EAACZ,EAAA,CAAoB,UAAU,MAAM,IAAK,EAAG,WAAW,SACtD,UAAAW,EAACyB,EAAA,CACC,KAAM,WAAWG,SACjB,MAAM,QACN,SAAQ,GACR,MAAOlB,EACT,EACAV,EAACyB,EAAA,CAAM,KAAM,WAAWG,UAAe,MAAM,QAAQ,EACrD5B,EAACb,EAAA,CACC,aAAW,uBACX,MAAM,QACN,QAAS,IAAMiC,EAAOQ,CAAK,EAE3B,SAAA5B,EAACwB,EAAA,CAAK,KAAK,wBAAwB,EACrC,IAdUG,EAAK,EAejB,CACD,EACD3B,EAAC6B,EAAA,CACC,WAAW,MACX,KAAK,QACL,QAAQ,WACR,MAAM,UACN,UAAS,GACT,QAASR,EACV,uCAED,EACArB,EAACd,EAAA,EAAQ,GACX,CAEJ,EAEO4C,GAAQnB","sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { useFieldArray, useFormContext } from 'react-hook-form';\nimport Divider from '@mui/material/Divider';\nimport IconButton from '@mui/material/IconButton';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport ActionButton from 'components/ActionButton';\nimport Icon from 'components/Icon';\n\nimport Autocomplete from '../Autocomplete';\nimport Field from '../Field';\n\nimport { ContentTypeOptions, HttpMethodOptions, WebhookProps } from './props';\nimport { SyledIconButton } from './styles';\nimport WebhookAlert from './WebhookAlert';\n\nconst CONTENT_TYPE_RULES = {\n required: { value: true, message: 'Campo Tipo de conteúdo é obrigatório' },\n} as const;\n\nconst HTTP_METHOD_RULES = {\n required: { value: true, message: 'Campo Método HTTP é obrigatório' },\n} as const;\n\nconst URL_RULES = {\n required: { value: true, message: 'Url é obrigatório' },\n} as const;\n\nconst HEADER_KEY_RULES = {\n required: { value: true, message: '' },\n} as const;\n\nconst Webhook = ({\n webhookData,\n isEditing = false,\n haveTip = false,\n hasFilter = true,\n hasType = true,\n}: WebhookProps) => {\n const { control } = useFormContext();\n\n const {\n fields: headers,\n append,\n remove,\n } = useFieldArray({\n name: 'headers',\n control,\n });\n\n const handleCreateField = useCallback(() => {\n append({ value: '', name: '' });\n }, [append]);\n\n const handleCopyResourceId = useCallback(() => {\n if (!webhookData?.resource_id) return;\n navigator.clipboard\n .writeText(webhookData.resource_id)\n .catch(() => undefined);\n }, [webhookData?.resource_id]);\n\n const resourceIdInputProps = useMemo(\n () => ({\n endAdornment: (\n <InputAdornment position=\"end\">\n <SyledIconButton\n aria-label=\"Copiar ID origem\"\n onClick={handleCopyResourceId}\n >\n <Icon className=\"copyIcon\" icon=\"COPY_CONTENT\" />\n </SyledIconButton>\n </InputAdornment>\n ),\n }),\n [handleCopyResourceId],\n );\n\n return (\n <>\n {haveTip && <WebhookAlert />}\n {isEditing && <Field name=\"name\" label=\"Nome do webhook\" />}\n <Stack direction=\"row\" gap={2}>\n <Field name=\"url\" label=\"URL de endpoint\" rules={URL_RULES} />\n {hasFilter && <Field name=\"filter\" label=\"Filtro\" />}\n </Stack>\n {isEditing && webhookData && (\n <>\n <Field variant=\"filled\" name=\"solution\" label=\"Solução\" disabled />\n <Stack direction=\"row\" gap={2}>\n <Field variant=\"filled\" name=\"resource\" label=\"Origem\" disabled />\n <Field\n variant=\"filled\"\n name=\"resource_id\"\n label=\"ID origem\"\n disabled\n InputProps={resourceIdInputProps}\n />\n <Field variant=\"filled\" name=\"event\" label=\"Evento\" disabled />\n </Stack>\n </>\n )}\n <Stack direction=\"row\" gap={2} alignItems=\"center\">\n {hasType && (\n <Autocomplete\n fullWidth\n options={ContentTypeOptions}\n name=\"content_type\"\n label=\"Tipo de conteúdo\"\n required\n rules={CONTENT_TYPE_RULES}\n />\n )}\n <Autocomplete\n fullWidth\n options={HttpMethodOptions}\n name=\"http_method\"\n label=\"Método HTTP\"\n required\n rules={HTTP_METHOD_RULES}\n />\n </Stack>\n <Typography variant=\"overline\" color=\"grey\">\n Cabeçalho\n </Typography>\n {headers?.map((item, index) => (\n <Stack key={item.id} direction=\"row\" gap={2} alignItems=\"center\">\n <Field\n name={`headers.${index}.name`}\n label=\"Chave\"\n required\n rules={HEADER_KEY_RULES}\n />\n <Field name={`headers.${index}.value`} label=\"Valor\" />\n <IconButton\n aria-label=\"Remover cabeçalho\"\n color=\"error\"\n onClick={() => remove(index)}\n >\n <Icon icon=\"DELETE_MARK_BUTTON_02\" />\n </IconButton>\n </Stack>\n ))}\n <ActionButton\n actionType=\"NEW\"\n size=\"large\"\n variant=\"outlined\"\n color=\"inherit\"\n fullWidth\n onClick={handleCreateField}\n >\n Adicionar novo cabeçalho\n </ActionButton>\n <Divider />\n </>\n );\n};\n\nexport default Webhook;\n","import { WebhookType } from 'types/webhook';\n\nexport interface WebhookProps {\n webhookData?: WebhookType;\n isEditing?: boolean;\n haveTip?: boolean;\n hasFilter?: boolean;\n hasType?: boolean;\n}\nexport enum ContentTypeStatus {\n XML = 'XML',\n JSON = 'JSON',\n BYTEA = 'BYTEA',\n}\n\nexport enum HttpMethodStatus {\n GET = 'GET',\n POST = 'POST',\n PATCH = 'PATCH',\n DELETE = 'DELETE',\n PUT = 'PUT',\n}\n\nexport const ContentTypeOptions = [\n {\n label: ContentTypeStatus.XML,\n value: ContentTypeStatus.XML,\n },\n {\n label: ContentTypeStatus.JSON,\n value: ContentTypeStatus.JSON,\n },\n {\n label: ContentTypeStatus.BYTEA,\n value: ContentTypeStatus.BYTEA,\n },\n];\n\nexport const HttpMethodOptions = [\n {\n label: HttpMethodStatus.GET,\n value: HttpMethodStatus.GET,\n },\n {\n label: HttpMethodStatus.POST,\n value: HttpMethodStatus.POST,\n },\n {\n label: HttpMethodStatus.DELETE,\n value: HttpMethodStatus.DELETE,\n },\n {\n label: HttpMethodStatus.PUT,\n value: HttpMethodStatus.PUT,\n },\n];\n","import Alert from '@mui/material/Alert';\nimport IconButton from '@mui/material/IconButton';\nimport { alpha, styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nexport const SyledIconButton = styled(IconButton)(({ theme }) => ({\n svg: {\n color: `${theme.palette.primary.main} !important`,\n },\n}));\n\nexport const StyledTypography = styled(Typography)(() => ({\n textDecoration: 'underline',\n fontWeight: '600',\n cursor: 'pointer',\n}));\n\nexport const StyledAlert = styled(Alert)(({ theme }) => ({\n backgroundColor: `${alpha(theme.palette.primary.main, 0.03)}`,\n border: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n flexDirection: 'row',\n alignItems: 'center',\n padding: '2px 12px',\n gap: 8,\n borderRadius: 8,\n marginBottom: 16,\n\n '& svg': {\n color: theme.palette.primary.main,\n },\n}));\n","import Typography from '@mui/material/Typography';\n\nimport { StyledAlert, StyledTypography } from './styles';\n\nconst WebhookAlert = () => {\n const handleLinkClick = () => {\n const url =\n 'https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks';\n window.open(url, '_blank');\n };\n\n return (\n <StyledAlert severity=\"info\">\n <Typography color=\"grey\" variant=\"caption\">\n Webhooks permitem que serviços externos sejam notificados quando\n determinados eventos acontecem. Saiba mais{' '}\n <StyledTypography\n variant=\"caption\"\n color=\"primary\"\n onClick={() => handleLinkClick()}\n >\n acessando a documentação do Webhook\n </StyledTypography>\n </Typography>\n </StyledAlert>\n );\n};\n\nexport default WebhookAlert;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
 
3
- var i=()=>{let[o,r]=useState(!1),[u,e]=useState(document.activeElement);return useEffect(()=>{let t=l=>e(l.target),n=()=>e(null);return window.addEventListener("focus",t,!0),window.addEventListener("blur",n,!0),r(!0),()=>{window.removeEventListener("focus",t),window.removeEventListener("blur",n);}},[]),{activeElement:u,listenersReady:o}},d=i;
3
+ var i=()=>{let[s,o]=useState(!1),[u,e]=useState(document.activeElement);return useEffect(()=>{let t=l=>e(l.target),n=()=>e(null);return window.addEventListener("focus",t,!0),window.addEventListener("blur",n,!0),o(!0),()=>{window.removeEventListener("focus",t,!0),window.removeEventListener("blur",n,!0);}},[]),{activeElement:u,listenersReady:s}},d=i;
4
4
 
5
5
  export { d as default };
6
6
  //# sourceMappingURL=useActiveElement.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useActiveElement.ts"],"names":["useEffect","useState","useActiveElement","listenersReady","setListenersReady","activeElement","setActiveElement","onFocus","event","onBlur","useActiveElement_default"],"mappings":"AAAA,OAAS,aAAAA,EAAW,YAAAC,MAAgB,QAEpC,IAAMC,EAAmB,IAAM,CAC7B,GAAM,CAACC,EAAgBC,CAAiB,EAAIH,EAAkB,EAAK,EAC7D,CAACI,EAAeC,CAAgB,EAAIL,EACxC,SAAS,aACX,EAEA,OAAAD,EAAU,IAAM,CACd,IAAMO,EAAWC,GACfF,EAAiBE,EAAM,MAAiB,EACpCC,EAAS,IAAMH,EAAiB,IAAI,EAE1C,cAAO,iBAAiB,QAASC,EAAS,EAAI,EAC9C,OAAO,iBAAiB,OAAQE,EAAQ,EAAI,EAE5CL,EAAkB,EAAI,EAEf,IAAM,CACX,OAAO,oBAAoB,QAASG,CAAO,EAC3C,OAAO,oBAAoB,OAAQE,CAAM,CAC3C,CACF,EAAG,CAAC,CAAC,EAEE,CACL,cAAAJ,EACA,eAAAF,CACF,CACF,EAEOO,EAAQR","sourcesContent":["import { useEffect, useState } from 'react';\n\nconst useActiveElement = () => {\n const [listenersReady, setListenersReady] = useState<boolean>(false);\n const [activeElement, setActiveElement] = useState<Element | null>(\n document.activeElement,\n );\n\n useEffect(() => {\n const onFocus = (event: FocusEvent) =>\n setActiveElement(event.target as Element);\n const onBlur = () => setActiveElement(null);\n\n window.addEventListener('focus', onFocus, true);\n window.addEventListener('blur', onBlur, true);\n\n setListenersReady(true);\n\n return () => {\n window.removeEventListener('focus', onFocus);\n window.removeEventListener('blur', onBlur);\n };\n }, []);\n\n return {\n activeElement,\n listenersReady,\n };\n};\n\nexport default useActiveElement;\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useActiveElement.ts"],"names":["useEffect","useState","useActiveElement","listenersReady","setListenersReady","activeElement","setActiveElement","onFocus","event","onBlur","useActiveElement_default"],"mappings":"AAAA,OAAS,aAAAA,EAAW,YAAAC,MAAgB,QAEpC,IAAMC,EAAmB,IAAM,CAC7B,GAAM,CAACC,EAAgBC,CAAiB,EAAIH,EAAkB,EAAK,EAC7D,CAACI,EAAeC,CAAgB,EAAIL,EACxC,SAAS,aACX,EAEA,OAAAD,EAAU,IAAM,CACd,IAAMO,EAAWC,GACfF,EAAiBE,EAAM,MAAiB,EACpCC,EAAS,IAAMH,EAAiB,IAAI,EAE1C,cAAO,iBAAiB,QAASC,EAAS,EAAI,EAC9C,OAAO,iBAAiB,OAAQE,EAAQ,EAAI,EAE5CL,EAAkB,EAAI,EAEf,IAAM,CACX,OAAO,oBAAoB,QAASG,EAAS,EAAI,EACjD,OAAO,oBAAoB,OAAQE,EAAQ,EAAI,CACjD,CACF,EAAG,CAAC,CAAC,EAEE,CACL,cAAAJ,EACA,eAAAF,CACF,CACF,EAEOO,EAAQR","sourcesContent":["import { useEffect, useState } from 'react';\n\nconst useActiveElement = () => {\n const [listenersReady, setListenersReady] = useState<boolean>(false);\n const [activeElement, setActiveElement] = useState<Element | null>(\n document.activeElement,\n );\n\n useEffect(() => {\n const onFocus = (event: FocusEvent) =>\n setActiveElement(event.target as Element);\n const onBlur = () => setActiveElement(null);\n\n window.addEventListener('focus', onFocus, true);\n window.addEventListener('blur', onBlur, true);\n\n setListenersReady(true);\n\n return () => {\n window.removeEventListener('focus', onFocus, true);\n window.removeEventListener('blur', onBlur, true);\n };\n }, []);\n\n return {\n activeElement,\n listenersReady,\n };\n};\n\nexport default useActiveElement;\n"]}
@@ -1,7 +1,7 @@
1
- export { a as default } from '../chunk-CWRUW77O.js';
2
- import '../chunk-CYWFK4OE.js';
1
+ export { a as default } from '../chunk-C2G7TCA7.js';
2
+ import '../chunk-2HAPOY5M.js';
3
3
  import '../chunk-XNKYJHNL.js';
4
- import '../chunk-KKVRDMSE.js';
4
+ import '../chunk-FJBC6QA5.js';
5
5
  import '../chunk-POTVACYB.js';
6
6
  import '../chunk-ET3WPQIO.js';
7
7
  //# sourceMappingURL=useCollapseSidebarOnMount.js.map
@@ -1,4 +1,4 @@
1
- export { a as default } from '../chunk-KKVRDMSE.js';
1
+ export { a as default } from '../chunk-FJBC6QA5.js';
2
2
  import '../chunk-POTVACYB.js';
3
3
  import '../chunk-ET3WPQIO.js';
4
4
  //# sourceMappingURL=useEventListener.js.map
@@ -1,5 +1,5 @@
1
- export { a as default } from '../chunk-CYWFK4OE.js';
2
- import '../chunk-KKVRDMSE.js';
1
+ export { a as default } from '../chunk-2HAPOY5M.js';
2
+ import '../chunk-FJBC6QA5.js';
3
3
  import '../chunk-POTVACYB.js';
4
4
  import '../chunk-ET3WPQIO.js';
5
5
  //# sourceMappingURL=useLocalStorage.js.map
@@ -1,4 +1,4 @@
1
- import { a } from '../chunk-KKVRDMSE.js';
1
+ import { a } from '../chunk-FJBC6QA5.js';
2
2
  import '../chunk-POTVACYB.js';
3
3
  import '../chunk-ET3WPQIO.js';
4
4
 
@@ -4,6 +4,6 @@ type ReturnType = boolean;
4
4
  type Query = 'up' | 'down' | 'between' | 'only';
5
5
  type Value = Breakpoint | number;
6
6
  declare const useResponsive: (query: Query, start?: Value, end?: Value) => ReturnType;
7
- declare function useWidth(): "sm" | "md" | "lg" | "xs" | "xl";
7
+ declare function useWidth(): "xs" | "sm" | "md" | "lg" | "xl";
8
8
 
9
9
  export { useResponsive as default, useWidth };
@@ -1,2 +1,2 @@
1
- export { b as default, a as useWidth } from '../chunk-RPO7AI5K.js';
1
+ export { b as default, a as useWidth } from '../chunk-2ZJUGM2S.js';
2
2
  //# sourceMappingURL=useResponsive.js.map
@@ -1,7 +1,7 @@
1
- import { useState } from 'react';
1
+ import { useState, useRef, useCallback, useEffect } from 'react';
2
2
  import { useFormContext } from 'react-hook-form';
3
3
 
4
- function F(t,i){let{watch:r,setValue:n}=useFormContext(),[u,o]=useState(i),l=r(t)||[];return {uploadFile:async e=>{if(!e){n(t,void 0),o(void 0);return}n(t,e),o(Object.assign(e,{preview:URL.createObjectURL(e)}));},uploadFiles:async e=>{n(t,[...l,...e.map(s=>Object.assign(s,{preview:URL.createObjectURL(s)}))]);},handleDeleteFile:()=>{n(t,void 0),o(void 0);},handleRemoveAll:()=>{n(t,void 0);},handleRemove:e=>{let s=l.filter(a=>a!==e);n(t,s);},file:u,setFileValue:o}}var b=F;
4
+ function b(t,a){let{watch:d,setValue:r}=useFormContext(),[p,o]=useState(a),u=d(t)||[],l=useRef([]),c=useCallback(e=>{let n=URL.createObjectURL(e);return l.current.push(n),n},[]),s=useCallback(()=>{l.current.forEach(e=>URL.revokeObjectURL(e)),l.current=[];},[]);return useEffect(()=>()=>s(),[s]),{uploadFile:async e=>{if(!e){s(),r(t,void 0),o(void 0);return}s(),r(t,e),o(Object.assign(e,{preview:c(e)}));},uploadFiles:async e=>{r(t,[...u,...e.map(n=>Object.assign(n,{preview:c(n)}))]);},handleDeleteFile:()=>{s(),r(t,void 0),o(void 0);},handleRemoveAll:()=>{r(t,void 0);},handleRemove:e=>{let n=u.filter(F=>F!==e);r(t,n);},file:p,setFileValue:o}}var O=b;
5
5
 
6
- export { b as default };
6
+ export { O as default };
7
7
  //# sourceMappingURL=useUpload.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useUpload.ts"],"names":["useState","useFormContext","useUpload","fieldName","urlImage","watch","setValue","fileValue","setFileValue","filesValues","file","files","filteredItems","f","useUpload_default"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,QACzB,OAAS,kBAAAC,MAAsB,kBAI/B,SAASC,EAAUC,EAAmBC,EAAmB,CACvD,GAAM,CAAE,MAAAC,EAAO,SAAAC,CAAS,EAAIL,EAAe,EACrC,CAACM,EAAWC,CAAY,EAAIR,EAChCI,CACF,EACMK,EAAwBJ,EAAMF,CAAS,GAAK,CAAC,EA4CnD,MAAO,CACL,WA3CiB,MAAOO,GAAgB,CACxC,GAAI,CAACA,EAAM,CACTJ,EAASH,EAAW,MAAS,EAC7BK,EAAa,MAAS,EACtB,OAGFF,EAASH,EAAWO,CAAI,EAExBF,EACE,OAAO,OAAOE,EAAM,CAClB,QAAS,IAAI,gBAAgBA,CAAI,CACnC,CAAC,CACH,CACF,EA8BE,YA5BkB,MAAOC,GAAkB,CAC3CL,EAASH,EAAW,CAClB,GAAGM,EACH,GAAGE,EAAM,IAAKD,GACZ,OAAO,OAAOA,EAAM,CAClB,QAAS,IAAI,gBAAgBA,CAAI,CACnC,CAAC,CACH,CACF,CAAC,CACH,EAoBE,iBAlBuB,IAAM,CAC7BJ,EAASH,EAAW,MAAS,EAC7BK,EAAa,MAAS,CACxB,EAgBE,gBAdsB,IAAM,CAC5BF,EAASH,EAAW,MAAS,CAC/B,EAaE,aAXoBO,GAAwB,CAC5C,IAAME,EAAgBH,EAAY,OAAOI,GAAKA,IAAMH,CAAI,EAExDJ,EAASH,EAAWS,CAAa,CACnC,EAQE,KAAML,EACN,aAAAC,CACF,CACF,CAEA,IAAOM,EAAQZ","sourcesContent":["import { useState } from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nimport { CustomFile } from 'types/upload';\n\nfunction useUpload(fieldName: string, urlImage?: string) {\n const { watch, setValue } = useFormContext();\n const [fileValue, setFileValue] = useState<CustomFile | string | undefined>(\n urlImage,\n );\n const filesValues: string[] = watch(fieldName) || [];\n\n const uploadFile = async (file?: File) => {\n if (!file) {\n setValue(fieldName, undefined);\n setFileValue(undefined);\n return;\n }\n\n setValue(fieldName, file);\n\n setFileValue(\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n );\n };\n\n const uploadFiles = async (files: File[]) => {\n setValue(fieldName, [\n ...filesValues,\n ...files.map((file: Blob | MediaSource) =>\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n ),\n ]);\n };\n\n const handleDeleteFile = () => {\n setValue(fieldName, undefined);\n setFileValue(undefined);\n };\n\n const handleRemoveAll = () => {\n setValue(fieldName, undefined);\n };\n\n const handleRemove = (file: File | string) => {\n const filteredItems = filesValues.filter(f => f !== file);\n\n setValue(fieldName, filteredItems);\n };\n\n return {\n uploadFile,\n uploadFiles,\n handleDeleteFile,\n handleRemoveAll,\n handleRemove,\n file: fileValue,\n setFileValue,\n };\n}\n\nexport default useUpload;\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useUpload.ts"],"names":["useCallback","useEffect","useRef","useState","useFormContext","useUpload","fieldName","urlImage","watch","setValue","fileValue","setFileValue","filesValues","objectUrlsRef","createTrackedUrl","file","url","revokeAllUrls","files","filteredItems","f","useUpload_default"],"mappings":"AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QACzD,OAAS,kBAAAC,MAAsB,kBAI/B,SAASC,EAAUC,EAAmBC,EAAmB,CACvD,GAAM,CAAE,MAAAC,EAAO,SAAAC,CAAS,EAAIL,EAAe,EACrC,CAACM,EAAWC,CAAY,EAAIR,EAChCI,CACF,EACMK,EAAwBJ,EAAMF,CAAS,GAAK,CAAC,EAC7CO,EAAgBX,EAAiB,CAAC,CAAC,EAEnCY,EAAmBd,EAAae,GAA6B,CACjE,IAAMC,EAAM,IAAI,gBAAgBD,CAAI,EACpC,OAAAF,EAAc,QAAQ,KAAKG,CAAG,EACvBA,CACT,EAAG,CAAC,CAAC,EAECC,EAAgBjB,EAAY,IAAM,CACtCa,EAAc,QAAQ,QAAQG,GAAO,IAAI,gBAAgBA,CAAG,CAAC,EAC7DH,EAAc,QAAU,CAAC,CAC3B,EAAG,CAAC,CAAC,EAEL,OAAAZ,EAAU,IACD,IAAMgB,EAAc,EAC1B,CAACA,CAAa,CAAC,EA+CX,CACL,WA9CiB,MAAOF,GAAgB,CACxC,GAAI,CAACA,EAAM,CACTE,EAAc,EACdR,EAASH,EAAW,MAAS,EAC7BK,EAAa,MAAS,EACtB,OAGFM,EAAc,EACdR,EAASH,EAAWS,CAAI,EAExBJ,EACE,OAAO,OAAOI,EAAM,CAClB,QAASD,EAAiBC,CAAI,CAChC,CAAC,CACH,CACF,EA+BE,YA7BkB,MAAOG,GAAkB,CAC3CT,EAASH,EAAW,CAClB,GAAGM,EACH,GAAGM,EAAM,IAAKH,GACZ,OAAO,OAAOA,EAAM,CAClB,QAASD,EAAiBC,CAAI,CAChC,CAAC,CACH,CACF,CAAC,CACH,EAqBE,iBAnBuB,IAAM,CAC7BE,EAAc,EACdR,EAASH,EAAW,MAAS,EAC7BK,EAAa,MAAS,CACxB,EAgBE,gBAdsB,IAAM,CAC5BF,EAASH,EAAW,MAAS,CAC/B,EAaE,aAXoBS,GAAwB,CAC5C,IAAMI,EAAgBP,EAAY,OAAOQ,GAAKA,IAAML,CAAI,EAExDN,EAASH,EAAWa,CAAa,CACnC,EAQE,KAAMT,EACN,aAAAC,CACF,CACF,CAEA,IAAOU,EAAQhB","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nimport { CustomFile } from 'types/upload';\n\nfunction useUpload(fieldName: string, urlImage?: string) {\n const { watch, setValue } = useFormContext();\n const [fileValue, setFileValue] = useState<CustomFile | string | undefined>(\n urlImage,\n );\n const filesValues: string[] = watch(fieldName) || [];\n const objectUrlsRef = useRef<string[]>([]);\n\n const createTrackedUrl = useCallback((file: Blob | MediaSource) => {\n const url = URL.createObjectURL(file);\n objectUrlsRef.current.push(url);\n return url;\n }, []);\n\n const revokeAllUrls = useCallback(() => {\n objectUrlsRef.current.forEach(url => URL.revokeObjectURL(url));\n objectUrlsRef.current = [];\n }, []);\n\n useEffect(() => {\n return () => revokeAllUrls();\n }, [revokeAllUrls]);\n\n const uploadFile = async (file?: File) => {\n if (!file) {\n revokeAllUrls();\n setValue(fieldName, undefined);\n setFileValue(undefined);\n return;\n }\n\n revokeAllUrls();\n setValue(fieldName, file);\n\n setFileValue(\n Object.assign(file, {\n preview: createTrackedUrl(file),\n }),\n );\n };\n\n const uploadFiles = async (files: File[]) => {\n setValue(fieldName, [\n ...filesValues,\n ...files.map((file: Blob | MediaSource) =>\n Object.assign(file, {\n preview: createTrackedUrl(file),\n }),\n ),\n ]);\n };\n\n const handleDeleteFile = () => {\n revokeAllUrls();\n setValue(fieldName, undefined);\n setFileValue(undefined);\n };\n\n const handleRemoveAll = () => {\n setValue(fieldName, undefined);\n };\n\n const handleRemove = (file: File | string) => {\n const filteredItems = filesValues.filter(f => f !== file);\n\n setValue(fieldName, filteredItems);\n };\n\n return {\n uploadFile,\n uploadFiles,\n handleDeleteFile,\n handleRemoveAll,\n handleRemove,\n file: fileValue,\n setFileValue,\n };\n}\n\nexport default useUpload;\n"]}
@@ -0,0 +1,3 @@
1
+ declare const sanitizeHtml: (html?: string | null) => string;
2
+
3
+ export { sanitizeHtml };
@@ -0,0 +1,6 @@
1
+ import i from 'isomorphic-dompurify';
2
+
3
+ var r=["div","span","p","b","i","em","strong","u","br","hr","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","table","thead","tbody","tfoot","tr","th","td","img","a","figure","figcaption"],e=["class","style","title","alt","width","height","colspan","rowspan","src","href","rel"],s=t=>t?i.sanitize(t,{ALLOWED_TAGS:r,ALLOWED_ATTR:e,ALLOW_DATA_ATTR:!1}):"";
4
+
5
+ export { s as sanitizeHtml };
6
+ //# sourceMappingURL=sanitize-html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/sanitize-html.ts"],"names":["DOMPurify","ALLOWED_TAGS","ALLOWED_ATTR","sanitizeHtml","html"],"mappings":"AAAA,OAAOA,MAAe,uBAEtB,IAAMC,EAAe,CACnB,MACA,OACA,IACA,IACA,IACA,KACA,SACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,aACA,QACA,QACA,QACA,QACA,KACA,KACA,KACA,MACA,IACA,SACA,YACF,EAEMC,EAAe,CACnB,QACA,QACA,QACA,MACA,QACA,SACA,UACA,UACA,MACA,OACA,KACF,EAEaC,EAAgBC,GACtBA,EAEEJ,EAAU,SAASI,EAAM,CAC9B,aAAAH,EACA,aAAAC,EACA,gBAAiB,EACnB,CAAC,EANiB","sourcesContent":["import DOMPurify from 'isomorphic-dompurify';\n\nconst ALLOWED_TAGS = [\n 'div',\n 'span',\n 'p',\n 'b',\n 'i',\n 'em',\n 'strong',\n 'u',\n 'br',\n 'hr',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'ul',\n 'ol',\n 'li',\n 'blockquote',\n 'table',\n 'thead',\n 'tbody',\n 'tfoot',\n 'tr',\n 'th',\n 'td',\n 'img',\n 'a',\n 'figure',\n 'figcaption',\n];\n\nconst ALLOWED_ATTR = [\n 'class',\n 'style',\n 'title',\n 'alt',\n 'width',\n 'height',\n 'colspan',\n 'rowspan',\n 'src',\n 'href',\n 'rel',\n];\n\nexport const sanitizeHtml = (html?: string | null): string => {\n if (!html) return '';\n\n return DOMPurify.sanitize(html, {\n ALLOWED_TAGS,\n ALLOWED_ATTR,\n ALLOW_DATA_ATTR: false,\n });\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.8.68",
3
+ "version": "2.8.69",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -166,6 +166,7 @@
166
166
  "framer-motion": "^11.3.30",
167
167
  "hugeicons-react": "0.4.0",
168
168
  "invariant": "^2.2.4",
169
+ "isomorphic-dompurify": "^3.6.0",
169
170
  "lodash": "^4.17.21",
170
171
  "react-color": "^2.19.3",
171
172
  "react-cropper": "^2.3.3",
@@ -1,16 +0,0 @@
1
- import { a } from './chunk-FBVAHVU3.js';
2
- import { k, b } from './chunk-GLRLKFPS.js';
3
- import { forwardRef, Children, isValidElement, useMemo, useState, useCallback, useEffect, useRef } from 'react';
4
- import N from '@mui/material/Box';
5
- import { styled, useTheme } from '@mui/material/styles';
6
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
- import J, { buttonBaseClasses } from '@mui/material/ButtonBase';
8
- import Y from '@mui/material/Stack';
9
- import he from '@mui/material/SvgIcon';
10
- import _e from '@mui/material/NoSsr';
11
- import Xe from 'embla-carousel-react';
12
-
13
- var Ge={xs:"(min-width: 0px)",sm:"(min-width: 600px)",md:"(min-width: 900px)",lg:"(min-width: 1200px)",xl:"(min-width: 1536px)"};var p={root:"mnl__carousel__root",container:"mnl__carousel__container",dots:"mnl__carousel__dots",dot:"mnl__carousel__dot",arrows:"mnl__carousel__arrows",arrowsLabel:"mnl__carousel__arrows_label",arrowPrev:"mnl__carousel__btn--prev",arrowNext:"mnl__carousel__btn--next",arrowSvg:"mnl__carousel__btn__svg",slide:"mnl__carousel__slide",slideContent:"mnl__carousel__slide__content",thumbs:"mnl__carousel__thumbs",thumb:"mnl__carousel__thumb",thumbContainer:"mnl__carousel__thumbs__container",thumbImage:"mnl__carousel__thumb__image",progress:"mnl__carousel__progress",progressBar:"mnl__carousel__progress__bar",state:{selected:"state--selected",disabled:"state--disabled"}};var pe=styled(N,{shouldForwardProp:e=>e!=="axis"&&e!=="slideSpacing"})(({axis:e,slideSpacing:o})=>({display:"block",position:"relative",...e==="x"&&{minWidth:0,paddingLeft:o},...e==="y"&&{minHeight:0,paddingTop:o}})),me=styled(N)(()=>({overflow:"hidden",position:"relative",borderRadius:"inherit"}));function w({sx:e,options:o,children:r,...t}){let i=de(o?.slidesToShow);return jsx(pe,{component:"li",axis:o?.axis??"x",slideSpacing:o?.slideSpacing,className:p.slide,sx:{flex:i,...e},...t,children:o?.parallax?jsx(me,{className:p.slideContent,children:jsx("div",{className:"slide__parallax__layer",children:r})}):r})}function de(e){return e&&typeof e=="object"?Object.keys(e).reduce((o,r)=>{let t=e[r];return o[r]=W(t),o},{}):W(e)}function W(e=1){if(typeof e=="string"){if(!(e==="auto"||e.endsWith("%")||e.endsWith("px")))throw new Error("Only accepts values: auto, px, %, or number.");return `0 0 ${e}`}if(typeof e=="number")return `0 0 ${100/e}%`;throw new Error("Invalid value type. Only accepts values: auto, px, %, or number.")}var R=styled(N,{shouldForwardProp:e=>e!=="axis"})(({axis:e})=>({margin:"auto",width:"100%",maxWidth:"100%",overflow:"hidden",position:"relative",...e==="y"&&{height:"100%"}})),T=styled(N,{shouldForwardProp:e=>e!=="axis"&&e!=="slideSpacing"})(({axis:e,slideSpacing:o})=>({display:"flex",backfaceVisibility:"hidden",...e==="x"&&{touchAction:"pan-y pinch-zoom",marginLeft:`calc(${o} * -1)`},...e==="y"&&{height:"100%",flexDirection:"column",touchAction:"pan-x pinch-zoom",marginTop:`calc(${o} * -1)`}}));function io({carousel:e,children:o,sx:r,slotProps:t,...i}){let{mainRef:n,options:s}=e,a=s?.axis??"x",l=s?.slideSpacing??"0px",c=s?.direction??"ltr",u=Children.map(o,m=>{if(isValidElement(m)){let d=m;return jsx(w,{options:e.options,sx:t?.slide,...i,children:m},d.key)}return null});return jsx(R,{sx:r,axis:a,ref:n,dir:c,className:p.root,children:jsx(T,{component:"ul",axis:a,slideSpacing:l,className:p.container,sx:{...e.pluginNames?.includes("autoHeight")&&{alignItems:"flex-start",transition:m=>m.transitions.create(["height"],{easing:m.transitions.easing.easeInOut,duration:m.transitions.duration.shorter})},...t?.container},children:u})})}function Co({options:e,slotProps:o,totalSlides:r,selectedIndex:t,onClickPrev:i,onClickNext:n,disablePrev:s,disableNext:a,sx:l,...c}){return jsxs(Y,{direction:"row",alignItems:"center",display:"inline-flex",className:p.arrows,sx:{gap:.5,zIndex:9,color:"action.active",...l},...c,children:[jsx(h,{variant:"prev",options:e,disabled:s,onClick:i,svgIcon:o?.prevBtn?.svgIcon,svgSize:o?.prevBtn?.svgSize,sx:o?.prevBtn?.sx}),jsx(h,{variant:"next",options:e,disabled:a,onClick:n,svgIcon:o?.nextBtn?.svgIcon,svgSize:o?.prevBtn?.svgSize,sx:o?.prevBtn?.sx})]})}function ho({options:e,slotProps:o,totalSlides:r,selectedIndex:t,onClickPrev:i,onClickNext:n,disablePrev:s,disableNext:a,sx:l,...c}){let u=useTheme();return jsxs(Y,{direction:"row",alignItems:"center",display:"inline-flex",className:p.arrows,sx:{p:.5,gap:.25,zIndex:9,borderRadius:1.25,color:"common.white",bgcolor:k(u.vars.palette.grey["900Channel"],.48),...l},...c,children:[jsx(h,{variant:"prev",options:e,disabled:s,onClick:i,sx:{p:.75,borderRadius:"inherit",...o?.prevBtn?.sx},svgIcon:o?.prevBtn?.svgIcon,svgSize:o?.prevBtn?.svgSize??16}),jsxs(N,{component:"span",className:p.arrowsLabel,sx:{mx:.5,typography:"subtitle2"},"data-testid":"carousel-number-display",children:[t,"/",r]}),jsx(h,{variant:"next",options:e,disabled:a,onClick:n,sx:{p:.75,borderRadius:"inherit",...o?.nextBtn?.sx},svgIcon:o?.nextBtn?.svgIcon,svgSize:o?.prevBtn?.svgSize??16})]})}function So({options:e,slotProps:o,onClickPrev:r,onClickNext:t,disablePrev:i,disableNext:n}){let s={zIndex:9,top:"50%",borderRadius:1.5,position:"absolute",color:"common.white",bgcolor:"text.primary",transform:"translateY(-50%)","&:hover":{opacity:.8},[b.dark]:{color:"grey.800"}};return jsxs(Fragment,{children:[jsx(h,{variant:"prev",options:e,disabled:i,onClick:r,svgIcon:o?.prevBtn?.svgIcon,svgSize:o?.prevBtn?.svgSize,sx:{left:-16,...s,...o?.prevBtn?.sx}}),jsx(h,{variant:"next",options:e,disabled:n,onClick:t,svgIcon:o?.nextBtn?.svgIcon,svgSize:o?.nextBtn?.svgSize,sx:{right:-16,...s,...o?.nextBtn?.sx}})]})}function h({sx:e,svgIcon:o,svgSize:r,options:t,variant:i,...n}){let s=i==="prev",a=i==="next",l=o||jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.488 4.43a.75.75 0 0 1 .081 1.058L9.988 12l5.581 6.512a.75.75 0 1 1-1.138.976l-6-7a.75.75 0 0 1 0-.976l6-7a.75.75 0 0 1 1.057-.081",clipRule:"evenodd"}),c=o||jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M8.512 4.43a.75.75 0 0 1 1.057.082l6 7a.75.75 0 0 1 0 .976l-6 7a.75.75 0 0 1-1.138-.976L14.012 12L8.431 5.488a.75.75 0 0 1 .08-1.057",clipRule:"evenodd"});return jsx(J,{className:s?p.arrowPrev:p.arrowPrev,"aria-label":s?"Prev button":"Next button",sx:{p:1,borderRadius:"50%",boxSizing:"content-box",transition:u=>u.transitions.create(["all"],{easing:u.transitions.easing.sharp,duration:u.transitions.duration.short}),[`&.${buttonBaseClasses.disabled}`]:{opacity:.4},...e,...t?.direction==="rtl"&&{...s&&{right:-16,left:"auto"},...a&&{left:-16,right:"auto"}}},...n,children:jsx(he,{className:p.arrowSvg,sx:{width:r??20,height:r??20,...t?.axis==="y"&&{transform:" rotate(90deg)"},...t?.direction==="rtl"&&{transform:" scaleX(-1)"}},children:s?l:c})})}function Ro({sx:e,gap:o,slotProps:r,onClickDot:t,scrollSnaps:i,selectedIndex:n,fallbackCount:s=1,variant:a="circular",fallback:l=!1,...c}){let u=useTheme(),m={number:o??6,rounded:o??2,circular:o??2},d={circular:r?.dot?.size??18,number:r?.dot?.size??28},S=jsx(N,{sx:{height:d.circular,width:`calc(${s*d.circular+m.circular*(s-1)}px )`,...a==="number"&&{height:d.number,width:`calc(${s*d.number+m.number*(s-1)}px )`}}}),f={circular:y=>({width:d.circular,height:d.circular,"&::before":{width:8,height:8,content:'""',opacity:.24,borderRadius:"50%",bgcolor:"primary.main",transition:u.transitions.create(["opacity"],{easing:u.transitions.easing.sharp,duration:u.transitions.duration.short}),...y&&{opacity:1}}}),rounded:y=>({width:d.circular,height:d.circular,"&::before":{width:8,height:8,content:'""',opacity:.24,borderRadius:"50%",bgcolor:"primary.main",transition:u.transitions.create(["width","opacity"],{easing:u.transitions.easing.sharp,duration:u.transitions.duration.short}),...y&&{width:"calc(100% - 4px)",opacity:1,borderRadius:1}}}),number:y=>({width:d.number,height:d.number,borderRadius:"50%",typography:"caption",color:"text.disabled",border:`solid 1px ${k(u.vars.palette.grey["500Channel"],.16)}`,...y&&{color:"common.white",bgcolor:"text.primary",fontWeight:"fontWeightSemiBold",[b.dark]:{color:"grey.800"}}})};return jsx(_e,{fallback:l?S:null,children:jsx(N,{"data-testid":"carousel-dots",component:"ul",className:p.dots,sx:{zIndex:9,display:"inline-flex",...a==="circular"&&{gap:`${m.circular}px`},...a==="rounded"&&{gap:`${m.rounded}px`},...a==="number"&&{gap:`${m.number}px`},...e},...c,children:i.map((y,x)=>{let v=x===n;return jsx(N,{component:"li",sx:{display:"inline-flex"},children:jsx(J,{disableRipple:!0,"aria-label":`dot-${x}`,className:p.dot.concat(v?` ${p.state.selected}`:""),onClick:()=>t(x),sx:{...a==="circular"&&f.circular(v),...a==="rounded"&&f.rounded(v),...a==="number"&&f.number(v),[`&.${p.state.selected}`]:{...r?.dot?.selected},...r?.dot?.sx},children:a==="number"&&x+1})},x)})})})}var we=styled(N)(({theme:e})=>({height:6,maxWidth:120,width:"100%",borderRadius:6,overflow:"hidden",position:"relative",color:e.palette.text.primary,backgroundColor:e.palette.divider})),Pe=styled(N)(()=>({top:0,bottom:0,width:"100%",left:"-100%",position:"absolute",backgroundColor:"currentColor"}));function Lo({value:e,sx:o,...r}){return jsx(we,{"data-testid":"carousel-progress",sx:o,className:p.progress,...r,children:jsx(Pe,{"data-testid":"carousel-progress-bar",className:p.progressBar,sx:{transform:`translate3d(${e}%, 0px, 0px)`}})})}var Ne=forwardRef(({children:e,slotProps:o,options:r,sx:t,...i},n)=>{let s=r?.axis??"x",a=r?.slideSpacing??"12px",l=Oe(s),c=Children.map(e,u=>{if(isValidElement(u)){let m=u;return jsx(w,{options:{...r,slideSpacing:a},sx:o?.slide,children:u},m.key)}return null});return jsx(R,{ref:n,axis:s,"data-testid":"carousel-root",className:p.thumbs,sx:{flexShrink:0,...s==="x"&&{p:.5,maxWidth:1},...s==="y"&&{p:.5,maxHeight:1},...!o?.disableMask&&l,...t},...i,children:jsx(T,{component:"ul",axis:s,"data-testid":"carousel-container",slideSpacing:a,className:p.thumbContainer,sx:{...o?.container},children:c})})});Ne.displayName="CarouselThumbs";function qo({thumbType:e="image",sx:o,src:r,index:t,selected:i,imageRender:n,thumbAlt:s,...a$1}){if(e==="image"&&(r||n)){let l={width:1,height:1,aspectRatio:1,objectFit:"cover",borderRadius:"inherit"};return jsx(J,{className:p.thumb,"data-testid":"carousel-thumb",sx:{width:64,height:64,opacity:.48,flexShrink:0,cursor:"pointer",borderRadius:1.25,transition:c=>c.transitions.create(["opacity","box-shadow"],{easing:c.transitions.easing.sharp,duration:c.transitions.duration.short}),...i&&{opacity:1,boxShadow:c=>`0 0 0 2px ${c.vars.palette.primary.main}`},...o},...a$1,children:n?.({sx:l,classes:p.thumbImage})||jsx(N,{component:"img",alt:s||`Imagem do slide ${t}`,src:r,"data-testid":"carousel-thumb-image",className:p.thumbImage,sx:l})})}return e==="video"?jsx(J,{className:p.thumb,"data-testid":"carousel-thumb",sx:{width:64,height:64,opacity:.48,flexShrink:0,cursor:"pointer",borderRadius:1.25,color:l=>l.vars.palette.primary.main,transition:l=>l.transitions.create(["opacity","box-shadow"],{easing:l.transitions.easing.sharp,duration:l.transitions.duration.short}),...i&&{opacity:1,boxShadow:l=>`0 0 0 2px ${l.vars.palette.primary.main}`},...o},...a$1,children:jsx(a,{icon:"PLAY_CIRCLE",width:32})}):null}function Oe(e){let o=useTheme(),r={zIndex:9,content:'""',position:"absolute"},t=`${o.vars.palette.background.paper} 20%, ${k(o.vars.palette.background.paperChannel,0)} 100%)`;return e==="y"?{"&::before, &::after":{...r,left:0,height:40,width:"100%"},"&::before":{top:-8,background:`linear-gradient(to bottom, ${t}`},"&::after":{bottom:-8,background:`linear-gradient(to top, ${t}`}}:{"&::before, &::after":{...r,top:0,width:40,height:"100%"},"&::before":{left:-8,background:`linear-gradient(to right, ${t}`},"&::after":{right:-8,background:`linear-gradient(to left, ${t}`}}}var A=e=>{let[o,r]=useState(!0),[t,i]=useState(!0),n=useCallback(()=>{e&&e.scrollPrev();},[e]),s=useCallback(()=>{e&&e.scrollNext();},[e]),a=useCallback(l=>{r(!l.canScrollPrev()),i(!l.canScrollNext());},[]);return useEffect(()=>{if(e)return a(e),e.on("reInit",a),e.on("select",a),()=>{e.off("reInit",a),e.off("select",a);}},[e,a]),{disablePrev:o,disableNext:t,onClickPrev:n,onClickNext:s}};function oe(e){let[o,r]=useState(!1),t=useCallback(n=>{let s=e?.plugins()?.autoplay;if(!s)return;(s.options.stopOnInteraction===!1?s.reset:s.stop)(),n();},[e]),i=useCallback(()=>{let n=e?.plugins()?.autoplay;if(!n)return;(n.isPlaying()?n.stop:n.play)();},[e]);return useEffect(()=>{let n=e?.plugins()?.autoplay;n&&(r(n.isPlaying()),e.on("autoplay:play",()=>r(!0)).on("autoplay:stop",()=>r(!1)).on("reInit",()=>r(!1)));},[e]),{isPlaying:o,onTogglePlay:i,onClickAutoplay:t}}function re(e){let[o,r]=useState(!1),t=useCallback(n=>{let s=e?.plugins()?.autoScroll;if(!s)return;(s.options.stopOnInteraction===!1?s.reset:s.stop)(),n();},[e]),i=useCallback(()=>{let n=e?.plugins()?.autoScroll;if(!n)return;(n.isPlaying()?n.stop:n.play)();},[e]);return useEffect(()=>{let n=e?.plugins()?.autoScroll;n&&(r(n.isPlaying()),e.on("autoScroll:play",()=>r(!0)).on("autoScroll:stop",()=>r(!1)).on("reInit",()=>r(!1)));},[e]),{isPlaying:o,onTogglePlay:i,onClickAutoplay:t}}function se(e){let[o,r]=useState(0),[t,i]=useState(0),[n,s]=useState([]),a=useCallback(u=>{e&&e.scrollTo(u);},[e]),l=useCallback(u=>{s(u.scrollSnapList());},[]),c=useCallback(u=>{i(u.selectedScrollSnap()),r(u.scrollSnapList().length);},[]);return useEffect(()=>{if(e)return l(e),c(e),e.on("reInit",l),e.on("reInit",c),e.on("select",c),()=>{e.off("reInit",l),e.off("reInit",c),e.off("select",c);}},[e,l,c]),{dotCount:o,scrollSnaps:n,selectedIndex:t,onClickDot:a}}function ne(e,o){let r=useRef(0),t=useRef([]),i=typeof o=="number"?o:.24,n=useCallback(l=>{t.current=l.slideNodes().map(c=>c.querySelector(".slide__parallax__layer"));},[]),s=useCallback(l=>{r.current=i*l.scrollSnapList().length;},[i]),a=useCallback((l,c)=>{let u=l.internalEngine(),m=l.scrollProgress(),d=l.slidesInView(),S=c==="scroll";l.scrollSnapList().forEach((f,y)=>{let x=f-m;u.slideRegistry[y].forEach(k=>{if(S&&!d.includes(k))return;u.options.loop&&u.slideLooper.loopPoints.forEach(V=>{let D=V.target();if(k===V.index&&D!==0){let M=Math.sign(D);M===-1&&(x=f-(1+m)),M===1&&(x=f+(1-m));}});let ce=x*(-1*r.current)*100,U=t.current[k];U&&(U.style.transform=`translateX(${ce}%)`);});});},[]);return useEffect(()=>{if(!(!e||!o))return n(e),s(e),a(e),e.on("reInit",n).on("reInit",s).on("reInit",a).on("scroll",a),()=>{e.off("reInit",n).off("reInit",s).off("reInit",a).off("scroll",a);}},[e,a]),null}function le(e){let[o,r]=useState(0),t=useCallback(i=>{let n=Math.max(0,Math.min(1,i.scrollProgress()));r(n*100);},[]);return useEffect(()=>{if(e)return t(e),e.on("reInit",t),e.on("scroll",t),()=>{e.off("reInit",t).off("scroll",t);}},[e,t]),{value:o}}function ue(e,o){let[r,t]=Xe({containScroll:"keepSnaps",dragFree:!0,...o}),[i,n]=useState(0),s=useCallback(l=>{!e||!t||e.scrollTo(l);},[e,t]),a=useCallback(()=>{!e||!t||(n(e.selectedScrollSnap()),t.scrollTo(e.selectedScrollSnap()));},[e,t,n]);return useEffect(()=>{if(e)return a(),e.on("select",a),e.on("reInit",a),()=>{e.off("select",a),e.off("reInit",a);}},[e,a]),{onClickThumb:s,thumbsRef:r,thumbsApi:t,selectedIndex:i}}var St=(e,o)=>{let[r,t]=Xe(e,o),{disablePrev:i,disableNext:n,onClickPrev:s,onClickNext:a}=A(t),l=o?.map(y=>y.name),c=se(t),u=oe(t),m=re(t),d=le(t),S=ue(t,e?.thumbs);ne(t,e?.parallax);let f=useMemo(()=>l?.includes("autoplay")?{onClickPrev:()=>u.onClickAutoplay(s),onClickNext:()=>u.onClickAutoplay(a)}:l?.includes("autoScroll")?{onClickPrev:()=>m.onClickAutoplay(s),onClickNext:()=>m.onClickAutoplay(a)}:{onClickPrev:s,onClickNext:a},[m,u,a,s,l]);return {options:{...e,...t?.internalEngine().options},pluginNames:l,mainRef:r,mainApi:t,arrows:{disablePrev:i,disableNext:n,onClickPrev:f.onClickPrev,onClickNext:f.onClickNext},dots:c,thumbs:S,progress:d,autoplay:u,autoScroll:m}};
14
-
15
- export { Ge as a, p as b, w as c, R as d, T as e, io as f, Co as g, ho as h, So as i, h as j, Ro as k, Lo as l, Ne as m, qo as n, St as o };
16
- //# sourceMappingURL=chunk-2MCLMTFV.js.map