@itcenteratunihelsinki/huds-lib 0.8.41 → 0.8.43

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 (291) hide show
  1. package/dist/cjs/color-box_8.cjs.entry.js +11 -36
  2. package/dist/cjs/{globalScript-6b592153.js → globalScript-45ad6d41.js} +1 -1
  3. package/dist/cjs/huds-lib.cjs.js +11 -4
  4. package/dist/cjs/hy-accordion-container_83.cjs.entry.js +363 -157
  5. package/dist/cjs/hy-event-item.cjs.entry.js +5 -2
  6. package/dist/cjs/hy-events.cjs.entry.js +4 -2
  7. package/dist/cjs/hy-hero-carousel.cjs.entry.js +4902 -0
  8. package/dist/cjs/{index-dfc917d9.js → index-25bd964b.js} +690 -287
  9. package/dist/cjs/loader.cjs.js +5 -4
  10. package/dist/collection/collection-manifest.json +3 -2
  11. package/dist/collection/components/accordion-container/accordion-container.js +36 -30
  12. package/dist/collection/components/accordion-item/accordion-item.js +115 -114
  13. package/dist/collection/components/adjacent-image-text/adjacent-image-text.js +276 -275
  14. package/dist/collection/components/baseline/baseline.js +34 -32
  15. package/dist/collection/components/button/button.js +225 -257
  16. package/dist/collection/components/color-box/color-box.js +12 -9
  17. package/dist/collection/components/courses/hy-content-list/hy-content-list.js +153 -148
  18. package/dist/collection/components/courses/hy-content-list-item/hy-content-list-item.css +2 -2
  19. package/dist/collection/components/courses/hy-content-list-item/hy-content-list-item.js +334 -331
  20. package/dist/collection/components/cta-button/cta-button.js +140 -138
  21. package/dist/collection/components/cta-link/cta-link.js +106 -103
  22. package/dist/collection/components/docs-container/docs-container.js +12 -9
  23. package/dist/collection/components/footer/hy-footer/hy-footer.js +12 -9
  24. package/dist/collection/components/footer/hy-footer-action/hy-footer-action.js +62 -55
  25. package/dist/collection/components/footer/hy-footer-base/hy-footer-base.js +182 -187
  26. package/dist/collection/components/footer/hy-footer-info/hy-footer-info.js +277 -270
  27. package/dist/collection/components/footer/hy-footer-link-item/hy-footer-link-item.js +190 -190
  28. package/dist/collection/components/grid-container/grid-container.js +12 -9
  29. package/dist/collection/components/grid-item/grid-item.css +0 -23
  30. package/dist/collection/components/grid-item/grid-item.js +101 -96
  31. package/dist/collection/components/grid-row/grid-row.js +12 -9
  32. package/dist/collection/components/heading/heading-fw.css +17 -17
  33. package/dist/collection/components/heading/heading.css +17 -17
  34. package/dist/collection/components/heading/heading.js +141 -146
  35. package/dist/collection/components/hy-anchor-link-list/hy-anchor-link-list.js +104 -99
  36. package/dist/collection/components/hy-badge/hy-badge.js +34 -30
  37. package/dist/collection/components/hy-banner/hy-banner.js +136 -135
  38. package/dist/collection/components/hy-box/hy-box.js +322 -318
  39. package/dist/collection/components/hy-box-container/hy-box-container.js +52 -54
  40. package/dist/collection/components/hy-breadcrumbs/hy-breadcrumbs.js +88 -82
  41. package/dist/collection/components/hy-checkbox/hy-checkbox.js +107 -114
  42. package/dist/collection/components/hy-collaboration/hy-collaboration.js +104 -99
  43. package/dist/collection/components/hy-crisis-banner/hy-crisis-banner.js +87 -85
  44. package/dist/collection/components/hy-dropdown/hy-dropdown.js +152 -147
  45. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.item.js +75 -74
  46. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.js +26 -22
  47. package/dist/collection/components/hy-event-item/hy-event-item.js +183 -192
  48. package/dist/collection/components/hy-events/hy-events.js +130 -127
  49. package/dist/collection/components/hy-filter-group/hy-filter-group.item.js +43 -41
  50. package/dist/collection/components/hy-filter-group/hy-filter-group.js +63 -54
  51. package/dist/collection/components/hy-filter-list-type/hy-filter-list-type.js +61 -56
  52. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.js +37 -30
  53. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.reset.js +2 -4
  54. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.reset.toggle.js +2 -8
  55. package/dist/collection/components/hy-general-list/hy-general-list.js +122 -113
  56. package/dist/collection/components/hy-general-list-item/hy-general-list-item.js +255 -258
  57. package/dist/collection/components/hy-hero/hy-hero.css +2 -2
  58. package/dist/collection/components/hy-hero/hy-hero.js +295 -308
  59. package/dist/collection/components/hy-hero-carousel/hy-hero-carousel.css +1306 -0
  60. package/dist/collection/components/hy-hero-carousel/hy-hero-carousel.js +211 -0
  61. package/dist/collection/components/hy-introduction/hy-introduction.js +247 -250
  62. package/dist/collection/components/hy-key-figure/hy-key-figure.js +72 -66
  63. package/dist/collection/components/hy-key-figure-group/hy-key-figure-group.css +1 -1
  64. package/dist/collection/components/hy-key-figure-group/hy-key-figure-group.js +66 -65
  65. package/dist/collection/components/hy-key-highlight/hy-key-highlight.js +72 -67
  66. package/dist/collection/components/hy-key-highlight-group/hy-key-highlight-group.css +2 -2
  67. package/dist/collection/components/hy-key-highlight-group/hy-key-highlight-group.js +78 -71
  68. package/dist/collection/components/hy-large-process-flow/hy-large-process-flow.css +6 -6
  69. package/dist/collection/components/hy-large-process-flow/hy-large-process-flow.js +54 -46
  70. package/dist/collection/components/hy-large-process-flow-phase/hy-large-process-flow-phase.css +3 -3
  71. package/dist/collection/components/hy-large-process-flow-phase/hy-large-process-flow-phase.js +40 -37
  72. package/dist/collection/components/hy-link-list/hy-link-list.js +106 -100
  73. package/dist/collection/components/hy-list-item/hy-list-item.js +428 -451
  74. package/dist/collection/components/hy-logo-grid/hy-logo-grid.item.js +53 -47
  75. package/dist/collection/components/hy-logo-grid/hy-logo-grid.js +53 -46
  76. package/dist/collection/components/hy-main/hy-main.js +34 -29
  77. package/dist/collection/components/hy-main-content-wrapper/hy-main-content-wrapper.js +12 -10
  78. package/dist/collection/components/hy-opening-hours/hy-opening-hours.css +2 -2
  79. package/dist/collection/components/hy-opening-hours/hy-opening-hours.js +304 -308
  80. package/dist/collection/components/hy-opening-hours-content/hy-opening-hours-content.css +2 -2
  81. package/dist/collection/components/hy-opening-hours-content/hy-opening-hours-content.js +107 -107
  82. package/dist/collection/components/hy-person-card/hy-person-card.js +422 -438
  83. package/dist/collection/components/hy-prominent-image/hy-prominent-image.js +106 -100
  84. package/dist/collection/components/hy-quote/hy-quote.js +51 -51
  85. package/dist/collection/components/hy-search-field/hy-search-field.js +166 -167
  86. package/dist/collection/components/hy-shortcuts/hy-shortcuts.css +1 -1
  87. package/dist/collection/components/hy-shortcuts/hy-shortcuts.js +89 -87
  88. package/dist/collection/components/hy-table-container/hy-table-container.css +6 -6
  89. package/dist/collection/components/hy-table-container/hy-table-container.js +12 -10
  90. package/dist/collection/components/hy-tabs/hy-tabs.js +115 -111
  91. package/dist/collection/components/hy-tabs-item/hy-tabs-item.js +36 -28
  92. package/dist/collection/components/hy-tag/hy-tag.js +12 -11
  93. package/dist/collection/components/hy-twitter-feed/hy-twitter-feed.js +107 -128
  94. package/dist/collection/components/hy-two-columns/hy-two-columns.js +34 -33
  95. package/dist/collection/components/hy-user-login-form/hy-user-login-form.js +53 -46
  96. package/dist/collection/components/hy-video/hy-video.css +1 -1
  97. package/dist/collection/components/hy-video/hy-video.js +462 -500
  98. package/dist/collection/components/icon/AddToTodoList.js +1 -2
  99. package/dist/collection/components/icon/Alert.js +1 -3
  100. package/dist/collection/components/icon/Archive.js +1 -5
  101. package/dist/collection/components/icon/Arrow.js +1 -2
  102. package/dist/collection/components/icon/ArrowDown.js +1 -2
  103. package/dist/collection/components/icon/ArrowRight.js +1 -7
  104. package/dist/collection/components/icon/ArrowUp.js +1 -2
  105. package/dist/collection/components/icon/Avatar.js +1 -2
  106. package/dist/collection/components/icon/AvatarGroup.js +1 -2
  107. package/dist/collection/components/icon/Bachelor.js +1 -2
  108. package/dist/collection/components/icon/BulletList.js +1 -2
  109. package/dist/collection/components/icon/Camera.js +1 -2
  110. package/dist/collection/components/icon/CaretDown.js +1 -2
  111. package/dist/collection/components/icon/CaretLeft.js +1 -2
  112. package/dist/collection/components/icon/CaretRight.js +1 -2
  113. package/dist/collection/components/icon/CaretUp.js +1 -2
  114. package/dist/collection/components/icon/Chat.js +1 -2
  115. package/dist/collection/components/icon/CodeFork.js +1 -2
  116. package/dist/collection/components/icon/Cogs.js +1 -2
  117. package/dist/collection/components/icon/Contentlink.js +1 -2
  118. package/dist/collection/components/icon/Customlink.js +1 -2
  119. package/dist/collection/components/icon/Date.js +1 -2
  120. package/dist/collection/components/icon/Discover.js +1 -2
  121. package/dist/collection/components/icon/Done.js +1 -2
  122. package/dist/collection/components/icon/Dot.js +1 -2
  123. package/dist/collection/components/icon/DotArrowRight.js +1 -6
  124. package/dist/collection/components/icon/Download.js +1 -2
  125. package/dist/collection/components/icon/Drag.js +1 -2
  126. package/dist/collection/components/icon/Dragbutton.js +1 -2
  127. package/dist/collection/components/icon/DropDown.js +1 -2
  128. package/dist/collection/components/icon/Edit.js +1 -2
  129. package/dist/collection/components/icon/EditEvent.js +1 -2
  130. package/dist/collection/components/icon/Embed.js +1 -2
  131. package/dist/collection/components/icon/Euro.js +1 -2
  132. package/dist/collection/components/icon/Events.js +1 -2
  133. package/dist/collection/components/icon/ExternalLink.js +1 -2
  134. package/dist/collection/components/icon/EyeSlash.js +1 -2
  135. package/dist/collection/components/icon/Facebook.js +1 -2
  136. package/dist/collection/components/icon/Favorites.js +1 -2
  137. package/dist/collection/components/icon/Feed.js +1 -2
  138. package/dist/collection/components/icon/FileText.js +1 -2
  139. package/dist/collection/components/icon/FullScreen.js +1 -2
  140. package/dist/collection/components/icon/Globe.js +1 -2
  141. package/dist/collection/components/icon/GooglePlus.js +1 -2
  142. package/dist/collection/components/icon/Grid.js +1 -2
  143. package/dist/collection/components/icon/Hamburger.js +1 -2
  144. package/dist/collection/components/icon/Heart.js +1 -2
  145. package/dist/collection/components/icon/HeartSupport.js +1 -2
  146. package/dist/collection/components/icon/Helsinginyliopisto.js +1 -2
  147. package/dist/collection/components/icon/Home.js +1 -2
  148. package/dist/collection/components/icon/HorizontalResize.js +1 -2
  149. package/dist/collection/components/icon/HyLogo.js +1 -2
  150. package/dist/collection/components/icon/IdNumber.js +1 -2
  151. package/dist/collection/components/icon/Image.js +1 -2
  152. package/dist/collection/components/icon/ImageGallery.js +1 -2
  153. package/dist/collection/components/icon/Images.js +1 -2
  154. package/dist/collection/components/icon/Info.js +1 -2
  155. package/dist/collection/components/icon/InfoStroke.js +1 -2
  156. package/dist/collection/components/icon/Instagram.js +1 -2
  157. package/dist/collection/components/icon/LeikiList.js +1 -2
  158. package/dist/collection/components/icon/LinkArrow.js +1 -2
  159. package/dist/collection/components/icon/LinkArrow1.js +1 -2
  160. package/dist/collection/components/icon/LinkArrowDown.js +1 -2
  161. package/dist/collection/components/icon/LinkArrowLeft.js +1 -2
  162. package/dist/collection/components/icon/LinkArrowOffsite.js +1 -2
  163. package/dist/collection/components/icon/LinkArrowUp.js +1 -2
  164. package/dist/collection/components/icon/Linkedin.js +1 -2
  165. package/dist/collection/components/icon/List.js +1 -2
  166. package/dist/collection/components/icon/ListAsBlocks.js +1 -2
  167. package/dist/collection/components/icon/ListStyleGrid.js +1 -10
  168. package/dist/collection/components/icon/ListStyleList.js +1 -5
  169. package/dist/collection/components/icon/Listoflinks.js +1 -2
  170. package/dist/collection/components/icon/Location.js +1 -2
  171. package/dist/collection/components/icon/Log.js +1 -2
  172. package/dist/collection/components/icon/Login.js +1 -2
  173. package/dist/collection/components/icon/Logout.js +1 -2
  174. package/dist/collection/components/icon/MagnifyMinus.js +1 -2
  175. package/dist/collection/components/icon/MagnifyPlus.js +1 -2
  176. package/dist/collection/components/icon/Mail.js +1 -2
  177. package/dist/collection/components/icon/Master.js +1 -2
  178. package/dist/collection/components/icon/Minus.js +1 -2
  179. package/dist/collection/components/icon/Mobile.js +1 -2
  180. package/dist/collection/components/icon/Modify.js +1 -2
  181. package/dist/collection/components/icon/NaviTriangle.js +1 -2
  182. package/dist/collection/components/icon/NewGroup.js +1 -2
  183. package/dist/collection/components/icon/NewPerson.js +1 -2
  184. package/dist/collection/components/icon/Notification.js +1 -2
  185. package/dist/collection/components/icon/OpinderLogo.js +1 -2
  186. package/dist/collection/components/icon/OpinderLogoNew.js +1 -2
  187. package/dist/collection/components/icon/Pdf.js +1 -2
  188. package/dist/collection/components/icon/People.js +1 -2
  189. package/dist/collection/components/icon/PermissionAll.js +1 -2
  190. package/dist/collection/components/icon/PermissionGroup.js +1 -2
  191. package/dist/collection/components/icon/PermissionPrivate.js +1 -2
  192. package/dist/collection/components/icon/Person.js +1 -2
  193. package/dist/collection/components/icon/PersonOutline.js +1 -2
  194. package/dist/collection/components/icon/Phone.js +1 -2
  195. package/dist/collection/components/icon/Play.js +1 -2
  196. package/dist/collection/components/icon/Plus.js +1 -2
  197. package/dist/collection/components/icon/Preview.js +1 -2
  198. package/dist/collection/components/icon/Profile.js +1 -2
  199. package/dist/collection/components/icon/Question.js +1 -2
  200. package/dist/collection/components/icon/Remove.js +1 -2
  201. package/dist/collection/components/icon/Retweet.js +1 -2
  202. package/dist/collection/components/icon/RotateLeft.js +1 -2
  203. package/dist/collection/components/icon/RotateRight.js +1 -2
  204. package/dist/collection/components/icon/Search.js +1 -2
  205. package/dist/collection/components/icon/Share.js +1 -2
  206. package/dist/collection/components/icon/SlimHamburgerMenu.js +1 -2
  207. package/dist/collection/components/icon/SocialMedia.js +1 -2
  208. package/dist/collection/components/icon/SomeFacebook.js +1 -2
  209. package/dist/collection/components/icon/SomeInstagram.js +1 -4
  210. package/dist/collection/components/icon/SomeLinkedin.js +1 -2
  211. package/dist/collection/components/icon/SomeTwitter.js +1 -2
  212. package/dist/collection/components/icon/SomeYoutube.js +1 -2
  213. package/dist/collection/components/icon/Spinner.js +1 -2
  214. package/dist/collection/components/icon/Square.js +1 -2
  215. package/dist/collection/components/icon/SquareChecked.js +1 -2
  216. package/dist/collection/components/icon/Time.js +1 -2
  217. package/dist/collection/components/icon/TodoList.js +1 -2
  218. package/dist/collection/components/icon/Tour.js +1 -2
  219. package/dist/collection/components/icon/Twitter.js +1 -2
  220. package/dist/collection/components/icon/TwitterLike.js +1 -2
  221. package/dist/collection/components/icon/UnitsAndFaculties.js +1 -2
  222. package/dist/collection/components/icon/Url.js +1 -2
  223. package/dist/collection/components/icon/Video.js +1 -2
  224. package/dist/collection/components/icon/Warning.js +1 -2
  225. package/dist/collection/components/icon/Wrench.js +1 -2
  226. package/dist/collection/components/icon/Youtube.js +1 -2
  227. package/dist/collection/components/icon/icon.js +67 -60
  228. package/dist/collection/components/icon/icons.js +4 -8
  229. package/dist/collection/components/image/image.js +147 -141
  230. package/dist/collection/components/ingress/ingress.js +34 -30
  231. package/dist/collection/components/link/link.js +106 -99
  232. package/dist/collection/components/link-box/link-box.css +0 -1
  233. package/dist/collection/components/link-box/link-box.js +270 -272
  234. package/dist/collection/components/link-box-list/link-box-list.js +95 -89
  235. package/dist/collection/components/navigation/hy-menu-main-group/hy-menu-main-group.js +285 -290
  236. package/dist/collection/components/navigation/menu-language/menu-language.js +147 -138
  237. package/dist/collection/components/navigation/menu-language-item/menu-language-item.js +123 -114
  238. package/dist/collection/components/pagination/hy-pager/hy-pager.js +12 -9
  239. package/dist/collection/components/pagination/hy-pager-item/hy-pager-item.js +92 -95
  240. package/dist/collection/components/paragraph-text/paragraph-text-content.css +14 -14
  241. package/dist/collection/components/paragraph-text/paragraph-text-landing.css +8 -8
  242. package/dist/collection/components/paragraph-text/paragraph-text.css +22 -22
  243. package/dist/collection/components/paragraph-text/paragraph-text.js +72 -67
  244. package/dist/collection/components/person-profile/person-profile-listing/person-profile-listing.css +1 -1
  245. package/dist/collection/components/person-profile/person-profile-listing/person-profile.listing.js +127 -126
  246. package/dist/collection/components/person-profile/person-profile.css +4 -4
  247. package/dist/collection/components/person-profile/person-profile.js +138 -182
  248. package/dist/collection/components/process/process.js +71 -62
  249. package/dist/collection/components/process-flow-box/process-flow-box.js +144 -148
  250. package/dist/collection/components/row/row.js +68 -72
  251. package/dist/collection/components/section-container/section-container.js +12 -9
  252. package/dist/collection/components/site-header/site-header.css +1 -1
  253. package/dist/collection/components/site-header/site-header.js +540 -560
  254. package/dist/collection/components/site-header/site-logo/site-logo.js +148 -148
  255. package/dist/collection/components/site-header/site-search/site-search.js +297 -312
  256. package/dist/collection/components/tiny-text/tiny-text.js +12 -9
  257. package/dist/esm/color-box_8.entry.js +12 -37
  258. package/dist/esm/{globalScript-9d045b36.js → globalScript-4ad40215.js} +1 -1
  259. package/dist/esm/huds-lib.js +8 -4
  260. package/dist/esm/hy-accordion-container_83.entry.js +364 -158
  261. package/dist/esm/hy-event-item.entry.js +5 -2
  262. package/dist/esm/hy-events.entry.js +5 -3
  263. package/dist/esm/hy-hero-carousel.entry.js +4898 -0
  264. package/dist/esm/{index-daaf0985.js → index-3a66d87e.js} +690 -288
  265. package/dist/esm/loader.js +5 -4
  266. package/dist/esm/polyfills/css-shim.js +1 -1
  267. package/dist/esm/{utils-7731bbdf.js → utils-43c56d92.js} +1 -1
  268. package/dist/huds-lib/huds-lib.esm.js +1 -1
  269. package/dist/huds-lib/{p-0ea3ec9a.js → p-63584350.js} +1 -1
  270. package/dist/huds-lib/p-7c7ea6b3.entry.js +1 -0
  271. package/dist/huds-lib/p-8d5c2e5b.entry.js +1 -0
  272. package/dist/huds-lib/p-91f6109f.entry.js +1 -0
  273. package/dist/huds-lib/p-9a15a75b.entry.js +1 -0
  274. package/dist/huds-lib/{p-04dcccdc.js → p-b02e49ad.js} +1 -1
  275. package/dist/huds-lib/p-ff975a68.js +2 -0
  276. package/dist/huds-lib/p-ffd1d29a.entry.js +87 -0
  277. package/dist/types/components/hy-hero-carousel/hy-hero-carousel.d.ts +30 -0
  278. package/dist/types/components/person-profile/person-profile-listing/person-profile.listing.d.ts +1 -1
  279. package/dist/types/components.d.ts +95 -20
  280. package/dist/types/stencil-public-runtime.d.ts +92 -19
  281. package/dist/types/utils/utils.d.ts +4 -4
  282. package/loader/index.d.ts +11 -12
  283. package/loader/index.es2017.js +1 -0
  284. package/loader/index.js +2 -11
  285. package/loader/package.json +2 -1
  286. package/package.json +13 -11
  287. package/dist/huds-lib/p-0370da7d.entry.js +0 -87
  288. package/dist/huds-lib/p-2244fcda.entry.js +0 -1
  289. package/dist/huds-lib/p-aba9f82a.entry.js +0 -1
  290. package/dist/huds-lib/p-c68c36c3.entry.js +0 -1
  291. package/dist/huds-lib/p-f8697bf9.js +0 -1
@@ -0,0 +1,4902 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-25bd964b.js');
6
+ const globalScript = require('./globalScript-45ad6d41.js');
7
+ const utils = require('./utils-14d5aa6f.js');
8
+
9
+ /**
10
+ * SSR Window 4.0.2
11
+ * Better handling for window object in SSR environment
12
+ * https://github.com/nolimits4web/ssr-window
13
+ *
14
+ * Copyright 2021, Vladimir Kharlampidi
15
+ *
16
+ * Licensed under MIT
17
+ *
18
+ * Released on: December 13, 2021
19
+ */
20
+ /* eslint-disable no-param-reassign */
21
+ function isObject$1(obj) {
22
+ return (obj !== null &&
23
+ typeof obj === 'object' &&
24
+ 'constructor' in obj &&
25
+ obj.constructor === Object);
26
+ }
27
+ function extend$1(target = {}, src = {}) {
28
+ Object.keys(src).forEach((key) => {
29
+ if (typeof target[key] === 'undefined')
30
+ target[key] = src[key];
31
+ else if (isObject$1(src[key]) &&
32
+ isObject$1(target[key]) &&
33
+ Object.keys(src[key]).length > 0) {
34
+ extend$1(target[key], src[key]);
35
+ }
36
+ });
37
+ }
38
+
39
+ const ssrDocument = {
40
+ body: {},
41
+ addEventListener() { },
42
+ removeEventListener() { },
43
+ activeElement: {
44
+ blur() { },
45
+ nodeName: '',
46
+ },
47
+ querySelector() {
48
+ return null;
49
+ },
50
+ querySelectorAll() {
51
+ return [];
52
+ },
53
+ getElementById() {
54
+ return null;
55
+ },
56
+ createEvent() {
57
+ return {
58
+ initEvent() { },
59
+ };
60
+ },
61
+ createElement() {
62
+ return {
63
+ children: [],
64
+ childNodes: [],
65
+ style: {},
66
+ setAttribute() { },
67
+ getElementsByTagName() {
68
+ return [];
69
+ },
70
+ };
71
+ },
72
+ createElementNS() {
73
+ return {};
74
+ },
75
+ importNode() {
76
+ return null;
77
+ },
78
+ location: {
79
+ hash: '',
80
+ host: '',
81
+ hostname: '',
82
+ href: '',
83
+ origin: '',
84
+ pathname: '',
85
+ protocol: '',
86
+ search: '',
87
+ },
88
+ };
89
+ function getDocument() {
90
+ const doc = typeof document !== 'undefined' ? document : {};
91
+ extend$1(doc, ssrDocument);
92
+ return doc;
93
+ }
94
+
95
+ const ssrWindow = {
96
+ document: ssrDocument,
97
+ navigator: {
98
+ userAgent: '',
99
+ },
100
+ location: {
101
+ hash: '',
102
+ host: '',
103
+ hostname: '',
104
+ href: '',
105
+ origin: '',
106
+ pathname: '',
107
+ protocol: '',
108
+ search: '',
109
+ },
110
+ history: {
111
+ replaceState() { },
112
+ pushState() { },
113
+ go() { },
114
+ back() { },
115
+ },
116
+ CustomEvent: function CustomEvent() {
117
+ return this;
118
+ },
119
+ addEventListener() { },
120
+ removeEventListener() { },
121
+ getComputedStyle() {
122
+ return {
123
+ getPropertyValue() {
124
+ return '';
125
+ },
126
+ };
127
+ },
128
+ Image() { },
129
+ Date() { },
130
+ screen: {},
131
+ setTimeout() { },
132
+ clearTimeout() { },
133
+ matchMedia() {
134
+ return {};
135
+ },
136
+ requestAnimationFrame(callback) {
137
+ if (typeof setTimeout === 'undefined') {
138
+ callback();
139
+ return null;
140
+ }
141
+ return setTimeout(callback, 0);
142
+ },
143
+ cancelAnimationFrame(id) {
144
+ if (typeof setTimeout === 'undefined') {
145
+ return;
146
+ }
147
+ clearTimeout(id);
148
+ },
149
+ };
150
+ function getWindow() {
151
+ const win = typeof window !== 'undefined' ? window : {};
152
+ extend$1(win, ssrWindow);
153
+ return win;
154
+ }
155
+
156
+ function deleteProps(obj) {
157
+ const object = obj;
158
+ Object.keys(object).forEach(key => {
159
+ try {
160
+ object[key] = null;
161
+ } catch (e) {
162
+ // no getter for object
163
+ }
164
+ try {
165
+ delete object[key];
166
+ } catch (e) {
167
+ // something got wrong
168
+ }
169
+ });
170
+ }
171
+ function nextTick(callback, delay = 0) {
172
+ return setTimeout(callback, delay);
173
+ }
174
+ function now() {
175
+ return Date.now();
176
+ }
177
+ function getComputedStyle$1(el) {
178
+ const window = getWindow();
179
+ let style;
180
+ if (window.getComputedStyle) {
181
+ style = window.getComputedStyle(el, null);
182
+ }
183
+ if (!style && el.currentStyle) {
184
+ style = el.currentStyle;
185
+ }
186
+ if (!style) {
187
+ style = el.style;
188
+ }
189
+ return style;
190
+ }
191
+ function getTranslate(el, axis = 'x') {
192
+ const window = getWindow();
193
+ let matrix;
194
+ let curTransform;
195
+ let transformMatrix;
196
+ const curStyle = getComputedStyle$1(el);
197
+ if (window.WebKitCSSMatrix) {
198
+ curTransform = curStyle.transform || curStyle.webkitTransform;
199
+ if (curTransform.split(',').length > 6) {
200
+ curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
201
+ }
202
+ // Some old versions of Webkit choke when 'none' is passed; pass
203
+ // empty string instead in this case
204
+ transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
205
+ } else {
206
+ transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
207
+ matrix = transformMatrix.toString().split(',');
208
+ }
209
+ if (axis === 'x') {
210
+ // Latest Chrome and webkits Fix
211
+ if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;
212
+ // Crazy IE10 Matrix
213
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
214
+ // Normal Browsers
215
+ else curTransform = parseFloat(matrix[4]);
216
+ }
217
+ if (axis === 'y') {
218
+ // Latest Chrome and webkits Fix
219
+ if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;
220
+ // Crazy IE10 Matrix
221
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
222
+ // Normal Browsers
223
+ else curTransform = parseFloat(matrix[5]);
224
+ }
225
+ return curTransform || 0;
226
+ }
227
+ function isObject(o) {
228
+ return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
229
+ }
230
+ function isNode(node) {
231
+ // eslint-disable-next-line
232
+ if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
233
+ return node instanceof HTMLElement;
234
+ }
235
+ return node && (node.nodeType === 1 || node.nodeType === 11);
236
+ }
237
+ function extend(...args) {
238
+ const to = Object(args[0]);
239
+ const noExtend = ['__proto__', 'constructor', 'prototype'];
240
+ for (let i = 1; i < args.length; i += 1) {
241
+ const nextSource = args[i];
242
+ if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
243
+ const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
244
+ for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
245
+ const nextKey = keysArray[nextIndex];
246
+ const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
247
+ if (desc !== undefined && desc.enumerable) {
248
+ if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
249
+ if (nextSource[nextKey].__swiper__) {
250
+ to[nextKey] = nextSource[nextKey];
251
+ } else {
252
+ extend(to[nextKey], nextSource[nextKey]);
253
+ }
254
+ } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
255
+ to[nextKey] = {};
256
+ if (nextSource[nextKey].__swiper__) {
257
+ to[nextKey] = nextSource[nextKey];
258
+ } else {
259
+ extend(to[nextKey], nextSource[nextKey]);
260
+ }
261
+ } else {
262
+ to[nextKey] = nextSource[nextKey];
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
268
+ return to;
269
+ }
270
+ function setCSSProperty(el, varName, varValue) {
271
+ el.style.setProperty(varName, varValue);
272
+ }
273
+ function animateCSSModeScroll({
274
+ swiper,
275
+ targetPosition,
276
+ side
277
+ }) {
278
+ const window = getWindow();
279
+ const startPosition = -swiper.translate;
280
+ let startTime = null;
281
+ let time;
282
+ const duration = swiper.params.speed;
283
+ swiper.wrapperEl.style.scrollSnapType = 'none';
284
+ window.cancelAnimationFrame(swiper.cssModeFrameID);
285
+ const dir = targetPosition > startPosition ? 'next' : 'prev';
286
+ const isOutOfBound = (current, target) => {
287
+ return dir === 'next' && current >= target || dir === 'prev' && current <= target;
288
+ };
289
+ const animate = () => {
290
+ time = new Date().getTime();
291
+ if (startTime === null) {
292
+ startTime = time;
293
+ }
294
+ const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
295
+ const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
296
+ let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
297
+ if (isOutOfBound(currentPosition, targetPosition)) {
298
+ currentPosition = targetPosition;
299
+ }
300
+ swiper.wrapperEl.scrollTo({
301
+ [side]: currentPosition
302
+ });
303
+ if (isOutOfBound(currentPosition, targetPosition)) {
304
+ swiper.wrapperEl.style.overflow = 'hidden';
305
+ swiper.wrapperEl.style.scrollSnapType = '';
306
+ setTimeout(() => {
307
+ swiper.wrapperEl.style.overflow = '';
308
+ swiper.wrapperEl.scrollTo({
309
+ [side]: currentPosition
310
+ });
311
+ });
312
+ window.cancelAnimationFrame(swiper.cssModeFrameID);
313
+ return;
314
+ }
315
+ swiper.cssModeFrameID = window.requestAnimationFrame(animate);
316
+ };
317
+ animate();
318
+ }
319
+ function elementChildren(element, selector = '') {
320
+ return [...element.children].filter(el => el.matches(selector));
321
+ }
322
+ function createElement(tag, classes = []) {
323
+ const el = document.createElement(tag);
324
+ el.classList.add(...(Array.isArray(classes) ? classes : [classes]));
325
+ return el;
326
+ }
327
+ function elementPrevAll(el, selector) {
328
+ const prevEls = [];
329
+ while (el.previousElementSibling) {
330
+ const prev = el.previousElementSibling; // eslint-disable-line
331
+ if (selector) {
332
+ if (prev.matches(selector)) prevEls.push(prev);
333
+ } else prevEls.push(prev);
334
+ el = prev;
335
+ }
336
+ return prevEls;
337
+ }
338
+ function elementNextAll(el, selector) {
339
+ const nextEls = [];
340
+ while (el.nextElementSibling) {
341
+ const next = el.nextElementSibling; // eslint-disable-line
342
+ if (selector) {
343
+ if (next.matches(selector)) nextEls.push(next);
344
+ } else nextEls.push(next);
345
+ el = next;
346
+ }
347
+ return nextEls;
348
+ }
349
+ function elementStyle(el, prop) {
350
+ const window = getWindow();
351
+ return window.getComputedStyle(el, null).getPropertyValue(prop);
352
+ }
353
+ function elementIndex(el) {
354
+ let child = el;
355
+ let i;
356
+ if (child) {
357
+ i = 0;
358
+ // eslint-disable-next-line
359
+ while ((child = child.previousSibling) !== null) {
360
+ if (child.nodeType === 1) i += 1;
361
+ }
362
+ return i;
363
+ }
364
+ return undefined;
365
+ }
366
+ function elementParents(el, selector) {
367
+ const parents = []; // eslint-disable-line
368
+ let parent = el.parentElement; // eslint-disable-line
369
+ while (parent) {
370
+ if (selector) {
371
+ if (parent.matches(selector)) parents.push(parent);
372
+ } else {
373
+ parents.push(parent);
374
+ }
375
+ parent = parent.parentElement;
376
+ }
377
+ return parents;
378
+ }
379
+ function elementOuterSize(el, size, includeMargins) {
380
+ const window = getWindow();
381
+ if (includeMargins) {
382
+ return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom'));
383
+ }
384
+ return el.offsetWidth;
385
+ }
386
+
387
+ let support;
388
+ function calcSupport() {
389
+ const window = getWindow();
390
+ const document = getDocument();
391
+ return {
392
+ smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style,
393
+ touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch)
394
+ };
395
+ }
396
+ function getSupport() {
397
+ if (!support) {
398
+ support = calcSupport();
399
+ }
400
+ return support;
401
+ }
402
+
403
+ let deviceCached;
404
+ function calcDevice({
405
+ userAgent
406
+ } = {}) {
407
+ const support = getSupport();
408
+ const window = getWindow();
409
+ const platform = window.navigator.platform;
410
+ const ua = userAgent || window.navigator.userAgent;
411
+ const device = {
412
+ ios: false,
413
+ android: false
414
+ };
415
+ const screenWidth = window.screen.width;
416
+ const screenHeight = window.screen.height;
417
+ const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
418
+ let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
419
+ const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
420
+ const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
421
+ const windows = platform === 'Win32';
422
+ let macos = platform === 'MacIntel';
423
+
424
+ // iPadOs 13 fix
425
+ const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];
426
+ if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {
427
+ ipad = ua.match(/(Version)\/([\d.]+)/);
428
+ if (!ipad) ipad = [0, 1, '13_0_0'];
429
+ macos = false;
430
+ }
431
+
432
+ // Android
433
+ if (android && !windows) {
434
+ device.os = 'android';
435
+ device.android = true;
436
+ }
437
+ if (ipad || iphone || ipod) {
438
+ device.os = 'ios';
439
+ device.ios = true;
440
+ }
441
+
442
+ // Export object
443
+ return device;
444
+ }
445
+ function getDevice(overrides = {}) {
446
+ if (!deviceCached) {
447
+ deviceCached = calcDevice(overrides);
448
+ }
449
+ return deviceCached;
450
+ }
451
+
452
+ let browser;
453
+ function calcBrowser() {
454
+ const window = getWindow();
455
+ let needPerspectiveFix = false;
456
+ function isSafari() {
457
+ const ua = window.navigator.userAgent.toLowerCase();
458
+ return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
459
+ }
460
+ if (isSafari()) {
461
+ const ua = String(window.navigator.userAgent);
462
+ if (ua.includes('Version/')) {
463
+ const [major, minor] = ua.split('Version/')[1].split(' ')[0].split('.').map(num => Number(num));
464
+ needPerspectiveFix = major < 16 || major === 16 && minor < 2;
465
+ }
466
+ }
467
+ return {
468
+ isSafari: needPerspectiveFix || isSafari(),
469
+ needPerspectiveFix,
470
+ isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
471
+ };
472
+ }
473
+ function getBrowser() {
474
+ if (!browser) {
475
+ browser = calcBrowser();
476
+ }
477
+ return browser;
478
+ }
479
+
480
+ function Resize({
481
+ swiper,
482
+ on,
483
+ emit
484
+ }) {
485
+ const window = getWindow();
486
+ let observer = null;
487
+ let animationFrame = null;
488
+ const resizeHandler = () => {
489
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
490
+ emit('beforeResize');
491
+ emit('resize');
492
+ };
493
+ const createObserver = () => {
494
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
495
+ observer = new ResizeObserver(entries => {
496
+ animationFrame = window.requestAnimationFrame(() => {
497
+ const {
498
+ width,
499
+ height
500
+ } = swiper;
501
+ let newWidth = width;
502
+ let newHeight = height;
503
+ entries.forEach(({
504
+ contentBoxSize,
505
+ contentRect,
506
+ target
507
+ }) => {
508
+ if (target && target !== swiper.el) return;
509
+ newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
510
+ newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
511
+ });
512
+ if (newWidth !== width || newHeight !== height) {
513
+ resizeHandler();
514
+ }
515
+ });
516
+ });
517
+ observer.observe(swiper.el);
518
+ };
519
+ const removeObserver = () => {
520
+ if (animationFrame) {
521
+ window.cancelAnimationFrame(animationFrame);
522
+ }
523
+ if (observer && observer.unobserve && swiper.el) {
524
+ observer.unobserve(swiper.el);
525
+ observer = null;
526
+ }
527
+ };
528
+ const orientationChangeHandler = () => {
529
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
530
+ emit('orientationchange');
531
+ };
532
+ on('init', () => {
533
+ if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {
534
+ createObserver();
535
+ return;
536
+ }
537
+ window.addEventListener('resize', resizeHandler);
538
+ window.addEventListener('orientationchange', orientationChangeHandler);
539
+ });
540
+ on('destroy', () => {
541
+ removeObserver();
542
+ window.removeEventListener('resize', resizeHandler);
543
+ window.removeEventListener('orientationchange', orientationChangeHandler);
544
+ });
545
+ }
546
+
547
+ function Observer({
548
+ swiper,
549
+ extendParams,
550
+ on,
551
+ emit
552
+ }) {
553
+ const observers = [];
554
+ const window = getWindow();
555
+ const attach = (target, options = {}) => {
556
+ const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
557
+ const observer = new ObserverFunc(mutations => {
558
+ // The observerUpdate event should only be triggered
559
+ // once despite the number of mutations. Additional
560
+ // triggers are redundant and are very costly
561
+ if (swiper.__preventObserver__) return;
562
+ if (mutations.length === 1) {
563
+ emit('observerUpdate', mutations[0]);
564
+ return;
565
+ }
566
+ const observerUpdate = function observerUpdate() {
567
+ emit('observerUpdate', mutations[0]);
568
+ };
569
+ if (window.requestAnimationFrame) {
570
+ window.requestAnimationFrame(observerUpdate);
571
+ } else {
572
+ window.setTimeout(observerUpdate, 0);
573
+ }
574
+ });
575
+ observer.observe(target, {
576
+ attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
577
+ childList: typeof options.childList === 'undefined' ? true : options.childList,
578
+ characterData: typeof options.characterData === 'undefined' ? true : options.characterData
579
+ });
580
+ observers.push(observer);
581
+ };
582
+ const init = () => {
583
+ if (!swiper.params.observer) return;
584
+ if (swiper.params.observeParents) {
585
+ const containerParents = elementParents(swiper.el);
586
+ for (let i = 0; i < containerParents.length; i += 1) {
587
+ attach(containerParents[i]);
588
+ }
589
+ }
590
+ // Observe container
591
+ attach(swiper.el, {
592
+ childList: swiper.params.observeSlideChildren
593
+ });
594
+
595
+ // Observe wrapper
596
+ attach(swiper.wrapperEl, {
597
+ attributes: false
598
+ });
599
+ };
600
+ const destroy = () => {
601
+ observers.forEach(observer => {
602
+ observer.disconnect();
603
+ });
604
+ observers.splice(0, observers.length);
605
+ };
606
+ extendParams({
607
+ observer: false,
608
+ observeParents: false,
609
+ observeSlideChildren: false
610
+ });
611
+ on('init', init);
612
+ on('destroy', destroy);
613
+ }
614
+
615
+ /* eslint-disable no-underscore-dangle */
616
+
617
+ const eventsEmitter = {
618
+ on(events, handler, priority) {
619
+ const self = this;
620
+ if (!self.eventsListeners || self.destroyed) return self;
621
+ if (typeof handler !== 'function') return self;
622
+ const method = priority ? 'unshift' : 'push';
623
+ events.split(' ').forEach(event => {
624
+ if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
625
+ self.eventsListeners[event][method](handler);
626
+ });
627
+ return self;
628
+ },
629
+ once(events, handler, priority) {
630
+ const self = this;
631
+ if (!self.eventsListeners || self.destroyed) return self;
632
+ if (typeof handler !== 'function') return self;
633
+ function onceHandler(...args) {
634
+ self.off(events, onceHandler);
635
+ if (onceHandler.__emitterProxy) {
636
+ delete onceHandler.__emitterProxy;
637
+ }
638
+ handler.apply(self, args);
639
+ }
640
+ onceHandler.__emitterProxy = handler;
641
+ return self.on(events, onceHandler, priority);
642
+ },
643
+ onAny(handler, priority) {
644
+ const self = this;
645
+ if (!self.eventsListeners || self.destroyed) return self;
646
+ if (typeof handler !== 'function') return self;
647
+ const method = priority ? 'unshift' : 'push';
648
+ if (self.eventsAnyListeners.indexOf(handler) < 0) {
649
+ self.eventsAnyListeners[method](handler);
650
+ }
651
+ return self;
652
+ },
653
+ offAny(handler) {
654
+ const self = this;
655
+ if (!self.eventsListeners || self.destroyed) return self;
656
+ if (!self.eventsAnyListeners) return self;
657
+ const index = self.eventsAnyListeners.indexOf(handler);
658
+ if (index >= 0) {
659
+ self.eventsAnyListeners.splice(index, 1);
660
+ }
661
+ return self;
662
+ },
663
+ off(events, handler) {
664
+ const self = this;
665
+ if (!self.eventsListeners || self.destroyed) return self;
666
+ if (!self.eventsListeners) return self;
667
+ events.split(' ').forEach(event => {
668
+ if (typeof handler === 'undefined') {
669
+ self.eventsListeners[event] = [];
670
+ } else if (self.eventsListeners[event]) {
671
+ self.eventsListeners[event].forEach((eventHandler, index) => {
672
+ if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
673
+ self.eventsListeners[event].splice(index, 1);
674
+ }
675
+ });
676
+ }
677
+ });
678
+ return self;
679
+ },
680
+ emit(...args) {
681
+ const self = this;
682
+ if (!self.eventsListeners || self.destroyed) return self;
683
+ if (!self.eventsListeners) return self;
684
+ let events;
685
+ let data;
686
+ let context;
687
+ if (typeof args[0] === 'string' || Array.isArray(args[0])) {
688
+ events = args[0];
689
+ data = args.slice(1, args.length);
690
+ context = self;
691
+ } else {
692
+ events = args[0].events;
693
+ data = args[0].data;
694
+ context = args[0].context || self;
695
+ }
696
+ data.unshift(context);
697
+ const eventsArray = Array.isArray(events) ? events : events.split(' ');
698
+ eventsArray.forEach(event => {
699
+ if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
700
+ self.eventsAnyListeners.forEach(eventHandler => {
701
+ eventHandler.apply(context, [event, ...data]);
702
+ });
703
+ }
704
+ if (self.eventsListeners && self.eventsListeners[event]) {
705
+ self.eventsListeners[event].forEach(eventHandler => {
706
+ eventHandler.apply(context, data);
707
+ });
708
+ }
709
+ });
710
+ return self;
711
+ }
712
+ };
713
+
714
+ function updateSize() {
715
+ const swiper = this;
716
+ let width;
717
+ let height;
718
+ const el = swiper.el;
719
+ if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
720
+ width = swiper.params.width;
721
+ } else {
722
+ width = el.clientWidth;
723
+ }
724
+ if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
725
+ height = swiper.params.height;
726
+ } else {
727
+ height = el.clientHeight;
728
+ }
729
+ if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
730
+ return;
731
+ }
732
+
733
+ // Subtract paddings
734
+ width = width - parseInt(elementStyle(el, 'padding-left') || 0, 10) - parseInt(elementStyle(el, 'padding-right') || 0, 10);
735
+ height = height - parseInt(elementStyle(el, 'padding-top') || 0, 10) - parseInt(elementStyle(el, 'padding-bottom') || 0, 10);
736
+ if (Number.isNaN(width)) width = 0;
737
+ if (Number.isNaN(height)) height = 0;
738
+ Object.assign(swiper, {
739
+ width,
740
+ height,
741
+ size: swiper.isHorizontal() ? width : height
742
+ });
743
+ }
744
+
745
+ function updateSlides() {
746
+ const swiper = this;
747
+ function getDirectionLabel(property) {
748
+ if (swiper.isHorizontal()) {
749
+ return property;
750
+ }
751
+ // prettier-ignore
752
+ return {
753
+ 'width': 'height',
754
+ 'margin-top': 'margin-left',
755
+ 'margin-bottom ': 'margin-right',
756
+ 'margin-left': 'margin-top',
757
+ 'margin-right': 'margin-bottom',
758
+ 'padding-left': 'padding-top',
759
+ 'padding-right': 'padding-bottom',
760
+ 'marginRight': 'marginBottom'
761
+ }[property];
762
+ }
763
+ function getDirectionPropertyValue(node, label) {
764
+ return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
765
+ }
766
+ const params = swiper.params;
767
+ const {
768
+ wrapperEl,
769
+ slidesEl,
770
+ size: swiperSize,
771
+ rtlTranslate: rtl,
772
+ wrongRTL
773
+ } = swiper;
774
+ const isVirtual = swiper.virtual && params.virtual.enabled;
775
+ const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
776
+ const slides = elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);
777
+ const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
778
+ let snapGrid = [];
779
+ const slidesGrid = [];
780
+ const slidesSizesGrid = [];
781
+ let offsetBefore = params.slidesOffsetBefore;
782
+ if (typeof offsetBefore === 'function') {
783
+ offsetBefore = params.slidesOffsetBefore.call(swiper);
784
+ }
785
+ let offsetAfter = params.slidesOffsetAfter;
786
+ if (typeof offsetAfter === 'function') {
787
+ offsetAfter = params.slidesOffsetAfter.call(swiper);
788
+ }
789
+ const previousSnapGridLength = swiper.snapGrid.length;
790
+ const previousSlidesGridLength = swiper.slidesGrid.length;
791
+ let spaceBetween = params.spaceBetween;
792
+ let slidePosition = -offsetBefore;
793
+ let prevSlideSize = 0;
794
+ let index = 0;
795
+ if (typeof swiperSize === 'undefined') {
796
+ return;
797
+ }
798
+ if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
799
+ spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
800
+ } else if (typeof spaceBetween === 'string') {
801
+ spaceBetween = parseFloat(spaceBetween);
802
+ }
803
+ swiper.virtualSize = -spaceBetween;
804
+
805
+ // reset margins
806
+ slides.forEach(slideEl => {
807
+ if (rtl) {
808
+ slideEl.style.marginLeft = '';
809
+ } else {
810
+ slideEl.style.marginRight = '';
811
+ }
812
+ slideEl.style.marginBottom = '';
813
+ slideEl.style.marginTop = '';
814
+ });
815
+
816
+ // reset cssMode offsets
817
+ if (params.centeredSlides && params.cssMode) {
818
+ setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
819
+ setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
820
+ }
821
+ const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
822
+ if (gridEnabled) {
823
+ swiper.grid.initSlides(slidesLength);
824
+ }
825
+
826
+ // Calc slides
827
+ let slideSize;
828
+ const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {
829
+ return typeof params.breakpoints[key].slidesPerView !== 'undefined';
830
+ }).length > 0;
831
+ for (let i = 0; i < slidesLength; i += 1) {
832
+ slideSize = 0;
833
+ let slide;
834
+ if (slides[i]) slide = slides[i];
835
+ if (gridEnabled) {
836
+ swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);
837
+ }
838
+ if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
839
+
840
+ if (params.slidesPerView === 'auto') {
841
+ if (shouldResetSlideSize) {
842
+ slides[i].style[getDirectionLabel('width')] = ``;
843
+ }
844
+ const slideStyles = getComputedStyle(slide);
845
+ const currentTransform = slide.style.transform;
846
+ const currentWebKitTransform = slide.style.webkitTransform;
847
+ if (currentTransform) {
848
+ slide.style.transform = 'none';
849
+ }
850
+ if (currentWebKitTransform) {
851
+ slide.style.webkitTransform = 'none';
852
+ }
853
+ if (params.roundLengths) {
854
+ slideSize = swiper.isHorizontal() ? elementOuterSize(slide, 'width', true) : elementOuterSize(slide, 'height', true);
855
+ } else {
856
+ // eslint-disable-next-line
857
+ const width = getDirectionPropertyValue(slideStyles, 'width');
858
+ const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');
859
+ const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');
860
+ const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');
861
+ const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');
862
+ const boxSizing = slideStyles.getPropertyValue('box-sizing');
863
+ if (boxSizing && boxSizing === 'border-box') {
864
+ slideSize = width + marginLeft + marginRight;
865
+ } else {
866
+ const {
867
+ clientWidth,
868
+ offsetWidth
869
+ } = slide;
870
+ slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
871
+ }
872
+ }
873
+ if (currentTransform) {
874
+ slide.style.transform = currentTransform;
875
+ }
876
+ if (currentWebKitTransform) {
877
+ slide.style.webkitTransform = currentWebKitTransform;
878
+ }
879
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
880
+ } else {
881
+ slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
882
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
883
+ if (slides[i]) {
884
+ slides[i].style[getDirectionLabel('width')] = `${slideSize}px`;
885
+ }
886
+ }
887
+ if (slides[i]) {
888
+ slides[i].swiperSlideSize = slideSize;
889
+ }
890
+ slidesSizesGrid.push(slideSize);
891
+ if (params.centeredSlides) {
892
+ slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
893
+ if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
894
+ if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
895
+ if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
896
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
897
+ if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
898
+ slidesGrid.push(slidePosition);
899
+ } else {
900
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
901
+ if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
902
+ slidesGrid.push(slidePosition);
903
+ slidePosition = slidePosition + slideSize + spaceBetween;
904
+ }
905
+ swiper.virtualSize += slideSize + spaceBetween;
906
+ prevSlideSize = slideSize;
907
+ index += 1;
908
+ }
909
+ swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
910
+ if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
911
+ wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;
912
+ }
913
+ if (params.setWrapperSize) {
914
+ wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
915
+ }
916
+ if (gridEnabled) {
917
+ swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
918
+ }
919
+
920
+ // Remove last grid elements depending on width
921
+ if (!params.centeredSlides) {
922
+ const newSlidesGrid = [];
923
+ for (let i = 0; i < snapGrid.length; i += 1) {
924
+ let slidesGridItem = snapGrid[i];
925
+ if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
926
+ if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
927
+ newSlidesGrid.push(slidesGridItem);
928
+ }
929
+ }
930
+ snapGrid = newSlidesGrid;
931
+ if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
932
+ snapGrid.push(swiper.virtualSize - swiperSize);
933
+ }
934
+ }
935
+ if (isVirtual && params.loop) {
936
+ const size = slidesSizesGrid[0] + spaceBetween;
937
+ if (params.slidesPerGroup > 1) {
938
+ const groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup);
939
+ const groupSize = size * params.slidesPerGroup;
940
+ for (let i = 0; i < groups; i += 1) {
941
+ snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize);
942
+ }
943
+ }
944
+ for (let i = 0; i < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; i += 1) {
945
+ if (params.slidesPerGroup === 1) {
946
+ snapGrid.push(snapGrid[snapGrid.length - 1] + size);
947
+ }
948
+ slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size);
949
+ swiper.virtualSize += size;
950
+ }
951
+ }
952
+ if (snapGrid.length === 0) snapGrid = [0];
953
+ if (spaceBetween !== 0) {
954
+ const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');
955
+ slides.filter((_, slideIndex) => {
956
+ if (!params.cssMode || params.loop) return true;
957
+ if (slideIndex === slides.length - 1) {
958
+ return false;
959
+ }
960
+ return true;
961
+ }).forEach(slideEl => {
962
+ slideEl.style[key] = `${spaceBetween}px`;
963
+ });
964
+ }
965
+ if (params.centeredSlides && params.centeredSlidesBounds) {
966
+ let allSlidesSize = 0;
967
+ slidesSizesGrid.forEach(slideSizeValue => {
968
+ allSlidesSize += slideSizeValue + (spaceBetween || 0);
969
+ });
970
+ allSlidesSize -= spaceBetween;
971
+ const maxSnap = allSlidesSize - swiperSize;
972
+ snapGrid = snapGrid.map(snap => {
973
+ if (snap < 0) return -offsetBefore;
974
+ if (snap > maxSnap) return maxSnap + offsetAfter;
975
+ return snap;
976
+ });
977
+ }
978
+ if (params.centerInsufficientSlides) {
979
+ let allSlidesSize = 0;
980
+ slidesSizesGrid.forEach(slideSizeValue => {
981
+ allSlidesSize += slideSizeValue + (spaceBetween || 0);
982
+ });
983
+ allSlidesSize -= spaceBetween;
984
+ if (allSlidesSize < swiperSize) {
985
+ const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
986
+ snapGrid.forEach((snap, snapIndex) => {
987
+ snapGrid[snapIndex] = snap - allSlidesOffset;
988
+ });
989
+ slidesGrid.forEach((snap, snapIndex) => {
990
+ slidesGrid[snapIndex] = snap + allSlidesOffset;
991
+ });
992
+ }
993
+ }
994
+ Object.assign(swiper, {
995
+ slides,
996
+ snapGrid,
997
+ slidesGrid,
998
+ slidesSizesGrid
999
+ });
1000
+ if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {
1001
+ setCSSProperty(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);
1002
+ setCSSProperty(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
1003
+ const addToSnapGrid = -swiper.snapGrid[0];
1004
+ const addToSlidesGrid = -swiper.slidesGrid[0];
1005
+ swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);
1006
+ swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid);
1007
+ }
1008
+ if (slidesLength !== previousSlidesLength) {
1009
+ swiper.emit('slidesLengthChange');
1010
+ }
1011
+ if (snapGrid.length !== previousSnapGridLength) {
1012
+ if (swiper.params.watchOverflow) swiper.checkOverflow();
1013
+ swiper.emit('snapGridLengthChange');
1014
+ }
1015
+ if (slidesGrid.length !== previousSlidesGridLength) {
1016
+ swiper.emit('slidesGridLengthChange');
1017
+ }
1018
+ if (params.watchSlidesProgress) {
1019
+ swiper.updateSlidesOffset();
1020
+ }
1021
+ if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
1022
+ const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
1023
+ const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);
1024
+ if (slidesLength <= params.maxBackfaceHiddenSlides) {
1025
+ if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass);
1026
+ } else if (hasClassBackfaceClassAdded) {
1027
+ swiper.el.classList.remove(backFaceHiddenClass);
1028
+ }
1029
+ }
1030
+ }
1031
+
1032
+ function updateAutoHeight(speed) {
1033
+ const swiper = this;
1034
+ const activeSlides = [];
1035
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1036
+ let newHeight = 0;
1037
+ let i;
1038
+ if (typeof speed === 'number') {
1039
+ swiper.setTransition(speed);
1040
+ } else if (speed === true) {
1041
+ swiper.setTransition(swiper.params.speed);
1042
+ }
1043
+ const getSlideByIndex = index => {
1044
+ if (isVirtual) {
1045
+ return swiper.slides[swiper.getSlideIndexByData(index)];
1046
+ }
1047
+ return swiper.slides[index];
1048
+ };
1049
+ // Find slides currently in view
1050
+ if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
1051
+ if (swiper.params.centeredSlides) {
1052
+ (swiper.visibleSlides || []).forEach(slide => {
1053
+ activeSlides.push(slide);
1054
+ });
1055
+ } else {
1056
+ for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
1057
+ const index = swiper.activeIndex + i;
1058
+ if (index > swiper.slides.length && !isVirtual) break;
1059
+ activeSlides.push(getSlideByIndex(index));
1060
+ }
1061
+ }
1062
+ } else {
1063
+ activeSlides.push(getSlideByIndex(swiper.activeIndex));
1064
+ }
1065
+
1066
+ // Find new height from highest slide in view
1067
+ for (i = 0; i < activeSlides.length; i += 1) {
1068
+ if (typeof activeSlides[i] !== 'undefined') {
1069
+ const height = activeSlides[i].offsetHeight;
1070
+ newHeight = height > newHeight ? height : newHeight;
1071
+ }
1072
+ }
1073
+
1074
+ // Update Height
1075
+ if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = `${newHeight}px`;
1076
+ }
1077
+
1078
+ function updateSlidesOffset() {
1079
+ const swiper = this;
1080
+ const slides = swiper.slides;
1081
+ // eslint-disable-next-line
1082
+ const minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0;
1083
+ for (let i = 0; i < slides.length; i += 1) {
1084
+ slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment();
1085
+ }
1086
+ }
1087
+
1088
+ function updateSlidesProgress(translate = this && this.translate || 0) {
1089
+ const swiper = this;
1090
+ const params = swiper.params;
1091
+ const {
1092
+ slides,
1093
+ rtlTranslate: rtl,
1094
+ snapGrid
1095
+ } = swiper;
1096
+ if (slides.length === 0) return;
1097
+ if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
1098
+ let offsetCenter = -translate;
1099
+ if (rtl) offsetCenter = translate;
1100
+
1101
+ // Visible Slides
1102
+ slides.forEach(slideEl => {
1103
+ slideEl.classList.remove(params.slideVisibleClass);
1104
+ });
1105
+ swiper.visibleSlidesIndexes = [];
1106
+ swiper.visibleSlides = [];
1107
+ let spaceBetween = params.spaceBetween;
1108
+ if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
1109
+ spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size;
1110
+ } else if (typeof spaceBetween === 'string') {
1111
+ spaceBetween = parseFloat(spaceBetween);
1112
+ }
1113
+ for (let i = 0; i < slides.length; i += 1) {
1114
+ const slide = slides[i];
1115
+ let slideOffset = slide.swiperSlideOffset;
1116
+ if (params.cssMode && params.centeredSlides) {
1117
+ slideOffset -= slides[0].swiperSlideOffset;
1118
+ }
1119
+ const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
1120
+ const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);
1121
+ const slideBefore = -(offsetCenter - slideOffset);
1122
+ const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
1123
+ const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
1124
+ if (isVisible) {
1125
+ swiper.visibleSlides.push(slide);
1126
+ swiper.visibleSlidesIndexes.push(i);
1127
+ slides[i].classList.add(params.slideVisibleClass);
1128
+ }
1129
+ slide.progress = rtl ? -slideProgress : slideProgress;
1130
+ slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
1131
+ }
1132
+ }
1133
+
1134
+ function updateProgress(translate) {
1135
+ const swiper = this;
1136
+ if (typeof translate === 'undefined') {
1137
+ const multiplier = swiper.rtlTranslate ? -1 : 1;
1138
+ // eslint-disable-next-line
1139
+ translate = swiper && swiper.translate && swiper.translate * multiplier || 0;
1140
+ }
1141
+ const params = swiper.params;
1142
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1143
+ let {
1144
+ progress,
1145
+ isBeginning,
1146
+ isEnd,
1147
+ progressLoop
1148
+ } = swiper;
1149
+ const wasBeginning = isBeginning;
1150
+ const wasEnd = isEnd;
1151
+ if (translatesDiff === 0) {
1152
+ progress = 0;
1153
+ isBeginning = true;
1154
+ isEnd = true;
1155
+ } else {
1156
+ progress = (translate - swiper.minTranslate()) / translatesDiff;
1157
+ const isBeginningRounded = Math.abs(translate - swiper.minTranslate()) < 1;
1158
+ const isEndRounded = Math.abs(translate - swiper.maxTranslate()) < 1;
1159
+ isBeginning = isBeginningRounded || progress <= 0;
1160
+ isEnd = isEndRounded || progress >= 1;
1161
+ if (isBeginningRounded) progress = 0;
1162
+ if (isEndRounded) progress = 1;
1163
+ }
1164
+ if (params.loop) {
1165
+ const firstSlideIndex = swiper.getSlideIndexByData(0);
1166
+ const lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1);
1167
+ const firstSlideTranslate = swiper.slidesGrid[firstSlideIndex];
1168
+ const lastSlideTranslate = swiper.slidesGrid[lastSlideIndex];
1169
+ const translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1];
1170
+ const translateAbs = Math.abs(translate);
1171
+ if (translateAbs >= firstSlideTranslate) {
1172
+ progressLoop = (translateAbs - firstSlideTranslate) / translateMax;
1173
+ } else {
1174
+ progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax;
1175
+ }
1176
+ if (progressLoop > 1) progressLoop -= 1;
1177
+ }
1178
+ Object.assign(swiper, {
1179
+ progress,
1180
+ progressLoop,
1181
+ isBeginning,
1182
+ isEnd
1183
+ });
1184
+ if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);
1185
+ if (isBeginning && !wasBeginning) {
1186
+ swiper.emit('reachBeginning toEdge');
1187
+ }
1188
+ if (isEnd && !wasEnd) {
1189
+ swiper.emit('reachEnd toEdge');
1190
+ }
1191
+ if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
1192
+ swiper.emit('fromEdge');
1193
+ }
1194
+ swiper.emit('progress', progress);
1195
+ }
1196
+
1197
+ function updateSlidesClasses() {
1198
+ const swiper = this;
1199
+ const {
1200
+ slides,
1201
+ params,
1202
+ slidesEl,
1203
+ activeIndex
1204
+ } = swiper;
1205
+ const isVirtual = swiper.virtual && params.virtual.enabled;
1206
+ const getFilteredSlide = selector => {
1207
+ return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
1208
+ };
1209
+ slides.forEach(slideEl => {
1210
+ slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
1211
+ });
1212
+ let activeSlide;
1213
+ if (isVirtual) {
1214
+ if (params.loop) {
1215
+ let slideIndex = activeIndex - swiper.virtual.slidesBefore;
1216
+ if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex;
1217
+ if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length;
1218
+ activeSlide = getFilteredSlide(`[data-swiper-slide-index="${slideIndex}"]`);
1219
+ } else {
1220
+ activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`);
1221
+ }
1222
+ } else {
1223
+ activeSlide = slides[activeIndex];
1224
+ }
1225
+ if (activeSlide) {
1226
+ // Active classes
1227
+ activeSlide.classList.add(params.slideActiveClass);
1228
+
1229
+ // Next Slide
1230
+ let nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1231
+ if (params.loop && !nextSlide) {
1232
+ nextSlide = slides[0];
1233
+ }
1234
+ if (nextSlide) {
1235
+ nextSlide.classList.add(params.slideNextClass);
1236
+ }
1237
+ // Prev Slide
1238
+ let prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1239
+ if (params.loop && !prevSlide === 0) {
1240
+ prevSlide = slides[slides.length - 1];
1241
+ }
1242
+ if (prevSlide) {
1243
+ prevSlide.classList.add(params.slidePrevClass);
1244
+ }
1245
+ }
1246
+ swiper.emitSlidesClasses();
1247
+ }
1248
+
1249
+ const processLazyPreloader = (swiper, imageEl) => {
1250
+ if (!swiper || swiper.destroyed || !swiper.params) return;
1251
+ const slideSelector = () => swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;
1252
+ const slideEl = imageEl.closest(slideSelector());
1253
+ if (slideEl) {
1254
+ const lazyEl = slideEl.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1255
+ if (lazyEl) lazyEl.remove();
1256
+ }
1257
+ };
1258
+ const unlazy = (swiper, index) => {
1259
+ if (!swiper.slides[index]) return;
1260
+ const imageEl = swiper.slides[index].querySelector('[loading="lazy"]');
1261
+ if (imageEl) imageEl.removeAttribute('loading');
1262
+ };
1263
+ const preload = swiper => {
1264
+ if (!swiper || swiper.destroyed || !swiper.params) return;
1265
+ let amount = swiper.params.lazyPreloadPrevNext;
1266
+ const len = swiper.slides.length;
1267
+ if (!len || !amount || amount < 0) return;
1268
+ amount = Math.min(amount, len);
1269
+ const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView);
1270
+ const activeIndex = swiper.activeIndex;
1271
+ const slideIndexLastInView = activeIndex + slidesPerView - 1;
1272
+ if (swiper.params.rewind) {
1273
+ for (let i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) {
1274
+ const realIndex = (i % len + len) % len;
1275
+ if (realIndex !== activeIndex && realIndex > slideIndexLastInView) unlazy(swiper, realIndex);
1276
+ }
1277
+ } else {
1278
+ for (let i = Math.max(slideIndexLastInView - amount, 0); i <= Math.min(slideIndexLastInView + amount, len - 1); i += 1) {
1279
+ if (i !== activeIndex && i > slideIndexLastInView) unlazy(swiper, i);
1280
+ }
1281
+ }
1282
+ };
1283
+
1284
+ function getActiveIndexByTranslate(swiper) {
1285
+ const {
1286
+ slidesGrid,
1287
+ params
1288
+ } = swiper;
1289
+ const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1290
+ let activeIndex;
1291
+ for (let i = 0; i < slidesGrid.length; i += 1) {
1292
+ if (typeof slidesGrid[i + 1] !== 'undefined') {
1293
+ if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
1294
+ activeIndex = i;
1295
+ } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
1296
+ activeIndex = i + 1;
1297
+ }
1298
+ } else if (translate >= slidesGrid[i]) {
1299
+ activeIndex = i;
1300
+ }
1301
+ }
1302
+ // Normalize slideIndex
1303
+ if (params.normalizeSlideIndex) {
1304
+ if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;
1305
+ }
1306
+ return activeIndex;
1307
+ }
1308
+ function updateActiveIndex(newActiveIndex) {
1309
+ const swiper = this;
1310
+ const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1311
+ const {
1312
+ snapGrid,
1313
+ params,
1314
+ activeIndex: previousIndex,
1315
+ realIndex: previousRealIndex,
1316
+ snapIndex: previousSnapIndex
1317
+ } = swiper;
1318
+ let activeIndex = newActiveIndex;
1319
+ let snapIndex;
1320
+ const getVirtualRealIndex = aIndex => {
1321
+ let realIndex = aIndex - swiper.virtual.slidesBefore;
1322
+ if (realIndex < 0) {
1323
+ realIndex = swiper.virtual.slides.length + realIndex;
1324
+ }
1325
+ if (realIndex >= swiper.virtual.slides.length) {
1326
+ realIndex -= swiper.virtual.slides.length;
1327
+ }
1328
+ return realIndex;
1329
+ };
1330
+ if (typeof activeIndex === 'undefined') {
1331
+ activeIndex = getActiveIndexByTranslate(swiper);
1332
+ }
1333
+ if (snapGrid.indexOf(translate) >= 0) {
1334
+ snapIndex = snapGrid.indexOf(translate);
1335
+ } else {
1336
+ const skip = Math.min(params.slidesPerGroupSkip, activeIndex);
1337
+ snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
1338
+ }
1339
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1340
+ if (activeIndex === previousIndex) {
1341
+ if (snapIndex !== previousSnapIndex) {
1342
+ swiper.snapIndex = snapIndex;
1343
+ swiper.emit('snapIndexChange');
1344
+ }
1345
+ if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
1346
+ swiper.realIndex = getVirtualRealIndex(activeIndex);
1347
+ }
1348
+ return;
1349
+ }
1350
+ // Get real index
1351
+ let realIndex;
1352
+ if (swiper.virtual && params.virtual.enabled && params.loop) {
1353
+ realIndex = getVirtualRealIndex(activeIndex);
1354
+ } else if (swiper.slides[activeIndex]) {
1355
+ realIndex = parseInt(swiper.slides[activeIndex].getAttribute('data-swiper-slide-index') || activeIndex, 10);
1356
+ } else {
1357
+ realIndex = activeIndex;
1358
+ }
1359
+ Object.assign(swiper, {
1360
+ previousSnapIndex,
1361
+ snapIndex,
1362
+ previousRealIndex,
1363
+ realIndex,
1364
+ previousIndex,
1365
+ activeIndex
1366
+ });
1367
+ if (swiper.initialized) {
1368
+ preload(swiper);
1369
+ }
1370
+ swiper.emit('activeIndexChange');
1371
+ swiper.emit('snapIndexChange');
1372
+ if (previousRealIndex !== realIndex) {
1373
+ swiper.emit('realIndexChange');
1374
+ }
1375
+ if (swiper.initialized || swiper.params.runCallbacksOnInit) {
1376
+ swiper.emit('slideChange');
1377
+ }
1378
+ }
1379
+
1380
+ function updateClickedSlide(e) {
1381
+ const swiper = this;
1382
+ const params = swiper.params;
1383
+ const slide = e.closest(`.${params.slideClass}, swiper-slide`);
1384
+ let slideFound = false;
1385
+ let slideIndex;
1386
+ if (slide) {
1387
+ for (let i = 0; i < swiper.slides.length; i += 1) {
1388
+ if (swiper.slides[i] === slide) {
1389
+ slideFound = true;
1390
+ slideIndex = i;
1391
+ break;
1392
+ }
1393
+ }
1394
+ }
1395
+ if (slide && slideFound) {
1396
+ swiper.clickedSlide = slide;
1397
+ if (swiper.virtual && swiper.params.virtual.enabled) {
1398
+ swiper.clickedIndex = parseInt(slide.getAttribute('data-swiper-slide-index'), 10);
1399
+ } else {
1400
+ swiper.clickedIndex = slideIndex;
1401
+ }
1402
+ } else {
1403
+ swiper.clickedSlide = undefined;
1404
+ swiper.clickedIndex = undefined;
1405
+ return;
1406
+ }
1407
+ if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
1408
+ swiper.slideToClickedSlide();
1409
+ }
1410
+ }
1411
+
1412
+ const update = {
1413
+ updateSize,
1414
+ updateSlides,
1415
+ updateAutoHeight,
1416
+ updateSlidesOffset,
1417
+ updateSlidesProgress,
1418
+ updateProgress,
1419
+ updateSlidesClasses,
1420
+ updateActiveIndex,
1421
+ updateClickedSlide
1422
+ };
1423
+
1424
+ function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') {
1425
+ const swiper = this;
1426
+ const {
1427
+ params,
1428
+ rtlTranslate: rtl,
1429
+ translate,
1430
+ wrapperEl
1431
+ } = swiper;
1432
+ if (params.virtualTranslate) {
1433
+ return rtl ? -translate : translate;
1434
+ }
1435
+ if (params.cssMode) {
1436
+ return translate;
1437
+ }
1438
+ let currentTranslate = getTranslate(wrapperEl, axis);
1439
+ currentTranslate += swiper.cssOverflowAdjustment();
1440
+ if (rtl) currentTranslate = -currentTranslate;
1441
+ return currentTranslate || 0;
1442
+ }
1443
+
1444
+ function setTranslate(translate, byController) {
1445
+ const swiper = this;
1446
+ const {
1447
+ rtlTranslate: rtl,
1448
+ params,
1449
+ wrapperEl,
1450
+ progress
1451
+ } = swiper;
1452
+ let x = 0;
1453
+ let y = 0;
1454
+ const z = 0;
1455
+ if (swiper.isHorizontal()) {
1456
+ x = rtl ? -translate : translate;
1457
+ } else {
1458
+ y = translate;
1459
+ }
1460
+ if (params.roundLengths) {
1461
+ x = Math.floor(x);
1462
+ y = Math.floor(y);
1463
+ }
1464
+ swiper.previousTranslate = swiper.translate;
1465
+ swiper.translate = swiper.isHorizontal() ? x : y;
1466
+ if (params.cssMode) {
1467
+ wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
1468
+ } else if (!params.virtualTranslate) {
1469
+ if (swiper.isHorizontal()) {
1470
+ x -= swiper.cssOverflowAdjustment();
1471
+ } else {
1472
+ y -= swiper.cssOverflowAdjustment();
1473
+ }
1474
+ wrapperEl.style.transform = `translate3d(${x}px, ${y}px, ${z}px)`;
1475
+ }
1476
+
1477
+ // Check if we need to update progress
1478
+ let newProgress;
1479
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1480
+ if (translatesDiff === 0) {
1481
+ newProgress = 0;
1482
+ } else {
1483
+ newProgress = (translate - swiper.minTranslate()) / translatesDiff;
1484
+ }
1485
+ if (newProgress !== progress) {
1486
+ swiper.updateProgress(translate);
1487
+ }
1488
+ swiper.emit('setTranslate', swiper.translate, byController);
1489
+ }
1490
+
1491
+ function minTranslate() {
1492
+ return -this.snapGrid[0];
1493
+ }
1494
+
1495
+ function maxTranslate() {
1496
+ return -this.snapGrid[this.snapGrid.length - 1];
1497
+ }
1498
+
1499
+ function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
1500
+ const swiper = this;
1501
+ const {
1502
+ params,
1503
+ wrapperEl
1504
+ } = swiper;
1505
+ if (swiper.animating && params.preventInteractionOnTransition) {
1506
+ return false;
1507
+ }
1508
+ const minTranslate = swiper.minTranslate();
1509
+ const maxTranslate = swiper.maxTranslate();
1510
+ let newTranslate;
1511
+ if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate;
1512
+
1513
+ // Update progress
1514
+ swiper.updateProgress(newTranslate);
1515
+ if (params.cssMode) {
1516
+ const isH = swiper.isHorizontal();
1517
+ if (speed === 0) {
1518
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
1519
+ } else {
1520
+ if (!swiper.support.smoothScroll) {
1521
+ animateCSSModeScroll({
1522
+ swiper,
1523
+ targetPosition: -newTranslate,
1524
+ side: isH ? 'left' : 'top'
1525
+ });
1526
+ return true;
1527
+ }
1528
+ wrapperEl.scrollTo({
1529
+ [isH ? 'left' : 'top']: -newTranslate,
1530
+ behavior: 'smooth'
1531
+ });
1532
+ }
1533
+ return true;
1534
+ }
1535
+ if (speed === 0) {
1536
+ swiper.setTransition(0);
1537
+ swiper.setTranslate(newTranslate);
1538
+ if (runCallbacks) {
1539
+ swiper.emit('beforeTransitionStart', speed, internal);
1540
+ swiper.emit('transitionEnd');
1541
+ }
1542
+ } else {
1543
+ swiper.setTransition(speed);
1544
+ swiper.setTranslate(newTranslate);
1545
+ if (runCallbacks) {
1546
+ swiper.emit('beforeTransitionStart', speed, internal);
1547
+ swiper.emit('transitionStart');
1548
+ }
1549
+ if (!swiper.animating) {
1550
+ swiper.animating = true;
1551
+ if (!swiper.onTranslateToWrapperTransitionEnd) {
1552
+ swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
1553
+ if (!swiper || swiper.destroyed) return;
1554
+ if (e.target !== this) return;
1555
+ swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
1556
+ swiper.onTranslateToWrapperTransitionEnd = null;
1557
+ delete swiper.onTranslateToWrapperTransitionEnd;
1558
+ if (runCallbacks) {
1559
+ swiper.emit('transitionEnd');
1560
+ }
1561
+ };
1562
+ }
1563
+ swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
1564
+ }
1565
+ }
1566
+ return true;
1567
+ }
1568
+
1569
+ const translate = {
1570
+ getTranslate: getSwiperTranslate,
1571
+ setTranslate,
1572
+ minTranslate,
1573
+ maxTranslate,
1574
+ translateTo
1575
+ };
1576
+
1577
+ function setTransition(duration, byController) {
1578
+ const swiper = this;
1579
+ if (!swiper.params.cssMode) {
1580
+ swiper.wrapperEl.style.transitionDuration = `${duration}ms`;
1581
+ }
1582
+ swiper.emit('setTransition', duration, byController);
1583
+ }
1584
+
1585
+ function transitionEmit({
1586
+ swiper,
1587
+ runCallbacks,
1588
+ direction,
1589
+ step
1590
+ }) {
1591
+ const {
1592
+ activeIndex,
1593
+ previousIndex
1594
+ } = swiper;
1595
+ let dir = direction;
1596
+ if (!dir) {
1597
+ if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
1598
+ }
1599
+ swiper.emit(`transition${step}`);
1600
+ if (runCallbacks && activeIndex !== previousIndex) {
1601
+ if (dir === 'reset') {
1602
+ swiper.emit(`slideResetTransition${step}`);
1603
+ return;
1604
+ }
1605
+ swiper.emit(`slideChangeTransition${step}`);
1606
+ if (dir === 'next') {
1607
+ swiper.emit(`slideNextTransition${step}`);
1608
+ } else {
1609
+ swiper.emit(`slidePrevTransition${step}`);
1610
+ }
1611
+ }
1612
+ }
1613
+
1614
+ function transitionStart(runCallbacks = true, direction) {
1615
+ const swiper = this;
1616
+ const {
1617
+ params
1618
+ } = swiper;
1619
+ if (params.cssMode) return;
1620
+ if (params.autoHeight) {
1621
+ swiper.updateAutoHeight();
1622
+ }
1623
+ transitionEmit({
1624
+ swiper,
1625
+ runCallbacks,
1626
+ direction,
1627
+ step: 'Start'
1628
+ });
1629
+ }
1630
+
1631
+ function transitionEnd(runCallbacks = true, direction) {
1632
+ const swiper = this;
1633
+ const {
1634
+ params
1635
+ } = swiper;
1636
+ swiper.animating = false;
1637
+ if (params.cssMode) return;
1638
+ swiper.setTransition(0);
1639
+ transitionEmit({
1640
+ swiper,
1641
+ runCallbacks,
1642
+ direction,
1643
+ step: 'End'
1644
+ });
1645
+ }
1646
+
1647
+ const transition = {
1648
+ setTransition,
1649
+ transitionStart,
1650
+ transitionEnd
1651
+ };
1652
+
1653
+ function slideTo(index = 0, speed = this.params.speed, runCallbacks = true, internal, initial) {
1654
+ if (typeof index === 'string') {
1655
+ index = parseInt(index, 10);
1656
+ }
1657
+ const swiper = this;
1658
+ let slideIndex = index;
1659
+ if (slideIndex < 0) slideIndex = 0;
1660
+ const {
1661
+ params,
1662
+ snapGrid,
1663
+ slidesGrid,
1664
+ previousIndex,
1665
+ activeIndex,
1666
+ rtlTranslate: rtl,
1667
+ wrapperEl,
1668
+ enabled
1669
+ } = swiper;
1670
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
1671
+ return false;
1672
+ }
1673
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
1674
+ let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
1675
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1676
+ const translate = -snapGrid[snapIndex];
1677
+ // Normalize slideIndex
1678
+ if (params.normalizeSlideIndex) {
1679
+ for (let i = 0; i < slidesGrid.length; i += 1) {
1680
+ const normalizedTranslate = -Math.floor(translate * 100);
1681
+ const normalizedGrid = Math.floor(slidesGrid[i] * 100);
1682
+ const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
1683
+ if (typeof slidesGrid[i + 1] !== 'undefined') {
1684
+ if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
1685
+ slideIndex = i;
1686
+ } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {
1687
+ slideIndex = i + 1;
1688
+ }
1689
+ } else if (normalizedTranslate >= normalizedGrid) {
1690
+ slideIndex = i;
1691
+ }
1692
+ }
1693
+ }
1694
+ // Directions locks
1695
+ if (swiper.initialized && slideIndex !== activeIndex) {
1696
+ if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
1697
+ return false;
1698
+ }
1699
+ if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
1700
+ if ((activeIndex || 0) !== slideIndex) {
1701
+ return false;
1702
+ }
1703
+ }
1704
+ }
1705
+ if (slideIndex !== (previousIndex || 0) && runCallbacks) {
1706
+ swiper.emit('beforeSlideChangeStart');
1707
+ }
1708
+
1709
+ // Update progress
1710
+ swiper.updateProgress(translate);
1711
+ let direction;
1712
+ if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
1713
+
1714
+ // Update Index
1715
+ if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
1716
+ swiper.updateActiveIndex(slideIndex);
1717
+ // Update Height
1718
+ if (params.autoHeight) {
1719
+ swiper.updateAutoHeight();
1720
+ }
1721
+ swiper.updateSlidesClasses();
1722
+ if (params.effect !== 'slide') {
1723
+ swiper.setTranslate(translate);
1724
+ }
1725
+ if (direction !== 'reset') {
1726
+ swiper.transitionStart(runCallbacks, direction);
1727
+ swiper.transitionEnd(runCallbacks, direction);
1728
+ }
1729
+ return false;
1730
+ }
1731
+ if (params.cssMode) {
1732
+ const isH = swiper.isHorizontal();
1733
+ const t = rtl ? translate : -translate;
1734
+ if (speed === 0) {
1735
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1736
+ if (isVirtual) {
1737
+ swiper.wrapperEl.style.scrollSnapType = 'none';
1738
+ swiper._immediateVirtual = true;
1739
+ }
1740
+ if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) {
1741
+ swiper._cssModeVirtualInitialSet = true;
1742
+ requestAnimationFrame(() => {
1743
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
1744
+ });
1745
+ } else {
1746
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
1747
+ }
1748
+ if (isVirtual) {
1749
+ requestAnimationFrame(() => {
1750
+ swiper.wrapperEl.style.scrollSnapType = '';
1751
+ swiper._immediateVirtual = false;
1752
+ });
1753
+ }
1754
+ } else {
1755
+ if (!swiper.support.smoothScroll) {
1756
+ animateCSSModeScroll({
1757
+ swiper,
1758
+ targetPosition: t,
1759
+ side: isH ? 'left' : 'top'
1760
+ });
1761
+ return true;
1762
+ }
1763
+ wrapperEl.scrollTo({
1764
+ [isH ? 'left' : 'top']: t,
1765
+ behavior: 'smooth'
1766
+ });
1767
+ }
1768
+ return true;
1769
+ }
1770
+ swiper.setTransition(speed);
1771
+ swiper.setTranslate(translate);
1772
+ swiper.updateActiveIndex(slideIndex);
1773
+ swiper.updateSlidesClasses();
1774
+ swiper.emit('beforeTransitionStart', speed, internal);
1775
+ swiper.transitionStart(runCallbacks, direction);
1776
+ if (speed === 0) {
1777
+ swiper.transitionEnd(runCallbacks, direction);
1778
+ } else if (!swiper.animating) {
1779
+ swiper.animating = true;
1780
+ if (!swiper.onSlideToWrapperTransitionEnd) {
1781
+ swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
1782
+ if (!swiper || swiper.destroyed) return;
1783
+ if (e.target !== this) return;
1784
+ swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
1785
+ swiper.onSlideToWrapperTransitionEnd = null;
1786
+ delete swiper.onSlideToWrapperTransitionEnd;
1787
+ swiper.transitionEnd(runCallbacks, direction);
1788
+ };
1789
+ }
1790
+ swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
1791
+ }
1792
+ return true;
1793
+ }
1794
+
1795
+ function slideToLoop(index = 0, speed = this.params.speed, runCallbacks = true, internal) {
1796
+ if (typeof index === 'string') {
1797
+ const indexAsNumber = parseInt(index, 10);
1798
+ index = indexAsNumber;
1799
+ }
1800
+ const swiper = this;
1801
+ let newIndex = index;
1802
+ if (swiper.params.loop) {
1803
+ if (swiper.virtual && swiper.params.virtual.enabled) {
1804
+ // eslint-disable-next-line
1805
+ newIndex = newIndex + swiper.virtual.slidesBefore;
1806
+ } else {
1807
+ newIndex = swiper.getSlideIndexByData(newIndex);
1808
+ }
1809
+ }
1810
+ return swiper.slideTo(newIndex, speed, runCallbacks, internal);
1811
+ }
1812
+
1813
+ /* eslint no-unused-vars: "off" */
1814
+ function slideNext(speed = this.params.speed, runCallbacks = true, internal) {
1815
+ const swiper = this;
1816
+ const {
1817
+ enabled,
1818
+ params,
1819
+ animating
1820
+ } = swiper;
1821
+ if (!enabled) return swiper;
1822
+ let perGroup = params.slidesPerGroup;
1823
+ if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
1824
+ perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
1825
+ }
1826
+ const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;
1827
+ const isVirtual = swiper.virtual && params.virtual.enabled;
1828
+ if (params.loop) {
1829
+ if (animating && !isVirtual && params.loopPreventsSliding) return false;
1830
+ swiper.loopFix({
1831
+ direction: 'next'
1832
+ });
1833
+ // eslint-disable-next-line
1834
+ swiper._clientLeft = swiper.wrapperEl.clientLeft;
1835
+ }
1836
+ if (params.rewind && swiper.isEnd) {
1837
+ return swiper.slideTo(0, speed, runCallbacks, internal);
1838
+ }
1839
+ return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
1840
+ }
1841
+
1842
+ /* eslint no-unused-vars: "off" */
1843
+ function slidePrev(speed = this.params.speed, runCallbacks = true, internal) {
1844
+ const swiper = this;
1845
+ const {
1846
+ params,
1847
+ snapGrid,
1848
+ slidesGrid,
1849
+ rtlTranslate,
1850
+ enabled,
1851
+ animating
1852
+ } = swiper;
1853
+ if (!enabled) return swiper;
1854
+ const isVirtual = swiper.virtual && params.virtual.enabled;
1855
+ if (params.loop) {
1856
+ if (animating && !isVirtual && params.loopPreventsSliding) return false;
1857
+ swiper.loopFix({
1858
+ direction: 'prev'
1859
+ });
1860
+ // eslint-disable-next-line
1861
+ swiper._clientLeft = swiper.wrapperEl.clientLeft;
1862
+ }
1863
+ const translate = rtlTranslate ? swiper.translate : -swiper.translate;
1864
+ function normalize(val) {
1865
+ if (val < 0) return -Math.floor(Math.abs(val));
1866
+ return Math.floor(val);
1867
+ }
1868
+ const normalizedTranslate = normalize(translate);
1869
+ const normalizedSnapGrid = snapGrid.map(val => normalize(val));
1870
+ let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
1871
+ if (typeof prevSnap === 'undefined' && params.cssMode) {
1872
+ let prevSnapIndex;
1873
+ snapGrid.forEach((snap, snapIndex) => {
1874
+ if (normalizedTranslate >= snap) {
1875
+ // prevSnap = snap;
1876
+ prevSnapIndex = snapIndex;
1877
+ }
1878
+ });
1879
+ if (typeof prevSnapIndex !== 'undefined') {
1880
+ prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
1881
+ }
1882
+ }
1883
+ let prevIndex = 0;
1884
+ if (typeof prevSnap !== 'undefined') {
1885
+ prevIndex = slidesGrid.indexOf(prevSnap);
1886
+ if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
1887
+ if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
1888
+ prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;
1889
+ prevIndex = Math.max(prevIndex, 0);
1890
+ }
1891
+ }
1892
+ if (params.rewind && swiper.isBeginning) {
1893
+ const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
1894
+ return swiper.slideTo(lastIndex, speed, runCallbacks, internal);
1895
+ }
1896
+ return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
1897
+ }
1898
+
1899
+ /* eslint no-unused-vars: "off" */
1900
+ function slideReset(speed = this.params.speed, runCallbacks = true, internal) {
1901
+ const swiper = this;
1902
+ return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
1903
+ }
1904
+
1905
+ /* eslint no-unused-vars: "off" */
1906
+ function slideToClosest(speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) {
1907
+ const swiper = this;
1908
+ let index = swiper.activeIndex;
1909
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
1910
+ const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
1911
+ const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1912
+ if (translate >= swiper.snapGrid[snapIndex]) {
1913
+ // The current translate is on or after the current snap index, so the choice
1914
+ // is between the current index and the one after it.
1915
+ const currentSnap = swiper.snapGrid[snapIndex];
1916
+ const nextSnap = swiper.snapGrid[snapIndex + 1];
1917
+ if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {
1918
+ index += swiper.params.slidesPerGroup;
1919
+ }
1920
+ } else {
1921
+ // The current translate is before the current snap index, so the choice
1922
+ // is between the current index and the one before it.
1923
+ const prevSnap = swiper.snapGrid[snapIndex - 1];
1924
+ const currentSnap = swiper.snapGrid[snapIndex];
1925
+ if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {
1926
+ index -= swiper.params.slidesPerGroup;
1927
+ }
1928
+ }
1929
+ index = Math.max(index, 0);
1930
+ index = Math.min(index, swiper.slidesGrid.length - 1);
1931
+ return swiper.slideTo(index, speed, runCallbacks, internal);
1932
+ }
1933
+
1934
+ function slideToClickedSlide() {
1935
+ const swiper = this;
1936
+ const {
1937
+ params,
1938
+ slidesEl
1939
+ } = swiper;
1940
+ const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
1941
+ let slideToIndex = swiper.clickedIndex;
1942
+ let realIndex;
1943
+ const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
1944
+ if (params.loop) {
1945
+ if (swiper.animating) return;
1946
+ realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
1947
+ if (params.centeredSlides) {
1948
+ if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
1949
+ swiper.loopFix();
1950
+ slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
1951
+ nextTick(() => {
1952
+ swiper.slideTo(slideToIndex);
1953
+ });
1954
+ } else {
1955
+ swiper.slideTo(slideToIndex);
1956
+ }
1957
+ } else if (slideToIndex > swiper.slides.length - slidesPerView) {
1958
+ swiper.loopFix();
1959
+ slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
1960
+ nextTick(() => {
1961
+ swiper.slideTo(slideToIndex);
1962
+ });
1963
+ } else {
1964
+ swiper.slideTo(slideToIndex);
1965
+ }
1966
+ } else {
1967
+ swiper.slideTo(slideToIndex);
1968
+ }
1969
+ }
1970
+
1971
+ const slide = {
1972
+ slideTo,
1973
+ slideToLoop,
1974
+ slideNext,
1975
+ slidePrev,
1976
+ slideReset,
1977
+ slideToClosest,
1978
+ slideToClickedSlide
1979
+ };
1980
+
1981
+ function loopCreate(slideRealIndex) {
1982
+ const swiper = this;
1983
+ const {
1984
+ params,
1985
+ slidesEl
1986
+ } = swiper;
1987
+ if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
1988
+ const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
1989
+ slides.forEach((el, index) => {
1990
+ el.setAttribute('data-swiper-slide-index', index);
1991
+ });
1992
+ swiper.loopFix({
1993
+ slideRealIndex,
1994
+ direction: params.centeredSlides ? undefined : 'next'
1995
+ });
1996
+ }
1997
+
1998
+ function loopFix({
1999
+ slideRealIndex,
2000
+ slideTo = true,
2001
+ direction,
2002
+ setTranslate,
2003
+ activeSlideIndex,
2004
+ byController,
2005
+ byMousewheel
2006
+ } = {}) {
2007
+ const swiper = this;
2008
+ if (!swiper.params.loop) return;
2009
+ swiper.emit('beforeLoopFix');
2010
+ const {
2011
+ slides,
2012
+ allowSlidePrev,
2013
+ allowSlideNext,
2014
+ slidesEl,
2015
+ params
2016
+ } = swiper;
2017
+ swiper.allowSlidePrev = true;
2018
+ swiper.allowSlideNext = true;
2019
+ if (swiper.virtual && params.virtual.enabled) {
2020
+ if (slideTo) {
2021
+ if (!params.centeredSlides && swiper.snapIndex === 0) {
2022
+ swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
2023
+ } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {
2024
+ swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
2025
+ } else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
2026
+ swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
2027
+ }
2028
+ }
2029
+ swiper.allowSlidePrev = allowSlidePrev;
2030
+ swiper.allowSlideNext = allowSlideNext;
2031
+ swiper.emit('loopFix');
2032
+ return;
2033
+ }
2034
+ const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10));
2035
+ let loopedSlides = params.loopedSlides || slidesPerView;
2036
+ if (loopedSlides % params.slidesPerGroup !== 0) {
2037
+ loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup;
2038
+ }
2039
+ swiper.loopedSlides = loopedSlides;
2040
+ const prependSlidesIndexes = [];
2041
+ const appendSlidesIndexes = [];
2042
+ let activeIndex = swiper.activeIndex;
2043
+ if (typeof activeSlideIndex === 'undefined') {
2044
+ activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);
2045
+ } else {
2046
+ activeIndex = activeSlideIndex;
2047
+ }
2048
+ const isNext = direction === 'next' || !direction;
2049
+ const isPrev = direction === 'prev' || !direction;
2050
+ let slidesPrepended = 0;
2051
+ let slidesAppended = 0;
2052
+ // prepend last slides before start
2053
+ if (activeSlideIndex < loopedSlides) {
2054
+ slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup);
2055
+ for (let i = 0; i < loopedSlides - activeSlideIndex; i += 1) {
2056
+ const index = i - Math.floor(i / slides.length) * slides.length;
2057
+ prependSlidesIndexes.push(slides.length - index - 1);
2058
+ }
2059
+ } else if (activeSlideIndex /* + slidesPerView */ > swiper.slides.length - loopedSlides * 2) {
2060
+ slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup);
2061
+ for (let i = 0; i < slidesAppended; i += 1) {
2062
+ const index = i - Math.floor(i / slides.length) * slides.length;
2063
+ appendSlidesIndexes.push(index);
2064
+ }
2065
+ }
2066
+ if (isPrev) {
2067
+ prependSlidesIndexes.forEach(index => {
2068
+ swiper.slides[index].swiperLoopMoveDOM = true;
2069
+ slidesEl.prepend(swiper.slides[index]);
2070
+ swiper.slides[index].swiperLoopMoveDOM = false;
2071
+ });
2072
+ }
2073
+ if (isNext) {
2074
+ appendSlidesIndexes.forEach(index => {
2075
+ swiper.slides[index].swiperLoopMoveDOM = true;
2076
+ slidesEl.append(swiper.slides[index]);
2077
+ swiper.slides[index].swiperLoopMoveDOM = false;
2078
+ });
2079
+ }
2080
+ swiper.recalcSlides();
2081
+ if (params.slidesPerView === 'auto') {
2082
+ swiper.updateSlides();
2083
+ }
2084
+ if (params.watchSlidesProgress) {
2085
+ swiper.updateSlidesOffset();
2086
+ }
2087
+ if (slideTo) {
2088
+ if (prependSlidesIndexes.length > 0 && isPrev) {
2089
+ if (typeof slideRealIndex === 'undefined') {
2090
+ const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2091
+ const newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended];
2092
+ const diff = newSlideTranslate - currentSlideTranslate;
2093
+ if (byMousewheel) {
2094
+ swiper.setTranslate(swiper.translate - diff);
2095
+ } else {
2096
+ swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
2097
+ if (setTranslate) {
2098
+ swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
2099
+ }
2100
+ }
2101
+ } else {
2102
+ if (setTranslate) {
2103
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
2104
+ }
2105
+ }
2106
+ } else if (appendSlidesIndexes.length > 0 && isNext) {
2107
+ if (typeof slideRealIndex === 'undefined') {
2108
+ const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2109
+ const newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended];
2110
+ const diff = newSlideTranslate - currentSlideTranslate;
2111
+ if (byMousewheel) {
2112
+ swiper.setTranslate(swiper.translate - diff);
2113
+ } else {
2114
+ swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
2115
+ if (setTranslate) {
2116
+ swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
2117
+ }
2118
+ }
2119
+ } else {
2120
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
2121
+ }
2122
+ }
2123
+ }
2124
+ swiper.allowSlidePrev = allowSlidePrev;
2125
+ swiper.allowSlideNext = allowSlideNext;
2126
+ if (swiper.controller && swiper.controller.control && !byController) {
2127
+ const loopParams = {
2128
+ slideRealIndex,
2129
+ slideTo: false,
2130
+ direction,
2131
+ setTranslate,
2132
+ activeSlideIndex,
2133
+ byController: true
2134
+ };
2135
+ if (Array.isArray(swiper.controller.control)) {
2136
+ swiper.controller.control.forEach(c => {
2137
+ if (!c.destroyed && c.params.loop) c.loopFix(loopParams);
2138
+ });
2139
+ } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) {
2140
+ swiper.controller.control.loopFix(loopParams);
2141
+ }
2142
+ }
2143
+ swiper.emit('loopFix');
2144
+ }
2145
+
2146
+ function loopDestroy() {
2147
+ const swiper = this;
2148
+ const {
2149
+ params,
2150
+ slidesEl
2151
+ } = swiper;
2152
+ if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2153
+ swiper.recalcSlides();
2154
+ const newSlidesOrder = [];
2155
+ swiper.slides.forEach(slideEl => {
2156
+ const index = typeof slideEl.swiperSlideIndex === 'undefined' ? slideEl.getAttribute('data-swiper-slide-index') * 1 : slideEl.swiperSlideIndex;
2157
+ newSlidesOrder[index] = slideEl;
2158
+ });
2159
+ swiper.slides.forEach(slideEl => {
2160
+ slideEl.removeAttribute('data-swiper-slide-index');
2161
+ });
2162
+ newSlidesOrder.forEach(slideEl => {
2163
+ slidesEl.append(slideEl);
2164
+ });
2165
+ swiper.recalcSlides();
2166
+ swiper.slideTo(swiper.realIndex, 0);
2167
+ }
2168
+
2169
+ const loop = {
2170
+ loopCreate,
2171
+ loopFix,
2172
+ loopDestroy
2173
+ };
2174
+
2175
+ function setGrabCursor(moving) {
2176
+ const swiper = this;
2177
+ if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
2178
+ const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;
2179
+ if (swiper.isElement) {
2180
+ swiper.__preventObserver__ = true;
2181
+ }
2182
+ el.style.cursor = 'move';
2183
+ el.style.cursor = moving ? 'grabbing' : 'grab';
2184
+ if (swiper.isElement) {
2185
+ requestAnimationFrame(() => {
2186
+ swiper.__preventObserver__ = false;
2187
+ });
2188
+ }
2189
+ }
2190
+
2191
+ function unsetGrabCursor() {
2192
+ const swiper = this;
2193
+ if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
2194
+ return;
2195
+ }
2196
+ if (swiper.isElement) {
2197
+ swiper.__preventObserver__ = true;
2198
+ }
2199
+ swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';
2200
+ if (swiper.isElement) {
2201
+ requestAnimationFrame(() => {
2202
+ swiper.__preventObserver__ = false;
2203
+ });
2204
+ }
2205
+ }
2206
+
2207
+ const grabCursor = {
2208
+ setGrabCursor,
2209
+ unsetGrabCursor
2210
+ };
2211
+
2212
+ // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
2213
+ function closestElement(selector, base = this) {
2214
+ function __closestFrom(el) {
2215
+ if (!el || el === getDocument() || el === getWindow()) return null;
2216
+ if (el.assignedSlot) el = el.assignedSlot;
2217
+ const found = el.closest(selector);
2218
+ if (!found && !el.getRootNode) {
2219
+ return null;
2220
+ }
2221
+ return found || __closestFrom(el.getRootNode().host);
2222
+ }
2223
+ return __closestFrom(base);
2224
+ }
2225
+ function onTouchStart(event) {
2226
+ const swiper = this;
2227
+ const document = getDocument();
2228
+ const window = getWindow();
2229
+ const data = swiper.touchEventsData;
2230
+ data.evCache.push(event);
2231
+ const {
2232
+ params,
2233
+ touches,
2234
+ enabled
2235
+ } = swiper;
2236
+ if (!enabled) return;
2237
+ if (!params.simulateTouch && event.pointerType === 'mouse') return;
2238
+ if (swiper.animating && params.preventInteractionOnTransition) {
2239
+ return;
2240
+ }
2241
+ if (!swiper.animating && params.cssMode && params.loop) {
2242
+ swiper.loopFix();
2243
+ }
2244
+ let e = event;
2245
+ if (e.originalEvent) e = e.originalEvent;
2246
+ let targetEl = e.target;
2247
+ if (params.touchEventsTarget === 'wrapper') {
2248
+ if (!swiper.wrapperEl.contains(targetEl)) return;
2249
+ }
2250
+ if ('which' in e && e.which === 3) return;
2251
+ if ('button' in e && e.button > 0) return;
2252
+ if (data.isTouched && data.isMoved) return;
2253
+
2254
+ // change target el for shadow root component
2255
+ const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
2256
+ // eslint-disable-next-line
2257
+ const eventPath = event.composedPath ? event.composedPath() : event.path;
2258
+ if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
2259
+ targetEl = eventPath[0];
2260
+ }
2261
+ const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;
2262
+ const isTargetShadow = !!(e.target && e.target.shadowRoot);
2263
+
2264
+ // use closestElement for shadow root element to get the actual closest for nested shadow root element
2265
+ if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) {
2266
+ swiper.allowClick = true;
2267
+ return;
2268
+ }
2269
+ if (params.swipeHandler) {
2270
+ if (!targetEl.closest(params.swipeHandler)) return;
2271
+ }
2272
+ touches.currentX = e.pageX;
2273
+ touches.currentY = e.pageY;
2274
+ const startX = touches.currentX;
2275
+ const startY = touches.currentY;
2276
+
2277
+ // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
2278
+
2279
+ const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
2280
+ const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
2281
+ if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
2282
+ if (edgeSwipeDetection === 'prevent') {
2283
+ event.preventDefault();
2284
+ } else {
2285
+ return;
2286
+ }
2287
+ }
2288
+ Object.assign(data, {
2289
+ isTouched: true,
2290
+ isMoved: false,
2291
+ allowTouchCallbacks: true,
2292
+ isScrolling: undefined,
2293
+ startMoving: undefined
2294
+ });
2295
+ touches.startX = startX;
2296
+ touches.startY = startY;
2297
+ data.touchStartTime = now();
2298
+ swiper.allowClick = true;
2299
+ swiper.updateSize();
2300
+ swiper.swipeDirection = undefined;
2301
+ if (params.threshold > 0) data.allowThresholdMove = false;
2302
+ let preventDefault = true;
2303
+ if (targetEl.matches(data.focusableElements)) {
2304
+ preventDefault = false;
2305
+ if (targetEl.nodeName === 'SELECT') {
2306
+ data.isTouched = false;
2307
+ }
2308
+ }
2309
+ if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {
2310
+ document.activeElement.blur();
2311
+ }
2312
+ const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
2313
+ if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) {
2314
+ e.preventDefault();
2315
+ }
2316
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {
2317
+ swiper.freeMode.onTouchStart();
2318
+ }
2319
+ swiper.emit('touchStart', e);
2320
+ }
2321
+
2322
+ function onTouchMove(event) {
2323
+ const document = getDocument();
2324
+ const swiper = this;
2325
+ const data = swiper.touchEventsData;
2326
+ const {
2327
+ params,
2328
+ touches,
2329
+ rtlTranslate: rtl,
2330
+ enabled
2331
+ } = swiper;
2332
+ if (!enabled) return;
2333
+ if (!params.simulateTouch && event.pointerType === 'mouse') return;
2334
+ let e = event;
2335
+ if (e.originalEvent) e = e.originalEvent;
2336
+ if (!data.isTouched) {
2337
+ if (data.startMoving && data.isScrolling) {
2338
+ swiper.emit('touchMoveOpposite', e);
2339
+ }
2340
+ return;
2341
+ }
2342
+ const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === e.pointerId);
2343
+ if (pointerIndex >= 0) data.evCache[pointerIndex] = e;
2344
+ const targetTouch = data.evCache.length > 1 ? data.evCache[0] : e;
2345
+ const pageX = targetTouch.pageX;
2346
+ const pageY = targetTouch.pageY;
2347
+ if (e.preventedByNestedSwiper) {
2348
+ touches.startX = pageX;
2349
+ touches.startY = pageY;
2350
+ return;
2351
+ }
2352
+ if (!swiper.allowTouchMove) {
2353
+ if (!e.target.matches(data.focusableElements)) {
2354
+ swiper.allowClick = false;
2355
+ }
2356
+ if (data.isTouched) {
2357
+ Object.assign(touches, {
2358
+ startX: pageX,
2359
+ startY: pageY,
2360
+ prevX: swiper.touches.currentX,
2361
+ prevY: swiper.touches.currentY,
2362
+ currentX: pageX,
2363
+ currentY: pageY
2364
+ });
2365
+ data.touchStartTime = now();
2366
+ }
2367
+ return;
2368
+ }
2369
+ if (params.touchReleaseOnEdges && !params.loop) {
2370
+ if (swiper.isVertical()) {
2371
+ // Vertical
2372
+ if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
2373
+ data.isTouched = false;
2374
+ data.isMoved = false;
2375
+ return;
2376
+ }
2377
+ } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
2378
+ return;
2379
+ }
2380
+ }
2381
+ if (document.activeElement) {
2382
+ if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
2383
+ data.isMoved = true;
2384
+ swiper.allowClick = false;
2385
+ return;
2386
+ }
2387
+ }
2388
+ if (data.allowTouchCallbacks) {
2389
+ swiper.emit('touchMove', e);
2390
+ }
2391
+ if (e.targetTouches && e.targetTouches.length > 1) return;
2392
+ touches.currentX = pageX;
2393
+ touches.currentY = pageY;
2394
+ const diffX = touches.currentX - touches.startX;
2395
+ const diffY = touches.currentY - touches.startY;
2396
+ if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;
2397
+ if (typeof data.isScrolling === 'undefined') {
2398
+ let touchAngle;
2399
+ if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
2400
+ data.isScrolling = false;
2401
+ } else {
2402
+ // eslint-disable-next-line
2403
+ if (diffX * diffX + diffY * diffY >= 25) {
2404
+ touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
2405
+ data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
2406
+ }
2407
+ }
2408
+ }
2409
+ if (data.isScrolling) {
2410
+ swiper.emit('touchMoveOpposite', e);
2411
+ }
2412
+ if (typeof data.startMoving === 'undefined') {
2413
+ if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
2414
+ data.startMoving = true;
2415
+ }
2416
+ }
2417
+ if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) {
2418
+ data.isTouched = false;
2419
+ return;
2420
+ }
2421
+ if (!data.startMoving) {
2422
+ return;
2423
+ }
2424
+ swiper.allowClick = false;
2425
+ if (!params.cssMode && e.cancelable) {
2426
+ e.preventDefault();
2427
+ }
2428
+ if (params.touchMoveStopPropagation && !params.nested) {
2429
+ e.stopPropagation();
2430
+ }
2431
+ let diff = swiper.isHorizontal() ? diffX : diffY;
2432
+ let touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY;
2433
+ if (params.oneWayMovement) {
2434
+ diff = Math.abs(diff) * (rtl ? 1 : -1);
2435
+ touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1);
2436
+ }
2437
+ touches.diff = diff;
2438
+ diff *= params.touchRatio;
2439
+ if (rtl) {
2440
+ diff = -diff;
2441
+ touchesDiff = -touchesDiff;
2442
+ }
2443
+ const prevTouchesDirection = swiper.touchesDirection;
2444
+ swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
2445
+ swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';
2446
+ const isLoop = swiper.params.loop && !params.cssMode;
2447
+ if (!data.isMoved) {
2448
+ if (isLoop) {
2449
+ swiper.loopFix({
2450
+ direction: swiper.swipeDirection
2451
+ });
2452
+ }
2453
+ data.startTranslate = swiper.getTranslate();
2454
+ swiper.setTransition(0);
2455
+ if (swiper.animating) {
2456
+ const evt = new window.CustomEvent('transitionend', {
2457
+ bubbles: true,
2458
+ cancelable: true
2459
+ });
2460
+ swiper.wrapperEl.dispatchEvent(evt);
2461
+ }
2462
+ data.allowMomentumBounce = false;
2463
+ // Grab Cursor
2464
+ if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
2465
+ swiper.setGrabCursor(true);
2466
+ }
2467
+ swiper.emit('sliderFirstMove', e);
2468
+ }
2469
+ let loopFixed;
2470
+ if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && Math.abs(diff) >= 1) {
2471
+ // need another loop fix
2472
+ swiper.loopFix({
2473
+ direction: swiper.swipeDirection,
2474
+ setTranslate: true
2475
+ });
2476
+ loopFixed = true;
2477
+ }
2478
+ swiper.emit('sliderMove', e);
2479
+ data.isMoved = true;
2480
+ data.currentTranslate = diff + data.startTranslate;
2481
+ let disableParentSwiper = true;
2482
+ let resistanceRatio = params.resistanceRatio;
2483
+ if (params.touchReleaseOnEdges) {
2484
+ resistanceRatio = 0;
2485
+ }
2486
+ if (diff > 0) {
2487
+ if (isLoop && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) {
2488
+ swiper.loopFix({
2489
+ direction: 'prev',
2490
+ setTranslate: true,
2491
+ activeSlideIndex: 0
2492
+ });
2493
+ }
2494
+ if (data.currentTranslate > swiper.minTranslate()) {
2495
+ disableParentSwiper = false;
2496
+ if (params.resistance) {
2497
+ data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;
2498
+ }
2499
+ }
2500
+ } else if (diff < 0) {
2501
+ if (isLoop && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) {
2502
+ swiper.loopFix({
2503
+ direction: 'next',
2504
+ setTranslate: true,
2505
+ activeSlideIndex: swiper.slides.length - (params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10)))
2506
+ });
2507
+ }
2508
+ if (data.currentTranslate < swiper.maxTranslate()) {
2509
+ disableParentSwiper = false;
2510
+ if (params.resistance) {
2511
+ data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;
2512
+ }
2513
+ }
2514
+ }
2515
+ if (disableParentSwiper) {
2516
+ e.preventedByNestedSwiper = true;
2517
+ }
2518
+
2519
+ // Directions locks
2520
+ if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
2521
+ data.currentTranslate = data.startTranslate;
2522
+ }
2523
+ if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
2524
+ data.currentTranslate = data.startTranslate;
2525
+ }
2526
+ if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
2527
+ data.currentTranslate = data.startTranslate;
2528
+ }
2529
+
2530
+ // Threshold
2531
+ if (params.threshold > 0) {
2532
+ if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
2533
+ if (!data.allowThresholdMove) {
2534
+ data.allowThresholdMove = true;
2535
+ touches.startX = touches.currentX;
2536
+ touches.startY = touches.currentY;
2537
+ data.currentTranslate = data.startTranslate;
2538
+ touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
2539
+ return;
2540
+ }
2541
+ } else {
2542
+ data.currentTranslate = data.startTranslate;
2543
+ return;
2544
+ }
2545
+ }
2546
+ if (!params.followFinger || params.cssMode) return;
2547
+
2548
+ // Update active index in free mode
2549
+ if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {
2550
+ swiper.updateActiveIndex();
2551
+ swiper.updateSlidesClasses();
2552
+ }
2553
+ if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) {
2554
+ swiper.freeMode.onTouchMove();
2555
+ }
2556
+ // Update progress
2557
+ swiper.updateProgress(data.currentTranslate);
2558
+ // Update translate
2559
+ swiper.setTranslate(data.currentTranslate);
2560
+ }
2561
+
2562
+ function onTouchEnd(event) {
2563
+ const swiper = this;
2564
+ const data = swiper.touchEventsData;
2565
+ const pointerIndex = data.evCache.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);
2566
+ if (pointerIndex >= 0) {
2567
+ data.evCache.splice(pointerIndex, 1);
2568
+ }
2569
+ if (['pointercancel', 'pointerout', 'pointerleave'].includes(event.type)) {
2570
+ const proceed = event.type === 'pointercancel' && (swiper.browser.isSafari || swiper.browser.isWebView);
2571
+ if (!proceed) {
2572
+ return;
2573
+ }
2574
+ }
2575
+ const {
2576
+ params,
2577
+ touches,
2578
+ rtlTranslate: rtl,
2579
+ slidesGrid,
2580
+ enabled
2581
+ } = swiper;
2582
+ if (!enabled) return;
2583
+ if (!params.simulateTouch && event.pointerType === 'mouse') return;
2584
+ let e = event;
2585
+ if (e.originalEvent) e = e.originalEvent;
2586
+ if (data.allowTouchCallbacks) {
2587
+ swiper.emit('touchEnd', e);
2588
+ }
2589
+ data.allowTouchCallbacks = false;
2590
+ if (!data.isTouched) {
2591
+ if (data.isMoved && params.grabCursor) {
2592
+ swiper.setGrabCursor(false);
2593
+ }
2594
+ data.isMoved = false;
2595
+ data.startMoving = false;
2596
+ return;
2597
+ }
2598
+ // Return Grab Cursor
2599
+ if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
2600
+ swiper.setGrabCursor(false);
2601
+ }
2602
+
2603
+ // Time diff
2604
+ const touchEndTime = now();
2605
+ const timeDiff = touchEndTime - data.touchStartTime;
2606
+
2607
+ // Tap, doubleTap, Click
2608
+ if (swiper.allowClick) {
2609
+ const pathTree = e.path || e.composedPath && e.composedPath();
2610
+ swiper.updateClickedSlide(pathTree && pathTree[0] || e.target);
2611
+ swiper.emit('tap click', e);
2612
+ if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
2613
+ swiper.emit('doubleTap doubleClick', e);
2614
+ }
2615
+ }
2616
+ data.lastClickTime = now();
2617
+ nextTick(() => {
2618
+ if (!swiper.destroyed) swiper.allowClick = true;
2619
+ });
2620
+ if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
2621
+ data.isTouched = false;
2622
+ data.isMoved = false;
2623
+ data.startMoving = false;
2624
+ return;
2625
+ }
2626
+ data.isTouched = false;
2627
+ data.isMoved = false;
2628
+ data.startMoving = false;
2629
+ let currentPos;
2630
+ if (params.followFinger) {
2631
+ currentPos = rtl ? swiper.translate : -swiper.translate;
2632
+ } else {
2633
+ currentPos = -data.currentTranslate;
2634
+ }
2635
+ if (params.cssMode) {
2636
+ return;
2637
+ }
2638
+ if (swiper.params.freeMode && params.freeMode.enabled) {
2639
+ swiper.freeMode.onTouchEnd({
2640
+ currentPos
2641
+ });
2642
+ return;
2643
+ }
2644
+
2645
+ // Find current slide
2646
+ let stopIndex = 0;
2647
+ let groupSize = swiper.slidesSizesGrid[0];
2648
+ for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
2649
+ const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
2650
+ if (typeof slidesGrid[i + increment] !== 'undefined') {
2651
+ if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
2652
+ stopIndex = i;
2653
+ groupSize = slidesGrid[i + increment] - slidesGrid[i];
2654
+ }
2655
+ } else if (currentPos >= slidesGrid[i]) {
2656
+ stopIndex = i;
2657
+ groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
2658
+ }
2659
+ }
2660
+ let rewindFirstIndex = null;
2661
+ let rewindLastIndex = null;
2662
+ if (params.rewind) {
2663
+ if (swiper.isBeginning) {
2664
+ rewindLastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
2665
+ } else if (swiper.isEnd) {
2666
+ rewindFirstIndex = 0;
2667
+ }
2668
+ }
2669
+ // Find current slide size
2670
+ const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
2671
+ const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
2672
+ if (timeDiff > params.longSwipesMs) {
2673
+ // Long touches
2674
+ if (!params.longSwipes) {
2675
+ swiper.slideTo(swiper.activeIndex);
2676
+ return;
2677
+ }
2678
+ if (swiper.swipeDirection === 'next') {
2679
+ if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex);
2680
+ }
2681
+ if (swiper.swipeDirection === 'prev') {
2682
+ if (ratio > 1 - params.longSwipesRatio) {
2683
+ swiper.slideTo(stopIndex + increment);
2684
+ } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {
2685
+ swiper.slideTo(rewindLastIndex);
2686
+ } else {
2687
+ swiper.slideTo(stopIndex);
2688
+ }
2689
+ }
2690
+ } else {
2691
+ // Short swipes
2692
+ if (!params.shortSwipes) {
2693
+ swiper.slideTo(swiper.activeIndex);
2694
+ return;
2695
+ }
2696
+ const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
2697
+ if (!isNavButtonTarget) {
2698
+ if (swiper.swipeDirection === 'next') {
2699
+ swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);
2700
+ }
2701
+ if (swiper.swipeDirection === 'prev') {
2702
+ swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);
2703
+ }
2704
+ } else if (e.target === swiper.navigation.nextEl) {
2705
+ swiper.slideTo(stopIndex + increment);
2706
+ } else {
2707
+ swiper.slideTo(stopIndex);
2708
+ }
2709
+ }
2710
+ }
2711
+
2712
+ function onResize() {
2713
+ const swiper = this;
2714
+ const {
2715
+ params,
2716
+ el
2717
+ } = swiper;
2718
+ if (el && el.offsetWidth === 0) return;
2719
+
2720
+ // Breakpoints
2721
+ if (params.breakpoints) {
2722
+ swiper.setBreakpoint();
2723
+ }
2724
+
2725
+ // Save locks
2726
+ const {
2727
+ allowSlideNext,
2728
+ allowSlidePrev,
2729
+ snapGrid
2730
+ } = swiper;
2731
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
2732
+
2733
+ // Disable locks on resize
2734
+ swiper.allowSlideNext = true;
2735
+ swiper.allowSlidePrev = true;
2736
+ swiper.updateSize();
2737
+ swiper.updateSlides();
2738
+ swiper.updateSlidesClasses();
2739
+ const isVirtualLoop = isVirtual && params.loop;
2740
+ if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {
2741
+ swiper.slideTo(swiper.slides.length - 1, 0, false, true);
2742
+ } else {
2743
+ if (swiper.params.loop && !isVirtual) {
2744
+ swiper.slideToLoop(swiper.realIndex, 0, false, true);
2745
+ } else {
2746
+ swiper.slideTo(swiper.activeIndex, 0, false, true);
2747
+ }
2748
+ }
2749
+ if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
2750
+ clearTimeout(swiper.autoplay.resizeTimeout);
2751
+ swiper.autoplay.resizeTimeout = setTimeout(() => {
2752
+ if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
2753
+ swiper.autoplay.resume();
2754
+ }
2755
+ }, 500);
2756
+ }
2757
+ // Return locks after resize
2758
+ swiper.allowSlidePrev = allowSlidePrev;
2759
+ swiper.allowSlideNext = allowSlideNext;
2760
+ if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
2761
+ swiper.checkOverflow();
2762
+ }
2763
+ }
2764
+
2765
+ function onClick(e) {
2766
+ const swiper = this;
2767
+ if (!swiper.enabled) return;
2768
+ if (!swiper.allowClick) {
2769
+ if (swiper.params.preventClicks) e.preventDefault();
2770
+ if (swiper.params.preventClicksPropagation && swiper.animating) {
2771
+ e.stopPropagation();
2772
+ e.stopImmediatePropagation();
2773
+ }
2774
+ }
2775
+ }
2776
+
2777
+ function onScroll() {
2778
+ const swiper = this;
2779
+ const {
2780
+ wrapperEl,
2781
+ rtlTranslate,
2782
+ enabled
2783
+ } = swiper;
2784
+ if (!enabled) return;
2785
+ swiper.previousTranslate = swiper.translate;
2786
+ if (swiper.isHorizontal()) {
2787
+ swiper.translate = -wrapperEl.scrollLeft;
2788
+ } else {
2789
+ swiper.translate = -wrapperEl.scrollTop;
2790
+ }
2791
+ // eslint-disable-next-line
2792
+ if (swiper.translate === 0) swiper.translate = 0;
2793
+ swiper.updateActiveIndex();
2794
+ swiper.updateSlidesClasses();
2795
+ let newProgress;
2796
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
2797
+ if (translatesDiff === 0) {
2798
+ newProgress = 0;
2799
+ } else {
2800
+ newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
2801
+ }
2802
+ if (newProgress !== swiper.progress) {
2803
+ swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
2804
+ }
2805
+ swiper.emit('setTranslate', swiper.translate, false);
2806
+ }
2807
+
2808
+ function onLoad(e) {
2809
+ const swiper = this;
2810
+ processLazyPreloader(swiper, e.target);
2811
+ if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) {
2812
+ return;
2813
+ }
2814
+ swiper.update();
2815
+ }
2816
+
2817
+ let dummyEventAttached = false;
2818
+ function dummyEventListener() {}
2819
+ const events = (swiper, method) => {
2820
+ const document = getDocument();
2821
+ const {
2822
+ params,
2823
+ el,
2824
+ wrapperEl,
2825
+ device
2826
+ } = swiper;
2827
+ const capture = !!params.nested;
2828
+ const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
2829
+ const swiperMethod = method;
2830
+
2831
+ // Touch Events
2832
+ el[domMethod]('pointerdown', swiper.onTouchStart, {
2833
+ passive: false
2834
+ });
2835
+ document[domMethod]('pointermove', swiper.onTouchMove, {
2836
+ passive: false,
2837
+ capture
2838
+ });
2839
+ document[domMethod]('pointerup', swiper.onTouchEnd, {
2840
+ passive: true
2841
+ });
2842
+ document[domMethod]('pointercancel', swiper.onTouchEnd, {
2843
+ passive: true
2844
+ });
2845
+ document[domMethod]('pointerout', swiper.onTouchEnd, {
2846
+ passive: true
2847
+ });
2848
+ document[domMethod]('pointerleave', swiper.onTouchEnd, {
2849
+ passive: true
2850
+ });
2851
+
2852
+ // Prevent Links Clicks
2853
+ if (params.preventClicks || params.preventClicksPropagation) {
2854
+ el[domMethod]('click', swiper.onClick, true);
2855
+ }
2856
+ if (params.cssMode) {
2857
+ wrapperEl[domMethod]('scroll', swiper.onScroll);
2858
+ }
2859
+
2860
+ // Resize handler
2861
+ if (params.updateOnWindowResize) {
2862
+ swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
2863
+ } else {
2864
+ swiper[swiperMethod]('observerUpdate', onResize, true);
2865
+ }
2866
+
2867
+ // Images loader
2868
+ el[domMethod]('load', swiper.onLoad, {
2869
+ capture: true
2870
+ });
2871
+ };
2872
+ function attachEvents() {
2873
+ const swiper = this;
2874
+ const document = getDocument();
2875
+ const {
2876
+ params
2877
+ } = swiper;
2878
+ swiper.onTouchStart = onTouchStart.bind(swiper);
2879
+ swiper.onTouchMove = onTouchMove.bind(swiper);
2880
+ swiper.onTouchEnd = onTouchEnd.bind(swiper);
2881
+ if (params.cssMode) {
2882
+ swiper.onScroll = onScroll.bind(swiper);
2883
+ }
2884
+ swiper.onClick = onClick.bind(swiper);
2885
+ swiper.onLoad = onLoad.bind(swiper);
2886
+ if (!dummyEventAttached) {
2887
+ document.addEventListener('touchstart', dummyEventListener);
2888
+ dummyEventAttached = true;
2889
+ }
2890
+ events(swiper, 'on');
2891
+ }
2892
+ function detachEvents() {
2893
+ const swiper = this;
2894
+ events(swiper, 'off');
2895
+ }
2896
+ const events$1 = {
2897
+ attachEvents,
2898
+ detachEvents
2899
+ };
2900
+
2901
+ const isGridEnabled = (swiper, params) => {
2902
+ return swiper.grid && params.grid && params.grid.rows > 1;
2903
+ };
2904
+ function setBreakpoint() {
2905
+ const swiper = this;
2906
+ const {
2907
+ realIndex,
2908
+ initialized,
2909
+ params,
2910
+ el
2911
+ } = swiper;
2912
+ const breakpoints = params.breakpoints;
2913
+ if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
2914
+
2915
+ // Get breakpoint for window width and update parameters
2916
+ const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
2917
+ if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
2918
+ const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
2919
+ const breakpointParams = breakpointOnlyParams || swiper.originalParams;
2920
+ const wasMultiRow = isGridEnabled(swiper, params);
2921
+ const isMultiRow = isGridEnabled(swiper, breakpointParams);
2922
+ const wasEnabled = params.enabled;
2923
+ if (wasMultiRow && !isMultiRow) {
2924
+ el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
2925
+ swiper.emitContainerClasses();
2926
+ } else if (!wasMultiRow && isMultiRow) {
2927
+ el.classList.add(`${params.containerModifierClass}grid`);
2928
+ if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {
2929
+ el.classList.add(`${params.containerModifierClass}grid-column`);
2930
+ }
2931
+ swiper.emitContainerClasses();
2932
+ }
2933
+
2934
+ // Toggle navigation, pagination, scrollbar
2935
+ ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
2936
+ const wasModuleEnabled = params[prop] && params[prop].enabled;
2937
+ const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;
2938
+ if (wasModuleEnabled && !isModuleEnabled) {
2939
+ swiper[prop].disable();
2940
+ }
2941
+ if (!wasModuleEnabled && isModuleEnabled) {
2942
+ swiper[prop].enable();
2943
+ }
2944
+ });
2945
+ const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
2946
+ const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
2947
+ if (directionChanged && initialized) {
2948
+ swiper.changeDirection();
2949
+ }
2950
+ extend(swiper.params, breakpointParams);
2951
+ const isEnabled = swiper.params.enabled;
2952
+ Object.assign(swiper, {
2953
+ allowTouchMove: swiper.params.allowTouchMove,
2954
+ allowSlideNext: swiper.params.allowSlideNext,
2955
+ allowSlidePrev: swiper.params.allowSlidePrev
2956
+ });
2957
+ if (wasEnabled && !isEnabled) {
2958
+ swiper.disable();
2959
+ } else if (!wasEnabled && isEnabled) {
2960
+ swiper.enable();
2961
+ }
2962
+ swiper.currentBreakpoint = breakpoint;
2963
+ swiper.emit('_beforeBreakpoint', breakpointParams);
2964
+ if (needsReLoop && initialized) {
2965
+ swiper.loopDestroy();
2966
+ swiper.loopCreate(realIndex);
2967
+ swiper.updateSlides();
2968
+ }
2969
+ swiper.emit('breakpoint', breakpointParams);
2970
+ }
2971
+
2972
+ function getBreakpoint(breakpoints, base = 'window', containerEl) {
2973
+ if (!breakpoints || base === 'container' && !containerEl) return undefined;
2974
+ let breakpoint = false;
2975
+ const window = getWindow();
2976
+ const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
2977
+ const points = Object.keys(breakpoints).map(point => {
2978
+ if (typeof point === 'string' && point.indexOf('@') === 0) {
2979
+ const minRatio = parseFloat(point.substr(1));
2980
+ const value = currentHeight * minRatio;
2981
+ return {
2982
+ value,
2983
+ point
2984
+ };
2985
+ }
2986
+ return {
2987
+ value: point,
2988
+ point
2989
+ };
2990
+ });
2991
+ points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
2992
+ for (let i = 0; i < points.length; i += 1) {
2993
+ const {
2994
+ point,
2995
+ value
2996
+ } = points[i];
2997
+ if (base === 'window') {
2998
+ if (window.matchMedia(`(min-width: ${value}px)`).matches) {
2999
+ breakpoint = point;
3000
+ }
3001
+ } else if (value <= containerEl.clientWidth) {
3002
+ breakpoint = point;
3003
+ }
3004
+ }
3005
+ return breakpoint || 'max';
3006
+ }
3007
+
3008
+ const breakpoints = {
3009
+ setBreakpoint,
3010
+ getBreakpoint
3011
+ };
3012
+
3013
+ function prepareClasses(entries, prefix) {
3014
+ const resultClasses = [];
3015
+ entries.forEach(item => {
3016
+ if (typeof item === 'object') {
3017
+ Object.keys(item).forEach(classNames => {
3018
+ if (item[classNames]) {
3019
+ resultClasses.push(prefix + classNames);
3020
+ }
3021
+ });
3022
+ } else if (typeof item === 'string') {
3023
+ resultClasses.push(prefix + item);
3024
+ }
3025
+ });
3026
+ return resultClasses;
3027
+ }
3028
+ function addClasses() {
3029
+ const swiper = this;
3030
+ const {
3031
+ classNames,
3032
+ params,
3033
+ rtl,
3034
+ el,
3035
+ device
3036
+ } = swiper;
3037
+ // prettier-ignore
3038
+ const suffixes = prepareClasses(['initialized', params.direction, {
3039
+ 'free-mode': swiper.params.freeMode && params.freeMode.enabled
3040
+ }, {
3041
+ 'autoheight': params.autoHeight
3042
+ }, {
3043
+ 'rtl': rtl
3044
+ }, {
3045
+ 'grid': params.grid && params.grid.rows > 1
3046
+ }, {
3047
+ 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'
3048
+ }, {
3049
+ 'android': device.android
3050
+ }, {
3051
+ 'ios': device.ios
3052
+ }, {
3053
+ 'css-mode': params.cssMode
3054
+ }, {
3055
+ 'centered': params.cssMode && params.centeredSlides
3056
+ }, {
3057
+ 'watch-progress': params.watchSlidesProgress
3058
+ }], params.containerModifierClass);
3059
+ classNames.push(...suffixes);
3060
+ el.classList.add(...classNames);
3061
+ swiper.emitContainerClasses();
3062
+ }
3063
+
3064
+ function removeClasses() {
3065
+ const swiper = this;
3066
+ const {
3067
+ el,
3068
+ classNames
3069
+ } = swiper;
3070
+ el.classList.remove(...classNames);
3071
+ swiper.emitContainerClasses();
3072
+ }
3073
+
3074
+ const classes = {
3075
+ addClasses,
3076
+ removeClasses
3077
+ };
3078
+
3079
+ function checkOverflow() {
3080
+ const swiper = this;
3081
+ const {
3082
+ isLocked: wasLocked,
3083
+ params
3084
+ } = swiper;
3085
+ const {
3086
+ slidesOffsetBefore
3087
+ } = params;
3088
+ if (slidesOffsetBefore) {
3089
+ const lastSlideIndex = swiper.slides.length - 1;
3090
+ const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;
3091
+ swiper.isLocked = swiper.size > lastSlideRightEdge;
3092
+ } else {
3093
+ swiper.isLocked = swiper.snapGrid.length === 1;
3094
+ }
3095
+ if (params.allowSlideNext === true) {
3096
+ swiper.allowSlideNext = !swiper.isLocked;
3097
+ }
3098
+ if (params.allowSlidePrev === true) {
3099
+ swiper.allowSlidePrev = !swiper.isLocked;
3100
+ }
3101
+ if (wasLocked && wasLocked !== swiper.isLocked) {
3102
+ swiper.isEnd = false;
3103
+ }
3104
+ if (wasLocked !== swiper.isLocked) {
3105
+ swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
3106
+ }
3107
+ }
3108
+ const checkOverflow$1 = {
3109
+ checkOverflow
3110
+ };
3111
+
3112
+ const defaults = {
3113
+ init: true,
3114
+ direction: 'horizontal',
3115
+ oneWayMovement: false,
3116
+ touchEventsTarget: 'wrapper',
3117
+ initialSlide: 0,
3118
+ speed: 300,
3119
+ cssMode: false,
3120
+ updateOnWindowResize: true,
3121
+ resizeObserver: true,
3122
+ nested: false,
3123
+ createElements: false,
3124
+ enabled: true,
3125
+ focusableElements: 'input, select, option, textarea, button, video, label',
3126
+ // Overrides
3127
+ width: null,
3128
+ height: null,
3129
+ //
3130
+ preventInteractionOnTransition: false,
3131
+ // ssr
3132
+ userAgent: null,
3133
+ url: null,
3134
+ // To support iOS's swipe-to-go-back gesture (when being used in-app).
3135
+ edgeSwipeDetection: false,
3136
+ edgeSwipeThreshold: 20,
3137
+ // Autoheight
3138
+ autoHeight: false,
3139
+ // Set wrapper width
3140
+ setWrapperSize: false,
3141
+ // Virtual Translate
3142
+ virtualTranslate: false,
3143
+ // Effects
3144
+ effect: 'slide',
3145
+ // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
3146
+
3147
+ // Breakpoints
3148
+ breakpoints: undefined,
3149
+ breakpointsBase: 'window',
3150
+ // Slides grid
3151
+ spaceBetween: 0,
3152
+ slidesPerView: 1,
3153
+ slidesPerGroup: 1,
3154
+ slidesPerGroupSkip: 0,
3155
+ slidesPerGroupAuto: false,
3156
+ centeredSlides: false,
3157
+ centeredSlidesBounds: false,
3158
+ slidesOffsetBefore: 0,
3159
+ // in px
3160
+ slidesOffsetAfter: 0,
3161
+ // in px
3162
+ normalizeSlideIndex: true,
3163
+ centerInsufficientSlides: false,
3164
+ // Disable swiper and hide navigation when container not overflow
3165
+ watchOverflow: true,
3166
+ // Round length
3167
+ roundLengths: false,
3168
+ // Touches
3169
+ touchRatio: 1,
3170
+ touchAngle: 45,
3171
+ simulateTouch: true,
3172
+ shortSwipes: true,
3173
+ longSwipes: true,
3174
+ longSwipesRatio: 0.5,
3175
+ longSwipesMs: 300,
3176
+ followFinger: true,
3177
+ allowTouchMove: true,
3178
+ threshold: 5,
3179
+ touchMoveStopPropagation: false,
3180
+ touchStartPreventDefault: true,
3181
+ touchStartForcePreventDefault: false,
3182
+ touchReleaseOnEdges: false,
3183
+ // Unique Navigation Elements
3184
+ uniqueNavElements: true,
3185
+ // Resistance
3186
+ resistance: true,
3187
+ resistanceRatio: 0.85,
3188
+ // Progress
3189
+ watchSlidesProgress: false,
3190
+ // Cursor
3191
+ grabCursor: false,
3192
+ // Clicks
3193
+ preventClicks: true,
3194
+ preventClicksPropagation: true,
3195
+ slideToClickedSlide: false,
3196
+ // loop
3197
+ loop: false,
3198
+ loopedSlides: null,
3199
+ loopPreventsSliding: true,
3200
+ // rewind
3201
+ rewind: false,
3202
+ // Swiping/no swiping
3203
+ allowSlidePrev: true,
3204
+ allowSlideNext: true,
3205
+ swipeHandler: null,
3206
+ // '.swipe-handler',
3207
+ noSwiping: true,
3208
+ noSwipingClass: 'swiper-no-swiping',
3209
+ noSwipingSelector: null,
3210
+ // Passive Listeners
3211
+ passiveListeners: true,
3212
+ maxBackfaceHiddenSlides: 10,
3213
+ // NS
3214
+ containerModifierClass: 'swiper-',
3215
+ // NEW
3216
+ slideClass: 'swiper-slide',
3217
+ slideActiveClass: 'swiper-slide-active',
3218
+ slideVisibleClass: 'swiper-slide-visible',
3219
+ slideNextClass: 'swiper-slide-next',
3220
+ slidePrevClass: 'swiper-slide-prev',
3221
+ wrapperClass: 'swiper-wrapper',
3222
+ lazyPreloaderClass: 'swiper-lazy-preloader',
3223
+ lazyPreloadPrevNext: 0,
3224
+ // Callbacks
3225
+ runCallbacksOnInit: true,
3226
+ // Internals
3227
+ _emitClasses: false
3228
+ };
3229
+
3230
+ function moduleExtendParams(params, allModulesParams) {
3231
+ return function extendParams(obj = {}) {
3232
+ const moduleParamName = Object.keys(obj)[0];
3233
+ const moduleParams = obj[moduleParamName];
3234
+ if (typeof moduleParams !== 'object' || moduleParams === null) {
3235
+ extend(allModulesParams, obj);
3236
+ return;
3237
+ }
3238
+ if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) {
3239
+ params[moduleParamName] = {
3240
+ auto: true
3241
+ };
3242
+ }
3243
+ if (!(moduleParamName in params && 'enabled' in moduleParams)) {
3244
+ extend(allModulesParams, obj);
3245
+ return;
3246
+ }
3247
+ if (params[moduleParamName] === true) {
3248
+ params[moduleParamName] = {
3249
+ enabled: true
3250
+ };
3251
+ }
3252
+ if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
3253
+ params[moduleParamName].enabled = true;
3254
+ }
3255
+ if (!params[moduleParamName]) params[moduleParamName] = {
3256
+ enabled: false
3257
+ };
3258
+ extend(allModulesParams, obj);
3259
+ };
3260
+ }
3261
+
3262
+ /* eslint no-param-reassign: "off" */
3263
+ const prototypes = {
3264
+ eventsEmitter,
3265
+ update,
3266
+ translate,
3267
+ transition,
3268
+ slide,
3269
+ loop,
3270
+ grabCursor,
3271
+ events: events$1,
3272
+ breakpoints,
3273
+ checkOverflow: checkOverflow$1,
3274
+ classes
3275
+ };
3276
+ const extendedDefaults = {};
3277
+ class Swiper {
3278
+ constructor(...args) {
3279
+ let el;
3280
+ let params;
3281
+ if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
3282
+ params = args[0];
3283
+ } else {
3284
+ [el, params] = args;
3285
+ }
3286
+ if (!params) params = {};
3287
+ params = extend({}, params);
3288
+ if (el && !params.el) params.el = el;
3289
+ const document = getDocument();
3290
+ if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) {
3291
+ const swipers = [];
3292
+ document.querySelectorAll(params.el).forEach(containerEl => {
3293
+ const newParams = extend({}, params, {
3294
+ el: containerEl
3295
+ });
3296
+ swipers.push(new Swiper(newParams));
3297
+ });
3298
+ // eslint-disable-next-line no-constructor-return
3299
+ return swipers;
3300
+ }
3301
+
3302
+ // Swiper Instance
3303
+ const swiper = this;
3304
+ swiper.__swiper__ = true;
3305
+ swiper.support = getSupport();
3306
+ swiper.device = getDevice({
3307
+ userAgent: params.userAgent
3308
+ });
3309
+ swiper.browser = getBrowser();
3310
+ swiper.eventsListeners = {};
3311
+ swiper.eventsAnyListeners = [];
3312
+ swiper.modules = [...swiper.__modules__];
3313
+ if (params.modules && Array.isArray(params.modules)) {
3314
+ swiper.modules.push(...params.modules);
3315
+ }
3316
+ const allModulesParams = {};
3317
+ swiper.modules.forEach(mod => {
3318
+ mod({
3319
+ params,
3320
+ swiper,
3321
+ extendParams: moduleExtendParams(params, allModulesParams),
3322
+ on: swiper.on.bind(swiper),
3323
+ once: swiper.once.bind(swiper),
3324
+ off: swiper.off.bind(swiper),
3325
+ emit: swiper.emit.bind(swiper)
3326
+ });
3327
+ });
3328
+
3329
+ // Extend defaults with modules params
3330
+ const swiperParams = extend({}, defaults, allModulesParams);
3331
+
3332
+ // Extend defaults with passed params
3333
+ swiper.params = extend({}, swiperParams, extendedDefaults, params);
3334
+ swiper.originalParams = extend({}, swiper.params);
3335
+ swiper.passedParams = extend({}, params);
3336
+
3337
+ // add event listeners
3338
+ if (swiper.params && swiper.params.on) {
3339
+ Object.keys(swiper.params.on).forEach(eventName => {
3340
+ swiper.on(eventName, swiper.params.on[eventName]);
3341
+ });
3342
+ }
3343
+ if (swiper.params && swiper.params.onAny) {
3344
+ swiper.onAny(swiper.params.onAny);
3345
+ }
3346
+
3347
+ // Extend Swiper
3348
+ Object.assign(swiper, {
3349
+ enabled: swiper.params.enabled,
3350
+ el,
3351
+ // Classes
3352
+ classNames: [],
3353
+ // Slides
3354
+ slides: [],
3355
+ slidesGrid: [],
3356
+ snapGrid: [],
3357
+ slidesSizesGrid: [],
3358
+ // isDirection
3359
+ isHorizontal() {
3360
+ return swiper.params.direction === 'horizontal';
3361
+ },
3362
+ isVertical() {
3363
+ return swiper.params.direction === 'vertical';
3364
+ },
3365
+ // Indexes
3366
+ activeIndex: 0,
3367
+ realIndex: 0,
3368
+ //
3369
+ isBeginning: true,
3370
+ isEnd: false,
3371
+ // Props
3372
+ translate: 0,
3373
+ previousTranslate: 0,
3374
+ progress: 0,
3375
+ velocity: 0,
3376
+ animating: false,
3377
+ cssOverflowAdjustment() {
3378
+ // Returns 0 unless `translate` is > 2**23
3379
+ // Should be subtracted from css values to prevent overflow
3380
+ return Math.trunc(this.translate / 2 ** 23) * 2 ** 23;
3381
+ },
3382
+ // Locks
3383
+ allowSlideNext: swiper.params.allowSlideNext,
3384
+ allowSlidePrev: swiper.params.allowSlidePrev,
3385
+ // Touch Events
3386
+ touchEventsData: {
3387
+ isTouched: undefined,
3388
+ isMoved: undefined,
3389
+ allowTouchCallbacks: undefined,
3390
+ touchStartTime: undefined,
3391
+ isScrolling: undefined,
3392
+ currentTranslate: undefined,
3393
+ startTranslate: undefined,
3394
+ allowThresholdMove: undefined,
3395
+ // Form elements to match
3396
+ focusableElements: swiper.params.focusableElements,
3397
+ // Last click time
3398
+ lastClickTime: 0,
3399
+ clickTimeout: undefined,
3400
+ // Velocities
3401
+ velocities: [],
3402
+ allowMomentumBounce: undefined,
3403
+ startMoving: undefined,
3404
+ evCache: []
3405
+ },
3406
+ // Clicks
3407
+ allowClick: true,
3408
+ // Touches
3409
+ allowTouchMove: swiper.params.allowTouchMove,
3410
+ touches: {
3411
+ startX: 0,
3412
+ startY: 0,
3413
+ currentX: 0,
3414
+ currentY: 0,
3415
+ diff: 0
3416
+ },
3417
+ // Images
3418
+ imagesToLoad: [],
3419
+ imagesLoaded: 0
3420
+ });
3421
+ swiper.emit('_swiper');
3422
+
3423
+ // Init
3424
+ if (swiper.params.init) {
3425
+ swiper.init();
3426
+ }
3427
+
3428
+ // Return app instance
3429
+ // eslint-disable-next-line no-constructor-return
3430
+ return swiper;
3431
+ }
3432
+ getSlideIndex(slideEl) {
3433
+ const {
3434
+ slidesEl,
3435
+ params
3436
+ } = this;
3437
+ const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3438
+ const firstSlideIndex = elementIndex(slides[0]);
3439
+ return elementIndex(slideEl) - firstSlideIndex;
3440
+ }
3441
+ getSlideIndexByData(index) {
3442
+ return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]);
3443
+ }
3444
+ recalcSlides() {
3445
+ const swiper = this;
3446
+ const {
3447
+ slidesEl,
3448
+ params
3449
+ } = swiper;
3450
+ swiper.slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3451
+ }
3452
+ enable() {
3453
+ const swiper = this;
3454
+ if (swiper.enabled) return;
3455
+ swiper.enabled = true;
3456
+ if (swiper.params.grabCursor) {
3457
+ swiper.setGrabCursor();
3458
+ }
3459
+ swiper.emit('enable');
3460
+ }
3461
+ disable() {
3462
+ const swiper = this;
3463
+ if (!swiper.enabled) return;
3464
+ swiper.enabled = false;
3465
+ if (swiper.params.grabCursor) {
3466
+ swiper.unsetGrabCursor();
3467
+ }
3468
+ swiper.emit('disable');
3469
+ }
3470
+ setProgress(progress, speed) {
3471
+ const swiper = this;
3472
+ progress = Math.min(Math.max(progress, 0), 1);
3473
+ const min = swiper.minTranslate();
3474
+ const max = swiper.maxTranslate();
3475
+ const current = (max - min) * progress + min;
3476
+ swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);
3477
+ swiper.updateActiveIndex();
3478
+ swiper.updateSlidesClasses();
3479
+ }
3480
+ emitContainerClasses() {
3481
+ const swiper = this;
3482
+ if (!swiper.params._emitClasses || !swiper.el) return;
3483
+ const cls = swiper.el.className.split(' ').filter(className => {
3484
+ return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
3485
+ });
3486
+ swiper.emit('_containerClasses', cls.join(' '));
3487
+ }
3488
+ getSlideClasses(slideEl) {
3489
+ const swiper = this;
3490
+ if (swiper.destroyed) return '';
3491
+ return slideEl.className.split(' ').filter(className => {
3492
+ return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;
3493
+ }).join(' ');
3494
+ }
3495
+ emitSlidesClasses() {
3496
+ const swiper = this;
3497
+ if (!swiper.params._emitClasses || !swiper.el) return;
3498
+ const updates = [];
3499
+ swiper.slides.forEach(slideEl => {
3500
+ const classNames = swiper.getSlideClasses(slideEl);
3501
+ updates.push({
3502
+ slideEl,
3503
+ classNames
3504
+ });
3505
+ swiper.emit('_slideClass', slideEl, classNames);
3506
+ });
3507
+ swiper.emit('_slideClasses', updates);
3508
+ }
3509
+ slidesPerViewDynamic(view = 'current', exact = false) {
3510
+ const swiper = this;
3511
+ const {
3512
+ params,
3513
+ slides,
3514
+ slidesGrid,
3515
+ slidesSizesGrid,
3516
+ size: swiperSize,
3517
+ activeIndex
3518
+ } = swiper;
3519
+ let spv = 1;
3520
+ if (params.centeredSlides) {
3521
+ let slideSize = slides[activeIndex].swiperSlideSize;
3522
+ let breakLoop;
3523
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
3524
+ if (slides[i] && !breakLoop) {
3525
+ slideSize += slides[i].swiperSlideSize;
3526
+ spv += 1;
3527
+ if (slideSize > swiperSize) breakLoop = true;
3528
+ }
3529
+ }
3530
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
3531
+ if (slides[i] && !breakLoop) {
3532
+ slideSize += slides[i].swiperSlideSize;
3533
+ spv += 1;
3534
+ if (slideSize > swiperSize) breakLoop = true;
3535
+ }
3536
+ }
3537
+ } else {
3538
+ // eslint-disable-next-line
3539
+ if (view === 'current') {
3540
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
3541
+ const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;
3542
+ if (slideInView) {
3543
+ spv += 1;
3544
+ }
3545
+ }
3546
+ } else {
3547
+ // previous
3548
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
3549
+ const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;
3550
+ if (slideInView) {
3551
+ spv += 1;
3552
+ }
3553
+ }
3554
+ }
3555
+ }
3556
+ return spv;
3557
+ }
3558
+ update() {
3559
+ const swiper = this;
3560
+ if (!swiper || swiper.destroyed) return;
3561
+ const {
3562
+ snapGrid,
3563
+ params
3564
+ } = swiper;
3565
+ // Breakpoints
3566
+ if (params.breakpoints) {
3567
+ swiper.setBreakpoint();
3568
+ }
3569
+ [...swiper.el.querySelectorAll('[loading="lazy"]')].forEach(imageEl => {
3570
+ if (imageEl.complete) {
3571
+ processLazyPreloader(swiper, imageEl);
3572
+ }
3573
+ });
3574
+ swiper.updateSize();
3575
+ swiper.updateSlides();
3576
+ swiper.updateProgress();
3577
+ swiper.updateSlidesClasses();
3578
+ function setTranslate() {
3579
+ const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
3580
+ const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
3581
+ swiper.setTranslate(newTranslate);
3582
+ swiper.updateActiveIndex();
3583
+ swiper.updateSlidesClasses();
3584
+ }
3585
+ let translated;
3586
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled) {
3587
+ setTranslate();
3588
+ if (swiper.params.autoHeight) {
3589
+ swiper.updateAutoHeight();
3590
+ }
3591
+ } else {
3592
+ if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
3593
+ const slides = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides : swiper.slides;
3594
+ translated = swiper.slideTo(slides.length - 1, 0, false, true);
3595
+ } else {
3596
+ translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
3597
+ }
3598
+ if (!translated) {
3599
+ setTranslate();
3600
+ }
3601
+ }
3602
+ if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
3603
+ swiper.checkOverflow();
3604
+ }
3605
+ swiper.emit('update');
3606
+ }
3607
+ changeDirection(newDirection, needUpdate = true) {
3608
+ const swiper = this;
3609
+ const currentDirection = swiper.params.direction;
3610
+ if (!newDirection) {
3611
+ // eslint-disable-next-line
3612
+ newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
3613
+ }
3614
+ if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
3615
+ return swiper;
3616
+ }
3617
+ swiper.el.classList.remove(`${swiper.params.containerModifierClass}${currentDirection}`);
3618
+ swiper.el.classList.add(`${swiper.params.containerModifierClass}${newDirection}`);
3619
+ swiper.emitContainerClasses();
3620
+ swiper.params.direction = newDirection;
3621
+ swiper.slides.forEach(slideEl => {
3622
+ if (newDirection === 'vertical') {
3623
+ slideEl.style.width = '';
3624
+ } else {
3625
+ slideEl.style.height = '';
3626
+ }
3627
+ });
3628
+ swiper.emit('changeDirection');
3629
+ if (needUpdate) swiper.update();
3630
+ return swiper;
3631
+ }
3632
+ changeLanguageDirection(direction) {
3633
+ const swiper = this;
3634
+ if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return;
3635
+ swiper.rtl = direction === 'rtl';
3636
+ swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl;
3637
+ if (swiper.rtl) {
3638
+ swiper.el.classList.add(`${swiper.params.containerModifierClass}rtl`);
3639
+ swiper.el.dir = 'rtl';
3640
+ } else {
3641
+ swiper.el.classList.remove(`${swiper.params.containerModifierClass}rtl`);
3642
+ swiper.el.dir = 'ltr';
3643
+ }
3644
+ swiper.update();
3645
+ }
3646
+ mount(element) {
3647
+ const swiper = this;
3648
+ if (swiper.mounted) return true;
3649
+
3650
+ // Find el
3651
+ let el = element || swiper.params.el;
3652
+ if (typeof el === 'string') {
3653
+ el = document.querySelector(el);
3654
+ }
3655
+ if (!el) {
3656
+ return false;
3657
+ }
3658
+ el.swiper = swiper;
3659
+ if (el.shadowEl) {
3660
+ swiper.isElement = true;
3661
+ }
3662
+ const getWrapperSelector = () => {
3663
+ return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;
3664
+ };
3665
+ const getWrapper = () => {
3666
+ if (el && el.shadowRoot && el.shadowRoot.querySelector) {
3667
+ const res = el.shadowRoot.querySelector(getWrapperSelector());
3668
+ // Children needs to return slot items
3669
+ return res;
3670
+ }
3671
+ return elementChildren(el, getWrapperSelector())[0];
3672
+ };
3673
+ // Find Wrapper
3674
+ let wrapperEl = getWrapper();
3675
+ if (!wrapperEl && swiper.params.createElements) {
3676
+ wrapperEl = createElement('div', swiper.params.wrapperClass);
3677
+ el.append(wrapperEl);
3678
+ elementChildren(el, `.${swiper.params.slideClass}`).forEach(slideEl => {
3679
+ wrapperEl.append(slideEl);
3680
+ });
3681
+ }
3682
+ Object.assign(swiper, {
3683
+ el,
3684
+ wrapperEl,
3685
+ slidesEl: swiper.isElement ? el : wrapperEl,
3686
+ mounted: true,
3687
+ // RTL
3688
+ rtl: el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl',
3689
+ rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl'),
3690
+ wrongRTL: elementStyle(wrapperEl, 'display') === '-webkit-box'
3691
+ });
3692
+ return true;
3693
+ }
3694
+ init(el) {
3695
+ const swiper = this;
3696
+ if (swiper.initialized) return swiper;
3697
+ const mounted = swiper.mount(el);
3698
+ if (mounted === false) return swiper;
3699
+ swiper.emit('beforeInit');
3700
+
3701
+ // Set breakpoint
3702
+ if (swiper.params.breakpoints) {
3703
+ swiper.setBreakpoint();
3704
+ }
3705
+
3706
+ // Add Classes
3707
+ swiper.addClasses();
3708
+
3709
+ // Update size
3710
+ swiper.updateSize();
3711
+
3712
+ // Update slides
3713
+ swiper.updateSlides();
3714
+ if (swiper.params.watchOverflow) {
3715
+ swiper.checkOverflow();
3716
+ }
3717
+
3718
+ // Set Grab Cursor
3719
+ if (swiper.params.grabCursor && swiper.enabled) {
3720
+ swiper.setGrabCursor();
3721
+ }
3722
+
3723
+ // Slide To Initial Slide
3724
+ if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
3725
+ swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true);
3726
+ } else {
3727
+ swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
3728
+ }
3729
+
3730
+ // Create loop
3731
+ if (swiper.params.loop) {
3732
+ swiper.loopCreate();
3733
+ }
3734
+
3735
+ // Attach events
3736
+ swiper.attachEvents();
3737
+ [...swiper.el.querySelectorAll('[loading="lazy"]')].forEach(imageEl => {
3738
+ if (imageEl.complete) {
3739
+ processLazyPreloader(swiper, imageEl);
3740
+ } else {
3741
+ imageEl.addEventListener('load', e => {
3742
+ processLazyPreloader(swiper, e.target);
3743
+ });
3744
+ }
3745
+ });
3746
+ preload(swiper);
3747
+
3748
+ // Init Flag
3749
+ swiper.initialized = true;
3750
+ preload(swiper);
3751
+
3752
+ // Emit
3753
+ swiper.emit('init');
3754
+ swiper.emit('afterInit');
3755
+ return swiper;
3756
+ }
3757
+ destroy(deleteInstance = true, cleanStyles = true) {
3758
+ const swiper = this;
3759
+ const {
3760
+ params,
3761
+ el,
3762
+ wrapperEl,
3763
+ slides
3764
+ } = swiper;
3765
+ if (typeof swiper.params === 'undefined' || swiper.destroyed) {
3766
+ return null;
3767
+ }
3768
+ swiper.emit('beforeDestroy');
3769
+
3770
+ // Init Flag
3771
+ swiper.initialized = false;
3772
+
3773
+ // Detach events
3774
+ swiper.detachEvents();
3775
+
3776
+ // Destroy loop
3777
+ if (params.loop) {
3778
+ swiper.loopDestroy();
3779
+ }
3780
+
3781
+ // Cleanup styles
3782
+ if (cleanStyles) {
3783
+ swiper.removeClasses();
3784
+ el.removeAttribute('style');
3785
+ wrapperEl.removeAttribute('style');
3786
+ if (slides && slides.length) {
3787
+ slides.forEach(slideEl => {
3788
+ slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
3789
+ slideEl.removeAttribute('style');
3790
+ slideEl.removeAttribute('data-swiper-slide-index');
3791
+ });
3792
+ }
3793
+ }
3794
+ swiper.emit('destroy');
3795
+
3796
+ // Detach emitter events
3797
+ Object.keys(swiper.eventsListeners).forEach(eventName => {
3798
+ swiper.off(eventName);
3799
+ });
3800
+ if (deleteInstance !== false) {
3801
+ swiper.el.swiper = null;
3802
+ deleteProps(swiper);
3803
+ }
3804
+ swiper.destroyed = true;
3805
+ return null;
3806
+ }
3807
+ static extendDefaults(newDefaults) {
3808
+ extend(extendedDefaults, newDefaults);
3809
+ }
3810
+ static get extendedDefaults() {
3811
+ return extendedDefaults;
3812
+ }
3813
+ static get defaults() {
3814
+ return defaults;
3815
+ }
3816
+ static installModule(mod) {
3817
+ if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];
3818
+ const modules = Swiper.prototype.__modules__;
3819
+ if (typeof mod === 'function' && modules.indexOf(mod) < 0) {
3820
+ modules.push(mod);
3821
+ }
3822
+ }
3823
+ static use(module) {
3824
+ if (Array.isArray(module)) {
3825
+ module.forEach(m => Swiper.installModule(m));
3826
+ return Swiper;
3827
+ }
3828
+ Swiper.installModule(module);
3829
+ return Swiper;
3830
+ }
3831
+ }
3832
+ Object.keys(prototypes).forEach(prototypeGroup => {
3833
+ Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {
3834
+ Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
3835
+ });
3836
+ });
3837
+ Swiper.use([Resize, Observer]);
3838
+
3839
+ function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
3840
+ if (swiper.params.createElements) {
3841
+ Object.keys(checkProps).forEach(key => {
3842
+ if (!params[key] && params.auto === true) {
3843
+ let element = elementChildren(swiper.el, `.${checkProps[key]}`)[0];
3844
+ if (!element) {
3845
+ element = createElement('div', checkProps[key]);
3846
+ element.className = checkProps[key];
3847
+ swiper.el.append(element);
3848
+ }
3849
+ params[key] = element;
3850
+ originalParams[key] = element;
3851
+ }
3852
+ });
3853
+ }
3854
+ return params;
3855
+ }
3856
+
3857
+ function Navigation({
3858
+ swiper,
3859
+ extendParams,
3860
+ on,
3861
+ emit
3862
+ }) {
3863
+ extendParams({
3864
+ navigation: {
3865
+ nextEl: null,
3866
+ prevEl: null,
3867
+ hideOnClick: false,
3868
+ disabledClass: 'swiper-button-disabled',
3869
+ hiddenClass: 'swiper-button-hidden',
3870
+ lockClass: 'swiper-button-lock',
3871
+ navigationDisabledClass: 'swiper-navigation-disabled'
3872
+ }
3873
+ });
3874
+ swiper.navigation = {
3875
+ nextEl: null,
3876
+ prevEl: null
3877
+ };
3878
+ const makeElementsArray = el => {
3879
+ if (!Array.isArray(el)) el = [el].filter(e => !!e);
3880
+ return el;
3881
+ };
3882
+ function getEl(el) {
3883
+ let res;
3884
+ if (el && typeof el === 'string' && swiper.isElement) {
3885
+ res = swiper.el.shadowRoot.querySelector(el);
3886
+ if (res) return res;
3887
+ }
3888
+ if (el) {
3889
+ if (typeof el === 'string') res = [...document.querySelectorAll(el)];
3890
+ if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
3891
+ res = swiper.el.querySelector(el);
3892
+ }
3893
+ }
3894
+ if (el && !res) return el;
3895
+ // if (Array.isArray(res) && res.length === 1) res = res[0];
3896
+ return res;
3897
+ }
3898
+ function toggleEl(el, disabled) {
3899
+ const params = swiper.params.navigation;
3900
+ el = makeElementsArray(el);
3901
+ el.forEach(subEl => {
3902
+ if (subEl) {
3903
+ subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
3904
+ if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
3905
+ if (swiper.params.watchOverflow && swiper.enabled) {
3906
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
3907
+ }
3908
+ }
3909
+ });
3910
+ }
3911
+ function update() {
3912
+ // Update Navigation Buttons
3913
+ const {
3914
+ nextEl,
3915
+ prevEl
3916
+ } = swiper.navigation;
3917
+ if (swiper.params.loop) {
3918
+ toggleEl(prevEl, false);
3919
+ toggleEl(nextEl, false);
3920
+ return;
3921
+ }
3922
+ toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
3923
+ toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
3924
+ }
3925
+ function onPrevClick(e) {
3926
+ e.preventDefault();
3927
+ if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
3928
+ swiper.slidePrev();
3929
+ emit('navigationPrev');
3930
+ }
3931
+ function onNextClick(e) {
3932
+ e.preventDefault();
3933
+ if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
3934
+ swiper.slideNext();
3935
+ emit('navigationNext');
3936
+ }
3937
+ function init() {
3938
+ const params = swiper.params.navigation;
3939
+ swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
3940
+ nextEl: 'swiper-button-next',
3941
+ prevEl: 'swiper-button-prev'
3942
+ });
3943
+ if (!(params.nextEl || params.prevEl)) return;
3944
+ let nextEl = getEl(params.nextEl);
3945
+ let prevEl = getEl(params.prevEl);
3946
+ Object.assign(swiper.navigation, {
3947
+ nextEl,
3948
+ prevEl
3949
+ });
3950
+ nextEl = makeElementsArray(nextEl);
3951
+ prevEl = makeElementsArray(prevEl);
3952
+ const initButton = (el, dir) => {
3953
+ if (el) {
3954
+ el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
3955
+ }
3956
+ if (!swiper.enabled && el) {
3957
+ el.classList.add(...params.lockClass.split(' '));
3958
+ }
3959
+ };
3960
+ nextEl.forEach(el => initButton(el, 'next'));
3961
+ prevEl.forEach(el => initButton(el, 'prev'));
3962
+ }
3963
+ function destroy() {
3964
+ let {
3965
+ nextEl,
3966
+ prevEl
3967
+ } = swiper.navigation;
3968
+ nextEl = makeElementsArray(nextEl);
3969
+ prevEl = makeElementsArray(prevEl);
3970
+ const destroyButton = (el, dir) => {
3971
+ el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
3972
+ el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
3973
+ };
3974
+ nextEl.forEach(el => destroyButton(el, 'next'));
3975
+ prevEl.forEach(el => destroyButton(el, 'prev'));
3976
+ }
3977
+ on('init', () => {
3978
+ if (swiper.params.navigation.enabled === false) {
3979
+ // eslint-disable-next-line
3980
+ disable();
3981
+ } else {
3982
+ init();
3983
+ update();
3984
+ }
3985
+ });
3986
+ on('toEdge fromEdge lock unlock', () => {
3987
+ update();
3988
+ });
3989
+ on('destroy', () => {
3990
+ destroy();
3991
+ });
3992
+ on('enable disable', () => {
3993
+ let {
3994
+ nextEl,
3995
+ prevEl
3996
+ } = swiper.navigation;
3997
+ nextEl = makeElementsArray(nextEl);
3998
+ prevEl = makeElementsArray(prevEl);
3999
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.navigation.lockClass));
4000
+ });
4001
+ on('click', (_s, e) => {
4002
+ let {
4003
+ nextEl,
4004
+ prevEl
4005
+ } = swiper.navigation;
4006
+ nextEl = makeElementsArray(nextEl);
4007
+ prevEl = makeElementsArray(prevEl);
4008
+ const targetEl = e.target;
4009
+ if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) {
4010
+ if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
4011
+ let isHidden;
4012
+ if (nextEl.length) {
4013
+ isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
4014
+ } else if (prevEl.length) {
4015
+ isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
4016
+ }
4017
+ if (isHidden === true) {
4018
+ emit('navigationShow');
4019
+ } else {
4020
+ emit('navigationHide');
4021
+ }
4022
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
4023
+ }
4024
+ });
4025
+ const enable = () => {
4026
+ swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
4027
+ init();
4028
+ update();
4029
+ };
4030
+ const disable = () => {
4031
+ swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
4032
+ destroy();
4033
+ };
4034
+ Object.assign(swiper.navigation, {
4035
+ enable,
4036
+ disable,
4037
+ update,
4038
+ init,
4039
+ destroy
4040
+ });
4041
+ }
4042
+
4043
+ function classesToSelector(classes = '') {
4044
+ return `.${classes.trim().replace(/([\.:!+\/])/g, '\\$1') // eslint-disable-line
4045
+ .replace(/ /g, '.')}`;
4046
+ }
4047
+
4048
+ function Pagination({
4049
+ swiper,
4050
+ extendParams,
4051
+ on,
4052
+ emit
4053
+ }) {
4054
+ const pfx = 'swiper-pagination';
4055
+ extendParams({
4056
+ pagination: {
4057
+ el: null,
4058
+ bulletElement: 'span',
4059
+ clickable: false,
4060
+ hideOnClick: false,
4061
+ renderBullet: null,
4062
+ renderProgressbar: null,
4063
+ renderFraction: null,
4064
+ renderCustom: null,
4065
+ progressbarOpposite: false,
4066
+ type: 'bullets',
4067
+ // 'bullets' or 'progressbar' or 'fraction' or 'custom'
4068
+ dynamicBullets: false,
4069
+ dynamicMainBullets: 1,
4070
+ formatFractionCurrent: number => number,
4071
+ formatFractionTotal: number => number,
4072
+ bulletClass: `${pfx}-bullet`,
4073
+ bulletActiveClass: `${pfx}-bullet-active`,
4074
+ modifierClass: `${pfx}-`,
4075
+ currentClass: `${pfx}-current`,
4076
+ totalClass: `${pfx}-total`,
4077
+ hiddenClass: `${pfx}-hidden`,
4078
+ progressbarFillClass: `${pfx}-progressbar-fill`,
4079
+ progressbarOppositeClass: `${pfx}-progressbar-opposite`,
4080
+ clickableClass: `${pfx}-clickable`,
4081
+ lockClass: `${pfx}-lock`,
4082
+ horizontalClass: `${pfx}-horizontal`,
4083
+ verticalClass: `${pfx}-vertical`,
4084
+ paginationDisabledClass: `${pfx}-disabled`
4085
+ }
4086
+ });
4087
+ swiper.pagination = {
4088
+ el: null,
4089
+ bullets: []
4090
+ };
4091
+ let bulletSize;
4092
+ let dynamicBulletIndex = 0;
4093
+ const makeElementsArray = el => {
4094
+ if (!Array.isArray(el)) el = [el].filter(e => !!e);
4095
+ return el;
4096
+ };
4097
+ function isPaginationDisabled() {
4098
+ return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0;
4099
+ }
4100
+ function setSideBullets(bulletEl, position) {
4101
+ const {
4102
+ bulletActiveClass
4103
+ } = swiper.params.pagination;
4104
+ if (!bulletEl) return;
4105
+ bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
4106
+ if (bulletEl) {
4107
+ bulletEl.classList.add(`${bulletActiveClass}-${position}`);
4108
+ bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
4109
+ if (bulletEl) {
4110
+ bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);
4111
+ }
4112
+ }
4113
+ }
4114
+ function onBulletClick(e) {
4115
+ const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
4116
+ if (!bulletEl) {
4117
+ return;
4118
+ }
4119
+ e.preventDefault();
4120
+ const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
4121
+ if (swiper.params.loop) {
4122
+ if (swiper.realIndex === index) return;
4123
+ const newSlideIndex = swiper.getSlideIndexByData(index);
4124
+ const currentSlideIndex = swiper.getSlideIndexByData(swiper.realIndex);
4125
+ if (newSlideIndex > swiper.slides.length - swiper.loopedSlides) {
4126
+ swiper.loopFix({
4127
+ direction: newSlideIndex > currentSlideIndex ? 'next' : 'prev',
4128
+ activeSlideIndex: newSlideIndex,
4129
+ slideTo: false
4130
+ });
4131
+ }
4132
+ swiper.slideToLoop(index);
4133
+ } else {
4134
+ swiper.slideTo(index);
4135
+ }
4136
+ }
4137
+ function update() {
4138
+ // Render || Update Pagination bullets/items
4139
+ const rtl = swiper.rtl;
4140
+ const params = swiper.params.pagination;
4141
+ if (isPaginationDisabled()) return;
4142
+ let el = swiper.pagination.el;
4143
+ el = makeElementsArray(el);
4144
+ // Current/Total
4145
+ let current;
4146
+ let previousIndex;
4147
+ const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
4148
+ const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
4149
+ if (swiper.params.loop) {
4150
+ previousIndex = swiper.previousRealIndex || 0;
4151
+ current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;
4152
+ } else if (typeof swiper.snapIndex !== 'undefined') {
4153
+ current = swiper.snapIndex;
4154
+ previousIndex = swiper.previousSnapIndex;
4155
+ } else {
4156
+ previousIndex = swiper.previousIndex || 0;
4157
+ current = swiper.activeIndex || 0;
4158
+ }
4159
+ // Types
4160
+ if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
4161
+ const bullets = swiper.pagination.bullets;
4162
+ let firstIndex;
4163
+ let lastIndex;
4164
+ let midIndex;
4165
+ if (params.dynamicBullets) {
4166
+ bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true);
4167
+ el.forEach(subEl => {
4168
+ subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;
4169
+ });
4170
+ if (params.dynamicMainBullets > 1 && previousIndex !== undefined) {
4171
+ dynamicBulletIndex += current - (previousIndex || 0);
4172
+ if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
4173
+ dynamicBulletIndex = params.dynamicMainBullets - 1;
4174
+ } else if (dynamicBulletIndex < 0) {
4175
+ dynamicBulletIndex = 0;
4176
+ }
4177
+ }
4178
+ firstIndex = Math.max(current - dynamicBulletIndex, 0);
4179
+ lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
4180
+ midIndex = (lastIndex + firstIndex) / 2;
4181
+ }
4182
+ bullets.forEach(bulletEl => {
4183
+ 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();
4184
+ bulletEl.classList.remove(...classesToRemove);
4185
+ });
4186
+ if (el.length > 1) {
4187
+ bullets.forEach(bullet => {
4188
+ const bulletIndex = elementIndex(bullet);
4189
+ if (bulletIndex === current) {
4190
+ bullet.classList.add(...params.bulletActiveClass.split(' '));
4191
+ }
4192
+ if (params.dynamicBullets) {
4193
+ if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
4194
+ bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));
4195
+ }
4196
+ if (bulletIndex === firstIndex) {
4197
+ setSideBullets(bullet, 'prev');
4198
+ }
4199
+ if (bulletIndex === lastIndex) {
4200
+ setSideBullets(bullet, 'next');
4201
+ }
4202
+ }
4203
+ });
4204
+ } else {
4205
+ const bullet = bullets[current];
4206
+ if (bullet) {
4207
+ bullet.classList.add(...params.bulletActiveClass.split(' '));
4208
+ }
4209
+ if (params.dynamicBullets) {
4210
+ const firstDisplayedBullet = bullets[firstIndex];
4211
+ const lastDisplayedBullet = bullets[lastIndex];
4212
+ for (let i = firstIndex; i <= lastIndex; i += 1) {
4213
+ if (bullets[i]) {
4214
+ bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));
4215
+ }
4216
+ }
4217
+ setSideBullets(firstDisplayedBullet, 'prev');
4218
+ setSideBullets(lastDisplayedBullet, 'next');
4219
+ }
4220
+ }
4221
+ if (params.dynamicBullets) {
4222
+ const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
4223
+ const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
4224
+ const offsetProp = rtl ? 'right' : 'left';
4225
+ bullets.forEach(bullet => {
4226
+ bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;
4227
+ });
4228
+ }
4229
+ }
4230
+ el.forEach((subEl, subElIndex) => {
4231
+ if (params.type === 'fraction') {
4232
+ subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => {
4233
+ fractionEl.textContent = params.formatFractionCurrent(current + 1);
4234
+ });
4235
+ subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => {
4236
+ totalEl.textContent = params.formatFractionTotal(total);
4237
+ });
4238
+ }
4239
+ if (params.type === 'progressbar') {
4240
+ let progressbarDirection;
4241
+ if (params.progressbarOpposite) {
4242
+ progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
4243
+ } else {
4244
+ progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
4245
+ }
4246
+ const scale = (current + 1) / total;
4247
+ let scaleX = 1;
4248
+ let scaleY = 1;
4249
+ if (progressbarDirection === 'horizontal') {
4250
+ scaleX = scale;
4251
+ } else {
4252
+ scaleY = scale;
4253
+ }
4254
+ subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => {
4255
+ progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;
4256
+ progressEl.style.transitionDuration = `${swiper.params.speed}ms`;
4257
+ });
4258
+ }
4259
+ if (params.type === 'custom' && params.renderCustom) {
4260
+ subEl.innerHTML = params.renderCustom(swiper, current + 1, total);
4261
+ if (subElIndex === 0) emit('paginationRender', subEl);
4262
+ } else {
4263
+ if (subElIndex === 0) emit('paginationRender', subEl);
4264
+ emit('paginationUpdate', subEl);
4265
+ }
4266
+ if (swiper.params.watchOverflow && swiper.enabled) {
4267
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
4268
+ }
4269
+ });
4270
+ }
4271
+ function render() {
4272
+ // Render Container
4273
+ const params = swiper.params.pagination;
4274
+ if (isPaginationDisabled()) return;
4275
+ const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
4276
+ let el = swiper.pagination.el;
4277
+ el = makeElementsArray(el);
4278
+ let paginationHTML = '';
4279
+ if (params.type === 'bullets') {
4280
+ let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
4281
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {
4282
+ numberOfBullets = slidesLength;
4283
+ }
4284
+ for (let i = 0; i < numberOfBullets; i += 1) {
4285
+ if (params.renderBullet) {
4286
+ paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
4287
+ } else {
4288
+ paginationHTML += `<${params.bulletElement} class="${params.bulletClass}"></${params.bulletElement}>`;
4289
+ }
4290
+ }
4291
+ }
4292
+ if (params.type === 'fraction') {
4293
+ if (params.renderFraction) {
4294
+ paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
4295
+ } else {
4296
+ paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
4297
+ }
4298
+ }
4299
+ if (params.type === 'progressbar') {
4300
+ if (params.renderProgressbar) {
4301
+ paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
4302
+ } else {
4303
+ paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
4304
+ }
4305
+ }
4306
+ swiper.pagination.bullets = [];
4307
+ el.forEach(subEl => {
4308
+ if (params.type !== 'custom') {
4309
+ subEl.innerHTML = paginationHTML || '';
4310
+ }
4311
+ if (params.type === 'bullets') {
4312
+ swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass)));
4313
+ }
4314
+ });
4315
+ if (params.type !== 'custom') {
4316
+ emit('paginationRender', el[0]);
4317
+ }
4318
+ }
4319
+ function init() {
4320
+ swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, {
4321
+ el: 'swiper-pagination'
4322
+ });
4323
+ const params = swiper.params.pagination;
4324
+ if (!params.el) return;
4325
+ let el;
4326
+ if (typeof params.el === 'string' && swiper.isElement) {
4327
+ el = swiper.el.shadowRoot.querySelector(params.el);
4328
+ }
4329
+ if (!el && typeof params.el === 'string') {
4330
+ el = [...document.querySelectorAll(params.el)];
4331
+ }
4332
+ if (!el) {
4333
+ el = params.el;
4334
+ }
4335
+ if (!el || el.length === 0) return;
4336
+ if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {
4337
+ el = [...swiper.el.querySelectorAll(params.el)];
4338
+ // check if it belongs to another nested Swiper
4339
+ if (el.length > 1) {
4340
+ el = el.filter(subEl => {
4341
+ if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false;
4342
+ return true;
4343
+ })[0];
4344
+ }
4345
+ }
4346
+ if (Array.isArray(el) && el.length === 1) el = el[0];
4347
+ Object.assign(swiper.pagination, {
4348
+ el
4349
+ });
4350
+ el = makeElementsArray(el);
4351
+ el.forEach(subEl => {
4352
+ if (params.type === 'bullets' && params.clickable) {
4353
+ subEl.classList.add(params.clickableClass);
4354
+ }
4355
+ subEl.classList.add(params.modifierClass + params.type);
4356
+ subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
4357
+ if (params.type === 'bullets' && params.dynamicBullets) {
4358
+ subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);
4359
+ dynamicBulletIndex = 0;
4360
+ if (params.dynamicMainBullets < 1) {
4361
+ params.dynamicMainBullets = 1;
4362
+ }
4363
+ }
4364
+ if (params.type === 'progressbar' && params.progressbarOpposite) {
4365
+ subEl.classList.add(params.progressbarOppositeClass);
4366
+ }
4367
+ if (params.clickable) {
4368
+ subEl.addEventListener('click', onBulletClick);
4369
+ }
4370
+ if (!swiper.enabled) {
4371
+ subEl.classList.add(params.lockClass);
4372
+ }
4373
+ });
4374
+ }
4375
+ function destroy() {
4376
+ const params = swiper.params.pagination;
4377
+ if (isPaginationDisabled()) return;
4378
+ let el = swiper.pagination.el;
4379
+ if (el) {
4380
+ el = makeElementsArray(el);
4381
+ el.forEach(subEl => {
4382
+ subEl.classList.remove(params.hiddenClass);
4383
+ subEl.classList.remove(params.modifierClass + params.type);
4384
+ subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
4385
+ if (params.clickable) {
4386
+ subEl.removeEventListener('click', onBulletClick);
4387
+ }
4388
+ });
4389
+ }
4390
+ if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));
4391
+ }
4392
+ on('changeDirection', () => {
4393
+ if (!swiper.pagination || !swiper.pagination.el) return;
4394
+ const params = swiper.params.pagination;
4395
+ let {
4396
+ el
4397
+ } = swiper.pagination;
4398
+ el = makeElementsArray(el);
4399
+ el.forEach(subEl => {
4400
+ subEl.classList.remove(params.horizontalClass, params.verticalClass);
4401
+ subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
4402
+ });
4403
+ });
4404
+ on('init', () => {
4405
+ if (swiper.params.pagination.enabled === false) {
4406
+ // eslint-disable-next-line
4407
+ disable();
4408
+ } else {
4409
+ init();
4410
+ render();
4411
+ update();
4412
+ }
4413
+ });
4414
+ on('activeIndexChange', () => {
4415
+ if (typeof swiper.snapIndex === 'undefined') {
4416
+ update();
4417
+ }
4418
+ });
4419
+ on('snapIndexChange', () => {
4420
+ update();
4421
+ });
4422
+ on('snapGridLengthChange', () => {
4423
+ render();
4424
+ update();
4425
+ });
4426
+ on('destroy', () => {
4427
+ destroy();
4428
+ });
4429
+ on('enable disable', () => {
4430
+ let {
4431
+ el
4432
+ } = swiper.pagination;
4433
+ if (el) {
4434
+ el = makeElementsArray(el);
4435
+ el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass));
4436
+ }
4437
+ });
4438
+ on('lock unlock', () => {
4439
+ update();
4440
+ });
4441
+ on('click', (_s, e) => {
4442
+ const targetEl = e.target;
4443
+ let {
4444
+ el
4445
+ } = swiper.pagination;
4446
+ if (!Array.isArray(el)) el = [el].filter(element => !!element);
4447
+ if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) {
4448
+ if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
4449
+ const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass);
4450
+ if (isHidden === true) {
4451
+ emit('paginationShow');
4452
+ } else {
4453
+ emit('paginationHide');
4454
+ }
4455
+ el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass));
4456
+ }
4457
+ });
4458
+ const enable = () => {
4459
+ swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass);
4460
+ let {
4461
+ el
4462
+ } = swiper.pagination;
4463
+ if (el) {
4464
+ el = makeElementsArray(el);
4465
+ el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));
4466
+ }
4467
+ init();
4468
+ render();
4469
+ update();
4470
+ };
4471
+ const disable = () => {
4472
+ swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass);
4473
+ let {
4474
+ el
4475
+ } = swiper.pagination;
4476
+ if (el) {
4477
+ el = makeElementsArray(el);
4478
+ el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));
4479
+ }
4480
+ destroy();
4481
+ };
4482
+ Object.assign(swiper.pagination, {
4483
+ enable,
4484
+ disable,
4485
+ render,
4486
+ update,
4487
+ init,
4488
+ destroy
4489
+ });
4490
+ }
4491
+
4492
+ function A11y({
4493
+ swiper,
4494
+ extendParams,
4495
+ on
4496
+ }) {
4497
+ extendParams({
4498
+ a11y: {
4499
+ enabled: true,
4500
+ notificationClass: 'swiper-notification',
4501
+ prevSlideMessage: 'Previous slide',
4502
+ nextSlideMessage: 'Next slide',
4503
+ firstSlideMessage: 'This is the first slide',
4504
+ lastSlideMessage: 'This is the last slide',
4505
+ paginationBulletMessage: 'Go to slide {{index}}',
4506
+ slideLabelMessage: '{{index}} / {{slidesLength}}',
4507
+ containerMessage: null,
4508
+ containerRoleDescriptionMessage: null,
4509
+ itemRoleDescriptionMessage: null,
4510
+ slideRole: 'group',
4511
+ id: null
4512
+ }
4513
+ });
4514
+ swiper.a11y = {
4515
+ clicked: false
4516
+ };
4517
+ let liveRegion = null;
4518
+ function notify(message) {
4519
+ const notification = liveRegion;
4520
+ if (notification.length === 0) return;
4521
+ notification.innerHTML = '';
4522
+ notification.innerHTML = message;
4523
+ }
4524
+ const makeElementsArray = el => {
4525
+ if (!Array.isArray(el)) el = [el].filter(e => !!e);
4526
+ return el;
4527
+ };
4528
+ function getRandomNumber(size = 16) {
4529
+ const randomChar = () => Math.round(16 * Math.random()).toString(16);
4530
+ return 'x'.repeat(size).replace(/x/g, randomChar);
4531
+ }
4532
+ function makeElFocusable(el) {
4533
+ el = makeElementsArray(el);
4534
+ el.forEach(subEl => {
4535
+ subEl.setAttribute('tabIndex', '0');
4536
+ });
4537
+ }
4538
+ function makeElNotFocusable(el) {
4539
+ el = makeElementsArray(el);
4540
+ el.forEach(subEl => {
4541
+ subEl.setAttribute('tabIndex', '-1');
4542
+ });
4543
+ }
4544
+ function addElRole(el, role) {
4545
+ el = makeElementsArray(el);
4546
+ el.forEach(subEl => {
4547
+ subEl.setAttribute('role', role);
4548
+ });
4549
+ }
4550
+ function addElRoleDescription(el, description) {
4551
+ el = makeElementsArray(el);
4552
+ el.forEach(subEl => {
4553
+ subEl.setAttribute('aria-roledescription', description);
4554
+ });
4555
+ }
4556
+ function addElControls(el, controls) {
4557
+ el = makeElementsArray(el);
4558
+ el.forEach(subEl => {
4559
+ subEl.setAttribute('aria-controls', controls);
4560
+ });
4561
+ }
4562
+ function addElLabel(el, label) {
4563
+ el = makeElementsArray(el);
4564
+ el.forEach(subEl => {
4565
+ subEl.setAttribute('aria-label', label);
4566
+ });
4567
+ }
4568
+ function addElId(el, id) {
4569
+ el = makeElementsArray(el);
4570
+ el.forEach(subEl => {
4571
+ subEl.setAttribute('id', id);
4572
+ });
4573
+ }
4574
+ function addElLive(el, live) {
4575
+ el = makeElementsArray(el);
4576
+ el.forEach(subEl => {
4577
+ subEl.setAttribute('aria-live', live);
4578
+ });
4579
+ }
4580
+ function disableEl(el) {
4581
+ el = makeElementsArray(el);
4582
+ el.forEach(subEl => {
4583
+ subEl.setAttribute('aria-disabled', true);
4584
+ });
4585
+ }
4586
+ function enableEl(el) {
4587
+ el = makeElementsArray(el);
4588
+ el.forEach(subEl => {
4589
+ subEl.setAttribute('aria-disabled', false);
4590
+ });
4591
+ }
4592
+ function onEnterOrSpaceKey(e) {
4593
+ if (e.keyCode !== 13 && e.keyCode !== 32) return;
4594
+ const params = swiper.params.a11y;
4595
+ const targetEl = e.target;
4596
+ if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
4597
+ if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
4598
+ }
4599
+ if (swiper.navigation && swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) {
4600
+ if (!(swiper.isEnd && !swiper.params.loop)) {
4601
+ swiper.slideNext();
4602
+ }
4603
+ if (swiper.isEnd) {
4604
+ notify(params.lastSlideMessage);
4605
+ } else {
4606
+ notify(params.nextSlideMessage);
4607
+ }
4608
+ }
4609
+ if (swiper.navigation && swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl) {
4610
+ if (!(swiper.isBeginning && !swiper.params.loop)) {
4611
+ swiper.slidePrev();
4612
+ }
4613
+ if (swiper.isBeginning) {
4614
+ notify(params.firstSlideMessage);
4615
+ } else {
4616
+ notify(params.prevSlideMessage);
4617
+ }
4618
+ }
4619
+ if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
4620
+ targetEl.click();
4621
+ }
4622
+ }
4623
+ function updateNavigation() {
4624
+ if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
4625
+ const {
4626
+ nextEl,
4627
+ prevEl
4628
+ } = swiper.navigation;
4629
+ if (prevEl) {
4630
+ if (swiper.isBeginning) {
4631
+ disableEl(prevEl);
4632
+ makeElNotFocusable(prevEl);
4633
+ } else {
4634
+ enableEl(prevEl);
4635
+ makeElFocusable(prevEl);
4636
+ }
4637
+ }
4638
+ if (nextEl) {
4639
+ if (swiper.isEnd) {
4640
+ disableEl(nextEl);
4641
+ makeElNotFocusable(nextEl);
4642
+ } else {
4643
+ enableEl(nextEl);
4644
+ makeElFocusable(nextEl);
4645
+ }
4646
+ }
4647
+ }
4648
+ function hasPagination() {
4649
+ return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
4650
+ }
4651
+ function hasClickablePagination() {
4652
+ return hasPagination() && swiper.params.pagination.clickable;
4653
+ }
4654
+ function updatePagination() {
4655
+ const params = swiper.params.a11y;
4656
+ if (!hasPagination()) return;
4657
+ swiper.pagination.bullets.forEach(bulletEl => {
4658
+ if (swiper.params.pagination.clickable) {
4659
+ makeElFocusable(bulletEl);
4660
+ if (!swiper.params.pagination.renderBullet) {
4661
+ addElRole(bulletEl, 'button');
4662
+ addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
4663
+ }
4664
+ }
4665
+ if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
4666
+ bulletEl.setAttribute('aria-current', 'true');
4667
+ } else {
4668
+ bulletEl.removeAttribute('aria-current');
4669
+ }
4670
+ });
4671
+ }
4672
+ const initNavEl = (el, wrapperId, message) => {
4673
+ makeElFocusable(el);
4674
+ if (el.tagName !== 'BUTTON') {
4675
+ addElRole(el, 'button');
4676
+ el.addEventListener('keydown', onEnterOrSpaceKey);
4677
+ }
4678
+ addElLabel(el, message);
4679
+ addElControls(el, wrapperId);
4680
+ };
4681
+ const handlePointerDown = () => {
4682
+ swiper.a11y.clicked = true;
4683
+ };
4684
+ const handlePointerUp = () => {
4685
+ requestAnimationFrame(() => {
4686
+ requestAnimationFrame(() => {
4687
+ if (!swiper.destroyed) {
4688
+ swiper.a11y.clicked = false;
4689
+ }
4690
+ });
4691
+ });
4692
+ };
4693
+ const handleFocus = e => {
4694
+ if (swiper.a11y.clicked) return;
4695
+ const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
4696
+ if (!slideEl || !swiper.slides.includes(slideEl)) return;
4697
+ const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
4698
+ const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
4699
+ if (isActive || isVisible) return;
4700
+ if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
4701
+ if (swiper.isHorizontal()) {
4702
+ swiper.el.scrollLeft = 0;
4703
+ } else {
4704
+ swiper.el.scrollTop = 0;
4705
+ }
4706
+ swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
4707
+ };
4708
+ const initSlides = () => {
4709
+ const params = swiper.params.a11y;
4710
+ if (params.itemRoleDescriptionMessage) {
4711
+ addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
4712
+ }
4713
+ if (params.slideRole) {
4714
+ addElRole(swiper.slides, params.slideRole);
4715
+ }
4716
+ const slidesLength = swiper.slides.length;
4717
+ if (params.slideLabelMessage) {
4718
+ swiper.slides.forEach((slideEl, index) => {
4719
+ const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
4720
+ const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
4721
+ addElLabel(slideEl, ariaLabelMessage);
4722
+ });
4723
+ }
4724
+ };
4725
+ const init = () => {
4726
+ const params = swiper.params.a11y;
4727
+ if (swiper.isElement) {
4728
+ swiper.el.shadowEl.append(liveRegion);
4729
+ } else {
4730
+ swiper.el.append(liveRegion);
4731
+ }
4732
+
4733
+ // Container
4734
+ const containerEl = swiper.el;
4735
+ if (params.containerRoleDescriptionMessage) {
4736
+ addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
4737
+ }
4738
+ if (params.containerMessage) {
4739
+ addElLabel(containerEl, params.containerMessage);
4740
+ }
4741
+
4742
+ // Wrapper
4743
+ const wrapperEl = swiper.wrapperEl;
4744
+ const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
4745
+ const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
4746
+ addElId(wrapperEl, wrapperId);
4747
+ addElLive(wrapperEl, live);
4748
+
4749
+ // Slide
4750
+ initSlides();
4751
+
4752
+ // Navigation
4753
+ let {
4754
+ nextEl,
4755
+ prevEl
4756
+ } = swiper.navigation ? swiper.navigation : {};
4757
+ nextEl = makeElementsArray(nextEl);
4758
+ prevEl = makeElementsArray(prevEl);
4759
+ if (nextEl) {
4760
+ nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
4761
+ }
4762
+ if (prevEl) {
4763
+ prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
4764
+ }
4765
+
4766
+ // Pagination
4767
+ if (hasClickablePagination()) {
4768
+ const paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el];
4769
+ paginationEl.forEach(el => {
4770
+ el.addEventListener('keydown', onEnterOrSpaceKey);
4771
+ });
4772
+ }
4773
+
4774
+ // Tab focus
4775
+ swiper.el.addEventListener('focus', handleFocus, true);
4776
+ swiper.el.addEventListener('pointerdown', handlePointerDown, true);
4777
+ swiper.el.addEventListener('pointerup', handlePointerUp, true);
4778
+ };
4779
+ function destroy() {
4780
+ if (liveRegion) liveRegion.remove();
4781
+ let {
4782
+ nextEl,
4783
+ prevEl
4784
+ } = swiper.navigation ? swiper.navigation : {};
4785
+ nextEl = makeElementsArray(nextEl);
4786
+ prevEl = makeElementsArray(prevEl);
4787
+ if (nextEl) {
4788
+ nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
4789
+ }
4790
+ if (prevEl) {
4791
+ prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
4792
+ }
4793
+
4794
+ // Pagination
4795
+ if (hasClickablePagination()) {
4796
+ const paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el];
4797
+ paginationEl.forEach(el => {
4798
+ el.removeEventListener('keydown', onEnterOrSpaceKey);
4799
+ });
4800
+ }
4801
+
4802
+ // Tab focus
4803
+ swiper.el.removeEventListener('focus', handleFocus, true);
4804
+ swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
4805
+ swiper.el.removeEventListener('pointerup', handlePointerUp, true);
4806
+ }
4807
+ on('beforeInit', () => {
4808
+ liveRegion = createElement('span', swiper.params.a11y.notificationClass);
4809
+ liveRegion.setAttribute('aria-live', 'assertive');
4810
+ liveRegion.setAttribute('aria-atomic', 'true');
4811
+ });
4812
+ on('afterInit', () => {
4813
+ if (!swiper.params.a11y.enabled) return;
4814
+ init();
4815
+ });
4816
+ on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
4817
+ if (!swiper.params.a11y.enabled) return;
4818
+ initSlides();
4819
+ });
4820
+ on('fromEdge toEdge afterInit lock unlock', () => {
4821
+ if (!swiper.params.a11y.enabled) return;
4822
+ updateNavigation();
4823
+ });
4824
+ on('paginationUpdate', () => {
4825
+ if (!swiper.params.a11y.enabled) return;
4826
+ updatePagination();
4827
+ });
4828
+ on('destroy', () => {
4829
+ if (!swiper.params.a11y.enabled) return;
4830
+ destroy();
4831
+ });
4832
+ }
4833
+
4834
+ const hyHeroCarouselCss = "@font-face{font-family:swiper-icons;src:url('data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA');font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper,swiper-container{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px, 0, 0);transform:translate3d(0px, 0, 0)}.swiper-horizontal{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-slide,swiper-slide{-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height, -webkit-transform;transition-property:height, -webkit-transform;transition-property:transform, height;transition-property:transform, height, -webkit-transform}.swiper-backface-hidden .swiper-slide{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{-webkit-perspective:1200px;perspective:1200px}.swiper-3d .swiper-wrapper{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-3d{-webkit-perspective:1200px;perspective:1200px}.swiper-3d .swiper-cube-shadow,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:'';-ms-flex-negative:0;flex-shrink:0;-webkit-box-ordinal-group:10000;-ms-flex-order:9999;order:9999}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-start:var(--swiper-centered-offset-before);margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-before:var(--swiper-centered-offset-before);margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;-webkit-transform-origin:50%;transform-origin:50%;-webkit-box-sizing:border-box;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader,.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,swiper-container:not(.swiper-watch-progress) .swiper-lazy-preloader{-webkit-animation:swiper-preloader-spin 1s infinite linear;animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color:#fff}.swiper-lazy-preloader-black{--swiper-preloader-color:#000}@-webkit-keyframes swiper-preloader-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swiper-preloader-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.swiper-virtual .swiper-slide{-webkit-backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0)}.swiper-virtual.swiper-css-mode .swiper-wrapper::after{content:'';position:absolute;left:0;top:0;pointer-events:none}.swiper-virtual.swiper-css-mode.swiper-horizontal .swiper-wrapper::after{height:1px;width:var(--swiper-virtual-size)}.swiper-virtual.swiper-css-mode.swiper-vertical .swiper-wrapper::after{width:1px;height:var(--swiper-virtual-size)}:root{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{position:absolute;top:var(--swiper-navigation-top-offset, 50%);width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - (var(--swiper-navigation-size) / 2));z-index:10;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-next.swiper-button-hidden,.swiper-button-prev.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-next,.swiper-navigation-disabled .swiper-button-prev{display:none !important}.swiper-button-next:after,.swiper-button-prev:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none !important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:var(--swiper-navigation-sides-offset, 10px);right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:'prev'}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:var(--swiper-navigation-sides-offset, 10px);left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:'next'}.swiper-button-lock{display:none}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:0.3s opacity;transition:0.3s opacity;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none !important}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:var(--swiper-pagination-bottom, 8px);top:var(--swiper-pagination-top, auto);left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transform:scale(0.33);transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{-webkit-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{-webkit-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{-webkit-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{-webkit-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:var(--swiper-pagination-bullet-border-radius, 50%);background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, 0.2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none !important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-pagination-vertical.swiper-pagination-bullets,.swiper-vertical>.swiper-pagination-bullets{right:var(--swiper-pagination-right, 8px);left:var(--swiper-pagination-left, auto);top:50%;-webkit-transform:translate3d(0px, -50%, 0);transform:translate3d(0px, -50%, 0)}.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:8px}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;-webkit-transition:0.2s top, 0.2s -webkit-transform;transition:0.2s top, 0.2s -webkit-transform;transition:0.2s transform, 0.2s top;transition:0.2s transform, 0.2s top, 0.2s -webkit-transform}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:0.2s left, 0.2s -webkit-transform;transition:0.2s left, 0.2s -webkit-transform;transition:0.2s transform, 0.2s left;transition:0.2s transform, 0.2s left, 0.2s -webkit-transform}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,:host(.swiper-horizontal.swiper-rtl) .swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:0.2s right, 0.2s -webkit-transform;transition:0.2s right, 0.2s -webkit-transform;transition:0.2s transform, 0.2s right;transition:0.2s transform, 0.2s right, 0.2s -webkit-transform}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color, inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, 0.25));position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{-webkit-transform-origin:right top;transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:var(--swiper-pagination-progressbar-size, 4px);left:0;top:0}.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-vertical>.swiper-pagination-progressbar{width:var(--swiper-pagination-progressbar-size, 4px);height:100%;left:0;top:0}.swiper-pagination-lock{display:none}.swiper-scrollbar{border-radius:var(--swiper-scrollbar-border-radius, 10px);position:relative;-ms-touch-action:none;background:var(--swiper-scrollbar-bg-color, rgba(0, 0, 0, 0.1))}.swiper-scrollbar-disabled>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-disabled{display:none !important}.swiper-horizontal>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-horizontal{position:absolute;left:var(--swiper-scrollbar-sides-offset, 1%);bottom:var(--swiper-scrollbar-bottom, 4px);top:var(--swiper-scrollbar-top, auto);z-index:50;height:var(--swiper-scrollbar-size, 4px);width:calc(100% - 2 * var(--swiper-scrollbar-sides-offset, 1%))}.swiper-scrollbar.swiper-scrollbar-vertical,.swiper-vertical>.swiper-scrollbar{position:absolute;left:var(--swiper-scrollbar-left, auto);right:var(--swiper-scrollbar-right, 4px);top:var(--swiper-scrollbar-sides-offset, 1%);z-index:50;width:var(--swiper-scrollbar-size, 4px);height:calc(100% - 2 * var(--swiper-scrollbar-sides-offset, 1%))}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:var(--swiper-scrollbar-drag-bg-color, rgba(0, 0, 0, 0.5));border-radius:var(--swiper-scrollbar-border-radius, 10px);left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center}.swiper-zoom-container>canvas,.swiper-zoom-container>img,.swiper-zoom-container>svg{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}.swiper-slide-zoomed{cursor:move;-ms-touch-action:none;touch-action:none}.swiper .swiper-notification,swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-grid>.swiper-wrapper{-ms-flex-wrap:wrap;flex-wrap:wrap}.swiper-grid-column>.swiper-wrapper{-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swiper-fade.swiper-free-mode .swiper-slide{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-fade .swiper-slide{pointer-events:none;-webkit-transition-property:opacity;transition-property:opacity}.swiper-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-fade .swiper-slide-active,.swiper-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-cube{overflow:visible}.swiper-cube .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;-webkit-transform-origin:0 0;transform-origin:0 0;width:100%;height:100%}.swiper-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-cube.swiper-rtl .swiper-slide{-webkit-transform-origin:100% 0;transform-origin:100% 0}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-next,.swiper-cube .swiper-slide-next+.swiper-slide,.swiper-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-cube .swiper-slide-shadow-bottom,.swiper-cube .swiper-slide-shadow-left,.swiper-cube .swiper-slide-shadow-right,.swiper-cube .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;opacity:0.6;z-index:0}.swiper-cube .swiper-cube-shadow:before{content:'';background:#000;position:absolute;left:0;top:0;bottom:0;right:0;-webkit-filter:blur(50px);filter:blur(50px)}.swiper-flip{overflow:visible}.swiper-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-flip .swiper-slide-active,.swiper-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-flip .swiper-slide-shadow-bottom,.swiper-flip .swiper-slide-shadow-left,.swiper-flip .swiper-slide-shadow-right,.swiper-flip .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-creative .swiper-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;-webkit-transition-property:opacity, height, -webkit-transform;transition-property:opacity, height, -webkit-transform;transition-property:transform, opacity, height;transition-property:transform, opacity, height, -webkit-transform}.swiper-cards{overflow:visible}.swiper-cards .swiper-slide{-webkit-transform-origin:center bottom;transform-origin:center bottom;-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden}:root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow-light:#f9a21a;--additional-yellow:#c47f1b;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}:host{display:block}.hero-carousel-container{border-bottom:1px solid var(--grayscale-medium-dark);margin:1.5rem 1rem;--button-size:35px;--button-offset:0px}@media (min-width: 60rem){.hero-carousel-container{border:none;margin:1.5rem 0 0 0;min-height:600px}.hero-carousel-container .swiper{padding:0 10px}}.hero-carousel-container .swiper-button-prev,.hero-carousel-container .swiper-button-next{-webkit-box-align:center;-ms-flex-align:center;align-items:center;aspect-ratio:1;background-color:none;border:none;-webkit-box-shadow:none;box-shadow:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:var(--button-size);z-index:9}@media (min-width: 60rem){.hero-carousel-container .swiper-button-prev,.hero-carousel-container .swiper-button-next{background-color:var(--brand-main-light);width:40px}.hero-carousel-container .swiper-button-prev:hover,.hero-carousel-container .swiper-button-next:hover{background-color:var(--brand-main-active)}}.hero-carousel-container .swiper-button-prev::after,.hero-carousel-container .swiper-button-next::after{display:none}@media (min-width: 60rem){.hero-carousel-container .swiper-button-next{bottom:50%;position:absolute;right:var(--button-offset);-webkit-transform:translateY(-50%);transform:translateY(-50%)}}@media (min-width: 60rem){.hero-carousel-container .swiper-button-prev{bottom:50%;left:var(--button-offset);position:absolute;-webkit-transform:translateY(-50%);transform:translateY(-50%)}}.hero-carousel-container .arrow svg{display:none}@media (min-width: 60rem){.hero-carousel-container .arrow svg{display:block}}.hero-carousel-container .caret svg{display:block}@media (min-width: 60rem){.hero-carousel-container .caret svg{display:none}}.hero-carousel-container svg{fill:var(--grayscale-medium-dark);height:16px;width:16px}@media (min-width: 60rem){.hero-carousel-container svg{fill:var(--grayscale-white)}}.hero-carousel--controls{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:30px 0;position:relative;width:100%}@media (min-width: 60rem){.hero-carousel--controls{display:block;margin:0;position:initial;width:auto}}.hero-carousel--pagination--mobile{bottom:auto !important;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;gap:12px;left:auto !important;position:relative;top:auto !important;width:100px !important}@media (min-width: 60rem){.hero-carousel--pagination--mobile{display:none}}.hero-carousel--controls__buttons{position:relative;margin-right:-15px;width:100px}@media (min-width: 60rem){.hero-carousel--controls__buttons{margin:0;position:initial;width:auto}}.hero-carousel--pagination__bullet{background-color:var(--grayscale-medium);content:\"\";display:block;height:12px;width:12px}.hero-carousel--pagination__bullet--active{background-color:var(--brand-main-active)}.hero-carousel--item__pagination ul{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;display:none;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;list-style-type:none;margin:24px 0 0 0;padding:0}@media (min-width: 60rem){.hero-carousel--item__pagination ul{display:-webkit-box;display:-ms-flexbox;display:flex}}.hero-carousel--item__pagination ul li.hero-carousel--item__pagination__button button{font-size:1.125rem;line-height:24px;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;background:none;border:none;-webkit-box-shadow:none;box-shadow:none;color:var(--grayscale-white);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--main-font-family);font-style:normal;font-weight:700;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;letter-spacing:-0.36px;opacity:0.25;text-align:left}.hero-carousel--item__pagination ul li.hero-carousel--item__pagination__button button:is(:hover,:focus){cursor:pointer;opacity:0.5}.hero-carousel--item__pagination ul li.hero-carousel--item__pagination__button button .hero-carousel--item__pagination__button__theme{font-size:0.875rem;line-height:18px;font-family:var(--main-font-family);font-weight:600;letter-spacing:-0.5px;text-transform:uppercase;text-align:left;margin-bottom:0.4rem}.hero-carousel--item__pagination ul li.hero-carousel--item__pagination__button.is-current button{opacity:1}.hero-carousel--item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}@media (min-width: 60rem){.hero-carousel--item{display:grid;grid-template-columns:1fr 1fr}}.hero-carousel--item__content{background-color:var(--brand-main);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:1rem 0.95rem}@media (min-width: 60rem){.hero-carousel--item__content{padding:clamp(15px, 10%, 72px) clamp(24px, 15%, 102px) clamp(15px, 10%, 65px) clamp(24px, 15%, 102px)}}.hero-carousel--item__content hy-cta-button{margin-bottom:30px}@media (min-width: 60rem){.hero-carousel--item__content hy-cta-button{margin-bottom:60px}}.hero-carousel--item__title{font-size:26px;line-height:32px;color:var(--grayscale-white);font-family:var(--main-font-family);font-weight:700;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;letter-spacing:-0.5px;margin:1rem 0;text-transform:uppercase}@media (min-width: 480px){.hero-carousel--item__title{font-size:calc(\n 26px + 28 * (100vw - 480px) / 1120\n )}}@media (min-width: 1600px){.hero-carousel--item__title{font-size:54px}}@media (min-width: 480px){.hero-carousel--item__title{line-height:calc(\n 32px + 28 * (100vw - 480px) / 1120\n )}}@media (min-width: 1600px){.hero-carousel--item__title{line-height:60px}}.hero-carousel--item__desc{font-size:0.9375rem;line-height:22px;-webkit-box-orient:vertical;-webkit-line-clamp:5;color:var(--grayscale-white);display:-webkit-box;font-family:var(--main-font-family);font-style:normal;line-clamp:3;margin-bottom:2rem;overflow:hidden;text-overflow:ellipsis}@media (min-width: 60rem){.hero-carousel--item__desc{font-size:1.0625rem;line-height:26px;font-weight:400;margin-bottom:2.5rem}}@media (min-width: 60rem){.hero-carousel--item__image{margin:10px 0}}.hero-carousel--item__image img{-o-object-fit:cover;object-fit:cover}";
4835
+
4836
+ const HyHeroCarousel = class {
4837
+ constructor(hostRef) {
4838
+ index.registerInstance(this, hostRef);
4839
+ this.itemCount = undefined;
4840
+ this.ariaLabelNext = 'Next slide';
4841
+ this.ariaLabelPrev = 'Previous slide';
4842
+ this.ariaLabelFirstSlide = 'This is the first slide';
4843
+ this.ariaLabelLastSlide = 'This is the first slide';
4844
+ this.ariaLabelBulletMessage = 'Go to slide';
4845
+ this.data = undefined;
4846
+ }
4847
+ async componentWillLoad() {
4848
+ this._data = await globalScript.jsonParserWorker(this.data);
4849
+ }
4850
+ componentDidLoad() {
4851
+ new Swiper('.swiper', {
4852
+ modules: [Navigation, Pagination, A11y],
4853
+ enabled: true,
4854
+ direction: 'horizontal',
4855
+ loop: true,
4856
+ spaceBetween: 50,
4857
+ navigation: {
4858
+ nextEl: '.swiper-button-next',
4859
+ prevEl: '.swiper-button-prev',
4860
+ },
4861
+ pagination: {
4862
+ el: '.swiper-pagination',
4863
+ bulletClass: 'hero-carousel--pagination__bullet',
4864
+ bulletActiveClass: 'hero-carousel--pagination__bullet--active',
4865
+ clickable: true,
4866
+ renderBullet: function (index, className) {
4867
+ return `<span aria-label="${this.ariaLabelBulletMessage} ${index}" data-index="${index}" class="${className}"></span>`;
4868
+ },
4869
+ },
4870
+ a11y: {
4871
+ enabled: true,
4872
+ firstSlideMessage: this.ariaLabelFirstSlide,
4873
+ lastSlideMessage: this.ariaLabelLastSlide,
4874
+ nextSlideMessage: this.ariaLabelNext,
4875
+ prevSlideMessage: this.ariaLabelPrev,
4876
+ paginationBulletMessage: `${this.ariaLabelBulletMessage} {{index}}`,
4877
+ },
4878
+ });
4879
+ }
4880
+ handleSlideChangeFromButtons(index) {
4881
+ const swiperEl = document.querySelector('.swiper');
4882
+ swiperEl.swiper.slideTo(index, 300, null);
4883
+ }
4884
+ render() {
4885
+ const carouselContentClasses = ['hero-carousel--item__content', this.itemCount > 1 ? 'has-pagination' : ''].join(' ');
4886
+ return (index.h("div", { class: "hero-carousel-container" }, index.h("div", { class: "swiper" }, index.h("div", { class: "swiper-wrapper" }, this._data['items'] &&
4887
+ this._data['items'].map((i, index$1) => {
4888
+ const currentIndex = index$1;
4889
+ const srcSet = JSON.parse(i.image_sources);
4890
+ return (index.h("div", { class: "swiper-slide", "data-title": i.title, "data-desc": i.desc }, index.h("div", { class: "swiper-slide hero-carousel--item" }, index.h("div", { class: carouselContentClasses }, index.h("h2", { class: "hero-carousel--item__title" }, i.title), index.h("div", { class: "hero-carousel--item__desc" }, i.desc), i.uri && (index.h("hy-cta-button", { "link-content": i.uri_title, "sc-label": i.uri_title, url: i.uri, "is-external": "false", variant: utils.CtaLinkButtonVariants.heroBlue })), this.itemCount > 1 ? (index.h("div", { class: "hero-carousel--item__pagination" }, index.h("ul", null, this._data['items'].map((i, index$1) => {
4891
+ const paginationButtonClasses = [
4892
+ 'hero-carousel--item__pagination__button',
4893
+ index$1 === currentIndex ? 'is-current' : '',
4894
+ ].join(' ');
4895
+ return (index.h("li", { class: paginationButtonClasses }, index.h("button", { "aria-label": `${this.ariaLabelBulletMessage} ${index$1}`, onClick: () => this.handleSlideChangeFromButtons(index$1), "data-index": index$1, "aria-current": index$1 === currentIndex ? 'true' : 'false' }, index.h("span", { class: "hero-carousel--item__pagination__button__theme" }, i.theme_text), i.title)));
4896
+ })))) : null), index.h("div", { class: "hero-carousel--item__image" }, srcSet.length > 0 ? (index.h("picture", null, srcSet.map((item) => (index.h("source", { srcSet: item.src, media: item.media, type: item.type, sizes: item.sizes ? item.sizes : '' }))), index.h("img", { "aria-hidden": "true", loading: 'eager', alt: i.image_alt, class: `hy-image__image`, src: i.image_fallback }))) : (index.h("img", { "aria-hidden": "true", loading: 'eager', alt: i.image_alt, class: `hy-image__image`, src: i.image_fallback }))))));
4897
+ })), this.itemCount > 1 ? (index.h("div", { class: "hero-carousel--controls" }, index.h("div", { class: "swiper-pagination hero-carousel--pagination--mobile" }), index.h("div", { class: "hero-carousel--controls__buttons" }, index.h("div", { class: "swiper-button-prev" }, index.h("hy-icon", { class: "arrow", icon: "hy-icon-arrow-left" }), index.h("hy-icon", { class: "caret", icon: "hy-icon-caret-left" })), index.h("div", { class: "swiper-button-next" }, index.h("hy-icon", { class: "arrow", icon: "hy-icon-arrow-right" }), index.h("hy-icon", { class: "caret", icon: "hy-icon-caret-right" }))))) : null)));
4898
+ }
4899
+ };
4900
+ HyHeroCarousel.style = hyHeroCarouselCss;
4901
+
4902
+ exports.hy_hero_carousel = HyHeroCarousel;