@stachelock/ui 0.5.4 → 0.6.1

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 (442) hide show
  1. package/README.md +118 -5
  2. package/dist/AddDeleteButtonGroup.vue_vue_type_script_setup_true_lang-6taLcPq0.js +77 -0
  3. package/dist/{AlertModal.vue_vue_type_script_setup_true_lang-C6q8Mpl4.js → AlertModal.vue_vue_type_script_setup_true_lang-DzhVQdx4.js} +45 -65
  4. package/dist/BackgroundGradientWrapper.vue_vue_type_script_setup_true_lang-C8msTrTn.js +0 -1
  5. package/dist/BarChart.vue_vue_type_script_setup_true_lang-xCb0DCbf.js +0 -1
  6. package/dist/{BaseModal.vue_vue_type_script_setup_true_lang-B67Pt3tW.js → BaseModal.vue_vue_type_script_setup_true_lang--iGzFCnC.js} +42 -44
  7. package/dist/{CalendarHeader.vue_vue_type_script_setup_true_lang-CkSUiLOH.js → CalendarHeader.vue_vue_type_script_setup_true_lang-hGa2MLyo.js} +114 -141
  8. package/dist/CardWrapper.vue_vue_type_script_setup_true_lang-D59QBAi9.js +0 -1
  9. package/dist/CheckboxInput.vue_vue_type_script_setup_true_lang-BikR9rgi.js +0 -1
  10. package/dist/ComboboxInput.vue_vue_type_script_setup_true_lang-BigvbBAU.js +331 -0
  11. package/dist/ComingSoon.vue_vue_type_script_setup_true_lang-CJ8FXE42.js +0 -1
  12. package/dist/{DashboardLayout.vue_vue_type_script_setup_true_lang-B0M6-9os.js → DashboardLayout.vue_vue_type_script_setup_true_lang-BAx4gKqh.js} +44 -47
  13. package/dist/{DatepickerInput.vue_vue_type_style_index_0_lang-BdkGLw0H.js → DatepickerInput.vue_vue_type_style_index_0_lang-DbI3619T.js} +23 -24
  14. package/dist/{DayCalendar.vue_vue_type_script_setup_true_lang-8al4Fotu.js → DayCalendar.vue_vue_type_script_setup_true_lang-D-4jcUvI.js} +1 -2
  15. package/dist/DefaultLayout.vue_vue_type_script_setup_true_lang-BZAz6aC-.js +0 -1
  16. package/dist/DisclosureWrapper.vue_vue_type_script_setup_true_lang-CgHPOC-w.js +35 -0
  17. package/dist/{DynamicForm.vue_vue_type_script_setup_true_lang-CxSaO5Cl.js → DynamicForm.vue_vue_type_script_setup_true_lang-BR8Pq7Kw.js} +52 -53
  18. package/dist/{DynamicFormField.vue_vue_type_script_setup_true_lang-CSLSRFM7.js → DynamicFormField.vue_vue_type_script_setup_true_lang-BCVmqg_n.js} +7 -8
  19. package/dist/EmailInput.vue_vue_type_script_setup_true_lang-BicPMIop.js +0 -1
  20. package/dist/EmptyInput.vue_vue_type_script_setup_true_lang-FWDCFF2c.js +0 -1
  21. package/dist/EmptyState.vue_vue_type_script_setup_true_lang-7mcKkOWP.js +0 -1
  22. package/dist/EventCard.vue_vue_type_script_setup_true_lang-B3TP-mWX.js +74 -0
  23. package/dist/EventsList.vue_vue_type_script_setup_true_lang-BTIoGr_e.js +87 -0
  24. package/dist/FileDropzoneInput.vue_vue_type_script_setup_true_lang-BJR-_ngq.js +176 -0
  25. package/dist/{FormErrorWrapper.vue_vue_type_script_setup_true_lang-BQOlG_ab.js → FormErrorWrapper.vue_vue_type_script_setup_true_lang-D7ZAgfPs.js} +12 -13
  26. package/dist/FunnelChart.vue_vue_type_script_setup_true_lang-B4pH6xCV.js +0 -1
  27. package/dist/HeaderLayout.vue_vue_type_script_setup_true_lang-BY2G6hCc.js +0 -1
  28. package/dist/HiddenInput.vue_vue_type_script_setup_true_lang-PtGZ4eLW.js +0 -1
  29. package/dist/{InlineTabs.vue_vue_type_script_setup_true_lang-CD0lnkUm.js → InlineTabs.vue_vue_type_script_setup_true_lang-B5w4yzcZ.js} +1 -2
  30. package/dist/LineChart.vue_vue_type_script_setup_true_lang-DJo0edLJ.js +0 -1
  31. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-swmHdR0_.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C0R4ADBb.js} +1 -2
  32. package/dist/{MonthCalendar.vue_vue_type_style_index_0_lang-Cyzq7A9j.js → MonthCalendar.vue_vue_type_style_index_0_lang-lnKkvJ9u.js} +1 -2
  33. package/dist/NavigationGroup.vue_vue_type_script_setup_true_lang-BWq5fpEm.js +0 -1
  34. package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-C8aX-84Q.js +0 -1
  35. package/dist/{NotificationContainer.vue_vue_type_style_index_0_lang-DSfNw4Ge.js → NotificationContainer.vue_vue_type_style_index_0_lang-CvJRwezr.js} +1 -2
  36. package/dist/{NotificationToast.vue_vue_type_script_setup_true_lang-CU__ORw8.js → NotificationToast.vue_vue_type_script_setup_true_lang-BBWpW4km.js} +61 -64
  37. package/dist/PieChart.vue_vue_type_script_setup_true_lang-e3wsA9O4.js +0 -1
  38. package/dist/ProfileHeaderAvatar.vue_vue_type_script_setup_true_lang-CKCoHD1o.js +0 -1
  39. package/dist/ProjectLogo.vue_vue_type_script_setup_true_lang-DYjp-RNh.js +0 -1
  40. package/dist/{SelectInput.vue_vue_type_script_setup_true_lang-DHiZ-7K2.js → SelectInput.vue_vue_type_script_setup_true_lang-D4GNv0MY.js} +56 -58
  41. package/dist/{SelectTextInput.vue_vue_type_script_setup_true_lang-DYrXW14A.js → SelectTextInput.vue_vue_type_script_setup_true_lang-BVaViHPl.js} +66 -69
  42. package/dist/{SidebarLayout.vue_vue_type_script_setup_true_lang-BJ5jadgZ.js → SidebarLayout.vue_vue_type_script_setup_true_lang-CZ21EVcZ.js} +36 -39
  43. package/dist/SparklineChart.vue_vue_type_script_setup_true_lang-BlNk5ZqM.js +0 -1
  44. package/dist/StatCard.vue_vue_type_script_setup_true_lang-B5SuaSXL.js +66 -0
  45. package/dist/{StepperPanels.vue_vue_type_script_setup_true_lang-D6Fv7iz3.js → StepperPanels.vue_vue_type_script_setup_true_lang-DPLQ9mQn.js} +34 -49
  46. package/dist/SwitchInput.vue_vue_type_script_setup_true_lang-D5Es9AjF.js +200 -0
  47. package/dist/{SwitchInputGroup.vue_vue_type_script_setup_true_lang-CK9JWl4F.js → SwitchInputGroup.vue_vue_type_script_setup_true_lang-DigNYqVZ.js} +1 -2
  48. package/dist/{TabGroup.vue_vue_type_script_setup_true_lang-DVVeOgWH.js → TabGroup.vue_vue_type_script_setup_true_lang-BsbiEA4E.js} +19 -20
  49. package/dist/{TabGroupUnderline.vue_vue_type_script_setup_true_lang-_3XtOn3w.js → TabGroupUnderline.vue_vue_type_script_setup_true_lang-CPcp1-Za.js} +21 -22
  50. package/dist/{TabsInPills.vue_vue_type_script_setup_true_lang-DY1NkXCQ.js → TabsInPills.vue_vue_type_script_setup_true_lang-U5CdRL7s.js} +1 -2
  51. package/dist/{TagifyInput.vue_vue_type_script_setup_true_lang-Da6-pRJ2.js → TagifyInput.vue_vue_type_script_setup_true_lang-BF2mK8JC.js} +14 -15
  52. package/dist/TextAreaInput.vue_vue_type_script_setup_true_lang-Cf0MJobG.js +0 -1
  53. package/dist/UiAvatar.vue_vue_type_script_setup_true_lang-WVY6JbUL.js +0 -1
  54. package/dist/UiBadge.vue_vue_type_script_setup_true_lang-DOtbLb9x.js +0 -1
  55. package/dist/UiButtonGroup.vue_vue_type_script_setup_true_lang-CVwXB-cb.js +0 -1
  56. package/dist/UiCheckbox.vue_vue_type_script_setup_true_lang-BxyM_F-V.js +0 -1
  57. package/dist/UiLoading.vue_vue_type_script_setup_true_lang-rNvtzKbq.js +0 -1
  58. package/dist/{UiMapAll.vue_vue_type_script_setup_true_lang-CMAyvJMk.js → UiMapAll.vue_vue_type_script_setup_true_lang-11yT7mTH.js} +93 -111
  59. package/dist/UiMenu.vue_vue_type_script_setup_true_lang-gnoIJm6x.js +127 -0
  60. package/dist/{UiModal.vue_vue_type_script_setup_true_lang-CpwFUDVU.js → UiModal.vue_vue_type_script_setup_true_lang-BZC7aN7K.js} +41 -43
  61. package/dist/{UiNavLink.vue_vue_type_script_setup_true_lang-DnWMn40M.js → UiNavLink.vue_vue_type_script_setup_true_lang-C5Gicm8o.js} +4 -5
  62. package/dist/UiProgressBar.vue_vue_type_script_setup_true_lang-BCh4orZW.js +0 -1
  63. package/dist/UiTable.vue_vue_type_script_setup_true_lang-xGAiJ9rS.js +0 -1
  64. package/dist/UiTransition.vue_vue_type_script_setup_true_lang-C4jb9I-3.js +0 -1
  65. package/dist/YearCalendar.vue_vue_type_script_setup_true_lang-CfKSpLLN.js +0 -1
  66. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -1
  67. package/dist/calendar-DLry-Vik.js +147 -0
  68. package/dist/calendars/CalendarDashboard.js +3 -4
  69. package/dist/calendars/CalendarHeader.js +1 -2
  70. package/dist/calendars/DayCalendar.js +1 -2
  71. package/dist/calendars/EventCard.js +1 -2
  72. package/dist/calendars/EventsList.js +1 -2
  73. package/dist/calendars/MonthCalendar.js +1 -2
  74. package/dist/calendars/WeekCalendar.js +1 -2
  75. package/dist/calendars/YearCalendar.js +0 -1
  76. package/dist/charts/BarChart.js +0 -1
  77. package/dist/charts/BaseChart.js +42 -59
  78. package/dist/charts/FunnelChart.js +0 -1
  79. package/dist/charts/LineChart.js +0 -1
  80. package/dist/charts/PieChart.js +0 -1
  81. package/dist/charts/SparklineChart.js +0 -1
  82. package/dist/charts/StatCard.js +1 -2
  83. package/dist/charts/chartTheme.js +0 -1
  84. package/dist/charts/index.js +1 -2
  85. package/dist/components/Avatar.js +0 -1
  86. package/dist/components/Badge.js +0 -1
  87. package/dist/components/Banner.js +178 -351
  88. package/dist/components/Breadcrumb.js +41 -42
  89. package/dist/components/Button.js +0 -1
  90. package/dist/components/ButtonGroup.js +0 -1
  91. package/dist/components/Checkbox.js +0 -1
  92. package/dist/components/CloudinaryImage.js +51 -81
  93. package/dist/components/Loading.js +0 -1
  94. package/dist/components/LoadingDots.js +0 -1
  95. package/dist/components/LottieAnimation.js +1 -2
  96. package/dist/components/Menu.js +1 -2
  97. package/dist/components/Modal.js +1 -2
  98. package/dist/components/NavLink.js +1 -2
  99. package/dist/components/ProgressBar.js +0 -1
  100. package/dist/components/RadialProgressBar.js +0 -1
  101. package/dist/components/Table.js +0 -1
  102. package/dist/components/Transition.js +0 -1
  103. package/dist/composables/index.js +1 -2
  104. package/dist/composables/useCalendar.js +1 -2
  105. package/dist/composables/useFormValidation.js +0 -1
  106. package/dist/composables/useMap.js +3 -3
  107. package/dist/composables/useModal.js +0 -1
  108. package/dist/composables/useNotifications.js +0 -1
  109. package/dist/composables/useTabs.js +87 -193
  110. package/dist/composables/useTheme.js +0 -1
  111. package/dist/empty-state/ComingSoon.js +0 -1
  112. package/dist/empty-state/EmptyState.js +0 -1
  113. package/dist/empty-state/index.js +0 -1
  114. package/dist/forms/DynamicForm.js +1 -2
  115. package/dist/forms/DynamicFormField.js +1 -2
  116. package/dist/forms/FormFieldWrapper.js +7 -8
  117. package/dist/id-DafBB_QF.js +0 -1
  118. package/dist/index.js +1343 -725
  119. package/dist/inputs/AddDeleteButtonGroup.js +1 -2
  120. package/dist/inputs/CheckboxInput.js +0 -1
  121. package/dist/inputs/ComboboxInput.js +1 -2
  122. package/dist/inputs/DatepickerInput.js +1 -2
  123. package/dist/inputs/EmailInput.js +0 -1
  124. package/dist/inputs/EmptyInput.js +0 -1
  125. package/dist/inputs/FileDropzoneInput.js +1 -2
  126. package/dist/inputs/HiddenInput.js +0 -1
  127. package/dist/inputs/PhoneInput.js +371 -3539
  128. package/dist/inputs/RichTextInput.js +235 -17298
  129. package/dist/inputs/SelectInput.js +1 -2
  130. package/dist/inputs/SelectTextInput.js +1 -2
  131. package/dist/inputs/SwitchInput.js +1 -2
  132. package/dist/inputs/SwitchInputGroup.js +1 -2
  133. package/dist/inputs/TagifyInput.js +1 -2
  134. package/dist/inputs/TextAreaInput.js +0 -1
  135. package/dist/inputs/TextInput.js +7 -8
  136. package/dist/layouts/DashboardLayout.js +1 -2
  137. package/dist/layouts/DefaultLayout.js +0 -1
  138. package/dist/layouts/HeaderLayout.js +0 -1
  139. package/dist/layouts/NavigationGroup.js +0 -1
  140. package/dist/layouts/NavigationItem.js +0 -1
  141. package/dist/layouts/ProfileHeaderAvatar.js +0 -1
  142. package/dist/layouts/ProjectLogo.js +0 -1
  143. package/dist/layouts/SidebarLayout.js +1 -2
  144. package/dist/loading/ContentSkeleton.js +0 -1
  145. package/dist/loading/SmartLoadingIndicator.js +0 -1
  146. package/dist/loading/index.js +0 -1
  147. package/dist/mapThemes-DFE9fZm3.js +0 -1
  148. package/dist/maps/GoogleMap.js +13 -14
  149. package/dist/maps/UiInfoWindow.js +41 -43
  150. package/dist/maps/UiMap.js +28 -31
  151. package/dist/maps/UiMapAll.js +1 -2
  152. package/dist/maps/UiMapMarker.js +1 -2
  153. package/dist/maps/index.js +1 -2
  154. package/dist/modals/AlertModal.js +1 -2
  155. package/dist/modals/BaseModal.js +1 -2
  156. package/dist/modals/ImageCropperModal.js +130 -1666
  157. package/dist/notifications/NotificationContainer.js +1 -2
  158. package/dist/notifications/NotificationToast.js +1 -2
  159. package/dist/notifications/index.js +2 -3
  160. package/dist/src/components/inputs/AddressInput.d.ts +40 -0
  161. package/dist/src/components/inputs/DatepickerInput.d.ts +7 -7
  162. package/dist/src/components/inputs/index.d.ts +1 -0
  163. package/dist/src/components/maps/UiMap.d.ts +1 -1
  164. package/dist/src/components/maps/UiMapAll.d.ts +6 -6
  165. package/dist/src/plugin/configure.d.ts +3 -1
  166. package/dist/src/services/geocoding.service.d.ts +68 -0
  167. package/dist/src/services/index.d.ts +1 -0
  168. package/dist/src/types/address.d.ts +164 -0
  169. package/dist/src/types/index.d.ts +1 -0
  170. package/dist/src/views/inputs/index.d.ts +1 -0
  171. package/dist/stepper/StepperPanels.js +1 -2
  172. package/dist/stepper/index.js +1 -2
  173. package/dist/style.css +1 -1
  174. package/dist/tabs/InlineTabs.js +1 -2
  175. package/dist/tabs/TabGroup.js +1 -2
  176. package/dist/tabs/TabGroupUnderline.js +1 -2
  177. package/dist/tabs/TabsInPills.js +1 -2
  178. package/dist/tabs/index.js +4 -5
  179. package/dist/ui.css +1 -1
  180. package/dist/useEventSegments-B-r_8zCW.js +0 -1
  181. package/dist/useMap-BGg0H582.js +297 -0
  182. package/dist/useSimpleTabs-CSgkChEU.js +0 -1
  183. package/dist/useStringTransform-CSr7nZWg.js +0 -1
  184. package/dist/wrappers/BackgroundGradientWrapper.js +0 -1
  185. package/dist/wrappers/CardWrapper.js +0 -1
  186. package/dist/wrappers/DisclosureWrapper.js +1 -2
  187. package/dist/wrappers/FormErrorWrapper.js +1 -2
  188. package/dist/wrappers/index.js +2 -3
  189. package/package.json +9 -1
  190. package/dist/AddDeleteButtonGroup.vue_vue_type_script_setup_true_lang-CFS3lVF-.js +0 -128
  191. package/dist/AddDeleteButtonGroup.vue_vue_type_script_setup_true_lang-CFS3lVF-.js.map +0 -1
  192. package/dist/AlertModal.vue_vue_type_script_setup_true_lang-C6q8Mpl4.js.map +0 -1
  193. package/dist/BackgroundGradientWrapper.vue_vue_type_script_setup_true_lang-C8msTrTn.js.map +0 -1
  194. package/dist/BarChart.vue_vue_type_script_setup_true_lang-xCb0DCbf.js.map +0 -1
  195. package/dist/Bars3Icon-BdOqcGcY.js +0 -22
  196. package/dist/Bars3Icon-BdOqcGcY.js.map +0 -1
  197. package/dist/BaseModal.vue_vue_type_script_setup_true_lang-B67Pt3tW.js.map +0 -1
  198. package/dist/CalendarHeader.vue_vue_type_script_setup_true_lang-CkSUiLOH.js.map +0 -1
  199. package/dist/CardWrapper.vue_vue_type_script_setup_true_lang-D59QBAi9.js.map +0 -1
  200. package/dist/CheckIcon-BGlsmVwT.js +0 -20
  201. package/dist/CheckIcon-BGlsmVwT.js.map +0 -1
  202. package/dist/CheckboxInput.vue_vue_type_script_setup_true_lang-BikR9rgi.js.map +0 -1
  203. package/dist/ChevronRightIcon-DkUqw988.js +0 -20
  204. package/dist/ChevronRightIcon-DkUqw988.js.map +0 -1
  205. package/dist/ChevronUpDownIcon-Bq_fsgrb.js +0 -20
  206. package/dist/ChevronUpDownIcon-Bq_fsgrb.js.map +0 -1
  207. package/dist/ComboboxInput.vue_vue_type_script_setup_true_lang-kEj-NYqm.js +0 -1362
  208. package/dist/ComboboxInput.vue_vue_type_script_setup_true_lang-kEj-NYqm.js.map +0 -1
  209. package/dist/ComingSoon.vue_vue_type_script_setup_true_lang-CJ8FXE42.js.map +0 -1
  210. package/dist/DashboardLayout.vue_vue_type_script_setup_true_lang-B0M6-9os.js.map +0 -1
  211. package/dist/DatepickerInput.vue_vue_type_style_index_0_lang-BdkGLw0H.js.map +0 -1
  212. package/dist/DayCalendar.vue_vue_type_script_setup_true_lang-8al4Fotu.js.map +0 -1
  213. package/dist/DefaultLayout.vue_vue_type_script_setup_true_lang-BZAz6aC-.js.map +0 -1
  214. package/dist/DisclosureWrapper.vue_vue_type_script_setup_true_lang-C7y2bNhW.js +0 -138
  215. package/dist/DisclosureWrapper.vue_vue_type_script_setup_true_lang-C7y2bNhW.js.map +0 -1
  216. package/dist/DynamicForm.vue_vue_type_script_setup_true_lang-CxSaO5Cl.js.map +0 -1
  217. package/dist/DynamicFormField.vue_vue_type_script_setup_true_lang-CSLSRFM7.js.map +0 -1
  218. package/dist/EmailInput.vue_vue_type_script_setup_true_lang-BicPMIop.js.map +0 -1
  219. package/dist/EmptyInput.vue_vue_type_script_setup_true_lang-FWDCFF2c.js.map +0 -1
  220. package/dist/EmptyState.vue_vue_type_script_setup_true_lang-7mcKkOWP.js.map +0 -1
  221. package/dist/EventCard.vue_vue_type_script_setup_true_lang-j1mtKShZ.js +0 -136
  222. package/dist/EventCard.vue_vue_type_script_setup_true_lang-j1mtKShZ.js.map +0 -1
  223. package/dist/EventsList.vue_vue_type_script_setup_true_lang-MhuVi5u8.js +0 -102
  224. package/dist/EventsList.vue_vue_type_script_setup_true_lang-MhuVi5u8.js.map +0 -1
  225. package/dist/ExclamationCircleIcon-DjxYk45_.js +0 -22
  226. package/dist/ExclamationCircleIcon-DjxYk45_.js.map +0 -1
  227. package/dist/ExclamationCircleIcon-DmL8Wwjo.js +0 -36
  228. package/dist/ExclamationCircleIcon-DmL8Wwjo.js.map +0 -1
  229. package/dist/ExclamationTriangleIcon-BNKYmV_J.js +0 -22
  230. package/dist/ExclamationTriangleIcon-BNKYmV_J.js.map +0 -1
  231. package/dist/FileDropzoneInput.vue_vue_type_script_setup_true_lang-CclXceTb.js +0 -211
  232. package/dist/FileDropzoneInput.vue_vue_type_script_setup_true_lang-CclXceTb.js.map +0 -1
  233. package/dist/FormErrorWrapper.vue_vue_type_script_setup_true_lang-BQOlG_ab.js.map +0 -1
  234. package/dist/FunnelChart.vue_vue_type_script_setup_true_lang-B4pH6xCV.js.map +0 -1
  235. package/dist/HeaderLayout.vue_vue_type_script_setup_true_lang-BY2G6hCc.js.map +0 -1
  236. package/dist/HiddenInput.vue_vue_type_script_setup_true_lang-PtGZ4eLW.js.map +0 -1
  237. package/dist/InformationCircleIcon-B322GNIt.js +0 -40
  238. package/dist/InformationCircleIcon-B322GNIt.js.map +0 -1
  239. package/dist/InlineTabs.vue_vue_type_script_setup_true_lang-CD0lnkUm.js.map +0 -1
  240. package/dist/LineChart.vue_vue_type_script_setup_true_lang-DJo0edLJ.js.map +0 -1
  241. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-swmHdR0_.js.map +0 -1
  242. package/dist/MapPinIcon-CSTDUZnD.js +0 -27
  243. package/dist/MapPinIcon-CSTDUZnD.js.map +0 -1
  244. package/dist/MonthCalendar.vue_vue_type_style_index_0_lang-Cyzq7A9j.js.map +0 -1
  245. package/dist/NavigationGroup.vue_vue_type_script_setup_true_lang-BWq5fpEm.js.map +0 -1
  246. package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-C8aX-84Q.js.map +0 -1
  247. package/dist/NotificationContainer.vue_vue_type_style_index_0_lang-DSfNw4Ge.js.map +0 -1
  248. package/dist/NotificationToast.vue_vue_type_script_setup_true_lang-CU__ORw8.js.map +0 -1
  249. package/dist/PieChart.vue_vue_type_script_setup_true_lang-e3wsA9O4.js.map +0 -1
  250. package/dist/PlusIcon-aDFVlB90.js +0 -40
  251. package/dist/PlusIcon-aDFVlB90.js.map +0 -1
  252. package/dist/ProfileHeaderAvatar.vue_vue_type_script_setup_true_lang-CKCoHD1o.js.map +0 -1
  253. package/dist/ProjectLogo.vue_vue_type_script_setup_true_lang-DYjp-RNh.js.map +0 -1
  254. package/dist/SelectInput.vue_vue_type_script_setup_true_lang-DHiZ-7K2.js.map +0 -1
  255. package/dist/SelectTextInput.vue_vue_type_script_setup_true_lang-DYrXW14A.js.map +0 -1
  256. package/dist/SidebarLayout.vue_vue_type_script_setup_true_lang-BJ5jadgZ.js.map +0 -1
  257. package/dist/SparklineChart.vue_vue_type_script_setup_true_lang-BlNk5ZqM.js.map +0 -1
  258. package/dist/StatCard.vue_vue_type_script_setup_true_lang-BfFupfmC.js +0 -111
  259. package/dist/StatCard.vue_vue_type_script_setup_true_lang-BfFupfmC.js.map +0 -1
  260. package/dist/StepperPanels.vue_vue_type_script_setup_true_lang-D6Fv7iz3.js.map +0 -1
  261. package/dist/SwitchInput.vue_vue_type_script_setup_true_lang-C88FcxuK.js +0 -280
  262. package/dist/SwitchInput.vue_vue_type_script_setup_true_lang-C88FcxuK.js.map +0 -1
  263. package/dist/SwitchInputGroup.vue_vue_type_script_setup_true_lang-CK9JWl4F.js.map +0 -1
  264. package/dist/TabGroup.vue_vue_type_script_setup_true_lang-DVVeOgWH.js.map +0 -1
  265. package/dist/TabGroupUnderline.vue_vue_type_script_setup_true_lang-_3XtOn3w.js.map +0 -1
  266. package/dist/TabsInPills.vue_vue_type_script_setup_true_lang-DY1NkXCQ.js.map +0 -1
  267. package/dist/TagifyInput.vue_vue_type_script_setup_true_lang-Da6-pRJ2.js.map +0 -1
  268. package/dist/TextAreaInput.vue_vue_type_script_setup_true_lang-Cf0MJobG.js.map +0 -1
  269. package/dist/UiAvatar.vue_vue_type_script_setup_true_lang-WVY6JbUL.js.map +0 -1
  270. package/dist/UiBadge.vue_vue_type_script_setup_true_lang-DOtbLb9x.js.map +0 -1
  271. package/dist/UiButtonGroup.vue_vue_type_script_setup_true_lang-CVwXB-cb.js.map +0 -1
  272. package/dist/UiCheckbox.vue_vue_type_script_setup_true_lang-BxyM_F-V.js.map +0 -1
  273. package/dist/UiLoading.vue_vue_type_script_setup_true_lang-rNvtzKbq.js.map +0 -1
  274. package/dist/UiMapAll.vue_vue_type_script_setup_true_lang-CMAyvJMk.js.map +0 -1
  275. package/dist/UiMenu.vue_vue_type_script_setup_true_lang-bQdfCzk6.js +0 -330
  276. package/dist/UiMenu.vue_vue_type_script_setup_true_lang-bQdfCzk6.js.map +0 -1
  277. package/dist/UiModal.vue_vue_type_script_setup_true_lang-CpwFUDVU.js.map +0 -1
  278. package/dist/UiNavLink.vue_vue_type_script_setup_true_lang-DnWMn40M.js.map +0 -1
  279. package/dist/UiProgressBar.vue_vue_type_script_setup_true_lang-BCh4orZW.js.map +0 -1
  280. package/dist/UiTable.vue_vue_type_script_setup_true_lang-xGAiJ9rS.js.map +0 -1
  281. package/dist/UiTransition.vue_vue_type_script_setup_true_lang-C4jb9I-3.js.map +0 -1
  282. package/dist/XMarkIcon-Cwy3T6p8.js +0 -22
  283. package/dist/XMarkIcon-Cwy3T6p8.js.map +0 -1
  284. package/dist/XMarkIcon-DNvCkiOy.js +0 -16
  285. package/dist/XMarkIcon-DNvCkiOy.js.map +0 -1
  286. package/dist/YearCalendar.vue_vue_type_script_setup_true_lang-CfKSpLLN.js.map +0 -1
  287. package/dist/_plugin-vue_export-helper-CHgC5LLL.js.map +0 -1
  288. package/dist/active-element-history-BTBNVIJN.js +0 -17
  289. package/dist/active-element-history-BTBNVIJN.js.map +0 -1
  290. package/dist/calculate-active-index-Dim3sT-5.js +0 -55
  291. package/dist/calculate-active-index-Dim3sT-5.js.map +0 -1
  292. package/dist/calendar-BlSSD4nO.js +0 -575
  293. package/dist/calendar-BlSSD4nO.js.map +0 -1
  294. package/dist/calendars/CalendarDashboard.js.map +0 -1
  295. package/dist/calendars/CalendarHeader.js.map +0 -1
  296. package/dist/calendars/DayCalendar.js.map +0 -1
  297. package/dist/calendars/EventCard.js.map +0 -1
  298. package/dist/calendars/EventsList.js.map +0 -1
  299. package/dist/calendars/MonthCalendar.js.map +0 -1
  300. package/dist/calendars/WeekCalendar.js.map +0 -1
  301. package/dist/calendars/YearCalendar.js.map +0 -1
  302. package/dist/charts/BarChart.js.map +0 -1
  303. package/dist/charts/BaseChart.js.map +0 -1
  304. package/dist/charts/FunnelChart.js.map +0 -1
  305. package/dist/charts/LineChart.js.map +0 -1
  306. package/dist/charts/PieChart.js.map +0 -1
  307. package/dist/charts/SparklineChart.js.map +0 -1
  308. package/dist/charts/StatCard.js.map +0 -1
  309. package/dist/charts/chartTheme.js.map +0 -1
  310. package/dist/charts/index.js.map +0 -1
  311. package/dist/components/Avatar.js.map +0 -1
  312. package/dist/components/Badge.js.map +0 -1
  313. package/dist/components/Banner.js.map +0 -1
  314. package/dist/components/Breadcrumb.js.map +0 -1
  315. package/dist/components/Button.js.map +0 -1
  316. package/dist/components/ButtonGroup.js.map +0 -1
  317. package/dist/components/Checkbox.js.map +0 -1
  318. package/dist/components/CloudinaryImage.js.map +0 -1
  319. package/dist/components/Loading.js.map +0 -1
  320. package/dist/components/LoadingDots.js.map +0 -1
  321. package/dist/components/LottieAnimation.js.map +0 -1
  322. package/dist/components/Menu.js.map +0 -1
  323. package/dist/components/Modal.js.map +0 -1
  324. package/dist/components/NavLink.js.map +0 -1
  325. package/dist/components/ProgressBar.js.map +0 -1
  326. package/dist/components/RadialProgressBar.js.map +0 -1
  327. package/dist/components/Table.js.map +0 -1
  328. package/dist/components/Transition.js.map +0 -1
  329. package/dist/composables/index.js.map +0 -1
  330. package/dist/composables/useCalendar.js.map +0 -1
  331. package/dist/composables/useFormValidation.js.map +0 -1
  332. package/dist/composables/useMap.js.map +0 -1
  333. package/dist/composables/useModal.js.map +0 -1
  334. package/dist/composables/useNotifications.js.map +0 -1
  335. package/dist/composables/useTabs.js.map +0 -1
  336. package/dist/composables/useTheme.js.map +0 -1
  337. package/dist/description-C7cRw0tq.js +0 -30
  338. package/dist/description-C7cRw0tq.js.map +0 -1
  339. package/dist/dialog-BJ2Ld8l3.js +0 -499
  340. package/dist/dialog-BJ2Ld8l3.js.map +0 -1
  341. package/dist/empty-state/ComingSoon.js.map +0 -1
  342. package/dist/empty-state/EmptyState.js.map +0 -1
  343. package/dist/empty-state/index.js.map +0 -1
  344. package/dist/env-BZfPsfnF.js +0 -29
  345. package/dist/env-BZfPsfnF.js.map +0 -1
  346. package/dist/form-f8yP4kN-.js +0 -35
  347. package/dist/form-f8yP4kN-.js.map +0 -1
  348. package/dist/forms/DynamicForm.js.map +0 -1
  349. package/dist/forms/DynamicFormField.js.map +0 -1
  350. package/dist/forms/FormFieldWrapper.js.map +0 -1
  351. package/dist/hidden-BSRluD1y.js +0 -15
  352. package/dist/hidden-BSRluD1y.js.map +0 -1
  353. package/dist/id-DafBB_QF.js.map +0 -1
  354. package/dist/index-Dca39bYA.js +0 -2167
  355. package/dist/index-Dca39bYA.js.map +0 -1
  356. package/dist/index.js.map +0 -1
  357. package/dist/inputs/AddDeleteButtonGroup.js.map +0 -1
  358. package/dist/inputs/CheckboxInput.js.map +0 -1
  359. package/dist/inputs/ComboboxInput.js.map +0 -1
  360. package/dist/inputs/DatepickerInput.js.map +0 -1
  361. package/dist/inputs/EmailInput.js.map +0 -1
  362. package/dist/inputs/EmptyInput.js.map +0 -1
  363. package/dist/inputs/FileDropzoneInput.js.map +0 -1
  364. package/dist/inputs/HiddenInput.js.map +0 -1
  365. package/dist/inputs/PhoneInput.js.map +0 -1
  366. package/dist/inputs/RichTextInput.js.map +0 -1
  367. package/dist/inputs/SelectInput.js.map +0 -1
  368. package/dist/inputs/SelectTextInput.js.map +0 -1
  369. package/dist/inputs/SwitchInput.js.map +0 -1
  370. package/dist/inputs/SwitchInputGroup.js.map +0 -1
  371. package/dist/inputs/TagifyInput.js.map +0 -1
  372. package/dist/inputs/TextAreaInput.js.map +0 -1
  373. package/dist/inputs/TextInput.js.map +0 -1
  374. package/dist/keyboard-Dd_2-cFu.js +0 -5
  375. package/dist/keyboard-Dd_2-cFu.js.map +0 -1
  376. package/dist/layouts/DashboardLayout.js.map +0 -1
  377. package/dist/layouts/DefaultLayout.js.map +0 -1
  378. package/dist/layouts/HeaderLayout.js.map +0 -1
  379. package/dist/layouts/NavigationGroup.js.map +0 -1
  380. package/dist/layouts/NavigationItem.js.map +0 -1
  381. package/dist/layouts/ProfileHeaderAvatar.js.map +0 -1
  382. package/dist/layouts/ProjectLogo.js.map +0 -1
  383. package/dist/layouts/SidebarLayout.js.map +0 -1
  384. package/dist/listbox-YaWWZiiG.js +0 -257
  385. package/dist/listbox-YaWWZiiG.js.map +0 -1
  386. package/dist/loading/ContentSkeleton.js.map +0 -1
  387. package/dist/loading/SmartLoadingIndicator.js.map +0 -1
  388. package/dist/loading/index.js.map +0 -1
  389. package/dist/mapThemes-DFE9fZm3.js.map +0 -1
  390. package/dist/maps/GoogleMap.js.map +0 -1
  391. package/dist/maps/UiInfoWindow.js.map +0 -1
  392. package/dist/maps/UiMap.js.map +0 -1
  393. package/dist/maps/UiMapAll.js.map +0 -1
  394. package/dist/maps/UiMapMarker.js.map +0 -1
  395. package/dist/maps/index.js.map +0 -1
  396. package/dist/micro-task-D-oTY33s.js +0 -9
  397. package/dist/micro-task-D-oTY33s.js.map +0 -1
  398. package/dist/modals/AlertModal.js.map +0 -1
  399. package/dist/modals/BaseModal.js.map +0 -1
  400. package/dist/modals/ImageCropperModal.js.map +0 -1
  401. package/dist/notifications/NotificationContainer.js.map +0 -1
  402. package/dist/notifications/NotificationToast.js.map +0 -1
  403. package/dist/notifications/index.js.map +0 -1
  404. package/dist/open-closed-JTEvYTg2.js +0 -19
  405. package/dist/open-closed-JTEvYTg2.js.map +0 -1
  406. package/dist/render-QUUPyNjX.js +0 -101
  407. package/dist/render-QUUPyNjX.js.map +0 -1
  408. package/dist/stepper/StepperPanels.js.map +0 -1
  409. package/dist/stepper/index.js.map +0 -1
  410. package/dist/tabs/InlineTabs.js.map +0 -1
  411. package/dist/tabs/TabGroup.js.map +0 -1
  412. package/dist/tabs/TabGroupUnderline.js.map +0 -1
  413. package/dist/tabs/TabsInPills.js.map +0 -1
  414. package/dist/tabs/index.js.map +0 -1
  415. package/dist/tabs-J5phClGv.js +0 -202
  416. package/dist/tabs-J5phClGv.js.map +0 -1
  417. package/dist/transition-_rPfnoET.js +0 -191
  418. package/dist/transition-_rPfnoET.js.map +0 -1
  419. package/dist/use-outside-click-14T0Zn98.js +0 -151
  420. package/dist/use-outside-click-14T0Zn98.js.map +0 -1
  421. package/dist/use-resolve-button-type-h6n-lm9q.js +0 -20
  422. package/dist/use-resolve-button-type-h6n-lm9q.js.map +0 -1
  423. package/dist/use-text-value-DKnkjK00.js +0 -44
  424. package/dist/use-text-value-DKnkjK00.js.map +0 -1
  425. package/dist/use-tree-walker-Bo9gIb_K.js +0 -16
  426. package/dist/use-tree-walker-Bo9gIb_K.js.map +0 -1
  427. package/dist/useEventSegments-B-r_8zCW.js.map +0 -1
  428. package/dist/useMap-BaZEIoWM.js +0 -525
  429. package/dist/useMap-BaZEIoWM.js.map +0 -1
  430. package/dist/useSimpleTabs-CSgkChEU.js.map +0 -1
  431. package/dist/useStringTransform-CSr7nZWg.js.map +0 -1
  432. package/dist/vue-datepicker-CEn0-fJj.js +0 -4871
  433. package/dist/vue-datepicker-CEn0-fJj.js.map +0 -1
  434. package/dist/vue-router-B3K2xmg_.js +0 -120
  435. package/dist/vue-router-B3K2xmg_.js.map +0 -1
  436. package/dist/vue3-lottie.es-DT4qZE-F.js +0 -7981
  437. package/dist/vue3-lottie.es-DT4qZE-F.js.map +0 -1
  438. package/dist/wrappers/BackgroundGradientWrapper.js.map +0 -1
  439. package/dist/wrappers/CardWrapper.js.map +0 -1
  440. package/dist/wrappers/DisclosureWrapper.js.map +0 -1
  441. package/dist/wrappers/FormErrorWrapper.js.map +0 -1
  442. package/dist/wrappers/index.js.map +0 -1
@@ -1,1545 +1,10 @@
1
- import { createElementBlock as Z, openBlock as y, createElementVNode as z, createBlock as x, renderSlot as q, resolveComponent as D, createVNode as f, withCtx as A, Fragment as $t, renderList as Pt, resolveDynamicComponent as lt, withDirectives as te, vShow as ee, mergeProps as ie, createCommentVNode as Bt, withModifiers as ye, defineComponent as ze, shallowRef as xe, ref as It, computed as ft, unref as S, createTextVNode as pt, toDisplayString as _t } from "vue";
2
- import Yt from "../components/Button.js";
3
- import { r as Re } from "../XMarkIcon-Cwy3T6p8.js";
4
- import { a as Ae, r as Me } from "../PlusIcon-aDFVlB90.js";
5
- import { S as Se, h as Xt } from "../transition-_rPfnoET.js";
6
- import { Y as Ce, G as Ee, V as Te } from "../dialog-BJ2Ld8l3.js";
7
- import { _ as We } from "../_plugin-vue_export-helper-CHgC5LLL.js";
8
- function ke(t, e) {
9
- return y(), Z("svg", {
10
- xmlns: "http://www.w3.org/2000/svg",
11
- fill: "none",
12
- viewBox: "0 0 24 24",
13
- "stroke-width": "1.5",
14
- stroke: "currentColor",
15
- "aria-hidden": "true",
16
- "data-slot": "icon"
17
- }, [
18
- z("path", {
19
- "stroke-linecap": "round",
20
- "stroke-linejoin": "round",
21
- d: "M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"
22
- })
23
- ]);
24
- }
25
- function Oe(t, e) {
26
- return y(), Z("svg", {
27
- xmlns: "http://www.w3.org/2000/svg",
28
- fill: "none",
29
- viewBox: "0 0 24 24",
30
- "stroke-width": "1.5",
31
- stroke: "currentColor",
32
- "aria-hidden": "true",
33
- "data-slot": "icon"
34
- }, [
35
- z("path", {
36
- "stroke-linecap": "round",
37
- "stroke-linejoin": "round",
38
- d: "M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3"
39
- })
40
- ]);
41
- }
42
- function je(t, e) {
43
- return y(), Z("svg", {
44
- xmlns: "http://www.w3.org/2000/svg",
45
- fill: "none",
46
- viewBox: "0 0 24 24",
47
- "stroke-width": "1.5",
48
- stroke: "currentColor",
49
- "aria-hidden": "true",
50
- "data-slot": "icon"
51
- }, [
52
- z("path", {
53
- "stroke-linecap": "round",
54
- "stroke-linejoin": "round",
55
- d: "m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3"
56
- })
57
- ]);
58
- }
59
- function De(t, e) {
60
- return y(), Z("svg", {
61
- xmlns: "http://www.w3.org/2000/svg",
62
- fill: "none",
63
- viewBox: "0 0 24 24",
64
- "stroke-width": "1.5",
65
- stroke: "currentColor",
66
- "aria-hidden": "true",
67
- "data-slot": "icon"
68
- }, [
69
- z("path", {
70
- "stroke-linecap": "round",
71
- "stroke-linejoin": "round",
72
- d: "M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"
73
- })
74
- ]);
75
- }
76
- function He(t, e) {
77
- return y(), Z("svg", {
78
- xmlns: "http://www.w3.org/2000/svg",
79
- fill: "none",
80
- viewBox: "0 0 24 24",
81
- "stroke-width": "1.5",
82
- stroke: "currentColor",
83
- "aria-hidden": "true",
84
- "data-slot": "icon"
85
- }, [
86
- z("path", {
87
- "stroke-linecap": "round",
88
- "stroke-linejoin": "round",
89
- d: "M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"
90
- })
91
- ]);
92
- }
93
- function Le(t, e) {
94
- return y(), Z("svg", {
95
- xmlns: "http://www.w3.org/2000/svg",
96
- fill: "none",
97
- viewBox: "0 0 24 24",
98
- "stroke-width": "1.5",
99
- stroke: "currentColor",
100
- "aria-hidden": "true",
101
- "data-slot": "icon"
102
- }, [
103
- z("path", {
104
- "stroke-linecap": "round",
105
- "stroke-linejoin": "round",
106
- d: "m4.5 12.75 6 6 9-13.5"
107
- })
108
- ]);
109
- }
110
- function $e(t, e) {
111
- return y(), Z("svg", {
112
- xmlns: "http://www.w3.org/2000/svg",
113
- fill: "none",
114
- viewBox: "0 0 24 24",
115
- "stroke-width": "1.5",
116
- stroke: "currentColor",
117
- "aria-hidden": "true",
118
- "data-slot": "icon"
119
- }, [
120
- z("path", {
121
- "stroke-linecap": "round",
122
- "stroke-linejoin": "round",
123
- d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
124
- })
125
- ]);
126
- }
127
- function Ft(t, e) {
128
- var i = Object.keys(t);
129
- if (Object.getOwnPropertySymbols) {
130
- var s = Object.getOwnPropertySymbols(t);
131
- e && (s = s.filter((function(o) {
132
- return Object.getOwnPropertyDescriptor(t, o).enumerable;
133
- }))), i.push.apply(i, s);
134
- }
135
- return i;
136
- }
137
- function b(t) {
138
- for (var e = 1; e < arguments.length; e++) {
139
- var i = arguments[e] != null ? arguments[e] : {};
140
- e % 2 ? Ft(Object(i), !0).forEach((function(s) {
141
- j(t, s, i[s]);
142
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : Ft(Object(i)).forEach((function(s) {
143
- Object.defineProperty(t, s, Object.getOwnPropertyDescriptor(i, s));
144
- }));
145
- }
146
- return t;
147
- }
148
- function j(t, e, i) {
149
- return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
150
- }
151
- function Pe(t, e) {
152
- if (t == null) return {};
153
- var i, s, o = (function(a, h) {
154
- if (a == null) return {};
155
- var r, l, c = {}, u = Object.keys(a);
156
- for (l = 0; l < u.length; l++) r = u[l], h.indexOf(r) >= 0 || (c[r] = a[r]);
157
- return c;
158
- })(t, e);
159
- if (Object.getOwnPropertySymbols) {
160
- var n = Object.getOwnPropertySymbols(t);
161
- for (s = 0; s < n.length; s++) i = n[s], e.indexOf(i) >= 0 || Object.prototype.propertyIsEnumerable.call(t, i) && (o[i] = t[i]);
162
- }
163
- return o;
164
- }
165
- function V(t) {
166
- return (function(e) {
167
- if (Array.isArray(e)) return vt(e);
168
- })(t) || (function(e) {
169
- if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
170
- })(t) || (function(e, i) {
171
- if (e) {
172
- if (typeof e == "string") return vt(e, i);
173
- var s = Object.prototype.toString.call(e).slice(8, -1);
174
- if (s === "Object" && e.constructor && (s = e.constructor.name), s === "Map" || s === "Set") return Array.from(e);
175
- if (s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)) return vt(e, i);
176
- }
177
- })(t) || (function() {
178
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
179
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
180
- })();
181
- }
182
- function vt(t, e) {
183
- (e == null || e > t.length) && (e = t.length);
184
- for (var i = 0, s = new Array(e); i < e; i++) s[i] = t[i];
185
- return s;
186
- }
187
- var Ut, Be, nt, R = (Ut = function(t) {
188
- /*!
189
- Copyright (c) 2018 Jed Watson.
190
- Licensed under the MIT License (MIT), see
191
- http://jedwatson.github.io/classnames
192
- */
193
- (function() {
194
- var e = {}.hasOwnProperty;
195
- function i() {
196
- for (var s = [], o = 0; o < arguments.length; o++) {
197
- var n = arguments[o];
198
- if (n) {
199
- var a = typeof n;
200
- if (a === "string" || a === "number") s.push(n);
201
- else if (Array.isArray(n)) {
202
- if (n.length) {
203
- var h = i.apply(null, n);
204
- h && s.push(h);
205
- }
206
- } else if (a === "object") if (n.toString === Object.prototype.toString) for (var r in n) e.call(n, r) && n[r] && s.push(r);
207
- else s.push(n.toString());
208
- }
209
- }
210
- return s.join(" ");
211
- }
212
- t.exports ? (i.default = i, t.exports = i) : window.classNames = i;
213
- })();
214
- }, Ut(nt = { path: Be, exports: {}, require: function(t, e) {
215
- return (function() {
216
- throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
217
- })(e == null && nt.path);
218
- } }, nt.exports), nt.exports), L = function(t) {
219
- return function(e, i) {
220
- if (!e) return t;
221
- var s;
222
- typeof e == "string" ? s = e : i = e;
223
- var o = t;
224
- return s && (o += "__" + s), o + (i ? Object.keys(i).reduce((function(n, a) {
225
- var h = i[a];
226
- return h && (n += " " + (typeof h == "boolean" ? o + "--" + a : o + "--" + a + "_" + h)), n;
227
- }), "") : "");
228
- };
229
- };
230
- function At(t, e, i) {
231
- var s, o, n, a, h;
232
- function r() {
233
- var c = Date.now() - a;
234
- c < e && c >= 0 ? s = setTimeout(r, e - c) : (s = null, i || (h = t.apply(n, o), n = o = null));
235
- }
236
- e == null && (e = 100);
237
- var l = function() {
238
- n = this, o = arguments, a = Date.now();
239
- var c = i && !s;
240
- return s || (s = setTimeout(r, e)), c && (h = t.apply(n, o), n = o = null), h;
241
- };
242
- return l.clear = function() {
243
- s && (clearTimeout(s), s = null);
244
- }, l.flush = function() {
245
- s && (h = t.apply(n, o), n = o = null, clearTimeout(s), s = null);
246
- }, l;
247
- }
248
- At.debounce = At;
249
- var Mt = At, g = function() {
250
- return g = Object.assign || function(t) {
251
- for (var e, i = 1, s = arguments.length; i < s; i++) for (var o in e = arguments[i]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
252
- return t;
253
- }, g.apply(this, arguments);
254
- };
255
- /*! *****************************************************************************
256
- Copyright (c) Microsoft Corporation.
257
-
258
- Permission to use, copy, modify, and/or distribute this software for any
259
- purpose with or without fee is hereby granted.
260
-
261
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
262
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
263
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
264
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
265
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
266
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
267
- PERFORMANCE OF THIS SOFTWARE.
268
- ***************************************************************************** */
269
- function ne(t, e) {
270
- var i, s;
271
- return t && e ? (i = "" + t + e[0].toUpperCase() + e.slice(1), s = t + "-" + e) : (i = t || e, s = t || e), { name: i, classname: s };
272
- }
273
- function se(t) {
274
- return /^blob:/.test(t);
275
- }
276
- function Nt(t) {
277
- return se(t) || (function(e) {
278
- return /^data:/.test(e);
279
- })(t);
280
- }
281
- function G(t) {
282
- return !!(t && t.constructor && t.call && t.apply);
283
- }
284
- function M(t) {
285
- return t === void 0;
286
- }
287
- function ht(t) {
288
- return typeof t == "object" && t !== null;
289
- }
290
- function St(t, e, i) {
291
- var s = {};
292
- return ht(t) ? (Object.keys(e).forEach((function(o) {
293
- M(t[o]) ? s[o] = e[o] : ht(e[o]) ? ht(t[o]) ? s[o] = St(t[o], e[o], i[o]) : s[o] = t[o] ? e[o] : i[o] : e[o] === !0 || e[o] === !1 ? s[o] = !!t[o] : s[o] = t[o];
294
- })), s) : t ? e : i;
295
- }
296
- function st(t) {
297
- var e = Number(t);
298
- return Number.isNaN(e) ? t : e;
299
- }
300
- function Vt(t) {
301
- return typeof (t == "number" || /* @__PURE__ */ (function(e) {
302
- return typeof e == "object" && e !== null;
303
- })(t) && toString.call(t) == "[object Number]") && !oe(t);
304
- }
305
- function oe(t) {
306
- return t != t;
307
- }
308
- function re(t, e) {
309
- return Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2));
310
- }
311
- var tt = function(t, e) {
312
- t === void 0 && (t = {}), e === void 0 && (e = {}), this.type = "manipulateImage", this.move = t, this.scale = e;
313
- }, Ie = function(t, e) {
314
- e === void 0 && (e = {}), this.type = "resize", this.directions = t, this.params = e;
315
- }, Wt = function(t) {
316
- this.type = "move", this.directions = t;
317
- }, _e = (function() {
318
- function t(e, i, s, o, n) {
319
- this.type = "drag", this.nativeEvent = e, this.position = s, this.previousPosition = o, this.element = i, this.anchor = n;
320
- }
321
- return t.prototype.shift = function() {
322
- var e = this, i = e.element, s = e.anchor, o = e.position;
323
- if (i) {
324
- var n = i.getBoundingClientRect(), a = n.left, h = n.top;
325
- return { left: o.left - a - s.left, top: o.top - h - s.top };
326
- }
327
- return { left: 0, top: 0 };
328
- }, t;
329
- })(), kt = { name: "DraggableElement", props: { classname: { type: String } }, beforeMount: function() {
330
- window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
331
- }, beforeUnmount: function() {
332
- window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
333
- }, mounted: function() {
334
- if (!this.$refs.draggable) throw new Error('You should add ref "draggable" to your root element to use draggable mixin');
335
- this.touches = [], this.hovered = !1;
336
- }, methods: { onMouseOver: function() {
337
- this.hovered || (this.hovered = !0, this.$emit("enter"));
338
- }, onMouseLeave: function() {
339
- this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
340
- }, onTouchStart: function(t) {
341
- t.cancelable && !this.disabled && t.touches.length === 1 && (this.touches = V(t.touches), this.hovered || (this.$emit("enter"), this.hovered = !0), t.touches.length && this.initAnchor(this.touches.reduce((function(e, i) {
342
- return { clientX: e.clientX + i.clientX / t.touches.length, clientY: e.clientY + i.clientY / t.touches.length };
343
- }), { clientX: 0, clientY: 0 })), t.preventDefault && t.preventDefault(), t.stopPropagation());
344
- }, onTouchEnd: function() {
345
- this.processEnd();
346
- }, onTouchMove: function(t) {
347
- this.touches.length && (this.processMove(t, t.touches), t.preventDefault && t.preventDefault(), t.stopPropagation && t.stopPropagation());
348
- }, onMouseDown: function(t) {
349
- if (!this.disabled) {
350
- var e = { fake: !0, clientX: t.clientX, clientY: t.clientY };
351
- this.touches = [e], this.initAnchor(e), t.stopPropagation();
352
- }
353
- }, onMouseMove: function(t) {
354
- this.touches.length && (this.processMove(t, [{ fake: !0, clientX: t.clientX, clientY: t.clientY }]), t.preventDefault && t.preventDefault());
355
- }, onMouseUp: function() {
356
- this.processEnd();
357
- }, initAnchor: function(t) {
358
- var e = this.$refs.draggable.getBoundingClientRect(), i = e.left, s = e.right, o = e.bottom, n = e.top;
359
- this.anchor = { left: t.clientX - i, top: t.clientY - n, bottom: o - t.clientY, right: s - t.clientX };
360
- }, processMove: function(t, e) {
361
- var i = V(e);
362
- if (this.touches.length) {
363
- if (this.touches.length === 1 && i.length === 1) {
364
- var s = this.$refs.draggable;
365
- this.$emit("drag", new _e(t, s, { left: i[0].clientX, top: i[0].clientY }, { left: this.touches[0].clientX, top: this.touches[0].clientY }, this.anchor));
366
- }
367
- this.touches = i;
368
- }
369
- }, processEnd: function() {
370
- this.touches.length && this.$emit("drag-end"), this.hovered && (this.$emit("leave"), this.hovered = !1), this.touches = [];
371
- } }, emits: ["drag", "drag-end", "leave", "enter"] };
372
- kt.render = function(t, e, i, s, o, n) {
373
- return y(), x("div", { ref: "draggable", class: i.classname, onTouchstart: e[1] || (e[1] = function() {
374
- return n.onTouchStart && n.onTouchStart.apply(n, arguments);
375
- }), onMousedown: e[2] || (e[2] = function() {
376
- return n.onMouseDown && n.onMouseDown.apply(n, arguments);
377
- }), onMouseover: e[3] || (e[3] = function() {
378
- return n.onMouseOver && n.onMouseOver.apply(n, arguments);
379
- }), onMouseleave: e[4] || (e[4] = function() {
380
- return n.onMouseLeave && n.onMouseLeave.apply(n, arguments);
381
- }) }, [q(t.$slots, "default")], 34);
382
- };
383
- var bt = L("vue-handler-wrapper"), ae = { name: "HandlerWrapper", components: { DraggableElement: kt }, props: { horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, computed: { classes: function() {
384
- var t;
385
- if (this.horizontalPosition || this.verticalPosition) {
386
- var e, i = ne(this.horizontalPosition, this.verticalPosition);
387
- t = bt((j(e = {}, i.classname, !0), j(e, "disabled", this.disabled), e));
388
- } else t = bt({ disabled: this.disabled });
389
- return { root: t, draggable: bt("draggable") };
390
- } }, emits: ["leave", "enter", "drag", "drag-end"] };
391
- ae.render = function(t, e, i, s, o, n) {
392
- var a = D("DraggableElement");
393
- return y(), x("div", { class: n.classes.root }, [f(a, { class: n.classes.draggable, onDrag: e[1] || (e[1] = function(h) {
394
- return t.$emit("drag", h);
395
- }), onDragEnd: e[2] || (e[2] = function(h) {
396
- return t.$emit("drag-end");
397
- }), onLeave: e[3] || (e[3] = function(h) {
398
- return t.$emit("leave");
399
- }), onEnter: e[4] || (e[4] = function(h) {
400
- return t.$emit("enter");
401
- }) }, { default: A((function() {
402
- return [q(t.$slots, "default")];
403
- })), _: 3 }, 8, ["class"])], 2);
404
- };
405
- var Ye = L("vue-line-wrapper"), he = { name: "LineWrapper", components: { DraggableElement: kt }, props: { position: { type: String, required: !0 }, disabled: { type: Boolean, default: !1 } }, computed: { classname: function() {
406
- var t;
407
- return Ye((j(t = {}, this.position, !0), j(t, "disabled", this.disabled), t));
408
- } }, emits: ["leave", "enter", "drag", "drag-end"] };
409
- he.render = function(t, e, i, s, o, n) {
410
- var a = D("DraggableElement");
411
- return y(), x(a, { class: n.classname, onDrag: e[1] || (e[1] = function(h) {
412
- return t.$emit("drag", h);
413
- }), onDragEnd: e[2] || (e[2] = function(h) {
414
- return t.$emit("drag-end");
415
- }), onLeave: e[3] || (e[3] = function(h) {
416
- return t.$emit("leave");
417
- }), onEnter: e[4] || (e[4] = function(h) {
418
- return t.$emit("enter");
419
- }) }, { default: A((function() {
420
- return [q(t.$slots, "default")];
421
- })), _: 3 }, 8, ["class"]);
422
- };
423
- var B = ["left", "right", "top", "bottom"], Xe = ["left", "right"], Fe = ["top", "bottom"], Ue = ["left", "top"], Ne = ["fill-area", "fit-area", "stencil", "none"], Zt = { left: 0, top: 0, width: 0, height: 0 };
424
- function qt(t, e, i) {
425
- return !(i = i || ["width", "height", "left", "top"]).some((function(s) {
426
- return t[s] !== e[s];
427
- }));
428
- }
429
- function I(t) {
430
- return { left: t.left, top: t.top, right: t.left + t.width, bottom: t.top + t.height };
431
- }
432
- function Q(t, e) {
433
- return { left: t.left - e.left, top: t.top - e.top };
434
- }
435
- function C(t) {
436
- return { left: t.left + t.width / 2, top: t.top + t.height / 2 };
437
- }
438
- function et(t, e) {
439
- var i = { left: 0, top: 0, right: 0, bottom: 0 };
440
- return B.forEach((function(s) {
441
- var o = e[s], n = I(t)[s];
442
- i[s] = o !== void 0 && n !== void 0 ? s === "left" || s === "top" ? Math.max(0, o - n) : Math.max(0, n - o) : 0;
443
- })), i;
444
- }
445
- function P(t, e) {
446
- return { left: t.left - e.left, top: t.top - e.top, width: t.width + e.left + e.right, height: t.height + e.top + e.bottom };
447
- }
448
- function ct(t) {
449
- return { left: -t.left, top: -t.top };
450
- }
451
- function W(t, e) {
452
- return g(g({}, t), { left: t.left + e.left, top: t.top + e.top });
453
- }
454
- function H(t, e, i, s) {
455
- if (e !== 1) {
456
- if (i) {
457
- var o = C(t);
458
- return { width: t.width * e, height: t.height * e, left: t.left + t.width * (1 - e) / 2 + (i.left - o.left) * (1 - e), top: t.top + t.height * (1 - e) / 2 + (i.top - o.top) * (1 - e) };
459
- }
460
- return { width: t.width * e, height: t.height * e, left: t.left + t.width * (1 - e) / 2, top: t.top + t.height * (1 - e) / 2 };
461
- }
462
- return t;
463
- }
464
- function w(t) {
465
- return t.width / t.height;
466
- }
467
- function K(t, e) {
468
- return Math.min(e.right !== void 0 && e.left !== void 0 ? (e.right - e.left) / t.width : 1 / 0, e.bottom !== void 0 && e.top !== void 0 ? (e.bottom - e.top) / t.height : 1 / 0);
469
- }
470
- function J(t, e) {
471
- var i = { left: 0, top: 0 }, s = et(t, e);
472
- return s.left && s.left > 0 ? i.left = s.left : s.right && s.right > 0 && (i.left = -s.right), s.top && s.top > 0 ? i.top = s.top : s.bottom && s.bottom > 0 && (i.top = -s.bottom), i;
473
- }
474
- function wt(t, e) {
475
- var i;
476
- return e.minimum && t < e.minimum ? i = e.minimum : e.maximum && t > e.maximum && (i = e.maximum), i;
477
- }
478
- function le(t, e) {
479
- var i = w(t), s = w(e);
480
- return e.width < 1 / 0 && e.height < 1 / 0 ? i > s ? { width: e.width, height: e.width / i } : { width: e.height * i, height: e.height } : e.width < 1 / 0 ? { width: e.width, height: e.width / i } : e.height < 1 / 0 ? { width: e.height * i, height: e.height } : t;
481
- }
482
- function ce(t, e) {
483
- var i = e * Math.PI / 180;
484
- return { width: Math.abs(t.width * Math.cos(i)) + Math.abs(t.height * Math.sin(i)), height: Math.abs(t.width * Math.sin(i)) + Math.abs(t.height * Math.cos(i)) };
485
- }
486
- function F(t, e) {
487
- var i = e * Math.PI / 180;
488
- return { left: t.left * Math.cos(i) - t.top * Math.sin(i), top: t.left * Math.sin(i) + t.top * Math.cos(i) };
489
- }
490
- function ut(t, e) {
491
- var i = et(E(t, e), e);
492
- return i.left + i.right + i.top + i.bottom ? i.left + i.right > i.top + i.bottom ? Math.min((t.width + i.left + i.right) / t.width, K(t, e)) : Math.min((t.height + i.top + i.bottom) / t.height, K(t, e)) : 1;
493
- }
494
- function E(t, e, i) {
495
- i === void 0 && (i = !1);
496
- var s = J(t, e);
497
- return W(t, i ? ct(s) : s);
498
- }
499
- function Ct(t) {
500
- return { width: t.right !== void 0 && t.left !== void 0 ? t.right - t.left : 1 / 0, height: t.bottom !== void 0 && t.top !== void 0 ? t.bottom - t.top : 1 / 0 };
501
- }
502
- function Ve(t, e) {
503
- return g(g({}, t), { minWidth: Math.min(e.width, t.minWidth), minHeight: Math.min(e.height, t.minHeight), maxWidth: Math.min(e.width, t.maxWidth), maxHeight: Math.min(e.height, t.maxHeight) });
504
- }
505
- function ue(t, e, i) {
506
- i === void 0 && (i = !0);
507
- var s = {};
508
- return B.forEach((function(o) {
509
- var n = t[o], a = e[o];
510
- n !== void 0 && a !== void 0 ? s[o] = o === "left" || o === "top" ? i ? Math.max(n, a) : Math.min(n, a) : i ? Math.min(n, a) : Math.max(n, a) : a !== void 0 ? s[o] = a : n !== void 0 && (s[o] = n);
511
- })), s;
512
- }
513
- function dt(t, e) {
514
- return ue(t, e, !0);
515
- }
516
- function Gt(t) {
517
- var e = t.size, i = t.aspectRatio, s = t.ignoreMinimum, o = t.sizeRestrictions;
518
- return !!((e.correctRatio || w(e) >= i.minimum && w(e) <= i.maximum) && e.height <= o.maxHeight && e.width <= o.maxWidth && e.width && e.height && (s || e.height >= o.minHeight && e.width >= o.minWidth));
519
- }
520
- function Qt(t, e) {
521
- return Math.pow(t.width - e.width, 2) + Math.pow(t.height - e.height, 2);
522
- }
523
- function Y(t) {
524
- var e = t.width, i = t.height, s = t.sizeRestrictions, o = { minimum: t.aspectRatio && t.aspectRatio.minimum || 0, maximum: t.aspectRatio && t.aspectRatio.maximum || 1 / 0 }, n = { width: Math.max(s.minWidth, Math.min(s.maxWidth, e)), height: Math.max(s.minHeight, Math.min(s.maxHeight, i)) };
525
- function a(l, c) {
526
- return c === void 0 && (c = !1), l.reduce((function(u, d) {
527
- return Gt({ size: d, aspectRatio: o, sizeRestrictions: s, ignoreMinimum: c }) && (!u || Qt(d, { width: e, height: i }) < Qt(u, { width: e, height: i })) ? d : u;
528
- }), null);
529
- }
530
- var h = [];
531
- o && [o.minimum, o.maximum].forEach((function(l) {
532
- l && h.push({ width: n.width, height: n.width / l, correctRatio: !0 }, { width: n.height * l, height: n.height, correctRatio: !0 });
533
- })), Gt({ size: n, aspectRatio: o, sizeRestrictions: s }) && h.push(n);
534
- var r = a(h) || a(h, !0);
535
- return r && { width: r.width, height: r.height };
536
- }
537
- function Et(t) {
538
- var e = t.event, i = t.coordinates, s = t.positionRestrictions, o = s === void 0 ? {} : s, n = W(i, e.directions);
539
- return W(n, J(n, o));
540
- }
541
- function Ze(t) {
542
- var e = t.coordinates, i = t.transform, s = t.imageSize, o = t.sizeRestrictions, n = t.positionRestrictions, a = t.aspectRatio, h = t.visibleArea, r = function(c, u) {
543
- return Et({ coordinates: c, positionRestrictions: n, event: new Wt({ left: u.left - c.left, top: u.top - c.top }) });
544
- }, l = g({}, e);
545
- return (Array.isArray(i) ? i : [i]).forEach((function(c) {
546
- var u = {};
547
- M((u = typeof c == "function" ? c({ coordinates: l, imageSize: s, visibleArea: h }) : c).width) && M(u.height) || (l = (function(d, m) {
548
- var p = g(g(g({}, d), Y({ width: m.width, height: m.height, sizeRestrictions: o, aspectRatio: a })), { left: 0, top: 0 });
549
- return r(p, { left: d.left, top: d.top });
550
- })(l, g(g({}, l), u))), M(u.left) && M(u.top) || (l = r(l, g(g({}, l), u)));
551
- })), l;
552
- }
553
- function qe(t) {
554
- t.event;
555
- var e = t.getAreaRestrictions, i = t.boundaries, s = t.coordinates, o = t.visibleArea;
556
- t.aspectRatio;
557
- var n = t.stencilSize, a = t.sizeRestrictions, h = t.positionRestrictions;
558
- t.stencilReference;
559
- var r, l, c, u = g({}, s), d = g({}, o), m = g({}, n);
560
- r = w(m), l = w(u), c === void 0 && (c = 1e-3), (r === 0 || l === 0 ? Math.abs(l - r) < c : Math.abs(l / r) < 1 + c && Math.abs(l / r) > 1 - c) || (u = g(g({}, u), Y({ sizeRestrictions: a, width: u.width, height: u.height, aspectRatio: { minimum: w(m), maximum: w(m) } })));
561
- var p = ut(d = H(d, u.width * i.width / (d.width * m.width)), e({ visibleArea: d, type: "resize" }));
562
- return p !== 1 && (d = H(d, p), u = H(u, p)), d = E(d = W(d, Q(C(u), C(d))), e({ visibleArea: d, type: "move" })), { coordinates: u = E(u, dt(I(d), h)), visibleArea: d };
563
- }
564
- function Ge(t) {
565
- var e = t.event, i = t.getAreaRestrictions, s = t.boundaries, o = t.coordinates, n = t.visibleArea;
566
- t.aspectRatio, t.stencilSize, t.sizeRestrictions;
567
- var a = t.positionRestrictions;
568
- t.stencilReference;
569
- var h = g({}, o), r = g({}, n);
570
- if (o && n && e.type !== "manipulateImage") {
571
- var l = { width: 0, height: 0 };
572
- r.width, s.width, w(s) > w(h) ? (l.height = 0.8 * s.height, l.width = l.height * w(h)) : (l.width = 0.8 * s.width, l.height = l.width * w(h));
573
- var c = ut(r = H(r, h.width * s.width / (r.width * l.width)), i({ visibleArea: r, type: "resize" }));
574
- r = H(r, c), c !== 1 && (l.height /= c, l.width /= c), r = E(r = W(r, Q(C(h), C(r))), i({ visibleArea: r, type: "move" })), h = E(h, dt(I(r), a));
575
- }
576
- return { coordinates: h, visibleArea: r };
577
- }
578
- function Qe(t) {
579
- var e = t.event, i = t.coordinates, s = t.visibleArea, o = t.getAreaRestrictions, n = g({}, s), a = g({}, i);
580
- if (e.type === "setCoordinates") {
581
- var h = Math.max(0, a.width - n.width), r = Math.max(0, a.height - n.height);
582
- h > r ? n = H(n, Math.min(a.width / n.width, K(n, o({ visibleArea: n, type: "resize" })))) : r > h && (n = H(n, Math.min(a.height / n.height, K(n, o({ visibleArea: n, type: "resize" }))))), n = E(n = W(n, ct(J(a, I(n)))), o({ visibleArea: n, type: "move" }));
583
- }
584
- return { visibleArea: n, coordinates: a };
585
- }
586
- function Ke(t) {
587
- var e = t.imageSize, i = t.visibleArea, s = t.coordinates, o = i || e;
588
- return { left: (i ? i.left : 0) + o.width / 2 - s.width / 2, top: (i ? i.top : 0) + o.height / 2 - s.height / 2 };
589
- }
590
- function Je(t) {
591
- var e = t.imageSize, i = t.visibleArea, s = t.aspectRatio, o = t.sizeRestrictions, n = i || e, a = Math.min(s.maximum || 1 / 0, Math.max(s.minimum || 0, w(n))), h = n.width < n.height ? { width: 0.8 * n.width, height: 0.8 * n.width / a } : { height: 0.8 * n.height, width: 0.8 * n.height * a };
592
- return Y(g(g({}, h), { aspectRatio: s, sizeRestrictions: o }));
593
- }
594
- function ti(t) {
595
- var e, i, s = t.imageSize, o = t.visibleArea, n = t.boundaries, a = t.aspectRatio, h = t.sizeRestrictions, r = t.stencilSize, l = o || s;
596
- return w(l) > w(n) ? i = (e = r.height * l.height / n.height) * w(r) : e = (i = r.width * l.width / n.width) / w(r), Y({ width: i, height: e, aspectRatio: a, sizeRestrictions: h });
597
- }
598
- function ei(t) {
599
- var e = t.getAreaRestrictions, i = t.coordinates, s = t.imageSize, o = w(t.boundaries);
600
- if (i) {
601
- var n = { height: Math.max(i.height, s.height), width: Math.max(i.width, s.width) }, a = le({ width: w(n) > o ? n.width : n.height * o, height: w(n) > o ? n.width / o : n.height }, Ct(e())), h = { left: i.left + i.width / 2 - a.width / 2, top: i.top + i.height / 2 - a.height / 2, width: a.width, height: a.height }, r = et(i, I(g({ left: 0, top: 0 }, s))), l = {};
602
- return !r.left && !r.right && h.width <= s.width && (l.left = 0, l.right = s.width), !r.top && !r.bottom && h.height <= s.height && (l.top = 0, l.bottom = s.height), E(h, l);
603
- }
604
- var c = w(s);
605
- return a = { height: c > o ? s.height : s.width / o, width: c > o ? s.height * o : s.width }, { left: s.width / 2 - a.width / 2, top: s.height / 2 - a.height / 2, width: a.width, height: a.height };
606
- }
607
- function ot(t, e) {
608
- return ue(t, I(e));
609
- }
610
- function ii(t) {
611
- var e = t.event, i = t.coordinates, s = t.visibleArea, o = t.sizeRestrictions, n = t.getAreaRestrictions, a = t.positionRestrictions, h = t.adjustStencil, r = e.scale, l = e.move, c = g({}, s), u = g({}, i), d = 1, m = 1, p = r.factor && Math.abs(r.factor - 1) > 1e-3;
612
- c = W(c, { left: l.left || 0, top: l.top || 0 });
613
- var v = { stencil: { minimum: Math.max(o.minWidth ? o.minWidth / u.width : 0, o.minHeight ? o.minHeight / u.height : 0), maximum: Math.min(o.maxWidth ? o.maxWidth / u.width : 1 / 0, o.maxHeight ? o.maxHeight / u.height : 1 / 0, K(u, a)) }, area: { maximum: K(c, n({ visibleArea: c, type: "resize" })) } };
614
- r.factor && p && (r.factor < 1 ? (m = Math.max(r.factor, v.stencil.minimum)) > 1 && (m = 1) : r.factor > 1 && (m = Math.min(r.factor, Math.min(v.area.maximum, v.stencil.maximum))) < 1 && (m = 1)), m && (c = H(c, m, r.center));
615
- var T = i.left - s.left, $ = s.width + s.left - (i.width + i.left), U = i.top - s.top, X = s.height + s.top - (i.height + i.top);
616
- return c = E(c = W(c, J(c, { left: a.left !== void 0 ? a.left - T * m : void 0, top: a.top !== void 0 ? a.top - U * m : void 0, bottom: a.bottom !== void 0 ? a.bottom + X * m : void 0, right: a.right !== void 0 ? a.right + $ * m : void 0 })), n({ visibleArea: c, type: "move" })), u.width = u.width * m, u.height = u.height * m, u.left = c.left + T * m, u.top = c.top + U * m, u = E(u, dt(I(c), a)), r.factor && p && h && (r.factor > 1 ? d = Math.min(v.area.maximum, r.factor) / m : r.factor < 1 && (d = Math.max(u.height / c.height, u.width / c.width, r.factor / m)), d !== 1 && (c = W(c = E(c = H(c, d, r.factor > 1 ? r.center : C(u)), n({ visibleArea: c, type: "move" })), ct(J(u, I(c)))))), { coordinates: u, visibleArea: c };
617
- }
618
- function ni(t) {
619
- var e = t.aspectRatio, i = t.getAreaRestrictions, s = t.coordinates, o = t.visibleArea, n = t.sizeRestrictions, a = t.positionRestrictions, h = t.imageSize, r = t.previousImageSize, l = t.angle, c = g({}, s), u = g({}, o), d = F(C(g({ left: 0, top: 0 }, r)), l);
620
- return (c = g(g({}, Y({ sizeRestrictions: n, aspectRatio: e, width: c.width, height: c.height })), F(C(c), l))).left -= d.left - h.width / 2 + c.width / 2, c.top -= d.top - h.height / 2 + c.height / 2, u = H(u, ut(u, i({ visibleArea: u, type: "resize" }))), { coordinates: c = E(c, a), visibleArea: u = E(u = W(u, Q(C(c), C(s))), i({ visibleArea: u, type: "move" })) };
621
- }
622
- function si(t) {
623
- var e = t.flip, i = t.previousFlip, s = t.rotate, o = t.getAreaRestrictions, n = t.coordinates, a = t.visibleArea, h = t.imageSize, r = g({}, n), l = g({}, a), c = i.horizontal !== e.horizontal, u = i.vertical !== e.vertical;
624
- if (c || u) {
625
- var d = F({ left: h.width / 2, top: h.height / 2 }, -s), m = F(C(r), -s), p = F({ left: c ? d.left - (m.left - d.left) : m.left, top: u ? d.top - (m.top - d.top) : m.top }, s);
626
- r = W(r, Q(p, C(r))), m = F(C(l), -s), l = E(l = W(l, Q(p = F({ left: c ? d.left - (m.left - d.left) : m.left, top: u ? d.top - (m.top - d.top) : m.top }, s), C(l))), o({ visibleArea: l, type: "move" }));
627
- }
628
- return { coordinates: r, visibleArea: l };
629
- }
630
- function Kt(t) {
631
- var e = t.directions, i = t.coordinates, s = t.positionRestrictions, o = s === void 0 ? {} : s, n = t.sizeRestrictions, a = t.preserveRatio, h = t.compensate, r = g({}, e), l = P(i, r).width, c = P(i, r).height;
632
- l < 0 && (r.left < 0 && r.right < 0 ? (r.left = -(i.width - n.minWidth) / (r.left / r.right), r.right = -(i.width - n.minWidth) / (r.right / r.left)) : r.left < 0 ? r.left = -(i.width - n.minWidth) : r.right < 0 && (r.right = -(i.width - n.minWidth))), c < 0 && (r.top < 0 && r.bottom < 0 ? (r.top = -(i.height - n.minHeight) / (r.top / r.bottom), r.bottom = -(i.height - n.minHeight) / (r.bottom / r.top)) : r.top < 0 ? r.top = -(i.height - n.minHeight) : r.bottom < 0 && (r.bottom = -(i.height - n.minHeight)));
633
- var u = et(P(i, r), o);
634
- h && (u.left && u.left > 0 && u.right === 0 ? (r.right += u.left, r.left -= u.left) : u.right && u.right > 0 && u.left === 0 && (r.left += u.right, r.right -= u.right), u.top && u.top > 0 && u.bottom === 0 ? (r.bottom += u.top, r.top -= u.top) : u.bottom && u.bottom > 0 && u.top === 0 && (r.top += u.bottom, r.bottom -= u.bottom), u = et(P(i, r), o));
635
- var d = { width: 1 / 0, height: 1 / 0, left: 1 / 0, right: 1 / 0, top: 1 / 0, bottom: 1 / 0 };
636
- if (B.forEach((function(v) {
637
- var T = u[v];
638
- T && r[v] && (d[v] = Math.max(0, 1 - T / r[v]));
639
- })), a) {
640
- var m = Math.min.apply(null, B.map((function(v) {
641
- return d[v];
642
- })));
643
- m !== 1 / 0 && B.forEach((function(v) {
644
- r[v] *= m;
645
- }));
646
- } else B.forEach((function(v) {
647
- d[v] !== 1 / 0 && (r[v] *= d[v]);
648
- }));
649
- if (l = P(i, r).width, c = P(i, r).height, r.right + r.left && (l > n.maxWidth ? d.width = (n.maxWidth - i.width) / (r.right + r.left) : l < n.minWidth && (d.width = (n.minWidth - i.width) / (r.right + r.left))), r.bottom + r.top && (c > n.maxHeight ? d.height = (n.maxHeight - i.height) / (r.bottom + r.top) : c < n.minHeight && (d.height = (n.minHeight - i.height) / (r.bottom + r.top))), a) {
650
- var p = Math.min(d.width, d.height);
651
- p !== 1 / 0 && B.forEach((function(v) {
652
- r[v] *= p;
653
- }));
654
- } else d.width !== 1 / 0 && Xe.forEach((function(v) {
655
- r[v] *= d.width;
656
- })), d.height !== 1 / 0 && Fe.forEach((function(v) {
657
- r[v] *= d.height;
658
- }));
659
- return r;
660
- }
661
- function rt(t, e, i) {
662
- return e == 0 && i == 0 ? t / 2 : e == 0 ? 0 : i == 0 ? t : t * Math.abs(e / (e + i));
663
- }
664
- var oi = L("vue-simple-handler"), ri = L("vue-simple-handler-wrapper"), mt = { name: "SimpleHandler", components: { HandlerWrapper: ae }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
665
- return { hover: !1 };
666
- }, computed: { classes: function() {
667
- var t, e = (j(t = {}, this.horizontalPosition, !!this.horizontalPosition), j(t, this.verticalPosition, !!this.verticalPosition), j(t, "".concat(this.horizontalPosition, "-").concat(this.verticalPosition), !!(this.verticalPosition && this.horizontalPosition)), j(t, "hover", this.hover), t);
668
- return { default: R(oi(e), this.defaultClass, this.hover && this.hoverClass), wrapper: R(ri(e), this.wrapperClass) };
669
- } }, methods: { onDrag: function(t) {
670
- this.$emit("drag", t);
671
- }, onEnter: function() {
672
- this.hover = !0;
673
- }, onLeave: function() {
674
- this.hover = !1;
675
- }, onDragEnd: function() {
676
- this.$emit("drag-end");
677
- } }, emits: ["drag", "drag-end"] };
678
- mt.render = function(t, e, i, s, o, n) {
679
- var a = D("HandlerWrapper");
680
- return y(), x(a, { class: n.classes.wrapper, "vertical-position": i.verticalPosition, "horizontal-position": i.horizontalPosition, disabled: i.disabled, onDrag: n.onDrag, onDragEnd: n.onDragEnd, onEnter: n.onEnter, onLeave: n.onLeave }, { default: A((function() {
681
- return [f("div", { class: n.classes.default }, null, 2)];
682
- })), _: 1 }, 8, ["class", "vertical-position", "horizontal-position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
683
- };
684
- var ai = L("vue-simple-line"), hi = L("vue-simple-line-wrapper"), gt = { name: "SimpleLine", components: { LineWrapper: he }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, position: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
685
- return { hover: !1 };
686
- }, computed: { classes: function() {
687
- return { root: R(ai(j({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass), wrapper: R(hi(j({}, this.position, !0)), this.wrapperClass) };
688
- } }, methods: { onDrag: function(t) {
689
- this.$emit("drag", t);
690
- }, onEnter: function() {
691
- this.hover = !0;
692
- }, onLeave: function() {
693
- this.hover = !1;
694
- }, onDragEnd: function() {
695
- this.$emit("drag-end");
696
- } }, emits: ["drag", "drag-end"] };
697
- gt.render = function(t, e, i, s, o, n) {
698
- var a = D("LineWrapper");
699
- return y(), x(a, { class: n.classes.wrapper, position: i.position, disabled: i.disabled, onDrag: n.onDrag, onDragEnd: n.onDragEnd, onEnter: n.onEnter, onLeave: n.onLeave }, { default: A((function() {
700
- return [f("div", { class: n.classes.root }, null, 2)];
701
- })), _: 1 }, 8, ["class", "position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
702
- };
703
- var yt = L("vue-bounding-box"), li = ["east", "west", null], ci = ["south", "north", null], Ot = { name: "BoundingBox", props: { width: { type: Number }, height: { type: Number }, transitions: { type: Object }, handlers: { type: Object, default: function() {
704
- return { eastNorth: !0, north: !0, westNorth: !0, west: !0, westSouth: !0, south: !0, eastSouth: !0, east: !0 };
705
- } }, handlersComponent: { type: [Object, String], default: function() {
706
- return mt;
707
- } }, handlersClasses: { type: Object, default: function() {
708
- return {};
709
- } }, handlersWrappersClasses: { type: Object, default: function() {
710
- return {};
711
- } }, lines: { type: Object, default: function() {
712
- return { west: !0, north: !0, east: !0, south: !0 };
713
- } }, linesComponent: { type: [Object, String], default: function() {
714
- return gt;
715
- } }, linesClasses: { type: Object, default: function() {
716
- return {};
717
- } }, linesWrappersClasses: { type: Object, default: function() {
718
- return {};
719
- } }, resizable: { type: Boolean, default: !0 } }, data: function() {
720
- var t = [];
721
- return li.forEach((function(e) {
722
- ci.forEach((function(i) {
723
- if (e !== i) {
724
- var s = ne(e, i), o = s.name, n = s.classname;
725
- t.push({ name: o, classname: n, verticalDirection: i, horizontalDirection: e });
726
- }
727
- }));
728
- })), { points: t };
729
- }, computed: { style: function() {
730
- var t = {};
731
- return this.width && this.height && (t.width = "".concat(this.width, "px"), t.height = "".concat(this.height, "px"), this.transitions && this.transitions.enabled && (t.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction))), t;
732
- }, classes: function() {
733
- var t = this.handlersClasses, e = this.handlersWrappersClasses, i = this.linesClasses, s = this.linesWrappersClasses;
734
- return { root: yt(), handlers: t, handlersWrappers: e, lines: i, linesWrappers: s };
735
- }, lineNodes: function() {
736
- var t = this, e = [];
737
- return this.points.forEach((function(i) {
738
- i.horizontalDirection && i.verticalDirection || !t.lines[i.name] || e.push({ name: i.name, component: t.linesComponent, class: R(t.classes.lines.default, t.classes.lines[i.name], !t.resizable && t.classes.lines.disabled), wrapperClass: R(t.classes.linesWrappers.default, t.classes.linesWrappers[i.name], !t.resizable && t.classes.linesWrappers.disabled), hoverClass: t.classes.lines.hover, verticalDirection: i.verticalDirection, horizontalDirection: i.horizontalDirection, disabled: !t.resizable });
739
- })), e;
740
- }, handlerNodes: function() {
741
- var t = this, e = [], i = this.width, s = this.height;
742
- return this.points.forEach((function(o) {
743
- if (t.handlers[o.name]) {
744
- var n = { name: o.name, component: t.handlersComponent, class: R(t.classes.handlers.default, t.classes.handlers[o.name]), wrapperClass: R(t.classes.handlersWrappers.default, t.classes.handlersWrappers[o.name]), hoverClass: t.classes.handlers.hover, verticalDirection: o.verticalDirection, horizontalDirection: o.horizontalDirection, disabled: !t.resizable };
745
- if (i && s) {
746
- var a = o.horizontalDirection, h = o.verticalDirection, r = a === "east" ? i : a === "west" ? 0 : i / 2, l = h === "south" ? s : h === "north" ? 0 : s / 2;
747
- n.wrapperClass = yt("handler"), n.wrapperStyle = { transform: "translate(".concat(r, "px, ").concat(l, "px)") }, t.transitions && t.transitions.enabled && (n.wrapperStyle.transition = "".concat(t.transitions.time, "ms ").concat(t.transitions.timingFunction));
748
- } else n.wrapperClass = yt("handler", j({}, o.classname, !0));
749
- e.push(n);
750
- }
751
- })), e;
752
- } }, beforeMount: function() {
753
- window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
754
- }, beforeUnmount: function() {
755
- window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
756
- }, mounted: function() {
757
- this.touches = [];
758
- }, methods: { onEnd: function() {
759
- this.$emit("resize-end");
760
- }, onHandlerDrag: function(t, e, i) {
761
- var s, o = t.shift(), n = o.left, a = o.top, h = { left: 0, right: 0, top: 0, bottom: 0 };
762
- e === "west" ? h.left -= n : e === "east" && (h.right += n), i === "north" ? h.top -= a : i === "south" && (h.bottom += a), !i && e ? s = "width" : i && !e && (s = "height"), this.resizable && this.$emit("resize", new Ie(h, { allowedDirections: { left: e === "west" || !e, right: e === "east" || !e, bottom: i === "south" || !i, top: i === "north" || !i }, preserveAspectRatio: t.nativeEvent && t.nativeEvent.shiftKey, respectDirection: s }));
763
- } }, emits: ["resize", "resize-end"] };
764
- Ot.render = function(t, e, i, s, o, n) {
765
- return y(), x("div", { ref: "box", class: n.classes.root, style: n.style }, [q(t.$slots, "default"), f("div", null, [(y(!0), x($t, null, Pt(n.lineNodes, (function(a) {
766
- return y(), x(lt(a.component), { key: a.name, "default-class": a.class, "hover-class": a.hoverClass, "wrapper-class": a.wrapperClass, position: a.name, disabled: a.disabled, onDrag: function(h) {
767
- return n.onHandlerDrag(h, a.horizontalDirection, a.verticalDirection);
768
- }, onDragEnd: e[1] || (e[1] = function(h) {
769
- return n.onEnd();
770
- }) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
771
- })), 128))]), (y(!0), x($t, null, Pt(n.handlerNodes, (function(a) {
772
- return y(), x("div", { key: a.name, style: a.wrapperStyle, class: a.wrapperClass }, [(y(), x(lt(a.component), { "default-class": a.class, "hover-class": a.hoverClass, "wrapper-class": a.wrapperClass, "horizontal-position": a.horizontalDirection, "vertical-position": a.verticalDirection, disabled: a.disabled, onDrag: function(h) {
773
- return n.onHandlerDrag(h, a.horizontalDirection, a.verticalDirection);
774
- }, onDragEnd: e[2] || (e[2] = function(h) {
775
- return n.onEnd();
776
- }) }, null, 8, ["default-class", "hover-class", "wrapper-class", "horizontal-position", "vertical-position", "disabled", "onDrag"]))], 6);
777
- })), 128))], 6);
778
- };
779
- var ui = L("vue-draggable-area"), jt = { name: "DraggableArea", props: { movable: { type: Boolean, default: !0 }, activationDistance: { type: Number, default: 20 } }, computed: { classnames: function() {
780
- return { default: ui() };
781
- } }, beforeMount: function() {
782
- window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
783
- }, beforeUnmount: function() {
784
- window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
785
- }, mounted: function() {
786
- this.touches = [], this.touchStarted = !1;
787
- }, methods: { onTouchStart: function(t) {
788
- if (t.cancelable) {
789
- var e = this.movable && t.touches.length === 1;
790
- e && (this.touches = V(t.touches)), (this.touchStarted || e) && (t.preventDefault(), t.stopPropagation());
791
- }
792
- }, onTouchEnd: function() {
793
- this.touchStarted = !1, this.processEnd();
794
- }, onTouchMove: function(t) {
795
- this.touches.length >= 1 && (this.touchStarted ? (this.processMove(t, t.touches), t.preventDefault(), t.stopPropagation()) : re({ x: this.touches[0].clientX, y: this.touches[0].clientY }, { x: t.touches[0].clientX, y: t.touches[0].clientY }) > this.activationDistance && (this.initAnchor({ clientX: t.touches[0].clientX, clientY: t.touches[0].clientY }), this.touchStarted = !0));
796
- }, onMouseDown: function(t) {
797
- if (this.movable && t.button === 0) {
798
- var e = { fake: !0, clientX: t.clientX, clientY: t.clientY };
799
- this.touches = [e], this.initAnchor(e), t.stopPropagation();
800
- }
801
- }, onMouseMove: function(t) {
802
- this.touches.length && (this.processMove(t, [{ fake: !0, clientX: t.clientX, clientY: t.clientY }]), t.preventDefault && t.cancelable && t.preventDefault(), t.stopPropagation());
803
- }, onMouseUp: function() {
804
- this.processEnd();
805
- }, initAnchor: function(t) {
806
- var e = this.$refs.container.getBoundingClientRect(), i = e.left, s = e.top;
807
- this.anchor = { x: t.clientX - i, y: t.clientY - s };
808
- }, processMove: function(t, e) {
809
- var i = V(e);
810
- if (this.touches.length) {
811
- var s = this.$refs.container.getBoundingClientRect(), o = s.left, n = s.top;
812
- this.touches.length === 1 && i.length === 1 && this.$emit("move", new Wt({ left: i[0].clientX - (o + this.anchor.x), top: i[0].clientY - (n + this.anchor.y) }));
813
- }
814
- }, processEnd: function() {
815
- this.touches.length && this.$emit("move-end"), this.touches = [];
816
- } }, emits: ["move", "move-end"] };
817
- jt.render = function(t, e, i, s, o, n) {
818
- return y(), x("div", { ref: "container", onTouchstart: e[1] || (e[1] = function() {
819
- return n.onTouchStart && n.onTouchStart.apply(n, arguments);
820
- }), onMousedown: e[2] || (e[2] = function() {
821
- return n.onMouseDown && n.onMouseDown.apply(n, arguments);
822
- }) }, [q(t.$slots, "default")], 544);
823
- };
824
- function zt(t) {
825
- var e, i;
826
- return { rotate: t.rotate || 0, flip: { horizontal: ((e = t?.flip) === null || e === void 0 ? void 0 : e.horizontal) || !1, vertical: ((i = t?.flip) === null || i === void 0 ? void 0 : i.vertical) || !1 } };
827
- }
828
- function di(t) {
829
- return new Promise((function(e, i) {
830
- try {
831
- if (t) if (/^data:/i.test(t)) e((function(r) {
832
- r = r.replace(/^data:([^;]+);base64,/gim, "");
833
- for (var l = atob(r), c = l.length, u = new ArrayBuffer(c), d = new Uint8Array(u), m = 0; m < c; m++) d[m] = l.charCodeAt(m);
834
- return u;
835
- })(t));
836
- else if (/^blob:/i.test(t)) {
837
- var s = new FileReader();
838
- s.onload = function(r) {
839
- e(r.target.result);
840
- }, n = t, a = function(r) {
841
- s.readAsArrayBuffer(r);
842
- }, (h = new XMLHttpRequest()).open("GET", n, !0), h.responseType = "blob", h.onload = function() {
843
- this.status != 200 && this.status !== 0 || a(this.response);
844
- }, h.send();
845
- } else {
846
- var o = new XMLHttpRequest();
847
- o.onreadystatechange = function() {
848
- o.readyState === 4 && (o.status === 200 || o.status === 0 ? e(o.response) : i("Warning: could not load an image to parse its orientation"), o = null);
849
- }, o.onprogress = function() {
850
- o.getResponseHeader("content-type") !== "image/jpeg" && o.abort();
851
- }, o.withCredentials = !1, o.open("GET", t, !0), o.responseType = "arraybuffer", o.send(null);
852
- }
853
- else i("Error: the image is empty");
854
- } catch (r) {
855
- i(r);
856
- }
857
- var n, a, h;
858
- }));
859
- }
860
- function de(t) {
861
- var e = t.rotate, i = t.flip, s = t.scaleX, o = t.scaleY, n = "";
862
- return n += " rotate(" + e + "deg) ", n += " scaleX(" + s * (i.horizontal ? -1 : 1) + ") ", n += " scaleY(" + o * (i.vertical ? -1 : 1) + ") ";
863
- }
864
- function mi(t) {
865
- try {
866
- var e, i = new DataView(t), s = void 0, o = void 0, n = void 0, a = void 0;
867
- if (i.getUint8(0) === 255 && i.getUint8(1) === 216) for (var h = i.byteLength, r = 2; r + 1 < h; ) {
868
- if (i.getUint8(r) === 255 && i.getUint8(r + 1) === 225) {
869
- n = r;
870
- break;
871
- }
872
- r++;
873
- }
874
- if (n && (s = n + 10, (function(m, p, v) {
875
- var T, $ = "";
876
- for (T = p, v += p; T < v; T++) $ += String.fromCharCode(m.getUint8(T));
877
- return $;
878
- })(i, n + 4, 4) === "Exif")) {
879
- var l = i.getUint16(s);
880
- if (((o = l === 18761) || l === 19789) && i.getUint16(s + 2, o) === 42) {
881
- var c = i.getUint32(s + 4, o);
882
- c >= 8 && (a = s + c);
883
- }
884
- }
885
- if (a) {
886
- for (var u = i.getUint16(a, o), d = 0; d < u; d++)
887
- if (r = a + 12 * d + 2, i.getUint16(r, o) === 274) {
888
- r += 8, e = i.getUint16(r, o), i.setUint16(r, 1, o);
889
- break;
890
- }
891
- }
892
- return e;
893
- } catch {
894
- return null;
895
- }
896
- }
897
- function Jt(t, e) {
898
- var i = e.getBoundingClientRect(), s = i.left, o = i.top, n = { left: 0, top: 0 }, a = 0;
899
- return t.forEach((function(h) {
900
- n.left += (h.clientX - s) / t.length, n.top += (h.clientY - o) / t.length;
901
- })), t.forEach((function(h) {
902
- a += re({ x: n.left, y: n.top }, { x: h.clientX - s, y: h.clientY - o });
903
- })), { centerMass: n, spread: a, count: t.length };
904
- }
905
- var me = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 }, eventsFilter: { type: Function, required: !1 } }, beforeMount: function() {
906
- window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
907
- }, beforeUnmount: function() {
908
- window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
909
- }, created: function() {
910
- this.transforming = !1, this.debouncedProcessEnd = Mt(this.processEnd), this.touches = [];
911
- }, methods: { processMove: function(t, e) {
912
- if (this.touches.length) {
913
- if (this.touches.length === 1 && e.length === 1) this.$emit("move", new tt({ left: this.touches[0].clientX - e[0].clientX, top: this.touches[0].clientY - e[0].clientY }));
914
- else if (this.touches.length > 1 && this.touchResize) {
915
- var i = Jt(e, this.$refs.container), s = this.oldGeometricProperties;
916
- s.count === i.count && s.count > 1 && this.$emit("resize", new tt({ left: s.centerMass.left - i.centerMass.left, top: s.centerMass.top - i.centerMass.top }, { factor: s.spread / i.spread, center: i.centerMass })), this.oldGeometricProperties = i;
917
- }
918
- this.touches = e;
919
- }
920
- }, processEnd: function() {
921
- this.transforming && (this.transforming = !1, this.$emit("transform-end"));
922
- }, processStart: function() {
923
- this.transforming = !0, this.debouncedProcessEnd.clear();
924
- }, processEvent: function(t) {
925
- return this.eventsFilter ? this.eventsFilter(t, this.transforming) !== !1 : (t.preventDefault(), t.stopPropagation(), !0);
926
- }, onTouchStart: function(t) {
927
- if (t.cancelable && (this.touchMove || this.touchResize && t.touches.length > 1) && this.processEvent(t)) {
928
- var e = this.$refs.container, i = e.getBoundingClientRect(), s = i.left, o = i.top, n = i.bottom, a = i.right;
929
- this.touches = V(t.touches).filter((function(h) {
930
- return h.clientX > s && h.clientX < a && h.clientY > o && h.clientY < n;
931
- })), this.oldGeometricProperties = Jt(this.touches, e);
932
- }
933
- }, onTouchEnd: function(t) {
934
- t.touches.length === 0 && (this.touches = [], this.processEnd());
935
- }, onTouchMove: function(t) {
936
- var e = this;
937
- if (this.touches.length) {
938
- var i = V(t.touches).filter((function(s) {
939
- return !s.identifier || e.touches.find((function(o) {
940
- return o.identifier === s.identifier;
941
- }));
942
- }));
943
- this.processEvent(t) && (this.processMove(t, i), this.processStart());
944
- }
945
- }, onMouseDown: function(t) {
946
- if (this.mouseMove && "buttons" in t && t.buttons === 1 && this.processEvent(t)) {
947
- var e = { fake: !0, clientX: t.clientX, clientY: t.clientY };
948
- this.touches = [e], this.processStart();
949
- }
950
- }, onMouseMove: function(t) {
951
- this.touches.length && this.processEvent(t) && this.processMove(t, [{ clientX: t.clientX, clientY: t.clientY }]);
952
- }, onMouseUp: function() {
953
- this.touches = [], this.processEnd();
954
- }, onWheel: function(t) {
955
- if (this.wheelResize && this.processEvent(t)) {
956
- var e = this.$refs.container.getBoundingClientRect(), i = e.left, s = e.top, o = 1 + this.wheelResize.ratio * (a = t.deltaY || t.detail || t.wheelDelta, (h = +a) == 0 || oe(h) ? h : h > 0 ? 1 : -1), n = { left: t.clientX - i, top: t.clientY - s };
957
- this.$emit("resize", new tt({}, { factor: o, center: n })), this.touches.length || this.debouncedProcessEnd();
958
- }
959
- var a, h;
960
- } }, emits: ["resize", "move", "transform-end"] };
961
- me.render = function(t, e, i, s, o, n) {
962
- return y(), x("div", { ref: "container", onTouchstart: e[1] || (e[1] = function() {
963
- return n.onTouchStart && n.onTouchStart.apply(n, arguments);
964
- }), onMousedown: e[2] || (e[2] = function() {
965
- return n.onMouseDown && n.onMouseDown.apply(n, arguments);
966
- }), onWheel: e[3] || (e[3] = function() {
967
- return n.onWheel && n.onWheel.apply(n, arguments);
968
- }) }, [q(t.$slots, "default")], 544);
969
- };
970
- var Tt = { components: { TransformableImage: me }, props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 } }, emits: ["resize", "move"] };
971
- Tt.render = function(t, e, i, s, o, n) {
972
- var a = D("transformable-image");
973
- return y(), x(a, { "touch-move": i.touchMove, "touch-resize": i.touchResize, "mouse-move": i.mouseMove, "wheel-resize": i.wheelResize, onMove: e[1] || (e[1] = function(h) {
974
- return t.$emit("move", h);
975
- }), onResize: e[2] || (e[2] = function(h) {
976
- return t.$emit("resize", h);
977
- }) }, { default: A((function() {
978
- return [q(t.$slots, "default")];
979
- })), _: 3 }, 8, ["touch-move", "touch-resize", "mouse-move", "wheel-resize"]);
980
- };
981
- var at = L("vue-preview"), ge = { props: { coordinates: { type: Object }, transitions: { type: Object }, image: { type: Object, default: function() {
982
- return {};
983
- } }, imageClass: { type: String }, width: { type: Number }, height: { type: Number }, fill: { type: Boolean } }, data: function() {
984
- return { calculatedImageSize: { width: 0, height: 0 }, calculatedSize: { width: 0, height: 0 } };
985
- }, computed: { classes: function() {
986
- return { root: at({ fill: this.fill }), wrapper: at("wrapper"), imageWrapper: at("image-wrapper"), image: R(at("image"), this.imageClass) };
987
- }, style: function() {
988
- if (this.fill) return {};
989
- var t = {};
990
- return this.width && (t.width = "".concat(this.size.width, "px")), this.height && (t.height = "".concat(this.size.height, "px")), this.transitions && this.transitions.enabled && (t.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), t;
991
- }, wrapperStyle: function() {
992
- var t = { width: "".concat(this.size.width, "px"), height: "".concat(this.size.height, "px"), left: "calc(50% - ".concat(this.size.width / 2, "px)"), top: "calc(50% - ".concat(this.size.height / 2, "px)") };
993
- return this.transitions && this.transitions.enabled && (t.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), t;
994
- }, imageStyle: function() {
995
- if (this.coordinates && this.image) {
996
- var t = this.coordinates.width / this.size.width, e = b(b({ rotate: 0, flip: { horizontal: !1, vertical: !1 } }, this.image.transforms), {}, { scaleX: 1 / t, scaleY: 1 / t }), i = this.imageSize.width, s = this.imageSize.height, o = ce({ width: i, height: s }, e.rotate), n = { width: "".concat(i, "px"), height: "".concat(s, "px"), left: "0px", top: "0px" }, a = { rotate: { left: (i - o.width) * e.scaleX / 2, top: (s - o.height) * e.scaleY / 2 }, scale: { left: (1 - e.scaleX) * i / 2, top: (1 - e.scaleY) * s / 2 } };
997
- return n.transform = `translate(
998
- `.concat(-this.coordinates.left / t - a.rotate.left - a.scale.left, "px,").concat(-this.coordinates.top / t - a.rotate.top - a.scale.top, "px) ") + de(e), this.transitions && this.transitions.enabled && (n.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), n;
999
- }
1000
- return {};
1001
- }, size: function() {
1002
- return { width: this.width || this.calculatedSize.width, height: this.height || this.calculatedSize.height };
1003
- }, imageSize: function() {
1004
- return { width: this.image.width || this.calculatedImageSize.width, height: this.image.height || this.calculatedImageSize.height };
1005
- } }, watch: { image: function(t) {
1006
- (t.width || t.height) && this.onChangeImage();
1007
- } }, mounted: function() {
1008
- var t = this;
1009
- this.onChangeImage(), this.$refs.image.addEventListener("load", (function() {
1010
- t.refreshImage();
1011
- })), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
1012
- }, unmounted: function() {
1013
- window.removeEventListener("resize", this.refresh), window.removeEventListener("orientationchange", this.refresh);
1014
- }, methods: { refreshImage: function() {
1015
- var t = this.$refs.image;
1016
- this.calculatedImageSize.height = t.naturalHeight, this.calculatedImageSize.width = t.naturalWidth;
1017
- }, refresh: function() {
1018
- var t = this.$refs.root;
1019
- this.width || (this.calculatedSize.width = t.clientWidth), this.height || (this.calculatedSize.height = t.clientHeight);
1020
- }, onChangeImage: function() {
1021
- var t = this.$refs.image;
1022
- t && t.complete && this.refreshImage(), this.refresh();
1023
- } } };
1024
- ge.render = function(t, e, i, s, o, n) {
1025
- return y(), x("div", { ref: "root", class: n.classes.root, style: n.style }, [f("div", { ref: "wrapper", class: n.classes.wrapper, style: n.wrapperStyle }, [te(f("img", { ref: "image", src: i.image && i.image.src, class: n.classes.image, style: n.imageStyle }, null, 14, ["src"]), [[ee, i.image && i.image.src]])], 6)], 6);
1026
- };
1027
- var Dt = { components: { Preview: ge }, inheritAttrs: !1 };
1028
- Dt.render = function(t, e, i, s, o, n) {
1029
- var a = D("preview");
1030
- return y(), x(a, ie(t.$attrs, { fill: !0 }), null, 16);
1031
- };
1032
- var xt = L("vue-rectangle-stencil"), Ht = { name: "RectangleStencil", components: { StencilPreview: Dt, BoundingBox: Ot, DraggableArea: jt }, props: { image: { type: Object }, coordinates: { type: Object }, stencilCoordinates: { type: Object }, handlers: { type: Object }, handlersComponent: { type: [Object, String], default: function() {
1033
- return mt;
1034
- } }, lines: { type: Object }, linesComponent: { type: [Object, String], default: function() {
1035
- return gt;
1036
- } }, aspectRatio: { type: [Number, String] }, minAspectRatio: { type: [Number, String] }, maxAspectRatio: { type: [Number, String] }, movable: { type: Boolean, default: !0 }, resizable: { type: Boolean, default: !0 }, transitions: { type: Object }, movingClass: { type: String }, resizingClass: { type: String }, previewClass: { type: String }, boundingBoxClass: { type: String }, linesClasses: { type: Object, default: function() {
1037
- return {};
1038
- } }, linesWrappersClasses: { type: Object, default: function() {
1039
- return {};
1040
- } }, handlersClasses: { type: Object, default: function() {
1041
- return {};
1042
- } }, handlersWrappersClasses: { type: Object, default: function() {
1043
- return {};
1044
- } } }, data: function() {
1045
- return { moving: !1, resizing: !1 };
1046
- }, computed: { classes: function() {
1047
- return { stencil: R(xt({ movable: this.movable, moving: this.moving, resizing: this.resizing }), this.moving && this.movingClass, this.resizing && this.resizingClass), preview: R(xt("preview"), this.previewClass), boundingBox: R(xt("bounding-box"), this.boundingBoxClass) };
1048
- }, style: function() {
1049
- var t = this.stencilCoordinates, e = t.height, i = t.width, s = t.left, o = t.top, n = { width: "".concat(i, "px"), height: "".concat(e, "px"), transform: "translate(".concat(s, "px, ").concat(o, "px)") };
1050
- return this.transitions && this.transitions.enabled && (n.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), n;
1051
- } }, methods: { onMove: function(t) {
1052
- this.$emit("move", t), this.moving = !0;
1053
- }, onMoveEnd: function() {
1054
- this.$emit("move-end"), this.moving = !1;
1055
- }, onResize: function(t) {
1056
- this.$emit("resize", t), this.resizing = !0;
1057
- }, onResizeEnd: function() {
1058
- this.$emit("resize-end"), this.resizing = !1;
1059
- }, aspectRatios: function() {
1060
- return { minimum: this.aspectRatio || this.minAspectRatio, maximum: this.aspectRatio || this.maxAspectRatio };
1061
- } }, emits: ["resize", "resize-end", "move", "move-end"] };
1062
- Ht.render = function(t, e, i, s, o, n) {
1063
- var a = D("stencil-preview"), h = D("draggable-area"), r = D("bounding-box");
1064
- return y(), x("div", { class: n.classes.stencil, style: n.style }, [f(r, { width: i.stencilCoordinates.width, height: i.stencilCoordinates.height, transitions: i.transitions, class: n.classes.boundingBox, handlers: i.handlers, "handlers-component": i.handlersComponent, "handlers-classes": i.handlersClasses, "handlers-wrappers-classes": i.handlersWrappersClasses, lines: i.lines, "lines-component": i.linesComponent, "lines-classes": i.linesClasses, "lines-wrappers-classes": i.linesWrappersClasses, resizable: i.resizable, onResize: n.onResize, onResizeEnd: n.onResizeEnd }, { default: A((function() {
1065
- return [f(h, { movable: i.movable, onMove: n.onMove, onMoveEnd: n.onMoveEnd }, { default: A((function() {
1066
- return [f(a, { image: i.image, coordinates: i.coordinates, width: i.stencilCoordinates.width, height: i.stencilCoordinates.height, class: n.classes.preview, transitions: i.transitions }, null, 8, ["image", "coordinates", "width", "height", "class", "transitions"])];
1067
- })), _: 1 }, 8, ["movable", "onMove", "onMoveEnd"])];
1068
- })), _: 1 }, 8, ["width", "height", "transitions", "class", "handlers", "handlers-component", "handlers-classes", "handlers-wrappers-classes", "lines", "lines-component", "lines-classes", "lines-wrappers-classes", "resizable", "onResize", "onResizeEnd"])], 6);
1069
- };
1070
- var Rt = L("vue-circle-stencil"), fe = { components: { StencilPreview: Dt, BoundingBox: Ot, DraggableArea: jt }, props: { image: { type: Object }, coordinates: { type: Object }, stencilCoordinates: { type: Object }, handlers: { type: Object, default: function() {
1071
- return { eastNorth: !0, westNorth: !0, westSouth: !0, eastSouth: !0 };
1072
- } }, handlersComponent: { type: [Object, String], default: function() {
1073
- return mt;
1074
- } }, handlersClasses: { type: Object, default: function() {
1075
- return {};
1076
- } }, handlersWrappersClasses: { type: Object, default: function() {
1077
- return {};
1078
- } }, lines: { type: Object }, linesComponent: { type: [Object, String], default: function() {
1079
- return gt;
1080
- } }, linesClasses: { type: Object, default: function() {
1081
- return {};
1082
- } }, linesWrappersClasses: { type: Object, default: function() {
1083
- return {};
1084
- } }, movable: { type: Boolean, default: !0 }, resizable: { type: Boolean, default: !0 }, transitions: { type: Object }, movingClass: { type: String }, resizingClass: { type: String }, previewClass: { type: String }, boundingBoxClass: { type: String } }, data: function() {
1085
- return { moving: !1, resizing: !1 };
1086
- }, computed: { classes: function() {
1087
- return { stencil: R(Rt({ movable: this.movable, moving: this.moving, resizing: this.resizing }), this.moving && this.movingClass, this.resizing && this.resizingClass), preview: R(Rt("preview"), this.previewClass), boundingBox: R(Rt("bounding-box"), this.boundingBoxClass) };
1088
- }, style: function() {
1089
- var t = this.stencilCoordinates, e = t.height, i = t.width, s = t.left, o = t.top, n = { width: "".concat(i, "px"), height: "".concat(e, "px"), transform: "translate(".concat(s, "px, ").concat(o, "px)") };
1090
- return this.transitions && this.transitions.enabled && (n.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), n;
1091
- } }, methods: { onMove: function(t) {
1092
- this.$emit("move", t), this.moving = !0;
1093
- }, onMoveEnd: function() {
1094
- this.$emit("move-end"), this.moving = !1;
1095
- }, onResize: function(t) {
1096
- this.$emit("resize", t), this.resizing = !0;
1097
- }, onResizeEnd: function() {
1098
- this.$emit("resize-end"), this.resizing = !1;
1099
- }, aspectRatios: function() {
1100
- return { minimum: 1, maximum: 1 };
1101
- } }, emits: ["resize", "resize-end", "move", "move-end"] };
1102
- fe.render = function(t, e, i, s, o, n) {
1103
- var a = D("stencil-preview"), h = D("draggable-area"), r = D("bounding-box");
1104
- return y(), x("div", { class: n.classes.stencil, style: n.style }, [f(r, { width: i.stencilCoordinates.width, height: i.stencilCoordinates.height, transitions: i.transitions, class: n.classes.boundingBox, handlers: i.handlers, "handlers-component": i.handlersComponent, "handlers-classes": i.handlersClasses, "handlers-wrappers-classes": i.handlersWrappersClasses, lines: i.lines, "lines-component": i.linesComponent, "lines-classes": i.linesClasses, "lines-wrappers-classes": i.linesWrappersClasses, resizable: i.resizable, onResize: n.onResize, onResizeEnd: n.onResizeEnd }, { default: A((function() {
1105
- return [f(h, { movable: i.movable, onMove: n.onMove, onMoveEnd: n.onMoveEnd }, { default: A((function() {
1106
- return [f(a, { image: i.image, coordinates: i.coordinates, width: i.stencilCoordinates.width, height: i.stencilCoordinates.height, class: n.classes.preview, transitions: i.transitions }, null, 8, ["image", "coordinates", "width", "height", "class", "transitions"])];
1107
- })), _: 1 }, 8, ["movable", "onMove", "onMoveEnd"])];
1108
- })), _: 1 }, 8, ["width", "height", "transitions", "class", "handlers", "handlers-component", "handlers-classes", "handlers-wrappers-classes", "lines", "lines-component", "lines-classes", "lines-wrappers-classes", "resizable", "onResize", "onResizeEnd"])], 6);
1109
- };
1110
- var gi = ["transitions"], _ = L("vue-advanced-cropper"), pe = { name: "Cropper", components: { BackgroundWrapper: Tt }, props: { src: { type: String, default: null }, stencilComponent: { type: [Object, String], default: function() {
1111
- return Ht;
1112
- } }, backgroundWrapperComponent: { type: [Object, String], default: function() {
1113
- return Tt;
1114
- } }, stencilProps: { type: Object, default: function() {
1115
- return {};
1116
- } }, autoZoom: { type: Boolean, default: !1 }, imageClass: { type: String }, boundariesClass: { type: String }, backgroundClass: { type: String }, foregroundClass: { type: String }, minWidth: { type: [Number, String] }, minHeight: { type: [Number, String] }, maxWidth: { type: [Number, String] }, maxHeight: { type: [Number, String] }, debounce: { type: [Boolean, Number], default: 500 }, transitions: { type: Boolean, default: !0 }, checkOrientation: { type: Boolean, default: !0 }, canvas: { type: [Object, Boolean], default: !0 }, crossOrigin: { type: [Boolean, String], default: void 0 }, transitionTime: { type: Number, default: 300 }, imageRestriction: { type: String, default: "fit-area", validator: function(t) {
1117
- return Ne.indexOf(t) !== -1;
1118
- } }, roundResult: { type: Boolean, default: !0 }, defaultSize: { type: [Function, Object] }, defaultPosition: { type: [Function, Object] }, defaultVisibleArea: { type: [Function, Object] }, defaultTransforms: { type: [Function, Object] }, defaultBoundaries: { type: [Function, String], validator: function(t) {
1119
- return !(typeof t == "string" && t !== "fill" && t !== "fit");
1120
- } }, priority: { type: String, default: "coordinates" }, stencilSize: { type: [Object, Function] }, resizeImage: { type: [Boolean, Object], default: !0 }, moveImage: { type: [Boolean, Object], default: !0 }, autoZoomAlgorithm: { type: Function }, resizeAlgorithm: { type: Function, default: function(t) {
1121
- var e = t.event, i = t.coordinates, s = t.aspectRatio, o = t.positionRestrictions, n = t.sizeRestrictions, a = g(g({}, i), { right: i.left + i.width, bottom: i.top + i.height }), h = e.params || {}, r = g({}, e.directions), l = h.allowedDirections || { left: !0, right: !0, bottom: !0, top: !0 };
1122
- n.widthFrozen && (r.left = 0, r.right = 0), n.heightFrozen && (r.top = 0, r.bottom = 0), B.forEach((function(N) {
1123
- l[N] || (r[N] = 0);
1124
- }));
1125
- var c = P(a, r = Kt({ coordinates: a, directions: r, sizeRestrictions: n, positionRestrictions: o })).width, u = P(a, r).height, d = h.preserveRatio ? w(a) : wt(c / u, s);
1126
- if (d) {
1127
- var m = h.respectDirection;
1128
- if (m || (m = a.width >= a.height || d === 1 ? "width" : "height"), m === "width") {
1129
- var p = c / d - a.height;
1130
- if (l.top && l.bottom) {
1131
- var v = r.top, T = r.bottom;
1132
- r.bottom = rt(p, T, v), r.top = rt(p, v, T);
1133
- } else l.bottom ? r.bottom = p : l.top ? r.top = p : l.right ? r.right = 0 : l.left && (r.left = 0);
1134
- } else if (m === "height") {
1135
- var $ = a.width - u * d;
1136
- if (l.left && l.right) {
1137
- var U = r.left, X = r.right;
1138
- r.left = -rt($, U, X), r.right = -rt($, X, U);
1139
- } else l.left ? r.left = -$ : l.right ? r.right = -$ : l.top ? r.top = 0 : l.bottom && (r.bottom = 0);
1140
- }
1141
- r = Kt({ directions: r, coordinates: a, sizeRestrictions: n, positionRestrictions: o, preserveRatio: !0, compensate: h.compensate });
1142
- }
1143
- return c = P(a, r).width, u = P(a, r).height, (d = h.preserveRatio ? w(a) : wt(c / u, s)) && Math.abs(d - c / u) > 1e-3 && B.forEach((function(N) {
1144
- l[N] || (r[N] = 0);
1145
- })), Et({ event: new Wt({ left: -r.left, top: -r.top }), coordinates: { width: i.width + r.right + r.left, height: i.height + r.top + r.bottom, left: i.left, top: i.top }, positionRestrictions: o });
1146
- } }, moveAlgorithm: { type: Function, default: Et }, initStretcher: { type: Function, default: function(t) {
1147
- var e = t.stretcher, i = t.imageSize, s = w(i);
1148
- e.style.width = i.width + "px", e.style.height = e.clientWidth / s + "px", e.style.width = e.clientWidth + "px";
1149
- } }, fitCoordinates: { type: Function, default: function(t) {
1150
- var e = t.visibleArea, i = t.coordinates, s = t.aspectRatio, o = t.sizeRestrictions, n = t.positionRestrictions, a = g(g({}, i), Y({ width: i.width, height: i.height, aspectRatio: s, sizeRestrictions: { maxWidth: e.width, maxHeight: e.height, minHeight: Math.min(e.height, o.minHeight), minWidth: Math.min(e.width, o.minWidth) } }));
1151
- return a = E(a = W(a, Q(C(i), C(a))), dt(I(e), n));
1152
- } }, fitVisibleArea: { type: Function, default: function(t) {
1153
- var e = t.visibleArea, i = t.boundaries, s = t.getAreaRestrictions, o = t.coordinates, n = g({}, e);
1154
- n.height = n.width / w(i), n.top += (e.height - n.height) / 2, (o.height - n.height > 0 || o.width - n.width > 0) && (n = H(n, Math.max(o.height / n.height, o.width / n.width)));
1155
- var a = ct(J(o, I(n = H(n, ut(n, s({ visibleArea: n, type: "resize" }))))));
1156
- return n.width < o.width && (a.left = 0), n.height < o.height && (a.top = 0), n = E(n = W(n, a), s({ visibleArea: n, type: "move" }));
1157
- } }, areaRestrictionsAlgorithm: { type: Function, default: function(t) {
1158
- var e = t.visibleArea, i = t.boundaries, s = t.imageSize, o = t.imageRestriction, n = t.type, a = {};
1159
- return o === "fill-area" ? a = { left: 0, top: 0, right: s.width, bottom: s.height } : o === "fit-area" && (w(i) > w(s) ? (a = { top: 0, bottom: s.height }, e && n === "move" && (e.width > s.width ? (a.left = -(e.width - s.width) / 2, a.right = s.width - a.left) : (a.left = 0, a.right = s.width))) : (a = { left: 0, right: s.width }, e && n === "move" && (e.height > s.height ? (a.top = -(e.height - s.height) / 2, a.bottom = s.height - a.top) : (a.top = 0, a.bottom = s.height)))), a;
1160
- } }, sizeRestrictionsAlgorithm: { type: Function, default: function(t) {
1161
- return { minWidth: t.minWidth, minHeight: t.minHeight, maxWidth: t.maxWidth, maxHeight: t.maxHeight };
1162
- } }, positionRestrictionsAlgorithm: { type: Function, default: function(t) {
1163
- var e = t.imageSize, i = {};
1164
- return t.imageRestriction !== "none" && (i = { left: 0, top: 0, right: e.width, bottom: e.height }), i;
1165
- } } }, data: function() {
1166
- return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: b({}, Zt) };
1167
- }, computed: { image: function() {
1168
- return { src: this.imageAttributes.src, width: this.imageAttributes.width, height: this.imageAttributes.height, transforms: this.imageTransforms };
1169
- }, imageTransforms: function() {
1170
- return { rotate: this.appliedImageTransforms.rotate, flip: { horizontal: this.appliedImageTransforms.flip.horizontal, vertical: this.appliedImageTransforms.flip.vertical }, translateX: this.visibleArea ? this.visibleArea.left / this.coefficient : 0, translateY: this.visibleArea ? this.visibleArea.top / this.coefficient : 0, scaleX: 1 / this.coefficient, scaleY: 1 / this.coefficient };
1171
- }, imageSize: function() {
1172
- var t = (function(e) {
1173
- return e * Math.PI / 180;
1174
- })(this.imageTransforms.rotate);
1175
- return { width: Math.abs(this.imageAttributes.width * Math.cos(t)) + Math.abs(this.imageAttributes.height * Math.sin(t)), height: Math.abs(this.imageAttributes.width * Math.sin(t)) + Math.abs(this.imageAttributes.height * Math.cos(t)) };
1176
- }, initialized: function() {
1177
- return !!(this.visibleArea && this.imageLoaded);
1178
- }, settings: function() {
1179
- var t = St(this.resizeImage, { touch: !0, wheel: { ratio: 0.1 }, adjustStencil: !0 }, { touch: !1, wheel: !1, adjustStencil: !1 });
1180
- return { moveImage: St(this.moveImage, { touch: !0, mouse: !0 }, { touch: !1, mouse: !1 }), resizeImage: t };
1181
- }, coefficient: function() {
1182
- return this.visibleArea ? this.visibleArea.width / this.boundaries.width : 0;
1183
- }, areaRestrictions: function() {
1184
- return this.imageLoaded ? this.areaRestrictionsAlgorithm({ imageSize: this.imageSize, imageRestriction: this.imageRestriction, boundaries: this.boundaries }) : {};
1185
- }, transitionsOptions: function() {
1186
- return { enabled: this.transitionsActive, timingFunction: "ease-in-out", time: 350 };
1187
- }, sizeRestrictions: function() {
1188
- if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
1189
- var t = this.sizeRestrictionsAlgorithm({ imageSize: this.imageSize, minWidth: M(this.minWidth) ? 0 : st(this.minWidth), minHeight: M(this.minHeight) ? 0 : st(this.minHeight), maxWidth: M(this.maxWidth) ? 1 / 0 : st(this.maxWidth), maxHeight: M(this.maxHeight) ? 1 / 0 : st(this.maxHeight) });
1190
- if (t = (function(s) {
1191
- var o = s.areaRestrictions, n = s.sizeRestrictions, a = s.boundaries, h = s.positionRestrictions, r = g(g({}, n), { minWidth: n.minWidth !== void 0 ? n.minWidth : 0, minHeight: n.minHeight !== void 0 ? n.minHeight : 0, maxWidth: n.maxWidth !== void 0 ? n.maxWidth : 1 / 0, maxHeight: n.maxHeight !== void 0 ? n.maxHeight : 1 / 0 });
1192
- h.left !== void 0 && h.right !== void 0 && (r.maxWidth = Math.min(r.maxWidth, h.right - h.left)), h.bottom !== void 0 && h.top !== void 0 && (r.maxHeight = Math.min(r.maxHeight, h.bottom - h.top));
1193
- var l = Ct(o), c = le(a, l);
1194
- return l.width < 1 / 0 && (!r.maxWidth || r.maxWidth > c.width) && (r.maxWidth = Math.min(r.maxWidth, c.width)), l.height < 1 / 0 && (!r.maxHeight || r.maxHeight > c.height) && (r.maxHeight = Math.min(r.maxHeight, c.height)), r.minWidth > r.maxWidth && (r.minWidth = r.maxWidth, r.widthFrozen = !0), r.minHeight > r.maxHeight && (r.minHeight = r.maxHeight, r.heightFrozen = !0), r;
1195
- })({ sizeRestrictions: t, areaRestrictions: this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }), imageSize: this.imageSize, boundaries: this.boundaries, positionRestrictions: this.positionRestrictions, imageRestriction: this.imageRestriction, visibleArea: this.visibleArea, stencilSize: this.getStencilSize() }), this.visibleArea && this.stencilSize) {
1196
- var e = this.getStencilSize(), i = Ct(this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }));
1197
- t.maxWidth = Math.min(t.maxWidth, i.width * e.width / this.boundaries.width), t.maxHeight = Math.min(t.maxHeight, i.height * e.height / this.boundaries.height), t.maxWidth < t.minWidth && (t.minWidth = t.maxWidth), t.maxHeight < t.minHeight && (t.minHeight = t.maxHeight);
1198
- }
1199
- return t;
1200
- }
1201
- return { minWidth: 0, minHeight: 0, maxWidth: 0, maxHeight: 0 };
1202
- }, positionRestrictions: function() {
1203
- return this.positionRestrictionsAlgorithm({ imageSize: this.imageSize, imageRestriction: this.imageRestriction });
1204
- }, classes: function() {
1205
- return { cropper: _(), image: R(_("image"), this.imageClass), stencil: _("stencil"), boundaries: R(_("boundaries"), this.boundariesClass), stretcher: R(_("stretcher")), background: R(_("background"), this.backgroundClass), foreground: R(_("foreground"), this.foregroundClass), imageWrapper: R(_("image-wrapper")), cropperWrapper: R(_("cropper-wrapper")) };
1206
- }, stencilCoordinates: function() {
1207
- if (this.initialized) {
1208
- var t = this.coordinates, e = t.width, i = t.height, s = t.left, o = t.top;
1209
- return { width: e / this.coefficient, height: i / this.coefficient, left: (s - this.visibleArea.left) / this.coefficient, top: (o - this.visibleArea.top) / this.coefficient };
1210
- }
1211
- return this.defaultCoordinates();
1212
- }, boundariesStyle: function() {
1213
- var t = { width: this.boundaries.width ? "".concat(Math.round(this.boundaries.width), "px") : "auto", height: this.boundaries.height ? "".concat(Math.round(this.boundaries.height), "px") : "auto", transition: "opacity ".concat(this.transitionTime, "ms"), pointerEvents: this.imageLoaded ? "all" : "none" };
1214
- return this.imageLoaded || (t.opacity = "0"), t;
1215
- }, imageStyle: function() {
1216
- var t = this.imageAttributes.width > this.imageAttributes.height ? { width: Math.min(1024, this.imageAttributes.width), height: Math.min(1024, this.imageAttributes.width) / (this.imageAttributes.width / this.imageAttributes.height) } : { height: Math.min(1024, this.imageAttributes.height), width: Math.min(1024, this.imageAttributes.height) * (this.imageAttributes.width / this.imageAttributes.height) }, e = { left: (t.width - this.imageSize.width) / (2 * this.coefficient), top: (t.height - this.imageSize.height) / (2 * this.coefficient) }, i = { left: (1 - 1 / this.coefficient) * t.width / 2, top: (1 - 1 / this.coefficient) * t.height / 2 }, s = b(b({}, this.imageTransforms), {}, { scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / t.width), scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / t.height) }), o = { width: "".concat(t.width, "px"), height: "".concat(t.height, "px"), left: "0px", top: "0px", transform: "translate(".concat(-e.left - i.left - this.imageTransforms.translateX, "px, ").concat(-e.top - i.top - this.imageTransforms.translateY, "px)") + de(s) };
1217
- return this.transitionsOptions.enabled && (o.transition = "".concat(this.transitionsOptions.time, "ms ").concat(this.transitionsOptions.timingFunction)), o;
1218
- } }, watch: { src: function() {
1219
- this.onChangeImage();
1220
- }, stencilComponent: function() {
1221
- var t = this;
1222
- this.$nextTick((function() {
1223
- t.resetCoordinates(), t.runAutoZoom("setCoordinates"), t.onChange();
1224
- }));
1225
- }, minWidth: function() {
1226
- this.onPropsChange();
1227
- }, maxWidth: function() {
1228
- this.onPropsChange();
1229
- }, minHeight: function() {
1230
- this.onPropsChange();
1231
- }, maxHeight: function() {
1232
- this.onPropsChange();
1233
- }, imageRestriction: function() {
1234
- this.reset();
1235
- }, stencilProps: function(t, e) {
1236
- ["aspectRatio", "minAspectRatio", "maxAspectRatio"].find((function(i) {
1237
- return t[i] !== e[i];
1238
- })) && this.$nextTick(this.onPropsChange);
1239
- } }, created: function() {
1240
- this.debouncedUpdate = Mt(this.update, this.debounce), this.debouncedDisableTransitions = Mt(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
1241
- }, mounted: function() {
1242
- this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
1243
- }, unmounted: function() {
1244
- window.removeEventListener("resize", this.refresh), window.removeEventListener("orientationchange", this.refresh), this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.debouncedUpdate.clear(), this.debouncedDisableTransitions.clear();
1245
- }, methods: { getResult: function() {
1246
- var t = this.initialized ? this.prepareResult(b({}, this.coordinates)) : this.defaultCoordinates(), e = { rotate: this.imageTransforms.rotate % 360, flip: b({}, this.imageTransforms.flip) };
1247
- if (this.src && this.imageLoaded) {
1248
- var i = this;
1249
- return { image: this.image, coordinates: t, visibleArea: this.visibleArea ? b({}, this.visibleArea) : null, imageTransforms: e, get canvas() {
1250
- return i.canvas ? i.getCanvas() : void 0;
1251
- } };
1252
- }
1253
- return { image: this.image, coordinates: t, visibleArea: this.visibleArea ? b({}, this.visibleArea) : null, canvas: void 0, imageTransforms: e };
1254
- }, zoom: function(t, e) {
1255
- var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = i.transitions, o = s === void 0 || s;
1256
- this.onManipulateImage(new tt({}, { factor: 1 / t, center: e }), { normalize: !1, transitions: o });
1257
- }, move: function(t, e) {
1258
- var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = i.transitions, o = s === void 0 || s;
1259
- this.onManipulateImage(new tt({ left: t || 0, top: e || 0 }), { normalize: !1, transitions: o });
1260
- }, setCoordinates: function(t) {
1261
- var e = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = i.autoZoom, o = s === void 0 || s, n = i.transitions, a = n === void 0 || n;
1262
- this.$nextTick((function() {
1263
- e.imageLoaded ? (e.transitionsActive || (a && e.enableTransitions(), e.coordinates = e.applyTransform(t), o && e.runAutoZoom("setCoordinates"), a && e.debouncedDisableTransitions()), e.onChange()) : e.delayedTransforms = t;
1264
- }));
1265
- }, refresh: function() {
1266
- var t = this, e = this.$refs.image;
1267
- if (this.src && e) return this.initialized ? this.updateVisibleArea().then((function() {
1268
- t.onChange();
1269
- })) : this.resetVisibleArea().then((function() {
1270
- t.onChange();
1271
- }));
1272
- }, reset: function() {
1273
- var t = this;
1274
- return this.resetVisibleArea().then((function() {
1275
- t.onChange(!1);
1276
- }));
1277
- }, awaitRender: function(t) {
1278
- var e = this;
1279
- this.awaiting || (this.awaiting = !0, this.$nextTick((function() {
1280
- t(), e.awaiting = !1;
1281
- })));
1282
- }, prepareResult: function(t) {
1283
- return this.roundResult ? (function(e) {
1284
- var i = e.coordinates, s = e.sizeRestrictions, o = e.positionRestrictions, n = { width: Math.round(i.width), height: Math.round(i.height), left: Math.round(i.left), top: Math.round(i.top) };
1285
- return n.width > s.maxWidth ? n.width = Math.floor(i.width) : n.width < s.minWidth && (n.width = Math.ceil(i.width)), n.height > s.maxHeight ? n.height = Math.floor(i.height) : n.height < s.minHeight && (n.height = Math.ceil(i.height)), E(n, o);
1286
- })(b(b({}, this.getPublicProperties()), {}, { positionRestrictions: ot(this.positionRestrictions, this.visibleArea), coordinates: t })) : t;
1287
- }, processAutoZoom: function(t, e, i, s) {
1288
- var o = this.autoZoomAlgorithm;
1289
- o || (o = this.stencilSize ? qe : this.autoZoom ? Ge : Qe);
1290
- var n = o({ event: { type: t, params: s }, visibleArea: e, coordinates: i, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
1291
- return b(b({}, n), {}, { changed: !qt(n.visibleArea, e) || !qt(n.coordinates, i) });
1292
- }, runAutoZoom: function(t) {
1293
- var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = e.transitions, s = i !== void 0 && i, o = Pe(e, gi), n = this.processAutoZoom(t, this.visibleArea, this.coordinates, o), a = n.visibleArea, h = n.coordinates, r = n.changed;
1294
- s && r && this.enableTransitions(), this.visibleArea = a, this.coordinates = h, s && r && this.debouncedDisableTransitions();
1295
- }, normalizeEvent: function(t) {
1296
- return (function(e) {
1297
- var i = e.event, s = e.visibleArea, o = e.coefficient;
1298
- if (i.type === "manipulateImage") return g(g({}, i), { move: { left: i.move && i.move.left ? o * i.move.left : 0, top: i.move && i.move.top ? o * i.move.top : 0 }, scale: { factor: i.scale && i.scale.factor ? i.scale.factor : 1, center: i.scale && i.scale.center ? { left: i.scale.center.left * o + s.left, top: i.scale.center.top * o + s.top } : null } });
1299
- if (i.type === "resize") {
1300
- var n = g(g({}, i), { directions: g({}, i.directions) });
1301
- return B.forEach((function(h) {
1302
- n.directions[h] *= o;
1303
- })), n;
1304
- }
1305
- if (i.type === "move") {
1306
- var a = g(g({}, i), { directions: g({}, i.directions) });
1307
- return Ue.forEach((function(h) {
1308
- a.directions[h] *= o;
1309
- })), a;
1310
- }
1311
- return i;
1312
- })(b(b({}, this.getPublicProperties()), {}, { event: t }));
1313
- }, getCanvas: function() {
1314
- if (this.$refs.canvas) {
1315
- var t = this.$refs.canvas, e = this.$refs.image, i = this.imageTransforms.rotate !== 0 || this.imageTransforms.flip.horizontal || this.imageTransforms.flip.vertical ? (function(h, r, l) {
1316
- var c = l.rotate, u = l.flip, d = { width: r.naturalWidth, height: r.naturalHeight }, m = ce(d, c), p = h.getContext("2d");
1317
- h.height = m.height, h.width = m.width, p.save();
1318
- var v = F(C(g({ left: 0, top: 0 }, d)), c);
1319
- return p.translate(-(v.left - m.width / 2), -(v.top - m.height / 2)), p.rotate(c * Math.PI / 180), p.translate(u.horizontal ? d.width : 0, u.vertical ? d.height : 0), p.scale(u.horizontal ? -1 : 1, u.vertical ? -1 : 1), p.drawImage(r, 0, 0, d.width, d.height), p.restore(), h;
1320
- })(this.$refs.sourceCanvas, e, this.imageTransforms) : e, s = b({ minWidth: 0, minHeight: 0, maxWidth: 1 / 0, maxHeight: 1 / 0, maxArea: this.maxCanvasSize, imageSmoothingEnabled: !0, imageSmoothingQuality: "high", fillColor: "transparent" }, this.canvas), o = function(h) {
1321
- return h.find((function(r) {
1322
- return l = r, !Number.isNaN(parseFloat(l)) && isFinite(l);
1323
- var l;
1324
- }));
1325
- }, n = Y({ sizeRestrictions: { minWidth: o([s.width, s.minWidth]) || 0, minHeight: o([s.height, s.minHeight]) || 0, maxWidth: o([s.width, s.maxWidth]) || 1 / 0, maxHeight: o([s.height, s.maxHeight]) || 1 / 0 }, width: this.coordinates.width, height: this.coordinates.height, aspectRatio: { minimum: this.coordinates.width / this.coordinates.height, maximum: this.coordinates.width / this.coordinates.height } });
1326
- if (s.maxArea && n.width * n.height > s.maxArea) {
1327
- var a = Math.sqrt(s.maxArea / (n.width * n.height));
1328
- n = { width: Math.round(a * n.width), height: Math.round(a * n.height) };
1329
- }
1330
- return (function(h, r, l, c, u) {
1331
- h.width = c ? c.width : l.width, h.height = c ? c.height : l.height;
1332
- var d = h.getContext("2d");
1333
- d.clearRect(0, 0, h.width, h.height), u && (u.imageSmoothingEnabled && (d.imageSmoothingEnabled = u.imageSmoothingEnabled), u.imageSmoothingQuality && (d.imageSmoothingQuality = u.imageSmoothingQuality), u.fillColor && (d.fillStyle = u.fillColor, d.fillRect(0, 0, h.width, h.height), d.save()));
1334
- var m = l.left < 0 ? -l.left : 0, p = l.top < 0 ? -l.top : 0;
1335
- d.drawImage(r, l.left + m, l.top + p, l.width, l.height, m * (h.width / l.width), p * (h.height / l.height), h.width, h.height);
1336
- })(t, i, this.coordinates, n, s), t;
1337
- }
1338
- }, update: function() {
1339
- this.$emit("change", this.getResult());
1340
- }, applyTransform: function(t) {
1341
- var e = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], i = this.visibleArea && e ? Ve(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, s = this.visibleArea && e ? ot(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
1342
- return Ze({ transform: t, coordinates: this.coordinates, imageSize: this.imageSize, sizeRestrictions: i, positionRestrictions: s, aspectRatio: this.getAspectRatio(), visibleArea: this.visibleArea });
1343
- }, resetCoordinates: function() {
1344
- var t = this;
1345
- if (this.$refs.image) {
1346
- this.$refs.cropper, this.$refs.image;
1347
- var e = this.defaultSize;
1348
- e || (e = this.stencilSize ? ti : Je);
1349
- var i = this.sizeRestrictions;
1350
- i.minWidth, i.minHeight, i.maxWidth, i.maxHeight;
1351
- var s = G(e) ? e({ boundaries: this.boundaries, imageSize: this.imageSize, aspectRatio: this.getAspectRatio(), sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize(), visibleArea: this.visibleArea }) : e, o = this.defaultPosition || Ke, n = [s, function(a) {
1352
- var h = a.coordinates;
1353
- return b({}, G(o) ? o({ coordinates: h, imageSize: t.imageSize, visibleArea: t.visibleArea }) : t.defaultPosition);
1354
- }];
1355
- this.delayedTransforms && n.push.apply(n, V(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(n, !0), this.delayedTransforms = null;
1356
- }
1357
- }, clearImage: function() {
1358
- var t = this;
1359
- this.imageLoaded = !1, setTimeout((function() {
1360
- var e = t.$refs.stretcher;
1361
- e && (e.style.height = "auto", e.style.width = "auto"), t.coordinates = t.defaultCoordinates(), t.boundaries = { width: 0, height: 0 };
1362
- }), this.transitionTime);
1363
- }, enableTransitions: function() {
1364
- this.transitions && (this.transitionsActive = !0);
1365
- }, disableTransitions: function() {
1366
- this.transitionsActive = !1;
1367
- }, updateBoundaries: function() {
1368
- var t = this, e = this.$refs.stretcher, i = this.$refs.cropper;
1369
- return this.initStretcher({ cropper: i, stretcher: e, imageSize: this.imageSize }), this.$nextTick().then((function() {
1370
- var s = { cropper: i, imageSize: t.imageSize };
1371
- if (G(t.defaultBoundaries) ? t.boundaries = t.defaultBoundaries(s) : t.defaultBoundaries === "fit" ? t.boundaries = (function(o) {
1372
- var n = o.cropper, a = o.imageSize, h = n.clientHeight, r = n.clientWidth, l = h, c = a.width * h / a.height;
1373
- return c > r && (c = r, l = a.height * r / a.width), { width: c, height: l };
1374
- })(s) : t.boundaries = (function(o) {
1375
- var n = o.cropper;
1376
- return { width: n.clientWidth, height: n.clientHeight };
1377
- })(s), !t.boundaries.width || !t.boundaries.height) throw new Error("It's impossible to fit the cropper in the current container");
1378
- }));
1379
- }, resetVisibleArea: function() {
1380
- var t = this;
1381
- return this.appliedImageTransforms = b(b({}, this.defaultImageTransforms), {}, { flip: b({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
1382
- t.priority !== "visible-area" && (t.visibleArea = null, t.resetCoordinates());
1383
- var e, i, s, o, n, a, h = t.defaultVisibleArea || ei;
1384
- t.visibleArea = G(h) ? h({ imageSize: t.imageSize, boundaries: t.boundaries, coordinates: t.priority !== "visible-area" ? t.coordinates : null, getAreaRestrictions: t.getAreaRestrictions, stencilSize: t.getStencilSize() }) : t.defaultVisibleArea, t.visibleArea = (e = { visibleArea: t.visibleArea, boundaries: t.boundaries, getAreaRestrictions: t.getAreaRestrictions }, i = e.visibleArea, s = e.boundaries, o = e.getAreaRestrictions, n = g({}, i), a = w(s), n.width / n.height !== a && (n.height = n.width / a), E(n, o({ visibleArea: n, type: "move" }))), t.priority === "visible-area" ? t.resetCoordinates() : t.coordinates = t.fitCoordinates({ visibleArea: t.visibleArea, coordinates: t.coordinates, aspectRatio: t.getAspectRatio(), positionRestrictions: t.positionRestrictions, sizeRestrictions: t.sizeRestrictions }), t.runAutoZoom("resetVisibleArea");
1385
- })).catch((function() {
1386
- t.visibleArea = null;
1387
- }));
1388
- }, updateVisibleArea: function() {
1389
- var t = this;
1390
- return this.updateBoundaries().then((function() {
1391
- t.visibleArea = t.fitVisibleArea({ imageSize: t.imageSize, boundaries: t.boundaries, visibleArea: t.visibleArea, coordinates: t.coordinates, getAreaRestrictions: t.getAreaRestrictions }), t.coordinates = t.fitCoordinates({ visibleArea: t.visibleArea, coordinates: t.coordinates, aspectRatio: t.getAspectRatio(), positionRestrictions: t.positionRestrictions, sizeRestrictions: t.sizeRestrictions }), t.runAutoZoom("updateVisibleArea");
1392
- })).catch((function() {
1393
- t.visibleArea = null;
1394
- }));
1395
- }, onChange: function() {
1396
- var t = !(arguments.length > 0 && arguments[0] !== void 0) || arguments[0];
1397
- t && this.debounce ? this.debouncedUpdate() : this.update();
1398
- }, onChangeImage: function() {
1399
- var t, e = this;
1400
- if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
1401
- if ((function(o) {
1402
- if (Nt(o)) return !1;
1403
- var n = window.location, a = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(o) || [], h = { protocol: a[1] || "", host: a[2] || "", port: a[3] || "" }, r = function(l) {
1404
- return l.port || ((l.protocol || n.protocol) === "http" ? 80 : 433);
1405
- };
1406
- return !(!h.protocol && !h.host && !h.port || h.protocol && h.protocol == n.protocol && h.host && h.host == n.host && h.host && r(h) == r(n));
1407
- })(this.src)) {
1408
- var i = M(this.crossOrigin) ? this.canvas : this.crossOrigin;
1409
- i === !0 && (i = "anonymous"), this.imageAttributes.crossOrigin = i || null;
1410
- }
1411
- if (this.checkOrientation) {
1412
- var s = (t = this.src, new Promise((function(o) {
1413
- di(t).then((function(n) {
1414
- var a = mi(n);
1415
- o(n ? { source: t, arrayBuffer: n, orientation: a } : { source: t, arrayBuffer: null, orientation: null });
1416
- })).catch((function(n) {
1417
- console.warn(n), o({ source: t, arrayBuffer: null, orientation: null });
1418
- }));
1419
- })));
1420
- setTimeout((function() {
1421
- s.then(e.onParseImage);
1422
- }), this.transitionTime);
1423
- } else setTimeout((function() {
1424
- e.onParseImage({ source: e.src });
1425
- }), this.transitionTime);
1426
- } else this.clearImage();
1427
- }, onFailLoadImage: function() {
1428
- this.imageAttributes.src && (this.clearImage(), this.$emit("error"));
1429
- }, onSuccessLoadImage: function() {
1430
- var t = this, e = this.$refs.image;
1431
- e && !this.imageLoaded && (this.imageAttributes.height = e.naturalHeight, this.imageAttributes.width = e.naturalWidth, this.imageLoaded = !0, this.resetVisibleArea().then((function() {
1432
- t.$emit("ready"), t.onChange(!1);
1433
- })));
1434
- }, onParseImage: function(t) {
1435
- var e = this, i = t.source, s = t.arrayBuffer, o = t.orientation;
1436
- this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, s && o && o > 1 ? se(i) || !Nt(i) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([s])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = (function(n) {
1437
- for (var a = [], h = new Uint8Array(n); h.length > 0; ) {
1438
- var r = h.subarray(0, 8192);
1439
- a.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), h = h.subarray(8192);
1440
- }
1441
- return "data:image/jpeg;base64," + btoa(a.join(""));
1442
- })(s) : this.imageAttributes.src = i, G(this.defaultTransforms) ? this.appliedImageTransforms = zt(this.defaultTransforms()) : ht(this.defaultTransforms) ? this.appliedImageTransforms = zt(this.defaultTransforms) : this.appliedImageTransforms = (function(n) {
1443
- var a = zt({});
1444
- if (n) switch (n) {
1445
- case 2:
1446
- a.flip.horizontal = !0;
1447
- break;
1448
- case 3:
1449
- a.rotate = -180;
1450
- break;
1451
- case 4:
1452
- a.flip.vertical = !0;
1453
- break;
1454
- case 5:
1455
- a.rotate = 90, a.flip.vertical = !0;
1456
- break;
1457
- case 6:
1458
- a.rotate = 90;
1459
- break;
1460
- case 7:
1461
- a.rotate = 90, a.flip.horizontal = !0;
1462
- break;
1463
- case 8:
1464
- a.rotate = -90;
1465
- }
1466
- return a;
1467
- })(o), this.defaultImageTransforms = b(b({}, this.appliedImageTransforms), {}, { flip: b({}, this.appliedImageTransforms.flip) }), this.$nextTick((function() {
1468
- var n = e.$refs.image;
1469
- n && n.complete && ((function(a) {
1470
- return !!a.naturalWidth;
1471
- })(n) ? e.onSuccessLoadImage() : e.onFailLoadImage());
1472
- }));
1473
- }, onResizeEnd: function() {
1474
- this.runAutoZoom("resize", { transitions: !0 });
1475
- }, onMoveEnd: function() {
1476
- this.runAutoZoom("move", { transitions: !0 });
1477
- }, onMove: function(t) {
1478
- var e = this;
1479
- this.transitionsOptions.enabled || this.awaitRender((function() {
1480
- e.coordinates = e.moveAlgorithm(b(b({}, e.getPublicProperties()), {}, { positionRestrictions: ot(e.positionRestrictions, e.visibleArea), coordinates: e.coordinates, event: e.normalizeEvent(t) })), e.onChange();
1481
- }));
1482
- }, onResize: function(t) {
1483
- var e = this;
1484
- this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
1485
- var i = e.sizeRestrictions, s = Math.min(e.coordinates.width, e.coordinates.height, 20 * e.coefficient);
1486
- e.coordinates = e.resizeAlgorithm(b(b({}, e.getPublicProperties()), {}, { positionRestrictions: ot(e.positionRestrictions, e.visibleArea), sizeRestrictions: { maxWidth: Math.min(i.maxWidth, e.visibleArea.width), maxHeight: Math.min(i.maxHeight, e.visibleArea.height), minWidth: Math.max(i.minWidth, s), minHeight: Math.max(i.minHeight, s) }, event: e.normalizeEvent(t) })), e.onChange(), e.ticking = !1;
1487
- }));
1488
- }, onManipulateImage: function(t) {
1489
- var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1490
- if (!this.transitionsOptions.enabled) {
1491
- var i = e.transitions, s = i !== void 0 && i, o = e.normalize, n = o === void 0 || o;
1492
- s && this.enableTransitions();
1493
- var a = ii(b(b({}, this.getPublicProperties()), {}, { event: n ? this.normalizeEvent(t) : t, getAreaRestrictions: this.getAreaRestrictions, imageRestriction: this.imageRestriction, adjustStencil: !this.stencilSize && this.settings.resizeImage.adjustStencil })), h = a.visibleArea, r = a.coordinates;
1494
- this.visibleArea = h, this.coordinates = r, this.runAutoZoom("manipulateImage"), this.onChange(), s && this.debouncedDisableTransitions();
1495
- }
1496
- }, onPropsChange: function() {
1497
- this.coordinates = this.applyTransform(this.coordinates, !0), this.onChange(!1);
1498
- }, getAreaRestrictions: function() {
1499
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.visibleArea, i = t.type, s = i === void 0 ? "move" : i;
1500
- return this.areaRestrictionsAlgorithm({ boundaries: this.boundaries, imageSize: this.imageSize, imageRestriction: this.imageRestriction, visibleArea: e, type: s });
1501
- }, getAspectRatio: function(t) {
1502
- var e, i, s = this.stencilProps, o = s.aspectRatio, n = s.minAspectRatio, a = s.maxAspectRatio;
1503
- if (this.$refs.stencil && this.$refs.stencil.aspectRatios) {
1504
- var h = this.$refs.stencil.aspectRatios();
1505
- e = h.minimum, i = h.maximum;
1506
- }
1507
- if (M(e) && (e = M(o) ? n : o), M(i) && (i = M(o) ? a : o), !t && (M(e) || M(i))) {
1508
- var r = this.getStencilSize(), l = r ? w(r) : null;
1509
- M(e) && (e = Vt(l) ? l : void 0), M(i) && (i = Vt(l) ? l : void 0);
1510
- }
1511
- return { minimum: e, maximum: i };
1512
- }, getStencilSize: function() {
1513
- if (this.stencilSize) return t = { currentStencilSize: { width: this.stencilCoordinates.width, height: this.stencilCoordinates.height }, stencilSize: this.stencilSize, boundaries: this.boundaries, coefficient: this.coefficient, coordinates: this.coordinates, aspectRatio: this.getAspectRatio(!0) }, e = t.boundaries, i = t.stencilSize, s = t.aspectRatio, wt(w(o = G(i) ? i({ boundaries: e, aspectRatio: s }) : i), s) && (o = Y({ sizeRestrictions: { maxWidth: e.width, maxHeight: e.height, minWidth: 0, minHeight: 0 }, width: o.width, height: o.height, aspectRatio: { minimum: s.minimum, maximum: s.maximum } })), (o.width > e.width || o.height > e.height) && (o = Y({ sizeRestrictions: { maxWidth: e.width, maxHeight: e.height, minWidth: 0, minHeight: 0 }, width: o.width, height: o.height, aspectRatio: { minimum: w(o), maximum: w(o) } })), o;
1514
- var t, e, i, s, o;
1515
- }, getPublicProperties: function() {
1516
- return { coefficient: this.coefficient, visibleArea: this.visibleArea, coordinates: this.coordinates, boundaries: this.boundaries, sizeRestrictions: this.sizeRestrictions, positionRestrictions: this.positionRestrictions, aspectRatio: this.getAspectRatio(), imageRestriction: this.imageRestriction };
1517
- }, defaultCoordinates: function() {
1518
- return b({}, Zt);
1519
- }, flip: function(t, e) {
1520
- var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = i.transitions, o = s === void 0 || s;
1521
- if (!this.transitionsActive) {
1522
- o && this.enableTransitions();
1523
- var n = b({}, this.imageTransforms.flip), a = si({ flip: { horizontal: t ? !n.horizontal : n.horizontal, vertical: e ? !n.vertical : n.vertical }, previousFlip: n, rotate: this.imageTransforms.rotate, visibleArea: this.visibleArea, coordinates: this.coordinates, imageSize: this.imageSize, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), h = a.visibleArea, r = a.coordinates;
1524
- t && (this.appliedImageTransforms.flip.horizontal = !this.appliedImageTransforms.flip.horizontal), e && (this.appliedImageTransforms.flip.vertical = !this.appliedImageTransforms.flip.vertical), this.visibleArea = h, this.coordinates = r, this.onChange(), o && this.debouncedDisableTransitions();
1525
- }
1526
- }, rotate: function(t) {
1527
- var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = e.transitions, s = i === void 0 || i;
1528
- if (!this.transitionsActive) {
1529
- s && this.enableTransitions();
1530
- var o = b({}, this.imageSize);
1531
- this.appliedImageTransforms.rotate += t;
1532
- var n = ni({ visibleArea: this.visibleArea, coordinates: this.coordinates, previousImageSize: o, imageSize: this.imageSize, angle: t, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), a = n.visibleArea, h = n.coordinates, r = this.processAutoZoom("rotateImage", a, h);
1533
- a = r.visibleArea, h = r.coordinates, this.visibleArea = a, this.coordinates = h, this.onChange(), s && this.debouncedDisableTransitions();
1534
- }
1535
- } }, emits: ["change", "error", "ready"] }, fi = { key: 0, ref: "canvas", style: { display: "none" } }, pi = { key: 1, ref: "sourceCanvas", style: { display: "none" } };
1536
- pe.render = function(t, e, i, s, o, n) {
1537
- return y(), x("div", { ref: "cropper", class: n.classes.cropper }, [f("div", { ref: "stretcher", class: n.classes.stretcher }, null, 2), f("div", { class: n.classes.boundaries, style: n.boundariesStyle }, [(y(), x(lt(i.backgroundWrapperComponent), { class: n.classes.cropperWrapper, "wheel-resize": n.settings.resizeImage.wheel, "touch-resize": n.settings.resizeImage.touch, "touch-move": n.settings.moveImage.touch, "mouse-move": n.settings.moveImage.mouse, onMove: n.onManipulateImage, onResize: n.onManipulateImage }, { default: A((function() {
1538
- return [f("div", { class: n.classes.background, style: n.boundariesStyle }, null, 6), f("div", { class: n.classes.imageWrapper }, [f("img", { ref: "image", crossorigin: o.imageAttributes.crossOrigin, src: o.imageAttributes.src, class: n.classes.image, style: n.imageStyle, onMousedown: e[1] || (e[1] = ye((function() {
1539
- }), ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), f("div", { class: n.classes.foreground, style: n.boundariesStyle }, null, 6), te((y(), x(lt(i.stencilComponent), ie({ ref: "stencil", image: n.image, coordinates: o.coordinates, "stencil-coordinates": n.stencilCoordinates, transitions: n.transitionsOptions }, i.stencilProps, { onResize: n.onResize, onResizeEnd: n.onResizeEnd, onMove: n.onMove, onMoveEnd: n.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[ee, o.imageLoaded]]), i.canvas ? (y(), x("canvas", fi, null, 512)) : Bt("", !0), i.canvas ? (y(), x("canvas", pi, null, 512)) : Bt("", !0)];
1540
- })), _: 1 }, 8, ["class", "wheel-resize", "touch-resize", "touch-move", "mouse-move", "onMove", "onResize"]))], 6)], 2);
1541
- };
1542
- const vi = { class: "sl-fixed sl-inset-0 sl-z-10 sl-w-screen sl-overflow-y-auto" }, bi = { class: "sl-flex sl-min-h-full sl-items-center sl-justify-center sl-p-4" }, wi = { class: "sl-flex sl-items-center sl-justify-between sl-px-6 sl-py-4 sl-border-b sl-border-gray-200 dark:sl-border-gray-700" }, yi = { class: "sl-relative sl-bg-gray-900 dark:sl-bg-gray-950" }, zi = { class: "sl-px-6 sl-py-4 sl-bg-gray-50 dark:sl-bg-gray-900 sl-border-t sl-border-gray-200 dark:sl-border-gray-700" }, xi = { class: "sl-flex sl-items-center sl-justify-center sl-gap-4 sl-mb-4" }, Ri = { class: "sl-flex sl-items-center sl-gap-2 sl-text-sm sl-text-gray-500 dark:sl-text-gray-400" }, Ai = { class: "sl-flex sl-justify-end sl-gap-3" }, Mi = /* @__PURE__ */ ze({
1
+ import { defineComponent as U, shallowRef as W, ref as v, computed as p, createBlock as E, openBlock as S, unref as s, withCtx as n, createVNode as t, createElementVNode as e, createTextVNode as y, toDisplayString as m } from "vue";
2
+ import { TransitionRoot as N, Dialog as Q, TransitionChild as f, DialogPanel as F, DialogTitle as G } from "@headlessui/vue";
3
+ import { CircleStencil as O, RectangleStencil as X, Cropper as q } from "vue-advanced-cropper";
4
+ import { XMarkIcon as J, MinusIcon as K, MagnifyingGlassIcon as Y, PlusIcon as Z, ArrowUturnLeftIcon as $, ArrowUturnRightIcon as ee, ArrowsRightLeftIcon as te, ArrowsUpDownIcon as le, ArrowPathIcon as se, CheckIcon as ae } from "@heroicons/vue/24/outline";
5
+ import b from "../components/Button.js";
6
+ import { _ as re } from "../_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const oe = { class: "sl-fixed sl-inset-0 sl-z-10 sl-w-screen sl-overflow-y-auto" }, ne = { class: "sl-flex sl-min-h-full sl-items-center sl-justify-center sl-p-4" }, ie = { class: "sl-flex sl-items-center sl-justify-between sl-px-6 sl-py-4 sl-border-b sl-border-gray-200 dark:sl-border-gray-700" }, ce = { class: "sl-relative sl-bg-gray-900 dark:sl-bg-gray-950" }, de = { class: "sl-px-6 sl-py-4 sl-bg-gray-50 dark:sl-bg-gray-900 sl-border-t sl-border-gray-200 dark:sl-border-gray-700" }, ge = { class: "sl-flex sl-items-center sl-justify-center sl-gap-4 sl-mb-4" }, ue = { class: "sl-flex sl-items-center sl-gap-2 sl-text-sm sl-text-gray-500 dark:sl-text-gray-400" }, pe = { class: "sl-flex sl-justify-end sl-gap-3" }, ye = /* @__PURE__ */ U({
1543
8
  __name: "ImageCropperModal",
1544
9
  props: {
1545
10
  modelValue: { type: Boolean },
@@ -1556,83 +21,83 @@ const vi = { class: "sl-fixed sl-inset-0 sl-z-10 sl-w-screen sl-overflow-y-auto"
1556
21
  title: { default: "Crop Image" }
1557
22
  },
1558
23
  emits: ["update:modelValue", "crop", "cancel"],
1559
- setup(t, { emit: e }) {
1560
- const i = t, s = e, o = xe(null), n = It(!1), a = It(1), h = ft(() => i.stencilType === "circle" ? fe : Ht), r = ft(() => {
1561
- const k = {
24
+ setup(x, { emit: k }) {
25
+ const a = x, c = k, l = W(null), g = v(!1), i = v(1), w = p(() => a.stencilType === "circle" ? O : X), _ = p(() => {
26
+ const r = {
1562
27
  handlers: {},
1563
28
  movable: !0,
1564
29
  resizable: !0,
1565
- aspectRatio: i.aspectRatio
30
+ aspectRatio: a.aspectRatio
1566
31
  };
1567
- return i.stencilType === "circle" && (k.previewClass = "sl-rounded-full"), k;
1568
- }), l = ft(() => ({ imageSize: k, visibleArea: O }) => ({
1569
- width: (O?.width || k.width) * 0.8,
1570
- height: (O?.height || k.height) * 0.8
1571
- })), c = {
32
+ return a.stencilType === "circle" && (r.previewClass = "sl-rounded-full"), r;
33
+ }), C = p(() => ({ imageSize: r, visibleArea: o }) => ({
34
+ width: (o?.width || r.width) * 0.8,
35
+ height: (o?.height || r.height) * 0.8
36
+ })), I = {
1572
37
  adjustStencil: !1
1573
- }, u = () => {
1574
- }, d = () => {
1575
- o.value && (o.value.zoom(1.1), a.value = Math.min(a.value * 1.1, 3));
1576
- }, m = () => {
1577
- o.value && (o.value.zoom(0.9), a.value = Math.max(a.value * 0.9, 0.5));
1578
- }, p = () => {
1579
- o.value && o.value.rotate(-90);
1580
- }, v = () => {
1581
- o.value && o.value.rotate(90);
38
+ }, R = () => {
39
+ }, z = () => {
40
+ l.value && (l.value.zoom(1.1), i.value = Math.min(i.value * 1.1, 3));
1582
41
  }, T = () => {
1583
- o.value && o.value.flip(!0, !1);
1584
- }, $ = () => {
1585
- o.value && o.value.flip(!1, !0);
1586
- }, U = () => {
1587
- o.value && (o.value.reset(), a.value = 1);
1588
- }, X = () => {
1589
- s("cancel"), s("update:modelValue", !1);
1590
- }, N = async () => {
1591
- if (o.value) {
1592
- n.value = !0;
42
+ l.value && (l.value.zoom(0.9), i.value = Math.max(i.value * 0.9, 0.5));
43
+ }, M = () => {
44
+ l.value && l.value.rotate(-90);
45
+ }, V = () => {
46
+ l.value && l.value.rotate(90);
47
+ }, B = () => {
48
+ l.value && l.value.flip(!0, !1);
49
+ }, j = () => {
50
+ l.value && l.value.flip(!1, !0);
51
+ }, D = () => {
52
+ l.value && (l.value.reset(), i.value = 1);
53
+ }, u = () => {
54
+ c("cancel"), c("update:modelValue", !1);
55
+ }, P = async () => {
56
+ if (l.value) {
57
+ g.value = !0;
1593
58
  try {
1594
- const { canvas: k, coordinates: O } = o.value.getResult();
1595
- if (!k)
59
+ const { canvas: r, coordinates: o } = l.value.getResult();
60
+ if (!r)
1596
61
  throw new Error("Failed to get canvas from cropper");
1597
- const it = {
1598
- coordinates: O
62
+ const d = {
63
+ coordinates: o
1599
64
  };
1600
- if (i.outputType === "canvas")
1601
- it.canvas = k;
1602
- else if (i.outputType === "base64")
1603
- it.base64 = k.toDataURL(i.outputMimeType, i.outputQuality);
65
+ if (a.outputType === "canvas")
66
+ d.canvas = r;
67
+ else if (a.outputType === "base64")
68
+ d.base64 = r.toDataURL(a.outputMimeType, a.outputQuality);
1604
69
  else {
1605
- const ve = await new Promise((be, we) => {
1606
- k.toBlob(
1607
- (Lt) => {
1608
- Lt ? be(Lt) : we(new Error("Failed to create blob"));
70
+ const A = await new Promise((H, L) => {
71
+ r.toBlob(
72
+ (h) => {
73
+ h ? H(h) : L(new Error("Failed to create blob"));
1609
74
  },
1610
- i.outputMimeType,
1611
- i.outputQuality
75
+ a.outputMimeType,
76
+ a.outputQuality
1612
77
  );
1613
78
  });
1614
- it.blob = ve;
79
+ d.blob = A;
1615
80
  }
1616
- s("crop", it), s("update:modelValue", !1);
1617
- } catch (k) {
1618
- console.error("Error cropping image:", k);
81
+ c("crop", d), c("update:modelValue", !1);
82
+ } catch (r) {
83
+ console.error("Error cropping image:", r);
1619
84
  } finally {
1620
- n.value = !1;
85
+ g.value = !1;
1621
86
  }
1622
87
  }
1623
88
  };
1624
- return (k, O) => (y(), x(S(Se), {
89
+ return (r, o) => (S(), E(s(N), {
1625
90
  as: "template",
1626
- show: i.modelValue
91
+ show: a.modelValue
1627
92
  }, {
1628
- default: A(() => [
1629
- f(S(Ce), {
93
+ default: n(() => [
94
+ t(s(Q), {
1630
95
  as: "div",
1631
96
  class: "sl-relative sl-z-50",
1632
- onClose: X
97
+ onClose: u
1633
98
  }, {
1634
- default: A(() => [
1635
- f(S(Xt), {
99
+ default: n(() => [
100
+ t(s(f), {
1636
101
  as: "template",
1637
102
  enter: "ease-out duration-300",
1638
103
  "enter-from": "opacity-0",
@@ -1641,14 +106,14 @@ const vi = { class: "sl-fixed sl-inset-0 sl-z-10 sl-w-screen sl-overflow-y-auto"
1641
106
  "leave-from": "opacity-100",
1642
107
  "leave-to": "opacity-0"
1643
108
  }, {
1644
- default: A(() => [...O[0] || (O[0] = [
1645
- z("div", { class: "sl-fixed sl-inset-0 sl-bg-black/50 dark:sl-bg-gray-900/80 sl-transition-opacity" }, null, -1)
109
+ default: n(() => [...o[0] || (o[0] = [
110
+ e("div", { class: "sl-fixed sl-inset-0 sl-bg-black/50 dark:sl-bg-gray-900/80 sl-transition-opacity" }, null, -1)
1646
111
  ])]),
1647
112
  _: 1
1648
113
  }),
1649
- z("div", vi, [
1650
- z("div", bi, [
1651
- f(S(Xt), {
114
+ e("div", oe, [
115
+ e("div", ne, [
116
+ t(s(f), {
1652
117
  as: "template",
1653
118
  enter: "ease-out duration-300",
1654
119
  "enter-from": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
@@ -1657,123 +122,123 @@ const vi = { class: "sl-fixed sl-inset-0 sl-z-10 sl-w-screen sl-overflow-y-auto"
1657
122
  "leave-from": "opacity-100 translate-y-0 sm:scale-100",
1658
123
  "leave-to": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
1659
124
  }, {
1660
- default: A(() => [
1661
- f(S(Ee), {
125
+ default: n(() => [
126
+ t(s(F), {
1662
127
  class: "sl-relative sl-transform sl-rounded-xl sl-bg-white dark:sl-bg-gray-900 sl-text-left sl-shadow-2xl sl-transition-all sl-w-full",
1663
128
  style: { maxWidth: "56rem" }
1664
129
  }, {
1665
- default: A(() => [
1666
- z("div", wi, [
1667
- f(S(Te), { class: "sl-text-lg sl-font-semibold sl-text-gray-900 dark:sl-text-white" }, {
1668
- default: A(() => [
1669
- pt(_t(i.title), 1)
130
+ default: n(() => [
131
+ e("div", ie, [
132
+ t(s(G), { class: "sl-text-lg sl-font-semibold sl-text-gray-900 dark:sl-text-white" }, {
133
+ default: n(() => [
134
+ y(m(a.title), 1)
1670
135
  ]),
1671
136
  _: 1
1672
137
  }),
1673
- z("button", {
138
+ e("button", {
1674
139
  type: "button",
1675
140
  class: "sl-rounded-lg sl-p-2 sl-text-gray-500 dark:sl-text-gray-400 hover:sl-text-gray-700 dark:hover:sl-text-white hover:sl-bg-gray-100 dark:hover:sl-bg-gray-800 sl-transition-colors",
1676
- onClick: X
141
+ onClick: u
1677
142
  }, [
1678
- f(S(Re), { class: "sl-h-5 sl-w-5" })
143
+ t(s(J), { class: "sl-h-5 sl-w-5" })
1679
144
  ])
1680
145
  ]),
1681
- z("div", yi, [
1682
- f(S(pe), {
146
+ e("div", ce, [
147
+ t(s(q), {
1683
148
  ref_key: "cropperRef",
1684
- ref: o,
149
+ ref: l,
1685
150
  class: "cropper",
1686
- src: i.image,
1687
- "stencil-component": h.value,
1688
- "stencil-props": r.value,
1689
- "default-size": l.value,
1690
- "resize-image": c,
1691
- "min-width": i.minWidth,
1692
- "min-height": i.minHeight,
1693
- "max-width": i.maxWidth,
1694
- "max-height": i.maxHeight,
151
+ src: a.image,
152
+ "stencil-component": w.value,
153
+ "stencil-props": _.value,
154
+ "default-size": C.value,
155
+ "resize-image": I,
156
+ "min-width": a.minWidth,
157
+ "min-height": a.minHeight,
158
+ "max-width": a.maxWidth,
159
+ "max-height": a.maxHeight,
1695
160
  "background-class": "cropper-bg",
1696
- onReady: u
161
+ onReady: R
1697
162
  }, null, 8, ["src", "stencil-component", "stencil-props", "default-size", "min-width", "min-height", "max-width", "max-height"])
1698
163
  ]),
1699
- z("div", zi, [
1700
- z("div", xi, [
1701
- z("button", {
164
+ e("div", de, [
165
+ e("div", ge, [
166
+ e("button", {
1702
167
  type: "button",
1703
168
  class: "sl-p-2 sl-rounded-lg sl-bg-gray-200 dark:sl-bg-gray-800 sl-text-gray-600 dark:sl-text-gray-300 hover:sl-bg-gray-300 dark:hover:sl-bg-gray-700 hover:sl-text-gray-900 dark:hover:sl-text-white sl-transition-colors",
1704
- onClick: m
169
+ onClick: T
1705
170
  }, [
1706
- f(S(Ae), { class: "sl-h-5 sl-w-5" })
171
+ t(s(K), { class: "sl-h-5 sl-w-5" })
1707
172
  ]),
1708
- z("div", Ri, [
1709
- f(S($e), { class: "sl-h-4 sl-w-4" }),
1710
- z("span", null, _t(Math.round(a.value * 100)) + "%", 1)
173
+ e("div", ue, [
174
+ t(s(Y), { class: "sl-h-4 sl-w-4" }),
175
+ e("span", null, m(Math.round(i.value * 100)) + "%", 1)
1711
176
  ]),
1712
- z("button", {
177
+ e("button", {
1713
178
  type: "button",
1714
179
  class: "sl-p-2 sl-rounded-lg sl-bg-gray-200 dark:sl-bg-gray-800 sl-text-gray-600 dark:sl-text-gray-300 hover:sl-bg-gray-300 dark:hover:sl-bg-gray-700 hover:sl-text-gray-900 dark:hover:sl-text-white sl-transition-colors",
1715
- onClick: d
180
+ onClick: z
1716
181
  }, [
1717
- f(S(Me), { class: "sl-h-5 sl-w-5" })
182
+ t(s(Z), { class: "sl-h-5 sl-w-5" })
1718
183
  ]),
1719
- O[1] || (O[1] = z("div", { class: "sl-w-px sl-h-6 sl-bg-gray-300 dark:sl-bg-gray-700" }, null, -1)),
1720
- z("button", {
184
+ o[1] || (o[1] = e("div", { class: "sl-w-px sl-h-6 sl-bg-gray-300 dark:sl-bg-gray-700" }, null, -1)),
185
+ e("button", {
1721
186
  type: "button",
1722
187
  class: "sl-p-2 sl-rounded-lg sl-bg-gray-200 dark:sl-bg-gray-800 sl-text-gray-600 dark:sl-text-gray-300 hover:sl-bg-gray-300 dark:hover:sl-bg-gray-700 hover:sl-text-gray-900 dark:hover:sl-text-white sl-transition-colors",
1723
- onClick: p
188
+ onClick: M
1724
189
  }, [
1725
- f(S(Oe), { class: "sl-h-5 sl-w-5" })
190
+ t(s($), { class: "sl-h-5 sl-w-5" })
1726
191
  ]),
1727
- z("button", {
192
+ e("button", {
1728
193
  type: "button",
1729
194
  class: "sl-p-2 sl-rounded-lg sl-bg-gray-200 dark:sl-bg-gray-800 sl-text-gray-600 dark:sl-text-gray-300 hover:sl-bg-gray-300 dark:hover:sl-bg-gray-700 hover:sl-text-gray-900 dark:hover:sl-text-white sl-transition-colors",
1730
- onClick: v
195
+ onClick: V
1731
196
  }, [
1732
- f(S(je), { class: "sl-h-5 sl-w-5" })
197
+ t(s(ee), { class: "sl-h-5 sl-w-5" })
1733
198
  ]),
1734
- z("button", {
199
+ e("button", {
1735
200
  type: "button",
1736
201
  class: "sl-p-2 sl-rounded-lg sl-bg-gray-200 dark:sl-bg-gray-800 sl-text-gray-600 dark:sl-text-gray-300 hover:sl-bg-gray-300 dark:hover:sl-bg-gray-700 hover:sl-text-gray-900 dark:hover:sl-text-white sl-transition-colors",
1737
- onClick: T
202
+ onClick: B
1738
203
  }, [
1739
- f(S(De), { class: "sl-h-5 sl-w-5" })
204
+ t(s(te), { class: "sl-h-5 sl-w-5" })
1740
205
  ]),
1741
- z("button", {
206
+ e("button", {
1742
207
  type: "button",
1743
208
  class: "sl-p-2 sl-rounded-lg sl-bg-gray-200 dark:sl-bg-gray-800 sl-text-gray-600 dark:sl-text-gray-300 hover:sl-bg-gray-300 dark:hover:sl-bg-gray-700 hover:sl-text-gray-900 dark:hover:sl-text-white sl-transition-colors",
1744
- onClick: $
209
+ onClick: j
1745
210
  }, [
1746
- f(S(He), { class: "sl-h-5 sl-w-5" })
211
+ t(s(le), { class: "sl-h-5 sl-w-5" })
1747
212
  ]),
1748
- z("button", {
213
+ e("button", {
1749
214
  type: "button",
1750
215
  class: "sl-p-2 sl-rounded-lg sl-bg-gray-200 dark:sl-bg-gray-800 sl-text-gray-600 dark:sl-text-gray-300 hover:sl-bg-gray-300 dark:hover:sl-bg-gray-700 hover:sl-text-gray-900 dark:hover:sl-text-white sl-transition-colors",
1751
- onClick: U
216
+ onClick: D
1752
217
  }, [
1753
- f(S(ke), { class: "sl-h-5 sl-w-5" })
218
+ t(s(se), { class: "sl-h-5 sl-w-5" })
1754
219
  ])
1755
220
  ]),
1756
- z("div", Ai, [
1757
- f(Yt, {
221
+ e("div", pe, [
222
+ t(b, {
1758
223
  theme: "light",
1759
224
  outlined: !0,
1760
- onButtonClick: X
225
+ onButtonClick: u
1761
226
  }, {
1762
- default: A(() => [...O[2] || (O[2] = [
1763
- pt(" Cancel ", -1)
227
+ default: n(() => [...o[2] || (o[2] = [
228
+ y(" Cancel ", -1)
1764
229
  ])]),
1765
230
  _: 1
1766
231
  }),
1767
- f(Yt, {
232
+ t(b, {
1768
233
  theme: "primary",
1769
- loading: n.value,
1770
- onButtonClick: N
234
+ loading: g.value,
235
+ onButtonClick: P
1771
236
  }, {
1772
- leading: A(() => [
1773
- f(S(Le), { class: "sl-h-4 sl-w-4" })
237
+ leading: n(() => [
238
+ t(s(ae), { class: "sl-h-4 sl-w-4" })
1774
239
  ]),
1775
- default: A(() => [
1776
- O[3] || (O[3] = pt(" Apply Crop ", -1))
240
+ default: n(() => [
241
+ o[3] || (o[3] = y(" Apply Crop ", -1))
1777
242
  ]),
1778
243
  _: 1
1779
244
  }, 8, ["loading"])
@@ -1794,8 +259,7 @@ const vi = { class: "sl-fixed sl-inset-0 sl-z-10 sl-w-screen sl-overflow-y-auto"
1794
259
  _: 1
1795
260
  }, 8, ["show"]));
1796
261
  }
1797
- }), ji = /* @__PURE__ */ We(Mi, [["__scopeId", "data-v-78f9e0cd"]]);
262
+ }), ke = /* @__PURE__ */ re(ye, [["__scopeId", "data-v-78f9e0cd"]]);
1798
263
  export {
1799
- ji as default
264
+ ke as default
1800
265
  };
1801
- //# sourceMappingURL=ImageCropperModal.js.map