@arc-ui/components 12.0.0-beta.6 → 12.0.0-beta.9

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 (381) hide show
  1. package/dist/Alert/Alert.cjs.js +4 -4
  2. package/dist/Alert/Alert.esm.js +4 -4
  3. package/dist/Alert/styles.css +1 -1
  4. package/dist/Align/Align.cjs.js +1 -1
  5. package/dist/Align/Align.esm.js +1 -1
  6. package/dist/AppButton/AppButton.cjs.js +2 -2
  7. package/dist/AppButton/AppButton.esm.js +2 -2
  8. package/dist/Avatar/Avatar.cjs.js +6 -6
  9. package/dist/Avatar/Avatar.esm.js +6 -6
  10. package/dist/AvatarGroup/AvatarGroup.cjs.js +6 -6
  11. package/dist/AvatarGroup/AvatarGroup.esm.js +6 -6
  12. package/dist/Badge/Badge.cjs.js +5 -12
  13. package/dist/Badge/Badge.esm.js +4 -11
  14. package/dist/Banner/Banner.cjs.js +21 -0
  15. package/dist/Banner/Banner.esm.js +13 -0
  16. package/dist/Banner/package.json +7 -0
  17. package/dist/Banner/styles.css +1 -0
  18. package/dist/BannerWithTabs/BannerWithTabs.cjs.js +62 -0
  19. package/dist/BannerWithTabs/BannerWithTabs.esm.js +54 -0
  20. package/dist/BannerWithTabs/package.json +7 -0
  21. package/dist/BannerWithTabs/styles.css +1 -0
  22. package/dist/Box/Box.cjs.js +6 -24
  23. package/dist/Box/Box.esm.js +5 -23
  24. package/dist/Box/styles.css +1 -1
  25. package/dist/BrandLogo/BrandLogo.cjs.js +3 -3
  26. package/dist/BrandLogo/BrandLogo.esm.js +3 -3
  27. package/dist/BrandLogo/styles.css +1 -1
  28. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +5 -4
  29. package/dist/Breadcrumbs/Breadcrumbs.esm.js +5 -4
  30. package/dist/Breadcrumbs/styles.css +1 -1
  31. package/dist/Button/Button.cjs.js +5 -5
  32. package/dist/Button/Button.esm.js +5 -5
  33. package/dist/Button/styles.css +1 -1
  34. package/dist/ButtonV2/ButtonV2.cjs.js +5 -5
  35. package/dist/ButtonV2/ButtonV2.esm.js +5 -5
  36. package/dist/ButtonV2/styles.css +1 -1
  37. package/dist/Calendar/Calendar.cjs.js +8 -8
  38. package/dist/Calendar/Calendar.esm.js +8 -8
  39. package/dist/Calendar/styles.css +1 -1
  40. package/dist/CardFooter/CardFooter.cjs.js +4 -4
  41. package/dist/CardFooter/CardFooter.esm.js +4 -4
  42. package/dist/CardFooter/styles.css +1 -1
  43. package/dist/CardHeading/CardHeading.cjs.js +4 -4
  44. package/dist/CardHeading/CardHeading.esm.js +4 -4
  45. package/dist/Carousel/Carousel.cjs.js +1921 -0
  46. package/dist/Carousel/Carousel.esm.js +1913 -0
  47. package/dist/Carousel/package.json +7 -0
  48. package/dist/Carousel/styles.css +1 -0
  49. package/dist/Checkbox/Checkbox.cjs.js +8 -8
  50. package/dist/Checkbox/Checkbox.esm.js +8 -8
  51. package/dist/Checkbox/styles.css +1 -1
  52. package/dist/Columns/Columns.cjs.js +2 -2
  53. package/dist/Columns/Columns.esm.js +2 -2
  54. package/dist/ContentSwitcher/ContentSwitcher.cjs.js +20 -0
  55. package/dist/ContentSwitcher/ContentSwitcher.esm.js +12 -0
  56. package/dist/ContentSwitcher/package.json +7 -0
  57. package/dist/ContentSwitcher/styles.css +1 -0
  58. package/dist/ContentSwitcherDropdown/ContentSwitcherDropdown.cjs.js +23 -0
  59. package/dist/ContentSwitcherDropdown/ContentSwitcherDropdown.esm.js +15 -0
  60. package/dist/ContentSwitcherDropdown/package.json +7 -0
  61. package/dist/ContentSwitcherDropdown/styles.css +1 -0
  62. package/dist/DatePicker/DatePicker.cjs.js +15 -15
  63. package/dist/DatePicker/DatePicker.esm.js +15 -15
  64. package/dist/Disclosure/Disclosure.cjs.js +4 -4
  65. package/dist/Disclosure/Disclosure.esm.js +4 -4
  66. package/dist/Disclosure/styles.css +1 -1
  67. package/dist/DisclosureMini/DisclosureMini.cjs.js +5 -5
  68. package/dist/DisclosureMini/DisclosureMini.esm.js +5 -5
  69. package/dist/Download/Download.cjs.js +16 -0
  70. package/dist/Download/Download.esm.js +8 -0
  71. package/dist/Download/package.json +7 -0
  72. package/dist/Download/styles.css +1 -0
  73. package/dist/Elevation/Elevation.cjs.js +1 -1
  74. package/dist/Elevation/Elevation.esm.js +1 -1
  75. package/dist/Elevation/styles.css +1 -1
  76. package/dist/Filter/Filter.cjs.js +4 -4
  77. package/dist/Filter/Filter.esm.js +4 -4
  78. package/dist/FormControl/FormControl.cjs.js +7 -7
  79. package/dist/FormControl/FormControl.esm.js +7 -7
  80. package/dist/Grid/Grid.cjs.js +2 -2
  81. package/dist/Grid/Grid.esm.js +2 -2
  82. package/dist/Grid/styles.css +1 -1
  83. package/dist/Group/Group.cjs.js +3 -3
  84. package/dist/Group/Group.esm.js +3 -3
  85. package/dist/Heading/Heading.cjs.js +3 -3
  86. package/dist/Heading/Heading.esm.js +3 -3
  87. package/dist/Heading/styles.css +1 -1
  88. package/dist/HeroBanner/HeroBanner.cjs.js +28 -0
  89. package/dist/HeroBanner/HeroBanner.esm.js +20 -0
  90. package/dist/HeroBanner/package.json +7 -0
  91. package/dist/HeroButton/HeroButton.cjs.js +5 -5
  92. package/dist/HeroButton/HeroButton.esm.js +5 -5
  93. package/dist/HeroButton/styles.css +1 -1
  94. package/dist/Hidden/Hidden.cjs.js +1 -1
  95. package/dist/Hidden/Hidden.esm.js +1 -1
  96. package/dist/Icon/Icon.cjs.js +3 -3
  97. package/dist/Icon/Icon.esm.js +3 -3
  98. package/dist/Image/Image.cjs.js +2 -2
  99. package/dist/Image/Image.esm.js +2 -2
  100. package/dist/ImpactCard/ImpactCard.cjs.js +8 -9
  101. package/dist/ImpactCard/ImpactCard.esm.js +8 -9
  102. package/dist/ImpactCard/styles.css +1 -1
  103. package/dist/InformationCard/InformationCard.cjs.js +33 -47
  104. package/dist/InformationCard/InformationCard.esm.js +33 -47
  105. package/dist/InformationCard/styles.css +1 -1
  106. package/dist/Link/Link.cjs.js +4 -4
  107. package/dist/Link/Link.esm.js +4 -4
  108. package/dist/Link/styles.css +1 -1
  109. package/dist/Markup/Markup.cjs.js +2 -2
  110. package/dist/Markup/Markup.esm.js +2 -2
  111. package/dist/MediaCard/MediaCard.cjs.js +11 -11
  112. package/dist/MediaCard/MediaCard.esm.js +11 -11
  113. package/dist/MediaCard/styles.css +1 -1
  114. package/dist/Modal/Modal.cjs.js +11 -11
  115. package/dist/Modal/Modal.esm.js +11 -11
  116. package/dist/PageBanner/PageBanner.cjs.js +28 -0
  117. package/dist/PageBanner/PageBanner.esm.js +20 -0
  118. package/dist/PageBanner/package.json +7 -0
  119. package/dist/Pagination/Pagination.cjs.js +3 -3
  120. package/dist/Pagination/Pagination.esm.js +3 -3
  121. package/dist/PaginationSimple/PaginationSimple.cjs.js +82 -13
  122. package/dist/PaginationSimple/PaginationSimple.esm.js +82 -13
  123. package/dist/PaginationSimple/styles.css +1 -1
  124. package/dist/Poster/Poster.cjs.js +4 -4
  125. package/dist/Poster/Poster.esm.js +4 -4
  126. package/dist/ProgressBar/ProgressBar.cjs.js +6 -6
  127. package/dist/ProgressBar/ProgressBar.esm.js +6 -6
  128. package/dist/ProgressStepper/ProgressStepper.cjs.js +5 -5
  129. package/dist/ProgressStepper/ProgressStepper.esm.js +5 -5
  130. package/dist/ProgressStepper/styles.css +1 -1
  131. package/dist/RadioGroup/RadioGroup.cjs.js +8 -8
  132. package/dist/RadioGroup/RadioGroup.esm.js +8 -8
  133. package/dist/RadioGroup/styles.css +1 -1
  134. package/dist/Rule/Rule.cjs.js +2 -2
  135. package/dist/Rule/Rule.esm.js +2 -2
  136. package/dist/Rule/styles.css +1 -1
  137. package/dist/ScrollToTop/ScrollToTop.cjs.js +21 -4
  138. package/dist/ScrollToTop/ScrollToTop.esm.js +21 -4
  139. package/dist/ScrollToTop/styles.css +1 -1
  140. package/dist/Section/Section.cjs.js +2 -2
  141. package/dist/Section/Section.esm.js +2 -2
  142. package/dist/Select/Select.cjs.js +29 -2204
  143. package/dist/Select/Select.esm.js +17 -2173
  144. package/dist/Select/styles.css +1 -1
  145. package/dist/SiteFooter/SiteFooter.cjs.js +7 -7
  146. package/dist/SiteFooter/SiteFooter.esm.js +7 -7
  147. package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +10 -9
  148. package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +10 -9
  149. package/dist/SiteHeaderV2/styles.css +1 -1
  150. package/dist/SkipLink/SkipLink.cjs.js +1 -1
  151. package/dist/SkipLink/SkipLink.esm.js +1 -1
  152. package/dist/Spinner/Spinner.cjs.js +12 -0
  153. package/dist/Spinner/Spinner.esm.js +4 -0
  154. package/dist/Spinner/package.json +7 -0
  155. package/dist/Spinner/styles.css +1 -0
  156. package/dist/Surface/Surface.cjs.js +2 -2
  157. package/dist/Surface/Surface.esm.js +2 -2
  158. package/dist/Surface/styles.css +1 -1
  159. package/dist/Switch/Switch.cjs.js +10 -10
  160. package/dist/Switch/Switch.esm.js +10 -10
  161. package/dist/Switch/styles.css +1 -1
  162. package/dist/Tabs/Tabs.cjs.js +9 -9
  163. package/dist/Tabs/Tabs.esm.js +9 -9
  164. package/dist/Tabs/styles.css +1 -1
  165. package/dist/Tag/Tag.cjs.js +77 -8
  166. package/dist/Tag/Tag.esm.js +76 -7
  167. package/dist/Tag/styles.css +1 -1
  168. package/dist/Text/Text.cjs.js +3 -3
  169. package/dist/Text/Text.esm.js +3 -3
  170. package/dist/TextArea/TextArea.cjs.js +53 -47
  171. package/dist/TextArea/TextArea.esm.js +53 -47
  172. package/dist/TextInput/TextInput.cjs.js +8 -9
  173. package/dist/TextInput/TextInput.esm.js +8 -9
  174. package/dist/Theme/Theme.cjs.js +5 -4
  175. package/dist/Theme/Theme.esm.js +5 -4
  176. package/dist/Theme/styles.css +1 -1
  177. package/dist/ThemeIcon/ThemeIcon.cjs.js +3 -3
  178. package/dist/ThemeIcon/ThemeIcon.esm.js +3 -3
  179. package/dist/ThemeIcon/styles.css +1 -1
  180. package/dist/Toast/Toast.cjs.js +8 -8
  181. package/dist/Toast/Toast.esm.js +8 -8
  182. package/dist/Toast/styles.css +1 -1
  183. package/dist/Truncate/Truncate.cjs.js +3 -3
  184. package/dist/Truncate/Truncate.esm.js +3 -3
  185. package/dist/TypographyCard/TypographyCard.cjs.js +7 -8
  186. package/dist/TypographyCard/TypographyCard.esm.js +7 -8
  187. package/dist/TypographyCard/styles.css +1 -1
  188. package/dist/UniversalHeader/UniversalHeader.cjs.js +3 -3
  189. package/dist/UniversalHeader/UniversalHeader.esm.js +3 -3
  190. package/dist/VerticalSpace/VerticalSpace.cjs.js +2 -2
  191. package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
  192. package/dist/VerticalSpace/styles.css +1 -1
  193. package/dist/VideoPlayer/VideoPlayer.cjs.js +36 -23
  194. package/dist/VideoPlayer/VideoPlayer.esm.js +36 -23
  195. package/dist/VideoPlayer/styles.css +1 -1
  196. package/dist/Visible/Visible.cjs.js +1 -1
  197. package/dist/Visible/Visible.esm.js +1 -1
  198. package/dist/VisuallyHidden/VisuallyHidden.cjs.js +2 -2
  199. package/dist/VisuallyHidden/VisuallyHidden.esm.js +2 -2
  200. package/dist/VisuallyHidden/styles.css +1 -1
  201. package/dist/_shared/cjs/{Avatar-9277512a.js → Avatar-a3b9f474.js} +4 -4
  202. package/dist/_shared/cjs/Badge-e9ad6e2a.js +17 -0
  203. package/dist/_shared/cjs/Banner-a785d73f.js +66 -0
  204. package/dist/_shared/cjs/Box-082962b9.js +29 -0
  205. package/dist/_shared/cjs/{BrandLogo-ce65cd74.js → BrandLogo-78d3095b.js} +2 -2
  206. package/dist/_shared/cjs/{Breadcrumbs-c7821aa9.js → Breadcrumbs-83b30371.js} +5 -4
  207. package/dist/_shared/cjs/BtIconChevronRight2Px.esm-2e4d117e.js +44 -0
  208. package/dist/_shared/cjs/{Button-ea665c9c.js → Button-e6217128.js} +4 -4
  209. package/dist/_shared/cjs/{ButtonV2-373877da.js → ButtonV2-2640e91a.js} +13 -8
  210. package/dist/_shared/cjs/{Calendar-e5184158.js → Calendar-4284f52b.js} +8 -8
  211. package/dist/_shared/cjs/{CardFooter-a1bb3ded.js → CardFooter-24b10ae4.js} +3 -3
  212. package/dist/_shared/cjs/{CardHeading-3ddcf774.js → CardHeading-0e9d9f86.js} +2 -2
  213. package/dist/_shared/cjs/{Checkbox-850dcf99.js → Checkbox-2cd69440.js} +12 -7
  214. package/dist/_shared/cjs/{Columns-5c6bab74.js → Columns-a8b736af.js} +1 -1
  215. package/dist/_shared/cjs/{Combination-854a36ce.js → Combination-091f3e34.js} +2 -2
  216. package/dist/_shared/cjs/ContentSwitcher-10398581.js +99 -0
  217. package/dist/_shared/cjs/ContentSwitcherDropdown-27d08a2f.js +64 -0
  218. package/dist/_shared/cjs/{DatePicker-2bf10a10.js → DatePicker-da6d276c.js} +6 -23
  219. package/dist/_shared/cjs/{DisclosureMini-c730c24d.js → DisclosureMini-661f0868.js} +4 -4
  220. package/dist/_shared/cjs/Download-60af8fe1.js +43 -0
  221. package/dist/_shared/cjs/{Filter-c42eee70.js → Filter-791d6d7a.js} +3 -3
  222. package/dist/_shared/cjs/{FormControl-5c963e6e.js → FormControl-9ab9e656.js} +5 -5
  223. package/dist/_shared/cjs/{Grid-69ed0e5c.js → Grid-bf7d8993.js} +1 -1
  224. package/dist/_shared/cjs/{Group-5233a907.js → Group-d94b74ac.js} +2 -2
  225. package/dist/_shared/cjs/{Heading-14378b72.js → Heading-dc6acee1.js} +5 -4
  226. package/dist/_shared/cjs/{HeroButton-db7d03d6.js → HeroButton-17400782.js} +6 -6
  227. package/dist/_shared/cjs/{Icon-7f1e8a19.js → Icon-cbf91a21.js} +16 -5
  228. package/dist/_shared/cjs/{Image-c8969ad9.js → Image-b83fa185.js} +1 -1
  229. package/dist/_shared/cjs/{MediaCard-4ff9f5c0.js → MediaCard-976046b7.js} +9 -9
  230. package/dist/_shared/cjs/{Poster-8fba5492.js → Poster-7c69a1e8.js} +3 -3
  231. package/dist/_shared/cjs/{ProgressStepper-aaff6b51.js → ProgressStepper-9d18e458.js} +8 -32
  232. package/dist/_shared/cjs/{RadioGroup-6142dceb.js → RadioGroup-4c9c7385.js} +4 -4
  233. package/dist/_shared/cjs/{Section-46646353.js → Section-6bda04f9.js} +1 -1
  234. package/dist/_shared/cjs/{SiteFooter-cfe7163f.js → SiteFooter-57e4e871.js} +6 -6
  235. package/dist/_shared/cjs/{SiteHeaderV2-043d976a.js → SiteHeaderV2-391c01d6.js} +15 -48
  236. package/dist/_shared/cjs/Spinner-3e4a2e61.js +24 -0
  237. package/dist/_shared/cjs/{Surface-7500f314.js → Surface-877d9fcc.js} +3 -2
  238. package/dist/_shared/cjs/Tabs-680a992e.js +90 -0
  239. package/dist/_shared/cjs/{Text-284a7314.js → Text-0d5891fc.js} +5 -4
  240. package/dist/_shared/cjs/{TextInput-bcc3f86c.js → TextInput-03995fb3.js} +6 -6
  241. package/dist/_shared/cjs/{ThemeIcon-c3dc056d.js → ThemeIcon-e7a68823.js} +2 -2
  242. package/dist/_shared/cjs/{Toast-69020185.js → Toast-d981b0a4.js} +6 -6
  243. package/dist/_shared/cjs/{UniversalHeader-07be88fd.js → UniversalHeader-3bf27194.js} +2 -2
  244. package/dist/_shared/cjs/{VerticalSpace-973deefe.js → VerticalSpace-14714d0f.js} +5 -5
  245. package/dist/_shared/cjs/{VisuallyHidden-25393f58.js → VisuallyHidden-82a60021.js} +1 -1
  246. package/dist/_shared/cjs/{component-4e71e3d3.js → component-dc16a7a5.js} +1 -1
  247. package/dist/_shared/cjs/{Tabs-bd1f208d.js → index-1e7a1fce.js} +8 -92
  248. package/dist/_shared/cjs/{index-6cbaf5e0.js → index-2bf59363.js} +1 -1
  249. package/dist/_shared/cjs/{index-dbab0ad6.js → index-527f962b.js} +1 -1
  250. package/dist/_shared/cjs/index-605c76b9.js +2204 -0
  251. package/dist/_shared/cjs/{index-568bc1da.js → index-879e71ee.js} +7 -7
  252. package/dist/_shared/cjs/{index-c137700a.js → index-ba3141f5.js} +1 -1
  253. package/dist/_shared/cjs/{index-677557a4.js → index-dbc843d3.js} +1 -1
  254. package/dist/_shared/cjs/index.es-b98bcd00.js +355 -0
  255. package/dist/_shared/cjs/{index.es-ba095ee5.js → index.es-d99844c0.js} +2 -2
  256. package/dist/_shared/esm/{Avatar-b5ac0a89.js → Avatar-cea3993d.js} +4 -4
  257. package/dist/_shared/esm/Badge-233eb171.js +11 -0
  258. package/dist/_shared/esm/Banner-ad242982.js +60 -0
  259. package/dist/_shared/esm/Box-aa4f3782.js +23 -0
  260. package/dist/_shared/esm/{BrandLogo-fb863b5b.js → BrandLogo-1ee6f128.js} +2 -2
  261. package/dist/_shared/esm/{Breadcrumbs-01ebed9b.js → Breadcrumbs-1e5f8ab3.js} +5 -4
  262. package/dist/_shared/esm/BtIconChevronRight2Px.esm-c939e317.js +37 -0
  263. package/dist/_shared/esm/{Button-1491784f.js → Button-ea676157.js} +4 -4
  264. package/dist/_shared/esm/{ButtonV2-f9019e00.js → ButtonV2-feb9bcbc.js} +13 -8
  265. package/dist/_shared/esm/{Calendar-5c2fb044.js → Calendar-2bbb4ad5.js} +8 -8
  266. package/dist/_shared/esm/{CardFooter-e4380cda.js → CardFooter-c1c75258.js} +3 -3
  267. package/dist/_shared/esm/{CardHeading-4223432d.js → CardHeading-394596ee.js} +2 -2
  268. package/dist/_shared/esm/{Checkbox-97def257.js → Checkbox-5c954576.js} +12 -7
  269. package/dist/_shared/esm/{Columns-9aa5df4a.js → Columns-61fccabf.js} +1 -1
  270. package/dist/_shared/esm/{Combination-2af75870.js → Combination-beb0370c.js} +2 -2
  271. package/dist/_shared/esm/ContentSwitcher-351ae1a6.js +93 -0
  272. package/dist/_shared/esm/ContentSwitcherDropdown-c5531690.js +58 -0
  273. package/dist/_shared/esm/{DatePicker-2d891441.js → DatePicker-a8e63fb1.js} +6 -23
  274. package/dist/_shared/esm/{DisclosureMini-6292f721.js → DisclosureMini-2d3bad0c.js} +4 -4
  275. package/dist/_shared/esm/Download-064c08ba.js +37 -0
  276. package/dist/_shared/esm/{Filter-71e06965.js → Filter-4519aab6.js} +3 -3
  277. package/dist/_shared/esm/{FormControl-e0acdf7a.js → FormControl-85a2ee28.js} +5 -5
  278. package/dist/_shared/esm/{Grid-727d05d6.js → Grid-3d8eaa8e.js} +1 -1
  279. package/dist/_shared/esm/{Group-b1b14ab4.js → Group-6d0c0d8e.js} +2 -2
  280. package/dist/_shared/esm/{Heading-0dfbdb24.js → Heading-db9014d5.js} +5 -4
  281. package/dist/_shared/esm/{HeroButton-bb983125.js → HeroButton-eb08293f.js} +6 -6
  282. package/dist/_shared/esm/{Icon-428e8061.js → Icon-e85f55ee.js} +16 -5
  283. package/dist/_shared/esm/{Image-c1dc10b5.js → Image-67ec95a0.js} +1 -1
  284. package/dist/_shared/esm/{MediaCard-d83b5561.js → MediaCard-4a845195.js} +9 -9
  285. package/dist/_shared/esm/{Poster-ac72059a.js → Poster-182a3dbf.js} +3 -3
  286. package/dist/_shared/esm/{ProgressStepper-e3e7b392.js → ProgressStepper-e1c297b4.js} +8 -32
  287. package/dist/_shared/esm/{RadioGroup-0d337240.js → RadioGroup-0daeae68.js} +4 -4
  288. package/dist/_shared/esm/{Section-c1dc6e37.js → Section-08f47911.js} +1 -1
  289. package/dist/_shared/esm/{SiteFooter-7e924fb4.js → SiteFooter-704fa8e5.js} +6 -6
  290. package/dist/_shared/esm/{SiteHeaderV2-94b9a407.js → SiteHeaderV2-2b0d6f96.js} +8 -41
  291. package/dist/_shared/esm/Spinner-6493dd54.js +18 -0
  292. package/dist/_shared/esm/{Surface-c425e5e6.js → Surface-b782cda9.js} +3 -2
  293. package/dist/_shared/esm/Tabs-321fa50e.js +84 -0
  294. package/dist/_shared/esm/{Text-96d8a35f.js → Text-d0acd173.js} +5 -4
  295. package/dist/_shared/esm/{TextInput-8e3b81bf.js → TextInput-211dbadb.js} +6 -6
  296. package/dist/_shared/esm/{ThemeIcon-9fac63d0.js → ThemeIcon-0b755b19.js} +2 -2
  297. package/dist/_shared/esm/{Toast-ebe2cd97.js → Toast-bd78be64.js} +6 -6
  298. package/dist/_shared/esm/{UniversalHeader-22ff848b.js → UniversalHeader-4907dbf4.js} +2 -2
  299. package/dist/_shared/esm/{VerticalSpace-6a3533db.js → VerticalSpace-6d8fcb17.js} +5 -5
  300. package/dist/_shared/esm/{VisuallyHidden-cf45ac18.js → VisuallyHidden-605ea42d.js} +1 -1
  301. package/dist/_shared/esm/{component-3e60a45e.js → component-d81b583b.js} +1 -1
  302. package/dist/_shared/esm/{index-fb8b9df7.js → index-13458236.js} +8 -8
  303. package/dist/_shared/esm/{index-61497bd9.js → index-2403936c.js} +1 -1
  304. package/dist/_shared/esm/index-66e8d1ec.js +2169 -0
  305. package/dist/_shared/esm/{index-cf208294.js → index-6bdce6c5.js} +1 -1
  306. package/dist/_shared/esm/{index-d083425f.js → index-7868cc59.js} +1 -1
  307. package/dist/_shared/esm/{index-3a2c1ceb.js → index-7f23bb37.js} +10 -10
  308. package/dist/_shared/esm/{index-f6cc48d2.js → index-a41a5e50.js} +1 -1
  309. package/dist/_shared/esm/{Tabs-028cee5d.js → index-b051f161.js} +6 -89
  310. package/dist/_shared/esm/index.es-3b4ff2ab.js +348 -0
  311. package/dist/_shared/esm/{index.es-974af4a2.js → index.es-8ada4213.js} +2 -2
  312. package/dist/index.es.js +14385 -13888
  313. package/dist/index.es.js.map +1 -1
  314. package/dist/index.js +14071 -13567
  315. package/dist/index.js.map +1 -1
  316. package/dist/styles.css +9 -7
  317. package/dist/types/components/Avatar/index.d.ts +1 -1
  318. package/dist/types/components/Banner/Banner.d.ts +68 -0
  319. package/dist/types/components/Banner/index.d.ts +1 -0
  320. package/dist/types/components/BannerWithTabs/BannerWithTabs.d.ts +17 -0
  321. package/dist/types/components/BannerWithTabs/index.d.ts +1 -0
  322. package/dist/types/components/Box/Box.d.ts +4 -0
  323. package/dist/types/components/ButtonV2/ButtonV2.d.ts +2 -2
  324. package/dist/types/components/Carousel/Carousel.d.ts +34 -0
  325. package/dist/types/components/Carousel/components/DotButton.d.ts +10 -0
  326. package/dist/types/components/Carousel/constants/breakpoints.d.ts +5 -0
  327. package/dist/types/components/Carousel/helpers/get-options.d.ts +3 -0
  328. package/dist/types/components/Carousel/helpers/get-slide-width.d.ts +12 -0
  329. package/dist/types/components/Carousel/index.d.ts +1 -0
  330. package/dist/types/components/Carousel/types/breakpoints.d.ts +1 -0
  331. package/dist/types/components/Carousel/types/keynames.d.ts +5 -0
  332. package/dist/types/components/Carousel/types/responsive.d.ts +3 -0
  333. package/dist/types/components/Carousel/types/screen-sizes.d.ts +2 -0
  334. package/dist/types/components/Carousel/types/slide-config.d.ts +5 -0
  335. package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
  336. package/dist/types/components/ContentSwitcher/ContentSwitcher.d.ts +32 -0
  337. package/dist/types/components/ContentSwitcher/ContentSwitcherContent/ContentSwitcherContent.d.ts +12 -0
  338. package/dist/types/components/ContentSwitcher/ContentSwitcherContent/index.d.ts +1 -0
  339. package/dist/types/components/ContentSwitcher/ContentSwitcherList/ContentSwitcherList.d.ts +24 -0
  340. package/dist/types/components/ContentSwitcher/ContentSwitcherList/index.d.ts +1 -0
  341. package/dist/types/components/ContentSwitcher/ContentSwitcherTab/ContentSwitcherTab.d.ts +17 -0
  342. package/dist/types/components/ContentSwitcher/ContentSwitcherTab/index.d.ts +1 -0
  343. package/dist/types/components/ContentSwitcher/index.d.ts +1 -0
  344. package/dist/types/components/ContentSwitcherDropdown/ContentSwitcherDropdown.d.ts +57 -0
  345. package/dist/types/components/ContentSwitcherDropdown/index.d.ts +1 -0
  346. package/dist/types/components/Disclosure/index.d.ts +1 -1
  347. package/dist/types/components/Download/Download.d.ts +41 -0
  348. package/dist/types/components/Download/index.d.ts +1 -0
  349. package/dist/types/components/Heading/Heading.d.ts +4 -0
  350. package/dist/types/components/Heading/index.d.ts +1 -1
  351. package/dist/types/components/HeroBanner/HeroBanner.d.ts +5 -0
  352. package/dist/types/components/HeroBanner/index.d.ts +1 -0
  353. package/dist/types/components/Icon/Icon.d.ts +2 -2
  354. package/dist/types/components/ImpactCard/index.d.ts +1 -1
  355. package/dist/types/components/InformationCard/InformationCard.d.ts +2 -2
  356. package/dist/types/components/InformationCard/index.d.ts +1 -1
  357. package/dist/types/components/MediaCard/index.d.ts +1 -1
  358. package/dist/types/components/PageBanner/PageBanner.d.ts +5 -0
  359. package/dist/types/components/PageBanner/index.d.ts +1 -0
  360. package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +24 -16
  361. package/dist/types/components/Spinner/Spinner.d.ts +16 -0
  362. package/dist/types/components/Spinner/index.d.ts +1 -0
  363. package/dist/types/components/Surface/Surface.d.ts +4 -0
  364. package/dist/types/components/Tabs/TabsList/TabsList.d.ts +5 -0
  365. package/dist/types/components/Text/Text.d.ts +4 -0
  366. package/dist/types/components/TextInput/TextInput.d.ts +2 -2
  367. package/dist/types/components/ThemeIcon/icon-names.d.ts +1 -1
  368. package/dist/types/components/Truncate/Truncate.d.ts +1 -1
  369. package/dist/types/components/TypographyCard/index.d.ts +1 -1
  370. package/dist/types/components/VideoPlayer/VideoPlayer.d.ts +9 -0
  371. package/dist/types/components/index.d.ts +7 -0
  372. package/dist/types/styles.d.ts +7 -1
  373. package/package.json +21 -18
  374. package/dist/_shared/cjs/ArcIconEclipse.esm-ac777a76.js +0 -28
  375. package/dist/_shared/cjs/Tag-4eb2ed9e.js +0 -44
  376. package/dist/_shared/cjs/index.es-c26e8978.js +0 -201
  377. package/dist/_shared/esm/ArcIconEclipse.esm-bb48b82a.js +0 -22
  378. package/dist/_shared/esm/Tag-1ae027ee.js +0 -38
  379. package/dist/_shared/esm/index.es-5496ec12.js +0 -196
  380. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Todo.d.ts +0 -2
  381. package/dist/_shared/cjs/{index-6f33b8c0.js → index-76f7dd53.js} +8 -8
@@ -0,0 +1,1921 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var index = require('../_shared/cjs/index-9947ac13.js');
7
+ var useMediaQuery = require('../_shared/cjs/use-media-query-d34c83b9.js');
8
+ var ThemeIcon = require('../_shared/cjs/ThemeIcon-e7a68823.js');
9
+ var index_es = require('../_shared/cjs/index.es-b98bcd00.js');
10
+ require('../_shared/cjs/Surface-877d9fcc.js');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
+
16
+ function isObject$1(subject) {
17
+ return Object.prototype.toString.call(subject) === '[object Object]';
18
+ }
19
+ function isRecord(subject) {
20
+ return isObject$1(subject) || Array.isArray(subject);
21
+ }
22
+ function canUseDOM() {
23
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
24
+ }
25
+ function areOptionsEqual(optionsA, optionsB) {
26
+ const optionsAKeys = Object.keys(optionsA);
27
+ const optionsBKeys = Object.keys(optionsB);
28
+ if (optionsAKeys.length !== optionsBKeys.length) return false;
29
+ const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}));
30
+ const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}));
31
+ if (breakpointsA !== breakpointsB) return false;
32
+ return optionsAKeys.every(key => {
33
+ const valueA = optionsA[key];
34
+ const valueB = optionsB[key];
35
+ if (typeof valueA === 'function') return `${valueA}` === `${valueB}`;
36
+ if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB;
37
+ return areOptionsEqual(valueA, valueB);
38
+ });
39
+ }
40
+ function sortAndMapPluginToOptions(plugins) {
41
+ return plugins.concat().sort((a, b) => a.name > b.name ? 1 : -1).map(plugin => plugin.options);
42
+ }
43
+ function arePluginsEqual(pluginsA, pluginsB) {
44
+ if (pluginsA.length !== pluginsB.length) return false;
45
+ const optionsA = sortAndMapPluginToOptions(pluginsA);
46
+ const optionsB = sortAndMapPluginToOptions(pluginsB);
47
+ return optionsA.every((optionA, index) => {
48
+ const optionB = optionsB[index];
49
+ return areOptionsEqual(optionA, optionB);
50
+ });
51
+ }
52
+
53
+ function isNumber(subject) {
54
+ return typeof subject === 'number';
55
+ }
56
+ function isString(subject) {
57
+ return typeof subject === 'string';
58
+ }
59
+ function isBoolean(subject) {
60
+ return typeof subject === 'boolean';
61
+ }
62
+ function isObject(subject) {
63
+ return Object.prototype.toString.call(subject) === '[object Object]';
64
+ }
65
+ function mathAbs(n) {
66
+ return Math.abs(n);
67
+ }
68
+ function mathSign(n) {
69
+ return Math.sign(n);
70
+ }
71
+ function deltaAbs(valueB, valueA) {
72
+ return mathAbs(valueB - valueA);
73
+ }
74
+ function factorAbs(valueB, valueA) {
75
+ if (valueB === 0 || valueA === 0) return 0;
76
+ if (mathAbs(valueB) <= mathAbs(valueA)) return 0;
77
+ const diff = deltaAbs(mathAbs(valueB), mathAbs(valueA));
78
+ return mathAbs(diff / valueB);
79
+ }
80
+ function arrayKeys(array) {
81
+ return objectKeys(array).map(Number);
82
+ }
83
+ function arrayLast(array) {
84
+ return array[arrayLastIndex(array)];
85
+ }
86
+ function arrayLastIndex(array) {
87
+ return Math.max(0, array.length - 1);
88
+ }
89
+ function arrayIsLastIndex(array, index) {
90
+ return index === arrayLastIndex(array);
91
+ }
92
+ function arrayFromNumber(n, startAt = 0) {
93
+ return Array.from(Array(n), (_, i) => startAt + i);
94
+ }
95
+ function objectKeys(object) {
96
+ return Object.keys(object);
97
+ }
98
+ function objectsMergeDeep(objectA, objectB) {
99
+ return [objectA, objectB].reduce((mergedObjects, currentObject) => {
100
+ objectKeys(currentObject).forEach(key => {
101
+ const valueA = mergedObjects[key];
102
+ const valueB = currentObject[key];
103
+ const areObjects = isObject(valueA) && isObject(valueB);
104
+ mergedObjects[key] = areObjects ? objectsMergeDeep(valueA, valueB) : valueB;
105
+ });
106
+ return mergedObjects;
107
+ }, {});
108
+ }
109
+ function isMouseEvent(evt, ownerWindow) {
110
+ return typeof ownerWindow.MouseEvent !== 'undefined' && evt instanceof ownerWindow.MouseEvent;
111
+ }
112
+
113
+ function Alignment(align, viewSize) {
114
+ const predefined = {
115
+ start,
116
+ center,
117
+ end
118
+ };
119
+ function start() {
120
+ return 0;
121
+ }
122
+ function center(n) {
123
+ return end(n) / 2;
124
+ }
125
+ function end(n) {
126
+ return viewSize - n;
127
+ }
128
+ function measure(n, index) {
129
+ if (isString(align)) return predefined[align](n);
130
+ return align(viewSize, n, index);
131
+ }
132
+ const self = {
133
+ measure
134
+ };
135
+ return self;
136
+ }
137
+
138
+ function EventStore() {
139
+ let listeners = [];
140
+ function add(node, type, handler, options = {
141
+ passive: true
142
+ }) {
143
+ let removeListener;
144
+ if ('addEventListener' in node) {
145
+ node.addEventListener(type, handler, options);
146
+ removeListener = () => node.removeEventListener(type, handler, options);
147
+ } else {
148
+ const legacyMediaQueryList = node;
149
+ legacyMediaQueryList.addListener(handler);
150
+ removeListener = () => legacyMediaQueryList.removeListener(handler);
151
+ }
152
+ listeners.push(removeListener);
153
+ return self;
154
+ }
155
+ function clear() {
156
+ listeners = listeners.filter(remove => remove());
157
+ }
158
+ const self = {
159
+ add,
160
+ clear
161
+ };
162
+ return self;
163
+ }
164
+
165
+ function Animations(ownerDocument, ownerWindow, update, render) {
166
+ const documentVisibleHandler = EventStore();
167
+ const timeStep = 1000 / 60;
168
+ let lastTimeStamp = null;
169
+ let lag = 0;
170
+ let animationFrame = 0;
171
+ function init() {
172
+ documentVisibleHandler.add(ownerDocument, 'visibilitychange', () => {
173
+ if (ownerDocument.hidden) reset();
174
+ });
175
+ }
176
+ function destroy() {
177
+ stop();
178
+ documentVisibleHandler.clear();
179
+ }
180
+ function animate(timeStamp) {
181
+ if (!animationFrame) return;
182
+ if (!lastTimeStamp) lastTimeStamp = timeStamp;
183
+ const elapsed = timeStamp - lastTimeStamp;
184
+ lastTimeStamp = timeStamp;
185
+ lag += elapsed;
186
+ while (lag >= timeStep) {
187
+ update(timeStep);
188
+ lag -= timeStep;
189
+ }
190
+ const lagOffset = lag / timeStep;
191
+ render(lagOffset);
192
+ if (animationFrame) ownerWindow.requestAnimationFrame(animate);
193
+ }
194
+ function start() {
195
+ if (animationFrame) return;
196
+ animationFrame = ownerWindow.requestAnimationFrame(animate);
197
+ }
198
+ function stop() {
199
+ ownerWindow.cancelAnimationFrame(animationFrame);
200
+ lastTimeStamp = null;
201
+ lag = 0;
202
+ animationFrame = 0;
203
+ }
204
+ function reset() {
205
+ lastTimeStamp = null;
206
+ lag = 0;
207
+ }
208
+ const self = {
209
+ init,
210
+ destroy,
211
+ start,
212
+ stop,
213
+ update: () => update(timeStep),
214
+ render
215
+ };
216
+ return self;
217
+ }
218
+
219
+ function Axis(axis, contentDirection) {
220
+ const isRightToLeft = contentDirection === 'rtl';
221
+ const isVertical = axis === 'y';
222
+ const scroll = isVertical ? 'y' : 'x';
223
+ const cross = isVertical ? 'x' : 'y';
224
+ const sign = !isVertical && isRightToLeft ? -1 : 1;
225
+ const startEdge = getStartEdge();
226
+ const endEdge = getEndEdge();
227
+ function measureSize(nodeRect) {
228
+ const {
229
+ height,
230
+ width
231
+ } = nodeRect;
232
+ return isVertical ? height : width;
233
+ }
234
+ function getStartEdge() {
235
+ if (isVertical) return 'top';
236
+ return isRightToLeft ? 'right' : 'left';
237
+ }
238
+ function getEndEdge() {
239
+ if (isVertical) return 'bottom';
240
+ return isRightToLeft ? 'left' : 'right';
241
+ }
242
+ function direction(n) {
243
+ return n * sign;
244
+ }
245
+ const self = {
246
+ scroll,
247
+ cross,
248
+ startEdge,
249
+ endEdge,
250
+ measureSize,
251
+ direction
252
+ };
253
+ return self;
254
+ }
255
+
256
+ function Limit(min = 0, max = 0) {
257
+ const length = mathAbs(min - max);
258
+ function reachedMin(n) {
259
+ return n < min;
260
+ }
261
+ function reachedMax(n) {
262
+ return n > max;
263
+ }
264
+ function reachedAny(n) {
265
+ return reachedMin(n) || reachedMax(n);
266
+ }
267
+ function constrain(n) {
268
+ if (!reachedAny(n)) return n;
269
+ return reachedMin(n) ? min : max;
270
+ }
271
+ function removeOffset(n) {
272
+ if (!length) return n;
273
+ return n - length * Math.ceil((n - max) / length);
274
+ }
275
+ const self = {
276
+ length,
277
+ max,
278
+ min,
279
+ constrain,
280
+ reachedAny,
281
+ reachedMax,
282
+ reachedMin,
283
+ removeOffset
284
+ };
285
+ return self;
286
+ }
287
+
288
+ function Counter(max, start, loop) {
289
+ const {
290
+ constrain
291
+ } = Limit(0, max);
292
+ const loopEnd = max + 1;
293
+ let counter = withinLimit(start);
294
+ function withinLimit(n) {
295
+ return !loop ? constrain(n) : mathAbs((loopEnd + n) % loopEnd);
296
+ }
297
+ function get() {
298
+ return counter;
299
+ }
300
+ function set(n) {
301
+ counter = withinLimit(n);
302
+ return self;
303
+ }
304
+ function add(n) {
305
+ return clone().set(get() + n);
306
+ }
307
+ function clone() {
308
+ return Counter(max, get(), loop);
309
+ }
310
+ const self = {
311
+ get,
312
+ set,
313
+ add,
314
+ clone
315
+ };
316
+ return self;
317
+ }
318
+
319
+ function DragHandler(axis, rootNode, ownerDocument, ownerWindow, target, dragTracker, location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, baseFriction, watchDrag) {
320
+ const {
321
+ cross: crossAxis,
322
+ direction
323
+ } = axis;
324
+ const focusNodes = ['INPUT', 'SELECT', 'TEXTAREA'];
325
+ const nonPassiveEvent = {
326
+ passive: false
327
+ };
328
+ const initEvents = EventStore();
329
+ const dragEvents = EventStore();
330
+ const goToNextThreshold = Limit(50, 225).constrain(percentOfView.measure(20));
331
+ const snapForceBoost = {
332
+ mouse: 300,
333
+ touch: 400
334
+ };
335
+ const freeForceBoost = {
336
+ mouse: 500,
337
+ touch: 600
338
+ };
339
+ const baseSpeed = dragFree ? 43 : 25;
340
+ let isMoving = false;
341
+ let startScroll = 0;
342
+ let startCross = 0;
343
+ let pointerIsDown = false;
344
+ let preventScroll = false;
345
+ let preventClick = false;
346
+ let isMouse = false;
347
+ function init(emblaApi) {
348
+ if (!watchDrag) return;
349
+ function downIfAllowed(evt) {
350
+ if (isBoolean(watchDrag) || watchDrag(emblaApi, evt)) down(evt);
351
+ }
352
+ const node = rootNode;
353
+ initEvents.add(node, 'dragstart', evt => evt.preventDefault(), nonPassiveEvent).add(node, 'touchmove', () => undefined, nonPassiveEvent).add(node, 'touchend', () => undefined).add(node, 'touchstart', downIfAllowed).add(node, 'mousedown', downIfAllowed).add(node, 'touchcancel', up).add(node, 'contextmenu', up).add(node, 'click', click, true);
354
+ }
355
+ function destroy() {
356
+ initEvents.clear();
357
+ dragEvents.clear();
358
+ }
359
+ function addDragEvents() {
360
+ const node = isMouse ? ownerDocument : rootNode;
361
+ dragEvents.add(node, 'touchmove', move, nonPassiveEvent).add(node, 'touchend', up).add(node, 'mousemove', move, nonPassiveEvent).add(node, 'mouseup', up);
362
+ }
363
+ function isFocusNode(node) {
364
+ const nodeName = node.nodeName || '';
365
+ return focusNodes.includes(nodeName);
366
+ }
367
+ function forceBoost() {
368
+ const boost = dragFree ? freeForceBoost : snapForceBoost;
369
+ const type = isMouse ? 'mouse' : 'touch';
370
+ return boost[type];
371
+ }
372
+ function allowedForce(force, targetChanged) {
373
+ const next = index.add(mathSign(force) * -1);
374
+ const baseForce = scrollTarget.byDistance(force, !dragFree).distance;
375
+ if (dragFree || mathAbs(force) < goToNextThreshold) return baseForce;
376
+ if (skipSnaps && targetChanged) return baseForce * 0.5;
377
+ return scrollTarget.byIndex(next.get(), 0).distance;
378
+ }
379
+ function down(evt) {
380
+ const isMouseEvt = isMouseEvent(evt, ownerWindow);
381
+ isMouse = isMouseEvt;
382
+ preventClick = dragFree && isMouseEvt && !evt.buttons && isMoving;
383
+ isMoving = deltaAbs(target.get(), location.get()) >= 2;
384
+ if (isMouseEvt && evt.button !== 0) return;
385
+ if (isFocusNode(evt.target)) return;
386
+ pointerIsDown = true;
387
+ dragTracker.pointerDown(evt);
388
+ scrollBody.useFriction(0).useDuration(0);
389
+ target.set(location);
390
+ addDragEvents();
391
+ startScroll = dragTracker.readPoint(evt);
392
+ startCross = dragTracker.readPoint(evt, crossAxis);
393
+ eventHandler.emit('pointerDown');
394
+ }
395
+ function move(evt) {
396
+ const isTouchEvt = !isMouseEvent(evt, ownerWindow);
397
+ if (isTouchEvt && evt.touches.length >= 2) return up(evt);
398
+ const lastScroll = dragTracker.readPoint(evt);
399
+ const lastCross = dragTracker.readPoint(evt, crossAxis);
400
+ const diffScroll = deltaAbs(lastScroll, startScroll);
401
+ const diffCross = deltaAbs(lastCross, startCross);
402
+ if (!preventScroll && !isMouse) {
403
+ if (!evt.cancelable) return up(evt);
404
+ preventScroll = diffScroll > diffCross;
405
+ if (!preventScroll) return up(evt);
406
+ }
407
+ const diff = dragTracker.pointerMove(evt);
408
+ if (diffScroll > dragThreshold) preventClick = true;
409
+ scrollBody.useFriction(0.3).useDuration(0.75);
410
+ animation.start();
411
+ target.add(direction(diff));
412
+ evt.preventDefault();
413
+ }
414
+ function up(evt) {
415
+ const currentLocation = scrollTarget.byDistance(0, false);
416
+ const targetChanged = currentLocation.index !== index.get();
417
+ const rawForce = dragTracker.pointerUp(evt) * forceBoost();
418
+ const force = allowedForce(direction(rawForce), targetChanged);
419
+ const forceFactor = factorAbs(rawForce, force);
420
+ const speed = baseSpeed - 10 * forceFactor;
421
+ const friction = baseFriction + forceFactor / 50;
422
+ preventScroll = false;
423
+ pointerIsDown = false;
424
+ dragEvents.clear();
425
+ scrollBody.useDuration(speed).useFriction(friction);
426
+ scrollTo.distance(force, !dragFree);
427
+ isMouse = false;
428
+ eventHandler.emit('pointerUp');
429
+ }
430
+ function click(evt) {
431
+ if (preventClick) {
432
+ evt.stopPropagation();
433
+ evt.preventDefault();
434
+ preventClick = false;
435
+ }
436
+ }
437
+ function pointerDown() {
438
+ return pointerIsDown;
439
+ }
440
+ const self = {
441
+ init,
442
+ destroy,
443
+ pointerDown
444
+ };
445
+ return self;
446
+ }
447
+
448
+ function DragTracker(axis, ownerWindow) {
449
+ const logInterval = 170;
450
+ let startEvent;
451
+ let lastEvent;
452
+ function readTime(evt) {
453
+ return evt.timeStamp;
454
+ }
455
+ function readPoint(evt, evtAxis) {
456
+ const property = evtAxis || axis.scroll;
457
+ const coord = `client${property === 'x' ? 'X' : 'Y'}`;
458
+ return (isMouseEvent(evt, ownerWindow) ? evt : evt.touches[0])[coord];
459
+ }
460
+ function pointerDown(evt) {
461
+ startEvent = evt;
462
+ lastEvent = evt;
463
+ return readPoint(evt);
464
+ }
465
+ function pointerMove(evt) {
466
+ const diff = readPoint(evt) - readPoint(lastEvent);
467
+ const expired = readTime(evt) - readTime(startEvent) > logInterval;
468
+ lastEvent = evt;
469
+ if (expired) startEvent = evt;
470
+ return diff;
471
+ }
472
+ function pointerUp(evt) {
473
+ if (!startEvent || !lastEvent) return 0;
474
+ const diffDrag = readPoint(lastEvent) - readPoint(startEvent);
475
+ const diffTime = readTime(evt) - readTime(startEvent);
476
+ const expired = readTime(evt) - readTime(lastEvent) > logInterval;
477
+ const force = diffDrag / diffTime;
478
+ const isFlick = diffTime && !expired && mathAbs(force) > 0.1;
479
+ return isFlick ? force : 0;
480
+ }
481
+ const self = {
482
+ pointerDown,
483
+ pointerMove,
484
+ pointerUp,
485
+ readPoint
486
+ };
487
+ return self;
488
+ }
489
+
490
+ function NodeRects() {
491
+ function measure(node) {
492
+ const {
493
+ offsetTop,
494
+ offsetLeft,
495
+ offsetWidth,
496
+ offsetHeight
497
+ } = node;
498
+ const offset = {
499
+ top: offsetTop,
500
+ right: offsetLeft + offsetWidth,
501
+ bottom: offsetTop + offsetHeight,
502
+ left: offsetLeft,
503
+ width: offsetWidth,
504
+ height: offsetHeight
505
+ };
506
+ return offset;
507
+ }
508
+ const self = {
509
+ measure
510
+ };
511
+ return self;
512
+ }
513
+
514
+ function PercentOfView(viewSize) {
515
+ function measure(n) {
516
+ return viewSize * (n / 100);
517
+ }
518
+ const self = {
519
+ measure
520
+ };
521
+ return self;
522
+ }
523
+
524
+ function ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects) {
525
+ const observeNodes = [container].concat(slides);
526
+ let resizeObserver;
527
+ let containerSize;
528
+ let slideSizes = [];
529
+ let destroyed = false;
530
+ function readSize(node) {
531
+ return axis.measureSize(nodeRects.measure(node));
532
+ }
533
+ function init(emblaApi) {
534
+ if (!watchResize) return;
535
+ containerSize = readSize(container);
536
+ slideSizes = slides.map(readSize);
537
+ function defaultCallback(entries) {
538
+ for (const entry of entries) {
539
+ if (destroyed) return;
540
+ const isContainer = entry.target === container;
541
+ const slideIndex = slides.indexOf(entry.target);
542
+ const lastSize = isContainer ? containerSize : slideSizes[slideIndex];
543
+ const newSize = readSize(isContainer ? container : slides[slideIndex]);
544
+ const diffSize = mathAbs(newSize - lastSize);
545
+ if (diffSize >= 0.5) {
546
+ emblaApi.reInit();
547
+ eventHandler.emit('resize');
548
+ break;
549
+ }
550
+ }
551
+ }
552
+ resizeObserver = new ResizeObserver(entries => {
553
+ if (isBoolean(watchResize) || watchResize(emblaApi, entries)) {
554
+ defaultCallback(entries);
555
+ }
556
+ });
557
+ ownerWindow.requestAnimationFrame(() => {
558
+ observeNodes.forEach(node => resizeObserver.observe(node));
559
+ });
560
+ }
561
+ function destroy() {
562
+ destroyed = true;
563
+ if (resizeObserver) resizeObserver.disconnect();
564
+ }
565
+ const self = {
566
+ init,
567
+ destroy
568
+ };
569
+ return self;
570
+ }
571
+
572
+ function ScrollBody(location, offsetLocation, previousLocation, target, baseDuration, baseFriction) {
573
+ let bodyVelocity = 0;
574
+ let scrollDirection = 0;
575
+ let scrollDuration = baseDuration;
576
+ let scrollFriction = baseFriction;
577
+ let rawLocation = location.get();
578
+ let rawLocationPrevious = 0;
579
+ function seek(timeStep) {
580
+ const fixedDeltaTimeSeconds = timeStep / 1000;
581
+ const duration = scrollDuration * fixedDeltaTimeSeconds;
582
+ const diff = target.get() - location.get();
583
+ const isInstant = !scrollDuration;
584
+ let directionDiff = 0;
585
+ if (isInstant) {
586
+ bodyVelocity = 0;
587
+ previousLocation.set(target);
588
+ location.set(target);
589
+ directionDiff = diff;
590
+ } else {
591
+ previousLocation.set(location);
592
+ bodyVelocity += diff / duration;
593
+ bodyVelocity *= scrollFriction;
594
+ rawLocation += bodyVelocity;
595
+ location.add(bodyVelocity * fixedDeltaTimeSeconds);
596
+ directionDiff = rawLocation - rawLocationPrevious;
597
+ }
598
+ scrollDirection = mathSign(directionDiff);
599
+ rawLocationPrevious = rawLocation;
600
+ return self;
601
+ }
602
+ function settled() {
603
+ const diff = target.get() - offsetLocation.get();
604
+ return mathAbs(diff) < 0.001;
605
+ }
606
+ function duration() {
607
+ return scrollDuration;
608
+ }
609
+ function direction() {
610
+ return scrollDirection;
611
+ }
612
+ function velocity() {
613
+ return bodyVelocity;
614
+ }
615
+ function useBaseDuration() {
616
+ return useDuration(baseDuration);
617
+ }
618
+ function useBaseFriction() {
619
+ return useFriction(baseFriction);
620
+ }
621
+ function useDuration(n) {
622
+ scrollDuration = n;
623
+ return self;
624
+ }
625
+ function useFriction(n) {
626
+ scrollFriction = n;
627
+ return self;
628
+ }
629
+ const self = {
630
+ direction,
631
+ duration,
632
+ velocity,
633
+ seek,
634
+ settled,
635
+ useBaseFriction,
636
+ useBaseDuration,
637
+ useFriction,
638
+ useDuration
639
+ };
640
+ return self;
641
+ }
642
+
643
+ function ScrollBounds(limit, location, target, scrollBody, percentOfView) {
644
+ const pullBackThreshold = percentOfView.measure(10);
645
+ const edgeOffsetTolerance = percentOfView.measure(50);
646
+ const frictionLimit = Limit(0.1, 0.99);
647
+ let disabled = false;
648
+ function shouldConstrain() {
649
+ if (disabled) return false;
650
+ if (!limit.reachedAny(target.get())) return false;
651
+ if (!limit.reachedAny(location.get())) return false;
652
+ return true;
653
+ }
654
+ function constrain(pointerDown) {
655
+ if (!shouldConstrain()) return;
656
+ const edge = limit.reachedMin(location.get()) ? 'min' : 'max';
657
+ const diffToEdge = mathAbs(limit[edge] - location.get());
658
+ const diffToTarget = target.get() - location.get();
659
+ const friction = frictionLimit.constrain(diffToEdge / edgeOffsetTolerance);
660
+ target.subtract(diffToTarget * friction);
661
+ if (!pointerDown && mathAbs(diffToTarget) < pullBackThreshold) {
662
+ target.set(limit.constrain(target.get()));
663
+ scrollBody.useDuration(25).useBaseFriction();
664
+ }
665
+ }
666
+ function toggleActive(active) {
667
+ disabled = !active;
668
+ }
669
+ const self = {
670
+ shouldConstrain,
671
+ constrain,
672
+ toggleActive
673
+ };
674
+ return self;
675
+ }
676
+
677
+ function ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance) {
678
+ const scrollBounds = Limit(-contentSize + viewSize, 0);
679
+ const snapsBounded = measureBounded();
680
+ const scrollContainLimit = findScrollContainLimit();
681
+ const snapsContained = measureContained();
682
+ function usePixelTolerance(bound, snap) {
683
+ return deltaAbs(bound, snap) < 1;
684
+ }
685
+ function findScrollContainLimit() {
686
+ const startSnap = snapsBounded[0];
687
+ const endSnap = arrayLast(snapsBounded);
688
+ const min = snapsBounded.lastIndexOf(startSnap);
689
+ const max = snapsBounded.indexOf(endSnap) + 1;
690
+ return Limit(min, max);
691
+ }
692
+ function measureBounded() {
693
+ return snapsAligned.map((snapAligned, index) => {
694
+ const {
695
+ min,
696
+ max
697
+ } = scrollBounds;
698
+ const snap = scrollBounds.constrain(snapAligned);
699
+ const isFirst = !index;
700
+ const isLast = arrayIsLastIndex(snapsAligned, index);
701
+ if (isFirst) return max;
702
+ if (isLast) return min;
703
+ if (usePixelTolerance(min, snap)) return min;
704
+ if (usePixelTolerance(max, snap)) return max;
705
+ return snap;
706
+ }).map(scrollBound => parseFloat(scrollBound.toFixed(3)));
707
+ }
708
+ function measureContained() {
709
+ if (contentSize <= viewSize + pixelTolerance) return [scrollBounds.max];
710
+ if (containScroll === 'keepSnaps') return snapsBounded;
711
+ const {
712
+ min,
713
+ max
714
+ } = scrollContainLimit;
715
+ return snapsBounded.slice(min, max);
716
+ }
717
+ const self = {
718
+ snapsContained,
719
+ scrollContainLimit
720
+ };
721
+ return self;
722
+ }
723
+
724
+ function ScrollLimit(contentSize, scrollSnaps, loop) {
725
+ const max = scrollSnaps[0];
726
+ const min = loop ? max - contentSize : arrayLast(scrollSnaps);
727
+ const limit = Limit(min, max);
728
+ const self = {
729
+ limit
730
+ };
731
+ return self;
732
+ }
733
+
734
+ function ScrollLooper(contentSize, limit, location, vectors) {
735
+ const jointSafety = 0.1;
736
+ const min = limit.min + jointSafety;
737
+ const max = limit.max + jointSafety;
738
+ const {
739
+ reachedMin,
740
+ reachedMax
741
+ } = Limit(min, max);
742
+ function shouldLoop(direction) {
743
+ if (direction === 1) return reachedMax(location.get());
744
+ if (direction === -1) return reachedMin(location.get());
745
+ return false;
746
+ }
747
+ function loop(direction) {
748
+ if (!shouldLoop(direction)) return;
749
+ const loopDistance = contentSize * (direction * -1);
750
+ vectors.forEach(v => v.add(loopDistance));
751
+ }
752
+ const self = {
753
+ loop
754
+ };
755
+ return self;
756
+ }
757
+
758
+ function ScrollProgress(limit) {
759
+ const {
760
+ max,
761
+ length
762
+ } = limit;
763
+ function get(n) {
764
+ const currentLocation = n - max;
765
+ return length ? currentLocation / -length : 0;
766
+ }
767
+ const self = {
768
+ get
769
+ };
770
+ return self;
771
+ }
772
+
773
+ function ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll) {
774
+ const {
775
+ startEdge,
776
+ endEdge
777
+ } = axis;
778
+ const {
779
+ groupSlides
780
+ } = slidesToScroll;
781
+ const alignments = measureSizes().map(alignment.measure);
782
+ const snaps = measureUnaligned();
783
+ const snapsAligned = measureAligned();
784
+ function measureSizes() {
785
+ return groupSlides(slideRects).map(rects => arrayLast(rects)[endEdge] - rects[0][startEdge]).map(mathAbs);
786
+ }
787
+ function measureUnaligned() {
788
+ return slideRects.map(rect => containerRect[startEdge] - rect[startEdge]).map(snap => -mathAbs(snap));
789
+ }
790
+ function measureAligned() {
791
+ return groupSlides(snaps).map(g => g[0]).map((snap, index) => snap + alignments[index]);
792
+ }
793
+ const self = {
794
+ snaps,
795
+ snapsAligned
796
+ };
797
+ return self;
798
+ }
799
+
800
+ function SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes) {
801
+ const {
802
+ groupSlides
803
+ } = slidesToScroll;
804
+ const {
805
+ min,
806
+ max
807
+ } = scrollContainLimit;
808
+ const slideRegistry = createSlideRegistry();
809
+ function createSlideRegistry() {
810
+ const groupedSlideIndexes = groupSlides(slideIndexes);
811
+ const doNotContain = !containSnaps || containScroll === 'keepSnaps';
812
+ if (scrollSnaps.length === 1) return [slideIndexes];
813
+ if (doNotContain) return groupedSlideIndexes;
814
+ return groupedSlideIndexes.slice(min, max).map((group, index, groups) => {
815
+ const isFirst = !index;
816
+ const isLast = arrayIsLastIndex(groups, index);
817
+ if (isFirst) {
818
+ const range = arrayLast(groups[0]) + 1;
819
+ return arrayFromNumber(range);
820
+ }
821
+ if (isLast) {
822
+ const range = arrayLastIndex(slideIndexes) - arrayLast(groups)[0] + 1;
823
+ return arrayFromNumber(range, arrayLast(groups)[0]);
824
+ }
825
+ return group;
826
+ });
827
+ }
828
+ const self = {
829
+ slideRegistry
830
+ };
831
+ return self;
832
+ }
833
+
834
+ function ScrollTarget(loop, scrollSnaps, contentSize, limit, targetVector) {
835
+ const {
836
+ reachedAny,
837
+ removeOffset,
838
+ constrain
839
+ } = limit;
840
+ function minDistance(distances) {
841
+ return distances.concat().sort((a, b) => mathAbs(a) - mathAbs(b))[0];
842
+ }
843
+ function findTargetSnap(target) {
844
+ const distance = loop ? removeOffset(target) : constrain(target);
845
+ const ascDiffsToSnaps = scrollSnaps.map((snap, index) => ({
846
+ diff: shortcut(snap - distance, 0),
847
+ index
848
+ })).sort((d1, d2) => mathAbs(d1.diff) - mathAbs(d2.diff));
849
+ const {
850
+ index
851
+ } = ascDiffsToSnaps[0];
852
+ return {
853
+ index,
854
+ distance
855
+ };
856
+ }
857
+ function shortcut(target, direction) {
858
+ const targets = [target, target + contentSize, target - contentSize];
859
+ if (!loop) return target;
860
+ if (!direction) return minDistance(targets);
861
+ const matchingTargets = targets.filter(t => mathSign(t) === direction);
862
+ if (matchingTargets.length) return minDistance(matchingTargets);
863
+ return arrayLast(targets) - contentSize;
864
+ }
865
+ function byIndex(index, direction) {
866
+ const diffToSnap = scrollSnaps[index] - targetVector.get();
867
+ const distance = shortcut(diffToSnap, direction);
868
+ return {
869
+ index,
870
+ distance
871
+ };
872
+ }
873
+ function byDistance(distance, snap) {
874
+ const target = targetVector.get() + distance;
875
+ const {
876
+ index,
877
+ distance: targetSnapDistance
878
+ } = findTargetSnap(target);
879
+ const reachedBound = !loop && reachedAny(target);
880
+ if (!snap || reachedBound) return {
881
+ index,
882
+ distance
883
+ };
884
+ const diffToSnap = scrollSnaps[index] - targetSnapDistance;
885
+ const snapDistance = distance + shortcut(diffToSnap, 0);
886
+ return {
887
+ index,
888
+ distance: snapDistance
889
+ };
890
+ }
891
+ const self = {
892
+ byDistance,
893
+ byIndex,
894
+ shortcut
895
+ };
896
+ return self;
897
+ }
898
+
899
+ function ScrollTo(animation, indexCurrent, indexPrevious, scrollBody, scrollTarget, targetVector, eventHandler) {
900
+ function scrollTo(target) {
901
+ const distanceDiff = target.distance;
902
+ const indexDiff = target.index !== indexCurrent.get();
903
+ targetVector.add(distanceDiff);
904
+ if (distanceDiff) {
905
+ if (scrollBody.duration()) {
906
+ animation.start();
907
+ } else {
908
+ animation.update();
909
+ animation.render(1);
910
+ animation.update();
911
+ }
912
+ }
913
+ if (indexDiff) {
914
+ indexPrevious.set(indexCurrent.get());
915
+ indexCurrent.set(target.index);
916
+ eventHandler.emit('select');
917
+ }
918
+ }
919
+ function distance(n, snap) {
920
+ const target = scrollTarget.byDistance(n, snap);
921
+ scrollTo(target);
922
+ }
923
+ function index(n, direction) {
924
+ const targetIndex = indexCurrent.clone().set(n);
925
+ const target = scrollTarget.byIndex(targetIndex.get(), direction);
926
+ scrollTo(target);
927
+ }
928
+ const self = {
929
+ distance,
930
+ index
931
+ };
932
+ return self;
933
+ }
934
+
935
+ function SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus) {
936
+ const focusListenerOptions = {
937
+ passive: true,
938
+ capture: true
939
+ };
940
+ let lastTabPressTime = 0;
941
+ function init(emblaApi) {
942
+ if (!watchFocus) return;
943
+ function defaultCallback(index) {
944
+ const nowTime = new Date().getTime();
945
+ const diffTime = nowTime - lastTabPressTime;
946
+ if (diffTime > 10) return;
947
+ eventHandler.emit('slideFocusStart');
948
+ root.scrollLeft = 0;
949
+ const group = slideRegistry.findIndex(group => group.includes(index));
950
+ if (!isNumber(group)) return;
951
+ scrollBody.useDuration(0);
952
+ scrollTo.index(group, 0);
953
+ eventHandler.emit('slideFocus');
954
+ }
955
+ eventStore.add(document, 'keydown', registerTabPress, false);
956
+ slides.forEach((slide, slideIndex) => {
957
+ eventStore.add(slide, 'focus', evt => {
958
+ if (isBoolean(watchFocus) || watchFocus(emblaApi, evt)) {
959
+ defaultCallback(slideIndex);
960
+ }
961
+ }, focusListenerOptions);
962
+ });
963
+ }
964
+ function registerTabPress(event) {
965
+ if (event.code === 'Tab') lastTabPressTime = new Date().getTime();
966
+ }
967
+ const self = {
968
+ init
969
+ };
970
+ return self;
971
+ }
972
+
973
+ function Vector1D(initialValue) {
974
+ let value = initialValue;
975
+ function get() {
976
+ return value;
977
+ }
978
+ function set(n) {
979
+ value = normalizeInput(n);
980
+ }
981
+ function add(n) {
982
+ value += normalizeInput(n);
983
+ }
984
+ function subtract(n) {
985
+ value -= normalizeInput(n);
986
+ }
987
+ function normalizeInput(n) {
988
+ return isNumber(n) ? n : n.get();
989
+ }
990
+ const self = {
991
+ get,
992
+ set,
993
+ add,
994
+ subtract
995
+ };
996
+ return self;
997
+ }
998
+
999
+ function Translate(axis, container) {
1000
+ const translate = axis.scroll === 'x' ? x : y;
1001
+ const containerStyle = container.style;
1002
+ let disabled = false;
1003
+ function x(n) {
1004
+ return `translate3d(${n}px,0px,0px)`;
1005
+ }
1006
+ function y(n) {
1007
+ return `translate3d(0px,${n}px,0px)`;
1008
+ }
1009
+ function to(target) {
1010
+ if (disabled) return;
1011
+ containerStyle.transform = translate(axis.direction(target));
1012
+ }
1013
+ function toggleActive(active) {
1014
+ disabled = !active;
1015
+ }
1016
+ function clear() {
1017
+ if (disabled) return;
1018
+ containerStyle.transform = '';
1019
+ if (!container.getAttribute('style')) container.removeAttribute('style');
1020
+ }
1021
+ const self = {
1022
+ clear,
1023
+ to,
1024
+ toggleActive
1025
+ };
1026
+ return self;
1027
+ }
1028
+
1029
+ function SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, location, slides) {
1030
+ const roundingSafety = 0.5;
1031
+ const ascItems = arrayKeys(slideSizesWithGaps);
1032
+ const descItems = arrayKeys(slideSizesWithGaps).reverse();
1033
+ const loopPoints = startPoints().concat(endPoints());
1034
+ function removeSlideSizes(indexes, from) {
1035
+ return indexes.reduce((a, i) => {
1036
+ return a - slideSizesWithGaps[i];
1037
+ }, from);
1038
+ }
1039
+ function slidesInGap(indexes, gap) {
1040
+ return indexes.reduce((a, i) => {
1041
+ const remainingGap = removeSlideSizes(a, gap);
1042
+ return remainingGap > 0 ? a.concat([i]) : a;
1043
+ }, []);
1044
+ }
1045
+ function findSlideBounds(offset) {
1046
+ return snaps.map((snap, index) => ({
1047
+ start: snap - slideSizes[index] + roundingSafety + offset,
1048
+ end: snap + viewSize - roundingSafety + offset
1049
+ }));
1050
+ }
1051
+ function findLoopPoints(indexes, offset, isEndEdge) {
1052
+ const slideBounds = findSlideBounds(offset);
1053
+ return indexes.map(index => {
1054
+ const initial = isEndEdge ? 0 : -contentSize;
1055
+ const altered = isEndEdge ? contentSize : 0;
1056
+ const boundEdge = isEndEdge ? 'end' : 'start';
1057
+ const loopPoint = slideBounds[index][boundEdge];
1058
+ return {
1059
+ index,
1060
+ loopPoint,
1061
+ slideLocation: Vector1D(-1),
1062
+ translate: Translate(axis, slides[index]),
1063
+ target: () => location.get() > loopPoint ? initial : altered
1064
+ };
1065
+ });
1066
+ }
1067
+ function startPoints() {
1068
+ const gap = scrollSnaps[0];
1069
+ const indexes = slidesInGap(descItems, gap);
1070
+ return findLoopPoints(indexes, contentSize, false);
1071
+ }
1072
+ function endPoints() {
1073
+ const gap = viewSize - scrollSnaps[0] - 1;
1074
+ const indexes = slidesInGap(ascItems, gap);
1075
+ return findLoopPoints(indexes, -contentSize, true);
1076
+ }
1077
+ function canLoop() {
1078
+ return loopPoints.every(({
1079
+ index
1080
+ }) => {
1081
+ const otherIndexes = ascItems.filter(i => i !== index);
1082
+ return removeSlideSizes(otherIndexes, viewSize) <= 0.1;
1083
+ });
1084
+ }
1085
+ function loop() {
1086
+ loopPoints.forEach(loopPoint => {
1087
+ const {
1088
+ target,
1089
+ translate,
1090
+ slideLocation
1091
+ } = loopPoint;
1092
+ const shiftLocation = target();
1093
+ if (shiftLocation === slideLocation.get()) return;
1094
+ translate.to(shiftLocation);
1095
+ slideLocation.set(shiftLocation);
1096
+ });
1097
+ }
1098
+ function clear() {
1099
+ loopPoints.forEach(loopPoint => loopPoint.translate.clear());
1100
+ }
1101
+ const self = {
1102
+ canLoop,
1103
+ clear,
1104
+ loop,
1105
+ loopPoints
1106
+ };
1107
+ return self;
1108
+ }
1109
+
1110
+ function SlidesHandler(container, eventHandler, watchSlides) {
1111
+ let mutationObserver;
1112
+ let destroyed = false;
1113
+ function init(emblaApi) {
1114
+ if (!watchSlides) return;
1115
+ function defaultCallback(mutations) {
1116
+ for (const mutation of mutations) {
1117
+ if (mutation.type === 'childList') {
1118
+ emblaApi.reInit();
1119
+ eventHandler.emit('slidesChanged');
1120
+ break;
1121
+ }
1122
+ }
1123
+ }
1124
+ mutationObserver = new MutationObserver(mutations => {
1125
+ if (destroyed) return;
1126
+ if (isBoolean(watchSlides) || watchSlides(emblaApi, mutations)) {
1127
+ defaultCallback(mutations);
1128
+ }
1129
+ });
1130
+ mutationObserver.observe(container, {
1131
+ childList: true
1132
+ });
1133
+ }
1134
+ function destroy() {
1135
+ if (mutationObserver) mutationObserver.disconnect();
1136
+ destroyed = true;
1137
+ }
1138
+ const self = {
1139
+ init,
1140
+ destroy
1141
+ };
1142
+ return self;
1143
+ }
1144
+
1145
+ function SlidesInView(container, slides, eventHandler, threshold) {
1146
+ const intersectionEntryMap = {};
1147
+ let inViewCache = null;
1148
+ let notInViewCache = null;
1149
+ let intersectionObserver;
1150
+ let destroyed = false;
1151
+ function init() {
1152
+ intersectionObserver = new IntersectionObserver(entries => {
1153
+ if (destroyed) return;
1154
+ entries.forEach(entry => {
1155
+ const index = slides.indexOf(entry.target);
1156
+ intersectionEntryMap[index] = entry;
1157
+ });
1158
+ inViewCache = null;
1159
+ notInViewCache = null;
1160
+ eventHandler.emit('slidesInView');
1161
+ }, {
1162
+ root: container.parentElement,
1163
+ threshold
1164
+ });
1165
+ slides.forEach(slide => intersectionObserver.observe(slide));
1166
+ }
1167
+ function destroy() {
1168
+ if (intersectionObserver) intersectionObserver.disconnect();
1169
+ destroyed = true;
1170
+ }
1171
+ function createInViewList(inView) {
1172
+ return objectKeys(intersectionEntryMap).reduce((list, slideIndex) => {
1173
+ const index = parseInt(slideIndex);
1174
+ const {
1175
+ isIntersecting
1176
+ } = intersectionEntryMap[index];
1177
+ const inViewMatch = inView && isIntersecting;
1178
+ const notInViewMatch = !inView && !isIntersecting;
1179
+ if (inViewMatch || notInViewMatch) list.push(index);
1180
+ return list;
1181
+ }, []);
1182
+ }
1183
+ function get(inView = true) {
1184
+ if (inView && inViewCache) return inViewCache;
1185
+ if (!inView && notInViewCache) return notInViewCache;
1186
+ const slideIndexes = createInViewList(inView);
1187
+ if (inView) inViewCache = slideIndexes;
1188
+ if (!inView) notInViewCache = slideIndexes;
1189
+ return slideIndexes;
1190
+ }
1191
+ const self = {
1192
+ init,
1193
+ destroy,
1194
+ get
1195
+ };
1196
+ return self;
1197
+ }
1198
+
1199
+ function SlideSizes(axis, containerRect, slideRects, slides, readEdgeGap, ownerWindow) {
1200
+ const {
1201
+ measureSize,
1202
+ startEdge,
1203
+ endEdge
1204
+ } = axis;
1205
+ const withEdgeGap = slideRects[0] && readEdgeGap;
1206
+ const startGap = measureStartGap();
1207
+ const endGap = measureEndGap();
1208
+ const slideSizes = slideRects.map(measureSize);
1209
+ const slideSizesWithGaps = measureWithGaps();
1210
+ function measureStartGap() {
1211
+ if (!withEdgeGap) return 0;
1212
+ const slideRect = slideRects[0];
1213
+ return mathAbs(containerRect[startEdge] - slideRect[startEdge]);
1214
+ }
1215
+ function measureEndGap() {
1216
+ if (!withEdgeGap) return 0;
1217
+ const style = ownerWindow.getComputedStyle(arrayLast(slides));
1218
+ return parseFloat(style.getPropertyValue(`margin-${endEdge}`));
1219
+ }
1220
+ function measureWithGaps() {
1221
+ return slideRects.map((rect, index, rects) => {
1222
+ const isFirst = !index;
1223
+ const isLast = arrayIsLastIndex(rects, index);
1224
+ if (isFirst) return slideSizes[index] + startGap;
1225
+ if (isLast) return slideSizes[index] + endGap;
1226
+ return rects[index + 1][startEdge] - rect[startEdge];
1227
+ }).map(mathAbs);
1228
+ }
1229
+ const self = {
1230
+ slideSizes,
1231
+ slideSizesWithGaps,
1232
+ startGap,
1233
+ endGap
1234
+ };
1235
+ return self;
1236
+ }
1237
+
1238
+ function SlidesToScroll(axis, viewSize, slidesToScroll, loop, containerRect, slideRects, startGap, endGap, pixelTolerance) {
1239
+ const {
1240
+ startEdge,
1241
+ endEdge,
1242
+ direction
1243
+ } = axis;
1244
+ const groupByNumber = isNumber(slidesToScroll);
1245
+ function byNumber(array, groupSize) {
1246
+ return arrayKeys(array).filter(i => i % groupSize === 0).map(i => array.slice(i, i + groupSize));
1247
+ }
1248
+ function bySize(array) {
1249
+ if (!array.length) return [];
1250
+ return arrayKeys(array).reduce((groups, rectB, index) => {
1251
+ const rectA = arrayLast(groups) || 0;
1252
+ const isFirst = rectA === 0;
1253
+ const isLast = rectB === arrayLastIndex(array);
1254
+ const edgeA = containerRect[startEdge] - slideRects[rectA][startEdge];
1255
+ const edgeB = containerRect[startEdge] - slideRects[rectB][endEdge];
1256
+ const gapA = !loop && isFirst ? direction(startGap) : 0;
1257
+ const gapB = !loop && isLast ? direction(endGap) : 0;
1258
+ const chunkSize = mathAbs(edgeB - gapB - (edgeA + gapA));
1259
+ if (index && chunkSize > viewSize + pixelTolerance) groups.push(rectB);
1260
+ if (isLast) groups.push(array.length);
1261
+ return groups;
1262
+ }, []).map((currentSize, index, groups) => {
1263
+ const previousSize = Math.max(groups[index - 1] || 0);
1264
+ return array.slice(previousSize, currentSize);
1265
+ });
1266
+ }
1267
+ function groupSlides(array) {
1268
+ return groupByNumber ? byNumber(array, slidesToScroll) : bySize(array);
1269
+ }
1270
+ const self = {
1271
+ groupSlides
1272
+ };
1273
+ return self;
1274
+ }
1275
+
1276
+ function Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler) {
1277
+ // Options
1278
+ const {
1279
+ align,
1280
+ axis: scrollAxis,
1281
+ direction,
1282
+ startIndex,
1283
+ loop,
1284
+ duration,
1285
+ dragFree,
1286
+ dragThreshold,
1287
+ inViewThreshold,
1288
+ slidesToScroll: groupSlides,
1289
+ skipSnaps,
1290
+ containScroll,
1291
+ watchResize,
1292
+ watchSlides,
1293
+ watchDrag,
1294
+ watchFocus
1295
+ } = options;
1296
+ // Measurements
1297
+ const pixelTolerance = 2;
1298
+ const nodeRects = NodeRects();
1299
+ const containerRect = nodeRects.measure(container);
1300
+ const slideRects = slides.map(nodeRects.measure);
1301
+ const axis = Axis(scrollAxis, direction);
1302
+ const viewSize = axis.measureSize(containerRect);
1303
+ const percentOfView = PercentOfView(viewSize);
1304
+ const alignment = Alignment(align, viewSize);
1305
+ const containSnaps = !loop && !!containScroll;
1306
+ const readEdgeGap = loop || !!containScroll;
1307
+ const {
1308
+ slideSizes,
1309
+ slideSizesWithGaps,
1310
+ startGap,
1311
+ endGap
1312
+ } = SlideSizes(axis, containerRect, slideRects, slides, readEdgeGap, ownerWindow);
1313
+ const slidesToScroll = SlidesToScroll(axis, viewSize, groupSlides, loop, containerRect, slideRects, startGap, endGap, pixelTolerance);
1314
+ const {
1315
+ snaps,
1316
+ snapsAligned
1317
+ } = ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll);
1318
+ const contentSize = -arrayLast(snaps) + arrayLast(slideSizesWithGaps);
1319
+ const {
1320
+ snapsContained,
1321
+ scrollContainLimit
1322
+ } = ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance);
1323
+ const scrollSnaps = containSnaps ? snapsContained : snapsAligned;
1324
+ const {
1325
+ limit
1326
+ } = ScrollLimit(contentSize, scrollSnaps, loop);
1327
+ // Indexes
1328
+ const index = Counter(arrayLastIndex(scrollSnaps), startIndex, loop);
1329
+ const indexPrevious = index.clone();
1330
+ const slideIndexes = arrayKeys(slides);
1331
+ // Animation
1332
+ const update = ({
1333
+ dragHandler,
1334
+ scrollBody,
1335
+ scrollBounds,
1336
+ options: {
1337
+ loop
1338
+ }
1339
+ }, timeStep) => {
1340
+ if (!loop) scrollBounds.constrain(dragHandler.pointerDown());
1341
+ scrollBody.seek(timeStep);
1342
+ };
1343
+ const render = ({
1344
+ scrollBody,
1345
+ translate,
1346
+ location,
1347
+ offsetLocation,
1348
+ scrollLooper,
1349
+ slideLooper,
1350
+ dragHandler,
1351
+ animation,
1352
+ eventHandler,
1353
+ scrollBounds,
1354
+ options: {
1355
+ loop
1356
+ }
1357
+ }, lagOffset) => {
1358
+ const shouldSettle = scrollBody.settled();
1359
+ const withinBounds = !scrollBounds.shouldConstrain();
1360
+ const hasSettled = loop ? shouldSettle : shouldSettle && withinBounds;
1361
+ if (hasSettled && !dragHandler.pointerDown()) {
1362
+ animation.stop();
1363
+ eventHandler.emit('settle');
1364
+ }
1365
+ if (!hasSettled) eventHandler.emit('scroll');
1366
+ const interpolatedLocation = location.get() * lagOffset + previousLocation.get() * (1 - lagOffset);
1367
+ offsetLocation.set(interpolatedLocation);
1368
+ if (loop) {
1369
+ scrollLooper.loop(scrollBody.direction());
1370
+ slideLooper.loop();
1371
+ }
1372
+ translate.to(offsetLocation.get());
1373
+ };
1374
+ const animation = Animations(ownerDocument, ownerWindow, timeStep => update(engine, timeStep), lagOffset => render(engine, lagOffset));
1375
+ // Shared
1376
+ const friction = 0.68;
1377
+ const startLocation = scrollSnaps[index.get()];
1378
+ const location = Vector1D(startLocation);
1379
+ const previousLocation = Vector1D(startLocation);
1380
+ const offsetLocation = Vector1D(startLocation);
1381
+ const target = Vector1D(startLocation);
1382
+ const scrollBody = ScrollBody(location, offsetLocation, previousLocation, target, duration, friction);
1383
+ const scrollTarget = ScrollTarget(loop, scrollSnaps, contentSize, limit, target);
1384
+ const scrollTo = ScrollTo(animation, index, indexPrevious, scrollBody, scrollTarget, target, eventHandler);
1385
+ const scrollProgress = ScrollProgress(limit);
1386
+ const eventStore = EventStore();
1387
+ const slidesInView = SlidesInView(container, slides, eventHandler, inViewThreshold);
1388
+ const {
1389
+ slideRegistry
1390
+ } = SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes);
1391
+ const slideFocus = SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus);
1392
+ // Engine
1393
+ const engine = {
1394
+ ownerDocument,
1395
+ ownerWindow,
1396
+ eventHandler,
1397
+ containerRect,
1398
+ slideRects,
1399
+ animation,
1400
+ axis,
1401
+ dragHandler: DragHandler(axis, root, ownerDocument, ownerWindow, target, DragTracker(axis, ownerWindow), location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, friction, watchDrag),
1402
+ eventStore,
1403
+ percentOfView,
1404
+ index,
1405
+ indexPrevious,
1406
+ limit,
1407
+ location,
1408
+ offsetLocation,
1409
+ previousLocation,
1410
+ options,
1411
+ resizeHandler: ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects),
1412
+ scrollBody,
1413
+ scrollBounds: ScrollBounds(limit, offsetLocation, target, scrollBody, percentOfView),
1414
+ scrollLooper: ScrollLooper(contentSize, limit, offsetLocation, [location, offsetLocation, previousLocation, target]),
1415
+ scrollProgress,
1416
+ scrollSnapList: scrollSnaps.map(scrollProgress.get),
1417
+ scrollSnaps,
1418
+ scrollTarget,
1419
+ scrollTo,
1420
+ slideLooper: SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, offsetLocation, slides),
1421
+ slideFocus,
1422
+ slidesHandler: SlidesHandler(container, eventHandler, watchSlides),
1423
+ slidesInView,
1424
+ slideIndexes,
1425
+ slideRegistry,
1426
+ slidesToScroll,
1427
+ target,
1428
+ translate: Translate(axis, container)
1429
+ };
1430
+ return engine;
1431
+ }
1432
+
1433
+ function EventHandler() {
1434
+ let listeners = {};
1435
+ let api;
1436
+ function init(emblaApi) {
1437
+ api = emblaApi;
1438
+ }
1439
+ function getListeners(evt) {
1440
+ return listeners[evt] || [];
1441
+ }
1442
+ function emit(evt) {
1443
+ getListeners(evt).forEach(e => e(api, evt));
1444
+ return self;
1445
+ }
1446
+ function on(evt, cb) {
1447
+ listeners[evt] = getListeners(evt).concat([cb]);
1448
+ return self;
1449
+ }
1450
+ function off(evt, cb) {
1451
+ listeners[evt] = getListeners(evt).filter(e => e !== cb);
1452
+ return self;
1453
+ }
1454
+ function clear() {
1455
+ listeners = {};
1456
+ }
1457
+ const self = {
1458
+ init,
1459
+ emit,
1460
+ off,
1461
+ on,
1462
+ clear
1463
+ };
1464
+ return self;
1465
+ }
1466
+
1467
+ const defaultOptions = {
1468
+ align: 'center',
1469
+ axis: 'x',
1470
+ container: null,
1471
+ slides: null,
1472
+ containScroll: 'trimSnaps',
1473
+ direction: 'ltr',
1474
+ slidesToScroll: 1,
1475
+ inViewThreshold: 0,
1476
+ breakpoints: {},
1477
+ dragFree: false,
1478
+ dragThreshold: 10,
1479
+ loop: false,
1480
+ skipSnaps: false,
1481
+ duration: 25,
1482
+ startIndex: 0,
1483
+ active: true,
1484
+ watchDrag: true,
1485
+ watchResize: true,
1486
+ watchSlides: true,
1487
+ watchFocus: true
1488
+ };
1489
+
1490
+ function OptionsHandler(ownerWindow) {
1491
+ function mergeOptions(optionsA, optionsB) {
1492
+ return objectsMergeDeep(optionsA, optionsB || {});
1493
+ }
1494
+ function optionsAtMedia(options) {
1495
+ const optionsAtMedia = options.breakpoints || {};
1496
+ const matchedMediaOptions = objectKeys(optionsAtMedia).filter(media => ownerWindow.matchMedia(media).matches).map(media => optionsAtMedia[media]).reduce((a, mediaOption) => mergeOptions(a, mediaOption), {});
1497
+ return mergeOptions(options, matchedMediaOptions);
1498
+ }
1499
+ function optionsMediaQueries(optionsList) {
1500
+ return optionsList.map(options => objectKeys(options.breakpoints || {})).reduce((acc, mediaQueries) => acc.concat(mediaQueries), []).map(ownerWindow.matchMedia);
1501
+ }
1502
+ const self = {
1503
+ mergeOptions,
1504
+ optionsAtMedia,
1505
+ optionsMediaQueries
1506
+ };
1507
+ return self;
1508
+ }
1509
+
1510
+ function PluginsHandler(optionsHandler) {
1511
+ let activePlugins = [];
1512
+ function init(emblaApi, plugins) {
1513
+ activePlugins = plugins.filter(({
1514
+ options
1515
+ }) => optionsHandler.optionsAtMedia(options).active !== false);
1516
+ activePlugins.forEach(plugin => plugin.init(emblaApi, optionsHandler));
1517
+ return plugins.reduce((map, plugin) => Object.assign(map, {
1518
+ [plugin.name]: plugin
1519
+ }), {});
1520
+ }
1521
+ function destroy() {
1522
+ activePlugins = activePlugins.filter(plugin => plugin.destroy());
1523
+ }
1524
+ const self = {
1525
+ init,
1526
+ destroy
1527
+ };
1528
+ return self;
1529
+ }
1530
+
1531
+ function EmblaCarousel(root, userOptions, userPlugins) {
1532
+ const ownerDocument = root.ownerDocument;
1533
+ const ownerWindow = ownerDocument.defaultView;
1534
+ const optionsHandler = OptionsHandler(ownerWindow);
1535
+ const pluginsHandler = PluginsHandler(optionsHandler);
1536
+ const mediaHandlers = EventStore();
1537
+ const eventHandler = EventHandler();
1538
+ const {
1539
+ mergeOptions,
1540
+ optionsAtMedia,
1541
+ optionsMediaQueries
1542
+ } = optionsHandler;
1543
+ const {
1544
+ on,
1545
+ off,
1546
+ emit
1547
+ } = eventHandler;
1548
+ const reInit = reActivate;
1549
+ let destroyed = false;
1550
+ let engine;
1551
+ let optionsBase = mergeOptions(defaultOptions, EmblaCarousel.globalOptions);
1552
+ let options = mergeOptions(optionsBase);
1553
+ let pluginList = [];
1554
+ let pluginApis;
1555
+ let container;
1556
+ let slides;
1557
+ function storeElements() {
1558
+ const {
1559
+ container: userContainer,
1560
+ slides: userSlides
1561
+ } = options;
1562
+ const customContainer = isString(userContainer) ? root.querySelector(userContainer) : userContainer;
1563
+ container = customContainer || root.children[0];
1564
+ const customSlides = isString(userSlides) ? container.querySelectorAll(userSlides) : userSlides;
1565
+ slides = [].slice.call(customSlides || container.children);
1566
+ }
1567
+ function createEngine(options) {
1568
+ const engine = Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler);
1569
+ if (options.loop && !engine.slideLooper.canLoop()) {
1570
+ const optionsWithoutLoop = Object.assign({}, options, {
1571
+ loop: false
1572
+ });
1573
+ return createEngine(optionsWithoutLoop);
1574
+ }
1575
+ return engine;
1576
+ }
1577
+ function activate(withOptions, withPlugins) {
1578
+ if (destroyed) return;
1579
+ optionsBase = mergeOptions(optionsBase, withOptions);
1580
+ options = optionsAtMedia(optionsBase);
1581
+ pluginList = withPlugins || pluginList;
1582
+ storeElements();
1583
+ engine = createEngine(options);
1584
+ optionsMediaQueries([optionsBase, ...pluginList.map(({
1585
+ options
1586
+ }) => options)]).forEach(query => mediaHandlers.add(query, 'change', reActivate));
1587
+ if (!options.active) return;
1588
+ engine.translate.to(engine.location.get());
1589
+ engine.animation.init();
1590
+ engine.slidesInView.init();
1591
+ engine.slideFocus.init(self);
1592
+ engine.eventHandler.init(self);
1593
+ engine.resizeHandler.init(self);
1594
+ engine.slidesHandler.init(self);
1595
+ if (engine.options.loop) engine.slideLooper.loop();
1596
+ if (container.offsetParent && slides.length) engine.dragHandler.init(self);
1597
+ pluginApis = pluginsHandler.init(self, pluginList);
1598
+ }
1599
+ function reActivate(withOptions, withPlugins) {
1600
+ const startIndex = selectedScrollSnap();
1601
+ deActivate();
1602
+ activate(mergeOptions({
1603
+ startIndex
1604
+ }, withOptions), withPlugins);
1605
+ eventHandler.emit('reInit');
1606
+ }
1607
+ function deActivate() {
1608
+ engine.dragHandler.destroy();
1609
+ engine.eventStore.clear();
1610
+ engine.translate.clear();
1611
+ engine.slideLooper.clear();
1612
+ engine.resizeHandler.destroy();
1613
+ engine.slidesHandler.destroy();
1614
+ engine.slidesInView.destroy();
1615
+ engine.animation.destroy();
1616
+ pluginsHandler.destroy();
1617
+ mediaHandlers.clear();
1618
+ }
1619
+ function destroy() {
1620
+ if (destroyed) return;
1621
+ destroyed = true;
1622
+ mediaHandlers.clear();
1623
+ deActivate();
1624
+ eventHandler.emit('destroy');
1625
+ eventHandler.clear();
1626
+ }
1627
+ function scrollTo(index, jump, direction) {
1628
+ if (!options.active || destroyed) return;
1629
+ engine.scrollBody.useBaseFriction().useDuration(jump === true ? 0 : options.duration);
1630
+ engine.scrollTo.index(index, direction || 0);
1631
+ }
1632
+ function scrollNext(jump) {
1633
+ const next = engine.index.add(1).get();
1634
+ scrollTo(next, jump, -1);
1635
+ }
1636
+ function scrollPrev(jump) {
1637
+ const prev = engine.index.add(-1).get();
1638
+ scrollTo(prev, jump, 1);
1639
+ }
1640
+ function canScrollNext() {
1641
+ const next = engine.index.add(1).get();
1642
+ return next !== selectedScrollSnap();
1643
+ }
1644
+ function canScrollPrev() {
1645
+ const prev = engine.index.add(-1).get();
1646
+ return prev !== selectedScrollSnap();
1647
+ }
1648
+ function scrollSnapList() {
1649
+ return engine.scrollSnapList;
1650
+ }
1651
+ function scrollProgress() {
1652
+ return engine.scrollProgress.get(engine.location.get());
1653
+ }
1654
+ function selectedScrollSnap() {
1655
+ return engine.index.get();
1656
+ }
1657
+ function previousScrollSnap() {
1658
+ return engine.indexPrevious.get();
1659
+ }
1660
+ function slidesInView() {
1661
+ return engine.slidesInView.get();
1662
+ }
1663
+ function slidesNotInView() {
1664
+ return engine.slidesInView.get(false);
1665
+ }
1666
+ function plugins() {
1667
+ return pluginApis;
1668
+ }
1669
+ function internalEngine() {
1670
+ return engine;
1671
+ }
1672
+ function rootNode() {
1673
+ return root;
1674
+ }
1675
+ function containerNode() {
1676
+ return container;
1677
+ }
1678
+ function slideNodes() {
1679
+ return slides;
1680
+ }
1681
+ const self = {
1682
+ canScrollNext,
1683
+ canScrollPrev,
1684
+ containerNode,
1685
+ internalEngine,
1686
+ destroy,
1687
+ off,
1688
+ on,
1689
+ emit,
1690
+ plugins,
1691
+ previousScrollSnap,
1692
+ reInit,
1693
+ rootNode,
1694
+ scrollNext,
1695
+ scrollPrev,
1696
+ scrollProgress,
1697
+ scrollSnapList,
1698
+ scrollTo,
1699
+ selectedScrollSnap,
1700
+ slideNodes,
1701
+ slidesInView,
1702
+ slidesNotInView
1703
+ };
1704
+ activate(userOptions, userPlugins);
1705
+ setTimeout(() => eventHandler.emit('init'), 0);
1706
+ return self;
1707
+ }
1708
+ EmblaCarousel.globalOptions = undefined;
1709
+
1710
+ function useEmblaCarousel(options = {}, plugins = []) {
1711
+ const storedOptions = React.useRef(options);
1712
+ const storedPlugins = React.useRef(plugins);
1713
+ const [emblaApi, setEmblaApi] = React.useState();
1714
+ const [viewport, setViewport] = React.useState();
1715
+ const reInit = React.useCallback(() => {
1716
+ if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current);
1717
+ }, [emblaApi]);
1718
+ React.useEffect(() => {
1719
+ if (areOptionsEqual(storedOptions.current, options)) return;
1720
+ storedOptions.current = options;
1721
+ reInit();
1722
+ }, [options, reInit]);
1723
+ React.useEffect(() => {
1724
+ if (arePluginsEqual(storedPlugins.current, plugins)) return;
1725
+ storedPlugins.current = plugins;
1726
+ reInit();
1727
+ }, [plugins, reInit]);
1728
+ React.useEffect(() => {
1729
+ if (canUseDOM() && viewport) {
1730
+ EmblaCarousel.globalOptions = useEmblaCarousel.globalOptions;
1731
+ const newEmblaApi = EmblaCarousel(viewport, storedOptions.current, storedPlugins.current);
1732
+ setEmblaApi(newEmblaApi);
1733
+ return () => newEmblaApi.destroy();
1734
+ } else {
1735
+ setEmblaApi(undefined);
1736
+ }
1737
+ }, [viewport, setEmblaApi]);
1738
+ return [setViewport, emblaApi];
1739
+ }
1740
+ useEmblaCarousel.globalOptions = undefined;
1741
+
1742
+ /**
1743
+ * Do not edit directly
1744
+ * Generated on Thu, 14 Nov 2024 15:25:13 GMT
1745
+ */
1746
+ var ArcSizeBreakpointsXs = "320px";
1747
+ var ArcSizeBreakpointsS = "636px";
1748
+ var ArcSizeBreakpointsM = "768px";
1749
+ var ArcSizeBreakpointsL = "1024px";
1750
+ var ArcSizeBreakpointsXl = "1280px";
1751
+
1752
+ var XS_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsXs, ")");
1753
+ var S_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsS, ")");
1754
+ var M_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsM, ")");
1755
+ var L_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsL, ")");
1756
+ var XL_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsXl, ")");
1757
+
1758
+ var getOptions = function (itemsToScroll, loop, responsive) {
1759
+ var breakpoints = [
1760
+ [XS_BREAKPOINT, "xs"],
1761
+ [S_BREAKPOINT, "s"],
1762
+ [M_BREAKPOINT, "m"],
1763
+ [L_BREAKPOINT, "l"],
1764
+ [XL_BREAKPOINT, "xl"],
1765
+ ];
1766
+ var breakpointOptions = breakpoints.reduce(function (acc, _a) {
1767
+ var _b;
1768
+ var _c;
1769
+ var query = _a[0], breakpoint = _a[1];
1770
+ return index_es.__assign(index_es.__assign({}, acc), index_es.__assign({}, ((responsive === null || responsive === void 0 ? void 0 : responsive[breakpoint])
1771
+ ? (_b = {},
1772
+ _b[query] = {
1773
+ slidesToScroll: (_c = responsive === null || responsive === void 0 ? void 0 : responsive[breakpoint]) === null || _c === void 0 ? void 0 : _c.itemsToScroll
1774
+ },
1775
+ _b) : {})));
1776
+ }, {});
1777
+ return {
1778
+ loop: loop,
1779
+ skipSnaps: true,
1780
+ align: "start",
1781
+ slidesToScroll: itemsToScroll,
1782
+ breakpoints: breakpointOptions
1783
+ };
1784
+ };
1785
+
1786
+ var getSlideWidth = function (_a) {
1787
+ var screenSizes = _a.screenSizes, itemsPerSlide = _a.itemsPerSlide, isPartialVisible = _a.isPartialVisible, responsive = _a.responsive, children = _a.children;
1788
+ var responsiveConfig = responsive &&
1789
+ Object.keys(screenSizes).find(function (size) {
1790
+ return responsive && screenSizes[size] && responsive[size];
1791
+ });
1792
+ var slideConfig = responsiveConfig
1793
+ ? responsive[responsiveConfig]
1794
+ : { itemsPerSlide: itemsPerSlide, isPartialVisible: isPartialVisible };
1795
+ var totalItems = React__default["default"].Children.count(children);
1796
+ var itemsPerView = slideConfig.itemsPerSlide > totalItems
1797
+ ? 1
1798
+ : Math.max(1, slideConfig.itemsPerSlide);
1799
+ var widthAdjustment = slideConfig.isPartialVisible ? 10 : 0;
1800
+ return (100 - widthAdjustment) / itemsPerView;
1801
+ };
1802
+
1803
+ var DotButton = function (_a) {
1804
+ var visibleSlideIndex = _a.visibleSlideIndex, scrollSnapIndex = _a.scrollSnapIndex, focusIndex = _a.focusIndex, onKeyDown = _a.onKeyDown, onClick = _a.onClick;
1805
+ var ref = React.useRef(null);
1806
+ var isSelected = visibleSlideIndex === scrollSnapIndex;
1807
+ React.useEffect(function () {
1808
+ var _a;
1809
+ if (focusIndex === scrollSnapIndex) {
1810
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
1811
+ }
1812
+ }, [focusIndex, scrollSnapIndex]);
1813
+ return (React__default["default"].createElement("button", { ref: ref, tabIndex: scrollSnapIndex === 0 ? 0 : -1, className: index.classNames("arc-Carousel-dot", {
1814
+ "arc-Carousel-dot--selected": isSelected
1815
+ }), onKeyDown: onKeyDown(scrollSnapIndex), onClick: function () { return onClick(scrollSnapIndex); }, "aria-selected": isSelected, role: "tab", "aria-label": "Show slide ".concat(scrollSnapIndex + 1) }));
1816
+ };
1817
+
1818
+ var KeyNames;
1819
+ (function (KeyNames) {
1820
+ KeyNames["ArrowLeft"] = "ArrowLeft";
1821
+ KeyNames["ArrowRight"] = "ArrowRight";
1822
+ KeyNames["Escape"] = "Escape";
1823
+ })(KeyNames || (KeyNames = {}));
1824
+
1825
+ var Carousel = function (_a) {
1826
+ var children = _a.children, responsive = _a.responsive, _b = _a.itemsToScroll, itemsToScroll = _b === void 0 ? 1 : _b, _c = _a.itemsPerSlide, itemsPerSlide = _c === void 0 ? 1 : _c, _d = _a.withGutter, withGutter = _d === void 0 ? true : _d, _e = _a.loop, loop = _e === void 0 ? false : _e, _f = _a.isPartialVisible, isPartialVisible = _f === void 0 ? false : _f;
1827
+ var id = React.useId();
1828
+ var _g = useEmblaCarousel(getOptions(itemsToScroll, loop, responsive)), emblaRef = _g[0], emblaApi = _g[1];
1829
+ var _h = React.useState(), dotButtonFocusIndex = _h[0], setDotButtonFocusIndex = _h[1];
1830
+ var prevButtonRef = React.useRef(null);
1831
+ var _j = React.useState(0), visibleSlideIndex = _j[0], setVisibleSlideIndex = _j[1];
1832
+ var _k = React.useState(true), prevButtonEnabled = _k[0], setPrevButtonEnabled = _k[1];
1833
+ var _l = React.useState(true), nextButtonEnabled = _l[0], setNextButtonEnabled = _l[1];
1834
+ var isMinWidthArcBreakpointXs = useMediaQuery.useMediaQuery(XS_BREAKPOINT);
1835
+ var isMinWidthArcBreakpointS = useMediaQuery.useMediaQuery(S_BREAKPOINT);
1836
+ var isMinWidthArcBreakpointM = useMediaQuery.useMediaQuery(M_BREAKPOINT);
1837
+ var isMinWidthArcBreakpointL = useMediaQuery.useMediaQuery(L_BREAKPOINT);
1838
+ var isMinWidthArcBreakpointXl = useMediaQuery.useMediaQuery(XL_BREAKPOINT);
1839
+ var slideWidth = getSlideWidth({
1840
+ screenSizes: {
1841
+ xl: isMinWidthArcBreakpointXl,
1842
+ l: isMinWidthArcBreakpointL,
1843
+ m: isMinWidthArcBreakpointM,
1844
+ s: isMinWidthArcBreakpointS,
1845
+ xs: isMinWidthArcBreakpointXs
1846
+ },
1847
+ itemsPerSlide: itemsPerSlide,
1848
+ isPartialVisible: isPartialVisible,
1849
+ responsive: responsive,
1850
+ children: children
1851
+ });
1852
+ var scrollSnaps = Array.from({
1853
+ length: (emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollSnapList().length) || 0
1854
+ }).map(function (_, i) { return i; });
1855
+ var scrollPrev = React.useCallback(function () { return emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollPrev(); }, [emblaApi]);
1856
+ var scrollNext = React.useCallback(function () { return emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollNext(); }, [emblaApi]);
1857
+ var onSelect = React.useCallback(function (emblaApi) {
1858
+ setVisibleSlideIndex(emblaApi.selectedScrollSnap());
1859
+ setPrevButtonEnabled(emblaApi.canScrollPrev());
1860
+ setNextButtonEnabled(emblaApi.canScrollNext());
1861
+ }, []);
1862
+ var onDotButtonClick = React.useCallback(function (index) {
1863
+ if (!emblaApi)
1864
+ return;
1865
+ emblaApi.scrollTo(index);
1866
+ }, [emblaApi]);
1867
+ var onSlideKeyDown = function (e) {
1868
+ var _a;
1869
+ if (e.key === KeyNames.Escape) {
1870
+ prevButtonEnabled
1871
+ ? (_a = prevButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus()
1872
+ : setDotButtonFocusIndex(0);
1873
+ }
1874
+ };
1875
+ var onDotButtonKeyDown = function (index) { return function (e) {
1876
+ if (e.key === KeyNames.ArrowLeft) {
1877
+ setDotButtonFocusIndex(index === 0 ? scrollSnaps.length - 1 : index - 1);
1878
+ }
1879
+ if (e.key === KeyNames.ArrowRight) {
1880
+ setDotButtonFocusIndex(index + 1 === scrollSnaps.length ? 0 : index + 1);
1881
+ }
1882
+ }; };
1883
+ React.useEffect(function () {
1884
+ if (!emblaApi)
1885
+ return;
1886
+ onSelect(emblaApi);
1887
+ emblaApi.on("reInit", onSelect).on("select", onSelect);
1888
+ }, [emblaApi, onSelect]);
1889
+ React.useEffect(function () {
1890
+ if (!emblaApi)
1891
+ return;
1892
+ emblaApi.scrollTo(0);
1893
+ }, [
1894
+ emblaApi,
1895
+ isMinWidthArcBreakpointXs,
1896
+ isMinWidthArcBreakpointS,
1897
+ isMinWidthArcBreakpointM,
1898
+ isMinWidthArcBreakpointL,
1899
+ isMinWidthArcBreakpointXl,
1900
+ ]);
1901
+ return (React__default["default"].createElement("div", { className: "arc-Carousel" },
1902
+ React__default["default"].createElement("div", { className: "arc-Carousel-container" },
1903
+ React__default["default"].createElement("div", { ref: emblaRef, className: index.classNames("arc-Carousel-viewport", {
1904
+ "arc-Carousel-viewport--gutter": withGutter
1905
+ }) },
1906
+ React__default["default"].createElement("div", { className: "arc-Carousel-slider", role: "region", "aria-roledescription": "carousel" }, React__default["default"].Children.map(children, function (child, i) { return (React__default["default"].createElement("div", { onKeyDown: onSlideKeyDown, style: { flex: "0 0 ".concat(slideWidth, "%"), width: "".concat(slideWidth, "%") }, className: "arc-Carousel-slide", key: "".concat(id, "-option-").concat(i), role: "group", "aria-roledescription": "slide" }, child)); })))),
1907
+ React__default["default"].createElement("div", { className: "arc-Carousel-nav" },
1908
+ React__default["default"].createElement("button", { "data-testid": "previous-button", ref: prevButtonRef, className: index.classNames("arc-Carousel-navButton", {
1909
+ "arc-Carousel-navButton--hidden": !prevButtonEnabled
1910
+ }), onClick: scrollPrev, "aria-label": "Show slide ".concat(visibleSlideIndex) },
1911
+ React__default["default"].createElement(ThemeIcon.ThemeIcon, { size: 32, icon: "carouselLeft" })),
1912
+ React__default["default"].createElement("div", { className: "arc-Carousel-dotContainer", role: "tablist" }, scrollSnaps.map(function (scrollSnapIndex) { return (React__default["default"].createElement(DotButton, { key: "".concat(id, "-dot-").concat(scrollSnapIndex), focusIndex: dotButtonFocusIndex, scrollSnapIndex: scrollSnapIndex, visibleSlideIndex: visibleSlideIndex, onKeyDown: onDotButtonKeyDown, onClick: function (index) { return onDotButtonClick(index); } })); })),
1913
+ React__default["default"].createElement("button", { "data-testid": "next-button", className: index.classNames("arc-Carousel-navButton", {
1914
+ "arc-Carousel-navButton--hidden": !nextButtonEnabled
1915
+ }), onClick: scrollNext, "aria-label": "Show slide ".concat(loop && visibleSlideIndex === scrollSnaps.length - 1
1916
+ ? 1
1917
+ : visibleSlideIndex + 2) },
1918
+ React__default["default"].createElement(ThemeIcon.ThemeIcon, { size: 32, icon: "carouselRight" })))));
1919
+ };
1920
+
1921
+ exports.Carousel = Carousel;