@jenesei-software/jenesei-kit-react 1.3.40 → 2.0.0

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 (754) hide show
  1. package/README.md +0 -37
  2. package/build/AnimatePresence-BByJ67dn.js +134 -0
  3. package/build/AnimatePresence-BByJ67dn.js.map +1 -0
  4. package/build/AnimatePresence-BtUPiqYm.cjs +11 -0
  5. package/build/AnimatePresence-BtUPiqYm.cjs.map +1 -0
  6. package/build/area-outside.cjs.js +1 -2
  7. package/build/area-outside.d.ts +2 -28
  8. package/build/area-outside.es.js +2 -3
  9. package/build/area-preview.cjs.js +1 -2
  10. package/build/area-preview.d.ts +2 -48
  11. package/build/area-preview.es.js +3 -5
  12. package/build/area-skeleton.cjs.js +1 -2
  13. package/build/area-skeleton.d.ts +2 -68
  14. package/build/area-skeleton.es.js +2 -4
  15. package/build/areas/outside/area.d.ts +7 -0
  16. package/build/areas/outside/index.d.ts +1 -0
  17. package/build/areas/preview/area.d.ts +3 -0
  18. package/build/areas/preview/area.hooks.d.ts +1 -0
  19. package/build/areas/preview/area.types.d.ts +19 -0
  20. package/build/areas/preview/index.d.ts +3 -0
  21. package/build/areas/skeleton/area.d.ts +3 -0
  22. package/build/areas/skeleton/area.types.d.ts +21 -0
  23. package/build/areas/skeleton/index.d.ts +2 -0
  24. package/build/build-info.txt +3 -3
  25. package/build/button-C5PgNYns.cjs +3 -0
  26. package/build/button-C5PgNYns.cjs.map +1 -0
  27. package/build/button-D8zdhI-0.js +102 -0
  28. package/build/button-D8zdhI-0.js.map +1 -0
  29. package/build/checkbox-Ba0-4wxk.js +98 -0
  30. package/build/checkbox-Ba0-4wxk.js.map +1 -0
  31. package/build/checkbox-BtkbSjHq.cjs +3 -0
  32. package/build/checkbox-BtkbSjHq.cjs.map +1 -0
  33. package/build/chunk-CW3en5xf.cjs +1 -0
  34. package/build/chunk-D1xtDmiO.js +31 -0
  35. package/build/component-6HgOL-7c.js +71 -0
  36. package/build/component-6HgOL-7c.js.map +1 -0
  37. package/build/component-BjdeqpEq.cjs +3 -0
  38. package/build/component-BjdeqpEq.cjs.map +1 -0
  39. package/build/component-button.cjs.js +1 -2
  40. package/build/component-button.d.ts +2 -208
  41. package/build/component-button.es.js +2 -5
  42. package/build/component-checkbox.cjs.js +1 -2
  43. package/build/component-checkbox.d.ts +2 -208
  44. package/build/component-checkbox.es.js +2 -8
  45. package/build/component-date-picker.cjs.js +1 -2
  46. package/build/component-date-picker.d.ts +2 -582
  47. package/build/component-date-picker.es.js +2 -19
  48. package/build/component-icon.cjs.js +1 -2
  49. package/build/component-icon.d.ts +2 -136
  50. package/build/component-icon.es.js +4 -8
  51. package/build/component-input-otp.cjs.js +1 -2
  52. package/build/component-input-otp.d.ts +2 -211
  53. package/build/component-input-otp.es.js +2 -7
  54. package/build/component-input.cjs.js +1 -2
  55. package/build/component-input.d.ts +2 -286
  56. package/build/component-input.es.js +2 -18
  57. package/build/component-pagination.cjs.js +1 -2
  58. package/build/component-pagination.d.ts +2 -196
  59. package/build/component-pagination.es.js +2 -4
  60. package/build/component-popover.cjs.js +1 -0
  61. package/build/component-popover.d.ts +2 -0
  62. package/build/component-popover.es.js +5 -0
  63. package/build/component-select.cjs.js +1 -2
  64. package/build/component-select.d.ts +2 -411
  65. package/build/component-select.es.js +6 -18
  66. package/build/component-separator.cjs.js +1 -2
  67. package/build/component-separator.d.ts +2 -49
  68. package/build/component-separator.es.js +2 -5
  69. package/build/component-stack.cjs.js +1 -2
  70. package/build/component-stack.d.ts +2 -72
  71. package/build/component-stack.es.js +3 -6
  72. package/build/component-textarea.cjs.js +1 -2
  73. package/build/component-textarea.d.ts +2 -202
  74. package/build/component-textarea.es.js +2 -6
  75. package/build/component-toggle.cjs.js +1 -2
  76. package/build/component-toggle.d.ts +2 -150
  77. package/build/component-toggle.es.js +2 -6
  78. package/build/component-tooltip.cjs.js +1 -2
  79. package/build/component-tooltip.d.ts +2 -360
  80. package/build/component-tooltip.es.js +2 -10
  81. package/build/component-typography.cjs.js +1 -2
  82. package/build/component-typography.d.ts +2 -316
  83. package/build/component-typography.es.js +3 -9
  84. package/build/components/button/component.d.ts +3 -0
  85. package/build/components/button/component.types.d.ts +41 -0
  86. package/build/components/button/index.d.ts +2 -0
  87. package/build/components/checkbox/component.d.ts +3 -0
  88. package/build/components/checkbox/component.types.d.ts +51 -0
  89. package/build/components/checkbox/index.d.ts +2 -0
  90. package/build/components/date-picker/component.d.ts +2 -0
  91. package/build/components/date-picker/component.types.d.ts +86 -0
  92. package/build/components/date-picker/index.d.ts +2 -0
  93. package/build/components/error/component.d.ts +3 -0
  94. package/build/components/error/component.types.d.ts +11 -0
  95. package/build/components/error/index.d.ts +2 -0
  96. package/build/components/icon/component.consts.d.ts +6 -0
  97. package/build/components/icon/component.d.ts +9 -0
  98. package/build/components/icon/component.functions.d.ts +2 -0
  99. package/build/components/icon/component.hooks.d.ts +5 -0
  100. package/build/components/icon/component.types.d.ts +47 -0
  101. package/build/components/icon/index.d.ts +4 -0
  102. package/build/components/input/component.d.ts +6 -0
  103. package/build/components/input/component.types.d.ts +78 -0
  104. package/build/components/input/index.d.ts +2 -0
  105. package/build/components/input-otp/component.d.ts +2 -0
  106. package/build/components/input-otp/component.types.d.ts +8 -0
  107. package/build/components/input-otp/index.d.ts +2 -0
  108. package/build/components/pagination/component.constants.d.ts +1 -0
  109. package/build/components/pagination/component.d.ts +3 -0
  110. package/build/components/pagination/component.types.d.ts +22 -0
  111. package/build/components/pagination/index.d.ts +2 -0
  112. package/build/components/popover/component.constants.d.ts +3 -0
  113. package/build/components/popover/component.d.ts +34 -0
  114. package/build/components/popover/component.types.d.ts +113 -0
  115. package/build/components/popover/index.d.ts +2 -0
  116. package/build/components/select/component.d.ts +4 -0
  117. package/build/components/select/component.examples.d.ts +6 -0
  118. package/build/components/select/component.types.d.ts +109 -0
  119. package/build/components/select/index.d.ts +3 -0
  120. package/build/components/separator/component.d.ts +3 -0
  121. package/build/components/separator/component.types.d.ts +10 -0
  122. package/build/components/separator/index.d.ts +2 -0
  123. package/build/components/stack/component.d.ts +4 -0
  124. package/build/components/stack/component.types.d.ts +20 -0
  125. package/build/components/stack/index.d.ts +2 -0
  126. package/build/components/textarea/component.d.ts +2 -0
  127. package/build/components/textarea/component.types.d.ts +67 -0
  128. package/build/components/textarea/index.d.ts +2 -0
  129. package/build/components/toggle/component.d.ts +2 -0
  130. package/build/components/toggle/component.types.d.ts +25 -0
  131. package/build/components/toggle/index.d.ts +2 -0
  132. package/build/components/tooltip/component.constants.d.ts +3 -0
  133. package/build/components/tooltip/component.d.ts +4 -0
  134. package/build/components/tooltip/component.types.d.ts +12 -0
  135. package/build/components/tooltip/index.d.ts +2 -0
  136. package/build/components/typography/component.d.ts +3 -0
  137. package/build/components/typography/component.types.d.ts +18 -0
  138. package/build/components/typography/index.d.ts +2 -0
  139. package/build/components-error.cjs.js +1 -0
  140. package/build/components-error.d.ts +2 -0
  141. package/build/components-error.es.js +4 -0
  142. package/build/context-app-4_kY3Qcd.js +417 -0
  143. package/build/context-app-4_kY3Qcd.js.map +1 -0
  144. package/build/context-app-DKsS6_WR.cjs +9 -0
  145. package/build/context-app-DKsS6_WR.cjs.map +1 -0
  146. package/build/context-app.cjs.js +1 -2
  147. package/build/context-app.d.ts +2 -224
  148. package/build/context-app.es.js +3 -19
  149. package/build/context-browser-theme-CPhqqRUP.js +35 -0
  150. package/build/context-browser-theme-CPhqqRUP.js.map +1 -0
  151. package/build/context-browser-theme-o9geUlSH.cjs +3 -0
  152. package/build/context-browser-theme-o9geUlSH.cjs.map +1 -0
  153. package/build/context-browser-theme.cjs.js +1 -0
  154. package/build/context-browser-theme.d.ts +2 -0
  155. package/build/context-browser-theme.es.js +5 -0
  156. package/build/context-cookie-5CBhf-gb.js +138 -0
  157. package/build/context-cookie-5CBhf-gb.js.map +1 -0
  158. package/build/context-cookie-CvTU44MD.cjs +3 -0
  159. package/build/context-cookie-CvTU44MD.cjs.map +1 -0
  160. package/build/context-cookie.cjs.js +1 -2
  161. package/build/context-cookie.d.ts +2 -67
  162. package/build/context-cookie.es.js +3 -8
  163. package/build/context-dialog-CCnhd1EY.cjs +3 -0
  164. package/build/context-dialog-CCnhd1EY.cjs.map +1 -0
  165. package/build/context-dialog-HLeQ5WNn.js +176 -0
  166. package/build/context-dialog-HLeQ5WNn.js.map +1 -0
  167. package/build/context-dialog.cjs.js +1 -2
  168. package/build/context-dialog.d.ts +2 -106
  169. package/build/context-dialog.es.js +4 -17
  170. package/build/context-geolocation-C7PYGQ2g.js +42 -0
  171. package/build/context-geolocation-C7PYGQ2g.js.map +1 -0
  172. package/build/context-geolocation-ffFFV4kn.cjs +3 -0
  173. package/build/context-geolocation-ffFFV4kn.cjs.map +1 -0
  174. package/build/context-geolocation.cjs.js +1 -2
  175. package/build/context-geolocation.d.ts +2 -22
  176. package/build/context-geolocation.es.js +3 -6
  177. package/build/context-local-storage-Bb_vktd8.js +83 -0
  178. package/build/context-local-storage-Bb_vktd8.js.map +1 -0
  179. package/build/context-local-storage-kmxWNK_4.cjs +3 -0
  180. package/build/context-local-storage-kmxWNK_4.cjs.map +1 -0
  181. package/build/context-local-storage.cjs.js +1 -2
  182. package/build/context-local-storage.d.ts +2 -54
  183. package/build/context-local-storage.es.js +3 -8
  184. package/build/context-permission-Co4BKDOu.js +77 -0
  185. package/build/context-permission-Co4BKDOu.js.map +1 -0
  186. package/build/context-permission-K3tWOiAx.cjs +3 -0
  187. package/build/context-permission-K3tWOiAx.cjs.map +1 -0
  188. package/build/context-permission.cjs.js +1 -2
  189. package/build/context-permission.d.ts +2 -28
  190. package/build/context-permission.es.js +3 -7
  191. package/build/context-screen-width-CEsyIyg6.js +53 -0
  192. package/build/context-screen-width-CEsyIyg6.js.map +1 -0
  193. package/build/context-screen-width-ind6z7Ny.cjs +3 -0
  194. package/build/context-screen-width-ind6z7Ny.cjs.map +1 -0
  195. package/build/context-screen-width.cjs.js +1 -2
  196. package/build/context-screen-width.d.ts +2 -34
  197. package/build/context-screen-width.es.js +3 -5
  198. package/build/context-sonner-Bniiz914.js +218 -0
  199. package/build/context-sonner-Bniiz914.js.map +1 -0
  200. package/build/context-sonner-L0OMEvZE.cjs +3 -0
  201. package/build/context-sonner-L0OMEvZE.cjs.map +1 -0
  202. package/build/context-sonner.cjs.js +1 -2
  203. package/build/context-sonner.d.ts +2 -457
  204. package/build/context-sonner.es.js +3 -20
  205. package/build/contexts/context-app/context.d.ts +33 -0
  206. package/build/contexts/context-app/context.hooks.d.ts +2 -0
  207. package/build/contexts/context-app/context.styles.d.ts +14 -0
  208. package/build/contexts/context-app/context.types.d.ts +87 -0
  209. package/build/contexts/context-app/index.d.ts +2 -0
  210. package/build/contexts/context-browser-theme/context.d.ts +4 -0
  211. package/build/contexts/context-browser-theme/context.hooks.d.ts +2 -0
  212. package/build/contexts/context-browser-theme/context.types.d.ts +12 -0
  213. package/build/contexts/context-browser-theme/index.d.ts +2 -0
  214. package/build/contexts/context-cookie/context.d.ts +27 -0
  215. package/build/contexts/context-cookie/context.functions.d.ts +3 -0
  216. package/build/contexts/context-cookie/context.hooks.d.ts +9 -0
  217. package/build/contexts/context-cookie/context.types.d.ts +18 -0
  218. package/build/contexts/context-cookie/index.d.ts +3 -0
  219. package/build/contexts/context-dialog/context.constants.d.ts +8 -0
  220. package/build/contexts/context-dialog/context.d.ts +4 -0
  221. package/build/contexts/context-dialog/context.hooks.d.ts +3 -0
  222. package/build/contexts/context-dialog/context.styles.d.ts +9 -0
  223. package/build/contexts/context-dialog/context.types.d.ts +47 -0
  224. package/build/contexts/context-dialog/index.d.ts +3 -0
  225. package/build/contexts/context-geolocation/context.d.ts +4 -0
  226. package/build/contexts/context-geolocation/context.hooks.d.ts +2 -0
  227. package/build/contexts/context-geolocation/context.types.d.ts +10 -0
  228. package/build/contexts/context-geolocation/index.d.ts +2 -0
  229. package/build/contexts/context-local-storage/context.d.ts +21 -0
  230. package/build/contexts/context-local-storage/context.functions.d.ts +2 -0
  231. package/build/contexts/context-local-storage/context.hooks.d.ts +5 -0
  232. package/build/contexts/context-local-storage/context.types.d.ts +16 -0
  233. package/build/contexts/context-local-storage/index.d.ts +3 -0
  234. package/build/contexts/context-permission/context.d.ts +3 -0
  235. package/build/contexts/context-permission/context.functions.d.ts +1 -0
  236. package/build/contexts/context-permission/context.hooks.d.ts +5 -0
  237. package/build/contexts/context-permission/context.types.d.ts +11 -0
  238. package/build/contexts/context-permission/index.d.ts +2 -0
  239. package/build/contexts/context-screen-width/context.d.ts +4 -0
  240. package/build/contexts/context-screen-width/context.hooks.d.ts +2 -0
  241. package/build/contexts/context-screen-width/context.types.d.ts +11 -0
  242. package/build/contexts/context-screen-width/index.d.ts +3 -0
  243. package/build/contexts/context-sonner/context.constants.d.ts +9 -0
  244. package/build/contexts/context-sonner/context.d.ts +4 -0
  245. package/build/contexts/context-sonner/context.hooks.d.ts +2 -0
  246. package/build/contexts/context-sonner/context.styles.d.ts +30 -0
  247. package/build/contexts/context-sonner/context.types.d.ts +59 -0
  248. package/build/contexts/context-sonner/index.d.ts +3 -0
  249. package/build/cores/consts.d.ts +30 -0
  250. package/build/{functions.d.ts → cores/functions.d.ts} +18 -22
  251. package/build/cores/logger.d.ts +1 -0
  252. package/build/cores/types.d.ts +18 -0
  253. package/build/date-picker-CQUe3ZXt.cjs +3 -0
  254. package/build/date-picker-CQUe3ZXt.cjs.map +1 -0
  255. package/build/date-picker-z3LcE7Ab.js +689 -0
  256. package/build/date-picker-z3LcE7Ab.js.map +1 -0
  257. package/build/dist-C8r_OdG1.cjs +3 -0
  258. package/build/dist-C8r_OdG1.cjs.map +1 -0
  259. package/build/dist-Dq_YJa2q.js +483 -0
  260. package/build/dist-Dq_YJa2q.js.map +1 -0
  261. package/build/error--kiPVmoi.cjs +3 -0
  262. package/build/error--kiPVmoi.cjs.map +1 -0
  263. package/build/error-D1UNY-0f.js +50 -0
  264. package/build/error-D1UNY-0f.js.map +1 -0
  265. package/build/functions-CLGf7hqw.js +20 -0
  266. package/build/functions-CLGf7hqw.js.map +1 -0
  267. package/build/functions-Dwo54amB.cjs +3 -0
  268. package/build/functions-Dwo54amB.cjs.map +1 -0
  269. package/build/hooks/use-debounced-callback/index.d.ts +1 -0
  270. package/build/hooks/use-debounced-callback/use.d.ts +1 -0
  271. package/build/hooks/use-deep-compare-memoize/index.d.ts +1 -0
  272. package/build/hooks/use-deep-compare-memoize/use.d.ts +1 -0
  273. package/build/hooks/use-deep-memo/index.d.ts +1 -0
  274. package/build/hooks/use-deep-memo/use.d.ts +1 -0
  275. package/build/hooks/use-merge-refs/index.d.ts +1 -0
  276. package/build/hooks/use-merge-refs/use.d.ts +2 -0
  277. package/build/hooks/use-overflowing/index.d.ts +2 -0
  278. package/build/hooks/use-overflowing/use.d.ts +12 -0
  279. package/build/hooks/use-overflowing/use.types.d.ts +6 -0
  280. package/build/hooks/use-overflowing-advanced/index.d.ts +2 -0
  281. package/build/hooks/use-overflowing-advanced/use.d.ts +7 -0
  282. package/build/hooks/use-overflowing-advanced/use.types.d.ts +5 -0
  283. package/build/hooks/use-overflowing-in-container/index.d.ts +2 -0
  284. package/build/hooks/use-overflowing-in-container/use.d.ts +7 -0
  285. package/build/hooks/use-overflowing-in-container/use.types.d.ts +7 -0
  286. package/build/hooks/use-responsive-layout/index.d.ts +1 -0
  287. package/build/hooks/use-responsive-layout/use.d.ts +2 -0
  288. package/build/hooks/use-typography-styles/index.d.ts +2 -0
  289. package/build/hooks/use-typography-styles/use.d.ts +2 -0
  290. package/build/hooks/use-typography-styles/use.types.d.ts +11 -0
  291. package/build/hooks-use-debounced-callback.cjs.js +3 -2
  292. package/build/hooks-use-debounced-callback.cjs.js.map +1 -1
  293. package/build/hooks-use-debounced-callback.d.ts +2 -3
  294. package/build/hooks-use-debounced-callback.es.js +12 -3
  295. package/build/hooks-use-debounced-callback.es.js.map +1 -1
  296. package/build/hooks-use-deep-compare-memoize.cjs.js +3 -2
  297. package/build/hooks-use-deep-compare-memoize.cjs.js.map +1 -1
  298. package/build/hooks-use-deep-compare-memoize.d.ts +2 -3
  299. package/build/hooks-use-deep-compare-memoize.es.js +10 -3
  300. package/build/hooks-use-deep-compare-memoize.es.js.map +1 -1
  301. package/build/hooks-use-deep-memo.cjs.js +3 -0
  302. package/build/hooks-use-deep-memo.cjs.js.map +1 -0
  303. package/build/hooks-use-deep-memo.d.ts +2 -0
  304. package/build/hooks-use-deep-memo.es.js +13 -0
  305. package/build/hooks-use-deep-memo.es.js.map +1 -0
  306. package/build/hooks-use-merge-refs.cjs.js +3 -0
  307. package/build/hooks-use-merge-refs.cjs.js.map +1 -0
  308. package/build/hooks-use-merge-refs.d.ts +2 -0
  309. package/build/hooks-use-merge-refs.es.js +13 -0
  310. package/build/hooks-use-merge-refs.es.js.map +1 -0
  311. package/build/hooks-use-overflowing-advanced.cjs.js +3 -0
  312. package/build/hooks-use-overflowing-advanced.cjs.js.map +1 -0
  313. package/build/hooks-use-overflowing-advanced.d.ts +2 -0
  314. package/build/hooks-use-overflowing-advanced.es.js +24 -0
  315. package/build/hooks-use-overflowing-advanced.es.js.map +1 -0
  316. package/build/hooks-use-overflowing-in-container.cjs.js +3 -0
  317. package/build/hooks-use-overflowing-in-container.cjs.js.map +1 -0
  318. package/build/hooks-use-overflowing-in-container.d.ts +2 -0
  319. package/build/hooks-use-overflowing-in-container.es.js +20 -0
  320. package/build/hooks-use-overflowing-in-container.es.js.map +1 -0
  321. package/build/hooks-use-overflowing.cjs.js +3 -0
  322. package/build/hooks-use-overflowing.cjs.js.map +1 -0
  323. package/build/hooks-use-overflowing.d.ts +2 -0
  324. package/build/hooks-use-overflowing.es.js +28 -0
  325. package/build/hooks-use-overflowing.es.js.map +1 -0
  326. package/build/hooks-use-responsive-layout.cjs.js +3 -0
  327. package/build/hooks-use-responsive-layout.cjs.js.map +1 -0
  328. package/build/hooks-use-responsive-layout.d.ts +2 -0
  329. package/build/hooks-use-responsive-layout.es.js +22 -0
  330. package/build/hooks-use-responsive-layout.es.js.map +1 -0
  331. package/build/hooks-use-typography-styles.cjs.js +3 -0
  332. package/build/hooks-use-typography-styles.cjs.js.map +1 -0
  333. package/build/hooks-use-typography-styles.d.ts +2 -0
  334. package/build/hooks-use-typography-styles.es.js +37 -0
  335. package/build/hooks-use-typography-styles.es.js.map +1 -0
  336. package/build/icon-BG6R5Lfa.js +277 -0
  337. package/build/icon-BG6R5Lfa.js.map +1 -0
  338. package/build/icon-CreblPsB.cjs +3 -0
  339. package/build/icon-CreblPsB.cjs.map +1 -0
  340. package/build/index.cjs.js +1 -2
  341. package/build/index.d.ts +39 -2494
  342. package/build/index.es.js +104 -309
  343. package/build/input-CWcWWMCp.cjs +11 -0
  344. package/build/input-CWcWWMCp.cjs.map +1 -0
  345. package/build/input-DqMLnOz5.js +917 -0
  346. package/build/input-DqMLnOz5.js.map +1 -0
  347. package/build/input-otp-DPp3qmvI.js +106 -0
  348. package/build/input-otp-DPp3qmvI.js.map +1 -0
  349. package/build/input-otp-Z_wz6o6L.cjs +3 -0
  350. package/build/input-otp-Z_wz6o6L.cjs.map +1 -0
  351. package/build/isEqual-VCZu3vai.js +675 -0
  352. package/build/isEqual-VCZu3vai.js.map +1 -0
  353. package/build/isEqual-wc3RBuBi.cjs +3 -0
  354. package/build/isEqual-wc3RBuBi.cjs.map +1 -0
  355. package/build/logger-BRWLzI5S.js +174 -0
  356. package/build/logger-BRWLzI5S.js.map +1 -0
  357. package/build/logger-DZFY33QY.cjs +5 -0
  358. package/build/logger-DZFY33QY.cjs.map +1 -0
  359. package/build/motion-BeQRGZxW.cjs +3 -0
  360. package/build/motion-BeQRGZxW.cjs.map +1 -0
  361. package/build/motion-Ot_yGWVJ.js +128 -0
  362. package/build/motion-Ot_yGWVJ.js.map +1 -0
  363. package/build/outside-BtjOuCPD.js +24 -0
  364. package/build/outside-BtjOuCPD.js.map +1 -0
  365. package/build/outside-DJ1B9sBT.cjs +3 -0
  366. package/build/outside-DJ1B9sBT.cjs.map +1 -0
  367. package/build/pagination-BnvQ1aha.cjs +3 -0
  368. package/build/pagination-BnvQ1aha.cjs.map +1 -0
  369. package/build/pagination-CpaP3Svg.js +110 -0
  370. package/build/pagination-CpaP3Svg.js.map +1 -0
  371. package/build/popover-1k1MNFwv.js +1948 -0
  372. package/build/popover-1k1MNFwv.js.map +1 -0
  373. package/build/popover-fte_EMYr.cjs +3 -0
  374. package/build/popover-fte_EMYr.cjs.map +1 -0
  375. package/build/preview-BvJN6QoV.js +65 -0
  376. package/build/preview-BvJN6QoV.js.map +1 -0
  377. package/build/preview-CG76AiC9.cjs +3 -0
  378. package/build/preview-CG76AiC9.cjs.map +1 -0
  379. package/build/proxy-D2Z8K6jr.cjs +3 -0
  380. package/build/proxy-D2Z8K6jr.cjs.map +1 -0
  381. package/build/proxy-DTLy-pV-.js +4354 -0
  382. package/build/proxy-DTLy-pV-.js.map +1 -0
  383. package/build/select-B4JeEvIF.js +3443 -0
  384. package/build/select-B4JeEvIF.js.map +1 -0
  385. package/build/select-BQtWzaxE.cjs +9 -0
  386. package/build/select-BQtWzaxE.cjs.map +1 -0
  387. package/build/separator-BXoT44nC.cjs +3 -0
  388. package/build/separator-BXoT44nC.cjs.map +1 -0
  389. package/build/separator-hWp-s54-.js +29 -0
  390. package/build/separator-hWp-s54-.js.map +1 -0
  391. package/build/skeleton-BOfnrUaI.cjs +3 -0
  392. package/build/skeleton-BOfnrUaI.cjs.map +1 -0
  393. package/build/skeleton-Bzr92XmL.js +39 -0
  394. package/build/skeleton-Bzr92XmL.js.map +1 -0
  395. package/build/style-motion.cjs.js +1 -2
  396. package/build/style-motion.d.ts +2 -20
  397. package/build/style-motion.es.js +5 -6
  398. package/build/style-utils.cjs.js +1 -0
  399. package/build/style-utils.d.ts +2 -0
  400. package/build/style-utils.es.js +7 -0
  401. package/build/styles/motion/index.d.ts +1 -0
  402. package/build/styles/motion/motion.d.ts +13 -0
  403. package/build/styles/utils/constants.d.ts +1797 -0
  404. package/build/styles/utils/functions.d.ts +3 -0
  405. package/build/styles/utils/index.d.ts +3 -0
  406. package/build/styles/utils/types.d.ts +68 -0
  407. package/build/textarea-BRzorAFw.cjs +3 -0
  408. package/build/textarea-BRzorAFw.cjs.map +1 -0
  409. package/build/textarea-BssfjUe3.js +132 -0
  410. package/build/textarea-BssfjUe3.js.map +1 -0
  411. package/build/toggle-BFp9Nmas.cjs +3 -0
  412. package/build/toggle-BFp9Nmas.cjs.map +1 -0
  413. package/build/toggle-CCfZoBpW.js +86 -0
  414. package/build/toggle-CCfZoBpW.js.map +1 -0
  415. package/build/typography-B2KioMfq.js +116 -0
  416. package/build/typography-B2KioMfq.js.map +1 -0
  417. package/build/typography-whjfut7N.cjs +3 -0
  418. package/build/typography-whjfut7N.cjs.map +1 -0
  419. package/build/utils-Cona48dZ.js +925 -0
  420. package/build/utils-Cona48dZ.js.map +1 -0
  421. package/build/utils-DtinAjAU.cjs +3 -0
  422. package/build/utils-DtinAjAU.cjs.map +1 -0
  423. package/build/v4-BDi_Luux.cjs +3 -0
  424. package/build/v4-BDi_Luux.cjs.map +1 -0
  425. package/build/v4-CYaPyb-W.js +31 -0
  426. package/build/v4-CYaPyb-W.js.map +1 -0
  427. package/package.json +189 -194
  428. package/build/area-0BNtBqG8.cjs +0 -2
  429. package/build/area-0BNtBqG8.cjs.map +0 -1
  430. package/build/area-B6xxVQ87.js +0 -35
  431. package/build/area-B6xxVQ87.js.map +0 -1
  432. package/build/area-B7-4IFQB.js +0 -19
  433. package/build/area-B7-4IFQB.js.map +0 -1
  434. package/build/area-DxKLtDFZ.cjs +0 -2
  435. package/build/area-DxKLtDFZ.cjs.map +0 -1
  436. package/build/area-outside.cjs.js.map +0 -1
  437. package/build/area-outside.es.js.map +0 -1
  438. package/build/area-preview.cjs.js.map +0 -1
  439. package/build/area-preview.es.js.map +0 -1
  440. package/build/area-scroll.cjs.js +0 -2
  441. package/build/area-scroll.cjs.js.map +0 -1
  442. package/build/area-scroll.d.ts +0 -57
  443. package/build/area-scroll.es.js +0 -7
  444. package/build/area-scroll.es.js.map +0 -1
  445. package/build/area-skeleton.cjs.js.map +0 -1
  446. package/build/area-skeleton.es.js.map +0 -1
  447. package/build/area-smooth.cjs.js +0 -2
  448. package/build/area-smooth.cjs.js.map +0 -1
  449. package/build/area-smooth.d.ts +0 -37
  450. package/build/area-smooth.es.js +0 -5
  451. package/build/area-smooth.es.js.map +0 -1
  452. package/build/area.hooks-Bk04M7mk.js +0 -26
  453. package/build/area.hooks-Bk04M7mk.js.map +0 -1
  454. package/build/area.hooks-C_UKZzcb.cjs +0 -2
  455. package/build/area.hooks-C_UKZzcb.cjs.map +0 -1
  456. package/build/area.styles-Cpx4H0gc.cjs +0 -27
  457. package/build/area.styles-Cpx4H0gc.cjs.map +0 -1
  458. package/build/area.styles-DhCCEhuq.js +0 -32
  459. package/build/area.styles-DhCCEhuq.js.map +0 -1
  460. package/build/component-B72M2Tpw.js +0 -84
  461. package/build/component-B72M2Tpw.js.map +0 -1
  462. package/build/component-BIxOOifU.cjs +0 -2
  463. package/build/component-BIxOOifU.cjs.map +0 -1
  464. package/build/component-BMIqhbpK.js +0 -23
  465. package/build/component-BMIqhbpK.js.map +0 -1
  466. package/build/component-BQru5uoj.js +0 -10
  467. package/build/component-BQru5uoj.js.map +0 -1
  468. package/build/component-BRCDQbb-.js +0 -50
  469. package/build/component-BRCDQbb-.js.map +0 -1
  470. package/build/component-BUkf5TLO.js +0 -170
  471. package/build/component-BUkf5TLO.js.map +0 -1
  472. package/build/component-BmccRQ_Y.cjs +0 -2
  473. package/build/component-BmccRQ_Y.cjs.map +0 -1
  474. package/build/component-Bvq-fgCN.cjs +0 -2
  475. package/build/component-Bvq-fgCN.cjs.map +0 -1
  476. package/build/component-C448kBTA.js +0 -443
  477. package/build/component-C448kBTA.js.map +0 -1
  478. package/build/component-C6I01Mel.cjs +0 -2
  479. package/build/component-C6I01Mel.cjs.map +0 -1
  480. package/build/component-C8mTuBua.js +0 -74
  481. package/build/component-C8mTuBua.js.map +0 -1
  482. package/build/component-CVWsmIlg.cjs +0 -2
  483. package/build/component-CVWsmIlg.cjs.map +0 -1
  484. package/build/component-C_6x7Mk8.js +0 -88
  485. package/build/component-C_6x7Mk8.js.map +0 -1
  486. package/build/component-CbWtsuhz.js +0 -60
  487. package/build/component-CbWtsuhz.js.map +0 -1
  488. package/build/component-Cfs39n8Q.js +0 -21
  489. package/build/component-Cfs39n8Q.js.map +0 -1
  490. package/build/component-CoOTSdM5.cjs +0 -28
  491. package/build/component-CoOTSdM5.cjs.map +0 -1
  492. package/build/component-Cu2i_-RT.cjs +0 -2
  493. package/build/component-Cu2i_-RT.cjs.map +0 -1
  494. package/build/component-CyZbUCkT.js +0 -39
  495. package/build/component-CyZbUCkT.js.map +0 -1
  496. package/build/component-D-HMYzXU.js +0 -65
  497. package/build/component-D-HMYzXU.js.map +0 -1
  498. package/build/component-D2vDwS60.cjs +0 -2
  499. package/build/component-D2vDwS60.cjs.map +0 -1
  500. package/build/component-D3KCIC-G.js +0 -64
  501. package/build/component-D3KCIC-G.js.map +0 -1
  502. package/build/component-DJAq34yj.cjs +0 -2
  503. package/build/component-DJAq34yj.cjs.map +0 -1
  504. package/build/component-DRMRXUJA.cjs +0 -2
  505. package/build/component-DRMRXUJA.cjs.map +0 -1
  506. package/build/component-DfSTPgfj.js +0 -248
  507. package/build/component-DfSTPgfj.js.map +0 -1
  508. package/build/component-DqV_-YxZ.cjs +0 -2
  509. package/build/component-DqV_-YxZ.cjs.map +0 -1
  510. package/build/component-DrmSI_ni.cjs +0 -2
  511. package/build/component-DrmSI_ni.cjs.map +0 -1
  512. package/build/component-Qxjnm7yi.cjs +0 -2
  513. package/build/component-Qxjnm7yi.cjs.map +0 -1
  514. package/build/component-WmDPzhcW.cjs +0 -2
  515. package/build/component-WmDPzhcW.cjs.map +0 -1
  516. package/build/component-accordion.cjs.js +0 -2
  517. package/build/component-accordion.cjs.js.map +0 -1
  518. package/build/component-accordion.d.ts +0 -100
  519. package/build/component-accordion.es.js +0 -11
  520. package/build/component-accordion.es.js.map +0 -1
  521. package/build/component-button-group.cjs.js +0 -2
  522. package/build/component-button-group.cjs.js.map +0 -1
  523. package/build/component-button-group.d.ts +0 -195
  524. package/build/component-button-group.es.js +0 -7
  525. package/build/component-button-group.es.js.map +0 -1
  526. package/build/component-button.cjs.js.map +0 -1
  527. package/build/component-button.es.js.map +0 -1
  528. package/build/component-checkbox-group.cjs.js +0 -2
  529. package/build/component-checkbox-group.cjs.js.map +0 -1
  530. package/build/component-checkbox-group.d.ts +0 -224
  531. package/build/component-checkbox-group.es.js +0 -12
  532. package/build/component-checkbox-group.es.js.map +0 -1
  533. package/build/component-checkbox.cjs.js.map +0 -1
  534. package/build/component-checkbox.es.js.map +0 -1
  535. package/build/component-date-picker.cjs.js.map +0 -1
  536. package/build/component-date-picker.es.js.map +0 -1
  537. package/build/component-gcvwlILJ.js +0 -76
  538. package/build/component-gcvwlILJ.js.map +0 -1
  539. package/build/component-icon.cjs.js.map +0 -1
  540. package/build/component-icon.es.js.map +0 -1
  541. package/build/component-image-button.cjs.js +0 -2
  542. package/build/component-image-button.cjs.js.map +0 -1
  543. package/build/component-image-button.d.ts +0 -215
  544. package/build/component-image-button.es.js +0 -5
  545. package/build/component-image-button.es.js.map +0 -1
  546. package/build/component-image-select.cjs.js +0 -2
  547. package/build/component-image-select.cjs.js.map +0 -1
  548. package/build/component-image-select.d.ts +0 -313
  549. package/build/component-image-select.es.js +0 -12
  550. package/build/component-image-select.es.js.map +0 -1
  551. package/build/component-image-slider.cjs.js +0 -2
  552. package/build/component-image-slider.cjs.js.map +0 -1
  553. package/build/component-image-slider.d.ts +0 -108
  554. package/build/component-image-slider.es.js +0 -9
  555. package/build/component-image-slider.es.js.map +0 -1
  556. package/build/component-image.cjs.js +0 -2
  557. package/build/component-image.cjs.js.map +0 -1
  558. package/build/component-image.d.ts +0 -51
  559. package/build/component-image.es.js +0 -7
  560. package/build/component-image.es.js.map +0 -1
  561. package/build/component-input-otp.cjs.js.map +0 -1
  562. package/build/component-input-otp.es.js.map +0 -1
  563. package/build/component-input.cjs.js.map +0 -1
  564. package/build/component-input.es.js.map +0 -1
  565. package/build/component-mFXKTq1K.cjs +0 -2
  566. package/build/component-mFXKTq1K.cjs.map +0 -1
  567. package/build/component-pagination.cjs.js.map +0 -1
  568. package/build/component-pagination.es.js.map +0 -1
  569. package/build/component-range.cjs.js +0 -2
  570. package/build/component-range.cjs.js.map +0 -1
  571. package/build/component-range.d.ts +0 -212
  572. package/build/component-range.es.js +0 -9
  573. package/build/component-range.es.js.map +0 -1
  574. package/build/component-ripple.cjs.js +0 -2
  575. package/build/component-ripple.cjs.js.map +0 -1
  576. package/build/component-ripple.d.ts +0 -47
  577. package/build/component-ripple.es.js +0 -12
  578. package/build/component-ripple.es.js.map +0 -1
  579. package/build/component-select.cjs.js.map +0 -1
  580. package/build/component-select.es.js.map +0 -1
  581. package/build/component-separator.cjs.js.map +0 -1
  582. package/build/component-separator.es.js.map +0 -1
  583. package/build/component-stack.cjs.js.map +0 -1
  584. package/build/component-stack.es.js.map +0 -1
  585. package/build/component-textarea.cjs.js.map +0 -1
  586. package/build/component-textarea.es.js.map +0 -1
  587. package/build/component-toggle.cjs.js.map +0 -1
  588. package/build/component-toggle.es.js.map +0 -1
  589. package/build/component-tooltip.cjs.js.map +0 -1
  590. package/build/component-tooltip.es.js.map +0 -1
  591. package/build/component-typography.cjs.js.map +0 -1
  592. package/build/component-typography.es.js.map +0 -1
  593. package/build/component.constants-BQOzGr0l.js +0 -757
  594. package/build/component.constants-BQOzGr0l.js.map +0 -1
  595. package/build/component.constants-CFLrPu5_.cjs +0 -2
  596. package/build/component.constants-CFLrPu5_.cjs.map +0 -1
  597. package/build/component.constants-DI22AYyi.js +0 -142
  598. package/build/component.constants-DI22AYyi.js.map +0 -1
  599. package/build/component.constants-DnHO8qFb.cjs +0 -2
  600. package/build/component.constants-DnHO8qFb.cjs.map +0 -1
  601. package/build/component.functions-D9ffjEok.cjs +0 -8
  602. package/build/component.functions-D9ffjEok.cjs.map +0 -1
  603. package/build/component.functions-DNW6h8kk.js +0 -12
  604. package/build/component.functions-DNW6h8kk.js.map +0 -1
  605. package/build/component.styles-BX2Aiqp_.cjs +0 -43
  606. package/build/component.styles-BX2Aiqp_.cjs.map +0 -1
  607. package/build/component.styles-C0oU5oX_.js +0 -59
  608. package/build/component.styles-C0oU5oX_.js.map +0 -1
  609. package/build/component.styles-CD6ZzRrk.cjs +0 -14
  610. package/build/component.styles-CD6ZzRrk.cjs.map +0 -1
  611. package/build/component.styles-SZ5VuhNG.js +0 -20
  612. package/build/component.styles-SZ5VuhNG.js.map +0 -1
  613. package/build/component.types-6hyRS9ZB.cjs +0 -2
  614. package/build/component.types-6hyRS9ZB.cjs.map +0 -1
  615. package/build/component.types-e2YpVj0l.js +0 -907
  616. package/build/component.types-e2YpVj0l.js.map +0 -1
  617. package/build/consts.cjs.js +0 -2
  618. package/build/consts.cjs.js.map +0 -1
  619. package/build/consts.d.ts +0 -77
  620. package/build/consts.es.js +0 -151
  621. package/build/consts.es.js.map +0 -1
  622. package/build/context-BK9a46O1.cjs +0 -4
  623. package/build/context-BK9a46O1.cjs.map +0 -1
  624. package/build/context-CPZf131N.cjs +0 -2
  625. package/build/context-CPZf131N.cjs.map +0 -1
  626. package/build/context-Cr80KOpF.js +0 -122
  627. package/build/context-Cr80KOpF.js.map +0 -1
  628. package/build/context-DssNKJ_n.cjs +0 -2
  629. package/build/context-DssNKJ_n.cjs.map +0 -1
  630. package/build/context-PFdUnKga.js +0 -44
  631. package/build/context-PFdUnKga.js.map +0 -1
  632. package/build/context-app.cjs.js.map +0 -1
  633. package/build/context-app.es.js.map +0 -1
  634. package/build/context-cookie.cjs.js.map +0 -1
  635. package/build/context-cookie.es.js.map +0 -1
  636. package/build/context-dialog.cjs.js.map +0 -1
  637. package/build/context-dialog.es.js.map +0 -1
  638. package/build/context-geolocation.cjs.js.map +0 -1
  639. package/build/context-geolocation.es.js.map +0 -1
  640. package/build/context-local-storage.cjs.js.map +0 -1
  641. package/build/context-local-storage.es.js.map +0 -1
  642. package/build/context-permission.cjs.js.map +0 -1
  643. package/build/context-permission.es.js.map +0 -1
  644. package/build/context-screen-width.cjs.js.map +0 -1
  645. package/build/context-screen-width.es.js.map +0 -1
  646. package/build/context-sonner.cjs.js.map +0 -1
  647. package/build/context-sonner.es.js.map +0 -1
  648. package/build/context-w9weDPCZ.js +0 -200
  649. package/build/context-w9weDPCZ.js.map +0 -1
  650. package/build/context.constants-B14bB8O1.js +0 -254
  651. package/build/context.constants-B14bB8O1.js.map +0 -1
  652. package/build/context.constants-BA1u2p1r.cjs +0 -32
  653. package/build/context.constants-BA1u2p1r.cjs.map +0 -1
  654. package/build/context.constants-BWLe7YHv.js +0 -12598
  655. package/build/context.constants-BWLe7YHv.js.map +0 -1
  656. package/build/context.constants-baqYH-_k.cjs +0 -1742
  657. package/build/context.constants-baqYH-_k.cjs.map +0 -1
  658. package/build/context.functions--v7FClEV.cjs +0 -2
  659. package/build/context.functions--v7FClEV.cjs.map +0 -1
  660. package/build/context.functions-B8FDl7nJ.js +0 -14
  661. package/build/context.functions-B8FDl7nJ.js.map +0 -1
  662. package/build/context.functions-CB6--UcR.js +0 -35
  663. package/build/context.functions-CB6--UcR.js.map +0 -1
  664. package/build/context.functions-CHaPcuVS.cjs +0 -2
  665. package/build/context.functions-CHaPcuVS.cjs.map +0 -1
  666. package/build/context.functions-CPP8X6so.js +0 -35
  667. package/build/context.functions-CPP8X6so.js.map +0 -1
  668. package/build/context.functions-ar41xFVo.cjs +0 -2
  669. package/build/context.functions-ar41xFVo.cjs.map +0 -1
  670. package/build/context.hooks-B-YcyJ5E.cjs +0 -2
  671. package/build/context.hooks-B-YcyJ5E.cjs.map +0 -1
  672. package/build/context.hooks-B9dsW2kz.js +0 -117
  673. package/build/context.hooks-B9dsW2kz.js.map +0 -1
  674. package/build/context.hooks-Bi7spFak.cjs +0 -2
  675. package/build/context.hooks-Bi7spFak.cjs.map +0 -1
  676. package/build/context.hooks-BnHnPV_i.js +0 -49
  677. package/build/context.hooks-BnHnPV_i.js.map +0 -1
  678. package/build/context.hooks-CDnjxy35.cjs +0 -2
  679. package/build/context.hooks-CDnjxy35.cjs.map +0 -1
  680. package/build/context.hooks-DDD8ffJI.cjs +0 -2
  681. package/build/context.hooks-DDD8ffJI.cjs.map +0 -1
  682. package/build/context.hooks-Df0m0Voe.js +0 -13
  683. package/build/context.hooks-Df0m0Voe.js.map +0 -1
  684. package/build/context.hooks-DjafkFMD.cjs +0 -2
  685. package/build/context.hooks-DjafkFMD.cjs.map +0 -1
  686. package/build/context.hooks-DpwnIiRj.cjs +0 -2
  687. package/build/context.hooks-DpwnIiRj.cjs.map +0 -1
  688. package/build/context.hooks-HEeFGka7.js +0 -13
  689. package/build/context.hooks-HEeFGka7.js.map +0 -1
  690. package/build/context.hooks-NDk5ehgk.js +0 -13
  691. package/build/context.hooks-NDk5ehgk.js.map +0 -1
  692. package/build/context.hooks-oclt34zD.js +0 -68
  693. package/build/context.hooks-oclt34zD.js.map +0 -1
  694. package/build/functions.cjs.js +0 -2
  695. package/build/functions.cjs.js.map +0 -1
  696. package/build/functions.es.js +0 -50
  697. package/build/functions.es.js.map +0 -1
  698. package/build/index.cjs.js.map +0 -1
  699. package/build/index.es.js.map +0 -1
  700. package/build/jsx-runtime-C6yv_9g1.cjs +0 -11
  701. package/build/jsx-runtime-C6yv_9g1.cjs.map +0 -1
  702. package/build/jsx-runtime-DZS36FSE.js +0 -316
  703. package/build/jsx-runtime-DZS36FSE.js.map +0 -1
  704. package/build/motion-DrSN18V7.cjs +0 -2
  705. package/build/motion-DrSN18V7.cjs.map +0 -1
  706. package/build/motion-K7hUU4gL.js +0 -85
  707. package/build/motion-K7hUU4gL.js.map +0 -1
  708. package/build/style-BfuEu91g.js +0 -176
  709. package/build/style-BfuEu91g.js.map +0 -1
  710. package/build/style-Drq-Q1Im.cjs +0 -136
  711. package/build/style-Drq-Q1Im.cjs.map +0 -1
  712. package/build/style-add.cjs.js +0 -2
  713. package/build/style-add.cjs.js.map +0 -1
  714. package/build/style-add.d.ts +0 -88
  715. package/build/style-add.es.js +0 -17
  716. package/build/style-add.es.js.map +0 -1
  717. package/build/style-error.cjs.js +0 -2
  718. package/build/style-error.cjs.js.map +0 -1
  719. package/build/style-error.d.ts +0 -99
  720. package/build/style-error.es.js +0 -7
  721. package/build/style-error.es.js.map +0 -1
  722. package/build/style-fRZ6xrVp.cjs +0 -10
  723. package/build/style-fRZ6xrVp.cjs.map +0 -1
  724. package/build/style-motion.cjs.js.map +0 -1
  725. package/build/style-motion.es.js.map +0 -1
  726. package/build/style-plT9Ah7t.js +0 -33
  727. package/build/style-plT9Ah7t.js.map +0 -1
  728. package/build/style-sx.cjs.js +0 -2
  729. package/build/style-sx.cjs.js.map +0 -1
  730. package/build/style-sx.d.ts +0 -33
  731. package/build/style-sx.es.js +0 -5
  732. package/build/style-sx.es.js.map +0 -1
  733. package/build/style-theme.cjs.js +0 -2
  734. package/build/style-theme.cjs.js.map +0 -1
  735. package/build/style-theme.d.ts +0 -293
  736. package/build/style-theme.es.js +0 -16
  737. package/build/style-theme.es.js.map +0 -1
  738. package/build/types.cjs.js +0 -2
  739. package/build/types.cjs.js.map +0 -1
  740. package/build/types.d.ts +0 -27
  741. package/build/types.es.js +0 -2
  742. package/build/types.es.js.map +0 -1
  743. package/build/use-BF8VW4MA.cjs +0 -16
  744. package/build/use-BF8VW4MA.cjs.map +0 -1
  745. package/build/use-Bp8UVw4Y.js +0 -16
  746. package/build/use-Bp8UVw4Y.js.map +0 -1
  747. package/build/use-C7vngeRk.js +0 -882
  748. package/build/use-C7vngeRk.js.map +0 -1
  749. package/build/use-DdGWsOBo.js +0 -1577
  750. package/build/use-DdGWsOBo.js.map +0 -1
  751. package/build/use-IhzeVumv.cjs +0 -2
  752. package/build/use-IhzeVumv.cjs.map +0 -1
  753. package/build/use-zW3LuRc_.cjs +0 -2
  754. package/build/use-zW3LuRc_.cjs.map +0 -1
@@ -1,1577 +0,0 @@
1
- import { j as jsxRuntimeExports } from "./jsx-runtime-DZS36FSE.js";
2
- import * as React from "react";
3
- import { useMemo, useState, useCallback, useEffect } from "react";
4
- import { bo as KEY_SIZE_DATA, P as Preview, B as Button } from "./context.constants-BWLe7YHv.js";
5
- import { P as Pagination } from "./component.constants-DI22AYyi.js";
6
- import { b as Stack } from "./component-gcvwlILJ.js";
7
- import { LIST_IMAGE_SUPPORTED_FORMAT } from "./consts.es.js";
8
- import "./context.constants-B14bB8O1.js";
9
- import { a as useDialog } from "./context.hooks-BnHnPV_i.js";
10
- import { g as getDefaultExportFromCjs, u as useDeepCompareMemoize } from "./use-C7vngeRk.js";
11
- import { useTheme } from "styled-components";
12
- var extendStatics = function(d, b) {
13
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
14
- d2.__proto__ = b2;
15
- } || function(d2, b2) {
16
- for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
17
- };
18
- return extendStatics(d, b);
19
- };
20
- function __extends(d, b) {
21
- if (typeof b !== "function" && b !== null)
22
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
23
- extendStatics(d, b);
24
- function __() {
25
- this.constructor = d;
26
- }
27
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
- }
29
- var __assign = function() {
30
- __assign = Object.assign || function __assign2(t) {
31
- for (var s, i = 1, n = arguments.length; i < n; i++) {
32
- s = arguments[i];
33
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
34
- }
35
- return t;
36
- };
37
- return __assign.apply(this, arguments);
38
- };
39
- typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
40
- var e = new Error(message);
41
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
42
- };
43
- var _populated = false;
44
- var _ie, _firefox, _opera, _webkit, _chrome;
45
- var _ie_real_version;
46
- var _osx, _windows, _linux, _android;
47
- var _win64;
48
- var _iphone, _ipad, _native;
49
- var _mobile;
50
- function _populate() {
51
- if (_populated) {
52
- return;
53
- }
54
- _populated = true;
55
- var uas = navigator.userAgent;
56
- var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
57
- var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
58
- _iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
59
- _ipad = /\b(iP[ao]d)/.exec(uas);
60
- _android = /Android/i.exec(uas);
61
- _native = /FBAN\/\w+;/i.exec(uas);
62
- _mobile = /Mobile/i.exec(uas);
63
- _win64 = !!/Win64/.exec(uas);
64
- if (agent) {
65
- _ie = agent[1] ? parseFloat(agent[1]) : agent[5] ? parseFloat(agent[5]) : NaN;
66
- if (_ie && document && document.documentMode) {
67
- _ie = document.documentMode;
68
- }
69
- var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
70
- _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
71
- _firefox = agent[2] ? parseFloat(agent[2]) : NaN;
72
- _opera = agent[3] ? parseFloat(agent[3]) : NaN;
73
- _webkit = agent[4] ? parseFloat(agent[4]) : NaN;
74
- if (_webkit) {
75
- agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
76
- _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
77
- } else {
78
- _chrome = NaN;
79
- }
80
- } else {
81
- _ie = _firefox = _opera = _chrome = _webkit = NaN;
82
- }
83
- if (os) {
84
- if (os[1]) {
85
- var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
86
- _osx = ver ? parseFloat(ver[1].replace("_", ".")) : true;
87
- } else {
88
- _osx = false;
89
- }
90
- _windows = !!os[2];
91
- _linux = !!os[3];
92
- } else {
93
- _osx = _windows = _linux = false;
94
- }
95
- }
96
- var UserAgent_DEPRECATED$1 = {
97
- /**
98
- * Check if the UA is Internet Explorer.
99
- *
100
- *
101
- * @return float|NaN Version number (if match) or NaN.
102
- */
103
- ie: function() {
104
- return _populate() || _ie;
105
- },
106
- /**
107
- * Check if we're in Internet Explorer compatibility mode.
108
- *
109
- * @return bool true if in compatibility mode, false if
110
- * not compatibility mode or not ie
111
- */
112
- ieCompatibilityMode: function() {
113
- return _populate() || _ie_real_version > _ie;
114
- },
115
- /**
116
- * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
117
- * only need this because Skype can't handle 64-bit IE yet. We need to remove
118
- * this when we don't need it -- tracked by #601957.
119
- */
120
- ie64: function() {
121
- return UserAgent_DEPRECATED$1.ie() && _win64;
122
- },
123
- /**
124
- * Check if the UA is Firefox.
125
- *
126
- *
127
- * @return float|NaN Version number (if match) or NaN.
128
- */
129
- firefox: function() {
130
- return _populate() || _firefox;
131
- },
132
- /**
133
- * Check if the UA is Opera.
134
- *
135
- *
136
- * @return float|NaN Version number (if match) or NaN.
137
- */
138
- opera: function() {
139
- return _populate() || _opera;
140
- },
141
- /**
142
- * Check if the UA is WebKit.
143
- *
144
- *
145
- * @return float|NaN Version number (if match) or NaN.
146
- */
147
- webkit: function() {
148
- return _populate() || _webkit;
149
- },
150
- /**
151
- * For Push
152
- * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
153
- */
154
- safari: function() {
155
- return UserAgent_DEPRECATED$1.webkit();
156
- },
157
- /**
158
- * Check if the UA is a Chrome browser.
159
- *
160
- *
161
- * @return float|NaN Version number (if match) or NaN.
162
- */
163
- chrome: function() {
164
- return _populate() || _chrome;
165
- },
166
- /**
167
- * Check if the user is running Windows.
168
- *
169
- * @return bool `true' if the user's OS is Windows.
170
- */
171
- windows: function() {
172
- return _populate() || _windows;
173
- },
174
- /**
175
- * Check if the user is running Mac OS X.
176
- *
177
- * @return float|bool Returns a float if a version number is detected,
178
- * otherwise true/false.
179
- */
180
- osx: function() {
181
- return _populate() || _osx;
182
- },
183
- /**
184
- * Check if the user is running Linux.
185
- *
186
- * @return bool `true' if the user's OS is some flavor of Linux.
187
- */
188
- linux: function() {
189
- return _populate() || _linux;
190
- },
191
- /**
192
- * Check if the user is running on an iPhone or iPod platform.
193
- *
194
- * @return bool `true' if the user is running some flavor of the
195
- * iPhone OS.
196
- */
197
- iphone: function() {
198
- return _populate() || _iphone;
199
- },
200
- mobile: function() {
201
- return _populate() || (_iphone || _ipad || _android || _mobile);
202
- },
203
- nativeApp: function() {
204
- return _populate() || _native;
205
- },
206
- android: function() {
207
- return _populate() || _android;
208
- },
209
- ipad: function() {
210
- return _populate() || _ipad;
211
- }
212
- };
213
- var UserAgent_DEPRECATED_1 = UserAgent_DEPRECATED$1;
214
- var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
215
- var ExecutionEnvironment$1 = {
216
- canUseDOM
217
- };
218
- var ExecutionEnvironment_1 = ExecutionEnvironment$1;
219
- var ExecutionEnvironment = ExecutionEnvironment_1;
220
- var useHasFeature;
221
- if (ExecutionEnvironment.canUseDOM) {
222
- useHasFeature = document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard.
223
- // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
224
- document.implementation.hasFeature("", "") !== true;
225
- }
226
- /**
227
- * Checks if an event is supported in the current execution environment.
228
- *
229
- * NOTE: This will not work correctly for non-generic events such as `change`,
230
- * `reset`, `load`, `error`, and `select`.
231
- *
232
- * Borrows from Modernizr.
233
- *
234
- * @param {string} eventNameSuffix Event name, e.g. "click".
235
- * @param {?boolean} capture Check if the capture phase is supported.
236
- * @return {boolean} True if the event is supported.
237
- * @internal
238
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
239
- */
240
- function isEventSupported$1(eventNameSuffix, capture) {
241
- if (!ExecutionEnvironment.canUseDOM || capture && !("addEventListener" in document)) {
242
- return false;
243
- }
244
- var eventName = "on" + eventNameSuffix;
245
- var isSupported = eventName in document;
246
- if (!isSupported) {
247
- var element = document.createElement("div");
248
- element.setAttribute(eventName, "return;");
249
- isSupported = typeof element[eventName] === "function";
250
- }
251
- if (!isSupported && useHasFeature && eventNameSuffix === "wheel") {
252
- isSupported = document.implementation.hasFeature("Events.wheel", "3.0");
253
- }
254
- return isSupported;
255
- }
256
- var isEventSupported_1 = isEventSupported$1;
257
- var UserAgent_DEPRECATED = UserAgent_DEPRECATED_1;
258
- var isEventSupported = isEventSupported_1;
259
- var PIXEL_STEP = 10;
260
- var LINE_HEIGHT = 40;
261
- var PAGE_HEIGHT = 800;
262
- function normalizeWheel$2(event) {
263
- var sX = 0, sY = 0, pX = 0, pY = 0;
264
- if ("detail" in event) {
265
- sY = event.detail;
266
- }
267
- if ("wheelDelta" in event) {
268
- sY = -event.wheelDelta / 120;
269
- }
270
- if ("wheelDeltaY" in event) {
271
- sY = -event.wheelDeltaY / 120;
272
- }
273
- if ("wheelDeltaX" in event) {
274
- sX = -event.wheelDeltaX / 120;
275
- }
276
- if ("axis" in event && event.axis === event.HORIZONTAL_AXIS) {
277
- sX = sY;
278
- sY = 0;
279
- }
280
- pX = sX * PIXEL_STEP;
281
- pY = sY * PIXEL_STEP;
282
- if ("deltaY" in event) {
283
- pY = event.deltaY;
284
- }
285
- if ("deltaX" in event) {
286
- pX = event.deltaX;
287
- }
288
- if ((pX || pY) && event.deltaMode) {
289
- if (event.deltaMode == 1) {
290
- pX *= LINE_HEIGHT;
291
- pY *= LINE_HEIGHT;
292
- } else {
293
- pX *= PAGE_HEIGHT;
294
- pY *= PAGE_HEIGHT;
295
- }
296
- }
297
- if (pX && !sX) {
298
- sX = pX < 1 ? -1 : 1;
299
- }
300
- if (pY && !sY) {
301
- sY = pY < 1 ? -1 : 1;
302
- }
303
- return {
304
- spinX: sX,
305
- spinY: sY,
306
- pixelX: pX,
307
- pixelY: pY
308
- };
309
- }
310
- normalizeWheel$2.getEventType = function() {
311
- return UserAgent_DEPRECATED.firefox() ? "DOMMouseScroll" : isEventSupported("wheel") ? "wheel" : "mousewheel";
312
- };
313
- var normalizeWheel_1 = normalizeWheel$2;
314
- var normalizeWheel = normalizeWheel_1;
315
- const normalizeWheel$1 = /* @__PURE__ */ getDefaultExportFromCjs(normalizeWheel);
316
- function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) {
317
- if (rotation === void 0) {
318
- rotation = 0;
319
- }
320
- var _a = rotateSize(mediaWidth, mediaHeight, rotation), width = _a.width, height = _a.height;
321
- var fittingWidth = Math.min(width, containerWidth);
322
- var fittingHeight = Math.min(height, containerHeight);
323
- if (fittingWidth > fittingHeight * aspect) {
324
- return {
325
- width: fittingHeight * aspect,
326
- height: fittingHeight
327
- };
328
- }
329
- return {
330
- width: fittingWidth,
331
- height: fittingWidth / aspect
332
- };
333
- }
334
- function getMediaZoom(mediaSize) {
335
- return mediaSize.width > mediaSize.height ? mediaSize.width / mediaSize.naturalWidth : mediaSize.height / mediaSize.naturalHeight;
336
- }
337
- function restrictPosition(position, mediaSize, cropSize, zoom, rotation) {
338
- if (rotation === void 0) {
339
- rotation = 0;
340
- }
341
- var _a = rotateSize(mediaSize.width, mediaSize.height, rotation), width = _a.width, height = _a.height;
342
- return {
343
- x: restrictPositionCoord(position.x, width, cropSize.width, zoom),
344
- y: restrictPositionCoord(position.y, height, cropSize.height, zoom)
345
- };
346
- }
347
- function restrictPositionCoord(position, mediaSize, cropSize, zoom) {
348
- var maxPosition = mediaSize * zoom / 2 - cropSize / 2;
349
- return clamp(position, -maxPosition, maxPosition);
350
- }
351
- function getDistanceBetweenPoints(pointA, pointB) {
352
- return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2));
353
- }
354
- function getRotationBetweenPoints(pointA, pointB) {
355
- return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI;
356
- }
357
- function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition2) {
358
- if (rotation === void 0) {
359
- rotation = 0;
360
- }
361
- if (restrictPosition2 === void 0) {
362
- restrictPosition2 = true;
363
- }
364
- var limitAreaFn = restrictPosition2 ? limitArea : noOp;
365
- var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
366
- var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
367
- var croppedAreaPercentages = {
368
- x: limitAreaFn(100, ((mediaBBoxSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaBBoxSize.width * 100),
369
- y: limitAreaFn(100, ((mediaBBoxSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaBBoxSize.height * 100),
370
- width: limitAreaFn(100, cropSize.width / mediaBBoxSize.width * 100 / zoom),
371
- height: limitAreaFn(100, cropSize.height / mediaBBoxSize.height * 100 / zoom)
372
- };
373
- var widthInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.width, croppedAreaPercentages.width * mediaNaturalBBoxSize.width / 100));
374
- var heightInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.height, croppedAreaPercentages.height * mediaNaturalBBoxSize.height / 100));
375
- var isImgWiderThanHigh = mediaNaturalBBoxSize.width >= mediaNaturalBBoxSize.height * aspect;
376
- var sizePixels = isImgWiderThanHigh ? {
377
- width: Math.round(heightInPixels * aspect),
378
- height: heightInPixels
379
- } : {
380
- width: widthInPixels,
381
- height: Math.round(widthInPixels / aspect)
382
- };
383
- var croppedAreaPixels = __assign(__assign({}, sizePixels), {
384
- x: Math.round(limitAreaFn(mediaNaturalBBoxSize.width - sizePixels.width, croppedAreaPercentages.x * mediaNaturalBBoxSize.width / 100)),
385
- y: Math.round(limitAreaFn(mediaNaturalBBoxSize.height - sizePixels.height, croppedAreaPercentages.y * mediaNaturalBBoxSize.height / 100))
386
- });
387
- return {
388
- croppedAreaPercentages,
389
- croppedAreaPixels
390
- };
391
- }
392
- function limitArea(max, value) {
393
- return Math.min(max, Math.max(0, value));
394
- }
395
- function noOp(_max, value) {
396
- return value;
397
- }
398
- function getInitialCropFromCroppedAreaPercentages(croppedAreaPercentages, mediaSize, rotation, cropSize, minZoom, maxZoom) {
399
- var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
400
- var zoom = clamp(cropSize.width / mediaBBoxSize.width * (100 / croppedAreaPercentages.width), minZoom, maxZoom);
401
- var crop = {
402
- x: zoom * mediaBBoxSize.width / 2 - cropSize.width / 2 - mediaBBoxSize.width * zoom * (croppedAreaPercentages.x / 100),
403
- y: zoom * mediaBBoxSize.height / 2 - cropSize.height / 2 - mediaBBoxSize.height * zoom * (croppedAreaPercentages.y / 100)
404
- };
405
- return {
406
- crop,
407
- zoom
408
- };
409
- }
410
- function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) {
411
- var mediaZoom = getMediaZoom(mediaSize);
412
- return cropSize.height > cropSize.width ? cropSize.height / (croppedAreaPixels.height * mediaZoom) : cropSize.width / (croppedAreaPixels.width * mediaZoom);
413
- }
414
- function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, rotation, cropSize, minZoom, maxZoom) {
415
- if (rotation === void 0) {
416
- rotation = 0;
417
- }
418
- var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
419
- var zoom = clamp(getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize), minZoom, maxZoom);
420
- var cropZoom = cropSize.height > cropSize.width ? cropSize.height / croppedAreaPixels.height : cropSize.width / croppedAreaPixels.width;
421
- var crop = {
422
- x: ((mediaNaturalBBoxSize.width - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom,
423
- y: ((mediaNaturalBBoxSize.height - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom
424
- };
425
- return {
426
- crop,
427
- zoom
428
- };
429
- }
430
- function getCenter(a, b) {
431
- return {
432
- x: (b.x + a.x) / 2,
433
- y: (b.y + a.y) / 2
434
- };
435
- }
436
- function getRadianAngle(degreeValue) {
437
- return degreeValue * Math.PI / 180;
438
- }
439
- function rotateSize(width, height, rotation) {
440
- var rotRad = getRadianAngle(rotation);
441
- return {
442
- width: Math.abs(Math.cos(rotRad) * width) + Math.abs(Math.sin(rotRad) * height),
443
- height: Math.abs(Math.sin(rotRad) * width) + Math.abs(Math.cos(rotRad) * height)
444
- };
445
- }
446
- function clamp(value, min, max) {
447
- return Math.min(Math.max(value, min), max);
448
- }
449
- function classNames() {
450
- var args = [];
451
- for (var _i = 0; _i < arguments.length; _i++) {
452
- args[_i] = arguments[_i];
453
- }
454
- return args.filter(function(value) {
455
- if (typeof value === "string" && value.length > 0) {
456
- return true;
457
- }
458
- return false;
459
- }).join(" ").trim();
460
- }
461
- var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n";
462
- var MIN_ZOOM = 1;
463
- var MAX_ZOOM = 3;
464
- var KEYBOARD_STEP = 1;
465
- var Cropper = (
466
- /** @class */
467
- function(_super) {
468
- __extends(Cropper2, _super);
469
- function Cropper2() {
470
- var _this = _super !== null && _super.apply(this, arguments) || this;
471
- _this.cropperRef = React.createRef();
472
- _this.imageRef = React.createRef();
473
- _this.videoRef = React.createRef();
474
- _this.containerPosition = {
475
- x: 0,
476
- y: 0
477
- };
478
- _this.containerRef = null;
479
- _this.styleRef = null;
480
- _this.containerRect = null;
481
- _this.mediaSize = {
482
- width: 0,
483
- height: 0,
484
- naturalWidth: 0,
485
- naturalHeight: 0
486
- };
487
- _this.dragStartPosition = {
488
- x: 0,
489
- y: 0
490
- };
491
- _this.dragStartCrop = {
492
- x: 0,
493
- y: 0
494
- };
495
- _this.gestureZoomStart = 0;
496
- _this.gestureRotationStart = 0;
497
- _this.isTouching = false;
498
- _this.lastPinchDistance = 0;
499
- _this.lastPinchRotation = 0;
500
- _this.rafDragTimeout = null;
501
- _this.rafPinchTimeout = null;
502
- _this.wheelTimer = null;
503
- _this.currentDoc = typeof document !== "undefined" ? document : null;
504
- _this.currentWindow = typeof window !== "undefined" ? window : null;
505
- _this.resizeObserver = null;
506
- _this.previousCropSize = null;
507
- _this.isInitialized = false;
508
- _this.state = {
509
- cropSize: null,
510
- hasWheelJustStarted: false,
511
- mediaObjectFit: void 0
512
- };
513
- _this.initResizeObserver = function() {
514
- if (typeof window.ResizeObserver === "undefined" || !_this.containerRef) {
515
- return;
516
- }
517
- var isFirstResize = true;
518
- _this.resizeObserver = new window.ResizeObserver(function(entries) {
519
- if (isFirstResize) {
520
- isFirstResize = false;
521
- return;
522
- }
523
- _this.computeSizes();
524
- });
525
- _this.resizeObserver.observe(_this.containerRef);
526
- };
527
- _this.preventZoomSafari = function(e) {
528
- return e.preventDefault();
529
- };
530
- _this.cleanEvents = function() {
531
- if (!_this.currentDoc) return;
532
- _this.currentDoc.removeEventListener("mousemove", _this.onMouseMove);
533
- _this.currentDoc.removeEventListener("mouseup", _this.onDragStopped);
534
- _this.currentDoc.removeEventListener("touchmove", _this.onTouchMove);
535
- _this.currentDoc.removeEventListener("touchend", _this.onDragStopped);
536
- _this.currentDoc.removeEventListener("gesturechange", _this.onGestureChange);
537
- _this.currentDoc.removeEventListener("gestureend", _this.onGestureEnd);
538
- _this.currentDoc.removeEventListener("scroll", _this.onScroll);
539
- };
540
- _this.clearScrollEvent = function() {
541
- if (_this.containerRef) _this.containerRef.removeEventListener("wheel", _this.onWheel);
542
- if (_this.wheelTimer) {
543
- clearTimeout(_this.wheelTimer);
544
- }
545
- };
546
- _this.onMediaLoad = function() {
547
- var cropSize = _this.computeSizes();
548
- if (cropSize) {
549
- _this.previousCropSize = cropSize;
550
- _this.emitCropData();
551
- _this.setInitialCrop(cropSize);
552
- _this.isInitialized = true;
553
- }
554
- if (_this.props.onMediaLoaded) {
555
- _this.props.onMediaLoaded(_this.mediaSize);
556
- }
557
- };
558
- _this.setInitialCrop = function(cropSize) {
559
- if (_this.props.initialCroppedAreaPercentages) {
560
- var _a = getInitialCropFromCroppedAreaPercentages(_this.props.initialCroppedAreaPercentages, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom), crop = _a.crop, zoom = _a.zoom;
561
- _this.props.onCropChange(crop);
562
- _this.props.onZoomChange && _this.props.onZoomChange(zoom);
563
- } else if (_this.props.initialCroppedAreaPixels) {
564
- var _b = getInitialCropFromCroppedAreaPixels(_this.props.initialCroppedAreaPixels, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom), crop = _b.crop, zoom = _b.zoom;
565
- _this.props.onCropChange(crop);
566
- _this.props.onZoomChange && _this.props.onZoomChange(zoom);
567
- }
568
- };
569
- _this.computeSizes = function() {
570
- var _a, _b, _c, _d, _e, _f;
571
- var mediaRef = _this.imageRef.current || _this.videoRef.current;
572
- if (mediaRef && _this.containerRef) {
573
- _this.containerRect = _this.containerRef.getBoundingClientRect();
574
- _this.saveContainerPosition();
575
- var containerAspect = _this.containerRect.width / _this.containerRect.height;
576
- var naturalWidth = ((_a = _this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
577
- var naturalHeight = ((_c = _this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
578
- var isMediaScaledDown = mediaRef.offsetWidth < naturalWidth || mediaRef.offsetHeight < naturalHeight;
579
- var mediaAspect = naturalWidth / naturalHeight;
580
- var renderedMediaSize = void 0;
581
- if (isMediaScaledDown) {
582
- switch (_this.state.mediaObjectFit) {
583
- default:
584
- case "contain":
585
- renderedMediaSize = containerAspect > mediaAspect ? {
586
- width: _this.containerRect.height * mediaAspect,
587
- height: _this.containerRect.height
588
- } : {
589
- width: _this.containerRect.width,
590
- height: _this.containerRect.width / mediaAspect
591
- };
592
- break;
593
- case "horizontal-cover":
594
- renderedMediaSize = {
595
- width: _this.containerRect.width,
596
- height: _this.containerRect.width / mediaAspect
597
- };
598
- break;
599
- case "vertical-cover":
600
- renderedMediaSize = {
601
- width: _this.containerRect.height * mediaAspect,
602
- height: _this.containerRect.height
603
- };
604
- break;
605
- }
606
- } else {
607
- renderedMediaSize = {
608
- width: mediaRef.offsetWidth,
609
- height: mediaRef.offsetHeight
610
- };
611
- }
612
- _this.mediaSize = __assign(__assign({}, renderedMediaSize), {
613
- naturalWidth,
614
- naturalHeight
615
- });
616
- if (_this.props.setMediaSize) {
617
- _this.props.setMediaSize(_this.mediaSize);
618
- }
619
- var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(_this.mediaSize.width, _this.mediaSize.height, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation);
620
- if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) {
621
- _this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize);
622
- }
623
- _this.setState({
624
- cropSize
625
- }, _this.recomputeCropPosition);
626
- if (_this.props.setCropSize) {
627
- _this.props.setCropSize(cropSize);
628
- }
629
- return cropSize;
630
- }
631
- };
632
- _this.saveContainerPosition = function() {
633
- if (_this.containerRef) {
634
- var bounds = _this.containerRef.getBoundingClientRect();
635
- _this.containerPosition = {
636
- x: bounds.left,
637
- y: bounds.top
638
- };
639
- }
640
- };
641
- _this.onMouseDown = function(e) {
642
- if (!_this.currentDoc) return;
643
- e.preventDefault();
644
- _this.currentDoc.addEventListener("mousemove", _this.onMouseMove);
645
- _this.currentDoc.addEventListener("mouseup", _this.onDragStopped);
646
- _this.saveContainerPosition();
647
- _this.onDragStart(Cropper2.getMousePoint(e));
648
- };
649
- _this.onMouseMove = function(e) {
650
- return _this.onDrag(Cropper2.getMousePoint(e));
651
- };
652
- _this.onScroll = function(e) {
653
- if (!_this.currentDoc) return;
654
- e.preventDefault();
655
- _this.saveContainerPosition();
656
- };
657
- _this.onTouchStart = function(e) {
658
- if (!_this.currentDoc) return;
659
- _this.isTouching = true;
660
- if (_this.props.onTouchRequest && !_this.props.onTouchRequest(e)) {
661
- return;
662
- }
663
- _this.currentDoc.addEventListener("touchmove", _this.onTouchMove, {
664
- passive: false
665
- });
666
- _this.currentDoc.addEventListener("touchend", _this.onDragStopped);
667
- _this.saveContainerPosition();
668
- if (e.touches.length === 2) {
669
- _this.onPinchStart(e);
670
- } else if (e.touches.length === 1) {
671
- _this.onDragStart(Cropper2.getTouchPoint(e.touches[0]));
672
- }
673
- };
674
- _this.onTouchMove = function(e) {
675
- e.preventDefault();
676
- if (e.touches.length === 2) {
677
- _this.onPinchMove(e);
678
- } else if (e.touches.length === 1) {
679
- _this.onDrag(Cropper2.getTouchPoint(e.touches[0]));
680
- }
681
- };
682
- _this.onGestureStart = function(e) {
683
- if (!_this.currentDoc) return;
684
- e.preventDefault();
685
- _this.currentDoc.addEventListener("gesturechange", _this.onGestureChange);
686
- _this.currentDoc.addEventListener("gestureend", _this.onGestureEnd);
687
- _this.gestureZoomStart = _this.props.zoom;
688
- _this.gestureRotationStart = _this.props.rotation;
689
- };
690
- _this.onGestureChange = function(e) {
691
- e.preventDefault();
692
- if (_this.isTouching) {
693
- return;
694
- }
695
- var point = Cropper2.getMousePoint(e);
696
- var newZoom = _this.gestureZoomStart - 1 + e.scale;
697
- _this.setNewZoom(newZoom, point, {
698
- shouldUpdatePosition: true
699
- });
700
- if (_this.props.onRotationChange) {
701
- var newRotation = _this.gestureRotationStart + e.rotation;
702
- _this.props.onRotationChange(newRotation);
703
- }
704
- };
705
- _this.onGestureEnd = function(e) {
706
- _this.cleanEvents();
707
- };
708
- _this.onDragStart = function(_a) {
709
- var _b, _c;
710
- var x = _a.x, y = _a.y;
711
- _this.dragStartPosition = {
712
- x,
713
- y
714
- };
715
- _this.dragStartCrop = __assign({}, _this.props.crop);
716
- (_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b);
717
- };
718
- _this.onDrag = function(_a) {
719
- var x = _a.x, y = _a.y;
720
- if (!_this.currentWindow) return;
721
- if (_this.rafDragTimeout) _this.currentWindow.cancelAnimationFrame(_this.rafDragTimeout);
722
- _this.rafDragTimeout = _this.currentWindow.requestAnimationFrame(function() {
723
- if (!_this.state.cropSize) return;
724
- if (x === void 0 || y === void 0) return;
725
- var offsetX = x - _this.dragStartPosition.x;
726
- var offsetY = y - _this.dragStartPosition.y;
727
- var requestedPosition = {
728
- x: _this.dragStartCrop.x + offsetX,
729
- y: _this.dragStartCrop.y + offsetY
730
- };
731
- var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition;
732
- _this.props.onCropChange(newPosition);
733
- });
734
- };
735
- _this.onDragStopped = function() {
736
- var _a, _b;
737
- _this.isTouching = false;
738
- _this.cleanEvents();
739
- _this.emitCropData();
740
- (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
741
- };
742
- _this.onWheel = function(e) {
743
- if (!_this.currentWindow) return;
744
- if (_this.props.onWheelRequest && !_this.props.onWheelRequest(e)) {
745
- return;
746
- }
747
- e.preventDefault();
748
- var point = Cropper2.getMousePoint(e);
749
- var pixelY = normalizeWheel$1(e).pixelY;
750
- var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200;
751
- _this.setNewZoom(newZoom, point, {
752
- shouldUpdatePosition: true
753
- });
754
- if (!_this.state.hasWheelJustStarted) {
755
- _this.setState({
756
- hasWheelJustStarted: true
757
- }, function() {
758
- var _a, _b;
759
- return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a);
760
- });
761
- }
762
- if (_this.wheelTimer) {
763
- clearTimeout(_this.wheelTimer);
764
- }
765
- _this.wheelTimer = _this.currentWindow.setTimeout(function() {
766
- return _this.setState({
767
- hasWheelJustStarted: false
768
- }, function() {
769
- var _a, _b;
770
- return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
771
- });
772
- }, 250);
773
- };
774
- _this.getPointOnContainer = function(_a, containerTopLeft) {
775
- var x = _a.x, y = _a.y;
776
- if (!_this.containerRect) {
777
- throw new Error("The Cropper is not mounted");
778
- }
779
- return {
780
- x: _this.containerRect.width / 2 - (x - containerTopLeft.x),
781
- y: _this.containerRect.height / 2 - (y - containerTopLeft.y)
782
- };
783
- };
784
- _this.getPointOnMedia = function(_a) {
785
- var x = _a.x, y = _a.y;
786
- var _b = _this.props, crop = _b.crop, zoom = _b.zoom;
787
- return {
788
- x: (x + crop.x) / zoom,
789
- y: (y + crop.y) / zoom
790
- };
791
- };
792
- _this.setNewZoom = function(zoom, point, _a) {
793
- var _b = _a === void 0 ? {} : _a, _c = _b.shouldUpdatePosition, shouldUpdatePosition = _c === void 0 ? true : _c;
794
- if (!_this.state.cropSize || !_this.props.onZoomChange) return;
795
- var newZoom = clamp(zoom, _this.props.minZoom, _this.props.maxZoom);
796
- if (shouldUpdatePosition) {
797
- var zoomPoint = _this.getPointOnContainer(point, _this.containerPosition);
798
- var zoomTarget = _this.getPointOnMedia(zoomPoint);
799
- var requestedPosition = {
800
- x: zoomTarget.x * newZoom - zoomPoint.x,
801
- y: zoomTarget.y * newZoom - zoomPoint.y
802
- };
803
- var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition;
804
- _this.props.onCropChange(newPosition);
805
- }
806
- _this.props.onZoomChange(newZoom);
807
- };
808
- _this.getCropData = function() {
809
- if (!_this.state.cropSize) {
810
- return null;
811
- }
812
- var restrictedPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop;
813
- return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition);
814
- };
815
- _this.emitCropData = function() {
816
- var cropData = _this.getCropData();
817
- if (!cropData) return;
818
- var croppedAreaPercentages = cropData.croppedAreaPercentages, croppedAreaPixels = cropData.croppedAreaPixels;
819
- if (_this.props.onCropComplete) {
820
- _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels);
821
- }
822
- if (_this.props.onCropAreaChange) {
823
- _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
824
- }
825
- };
826
- _this.emitCropAreaChange = function() {
827
- var cropData = _this.getCropData();
828
- if (!cropData) return;
829
- var croppedAreaPercentages = cropData.croppedAreaPercentages, croppedAreaPixels = cropData.croppedAreaPixels;
830
- if (_this.props.onCropAreaChange) {
831
- _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
832
- }
833
- };
834
- _this.recomputeCropPosition = function() {
835
- if (!_this.state.cropSize) return;
836
- var adjustedCrop = _this.props.crop;
837
- if (_this.isInitialized && _this.previousCropSize) {
838
- var sizeChanged = Math.abs(_this.previousCropSize.width - _this.state.cropSize.width) > 1e-6 || Math.abs(_this.previousCropSize.height - _this.state.cropSize.height) > 1e-6;
839
- if (sizeChanged) {
840
- var scaleX = _this.state.cropSize.width / _this.previousCropSize.width;
841
- var scaleY = _this.state.cropSize.height / _this.previousCropSize.height;
842
- adjustedCrop = {
843
- x: _this.props.crop.x * scaleX,
844
- y: _this.props.crop.y * scaleY
845
- };
846
- }
847
- }
848
- var newPosition = _this.props.restrictPosition ? restrictPosition(adjustedCrop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : adjustedCrop;
849
- _this.previousCropSize = _this.state.cropSize;
850
- _this.props.onCropChange(newPosition);
851
- _this.emitCropData();
852
- };
853
- _this.onKeyDown = function(event) {
854
- var _a, _b;
855
- var _c = _this.props, crop = _c.crop, onCropChange = _c.onCropChange, keyboardStep = _c.keyboardStep, zoom = _c.zoom, rotation = _c.rotation;
856
- var step = keyboardStep;
857
- if (!_this.state.cropSize) return;
858
- if (event.shiftKey) {
859
- step *= 0.2;
860
- }
861
- var newCrop = __assign({}, crop);
862
- switch (event.key) {
863
- case "ArrowUp":
864
- newCrop.y -= step;
865
- event.preventDefault();
866
- break;
867
- case "ArrowDown":
868
- newCrop.y += step;
869
- event.preventDefault();
870
- break;
871
- case "ArrowLeft":
872
- newCrop.x -= step;
873
- event.preventDefault();
874
- break;
875
- case "ArrowRight":
876
- newCrop.x += step;
877
- event.preventDefault();
878
- break;
879
- default:
880
- return;
881
- }
882
- if (_this.props.restrictPosition) {
883
- newCrop = restrictPosition(newCrop, _this.mediaSize, _this.state.cropSize, zoom, rotation);
884
- }
885
- if (!event.repeat) {
886
- (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a);
887
- }
888
- onCropChange(newCrop);
889
- };
890
- _this.onKeyUp = function(event) {
891
- var _a, _b;
892
- switch (event.key) {
893
- case "ArrowUp":
894
- case "ArrowDown":
895
- case "ArrowLeft":
896
- case "ArrowRight":
897
- event.preventDefault();
898
- break;
899
- default:
900
- return;
901
- }
902
- _this.emitCropData();
903
- (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
904
- };
905
- return _this;
906
- }
907
- Cropper2.prototype.componentDidMount = function() {
908
- if (!this.currentDoc || !this.currentWindow) return;
909
- if (this.containerRef) {
910
- if (this.containerRef.ownerDocument) {
911
- this.currentDoc = this.containerRef.ownerDocument;
912
- }
913
- if (this.currentDoc.defaultView) {
914
- this.currentWindow = this.currentDoc.defaultView;
915
- }
916
- this.initResizeObserver();
917
- if (typeof window.ResizeObserver === "undefined") {
918
- this.currentWindow.addEventListener("resize", this.computeSizes);
919
- }
920
- this.props.zoomWithScroll && this.containerRef.addEventListener("wheel", this.onWheel, {
921
- passive: false
922
- });
923
- this.containerRef.addEventListener("gesturestart", this.onGestureStart);
924
- }
925
- this.currentDoc.addEventListener("scroll", this.onScroll);
926
- if (!this.props.disableAutomaticStylesInjection) {
927
- this.styleRef = this.currentDoc.createElement("style");
928
- this.styleRef.setAttribute("type", "text/css");
929
- if (this.props.nonce) {
930
- this.styleRef.setAttribute("nonce", this.props.nonce);
931
- }
932
- this.styleRef.innerHTML = css_248z;
933
- this.currentDoc.head.appendChild(this.styleRef);
934
- }
935
- if (this.imageRef.current && this.imageRef.current.complete) {
936
- this.onMediaLoad();
937
- }
938
- if (this.props.setImageRef) {
939
- this.props.setImageRef(this.imageRef);
940
- }
941
- if (this.props.setVideoRef) {
942
- this.props.setVideoRef(this.videoRef);
943
- }
944
- if (this.props.setCropperRef) {
945
- this.props.setCropperRef(this.cropperRef);
946
- }
947
- };
948
- Cropper2.prototype.componentWillUnmount = function() {
949
- var _a, _b;
950
- if (!this.currentDoc || !this.currentWindow) return;
951
- if (typeof window.ResizeObserver === "undefined") {
952
- this.currentWindow.removeEventListener("resize", this.computeSizes);
953
- }
954
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
955
- if (this.containerRef) {
956
- this.containerRef.removeEventListener("gesturestart", this.preventZoomSafari);
957
- }
958
- if (this.styleRef) {
959
- (_b = this.styleRef.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.styleRef);
960
- }
961
- this.cleanEvents();
962
- this.props.zoomWithScroll && this.clearScrollEvent();
963
- };
964
- Cropper2.prototype.componentDidUpdate = function(prevProps) {
965
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
966
- if (prevProps.rotation !== this.props.rotation) {
967
- this.computeSizes();
968
- this.recomputeCropPosition();
969
- } else if (prevProps.aspect !== this.props.aspect) {
970
- this.computeSizes();
971
- } else if (prevProps.objectFit !== this.props.objectFit) {
972
- this.computeSizes();
973
- } else if (prevProps.zoom !== this.props.zoom) {
974
- this.recomputeCropPosition();
975
- } else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) {
976
- this.computeSizes();
977
- } else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) {
978
- this.emitCropAreaChange();
979
- }
980
- if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) {
981
- this.props.zoomWithScroll ? this.containerRef.addEventListener("wheel", this.onWheel, {
982
- passive: false
983
- }) : this.clearScrollEvent();
984
- }
985
- if (prevProps.video !== this.props.video) {
986
- (_j = this.videoRef.current) === null || _j === void 0 ? void 0 : _j.load();
987
- }
988
- var objectFit = this.getObjectFit();
989
- if (objectFit !== this.state.mediaObjectFit) {
990
- this.setState({
991
- mediaObjectFit: objectFit
992
- }, this.computeSizes);
993
- }
994
- };
995
- Cropper2.prototype.getAspect = function() {
996
- var _a = this.props, cropSize = _a.cropSize, aspect = _a.aspect;
997
- if (cropSize) {
998
- return cropSize.width / cropSize.height;
999
- }
1000
- return aspect;
1001
- };
1002
- Cropper2.prototype.getObjectFit = function() {
1003
- var _a, _b, _c, _d;
1004
- if (this.props.objectFit === "cover") {
1005
- var mediaRef = this.imageRef.current || this.videoRef.current;
1006
- if (mediaRef && this.containerRef) {
1007
- this.containerRect = this.containerRef.getBoundingClientRect();
1008
- var containerAspect = this.containerRect.width / this.containerRect.height;
1009
- var naturalWidth = ((_a = this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
1010
- var naturalHeight = ((_c = this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
1011
- var mediaAspect = naturalWidth / naturalHeight;
1012
- return mediaAspect < containerAspect ? "horizontal-cover" : "vertical-cover";
1013
- }
1014
- return "horizontal-cover";
1015
- }
1016
- return this.props.objectFit;
1017
- };
1018
- Cropper2.prototype.onPinchStart = function(e) {
1019
- var pointA = Cropper2.getTouchPoint(e.touches[0]);
1020
- var pointB = Cropper2.getTouchPoint(e.touches[1]);
1021
- this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB);
1022
- this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB);
1023
- this.onDragStart(getCenter(pointA, pointB));
1024
- };
1025
- Cropper2.prototype.onPinchMove = function(e) {
1026
- var _this = this;
1027
- if (!this.currentDoc || !this.currentWindow) return;
1028
- var pointA = Cropper2.getTouchPoint(e.touches[0]);
1029
- var pointB = Cropper2.getTouchPoint(e.touches[1]);
1030
- var center = getCenter(pointA, pointB);
1031
- this.onDrag(center);
1032
- if (this.rafPinchTimeout) this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout);
1033
- this.rafPinchTimeout = this.currentWindow.requestAnimationFrame(function() {
1034
- var distance = getDistanceBetweenPoints(pointA, pointB);
1035
- var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance);
1036
- _this.setNewZoom(newZoom, center, {
1037
- shouldUpdatePosition: false
1038
- });
1039
- _this.lastPinchDistance = distance;
1040
- var rotation = getRotationBetweenPoints(pointA, pointB);
1041
- var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation);
1042
- _this.props.onRotationChange && _this.props.onRotationChange(newRotation);
1043
- _this.lastPinchRotation = rotation;
1044
- });
1045
- };
1046
- Cropper2.prototype.render = function() {
1047
- var _this = this;
1048
- var _a;
1049
- var _b = this.props, image = _b.image, video = _b.video, mediaProps = _b.mediaProps, cropperProps = _b.cropperProps, transform = _b.transform, _c = _b.crop, x = _c.x, y = _c.y, rotation = _b.rotation, zoom = _b.zoom, cropShape = _b.cropShape, showGrid = _b.showGrid, roundCropAreaPixels = _b.roundCropAreaPixels, _d = _b.style, containerStyle = _d.containerStyle, cropAreaStyle = _d.cropAreaStyle, mediaStyle = _d.mediaStyle, _e = _b.classes, containerClassName = _e.containerClassName, cropAreaClassName = _e.cropAreaClassName, mediaClassName = _e.mediaClassName;
1050
- var objectFit = (_a = this.state.mediaObjectFit) !== null && _a !== void 0 ? _a : this.getObjectFit();
1051
- return React.createElement("div", {
1052
- onMouseDown: this.onMouseDown,
1053
- onTouchStart: this.onTouchStart,
1054
- ref: function ref(el) {
1055
- return _this.containerRef = el;
1056
- },
1057
- "data-testid": "container",
1058
- style: containerStyle,
1059
- className: classNames("reactEasyCrop_Container", containerClassName)
1060
- }, image ? React.createElement("img", __assign({
1061
- alt: "",
1062
- className: classNames("reactEasyCrop_Image", objectFit === "contain" && "reactEasyCrop_Contain", objectFit === "horizontal-cover" && "reactEasyCrop_Cover_Horizontal", objectFit === "vertical-cover" && "reactEasyCrop_Cover_Vertical", mediaClassName)
1063
- }, mediaProps, {
1064
- src: image,
1065
- ref: this.imageRef,
1066
- style: __assign(__assign({}, mediaStyle), {
1067
- transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")")
1068
- }),
1069
- onLoad: this.onMediaLoad
1070
- })) : video && React.createElement("video", __assign({
1071
- autoPlay: true,
1072
- playsInline: true,
1073
- loop: true,
1074
- muted: true,
1075
- className: classNames("reactEasyCrop_Video", objectFit === "contain" && "reactEasyCrop_Contain", objectFit === "horizontal-cover" && "reactEasyCrop_Cover_Horizontal", objectFit === "vertical-cover" && "reactEasyCrop_Cover_Vertical", mediaClassName)
1076
- }, mediaProps, {
1077
- ref: this.videoRef,
1078
- onLoadedMetadata: this.onMediaLoad,
1079
- style: __assign(__assign({}, mediaStyle), {
1080
- transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")")
1081
- }),
1082
- controls: false
1083
- }), (Array.isArray(video) ? video : [{
1084
- src: video
1085
- }]).map(function(item) {
1086
- return React.createElement("source", __assign({
1087
- key: item.src
1088
- }, item));
1089
- })), this.state.cropSize && React.createElement("div", __assign({
1090
- ref: this.cropperRef,
1091
- style: __assign(__assign({}, cropAreaStyle), {
1092
- width: roundCropAreaPixels ? Math.round(this.state.cropSize.width) : this.state.cropSize.width,
1093
- height: roundCropAreaPixels ? Math.round(this.state.cropSize.height) : this.state.cropSize.height
1094
- }),
1095
- tabIndex: 0,
1096
- onKeyDown: this.onKeyDown,
1097
- onKeyUp: this.onKeyUp,
1098
- "data-testid": "cropper",
1099
- className: classNames("reactEasyCrop_CropArea", cropShape === "round" && "reactEasyCrop_CropAreaRound", showGrid && "reactEasyCrop_CropAreaGrid", cropAreaClassName)
1100
- }, cropperProps)));
1101
- };
1102
- Cropper2.defaultProps = {
1103
- zoom: 1,
1104
- rotation: 0,
1105
- aspect: 4 / 3,
1106
- maxZoom: MAX_ZOOM,
1107
- minZoom: MIN_ZOOM,
1108
- cropShape: "rect",
1109
- objectFit: "contain",
1110
- showGrid: true,
1111
- style: {},
1112
- classes: {},
1113
- mediaProps: {},
1114
- cropperProps: {},
1115
- zoomSpeed: 1,
1116
- restrictPosition: true,
1117
- zoomWithScroll: true,
1118
- keyboardStep: KEYBOARD_STEP
1119
- };
1120
- Cropper2.getMousePoint = function(e) {
1121
- return {
1122
- x: Number(e.clientX),
1123
- y: Number(e.clientY)
1124
- };
1125
- };
1126
- Cropper2.getTouchPoint = function(touch) {
1127
- return {
1128
- x: Number(touch.clientX),
1129
- y: Number(touch.clientY)
1130
- };
1131
- };
1132
- return Cropper2;
1133
- }(React.Component)
1134
- );
1135
- const useImageCrop = (props) => {
1136
- const size = useMemo(() => KEY_SIZE_DATA[props.dialog.button.size], [props.dialog.button.size]);
1137
- const br = useMemo(() => `${size.radius}px`, [size.radius]);
1138
- const [images, setImages] = useState([]);
1139
- const propsMemo = useDeepCompareMemoize(props);
1140
- const propsDialog = useMemo(
1141
- () => ({
1142
- propsCustom: {
1143
- images,
1144
- br,
1145
- imageSettings: propsMemo.imageSettings,
1146
- onSave: propsMemo.onSave,
1147
- dialog: propsMemo.dialog,
1148
- locale: propsMemo.locale
1149
- },
1150
- propsDialog: {
1151
- borderRadius: br,
1152
- padding: "0",
1153
- background: "transparent"
1154
- },
1155
- onRemove() {
1156
- setImages([]);
1157
- },
1158
- content: (remove, isAnimating, params) => /* @__PURE__ */ jsxRuntimeExports.jsx(CropperWrapper, { params, remove, isAnimating })
1159
- }),
1160
- [br, images, propsMemo.dialog, propsMemo.imageSettings, propsMemo.locale, propsMemo.onSave]
1161
- );
1162
- const { add } = useDialog(propsDialog);
1163
- const handleAdd = useCallback(
1164
- (images2) => {
1165
- setImages(images2);
1166
- add();
1167
- },
1168
- [add]
1169
- );
1170
- const handleAddFiles = useCallback(
1171
- (files) => {
1172
- const validFiles = Array.from(files).filter((file) => {
1173
- if (file.size > props.imageSettings.maxSize) {
1174
- console.warn(`File ${file.name} exceeds the allowed size of ${props.imageSettings.maxSize} bytes`);
1175
- return false;
1176
- }
1177
- return true;
1178
- });
1179
- const newImages = validFiles.map((file, idx) => ({
1180
- id: Date.now() + idx,
1181
- file,
1182
- url: URL.createObjectURL(file),
1183
- index: idx,
1184
- isNew: true,
1185
- name: file.name,
1186
- format: file.type
1187
- }));
1188
- if (props.refInput && "current" in props.refInput && props.refInput.current) {
1189
- props.refInput.current.value = "";
1190
- }
1191
- if (newImages.length) handleAdd(newImages);
1192
- },
1193
- [handleAdd, props.imageSettings.maxSize, props.refInput]
1194
- );
1195
- return { handleAdd, handleAddFiles };
1196
- };
1197
- function getCroppedImg(imageSrc, crop, format = "image/png") {
1198
- const mimeType = LIST_IMAGE_SUPPORTED_FORMAT.includes(format) ? format : "image/png";
1199
- return new Promise((resolve, reject) => {
1200
- const image = new Image();
1201
- image.src = imageSrc;
1202
- image.crossOrigin = "anonymous";
1203
- image.onload = () => {
1204
- const canvas = document.createElement("canvas");
1205
- const ctx = canvas.getContext("2d");
1206
- canvas.width = crop.width;
1207
- canvas.height = crop.height;
1208
- ctx.drawImage(image, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);
1209
- canvas.toBlob((blob) => {
1210
- if (blob) resolve(blob);
1211
- else reject(new Error("Canvas is empty"));
1212
- }, mimeType);
1213
- };
1214
- image.onerror = () => reject(new Error("Failed to load image"));
1215
- });
1216
- }
1217
- const CropperWrapper = (props) => {
1218
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
1219
- const [index, setIndex] = useState(0);
1220
- const [newImages, setNewImages] = useState([]);
1221
- const [newImagesCroppedArea, setNewImagesCroppedArea] = useState([]);
1222
- const theme = useTheme();
1223
- const isMulti = useMemo(() => {
1224
- var _a2, _b2;
1225
- return ((_b2 = ((_a2 = props == null ? void 0 : props.params) == null ? void 0 : _a2.images) ?? []) == null ? void 0 : _b2.length) > 1;
1226
- }, [(_a = props.params) == null ? void 0 : _a.images]);
1227
- const newImageIndex = useMemo(() => newImages == null ? void 0 : newImages[index], [newImages, index]);
1228
- const onSave = useCallback(
1229
- async (images) => {
1230
- var _a2, _b2, _c2;
1231
- const saveImages = await Promise.all(
1232
- images.map(async (image) => {
1233
- const imageCroppedArea = newImagesCroppedArea[image.index] ?? null;
1234
- if (image.isDeleted || !image.isCropped || !image.url || !image.name || !imageCroppedArea) return null;
1235
- const blob = await getCroppedImg(image.url, imageCroppedArea, image.format);
1236
- const croppedFile = new File([blob], image.name, { type: image.format });
1237
- const newImage = {
1238
- ...image,
1239
- file: croppedFile,
1240
- url: URL.createObjectURL(croppedFile)
1241
- };
1242
- return newImage;
1243
- })
1244
- );
1245
- (_b2 = (_a2 = props.params) == null ? void 0 : _a2.onSave) == null ? void 0 : _b2.call(_a2, saveImages.filter(Boolean));
1246
- (_c2 = props.remove) == null ? void 0 : _c2.call(props);
1247
- },
1248
- [newImagesCroppedArea, props]
1249
- );
1250
- const onChange = useCallback(
1251
- async (params) => {
1252
- var _a2, _b2, _c2;
1253
- const image = (_b2 = (_a2 = props == null ? void 0 : props.params) == null ? void 0 : _a2.images) == null ? void 0 : _b2[params.index];
1254
- if (image) {
1255
- const newImage = {
1256
- ...image,
1257
- id: Date.now() + params.index,
1258
- index: params.index,
1259
- croppedArea: params.croppedArea ?? image.croppedArea,
1260
- zoom: params.zoom ?? image.zoom,
1261
- crop: params.crop ?? image.crop,
1262
- isNew: true,
1263
- isCropped: params.isCropped ?? image.isCropped,
1264
- isDeleted: params.isDeleted ?? image.isDeleted
1265
- };
1266
- setNewImages((prev) => {
1267
- const arr = [...prev];
1268
- arr[params.index] = newImage;
1269
- return arr;
1270
- });
1271
- if (params.isNext) {
1272
- const newIndex = params.index + 1 >= (((_c2 = props == null ? void 0 : props.params) == null ? void 0 : _c2.images) ?? []).length ? 0 : params.index + 1;
1273
- setIndex(newIndex);
1274
- }
1275
- if (params.isSave) {
1276
- onSave([newImage]);
1277
- }
1278
- }
1279
- },
1280
- [onSave, (_b = props == null ? void 0 : props.params) == null ? void 0 : _b.images]
1281
- );
1282
- useEffect(() => {
1283
- var _a2, _b2;
1284
- setNewImages(((_a2 = props == null ? void 0 : props.params) == null ? void 0 : _a2.images) ?? []);
1285
- setNewImagesCroppedArea((((_b2 = props == null ? void 0 : props.params) == null ? void 0 : _b2.images) ?? []).map((image) => image.croppedArea ?? null));
1286
- }, [(_c = props == null ? void 0 : props.params) == null ? void 0 : _c.images]);
1287
- useEffect(() => {
1288
- return () => {
1289
- setIndex(0);
1290
- setNewImages([]);
1291
- setNewImagesCroppedArea([]);
1292
- };
1293
- }, []);
1294
- const lengthData = useMemo(() => {
1295
- return newImages.reduce((acc, image) => {
1296
- if (acc && (image == null ? void 0 : image.index) !== void 0)
1297
- acc[image.index] = {
1298
- genre: image.isDeleted ? "redTransparent" : image.isCropped ? "greenTransparent" : "white",
1299
- icons: image.isDeleted ? [{ type: "id", name: "CloseMini" }] : image.isCropped ? [{ type: "id", name: "TickMini" }] : []
1300
- };
1301
- return acc;
1302
- }, {});
1303
- }, [newImages]);
1304
- const isDisabledSave = useMemo(() => {
1305
- return newImages.every((image) => (image == null ? void 0 : image.isDeleted) || !(image == null ? void 0 : image.isCropped));
1306
- }, [newImages]);
1307
- const genre = useMemo(() => {
1308
- var _a2;
1309
- return ((_a2 = props.params) == null ? void 0 : _a2.dialog.button.genre) || "product";
1310
- }, [(_d = props.params) == null ? void 0 : _d.dialog.button.genre]);
1311
- const size = useMemo(() => {
1312
- var _a2;
1313
- return ((_a2 = props.params) == null ? void 0 : _a2.dialog.button.size) || "medium";
1314
- }, [(_e = props.params) == null ? void 0 : _e.dialog.button.size]);
1315
- const genreDelete = useMemo(
1316
- () => {
1317
- var _a2;
1318
- return ((_a2 = props.params) == null ? void 0 : _a2.dialog.buttonDelete.genre) || "product";
1319
- },
1320
- [(_f = props.params) == null ? void 0 : _f.dialog.buttonDelete.genre]
1321
- );
1322
- const sizeDelete = useMemo(() => {
1323
- var _a2;
1324
- return ((_a2 = props.params) == null ? void 0 : _a2.dialog.button.size) || "medium";
1325
- }, [(_g = props.params) == null ? void 0 : _g.dialog.button.size]);
1326
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1327
- Stack,
1328
- {
1329
- sx: (theme2) => {
1330
- var _a2, _b2, _c2;
1331
- return {
1332
- default: {
1333
- position: "relative",
1334
- overflow: "hidden",
1335
- aspectRatio: ((_a2 = props.params) == null ? void 0 : _a2.imageSettings.aspect) ? `${((_b2 = props.params) == null ? void 0 : _b2.imageSettings.aspect) * 2} / 2` : void 0,
1336
- width: "auto",
1337
- maxWidth: "70dvw",
1338
- height: "85dvh",
1339
- borderRadius: (_c2 = props.params) == null ? void 0 : _c2.br,
1340
- backgroundColor: theme2.palette.whiteStandard
1341
- },
1342
- tablet: {
1343
- maxWidth: "95dvw"
1344
- }
1345
- };
1346
- },
1347
- children: [
1348
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Preview, { visible: !props.isAnimating, minTime: 500, children: [
1349
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1350
- Stack,
1351
- {
1352
- sx: {
1353
- default: {
1354
- position: "absolute",
1355
- top: 0,
1356
- left: 0,
1357
- right: 0,
1358
- bottom: 0
1359
- }
1360
- },
1361
- children: newImageIndex && /* @__PURE__ */ jsxRuntimeExports.jsx(
1362
- Cropper,
1363
- {
1364
- style: {
1365
- containerStyle: {
1366
- backgroundColor: theme.palette.black80
1367
- }
1368
- },
1369
- image: newImageIndex.url,
1370
- crop: (newImageIndex == null ? void 0 : newImageIndex.crop) ?? { x: 0, y: 0 },
1371
- zoom: (newImageIndex == null ? void 0 : newImageIndex.zoom) ?? 1,
1372
- aspect: (_h = props.params) == null ? void 0 : _h.imageSettings.aspect,
1373
- onCropChange: (crop) => {
1374
- onChange({
1375
- ...newImageIndex,
1376
- crop
1377
- });
1378
- },
1379
- onZoomChange: (zoom) => {
1380
- onChange({
1381
- ...newImageIndex,
1382
- zoom
1383
- });
1384
- },
1385
- onCropComplete: (_, croppedArea) => {
1386
- setNewImagesCroppedArea((prev) => {
1387
- const arr = [...prev];
1388
- arr[index] = croppedArea;
1389
- return arr;
1390
- });
1391
- }
1392
- }
1393
- )
1394
- }
1395
- ),
1396
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
1397
- Stack,
1398
- {
1399
- sx: {
1400
- default: {
1401
- position: "absolute",
1402
- top: 15,
1403
- right: 15,
1404
- gap: "10px"
1405
- }
1406
- },
1407
- children: [
1408
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { genre: genreDelete, size: sizeDelete, isHiddenBorder: true, isRadius: true, onClick: () => {
1409
- var _a2;
1410
- return (_a2 = props.remove) == null ? void 0 : _a2.call(props);
1411
- }, children: (_i = props.params) == null ? void 0 : _i.locale.dialogCancel }),
1412
- isMulti && /* @__PURE__ */ jsxRuntimeExports.jsx(
1413
- Button,
1414
- {
1415
- genre,
1416
- size,
1417
- isHiddenBorder: true,
1418
- isRadius: true,
1419
- onClick: () => onSave(newImages),
1420
- isHidden: isDisabledSave,
1421
- isDisabled: isDisabledSave,
1422
- children: (_j = props.params) == null ? void 0 : _j.locale.dialogSave
1423
- }
1424
- )
1425
- ]
1426
- }
1427
- )
1428
- ] }),
1429
- isMulti && index !== ((_k = props == null ? void 0 : props.params) == null ? void 0 : _k.images.length) && /* @__PURE__ */ jsxRuntimeExports.jsx(
1430
- Button,
1431
- {
1432
- sx: {
1433
- default: {
1434
- position: "absolute",
1435
- top: 15,
1436
- left: 15
1437
- }
1438
- },
1439
- genre,
1440
- size,
1441
- isHiddenBorder: true,
1442
- isWidthAsHeight: true,
1443
- isRadius: true,
1444
- isDisabled: true,
1445
- children: index + 1
1446
- }
1447
- ),
1448
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
1449
- Stack,
1450
- {
1451
- sx: (theme2) => ({
1452
- default: {
1453
- position: "absolute",
1454
- bottom: isMulti ? 5 : 15,
1455
- left: isMulti ? 5 : void 0,
1456
- right: isMulti ? void 0 : 15,
1457
- width: isMulti ? "calc(100% - 10px)" : "fit-content",
1458
- backgroundColor: isMulti ? theme2.palette.whiteStandard : theme2.palette.transparent,
1459
- padding: "10px",
1460
- borderRadius: "50px",
1461
- flexDirection: "row",
1462
- justifyContent: "space-between",
1463
- alignItems: "center",
1464
- gap: "10px"
1465
- },
1466
- mobile: {
1467
- borderRadius: "24px",
1468
- flexDirection: "column",
1469
- alignItems: "stretch",
1470
- gap: "10px"
1471
- }
1472
- }),
1473
- children: [
1474
- isMulti && /* @__PURE__ */ jsxRuntimeExports.jsx(
1475
- Pagination,
1476
- {
1477
- sx: {
1478
- default: {},
1479
- mobile: {
1480
- justifyContent: "space-between"
1481
- }
1482
- },
1483
- lengthData,
1484
- length: (((_l = props == null ? void 0 : props.params) == null ? void 0 : _l.images) ?? []).length,
1485
- index,
1486
- changeIndex: (newIndex) => {
1487
- setIndex(newIndex);
1488
- },
1489
- isInfinity: true,
1490
- viewQuantity: 4,
1491
- buttonControl: {
1492
- genre,
1493
- size,
1494
- isRadius: true,
1495
- isWidthAsHeight: true
1496
- },
1497
- buttonCount: {
1498
- active: {
1499
- genre,
1500
- size,
1501
- isRadius: true,
1502
- isPlaystationEffect: true
1503
- },
1504
- inactive: {
1505
- genre: "white",
1506
- size,
1507
- isRadius: true
1508
- }
1509
- },
1510
- locale: {
1511
- next: "Next",
1512
- prev: "Prev"
1513
- }
1514
- }
1515
- ),
1516
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
1517
- Stack,
1518
- {
1519
- sx: {
1520
- default: {
1521
- gap: "10px"
1522
- },
1523
- mobile: {
1524
- justifyContent: "center"
1525
- }
1526
- },
1527
- children: [
1528
- isMulti && /* @__PURE__ */ jsxRuntimeExports.jsx(
1529
- Button,
1530
- {
1531
- genre: genreDelete,
1532
- size: sizeDelete,
1533
- isHiddenBorder: true,
1534
- isRadius: true,
1535
- onClick: () => {
1536
- onChange({
1537
- ...newImageIndex,
1538
- isDeleted: true,
1539
- isNext: isMulti
1540
- });
1541
- },
1542
- children: (_m = props.params) == null ? void 0 : _m.locale.dialogDeleteImage
1543
- }
1544
- ),
1545
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1546
- Button,
1547
- {
1548
- genre,
1549
- size,
1550
- isHiddenBorder: true,
1551
- isRadius: true,
1552
- onClick: () => {
1553
- onChange({
1554
- ...newImageIndex,
1555
- isDeleted: false,
1556
- isCropped: true,
1557
- isNext: isMulti,
1558
- isSave: !isMulti
1559
- });
1560
- },
1561
- children: isMulti ? (_n = props.params) == null ? void 0 : _n.locale.dialogAddImage : (_o = props.params) == null ? void 0 : _o.locale.dialogSave
1562
- }
1563
- )
1564
- ]
1565
- }
1566
- )
1567
- ]
1568
- }
1569
- )
1570
- ]
1571
- }
1572
- );
1573
- };
1574
- export {
1575
- useImageCrop as u
1576
- };
1577
- //# sourceMappingURL=use-DdGWsOBo.js.map