@content-blocks/js 0.7.6 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +111 -3
  3. package/THIRD-PARTY-NOTICES.md +21 -0
  4. package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -2
  5. package/dist/cjs/content-accordion.cjs.entry.js +87 -0
  6. package/dist/cjs/content-blocks.cjs.js +35 -11
  7. package/dist/cjs/content-button.cjs.entry.js +113 -0
  8. package/dist/cjs/content-carousel.cjs.entry.js +153 -47
  9. package/dist/cjs/content-grid-formatter.cjs.entry.js +102 -0
  10. package/dist/cjs/content-hero-block.cjs.entry.js +45 -0
  11. package/dist/cjs/content-image.cjs.entry.js +153 -0
  12. package/dist/cjs/content-line.cjs.entry.js +61 -0
  13. package/dist/cjs/content-navigation-block.cjs.entry.js +51 -34
  14. package/dist/cjs/content-overlay.cjs.entry.js +641 -0
  15. package/dist/cjs/content-spacer.cjs.entry.js +75 -0
  16. package/dist/cjs/content-split-block.cjs.entry.js +22 -19
  17. package/dist/cjs/content-tabs.cjs.entry.js +38 -21
  18. package/dist/cjs/content-text-block.cjs.entry.js +63 -0
  19. package/dist/cjs/content-tout-block.cjs.entry.js +34 -0
  20. package/dist/cjs/{content-accordion_11.cjs.entry.js → content-video.cjs.entry.js} +14560 -12927
  21. package/dist/cjs/{focus-trap.esm-7bc384a0.js → focus-trap.esm-ZwN-anf1.js} +484 -190
  22. package/dist/cjs/{index-2e0ce692.js → index-B1U6Gweq.js} +348 -246
  23. package/dist/cjs/index-ClnpH9XB.js +2170 -0
  24. package/dist/cjs/index-CyalvZJn.js +1719 -0
  25. package/dist/cjs/index-DUvWvBDN.js +290 -0
  26. package/dist/cjs/index-voGY4Tkl.js +4705 -0
  27. package/dist/cjs/index.cjs.js +2 -5
  28. package/dist/cjs/loader.cjs.js +3 -8
  29. package/dist/cjs/responsive-component-C5eJS82z.js +171 -0
  30. package/dist/cjs/responsive-component-DMdnQIPV.js +171 -0
  31. package/dist/cjs/swiper-KLYbvU1K.js +3931 -0
  32. package/dist/cjs/{swiper-8221f4e8.js → swiper-_Z8Y4IJI.js} +269 -236
  33. package/dist/cjs/utils-BCHaRGm_.js +462 -0
  34. package/dist/cjs/{utils-df044337.js → utils-C3gXIS2t.js} +51 -49
  35. package/dist/cjs/utils-DUvWvBDN.js +290 -0
  36. package/dist/collection/blocks/content-hero-block/content-hero-block.css +1 -1
  37. package/dist/collection/blocks/content-hero-block/content-hero-block.js +33 -48
  38. package/dist/collection/blocks/content-split-block/content-split-block.css +16 -5
  39. package/dist/collection/blocks/content-split-block/content-split-block.js +29 -48
  40. package/dist/collection/blocks/content-text-block/content-text-block.js +65 -59
  41. package/dist/collection/blocks/content-tout-block/content-tout-block.css +3 -0
  42. package/dist/collection/blocks/content-tout-block/content-tout-block.js +22 -47
  43. package/dist/collection/collection-manifest.json +8 -5
  44. package/dist/collection/components/content-accordion/content-accordion.css +20 -1
  45. package/dist/collection/components/content-accordion/content-accordion.js +67 -33
  46. package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js +0 -1
  47. package/dist/collection/components/content-carousel/content-carousel.css +60 -4
  48. package/dist/collection/components/content-carousel/content-carousel.js +294 -44
  49. package/dist/collection/components/content-navigation-block/content-navigation-block.css +15 -1
  50. package/dist/collection/components/content-navigation-block/content-navigation-block.js +86 -42
  51. package/dist/collection/components/content-overlay/content-overlay.css +36 -5
  52. package/dist/collection/components/content-overlay/content-overlay.js +181 -120
  53. package/dist/collection/components/content-overlay/libraries/aria-dialog.js +0 -1
  54. package/dist/collection/components/content-overlay/libraries/aria-utilities.js +0 -1
  55. package/dist/collection/components/content-tabs/content-tabs.js +7 -49
  56. package/dist/collection/components/content-tabs/libraries/w3_tabs.js +0 -1
  57. package/dist/collection/elements/content-button/content-button.css +8 -7
  58. package/dist/collection/elements/content-button/content-button.js +103 -84
  59. package/dist/collection/elements/content-image/content-image.css +3 -1
  60. package/dist/collection/elements/content-image/content-image.js +176 -95
  61. package/dist/collection/elements/content-line/content-line.js +63 -54
  62. package/dist/collection/elements/content-video/content-video.css +1 -1
  63. package/dist/collection/elements/content-video/content-video.js +165 -92
  64. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +8 -2
  65. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +167 -89
  66. package/dist/collection/formatters/content-spacer/content-spacer.js +86 -209
  67. package/dist/collection/global/content-blocks-reset.css +77 -0
  68. package/dist/collection/index.js +1 -1
  69. package/dist/collection/sass/_mixins.scss +21 -5
  70. package/dist/collection/sass/_variables.scss +15 -15
  71. package/dist/collection/setupFiles.js +0 -1
  72. package/dist/collection/site/site.js +67 -0
  73. package/dist/collection/utils/breakpoints.js +162 -0
  74. package/dist/collection/utils/responsive-component.js +249 -0
  75. package/dist/collection/utils/utils.js +32 -42
  76. package/dist/components/content-accordion.js +65 -44
  77. package/dist/components/content-button.js +89 -43
  78. package/dist/components/content-carousel.js +172 -55
  79. package/dist/components/content-grid-formatter.js +127 -3
  80. package/dist/components/content-hero-block.js +33 -26
  81. package/dist/components/content-image.js +127 -71
  82. package/dist/components/content-line.js +56 -35
  83. package/dist/components/content-navigation-block.js +62 -39
  84. package/dist/components/content-overlay.js +128 -67
  85. package/dist/components/content-spacer.js +70 -54
  86. package/dist/components/content-split-block.js +33 -32
  87. package/dist/components/content-tabs.js +46 -25
  88. package/dist/components/content-text-block.js +55 -35
  89. package/dist/components/content-tout-block.js +29 -27
  90. package/dist/components/content-video.js +14624 -11972
  91. package/dist/{esm/focus-trap.esm-8fb54175.js → components/focus-trap.esm.js} +484 -190
  92. package/dist/components/index.d.ts +2 -0
  93. package/dist/components/index.js +3 -3
  94. package/dist/components/{p-5a91aa1b.js → index2.js} +348 -246
  95. package/dist/components/p-BWRCeMvO.js +1 -0
  96. package/dist/components/p-CYF5GU_q.js +1 -0
  97. package/dist/components/p-DXUoPIwl.js +10 -0
  98. package/dist/components/p-D_Ll4QNj.js +1 -0
  99. package/dist/components/p-DhIoW7H3.js +1 -0
  100. package/dist/components/responsive-component.js +168 -0
  101. package/dist/components/{p-e5dc4ea4.js → swiper.js} +268 -235
  102. package/dist/components/utils.js +4969 -0
  103. package/dist/{esm/utils-1c9f0ec1.js → components/utils2.js} +51 -50
  104. package/dist/content-blocks/content-accordion.entry.js +85 -0
  105. package/dist/content-blocks/content-blocks.esm.js +47 -2
  106. package/dist/content-blocks/content-button.entry.js +111 -0
  107. package/dist/content-blocks/content-carousel.entry.js +188 -0
  108. package/dist/content-blocks/content-grid-formatter.entry.js +100 -0
  109. package/dist/content-blocks/content-hero-block.entry.js +43 -0
  110. package/dist/content-blocks/content-image.entry.js +151 -0
  111. package/dist/content-blocks/content-line.entry.js +59 -0
  112. package/dist/content-blocks/content-navigation-block.entry.js +105 -0
  113. package/dist/content-blocks/content-overlay.entry.js +639 -0
  114. package/dist/content-blocks/content-spacer.entry.js +73 -0
  115. package/dist/content-blocks/content-split-block.entry.js +34 -0
  116. package/dist/content-blocks/content-tabs.entry.js +245 -0
  117. package/dist/content-blocks/content-text-block.entry.js +61 -0
  118. package/dist/content-blocks/content-tout-block.entry.js +32 -0
  119. package/dist/{esm/content-accordion_11.entry.js → content-blocks/content-video.entry.js} +14535 -12890
  120. package/dist/{components/p-a2fedf8a.js → content-blocks/focus-trap.esm-DXUoPIwl.js} +484 -190
  121. package/dist/content-blocks/global/content-blocks-reset.css +77 -0
  122. package/dist/content-blocks/index-BFDJMblF.js +4690 -0
  123. package/dist/{esm/index-f45a9c45.js → content-blocks/index-P1YnSd-O.js} +348 -246
  124. package/dist/content-blocks/index.esm.js +1 -2
  125. package/dist/content-blocks/p-008457f0.entry.js +1 -0
  126. package/dist/content-blocks/p-052692f1.entry.js +1 -0
  127. package/dist/content-blocks/p-0f71bd32.entry.js +1 -0
  128. package/dist/content-blocks/p-1f154617.entry.js +1 -0
  129. package/dist/content-blocks/p-2554ebd8.entry.js +1 -0
  130. package/dist/content-blocks/p-4afd6511.entry.js +1 -0
  131. package/dist/content-blocks/p-78d5de9f.entry.js +1 -0
  132. package/dist/content-blocks/p-7bcf7e7e.entry.js +1 -0
  133. package/dist/content-blocks/p-9058031c.entry.js +1 -0
  134. package/dist/content-blocks/p-9c41ac23.entry.js +17 -0
  135. package/dist/content-blocks/p-CLwOzPEO.js +3 -0
  136. package/dist/content-blocks/p-CYF5GU_q.js +1 -0
  137. package/dist/content-blocks/p-CjR_4mPu.js +1 -0
  138. package/dist/content-blocks/p-DQuL1Twl.js +1 -0
  139. package/dist/content-blocks/p-DXUoPIwl.js +10 -0
  140. package/dist/content-blocks/p-D_Ll4QNj.js +1 -0
  141. package/dist/content-blocks/p-DhIoW7H3.js +1 -0
  142. package/dist/content-blocks/p-DzYwy_62.js +1 -0
  143. package/dist/content-blocks/p-b2e6358a.entry.js +1 -0
  144. package/dist/content-blocks/p-c783bc68.entry.js +1 -0
  145. package/dist/content-blocks/p-e3d81e15.entry.js +1 -0
  146. package/dist/content-blocks/p-f23b4aae.entry.js +1 -0
  147. package/dist/content-blocks/p-f75c9094.entry.js +1 -0
  148. package/dist/content-blocks/responsive-component-BsLrcKbS.js +169 -0
  149. package/dist/content-blocks/sass/_mixins.scss +21 -5
  150. package/dist/content-blocks/sass/_variables.scss +15 -15
  151. package/dist/{esm/swiper-e9621adb.js → content-blocks/swiper-nBv069TB.js} +268 -235
  152. package/dist/{components/p-b85cfa86.js → content-blocks/utils--SDsQnWS.js} +51 -50
  153. package/dist/content-blocks/utils-Bak__24s.js +280 -0
  154. package/dist/docs.d.ts +480 -0
  155. package/dist/docs.json +5312 -0
  156. package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -2
  157. package/dist/esm/content-accordion.entry.js +85 -0
  158. package/dist/esm/content-blocks.js +33 -8
  159. package/dist/esm/content-button.entry.js +111 -0
  160. package/dist/esm/content-carousel.entry.js +153 -45
  161. package/dist/esm/content-grid-formatter.entry.js +100 -0
  162. package/dist/esm/content-hero-block.entry.js +43 -0
  163. package/dist/esm/content-image.entry.js +151 -0
  164. package/dist/esm/content-line.entry.js +59 -0
  165. package/dist/esm/content-navigation-block.entry.js +51 -32
  166. package/dist/esm/content-overlay.entry.js +639 -0
  167. package/dist/esm/content-spacer.entry.js +73 -0
  168. package/dist/esm/content-split-block.entry.js +22 -17
  169. package/dist/esm/content-tabs.entry.js +38 -19
  170. package/dist/esm/content-text-block.entry.js +61 -0
  171. package/dist/esm/content-tout-block.entry.js +32 -0
  172. package/dist/esm/content-video.entry.js +72033 -0
  173. package/dist/esm/focus-trap.esm-DXUoPIwl.js +1801 -0
  174. package/dist/esm/index-BASCLGuP.js +1713 -0
  175. package/dist/esm/index-BFDJMblF.js +4690 -0
  176. package/dist/esm/index-CLwOzPEO.js +2161 -0
  177. package/dist/esm/index-CjR_4mPu.js +280 -0
  178. package/dist/esm/index-P1YnSd-O.js +5397 -0
  179. package/dist/esm/index.js +1 -3
  180. package/dist/esm/loader.js +3 -6
  181. package/dist/esm/responsive-component-BsLrcKbS.js +169 -0
  182. package/dist/esm/responsive-component-D7dJHMp0.js +169 -0
  183. package/dist/esm/swiper-CtypHPwF.js +3928 -0
  184. package/dist/esm/swiper-nBv069TB.js +3941 -0
  185. package/dist/esm/utils--SDsQnWS.js +460 -0
  186. package/dist/esm/utils-Bak__24s.js +280 -0
  187. package/dist/esm/utils-CYF5GU_q.js +438 -0
  188. package/dist/node_modules/video.js/dist/video-js.min.css +1 -0
  189. package/dist/test/axe.js +60 -0
  190. package/dist/types/Users/shahrukceo/Developer/content-blocks/packages/js/.stencil/test/axe.d.ts +16 -0
  191. package/dist/types/blocks/content-hero-block/content-hero-block.d.ts +7 -11
  192. package/dist/types/blocks/content-split-block/content-split-block.d.ts +5 -9
  193. package/dist/types/blocks/content-text-block/content-text-block.d.ts +4 -9
  194. package/dist/types/blocks/content-tout-block/content-tout-block.d.ts +5 -10
  195. package/dist/types/components/content-accordion/content-accordion.d.ts +4 -3
  196. package/dist/types/components/content-accordion/libraries/w3_disclosure_button.d.ts +0 -1
  197. package/dist/types/components/content-carousel/content-carousel.d.ts +44 -7
  198. package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +14 -8
  199. package/dist/types/components/content-overlay/content-overlay.d.ts +15 -16
  200. package/dist/types/components/content-overlay/libraries/aria-dialog.d.ts +0 -1
  201. package/dist/types/components/content-overlay/libraries/aria-utilities.d.ts +0 -1
  202. package/dist/types/components/content-tabs/content-tabs.d.ts +4 -10
  203. package/dist/types/components/content-tabs/libraries/w3_tabs.d.ts +0 -1
  204. package/dist/types/components.d.ts +900 -196
  205. package/dist/types/elements/content-button/content-button.d.ts +8 -13
  206. package/dist/types/elements/content-image/content-image.d.ts +15 -9
  207. package/dist/types/elements/content-line/content-line.d.ts +5 -12
  208. package/dist/types/elements/content-video/content-video.d.ts +12 -11
  209. package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +14 -9
  210. package/dist/types/formatters/content-spacer/content-spacer.d.ts +4 -36
  211. package/dist/types/index.d.ts +3 -1
  212. package/dist/types/setupFiles.d.ts +0 -1
  213. package/dist/types/stencil-public-runtime.d.ts +265 -60
  214. package/dist/types/typings.d.ts +10 -0
  215. package/dist/types/utils/breakpoints.d.ts +57 -0
  216. package/dist/types/utils/responsive-component.d.ts +49 -0
  217. package/dist/types/utils/utils.d.ts +11 -8
  218. package/loader/cdn.js +1 -0
  219. package/loader/index.cjs.js +1 -0
  220. package/loader/index.d.ts +24 -0
  221. package/loader/index.es2017.js +1 -0
  222. package/loader/index.js +2 -0
  223. package/package.json +75 -65
  224. package/dist/cjs/BehaviorSubject-12116537.js +0 -655
  225. package/dist/cjs/BehaviorSubject-12116537.js.map +0 -1
  226. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  227. package/dist/cjs/content-accordion_11.cjs.entry.js.map +0 -1
  228. package/dist/cjs/content-blocks.cjs.js.map +0 -1
  229. package/dist/cjs/content-carousel.cjs.entry.js.map +0 -1
  230. package/dist/cjs/content-navigation-block.cjs.entry.js.map +0 -1
  231. package/dist/cjs/content-split-block.cjs.entry.js.map +0 -1
  232. package/dist/cjs/content-tabs.cjs.entry.js.map +0 -1
  233. package/dist/cjs/focus-trap.esm-7bc384a0.js.map +0 -1
  234. package/dist/cjs/index-2e0ce692.js.map +0 -1
  235. package/dist/cjs/index-8af2820a.js +0 -1650
  236. package/dist/cjs/index-8af2820a.js.map +0 -1
  237. package/dist/cjs/index.cjs.js.map +0 -1
  238. package/dist/cjs/loader.cjs.js.map +0 -1
  239. package/dist/cjs/swiper-8221f4e8.js.map +0 -1
  240. package/dist/cjs/utils-df044337.js.map +0 -1
  241. package/dist/cjs/utils-f8ccab0a.js +0 -126
  242. package/dist/cjs/utils-f8ccab0a.js.map +0 -1
  243. package/dist/cjs/window-resize-service-65a5a370.js +0 -37
  244. package/dist/cjs/window-resize-service-65a5a370.js.map +0 -1
  245. package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +0 -1
  246. package/dist/collection/blocks/content-split-block/content-split-block.js.map +0 -1
  247. package/dist/collection/blocks/content-text-block/content-text-block.js.map +0 -1
  248. package/dist/collection/blocks/content-tout-block/content-tout-block.js.map +0 -1
  249. package/dist/collection/components/content-accordion/content-accordion.js.map +0 -1
  250. package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js.map +0 -1
  251. package/dist/collection/components/content-carousel/content-carousel.js.map +0 -1
  252. package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +0 -1
  253. package/dist/collection/components/content-overlay/content-overlay.js.map +0 -1
  254. package/dist/collection/components/content-overlay/libraries/aria-dialog.js.map +0 -1
  255. package/dist/collection/components/content-overlay/libraries/aria-utilities.js.map +0 -1
  256. package/dist/collection/components/content-tabs/content-tabs.js.map +0 -1
  257. package/dist/collection/components/content-tabs/libraries/w3_tabs.js.map +0 -1
  258. package/dist/collection/elements/content-button/content-button.js.map +0 -1
  259. package/dist/collection/elements/content-image/content-image.js.map +0 -1
  260. package/dist/collection/elements/content-line/content-line.js.map +0 -1
  261. package/dist/collection/elements/content-video/content-video.js.map +0 -1
  262. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +0 -1
  263. package/dist/collection/formatters/content-spacer/content-spacer.js.map +0 -1
  264. package/dist/collection/globalScript.js +0 -15
  265. package/dist/collection/globalScript.js.map +0 -1
  266. package/dist/collection/index.js.map +0 -1
  267. package/dist/collection/services/content-events-service.js +0 -23
  268. package/dist/collection/services/content-events-service.js.map +0 -1
  269. package/dist/collection/services/window-resize-service.js +0 -31
  270. package/dist/collection/services/window-resize-service.js.map +0 -1
  271. package/dist/collection/setupFiles.js.map +0 -1
  272. package/dist/collection/stories/ContentHeroBlock.stories.js +0 -51
  273. package/dist/collection/stories/ContentHeroBlock.stories.js.map +0 -1
  274. package/dist/collection/stories/ContentNavigationBlock.stories.js +0 -33
  275. package/dist/collection/stories/ContentNavigationBlock.stories.js.map +0 -1
  276. package/dist/collection/stories/ContentSpacer.stories.js +0 -20
  277. package/dist/collection/stories/ContentSpacer.stories.js.map +0 -1
  278. package/dist/collection/stories/ContentTextBlock.stories.js +0 -17
  279. package/dist/collection/stories/ContentTextBlock.stories.js.map +0 -1
  280. package/dist/collection/stories/ContentToutBlock.stories.js +0 -17
  281. package/dist/collection/stories/ContentToutBlock.stories.js.map +0 -1
  282. package/dist/collection/stories/FullPageExample.stories.js +0 -432
  283. package/dist/collection/stories/FullPageExample.stories.js.map +0 -1
  284. package/dist/collection/stories/assets/accessibility.svg +0 -5
  285. package/dist/collection/stories/assets/discord.svg +0 -15
  286. package/dist/collection/stories/assets/github.svg +0 -3
  287. package/dist/collection/stories/assets/tutorials.svg +0 -12
  288. package/dist/collection/stories/assets/youtube.svg +0 -4
  289. package/dist/collection/utils/utils.js.map +0 -1
  290. package/dist/components/content-accordion.js.map +0 -1
  291. package/dist/components/content-button.js.map +0 -1
  292. package/dist/components/content-carousel.js.map +0 -1
  293. package/dist/components/content-grid-formatter.js.map +0 -1
  294. package/dist/components/content-hero-block.js.map +0 -1
  295. package/dist/components/content-image.js.map +0 -1
  296. package/dist/components/content-line.js.map +0 -1
  297. package/dist/components/content-navigation-block.js.map +0 -1
  298. package/dist/components/content-overlay.js.map +0 -1
  299. package/dist/components/content-spacer.js.map +0 -1
  300. package/dist/components/content-split-block.js.map +0 -1
  301. package/dist/components/content-tabs.js.map +0 -1
  302. package/dist/components/content-text-block.js.map +0 -1
  303. package/dist/components/content-tout-block.js.map +0 -1
  304. package/dist/components/content-video.js.map +0 -1
  305. package/dist/components/index.js.map +0 -1
  306. package/dist/components/p-26483b46.js +0 -35
  307. package/dist/components/p-26483b46.js.map +0 -1
  308. package/dist/components/p-5a91aa1b.js.map +0 -1
  309. package/dist/components/p-74be971f.js +0 -652
  310. package/dist/components/p-74be971f.js.map +0 -1
  311. package/dist/components/p-7a436263.js +0 -122
  312. package/dist/components/p-7a436263.js.map +0 -1
  313. package/dist/components/p-a2fedf8a.js.map +0 -1
  314. package/dist/components/p-b85cfa86.js.map +0 -1
  315. package/dist/components/p-e28db040.js +0 -1452
  316. package/dist/components/p-e28db040.js.map +0 -1
  317. package/dist/components/p-e5dc4ea4.js.map +0 -1
  318. package/dist/components/p-e9bce2ab.js +0 -88
  319. package/dist/components/p-e9bce2ab.js.map +0 -1
  320. package/dist/content-blocks/content-blocks.esm.js.map +0 -1
  321. package/dist/content-blocks/index.esm.js.map +0 -1
  322. package/dist/content-blocks/p-13c3cc4f.js +0 -3
  323. package/dist/content-blocks/p-13c3cc4f.js.map +0 -1
  324. package/dist/content-blocks/p-5422c25b.entry.js +0 -2
  325. package/dist/content-blocks/p-5422c25b.entry.js.map +0 -1
  326. package/dist/content-blocks/p-5a91aa1b.js +0 -2
  327. package/dist/content-blocks/p-5a91aa1b.js.map +0 -1
  328. package/dist/content-blocks/p-650d1757.js +0 -2
  329. package/dist/content-blocks/p-650d1757.js.map +0 -1
  330. package/dist/content-blocks/p-74be971f.js +0 -2
  331. package/dist/content-blocks/p-74be971f.js.map +0 -1
  332. package/dist/content-blocks/p-8deb755c.entry.js +0 -26
  333. package/dist/content-blocks/p-8deb755c.entry.js.map +0 -1
  334. package/dist/content-blocks/p-a2fedf8a.js +0 -10
  335. package/dist/content-blocks/p-a2fedf8a.js.map +0 -1
  336. package/dist/content-blocks/p-b305392e.entry.js +0 -2
  337. package/dist/content-blocks/p-b305392e.entry.js.map +0 -1
  338. package/dist/content-blocks/p-b85cfa86.js +0 -2
  339. package/dist/content-blocks/p-b85cfa86.js.map +0 -1
  340. package/dist/content-blocks/p-cc7397cf.js +0 -2
  341. package/dist/content-blocks/p-cc7397cf.js.map +0 -1
  342. package/dist/content-blocks/p-d62775d7.entry.js +0 -2
  343. package/dist/content-blocks/p-d62775d7.entry.js.map +0 -1
  344. package/dist/content-blocks/p-e1255160.js +0 -2
  345. package/dist/content-blocks/p-e1255160.js.map +0 -1
  346. package/dist/content-blocks/p-e5dc4ea4.js +0 -2
  347. package/dist/content-blocks/p-e5dc4ea4.js.map +0 -1
  348. package/dist/content-blocks/p-f73f934a.entry.js +0 -2
  349. package/dist/content-blocks/p-f73f934a.entry.js.map +0 -1
  350. package/dist/esm/BehaviorSubject-f7a12fd8.js +0 -652
  351. package/dist/esm/BehaviorSubject-f7a12fd8.js.map +0 -1
  352. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  353. package/dist/esm/content-accordion_11.entry.js.map +0 -1
  354. package/dist/esm/content-blocks.js.map +0 -1
  355. package/dist/esm/content-carousel.entry.js.map +0 -1
  356. package/dist/esm/content-navigation-block.entry.js.map +0 -1
  357. package/dist/esm/content-split-block.entry.js.map +0 -1
  358. package/dist/esm/content-tabs.entry.js.map +0 -1
  359. package/dist/esm/focus-trap.esm-8fb54175.js.map +0 -1
  360. package/dist/esm/index-ec24af7a.js +0 -1621
  361. package/dist/esm/index-ec24af7a.js.map +0 -1
  362. package/dist/esm/index-f45a9c45.js.map +0 -1
  363. package/dist/esm/index.js.map +0 -1
  364. package/dist/esm/loader.js.map +0 -1
  365. package/dist/esm/swiper-e9621adb.js.map +0 -1
  366. package/dist/esm/utils-1c9f0ec1.js.map +0 -1
  367. package/dist/esm/utils-9a901aa9.js +0 -122
  368. package/dist/esm/utils-9a901aa9.js.map +0 -1
  369. package/dist/esm/window-resize-service-354f2ac5.js +0 -35
  370. package/dist/esm/window-resize-service-354f2ac5.js.map +0 -1
  371. package/dist/types/globalScript.d.ts +0 -1
  372. package/dist/types/old-components.d.ts +0 -1239
  373. package/dist/types/services/content-events-service.d.ts +0 -11
  374. package/dist/types/services/window-resize-service.d.ts +0 -11
  375. package/dist/types/stories/ContentHeroBlock.stories.d.ts +0 -11
  376. package/dist/types/stories/ContentNavigationBlock.stories.d.ts +0 -9
  377. package/dist/types/stories/ContentSpacer.stories.d.ts +0 -15
  378. package/dist/types/stories/ContentTextBlock.stories.d.ts +0 -9
  379. package/dist/types/stories/ContentToutBlock.stories.d.ts +0 -9
  380. package/dist/types/stories/FullPageExample.stories.d.ts +0 -10
@@ -0,0 +1,1713 @@
1
+ import { a as elementChildren, c as createElement, t as makeElementsArray, u as setInnerHTML, r as elementParents, o as elementOuterSize, b as elementIndex, g as getDocument, v as classesToTokens, n as nextTick, w as elementOffset } from './utils-CYF5GU_q.js';
2
+
3
+ function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
4
+ if (swiper.params.createElements) {
5
+ Object.keys(checkProps).forEach(key => {
6
+ if (!params[key] && params.auto === true) {
7
+ let element = elementChildren(swiper.el, `.${checkProps[key]}`)[0];
8
+ if (!element) {
9
+ element = createElement('div', checkProps[key]);
10
+ element.className = checkProps[key];
11
+ swiper.el.append(element);
12
+ }
13
+ params[key] = element;
14
+ originalParams[key] = element;
15
+ }
16
+ });
17
+ }
18
+ return params;
19
+ }
20
+
21
+ const arrowSvg = `<svg class="swiper-navigation-icon" width="11" height="20" viewBox="0 0 11 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.38296 20.0762C0.111788 19.805 0.111788 19.3654 0.38296 19.0942L9.19758 10.2796L0.38296 1.46497C0.111788 1.19379 0.111788 0.754138 0.38296 0.482966C0.654131 0.211794 1.09379 0.211794 1.36496 0.482966L10.4341 9.55214C10.8359 9.9539 10.8359 10.6053 10.4341 11.007L1.36496 20.0762C1.09379 20.3474 0.654131 20.3474 0.38296 20.0762Z" fill="currentColor"/></svg>`;
22
+ function Navigation({
23
+ swiper,
24
+ extendParams,
25
+ on,
26
+ emit
27
+ }) {
28
+ extendParams({
29
+ navigation: {
30
+ nextEl: null,
31
+ prevEl: null,
32
+ addIcons: true,
33
+ hideOnClick: false,
34
+ disabledClass: 'swiper-button-disabled',
35
+ hiddenClass: 'swiper-button-hidden',
36
+ lockClass: 'swiper-button-lock',
37
+ navigationDisabledClass: 'swiper-navigation-disabled'
38
+ }
39
+ });
40
+ swiper.navigation = {
41
+ nextEl: null,
42
+ prevEl: null,
43
+ arrowSvg
44
+ };
45
+ function getEl(el) {
46
+ let res;
47
+ if (el && typeof el === 'string' && swiper.isElement) {
48
+ res = swiper.el.querySelector(el) || swiper.hostEl.querySelector(el);
49
+ if (res) return res;
50
+ }
51
+ if (el) {
52
+ if (typeof el === 'string') res = [...document.querySelectorAll(el)];
53
+ if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
54
+ res = swiper.el.querySelector(el);
55
+ } else if (res && res.length === 1) {
56
+ res = res[0];
57
+ }
58
+ }
59
+ if (el && !res) return el;
60
+ // if (Array.isArray(res) && res.length === 1) res = res[0];
61
+ return res;
62
+ }
63
+ function toggleEl(el, disabled) {
64
+ const params = swiper.params.navigation;
65
+ el = makeElementsArray(el);
66
+ el.forEach(subEl => {
67
+ if (subEl) {
68
+ subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
69
+ if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
70
+ if (swiper.params.watchOverflow && swiper.enabled) {
71
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
72
+ }
73
+ }
74
+ });
75
+ }
76
+ function update() {
77
+ // Update Navigation Buttons
78
+ const {
79
+ nextEl,
80
+ prevEl
81
+ } = swiper.navigation;
82
+ if (swiper.params.loop) {
83
+ toggleEl(prevEl, false);
84
+ toggleEl(nextEl, false);
85
+ return;
86
+ }
87
+ toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
88
+ toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
89
+ }
90
+ function onPrevClick(e) {
91
+ e.preventDefault();
92
+ if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
93
+ swiper.slidePrev();
94
+ emit('navigationPrev');
95
+ }
96
+ function onNextClick(e) {
97
+ e.preventDefault();
98
+ if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
99
+ swiper.slideNext();
100
+ emit('navigationNext');
101
+ }
102
+ function init() {
103
+ const params = swiper.params.navigation;
104
+ swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
105
+ nextEl: 'swiper-button-next',
106
+ prevEl: 'swiper-button-prev'
107
+ });
108
+ if (!(params.nextEl || params.prevEl)) return;
109
+ let nextEl = getEl(params.nextEl);
110
+ let prevEl = getEl(params.prevEl);
111
+ Object.assign(swiper.navigation, {
112
+ nextEl,
113
+ prevEl
114
+ });
115
+ nextEl = makeElementsArray(nextEl);
116
+ prevEl = makeElementsArray(prevEl);
117
+ const initButton = (el, dir) => {
118
+ if (el) {
119
+ if (params.addIcons && el.matches('.swiper-button-next,.swiper-button-prev') && !el.querySelector('svg')) {
120
+ const tempEl = document.createElement('div');
121
+ setInnerHTML(tempEl, arrowSvg);
122
+ el.appendChild(tempEl.querySelector('svg'));
123
+ tempEl.remove();
124
+ }
125
+ el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
126
+ }
127
+ if (!swiper.enabled && el) {
128
+ el.classList.add(...params.lockClass.split(' '));
129
+ }
130
+ };
131
+ nextEl.forEach(el => initButton(el, 'next'));
132
+ prevEl.forEach(el => initButton(el, 'prev'));
133
+ }
134
+ function destroy() {
135
+ let {
136
+ nextEl,
137
+ prevEl
138
+ } = swiper.navigation;
139
+ nextEl = makeElementsArray(nextEl);
140
+ prevEl = makeElementsArray(prevEl);
141
+ const destroyButton = (el, dir) => {
142
+ el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
143
+ el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
144
+ };
145
+ nextEl.forEach(el => destroyButton(el, 'next'));
146
+ prevEl.forEach(el => destroyButton(el, 'prev'));
147
+ }
148
+ on('init', () => {
149
+ if (swiper.params.navigation.enabled === false) {
150
+ // eslint-disable-next-line
151
+ disable();
152
+ } else {
153
+ init();
154
+ update();
155
+ }
156
+ });
157
+ on('toEdge fromEdge lock unlock', () => {
158
+ update();
159
+ });
160
+ on('destroy', () => {
161
+ destroy();
162
+ });
163
+ on('enable disable', () => {
164
+ let {
165
+ nextEl,
166
+ prevEl
167
+ } = swiper.navigation;
168
+ nextEl = makeElementsArray(nextEl);
169
+ prevEl = makeElementsArray(prevEl);
170
+ if (swiper.enabled) {
171
+ update();
172
+ return;
173
+ }
174
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));
175
+ });
176
+ on('click', (_s, e) => {
177
+ let {
178
+ nextEl,
179
+ prevEl
180
+ } = swiper.navigation;
181
+ nextEl = makeElementsArray(nextEl);
182
+ prevEl = makeElementsArray(prevEl);
183
+ const targetEl = e.target;
184
+ let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
185
+ if (swiper.isElement && !targetIsButton) {
186
+ const path = e.path || e.composedPath && e.composedPath();
187
+ if (path) {
188
+ targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
189
+ }
190
+ }
191
+ if (swiper.params.navigation.hideOnClick && !targetIsButton) {
192
+ if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
193
+ let isHidden;
194
+ if (nextEl.length) {
195
+ isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
196
+ } else if (prevEl.length) {
197
+ isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
198
+ }
199
+ if (isHidden === true) {
200
+ emit('navigationShow');
201
+ } else {
202
+ emit('navigationHide');
203
+ }
204
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
205
+ }
206
+ });
207
+ const enable = () => {
208
+ swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
209
+ init();
210
+ update();
211
+ };
212
+ const disable = () => {
213
+ swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
214
+ destroy();
215
+ };
216
+ Object.assign(swiper.navigation, {
217
+ enable,
218
+ disable,
219
+ update,
220
+ init,
221
+ destroy
222
+ });
223
+ }
224
+
225
+ function classesToSelector(classes = '') {
226
+ // Escape all CSS selector special characters
227
+ return `.${classes.trim().replace(/([\.:!+\/()[\]#>~*^$|=,'"@{}\\])/g, '\\$1') // eslint-disable-line
228
+ .replace(/ /g, '.')}`;
229
+ }
230
+
231
+ function Pagination({
232
+ swiper,
233
+ extendParams,
234
+ on,
235
+ emit
236
+ }) {
237
+ const pfx = 'swiper-pagination';
238
+ extendParams({
239
+ pagination: {
240
+ el: null,
241
+ bulletElement: 'span',
242
+ clickable: false,
243
+ hideOnClick: false,
244
+ renderBullet: null,
245
+ renderProgressbar: null,
246
+ renderFraction: null,
247
+ renderCustom: null,
248
+ progressbarOpposite: false,
249
+ type: 'bullets',
250
+ // 'bullets' or 'progressbar' or 'fraction' or 'custom'
251
+ dynamicBullets: false,
252
+ dynamicMainBullets: 1,
253
+ formatFractionCurrent: number => number,
254
+ formatFractionTotal: number => number,
255
+ bulletClass: `${pfx}-bullet`,
256
+ bulletActiveClass: `${pfx}-bullet-active`,
257
+ modifierClass: `${pfx}-`,
258
+ currentClass: `${pfx}-current`,
259
+ totalClass: `${pfx}-total`,
260
+ hiddenClass: `${pfx}-hidden`,
261
+ progressbarFillClass: `${pfx}-progressbar-fill`,
262
+ progressbarOppositeClass: `${pfx}-progressbar-opposite`,
263
+ clickableClass: `${pfx}-clickable`,
264
+ lockClass: `${pfx}-lock`,
265
+ horizontalClass: `${pfx}-horizontal`,
266
+ verticalClass: `${pfx}-vertical`,
267
+ paginationDisabledClass: `${pfx}-disabled`
268
+ }
269
+ });
270
+ swiper.pagination = {
271
+ el: null,
272
+ bullets: []
273
+ };
274
+ let bulletSize;
275
+ let dynamicBulletIndex = 0;
276
+ function isPaginationDisabled() {
277
+ return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0;
278
+ }
279
+ function setSideBullets(bulletEl, position) {
280
+ const {
281
+ bulletActiveClass
282
+ } = swiper.params.pagination;
283
+ if (!bulletEl) return;
284
+ bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
285
+ if (bulletEl) {
286
+ bulletEl.classList.add(`${bulletActiveClass}-${position}`);
287
+ bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
288
+ if (bulletEl) {
289
+ bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);
290
+ }
291
+ }
292
+ }
293
+ function getMoveDirection(prevIndex, nextIndex, length) {
294
+ prevIndex = prevIndex % length;
295
+ nextIndex = nextIndex % length;
296
+ if (nextIndex === prevIndex + 1) {
297
+ return 'next';
298
+ } else if (nextIndex === prevIndex - 1) {
299
+ return 'previous';
300
+ }
301
+ return;
302
+ }
303
+ function onBulletClick(e) {
304
+ const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
305
+ if (!bulletEl) {
306
+ return;
307
+ }
308
+ e.preventDefault();
309
+ const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
310
+ if (swiper.params.loop) {
311
+ if (swiper.realIndex === index) return;
312
+ const moveDirection = getMoveDirection(swiper.realIndex, index, swiper.slides.length);
313
+ if (moveDirection === 'next') {
314
+ swiper.slideNext();
315
+ } else if (moveDirection === 'previous') {
316
+ swiper.slidePrev();
317
+ } else {
318
+ swiper.slideToLoop(index);
319
+ }
320
+ } else {
321
+ swiper.slideTo(index);
322
+ }
323
+ }
324
+ function update() {
325
+ // Render || Update Pagination bullets/items
326
+ const rtl = swiper.rtl;
327
+ const params = swiper.params.pagination;
328
+ if (isPaginationDisabled()) return;
329
+ let el = swiper.pagination.el;
330
+ el = makeElementsArray(el);
331
+ // Current/Total
332
+ let current;
333
+ let previousIndex;
334
+ const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
335
+ const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
336
+ if (swiper.params.loop) {
337
+ previousIndex = swiper.previousRealIndex || 0;
338
+ current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;
339
+ } else if (typeof swiper.snapIndex !== 'undefined') {
340
+ current = swiper.snapIndex;
341
+ previousIndex = swiper.previousSnapIndex;
342
+ } else {
343
+ previousIndex = swiper.previousIndex || 0;
344
+ current = swiper.activeIndex || 0;
345
+ }
346
+ // Types
347
+ if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
348
+ const bullets = swiper.pagination.bullets;
349
+ let firstIndex;
350
+ let lastIndex;
351
+ let midIndex;
352
+ if (params.dynamicBullets) {
353
+ bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height');
354
+ el.forEach(subEl => {
355
+ subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;
356
+ });
357
+ if (params.dynamicMainBullets > 1 && previousIndex !== undefined) {
358
+ dynamicBulletIndex += current - (previousIndex || 0);
359
+ if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
360
+ dynamicBulletIndex = params.dynamicMainBullets - 1;
361
+ } else if (dynamicBulletIndex < 0) {
362
+ dynamicBulletIndex = 0;
363
+ }
364
+ }
365
+ firstIndex = Math.max(current - dynamicBulletIndex, 0);
366
+ lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
367
+ midIndex = (lastIndex + firstIndex) / 2;
368
+ }
369
+ bullets.forEach(bulletEl => {
370
+ const classesToRemove = [...['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`)].map(s => typeof s === 'string' && s.includes(' ') ? s.split(' ') : s).flat();
371
+ bulletEl.classList.remove(...classesToRemove);
372
+ });
373
+ if (el.length > 1) {
374
+ bullets.forEach(bullet => {
375
+ const bulletIndex = elementIndex(bullet);
376
+ if (bulletIndex === current) {
377
+ bullet.classList.add(...params.bulletActiveClass.split(' '));
378
+ } else if (swiper.isElement) {
379
+ bullet.setAttribute('part', 'bullet');
380
+ }
381
+ if (params.dynamicBullets) {
382
+ if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
383
+ bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));
384
+ }
385
+ if (bulletIndex === firstIndex) {
386
+ setSideBullets(bullet, 'prev');
387
+ }
388
+ if (bulletIndex === lastIndex) {
389
+ setSideBullets(bullet, 'next');
390
+ }
391
+ }
392
+ });
393
+ } else {
394
+ const bullet = bullets[current];
395
+ if (bullet) {
396
+ bullet.classList.add(...params.bulletActiveClass.split(' '));
397
+ }
398
+ if (swiper.isElement) {
399
+ bullets.forEach((bulletEl, bulletIndex) => {
400
+ bulletEl.setAttribute('part', bulletIndex === current ? 'bullet-active' : 'bullet');
401
+ });
402
+ }
403
+ if (params.dynamicBullets) {
404
+ const firstDisplayedBullet = bullets[firstIndex];
405
+ const lastDisplayedBullet = bullets[lastIndex];
406
+ for (let i = firstIndex; i <= lastIndex; i += 1) {
407
+ if (bullets[i]) {
408
+ bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));
409
+ }
410
+ }
411
+ setSideBullets(firstDisplayedBullet, 'prev');
412
+ setSideBullets(lastDisplayedBullet, 'next');
413
+ }
414
+ }
415
+ if (params.dynamicBullets) {
416
+ const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
417
+ const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
418
+ const offsetProp = rtl ? 'right' : 'left';
419
+ bullets.forEach(bullet => {
420
+ bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;
421
+ });
422
+ }
423
+ }
424
+ el.forEach((subEl, subElIndex) => {
425
+ if (params.type === 'fraction') {
426
+ subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => {
427
+ fractionEl.textContent = params.formatFractionCurrent(current + 1);
428
+ });
429
+ subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => {
430
+ totalEl.textContent = params.formatFractionTotal(total);
431
+ });
432
+ }
433
+ if (params.type === 'progressbar') {
434
+ let progressbarDirection;
435
+ if (params.progressbarOpposite) {
436
+ progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
437
+ } else {
438
+ progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
439
+ }
440
+ const scale = (current + 1) / total;
441
+ let scaleX = 1;
442
+ let scaleY = 1;
443
+ if (progressbarDirection === 'horizontal') {
444
+ scaleX = scale;
445
+ } else {
446
+ scaleY = scale;
447
+ }
448
+ subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => {
449
+ progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;
450
+ progressEl.style.transitionDuration = `${swiper.params.speed}ms`;
451
+ });
452
+ }
453
+ if (params.type === 'custom' && params.renderCustom) {
454
+ setInnerHTML(subEl, params.renderCustom(swiper, current + 1, total));
455
+ if (subElIndex === 0) emit('paginationRender', subEl);
456
+ } else {
457
+ if (subElIndex === 0) emit('paginationRender', subEl);
458
+ emit('paginationUpdate', subEl);
459
+ }
460
+ if (swiper.params.watchOverflow && swiper.enabled) {
461
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
462
+ }
463
+ });
464
+ }
465
+ function render() {
466
+ // Render Container
467
+ const params = swiper.params.pagination;
468
+ if (isPaginationDisabled()) return;
469
+ const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.grid && swiper.params.grid.rows > 1 ? swiper.slides.length / Math.ceil(swiper.params.grid.rows) : swiper.slides.length;
470
+ let el = swiper.pagination.el;
471
+ el = makeElementsArray(el);
472
+ let paginationHTML = '';
473
+ if (params.type === 'bullets') {
474
+ let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
475
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {
476
+ numberOfBullets = slidesLength;
477
+ }
478
+ for (let i = 0; i < numberOfBullets; i += 1) {
479
+ if (params.renderBullet) {
480
+ paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
481
+ } else {
482
+ // prettier-ignore
483
+ paginationHTML += `<${params.bulletElement} ${swiper.isElement ? 'part="bullet"' : ''} class="${params.bulletClass}"></${params.bulletElement}>`;
484
+ }
485
+ }
486
+ }
487
+ if (params.type === 'fraction') {
488
+ if (params.renderFraction) {
489
+ paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
490
+ } else {
491
+ paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
492
+ }
493
+ }
494
+ if (params.type === 'progressbar') {
495
+ if (params.renderProgressbar) {
496
+ paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
497
+ } else {
498
+ paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
499
+ }
500
+ }
501
+ swiper.pagination.bullets = [];
502
+ el.forEach(subEl => {
503
+ if (params.type !== 'custom') {
504
+ setInnerHTML(subEl, paginationHTML || '');
505
+ }
506
+ if (params.type === 'bullets') {
507
+ swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass)));
508
+ }
509
+ });
510
+ if (params.type !== 'custom') {
511
+ emit('paginationRender', el[0]);
512
+ }
513
+ }
514
+ function init() {
515
+ swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, {
516
+ el: 'swiper-pagination'
517
+ });
518
+ const params = swiper.params.pagination;
519
+ if (!params.el) return;
520
+ let el;
521
+ if (typeof params.el === 'string' && swiper.isElement) {
522
+ el = swiper.el.querySelector(params.el);
523
+ }
524
+ if (!el && typeof params.el === 'string') {
525
+ el = [...document.querySelectorAll(params.el)];
526
+ }
527
+ if (!el) {
528
+ el = params.el;
529
+ }
530
+ if (!el || el.length === 0) return;
531
+ if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {
532
+ el = [...swiper.el.querySelectorAll(params.el)];
533
+ // check if it belongs to another nested Swiper
534
+ if (el.length > 1) {
535
+ el = el.find(subEl => {
536
+ if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false;
537
+ return true;
538
+ });
539
+ }
540
+ }
541
+ if (Array.isArray(el) && el.length === 1) el = el[0];
542
+ Object.assign(swiper.pagination, {
543
+ el
544
+ });
545
+ el = makeElementsArray(el);
546
+ el.forEach(subEl => {
547
+ if (params.type === 'bullets' && params.clickable) {
548
+ subEl.classList.add(...(params.clickableClass || '').split(' '));
549
+ }
550
+ subEl.classList.add(params.modifierClass + params.type);
551
+ subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
552
+ if (params.type === 'bullets' && params.dynamicBullets) {
553
+ subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);
554
+ dynamicBulletIndex = 0;
555
+ if (params.dynamicMainBullets < 1) {
556
+ params.dynamicMainBullets = 1;
557
+ }
558
+ }
559
+ if (params.type === 'progressbar' && params.progressbarOpposite) {
560
+ subEl.classList.add(params.progressbarOppositeClass);
561
+ }
562
+ if (params.clickable) {
563
+ subEl.addEventListener('click', onBulletClick);
564
+ }
565
+ if (!swiper.enabled) {
566
+ subEl.classList.add(params.lockClass);
567
+ }
568
+ });
569
+ }
570
+ function destroy() {
571
+ const params = swiper.params.pagination;
572
+ if (isPaginationDisabled()) return;
573
+ let el = swiper.pagination.el;
574
+ if (el) {
575
+ el = makeElementsArray(el);
576
+ el.forEach(subEl => {
577
+ subEl.classList.remove(params.hiddenClass);
578
+ subEl.classList.remove(params.modifierClass + params.type);
579
+ subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
580
+ if (params.clickable) {
581
+ subEl.classList.remove(...(params.clickableClass || '').split(' '));
582
+ subEl.removeEventListener('click', onBulletClick);
583
+ }
584
+ });
585
+ }
586
+ if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));
587
+ }
588
+ on('changeDirection', () => {
589
+ if (!swiper.pagination || !swiper.pagination.el) return;
590
+ const params = swiper.params.pagination;
591
+ let {
592
+ el
593
+ } = swiper.pagination;
594
+ el = makeElementsArray(el);
595
+ el.forEach(subEl => {
596
+ subEl.classList.remove(params.horizontalClass, params.verticalClass);
597
+ subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
598
+ });
599
+ });
600
+ on('init', () => {
601
+ if (swiper.params.pagination.enabled === false) {
602
+ // eslint-disable-next-line
603
+ disable();
604
+ } else {
605
+ init();
606
+ render();
607
+ update();
608
+ }
609
+ });
610
+ on('activeIndexChange', () => {
611
+ if (typeof swiper.snapIndex === 'undefined') {
612
+ update();
613
+ }
614
+ });
615
+ on('snapIndexChange', () => {
616
+ update();
617
+ });
618
+ on('snapGridLengthChange', () => {
619
+ render();
620
+ update();
621
+ });
622
+ on('destroy', () => {
623
+ destroy();
624
+ });
625
+ on('enable disable', () => {
626
+ let {
627
+ el
628
+ } = swiper.pagination;
629
+ if (el) {
630
+ el = makeElementsArray(el);
631
+ el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass));
632
+ }
633
+ });
634
+ on('lock unlock', () => {
635
+ update();
636
+ });
637
+ on('click', (_s, e) => {
638
+ const targetEl = e.target;
639
+ const el = makeElementsArray(swiper.pagination.el);
640
+ if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) {
641
+ if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
642
+ const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass);
643
+ if (isHidden === true) {
644
+ emit('paginationShow');
645
+ } else {
646
+ emit('paginationHide');
647
+ }
648
+ el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass));
649
+ }
650
+ });
651
+ const enable = () => {
652
+ swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass);
653
+ let {
654
+ el
655
+ } = swiper.pagination;
656
+ if (el) {
657
+ el = makeElementsArray(el);
658
+ el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));
659
+ }
660
+ init();
661
+ render();
662
+ update();
663
+ };
664
+ const disable = () => {
665
+ swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass);
666
+ let {
667
+ el
668
+ } = swiper.pagination;
669
+ if (el) {
670
+ el = makeElementsArray(el);
671
+ el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));
672
+ }
673
+ destroy();
674
+ };
675
+ Object.assign(swiper.pagination, {
676
+ enable,
677
+ disable,
678
+ render,
679
+ update,
680
+ init,
681
+ destroy
682
+ });
683
+ }
684
+
685
+ function Scrollbar({
686
+ swiper,
687
+ extendParams,
688
+ on,
689
+ emit
690
+ }) {
691
+ const document = getDocument();
692
+ let isTouched = false;
693
+ let timeout = null;
694
+ let dragTimeout = null;
695
+ let dragStartPos;
696
+ let dragSize;
697
+ let trackSize;
698
+ let divider;
699
+ extendParams({
700
+ scrollbar: {
701
+ el: null,
702
+ dragSize: 'auto',
703
+ hide: false,
704
+ draggable: false,
705
+ snapOnRelease: true,
706
+ lockClass: 'swiper-scrollbar-lock',
707
+ dragClass: 'swiper-scrollbar-drag',
708
+ scrollbarDisabledClass: 'swiper-scrollbar-disabled',
709
+ horizontalClass: `swiper-scrollbar-horizontal`,
710
+ verticalClass: `swiper-scrollbar-vertical`
711
+ }
712
+ });
713
+ swiper.scrollbar = {
714
+ el: null,
715
+ dragEl: null
716
+ };
717
+ function setTranslate() {
718
+ if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
719
+ const {
720
+ scrollbar,
721
+ rtlTranslate: rtl
722
+ } = swiper;
723
+ const {
724
+ dragEl,
725
+ el
726
+ } = scrollbar;
727
+ const params = swiper.params.scrollbar;
728
+ const progress = swiper.params.loop ? swiper.progressLoop : swiper.progress;
729
+ let newSize = dragSize;
730
+ let newPos = (trackSize - dragSize) * progress;
731
+ if (rtl) {
732
+ newPos = -newPos;
733
+ if (newPos > 0) {
734
+ newSize = dragSize - newPos;
735
+ newPos = 0;
736
+ } else if (-newPos + dragSize > trackSize) {
737
+ newSize = trackSize + newPos;
738
+ }
739
+ } else if (newPos < 0) {
740
+ newSize = dragSize + newPos;
741
+ newPos = 0;
742
+ } else if (newPos + dragSize > trackSize) {
743
+ newSize = trackSize - newPos;
744
+ }
745
+ if (swiper.isHorizontal()) {
746
+ dragEl.style.transform = `translate3d(${newPos}px, 0, 0)`;
747
+ dragEl.style.width = `${newSize}px`;
748
+ } else {
749
+ dragEl.style.transform = `translate3d(0px, ${newPos}px, 0)`;
750
+ dragEl.style.height = `${newSize}px`;
751
+ }
752
+ if (params.hide) {
753
+ clearTimeout(timeout);
754
+ el.style.opacity = 1;
755
+ timeout = setTimeout(() => {
756
+ el.style.opacity = 0;
757
+ el.style.transitionDuration = '400ms';
758
+ }, 1000);
759
+ }
760
+ }
761
+ function setTransition(duration) {
762
+ if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
763
+ swiper.scrollbar.dragEl.style.transitionDuration = `${duration}ms`;
764
+ }
765
+ function updateSize() {
766
+ if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
767
+ const {
768
+ scrollbar
769
+ } = swiper;
770
+ const {
771
+ dragEl,
772
+ el
773
+ } = scrollbar;
774
+ dragEl.style.width = '';
775
+ dragEl.style.height = '';
776
+ trackSize = swiper.isHorizontal() ? el.offsetWidth : el.offsetHeight;
777
+ divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0));
778
+ if (swiper.params.scrollbar.dragSize === 'auto') {
779
+ dragSize = trackSize * divider;
780
+ } else {
781
+ dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);
782
+ }
783
+ if (swiper.isHorizontal()) {
784
+ dragEl.style.width = `${dragSize}px`;
785
+ } else {
786
+ dragEl.style.height = `${dragSize}px`;
787
+ }
788
+ if (divider >= 1) {
789
+ el.style.display = 'none';
790
+ } else {
791
+ el.style.display = '';
792
+ }
793
+ if (swiper.params.scrollbar.hide) {
794
+ el.style.opacity = 0;
795
+ }
796
+ if (swiper.params.watchOverflow && swiper.enabled) {
797
+ scrollbar.el.classList[swiper.isLocked ? 'add' : 'remove'](swiper.params.scrollbar.lockClass);
798
+ }
799
+ }
800
+ function getPointerPosition(e) {
801
+ return swiper.isHorizontal() ? e.clientX : e.clientY;
802
+ }
803
+ function setDragPosition(e) {
804
+ const {
805
+ scrollbar,
806
+ rtlTranslate: rtl
807
+ } = swiper;
808
+ const {
809
+ el
810
+ } = scrollbar;
811
+ let positionRatio;
812
+ positionRatio = (getPointerPosition(e) - elementOffset(el)[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);
813
+ positionRatio = Math.max(Math.min(positionRatio, 1), 0);
814
+ if (rtl) {
815
+ positionRatio = 1 - positionRatio;
816
+ }
817
+ const position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio;
818
+ swiper.updateProgress(position);
819
+ swiper.setTranslate(position);
820
+ swiper.updateActiveIndex();
821
+ swiper.updateSlidesClasses();
822
+ }
823
+ function onDragStart(e) {
824
+ const params = swiper.params.scrollbar;
825
+ const {
826
+ scrollbar,
827
+ wrapperEl
828
+ } = swiper;
829
+ const {
830
+ el,
831
+ dragEl
832
+ } = scrollbar;
833
+ isTouched = true;
834
+ dragStartPos = e.target === dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;
835
+ e.preventDefault();
836
+ e.stopPropagation();
837
+ wrapperEl.style.transitionDuration = '100ms';
838
+ dragEl.style.transitionDuration = '100ms';
839
+ setDragPosition(e);
840
+ clearTimeout(dragTimeout);
841
+ el.style.transitionDuration = '0ms';
842
+ if (params.hide) {
843
+ el.style.opacity = 1;
844
+ }
845
+ if (swiper.params.cssMode) {
846
+ swiper.wrapperEl.style['scroll-snap-type'] = 'none';
847
+ }
848
+ emit('scrollbarDragStart', e);
849
+ }
850
+ function onDragMove(e) {
851
+ const {
852
+ scrollbar,
853
+ wrapperEl
854
+ } = swiper;
855
+ const {
856
+ el,
857
+ dragEl
858
+ } = scrollbar;
859
+ if (!isTouched) return;
860
+ if (e.preventDefault && e.cancelable) e.preventDefault();else e.returnValue = false;
861
+ setDragPosition(e);
862
+ wrapperEl.style.transitionDuration = '0ms';
863
+ el.style.transitionDuration = '0ms';
864
+ dragEl.style.transitionDuration = '0ms';
865
+ emit('scrollbarDragMove', e);
866
+ }
867
+ function onDragEnd(e) {
868
+ const params = swiper.params.scrollbar;
869
+ const {
870
+ scrollbar,
871
+ wrapperEl
872
+ } = swiper;
873
+ const {
874
+ el
875
+ } = scrollbar;
876
+ if (!isTouched) return;
877
+ isTouched = false;
878
+ if (swiper.params.cssMode) {
879
+ swiper.wrapperEl.style['scroll-snap-type'] = '';
880
+ wrapperEl.style.transitionDuration = '';
881
+ }
882
+ if (params.hide) {
883
+ clearTimeout(dragTimeout);
884
+ dragTimeout = nextTick(() => {
885
+ el.style.opacity = 0;
886
+ el.style.transitionDuration = '400ms';
887
+ }, 1000);
888
+ }
889
+ emit('scrollbarDragEnd', e);
890
+ if (params.snapOnRelease) {
891
+ swiper.slideToClosest();
892
+ }
893
+ }
894
+ function events(method) {
895
+ const {
896
+ scrollbar,
897
+ params
898
+ } = swiper;
899
+ const el = scrollbar.el;
900
+ if (!el) return;
901
+ const target = el;
902
+ const activeListener = params.passiveListeners ? {
903
+ passive: false,
904
+ capture: false
905
+ } : false;
906
+ const passiveListener = params.passiveListeners ? {
907
+ passive: true,
908
+ capture: false
909
+ } : false;
910
+ if (!target) return;
911
+ const eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
912
+ target[eventMethod]('pointerdown', onDragStart, activeListener);
913
+ document[eventMethod]('pointermove', onDragMove, activeListener);
914
+ document[eventMethod]('pointerup', onDragEnd, passiveListener);
915
+ }
916
+ function enableDraggable() {
917
+ if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
918
+ events('on');
919
+ }
920
+ function disableDraggable() {
921
+ if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
922
+ events('off');
923
+ }
924
+ function init() {
925
+ const {
926
+ scrollbar,
927
+ el: swiperEl
928
+ } = swiper;
929
+ swiper.params.scrollbar = createElementIfNotDefined(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, {
930
+ el: 'swiper-scrollbar'
931
+ });
932
+ const params = swiper.params.scrollbar;
933
+ if (!params.el) return;
934
+ let el;
935
+ if (typeof params.el === 'string' && swiper.isElement) {
936
+ el = swiper.el.querySelector(params.el);
937
+ }
938
+ if (!el && typeof params.el === 'string') {
939
+ el = document.querySelectorAll(params.el);
940
+ if (!el.length) return;
941
+ } else if (!el) {
942
+ el = params.el;
943
+ }
944
+ if (swiper.params.uniqueNavElements && typeof params.el === 'string' && el.length > 1 && swiperEl.querySelectorAll(params.el).length === 1) {
945
+ el = swiperEl.querySelector(params.el);
946
+ }
947
+ if (el.length > 0) el = el[0];
948
+ el.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
949
+ let dragEl;
950
+ if (el) {
951
+ dragEl = el.querySelector(classesToSelector(swiper.params.scrollbar.dragClass));
952
+ if (!dragEl) {
953
+ dragEl = createElement('div', swiper.params.scrollbar.dragClass);
954
+ el.append(dragEl);
955
+ }
956
+ }
957
+ Object.assign(scrollbar, {
958
+ el,
959
+ dragEl
960
+ });
961
+ if (params.draggable) {
962
+ enableDraggable();
963
+ }
964
+ if (el) {
965
+ el.classList[swiper.enabled ? 'remove' : 'add'](...classesToTokens(swiper.params.scrollbar.lockClass));
966
+ }
967
+ }
968
+ function destroy() {
969
+ const params = swiper.params.scrollbar;
970
+ const el = swiper.scrollbar.el;
971
+ if (el) {
972
+ el.classList.remove(...classesToTokens(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass));
973
+ }
974
+ disableDraggable();
975
+ }
976
+ on('changeDirection', () => {
977
+ if (!swiper.scrollbar || !swiper.scrollbar.el) return;
978
+ const params = swiper.params.scrollbar;
979
+ let {
980
+ el
981
+ } = swiper.scrollbar;
982
+ el = makeElementsArray(el);
983
+ el.forEach(subEl => {
984
+ subEl.classList.remove(params.horizontalClass, params.verticalClass);
985
+ subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
986
+ });
987
+ });
988
+ on('init', () => {
989
+ if (swiper.params.scrollbar.enabled === false) {
990
+ // eslint-disable-next-line
991
+ disable();
992
+ } else {
993
+ init();
994
+ updateSize();
995
+ setTranslate();
996
+ }
997
+ });
998
+ on('update resize observerUpdate lock unlock changeDirection', () => {
999
+ updateSize();
1000
+ });
1001
+ on('setTranslate', () => {
1002
+ setTranslate();
1003
+ });
1004
+ on('setTransition', (_s, duration) => {
1005
+ setTransition(duration);
1006
+ });
1007
+ on('enable disable', () => {
1008
+ const {
1009
+ el
1010
+ } = swiper.scrollbar;
1011
+ if (el) {
1012
+ el.classList[swiper.enabled ? 'remove' : 'add'](...classesToTokens(swiper.params.scrollbar.lockClass));
1013
+ }
1014
+ });
1015
+ on('destroy', () => {
1016
+ destroy();
1017
+ });
1018
+ const enable = () => {
1019
+ swiper.el.classList.remove(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass));
1020
+ if (swiper.scrollbar.el) {
1021
+ swiper.scrollbar.el.classList.remove(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass));
1022
+ }
1023
+ init();
1024
+ updateSize();
1025
+ setTranslate();
1026
+ };
1027
+ const disable = () => {
1028
+ swiper.el.classList.add(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass));
1029
+ if (swiper.scrollbar.el) {
1030
+ swiper.scrollbar.el.classList.add(...classesToTokens(swiper.params.scrollbar.scrollbarDisabledClass));
1031
+ }
1032
+ destroy();
1033
+ };
1034
+ Object.assign(swiper.scrollbar, {
1035
+ enable,
1036
+ disable,
1037
+ updateSize,
1038
+ setTranslate,
1039
+ init,
1040
+ destroy
1041
+ });
1042
+ }
1043
+
1044
+ function A11y({
1045
+ swiper,
1046
+ extendParams,
1047
+ on
1048
+ }) {
1049
+ extendParams({
1050
+ a11y: {
1051
+ enabled: true,
1052
+ notificationClass: 'swiper-notification',
1053
+ prevSlideMessage: 'Previous slide',
1054
+ nextSlideMessage: 'Next slide',
1055
+ firstSlideMessage: 'This is the first slide',
1056
+ lastSlideMessage: 'This is the last slide',
1057
+ paginationBulletMessage: 'Go to slide {{index}}',
1058
+ slideLabelMessage: '{{index}} / {{slidesLength}}',
1059
+ containerMessage: null,
1060
+ containerRoleDescriptionMessage: null,
1061
+ containerRole: null,
1062
+ itemRoleDescriptionMessage: null,
1063
+ slideRole: 'group',
1064
+ id: null,
1065
+ scrollOnFocus: true,
1066
+ wrapperLiveRegion: true
1067
+ }
1068
+ });
1069
+ swiper.a11y = {
1070
+ clicked: false
1071
+ };
1072
+ let liveRegion = null;
1073
+ let preventFocusHandler;
1074
+ let focusTargetSlideEl;
1075
+ let visibilityChangedTimestamp = new Date().getTime();
1076
+ function notify(message) {
1077
+ const notification = liveRegion;
1078
+ if (notification.length === 0) return;
1079
+ setInnerHTML(notification, message);
1080
+ }
1081
+ function getRandomNumber(size = 16) {
1082
+ const randomChar = () => Math.round(16 * Math.random()).toString(16);
1083
+ return 'x'.repeat(size).replace(/x/g, randomChar);
1084
+ }
1085
+ function makeElFocusable(el) {
1086
+ el = makeElementsArray(el);
1087
+ el.forEach(subEl => {
1088
+ subEl.setAttribute('tabIndex', '0');
1089
+ });
1090
+ }
1091
+ function makeElNotFocusable(el) {
1092
+ el = makeElementsArray(el);
1093
+ el.forEach(subEl => {
1094
+ subEl.setAttribute('tabIndex', '-1');
1095
+ });
1096
+ }
1097
+ function addElRole(el, role) {
1098
+ el = makeElementsArray(el);
1099
+ el.forEach(subEl => {
1100
+ subEl.setAttribute('role', role);
1101
+ });
1102
+ }
1103
+ function addElRoleDescription(el, description) {
1104
+ el = makeElementsArray(el);
1105
+ el.forEach(subEl => {
1106
+ subEl.setAttribute('aria-roledescription', description);
1107
+ });
1108
+ }
1109
+ function addElLabel(el, label) {
1110
+ el = makeElementsArray(el);
1111
+ el.forEach(subEl => {
1112
+ subEl.setAttribute('aria-label', label);
1113
+ });
1114
+ }
1115
+ function addElId(el, id) {
1116
+ el = makeElementsArray(el);
1117
+ el.forEach(subEl => {
1118
+ subEl.setAttribute('id', id);
1119
+ });
1120
+ }
1121
+ function addElLive(el, live) {
1122
+ el = makeElementsArray(el);
1123
+ el.forEach(subEl => {
1124
+ subEl.setAttribute('aria-live', live);
1125
+ });
1126
+ }
1127
+ function disableEl(el) {
1128
+ el = makeElementsArray(el);
1129
+ el.forEach(subEl => {
1130
+ subEl.setAttribute('aria-disabled', true);
1131
+ });
1132
+ }
1133
+ function enableEl(el) {
1134
+ el = makeElementsArray(el);
1135
+ el.forEach(subEl => {
1136
+ subEl.removeAttribute('aria-disabled');
1137
+ });
1138
+ }
1139
+ function onEnterOrSpaceKey(e) {
1140
+ if (e.keyCode !== 13 && e.keyCode !== 32) return;
1141
+ const params = swiper.params.a11y;
1142
+ const targetEl = e.target;
1143
+ if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
1144
+ if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
1145
+ }
1146
+ if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
1147
+ const prevEls = makeElementsArray(swiper.navigation.prevEl);
1148
+ const nextEls = makeElementsArray(swiper.navigation.nextEl);
1149
+ if (nextEls.includes(targetEl)) {
1150
+ if (!(swiper.isEnd && !swiper.params.loop)) {
1151
+ swiper.slideNext();
1152
+ }
1153
+ if (swiper.isEnd) {
1154
+ notify(params.lastSlideMessage);
1155
+ } else {
1156
+ notify(params.nextSlideMessage);
1157
+ }
1158
+ }
1159
+ if (prevEls.includes(targetEl)) {
1160
+ if (!(swiper.isBeginning && !swiper.params.loop)) {
1161
+ swiper.slidePrev();
1162
+ }
1163
+ if (swiper.isBeginning) {
1164
+ notify(params.firstSlideMessage);
1165
+ } else {
1166
+ notify(params.prevSlideMessage);
1167
+ }
1168
+ }
1169
+ }
1170
+ if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
1171
+ targetEl.click();
1172
+ }
1173
+ }
1174
+ function updateNavigation() {
1175
+ if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
1176
+ const {
1177
+ nextEl,
1178
+ prevEl
1179
+ } = swiper.navigation;
1180
+ if (prevEl) {
1181
+ if (swiper.isBeginning) {
1182
+ disableEl(prevEl);
1183
+ makeElNotFocusable(prevEl);
1184
+ } else {
1185
+ enableEl(prevEl);
1186
+ makeElFocusable(prevEl);
1187
+ }
1188
+ }
1189
+ if (nextEl) {
1190
+ if (swiper.isEnd) {
1191
+ disableEl(nextEl);
1192
+ makeElNotFocusable(nextEl);
1193
+ } else {
1194
+ enableEl(nextEl);
1195
+ makeElFocusable(nextEl);
1196
+ }
1197
+ }
1198
+ }
1199
+ function hasPagination() {
1200
+ return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
1201
+ }
1202
+ function hasClickablePagination() {
1203
+ return hasPagination() && swiper.params.pagination.clickable;
1204
+ }
1205
+ function updatePagination() {
1206
+ const params = swiper.params.a11y;
1207
+ if (!hasPagination()) return;
1208
+ swiper.pagination.bullets.forEach(bulletEl => {
1209
+ if (swiper.params.pagination.clickable) {
1210
+ makeElFocusable(bulletEl);
1211
+ if (!swiper.params.pagination.renderBullet) {
1212
+ addElRole(bulletEl, 'button');
1213
+ addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
1214
+ }
1215
+ }
1216
+ if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
1217
+ bulletEl.setAttribute('aria-current', 'true');
1218
+ } else {
1219
+ bulletEl.removeAttribute('aria-current');
1220
+ }
1221
+ });
1222
+ }
1223
+ const initNavEl = (el, wrapperId, message) => {
1224
+ makeElFocusable(el);
1225
+ if (el.tagName !== 'BUTTON') {
1226
+ addElRole(el, 'button');
1227
+ el.addEventListener('keydown', onEnterOrSpaceKey);
1228
+ }
1229
+ addElLabel(el, message);
1230
+ };
1231
+ const handlePointerDown = e => {
1232
+ if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
1233
+ preventFocusHandler = true;
1234
+ }
1235
+ swiper.a11y.clicked = true;
1236
+ };
1237
+ const handlePointerUp = () => {
1238
+ preventFocusHandler = false;
1239
+ requestAnimationFrame(() => {
1240
+ requestAnimationFrame(() => {
1241
+ if (!swiper.destroyed) {
1242
+ swiper.a11y.clicked = false;
1243
+ }
1244
+ });
1245
+ });
1246
+ };
1247
+ const onVisibilityChange = e => {
1248
+ visibilityChangedTimestamp = new Date().getTime();
1249
+ };
1250
+ const handleFocus = e => {
1251
+ if (swiper.a11y.clicked || !swiper.params.a11y.scrollOnFocus) return;
1252
+ if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
1253
+ const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
1254
+ if (!slideEl || !swiper.slides.includes(slideEl)) return;
1255
+ focusTargetSlideEl = slideEl;
1256
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1257
+ const isActive = (isVirtual ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : swiper.slides.indexOf(slideEl)) === swiper.activeIndex;
1258
+ const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
1259
+ if (isActive || isVisible) return;
1260
+ if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
1261
+ if (swiper.isHorizontal()) {
1262
+ swiper.el.scrollLeft = 0;
1263
+ } else {
1264
+ swiper.el.scrollTop = 0;
1265
+ }
1266
+ requestAnimationFrame(() => {
1267
+ if (preventFocusHandler) return;
1268
+ if (swiper.params.loop) {
1269
+ swiper.slideToLoop(swiper.getSlideIndexWhenGrid(parseInt(slideEl.getAttribute('data-swiper-slide-index'))), 0);
1270
+ } else if (isVirtual) {
1271
+ swiper.slideTo(swiper.getSlideIndexWhenGrid(parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10)), 0);
1272
+ } else {
1273
+ swiper.slideTo(swiper.getSlideIndexWhenGrid(swiper.slides.indexOf(slideEl)), 0);
1274
+ }
1275
+ preventFocusHandler = false;
1276
+ });
1277
+ };
1278
+ const initSlides = () => {
1279
+ const params = swiper.params.a11y;
1280
+ if (params.itemRoleDescriptionMessage) {
1281
+ addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
1282
+ }
1283
+ if (params.slideRole) {
1284
+ addElRole(swiper.slides, params.slideRole);
1285
+ }
1286
+ const slidesLength = swiper.slides.length;
1287
+ if (params.slideLabelMessage) {
1288
+ swiper.slides.forEach((slideEl, index) => {
1289
+ const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
1290
+ const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
1291
+ addElLabel(slideEl, ariaLabelMessage);
1292
+ });
1293
+ }
1294
+ };
1295
+ const init = () => {
1296
+ const params = swiper.params.a11y;
1297
+ swiper.el.append(liveRegion);
1298
+
1299
+ // Container
1300
+ const containerEl = swiper.el;
1301
+ if (params.containerRoleDescriptionMessage) {
1302
+ addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
1303
+ }
1304
+ if (params.containerMessage) {
1305
+ addElLabel(containerEl, params.containerMessage);
1306
+ }
1307
+ if (params.containerRole) {
1308
+ addElRole(containerEl, params.containerRole);
1309
+ }
1310
+
1311
+ // Wrapper
1312
+ const wrapperEl = swiper.wrapperEl;
1313
+ const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
1314
+ addElId(wrapperEl, wrapperId);
1315
+ if (params.wrapperLiveRegion) {
1316
+ const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
1317
+ addElLive(wrapperEl, live);
1318
+ }
1319
+
1320
+ // Slide
1321
+ initSlides();
1322
+
1323
+ // Navigation
1324
+ let {
1325
+ nextEl,
1326
+ prevEl
1327
+ } = swiper.navigation ? swiper.navigation : {};
1328
+ nextEl = makeElementsArray(nextEl);
1329
+ prevEl = makeElementsArray(prevEl);
1330
+ if (nextEl) {
1331
+ nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
1332
+ }
1333
+ if (prevEl) {
1334
+ prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
1335
+ }
1336
+
1337
+ // Pagination
1338
+ if (hasClickablePagination()) {
1339
+ const paginationEl = makeElementsArray(swiper.pagination.el);
1340
+ paginationEl.forEach(el => {
1341
+ el.addEventListener('keydown', onEnterOrSpaceKey);
1342
+ });
1343
+ }
1344
+
1345
+ // Tab focus
1346
+ const document = getDocument();
1347
+ document.addEventListener('visibilitychange', onVisibilityChange);
1348
+ swiper.el.addEventListener('focus', handleFocus, true);
1349
+ swiper.el.addEventListener('pointerdown', handlePointerDown, true);
1350
+ swiper.el.addEventListener('pointerup', handlePointerUp, true);
1351
+ };
1352
+ function destroy() {
1353
+ if (liveRegion) liveRegion.remove();
1354
+ let {
1355
+ nextEl,
1356
+ prevEl
1357
+ } = swiper.navigation ? swiper.navigation : {};
1358
+ nextEl = makeElementsArray(nextEl);
1359
+ prevEl = makeElementsArray(prevEl);
1360
+ if (nextEl) {
1361
+ nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
1362
+ }
1363
+ if (prevEl) {
1364
+ prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
1365
+ }
1366
+
1367
+ // Pagination
1368
+ if (hasClickablePagination()) {
1369
+ const paginationEl = makeElementsArray(swiper.pagination.el);
1370
+ paginationEl.forEach(el => {
1371
+ el.removeEventListener('keydown', onEnterOrSpaceKey);
1372
+ });
1373
+ }
1374
+ const document = getDocument();
1375
+ document.removeEventListener('visibilitychange', onVisibilityChange);
1376
+ // Tab focus
1377
+ if (swiper.el && typeof swiper.el !== 'string') {
1378
+ swiper.el.removeEventListener('focus', handleFocus, true);
1379
+ swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
1380
+ swiper.el.removeEventListener('pointerup', handlePointerUp, true);
1381
+ }
1382
+ }
1383
+ on('beforeInit', () => {
1384
+ liveRegion = createElement('span', swiper.params.a11y.notificationClass);
1385
+ liveRegion.setAttribute('aria-live', 'assertive');
1386
+ liveRegion.setAttribute('aria-atomic', 'true');
1387
+ });
1388
+ on('afterInit', () => {
1389
+ if (!swiper.params.a11y.enabled) return;
1390
+ init();
1391
+ });
1392
+ on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
1393
+ if (!swiper.params.a11y.enabled) return;
1394
+ initSlides();
1395
+ });
1396
+ on('fromEdge toEdge afterInit lock unlock', () => {
1397
+ if (!swiper.params.a11y.enabled) return;
1398
+ updateNavigation();
1399
+ });
1400
+ on('paginationUpdate', () => {
1401
+ if (!swiper.params.a11y.enabled) return;
1402
+ updatePagination();
1403
+ });
1404
+ on('destroy', () => {
1405
+ if (!swiper.params.a11y.enabled) return;
1406
+ destroy();
1407
+ });
1408
+ }
1409
+
1410
+ /* eslint no-underscore-dangle: "off" */
1411
+ /* eslint no-use-before-define: "off" */
1412
+ function Autoplay({
1413
+ swiper,
1414
+ extendParams,
1415
+ on,
1416
+ emit,
1417
+ params
1418
+ }) {
1419
+ swiper.autoplay = {
1420
+ running: false,
1421
+ paused: false,
1422
+ timeLeft: 0
1423
+ };
1424
+ extendParams({
1425
+ autoplay: {
1426
+ enabled: false,
1427
+ delay: 3000,
1428
+ waitForTransition: true,
1429
+ disableOnInteraction: false,
1430
+ stopOnLastSlide: false,
1431
+ reverseDirection: false,
1432
+ pauseOnMouseEnter: false
1433
+ }
1434
+ });
1435
+ let timeout;
1436
+ let raf;
1437
+ let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;
1438
+ let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;
1439
+ let autoplayTimeLeft;
1440
+ let autoplayStartTime = new Date().getTime();
1441
+ let wasPaused;
1442
+ let isTouched;
1443
+ let pausedByTouch;
1444
+ let touchStartTimeout;
1445
+ let pausedByInteraction;
1446
+ let pausedByPointerEnter;
1447
+ function onTransitionEnd(e) {
1448
+ if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
1449
+ if (e.target !== swiper.wrapperEl) return;
1450
+ swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
1451
+ if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
1452
+ return;
1453
+ }
1454
+ resume();
1455
+ }
1456
+ const calcTimeLeft = () => {
1457
+ if (swiper.destroyed || !swiper.autoplay.running) return;
1458
+ if (swiper.autoplay.paused) {
1459
+ wasPaused = true;
1460
+ } else if (wasPaused) {
1461
+ autoplayDelayCurrent = autoplayTimeLeft;
1462
+ wasPaused = false;
1463
+ }
1464
+ const timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime();
1465
+ swiper.autoplay.timeLeft = timeLeft;
1466
+ emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal);
1467
+ raf = requestAnimationFrame(() => {
1468
+ calcTimeLeft();
1469
+ });
1470
+ };
1471
+ const getSlideDelay = () => {
1472
+ let activeSlideEl;
1473
+ if (swiper.virtual && swiper.params.virtual.enabled) {
1474
+ activeSlideEl = swiper.slides.find(slideEl => slideEl.classList.contains('swiper-slide-active'));
1475
+ } else {
1476
+ activeSlideEl = swiper.slides[swiper.activeIndex];
1477
+ }
1478
+ if (!activeSlideEl) return undefined;
1479
+ const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
1480
+ return currentSlideDelay;
1481
+ };
1482
+ const getTotalDelay = () => {
1483
+ let totalDelay = swiper.params.autoplay.delay;
1484
+ const currentSlideDelay = getSlideDelay();
1485
+ if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0) {
1486
+ totalDelay = currentSlideDelay;
1487
+ }
1488
+ return totalDelay;
1489
+ };
1490
+ const run = delayForce => {
1491
+ if (swiper.destroyed || !swiper.autoplay.running) return;
1492
+ cancelAnimationFrame(raf);
1493
+ calcTimeLeft();
1494
+ let delay = delayForce;
1495
+ if (typeof delay === 'undefined') {
1496
+ delay = getTotalDelay();
1497
+ autoplayDelayTotal = delay;
1498
+ autoplayDelayCurrent = delay;
1499
+ }
1500
+ autoplayTimeLeft = delay;
1501
+ const speed = swiper.params.speed;
1502
+ const proceed = () => {
1503
+ if (!swiper || swiper.destroyed) return;
1504
+ if (swiper.params.autoplay.reverseDirection) {
1505
+ if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) {
1506
+ swiper.slidePrev(speed, true, true);
1507
+ emit('autoplay');
1508
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
1509
+ swiper.slideTo(swiper.slides.length - 1, speed, true, true);
1510
+ emit('autoplay');
1511
+ }
1512
+ } else {
1513
+ if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) {
1514
+ swiper.slideNext(speed, true, true);
1515
+ emit('autoplay');
1516
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
1517
+ swiper.slideTo(0, speed, true, true);
1518
+ emit('autoplay');
1519
+ }
1520
+ }
1521
+ if (swiper.params.cssMode) {
1522
+ autoplayStartTime = new Date().getTime();
1523
+ requestAnimationFrame(() => {
1524
+ run();
1525
+ });
1526
+ }
1527
+ };
1528
+ if (delay > 0) {
1529
+ clearTimeout(timeout);
1530
+ timeout = setTimeout(() => {
1531
+ proceed();
1532
+ }, delay);
1533
+ } else {
1534
+ requestAnimationFrame(() => {
1535
+ proceed();
1536
+ });
1537
+ }
1538
+
1539
+ // eslint-disable-next-line
1540
+ return delay;
1541
+ };
1542
+ const start = () => {
1543
+ autoplayStartTime = new Date().getTime();
1544
+ swiper.autoplay.running = true;
1545
+ run();
1546
+ emit('autoplayStart');
1547
+ };
1548
+ const stop = () => {
1549
+ swiper.autoplay.running = false;
1550
+ clearTimeout(timeout);
1551
+ cancelAnimationFrame(raf);
1552
+ emit('autoplayStop');
1553
+ };
1554
+ const pause = (internal, reset) => {
1555
+ if (swiper.destroyed || !swiper.autoplay.running) return;
1556
+ clearTimeout(timeout);
1557
+ if (!internal) {
1558
+ pausedByInteraction = true;
1559
+ }
1560
+ const proceed = () => {
1561
+ emit('autoplayPause');
1562
+ if (swiper.params.autoplay.waitForTransition) {
1563
+ swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd);
1564
+ } else {
1565
+ resume();
1566
+ }
1567
+ };
1568
+ swiper.autoplay.paused = true;
1569
+ if (reset) {
1570
+ proceed();
1571
+ return;
1572
+ }
1573
+ const delay = autoplayTimeLeft || swiper.params.autoplay.delay;
1574
+ autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime);
1575
+ if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return;
1576
+ if (autoplayTimeLeft < 0) autoplayTimeLeft = 0;
1577
+ proceed();
1578
+ };
1579
+ const resume = () => {
1580
+ if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return;
1581
+ autoplayStartTime = new Date().getTime();
1582
+ if (pausedByInteraction) {
1583
+ pausedByInteraction = false;
1584
+ run(autoplayTimeLeft);
1585
+ } else {
1586
+ run();
1587
+ }
1588
+ swiper.autoplay.paused = false;
1589
+ emit('autoplayResume');
1590
+ };
1591
+ const onVisibilityChange = () => {
1592
+ if (swiper.destroyed || !swiper.autoplay.running) return;
1593
+ const document = getDocument();
1594
+ if (document.visibilityState === 'hidden') {
1595
+ pausedByInteraction = true;
1596
+ pause(true);
1597
+ }
1598
+ if (document.visibilityState === 'visible') {
1599
+ resume();
1600
+ }
1601
+ };
1602
+ const onPointerEnter = e => {
1603
+ if (e.pointerType !== 'mouse') return;
1604
+ pausedByInteraction = true;
1605
+ pausedByPointerEnter = true;
1606
+ if (swiper.animating || swiper.autoplay.paused) return;
1607
+ pause(true);
1608
+ };
1609
+ const onPointerLeave = e => {
1610
+ if (e.pointerType !== 'mouse') return;
1611
+ pausedByPointerEnter = false;
1612
+ if (swiper.autoplay.paused) {
1613
+ resume();
1614
+ }
1615
+ };
1616
+ const attachMouseEvents = () => {
1617
+ if (swiper.params.autoplay.pauseOnMouseEnter) {
1618
+ swiper.el.addEventListener('pointerenter', onPointerEnter);
1619
+ swiper.el.addEventListener('pointerleave', onPointerLeave);
1620
+ }
1621
+ };
1622
+ const detachMouseEvents = () => {
1623
+ if (swiper.el && typeof swiper.el !== 'string') {
1624
+ swiper.el.removeEventListener('pointerenter', onPointerEnter);
1625
+ swiper.el.removeEventListener('pointerleave', onPointerLeave);
1626
+ }
1627
+ };
1628
+ const attachDocumentEvents = () => {
1629
+ const document = getDocument();
1630
+ document.addEventListener('visibilitychange', onVisibilityChange);
1631
+ };
1632
+ const detachDocumentEvents = () => {
1633
+ const document = getDocument();
1634
+ document.removeEventListener('visibilitychange', onVisibilityChange);
1635
+ };
1636
+ on('init', () => {
1637
+ if (swiper.params.autoplay.enabled) {
1638
+ attachMouseEvents();
1639
+ attachDocumentEvents();
1640
+ start();
1641
+ }
1642
+ });
1643
+ on('destroy', () => {
1644
+ detachMouseEvents();
1645
+ detachDocumentEvents();
1646
+ if (swiper.autoplay.running) {
1647
+ stop();
1648
+ }
1649
+ });
1650
+ on('_freeModeStaticRelease', () => {
1651
+ if (pausedByTouch || pausedByInteraction) {
1652
+ resume();
1653
+ }
1654
+ });
1655
+ on('_freeModeNoMomentumRelease', () => {
1656
+ if (!swiper.params.autoplay.disableOnInteraction) {
1657
+ pause(true, true);
1658
+ } else {
1659
+ stop();
1660
+ }
1661
+ });
1662
+ on('beforeTransitionStart', (_s, speed, internal) => {
1663
+ if (swiper.destroyed || !swiper.autoplay.running) return;
1664
+ if (internal || !swiper.params.autoplay.disableOnInteraction) {
1665
+ pause(true, true);
1666
+ } else {
1667
+ stop();
1668
+ }
1669
+ });
1670
+ on('sliderFirstMove', () => {
1671
+ if (swiper.destroyed || !swiper.autoplay.running) return;
1672
+ if (swiper.params.autoplay.disableOnInteraction) {
1673
+ stop();
1674
+ return;
1675
+ }
1676
+ isTouched = true;
1677
+ pausedByTouch = false;
1678
+ pausedByInteraction = false;
1679
+ touchStartTimeout = setTimeout(() => {
1680
+ pausedByInteraction = true;
1681
+ pausedByTouch = true;
1682
+ pause(true);
1683
+ }, 200);
1684
+ });
1685
+ on('touchEnd', () => {
1686
+ if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return;
1687
+ clearTimeout(touchStartTimeout);
1688
+ clearTimeout(timeout);
1689
+ if (swiper.params.autoplay.disableOnInteraction) {
1690
+ pausedByTouch = false;
1691
+ isTouched = false;
1692
+ return;
1693
+ }
1694
+ if (pausedByTouch && swiper.params.cssMode) resume();
1695
+ pausedByTouch = false;
1696
+ isTouched = false;
1697
+ });
1698
+ on('slideChange', () => {
1699
+ if (swiper.destroyed || !swiper.autoplay.running) return;
1700
+ if (swiper.autoplay.paused) {
1701
+ autoplayTimeLeft = getTotalDelay();
1702
+ autoplayDelayTotal = getTotalDelay();
1703
+ }
1704
+ });
1705
+ Object.assign(swiper.autoplay, {
1706
+ start,
1707
+ stop,
1708
+ pause,
1709
+ resume
1710
+ });
1711
+ }
1712
+
1713
+ export { A11y, Autoplay, Navigation, Pagination, Scrollbar };