@devalok/shilp-sutra 0.34.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (541) hide show
  1. package/LICENSE +21 -21
  2. package/dist/_chunks/badge-group.js +306 -246
  3. package/dist/_chunks/badge-group.js.map +1 -0
  4. package/dist/_chunks/chat.js +518 -0
  5. package/dist/_chunks/chat.js.map +1 -0
  6. package/dist/_chunks/date-picker.js +748 -0
  7. package/dist/_chunks/date-picker.js.map +1 -0
  8. package/dist/_chunks/document-preview.js +109 -90
  9. package/dist/_chunks/document-preview.js.map +1 -0
  10. package/dist/_chunks/file-preview.js +492 -504
  11. package/dist/_chunks/file-preview.js.map +1 -0
  12. package/dist/_chunks/framer.js +5564 -5613
  13. package/dist/_chunks/framer.js.map +1 -0
  14. package/dist/_chunks/image-preview.js +127 -88
  15. package/dist/_chunks/image-preview.js.map +1 -0
  16. package/dist/_chunks/keybinding.js +12 -14
  17. package/dist/_chunks/keybinding.js.map +1 -0
  18. package/dist/_chunks/link-context.js +19 -16
  19. package/dist/_chunks/link-context.js.map +1 -0
  20. package/dist/_chunks/mention-suggestion.js +353 -350
  21. package/dist/_chunks/mention-suggestion.js.map +1 -0
  22. package/dist/_chunks/motion-provider.js +26 -20
  23. package/dist/_chunks/motion-provider.js.map +1 -0
  24. package/dist/_chunks/popover.js +123 -0
  25. package/dist/_chunks/popover.js.map +1 -0
  26. package/dist/_chunks/primitives.js +7585 -6426
  27. package/dist/_chunks/primitives.js.map +1 -0
  28. package/dist/_chunks/rich-chat-input.js +2071 -0
  29. package/dist/_chunks/rich-chat-input.js.map +1 -0
  30. package/dist/_chunks/rolldown-runtime.js +21 -0
  31. package/dist/_chunks/shared.js +126 -0
  32. package/dist/_chunks/shared.js.map +1 -0
  33. package/dist/_chunks/sonner.js +605 -734
  34. package/dist/_chunks/sonner.js.map +1 -0
  35. package/dist/_chunks/stat-row.js +418 -440
  36. package/dist/_chunks/stat-row.js.map +1 -0
  37. package/dist/_chunks/tiptap.js +15850 -19964
  38. package/dist/_chunks/tiptap.js.map +1 -0
  39. package/dist/_chunks/tree-view.js +231 -290
  40. package/dist/_chunks/tree-view.js.map +1 -0
  41. package/dist/_chunks/use-calendar.js +161 -208
  42. package/dist/_chunks/use-calendar.js.map +1 -0
  43. package/dist/_chunks/vendor-client.js +314 -2199
  44. package/dist/_chunks/vendor-client.js.map +1 -0
  45. package/dist/_chunks/vendor-utils.js +1721 -2978
  46. package/dist/_chunks/vendor-utils.js.map +1 -0
  47. package/dist/ai/ai-command-provider.js +23 -17
  48. package/dist/ai/ai-command-provider.js.map +1 -0
  49. package/dist/ai/block-renderer.js +68 -51
  50. package/dist/ai/block-renderer.js.map +1 -0
  51. package/dist/ai/blocks/index.js +2 -12
  52. package/dist/ai/blocks/loading.d.ts.map +1 -1
  53. package/dist/ai/command-bar.js +470 -519
  54. package/dist/ai/command-bar.js.map +1 -0
  55. package/dist/ai/conversation.js +241 -227
  56. package/dist/ai/conversation.js.map +1 -0
  57. package/dist/ai/devadoot-icon.d.ts.map +1 -1
  58. package/dist/ai/index.js +181 -167
  59. package/dist/ai/index.js.map +1 -0
  60. package/dist/ai/types.js +0 -1
  61. package/dist/composed/activity-feed.js +232 -202
  62. package/dist/composed/activity-feed.js.map +1 -0
  63. package/dist/composed/avatar-group.js +164 -222
  64. package/dist/composed/avatar-group.js.map +1 -0
  65. package/dist/composed/bulk-action-bar.js +166 -165
  66. package/dist/composed/bulk-action-bar.js.map +1 -0
  67. package/dist/composed/command-palette.js +290 -308
  68. package/dist/composed/command-palette.js.map +1 -0
  69. package/dist/composed/confirm-dialog.js +28 -48
  70. package/dist/composed/confirm-dialog.js.map +1 -0
  71. package/dist/composed/content-card.js +69 -108
  72. package/dist/composed/content-card.js.map +1 -0
  73. package/dist/composed/date-picker/index.js +3 -13
  74. package/dist/composed/deadline-indicator.js +68 -74
  75. package/dist/composed/deadline-indicator.js.map +1 -0
  76. package/dist/composed/emoji-picker.js +83 -110
  77. package/dist/composed/emoji-picker.js.map +1 -0
  78. package/dist/composed/empty-state.d.ts.map +1 -1
  79. package/dist/composed/empty-state.js +64 -103
  80. package/dist/composed/empty-state.js.map +1 -0
  81. package/dist/composed/error-boundary.js +129 -127
  82. package/dist/composed/error-boundary.js.map +1 -0
  83. package/dist/composed/file-preview.js +2 -12
  84. package/dist/composed/filter-bar.js +98 -130
  85. package/dist/composed/filter-bar.js.map +1 -0
  86. package/dist/composed/form-section.js +61 -45
  87. package/dist/composed/form-section.js.map +1 -0
  88. package/dist/composed/global-loading.js +34 -47
  89. package/dist/composed/global-loading.js.map +1 -0
  90. package/dist/composed/index.js +34 -92
  91. package/dist/composed/inline-edit.js +92 -107
  92. package/dist/composed/inline-edit.js.map +1 -0
  93. package/dist/composed/lib/string-utils.js +8 -8
  94. package/dist/composed/lib/string-utils.js.map +1 -0
  95. package/dist/composed/loading-skeleton.js +103 -171
  96. package/dist/composed/loading-skeleton.js.map +1 -0
  97. package/dist/composed/markdown-viewer.js +187 -139
  98. package/dist/composed/markdown-viewer.js.map +1 -0
  99. package/dist/composed/master-detail.js +147 -156
  100. package/dist/composed/master-detail.js.map +1 -0
  101. package/dist/composed/member-picker.js +46 -49
  102. package/dist/composed/member-picker.js.map +1 -0
  103. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  104. package/dist/composed/multi-select-popover.js +185 -179
  105. package/dist/composed/multi-select-popover.js.map +1 -0
  106. package/dist/composed/page-header.js +54 -76
  107. package/dist/composed/page-header.js.map +1 -0
  108. package/dist/composed/page-skeletons.js +143 -127
  109. package/dist/composed/page-skeletons.js.map +1 -0
  110. package/dist/composed/priority-indicator.js +105 -111
  111. package/dist/composed/priority-indicator.js.map +1 -0
  112. package/dist/composed/responsive-overlay.js +36 -41
  113. package/dist/composed/responsive-overlay.js.map +1 -0
  114. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  115. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  116. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  117. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  118. package/dist/composed/rich-chat-input.js +2 -1860
  119. package/dist/composed/rich-text-editor.js +561 -424
  120. package/dist/composed/rich-text-editor.js.map +1 -0
  121. package/dist/composed/schedule-view.js +134 -185
  122. package/dist/composed/schedule-view.js.map +1 -0
  123. package/dist/composed/simple-tooltip.js +21 -21
  124. package/dist/composed/simple-tooltip.js.map +1 -0
  125. package/dist/composed/status-badge.d.ts.map +1 -1
  126. package/dist/composed/status-badge.js +133 -137
  127. package/dist/composed/status-badge.js.map +1 -0
  128. package/dist/hooks/index.js +7 -12
  129. package/dist/hooks/use-color-mode.js +28 -25
  130. package/dist/hooks/use-color-mode.js.map +1 -0
  131. package/dist/hooks/use-mobile.js +13 -13
  132. package/dist/hooks/use-mobile.js.map +1 -0
  133. package/dist/hooks/use-toast.js +2 -4
  134. package/dist/hooks/use-touch-device.js +9 -11
  135. package/dist/hooks/use-touch-device.js.map +1 -0
  136. package/dist/hooks/use-viewport-height.js +14 -14
  137. package/dist/hooks/use-viewport-height.js.map +1 -0
  138. package/dist/motion/check-motion-provider.d.ts +3 -0
  139. package/dist/motion/check-motion-provider.d.ts.map +1 -0
  140. package/dist/motion/index.js +17 -11
  141. package/dist/motion/index.js.map +1 -0
  142. package/dist/motion/primitives-index.js +226 -186
  143. package/dist/motion/primitives-index.js.map +1 -0
  144. package/dist/primitives/react-accordion.d.ts +114 -114
  145. package/dist/primitives/react-alert-dialog.d.ts +51 -51
  146. package/dist/primitives/react-aspect-ratio.d.ts +11 -11
  147. package/dist/primitives/react-avatar.d.ts +24 -24
  148. package/dist/primitives/react-checkbox.d.ts +50 -50
  149. package/dist/primitives/react-collapsible.d.ts +33 -33
  150. package/dist/primitives/react-context-menu.d.ts +96 -96
  151. package/dist/primitives/react-dialog.d.ts +103 -103
  152. package/dist/primitives/react-dropdown-menu.d.ts +97 -97
  153. package/dist/primitives/react-hover-card.d.ts +79 -79
  154. package/dist/primitives/react-label.d.ts +10 -10
  155. package/dist/primitives/react-menu.d.ts +169 -169
  156. package/dist/primitives/react-menubar.d.ts +115 -115
  157. package/dist/primitives/react-navigation-menu.d.ts +126 -126
  158. package/dist/primitives/react-popover.d.ts +85 -85
  159. package/dist/primitives/react-progress.d.ts +19 -19
  160. package/dist/primitives/react-radio-group.d.ts +58 -58
  161. package/dist/primitives/react-roving-focus.d.ts +49 -49
  162. package/dist/primitives/react-select.d.ts +137 -137
  163. package/dist/primitives/react-separator.d.ts +21 -21
  164. package/dist/primitives/react-slider.d.ts +75 -75
  165. package/dist/primitives/react-switch.d.ts +21 -21
  166. package/dist/primitives/react-tabs.d.ts +56 -56
  167. package/dist/primitives/react-toast.d.ts +120 -120
  168. package/dist/primitives/react-toggle-group.d.ts +75 -75
  169. package/dist/primitives/react-toggle.d.ts +24 -24
  170. package/dist/primitives/react-tooltip.d.ts +101 -101
  171. package/dist/primitives/react-visually-hidden.d.ts +22 -22
  172. package/dist/shell/app-command-palette.d.ts +2 -0
  173. package/dist/shell/app-command-palette.d.ts.map +1 -1
  174. package/dist/shell/app-command-palette.js +94 -238
  175. package/dist/shell/app-command-palette.js.map +1 -0
  176. package/dist/shell/bottom-navbar.js +150 -190
  177. package/dist/shell/bottom-navbar.js.map +1 -0
  178. package/dist/shell/command-registry.js +13 -14
  179. package/dist/shell/command-registry.js.map +1 -0
  180. package/dist/shell/index.js +10 -20
  181. package/dist/shell/link-context.js +2 -5
  182. package/dist/shell/notification-center.d.ts.map +1 -1
  183. package/dist/shell/notification-center.js +263 -259
  184. package/dist/shell/notification-center.js.map +1 -0
  185. package/dist/shell/notification-preferences.js +241 -184
  186. package/dist/shell/notification-preferences.js.map +1 -0
  187. package/dist/shell/sidebar.js +251 -281
  188. package/dist/shell/sidebar.js.map +1 -0
  189. package/dist/shell/top-bar.js +203 -237
  190. package/dist/shell/top-bar.js.map +1 -0
  191. package/dist/tailwind/index.cjs +473 -442
  192. package/dist/tailwind/index.js +2 -4
  193. package/dist/tailwind/preset.d.ts.map +1 -1
  194. package/dist/tailwind/preset.js +490 -459
  195. package/dist/tailwind/preset.js.map +1 -0
  196. package/dist/tokens/index.css +4 -4
  197. package/dist/tokens/primitives.css +442 -442
  198. package/dist/tokens/semantic.css +742 -547
  199. package/dist/tokens/typography-semantic.css +123 -100
  200. package/dist/tokens/typography.css +422 -422
  201. package/dist/ui/accordion.js +52 -60
  202. package/dist/ui/accordion.js.map +1 -0
  203. package/dist/ui/alert-dialog.d.ts +6 -2
  204. package/dist/ui/alert-dialog.d.ts.map +1 -1
  205. package/dist/ui/alert-dialog.js +112 -156
  206. package/dist/ui/alert-dialog.js.map +1 -0
  207. package/dist/ui/alert.d.ts +3 -2
  208. package/dist/ui/alert.d.ts.map +1 -1
  209. package/dist/ui/alert.js +203 -99
  210. package/dist/ui/alert.js.map +1 -0
  211. package/dist/ui/aspect-ratio.js +13 -16
  212. package/dist/ui/aspect-ratio.js.map +1 -0
  213. package/dist/ui/autocomplete.d.ts.map +1 -1
  214. package/dist/ui/autocomplete.js +137 -148
  215. package/dist/ui/autocomplete.js.map +1 -0
  216. package/dist/ui/avatar.js +196 -169
  217. package/dist/ui/avatar.js.map +1 -0
  218. package/dist/ui/badge-group.js +2 -7
  219. package/dist/ui/badge-indicator.js +42 -51
  220. package/dist/ui/badge-indicator.js.map +1 -0
  221. package/dist/ui/badge.js +2 -15
  222. package/dist/ui/banner.js +76 -68
  223. package/dist/ui/banner.js.map +1 -0
  224. package/dist/ui/breadcrumb.js +65 -84
  225. package/dist/ui/breadcrumb.js.map +1 -0
  226. package/dist/ui/button-group.js +109 -102
  227. package/dist/ui/button-group.js.map +1 -0
  228. package/dist/ui/button-processing.d.ts.map +1 -1
  229. package/dist/ui/button-processing.js +89 -72
  230. package/dist/ui/button-processing.js.map +1 -0
  231. package/dist/ui/button.js +393 -279
  232. package/dist/ui/button.js.map +1 -0
  233. package/dist/ui/card.js +151 -157
  234. package/dist/ui/card.js.map +1 -0
  235. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  236. package/dist/ui/charts/chart-container.d.ts +2 -0
  237. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  238. package/dist/ui/charts/index.js +1025 -1319
  239. package/dist/ui/charts/index.js.map +1 -0
  240. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  241. package/dist/ui/chat/index.js +2 -11
  242. package/dist/ui/chat/message-input.d.ts.map +1 -1
  243. package/dist/ui/chat/message-list.d.ts +1 -1
  244. package/dist/ui/chat/message-list.d.ts.map +1 -1
  245. package/dist/ui/chat/message.d.ts.map +1 -1
  246. package/dist/ui/chat/system-message.d.ts.map +1 -1
  247. package/dist/ui/checkbox.d.ts.map +1 -1
  248. package/dist/ui/checkbox.js +82 -100
  249. package/dist/ui/checkbox.js.map +1 -0
  250. package/dist/ui/code.js +18 -32
  251. package/dist/ui/code.js.map +1 -0
  252. package/dist/ui/collapsible.js +21 -29
  253. package/dist/ui/collapsible.js.map +1 -0
  254. package/dist/ui/color-input.d.ts.map +1 -1
  255. package/dist/ui/color-input.js +455 -372
  256. package/dist/ui/color-input.js.map +1 -0
  257. package/dist/ui/color-swatch.js +60 -90
  258. package/dist/ui/color-swatch.js.map +1 -0
  259. package/dist/ui/combobox.d.ts +7 -0
  260. package/dist/ui/combobox.d.ts.map +1 -1
  261. package/dist/ui/combobox.js +278 -293
  262. package/dist/ui/combobox.js.map +1 -0
  263. package/dist/ui/container.js +18 -24
  264. package/dist/ui/container.js.map +1 -0
  265. package/dist/ui/context-menu.js +154 -203
  266. package/dist/ui/context-menu.js.map +1 -0
  267. package/dist/ui/data-table-body.js +116 -213
  268. package/dist/ui/data-table-body.js.map +1 -0
  269. package/dist/ui/data-table-bulk-actions.js +43 -59
  270. package/dist/ui/data-table-bulk-actions.js.map +1 -0
  271. package/dist/ui/data-table-card.js +84 -71
  272. package/dist/ui/data-table-card.js.map +1 -0
  273. package/dist/ui/data-table-context.js +39 -42
  274. package/dist/ui/data-table-context.js.map +1 -0
  275. package/dist/ui/data-table-header.js +98 -139
  276. package/dist/ui/data-table-header.js.map +1 -0
  277. package/dist/ui/data-table-pagination.js +69 -82
  278. package/dist/ui/data-table-pagination.js.map +1 -0
  279. package/dist/ui/data-table-toolbar.js +104 -130
  280. package/dist/ui/data-table-toolbar.js.map +1 -0
  281. package/dist/ui/data-table.js +281 -354
  282. package/dist/ui/data-table.js.map +1 -0
  283. package/dist/ui/devalok-grain.js +77 -66
  284. package/dist/ui/devalok-grain.js.map +1 -0
  285. package/dist/ui/dialog.js +118 -151
  286. package/dist/ui/dialog.js.map +1 -0
  287. package/dist/ui/dropdown-menu.js +152 -203
  288. package/dist/ui/dropdown-menu.js.map +1 -0
  289. package/dist/ui/file-upload.js +242 -266
  290. package/dist/ui/file-upload.js.map +1 -0
  291. package/dist/ui/form.d.ts +8 -0
  292. package/dist/ui/form.d.ts.map +1 -1
  293. package/dist/ui/form.js +62 -56
  294. package/dist/ui/form.js.map +1 -0
  295. package/dist/ui/hover-card.js +54 -54
  296. package/dist/ui/hover-card.js.map +1 -0
  297. package/dist/ui/icon-button.js +21 -26
  298. package/dist/ui/icon-button.js.map +1 -0
  299. package/dist/ui/icon-context.js +17 -17
  300. package/dist/ui/icon-context.js.map +1 -0
  301. package/dist/ui/icon-group.js +22 -29
  302. package/dist/ui/icon-group.js.map +1 -0
  303. package/dist/ui/icon.js +201 -121
  304. package/dist/ui/icon.js.map +1 -0
  305. package/dist/ui/index.d.ts +4 -4
  306. package/dist/ui/index.d.ts.map +1 -1
  307. package/dist/ui/index.js +90 -350
  308. package/dist/ui/index.js.map +1 -0
  309. package/dist/ui/input-otp.d.ts +12 -3
  310. package/dist/ui/input-otp.d.ts.map +1 -1
  311. package/dist/ui/input-otp.js +58 -48
  312. package/dist/ui/input-otp.js.map +1 -0
  313. package/dist/ui/input.d.ts.map +1 -1
  314. package/dist/ui/input.js +93 -169
  315. package/dist/ui/input.js.map +1 -0
  316. package/dist/ui/label.d.ts.map +1 -1
  317. package/dist/ui/label.js +23 -23
  318. package/dist/ui/label.js.map +1 -0
  319. package/dist/ui/lib/check-tokens.d.ts +3 -0
  320. package/dist/ui/lib/check-tokens.d.ts.map +1 -0
  321. package/dist/ui/lib/date-utils.js +14 -11
  322. package/dist/ui/lib/date-utils.js.map +1 -0
  323. package/dist/ui/lib/motion.d.ts +15 -4
  324. package/dist/ui/lib/motion.d.ts.map +1 -1
  325. package/dist/ui/lib/motion.js +83 -33
  326. package/dist/ui/lib/motion.js.map +1 -0
  327. package/dist/ui/lib/utils.js +39 -16
  328. package/dist/ui/lib/utils.js.map +1 -0
  329. package/dist/ui/link.js +13 -24
  330. package/dist/ui/link.js.map +1 -0
  331. package/dist/ui/menubar.js +132 -210
  332. package/dist/ui/menubar.js.map +1 -0
  333. package/dist/ui/navigation-menu.js +163 -193
  334. package/dist/ui/navigation-menu.js.map +1 -0
  335. package/dist/ui/number-input.d.ts +16 -1
  336. package/dist/ui/number-input.d.ts.map +1 -1
  337. package/dist/ui/number-input.js +102 -95
  338. package/dist/ui/number-input.js.map +1 -0
  339. package/dist/ui/pagination.js +122 -159
  340. package/dist/ui/pagination.js.map +1 -0
  341. package/dist/ui/popover.js +2 -131
  342. package/dist/ui/progress-ring.d.ts.map +1 -1
  343. package/dist/ui/progress-ring.js +133 -143
  344. package/dist/ui/progress-ring.js.map +1 -0
  345. package/dist/ui/progress.js +51 -95
  346. package/dist/ui/progress.js.map +1 -0
  347. package/dist/ui/radio.d.ts.map +1 -1
  348. package/dist/ui/radio.js +47 -49
  349. package/dist/ui/radio.js.map +1 -0
  350. package/dist/ui/search-input.js +51 -53
  351. package/dist/ui/search-input.js.map +1 -0
  352. package/dist/ui/segmented-control.d.ts +1 -1
  353. package/dist/ui/segmented-control.d.ts.map +1 -1
  354. package/dist/ui/segmented-control.js +95 -114
  355. package/dist/ui/segmented-control.js.map +1 -0
  356. package/dist/ui/select.d.ts.map +1 -1
  357. package/dist/ui/select.js +137 -157
  358. package/dist/ui/select.js.map +1 -0
  359. package/dist/ui/separator.d.ts.map +1 -1
  360. package/dist/ui/separator.js +18 -25
  361. package/dist/ui/separator.js.map +1 -0
  362. package/dist/ui/sheet.js +135 -163
  363. package/dist/ui/sheet.js.map +1 -0
  364. package/dist/ui/sidebar.js +357 -600
  365. package/dist/ui/sidebar.js.map +1 -0
  366. package/dist/ui/skeleton.js +179 -231
  367. package/dist/ui/skeleton.js.map +1 -0
  368. package/dist/ui/slider.d.ts +22 -3
  369. package/dist/ui/slider.d.ts.map +1 -1
  370. package/dist/ui/slider.js +62 -34
  371. package/dist/ui/slider.js.map +1 -0
  372. package/dist/ui/spinner.js +226 -205
  373. package/dist/ui/spinner.js.map +1 -0
  374. package/dist/ui/split-button.d.ts.map +1 -1
  375. package/dist/ui/split-button.js +228 -276
  376. package/dist/ui/split-button.js.map +1 -0
  377. package/dist/ui/stack.js +56 -70
  378. package/dist/ui/stack.js.map +1 -0
  379. package/dist/ui/stat-card.js +259 -251
  380. package/dist/ui/stat-card.js.map +1 -0
  381. package/dist/ui/status-dot.js +67 -63
  382. package/dist/ui/status-dot.js.map +1 -0
  383. package/dist/ui/stepper.d.ts +10 -0
  384. package/dist/ui/stepper.d.ts.map +1 -1
  385. package/dist/ui/stepper.js +124 -168
  386. package/dist/ui/stepper.js.map +1 -0
  387. package/dist/ui/switch.d.ts.map +1 -1
  388. package/dist/ui/switch.js +56 -55
  389. package/dist/ui/switch.js.map +1 -0
  390. package/dist/ui/table.js +57 -90
  391. package/dist/ui/table.js.map +1 -0
  392. package/dist/ui/tabs.d.ts +3 -1
  393. package/dist/ui/tabs.d.ts.map +1 -1
  394. package/dist/ui/tabs.js +159 -156
  395. package/dist/ui/tabs.js.map +1 -0
  396. package/dist/ui/text.d.ts +1 -1
  397. package/dist/ui/text.d.ts.map +1 -1
  398. package/dist/ui/text.js +60 -59
  399. package/dist/ui/text.js.map +1 -0
  400. package/dist/ui/textarea.js +40 -57
  401. package/dist/ui/textarea.js.map +1 -0
  402. package/dist/ui/toast-registry.d.ts +8 -0
  403. package/dist/ui/toast-registry.d.ts.map +1 -0
  404. package/dist/ui/toast-registry.js +13 -0
  405. package/dist/ui/toast-registry.js.map +1 -0
  406. package/dist/ui/toast-types.js +0 -1
  407. package/dist/ui/toast.d.ts.map +1 -1
  408. package/dist/ui/toast.js +559 -536
  409. package/dist/ui/toast.js.map +1 -0
  410. package/dist/ui/toaster.d.ts.map +1 -1
  411. package/dist/ui/toaster.js +24 -33
  412. package/dist/ui/toaster.js.map +1 -0
  413. package/dist/ui/toggle-group.d.ts +2 -0
  414. package/dist/ui/toggle-group.d.ts.map +1 -1
  415. package/dist/ui/toggle-group.js +44 -41
  416. package/dist/ui/toggle-group.js.map +1 -0
  417. package/dist/ui/toggle.d.ts +2 -0
  418. package/dist/ui/toggle.d.ts.map +1 -1
  419. package/dist/ui/toggle.js +44 -40
  420. package/dist/ui/toggle.js.map +1 -0
  421. package/dist/ui/tooltip.js +80 -65
  422. package/dist/ui/tooltip.js.map +1 -0
  423. package/dist/ui/tree-view/index.js +2 -6
  424. package/dist/ui/visually-hidden.js +12 -10
  425. package/dist/ui/visually-hidden.js.map +1 -0
  426. package/docs/components/_header.md +85 -85
  427. package/docs/components/composed/activity-feed.md +62 -62
  428. package/docs/components/composed/avatar-group.md +65 -65
  429. package/docs/components/composed/bulk-action-bar.md +40 -40
  430. package/docs/components/composed/command-palette.md +40 -40
  431. package/docs/components/composed/confirm-dialog.md +46 -46
  432. package/docs/components/composed/content-card.md +36 -36
  433. package/docs/components/composed/date-picker.md +130 -130
  434. package/docs/components/composed/deadline-indicator.md +27 -27
  435. package/docs/components/composed/emoji-picker.md +52 -52
  436. package/docs/components/composed/empty-state.md +53 -53
  437. package/docs/components/composed/error-boundary.md +29 -29
  438. package/docs/components/composed/file-preview.md +40 -40
  439. package/docs/components/composed/filter-bar.md +57 -57
  440. package/docs/components/composed/form-section.md +31 -31
  441. package/docs/components/composed/global-loading.md +27 -27
  442. package/docs/components/composed/inline-edit.md +35 -35
  443. package/docs/components/composed/loading-skeleton.md +51 -51
  444. package/docs/components/composed/markdown-viewer.md +27 -27
  445. package/docs/components/composed/master-detail.md +48 -48
  446. package/docs/components/composed/member-picker.md +35 -35
  447. package/docs/components/composed/multi-select-popover.md +62 -62
  448. package/docs/components/composed/page-header.md +41 -41
  449. package/docs/components/composed/page-skeletons.md +32 -32
  450. package/docs/components/composed/priority-indicator.md +32 -32
  451. package/docs/components/composed/responsive-overlay.md +34 -34
  452. package/docs/components/composed/rich-text-editor.md +82 -82
  453. package/docs/components/composed/schedule-view.md +39 -39
  454. package/docs/components/composed/simple-tooltip.md +33 -33
  455. package/docs/components/composed/status-badge.md +55 -55
  456. package/docs/components/shell/app-command-palette.md +44 -44
  457. package/docs/components/shell/bottom-navbar.md +52 -52
  458. package/docs/components/shell/command-registry.md +48 -48
  459. package/docs/components/shell/link-context.md +41 -41
  460. package/docs/components/shell/notification-center.md +63 -63
  461. package/docs/components/shell/notification-preferences.md +42 -42
  462. package/docs/components/shell/sidebar.md +92 -92
  463. package/docs/components/shell/top-bar.md +143 -143
  464. package/docs/components/ui/accordion.md +51 -51
  465. package/docs/components/ui/alert-dialog.md +61 -61
  466. package/docs/components/ui/alert.md +46 -46
  467. package/docs/components/ui/aspect-ratio.md +25 -25
  468. package/docs/components/ui/autocomplete.md +48 -48
  469. package/docs/components/ui/avatar.md +56 -56
  470. package/docs/components/ui/badge.md +83 -82
  471. package/docs/components/ui/banner.md +42 -42
  472. package/docs/components/ui/breadcrumb.md +37 -37
  473. package/docs/components/ui/button-group.md +41 -41
  474. package/docs/components/ui/button.md +94 -93
  475. package/docs/components/ui/card.md +52 -52
  476. package/docs/components/ui/charts.md +43 -43
  477. package/docs/components/ui/checkbox.md +36 -36
  478. package/docs/components/ui/chip.md +47 -47
  479. package/docs/components/ui/code.md +28 -28
  480. package/docs/components/ui/collapsible.md +40 -40
  481. package/docs/components/ui/color-input.md +91 -91
  482. package/docs/components/ui/color-swatch.md +25 -25
  483. package/docs/components/ui/combobox.md +54 -54
  484. package/docs/components/ui/container.md +26 -26
  485. package/docs/components/ui/context-menu.md +43 -43
  486. package/docs/components/ui/data-table-body.md +1 -1
  487. package/docs/components/ui/data-table-bulk-actions.md +1 -1
  488. package/docs/components/ui/data-table-card.md +1 -1
  489. package/docs/components/ui/data-table-context.md +1 -1
  490. package/docs/components/ui/data-table-header.md +1 -1
  491. package/docs/components/ui/data-table-pagination.md +1 -1
  492. package/docs/components/ui/data-table-toolbar.md +44 -44
  493. package/docs/components/ui/data-table.md +94 -94
  494. package/docs/components/ui/dialog.md +54 -54
  495. package/docs/components/ui/dropdown-menu.md +48 -48
  496. package/docs/components/ui/file-upload.md +41 -41
  497. package/docs/components/ui/form.md +51 -51
  498. package/docs/components/ui/hover-card.md +32 -32
  499. package/docs/components/ui/icon-button.md +40 -40
  500. package/docs/components/ui/input-otp.md +44 -44
  501. package/docs/components/ui/input.md +74 -74
  502. package/docs/components/ui/label.md +25 -25
  503. package/docs/components/ui/link.md +29 -29
  504. package/docs/components/ui/menubar.md +44 -44
  505. package/docs/components/ui/navigation-menu.md +46 -46
  506. package/docs/components/ui/number-input.md +44 -44
  507. package/docs/components/ui/pagination.md +48 -48
  508. package/docs/components/ui/popover.md +30 -30
  509. package/docs/components/ui/progress-ring.md +41 -41
  510. package/docs/components/ui/progress.md +34 -34
  511. package/docs/components/ui/radio.md +34 -34
  512. package/docs/components/ui/search-input.md +43 -43
  513. package/docs/components/ui/segmented-control.md +50 -50
  514. package/docs/components/ui/select.md +53 -53
  515. package/docs/components/ui/separator.md +32 -32
  516. package/docs/components/ui/sheet.md +47 -47
  517. package/docs/components/ui/sidebar.md +72 -72
  518. package/docs/components/ui/skeleton.md +77 -77
  519. package/docs/components/ui/slider.md +29 -29
  520. package/docs/components/ui/spinner.md +54 -54
  521. package/docs/components/ui/stack.md +39 -39
  522. package/docs/components/ui/stat-card.md +61 -61
  523. package/docs/components/ui/status-dot.md +26 -26
  524. package/docs/components/ui/stepper.md +49 -49
  525. package/docs/components/ui/switch.md +47 -47
  526. package/docs/components/ui/table.md +47 -47
  527. package/docs/components/ui/tabs.md +60 -60
  528. package/docs/components/ui/text.md +37 -37
  529. package/docs/components/ui/textarea.md +39 -39
  530. package/docs/components/ui/toast.md +65 -65
  531. package/docs/components/ui/toaster.md +47 -47
  532. package/docs/components/ui/toggle-group.md +43 -43
  533. package/docs/components/ui/toggle.md +37 -37
  534. package/docs/components/ui/tooltip.md +38 -38
  535. package/docs/components/ui/tree-view.md +65 -65
  536. package/docs/components/ui/visually-hidden.md +21 -21
  537. package/llms-full.txt +5266 -5264
  538. package/llms.txt +624 -580
  539. package/package.json +7 -8
  540. package/dist/_chunks/date-time-picker.js +0 -851
  541. package/dist/_chunks/typing-indicator.js +0 -565
@@ -1,745 +1,616 @@
1
1
  "use client";
2
- import a from "react";
3
- import Ut from "react-dom";
4
- function Xt(r) {
5
- if (typeof document > "u") return;
6
- let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
7
- e.type = "text/css", o.appendChild(e), e.styleSheet ? e.styleSheet.cssText = r : e.appendChild(document.createTextNode(r));
2
+ import e from "react";
3
+ import t from "react-dom";
4
+ //#region ../../node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs
5
+ function n(e) {
6
+ if (!e || typeof document > "u") return;
7
+ let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
8
+ n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
8
9
  }
9
- const Wt = (r) => {
10
- switch (r) {
11
- case "success":
12
- return Gt;
13
- case "info":
14
- return Jt;
15
- case "warning":
16
- return Qt;
17
- case "error":
18
- return Zt;
19
- default:
20
- return null;
21
- }
22
- }, Kt = Array(12).fill(0), qt = ({ visible: r, className: o }) => /* @__PURE__ */ a.createElement("div", {
23
- className: [
24
- "sonner-loading-wrapper",
25
- o
26
- ].filter(Boolean).join(" "),
27
- "data-visible": r
28
- }, /* @__PURE__ */ a.createElement("div", {
29
- className: "sonner-spinner"
30
- }, Kt.map((e, s) => /* @__PURE__ */ a.createElement("div", {
31
- className: "sonner-loading-bar",
32
- key: `spinner-bar-${s}`
33
- })))), Gt = /* @__PURE__ */ a.createElement("svg", {
34
- xmlns: "http://www.w3.org/2000/svg",
35
- viewBox: "0 0 20 20",
36
- fill: "currentColor",
37
- height: "20",
38
- width: "20"
39
- }, /* @__PURE__ */ a.createElement("path", {
40
- fillRule: "evenodd",
41
- 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",
42
- clipRule: "evenodd"
43
- })), Qt = /* @__PURE__ */ a.createElement("svg", {
44
- xmlns: "http://www.w3.org/2000/svg",
45
- viewBox: "0 0 24 24",
46
- fill: "currentColor",
47
- height: "20",
48
- width: "20"
49
- }, /* @__PURE__ */ a.createElement("path", {
50
- fillRule: "evenodd",
51
- 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",
52
- clipRule: "evenodd"
53
- })), Jt = /* @__PURE__ */ a.createElement("svg", {
54
- xmlns: "http://www.w3.org/2000/svg",
55
- viewBox: "0 0 20 20",
56
- fill: "currentColor",
57
- height: "20",
58
- width: "20"
59
- }, /* @__PURE__ */ a.createElement("path", {
60
- fillRule: "evenodd",
61
- 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",
62
- clipRule: "evenodd"
63
- })), Zt = /* @__PURE__ */ a.createElement("svg", {
64
- xmlns: "http://www.w3.org/2000/svg",
65
- viewBox: "0 0 20 20",
66
- fill: "currentColor",
67
- height: "20",
68
- width: "20"
69
- }, /* @__PURE__ */ a.createElement("path", {
70
- fillRule: "evenodd",
71
- 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",
72
- clipRule: "evenodd"
73
- })), te = /* @__PURE__ */ a.createElement("svg", {
74
- xmlns: "http://www.w3.org/2000/svg",
75
- width: "12",
76
- height: "12",
77
- viewBox: "0 0 24 24",
78
- fill: "none",
79
- stroke: "currentColor",
80
- strokeWidth: "1.5",
81
- strokeLinecap: "round",
82
- strokeLinejoin: "round"
83
- }, /* @__PURE__ */ a.createElement("line", {
84
- x1: "18",
85
- y1: "6",
86
- x2: "6",
87
- y2: "18"
88
- }), /* @__PURE__ */ a.createElement("line", {
89
- x1: "6",
90
- y1: "6",
91
- x2: "18",
92
- y2: "18"
93
- })), ee = () => {
94
- const [r, o] = a.useState(typeof document !== "undefined" ? document.hidden : false);
95
- return a.useEffect(() => {
96
- const e = () => {
97
- o(document.hidden);
98
- };
99
- return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
100
- }, []), r;
101
- };
102
- let xt = 1;
103
- class ae {
104
- constructor() {
105
- this.subscribe = (o) => (this.subscribers.push(o), () => {
106
- const e = this.subscribers.indexOf(o);
107
- this.subscribers.splice(e, 1);
108
- }), this.publish = (o) => {
109
- this.subscribers.forEach((e) => e(o));
110
- }, this.addToast = (o) => {
111
- this.publish(o), this.toasts = [
112
- ...this.toasts,
113
- o
114
- ];
115
- }, this.create = (o) => {
116
- var e;
117
- const { message: s, ...C } = o, u = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : xt++, g = this.toasts.find((b) => b.id === u), _ = o.dismissible === void 0 ? !0 : o.dismissible;
118
- return this.dismissedToasts.has(u) && this.dismissedToasts.delete(u), g ? this.toasts = this.toasts.map((b) => b.id === u ? (this.publish({
119
- ...b,
120
- ...o,
121
- id: u,
122
- title: s
123
- }), {
124
- ...b,
125
- ...o,
126
- id: u,
127
- dismissible: _,
128
- title: s
129
- }) : b) : this.addToast({
130
- title: s,
131
- ...C,
132
- dismissible: _,
133
- id: u
134
- }), u;
135
- }, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
136
- id: o,
137
- dismiss: !0
138
- })))) : this.toasts.forEach((e) => {
139
- this.subscribers.forEach((s) => s({
140
- id: e.id,
141
- dismiss: !0
142
- }));
143
- }), o), this.message = (o, e) => this.create({
144
- ...e,
145
- message: o
146
- }), this.error = (o, e) => this.create({
147
- ...e,
148
- message: o,
149
- type: "error"
150
- }), this.success = (o, e) => this.create({
151
- ...e,
152
- type: "success",
153
- message: o
154
- }), this.info = (o, e) => this.create({
155
- ...e,
156
- type: "info",
157
- message: o
158
- }), this.warning = (o, e) => this.create({
159
- ...e,
160
- type: "warning",
161
- message: o
162
- }), this.loading = (o, e) => this.create({
163
- ...e,
164
- type: "loading",
165
- message: o
166
- }), this.promise = (o, e) => {
167
- if (!e)
168
- return;
169
- let s;
170
- e.loading !== void 0 && (s = this.create({
171
- ...e,
172
- promise: o,
173
- type: "loading",
174
- message: e.loading,
175
- description: typeof e.description != "function" ? e.description : void 0
176
- }));
177
- const C = Promise.resolve(o instanceof Function ? o() : o);
178
- let u = s !== void 0, g;
179
- const _ = C.then(async (i) => {
180
- if (g = [
181
- "resolve",
182
- i
183
- ], a.isValidElement(i))
184
- u = !1, this.create({
185
- id: s,
186
- type: "default",
187
- message: i
188
- });
189
- else if (se(i) && !i.ok) {
190
- u = !1;
191
- const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error, x = typeof e.description == "function" ? await e.description(`HTTP error! status: ${i.status}`) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
192
- message: t
193
- };
194
- this.create({
195
- id: s,
196
- type: "error",
197
- description: x,
198
- ...E
199
- });
200
- } else if (i instanceof Error) {
201
- u = !1;
202
- const t = typeof e.error == "function" ? await e.error(i) : e.error, x = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
203
- message: t
204
- };
205
- this.create({
206
- id: s,
207
- type: "error",
208
- description: x,
209
- ...E
210
- });
211
- } else if (e.success !== void 0) {
212
- u = !1;
213
- const t = typeof e.success == "function" ? await e.success(i) : e.success, x = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
214
- message: t
215
- };
216
- this.create({
217
- id: s,
218
- type: "success",
219
- description: x,
220
- ...E
221
- });
222
- }
223
- }).catch(async (i) => {
224
- if (g = [
225
- "reject",
226
- i
227
- ], e.error !== void 0) {
228
- u = !1;
229
- const T = typeof e.error == "function" ? await e.error(i) : e.error, t = typeof e.description == "function" ? await e.description(i) : e.description, O = typeof T == "object" && !a.isValidElement(T) ? T : {
230
- message: T
231
- };
232
- this.create({
233
- id: s,
234
- type: "error",
235
- description: t,
236
- ...O
237
- });
238
- }
239
- }).finally(() => {
240
- u && (this.dismiss(s), s = void 0), e.finally == null || e.finally.call(e);
241
- }), b = () => new Promise((i, T) => _.then(() => g[0] === "reject" ? T(g[1]) : i(g[1])).catch(T));
242
- return typeof s != "string" && typeof s != "number" ? {
243
- unwrap: b
244
- } : Object.assign(s, {
245
- unwrap: b
246
- });
247
- }, this.custom = (o, e) => {
248
- const s = e?.id || xt++;
249
- return this.create({
250
- jsx: o(s),
251
- id: s,
252
- ...e
253
- }), s;
254
- }, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
255
- }
256
- }
257
- const S = new ae(), oe = (r, o) => {
258
- const e = o?.id || xt++;
259
- return S.addToast({
260
- title: r,
261
- ...o,
262
- id: e
263
- }), e;
264
- }, se = (r) => r && typeof r == "object" && "ok" in r && typeof r.ok == "boolean" && "status" in r && typeof r.status == "number", ne = oe, re = () => S.toasts, ie = () => S.getActiveToasts(), xe = Object.assign(ne, {
265
- success: S.success,
266
- info: S.info,
267
- warning: S.warning,
268
- error: S.error,
269
- custom: S.custom,
270
- message: S.message,
271
- promise: S.promise,
272
- dismiss: S.dismiss,
273
- loading: S.loading
10
+ var r = (e) => {
11
+ switch (e) {
12
+ case "success": return o;
13
+ case "info": return c;
14
+ case "warning": return s;
15
+ case "error": return l;
16
+ default: return null;
17
+ }
18
+ }, i = Array(12).fill(0), a = ({ visible: t, className: n }) => /* @__PURE__ */ e.createElement("div", {
19
+ className: ["sonner-loading-wrapper", n].filter(Boolean).join(" "),
20
+ "data-visible": t
21
+ }, /* @__PURE__ */ e.createElement("div", { className: "sonner-spinner" }, i.map((t, n) => /* @__PURE__ */ e.createElement("div", {
22
+ className: "sonner-loading-bar",
23
+ key: `spinner-bar-${n}`
24
+ })))), o = /* @__PURE__ */ e.createElement("svg", {
25
+ xmlns: "http://www.w3.org/2000/svg",
26
+ viewBox: "0 0 20 20",
27
+ fill: "currentColor",
28
+ height: "20",
29
+ width: "20"
30
+ }, /* @__PURE__ */ e.createElement("path", {
31
+ fillRule: "evenodd",
32
+ 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",
33
+ clipRule: "evenodd"
34
+ })), s = /* @__PURE__ */ e.createElement("svg", {
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ viewBox: "0 0 24 24",
37
+ fill: "currentColor",
38
+ height: "20",
39
+ width: "20"
40
+ }, /* @__PURE__ */ e.createElement("path", {
41
+ fillRule: "evenodd",
42
+ 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",
43
+ clipRule: "evenodd"
44
+ })), c = /* @__PURE__ */ e.createElement("svg", {
45
+ xmlns: "http://www.w3.org/2000/svg",
46
+ viewBox: "0 0 20 20",
47
+ fill: "currentColor",
48
+ height: "20",
49
+ width: "20"
50
+ }, /* @__PURE__ */ e.createElement("path", {
51
+ fillRule: "evenodd",
52
+ 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",
53
+ clipRule: "evenodd"
54
+ })), l = /* @__PURE__ */ e.createElement("svg", {
55
+ xmlns: "http://www.w3.org/2000/svg",
56
+ viewBox: "0 0 20 20",
57
+ fill: "currentColor",
58
+ height: "20",
59
+ width: "20"
60
+ }, /* @__PURE__ */ e.createElement("path", {
61
+ fillRule: "evenodd",
62
+ 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",
63
+ clipRule: "evenodd"
64
+ })), u = /* @__PURE__ */ e.createElement("svg", {
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ width: "12",
67
+ height: "12",
68
+ viewBox: "0 0 24 24",
69
+ fill: "none",
70
+ stroke: "currentColor",
71
+ strokeWidth: "1.5",
72
+ strokeLinecap: "round",
73
+ strokeLinejoin: "round"
74
+ }, /* @__PURE__ */ e.createElement("line", {
75
+ x1: "18",
76
+ y1: "6",
77
+ x2: "6",
78
+ y2: "18"
79
+ }), /* @__PURE__ */ e.createElement("line", {
80
+ x1: "6",
81
+ y1: "6",
82
+ x2: "18",
83
+ y2: "18"
84
+ })), d = () => {
85
+ let [t, n] = e.useState(typeof document !== "undefined" ? document.hidden : false);
86
+ return e.useEffect(() => {
87
+ let e = () => {
88
+ n(document.hidden);
89
+ };
90
+ return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
91
+ }, []), t;
92
+ }, f = 1, p = new class {
93
+ constructor() {
94
+ this.subscribe = (e) => (this.subscribers.push(e), () => {
95
+ let t = this.subscribers.indexOf(e);
96
+ this.subscribers.splice(t, 1);
97
+ }), this.publish = (e) => {
98
+ this.subscribers.forEach((t) => t(e));
99
+ }, this.addToast = (e) => {
100
+ this.publish(e), this.toasts = [...this.toasts, e];
101
+ }, this.create = (e) => {
102
+ let { message: t, ...n } = e, r = typeof e?.id == "number" || e.id?.length > 0 ? e.id : f++, i = this.toasts.find((e) => e.id === r), a = e.dismissible === void 0 ? !0 : e.dismissible;
103
+ return this.dismissedToasts.has(r) && this.dismissedToasts.delete(r), i ? this.toasts = this.toasts.map((n) => n.id === r ? (this.publish({
104
+ ...n,
105
+ ...e,
106
+ id: r,
107
+ title: t
108
+ }), {
109
+ ...n,
110
+ ...e,
111
+ id: r,
112
+ dismissible: a,
113
+ title: t
114
+ }) : n) : this.addToast({
115
+ title: t,
116
+ ...n,
117
+ dismissible: a,
118
+ id: r
119
+ }), r;
120
+ }, this.dismiss = (e) => (e ? (this.dismissedToasts.add(e), requestAnimationFrame(() => this.subscribers.forEach((t) => t({
121
+ id: e,
122
+ dismiss: !0
123
+ })))) : this.toasts.forEach((e) => {
124
+ this.subscribers.forEach((t) => t({
125
+ id: e.id,
126
+ dismiss: !0
127
+ }));
128
+ }), e), this.message = (e, t) => this.create({
129
+ ...t,
130
+ message: e
131
+ }), this.error = (e, t) => this.create({
132
+ ...t,
133
+ message: e,
134
+ type: "error"
135
+ }), this.success = (e, t) => this.create({
136
+ ...t,
137
+ type: "success",
138
+ message: e
139
+ }), this.info = (e, t) => this.create({
140
+ ...t,
141
+ type: "info",
142
+ message: e
143
+ }), this.warning = (e, t) => this.create({
144
+ ...t,
145
+ type: "warning",
146
+ message: e
147
+ }), this.loading = (e, t) => this.create({
148
+ ...t,
149
+ type: "loading",
150
+ message: e
151
+ }), this.promise = (t, n) => {
152
+ if (!n) return;
153
+ let r;
154
+ n.loading !== void 0 && (r = this.create({
155
+ ...n,
156
+ promise: t,
157
+ type: "loading",
158
+ message: n.loading,
159
+ description: typeof n.description == "function" ? void 0 : n.description
160
+ }));
161
+ let i = Promise.resolve(t instanceof Function ? t() : t), a = r !== void 0, o, s = i.then(async (t) => {
162
+ if (o = ["resolve", t], e.isValidElement(t)) a = !1, this.create({
163
+ id: r,
164
+ type: "default",
165
+ message: t
166
+ });
167
+ else if (h(t) && !t.ok) {
168
+ a = !1;
169
+ let i = typeof n.error == "function" ? await n.error(`HTTP error! status: ${t.status}`) : n.error, o = typeof n.description == "function" ? await n.description(`HTTP error! status: ${t.status}`) : n.description, s = typeof i == "object" && !e.isValidElement(i) ? i : { message: i };
170
+ this.create({
171
+ id: r,
172
+ type: "error",
173
+ description: o,
174
+ ...s
175
+ });
176
+ } else if (t instanceof Error) {
177
+ a = !1;
178
+ let i = typeof n.error == "function" ? await n.error(t) : n.error, o = typeof n.description == "function" ? await n.description(t) : n.description, s = typeof i == "object" && !e.isValidElement(i) ? i : { message: i };
179
+ this.create({
180
+ id: r,
181
+ type: "error",
182
+ description: o,
183
+ ...s
184
+ });
185
+ } else if (n.success !== void 0) {
186
+ a = !1;
187
+ let i = typeof n.success == "function" ? await n.success(t) : n.success, o = typeof n.description == "function" ? await n.description(t) : n.description, s = typeof i == "object" && !e.isValidElement(i) ? i : { message: i };
188
+ this.create({
189
+ id: r,
190
+ type: "success",
191
+ description: o,
192
+ ...s
193
+ });
194
+ }
195
+ }).catch(async (t) => {
196
+ if (o = ["reject", t], n.error !== void 0) {
197
+ a = !1;
198
+ let i = typeof n.error == "function" ? await n.error(t) : n.error, o = typeof n.description == "function" ? await n.description(t) : n.description, s = typeof i == "object" && !e.isValidElement(i) ? i : { message: i };
199
+ this.create({
200
+ id: r,
201
+ type: "error",
202
+ description: o,
203
+ ...s
204
+ });
205
+ }
206
+ }).finally(() => {
207
+ a && (this.dismiss(r), r = void 0), n.finally == null || n.finally.call(n);
208
+ }), c = () => new Promise((e, t) => s.then(() => o[0] === "reject" ? t(o[1]) : e(o[1])).catch(t));
209
+ return typeof r != "string" && typeof r != "number" ? { unwrap: c } : Object.assign(r, { unwrap: c });
210
+ }, this.custom = (e, t) => {
211
+ let n = t?.id || f++;
212
+ return this.create({
213
+ jsx: e(n),
214
+ id: n,
215
+ ...t
216
+ }), n;
217
+ }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
218
+ }
219
+ }(), m = (e, t) => {
220
+ let n = t?.id || f++;
221
+ return p.addToast({
222
+ title: e,
223
+ ...t,
224
+ id: n
225
+ }), n;
226
+ }, h = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", g = Object.assign(m, {
227
+ success: p.success,
228
+ info: p.info,
229
+ warning: p.warning,
230
+ error: p.error,
231
+ custom: p.custom,
232
+ message: p.message,
233
+ promise: p.promise,
234
+ dismiss: p.dismiss,
235
+ loading: p.loading
274
236
  }, {
275
- getHistory: re,
276
- getToasts: ie
237
+ getHistory: () => p.toasts,
238
+ getToasts: () => p.getActiveToasts()
277
239
  });
278
- Xt("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
279
- function mt(r) {
280
- return r.label !== void 0;
240
+ n("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
241
+ function _(e) {
242
+ return e.label !== void 0;
281
243
  }
282
- const le = 3, de = "24px", ce = "16px", Mt = 4e3, ue = 356, fe = 14, me = 45, pe = 200;
283
- function H(...r) {
284
- return r.filter(Boolean).join(" ");
244
+ var v = 3, y = "24px", b = "16px", x = 4e3, ee = 356, te = 14, S = 45, ne = 200;
245
+ function C(...e) {
246
+ return e.filter(Boolean).join(" ");
285
247
  }
286
- function ge(r) {
287
- const [o, e] = r.split("-"), s = [];
288
- return o && s.push(o), e && s.push(e), s;
248
+ function w(e) {
249
+ let [t, n] = e.split("-"), r = [];
250
+ return t && r.push(t), n && r.push(n), r;
289
251
  }
290
- const he = (r) => {
291
- var o, e, s, C, u, g, _, b, i;
292
- const { invert: T, toast: t, unstyled: x, interacting: O, setHeights: E, visibleToasts: pt, heights: U, index: d, toasts: ot, expanded: X, removeToast: st, defaultRichColors: gt, closeButton: z, style: Z, cancelButtonStyle: Y, actionButtonStyle: ht, className: nt = "", descriptionClassName: bt = "", duration: tt, position: A, gap: rt, expandByDefault: et, classNames: c, icons: v, closeButtonAriaLabel: j = "Close toast" } = r, [$, B] = a.useState(null), [F, it] = a.useState(null), [l, p] = a.useState(!1), [m, D] = a.useState(!1), [W, f] = a.useState(!1), [K, lt] = a.useState(!1), [dt, q] = a.useState(!1), [Ct, vt] = a.useState(0), [At, Et] = a.useState(0), at = a.useRef(t.duration || tt || Mt), Tt = a.useRef(null), P = a.useRef(null), Ht = d === 0, Ot = d + 1 <= pt, N = t.type, G = t.dismissible !== !1, zt = t.className || "", Pt = t.descriptionClassName || "", ct = a.useMemo(() => U.findIndex((n) => n.toastId === t.id) || 0, [
293
- U,
294
- t.id
295
- ]), jt = a.useMemo(() => {
296
- var n;
297
- return (n = t.closeButton) != null ? n : z;
298
- }, [
299
- t.closeButton,
300
- z
301
- ]), St = a.useMemo(() => t.duration || tt || Mt, [
302
- t.duration,
303
- tt
304
- ]), yt = a.useRef(0), Q = a.useRef(0), Nt = a.useRef(0), J = a.useRef(null), [Lt, Yt] = A.split("-"), kt = a.useMemo(() => U.reduce((n, h, w) => w >= ct ? n : n + h.height, 0), [
305
- U,
306
- ct
307
- ]), _t = ee(), $t = t.invert || T, wt = N === "loading";
308
- Q.current = a.useMemo(() => ct * rt + kt, [
309
- ct,
310
- kt
311
- ]), a.useEffect(() => {
312
- at.current = St;
313
- }, [
314
- St
315
- ]), a.useEffect(() => {
316
- p(!0);
317
- }, []), a.useEffect(() => {
318
- const n = P.current;
319
- if (n) {
320
- const h = n.getBoundingClientRect().height;
321
- return Et(h), E((w) => [
322
- {
323
- toastId: t.id,
324
- height: h,
325
- position: t.position
326
- },
327
- ...w
328
- ]), () => E((w) => w.filter((k) => k.toastId !== t.id));
329
- }
330
- }, [
331
- E,
332
- t.id
333
- ]), a.useLayoutEffect(() => {
334
- if (!l) return;
335
- const n = P.current, h = n.style.height;
336
- n.style.height = "auto";
337
- const w = n.getBoundingClientRect().height;
338
- n.style.height = h, Et(w), E((k) => k.find((y) => y.toastId === t.id) ? k.map((y) => y.toastId === t.id ? {
339
- ...y,
340
- height: w
341
- } : y) : [
342
- {
343
- toastId: t.id,
344
- height: w,
345
- position: t.position
346
- },
347
- ...k
348
- ]);
349
- }, [
350
- l,
351
- t.title,
352
- t.description,
353
- E,
354
- t.id,
355
- t.jsx,
356
- t.action,
357
- t.cancel
358
- ]);
359
- const L = a.useCallback(() => {
360
- D(!0), vt(Q.current), E((n) => n.filter((h) => h.toastId !== t.id)), setTimeout(() => {
361
- st(t);
362
- }, pe);
363
- }, [
364
- t,
365
- st,
366
- E,
367
- Q
368
- ]);
369
- a.useEffect(() => {
370
- if (t.promise && N === "loading" || t.duration === 1 / 0 || t.type === "loading") return;
371
- let n;
372
- return X || O || _t ? (() => {
373
- if (Nt.current < yt.current) {
374
- const k = (/* @__PURE__ */ new Date()).getTime() - yt.current;
375
- at.current = at.current - k;
376
- }
377
- Nt.current = (/* @__PURE__ */ new Date()).getTime();
378
- })() : at.current !== 1 / 0 && (yt.current = (/* @__PURE__ */ new Date()).getTime(), n = setTimeout(() => {
379
- t.onAutoClose == null || t.onAutoClose.call(t, t), L();
380
- }, at.current)), () => clearTimeout(n);
381
- }, [
382
- X,
383
- O,
384
- t,
385
- N,
386
- _t,
387
- L
388
- ]), a.useEffect(() => {
389
- t.delete && (L(), t.onDismiss == null || t.onDismiss.call(t, t));
390
- }, [
391
- L,
392
- t.delete
393
- ]);
394
- function Ft() {
395
- var n;
396
- if (v?.loading) {
397
- var h;
398
- return /* @__PURE__ */ a.createElement("div", {
399
- className: H(c?.loader, t == null || (h = t.classNames) == null ? void 0 : h.loader, "sonner-loader"),
400
- "data-visible": N === "loading"
401
- }, v.loading);
402
- }
403
- return /* @__PURE__ */ a.createElement(qt, {
404
- className: H(c?.loader, t == null || (n = t.classNames) == null ? void 0 : n.loader),
405
- visible: N === "loading"
406
- });
407
- }
408
- const Vt = t.icon || v?.[N] || Wt(N);
409
- var Dt, Rt;
410
- return /* @__PURE__ */ a.createElement("li", {
411
- tabIndex: 0,
412
- ref: P,
413
- className: H(nt, zt, c?.toast, t == null || (o = t.classNames) == null ? void 0 : o.toast, c?.default, c?.[N], t == null || (e = t.classNames) == null ? void 0 : e[N]),
414
- "data-sonner-toast": "",
415
- "data-rich-colors": (Dt = t.richColors) != null ? Dt : gt,
416
- "data-styled": !(t.jsx || t.unstyled || x),
417
- "data-mounted": l,
418
- "data-promise": !!t.promise,
419
- "data-swiped": dt,
420
- "data-removed": m,
421
- "data-visible": Ot,
422
- "data-y-position": Lt,
423
- "data-x-position": Yt,
424
- "data-index": d,
425
- "data-front": Ht,
426
- "data-swiping": W,
427
- "data-dismissible": G,
428
- "data-type": N,
429
- "data-invert": $t,
430
- "data-swipe-out": K,
431
- "data-swipe-direction": F,
432
- "data-expanded": !!(X || et && l),
433
- "data-testid": t.testId,
434
- style: {
435
- "--index": d,
436
- "--toasts-before": d,
437
- "--z-index": ot.length - d,
438
- "--offset": `${m ? Ct : Q.current}px`,
439
- "--initial-height": et ? "auto" : `${At}px`,
440
- ...Z,
441
- ...t.style
442
- },
443
- onDragEnd: () => {
444
- f(!1), B(null), J.current = null;
445
- },
446
- onPointerDown: (n) => {
447
- n.button !== 2 && (wt || !G || (Tt.current = /* @__PURE__ */ new Date(), vt(Q.current), n.target.setPointerCapture(n.pointerId), n.target.tagName !== "BUTTON" && (f(!0), J.current = {
448
- x: n.clientX,
449
- y: n.clientY
450
- })));
451
- },
452
- onPointerUp: () => {
453
- var n, h, w;
454
- if (K || !G) return;
455
- J.current = null;
456
- const k = Number(((n = P.current) == null ? void 0 : n.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ut = Number(((h = P.current) == null ? void 0 : h.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), y = (/* @__PURE__ */ new Date()).getTime() - ((w = Tt.current) == null ? void 0 : w.getTime()), R = $ === "x" ? k : ut, ft = Math.abs(R) / y;
457
- if (Math.abs(R) >= me || ft > 0.11) {
458
- vt(Q.current), t.onDismiss == null || t.onDismiss.call(t, t), it($ === "x" ? k > 0 ? "right" : "left" : ut > 0 ? "down" : "up"), L(), lt(!0);
459
- return;
460
- } else {
461
- var M, I;
462
- (M = P.current) == null || M.style.setProperty("--swipe-amount-x", "0px"), (I = P.current) == null || I.style.setProperty("--swipe-amount-y", "0px");
463
- }
464
- q(!1), f(!1), B(null);
465
- },
466
- onPointerMove: (n) => {
467
- var h, w, k;
468
- if (!J.current || !G || ((h = window.getSelection()) == null ? void 0 : h.toString().length) > 0) return;
469
- const y = n.clientY - J.current.y, R = n.clientX - J.current.x;
470
- var ft;
471
- const M = (ft = r.swipeDirections) != null ? ft : ge(A);
472
- !$ && (Math.abs(R) > 1 || Math.abs(y) > 1) && B(Math.abs(R) > Math.abs(y) ? "x" : "y");
473
- let I = {
474
- x: 0,
475
- y: 0
476
- };
477
- const Bt = (V) => 1 / (1.5 + Math.abs(V) / 20);
478
- if ($ === "y") {
479
- if (M.includes("top") || M.includes("bottom"))
480
- if (M.includes("top") && y < 0 || M.includes("bottom") && y > 0)
481
- I.y = y;
482
- else {
483
- const V = y * Bt(y);
484
- I.y = Math.abs(V) < Math.abs(y) ? V : y;
485
- }
486
- } else if ($ === "x" && (M.includes("left") || M.includes("right")))
487
- if (M.includes("left") && R < 0 || M.includes("right") && R > 0)
488
- I.x = R;
489
- else {
490
- const V = R * Bt(R);
491
- I.x = Math.abs(V) < Math.abs(R) ? V : R;
492
- }
493
- (Math.abs(I.x) > 0 || Math.abs(I.y) > 0) && q(!0), (w = P.current) == null || w.style.setProperty("--swipe-amount-x", `${I.x}px`), (k = P.current) == null || k.style.setProperty("--swipe-amount-y", `${I.y}px`);
494
- }
495
- }, jt && !t.jsx && N !== "loading" ? /* @__PURE__ */ a.createElement("button", {
496
- "aria-label": j,
497
- "data-disabled": wt,
498
- "data-close-button": !0,
499
- onClick: wt || !G ? () => {
500
- } : () => {
501
- L(), t.onDismiss == null || t.onDismiss.call(t, t);
502
- },
503
- className: H(c?.closeButton, t == null || (s = t.classNames) == null ? void 0 : s.closeButton)
504
- }, (Rt = v?.close) != null ? Rt : te) : null, (N || t.icon || t.promise) && t.icon !== null && (v?.[N] !== null || t.icon) ? /* @__PURE__ */ a.createElement("div", {
505
- "data-icon": "",
506
- className: H(c?.icon, t == null || (C = t.classNames) == null ? void 0 : C.icon)
507
- }, t.promise || t.type === "loading" && !t.icon ? t.icon || Ft() : null, t.type !== "loading" ? Vt : null) : null, /* @__PURE__ */ a.createElement("div", {
508
- "data-content": "",
509
- className: H(c?.content, t == null || (u = t.classNames) == null ? void 0 : u.content)
510
- }, /* @__PURE__ */ a.createElement("div", {
511
- "data-title": "",
512
- className: H(c?.title, t == null || (g = t.classNames) == null ? void 0 : g.title)
513
- }, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ a.createElement("div", {
514
- "data-description": "",
515
- className: H(bt, Pt, c?.description, t == null || (_ = t.classNames) == null ? void 0 : _.description)
516
- }, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel && mt(t.cancel) ? /* @__PURE__ */ a.createElement("button", {
517
- "data-button": !0,
518
- "data-cancel": !0,
519
- style: t.cancelButtonStyle || Y,
520
- onClick: (n) => {
521
- mt(t.cancel) && G && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, n), L());
522
- },
523
- className: H(c?.cancelButton, t == null || (b = t.classNames) == null ? void 0 : b.cancelButton)
524
- }, t.cancel.label) : null, /* @__PURE__ */ a.isValidElement(t.action) ? t.action : t.action && mt(t.action) ? /* @__PURE__ */ a.createElement("button", {
525
- "data-button": !0,
526
- "data-action": !0,
527
- style: t.actionButtonStyle || ht,
528
- onClick: (n) => {
529
- mt(t.action) && (t.action.onClick == null || t.action.onClick.call(t.action, n), !n.defaultPrevented && L());
530
- },
531
- className: H(c?.actionButton, t == null || (i = t.classNames) == null ? void 0 : i.actionButton)
532
- }, t.action.label) : null);
252
+ var re = (t) => {
253
+ let { invert: n, toast: i, unstyled: o, interacting: s, setHeights: c, visibleToasts: l, heights: f, index: p, toasts: m, expanded: h, removeToast: g, defaultRichColors: v, closeButton: y, style: b, cancelButtonStyle: ee, actionButtonStyle: te, className: re = "", descriptionClassName: T = "", duration: E, position: D, gap: O, expandByDefault: k, classNames: A, icons: j, closeButtonAriaLabel: ie = "Close toast" } = t, [M, N] = e.useState(null), [P, ae] = e.useState(null), [F, I] = e.useState(!1), [L, R] = e.useState(!1), [z, B] = e.useState(!1), [oe, se] = e.useState(!1), [ce, le] = e.useState(!1), [ue, V] = e.useState(0), [de, H] = e.useState(0), U = e.useRef(i.duration || E || x), fe = e.useRef(null), W = e.useRef(null), pe = p === 0, me = p + 1 <= l, G = i.type, K = i.dismissible !== !1, he = i.className || "", ge = i.descriptionClassName || "", q = e.useMemo(() => f.findIndex((e) => e.toastId === i.id) || 0, [f, i.id]), _e = e.useMemo(() => i.closeButton ?? y, [i.closeButton, y]), ve = e.useMemo(() => i.duration || E || x, [i.duration, E]), J = e.useRef(0), Y = e.useRef(0), X = e.useRef(0), Z = e.useRef(null), [ye, be] = D.split("-"), xe = e.useMemo(() => f.reduce((e, t, n) => n >= q ? e : e + t.height, 0), [f, q]), Se = d(), Ce = i.invert || n, Q = G === "loading";
254
+ Y.current = e.useMemo(() => q * O + xe, [q, xe]), e.useEffect(() => {
255
+ U.current = ve;
256
+ }, [ve]), e.useEffect(() => {
257
+ I(!0);
258
+ }, []), e.useEffect(() => {
259
+ let e = W.current;
260
+ if (e) {
261
+ let t = e.getBoundingClientRect().height;
262
+ return H(t), c((e) => [{
263
+ toastId: i.id,
264
+ height: t,
265
+ position: i.position
266
+ }, ...e]), () => c((e) => e.filter((e) => e.toastId !== i.id));
267
+ }
268
+ }, [c, i.id]), e.useLayoutEffect(() => {
269
+ if (!F) return;
270
+ let e = W.current, t = e.style.height;
271
+ e.style.height = "auto";
272
+ let n = e.getBoundingClientRect().height;
273
+ e.style.height = t, H(n), c((e) => e.find((e) => e.toastId === i.id) ? e.map((e) => e.toastId === i.id ? {
274
+ ...e,
275
+ height: n
276
+ } : e) : [{
277
+ toastId: i.id,
278
+ height: n,
279
+ position: i.position
280
+ }, ...e]);
281
+ }, [
282
+ F,
283
+ i.title,
284
+ i.description,
285
+ c,
286
+ i.id,
287
+ i.jsx,
288
+ i.action,
289
+ i.cancel
290
+ ]);
291
+ let $ = e.useCallback(() => {
292
+ R(!0), V(Y.current), c((e) => e.filter((e) => e.toastId !== i.id)), setTimeout(() => {
293
+ g(i);
294
+ }, ne);
295
+ }, [
296
+ i,
297
+ g,
298
+ c,
299
+ Y
300
+ ]);
301
+ e.useEffect(() => {
302
+ if (i.promise && G === "loading" || i.duration === Infinity || i.type === "loading") return;
303
+ let e;
304
+ return h || s || Se ? (() => {
305
+ if (X.current < J.current) {
306
+ let e = (/* @__PURE__ */ new Date()).getTime() - J.current;
307
+ U.current -= e;
308
+ }
309
+ X.current = (/* @__PURE__ */ new Date()).getTime();
310
+ })() : U.current !== Infinity && (J.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
311
+ i.onAutoClose == null || i.onAutoClose.call(i, i), $();
312
+ }, U.current)), () => clearTimeout(e);
313
+ }, [
314
+ h,
315
+ s,
316
+ i,
317
+ G,
318
+ Se,
319
+ $
320
+ ]), e.useEffect(() => {
321
+ i.delete && ($(), i.onDismiss == null || i.onDismiss.call(i, i));
322
+ }, [$, i.delete]);
323
+ function we() {
324
+ return j?.loading ? /* @__PURE__ */ e.createElement("div", {
325
+ className: C(A?.loader, i?.classNames?.loader, "sonner-loader"),
326
+ "data-visible": G === "loading"
327
+ }, j.loading) : /* @__PURE__ */ e.createElement(a, {
328
+ className: C(A?.loader, i?.classNames?.loader),
329
+ visible: G === "loading"
330
+ });
331
+ }
332
+ let Te = i.icon || j?.[G] || r(G);
333
+ return /* @__PURE__ */ e.createElement("li", {
334
+ tabIndex: 0,
335
+ ref: W,
336
+ className: C(re, he, A?.toast, i?.classNames?.toast, A?.default, A?.[G], i?.classNames?.[G]),
337
+ "data-sonner-toast": "",
338
+ "data-rich-colors": i.richColors ?? v,
339
+ "data-styled": !(i.jsx || i.unstyled || o),
340
+ "data-mounted": F,
341
+ "data-promise": !!i.promise,
342
+ "data-swiped": ce,
343
+ "data-removed": L,
344
+ "data-visible": me,
345
+ "data-y-position": ye,
346
+ "data-x-position": be,
347
+ "data-index": p,
348
+ "data-front": pe,
349
+ "data-swiping": z,
350
+ "data-dismissible": K,
351
+ "data-type": G,
352
+ "data-invert": Ce,
353
+ "data-swipe-out": oe,
354
+ "data-swipe-direction": P,
355
+ "data-expanded": !!(h || k && F),
356
+ "data-testid": i.testId,
357
+ style: {
358
+ "--index": p,
359
+ "--toasts-before": p,
360
+ "--z-index": m.length - p,
361
+ "--offset": `${L ? ue : Y.current}px`,
362
+ "--initial-height": k ? "auto" : `${de}px`,
363
+ ...b,
364
+ ...i.style
365
+ },
366
+ onDragEnd: () => {
367
+ B(!1), N(null), Z.current = null;
368
+ },
369
+ onPointerDown: (e) => {
370
+ e.button !== 2 && (Q || !K || (fe.current = /* @__PURE__ */ new Date(), V(Y.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (B(!0), Z.current = {
371
+ x: e.clientX,
372
+ y: e.clientY
373
+ })));
374
+ },
375
+ onPointerUp: () => {
376
+ if (oe || !K) return;
377
+ Z.current = null;
378
+ let e = Number(W.current?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0), t = Number(W.current?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0), n = (/* @__PURE__ */ new Date()).getTime() - fe.current?.getTime(), r = M === "x" ? e : t, a = Math.abs(r) / n;
379
+ if (Math.abs(r) >= S || a > .11) {
380
+ V(Y.current), i.onDismiss == null || i.onDismiss.call(i, i), ae(M === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), $(), se(!0);
381
+ return;
382
+ } else {
383
+ var o, s;
384
+ (o = W.current) == null || o.style.setProperty("--swipe-amount-x", "0px"), (s = W.current) == null || s.style.setProperty("--swipe-amount-y", "0px");
385
+ }
386
+ le(!1), B(!1), N(null);
387
+ },
388
+ onPointerMove: (e) => {
389
+ var n, r;
390
+ if (!Z.current || !K || window.getSelection()?.toString().length > 0) return;
391
+ let i = e.clientY - Z.current.y, a = e.clientX - Z.current.x, o = t.swipeDirections ?? w(D);
392
+ !M && (Math.abs(a) > 1 || Math.abs(i) > 1) && N(Math.abs(a) > Math.abs(i) ? "x" : "y");
393
+ let s = {
394
+ x: 0,
395
+ y: 0
396
+ }, c = (e) => 1 / (1.5 + Math.abs(e) / 20);
397
+ if (M === "y") {
398
+ if (o.includes("top") || o.includes("bottom")) if (o.includes("top") && i < 0 || o.includes("bottom") && i > 0) s.y = i;
399
+ else {
400
+ let e = i * c(i);
401
+ s.y = Math.abs(e) < Math.abs(i) ? e : i;
402
+ }
403
+ } else if (M === "x" && (o.includes("left") || o.includes("right"))) if (o.includes("left") && a < 0 || o.includes("right") && a > 0) s.x = a;
404
+ else {
405
+ let e = a * c(a);
406
+ s.x = Math.abs(e) < Math.abs(a) ? e : a;
407
+ }
408
+ (Math.abs(s.x) > 0 || Math.abs(s.y) > 0) && le(!0), (n = W.current) == null || n.style.setProperty("--swipe-amount-x", `${s.x}px`), (r = W.current) == null || r.style.setProperty("--swipe-amount-y", `${s.y}px`);
409
+ }
410
+ }, _e && !i.jsx && G !== "loading" ? /* @__PURE__ */ e.createElement("button", {
411
+ "aria-label": ie,
412
+ "data-disabled": Q,
413
+ "data-close-button": !0,
414
+ onClick: Q || !K ? () => {} : () => {
415
+ $(), i.onDismiss == null || i.onDismiss.call(i, i);
416
+ },
417
+ className: C(A?.closeButton, i?.classNames?.closeButton)
418
+ }, j?.close ?? u) : null, (G || i.icon || i.promise) && i.icon !== null && (j?.[G] !== null || i.icon) ? /* @__PURE__ */ e.createElement("div", {
419
+ "data-icon": "",
420
+ className: C(A?.icon, i?.classNames?.icon)
421
+ }, i.promise || i.type === "loading" && !i.icon ? i.icon || we() : null, i.type === "loading" ? null : Te) : null, /* @__PURE__ */ e.createElement("div", {
422
+ "data-content": "",
423
+ className: C(A?.content, i?.classNames?.content)
424
+ }, /* @__PURE__ */ e.createElement("div", {
425
+ "data-title": "",
426
+ className: C(A?.title, i?.classNames?.title)
427
+ }, i.jsx ? i.jsx : typeof i.title == "function" ? i.title() : i.title), i.description ? /* @__PURE__ */ e.createElement("div", {
428
+ "data-description": "",
429
+ className: C(T, ge, A?.description, i?.classNames?.description)
430
+ }, typeof i.description == "function" ? i.description() : i.description) : null), /* @__PURE__ */ e.isValidElement(i.cancel) ? i.cancel : i.cancel && _(i.cancel) ? /* @__PURE__ */ e.createElement("button", {
431
+ "data-button": !0,
432
+ "data-cancel": !0,
433
+ style: i.cancelButtonStyle || ee,
434
+ onClick: (e) => {
435
+ _(i.cancel) && K && (i.cancel.onClick == null || i.cancel.onClick.call(i.cancel, e), $());
436
+ },
437
+ className: C(A?.cancelButton, i?.classNames?.cancelButton)
438
+ }, i.cancel.label) : null, /* @__PURE__ */ e.isValidElement(i.action) ? i.action : i.action && _(i.action) ? /* @__PURE__ */ e.createElement("button", {
439
+ "data-button": !0,
440
+ "data-action": !0,
441
+ style: i.actionButtonStyle || te,
442
+ onClick: (e) => {
443
+ _(i.action) && (i.action.onClick == null || i.action.onClick.call(i.action, e), !e.defaultPrevented && $());
444
+ },
445
+ className: C(A?.actionButton, i?.classNames?.actionButton)
446
+ }, i.action.label) : null);
533
447
  };
534
- function It() {
535
- if (typeof window > "u" || typeof document > "u") return "ltr";
536
- const r = document.documentElement.getAttribute("dir");
537
- return r === "auto" || !r ? window.getComputedStyle(document.documentElement).direction : r;
448
+ function T() {
449
+ if (typeof window > "u" || typeof document > "u") return "ltr";
450
+ let e = document.documentElement.getAttribute("dir");
451
+ return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
538
452
  }
539
- function be(r, o) {
540
- const e = {};
541
- return [
542
- r,
543
- o
544
- ].forEach((s, C) => {
545
- const u = C === 1, g = u ? "--mobile-offset" : "--offset", _ = u ? ce : de;
546
- function b(i) {
547
- [
548
- "top",
549
- "right",
550
- "bottom",
551
- "left"
552
- ].forEach((T) => {
553
- e[`${g}-${T}`] = typeof i == "number" ? `${i}px` : i;
554
- });
555
- }
556
- typeof s == "number" || typeof s == "string" ? b(s) : typeof s == "object" ? [
557
- "top",
558
- "right",
559
- "bottom",
560
- "left"
561
- ].forEach((i) => {
562
- s[i] === void 0 ? e[`${g}-${i}`] = _ : e[`${g}-${i}`] = typeof s[i] == "number" ? `${s[i]}px` : s[i];
563
- }) : b(_);
564
- }), e;
453
+ function E(e, t) {
454
+ let n = {};
455
+ return [e, t].forEach((e, t) => {
456
+ let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ? b : y;
457
+ function o(e) {
458
+ [
459
+ "top",
460
+ "right",
461
+ "bottom",
462
+ "left"
463
+ ].forEach((t) => {
464
+ n[`${i}-${t}`] = typeof e == "number" ? `${e}px` : e;
465
+ });
466
+ }
467
+ typeof e == "number" || typeof e == "string" ? o(e) : typeof e == "object" ? [
468
+ "top",
469
+ "right",
470
+ "bottom",
471
+ "left"
472
+ ].forEach((t) => {
473
+ e[t] === void 0 ? n[`${i}-${t}`] = a : n[`${i}-${t}`] = typeof e[t] == "number" ? `${e[t]}px` : e[t];
474
+ }) : o(a);
475
+ }), n;
565
476
  }
566
- const Ee = /* @__PURE__ */ a.forwardRef(function(o, e) {
567
- const { id: s, invert: C, position: u = "bottom-right", hotkey: g = [
568
- "altKey",
569
- "KeyT"
570
- ], expand: _, closeButton: b, className: i, offset: T, mobileOffset: t, theme: x = "light", richColors: O, duration: E, style: pt, visibleToasts: U = le, toastOptions: d, dir: ot = It(), gap: X = fe, icons: st, containerAriaLabel: gt = "Notifications" } = o, [z, Z] = a.useState([]), Y = a.useMemo(() => s ? z.filter((l) => l.toasterId === s) : z.filter((l) => !l.toasterId), [
571
- z,
572
- s
573
- ]), ht = a.useMemo(() => Array.from(new Set([
574
- u
575
- ].concat(Y.filter((l) => l.position).map((l) => l.position)))), [
576
- Y,
577
- u
578
- ]), [nt, bt] = a.useState([]), [tt, A] = a.useState(!1), [rt, et] = a.useState(!1), [c, v] = a.useState(x !== "system" ? x : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), j = a.useRef(null), $ = g.join("+").replace(/Key/g, "").replace(/Digit/g, ""), B = a.useRef(null), F = a.useRef(!1), it = a.useCallback((l) => {
579
- Z((p) => {
580
- var m;
581
- return (m = p.find((D) => D.id === l.id)) != null && m.delete || S.dismiss(l.id), p.filter(({ id: D }) => D !== l.id);
582
- });
583
- }, []);
584
- return a.useEffect(() => S.subscribe((l) => {
585
- if (l.dismiss) {
586
- requestAnimationFrame(() => {
587
- Z((p) => p.map((m) => m.id === l.id ? {
588
- ...m,
589
- delete: !0
590
- } : m));
591
- });
592
- return;
593
- }
594
- setTimeout(() => {
595
- Ut.flushSync(() => {
596
- Z((p) => {
597
- const m = p.findIndex((D) => D.id === l.id);
598
- return m !== -1 ? [
599
- ...p.slice(0, m),
600
- {
601
- ...p[m],
602
- ...l
603
- },
604
- ...p.slice(m + 1)
605
- ] : [
606
- l,
607
- ...p
608
- ];
609
- });
610
- });
611
- });
612
- }), [
613
- z
614
- ]), a.useEffect(() => {
615
- if (x !== "system") {
616
- v(x);
617
- return;
618
- }
619
- if (x === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? v("dark") : v("light")), typeof window > "u") return;
620
- const l = window.matchMedia("(prefers-color-scheme: dark)");
621
- try {
622
- l.addEventListener("change", ({ matches: p }) => {
623
- v(p ? "dark" : "light");
624
- });
625
- } catch {
626
- l.addListener(({ matches: m }) => {
627
- try {
628
- v(m ? "dark" : "light");
629
- } catch (D) {
630
- console.error(D);
631
- }
632
- });
633
- }
634
- }, [
635
- x
636
- ]), a.useEffect(() => {
637
- z.length <= 1 && A(!1);
638
- }, [
639
- z
640
- ]), a.useEffect(() => {
641
- const l = (p) => {
642
- var m;
643
- if (g.every((f) => p[f] || p.code === f)) {
644
- var W;
645
- A(!0), (W = j.current) == null || W.focus();
646
- }
647
- p.code === "Escape" && (document.activeElement === j.current || (m = j.current) != null && m.contains(document.activeElement)) && A(!1);
648
- };
649
- return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
650
- }, [
651
- g
652
- ]), a.useEffect(() => {
653
- if (j.current)
654
- return () => {
655
- B.current && (B.current.focus({
656
- preventScroll: !0
657
- }), B.current = null, F.current = !1);
658
- };
659
- }, [
660
- j.current
661
- ]), // Remove item from normal navigation flow, only available via hotkey
662
- /* @__PURE__ */ a.createElement("section", {
663
- ref: e,
664
- "aria-label": `${gt} ${$}`,
665
- tabIndex: -1,
666
- "aria-live": "polite",
667
- "aria-relevant": "additions text",
668
- "aria-atomic": "false",
669
- suppressHydrationWarning: !0
670
- }, ht.map((l, p) => {
671
- var m;
672
- const [D, W] = l.split("-");
673
- return Y.length ? /* @__PURE__ */ a.createElement("ol", {
674
- key: l,
675
- dir: ot === "auto" ? It() : ot,
676
- tabIndex: -1,
677
- ref: j,
678
- className: i,
679
- "data-sonner-toaster": !0,
680
- "data-sonner-theme": c,
681
- "data-y-position": D,
682
- "data-x-position": W,
683
- style: {
684
- "--front-toast-height": `${((m = nt[0]) == null ? void 0 : m.height) || 0}px`,
685
- "--width": `${ue}px`,
686
- "--gap": `${X}px`,
687
- ...pt,
688
- ...be(T, t)
689
- },
690
- onBlur: (f) => {
691
- F.current && !f.currentTarget.contains(f.relatedTarget) && (F.current = !1, B.current && (B.current.focus({
692
- preventScroll: !0
693
- }), B.current = null));
694
- },
695
- onFocus: (f) => {
696
- f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || F.current || (F.current = !0, B.current = f.relatedTarget);
697
- },
698
- onMouseEnter: () => A(!0),
699
- onMouseMove: () => A(!0),
700
- onMouseLeave: () => {
701
- rt || A(!1);
702
- },
703
- onDragEnd: () => A(!1),
704
- onPointerDown: (f) => {
705
- f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || et(!0);
706
- },
707
- onPointerUp: () => et(!1)
708
- }, Y.filter((f) => !f.position && p === 0 || f.position === l).map((f, K) => {
709
- var lt, dt;
710
- return /* @__PURE__ */ a.createElement(he, {
711
- key: f.id,
712
- icons: st,
713
- index: K,
714
- toast: f,
715
- defaultRichColors: O,
716
- duration: (lt = d?.duration) != null ? lt : E,
717
- className: d?.className,
718
- descriptionClassName: d?.descriptionClassName,
719
- invert: C,
720
- visibleToasts: U,
721
- closeButton: (dt = d?.closeButton) != null ? dt : b,
722
- interacting: rt,
723
- position: l,
724
- style: d?.style,
725
- unstyled: d?.unstyled,
726
- classNames: d?.classNames,
727
- cancelButtonStyle: d?.cancelButtonStyle,
728
- actionButtonStyle: d?.actionButtonStyle,
729
- closeButtonAriaLabel: d?.closeButtonAriaLabel,
730
- removeToast: it,
731
- toasts: Y.filter((q) => q.position == f.position),
732
- heights: nt.filter((q) => q.position == f.position),
733
- setHeights: bt,
734
- expandByDefault: _,
735
- gap: X,
736
- expanded: tt,
737
- swipeDirections: o.swipeDirections
738
- });
739
- })) : null;
740
- }));
477
+ var D = /* @__PURE__ */ e.forwardRef(function(n, r) {
478
+ let { id: i, invert: a, position: o = "bottom-right", hotkey: s = ["altKey", "KeyT"], expand: c, closeButton: l, className: u, offset: d, mobileOffset: f, theme: m = "light", richColors: h, duration: g, style: _, visibleToasts: y = v, toastOptions: b, dir: x = T(), gap: S = te, icons: ne, containerAriaLabel: C = "Notifications" } = n, [w, D] = e.useState([]), O = e.useMemo(() => i ? w.filter((e) => e.toasterId === i) : w.filter((e) => !e.toasterId), [w, i]), k = e.useMemo(() => Array.from(new Set([o].concat(O.filter((e) => e.position).map((e) => e.position)))), [O, o]), [A, j] = e.useState([]), [ie, M] = e.useState(!1), [N, P] = e.useState(!1), [ae, F] = e.useState(m === "system" ? typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : m), I = e.useRef(null), L = s.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = e.useRef(null), z = e.useRef(!1), B = e.useCallback((e) => {
479
+ D((t) => (t.find((t) => t.id === e.id)?.delete || p.dismiss(e.id), t.filter(({ id: t }) => t !== e.id)));
480
+ }, []);
481
+ return e.useEffect(() => p.subscribe((e) => {
482
+ if (e.dismiss) {
483
+ requestAnimationFrame(() => {
484
+ D((t) => t.map((t) => t.id === e.id ? {
485
+ ...t,
486
+ delete: !0
487
+ } : t));
488
+ });
489
+ return;
490
+ }
491
+ setTimeout(() => {
492
+ t.flushSync(() => {
493
+ D((t) => {
494
+ let n = t.findIndex((t) => t.id === e.id);
495
+ return n === -1 ? [e, ...t] : [
496
+ ...t.slice(0, n),
497
+ {
498
+ ...t[n],
499
+ ...e
500
+ },
501
+ ...t.slice(n + 1)
502
+ ];
503
+ });
504
+ });
505
+ });
506
+ }), [w]), e.useEffect(() => {
507
+ if (m !== "system") {
508
+ F(m);
509
+ return;
510
+ }
511
+ if (m === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? F("dark") : F("light")), typeof window > "u") return;
512
+ let e = window.matchMedia("(prefers-color-scheme: dark)");
513
+ try {
514
+ e.addEventListener("change", ({ matches: e }) => {
515
+ F(e ? "dark" : "light");
516
+ });
517
+ } catch {
518
+ e.addListener(({ matches: e }) => {
519
+ try {
520
+ F(e ? "dark" : "light");
521
+ } catch (e) {
522
+ console.error(e);
523
+ }
524
+ });
525
+ }
526
+ }, [m]), e.useEffect(() => {
527
+ w.length <= 1 && M(!1);
528
+ }, [w]), e.useEffect(() => {
529
+ let e = (e) => {
530
+ if (s.every((t) => e[t] || e.code === t)) {
531
+ var t;
532
+ M(!0), (t = I.current) == null || t.focus();
533
+ }
534
+ e.code === "Escape" && (document.activeElement === I.current || I.current?.contains(document.activeElement)) && M(!1);
535
+ };
536
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
537
+ }, [s]), e.useEffect(() => {
538
+ if (I.current) return () => {
539
+ R.current && (R.current.focus({ preventScroll: !0 }), R.current = null, z.current = !1);
540
+ };
541
+ }, [I.current]), /* @__PURE__ */ e.createElement("section", {
542
+ ref: r,
543
+ "aria-label": `${C} ${L}`,
544
+ tabIndex: -1,
545
+ "aria-live": "polite",
546
+ "aria-relevant": "additions text",
547
+ "aria-atomic": "false",
548
+ suppressHydrationWarning: !0
549
+ }, k.map((t, r) => {
550
+ let [i, o] = t.split("-");
551
+ return O.length ? /* @__PURE__ */ e.createElement("ol", {
552
+ key: t,
553
+ dir: x === "auto" ? T() : x,
554
+ tabIndex: -1,
555
+ ref: I,
556
+ className: u,
557
+ "data-sonner-toaster": !0,
558
+ "data-sonner-theme": ae,
559
+ "data-y-position": i,
560
+ "data-x-position": o,
561
+ style: {
562
+ "--front-toast-height": `${A[0]?.height || 0}px`,
563
+ "--width": `${ee}px`,
564
+ "--gap": `${S}px`,
565
+ ..._,
566
+ ...E(d, f)
567
+ },
568
+ onBlur: (e) => {
569
+ z.current && !e.currentTarget.contains(e.relatedTarget) && (z.current = !1, R.current &&= (R.current.focus({ preventScroll: !0 }), null));
570
+ },
571
+ onFocus: (e) => {
572
+ e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || z.current || (z.current = !0, R.current = e.relatedTarget);
573
+ },
574
+ onMouseEnter: () => M(!0),
575
+ onMouseMove: () => M(!0),
576
+ onMouseLeave: () => {
577
+ N || M(!1);
578
+ },
579
+ onDragEnd: () => M(!1),
580
+ onPointerDown: (e) => {
581
+ e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || P(!0);
582
+ },
583
+ onPointerUp: () => P(!1)
584
+ }, O.filter((e) => !e.position && r === 0 || e.position === t).map((r, i) => /* @__PURE__ */ e.createElement(re, {
585
+ key: r.id,
586
+ icons: ne,
587
+ index: i,
588
+ toast: r,
589
+ defaultRichColors: h,
590
+ duration: b?.duration ?? g,
591
+ className: b?.className,
592
+ descriptionClassName: b?.descriptionClassName,
593
+ invert: a,
594
+ visibleToasts: y,
595
+ closeButton: b?.closeButton ?? l,
596
+ interacting: N,
597
+ position: t,
598
+ style: b?.style,
599
+ unstyled: b?.unstyled,
600
+ classNames: b?.classNames,
601
+ cancelButtonStyle: b?.cancelButtonStyle,
602
+ actionButtonStyle: b?.actionButtonStyle,
603
+ closeButtonAriaLabel: b?.closeButtonAriaLabel,
604
+ removeToast: B,
605
+ toasts: O.filter((e) => e.position == r.position),
606
+ heights: A.filter((e) => e.position == r.position),
607
+ setHeights: j,
608
+ expandByDefault: c,
609
+ gap: S,
610
+ expanded: ie,
611
+ swipeDirections: n.swipeDirections
612
+ }))) : null;
613
+ }));
741
614
  });
742
- export {
743
- Ee as T,
744
- xe as t
745
- };
615
+ //#endregion
616
+ export { g as n, D as t };