@ember-joinery/primitives 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. package/CHANGELOG.md +472 -0
  2. package/LICENSE.md +9 -0
  3. package/NOTICE +532 -0
  4. package/README.md +11 -2
  5. package/addon-main.cjs +4 -0
  6. package/declarations/-private/combobox-list.d.ts +59 -0
  7. package/declarations/-private/combobox-list.d.ts.map +1 -0
  8. package/declarations/-private/command-score.d.ts +33 -0
  9. package/declarations/-private/command-score.d.ts.map +1 -0
  10. package/declarations/-private/delay-group.d.ts +47 -0
  11. package/declarations/-private/delay-group.d.ts.map +1 -0
  12. package/declarations/-private/dialog.d.ts +180 -0
  13. package/declarations/-private/dialog.d.ts.map +1 -0
  14. package/declarations/-private/form-control.d.ts +70 -0
  15. package/declarations/-private/form-control.d.ts.map +1 -0
  16. package/declarations/-private/form-data.d.ts +14 -0
  17. package/declarations/-private/form-data.d.ts.map +1 -0
  18. package/declarations/-private/hover-intent.d.ts +48 -0
  19. package/declarations/-private/hover-intent.d.ts.map +1 -0
  20. package/declarations/-private/image-loading.d.ts +77 -0
  21. package/declarations/-private/image-loading.d.ts.map +1 -0
  22. package/declarations/-private/indicator.d.ts +27 -0
  23. package/declarations/-private/indicator.d.ts.map +1 -0
  24. package/declarations/-private/instances.d.ts +11 -0
  25. package/declarations/-private/instances.d.ts.map +1 -0
  26. package/declarations/-private/layout-styles.d.ts +34 -0
  27. package/declarations/-private/layout-styles.d.ts.map +1 -0
  28. package/declarations/-private/menu.d.ts +616 -0
  29. package/declarations/-private/menu.d.ts.map +1 -0
  30. package/declarations/-private/observers.d.ts +35 -0
  31. package/declarations/-private/observers.d.ts.map +1 -0
  32. package/declarations/-private/popper.d.ts +149 -0
  33. package/declarations/-private/popper.d.ts.map +1 -0
  34. package/declarations/-private/presence-chart.d.ts +39 -0
  35. package/declarations/-private/presence-chart.d.ts.map +1 -0
  36. package/declarations/-private/promise-state.d.ts +41 -0
  37. package/declarations/-private/promise-state.d.ts.map +1 -0
  38. package/declarations/-private/scroll-end.d.ts +16 -0
  39. package/declarations/-private/scroll-end.d.ts.map +1 -0
  40. package/declarations/-private/scroll-visibility.d.ts +68 -0
  41. package/declarations/-private/scroll-visibility.d.ts.map +1 -0
  42. package/declarations/-private/toast.d.ts +119 -0
  43. package/declarations/-private/toast.d.ts.map +1 -0
  44. package/declarations/-private/typeahead-search.d.ts +29 -0
  45. package/declarations/-private/typeahead-search.d.ts.map +1 -0
  46. package/declarations/accordion.d.ts +284 -0
  47. package/declarations/accordion.d.ts.map +1 -0
  48. package/declarations/alert-dialog.d.ts +80 -0
  49. package/declarations/alert-dialog.d.ts.map +1 -0
  50. package/declarations/anchor/component.d.ts +63 -0
  51. package/declarations/anchor/component.d.ts.map +1 -0
  52. package/declarations/anchor/index.d.ts +7 -0
  53. package/declarations/anchor/index.d.ts.map +1 -0
  54. package/declarations/anchor/middleware.d.ts +46 -0
  55. package/declarations/anchor/middleware.d.ts.map +1 -0
  56. package/declarations/anchor/modifier.d.ts +34 -0
  57. package/declarations/anchor/modifier.d.ts.map +1 -0
  58. package/declarations/anchor/options.d.ts +112 -0
  59. package/declarations/anchor/options.d.ts.map +1 -0
  60. package/declarations/anchor/position.d.ts +36 -0
  61. package/declarations/anchor/position.d.ts.map +1 -0
  62. package/declarations/anchor.d.ts +2 -0
  63. package/declarations/as.d.ts +33 -0
  64. package/declarations/as.d.ts.map +1 -0
  65. package/declarations/aspect-ratio.d.ts +34 -0
  66. package/declarations/aspect-ratio.d.ts.map +1 -0
  67. package/declarations/avatar.d.ts +178 -0
  68. package/declarations/avatar.d.ts.map +1 -0
  69. package/declarations/body-class.d.ts +30 -0
  70. package/declarations/body-class.d.ts.map +1 -0
  71. package/declarations/breadcrumb.d.ts +64 -0
  72. package/declarations/breadcrumb.d.ts.map +1 -0
  73. package/declarations/calendar/dates.d.ts +142 -0
  74. package/declarations/calendar/dates.d.ts.map +1 -0
  75. package/declarations/calendar/index.d.ts +59 -0
  76. package/declarations/calendar/index.d.ts.map +1 -0
  77. package/declarations/calendar/state.d.ts +415 -0
  78. package/declarations/calendar/state.d.ts.map +1 -0
  79. package/declarations/calendar.d.ts +3 -0
  80. package/declarations/checkbox.d.ts +71 -0
  81. package/declarations/checkbox.d.ts.map +1 -0
  82. package/declarations/collapsible.d.ts +216 -0
  83. package/declarations/collapsible.d.ts.map +1 -0
  84. package/declarations/color-scheme.d.ts +115 -0
  85. package/declarations/color-scheme.d.ts.map +1 -0
  86. package/declarations/combobox.d.ts +569 -0
  87. package/declarations/combobox.d.ts.map +1 -0
  88. package/declarations/command.d.ts +410 -0
  89. package/declarations/command.d.ts.map +1 -0
  90. package/declarations/context-menu.d.ts +155 -0
  91. package/declarations/context-menu.d.ts.map +1 -0
  92. package/declarations/controllable-state.d.ts +85 -0
  93. package/declarations/controllable-state.d.ts.map +1 -0
  94. package/declarations/dialog.d.ts +80 -0
  95. package/declarations/dialog.d.ts.map +1 -0
  96. package/declarations/direction.d.ts +55 -0
  97. package/declarations/direction.d.ts.map +1 -0
  98. package/declarations/dismiss.d.ts +111 -0
  99. package/declarations/dismiss.d.ts.map +1 -0
  100. package/declarations/dom-context.d.ts +74 -0
  101. package/declarations/dom-context.d.ts.map +1 -0
  102. package/declarations/drawer/controller.d.ts +174 -0
  103. package/declarations/drawer/controller.d.ts.map +1 -0
  104. package/declarations/drawer/index.d.ts +105 -0
  105. package/declarations/drawer/index.d.ts.map +1 -0
  106. package/declarations/drawer/machine.d.ts +139 -0
  107. package/declarations/drawer/machine.d.ts.map +1 -0
  108. package/declarations/drawer/parts.d.ts +85 -0
  109. package/declarations/drawer/parts.d.ts.map +1 -0
  110. package/declarations/drawer.d.ts +2 -0
  111. package/declarations/dropdown-menu.d.ts +169 -0
  112. package/declarations/dropdown-menu.d.ts.map +1 -0
  113. package/declarations/external-link.d.ts +26 -0
  114. package/declarations/external-link.d.ts.map +1 -0
  115. package/declarations/file-drop.d.ts +119 -0
  116. package/declarations/file-drop.d.ts.map +1 -0
  117. package/declarations/focus-scope.d.ts +105 -0
  118. package/declarations/focus-scope.d.ts.map +1 -0
  119. package/declarations/focus.d.ts +114 -0
  120. package/declarations/focus.d.ts.map +1 -0
  121. package/declarations/head.d.ts +20 -0
  122. package/declarations/head.d.ts.map +1 -0
  123. package/declarations/heading.d.ts +59 -0
  124. package/declarations/heading.d.ts.map +1 -0
  125. package/declarations/hero.d.ts +32 -0
  126. package/declarations/hero.d.ts.map +1 -0
  127. package/declarations/hide-others.d.ts +35 -0
  128. package/declarations/hide-others.d.ts.map +1 -0
  129. package/declarations/hover-card.d.ts +148 -0
  130. package/declarations/hover-card.d.ts.map +1 -0
  131. package/declarations/i18n.d.ts +47 -0
  132. package/declarations/i18n.d.ts.map +1 -0
  133. package/declarations/id.d.ts +15 -0
  134. package/declarations/id.d.ts.map +1 -0
  135. package/declarations/iframe.d.ts +12 -0
  136. package/declarations/iframe.d.ts.map +1 -0
  137. package/declarations/incremental-each.d.ts +81 -0
  138. package/declarations/incremental-each.d.ts.map +1 -0
  139. package/declarations/index.d.ts +108 -0
  140. package/declarations/index.d.ts.map +1 -0
  141. package/declarations/input-otp.d.ts +201 -0
  142. package/declarations/input-otp.d.ts.map +1 -0
  143. package/declarations/keys.d.ts +50 -0
  144. package/declarations/keys.d.ts.map +1 -0
  145. package/declarations/label.d.ts +36 -0
  146. package/declarations/label.d.ts.map +1 -0
  147. package/declarations/layer.d.ts +56 -0
  148. package/declarations/layer.d.ts.map +1 -0
  149. package/declarations/link-helper.d.ts +73 -0
  150. package/declarations/link-helper.d.ts.map +1 -0
  151. package/declarations/link.d.ts +60 -0
  152. package/declarations/link.d.ts.map +1 -0
  153. package/declarations/load.d.ts +47 -0
  154. package/declarations/load.d.ts.map +1 -0
  155. package/declarations/menubar.d.ts +231 -0
  156. package/declarations/menubar.d.ts.map +1 -0
  157. package/declarations/message-scroller/components.d.ts +229 -0
  158. package/declarations/message-scroller/components.d.ts.map +1 -0
  159. package/declarations/message-scroller/geometry.d.ts +95 -0
  160. package/declarations/message-scroller/geometry.d.ts.map +1 -0
  161. package/declarations/message-scroller/index.d.ts +4 -0
  162. package/declarations/message-scroller/index.d.ts.map +1 -0
  163. package/declarations/message-scroller/state.d.ts +124 -0
  164. package/declarations/message-scroller/state.d.ts.map +1 -0
  165. package/declarations/message-scroller.d.ts +2 -0
  166. package/declarations/messages.d.ts +166 -0
  167. package/declarations/messages.d.ts.map +1 -0
  168. package/declarations/narrowing.d.ts +24 -0
  169. package/declarations/narrowing.d.ts.map +1 -0
  170. package/declarations/native-form.d.ts +56 -0
  171. package/declarations/native-form.d.ts.map +1 -0
  172. package/declarations/native-value.d.ts +47 -0
  173. package/declarations/native-value.d.ts.map +1 -0
  174. package/declarations/navigation-menu.d.ts +406 -0
  175. package/declarations/navigation-menu.d.ts.map +1 -0
  176. package/declarations/on-resize.d.ts +32 -0
  177. package/declarations/on-resize.d.ts.map +1 -0
  178. package/declarations/part.d.ts +99 -0
  179. package/declarations/part.d.ts.map +1 -0
  180. package/declarations/popover.d.ts +236 -0
  181. package/declarations/popover.d.ts.map +1 -0
  182. package/declarations/portal/index.d.ts +3 -0
  183. package/declarations/portal/index.d.ts.map +1 -0
  184. package/declarations/portal/portal.d.ts +46 -0
  185. package/declarations/portal/portal.d.ts.map +1 -0
  186. package/declarations/portal/targets.d.ts +40 -0
  187. package/declarations/portal/targets.d.ts.map +1 -0
  188. package/declarations/portal.d.ts +2 -0
  189. package/declarations/presence.d.ts +80 -0
  190. package/declarations/presence.d.ts.map +1 -0
  191. package/declarations/progress.d.ts +98 -0
  192. package/declarations/progress.d.ts.map +1 -0
  193. package/declarations/proper-links.d.ts +69 -0
  194. package/declarations/proper-links.d.ts.map +1 -0
  195. package/declarations/qp.d.ts +55 -0
  196. package/declarations/qp.d.ts.map +1 -0
  197. package/declarations/questionnaire/components.d.ts +348 -0
  198. package/declarations/questionnaire/components.d.ts.map +1 -0
  199. package/declarations/questionnaire/index.d.ts +4 -0
  200. package/declarations/questionnaire/index.d.ts.map +1 -0
  201. package/declarations/questionnaire/state.d.ts +400 -0
  202. package/declarations/questionnaire/state.d.ts.map +1 -0
  203. package/declarations/questionnaire/utils.d.ts +65 -0
  204. package/declarations/questionnaire/utils.d.ts.map +1 -0
  205. package/declarations/questionnaire.d.ts +2 -0
  206. package/declarations/radio-group.d.ts +115 -0
  207. package/declarations/radio-group.d.ts.map +1 -0
  208. package/declarations/rating.d.ts +214 -0
  209. package/declarations/rating.d.ts.map +1 -0
  210. package/declarations/resizable/components.d.ts +107 -0
  211. package/declarations/resizable/components.d.ts.map +1 -0
  212. package/declarations/resizable/index.d.ts +4 -0
  213. package/declarations/resizable/index.d.ts.map +1 -0
  214. package/declarations/resizable/layout.d.ts +93 -0
  215. package/declarations/resizable/layout.d.ts.map +1 -0
  216. package/declarations/resizable/state.d.ts +211 -0
  217. package/declarations/resizable/state.d.ts.map +1 -0
  218. package/declarations/resizable.d.ts +2 -0
  219. package/declarations/resize-observer.d.ts +40 -0
  220. package/declarations/resize-observer.d.ts.map +1 -0
  221. package/declarations/roving-focus.d.ts +204 -0
  222. package/declarations/roving-focus.d.ts.map +1 -0
  223. package/declarations/scroll-area/components.d.ts +125 -0
  224. package/declarations/scroll-area/components.d.ts.map +1 -0
  225. package/declarations/scroll-area/index.d.ts +3 -0
  226. package/declarations/scroll-area/index.d.ts.map +1 -0
  227. package/declarations/scroll-area/state.d.ts +147 -0
  228. package/declarations/scroll-area/state.d.ts.map +1 -0
  229. package/declarations/scroll-area.d.ts +2 -0
  230. package/declarations/scroll-lock.d.ts +69 -0
  231. package/declarations/scroll-lock.d.ts.map +1 -0
  232. package/declarations/scroller.d.ts +71 -0
  233. package/declarations/scroller.d.ts.map +1 -0
  234. package/declarations/select.d.ts +459 -0
  235. package/declarations/select.d.ts.map +1 -0
  236. package/declarations/separator.d.ts +71 -0
  237. package/declarations/separator.d.ts.map +1 -0
  238. package/declarations/service.d.ts +83 -0
  239. package/declarations/service.d.ts.map +1 -0
  240. package/declarations/shadowed.d.ts +63 -0
  241. package/declarations/shadowed.d.ts.map +1 -0
  242. package/declarations/slider.d.ts +283 -0
  243. package/declarations/slider.d.ts.map +1 -0
  244. package/declarations/sticky-footer.d.ts +43 -0
  245. package/declarations/sticky-footer.d.ts.map +1 -0
  246. package/declarations/store.d.ts +47 -0
  247. package/declarations/store.d.ts.map +1 -0
  248. package/declarations/switch.d.ts +76 -0
  249. package/declarations/switch.d.ts.map +1 -0
  250. package/declarations/tabs.d.ts +250 -0
  251. package/declarations/tabs.d.ts.map +1 -0
  252. package/declarations/toast/icons.d.ts +29 -0
  253. package/declarations/toast/icons.d.ts.map +1 -0
  254. package/declarations/toast/index.d.ts +4 -0
  255. package/declarations/toast/index.d.ts.map +1 -0
  256. package/declarations/toast/item.d.ts +162 -0
  257. package/declarations/toast/item.d.ts.map +1 -0
  258. package/declarations/toast/state.d.ts +276 -0
  259. package/declarations/toast/state.d.ts.map +1 -0
  260. package/declarations/toast/styles.d.ts +20 -0
  261. package/declarations/toast/styles.d.ts.map +1 -0
  262. package/declarations/toast/toaster.d.ts +173 -0
  263. package/declarations/toast/toaster.d.ts.map +1 -0
  264. package/declarations/toast.d.ts +2 -0
  265. package/declarations/toggle-group.d.ts +161 -0
  266. package/declarations/toggle-group.d.ts.map +1 -0
  267. package/declarations/toggle.d.ts +70 -0
  268. package/declarations/toggle.d.ts.map +1 -0
  269. package/declarations/tooltip.d.ts +227 -0
  270. package/declarations/tooltip.d.ts.map +1 -0
  271. package/declarations/typeahead.d.ts +97 -0
  272. package/declarations/typeahead.d.ts.map +1 -0
  273. package/declarations/viewport.d.ts +109 -0
  274. package/declarations/viewport.d.ts.map +1 -0
  275. package/declarations/visually-hidden.d.ts +42 -0
  276. package/declarations/visually-hidden.d.ts.map +1 -0
  277. package/declarations/zoetrope.d.ts +120 -0
  278. package/declarations/zoetrope.d.ts.map +1 -0
  279. package/dist/accordion.js +367 -0
  280. package/dist/accordion.js.map +1 -0
  281. package/dist/alert-dialog.js +122 -0
  282. package/dist/alert-dialog.js.map +1 -0
  283. package/dist/anchor.js +2 -0
  284. package/dist/anchor.js.map +1 -0
  285. package/dist/as.js +60 -0
  286. package/dist/as.js.map +1 -0
  287. package/dist/aspect-ratio.js +59 -0
  288. package/dist/aspect-ratio.js.map +1 -0
  289. package/dist/avatar.js +464 -0
  290. package/dist/avatar.js.map +1 -0
  291. package/dist/body-class.js +57 -0
  292. package/dist/body-class.js.map +1 -0
  293. package/dist/breadcrumb.js +59 -0
  294. package/dist/breadcrumb.js.map +1 -0
  295. package/dist/calendar.js +1494 -0
  296. package/dist/calendar.js.map +1 -0
  297. package/dist/checkbox.js +81 -0
  298. package/dist/checkbox.js.map +1 -0
  299. package/dist/collapsible.js +255 -0
  300. package/dist/collapsible.js.map +1 -0
  301. package/dist/color-scheme.js +306 -0
  302. package/dist/color-scheme.js.map +1 -0
  303. package/dist/combobox.js +1413 -0
  304. package/dist/combobox.js.map +1 -0
  305. package/dist/command.js +1054 -0
  306. package/dist/command.js.map +1 -0
  307. package/dist/component-DqLt83fo.js +886 -0
  308. package/dist/component-DqLt83fo.js.map +1 -0
  309. package/dist/components-CWfg0cFs.js +1745 -0
  310. package/dist/components-CWfg0cFs.js.map +1 -0
  311. package/dist/components-DBWszEI3.js +1285 -0
  312. package/dist/components-DBWszEI3.js.map +1 -0
  313. package/dist/components-DI8Azu05.js +1542 -0
  314. package/dist/components-DI8Azu05.js.map +1 -0
  315. package/dist/components-F0Ini448.js +875 -0
  316. package/dist/components-F0Ini448.js.map +1 -0
  317. package/dist/context-menu.js +207 -0
  318. package/dist/context-menu.js.map +1 -0
  319. package/dist/controllable-state.js +134 -0
  320. package/dist/controllable-state.js.map +1 -0
  321. package/dist/delay-group-B1K03gBL.js +75 -0
  322. package/dist/delay-group-B1K03gBL.js.map +1 -0
  323. package/dist/dialog-3gfz_8NA.js +349 -0
  324. package/dist/dialog-3gfz_8NA.js.map +1 -0
  325. package/dist/dialog.js +57 -0
  326. package/dist/dialog.js.map +1 -0
  327. package/dist/direction.js +75 -0
  328. package/dist/direction.js.map +1 -0
  329. package/dist/dismiss.js +329 -0
  330. package/dist/dismiss.js.map +1 -0
  331. package/dist/dom-context.js +104 -0
  332. package/dist/dom-context.js.map +1 -0
  333. package/dist/drawer.js +1456 -0
  334. package/dist/drawer.js.map +1 -0
  335. package/dist/dropdown-menu.js +201 -0
  336. package/dist/dropdown-menu.js.map +1 -0
  337. package/dist/external-link.js +21 -0
  338. package/dist/external-link.js.map +1 -0
  339. package/dist/file-drop.js +183 -0
  340. package/dist/file-drop.js.map +1 -0
  341. package/dist/focus-scope.js +292 -0
  342. package/dist/focus-scope.js.map +1 -0
  343. package/dist/focus.js +307 -0
  344. package/dist/focus.js.map +1 -0
  345. package/dist/form-control-Ca_KHSKK.js +177 -0
  346. package/dist/form-control-Ca_KHSKK.js.map +1 -0
  347. package/dist/head.js +25 -0
  348. package/dist/head.js.map +1 -0
  349. package/dist/heading.js +152 -0
  350. package/dist/heading.js.map +1 -0
  351. package/dist/hero.js +36 -0
  352. package/dist/hero.js.map +1 -0
  353. package/dist/hide-others.js +108 -0
  354. package/dist/hide-others.js.map +1 -0
  355. package/dist/hover-card.js +246 -0
  356. package/dist/hover-card.js.map +1 -0
  357. package/dist/hover-intent-Bxb83fgX.js +92 -0
  358. package/dist/hover-intent-Bxb83fgX.js.map +1 -0
  359. package/dist/i18n.js +72 -0
  360. package/dist/i18n.js.map +1 -0
  361. package/dist/id.js +24 -0
  362. package/dist/id.js.map +1 -0
  363. package/dist/iframe.js +19 -0
  364. package/dist/iframe.js.map +1 -0
  365. package/dist/incremental-each.js +181 -0
  366. package/dist/incremental-each.js.map +1 -0
  367. package/dist/index.js +87 -0
  368. package/dist/index.js.map +1 -0
  369. package/dist/indicator-sYuRuFJA.js +26 -0
  370. package/dist/indicator-sYuRuFJA.js.map +1 -0
  371. package/dist/input-otp.js +611 -0
  372. package/dist/input-otp.js.map +1 -0
  373. package/dist/keys.js +65 -0
  374. package/dist/keys.js.map +1 -0
  375. package/dist/label.js +41 -0
  376. package/dist/label.js.map +1 -0
  377. package/dist/layer.js +157 -0
  378. package/dist/layer.js.map +1 -0
  379. package/dist/layout-styles-DY86so8a.js +81 -0
  380. package/dist/layout-styles-DY86so8a.js.map +1 -0
  381. package/dist/link-helper.js +122 -0
  382. package/dist/link-helper.js.map +1 -0
  383. package/dist/link.js +39 -0
  384. package/dist/link.js.map +1 -0
  385. package/dist/load.js +54 -0
  386. package/dist/load.js.map +1 -0
  387. package/dist/menu-Da1LFCet.js +1109 -0
  388. package/dist/menu-Da1LFCet.js.map +1 -0
  389. package/dist/menubar.js +357 -0
  390. package/dist/menubar.js.map +1 -0
  391. package/dist/message-scroller.js +2 -0
  392. package/dist/message-scroller.js.map +1 -0
  393. package/dist/messages.js +168 -0
  394. package/dist/messages.js.map +1 -0
  395. package/dist/narrowing.js +29 -0
  396. package/dist/narrowing.js.map +1 -0
  397. package/dist/native-form.js +134 -0
  398. package/dist/native-form.js.map +1 -0
  399. package/dist/native-value.js +125 -0
  400. package/dist/native-value.js.map +1 -0
  401. package/dist/navigation-menu.js +872 -0
  402. package/dist/navigation-menu.js.map +1 -0
  403. package/dist/observers-aItWe029.js +113 -0
  404. package/dist/observers-aItWe029.js.map +1 -0
  405. package/dist/on-resize.js +47 -0
  406. package/dist/on-resize.js.map +1 -0
  407. package/dist/part.js +291 -0
  408. package/dist/part.js.map +1 -0
  409. package/dist/popover.js +419 -0
  410. package/dist/popover.js.map +1 -0
  411. package/dist/popper-BbTzV8dP.js +323 -0
  412. package/dist/popper-BbTzV8dP.js.map +1 -0
  413. package/dist/portal-U554WDI9.js +214 -0
  414. package/dist/portal-U554WDI9.js.map +1 -0
  415. package/dist/portal.js +2 -0
  416. package/dist/portal.js.map +1 -0
  417. package/dist/presence.js +243 -0
  418. package/dist/presence.js.map +1 -0
  419. package/dist/progress.js +106 -0
  420. package/dist/progress.js.map +1 -0
  421. package/dist/promise-state-BMi2zVoT.js +91 -0
  422. package/dist/promise-state-BMi2zVoT.js.map +1 -0
  423. package/dist/proper-links.js +136 -0
  424. package/dist/proper-links.js.map +1 -0
  425. package/dist/qp.js +77 -0
  426. package/dist/qp.js.map +1 -0
  427. package/dist/questionnaire.js +2 -0
  428. package/dist/questionnaire.js.map +1 -0
  429. package/dist/radio-group.js +149 -0
  430. package/dist/radio-group.js.map +1 -0
  431. package/dist/rating.js +261 -0
  432. package/dist/rating.js.map +1 -0
  433. package/dist/resizable.js +2 -0
  434. package/dist/resizable.js.map +1 -0
  435. package/dist/resize-observer.js +85 -0
  436. package/dist/resize-observer.js.map +1 -0
  437. package/dist/roving-focus.js +355 -0
  438. package/dist/roving-focus.js.map +1 -0
  439. package/dist/scroll-area.js +2 -0
  440. package/dist/scroll-area.js.map +1 -0
  441. package/dist/scroll-end-Cer8JSIB.js +87 -0
  442. package/dist/scroll-end-Cer8JSIB.js.map +1 -0
  443. package/dist/scroll-lock.js +267 -0
  444. package/dist/scroll-lock.js.map +1 -0
  445. package/dist/scroller.js +117 -0
  446. package/dist/scroller.js.map +1 -0
  447. package/dist/select.js +1223 -0
  448. package/dist/select.js.map +1 -0
  449. package/dist/separator.js +80 -0
  450. package/dist/separator.js.map +1 -0
  451. package/dist/service.js +160 -0
  452. package/dist/service.js.map +1 -0
  453. package/dist/shadowed.js +70 -0
  454. package/dist/shadowed.js.map +1 -0
  455. package/dist/slider.js +586 -0
  456. package/dist/slider.js.map +1 -0
  457. package/dist/sticky-footer.js +40 -0
  458. package/dist/sticky-footer.js.map +1 -0
  459. package/dist/store-BjiAd-KP.js +93 -0
  460. package/dist/store-BjiAd-KP.js.map +1 -0
  461. package/dist/store.js +4 -0
  462. package/dist/store.js.map +1 -0
  463. package/dist/switch.js +58 -0
  464. package/dist/switch.js.map +1 -0
  465. package/dist/tabs.js +458 -0
  466. package/dist/tabs.js.map +1 -0
  467. package/dist/toast.js +2 -0
  468. package/dist/toast.js.map +1 -0
  469. package/dist/toaster-DwprFZ1J.js +1518 -0
  470. package/dist/toaster-DwprFZ1J.js.map +1 -0
  471. package/dist/toggle-group.js +221 -0
  472. package/dist/toggle-group.js.map +1 -0
  473. package/dist/toggle.js +78 -0
  474. package/dist/toggle.js.map +1 -0
  475. package/dist/tooltip.js +422 -0
  476. package/dist/tooltip.js.map +1 -0
  477. package/dist/typeahead.js +233 -0
  478. package/dist/typeahead.js.map +1 -0
  479. package/dist/viewport.js +138 -0
  480. package/dist/viewport.js.map +1 -0
  481. package/dist/visually-hidden.js +49 -0
  482. package/dist/visually-hidden.js.map +1 -0
  483. package/dist/zoetrope.js +336 -0
  484. package/dist/zoetrope.js.map +1 -0
  485. package/package.json +101 -3
@@ -0,0 +1,1518 @@
1
+ import Component from '@glimmer/component';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { on } from '@ember/modifier';
4
+ import { registerDestructor, isDestroying, isDestroyed } from '@ember/destroyable';
5
+ import Modifier, { modifier } from 'ember-modifier';
6
+ import { getDirection } from './direction.js';
7
+ import { dismissableBranch } from './dismiss.js';
8
+ import { topLayer } from './layer.js';
9
+ import { fn } from '@ember/helper';
10
+ import { buildWaiter } from '@ember/test-waiters';
11
+ import { precompileTemplate } from '@ember/template-compilation';
12
+ import { setComponentTemplate } from '@ember/component';
13
+ import templateOnly from '@ember/component/template-only';
14
+ import { t, translate } from './i18n.js';
15
+ import { messages } from './messages.js';
16
+ import { isNumber, isString, isFunction, isObject, isBoolean, isUndefined } from '@sindresorhus/is';
17
+ import { State, Machine, region, transition, onEntry, after } from '@switchyard-ts/core';
18
+ import { machine } from '@switchyard-ts/ember';
19
+ import { g, i, n } from 'decorator-transforms/runtime';
20
+ import { warn } from '@ember/debug';
21
+ import { service } from './service.js';
22
+ import { a as isOwner } from './store-BjiAd-KP.js';
23
+
24
+ /*!
25
+ * @ember-joinery/primitives/toast ports sonner 2.0.7 (https://github.com/emilkowalski/sonner):
26
+ * its toast state, Toaster, Toast, icons and loader.
27
+ *
28
+ * MIT License. Copyright (c) 2023 Emil Kowalski
29
+ *
30
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
31
+ * and associated documentation files (the "Software"), to deal in the Software without
32
+ * restriction, including without limitation the rights to use, copy, modify, merge, publish,
33
+ * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
34
+ * Software is furnished to do so, subject to the following conditions:
35
+ *
36
+ * The above copyright notice and this permission notice shall be included in all copies or
37
+ * substantial portions of the Software.
38
+ *
39
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
40
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
42
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
+ */
45
+ /** Whether a value is what `toast.promise()` returns. */
46
+ function isPromiseToast(value) {
47
+ return isObject(value) && !isFunction(value) && 'unwrap' in value && isFunction(value.unwrap);
48
+ }
49
+
50
+ /** What `create` takes: a toast's options plus its message (its title). */
51
+
52
+ function isHttpResponse(data) {
53
+ return isObject(data) && !isFunction(data) && 'ok' in data && isBoolean(data.ok) && 'status' in data && isNumber(data.status);
54
+ }
55
+
56
+ /** A promise result's options, when it is the extended form `{ message, … }`. */
57
+ function isExtendedResult(value) {
58
+ return isObject(value) && !isFunction(value) && 'message' in value;
59
+ }
60
+ async function resolveResult(result, data) {
61
+ return isFunction(result) && !isComponentClass(result) ? await result(data) : result;
62
+ }
63
+
64
+ /**
65
+ * Whether a function is a component class rather than a result function: a class component
66
+ * is constructed, so it has a prototype other than a plain function's, with its own methods.
67
+ */
68
+ function isComponentClass(value) {
69
+ return isFunction(value) && /^class[\s{]/.test(Function.prototype.toString.call(value));
70
+ }
71
+
72
+ /** Tests wait for a change to reach the Toasters (see `Toasts.toasts`). */
73
+ const publishing = buildWaiter('@ember-joinery/primitives:toast-state');
74
+
75
+ /**
76
+ * The toasts of one app (one owner): what is shown, what has been, and sonner's `toast` methods
77
+ * to make and close them. Each app instance has one, through `service`, so tests don't share
78
+ * toasts. `toast()` reaches the app's from anywhere; `toastsFor(this)` from anything with an
79
+ * owner.
80
+ *
81
+ * toastsFor(this).success('Saved')
82
+ * toastsFor(this).toasts // what the Toasters show, newest first
83
+ */
84
+ class Toasts {
85
+ static {
86
+ g(this.prototype, "toasts", [tracked], function () {
87
+ return [];
88
+ });
89
+ }
90
+ #toasts = (i(this, "toasts"), void 0);
91
+ /**
92
+ * The toasts the Toasters show (or are taking away), newest first. A change reaches it a
93
+ * microtask later, as sonner's Toaster takes its toasts a task later: so `toast()` can be
94
+ * called while a page renders (in a constructor or a getter), even after a Toaster has read
95
+ * this, and the Toaster shows it on the next render. `getToasts()` has a new toast at once,
96
+ * and `await settled()` waits for it here.
97
+ */
98
+ /** The toasts as they are now, which `toasts` takes on its next publish. */
99
+ #list = [];
100
+ #publishing;
101
+
102
+ /** Every toast made, oldest first, each as last updated (sonner's `getHistory()`). */
103
+ history = [];
104
+ #dismissed = new Set();
105
+ #counter = 1;
106
+ #destroyed = false;
107
+ constructor() {
108
+ registerDestructor(this, () => this.#destroyed = true);
109
+ }
110
+
111
+ /**
112
+ * Makes a toast, or updates the one with the same `id`. Returns its id. The methods below are
113
+ * shorthands for it.
114
+ */
115
+ create = data => {
116
+ const {
117
+ message,
118
+ ...rest
119
+ } = data;
120
+ const id = isNumber(data.id) || isString(data.id) && data.id.length > 0 ? data.id : this.#counter++;
121
+ if (this.#destroyed) return id;
122
+ const dismissible = data.dismissible === undefined ? true : data.dismissible;
123
+ this.#dismissed.delete(id);
124
+ const index = this.history.findIndex(toast => toast.id === id);
125
+ if (index !== -1) {
126
+ const updated = {
127
+ ...this.history[index],
128
+ ...rest,
129
+ id,
130
+ dismissible,
131
+ title: message
132
+ };
133
+ this.history[index] = updated;
134
+ } else {
135
+ this.history.push({
136
+ title: message,
137
+ ...rest,
138
+ dismissible,
139
+ id
140
+ });
141
+ }
142
+ const shown = this.#list.findIndex(toast => toast.id === id);
143
+ if (shown !== -1) {
144
+ const toasts = [...this.#list];
145
+ toasts[shown] = {
146
+ ...toasts[shown],
147
+ ...rest,
148
+ id,
149
+ dismissible,
150
+ title: message
151
+ };
152
+ this.#publish(toasts);
153
+ } else {
154
+ this.#publish([{
155
+ title: message,
156
+ ...rest,
157
+ dismissible,
158
+ id
159
+ }, ...this.#list]);
160
+ }
161
+ return id;
162
+ };
163
+
164
+ /** A toast with only the message and the options you give. */
165
+ message = (message, data) => this.create({
166
+ ...data,
167
+ message
168
+ });
169
+
170
+ /** A success toast: a check icon, and green with rich colours. */
171
+ success = (message, data) => this.create({
172
+ ...data,
173
+ type: 'success',
174
+ message
175
+ });
176
+
177
+ /** An info toast. */
178
+ info = (message, data) => this.create({
179
+ ...data,
180
+ type: 'info',
181
+ message
182
+ });
183
+
184
+ /** A warning toast. */
185
+ warning = (message, data) => this.create({
186
+ ...data,
187
+ type: 'warning',
188
+ message
189
+ });
190
+
191
+ /** An error toast. */
192
+ error = (message, data) => this.create({
193
+ ...data,
194
+ type: 'error',
195
+ message
196
+ });
197
+
198
+ /** A loading toast, with a spinner, that stays until you update or dismiss it. */
199
+ loading = (message, data) => this.create({
200
+ ...data,
201
+ type: 'loading',
202
+ message
203
+ });
204
+
205
+ /**
206
+ * A toast drawn by a component of your own, with none of sonner's look (sonner's
207
+ * `toast.custom()`). The component gets `@id` and `@dismiss`.
208
+ */
209
+ custom = (component, data) => {
210
+ const id = data?.id || this.#counter++;
211
+ return this.create({
212
+ ...data,
213
+ component,
214
+ id
215
+ });
216
+ };
217
+
218
+ /**
219
+ * A toast that follows a promise: `loading` while it waits, then `success` (given the result)
220
+ * or `error` (given the reason). A resolved `Response` that isn't `ok`, or an `Error`, counts
221
+ * as a failure.
222
+ *
223
+ * toast.promise(save(), {
224
+ * loading: 'Saving…',
225
+ * success: data => `${data.name} has been saved`,
226
+ * error: 'Could not save',
227
+ * })
228
+ */
229
+ promise = (promise, data) => {
230
+ if (!data) return {
231
+ id: undefined,
232
+ unwrap: () => Promise.resolve(promise)
233
+ };
234
+ let id;
235
+ if (data.loading !== undefined) {
236
+ id = this.create({
237
+ ...data,
238
+ promise,
239
+ type: 'loading',
240
+ message: data.loading,
241
+ description: !isFunction(data.description) ? data.description : undefined
242
+ });
243
+ }
244
+ const started = Promise.resolve(isFunction(promise) ? promise() : promise);
245
+ let shouldDismiss = id !== undefined;
246
+ let result;
247
+ const show = async (type, outcome, value) => {
248
+ const shown = await resolveResult(outcome, value);
249
+ const description = await resolveResult(data.description, value);
250
+ // Joinery: dismissed while it waited, it stays dismissed. sonner's comes back.
251
+ if (id !== undefined && this.#dismissed.has(id)) return;
252
+ const settings = isExtendedResult(shown) ? shown : {
253
+ message: shown
254
+ };
255
+ this.create({
256
+ id,
257
+ type,
258
+ description: description,
259
+ ...settings
260
+ });
261
+ };
262
+ const original = started.then(async response => {
263
+ result = ['resolve', response];
264
+ if (isHttpResponse(response) && !response.ok) {
265
+ shouldDismiss = false;
266
+ await show('error', data.error, `HTTP error! status: ${response.status}`);
267
+ } else if (response instanceof Error) {
268
+ shouldDismiss = false;
269
+ await show('error', data.error, response);
270
+ } else if (data.success !== undefined) {
271
+ shouldDismiss = false;
272
+ await show('success', data.success, response);
273
+ }
274
+ }).catch(async error => {
275
+ result = ['reject', error];
276
+ if (data.error !== undefined) {
277
+ shouldDismiss = false;
278
+ await show('error', data.error, error);
279
+ }
280
+ }).finally(() => {
281
+ if (shouldDismiss) {
282
+ // Still loading, and nothing will replace it: take it away.
283
+ this.dismiss(id);
284
+ id = undefined;
285
+ }
286
+ void data.finally?.();
287
+ });
288
+ const unwrap = () => new Promise((resolve, reject) => original.then(() => result?.[0] === 'reject' ? reject(result[1]) : resolve(result?.[1])).catch(reject));
289
+ return {
290
+ id,
291
+ unwrap
292
+ };
293
+ };
294
+
295
+ /**
296
+ * Closes the toast with this id, or every toast without one. It animates out, and its
297
+ * `onDismiss` is called. It takes what `toast.promise()` returns as well as an id.
298
+ */
299
+ dismiss = toastOrId => {
300
+ let id;
301
+ if (isPromiseToast(toastOrId)) {
302
+ // A promise toast made without `loading` shows nothing until it settles, and has no id.
303
+ if (toastOrId.id === undefined) return undefined;
304
+ id = toastOrId.id;
305
+ } else if (toastOrId === undefined || isNumber(toastOrId) || isString(toastOrId)) {
306
+ id = toastOrId;
307
+ } else {
308
+ warn(`Joinery: toast.dismiss() was given ${String(toastOrId)}, which is not a toast's id, so ` + 'it closed nothing. Give it the id toast() returned (or what toast.promise() returned).', false, {
309
+ id: 'joinery.toast.dismiss-id'
310
+ });
311
+ return undefined;
312
+ }
313
+ if (this.#destroyed) return id;
314
+ if (id !== undefined) {
315
+ this.#dismissed.add(id);
316
+ this.#markDeleted(toast => toast.id === id);
317
+ } else {
318
+ for (const toast of this.#list) this.#dismissed.add(toast.id);
319
+ this.#markDeleted(() => true);
320
+ }
321
+ return id;
322
+ };
323
+
324
+ /** Every toast made, as sonner's `toast.getHistory()`. */
325
+ getHistory = () => [...this.history];
326
+
327
+ /** The toasts made that haven't been dismissed, as sonner's `toast.getToasts()`. */
328
+ getToasts = () => this.history.filter(toast => !this.#dismissed.has(toast.id));
329
+
330
+ /**
331
+ * Takes a toast off the list once it has animated out. A Toaster calls it; to close a toast,
332
+ * call `dismiss`.
333
+ */
334
+ remove(toast) {
335
+ if (this.#destroyed) return;
336
+ const shown = this.#list.find(each => each.id === toast.id);
337
+ if (!shown?.delete) this.#dismissed.add(toast.id);
338
+ this.#publish(this.#list.filter(each => each.id !== toast.id));
339
+ }
340
+ #markDeleted(matches) {
341
+ if (!this.#list.some(matches)) return;
342
+ this.#publish(this.#list.map(toast => matches(toast) ? {
343
+ ...toast,
344
+ delete: true
345
+ } : toast));
346
+ }
347
+
348
+ /**
349
+ * Takes the toasts as they now are, and hands them to the Toasters (`toasts`) in a microtask:
350
+ * never during the render that made them, which may already have read `toasts`.
351
+ */
352
+ #publish(list) {
353
+ this.#list = list;
354
+ if (this.#publishing !== undefined) return;
355
+ this.#publishing = publishing.beginAsync();
356
+ queueMicrotask(() => {
357
+ const token = this.#publishing;
358
+ this.#publishing = undefined;
359
+ if (!this.#destroyed) this.toasts = this.#list;
360
+ publishing.endAsync(token);
361
+ });
362
+ }
363
+ }
364
+
365
+ /** The owners whose Toasters are rendered, oldest first: `toast()` uses the newest. */
366
+ const bound = [];
367
+ const GLOBAL = 'JOINERY_TOAST_OWNER';
368
+ const alive = owner => !isDestroying(owner) && !isDestroyed(owner);
369
+
370
+ /**
371
+ * Points `toast()` at an owner's toasts while its Toaster is rendered: the Toaster does it
372
+ * itself. Returns the function that takes it back.
373
+ */
374
+ function bindToasts(owner) {
375
+ bound.push(owner);
376
+ let active = true;
377
+ return () => {
378
+ if (!active) return;
379
+ active = false;
380
+ const index = bound.lastIndexOf(owner);
381
+ if (index !== -1) bound.splice(index, 1);
382
+ };
383
+ }
384
+
385
+ /**
386
+ * The owner `toast()` uses now: `globalThis.JOINERY_TOAST_OWNER` (which test-support's
387
+ * `setupToaster(hooks)` sets to each test's owner), else the owner of the newest rendered
388
+ * Toaster.
389
+ */
390
+ function toastOwner() {
391
+ const global = globalThis[GLOBAL];
392
+ if (isOwner(global) && alive(global)) return global;
393
+ for (let index = bound.length - 1; index >= 0; index--) {
394
+ const owner = bound[index];
395
+ if (alive(owner)) return owner;
396
+ }
397
+ return undefined;
398
+ }
399
+
400
+ /**
401
+ * The toasts of the app `context` belongs to (anything with an owner, or the owner itself):
402
+ * the same `Toasts` its Toasters show. sonner's `useSonner()` is `toastsFor(this).toasts`.
403
+ *
404
+ * toastsFor(this).success('Saved')
405
+ */
406
+ function toastsFor(context) {
407
+ return service(context, Toasts);
408
+ }
409
+
410
+ /** Toasts for when no Toaster is rendered: nothing shows them, as with sonner. */
411
+ let detached;
412
+ function current(caller) {
413
+ const owner = toastOwner();
414
+ if (owner) return toastsFor(owner);
415
+ warn(`Joinery: ${caller} found no Toaster to show the toast. Render a <Toaster> once, in your ` + 'application template; in tests, call setupToaster(hooks) or render a <Toaster>.', false, {
416
+ id: 'joinery.toast.no-toaster'
417
+ });
418
+ return detached ??= new Toasts();
419
+ }
420
+
421
+ /** sonner's `toast`: a function, with a method for each kind of toast. */
422
+
423
+ /**
424
+ * Shows a toast, from anywhere: a component, a route, a plain function. It is sonner's `toast`,
425
+ * with the same methods (`toast.success()`, `toast.promise()`, `toast.dismiss()`…), and it
426
+ * shows in the app's `<Toaster>`:
427
+ *
428
+ * import { toast } from '@ember-joinery/primitives/toast'
429
+ *
430
+ * toast('Event has been created', { description: 'Sunday at 9:00 AM' })
431
+ * toast.success('Saved')
432
+ * toast.promise(save(), { loading: 'Saving…', success: 'Saved', error: 'Failed' })
433
+ *
434
+ * The toasts belong to an owner (one app, or one test), not to the page: `toast()` uses the
435
+ * app whose `<Toaster>` is rendered (in tests, the test's, with `setupToaster(hooks)`), and
436
+ * `toastsFor(this)` names one.
437
+ */
438
+ const toast = Object.assign((message, data) => current('toast()').message(message, data), {
439
+ success: (message, data) => current('toast.success()').success(message, data),
440
+ info: (message, data) => current('toast.info()').info(message, data),
441
+ warning: (message, data) => current('toast.warning()').warning(message, data),
442
+ error: (message, data) => current('toast.error()').error(message, data),
443
+ message: (message, data) => current('toast.message()').message(message, data),
444
+ loading: (message, data) => current('toast.loading()').loading(message, data),
445
+ custom: (component, data) => current('toast.custom()').custom(component, data),
446
+ promise: (promise, data) => current('toast.promise()').promise(promise, data),
447
+ dismiss: toastOrId => current('toast.dismiss()').dismiss(toastOrId),
448
+ getHistory: () => current('toast.getHistory()').getHistory(),
449
+ getToasts: () => current('toast.getToasts()').getToasts()
450
+ });
451
+
452
+ // sonner 2.0.7's own icons and loader (MIT, (c) 2023 Emil Kowalski; the notice is in state.ts),
453
+ // drawn as sonner draws them. A Toaster shows these unless its `@icons` replaces them
454
+ // (Joinery's styled Toaster does, with lucide's, as shadcn's does).
455
+ const SuccessIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\" aria-hidden=\"true\" ...attributes>\n <path fill-rule=\"evenodd\" 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\" clip-rule=\"evenodd\" />\n</svg>", {
456
+ strictMode: true
457
+ }), templateOnly());
458
+ const WarningIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" height=\"20\" width=\"20\" aria-hidden=\"true\" ...attributes>\n <path fill-rule=\"evenodd\" 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\" clip-rule=\"evenodd\" />\n</svg>", {
459
+ strictMode: true
460
+ }), templateOnly());
461
+ const InfoIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\" aria-hidden=\"true\" ...attributes>\n <path fill-rule=\"evenodd\" 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\" clip-rule=\"evenodd\" />\n</svg>", {
462
+ strictMode: true
463
+ }), templateOnly());
464
+ const ErrorIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\" aria-hidden=\"true\" ...attributes>\n <path fill-rule=\"evenodd\" 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\" clip-rule=\"evenodd\" />\n</svg>", {
465
+ strictMode: true
466
+ }), templateOnly());
467
+ const CloseIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" ...attributes>\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n</svg>", {
468
+ strictMode: true
469
+ }), templateOnly());
470
+ const BARS = Array.from({
471
+ length: 12
472
+ }, (_, index) => index);
473
+ /** sonner's spinner: twelve bars, fading in turn (`.sonner-loading-bar` in its CSS). */
474
+ const Loader = setComponentTemplate(precompileTemplate("<div class=\"sonner-loading-wrapper {{@class}}\" data-visible={{if @visible \"true\" \"false\"}} ...attributes>\n <div class=\"sonner-spinner\">\n {{#each BARS}}\n <div class=\"sonner-loading-bar\"></div>\n {{/each}}\n </div>\n</div>", {
475
+ strictMode: true,
476
+ scope: () => ({
477
+ BARS
478
+ })
479
+ }), templateOnly());
480
+ /** sonner's icon for a type (its `getAsset`): none for the types without one. */
481
+ function iconFor(type) {
482
+ switch (type) {
483
+ case 'success':
484
+ return SuccessIcon;
485
+ case 'info':
486
+ return InfoIcon;
487
+ case 'warning':
488
+ return WarningIcon;
489
+ case 'error':
490
+ return ErrorIcon;
491
+ default:
492
+ return null;
493
+ }
494
+ }
495
+
496
+ /** A style property's CSS name: custom properties as they are, `marginTop` as `margin-top`. */
497
+ function cssName(name) {
498
+ return name.startsWith('--') ? name : name.replace(/[A-Z]/g, upper => `-${upper.toLowerCase()}`);
499
+ }
500
+ /**
501
+ * Sets inline styles through the CSSOM, as React's `style` does, so a strict Content Security
502
+ * Policy (one without `style-src 'unsafe-inline'`) doesn't block them as it would a `style`
503
+ * attribute. It removes what an earlier run set and this one doesn't, and leaves alone what
504
+ * others set (a toast's `--swipe-amount-x`).
505
+ */
506
+ class styles extends Modifier {
507
+ #set = new Set();
508
+ modify(element, [styles]) {
509
+ const next = new Set();
510
+ for (const [name, value] of Object.entries(styles ?? {})) {
511
+ const property = cssName(name);
512
+ element.style.setProperty(property, value);
513
+ next.add(property);
514
+ }
515
+ for (const property of this.#set) if (!next.has(property)) element.style.removeProperty(property);
516
+ this.#set = next;
517
+ }
518
+ }
519
+
520
+ const TIME_BEFORE_UNMOUNT = 200;
521
+ class LifeState extends State {
522
+ /** Rendered, not yet measured: `data-mounted="false"`. */
523
+ static Measuring = LifeState.of('measuring');
524
+ static Shown = LifeState.of('shown');
525
+ /** Animating out, `TIME_BEFORE_UNMOUNT` long. */
526
+ static Removing = LifeState.of('removing');
527
+ /** Taken off its Toaster's list. */
528
+ static Removed = LifeState.of('removed');
529
+ }
530
+ class GestureState extends State {
531
+ static Idle = GestureState.of('idle');
532
+ /** A pointer is down on it: `data-swiping`. */
533
+ static Pressed = GestureState.of('pressed');
534
+ /** It follows the pointer: `data-swiped` as well. */
535
+ static Swiping = GestureState.of('swiping');
536
+ /** Swiped far or fast enough: it flies off (`data-swipe-out`). */
537
+ static SwipedOut = GestureState.of('swiped-out');
538
+ }
539
+
540
+ /** What a toast's chart works on. */
541
+
542
+ /**
543
+ * A toast's life, as two regions: measured, shown, animating out and gone; and a press that may
544
+ * turn into a swipe and fly it off. A swipe out removes it, and nothing brings it back.
545
+ */
546
+ class ToastLife extends Machine {
547
+ host;
548
+ static {
549
+ g(this.prototype, "life", [region(LifeState)]);
550
+ }
551
+ #life = (i(this, "life"), void 0);
552
+ static {
553
+ g(this.prototype, "gesture", [region(GestureState)]);
554
+ }
555
+ #gesture = (i(this, "gesture"), void 0);
556
+ constructor(host) {
557
+ super();
558
+ this.host = host;
559
+ }
560
+
561
+ /** Measured: `data-mounted` turns on, and its entrance starts. */
562
+ measured() {}
563
+
564
+ /** Closes it; once is enough. */
565
+ static {
566
+ n(this.prototype, "measured", [transition({
567
+ from: [LifeState.Shown, LifeState.Removing, LifeState.Removed]
568
+ }), transition({
569
+ from: LifeState.Measuring,
570
+ to: LifeState.Shown
571
+ })]);
572
+ }
573
+ remove() {}
574
+ static {
575
+ n(this.prototype, "remove", [transition({
576
+ from: [LifeState.Removing, LifeState.Removed]
577
+ }), transition({
578
+ from: [LifeState.Measuring, LifeState.Shown],
579
+ to: LifeState.Removing
580
+ })]);
581
+ }
582
+ startRemoving() {
583
+ this.host.removing();
584
+ }
585
+ static {
586
+ n(this.prototype, "startRemoving", [onEntry(LifeState.Removing)]);
587
+ }
588
+ unmounted() {
589
+ this.host.unmount();
590
+ }
591
+ static {
592
+ n(this.prototype, "unmounted", [after(TIME_BEFORE_UNMOUNT, {
593
+ from: LifeState.Removing,
594
+ to: LifeState.Removed
595
+ })]);
596
+ }
597
+ press() {}
598
+
599
+ /** The pointer moved it. */
600
+ static {
601
+ n(this.prototype, "press", [transition({
602
+ from: [GestureState.Pressed, GestureState.Swiping, GestureState.SwipedOut]
603
+ }), transition({
604
+ from: GestureState.Idle,
605
+ to: GestureState.Pressed
606
+ })]);
607
+ }
608
+ drag() {}
609
+
610
+ /** Let go short of a swipe out: it springs back. */
611
+ static {
612
+ n(this.prototype, "drag", [transition({
613
+ from: [GestureState.Idle, GestureState.Swiping, GestureState.SwipedOut]
614
+ }), transition({
615
+ from: GestureState.Pressed,
616
+ to: GestureState.Swiping
617
+ })]);
618
+ }
619
+ release() {}
620
+
621
+ /** A drag (HTML drag and drop) took the pointer. */
622
+ static {
623
+ n(this.prototype, "release", [transition({
624
+ from: [GestureState.Idle, GestureState.SwipedOut]
625
+ }), transition({
626
+ from: [GestureState.Pressed, GestureState.Swiping],
627
+ to: GestureState.Idle
628
+ })]);
629
+ }
630
+ dragEnd() {}
631
+ static {
632
+ n(this.prototype, "dragEnd", [transition({
633
+ from: [GestureState.Idle, GestureState.SwipedOut]
634
+ }), transition({
635
+ from: [GestureState.Pressed, GestureState.Swiping],
636
+ to: GestureState.Idle
637
+ })]);
638
+ }
639
+ swipeOut() {
640
+ this.remove();
641
+ }
642
+ static {
643
+ n(this.prototype, "swipeOut", [transition({
644
+ in: 'gesture',
645
+ to: GestureState.SwipedOut
646
+ })]);
647
+ }
648
+ }
649
+ class TimerState extends State {
650
+ /** A loading toast, `duration: Infinity`, or one already closing: no timer. */
651
+ static None = TimerState.of('none');
652
+ /** Counting down what is left of its duration. */
653
+ static Running = TimerState.of('running');
654
+ /** The stack is expanded, pressed, or the page hidden. */
655
+ static Paused = TimerState.of('paused');
656
+ }
657
+
658
+ /** What a toast's timer reads, and tells when its time is up. */
659
+
660
+ /** setTimeout without a test waiter, as sonner's timer has none: `settled()` would wait it out. */
661
+ const untracked = {
662
+ setTimeout: (fn, ms) => setTimeout(fn, ms),
663
+ clearTimeout: handle => clearTimeout(handle)
664
+ };
665
+
666
+ /**
667
+ * sonner's auto-close timer, as a chart. `sync()` is sonner's timer effect, sent whenever the
668
+ * toast, its duration or whether it is paused changes: a pause banks the time that ran since
669
+ * the last start (once), a resume or a change to the toast starts what is left again.
670
+ */
671
+ class ToastTimer extends Machine {
672
+ static clock = untracked;
673
+ host;
674
+ #duration;
675
+ #remaining;
676
+ /** When it last started running, if it hasn't paused since (sonner's `last < start`). */
677
+ #startedAt;
678
+ constructor(host) {
679
+ super();
680
+ this.host = host;
681
+ this.#remaining = this.#duration = host.duration;
682
+ }
683
+ get remainingTime() {
684
+ return Math.max(0, this.#remaining);
685
+ }
686
+ get hasNoTimer() {
687
+ return this.host.isUntimed || this.host.duration === Infinity;
688
+ }
689
+ get isPaused() {
690
+ return this.host.isPaused;
691
+ }
692
+ sync() {
693
+ const {
694
+ duration
695
+ } = this.host;
696
+ if (duration !== this.#duration) this.#remaining = this.#duration = duration;
697
+ }
698
+ static {
699
+ n(this.prototype, "sync", [transition({
700
+ to: TimerState.Running,
701
+ reenter: true
702
+ }), transition({
703
+ from: TimerState.Paused,
704
+ guard: m => m.isPaused
705
+ }), transition({
706
+ from: [TimerState.None, TimerState.Running],
707
+ to: TimerState.Paused,
708
+ guard: m => m.isPaused
709
+ }), transition({
710
+ from: [TimerState.None, TimerState.Running, TimerState.Paused],
711
+ to: TimerState.None,
712
+ guard: m => m.hasNoTimer
713
+ })]);
714
+ }
715
+ started() {
716
+ this.#startedAt = Date.now();
717
+ }
718
+ static {
719
+ n(this.prototype, "started", [onEntry(TimerState.Running)]);
720
+ }
721
+ paused() {
722
+ if (this.#startedAt !== undefined) this.#remaining -= Date.now() - this.#startedAt;
723
+ this.#startedAt = undefined;
724
+ }
725
+ static {
726
+ n(this.prototype, "paused", [onEntry(TimerState.Paused)]);
727
+ }
728
+ timedOut() {
729
+ this.host.timedOut();
730
+ }
731
+ static {
732
+ n(this.prototype, "timedOut", [after('remainingTime', {
733
+ from: TimerState.Running,
734
+ to: TimerState.None
735
+ })]);
736
+ }
737
+ }
738
+
739
+ /** A started `ToastLife`, stopped (its unmount timer with it) when `owner` is destroyed. */
740
+ function toastLife(owner, host) {
741
+ return machine(owner, new ToastLife(host));
742
+ }
743
+
744
+ /** A started `ToastTimer`, stopped when `owner` is destroyed. */
745
+ function toastTimer(owner, host) {
746
+ return machine(owner, new ToastTimer(host));
747
+ }
748
+
749
+ const waiter = buildWaiter('@ember-joinery/primitives:toast');
750
+ /** How long a toast shows, in milliseconds, unless told otherwise (sonner's `TOAST_LIFETIME`). */
751
+ const TOAST_LIFETIME = 4000;
752
+ /** How far, in pixels, a swipe must go to dismiss a toast (sonner's `SWIPE_THRESHOLD`). */
753
+ const SWIPE_THRESHOLD = 45;
754
+ /** A toast's measured height, which the toasts below it in the stack are placed by. */
755
+
756
+ /** What a toast tells its Toaster: its height, and when it has animated out. */
757
+
758
+ function cn(...classes) {
759
+ const joined = classes.filter(Boolean).join(' ');
760
+ return joined || undefined;
761
+ }
762
+ const bool = value => value ? 'true' : 'false';
763
+ /** An optional boolean as React renders it on a `data-` attribute: left off when unset. */
764
+ const optional = value => value === undefined ? undefined : bool(value);
765
+ function isAction(action) {
766
+ return isObject(action) && !isFunction(action) && 'label' in action;
767
+ }
768
+ function defaultSwipeDirections(position) {
769
+ const [y, x] = position.split('-');
770
+ const directions = [];
771
+ if (y) directions.push(y);
772
+ if (x && x !== 'center') directions.push(x);
773
+ return directions;
774
+ }
775
+ /** Runs `callback` once the render is over: a render can't change state it has read. */
776
+ function afterRender(owner, callback) {
777
+ const token = waiter.beginAsync();
778
+ queueMicrotask(() => {
779
+ try {
780
+ if (!isDestroying(owner) && !isDestroyed(owner)) callback();
781
+ } finally {
782
+ waiter.endAsync(token);
783
+ }
784
+ });
785
+ }
786
+ /**
787
+ * A toast's height with its content laid out in full, as sonner measures it (with `height:
788
+ * auto`): its layout height, which a collapsed stack's scaling doesn't change, so toasts made
789
+ * together measure as each would alone in front.
790
+ */
791
+ function naturalHeight(element) {
792
+ const original = element.style.height;
793
+ element.style.height = 'auto';
794
+ const height = Number.parseFloat(getComputedStyle(element).height) || 0;
795
+ element.style.height = original;
796
+ return height;
797
+ }
798
+ const notLoading = type => type !== 'loading';
799
+ const text = content => isString(content) ? content : undefined;
800
+ const component = content => content === undefined || isString(content) ? undefined : content;
801
+ class ToastItem extends Component {
802
+ static {
803
+ g(this.prototype, "swipeOutDirection", [tracked], function () {
804
+ return null;
805
+ });
806
+ }
807
+ #swipeOutDirection = (i(this, "swipeOutDirection"), void 0);
808
+ static {
809
+ g(this.prototype, "offsetBeforeRemove", [tracked], function () {
810
+ return 0;
811
+ });
812
+ }
813
+ #offsetBeforeRemove = (i(this, "offsetBeforeRemove"), void 0);
814
+ static {
815
+ g(this.prototype, "initialHeight", [tracked], function () {
816
+ return 0;
817
+ });
818
+ }
819
+ #initialHeight = (i(this, "initialHeight"), void 0);
820
+ #element;
821
+ #swipeDirection = null;
822
+ #dragStart = null;
823
+ #pointerStart = null;
824
+ #deleted = false;
825
+ chart = toastLife(this, this);
826
+ timer = toastTimer(this, this);
827
+ constructor(owner, args) {
828
+ super(owner, args);
829
+ registerDestructor(this, () => {
830
+ const id = this.args.toast.id;
831
+ const host = this.args.host;
832
+ queueMicrotask(() => host.setHeights(heights => heights.filter(h => h.toastId !== id)));
833
+ });
834
+ }
835
+ get toast() {
836
+ return this.args.toast;
837
+ }
838
+ get mounted() {
839
+ return !this.chart.matches(LifeState.Measuring);
840
+ }
841
+ get removed() {
842
+ return this.chart.matches(LifeState.Removing) || this.chart.matches(LifeState.Removed);
843
+ }
844
+ get swiping() {
845
+ return !this.chart.matches(GestureState.Idle);
846
+ }
847
+ get isSwiped() {
848
+ return this.chart.matches(GestureState.Swiping) || this.chart.matches(GestureState.SwipedOut);
849
+ }
850
+ get swipeOut() {
851
+ return this.chart.matches(GestureState.SwipedOut);
852
+ }
853
+ get type() {
854
+ return this.toast.type;
855
+ }
856
+ get isFront() {
857
+ return this.args.index === 0;
858
+ }
859
+ get isVisible() {
860
+ return this.args.index + 1 <= this.args.visibleToasts;
861
+ }
862
+ get dismissible() {
863
+ return this.toast.dismissible !== false;
864
+ }
865
+ get isPromise() {
866
+ return Boolean(this.toast.promise);
867
+ }
868
+ get disabled() {
869
+ return this.type === 'loading';
870
+ }
871
+ get duration() {
872
+ return this.toast.duration || this.args.duration || TOAST_LIFETIME;
873
+ }
874
+ get y() {
875
+ return this.args.position.split('-')[0];
876
+ }
877
+ get x() {
878
+ return this.args.position.split('-')[1];
879
+ }
880
+ /** Where its height is in the stack (sonner's `heightIndex`, `-1` before it is measured). */
881
+ get heightIndex() {
882
+ return this.args.heights.findIndex(height => height.toastId === this.toast.id) || 0;
883
+ }
884
+ get toastsHeightBefore() {
885
+ return this.args.heights.reduce((sum, height, index) => index >= this.heightIndex ? sum : sum + height.height, 0);
886
+ }
887
+ /** How far it sits from the front of an expanded stack, in pixels. */
888
+ get offset() {
889
+ return this.heightIndex * this.args.gap + this.toastsHeightBefore;
890
+ }
891
+ get classes() {
892
+ const {
893
+ classNames
894
+ } = this.args;
895
+ const own = this.toast.classNames;
896
+ const type = this.type;
897
+ return cn(this.args.className, this.toast.className, classNames?.toast, own?.toast, classNames?.default, type && classNames?.[type], type && own?.[type]);
898
+ }
899
+ get richColors() {
900
+ return optional(this.toast.richColors ?? this.args.richColors);
901
+ }
902
+ get styled() {
903
+ return bool(!(this.toast.component || this.toast.unstyled || this.args.unstyled));
904
+ }
905
+ get invert() {
906
+ return optional(this.toast.invert || this.args.invert || undefined);
907
+ }
908
+ get expanded() {
909
+ return bool(this.args.expanded || this.args.expandByDefault && this.mounted);
910
+ }
911
+ get vars() {
912
+ const {
913
+ index,
914
+ count
915
+ } = this.args;
916
+ return {
917
+ '--index': String(index),
918
+ '--toasts-before': String(index),
919
+ '--z-index': String(count - index),
920
+ '--offset': `${this.removed ? this.offsetBeforeRemove : this.offset}px`,
921
+ '--initial-height': this.args.expandByDefault ? 'auto' : `${this.initialHeight}px`,
922
+ ...this.args.style,
923
+ ...this.toast.style
924
+ };
925
+ }
926
+ get showCloseButton() {
927
+ const closeButton = this.toast.closeButton ?? this.args.closeButton;
928
+ return Boolean(closeButton && !this.toast.component && this.type !== 'loading');
929
+ }
930
+ get CloseIcon() {
931
+ return this.args.icons?.close ?? CloseIcon;
932
+ }
933
+ get showIcon() {
934
+ const {
935
+ toast,
936
+ type
937
+ } = this;
938
+ const icons = this.args.icons;
939
+ return Boolean((type || toast.icon || toast.promise) && toast.icon !== null && (icons?.[type ?? ''] !== null || toast.icon));
940
+ }
941
+ /** Whether the loading spinner shows (and, once a promise settles, fades out). */
942
+ get showLoader() {
943
+ return Boolean(this.toast.promise || this.type === 'loading' && !this.toast.icon);
944
+ }
945
+ get loaderVisible() {
946
+ return this.type === 'loading';
947
+ }
948
+ get loaderClass() {
949
+ return cn(this.args.classNames?.loader, this.toast.classNames?.loader);
950
+ }
951
+ get LoadingIcon() {
952
+ return this.args.icons?.loading;
953
+ }
954
+ get Icon() {
955
+ const icons = this.args.icons;
956
+ return this.toast.icon || icons?.[this.type ?? ''] || iconFor(this.type);
957
+ }
958
+ get titleText() {
959
+ return text(this.toast.title);
960
+ }
961
+ get Title() {
962
+ return component(this.toast.title);
963
+ }
964
+ get descriptionText() {
965
+ return text(this.toast.description);
966
+ }
967
+ get Description() {
968
+ return component(this.toast.description);
969
+ }
970
+ get descriptionClass() {
971
+ return cn(this.args.descriptionClassName, this.toast.descriptionClassName, this.args.classNames?.description, this.toast.classNames?.description);
972
+ }
973
+ get cancel() {
974
+ return isAction(this.toast.cancel) ? this.toast.cancel : undefined;
975
+ }
976
+ get Cancel() {
977
+ const cancel = this.toast.cancel;
978
+ return cancel && !isAction(cancel) ? cancel : undefined;
979
+ }
980
+ get action() {
981
+ return isAction(this.toast.action) ? this.toast.action : undefined;
982
+ }
983
+ get Action() {
984
+ const action = this.toast.action;
985
+ return action && !isAction(action) ? action : undefined;
986
+ }
987
+ get cancelStyle() {
988
+ return this.toast.cancelButtonStyle || this.args.cancelButtonStyle;
989
+ }
990
+ get actionStyle() {
991
+ return this.toast.actionButtonStyle || this.args.actionButtonStyle;
992
+ }
993
+ part = (name, extra) => cn(this.args.classNames?.[name], this.toast.classNames?.[name], extra);
994
+ /** Closes it: it animates out, and its Toaster removes it. */
995
+ deleteToast = () => this.chart.remove();
996
+ removing() {
997
+ this.offsetBeforeRemove = this.offset;
998
+ const id = this.toast.id;
999
+ this.args.host.setHeights(heights => heights.filter(height => height.toastId !== id));
1000
+ this.timer.sync();
1001
+ }
1002
+ unmount() {
1003
+ this.args.host.removeToast(this.toast);
1004
+ }
1005
+ #dismiss() {
1006
+ this.deleteToast();
1007
+ this.toast.onDismiss?.(this.toast);
1008
+ }
1009
+ /** Measures it when it is first shown, and starts its entrance. */
1010
+ setup = modifier(element => {
1011
+ this.#element = element;
1012
+ // Once the render is over: the list's modifiers, which set its width, run after its toasts'.
1013
+ afterRender(this, () => {
1014
+ const height = naturalHeight(element);
1015
+ this.initialHeight = height;
1016
+ const {
1017
+ id,
1018
+ position
1019
+ } = this.toast;
1020
+ this.args.host.setHeights(heights => [{
1021
+ toastId: id,
1022
+ height,
1023
+ position
1024
+ }, ...heights]);
1025
+ // Measuring it laid it out unmounted (below and transparent), so turning `data-mounted`
1026
+ // on now is a transition, as sonner's effect after the first paint is.
1027
+ this.chart.measured();
1028
+ });
1029
+ });
1030
+ /** Measures it again whenever what it shows changes (sonner's layout effect). */
1031
+ remeasure = modifier((element, [mounted]) => {
1032
+ if (!mounted) return;
1033
+ afterRender(this, () => {
1034
+ const height = naturalHeight(element);
1035
+ this.initialHeight = height;
1036
+ const {
1037
+ id,
1038
+ position
1039
+ } = this.toast;
1040
+ this.args.host.setHeights(heights => heights.some(each => each.toastId === id) ? heights.map(each => each.toastId === id ? {
1041
+ ...each,
1042
+ height
1043
+ } : each) : [{
1044
+ toastId: id,
1045
+ height,
1046
+ position
1047
+ }, ...heights]);
1048
+ });
1049
+ });
1050
+ /** Starts its exit when `toast.dismiss()` marks it deleted. */
1051
+ watchDelete = modifier((_element, [deleted]) => {
1052
+ if (!deleted || this.#deleted) return;
1053
+ this.#deleted = true;
1054
+ afterRender(this, () => this.#dismiss());
1055
+ });
1056
+ /**
1057
+ * Runs its timer while the stack is collapsed, the pointer isn't on it and the page is
1058
+ * showing, and pauses it otherwise (sonner's timer effect). A loading toast, a promise that
1059
+ * hasn't settled and `duration: Infinity` have none.
1060
+ */
1061
+ timerSync = modifier((_element, _) => this.timer.sync());
1062
+ get isUntimed() {
1063
+ return this.type === 'loading' || this.removed;
1064
+ }
1065
+ get isPaused() {
1066
+ return this.paused;
1067
+ }
1068
+ timedOut() {
1069
+ this.toast.onAutoClose?.(this.toast);
1070
+ this.deleteToast();
1071
+ }
1072
+ get paused() {
1073
+ return this.args.expanded || this.args.interacting || this.args.documentHidden;
1074
+ }
1075
+ onPointerDown = event => {
1076
+ if (event.button === 2) return;
1077
+ if (this.disabled || !this.dismissible) return;
1078
+ this.#dragStart = Date.now();
1079
+ this.offsetBeforeRemove = this.offset;
1080
+ const target = event.target;
1081
+ try {
1082
+ // Keeps the pointer's events coming here even once it leaves the toast, as it swipes.
1083
+ target.setPointerCapture(event.pointerId);
1084
+ } catch {
1085
+ // not an active pointer (a synthetic event)
1086
+ }
1087
+ if (target.tagName === 'BUTTON') return;
1088
+ this.chart.press();
1089
+ this.#pointerStart = {
1090
+ x: event.clientX,
1091
+ y: event.clientY
1092
+ };
1093
+ };
1094
+ onPointerUp = () => {
1095
+ if (this.swipeOut || !this.dismissible) return;
1096
+ this.#pointerStart = null;
1097
+ const style = this.#element?.style;
1098
+ const amountX = Number(style?.getPropertyValue('--swipe-amount-x').replace('px', '') || 0);
1099
+ const amountY = Number(style?.getPropertyValue('--swipe-amount-y').replace('px', '') || 0);
1100
+ const timeTaken = this.#dragStart === null ? NaN : Date.now() - this.#dragStart;
1101
+ const amount = this.#swipeDirection === 'x' ? amountX : amountY;
1102
+ const velocity = Math.abs(amount) / timeTaken;
1103
+ if (Math.abs(amount) >= SWIPE_THRESHOLD || velocity > 0.11) {
1104
+ this.offsetBeforeRemove = this.offset;
1105
+ this.toast.onDismiss?.(this.toast);
1106
+ if (this.#swipeDirection === 'x') this.swipeOutDirection = amountX > 0 ? 'right' : 'left';else this.swipeOutDirection = amountY > 0 ? 'down' : 'up';
1107
+ this.chart.swipeOut();
1108
+ return;
1109
+ }
1110
+ style?.setProperty('--swipe-amount-x', '0px');
1111
+ style?.setProperty('--swipe-amount-y', '0px');
1112
+ this.chart.release();
1113
+ this.#swipeDirection = null;
1114
+ };
1115
+ onPointerMove = event => {
1116
+ const start = this.#pointerStart;
1117
+ if (!start || !this.dismissible) return;
1118
+ if ((window.getSelection()?.toString().length ?? 0) > 0) return; // selecting text
1119
+ const yDelta = event.clientY - start.y;
1120
+ const xDelta = event.clientX - start.x;
1121
+ const directions = this.args.swipeDirections ?? defaultSwipeDirections(this.args.position);
1122
+ if (!this.#swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
1123
+ this.#swipeDirection = Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y';
1124
+ }
1125
+ const amount = {
1126
+ x: 0,
1127
+ y: 0
1128
+ };
1129
+ // Against an allowed direction, the toast follows the pointer less and less.
1130
+ const dampened = delta => {
1131
+ const value = delta * (1 / (1.5 + Math.abs(delta) / 20));
1132
+ return Math.abs(value) < Math.abs(delta) ? value : delta;
1133
+ };
1134
+ if (this.#swipeDirection === 'y') {
1135
+ if (directions.includes('top') || directions.includes('bottom')) {
1136
+ amount.y = directions.includes('top') && yDelta < 0 || directions.includes('bottom') && yDelta > 0 ? yDelta : dampened(yDelta);
1137
+ }
1138
+ } else if (this.#swipeDirection === 'x') {
1139
+ if (directions.includes('left') || directions.includes('right')) {
1140
+ amount.x = directions.includes('left') && xDelta < 0 || directions.includes('right') && xDelta > 0 ? xDelta : dampened(xDelta);
1141
+ }
1142
+ }
1143
+ if (Math.abs(amount.x) > 0 || Math.abs(amount.y) > 0) this.chart.drag();
1144
+ this.#element?.style.setProperty('--swipe-amount-x', `${amount.x}px`);
1145
+ this.#element?.style.setProperty('--swipe-amount-y', `${amount.y}px`);
1146
+ };
1147
+ onDragEnd = () => {
1148
+ this.chart.dragEnd();
1149
+ this.#swipeDirection = null;
1150
+ this.#pointerStart = null;
1151
+ };
1152
+ onClose = () => {
1153
+ if (this.disabled || !this.dismissible) return;
1154
+ this.#dismiss();
1155
+ };
1156
+ onCancel = (cancel, event) => {
1157
+ if (!this.dismissible) return;
1158
+ cancel.onClick?.(event);
1159
+ this.deleteToast();
1160
+ };
1161
+ onAction = (action, event) => {
1162
+ action.onClick?.(event);
1163
+ if (event.defaultPrevented) return;
1164
+ this.deleteToast();
1165
+ };
1166
+ static {
1167
+ setComponentTemplate(precompileTemplate("<li tabindex=\"0\" class={{this.classes}} data-sonner-toast data-rich-colors={{this.richColors}} data-styled={{this.styled}} data-mounted={{bool this.mounted}} data-promise={{bool this.isPromise}} data-swiped={{bool this.isSwiped}} data-removed={{bool this.removed}} data-visible={{bool this.isVisible}} data-y-position={{this.y}} data-x-position={{this.x}} data-index={{@index}} data-front={{bool this.isFront}} data-swiping={{bool this.swiping}} data-dismissible={{bool this.dismissible}} data-type={{this.type}} data-invert={{this.invert}} data-swipe-out={{bool this.swipeOut}} data-swipe-direction={{this.swipeOutDirection}} data-expanded={{this.expanded}} data-testid={{this.toast.testId}} data-test-jn=\"toast\" data-test-jn-name=\"{{this.toast.id}}\" {{styles this.vars}} {{this.setup}} {{this.remeasure this.mounted this.toast.title this.toast.description this.toast.component this.toast.action this.toast.cancel}} {{this.watchDelete this.toast.delete}} {{this.timerSync this.paused this.toast this.duration}} {{on \"pointerdown\" this.onPointerDown}} {{on \"pointerup\" this.onPointerUp}} {{on \"pointermove\" this.onPointerMove}} {{on \"dragend\" this.onDragEnd}}>\n {{#if this.showCloseButton}}\n <button type=\"button\" aria-label={{if @closeButtonAriaLabel @closeButtonAriaLabel (t messages.toastClose)}} data-disabled={{bool this.disabled}} data-close-button=\"true\" class={{this.part \"closeButton\"}} data-test-jn-part=\"close\" {{on \"click\" this.onClose}}><this.CloseIcon /></button>\n {{/if}}\n {{#if this.showIcon}}\n <div data-icon class={{this.part \"icon\"}} data-test-jn-part=\"icon\">\n {{#if this.showLoader}}\n {{#if this.toast.icon}}\n <this.toast.icon />\n {{else if this.LoadingIcon}}\n <div class={{this.part \"loader\" \"sonner-loader\"}} data-visible={{bool this.loaderVisible}}><this.LoadingIcon /></div>\n {{else}}\n <Loader @class={{this.loaderClass}} @visible={{this.loaderVisible}} />\n {{/if}}\n {{/if}}\n {{#if (notLoading this.type)}}\n {{#if this.Icon}}<this.Icon />{{/if}}\n {{/if}}\n </div>\n {{/if}}\n <div data-content class={{this.part \"content\"}}>\n <div data-title class={{this.part \"title\"}} data-test-jn-part=\"title\">\n {{#if this.toast.component}}\n <this.toast.component @id={{this.toast.id}} @dismiss={{this.deleteToast}} />\n {{else if this.Title}}\n <this.Title />\n {{else}}\n {{this.titleText}}\n {{/if}}\n </div>\n {{#if this.toast.description}}\n <div data-description class={{this.descriptionClass}} data-test-jn-part=\"description\">\n {{#if this.Description}}<this.Description />{{else}}{{this.descriptionText}}{{/if}}\n </div>\n {{/if}}\n </div>\n {{#if this.Cancel}}\n <this.Cancel />\n {{else if this.cancel}}\n <button type=\"button\" data-button=\"true\" data-cancel=\"true\" class={{this.part \"cancelButton\"}} data-test-jn-part=\"cancel\" {{styles this.cancelStyle}} {{on \"click\" (fn this.onCancel this.cancel)}}>{{this.cancel.label}}</button>\n {{/if}}\n {{#if this.Action}}\n <this.Action />\n {{else if this.action}}\n <button type=\"button\" data-button=\"true\" data-action=\"true\" class={{this.part \"actionButton\"}} data-test-jn-part=\"action\" {{styles this.actionStyle}} {{on \"click\" (fn this.onAction this.action)}}>{{this.action.label}}</button>\n {{/if}}\n</li>", {
1168
+ strictMode: true,
1169
+ scope: () => ({
1170
+ bool,
1171
+ styles,
1172
+ on,
1173
+ t,
1174
+ messages,
1175
+ Loader,
1176
+ notLoading,
1177
+ fn
1178
+ })
1179
+ }), this);
1180
+ }
1181
+ }
1182
+
1183
+ const VISIBLE_TOASTS_AMOUNT = 3;
1184
+ /** The space between the stack and the viewport's edges. */
1185
+ const VIEWPORT_OFFSET = '24px';
1186
+ /** The same, on a narrow screen (600px or less). */
1187
+ const MOBILE_VIEWPORT_OFFSET = '16px';
1188
+ /** A toast's width, in pixels. */
1189
+ const TOAST_WIDTH = 356;
1190
+ /** The space between toasts in an expanded stack, in pixels. */
1191
+ const GAP = 14;
1192
+ /** Options every toast in a Toaster takes, as sonner's `toastOptions`. */
1193
+
1194
+ /** The space between the stack and the viewport's edges: one length, or one per side. */
1195
+
1196
+ /** A Toaster's colour theme, as sonner's: `system` follows the OS. */
1197
+
1198
+ function offsetStyles(offset, mobile) {
1199
+ const result = {};
1200
+ const px = value => isNumber(value) ? `${value}px` : value;
1201
+ for (const [value, prefix, fallback] of [[offset, '--offset', VIEWPORT_OFFSET], [mobile, '--mobile-offset', MOBILE_VIEWPORT_OFFSET]]) {
1202
+ for (const side of ['top', 'right', 'bottom', 'left']) {
1203
+ if (isNumber(value) || isString(value)) {
1204
+ result[`${prefix}-${side}`] = px(value);
1205
+ } else if (isObject(value) && !isFunction(value)) {
1206
+ const own = value[side];
1207
+ result[`${prefix}-${side}`] = own === undefined ? fallback : px(own);
1208
+ } else {
1209
+ result[`${prefix}-${side}`] = fallback;
1210
+ }
1211
+ }
1212
+ }
1213
+ return result;
1214
+ }
1215
+ const prefersDark = () => isFunction(globalThis.matchMedia) && globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
1216
+ /**
1217
+ * Whether focus on an element shows as the keyboard's (`:focus-visible`): tabbing or the hotkey,
1218
+ * not a click or a tap on a toast.
1219
+ */
1220
+ const focusVisible = element => {
1221
+ if (!(element instanceof Element)) return false;
1222
+ try {
1223
+ return element.matches(':focus-visible');
1224
+ } catch {
1225
+ return true;
1226
+ }
1227
+ };
1228
+ const yOf = position => position.split('-')[0];
1229
+ const xOf = position => position.split('-')[1];
1230
+ /**
1231
+ * Shows the app's toasts: sonner's `Toaster`, headless. Render it once, in your application
1232
+ * template, and make toasts from anywhere with `toast()`:
1233
+ *
1234
+ * import { Toaster, toast } from '@ember-joinery/primitives/toast'
1235
+ *
1236
+ * <Toaster @position="top-center" @richColors={{true}} />
1237
+ * <button type="button" {{on "click" (fn toast "Saved")}}>Save</button>
1238
+ *
1239
+ * It renders sonner's markup and data attributes (`data-sonner-toaster`, `data-sonner-toast`,
1240
+ * `data-mounted`, `data-expanded`…), which sonner's CSS lays out, stacks and animates;
1241
+ * `@ember-joinery/ember`'s `Toaster` ships that CSS, with shadcn's look. Each list is in the
1242
+ * browser's top layer, so toasts show above dialogs and popovers, and counts as inside every
1243
+ * dismissable layer, so pressing a toast closes none of them.
1244
+ *
1245
+ * Toasts belong to the app (its owner), not the page, so each test has its own.
1246
+ */
1247
+ class Toaster extends Component {
1248
+ static {
1249
+ g(this.prototype, "heights", [tracked], function () {
1250
+ return [];
1251
+ });
1252
+ }
1253
+ #heights = (i(this, "heights"), void 0);
1254
+ static {
1255
+ g(this.prototype, "expanded", [tracked], function () {
1256
+ return false;
1257
+ });
1258
+ }
1259
+ #expanded = (i(this, "expanded"), void 0);
1260
+ static {
1261
+ g(this.prototype, "interacting", [tracked], function () {
1262
+ return false;
1263
+ });
1264
+ }
1265
+ #interacting = (i(this, "interacting"), void 0);
1266
+ static {
1267
+ g(this.prototype, "documentHidden", [tracked], function () {
1268
+ return !isUndefined(globalThis.document) && globalThis.document.hidden;
1269
+ });
1270
+ }
1271
+ #documentHidden = (i(this, "documentHidden"), void 0);
1272
+ static {
1273
+ g(this.prototype, "systemDark", [tracked], function () {
1274
+ return prefersDark();
1275
+ });
1276
+ }
1277
+ #systemDark = (i(this, "systemDark"), void 0);
1278
+ #section;
1279
+ /** The newest list, which the hotkey focuses (sonner's `listRef`). */
1280
+ #list;
1281
+ #lists = new Set();
1282
+ #lastFocused = null;
1283
+ #focusWithin = false;
1284
+ /** Focus in a list came from the keyboard, which holds the stack open until it leaves. */
1285
+ #keyboardFocus = false;
1286
+ /** A pointer went down on a list since the last key press: the focus that follows is its. */
1287
+ #pressed = false;
1288
+ #hovered = false;
1289
+ /** Toasts already shown, so a new one can raise its list above layers opened since. */
1290
+ #seen = new Set();
1291
+ constructor(owner, args) {
1292
+ super(owner, args);
1293
+ registerDestructor(this, bindToasts(owner));
1294
+ // Rendered on the server (FastBoot), there is no document to listen to.
1295
+ if (isUndefined(globalThis.document)) return;
1296
+ const onKeyDown = event => this.#onKeyDown(event);
1297
+ const onVisibility = () => this.documentHidden = document.hidden;
1298
+ document.addEventListener('keydown', onKeyDown);
1299
+ document.addEventListener('visibilitychange', onVisibility);
1300
+ const query = isFunction(globalThis.matchMedia) ? globalThis.matchMedia('(prefers-color-scheme: dark)') : undefined;
1301
+ const onScheme = event => this.systemDark = event.matches;
1302
+ query?.addEventListener('change', onScheme);
1303
+ registerDestructor(this, () => {
1304
+ document.removeEventListener('keydown', onKeyDown);
1305
+ document.removeEventListener('visibilitychange', onVisibility);
1306
+ query?.removeEventListener('change', onScheme);
1307
+ });
1308
+ }
1309
+ get store() {
1310
+ return toastsFor(this);
1311
+ }
1312
+ /** The toasts this Toaster shows: those for its `@id`, or those without a `toasterId`. */
1313
+ get toasts() {
1314
+ const {
1315
+ id
1316
+ } = this.args;
1317
+ const all = this.store.toasts;
1318
+ return id ? all.filter(toast => toast.toasterId === id) : all.filter(toast => !toast.toasterId);
1319
+ }
1320
+ get position() {
1321
+ return this.args.position ?? 'bottom-right';
1322
+ }
1323
+ /** Its own position, then each other position a toast asked for. */
1324
+ get positions() {
1325
+ const own = this.toasts.map(toast => toast.position).filter(Boolean);
1326
+ return [...new Set([this.position, ...own])];
1327
+ }
1328
+ get theme() {
1329
+ const theme = this.args.theme ?? 'light';
1330
+ if (theme !== 'system') return theme;
1331
+ return this.systemDark ? 'dark' : 'light';
1332
+ }
1333
+ get hotkey() {
1334
+ return this.args.hotkey ?? ['altKey', 'KeyT'];
1335
+ }
1336
+ get label() {
1337
+ const hotkey = this.hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');
1338
+ const label = this.args.containerAriaLabel;
1339
+ return label !== undefined ? `${label} ${hotkey}` : translate(this, messages.toasterLabel, {
1340
+ hotkey
1341
+ });
1342
+ }
1343
+ get dir() {
1344
+ const dir = this.args.dir;
1345
+ return dir === 'ltr' || dir === 'rtl' ? dir : getDirection(this.#section ?? null);
1346
+ }
1347
+ get gap() {
1348
+ return this.args.gap ?? GAP;
1349
+ }
1350
+ get visibleToasts() {
1351
+ return this.args.visibleToasts ?? VISIBLE_TOASTS_AMOUNT;
1352
+ }
1353
+ get closeButton() {
1354
+ return this.args.toastOptions?.closeButton ?? this.args.closeButton;
1355
+ }
1356
+ get duration() {
1357
+ return this.args.toastOptions?.duration ?? this.args.duration;
1358
+ }
1359
+ get listStyles() {
1360
+ return {
1361
+ '--front-toast-height': `${this.heights[0]?.height || 0}px`,
1362
+ '--width': `${TOAST_WIDTH}px`,
1363
+ '--gap': `${this.gap}px`,
1364
+ ...this.args.style,
1365
+ ...offsetStyles(this.args.offset, this.args.mobileOffset)
1366
+ };
1367
+ }
1368
+ /** The toasts in one position's list: those asking for it, and, in the first, the rest. */
1369
+ toastsAt = (position, index) => this.toasts.filter(toast => !toast.position && index === 0 || toast.position === position);
1370
+ /** The toasts a toast stacks with: those that asked for the same position, or none. */
1371
+ stackOf = toast => this.toasts.filter(each => each.position === toast.position).length;
1372
+ heightsOf = toast => this.heights.filter(height => height.position === toast.position);
1373
+ y = yOf;
1374
+ x = xOf;
1375
+ /**
1376
+ * Updates the toasts' heights, kept newest first, as the toasts are: sonner's order, which
1377
+ * is the order its toasts mount in, one at a time. Toasts made together mount together here.
1378
+ */
1379
+ setHeights(update) {
1380
+ if (isDestroying(this) || isDestroyed(this)) return;
1381
+ const order = new Map(this.store.toasts.map((toast, index) => [toast.id, index]));
1382
+ const rank = height => order.get(height.toastId) ?? Infinity;
1383
+ this.heights = [...update(this.heights)].sort((a, b) => rank(a) - rank(b));
1384
+ }
1385
+ removeToast(toast) {
1386
+ if (isDestroying(this) || isDestroyed(this)) return;
1387
+ this.store.remove(toast);
1388
+ }
1389
+ #onKeyDown(event) {
1390
+ this.#pressed = false;
1391
+ const pressed = this.hotkey.every(key => event[key] || event.code === key);
1392
+ if (pressed) {
1393
+ this.expanded = true;
1394
+ this.#list?.focus();
1395
+ }
1396
+ const active = document.activeElement;
1397
+ if ((event.key === 'Escape' || event.code === 'Escape') && this.#list && (active === this.#list || this.#list.contains(active))) {
1398
+ this.expanded = false;
1399
+ }
1400
+ }
1401
+ /** Remembers the section, so the lists take the direction where the Toaster is. */
1402
+ section = modifier(element => {
1403
+ this.#section = element;
1404
+ });
1405
+ /**
1406
+ * Keeps the stack collapsed once one toast or none is left (sonner's effect on its toasts).
1407
+ */
1408
+ watch = modifier((_element, [toasts]) => {
1409
+ if (toasts.length <= 1) {
1410
+ queueMicrotask(() => {
1411
+ if (!isDestroying(this) && !isDestroyed(this)) this.expanded = false;
1412
+ });
1413
+ }
1414
+ });
1415
+ /** A list: the newest is the one the hotkey focuses (sonner's `listRef`). */
1416
+ listRef = modifier(element => {
1417
+ this.#list = element;
1418
+ this.#lists.add(element);
1419
+ return () => {
1420
+ this.#lists.delete(element);
1421
+ if (this.#list === element) this.#list = [...this.#lists].at(-1);
1422
+ if (this.#lists.size) return;
1423
+ // The last list is going: give focus back, as sonner does when its list unmounts.
1424
+ const last = this.#lastFocused;
1425
+ this.#lastFocused = null;
1426
+ this.#focusWithin = false;
1427
+ this.#keyboardFocus = false;
1428
+ last?.focus({
1429
+ preventScroll: true
1430
+ });
1431
+ };
1432
+ });
1433
+ /**
1434
+ * When a toast arrives that a list hasn't shown, moves the list to the top of the top layer,
1435
+ * above any dialog or popover opened since it was shown, unless focus is in it.
1436
+ */
1437
+ raise = modifier((element, [toasts]) => {
1438
+ const fresh = toasts.some(toast => !this.#seen.has(toast.id));
1439
+ for (const toast of toasts) this.#seen.add(toast.id);
1440
+ if (!fresh || element.contains(document.activeElement)) return;
1441
+ queueMicrotask(() => {
1442
+ const popover = element;
1443
+ if (!element.isConnected || !element.matches(':popover-open')) return;
1444
+ try {
1445
+ popover.hidePopover();
1446
+ popover.showPopover();
1447
+ } catch {
1448
+ // gone, or shown by someone else
1449
+ }
1450
+ });
1451
+ });
1452
+ onFocusIn = event => {
1453
+ const target = event.target;
1454
+ if (target instanceof HTMLElement && target.dataset['dismissible'] === 'false') return;
1455
+ if (!this.#focusWithin) {
1456
+ this.#focusWithin = true;
1457
+ this.#lastFocused = event.relatedTarget;
1458
+ }
1459
+ // Joinery: focus from the keyboard (tabbing, the hotkey) expands the stack and pauses the
1460
+ // timers, as hovering does, until it leaves the list. sonner's doesn't. A click or a tap on
1461
+ // a toast also focuses it, but that focus holds nothing: the pointer leaving collapses the
1462
+ // stack and the timers run again, as in sonner.
1463
+ this.#keyboardFocus = !this.#pressed && focusVisible(target);
1464
+ if (this.#keyboardFocus) this.expanded = true;
1465
+ };
1466
+ onFocusOut = event => {
1467
+ const list = event.currentTarget;
1468
+ if (this.#focusWithin && !list.contains(event.relatedTarget)) {
1469
+ this.#focusWithin = false;
1470
+ this.#keyboardFocus = false;
1471
+ if (!this.#hovered && !this.interacting) this.expanded = false;
1472
+ const last = this.#lastFocused;
1473
+ this.#lastFocused = null;
1474
+ last?.focus({
1475
+ preventScroll: true
1476
+ });
1477
+ }
1478
+ };
1479
+ onMouseEnter = () => {
1480
+ this.#hovered = true;
1481
+ this.expanded = true;
1482
+ };
1483
+ onMouseMove = () => {
1484
+ if (!this.expanded) this.expanded = true;
1485
+ };
1486
+ onMouseLeave = () => {
1487
+ this.#hovered = false;
1488
+ // Not while a toast is being pressed or swiped, or the keyboard's focus is in the list.
1489
+ if (!this.interacting && !this.#keyboardFocus) this.expanded = false;
1490
+ };
1491
+ onDragEnd = () => {
1492
+ this.expanded = false;
1493
+ };
1494
+ onPointerDown = event => {
1495
+ this.#pressed = true;
1496
+ const target = event.target;
1497
+ if (target instanceof HTMLElement && target.dataset['dismissible'] === 'false') return;
1498
+ this.interacting = true;
1499
+ };
1500
+ onPointerUp = () => {
1501
+ this.interacting = false;
1502
+ };
1503
+ static {
1504
+ setComponentTemplate(precompileTemplate("<section aria-label={{this.label}} tabindex=\"-1\" aria-live=\"polite\" aria-relevant=\"additions text\" aria-atomic=\"false\" data-test-jn=\"toaster\" data-test-jn-name={{@name}} {{this.section}} {{this.watch this.toasts}}>\n {{#if this.toasts.length}}\n {{#each this.positions key=\"@identity\" as |position index|}}\n {{#let (this.toastsAt position index) as |toasts|}}\n <ol dir={{this.dir}} tabindex=\"-1\" data-sonner-toaster=\"true\" data-sonner-theme={{this.theme}} data-y-position={{this.y position}} data-x-position={{this.x position}} data-test-jn-part=\"list\" data-test-jn-value={{position}} {{styles this.listStyles}} {{topLayer}} {{dismissableBranch}} {{this.listRef}} {{this.raise toasts}} {{on \"focusin\" this.onFocusIn}} {{on \"focusout\" this.onFocusOut}} {{on \"mouseenter\" this.onMouseEnter}} {{on \"mousemove\" this.onMouseMove}} {{on \"mouseleave\" this.onMouseLeave}} {{on \"dragend\" this.onDragEnd}} {{on \"pointerdown\" this.onPointerDown}} {{on \"pointerup\" this.onPointerUp}} ...attributes>\n {{#each toasts key=\"id\" as |toast toastIndex|}}\n <ToastItem @toast={{toast}} @index={{toastIndex}} @count={{this.stackOf toast}} @heights={{this.heightsOf toast}} @host={{this}} @position={{position}} @expanded={{this.expanded}} @interacting={{this.interacting}} @documentHidden={{this.documentHidden}} @gap={{this.gap}} @visibleToasts={{this.visibleToasts}} @expandByDefault={{if @expand true false}} @invert={{@invert}} @richColors={{@richColors}} @closeButton={{this.closeButton}} @duration={{this.duration}} @className={{@toastOptions.className}} @descriptionClassName={{@toastOptions.descriptionClassName}} @classNames={{@toastOptions.classNames}} @style={{@toastOptions.style}} @unstyled={{@toastOptions.unstyled}} @cancelButtonStyle={{@toastOptions.cancelButtonStyle}} @actionButtonStyle={{@toastOptions.actionButtonStyle}} @closeButtonAriaLabel={{@toastOptions.closeButtonAriaLabel}} @icons={{@icons}} @swipeDirections={{@swipeDirections}} />\n {{/each}}\n </ol>\n {{/let}}\n {{/each}}\n {{/if}}\n</section>", {
1505
+ strictMode: true,
1506
+ scope: () => ({
1507
+ styles,
1508
+ topLayer,
1509
+ dismissableBranch,
1510
+ on,
1511
+ ToastItem
1512
+ })
1513
+ }), this);
1514
+ }
1515
+ }
1516
+
1517
+ export { SWIPE_THRESHOLD as S, TIME_BEFORE_UNMOUNT as T, TOAST_LIFETIME as a, Toaster as b, Toasts as c, bindToasts as d, toastOwner as e, toastsFor as f, toast as t };
1518
+ //# sourceMappingURL=toaster-DwprFZ1J.js.map