@youcan/celeste 0.6.29 → 0.6.31

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 (369) hide show
  1. package/dist/celeste.css +4244 -0
  2. package/dist/cjs/alert.js +111 -0
  3. package/dist/cjs/alpha-slider.js +3 -0
  4. package/dist/cjs/badge.js +55 -0
  5. package/dist/cjs/button.js +39 -0
  6. package/dist/cjs/checkbox-label.js +112 -0
  7. package/dist/cjs/checkbox.js +3 -0
  8. package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -0
  9. package/dist/cjs/chunks/alpha-slider.js +127 -0
  10. package/dist/cjs/chunks/checkbox.vue_vue_type_style_index_0_lang.js +38 -0
  11. package/dist/cjs/chunks/clsx.js +15 -0
  12. package/dist/cjs/chunks/combobox-anchor.js +31 -0
  13. package/dist/cjs/chunks/content-divider.vue_vue_type_style_index_0_lang.js +52 -0
  14. package/dist/cjs/chunks/dropdown-menu-content.vue_vue_type_style_index_0_lang.js +51 -0
  15. package/dist/cjs/chunks/dropdown-menu-sub-content.vue_vue_type_style_index_0_lang.js +49 -0
  16. package/dist/cjs/chunks/dropdown-menu-sub-trigger.vue_vue_type_style_index_0_lang.js +32 -0
  17. package/dist/cjs/chunks/dropdown-menu-sub.js +25 -0
  18. package/dist/cjs/chunks/index.js +9300 -0
  19. package/dist/cjs/chunks/index2.js +1457 -0
  20. package/dist/cjs/chunks/index3.js +16457 -0
  21. package/dist/cjs/chunks/modal-close.js +22 -0
  22. package/dist/cjs/chunks/modal-trigger.js +22 -0
  23. package/dist/cjs/chunks/modal.js +26 -0
  24. package/dist/cjs/chunks/popover.js +26 -0
  25. package/dist/cjs/chunks/scroll-area.js +41 -0
  26. package/dist/cjs/chunks/select-group.js +22 -0
  27. package/dist/cjs/chunks/select.js +38 -0
  28. package/dist/cjs/chunks/slider.vue_vue_type_style_index_0_lang.js +52 -0
  29. package/dist/cjs/chunks/sonner.js +1153 -0
  30. package/dist/cjs/chunks/switch.vue_vue_type_style_index_0_lang.js +38 -0
  31. package/dist/cjs/chunks/use-color-model.js +992 -0
  32. package/dist/cjs/color-area.js +175 -0
  33. package/dist/cjs/color-picker.js +514 -0
  34. package/dist/cjs/color-swatch.js +59 -0
  35. package/dist/cjs/color.js +102 -0
  36. package/dist/cjs/combobox-anchor.js +3 -0
  37. package/dist/cjs/combobox-empty.js +32 -0
  38. package/dist/cjs/combobox-group.js +42 -0
  39. package/dist/cjs/combobox-input.js +63 -0
  40. package/dist/cjs/combobox-item.js +109 -0
  41. package/dist/cjs/combobox-list.js +62 -0
  42. package/dist/cjs/combobox-root.js +40 -0
  43. package/dist/cjs/combobox-separator.js +32 -0
  44. package/dist/cjs/combobox-trigger.js +47 -0
  45. package/dist/cjs/combobox.js +233 -0
  46. package/dist/cjs/command-group.js +41 -0
  47. package/dist/cjs/command-input.js +42 -0
  48. package/dist/cjs/command-item.js +34 -0
  49. package/dist/cjs/command-list.js +52 -0
  50. package/dist/cjs/command-root.js +45 -0
  51. package/dist/cjs/command-separator.js +32 -0
  52. package/dist/cjs/compact-button.js +42 -0
  53. package/dist/cjs/config.js +136 -0
  54. package/dist/cjs/content-divider.js +3 -0
  55. package/dist/cjs/context-menu-item.js +134 -0
  56. package/dist/cjs/crypto.js +8 -0
  57. package/dist/cjs/dropdown-item.js +99 -0
  58. package/dist/cjs/dropdown-menu-content.js +3 -0
  59. package/dist/cjs/dropdown-menu-group.js +24 -0
  60. package/dist/cjs/dropdown-menu-item.js +68 -0
  61. package/dist/cjs/dropdown-menu-label.js +31 -0
  62. package/dist/cjs/dropdown-menu-separator.js +25 -0
  63. package/dist/cjs/dropdown-menu-sub-content.js +3 -0
  64. package/dist/cjs/dropdown-menu-sub-trigger.js +3 -0
  65. package/dist/cjs/dropdown-menu-sub.js +3 -0
  66. package/dist/cjs/dropdown-menu-trigger.js +26 -0
  67. package/dist/cjs/dropdown-menu.js +32 -0
  68. package/dist/cjs/dropdown.js +291 -0
  69. package/dist/cjs/extra-settings.js +155 -0
  70. package/dist/cjs/fancy-button.js +38 -0
  71. package/dist/cjs/hint-text.js +36 -0
  72. package/dist/cjs/hue-slider.js +133 -0
  73. package/dist/cjs/index.js +229 -0
  74. package/dist/cjs/label.js +55 -0
  75. package/dist/cjs/link-bubble.js +228 -0
  76. package/dist/cjs/link-button.js +44 -0
  77. package/dist/cjs/modal-body.js +22 -0
  78. package/dist/cjs/modal-close.js +3 -0
  79. package/dist/cjs/modal-content.js +48 -0
  80. package/dist/cjs/modal-footer.js +22 -0
  81. package/dist/cjs/modal-header.js +81 -0
  82. package/dist/cjs/modal-trigger.js +3 -0
  83. package/dist/cjs/modal.js +3 -0
  84. package/dist/cjs/popover-content.js +104 -0
  85. package/dist/cjs/popover-trigger.js +24 -0
  86. package/dist/cjs/popover.js +3 -0
  87. package/dist/cjs/rich-editor.js +4996 -0
  88. package/dist/cjs/scroll-area.js +3 -0
  89. package/dist/cjs/scroll-bar.js +39 -0
  90. package/dist/cjs/segmented-control-item.js +41 -0
  91. package/dist/cjs/segmented-control.js +40 -0
  92. package/dist/cjs/select-content.js +61 -0
  93. package/dist/cjs/select-group.js +3 -0
  94. package/dist/cjs/select-icon.js +25 -0
  95. package/dist/cjs/select-item.js +44 -0
  96. package/dist/cjs/select-label.js +32 -0
  97. package/dist/cjs/select-separator.js +26 -0
  98. package/dist/cjs/select-trigger.js +40 -0
  99. package/dist/cjs/select-value.js +31 -0
  100. package/dist/cjs/select.js +3 -0
  101. package/dist/cjs/shims.js +1 -0
  102. package/dist/cjs/slider.js +3 -0
  103. package/dist/cjs/social-button.js +45 -0
  104. package/dist/cjs/sonner-alert.js +41 -0
  105. package/dist/cjs/sonner.js +3 -0
  106. package/dist/cjs/status-badge.js +49 -0
  107. package/dist/cjs/switch.js +3 -0
  108. package/dist/cjs/tab-menu-content.js +32 -0
  109. package/dist/cjs/tab-menu-item.js +44 -0
  110. package/dist/cjs/tab-menu-list.js +34 -0
  111. package/dist/cjs/tab-menu.js +32 -0
  112. package/dist/cjs/text-input-affix.js +27 -0
  113. package/dist/cjs/text-input-button.js +31 -0
  114. package/dist/cjs/text-input.js +119 -0
  115. package/dist/cjs/textarea.js +56 -0
  116. package/dist/cjs/tooltip.js +115 -0
  117. package/dist/cjs/types.js +1 -0
  118. package/dist/cjs/use-color-model.js +6 -0
  119. package/dist/cjs/use-delegated-props.js +14 -0
  120. package/dist/cjs/use-user-select.js +39 -0
  121. package/dist/components/alert/alert.d.ts +30 -0
  122. package/dist/components/alert/index.d.ts +2 -0
  123. package/dist/components/badge/badge.d.ts +17 -0
  124. package/dist/components/badge/index.d.ts +4 -0
  125. package/dist/components/badge/status-badge.d.ts +13 -0
  126. package/dist/components/button/button.d.ts +22 -0
  127. package/dist/components/button/compact-button.d.ts +15 -0
  128. package/dist/components/button/fancy-button.d.ts +20 -0
  129. package/dist/components/button/index.d.ts +10 -0
  130. package/dist/components/button/link-button.d.ts +22 -0
  131. package/dist/components/button/social-button.d.ts +10 -0
  132. package/dist/components/checkbox/checkbox-label.d.ts +32 -0
  133. package/dist/components/checkbox/checkbox.d.ts +11 -0
  134. package/dist/components/checkbox/index.d.ts +4 -0
  135. package/dist/components/color-picker/alpha-slider.d.ts +15 -0
  136. package/dist/components/color-picker/color-area.d.ts +9 -0
  137. package/dist/components/color-picker/color-picker.d.ts +47 -0
  138. package/dist/components/color-picker/color-swatch.d.ts +19 -0
  139. package/dist/components/color-picker/composable/use-color-model.d.ts +7 -0
  140. package/dist/components/color-picker/composable/use-user-select.d.ts +8 -0
  141. package/dist/components/color-picker/hue-slider.d.ts +14 -0
  142. package/dist/components/color-picker/index.d.ts +10 -0
  143. package/dist/components/combobox/combobox-anchor.d.ts +22 -0
  144. package/dist/components/combobox/combobox-empty.d.ts +22 -0
  145. package/dist/components/combobox/combobox-group.d.ts +23 -0
  146. package/dist/components/combobox/combobox-input.d.ts +17 -0
  147. package/dist/components/combobox/combobox-item.d.ts +31 -0
  148. package/dist/components/combobox/combobox-list.d.ts +36 -0
  149. package/dist/components/combobox/combobox-root.d.ts +29 -0
  150. package/dist/components/combobox/combobox-separator.d.ts +22 -0
  151. package/dist/components/combobox/combobox-trigger.d.ts +20 -0
  152. package/dist/components/combobox/combobox.d.ts +42 -0
  153. package/dist/components/combobox/index.d.ts +20 -0
  154. package/dist/components/content-divider/content-divider.d.ts +10 -0
  155. package/dist/components/content-divider/index.d.ts +2 -0
  156. package/dist/components/dropdown/context-menu-item.d.ts +39 -0
  157. package/dist/components/dropdown/dropdown-item.d.ts +30 -0
  158. package/dist/components/dropdown/dropdown.d.ts +55 -0
  159. package/dist/components/dropdown/index.d.ts +6 -0
  160. package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +36 -0
  161. package/dist/components/dropdown-menu/dropdown-menu-group.d.ts +18 -0
  162. package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +26 -0
  163. package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +22 -0
  164. package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +7 -0
  165. package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +38 -0
  166. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +22 -0
  167. package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +22 -0
  168. package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +18 -0
  169. package/dist/components/dropdown-menu/dropdown-menu.d.ts +18 -0
  170. package/dist/components/dropdown-menu/index.d.ts +20 -0
  171. package/dist/components/hint-text/hint-text.d.ts +11 -0
  172. package/dist/components/hint-text/index.d.ts +2 -0
  173. package/dist/components/index.d.ts +23 -0
  174. package/dist/components/label/index.d.ts +2 -0
  175. package/dist/components/label/label.d.ts +29 -0
  176. package/dist/components/modal/index.d.ts +14 -0
  177. package/dist/components/modal/modal-body.d.ts +21 -0
  178. package/dist/components/modal/modal-close.d.ts +18 -0
  179. package/dist/components/modal/modal-content.d.ts +37 -0
  180. package/dist/components/modal/modal-footer.d.ts +21 -0
  181. package/dist/components/modal/modal-header.d.ts +16 -0
  182. package/dist/components/modal/modal-trigger.d.ts +18 -0
  183. package/dist/components/modal/modal.d.ts +22 -0
  184. package/dist/components/popover/index.d.ts +6 -0
  185. package/dist/components/popover/popover-content.d.ts +41 -0
  186. package/dist/components/popover/popover-trigger.d.ts +18 -0
  187. package/dist/components/popover/popover.d.ts +22 -0
  188. package/dist/components/rich-editor/config.d.ts +33 -0
  189. package/dist/components/rich-editor/extra-settings.d.ts +6 -0
  190. package/dist/components/rich-editor/index.d.ts +2 -0
  191. package/dist/components/rich-editor/link-bubble.d.ts +11 -0
  192. package/dist/components/rich-editor/rich-editor.d.ts +55 -0
  193. package/dist/components/rich-editor/types.d.ts +19 -0
  194. package/dist/components/scroll-area/index.d.ts +2 -0
  195. package/dist/components/scroll-area/scroll-area.d.ts +22 -0
  196. package/dist/components/scroll-area/scroll-bar.d.ts +9 -0
  197. package/dist/components/segmented-control/index.d.ts +4 -0
  198. package/dist/components/segmented-control/segmented-control-item.d.ts +22 -0
  199. package/dist/components/segmented-control/segmented-control.d.ts +26 -0
  200. package/dist/components/select/index.d.ts +18 -0
  201. package/dist/components/select/select-content.d.ts +33 -0
  202. package/dist/components/select/select-group.d.ts +18 -0
  203. package/dist/components/select/select-icon.d.ts +21 -0
  204. package/dist/components/select/select-item.d.ts +22 -0
  205. package/dist/components/select/select-label.d.ts +22 -0
  206. package/dist/components/select/select-separator.d.ts +7 -0
  207. package/dist/components/select/select-trigger.d.ts +28 -0
  208. package/dist/components/select/select-value.d.ts +22 -0
  209. package/dist/components/select/select.d.ts +28 -0
  210. package/dist/components/slider/index.d.ts +2 -0
  211. package/dist/components/slider/slider.d.ts +13 -0
  212. package/dist/components/sonner/index.d.ts +4 -0
  213. package/dist/components/sonner/sonner-alert.d.ts +13 -0
  214. package/dist/components/sonner/sonner.d.ts +5 -0
  215. package/dist/components/switch/index.d.ts +2 -0
  216. package/dist/components/switch/switch.d.ts +11 -0
  217. package/dist/components/tab-menu/index.d.ts +8 -0
  218. package/dist/components/tab-menu/tab-menu-content.d.ts +22 -0
  219. package/dist/components/tab-menu/tab-menu-item.d.ts +24 -0
  220. package/dist/components/tab-menu/tab-menu-list.d.ts +22 -0
  221. package/dist/components/tab-menu/tab-menu.d.ts +23 -0
  222. package/dist/components/text-input/index.d.ts +6 -0
  223. package/dist/components/text-input/text-input-affix.d.ts +23 -0
  224. package/dist/components/text-input/text-input-button.d.ts +23 -0
  225. package/dist/components/text-input/text-input.d.ts +32 -0
  226. package/dist/components/textarea/index.d.ts +2 -0
  227. package/dist/components/textarea/textarea.d.ts +22 -0
  228. package/dist/components/tooltip/index.d.ts +2 -0
  229. package/dist/components/tooltip/tooltip.d.ts +29 -0
  230. package/dist/composables/use-delegated-props.d.ts +2 -0
  231. package/dist/es/alert.js +112 -0
  232. package/dist/es/alpha-slider.js +4 -0
  233. package/dist/es/badge.js +56 -0
  234. package/dist/es/button.js +40 -0
  235. package/dist/es/checkbox-label.js +113 -0
  236. package/dist/es/checkbox.js +4 -0
  237. package/dist/es/chunks/_plugin-vue_export-helper.js +10 -0
  238. package/dist/es/chunks/alpha-slider.js +128 -0
  239. package/dist/es/chunks/checkbox.vue_vue_type_style_index_0_lang.js +39 -0
  240. package/dist/es/chunks/clsx.js +16 -0
  241. package/dist/es/chunks/combobox-anchor.js +32 -0
  242. package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +53 -0
  243. package/dist/es/chunks/dropdown-menu-content.vue_vue_type_style_index_0_lang.js +52 -0
  244. package/dist/es/chunks/dropdown-menu-sub-content.vue_vue_type_style_index_0_lang.js +50 -0
  245. package/dist/es/chunks/dropdown-menu-sub-trigger.vue_vue_type_style_index_0_lang.js +33 -0
  246. package/dist/es/chunks/dropdown-menu-sub.js +26 -0
  247. package/dist/es/chunks/index.js +9285 -0
  248. package/dist/es/chunks/index2.js +1457 -0
  249. package/dist/es/chunks/index3.js +16458 -0
  250. package/dist/es/chunks/modal-close.js +23 -0
  251. package/dist/es/chunks/modal-trigger.js +23 -0
  252. package/dist/es/chunks/modal.js +27 -0
  253. package/dist/es/chunks/popover.js +27 -0
  254. package/dist/es/chunks/scroll-area.js +42 -0
  255. package/dist/es/chunks/select-group.js +23 -0
  256. package/dist/es/chunks/select.js +39 -0
  257. package/dist/es/chunks/slider.vue_vue_type_style_index_0_lang.js +53 -0
  258. package/dist/es/chunks/sonner.js +1154 -0
  259. package/dist/es/chunks/switch.vue_vue_type_style_index_0_lang.js +39 -0
  260. package/dist/es/chunks/use-color-model.js +993 -0
  261. package/dist/es/color-area.js +176 -0
  262. package/dist/es/color-picker.js +515 -0
  263. package/dist/es/color-swatch.js +60 -0
  264. package/dist/es/color.js +102 -0
  265. package/dist/es/combobox-anchor.js +4 -0
  266. package/dist/es/combobox-empty.js +33 -0
  267. package/dist/es/combobox-group.js +43 -0
  268. package/dist/es/combobox-input.js +64 -0
  269. package/dist/es/combobox-item.js +110 -0
  270. package/dist/es/combobox-list.js +63 -0
  271. package/dist/es/combobox-root.js +41 -0
  272. package/dist/es/combobox-separator.js +33 -0
  273. package/dist/es/combobox-trigger.js +48 -0
  274. package/dist/es/combobox.js +234 -0
  275. package/dist/es/command-group.js +42 -0
  276. package/dist/es/command-input.js +43 -0
  277. package/dist/es/command-item.js +35 -0
  278. package/dist/es/command-list.js +53 -0
  279. package/dist/es/command-root.js +46 -0
  280. package/dist/es/command-separator.js +33 -0
  281. package/dist/es/compact-button.js +43 -0
  282. package/dist/es/config.js +136 -0
  283. package/dist/es/content-divider.js +4 -0
  284. package/dist/es/context-menu-item.js +135 -0
  285. package/dist/es/crypto.js +8 -0
  286. package/dist/es/dropdown-item.js +100 -0
  287. package/dist/es/dropdown-menu-content.js +4 -0
  288. package/dist/es/dropdown-menu-group.js +25 -0
  289. package/dist/es/dropdown-menu-item.js +69 -0
  290. package/dist/es/dropdown-menu-label.js +32 -0
  291. package/dist/es/dropdown-menu-separator.js +26 -0
  292. package/dist/es/dropdown-menu-sub-content.js +4 -0
  293. package/dist/es/dropdown-menu-sub-trigger.js +4 -0
  294. package/dist/es/dropdown-menu-sub.js +4 -0
  295. package/dist/es/dropdown-menu-trigger.js +27 -0
  296. package/dist/es/dropdown-menu.js +33 -0
  297. package/dist/es/dropdown.js +292 -0
  298. package/dist/es/extra-settings.js +156 -0
  299. package/dist/es/fancy-button.js +39 -0
  300. package/dist/es/hint-text.js +37 -0
  301. package/dist/es/hue-slider.js +134 -0
  302. package/dist/es/index.js +229 -0
  303. package/dist/es/label.js +56 -0
  304. package/dist/es/link-bubble.js +229 -0
  305. package/dist/es/link-button.js +45 -0
  306. package/dist/es/modal-body.js +23 -0
  307. package/dist/es/modal-close.js +4 -0
  308. package/dist/es/modal-content.js +49 -0
  309. package/dist/es/modal-footer.js +23 -0
  310. package/dist/es/modal-header.js +82 -0
  311. package/dist/es/modal-trigger.js +4 -0
  312. package/dist/es/modal.js +4 -0
  313. package/dist/es/popover-content.js +105 -0
  314. package/dist/es/popover-trigger.js +25 -0
  315. package/dist/es/popover.js +4 -0
  316. package/dist/es/rich-editor.js +4997 -0
  317. package/dist/es/scroll-area.js +4 -0
  318. package/dist/es/scroll-bar.js +40 -0
  319. package/dist/es/segmented-control-item.js +42 -0
  320. package/dist/es/segmented-control.js +41 -0
  321. package/dist/es/select-content.js +62 -0
  322. package/dist/es/select-group.js +4 -0
  323. package/dist/es/select-icon.js +26 -0
  324. package/dist/es/select-item.js +45 -0
  325. package/dist/es/select-label.js +33 -0
  326. package/dist/es/select-separator.js +27 -0
  327. package/dist/es/select-trigger.js +41 -0
  328. package/dist/es/select-value.js +32 -0
  329. package/dist/es/select.js +4 -0
  330. package/dist/es/shims.js +1 -0
  331. package/dist/es/slider.js +4 -0
  332. package/dist/es/social-button.js +46 -0
  333. package/dist/es/sonner-alert.js +42 -0
  334. package/dist/es/sonner.js +4 -0
  335. package/dist/es/status-badge.js +50 -0
  336. package/dist/es/switch.js +4 -0
  337. package/dist/es/tab-menu-content.js +33 -0
  338. package/dist/es/tab-menu-item.js +45 -0
  339. package/dist/es/tab-menu-list.js +35 -0
  340. package/dist/es/tab-menu.js +33 -0
  341. package/dist/es/text-input-affix.js +28 -0
  342. package/dist/es/text-input-button.js +32 -0
  343. package/dist/es/text-input.js +120 -0
  344. package/dist/es/textarea.js +57 -0
  345. package/dist/es/tooltip.js +116 -0
  346. package/dist/es/types.js +1 -0
  347. package/dist/es/use-color-model.js +6 -0
  348. package/dist/es/use-delegated-props.js +14 -0
  349. package/dist/es/use-user-select.js +39 -0
  350. package/dist/index.d.ts +5 -0
  351. package/dist/utils/color.d.ts +26 -0
  352. package/dist/utils/crypto.d.ts +1 -0
  353. package/dist/utils/index.d.ts +3 -0
  354. package/dist/utils/sonner.d.ts +19 -0
  355. package/package.json +15 -4
  356. package/src/components/index.ts +2 -0
  357. package/src/components/rich-editor/config.ts +150 -0
  358. package/src/components/rich-editor/extra-settings.vue +151 -0
  359. package/src/components/rich-editor/index.ts +2 -0
  360. package/src/components/rich-editor/link-bubble.vue +288 -0
  361. package/src/components/rich-editor/rich-editor.vue +428 -0
  362. package/src/components/rich-editor/stories/rich-editor.stories.ts +87 -0
  363. package/src/components/rich-editor/types.ts +21 -0
  364. package/src/components/sonner/index.ts +5 -0
  365. package/src/components/sonner/sonner-alert.vue +54 -0
  366. package/src/components/sonner/sonner.vue +13 -0
  367. package/src/components/sonner/stories/sonner.stories.ts +194 -0
  368. package/src/utils/index.ts +3 -0
  369. package/src/utils/sonner.ts +72 -0
@@ -0,0 +1,1153 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ const Mo = require("vue");
6
+ let toastsCounter = 1;
7
+ var Observer = class {
8
+ constructor() {
9
+ __publicField(this, "subscribers");
10
+ __publicField(this, "toasts");
11
+ __publicField(this, "dismissedToasts");
12
+ __publicField(this, "subscribe", (subscriber) => {
13
+ this.subscribers.push(subscriber);
14
+ return () => {
15
+ const index = this.subscribers.indexOf(subscriber);
16
+ this.subscribers.splice(index, 1);
17
+ };
18
+ });
19
+ __publicField(this, "publish", (data) => {
20
+ this.subscribers.forEach((subscriber) => subscriber(data));
21
+ });
22
+ __publicField(this, "addToast", (data) => {
23
+ this.publish(data);
24
+ this.toasts = [...this.toasts, data];
25
+ });
26
+ __publicField(this, "create", (data) => {
27
+ var _a;
28
+ const { message, ...rest } = data;
29
+ const id = typeof data.id === "number" || data.id && ((_a = data.id) == null ? void 0 : _a.length) > 0 ? data.id : toastsCounter++;
30
+ const alreadyExists = this.toasts.find((toast$1) => {
31
+ return toast$1.id === id;
32
+ });
33
+ const dismissible = data.dismissible === void 0 ? true : data.dismissible;
34
+ if (this.dismissedToasts.has(id)) this.dismissedToasts.delete(id);
35
+ if (alreadyExists) this.toasts = this.toasts.map((toast$1) => {
36
+ if (toast$1.id === id) {
37
+ this.publish({
38
+ ...toast$1,
39
+ ...data,
40
+ id,
41
+ title: message
42
+ });
43
+ return {
44
+ ...toast$1,
45
+ ...data,
46
+ id,
47
+ dismissible,
48
+ title: message
49
+ };
50
+ }
51
+ return toast$1;
52
+ });
53
+ else this.addToast({
54
+ title: message,
55
+ ...rest,
56
+ dismissible,
57
+ id
58
+ });
59
+ return id;
60
+ });
61
+ __publicField(this, "dismiss", (id) => {
62
+ if (id) {
63
+ this.dismissedToasts.add(id);
64
+ requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
65
+ id,
66
+ dismiss: true
67
+ })));
68
+ } else this.toasts.forEach((toast$1) => {
69
+ this.subscribers.forEach((subscriber) => subscriber({
70
+ id: toast$1.id,
71
+ dismiss: true
72
+ }));
73
+ });
74
+ return id;
75
+ });
76
+ __publicField(this, "message", (message, data) => {
77
+ return this.create({
78
+ ...data,
79
+ message,
80
+ type: "default"
81
+ });
82
+ });
83
+ __publicField(this, "error", (message, data) => {
84
+ return this.create({
85
+ ...data,
86
+ type: "error",
87
+ message
88
+ });
89
+ });
90
+ __publicField(this, "success", (message, data) => {
91
+ return this.create({
92
+ ...data,
93
+ type: "success",
94
+ message
95
+ });
96
+ });
97
+ __publicField(this, "info", (message, data) => {
98
+ return this.create({
99
+ ...data,
100
+ type: "info",
101
+ message
102
+ });
103
+ });
104
+ __publicField(this, "warning", (message, data) => {
105
+ return this.create({
106
+ ...data,
107
+ type: "warning",
108
+ message
109
+ });
110
+ });
111
+ __publicField(this, "loading", (message, data) => {
112
+ return this.create({
113
+ ...data,
114
+ type: "loading",
115
+ message
116
+ });
117
+ });
118
+ __publicField(this, "promise", (promise, data) => {
119
+ if (!data) return;
120
+ let id;
121
+ if (data.loading !== void 0) id = this.create({
122
+ ...data,
123
+ promise,
124
+ type: "loading",
125
+ message: data.loading,
126
+ description: typeof data.description !== "function" ? data.description : void 0
127
+ });
128
+ const p = Promise.resolve(promise instanceof Function ? promise() : promise);
129
+ let shouldDismiss = id !== void 0;
130
+ let result;
131
+ const originalPromise = p.then(async (response) => {
132
+ result = ["resolve", response];
133
+ const isVueComponent = Mo.isVNode(response);
134
+ if (isVueComponent) {
135
+ shouldDismiss = false;
136
+ this.create({
137
+ id,
138
+ type: "default",
139
+ message: response
140
+ });
141
+ } else if (isHttpResponse(response) && !response.ok) {
142
+ shouldDismiss = false;
143
+ const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
144
+ const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
145
+ const isExtendedResult = typeof promiseData === "object" && !Mo.isVNode(promiseData);
146
+ const toastSettings = isExtendedResult ? promiseData : {
147
+ message: promiseData || "",
148
+ id: id || ""
149
+ };
150
+ this.create({
151
+ id,
152
+ type: "error",
153
+ description,
154
+ ...toastSettings
155
+ });
156
+ } else if (response instanceof Error) {
157
+ shouldDismiss = false;
158
+ const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
159
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
160
+ const isExtendedResult = typeof promiseData === "object" && !Mo.isVNode(promiseData);
161
+ const toastSettings = isExtendedResult ? promiseData : {
162
+ message: promiseData || "",
163
+ id: id || ""
164
+ };
165
+ this.create({
166
+ id,
167
+ type: "error",
168
+ description,
169
+ ...toastSettings
170
+ });
171
+ } else if (data.success !== void 0) {
172
+ shouldDismiss = false;
173
+ const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
174
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
175
+ const isExtendedResult = typeof promiseData === "object" && !Mo.isVNode(promiseData);
176
+ const toastSettings = isExtendedResult ? promiseData : {
177
+ message: promiseData || "",
178
+ id: id || ""
179
+ };
180
+ this.create({
181
+ id,
182
+ type: "success",
183
+ description,
184
+ ...toastSettings
185
+ });
186
+ }
187
+ }).catch(async (error) => {
188
+ result = ["reject", error];
189
+ if (data.error !== void 0) {
190
+ shouldDismiss = false;
191
+ const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
192
+ const description = typeof data.description === "function" ? await data.description(error) : data.description;
193
+ const isExtendedResult = typeof promiseData === "object" && !Mo.isVNode(promiseData);
194
+ const toastSettings = isExtendedResult ? promiseData : {
195
+ message: promiseData || "",
196
+ id: id || ""
197
+ };
198
+ this.create({
199
+ id,
200
+ type: "error",
201
+ description,
202
+ ...toastSettings
203
+ });
204
+ }
205
+ }).finally(() => {
206
+ var _a;
207
+ if (shouldDismiss) {
208
+ this.dismiss(id);
209
+ id = void 0;
210
+ }
211
+ (_a = data.finally) == null ? void 0 : _a.call(data);
212
+ });
213
+ const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
214
+ if (typeof id !== "string" && typeof id !== "number") return { unwrap };
215
+ else return Object.assign(id, { unwrap });
216
+ });
217
+ __publicField(this, "custom", (component, data) => {
218
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
219
+ this.publish({
220
+ component,
221
+ id,
222
+ ...data
223
+ });
224
+ return id;
225
+ });
226
+ __publicField(this, "getActiveToasts", () => {
227
+ return this.toasts.filter((toast$1) => !this.dismissedToasts.has(toast$1.id));
228
+ });
229
+ this.subscribers = [];
230
+ this.toasts = [];
231
+ this.dismissedToasts = /* @__PURE__ */ new Set();
232
+ }
233
+ };
234
+ const ToastState = new Observer();
235
+ function toastFunction(message, data) {
236
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
237
+ ToastState.create({
238
+ message,
239
+ id,
240
+ type: "default",
241
+ ...data
242
+ });
243
+ return id;
244
+ }
245
+ const isHttpResponse = (data) => {
246
+ return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
247
+ };
248
+ const basicToast = toastFunction;
249
+ const getHistory = () => ToastState.toasts;
250
+ const getToasts = () => ToastState.getActiveToasts();
251
+ Object.assign(basicToast, {
252
+ success: ToastState.success,
253
+ info: ToastState.info,
254
+ warning: ToastState.warning,
255
+ error: ToastState.error,
256
+ custom: ToastState.custom,
257
+ message: ToastState.message,
258
+ promise: ToastState.promise,
259
+ dismiss: ToastState.dismiss,
260
+ loading: ToastState.loading
261
+ }, {
262
+ getHistory,
263
+ getToasts
264
+ });
265
+ function isAction(action) {
266
+ return action.label !== void 0;
267
+ }
268
+ const VISIBLE_TOASTS_AMOUNT = 3;
269
+ const VIEWPORT_OFFSET = "24px";
270
+ const MOBILE_VIEWPORT_OFFSET = "16px";
271
+ const TOAST_LIFETIME = 4e3;
272
+ const TOAST_WIDTH = 356;
273
+ const GAP = 14;
274
+ const SWIPE_THRESHOLD = 45;
275
+ const TIME_BEFORE_UNMOUNT = 200;
276
+ function useIsDocumentHidden() {
277
+ const isDocumentHidden = Mo.ref(false);
278
+ Mo.watchEffect(() => {
279
+ const callback = () => {
280
+ isDocumentHidden.value = document.hidden;
281
+ };
282
+ document.addEventListener("visibilitychange", callback);
283
+ return () => window.removeEventListener("visibilitychange", callback);
284
+ });
285
+ return { isDocumentHidden };
286
+ }
287
+ function cn(...classes) {
288
+ return classes.filter(Boolean).join(" ");
289
+ }
290
+ function getDefaultSwipeDirections(position) {
291
+ const [y, x] = position.split("-");
292
+ const directions = [];
293
+ if (y) directions.push(y);
294
+ if (x) directions.push(x);
295
+ return directions;
296
+ }
297
+ function assignOffset(defaultOffset, mobileOffset) {
298
+ const styles = {};
299
+ [defaultOffset, mobileOffset].forEach((offset, index) => {
300
+ const isMobile = index === 1;
301
+ const prefix = isMobile ? "--mobile-offset" : "--offset";
302
+ const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
303
+ function assignAll(offset$1) {
304
+ [
305
+ "top",
306
+ "right",
307
+ "bottom",
308
+ "left"
309
+ ].forEach((key) => {
310
+ styles[`${prefix}-${key}`] = typeof offset$1 === "number" ? `${offset$1}px` : offset$1;
311
+ });
312
+ }
313
+ if (typeof offset === "number" || typeof offset === "string") assignAll(offset);
314
+ else if (typeof offset === "object") [
315
+ "top",
316
+ "right",
317
+ "bottom",
318
+ "left"
319
+ ].forEach((key) => {
320
+ if (offset[key] === void 0) styles[`${prefix}-${key}`] = defaultValue;
321
+ else styles[`${prefix}-${key}`] = typeof offset[key] === "number" ? `${offset[key]}px` : offset[key];
322
+ });
323
+ else assignAll(defaultValue);
324
+ });
325
+ return styles;
326
+ }
327
+ const _hoisted_1$7 = [
328
+ "data-rich-colors",
329
+ "data-styled",
330
+ "data-mounted",
331
+ "data-promise",
332
+ "data-swiped",
333
+ "data-removed",
334
+ "data-visible",
335
+ "data-y-position",
336
+ "data-x-position",
337
+ "data-index",
338
+ "data-front",
339
+ "data-swiping",
340
+ "data-dismissible",
341
+ "data-type",
342
+ "data-invert",
343
+ "data-swipe-out",
344
+ "data-swipe-direction",
345
+ "data-expanded"
346
+ ];
347
+ const _hoisted_2$2 = ["aria-label", "data-disabled"];
348
+ var Toast_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Mo.defineComponent({
349
+ __name: "Toast",
350
+ props: {
351
+ toast: {},
352
+ toasts: {},
353
+ index: {},
354
+ swipeDirections: {},
355
+ expanded: { type: Boolean },
356
+ invert: { type: Boolean },
357
+ heights: {},
358
+ gap: {},
359
+ position: {},
360
+ visibleToasts: {},
361
+ expandByDefault: { type: Boolean },
362
+ closeButton: { type: Boolean },
363
+ interacting: { type: Boolean },
364
+ style: {},
365
+ cancelButtonStyle: {},
366
+ actionButtonStyle: {},
367
+ duration: {},
368
+ class: {},
369
+ unstyled: { type: Boolean },
370
+ descriptionClass: {},
371
+ loadingIcon: {},
372
+ classes: {},
373
+ icons: {},
374
+ closeButtonAriaLabel: {},
375
+ defaultRichColors: { type: Boolean }
376
+ },
377
+ emits: [
378
+ "update:heights",
379
+ "update:height",
380
+ "removeToast"
381
+ ],
382
+ setup(__props, { emit: __emit }) {
383
+ const props = __props;
384
+ const emit = __emit;
385
+ const swipeDirection = Mo.ref(null);
386
+ const swipeOutDirection = Mo.ref(null);
387
+ const mounted = Mo.ref(false);
388
+ const removed = Mo.ref(false);
389
+ const swiping = Mo.ref(false);
390
+ const swipeOut = Mo.ref(false);
391
+ const swiped = Mo.ref(false);
392
+ const offsetBeforeRemove = Mo.ref(0);
393
+ const initialHeight = Mo.ref(0);
394
+ const remainingTime = Mo.ref(props.toast.duration || props.duration || TOAST_LIFETIME);
395
+ const dragStartTime = Mo.ref(null);
396
+ const toastRef = Mo.ref(null);
397
+ const isFront = Mo.computed(() => props.index === 0);
398
+ const isVisible = Mo.computed(() => props.index + 1 <= props.visibleToasts);
399
+ const toastType = Mo.computed(() => props.toast.type);
400
+ const dismissible = Mo.computed(() => props.toast.dismissible !== false);
401
+ const toastClass = Mo.computed(() => props.toast.class || "");
402
+ const toastDescriptionClass = Mo.computed(() => props.descriptionClass || "");
403
+ const heightIndex = Mo.computed(() => {
404
+ const currentPosition = props.toast.position || props.position;
405
+ const samePositionHeights = props.heights.filter((h) => h.position === currentPosition);
406
+ const index = samePositionHeights.findIndex((height) => height.toastId === props.toast.id);
407
+ return index >= 0 ? index : 0;
408
+ });
409
+ const toastsHeightBefore = Mo.computed(() => {
410
+ const currentPosition = props.toast.position || props.position;
411
+ const samePositionHeights = props.heights.filter((h) => h.position === currentPosition);
412
+ return samePositionHeights.reduce((prev, curr, reducerIndex) => {
413
+ if (reducerIndex >= heightIndex.value) return prev;
414
+ return prev + curr.height;
415
+ }, 0);
416
+ });
417
+ const offset = Mo.computed(() => heightIndex.value * props.gap + toastsHeightBefore.value || 0);
418
+ const closeButton = Mo.computed(() => props.toast.closeButton ?? props.closeButton);
419
+ const duration = Mo.computed(() => props.toast.duration || props.duration || TOAST_LIFETIME);
420
+ const closeTimerStartTimeRef = Mo.ref(0);
421
+ const lastCloseTimerStartTimeRef = Mo.ref(0);
422
+ const pointerStartRef = Mo.ref(null);
423
+ const coords = Mo.computed(() => props.position.split("-"));
424
+ const y = Mo.computed(() => coords.value[0]);
425
+ const x = Mo.computed(() => coords.value[1]);
426
+ const isStringOfTitle = Mo.computed(() => typeof props.toast.title !== "string");
427
+ const isStringOfDescription = Mo.computed(() => typeof props.toast.description !== "string");
428
+ const { isDocumentHidden } = useIsDocumentHidden();
429
+ const disabled = Mo.computed(() => toastType.value && toastType.value === "loading");
430
+ Mo.onMounted(() => {
431
+ mounted.value = true;
432
+ remainingTime.value = duration.value;
433
+ });
434
+ Mo.watchEffect(async () => {
435
+ if (!mounted.value || !toastRef.value) return;
436
+ await Mo.nextTick();
437
+ const toastNode = toastRef.value;
438
+ const originalHeight = toastNode.style.height;
439
+ toastNode.style.height = "auto";
440
+ const newHeight = toastNode.getBoundingClientRect().height;
441
+ toastNode.style.height = originalHeight;
442
+ initialHeight.value = newHeight;
443
+ emit("update:height", {
444
+ toastId: props.toast.id,
445
+ height: newHeight,
446
+ position: props.toast.position || props.position
447
+ });
448
+ });
449
+ function deleteToast() {
450
+ removed.value = true;
451
+ offsetBeforeRemove.value = offset.value;
452
+ setTimeout(() => {
453
+ emit("removeToast", props.toast);
454
+ }, TIME_BEFORE_UNMOUNT);
455
+ }
456
+ function handleCloseToast() {
457
+ var _a, _b;
458
+ if (disabled.value || !dismissible.value) return {};
459
+ deleteToast();
460
+ (_b = (_a = props.toast).onDismiss) == null ? void 0 : _b.call(_a, props.toast);
461
+ }
462
+ function onPointerDown(event) {
463
+ if (disabled.value || !dismissible.value) return;
464
+ dragStartTime.value = /* @__PURE__ */ new Date();
465
+ offsetBeforeRemove.value = offset.value;
466
+ event.target.setPointerCapture(event.pointerId);
467
+ if (event.target.tagName === "BUTTON") return;
468
+ swiping.value = true;
469
+ pointerStartRef.value = {
470
+ x: event.clientX,
471
+ y: event.clientY
472
+ };
473
+ }
474
+ function onPointerUp() {
475
+ var _a, _b, _c, _d, _e, _f, _g;
476
+ if (swipeOut.value || !dismissible.value) return;
477
+ pointerStartRef.value = null;
478
+ const swipeAmountX = Number(((_a = toastRef.value) == null ? void 0 : _a.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
479
+ const swipeAmountY = Number(((_b = toastRef.value) == null ? void 0 : _b.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
480
+ const timeTaken = (/* @__PURE__ */ new Date()).getTime() - (((_c = dragStartTime.value) == null ? void 0 : _c.getTime()) || 0);
481
+ const swipeAmount = swipeDirection.value === "x" ? swipeAmountX : swipeAmountY;
482
+ const velocity = Math.abs(swipeAmount) / timeTaken;
483
+ if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
484
+ offsetBeforeRemove.value = offset.value;
485
+ (_e = (_d = props.toast).onDismiss) == null ? void 0 : _e.call(_d, props.toast);
486
+ if (swipeDirection.value === "x") swipeOutDirection.value = swipeAmountX > 0 ? "right" : "left";
487
+ else swipeOutDirection.value = swipeAmountY > 0 ? "down" : "up";
488
+ deleteToast();
489
+ swipeOut.value = true;
490
+ return;
491
+ } else {
492
+ (_f = toastRef.value) == null ? void 0 : _f.style.setProperty("--swipe-amount-x", `0px`);
493
+ (_g = toastRef.value) == null ? void 0 : _g.style.setProperty("--swipe-amount-y", `0px`);
494
+ }
495
+ swiped.value = false;
496
+ swiping.value = false;
497
+ swipeDirection.value = null;
498
+ }
499
+ function onPointerMove(event) {
500
+ var _a, _b, _c, _d;
501
+ if (!pointerStartRef.value || !dismissible.value) return;
502
+ const isHighlighted = ((_b = (_a = window == null ? void 0 : window.getSelection()) == null ? void 0 : _a.toString()) == null ? void 0 : _b.length) ?? false;
503
+ if (isHighlighted) return;
504
+ const yDelta = event.clientY - pointerStartRef.value.y;
505
+ const xDelta = event.clientX - pointerStartRef.value.x;
506
+ const swipeDirections = props.swipeDirections ?? getDefaultSwipeDirections(props.position);
507
+ if (!swipeDirection.value && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) swipeDirection.value = Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y";
508
+ let swipeAmount = {
509
+ x: 0,
510
+ y: 0
511
+ };
512
+ const getDampening = (delta) => {
513
+ const factor = Math.abs(delta) / 20;
514
+ return 1 / (1.5 + factor);
515
+ };
516
+ if (swipeDirection.value === "y") {
517
+ if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) swipeAmount.y = yDelta;
518
+ else {
519
+ const dampenedDelta = yDelta * getDampening(yDelta);
520
+ swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
521
+ }
522
+ } else if (swipeDirection.value === "x") {
523
+ if (swipeDirections.includes("left") || swipeDirections.includes("right")) if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) swipeAmount.x = xDelta;
524
+ else {
525
+ const dampenedDelta = xDelta * getDampening(xDelta);
526
+ swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
527
+ }
528
+ }
529
+ if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) swiped.value = true;
530
+ (_c = toastRef.value) == null ? void 0 : _c.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
531
+ (_d = toastRef.value) == null ? void 0 : _d.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
532
+ }
533
+ Mo.onMounted(() => {
534
+ mounted.value = true;
535
+ if (!toastRef.value) return;
536
+ const height = toastRef.value.getBoundingClientRect().height;
537
+ initialHeight.value = height;
538
+ const newHeights = [{
539
+ toastId: props.toast.id,
540
+ height,
541
+ position: props.toast.position
542
+ }, ...props.heights];
543
+ emit("update:heights", newHeights);
544
+ });
545
+ Mo.onBeforeUnmount(() => {
546
+ if (toastRef.value) emit("removeToast", props.toast);
547
+ });
548
+ Mo.watchEffect((onInvalidate) => {
549
+ if (props.toast.promise && toastType.value === "loading" || props.toast.duration === Infinity || props.toast.type === "loading") return;
550
+ let timeoutId;
551
+ const pauseTimer = () => {
552
+ if (lastCloseTimerStartTimeRef.value < closeTimerStartTimeRef.value) {
553
+ const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.value;
554
+ remainingTime.value = remainingTime.value - elapsedTime;
555
+ }
556
+ lastCloseTimerStartTimeRef.value = (/* @__PURE__ */ new Date()).getTime();
557
+ };
558
+ const startTimer = () => {
559
+ if (remainingTime.value === Infinity) return;
560
+ closeTimerStartTimeRef.value = (/* @__PURE__ */ new Date()).getTime();
561
+ timeoutId = setTimeout(() => {
562
+ var _a, _b;
563
+ (_b = (_a = props.toast).onAutoClose) == null ? void 0 : _b.call(_a, props.toast);
564
+ deleteToast();
565
+ }, remainingTime.value);
566
+ };
567
+ if (props.expanded || props.interacting || isDocumentHidden.value) pauseTimer();
568
+ else startTimer();
569
+ onInvalidate(() => {
570
+ clearTimeout(timeoutId);
571
+ });
572
+ });
573
+ Mo.watch(() => props.toast.delete, (value) => {
574
+ if (value !== void 0 && value) deleteToast();
575
+ }, { deep: true });
576
+ function handleDragEnd() {
577
+ swiping.value = false;
578
+ swipeDirection.value = null;
579
+ pointerStartRef.value = null;
580
+ }
581
+ return (_ctx, _cache) => {
582
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
583
+ return Mo.openBlock(), Mo.createElementBlock("li", {
584
+ tabindex: "0",
585
+ ref_key: "toastRef",
586
+ ref: toastRef,
587
+ class: Mo.normalizeClass(Mo.unref(cn)(props.class, toastClass.value, (_a = _ctx.classes) == null ? void 0 : _a.toast, (_b = _ctx.toast.classes) == null ? void 0 : _b.toast, (_c = _ctx.classes) == null ? void 0 : _c[toastType.value], (_e = (_d = _ctx.toast) == null ? void 0 : _d.classes) == null ? void 0 : _e[toastType.value])),
588
+ "data-sonner-toast": "",
589
+ "data-rich-colors": _ctx.toast.richColors ?? _ctx.defaultRichColors,
590
+ "data-styled": !Boolean(_ctx.toast.component || ((_f = _ctx.toast) == null ? void 0 : _f.unstyled) || _ctx.unstyled),
591
+ "data-mounted": mounted.value,
592
+ "data-promise": Boolean(_ctx.toast.promise),
593
+ "data-swiped": swiped.value,
594
+ "data-removed": removed.value,
595
+ "data-visible": isVisible.value,
596
+ "data-y-position": y.value,
597
+ "data-x-position": x.value,
598
+ "data-index": _ctx.index,
599
+ "data-front": isFront.value,
600
+ "data-swiping": swiping.value,
601
+ "data-dismissible": dismissible.value,
602
+ "data-type": toastType.value,
603
+ "data-invert": _ctx.toast.invert || _ctx.invert,
604
+ "data-swipe-out": swipeOut.value,
605
+ "data-swipe-direction": swipeOutDirection.value,
606
+ "data-expanded": Boolean(_ctx.expanded || _ctx.expandByDefault && mounted.value),
607
+ style: Mo.normalizeStyle({
608
+ "--index": _ctx.index,
609
+ "--toasts-before": _ctx.index,
610
+ "--z-index": _ctx.toasts.length - _ctx.index,
611
+ "--offset": `${removed.value ? offsetBeforeRemove.value : offset.value}px`,
612
+ "--initial-height": _ctx.expandByDefault ? "auto" : `${initialHeight.value}px`,
613
+ ..._ctx.style,
614
+ ...props.toast.style
615
+ }),
616
+ onDragend: handleDragEnd,
617
+ onPointerdown: onPointerDown,
618
+ onPointerup: onPointerUp,
619
+ onPointermove: onPointerMove
620
+ }, [closeButton.value && !_ctx.toast.component && toastType.value !== "loading" ? (Mo.openBlock(), Mo.createElementBlock("button", {
621
+ key: 0,
622
+ "aria-label": _ctx.closeButtonAriaLabel || "Close toast",
623
+ "data-disabled": disabled.value,
624
+ "data-close-button": "true",
625
+ class: Mo.normalizeClass(Mo.unref(cn)((_g = _ctx.classes) == null ? void 0 : _g.closeButton, (_i = (_h = _ctx.toast) == null ? void 0 : _h.classes) == null ? void 0 : _i.closeButton)),
626
+ onClick: handleCloseToast
627
+ }, [((_j = _ctx.icons) == null ? void 0 : _j.close) ? (Mo.openBlock(), Mo.createBlock(Mo.resolveDynamicComponent((_k = _ctx.icons) == null ? void 0 : _k.close), { key: 0 })) : Mo.renderSlot(_ctx.$slots, "close-icon", { key: 1 })], 10, _hoisted_2$2)) : Mo.createCommentVNode("v-if", true), _ctx.toast.component ? (Mo.openBlock(), Mo.createBlock(Mo.resolveDynamicComponent(_ctx.toast.component), Mo.mergeProps({ key: 1 }, _ctx.toast.componentProps, { onCloseToast: handleCloseToast }), null, 16)) : (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 2 }, [
628
+ toastType.value !== "default" || _ctx.toast.icon || _ctx.toast.promise ? (Mo.openBlock(), Mo.createElementBlock("div", {
629
+ key: 0,
630
+ "data-icon": "",
631
+ class: Mo.normalizeClass(Mo.unref(cn)((_l = _ctx.classes) == null ? void 0 : _l.icon, (_n = (_m = _ctx.toast) == null ? void 0 : _m.classes) == null ? void 0 : _n.icon))
632
+ }, [_ctx.toast.icon ? (Mo.openBlock(), Mo.createBlock(Mo.resolveDynamicComponent(_ctx.toast.icon), { key: 0 })) : (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 1 }, [toastType.value === "loading" ? Mo.renderSlot(_ctx.$slots, "loading-icon", { key: 0 }) : toastType.value === "success" ? Mo.renderSlot(_ctx.$slots, "success-icon", { key: 1 }) : toastType.value === "error" ? Mo.renderSlot(_ctx.$slots, "error-icon", { key: 2 }) : toastType.value === "warning" ? Mo.renderSlot(_ctx.$slots, "warning-icon", { key: 3 }) : toastType.value === "info" ? Mo.renderSlot(_ctx.$slots, "info-icon", { key: 4 }) : Mo.createCommentVNode("v-if", true)], 64))], 2)) : Mo.createCommentVNode("v-if", true),
633
+ Mo.createElementVNode("div", {
634
+ "data-content": "",
635
+ class: Mo.normalizeClass(Mo.unref(cn)((_o = _ctx.classes) == null ? void 0 : _o.content, (_q = (_p = _ctx.toast) == null ? void 0 : _p.classes) == null ? void 0 : _q.content))
636
+ }, [Mo.createElementVNode("div", {
637
+ "data-title": "",
638
+ class: Mo.normalizeClass(Mo.unref(cn)((_r = _ctx.classes) == null ? void 0 : _r.title, (_s = _ctx.toast.classes) == null ? void 0 : _s.title))
639
+ }, [isStringOfTitle.value ? (Mo.openBlock(), Mo.createBlock(Mo.resolveDynamicComponent(_ctx.toast.title), Mo.normalizeProps(Mo.mergeProps({ key: 0 }, _ctx.toast.componentProps)), null, 16)) : (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 1 }, [Mo.createTextVNode(Mo.toDisplayString(_ctx.toast.title), 1)], 64))], 2), _ctx.toast.description ? (Mo.openBlock(), Mo.createElementBlock("div", {
640
+ key: 0,
641
+ "data-description": "",
642
+ class: Mo.normalizeClass(Mo.unref(cn)(_ctx.descriptionClass, toastDescriptionClass.value, (_t = _ctx.classes) == null ? void 0 : _t.description, (_u = _ctx.toast.classes) == null ? void 0 : _u.description))
643
+ }, [isStringOfDescription.value ? (Mo.openBlock(), Mo.createBlock(Mo.resolveDynamicComponent(_ctx.toast.description), Mo.normalizeProps(Mo.mergeProps({ key: 0 }, _ctx.toast.componentProps)), null, 16)) : (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 1 }, [Mo.createTextVNode(Mo.toDisplayString(_ctx.toast.description), 1)], 64))], 2)) : Mo.createCommentVNode("v-if", true)], 2),
644
+ _ctx.toast.cancel ? (Mo.openBlock(), Mo.createElementBlock("button", {
645
+ key: 1,
646
+ style: Mo.normalizeStyle(_ctx.toast.cancelButtonStyle || _ctx.cancelButtonStyle),
647
+ class: Mo.normalizeClass(Mo.unref(cn)((_v = _ctx.classes) == null ? void 0 : _v.cancelButton, (_w = _ctx.toast.classes) == null ? void 0 : _w.cancelButton)),
648
+ "data-button": "",
649
+ "data-cancel": "",
650
+ onClick: _cache[0] || (_cache[0] = (event) => {
651
+ var _a2, _b2;
652
+ if (!Mo.unref(isAction)(_ctx.toast.cancel)) return;
653
+ if (!dismissible.value) return;
654
+ (_b2 = (_a2 = _ctx.toast.cancel).onClick) == null ? void 0 : _b2.call(_a2, event);
655
+ deleteToast();
656
+ })
657
+ }, Mo.toDisplayString(Mo.unref(isAction)(_ctx.toast.cancel) ? (_x = _ctx.toast.cancel) == null ? void 0 : _x.label : _ctx.toast.cancel), 7)) : Mo.createCommentVNode("v-if", true),
658
+ _ctx.toast.action ? (Mo.openBlock(), Mo.createElementBlock("button", {
659
+ key: 2,
660
+ style: Mo.normalizeStyle(_ctx.toast.actionButtonStyle || _ctx.actionButtonStyle),
661
+ class: Mo.normalizeClass(Mo.unref(cn)((_y = _ctx.classes) == null ? void 0 : _y.actionButton, (_z = _ctx.toast.classes) == null ? void 0 : _z.actionButton)),
662
+ "data-button": "",
663
+ "data-action": "",
664
+ onClick: _cache[1] || (_cache[1] = (event) => {
665
+ var _a2, _b2;
666
+ if (!Mo.unref(isAction)(_ctx.toast.action)) return;
667
+ (_b2 = (_a2 = _ctx.toast.action).onClick) == null ? void 0 : _b2.call(_a2, event);
668
+ if (event.defaultPrevented) return;
669
+ deleteToast();
670
+ })
671
+ }, Mo.toDisplayString(Mo.unref(isAction)(_ctx.toast.action) ? (_A = _ctx.toast.action) == null ? void 0 : _A.label : _ctx.toast.action), 7)) : Mo.createCommentVNode("v-if", true)
672
+ ], 64))], 46, _hoisted_1$7);
673
+ };
674
+ }
675
+ });
676
+ var Toast_default = Toast_vue_vue_type_script_setup_true_lang_default;
677
+ var export_helper_default = (sfc, props) => {
678
+ const target = sfc.__vccOpts || sfc;
679
+ for (const [key, val] of props) target[key] = val;
680
+ return target;
681
+ };
682
+ const _sfc_main$4 = {};
683
+ const _hoisted_1$6 = {
684
+ xmlns: "http://www.w3.org/2000/svg",
685
+ width: "12",
686
+ height: "12",
687
+ viewBox: "0 0 24 24",
688
+ fill: "none",
689
+ stroke: "currentColor",
690
+ "stoke-width": "1.5",
691
+ "stroke-linecap": "round",
692
+ "stroke-linejoin": "round"
693
+ };
694
+ function _sfc_render$4(_ctx, _cache) {
695
+ return Mo.openBlock(), Mo.createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [Mo.createElementVNode("line", {
696
+ x1: "18",
697
+ y1: "6",
698
+ x2: "6",
699
+ y2: "18"
700
+ }, null, -1), Mo.createElementVNode("line", {
701
+ x1: "6",
702
+ y1: "6",
703
+ x2: "18",
704
+ y2: "18"
705
+ }, null, -1)]));
706
+ }
707
+ var CloseIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$4, [["render", _sfc_render$4]]);
708
+ const _hoisted_1$5 = ["data-visible"];
709
+ const _hoisted_2$1 = { class: "sonner-spinner" };
710
+ var Loader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Mo.defineComponent({
711
+ __name: "Loader",
712
+ props: { visible: { type: Boolean } },
713
+ setup(__props) {
714
+ const bars = Array(12).fill(0);
715
+ return (_ctx, _cache) => {
716
+ return Mo.openBlock(), Mo.createElementBlock("div", {
717
+ class: "sonner-loading-wrapper",
718
+ "data-visible": _ctx.visible
719
+ }, [Mo.createElementVNode("div", _hoisted_2$1, [(Mo.openBlock(true), Mo.createElementBlock(Mo.Fragment, null, Mo.renderList(Mo.unref(bars), (bar) => {
720
+ return Mo.openBlock(), Mo.createElementBlock("div", {
721
+ key: `spinner-bar-${bar}`,
722
+ class: "sonner-loading-bar"
723
+ });
724
+ }), 128))])], 8, _hoisted_1$5);
725
+ };
726
+ }
727
+ });
728
+ var Loader_default = Loader_vue_vue_type_script_setup_true_lang_default;
729
+ const _sfc_main$3 = {};
730
+ const _hoisted_1$4 = {
731
+ xmlns: "http://www.w3.org/2000/svg",
732
+ viewBox: "0 0 20 20",
733
+ fill: "currentColor",
734
+ height: "20",
735
+ width: "20"
736
+ };
737
+ function _sfc_render$3(_ctx, _cache) {
738
+ return Mo.openBlock(), Mo.createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [Mo.createElementVNode("path", {
739
+ "fill-rule": "evenodd",
740
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
741
+ "clip-rule": "evenodd"
742
+ }, null, -1)]));
743
+ }
744
+ var SuccessIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$3, [["render", _sfc_render$3]]);
745
+ const _sfc_main$2 = {};
746
+ const _hoisted_1$3 = {
747
+ xmlns: "http://www.w3.org/2000/svg",
748
+ viewBox: "0 0 20 20",
749
+ fill: "currentColor",
750
+ height: "20",
751
+ width: "20"
752
+ };
753
+ function _sfc_render$2(_ctx, _cache) {
754
+ return Mo.openBlock(), Mo.createElementBlock("svg", _hoisted_1$3, _cache[0] || (_cache[0] = [Mo.createElementVNode("path", {
755
+ "fill-rule": "evenodd",
756
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
757
+ "clip-rule": "evenodd"
758
+ }, null, -1)]));
759
+ }
760
+ var InfoIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$2, [["render", _sfc_render$2]]);
761
+ const _sfc_main$1 = {};
762
+ const _hoisted_1$2 = {
763
+ xmlns: "http://www.w3.org/2000/svg",
764
+ viewBox: "0 0 24 24",
765
+ fill: "currentColor",
766
+ height: "20",
767
+ width: "20"
768
+ };
769
+ function _sfc_render$1(_ctx, _cache) {
770
+ return Mo.openBlock(), Mo.createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [Mo.createElementVNode("path", {
771
+ "fill-rule": "evenodd",
772
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
773
+ "clip-rule": "evenodd"
774
+ }, null, -1)]));
775
+ }
776
+ var WarningIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$1, [["render", _sfc_render$1]]);
777
+ const _sfc_main$5 = {};
778
+ const _hoisted_1$1 = {
779
+ xmlns: "http://www.w3.org/2000/svg",
780
+ viewBox: "0 0 20 20",
781
+ fill: "currentColor",
782
+ height: "20",
783
+ width: "20"
784
+ };
785
+ function _sfc_render(_ctx, _cache) {
786
+ return Mo.openBlock(), Mo.createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [Mo.createElementVNode("path", {
787
+ "fill-rule": "evenodd",
788
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
789
+ "clip-rule": "evenodd"
790
+ }, null, -1)]));
791
+ }
792
+ var ErrorIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$5, [["render", _sfc_render]]);
793
+ const _hoisted_1 = ["aria-label"];
794
+ const _hoisted_2 = [
795
+ "data-sonner-theme",
796
+ "dir",
797
+ "data-theme",
798
+ "data-rich-colors",
799
+ "data-y-position",
800
+ "data-x-position",
801
+ "data-lifted"
802
+ ];
803
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
804
+ function getDocumentDirection() {
805
+ if (typeof window === "undefined") return "ltr";
806
+ if (typeof document === "undefined") return "ltr";
807
+ const dirAttribute = document.documentElement.getAttribute("dir");
808
+ if (dirAttribute === "auto" || !dirAttribute) return window.getComputedStyle(document.documentElement).direction;
809
+ return dirAttribute;
810
+ }
811
+ var Toaster_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Mo.defineComponent({
812
+ name: "Toaster",
813
+ inheritAttrs: false,
814
+ __name: "Toaster",
815
+ props: {
816
+ invert: {
817
+ type: Boolean,
818
+ default: false
819
+ },
820
+ theme: { default: "light" },
821
+ position: { default: "bottom-right" },
822
+ hotkey: { default: () => ["altKey", "KeyT"] },
823
+ richColors: {
824
+ type: Boolean,
825
+ default: false
826
+ },
827
+ expand: {
828
+ type: Boolean,
829
+ default: false
830
+ },
831
+ duration: {},
832
+ gap: { default: GAP },
833
+ visibleToasts: { default: VISIBLE_TOASTS_AMOUNT },
834
+ closeButton: {
835
+ type: Boolean,
836
+ default: false
837
+ },
838
+ toastOptions: { default: () => ({}) },
839
+ class: { default: "" },
840
+ style: {},
841
+ offset: { default: VIEWPORT_OFFSET },
842
+ mobileOffset: { default: MOBILE_VIEWPORT_OFFSET },
843
+ dir: { default: "auto" },
844
+ swipeDirections: {},
845
+ icons: {},
846
+ containerAriaLabel: { default: "Notifications" }
847
+ },
848
+ setup(__props) {
849
+ const props = __props;
850
+ const attrs = Mo.useAttrs();
851
+ const toasts = Mo.ref([]);
852
+ function filteredToasts(pos, index) {
853
+ return toasts.value.filter((toast$1) => !toast$1.position && index === 0 || toast$1.position === pos);
854
+ }
855
+ const possiblePositions = Mo.computed(() => {
856
+ const posList = toasts.value.filter((toast$1) => toast$1.position).map((toast$1) => toast$1.position);
857
+ return posList.length > 0 ? Array.from(new Set([props.position].concat(posList))) : [props.position];
858
+ });
859
+ const toastsByPosition = Mo.computed(() => {
860
+ const result = {};
861
+ possiblePositions.value.forEach((pos) => {
862
+ result[pos] = toasts.value.filter((t) => t.position === pos);
863
+ });
864
+ return result;
865
+ });
866
+ const heights = Mo.ref([]);
867
+ const expanded = Mo.ref(false);
868
+ const interacting = Mo.ref(false);
869
+ const actualTheme = Mo.ref(props.theme !== "system" ? props.theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
870
+ const listRef = Mo.ref(null);
871
+ const lastFocusedElementRef = Mo.ref(null);
872
+ const isFocusWithinRef = Mo.ref(false);
873
+ const hotkeyLabel = props.hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
874
+ function removeToast(toastToRemove) {
875
+ var _a;
876
+ if (!((_a = toasts.value.find((toast$1) => toast$1.id === toastToRemove.id)) == null ? void 0 : _a.delete)) ToastState.dismiss(toastToRemove.id);
877
+ toasts.value = toasts.value.filter(({ id }) => id !== toastToRemove.id);
878
+ setTimeout(() => {
879
+ if (!toasts.value.find((t) => t.id === toastToRemove.id)) heights.value = heights.value.filter((h) => h.toastId !== toastToRemove.id);
880
+ }, TIME_BEFORE_UNMOUNT + 50);
881
+ }
882
+ function onBlur(event) {
883
+ var _a, _b;
884
+ if (isFocusWithinRef.value && !((_b = (_a = event.currentTarget) == null ? void 0 : _a.contains) == null ? void 0 : _b.call(_a, event.relatedTarget))) {
885
+ isFocusWithinRef.value = false;
886
+ if (lastFocusedElementRef.value) {
887
+ lastFocusedElementRef.value.focus({ preventScroll: true });
888
+ lastFocusedElementRef.value = null;
889
+ }
890
+ }
891
+ }
892
+ function onFocus(event) {
893
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
894
+ if (isNotDismissible) return;
895
+ if (!isFocusWithinRef.value) {
896
+ isFocusWithinRef.value = true;
897
+ lastFocusedElementRef.value = event.relatedTarget;
898
+ }
899
+ }
900
+ function onPointerDown(event) {
901
+ if (event.target) {
902
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
903
+ if (isNotDismissible) return;
904
+ }
905
+ interacting.value = true;
906
+ }
907
+ Mo.watchEffect((onInvalidate) => {
908
+ const unsubscribe = ToastState.subscribe((toast$1) => {
909
+ if (toast$1.dismiss) {
910
+ requestAnimationFrame(() => {
911
+ toasts.value = toasts.value.map((t) => t.id === toast$1.id ? {
912
+ ...t,
913
+ delete: true
914
+ } : t);
915
+ });
916
+ return;
917
+ }
918
+ Mo.nextTick(() => {
919
+ const indexOfExistingToast = toasts.value.findIndex((t) => t.id === toast$1.id);
920
+ if (indexOfExistingToast !== -1) toasts.value = [
921
+ ...toasts.value.slice(0, indexOfExistingToast),
922
+ {
923
+ ...toasts.value[indexOfExistingToast],
924
+ ...toast$1
925
+ },
926
+ ...toasts.value.slice(indexOfExistingToast + 1)
927
+ ];
928
+ else toasts.value = [toast$1, ...toasts.value];
929
+ });
930
+ });
931
+ onInvalidate(unsubscribe);
932
+ });
933
+ Mo.watchEffect((onInvalidate) => {
934
+ if (typeof window === "undefined") return;
935
+ if (props.theme !== "system") {
936
+ actualTheme.value = props.theme;
937
+ return;
938
+ }
939
+ const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
940
+ const updateTheme = (matches) => {
941
+ actualTheme.value = matches ? "dark" : "light";
942
+ };
943
+ updateTheme(darkMediaQuery.matches);
944
+ const handler = (event) => {
945
+ updateTheme(event.matches);
946
+ };
947
+ try {
948
+ darkMediaQuery.addEventListener("change", handler);
949
+ } catch {
950
+ darkMediaQuery.addListener(handler);
951
+ }
952
+ onInvalidate(() => {
953
+ try {
954
+ darkMediaQuery.removeEventListener("change", handler);
955
+ } catch {
956
+ darkMediaQuery.removeListener(handler);
957
+ }
958
+ });
959
+ });
960
+ Mo.watchEffect(() => {
961
+ if (listRef.value && lastFocusedElementRef.value) {
962
+ lastFocusedElementRef.value.focus({ preventScroll: true });
963
+ lastFocusedElementRef.value = null;
964
+ isFocusWithinRef.value = false;
965
+ }
966
+ });
967
+ Mo.watchEffect(() => {
968
+ if (toasts.value.length <= 1) expanded.value = false;
969
+ });
970
+ Mo.watchEffect((onInvalidate) => {
971
+ function handleKeyDown(event) {
972
+ const isHotkeyPressed = props.hotkey.every((key) => event[key] || event.code === key);
973
+ const listRefItem = Array.isArray(listRef.value) ? listRef.value[0] : listRef.value;
974
+ if (isHotkeyPressed) {
975
+ expanded.value = true;
976
+ listRefItem == null ? void 0 : listRefItem.focus();
977
+ }
978
+ const isItemActive = document.activeElement === listRef.value || (listRefItem == null ? void 0 : listRefItem.contains(document.activeElement));
979
+ if (event.code === "Escape" && isItemActive) expanded.value = false;
980
+ }
981
+ if (!isClient) return;
982
+ document.addEventListener("keydown", handleKeyDown);
983
+ onInvalidate(() => {
984
+ document.removeEventListener("keydown", handleKeyDown);
985
+ });
986
+ });
987
+ function handleMouseEnter() {
988
+ expanded.value = true;
989
+ }
990
+ function handleMouseLeave() {
991
+ if (!interacting.value) expanded.value = false;
992
+ }
993
+ function handleDragEnd() {
994
+ expanded.value = false;
995
+ }
996
+ function handlePointerUp() {
997
+ interacting.value = false;
998
+ }
999
+ function updateHeights(h) {
1000
+ heights.value = h;
1001
+ }
1002
+ function updateHeight(h) {
1003
+ const index = heights.value.findIndex((item) => item.toastId === h.toastId);
1004
+ if (index !== -1) heights.value[index] = h;
1005
+ else {
1006
+ const samePositionIndex = heights.value.findIndex((item) => item.position === h.position);
1007
+ if (samePositionIndex !== -1) heights.value.splice(samePositionIndex, 0, h);
1008
+ else heights.value.unshift(h);
1009
+ }
1010
+ }
1011
+ return (_ctx, _cache) => {
1012
+ return Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, null, [Mo.createCommentVNode(" Remove item from normal navigation flow, only available via hotkey "), Mo.createElementVNode("section", {
1013
+ "aria-label": `${_ctx.containerAriaLabel} ${Mo.unref(hotkeyLabel)}`,
1014
+ tabIndex: -1,
1015
+ "aria-live": "polite",
1016
+ "aria-relevant": "additions text",
1017
+ "aria-atomic": "false"
1018
+ }, [(Mo.openBlock(true), Mo.createElementBlock(Mo.Fragment, null, Mo.renderList(possiblePositions.value, (pos, index) => {
1019
+ var _a;
1020
+ return Mo.openBlock(), Mo.createElementBlock("ol", Mo.mergeProps({
1021
+ key: pos,
1022
+ ref_for: true,
1023
+ ref_key: "listRef",
1024
+ ref: listRef,
1025
+ "data-sonner-toaster": "",
1026
+ "data-sonner-theme": actualTheme.value,
1027
+ class: props.class,
1028
+ dir: _ctx.dir === "auto" ? getDocumentDirection() : _ctx.dir,
1029
+ tabIndex: -1,
1030
+ "data-theme": _ctx.theme,
1031
+ "data-rich-colors": _ctx.richColors,
1032
+ "data-y-position": pos.split("-")[0],
1033
+ "data-x-position": pos.split("-")[1],
1034
+ "data-lifted": expanded.value && toasts.value.length > 1 && !_ctx.expand,
1035
+ style: {
1036
+ "--front-toast-height": `${((_a = heights.value[0]) == null ? void 0 : _a.height) || 0}px`,
1037
+ "--width": `${Mo.unref(TOAST_WIDTH)}px`,
1038
+ "--gap": `${_ctx.gap}px`,
1039
+ ..._ctx.style,
1040
+ ...Mo.unref(attrs).style,
1041
+ ...Mo.unref(assignOffset)(_ctx.offset, _ctx.mobileOffset)
1042
+ }
1043
+ }, _ctx.$attrs, {
1044
+ onBlur,
1045
+ onFocus,
1046
+ onMouseenter: handleMouseEnter,
1047
+ onMousemove: handleMouseEnter,
1048
+ onMouseleave: handleMouseLeave,
1049
+ onDragend: handleDragEnd,
1050
+ onPointerdown: onPointerDown,
1051
+ onPointerup: handlePointerUp
1052
+ }), [(Mo.openBlock(true), Mo.createElementBlock(Mo.Fragment, null, Mo.renderList(filteredToasts(pos, index), (toast$1, idx) => {
1053
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
1054
+ return Mo.openBlock(), Mo.createBlock(Toast_default, {
1055
+ key: toast$1.id,
1056
+ heights: heights.value,
1057
+ icons: _ctx.icons,
1058
+ index: idx,
1059
+ toast: toast$1,
1060
+ defaultRichColors: _ctx.richColors,
1061
+ duration: ((_a2 = _ctx.toastOptions) == null ? void 0 : _a2.duration) ?? _ctx.duration,
1062
+ class: Mo.normalizeClass(((_b = _ctx.toastOptions) == null ? void 0 : _b.class) ?? ""),
1063
+ descriptionClass: (_c = _ctx.toastOptions) == null ? void 0 : _c.descriptionClass,
1064
+ invert: _ctx.invert,
1065
+ visibleToasts: _ctx.visibleToasts,
1066
+ closeButton: ((_d = _ctx.toastOptions) == null ? void 0 : _d.closeButton) ?? _ctx.closeButton,
1067
+ interacting: interacting.value,
1068
+ position: pos,
1069
+ style: Mo.normalizeStyle((_e = _ctx.toastOptions) == null ? void 0 : _e.style),
1070
+ unstyled: (_f = _ctx.toastOptions) == null ? void 0 : _f.unstyled,
1071
+ classes: (_g = _ctx.toastOptions) == null ? void 0 : _g.classes,
1072
+ cancelButtonStyle: (_h = _ctx.toastOptions) == null ? void 0 : _h.cancelButtonStyle,
1073
+ actionButtonStyle: (_i = _ctx.toastOptions) == null ? void 0 : _i.actionButtonStyle,
1074
+ "close-button-aria-label": (_j = _ctx.toastOptions) == null ? void 0 : _j.closeButtonAriaLabel,
1075
+ toasts: toastsByPosition.value[pos],
1076
+ expandByDefault: _ctx.expand,
1077
+ gap: _ctx.gap,
1078
+ expanded: expanded.value,
1079
+ swipeDirections: props.swipeDirections,
1080
+ "onUpdate:heights": updateHeights,
1081
+ "onUpdate:height": updateHeight,
1082
+ onRemoveToast: removeToast
1083
+ }, {
1084
+ "close-icon": Mo.withCtx(() => [Mo.renderSlot(_ctx.$slots, "close-icon", {}, () => [Mo.createVNode(CloseIcon_default)])]),
1085
+ "loading-icon": Mo.withCtx(() => [Mo.renderSlot(_ctx.$slots, "loading-icon", {}, () => [Mo.createVNode(Loader_default, { visible: toast$1.type === "loading" }, null, 8, ["visible"])])]),
1086
+ "success-icon": Mo.withCtx(() => [Mo.renderSlot(_ctx.$slots, "success-icon", {}, () => [Mo.createVNode(SuccessIcon_default)])]),
1087
+ "error-icon": Mo.withCtx(() => [Mo.renderSlot(_ctx.$slots, "error-icon", {}, () => [Mo.createVNode(ErrorIcon_default)])]),
1088
+ "warning-icon": Mo.withCtx(() => [Mo.renderSlot(_ctx.$slots, "warning-icon", {}, () => [Mo.createVNode(WarningIcon_default)])]),
1089
+ "info-icon": Mo.withCtx(() => [Mo.renderSlot(_ctx.$slots, "info-icon", {}, () => [Mo.createVNode(InfoIcon_default)])]),
1090
+ _: 2
1091
+ }, 1032, [
1092
+ "heights",
1093
+ "icons",
1094
+ "index",
1095
+ "toast",
1096
+ "defaultRichColors",
1097
+ "duration",
1098
+ "class",
1099
+ "descriptionClass",
1100
+ "invert",
1101
+ "visibleToasts",
1102
+ "closeButton",
1103
+ "interacting",
1104
+ "position",
1105
+ "style",
1106
+ "unstyled",
1107
+ "classes",
1108
+ "cancelButtonStyle",
1109
+ "actionButtonStyle",
1110
+ "close-button-aria-label",
1111
+ "toasts",
1112
+ "expandByDefault",
1113
+ "gap",
1114
+ "expanded",
1115
+ "swipeDirections"
1116
+ ]);
1117
+ }), 128))], 16, _hoisted_2);
1118
+ }), 128))], 8, _hoisted_1)], 2112);
1119
+ };
1120
+ }
1121
+ });
1122
+ var Toaster_default = Toaster_vue_vue_type_script_setup_true_lang_default;
1123
+ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
1124
+ __name: "sonner",
1125
+ props: {
1126
+ invert: { type: Boolean },
1127
+ theme: {},
1128
+ position: {},
1129
+ hotkey: {},
1130
+ richColors: { type: Boolean },
1131
+ expand: { type: Boolean },
1132
+ duration: {},
1133
+ gap: {},
1134
+ visibleToasts: {},
1135
+ closeButton: { type: Boolean },
1136
+ toastOptions: {},
1137
+ class: {},
1138
+ style: {},
1139
+ offset: {},
1140
+ mobileOffset: {},
1141
+ dir: {},
1142
+ swipeDirections: {},
1143
+ icons: {},
1144
+ containerAriaLabel: {}
1145
+ },
1146
+ setup(__props) {
1147
+ const props = __props;
1148
+ return (_ctx, _cache) => {
1149
+ return Mo.openBlock(), Mo.createBlock(Mo.unref(Toaster_default), Mo.normalizeProps(Mo.guardReactiveProps(props)), null, 16);
1150
+ };
1151
+ }
1152
+ });
1153
+ exports._sfc_main = _sfc_main;