@nanoporetech-digital/components 1.15.6 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (981) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/cjs/active-element-2f9bf0aa.js +21 -0
  3. package/dist/cjs/active-element-2f9bf0aa.js.map +1 -0
  4. package/dist/cjs/{algoliasearch.umd-0ccd70ce.js → algoliasearch.umd-79e17a1a.js} +3 -3
  5. package/dist/cjs/{algoliasearch.umd-0ccd70ce.js.map → algoliasearch.umd-79e17a1a.js.map} +1 -1
  6. package/dist/cjs/{dom-5f3fae1a.js → dom-52f9b8b7.js} +25 -6
  7. package/dist/cjs/dom-52f9b8b7.js.map +1 -0
  8. package/dist/cjs/form-control-3bc82e3e.js +80 -0
  9. package/dist/cjs/form-control-3bc82e3e.js.map +1 -0
  10. package/dist/cjs/{index-117f36a4.js → index-53d02e05.js} +12 -27
  11. package/dist/cjs/index-53d02e05.js.map +1 -0
  12. package/dist/cjs/index-cb62df44.js +12 -12
  13. package/dist/cjs/index.cjs.js +3 -3
  14. package/dist/cjs/index.cjs.js.map +1 -1
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/cjs/{modal-01eed1bf.js → modal-f09e431f.js} +2 -2
  17. package/dist/cjs/{modal-01eed1bf.js.map → modal-f09e431f.js.map} +1 -1
  18. package/dist/cjs/nano-accordion.cjs.entry.js +2 -4
  19. package/dist/cjs/nano-accordion.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nano-alert.cjs.entry.js +6 -6
  21. package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nano-algolia-filter.cjs.entry.js +1 -1
  23. package/dist/cjs/nano-algolia-filter.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nano-algolia-input.cjs.entry.js +1 -1
  25. package/dist/cjs/nano-algolia.cjs.entry.js +9 -5
  26. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nano-aspect-ratio.cjs.entry.js +1 -1
  28. package/dist/cjs/nano-aspect-ratio.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nano-checkbox-group.cjs.entry.js +4 -1
  30. package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
  31. package/dist/cjs/nano-checkbox.cjs.entry.js +1 -1
  32. package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
  33. package/dist/cjs/nano-components.cjs.js +1 -1
  34. package/dist/cjs/nano-datalist_3.cjs.entry.js +790 -0
  35. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -0
  36. package/dist/cjs/nano-date-input.cjs.entry.js +9 -5
  37. package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
  38. package/dist/cjs/{nano-date-picker_2.cjs.entry.js → nano-date-picker.cjs.entry.js} +2 -274
  39. package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -0
  40. package/dist/cjs/nano-details.cjs.entry.js +2 -2
  41. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  42. package/dist/cjs/nano-dialog.cjs.entry.js +5 -5
  43. package/dist/cjs/nano-dialog.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nano-drawer.cjs.entry.js +5 -5
  45. package/dist/cjs/nano-drawer.cjs.entry.js.map +1 -1
  46. package/dist/cjs/nano-dropdown.cjs.entry.js +307 -0
  47. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -0
  48. package/dist/cjs/nano-file-upload.cjs.entry.js +1 -1
  49. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  50. package/dist/cjs/nano-global-nav.cjs.entry.js +19 -24
  51. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  52. package/dist/cjs/nano-global-search-results.cjs.entry.js +200 -115
  53. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  54. package/dist/cjs/nano-grid_3.cjs.entry.js +15 -7
  55. package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
  56. package/dist/cjs/nano-hero.cjs.entry.js +13 -5
  57. package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
  58. package/dist/cjs/nano-icon-button.cjs.entry.js +2 -2
  59. package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
  60. package/dist/cjs/nano-icon.cjs.entry.js +1 -1
  61. package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
  62. package/dist/cjs/nano-input.cjs.entry.js +80 -75
  63. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  64. package/dist/cjs/nano-menu-drawer.cjs.entry.js +2 -2
  65. package/dist/cjs/nano-menu-drawer.cjs.entry.js.map +1 -1
  66. package/dist/cjs/nano-nav-item_2.cjs.entry.js +287 -533
  67. package/dist/cjs/nano-nav-item_2.cjs.entry.js.map +1 -1
  68. package/dist/cjs/nano-range.cjs.entry.js +2 -2
  69. package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
  70. package/dist/cjs/nano-rating.cjs.entry.js +2 -2
  71. package/dist/cjs/nano-rating.cjs.entry.js.map +1 -1
  72. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +1 -1
  73. package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
  74. package/dist/cjs/nano-slide.cjs.entry.js +1 -1
  75. package/dist/cjs/nano-slide.cjs.entry.js.map +1 -1
  76. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  77. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  78. package/dist/cjs/nano-spinner.cjs.entry.js +1 -1
  79. package/dist/cjs/nano-spinner.cjs.entry.js.map +1 -1
  80. package/dist/cjs/nano-sticker.cjs.entry.js +3 -3
  81. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  82. package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
  83. package/dist/cjs/nano-tab-content.cjs.entry.js.map +1 -1
  84. package/dist/cjs/nano-tab-group.cjs.entry.js +72 -36
  85. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  86. package/dist/cjs/nano-tab.cjs.entry.js +9 -2
  87. package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
  88. package/dist/cjs/nano-tooltip.cjs.entry.js +2 -2
  89. package/dist/cjs/nano-tooltip.cjs.entry.js.map +1 -1
  90. package/dist/cjs/{popover-d033efa2.js → popover-86f1775c.js} +10 -1
  91. package/dist/cjs/popover-86f1775c.js.map +1 -0
  92. package/dist/cjs/{scroll-d7753eed.js → scroll-6b9e6870.js} +2 -2
  93. package/dist/cjs/{scroll-d7753eed.js.map → scroll-6b9e6870.js.map} +1 -1
  94. package/dist/cjs/{tabbable-615c30e1.js → tabbable-de4c23d8.js} +8 -6
  95. package/dist/cjs/tabbable-de4c23d8.js.map +1 -0
  96. package/dist/collection/collection-manifest.json +3 -2
  97. package/dist/collection/components/accordion/accordion.css +3 -0
  98. package/dist/collection/components/accordion/accordion.js +2 -5
  99. package/dist/collection/components/accordion/accordion.js.map +1 -1
  100. package/dist/collection/components/alert/alert.css +5 -6
  101. package/dist/collection/components/alert/alert.helpers.js +2 -2
  102. package/dist/collection/components/alert/alert.helpers.js.map +1 -1
  103. package/dist/collection/components/alert/alert.js +1 -1
  104. package/dist/collection/components/algolia/algolia-filter.css +3 -0
  105. package/dist/collection/components/algolia/algolia-filter.js +2 -2
  106. package/dist/collection/components/algolia/algolia-input.js +5 -5
  107. package/dist/collection/components/algolia/algolia-results.js +1 -1
  108. package/dist/collection/components/algolia/algolia.css +3 -0
  109. package/dist/collection/components/algolia/algolia.js +6 -6
  110. package/dist/collection/components/aspect-ratio/aspect-ratio.css +3 -0
  111. package/dist/collection/components/checkbox/checkbox-group.css +3 -0
  112. package/dist/collection/components/checkbox/checkbox-group.js +5 -2
  113. package/dist/collection/components/checkbox/checkbox-group.js.map +1 -1
  114. package/dist/collection/components/checkbox/checkbox.css +3 -0
  115. package/dist/collection/components/checkbox/checkbox.js +3 -3
  116. package/dist/collection/components/datalist/datalist.css +55 -0
  117. package/dist/collection/components/datalist/datalist.js +796 -0
  118. package/dist/collection/components/datalist/datalist.js.map +1 -0
  119. package/dist/collection/components/date-input/date-input.css +3 -0
  120. package/dist/collection/components/date-input/date-input.js +18 -10
  121. package/dist/collection/components/date-input/date-input.js.map +1 -1
  122. package/dist/collection/components/date-picker/date-picker.css +3 -0
  123. package/dist/collection/components/date-picker/date-picker.js +5 -5
  124. package/dist/collection/components/details/details.css +3 -0
  125. package/dist/collection/components/details/details.js +2 -3
  126. package/dist/collection/components/details/details.js.map +1 -1
  127. package/dist/collection/components/dialog/dialog.css +4 -1
  128. package/dist/collection/components/dialog/dialog.helpers.js.map +1 -1
  129. package/dist/collection/components/dialog/dialog.js +1 -1
  130. package/dist/collection/components/drawer/drawer.css +3 -0
  131. package/dist/collection/components/dropdown/dropdown.css +19 -2
  132. package/dist/collection/components/dropdown/dropdown.js +56 -39
  133. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  134. package/dist/collection/components/file-upload/file-upload.css +5 -2
  135. package/dist/collection/components/file-upload/file-upload.js +4 -4
  136. package/dist/collection/components/form-control/form-control.js +73 -0
  137. package/dist/collection/components/form-control/form-control.js.map +1 -0
  138. package/dist/collection/components/global-nav/global-nav.css +43 -37
  139. package/dist/collection/components/global-nav/global-nav.js +21 -26
  140. package/dist/collection/components/global-nav/global-nav.js.map +1 -1
  141. package/dist/collection/components/global-search-results/global-search-results.css +299 -18
  142. package/dist/collection/components/global-search-results/global-search-results.js +200 -113
  143. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  144. package/dist/collection/components/grid/grid-item.css +3 -0
  145. package/dist/collection/components/grid/grid-item.js +1 -1
  146. package/dist/collection/components/grid/grid.css +3 -0
  147. package/dist/collection/components/grid/grid.js +37 -6
  148. package/dist/collection/components/grid/grid.js.map +1 -1
  149. package/dist/collection/components/hero/hero.css +13 -5
  150. package/dist/collection/components/hero/hero.js +32 -22
  151. package/dist/collection/components/hero/hero.js.map +1 -1
  152. package/dist/collection/components/icon/icon.css +3 -0
  153. package/dist/collection/components/icon/icon.js +1 -1
  154. package/dist/collection/components/icon-button/icon-button.css +6 -1
  155. package/dist/collection/components/icon-button/icon-button.js +1 -1
  156. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  157. package/dist/collection/components/img/img.css +3 -0
  158. package/dist/collection/components/input/input.css +242 -232
  159. package/dist/collection/components/input/input.js +111 -114
  160. package/dist/collection/components/input/input.js.map +1 -1
  161. package/dist/collection/components/menu/menu.css +27 -35
  162. package/dist/collection/components/menu/menu.js +222 -48
  163. package/dist/collection/components/menu/menu.js.map +1 -1
  164. package/dist/collection/components/menu-drawer/menu-drawer.css +3 -0
  165. package/dist/collection/components/nav-item/nav-item.css +3 -0
  166. package/dist/collection/components/nav-item/nav-item.js +5 -5
  167. package/dist/collection/components/nav-item/nav-item.js.map +1 -1
  168. package/dist/collection/components/option/option-interface.js +5 -0
  169. package/dist/collection/components/option/option-interface.js.map +1 -0
  170. package/dist/collection/components/option/option.css +187 -0
  171. package/dist/collection/components/option/option.js +242 -0
  172. package/dist/collection/components/option/option.js.map +1 -0
  173. package/dist/collection/components/range/range.css +3 -0
  174. package/dist/collection/components/range/range.js +4 -4
  175. package/dist/collection/components/rating/rating.css +3 -0
  176. package/dist/collection/components/resize-observe/resize-observe.js +1 -1
  177. package/dist/collection/components/select/select.css +458 -391
  178. package/dist/collection/components/select/select.js +367 -607
  179. package/dist/collection/components/select/select.js.map +1 -1
  180. package/dist/collection/components/skeleton/skeleton.css +3 -0
  181. package/dist/collection/components/slides/slide.css +3 -0
  182. package/dist/collection/components/slides/slides.css +3 -0
  183. package/dist/collection/components/slides/slides.js +7 -7
  184. package/dist/collection/components/spinner/spinner.css +3 -0
  185. package/dist/collection/components/sticky/sticker.css +3 -0
  186. package/dist/collection/components/tabs/tab-content.css +3 -0
  187. package/dist/collection/components/tabs/tab-content.js +3 -3
  188. package/dist/collection/components/tabs/tab-content.js.map +1 -1
  189. package/dist/collection/components/tabs/tab-group.css +16 -5
  190. package/dist/collection/components/tabs/tab-group.js +137 -41
  191. package/dist/collection/components/tabs/tab-group.js.map +1 -1
  192. package/dist/collection/components/tabs/tab.css +36 -6
  193. package/dist/collection/components/tabs/tab.js +45 -2
  194. package/dist/collection/components/tabs/tab.js.map +1 -1
  195. package/dist/collection/components/tooltip/tooltip.css +3 -0
  196. package/dist/collection/utils/active-element.js +16 -0
  197. package/dist/collection/utils/active-element.js.map +1 -0
  198. package/dist/collection/utils/dom.js +24 -5
  199. package/dist/collection/utils/dom.js.map +1 -1
  200. package/dist/collection/utils/index.js +13 -13
  201. package/dist/collection/utils/index.js.map +1 -1
  202. package/dist/collection/utils/popover.js +9 -0
  203. package/dist/collection/utils/popover.js.map +1 -1
  204. package/dist/collection/utils/tabbable.js +7 -5
  205. package/dist/collection/utils/tabbable.js.map +1 -1
  206. package/dist/collection/utils/template.js +5 -1
  207. package/dist/collection/utils/template.js.map +1 -1
  208. package/dist/collection/utils/testing/index.js +11 -1
  209. package/dist/collection/utils/testing/index.js.map +1 -1
  210. package/dist/components/ResizeObserver.es.js +933 -0
  211. package/dist/components/ResizeObserver.es.js.map +1 -0
  212. package/dist/components/_commonjsHelpers.js +41 -0
  213. package/dist/components/_commonjsHelpers.js.map +1 -0
  214. package/dist/components/active-element.js +19 -0
  215. package/dist/components/active-element.js.map +1 -0
  216. package/dist/components/algolia-data.js +49 -0
  217. package/dist/components/algolia-data.js.map +1 -0
  218. package/dist/components/algolia.js +906 -0
  219. package/dist/components/algolia.js.map +1 -0
  220. package/dist/components/algoliasearch.umd.js +13 -0
  221. package/dist/components/algoliasearch.umd.js.map +1 -0
  222. package/dist/components/component-store.js +2234 -0
  223. package/dist/components/component-store.js.map +1 -0
  224. package/dist/components/datalist.js +557 -0
  225. package/dist/components/datalist.js.map +1 -0
  226. package/dist/components/date-picker.js +624 -0
  227. package/dist/components/date-picker.js.map +1 -0
  228. package/dist/{esm/dom-a791b223.js → components/dom.js} +25 -6
  229. package/dist/components/dom.js.map +1 -0
  230. package/dist/components/dropdown.js +332 -0
  231. package/dist/components/dropdown.js.map +1 -0
  232. package/dist/components/focus-visible.js +66 -0
  233. package/dist/components/focus-visible.js.map +1 -0
  234. package/dist/components/form-control.js +77 -0
  235. package/dist/components/form-control.js.map +1 -0
  236. package/dist/components/grid-item.js +112 -0
  237. package/dist/components/grid-item.js.map +1 -0
  238. package/dist/components/grid.js +276 -0
  239. package/dist/components/grid.js.map +1 -0
  240. package/dist/components/icon-button.js +70 -0
  241. package/dist/components/icon-button.js.map +1 -0
  242. package/dist/components/icon.js +269 -0
  243. package/dist/components/icon.js.map +1 -0
  244. package/dist/components/img.js +184 -0
  245. package/dist/components/img.js.map +1 -0
  246. package/dist/components/index.d.ts +26 -0
  247. package/dist/components/index.js +251 -0
  248. package/dist/components/index.js.map +1 -0
  249. package/dist/{esm/index-f41ae118.js → components/index2.js} +13 -27
  250. package/dist/components/index2.js.map +1 -0
  251. package/dist/components/index3.js +1075 -0
  252. package/dist/components/index3.js.map +1 -0
  253. package/dist/components/index4.js +637 -0
  254. package/dist/components/index4.js.map +1 -0
  255. package/dist/components/input.js +474 -0
  256. package/dist/components/input.js.map +1 -0
  257. package/dist/components/intersection-observer.js +985 -0
  258. package/dist/components/intersection-observer.js.map +1 -0
  259. package/dist/components/local-my-account.js +353 -0
  260. package/dist/components/local-my-account.js.map +1 -0
  261. package/dist/components/menu.js +235 -0
  262. package/dist/components/menu.js.map +1 -0
  263. package/dist/components/modal.js +48 -0
  264. package/dist/components/modal.js.map +1 -0
  265. package/dist/components/nano-accordion.d.ts +11 -0
  266. package/dist/components/nano-accordion.js +63 -0
  267. package/dist/components/nano-accordion.js.map +1 -0
  268. package/dist/components/nano-alert.d.ts +11 -0
  269. package/dist/components/nano-alert.js +296 -0
  270. package/dist/components/nano-alert.js.map +1 -0
  271. package/dist/components/nano-algolia-filter.d.ts +11 -0
  272. package/dist/components/nano-algolia-filter.js +317 -0
  273. package/dist/components/nano-algolia-filter.js.map +1 -0
  274. package/dist/components/nano-algolia-input.d.ts +11 -0
  275. package/dist/components/nano-algolia-input.js +224 -0
  276. package/dist/components/nano-algolia-input.js.map +1 -0
  277. package/dist/components/nano-algolia-pagination.d.ts +11 -0
  278. package/dist/components/nano-algolia-pagination.js +104 -0
  279. package/dist/components/nano-algolia-pagination.js.map +1 -0
  280. package/dist/components/nano-algolia-results.d.ts +11 -0
  281. package/dist/components/nano-algolia-results.js +224 -0
  282. package/dist/components/nano-algolia-results.js.map +1 -0
  283. package/dist/components/nano-algolia.d.ts +11 -0
  284. package/dist/components/nano-algolia.js +11 -0
  285. package/dist/components/nano-algolia.js.map +1 -0
  286. package/dist/components/nano-aspect-ratio.d.ts +11 -0
  287. package/dist/components/nano-aspect-ratio.js +74 -0
  288. package/dist/components/nano-aspect-ratio.js.map +1 -0
  289. package/dist/components/nano-checkbox-group.d.ts +11 -0
  290. package/dist/components/nano-checkbox-group.js +235 -0
  291. package/dist/components/nano-checkbox-group.js.map +1 -0
  292. package/dist/components/nano-checkbox.d.ts +11 -0
  293. package/dist/components/nano-checkbox.js +231 -0
  294. package/dist/components/nano-checkbox.js.map +1 -0
  295. package/dist/components/nano-datalist.d.ts +11 -0
  296. package/dist/components/nano-datalist.js +11 -0
  297. package/dist/components/nano-datalist.js.map +1 -0
  298. package/dist/components/nano-date-input.d.ts +11 -0
  299. package/dist/components/nano-date-input.js +408 -0
  300. package/dist/components/nano-date-input.js.map +1 -0
  301. package/dist/components/nano-date-picker.d.ts +11 -0
  302. package/dist/components/nano-date-picker.js +11 -0
  303. package/dist/components/nano-date-picker.js.map +1 -0
  304. package/dist/components/nano-details.d.ts +11 -0
  305. package/dist/components/nano-details.js +162 -0
  306. package/dist/components/nano-details.js.map +1 -0
  307. package/dist/components/nano-dialog.d.ts +11 -0
  308. package/dist/components/nano-dialog.js +231 -0
  309. package/dist/components/nano-dialog.js.map +1 -0
  310. package/dist/components/nano-drawer.d.ts +11 -0
  311. package/dist/components/nano-drawer.js +217 -0
  312. package/dist/components/nano-drawer.js.map +1 -0
  313. package/dist/components/nano-dropdown.d.ts +11 -0
  314. package/dist/components/nano-dropdown.js +11 -0
  315. package/dist/components/nano-dropdown.js.map +1 -0
  316. package/dist/components/nano-file-upload.d.ts +11 -0
  317. package/dist/components/nano-file-upload.js +421 -0
  318. package/dist/components/nano-file-upload.js.map +1 -0
  319. package/dist/components/nano-global-nav.d.ts +11 -0
  320. package/dist/components/nano-global-nav.js +1221 -0
  321. package/dist/components/nano-global-nav.js.map +1 -0
  322. package/dist/components/nano-global-search-results.d.ts +11 -0
  323. package/dist/components/nano-global-search-results.js +608 -0
  324. package/dist/components/nano-global-search-results.js.map +1 -0
  325. package/dist/components/nano-grid-item.d.ts +11 -0
  326. package/dist/components/nano-grid-item.js +11 -0
  327. package/dist/components/nano-grid-item.js.map +1 -0
  328. package/dist/components/nano-grid.d.ts +11 -0
  329. package/dist/components/nano-grid.js +11 -0
  330. package/dist/components/nano-grid.js.map +1 -0
  331. package/dist/components/nano-hero.d.ts +11 -0
  332. package/dist/components/nano-hero.js +187 -0
  333. package/dist/components/nano-hero.js.map +1 -0
  334. package/dist/components/nano-icon-button.d.ts +11 -0
  335. package/dist/components/nano-icon-button.js +11 -0
  336. package/dist/components/nano-icon-button.js.map +1 -0
  337. package/dist/components/nano-icon.d.ts +11 -0
  338. package/dist/components/nano-icon.js +11 -0
  339. package/dist/components/nano-icon.js.map +1 -0
  340. package/dist/components/nano-img.d.ts +11 -0
  341. package/dist/components/nano-img.js +11 -0
  342. package/dist/components/nano-img.js.map +1 -0
  343. package/dist/components/nano-input.d.ts +11 -0
  344. package/dist/components/nano-input.js +11 -0
  345. package/dist/components/nano-input.js.map +1 -0
  346. package/dist/components/nano-menu-drawer.d.ts +11 -0
  347. package/dist/components/nano-menu-drawer.js +221 -0
  348. package/dist/components/nano-menu-drawer.js.map +1 -0
  349. package/dist/components/nano-menu.d.ts +11 -0
  350. package/dist/components/nano-menu.js +11 -0
  351. package/dist/components/nano-menu.js.map +1 -0
  352. package/dist/components/nano-nav-item.d.ts +11 -0
  353. package/dist/components/nano-nav-item.js +11 -0
  354. package/dist/components/nano-nav-item.js.map +1 -0
  355. package/dist/components/nano-option.d.ts +11 -0
  356. package/dist/components/nano-option.js +11 -0
  357. package/dist/components/nano-option.js.map +1 -0
  358. package/dist/components/nano-range.d.ts +11 -0
  359. package/dist/components/nano-range.js +430 -0
  360. package/dist/components/nano-range.js.map +1 -0
  361. package/dist/components/nano-rating.d.ts +11 -0
  362. package/dist/components/nano-rating.js +240 -0
  363. package/dist/components/nano-rating.js.map +1 -0
  364. package/dist/components/nano-resize-observe.d.ts +11 -0
  365. package/dist/components/nano-resize-observe.js +11 -0
  366. package/dist/components/nano-resize-observe.js.map +1 -0
  367. package/dist/components/nano-select.d.ts +11 -0
  368. package/dist/components/nano-select.js +11 -0
  369. package/dist/components/nano-select.js.map +1 -0
  370. package/dist/components/nano-skeleton.d.ts +11 -0
  371. package/dist/components/nano-skeleton.js +11 -0
  372. package/dist/components/nano-skeleton.js.map +1 -0
  373. package/dist/components/nano-slide.d.ts +11 -0
  374. package/dist/components/nano-slide.js +66 -0
  375. package/dist/components/nano-slide.js.map +1 -0
  376. package/dist/components/nano-slides.d.ts +11 -0
  377. package/dist/components/nano-slides.js +4335 -0
  378. package/dist/components/nano-slides.js.map +1 -0
  379. package/dist/components/nano-spinner.d.ts +11 -0
  380. package/dist/components/nano-spinner.js +11 -0
  381. package/dist/components/nano-spinner.js.map +1 -0
  382. package/dist/components/nano-sticker.d.ts +11 -0
  383. package/dist/components/nano-sticker.js +11 -0
  384. package/dist/components/nano-sticker.js.map +1 -0
  385. package/dist/components/nano-tab-content.d.ts +11 -0
  386. package/dist/components/nano-tab-content.js +49 -0
  387. package/dist/components/nano-tab-content.js.map +1 -0
  388. package/dist/components/nano-tab-group.d.ts +11 -0
  389. package/dist/components/nano-tab-group.js +460 -0
  390. package/dist/components/nano-tab-group.js.map +1 -0
  391. package/dist/components/nano-tab.d.ts +11 -0
  392. package/dist/components/nano-tab.js +86 -0
  393. package/dist/components/nano-tab.js.map +1 -0
  394. package/dist/components/nano-tooltip.d.ts +11 -0
  395. package/dist/components/nano-tooltip.js +11 -0
  396. package/dist/components/nano-tooltip.js.map +1 -0
  397. package/dist/components/nav-item.js +327 -0
  398. package/dist/components/nav-item.js.map +1 -0
  399. package/dist/components/option.js +120 -0
  400. package/dist/components/option.js.map +1 -0
  401. package/dist/{esm/popover-2c7b2326.js → components/popover.js} +10 -1
  402. package/dist/components/popover.js.map +1 -0
  403. package/dist/components/resize-observe.js +162 -0
  404. package/dist/components/resize-observe.js.map +1 -0
  405. package/dist/{esm/scroll-5cd0ab13.js → components/scroll.js} +2 -2
  406. package/dist/components/scroll.js.map +1 -0
  407. package/dist/components/select.js +670 -0
  408. package/dist/components/select.js.map +1 -0
  409. package/dist/components/skeleton.js +43 -0
  410. package/dist/components/skeleton.js.map +1 -0
  411. package/dist/components/slot.js +48 -0
  412. package/dist/components/slot.js.map +1 -0
  413. package/dist/components/spinner.js +49 -0
  414. package/dist/components/spinner.js.map +1 -0
  415. package/dist/components/sticker.js +665 -0
  416. package/dist/components/sticker.js.map +1 -0
  417. package/dist/{esm/tabbable-e21f860a.js → components/tabbable.js} +8 -6
  418. package/dist/components/tabbable.js.map +1 -0
  419. package/dist/components/theme.js +29 -0
  420. package/dist/components/theme.js.map +1 -0
  421. package/dist/components/throttle.js +55 -0
  422. package/dist/components/throttle.js.map +1 -0
  423. package/dist/components/tooltip.js +216 -0
  424. package/dist/components/tooltip.js.map +1 -0
  425. package/dist/custom-elements/index.d.ts +12 -6
  426. package/dist/custom-elements/index.js +1745 -1116
  427. package/dist/custom-elements/index.js.map +1 -1
  428. package/dist/esm/active-element-75b7c8a0.js +19 -0
  429. package/dist/esm/active-element-75b7c8a0.js.map +1 -0
  430. package/dist/esm/{algoliasearch.umd-8e5aff52.js → algoliasearch.umd-6d09b727.js} +3 -3
  431. package/dist/esm/{algoliasearch.umd-8e5aff52.js.map → algoliasearch.umd-6d09b727.js.map} +1 -1
  432. package/dist/esm/dom-faa69d29.js +75 -0
  433. package/dist/esm/dom-faa69d29.js.map +1 -0
  434. package/dist/esm/form-control-67eeb108.js +77 -0
  435. package/dist/esm/form-control-67eeb108.js.map +1 -0
  436. package/dist/esm/index-5f8d16e7.js +12 -12
  437. package/dist/esm/index-bf53664b.js +74 -0
  438. package/dist/esm/{index-f41ae118.js.map → index-bf53664b.js.map} +1 -1
  439. package/dist/esm/index.js +4 -4
  440. package/dist/esm/index.js.map +1 -1
  441. package/dist/esm/loader.js +1 -1
  442. package/dist/esm/{modal-eb0a9bb3.js → modal-215df46b.js} +2 -2
  443. package/dist/esm/{modal-eb0a9bb3.js.map → modal-215df46b.js.map} +1 -1
  444. package/dist/esm/nano-accordion.entry.js +2 -4
  445. package/dist/esm/nano-accordion.entry.js.map +1 -1
  446. package/dist/esm/nano-alert.entry.js +6 -6
  447. package/dist/esm/nano-alert.entry.js.map +1 -1
  448. package/dist/esm/nano-algolia-filter.entry.js +1 -1
  449. package/dist/esm/nano-algolia-filter.entry.js.map +1 -1
  450. package/dist/esm/nano-algolia-input.entry.js +1 -1
  451. package/dist/esm/nano-algolia.entry.js +9 -5
  452. package/dist/esm/nano-algolia.entry.js.map +1 -1
  453. package/dist/esm/nano-aspect-ratio.entry.js +1 -1
  454. package/dist/esm/nano-aspect-ratio.entry.js.map +1 -1
  455. package/dist/esm/nano-checkbox-group.entry.js +4 -1
  456. package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
  457. package/dist/esm/nano-checkbox.entry.js +1 -1
  458. package/dist/esm/nano-checkbox.entry.js.map +1 -1
  459. package/dist/esm/nano-components.js +1 -1
  460. package/dist/esm/nano-datalist_3.entry.js +784 -0
  461. package/dist/esm/nano-datalist_3.entry.js.map +1 -0
  462. package/dist/esm/nano-date-input.entry.js +9 -5
  463. package/dist/esm/nano-date-input.entry.js.map +1 -1
  464. package/dist/esm/{nano-date-picker_2.entry.js → nano-date-picker.entry.js} +3 -274
  465. package/dist/esm/nano-date-picker.entry.js.map +1 -0
  466. package/dist/esm/nano-details.entry.js +2 -2
  467. package/dist/esm/nano-details.entry.js.map +1 -1
  468. package/dist/esm/nano-dialog.entry.js +5 -5
  469. package/dist/esm/nano-dialog.entry.js.map +1 -1
  470. package/dist/esm/nano-drawer.entry.js +5 -5
  471. package/dist/esm/nano-drawer.entry.js.map +1 -1
  472. package/dist/esm/nano-dropdown.entry.js +303 -0
  473. package/dist/esm/nano-dropdown.entry.js.map +1 -0
  474. package/dist/esm/nano-file-upload.entry.js +1 -1
  475. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  476. package/dist/esm/nano-global-nav.entry.js +19 -24
  477. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  478. package/dist/esm/nano-global-search-results.entry.js +200 -115
  479. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  480. package/dist/esm/nano-grid_3.entry.js +16 -8
  481. package/dist/esm/nano-grid_3.entry.js.map +1 -1
  482. package/dist/esm/nano-hero.entry.js +14 -6
  483. package/dist/esm/nano-hero.entry.js.map +1 -1
  484. package/dist/esm/nano-icon-button.entry.js +2 -2
  485. package/dist/esm/nano-icon-button.entry.js.map +1 -1
  486. package/dist/esm/nano-icon.entry.js +1 -1
  487. package/dist/esm/nano-icon.entry.js.map +1 -1
  488. package/dist/esm/nano-input.entry.js +80 -75
  489. package/dist/esm/nano-input.entry.js.map +1 -1
  490. package/dist/esm/nano-menu-drawer.entry.js +2 -2
  491. package/dist/esm/nano-menu-drawer.entry.js.map +1 -1
  492. package/dist/esm/nano-nav-item_2.entry.js +287 -533
  493. package/dist/esm/nano-nav-item_2.entry.js.map +1 -1
  494. package/dist/esm/nano-range.entry.js +2 -2
  495. package/dist/esm/nano-range.entry.js.map +1 -1
  496. package/dist/esm/nano-rating.entry.js +2 -2
  497. package/dist/esm/nano-rating.entry.js.map +1 -1
  498. package/dist/esm/nano-resize-observe_2.entry.js +1 -1
  499. package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
  500. package/dist/esm/nano-slide.entry.js +1 -1
  501. package/dist/esm/nano-slide.entry.js.map +1 -1
  502. package/dist/esm/nano-slides.entry.js +1 -1
  503. package/dist/esm/nano-slides.entry.js.map +1 -1
  504. package/dist/esm/nano-spinner.entry.js +1 -1
  505. package/dist/esm/nano-spinner.entry.js.map +1 -1
  506. package/dist/esm/nano-sticker.entry.js +3 -3
  507. package/dist/esm/nano-sticker.entry.js.map +1 -1
  508. package/dist/esm/nano-tab-content.entry.js +2 -2
  509. package/dist/esm/nano-tab-content.entry.js.map +1 -1
  510. package/dist/esm/nano-tab-group.entry.js +72 -36
  511. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  512. package/dist/esm/nano-tab.entry.js +10 -3
  513. package/dist/esm/nano-tab.entry.js.map +1 -1
  514. package/dist/esm/nano-tooltip.entry.js +2 -2
  515. package/dist/esm/nano-tooltip.entry.js.map +1 -1
  516. package/dist/esm/popover-db86a392.js +1893 -0
  517. package/dist/esm/popover-db86a392.js.map +1 -0
  518. package/dist/esm/scroll-881feb46.js +76 -0
  519. package/dist/esm/{scroll-5cd0ab13.js.map → scroll-881feb46.js.map} +1 -1
  520. package/dist/esm/tabbable-614f515e.js +94 -0
  521. package/dist/esm/tabbable-614f515e.js.map +1 -0
  522. package/dist/esm-es5/active-element-75b7c8a0.js +5 -0
  523. package/dist/esm-es5/active-element-75b7c8a0.js.map +1 -0
  524. package/dist/esm-es5/{algoliasearch.umd-8e5aff52.js → algoliasearch.umd-6d09b727.js} +3 -3
  525. package/dist/esm-es5/{algoliasearch.umd-8e5aff52.js.map → algoliasearch.umd-6d09b727.js.map} +1 -1
  526. package/dist/esm-es5/dom-faa69d29.js +5 -0
  527. package/dist/esm-es5/dom-faa69d29.js.map +1 -0
  528. package/dist/esm-es5/form-control-67eeb108.js +5 -0
  529. package/dist/esm-es5/form-control-67eeb108.js.map +1 -0
  530. package/dist/esm-es5/index-5f8d16e7.js +1 -1
  531. package/dist/esm-es5/index-bf53664b.js +5 -0
  532. package/dist/esm-es5/index-bf53664b.js.map +1 -0
  533. package/dist/esm-es5/index.js +1 -1
  534. package/dist/esm-es5/index.js.map +1 -1
  535. package/dist/esm-es5/loader.js +1 -1
  536. package/dist/esm-es5/loader.js.map +1 -1
  537. package/dist/esm-es5/{modal-eb0a9bb3.js → modal-215df46b.js} +2 -2
  538. package/dist/esm-es5/{modal-eb0a9bb3.js.map → modal-215df46b.js.map} +0 -0
  539. package/dist/esm-es5/nano-accordion.entry.js +1 -1
  540. package/dist/esm-es5/nano-accordion.entry.js.map +1 -1
  541. package/dist/esm-es5/nano-alert.entry.js +1 -1
  542. package/dist/esm-es5/nano-alert.entry.js.map +1 -1
  543. package/dist/esm-es5/nano-algolia-filter.entry.js +1 -1
  544. package/dist/esm-es5/nano-algolia-filter.entry.js.map +1 -1
  545. package/dist/esm-es5/nano-algolia-input.entry.js +1 -1
  546. package/dist/esm-es5/nano-algolia.entry.js +1 -1
  547. package/dist/esm-es5/nano-algolia.entry.js.map +1 -1
  548. package/dist/esm-es5/nano-aspect-ratio.entry.js +1 -1
  549. package/dist/esm-es5/nano-aspect-ratio.entry.js.map +1 -1
  550. package/dist/esm-es5/nano-checkbox-group.entry.js +1 -1
  551. package/dist/esm-es5/nano-checkbox-group.entry.js.map +1 -1
  552. package/dist/esm-es5/nano-checkbox.entry.js +1 -1
  553. package/dist/esm-es5/nano-checkbox.entry.js.map +1 -1
  554. package/dist/esm-es5/nano-components.js +1 -1
  555. package/dist/esm-es5/nano-components.js.map +1 -1
  556. package/dist/esm-es5/nano-datalist_3.entry.js +5 -0
  557. package/dist/esm-es5/nano-datalist_3.entry.js.map +1 -0
  558. package/dist/esm-es5/nano-date-input.entry.js +1 -1
  559. package/dist/esm-es5/nano-date-input.entry.js.map +1 -1
  560. package/dist/esm-es5/nano-date-picker.entry.js +5 -0
  561. package/dist/esm-es5/nano-date-picker.entry.js.map +1 -0
  562. package/dist/esm-es5/nano-details.entry.js +1 -1
  563. package/dist/esm-es5/nano-details.entry.js.map +1 -1
  564. package/dist/esm-es5/nano-dialog.entry.js +1 -1
  565. package/dist/esm-es5/nano-dialog.entry.js.map +1 -1
  566. package/dist/esm-es5/nano-drawer.entry.js +1 -1
  567. package/dist/esm-es5/nano-drawer.entry.js.map +1 -1
  568. package/dist/esm-es5/nano-dropdown.entry.js +5 -0
  569. package/dist/esm-es5/nano-dropdown.entry.js.map +1 -0
  570. package/dist/esm-es5/nano-file-upload.entry.js +1 -1
  571. package/dist/esm-es5/nano-file-upload.entry.js.map +1 -1
  572. package/dist/esm-es5/nano-global-nav.entry.js +1 -1
  573. package/dist/esm-es5/nano-global-nav.entry.js.map +1 -1
  574. package/dist/esm-es5/nano-global-search-results.entry.js +2 -2
  575. package/dist/esm-es5/nano-global-search-results.entry.js.map +1 -1
  576. package/dist/esm-es5/nano-grid_3.entry.js +1 -1
  577. package/dist/esm-es5/nano-grid_3.entry.js.map +1 -1
  578. package/dist/esm-es5/nano-hero.entry.js +1 -1
  579. package/dist/esm-es5/nano-hero.entry.js.map +1 -1
  580. package/dist/esm-es5/nano-icon-button.entry.js +1 -1
  581. package/dist/esm-es5/nano-icon-button.entry.js.map +1 -1
  582. package/dist/esm-es5/nano-icon.entry.js +1 -1
  583. package/dist/esm-es5/nano-icon.entry.js.map +1 -1
  584. package/dist/esm-es5/nano-input.entry.js +2 -2
  585. package/dist/esm-es5/nano-input.entry.js.map +1 -1
  586. package/dist/esm-es5/nano-menu-drawer.entry.js +1 -1
  587. package/dist/esm-es5/nano-menu-drawer.entry.js.map +1 -1
  588. package/dist/esm-es5/nano-nav-item_2.entry.js +1 -1
  589. package/dist/esm-es5/nano-nav-item_2.entry.js.map +1 -1
  590. package/dist/esm-es5/nano-range.entry.js +1 -1
  591. package/dist/esm-es5/nano-range.entry.js.map +1 -1
  592. package/dist/esm-es5/nano-rating.entry.js +1 -1
  593. package/dist/esm-es5/nano-rating.entry.js.map +1 -1
  594. package/dist/esm-es5/nano-resize-observe_2.entry.js +2 -2
  595. package/dist/esm-es5/nano-resize-observe_2.entry.js.map +1 -1
  596. package/dist/esm-es5/nano-slide.entry.js +1 -1
  597. package/dist/esm-es5/nano-slide.entry.js.map +1 -1
  598. package/dist/esm-es5/nano-slides.entry.js +1 -1
  599. package/dist/esm-es5/nano-slides.entry.js.map +1 -1
  600. package/dist/esm-es5/nano-spinner.entry.js +1 -1
  601. package/dist/esm-es5/nano-spinner.entry.js.map +1 -1
  602. package/dist/esm-es5/nano-sticker.entry.js +1 -1
  603. package/dist/esm-es5/nano-sticker.entry.js.map +1 -1
  604. package/dist/esm-es5/nano-tab-content.entry.js +1 -1
  605. package/dist/esm-es5/nano-tab-content.entry.js.map +1 -1
  606. package/dist/esm-es5/nano-tab-group.entry.js +2 -2
  607. package/dist/esm-es5/nano-tab-group.entry.js.map +1 -1
  608. package/dist/esm-es5/nano-tab.entry.js +2 -2
  609. package/dist/esm-es5/nano-tab.entry.js.map +1 -1
  610. package/dist/esm-es5/nano-tooltip.entry.js +1 -1
  611. package/dist/esm-es5/nano-tooltip.entry.js.map +1 -1
  612. package/dist/esm-es5/{popover-2c7b2326.js → popover-db86a392.js} +2 -2
  613. package/dist/esm-es5/popover-db86a392.js.map +1 -0
  614. package/dist/esm-es5/{scroll-5cd0ab13.js → scroll-881feb46.js} +2 -2
  615. package/dist/esm-es5/{scroll-5cd0ab13.js.map → scroll-881feb46.js.map} +0 -0
  616. package/dist/esm-es5/tabbable-614f515e.js +5 -0
  617. package/dist/esm-es5/tabbable-614f515e.js.map +1 -0
  618. package/dist/nano-components/index.esm.js +1 -1
  619. package/dist/nano-components/index.esm.js.map +1 -1
  620. package/dist/nano-components/nano-components.css +1 -1
  621. package/dist/nano-components/nano-components.esm.js +1 -1
  622. package/dist/nano-components/nano-components.esm.js.map +1 -1
  623. package/dist/nano-components/{p-2f21a443.system.entry.js → p-033296c7.system.entry.js} +2 -2
  624. package/dist/nano-components/{p-2f21a443.system.entry.js.map → p-033296c7.system.entry.js.map} +1 -1
  625. package/dist/nano-components/p-040b6cda.entry.js +5 -0
  626. package/dist/nano-components/{p-61565b5a.entry.js.map → p-040b6cda.entry.js.map} +1 -1
  627. package/dist/nano-components/p-05c7bde1.system.entry.js +5 -0
  628. package/dist/nano-components/{p-30df44d9.system.entry.js.map → p-05c7bde1.system.entry.js.map} +1 -1
  629. package/dist/nano-components/p-07bdf44d.entry.js +5 -0
  630. package/dist/nano-components/{p-88bcf55b.entry.js.map → p-07bdf44d.entry.js.map} +1 -1
  631. package/dist/nano-components/p-09066701.system.entry.js +5 -0
  632. package/dist/nano-components/p-09066701.system.entry.js.map +1 -0
  633. package/dist/nano-components/p-090f22a9.system.entry.js +5 -0
  634. package/dist/nano-components/{p-854df906.system.entry.js.map → p-090f22a9.system.entry.js.map} +1 -1
  635. package/dist/nano-components/p-096682d9.system.js +1 -1
  636. package/dist/nano-components/p-096682d9.system.js.map +1 -1
  637. package/dist/nano-components/p-09d2d944.system.js +5 -0
  638. package/dist/nano-components/p-09d2d944.system.js.map +1 -0
  639. package/dist/nano-components/{p-bfc12324.system.entry.js → p-0bee6fe6.system.entry.js} +2 -2
  640. package/dist/nano-components/{p-bfc12324.system.entry.js.map → p-0bee6fe6.system.entry.js.map} +0 -0
  641. package/dist/nano-components/{p-21c2a9a5.system.entry.js → p-173bae15.system.entry.js} +2 -2
  642. package/dist/nano-components/{p-21c2a9a5.system.entry.js.map → p-173bae15.system.entry.js.map} +1 -1
  643. package/dist/nano-components/{p-731935b1.js → p-1805d59a.js} +2 -2
  644. package/dist/nano-components/{p-731935b1.js.map → p-1805d59a.js.map} +0 -0
  645. package/dist/nano-components/p-1a293bd0.entry.js +5 -0
  646. package/dist/nano-components/{p-8b7f8ef4.entry.js.map → p-1a293bd0.entry.js.map} +1 -1
  647. package/dist/nano-components/p-1c216ca4.system.js +5 -0
  648. package/dist/{esm-es5/index-f41ae118.js.map → nano-components/p-1c216ca4.system.js.map} +1 -1
  649. package/dist/nano-components/p-1d13dbdf.system.js +5 -0
  650. package/dist/nano-components/p-1d13dbdf.system.js.map +1 -0
  651. package/dist/nano-components/p-1e974cad.entry.js +5 -0
  652. package/dist/nano-components/{p-7e60c331.entry.js.map → p-1e974cad.entry.js.map} +1 -1
  653. package/dist/nano-components/p-20387cde.system.entry.js +5 -0
  654. package/dist/nano-components/{p-91778977.system.entry.js.map → p-20387cde.system.entry.js.map} +1 -1
  655. package/dist/nano-components/p-20db18f3.entry.js +5 -0
  656. package/dist/nano-components/{p-a9dd7cf9.entry.js.map → p-20db18f3.entry.js.map} +1 -1
  657. package/dist/nano-components/p-22884654.system.entry.js +5 -0
  658. package/dist/nano-components/{p-3d0fbd0e.system.entry.js.map → p-22884654.system.entry.js.map} +1 -1
  659. package/dist/nano-components/p-2559e9c1.entry.js +5 -0
  660. package/dist/nano-components/p-2559e9c1.entry.js.map +1 -0
  661. package/dist/nano-components/p-289aa03f.js +5 -0
  662. package/dist/nano-components/p-289aa03f.js.map +1 -0
  663. package/dist/nano-components/p-2e6c55e2.entry.js +5 -0
  664. package/dist/nano-components/{p-6f3d20fe.entry.js.map → p-2e6c55e2.entry.js.map} +1 -1
  665. package/dist/nano-components/{p-60c9b580.system.js → p-3258c568.system.js} +2 -2
  666. package/dist/nano-components/p-3258c568.system.js.map +1 -0
  667. package/dist/nano-components/p-3456db01.entry.js +5 -0
  668. package/dist/nano-components/p-3456db01.entry.js.map +1 -0
  669. package/dist/nano-components/p-346588cc.entry.js +5 -0
  670. package/dist/nano-components/p-346588cc.entry.js.map +1 -0
  671. package/dist/nano-components/p-394c3c19.entry.js +5 -0
  672. package/dist/nano-components/{p-217f71aa.entry.js.map → p-394c3c19.entry.js.map} +1 -1
  673. package/dist/nano-components/p-3a13948a.system.entry.js +5 -0
  674. package/dist/nano-components/p-3a13948a.system.entry.js.map +1 -0
  675. package/dist/nano-components/p-3a725f1f.system.entry.js +5 -0
  676. package/dist/nano-components/p-3a725f1f.system.entry.js.map +1 -0
  677. package/dist/nano-components/p-3aa1d07d.entry.js +5 -0
  678. package/dist/nano-components/{p-6a1c69d3.entry.js.map → p-3aa1d07d.entry.js.map} +1 -1
  679. package/dist/nano-components/p-3ad1d5aa.system.entry.js +5 -0
  680. package/dist/nano-components/p-3ad1d5aa.system.entry.js.map +1 -0
  681. package/dist/nano-components/p-3ef30ded.system.entry.js +5 -0
  682. package/dist/nano-components/{p-9bf4a6e0.system.entry.js.map → p-3ef30ded.system.entry.js.map} +1 -1
  683. package/dist/nano-components/p-3fc52f19.system.entry.js +5 -0
  684. package/dist/nano-components/p-3fc52f19.system.entry.js.map +1 -0
  685. package/dist/nano-components/p-4429caac.system.entry.js +5 -0
  686. package/dist/nano-components/p-4429caac.system.entry.js.map +1 -0
  687. package/dist/nano-components/p-4535e3bb.entry.js +5 -0
  688. package/dist/nano-components/{p-143bca0d.entry.js.map → p-4535e3bb.entry.js.map} +1 -1
  689. package/dist/nano-components/p-462ad4f1.entry.js +5 -0
  690. package/dist/nano-components/p-462ad4f1.entry.js.map +1 -0
  691. package/dist/nano-components/p-46d0bb7b.entry.js +5 -0
  692. package/dist/nano-components/p-46d0bb7b.entry.js.map +1 -0
  693. package/dist/nano-components/p-5066e563.system.entry.js +5 -0
  694. package/dist/nano-components/{p-006f2fd3.system.entry.js.map → p-5066e563.system.entry.js.map} +1 -1
  695. package/dist/nano-components/p-52ab579e.system.entry.js +5 -0
  696. package/dist/nano-components/p-52ab579e.system.entry.js.map +1 -0
  697. package/dist/nano-components/p-531d5275.system.entry.js +5 -0
  698. package/dist/nano-components/{p-b79dc23a.system.entry.js.map → p-531d5275.system.entry.js.map} +1 -1
  699. package/dist/nano-components/p-5653961d.system.entry.js +5 -0
  700. package/dist/nano-components/{p-18f49ebf.system.entry.js.map → p-5653961d.system.entry.js.map} +1 -1
  701. package/dist/nano-components/p-56ba0d63.entry.js +5 -0
  702. package/dist/nano-components/p-56ba0d63.entry.js.map +1 -0
  703. package/dist/nano-components/p-593de29b.system.entry.js +5 -0
  704. package/dist/nano-components/{p-76b13c27.system.entry.js.map → p-593de29b.system.entry.js.map} +1 -1
  705. package/dist/nano-components/p-5a476bba.system.entry.js +5 -0
  706. package/dist/nano-components/p-5a476bba.system.entry.js.map +1 -0
  707. package/dist/nano-components/{p-8a608e6d.entry.js → p-5e7c7d3d.entry.js} +2 -2
  708. package/dist/nano-components/{p-8a608e6d.entry.js.map → p-5e7c7d3d.entry.js.map} +1 -1
  709. package/dist/nano-components/p-672e5547.js +5 -0
  710. package/dist/nano-components/p-672e5547.js.map +1 -0
  711. package/dist/nano-components/{p-a16651a6.system.js → p-67cc0d9b.system.js} +3 -3
  712. package/dist/nano-components/{p-a16651a6.system.js.map → p-67cc0d9b.system.js.map} +1 -1
  713. package/dist/nano-components/p-69439aa1.system.entry.js +5 -0
  714. package/dist/nano-components/p-69439aa1.system.entry.js.map +1 -0
  715. package/dist/nano-components/p-6ade3290.entry.js +5 -0
  716. package/dist/nano-components/{p-1e03f9bf.entry.js.map → p-6ade3290.entry.js.map} +1 -1
  717. package/dist/nano-components/p-70dec19f.entry.js +5 -0
  718. package/dist/nano-components/{p-d0e9b177.entry.js.map → p-70dec19f.entry.js.map} +1 -1
  719. package/dist/nano-components/p-71c26ace.entry.js +5 -0
  720. package/dist/nano-components/p-71c26ace.entry.js.map +1 -0
  721. package/dist/nano-components/p-7232c046.system.entry.js +5 -0
  722. package/dist/nano-components/{p-92b3f99b.system.entry.js.map → p-7232c046.system.entry.js.map} +1 -1
  723. package/dist/nano-components/p-730f60ea.entry.js +5 -0
  724. package/dist/nano-components/{p-78cf9d39.entry.js.map → p-730f60ea.entry.js.map} +1 -1
  725. package/dist/nano-components/p-74a7fc4f.js +5 -0
  726. package/dist/nano-components/p-74a7fc4f.js.map +1 -0
  727. package/dist/nano-components/p-774e090b.system.entry.js +5 -0
  728. package/dist/nano-components/p-774e090b.system.entry.js.map +1 -0
  729. package/dist/nano-components/{p-d31761c8.system.js → p-7be6b7f3.system.js} +2 -2
  730. package/dist/nano-components/p-7be6b7f3.system.js.map +1 -0
  731. package/dist/nano-components/p-7d2e2685.entry.js +5 -0
  732. package/dist/nano-components/p-7d2e2685.entry.js.map +1 -0
  733. package/dist/nano-components/p-820d9e23.system.entry.js +5 -0
  734. package/dist/nano-components/p-820d9e23.system.entry.js.map +1 -0
  735. package/dist/nano-components/p-8278c5d2.system.entry.js +5 -0
  736. package/dist/nano-components/{p-badf69ee.system.entry.js.map → p-8278c5d2.system.entry.js.map} +1 -1
  737. package/dist/nano-components/p-82f4b071.entry.js +5 -0
  738. package/dist/nano-components/p-82f4b071.entry.js.map +1 -0
  739. package/dist/nano-components/p-88f17c86.system.entry.js +5 -0
  740. package/dist/nano-components/p-88f17c86.system.entry.js.map +1 -0
  741. package/dist/nano-components/p-8a8f893b.system.entry.js +5 -0
  742. package/dist/nano-components/{p-cc668975.system.entry.js.map → p-8a8f893b.system.entry.js.map} +1 -1
  743. package/dist/nano-components/p-93448bcd.system.entry.js +5 -0
  744. package/dist/nano-components/{p-02e82e14.system.entry.js.map → p-93448bcd.system.entry.js.map} +1 -1
  745. package/dist/nano-components/p-94593617.system.entry.js +5 -0
  746. package/dist/nano-components/{p-2442eda0.system.entry.js.map → p-94593617.system.entry.js.map} +1 -1
  747. package/dist/nano-components/{p-56113dd3.js → p-9a385481.js} +2 -2
  748. package/dist/nano-components/p-9a385481.js.map +1 -0
  749. package/dist/nano-components/{p-8134c14e.system.js → p-9de508a5.system.js} +2 -2
  750. package/dist/nano-components/p-9de508a5.system.js.map +1 -0
  751. package/dist/nano-components/p-a315ed2c.entry.js +5 -0
  752. package/dist/nano-components/{p-13801651.entry.js.map → p-a315ed2c.entry.js.map} +1 -1
  753. package/dist/nano-components/p-a4075d49.entry.js +5 -0
  754. package/dist/nano-components/p-a4075d49.entry.js.map +1 -0
  755. package/dist/nano-components/p-b19e0775.system.entry.js +5 -0
  756. package/dist/nano-components/p-b19e0775.system.entry.js.map +1 -0
  757. package/dist/nano-components/{p-18411914.system.js → p-b370e3ef.system.js} +2 -2
  758. package/dist/nano-components/{p-18411914.system.js.map → p-b370e3ef.system.js.map} +0 -0
  759. package/dist/nano-components/p-b59d2bd5.entry.js +5 -0
  760. package/dist/nano-components/p-b59d2bd5.entry.js.map +1 -0
  761. package/dist/nano-components/p-b619500f.js +5 -0
  762. package/dist/nano-components/p-b619500f.js.map +1 -0
  763. package/dist/nano-components/{p-23f65b34.entry.js → p-ba13bb56.entry.js} +2 -2
  764. package/dist/nano-components/{p-23f65b34.entry.js.map → p-ba13bb56.entry.js.map} +1 -1
  765. package/dist/nano-components/p-c0ddb4c3.entry.js +5 -0
  766. package/dist/nano-components/{p-78569d39.entry.js.map → p-c0ddb4c3.entry.js.map} +1 -1
  767. package/dist/nano-components/p-c954c040.entry.js +5 -0
  768. package/dist/nano-components/p-c954c040.entry.js.map +1 -0
  769. package/dist/nano-components/p-c9c1a345.system.entry.js +5 -0
  770. package/dist/nano-components/{p-38a3e791.system.entry.js.map → p-c9c1a345.system.entry.js.map} +1 -1
  771. package/dist/nano-components/{p-8c8963f6.js → p-cb79d1ec.js} +2 -2
  772. package/dist/nano-components/{p-8c8963f6.js.map → p-cb79d1ec.js.map} +0 -0
  773. package/dist/nano-components/p-d6569144.entry.js +5 -0
  774. package/dist/nano-components/{p-c7b7f7ab.entry.js.map → p-d6569144.entry.js.map} +1 -1
  775. package/dist/nano-components/{p-2d1a856e.system.js → p-d84ef175.system.js} +2 -2
  776. package/dist/nano-components/{p-2d1a856e.system.js.map → p-d84ef175.system.js.map} +0 -0
  777. package/dist/nano-components/p-d9c7909e.js +5 -0
  778. package/dist/nano-components/p-d9c7909e.js.map +1 -0
  779. package/dist/nano-components/p-e11bd40d.entry.js +5 -0
  780. package/dist/nano-components/{p-a21d90aa.entry.js.map → p-e11bd40d.entry.js.map} +1 -1
  781. package/dist/nano-components/p-e15be516.system.entry.js +5 -0
  782. package/dist/nano-components/p-e15be516.system.entry.js.map +1 -0
  783. package/dist/nano-components/p-e2ae11d2.entry.js +5 -0
  784. package/dist/nano-components/p-e2ae11d2.entry.js.map +1 -0
  785. package/dist/nano-components/{p-8757b4eb.js → p-e3583b00.js} +3 -3
  786. package/dist/nano-components/{p-8757b4eb.js.map → p-e3583b00.js.map} +1 -1
  787. package/dist/nano-components/p-e35eac75.entry.js +5 -0
  788. package/dist/nano-components/p-e35eac75.entry.js.map +1 -0
  789. package/dist/nano-components/p-e562bffd.entry.js +5 -0
  790. package/dist/nano-components/p-e562bffd.entry.js.map +1 -0
  791. package/dist/nano-components/p-e6f41b97.entry.js +5 -0
  792. package/dist/nano-components/p-e6f41b97.entry.js.map +1 -0
  793. package/dist/nano-components/p-e6f8f9f7.system.entry.js +5 -0
  794. package/dist/nano-components/p-e6f8f9f7.system.entry.js.map +1 -0
  795. package/dist/nano-components/p-ea5eb591.system.js +5 -0
  796. package/dist/nano-components/p-ea5eb591.system.js.map +1 -0
  797. package/dist/nano-components/p-ef4e0912.system.entry.js +5 -0
  798. package/dist/nano-components/{p-2aed806d.system.entry.js.map → p-ef4e0912.system.entry.js.map} +1 -1
  799. package/dist/nano-components/{p-981cc614.entry.js → p-f1bf1099.entry.js} +2 -2
  800. package/dist/nano-components/{p-981cc614.entry.js.map → p-f1bf1099.entry.js.map} +0 -0
  801. package/dist/nano-components/p-f2e7d2f9.system.entry.js +5 -0
  802. package/dist/nano-components/p-f2e7d2f9.system.entry.js.map +1 -0
  803. package/dist/nano-components/p-f3bf942d.entry.js +5 -0
  804. package/dist/nano-components/p-f3bf942d.entry.js.map +1 -0
  805. package/dist/nano-components/p-f53989c3.system.entry.js +5 -0
  806. package/dist/nano-components/{p-6621e4f1.system.entry.js.map → p-f53989c3.system.entry.js.map} +1 -1
  807. package/dist/themes/nanopore.css +1 -1
  808. package/dist/themes/nanopore.css.map +1 -1
  809. package/dist/types/components/accordion/accordion.d.ts +0 -1
  810. package/dist/types/components/checkbox/checkbox-group.d.ts +1 -0
  811. package/dist/types/components/datalist/datalist.d.ts +98 -0
  812. package/dist/types/components/date-input/date-input.d.ts +2 -0
  813. package/dist/types/components/dialog/dialog.helpers.d.ts +2 -2
  814. package/dist/types/components/dropdown/dropdown.d.ts +8 -4
  815. package/dist/types/components/form-control/form-control.d.ts +35 -0
  816. package/dist/types/components/global-search-results/global-search-results.d.ts +1 -0
  817. package/dist/types/components/grid/grid.d.ts +7 -1
  818. package/dist/types/components/hero/hero.d.ts +2 -0
  819. package/dist/types/components/input/input.d.ts +13 -9
  820. package/dist/types/components/menu/menu.d.ts +22 -8
  821. package/dist/types/components/option/option-interface.d.ts +7 -0
  822. package/dist/types/components/option/option.d.ts +45 -0
  823. package/dist/types/components/select/select.d.ts +43 -49
  824. package/dist/types/components/tabs/tab-group.d.ts +32 -6
  825. package/dist/types/components/tabs/tab.d.ts +6 -1
  826. package/dist/types/components.d.ts +241 -70
  827. package/dist/types/interface.d.ts +1 -0
  828. package/dist/types/utils/active-element.d.ts +1 -0
  829. package/dist/types/utils/dom.d.ts +9 -1
  830. package/dist/types/utils/index.d.ts +2 -1
  831. package/dist/types/utils/tabbable.d.ts +2 -2
  832. package/dist/types/utils/testing/index.d.ts +3 -2
  833. package/docs-json.json +1244 -262
  834. package/docs-vscode.json +102 -33
  835. package/package.json +5 -5
  836. package/dist/cjs/dom-5f3fae1a.js.map +0 -1
  837. package/dist/cjs/index-117f36a4.js.map +0 -1
  838. package/dist/cjs/nano-date-picker_2.cjs.entry.js.map +0 -1
  839. package/dist/cjs/nano-menu.cjs.entry.js +0 -156
  840. package/dist/cjs/nano-menu.cjs.entry.js.map +0 -1
  841. package/dist/cjs/nano-select-option.cjs.entry.js +0 -43
  842. package/dist/cjs/nano-select-option.cjs.entry.js.map +0 -1
  843. package/dist/cjs/popover-d033efa2.js.map +0 -1
  844. package/dist/cjs/tabbable-615c30e1.js.map +0 -1
  845. package/dist/collection/components/select/select-option.css +0 -15
  846. package/dist/collection/components/select/select-option.js +0 -127
  847. package/dist/collection/components/select/select-option.js.map +0 -1
  848. package/dist/esm/dom-a791b223.js.map +0 -1
  849. package/dist/esm/nano-date-picker_2.entry.js.map +0 -1
  850. package/dist/esm/nano-menu.entry.js +0 -152
  851. package/dist/esm/nano-menu.entry.js.map +0 -1
  852. package/dist/esm/nano-select-option.entry.js +0 -39
  853. package/dist/esm/nano-select-option.entry.js.map +0 -1
  854. package/dist/esm/popover-2c7b2326.js.map +0 -1
  855. package/dist/esm/tabbable-e21f860a.js.map +0 -1
  856. package/dist/esm-es5/dom-a791b223.js +0 -5
  857. package/dist/esm-es5/dom-a791b223.js.map +0 -1
  858. package/dist/esm-es5/index-f41ae118.js +0 -5
  859. package/dist/esm-es5/nano-date-picker_2.entry.js +0 -5
  860. package/dist/esm-es5/nano-date-picker_2.entry.js.map +0 -1
  861. package/dist/esm-es5/nano-menu.entry.js +0 -5
  862. package/dist/esm-es5/nano-menu.entry.js.map +0 -1
  863. package/dist/esm-es5/nano-select-option.entry.js +0 -5
  864. package/dist/esm-es5/nano-select-option.entry.js.map +0 -1
  865. package/dist/esm-es5/popover-2c7b2326.js.map +0 -1
  866. package/dist/esm-es5/tabbable-e21f860a.js +0 -5
  867. package/dist/esm-es5/tabbable-e21f860a.js.map +0 -1
  868. package/dist/nano-components/p-006f2fd3.system.entry.js +0 -5
  869. package/dist/nano-components/p-02e82e14.system.entry.js +0 -5
  870. package/dist/nano-components/p-05a8014a.entry.js +0 -5
  871. package/dist/nano-components/p-05a8014a.entry.js.map +0 -1
  872. package/dist/nano-components/p-13801651.entry.js +0 -5
  873. package/dist/nano-components/p-13fa75fc.entry.js +0 -5
  874. package/dist/nano-components/p-13fa75fc.entry.js.map +0 -1
  875. package/dist/nano-components/p-143bca0d.entry.js +0 -5
  876. package/dist/nano-components/p-18f49ebf.system.entry.js +0 -5
  877. package/dist/nano-components/p-19428228.system.entry.js +0 -5
  878. package/dist/nano-components/p-19428228.system.entry.js.map +0 -1
  879. package/dist/nano-components/p-1e03f9bf.entry.js +0 -5
  880. package/dist/nano-components/p-217f71aa.entry.js +0 -5
  881. package/dist/nano-components/p-2442eda0.system.entry.js +0 -5
  882. package/dist/nano-components/p-2946bd70.system.entry.js +0 -5
  883. package/dist/nano-components/p-2946bd70.system.entry.js.map +0 -1
  884. package/dist/nano-components/p-2aed806d.system.entry.js +0 -5
  885. package/dist/nano-components/p-30df44d9.system.entry.js +0 -5
  886. package/dist/nano-components/p-38a3e791.system.entry.js +0 -5
  887. package/dist/nano-components/p-3a49ceab.entry.js +0 -5
  888. package/dist/nano-components/p-3a49ceab.entry.js.map +0 -1
  889. package/dist/nano-components/p-3d0fbd0e.system.entry.js +0 -5
  890. package/dist/nano-components/p-3f00179c.js +0 -5
  891. package/dist/nano-components/p-3f00179c.js.map +0 -1
  892. package/dist/nano-components/p-48e6bea3.entry.js +0 -5
  893. package/dist/nano-components/p-48e6bea3.entry.js.map +0 -1
  894. package/dist/nano-components/p-4d62ec32.system.js +0 -5
  895. package/dist/nano-components/p-4d62ec32.system.js.map +0 -1
  896. package/dist/nano-components/p-4e451498.entry.js +0 -5
  897. package/dist/nano-components/p-4e451498.entry.js.map +0 -1
  898. package/dist/nano-components/p-51d9570d.entry.js +0 -5
  899. package/dist/nano-components/p-51d9570d.entry.js.map +0 -1
  900. package/dist/nano-components/p-51fa04a6.entry.js +0 -5
  901. package/dist/nano-components/p-51fa04a6.entry.js.map +0 -1
  902. package/dist/nano-components/p-55189485.system.entry.js +0 -5
  903. package/dist/nano-components/p-55189485.system.entry.js.map +0 -1
  904. package/dist/nano-components/p-56113dd3.js.map +0 -1
  905. package/dist/nano-components/p-5bbd6c81.entry.js +0 -5
  906. package/dist/nano-components/p-5bbd6c81.entry.js.map +0 -1
  907. package/dist/nano-components/p-5e9170ae.entry.js +0 -5
  908. package/dist/nano-components/p-5e9170ae.entry.js.map +0 -1
  909. package/dist/nano-components/p-60c9b580.system.js.map +0 -1
  910. package/dist/nano-components/p-61565b5a.entry.js +0 -5
  911. package/dist/nano-components/p-621750cc.js +0 -5
  912. package/dist/nano-components/p-621750cc.js.map +0 -1
  913. package/dist/nano-components/p-6621e4f1.system.entry.js +0 -5
  914. package/dist/nano-components/p-6a1c69d3.entry.js +0 -5
  915. package/dist/nano-components/p-6ab8d211.system.entry.js +0 -5
  916. package/dist/nano-components/p-6ab8d211.system.entry.js.map +0 -1
  917. package/dist/nano-components/p-6e9b3d60.system.entry.js +0 -5
  918. package/dist/nano-components/p-6e9b3d60.system.entry.js.map +0 -1
  919. package/dist/nano-components/p-6f3d20fe.entry.js +0 -5
  920. package/dist/nano-components/p-6feac35e.entry.js +0 -5
  921. package/dist/nano-components/p-6feac35e.entry.js.map +0 -1
  922. package/dist/nano-components/p-723c212f.system.entry.js +0 -5
  923. package/dist/nano-components/p-723c212f.system.entry.js.map +0 -1
  924. package/dist/nano-components/p-76b13c27.system.entry.js +0 -5
  925. package/dist/nano-components/p-78569d39.entry.js +0 -5
  926. package/dist/nano-components/p-78cf9d39.entry.js +0 -5
  927. package/dist/nano-components/p-7e60c331.entry.js +0 -5
  928. package/dist/nano-components/p-8134c14e.system.js.map +0 -1
  929. package/dist/nano-components/p-81b4ed2a.system.entry.js +0 -5
  930. package/dist/nano-components/p-81b4ed2a.system.entry.js.map +0 -1
  931. package/dist/nano-components/p-854df906.system.entry.js +0 -5
  932. package/dist/nano-components/p-88bcf55b.entry.js +0 -5
  933. package/dist/nano-components/p-8b7f8ef4.entry.js +0 -5
  934. package/dist/nano-components/p-8c3993ff.entry.js +0 -5
  935. package/dist/nano-components/p-8c3993ff.entry.js.map +0 -1
  936. package/dist/nano-components/p-91778977.system.entry.js +0 -5
  937. package/dist/nano-components/p-92b3f99b.system.entry.js +0 -5
  938. package/dist/nano-components/p-9bd73d1d.js +0 -5
  939. package/dist/nano-components/p-9bd73d1d.js.map +0 -1
  940. package/dist/nano-components/p-9bf4a6e0.system.entry.js +0 -5
  941. package/dist/nano-components/p-9df226fd.system.entry.js +0 -5
  942. package/dist/nano-components/p-9df226fd.system.entry.js.map +0 -1
  943. package/dist/nano-components/p-a0b55c38.system.entry.js +0 -5
  944. package/dist/nano-components/p-a0b55c38.system.entry.js.map +0 -1
  945. package/dist/nano-components/p-a21d90aa.entry.js +0 -5
  946. package/dist/nano-components/p-a9dd7cf9.entry.js +0 -5
  947. package/dist/nano-components/p-ad069ba4.entry.js +0 -5
  948. package/dist/nano-components/p-ad069ba4.entry.js.map +0 -1
  949. package/dist/nano-components/p-b246a7bb.entry.js +0 -5
  950. package/dist/nano-components/p-b246a7bb.entry.js.map +0 -1
  951. package/dist/nano-components/p-b45d4be9.entry.js +0 -5
  952. package/dist/nano-components/p-b45d4be9.entry.js.map +0 -1
  953. package/dist/nano-components/p-b79dc23a.system.entry.js +0 -5
  954. package/dist/nano-components/p-b86fc6b7.system.js +0 -5
  955. package/dist/nano-components/p-b86fc6b7.system.js.map +0 -1
  956. package/dist/nano-components/p-badf69ee.system.entry.js +0 -5
  957. package/dist/nano-components/p-bde0deae.system.entry.js +0 -5
  958. package/dist/nano-components/p-bde0deae.system.entry.js.map +0 -1
  959. package/dist/nano-components/p-be3df2e8.system.entry.js +0 -5
  960. package/dist/nano-components/p-be3df2e8.system.entry.js.map +0 -1
  961. package/dist/nano-components/p-c39c1e8d.entry.js +0 -5
  962. package/dist/nano-components/p-c39c1e8d.entry.js.map +0 -1
  963. package/dist/nano-components/p-c7b7f7ab.entry.js +0 -5
  964. package/dist/nano-components/p-c82ccbc8.entry.js +0 -5
  965. package/dist/nano-components/p-c82ccbc8.entry.js.map +0 -1
  966. package/dist/nano-components/p-cc668975.system.entry.js +0 -5
  967. package/dist/nano-components/p-cfd4c9de.system.entry.js +0 -5
  968. package/dist/nano-components/p-cfd4c9de.system.entry.js.map +0 -1
  969. package/dist/nano-components/p-d0e9b177.entry.js +0 -5
  970. package/dist/nano-components/p-d31761c8.system.js.map +0 -1
  971. package/dist/nano-components/p-d47d297b.system.entry.js +0 -5
  972. package/dist/nano-components/p-d47d297b.system.entry.js.map +0 -1
  973. package/dist/nano-components/p-e48a53f5.system.entry.js +0 -5
  974. package/dist/nano-components/p-e48a53f5.system.entry.js.map +0 -1
  975. package/dist/nano-components/p-e5f01860.entry.js +0 -5
  976. package/dist/nano-components/p-e5f01860.entry.js.map +0 -1
  977. package/dist/nano-components/p-f2b2cd38.system.entry.js +0 -5
  978. package/dist/nano-components/p-f2b2cd38.system.entry.js.map +0 -1
  979. package/dist/nano-components/p-fcb5ffaf.system.entry.js +0 -5
  980. package/dist/nano-components/p-fcb5ffaf.system.entry.js.map +0 -1
  981. package/dist/types/components/select/select-option.d.ts +0 -23
@@ -0,0 +1,4335 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ import { HTMLElement as HTMLElement$1, createEvent, Build, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
5
+ import { i as index } from './ResizeObserver.es.js';
6
+ import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
7
+
8
+ var evEmitter = createCommonjsModule(function (module) {
9
+ /**
10
+ * EvEmitter v1.1.0
11
+ * Lil' event emitter
12
+ * MIT License
13
+ */
14
+
15
+ /* jshint unused: true, undef: true, strict: true */
16
+
17
+ ( function( global, factory ) {
18
+ // universal module definition
19
+ /* jshint strict: false */ /* globals define, module, window */
20
+ if ( module.exports ) {
21
+ // CommonJS - Browserify, Webpack
22
+ module.exports = factory();
23
+ } else {
24
+ // Browser globals
25
+ global.EvEmitter = factory();
26
+ }
27
+
28
+ }( typeof window != 'undefined' ? window : commonjsGlobal, function() {
29
+
30
+ function EvEmitter() {}
31
+
32
+ var proto = EvEmitter.prototype;
33
+
34
+ proto.on = function( eventName, listener ) {
35
+ if ( !eventName || !listener ) {
36
+ return;
37
+ }
38
+ // set events hash
39
+ var events = this._events = this._events || {};
40
+ // set listeners array
41
+ var listeners = events[ eventName ] = events[ eventName ] || [];
42
+ // only add once
43
+ if ( listeners.indexOf( listener ) == -1 ) {
44
+ listeners.push( listener );
45
+ }
46
+
47
+ return this;
48
+ };
49
+
50
+ proto.once = function( eventName, listener ) {
51
+ if ( !eventName || !listener ) {
52
+ return;
53
+ }
54
+ // add event
55
+ this.on( eventName, listener );
56
+ // set once flag
57
+ // set onceEvents hash
58
+ var onceEvents = this._onceEvents = this._onceEvents || {};
59
+ // set onceListeners object
60
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
61
+ // set flag
62
+ onceListeners[ listener ] = true;
63
+
64
+ return this;
65
+ };
66
+
67
+ proto.off = function( eventName, listener ) {
68
+ var listeners = this._events && this._events[ eventName ];
69
+ if ( !listeners || !listeners.length ) {
70
+ return;
71
+ }
72
+ var index = listeners.indexOf( listener );
73
+ if ( index != -1 ) {
74
+ listeners.splice( index, 1 );
75
+ }
76
+
77
+ return this;
78
+ };
79
+
80
+ proto.emitEvent = function( eventName, args ) {
81
+ var listeners = this._events && this._events[ eventName ];
82
+ if ( !listeners || !listeners.length ) {
83
+ return;
84
+ }
85
+ // copy over to avoid interference if .off() in listener
86
+ listeners = listeners.slice(0);
87
+ args = args || [];
88
+ // once stuff
89
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
90
+
91
+ for ( var i=0; i < listeners.length; i++ ) {
92
+ var listener = listeners[i];
93
+ var isOnce = onceListeners && onceListeners[ listener ];
94
+ if ( isOnce ) {
95
+ // remove listener
96
+ // remove before trigger to prevent recursion
97
+ this.off( eventName, listener );
98
+ // unset once flag
99
+ delete onceListeners[ listener ];
100
+ }
101
+ // trigger listener
102
+ listener.apply( this, args );
103
+ }
104
+
105
+ return this;
106
+ };
107
+
108
+ proto.allOff = function() {
109
+ delete this._events;
110
+ delete this._onceEvents;
111
+ };
112
+
113
+ return EvEmitter;
114
+
115
+ }));
116
+ });
117
+
118
+ var getSize = createCommonjsModule(function (module) {
119
+ /*!
120
+ * getSize v2.0.3
121
+ * measure size of elements
122
+ * MIT license
123
+ */
124
+
125
+ /* jshint browser: true, strict: true, undef: true, unused: true */
126
+ /* globals console: false */
127
+
128
+ ( function( window, factory ) {
129
+ /* jshint strict: false */ /* globals define, module */
130
+ if ( module.exports ) {
131
+ // CommonJS
132
+ module.exports = factory();
133
+ } else {
134
+ // browser global
135
+ window.getSize = factory();
136
+ }
137
+
138
+ })( window, function factory() {
139
+
140
+ // -------------------------- helpers -------------------------- //
141
+
142
+ // get a number from a string, not a percentage
143
+ function getStyleSize( value ) {
144
+ var num = parseFloat( value );
145
+ // not a percent like '100%', and a number
146
+ var isValid = value.indexOf('%') == -1 && !isNaN( num );
147
+ return isValid && num;
148
+ }
149
+
150
+ function noop() {}
151
+
152
+ var logError = typeof console == 'undefined' ? noop :
153
+ function( message ) {
154
+ console.error( message );
155
+ };
156
+
157
+ // -------------------------- measurements -------------------------- //
158
+
159
+ var measurements = [
160
+ 'paddingLeft',
161
+ 'paddingRight',
162
+ 'paddingTop',
163
+ 'paddingBottom',
164
+ 'marginLeft',
165
+ 'marginRight',
166
+ 'marginTop',
167
+ 'marginBottom',
168
+ 'borderLeftWidth',
169
+ 'borderRightWidth',
170
+ 'borderTopWidth',
171
+ 'borderBottomWidth'
172
+ ];
173
+
174
+ var measurementsLength = measurements.length;
175
+
176
+ function getZeroSize() {
177
+ var size = {
178
+ width: 0,
179
+ height: 0,
180
+ innerWidth: 0,
181
+ innerHeight: 0,
182
+ outerWidth: 0,
183
+ outerHeight: 0
184
+ };
185
+ for ( var i=0; i < measurementsLength; i++ ) {
186
+ var measurement = measurements[i];
187
+ size[ measurement ] = 0;
188
+ }
189
+ return size;
190
+ }
191
+
192
+ // -------------------------- getStyle -------------------------- //
193
+
194
+ /**
195
+ * getStyle, get style of element, check for Firefox bug
196
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
197
+ */
198
+ function getStyle( elem ) {
199
+ var style = getComputedStyle( elem );
200
+ if ( !style ) {
201
+ logError( 'Style returned ' + style +
202
+ '. Are you running this code in a hidden iframe on Firefox? ' +
203
+ 'See https://bit.ly/getsizebug1' );
204
+ }
205
+ return style;
206
+ }
207
+
208
+ // -------------------------- setup -------------------------- //
209
+
210
+ var isSetup = false;
211
+
212
+ var isBoxSizeOuter;
213
+
214
+ /**
215
+ * setup
216
+ * check isBoxSizerOuter
217
+ * do on first getSize() rather than on page load for Firefox bug
218
+ */
219
+ function setup() {
220
+ // setup once
221
+ if ( isSetup ) {
222
+ return;
223
+ }
224
+ isSetup = true;
225
+
226
+ // -------------------------- box sizing -------------------------- //
227
+
228
+ /**
229
+ * Chrome & Safari measure the outer-width on style.width on border-box elems
230
+ * IE11 & Firefox<29 measures the inner-width
231
+ */
232
+ var div = document.createElement('div');
233
+ div.style.width = '200px';
234
+ div.style.padding = '1px 2px 3px 4px';
235
+ div.style.borderStyle = 'solid';
236
+ div.style.borderWidth = '1px 2px 3px 4px';
237
+ div.style.boxSizing = 'border-box';
238
+
239
+ var body = document.body || document.documentElement;
240
+ body.appendChild( div );
241
+ var style = getStyle( div );
242
+ // round value for browser zoom. desandro/masonry#928
243
+ isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;
244
+ getSize.isBoxSizeOuter = isBoxSizeOuter;
245
+
246
+ body.removeChild( div );
247
+ }
248
+
249
+ // -------------------------- getSize -------------------------- //
250
+
251
+ function getSize( elem ) {
252
+ setup();
253
+
254
+ // use querySeletor if elem is string
255
+ if ( typeof elem == 'string' ) {
256
+ elem = document.querySelector( elem );
257
+ }
258
+
259
+ // do not proceed on non-objects
260
+ if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
261
+ return;
262
+ }
263
+
264
+ var style = getStyle( elem );
265
+
266
+ // if hidden, everything is 0
267
+ if ( style.display == 'none' ) {
268
+ return getZeroSize();
269
+ }
270
+
271
+ var size = {};
272
+ size.width = elem.offsetWidth;
273
+ size.height = elem.offsetHeight;
274
+
275
+ var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
276
+
277
+ // get all measurements
278
+ for ( var i=0; i < measurementsLength; i++ ) {
279
+ var measurement = measurements[i];
280
+ var value = style[ measurement ];
281
+ var num = parseFloat( value );
282
+ // any 'auto', 'medium' value will be 0
283
+ size[ measurement ] = !isNaN( num ) ? num : 0;
284
+ }
285
+
286
+ var paddingWidth = size.paddingLeft + size.paddingRight;
287
+ var paddingHeight = size.paddingTop + size.paddingBottom;
288
+ var marginWidth = size.marginLeft + size.marginRight;
289
+ var marginHeight = size.marginTop + size.marginBottom;
290
+ var borderWidth = size.borderLeftWidth + size.borderRightWidth;
291
+ var borderHeight = size.borderTopWidth + size.borderBottomWidth;
292
+
293
+ var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
294
+
295
+ // overwrite width and height if we can get it from style
296
+ var styleWidth = getStyleSize( style.width );
297
+ if ( styleWidth !== false ) {
298
+ size.width = styleWidth +
299
+ // add padding and border unless it's already including it
300
+ ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
301
+ }
302
+
303
+ var styleHeight = getStyleSize( style.height );
304
+ if ( styleHeight !== false ) {
305
+ size.height = styleHeight +
306
+ // add padding and border unless it's already including it
307
+ ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
308
+ }
309
+
310
+ size.innerWidth = size.width - ( paddingWidth + borderWidth );
311
+ size.innerHeight = size.height - ( paddingHeight + borderHeight );
312
+
313
+ size.outerWidth = size.width + marginWidth;
314
+ size.outerHeight = size.height + marginHeight;
315
+
316
+ return size;
317
+ }
318
+
319
+ return getSize;
320
+
321
+ });
322
+ });
323
+
324
+ var matchesSelector = createCommonjsModule(function (module) {
325
+ /**
326
+ * matchesSelector v2.0.2
327
+ * matchesSelector( element, '.selector' )
328
+ * MIT license
329
+ */
330
+
331
+ /*jshint browser: true, strict: true, undef: true, unused: true */
332
+
333
+ ( function( window, factory ) {
334
+ // universal module definition
335
+ if ( module.exports ) {
336
+ // CommonJS
337
+ module.exports = factory();
338
+ } else {
339
+ // browser global
340
+ window.matchesSelector = factory();
341
+ }
342
+
343
+ }( window, function factory() {
344
+
345
+ var matchesMethod = ( function() {
346
+ var ElemProto = window.Element.prototype;
347
+ // check for the standard method name first
348
+ if ( ElemProto.matches ) {
349
+ return 'matches';
350
+ }
351
+ // check un-prefixed
352
+ if ( ElemProto.matchesSelector ) {
353
+ return 'matchesSelector';
354
+ }
355
+ // check vendor prefixes
356
+ var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
357
+
358
+ for ( var i=0; i < prefixes.length; i++ ) {
359
+ var prefix = prefixes[i];
360
+ var method = prefix + 'MatchesSelector';
361
+ if ( ElemProto[ method ] ) {
362
+ return method;
363
+ }
364
+ }
365
+ })();
366
+
367
+ return function matchesSelector( elem, selector ) {
368
+ return elem[ matchesMethod ]( selector );
369
+ };
370
+
371
+ }));
372
+ });
373
+
374
+ var utils = createCommonjsModule(function (module) {
375
+ /**
376
+ * Fizzy UI utils v2.0.7
377
+ * MIT license
378
+ */
379
+
380
+ /*jshint browser: true, undef: true, unused: true, strict: true */
381
+
382
+ ( function( window, factory ) {
383
+ // universal module definition
384
+ /*jshint strict: false */ /*globals define, module, require */
385
+
386
+ if ( module.exports ) {
387
+ // CommonJS
388
+ module.exports = factory(
389
+ window,
390
+ matchesSelector
391
+ );
392
+ } else {
393
+ // browser global
394
+ window.fizzyUIUtils = factory(
395
+ window,
396
+ window.matchesSelector
397
+ );
398
+ }
399
+
400
+ }( window, function factory( window, matchesSelector ) {
401
+
402
+ var utils = {};
403
+
404
+ // ----- extend ----- //
405
+
406
+ // extends objects
407
+ utils.extend = function( a, b ) {
408
+ for ( var prop in b ) {
409
+ a[ prop ] = b[ prop ];
410
+ }
411
+ return a;
412
+ };
413
+
414
+ // ----- modulo ----- //
415
+
416
+ utils.modulo = function( num, div ) {
417
+ return ( ( num % div ) + div ) % div;
418
+ };
419
+
420
+ // ----- makeArray ----- //
421
+
422
+ var arraySlice = Array.prototype.slice;
423
+
424
+ // turn element or nodeList into an array
425
+ utils.makeArray = function( obj ) {
426
+ if ( Array.isArray( obj ) ) {
427
+ // use object if already an array
428
+ return obj;
429
+ }
430
+ // return empty array if undefined or null. #6
431
+ if ( obj === null || obj === undefined ) {
432
+ return [];
433
+ }
434
+
435
+ var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
436
+ if ( isArrayLike ) {
437
+ // convert nodeList to array
438
+ return arraySlice.call( obj );
439
+ }
440
+
441
+ // array of single index
442
+ return [ obj ];
443
+ };
444
+
445
+ // ----- removeFrom ----- //
446
+
447
+ utils.removeFrom = function( ary, obj ) {
448
+ var index = ary.indexOf( obj );
449
+ if ( index != -1 ) {
450
+ ary.splice( index, 1 );
451
+ }
452
+ };
453
+
454
+ // ----- getParent ----- //
455
+
456
+ utils.getParent = function( elem, selector ) {
457
+ while ( elem.parentNode && elem != document.body ) {
458
+ elem = elem.parentNode;
459
+ if ( matchesSelector( elem, selector ) ) {
460
+ return elem;
461
+ }
462
+ }
463
+ };
464
+
465
+ // ----- getQueryElement ----- //
466
+
467
+ // use element as selector string
468
+ utils.getQueryElement = function( elem ) {
469
+ if ( typeof elem == 'string' ) {
470
+ return document.querySelector( elem );
471
+ }
472
+ return elem;
473
+ };
474
+
475
+ // ----- handleEvent ----- //
476
+
477
+ // enable .ontype to trigger from .addEventListener( elem, 'type' )
478
+ utils.handleEvent = function( event ) {
479
+ var method = 'on' + event.type;
480
+ if ( this[ method ] ) {
481
+ this[ method ]( event );
482
+ }
483
+ };
484
+
485
+ // ----- filterFindElements ----- //
486
+
487
+ utils.filterFindElements = function( elems, selector ) {
488
+ // make array of elems
489
+ elems = utils.makeArray( elems );
490
+ var ffElems = [];
491
+
492
+ elems.forEach( function( elem ) {
493
+ // check that elem is an actual element
494
+ if ( !( elem instanceof HTMLElement ) ) {
495
+ return;
496
+ }
497
+ // add elem if no selector
498
+ if ( !selector ) {
499
+ ffElems.push( elem );
500
+ return;
501
+ }
502
+ // filter & find items if we have a selector
503
+ // filter
504
+ if ( matchesSelector( elem, selector ) ) {
505
+ ffElems.push( elem );
506
+ }
507
+ // find children
508
+ var childElems = elem.querySelectorAll( selector );
509
+ // concat childElems to filterFound array
510
+ for ( var i=0; i < childElems.length; i++ ) {
511
+ ffElems.push( childElems[i] );
512
+ }
513
+ });
514
+
515
+ return ffElems;
516
+ };
517
+
518
+ // ----- debounceMethod ----- //
519
+
520
+ utils.debounceMethod = function( _class, methodName, threshold ) {
521
+ threshold = threshold || 100;
522
+ // original method
523
+ var method = _class.prototype[ methodName ];
524
+ var timeoutName = methodName + 'Timeout';
525
+
526
+ _class.prototype[ methodName ] = function() {
527
+ var timeout = this[ timeoutName ];
528
+ clearTimeout( timeout );
529
+
530
+ var args = arguments;
531
+ var _this = this;
532
+ this[ timeoutName ] = setTimeout( function() {
533
+ method.apply( _this, args );
534
+ delete _this[ timeoutName ];
535
+ }, threshold );
536
+ };
537
+ };
538
+
539
+ // ----- docReady ----- //
540
+
541
+ utils.docReady = function( callback ) {
542
+ var readyState = document.readyState;
543
+ if ( readyState == 'complete' || readyState == 'interactive' ) {
544
+ // do async to allow for other scripts to run. metafizzy/flickity#441
545
+ setTimeout( callback );
546
+ } else {
547
+ document.addEventListener( 'DOMContentLoaded', callback );
548
+ }
549
+ };
550
+
551
+ // ----- htmlInit ----- //
552
+
553
+ // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
554
+ utils.toDashed = function( str ) {
555
+ return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
556
+ return $1 + '-' + $2;
557
+ }).toLowerCase();
558
+ };
559
+
560
+ var console = window.console;
561
+ /**
562
+ * allow user to initialize classes via [data-namespace] or .js-namespace class
563
+ * htmlInit( Widget, 'widgetName' )
564
+ * options are parsed from data-namespace-options
565
+ */
566
+ utils.htmlInit = function( WidgetClass, namespace ) {
567
+ utils.docReady( function() {
568
+ var dashedNamespace = utils.toDashed( namespace );
569
+ var dataAttr = 'data-' + dashedNamespace;
570
+ var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
571
+ var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
572
+ var elems = utils.makeArray( dataAttrElems )
573
+ .concat( utils.makeArray( jsDashElems ) );
574
+ var dataOptionsAttr = dataAttr + '-options';
575
+ var jQuery = window.jQuery;
576
+
577
+ elems.forEach( function( elem ) {
578
+ var attr = elem.getAttribute( dataAttr ) ||
579
+ elem.getAttribute( dataOptionsAttr );
580
+ var options;
581
+ try {
582
+ options = attr && JSON.parse( attr );
583
+ } catch ( error ) {
584
+ // log error, do not initialize
585
+ if ( console ) {
586
+ console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
587
+ ': ' + error );
588
+ }
589
+ return;
590
+ }
591
+ // initialize
592
+ var instance = new WidgetClass( elem, options );
593
+ // make available via $().data('namespace')
594
+ if ( jQuery ) {
595
+ jQuery.data( elem, namespace, instance );
596
+ }
597
+ });
598
+
599
+ });
600
+ };
601
+
602
+ // ----- ----- //
603
+
604
+ return utils;
605
+
606
+ }));
607
+ });
608
+
609
+ function Cell(elem, parent) {
610
+ this.element = elem;
611
+ this.parent = parent;
612
+
613
+ this.create();
614
+ }
615
+
616
+ var proto$b = Cell.prototype;
617
+
618
+ proto$b.create = function () {
619
+ this.element.style.position = 'absolute';
620
+ this.element.setAttribute('aria-hidden', 'true');
621
+ this.x = 0;
622
+ this.shift = 0;
623
+ Array.from(this.element.querySelectorAll('*')).forEach((element) => {
624
+ element.setAttribute('tabindex', '-1');
625
+ });
626
+ };
627
+
628
+ proto$b.destroy = function () {
629
+ // reset style
630
+ this.unselect();
631
+ this.element.style.position = '';
632
+ var side = this.parent.originSide;
633
+ this.element.style[side] = '';
634
+ };
635
+
636
+ proto$b.getSize = function () {
637
+ this.size = getSize(this.element);
638
+ };
639
+
640
+ proto$b.setPosition = function (x) {
641
+ this.x = x;
642
+ this.updateTarget();
643
+ this.renderPosition(x);
644
+ };
645
+
646
+ // setDefaultTarget v1 method, backwards compatibility, remove in v3
647
+ proto$b.updateTarget = proto$b.setDefaultTarget = function () {
648
+ var marginProperty =
649
+ this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight';
650
+ this.target =
651
+ this.x +
652
+ this.size[marginProperty] +
653
+ this.size.width * this.parent.cellAlign;
654
+ };
655
+
656
+ proto$b.renderPosition = function (x) {
657
+ // render position of cell with in slider
658
+ var side = this.parent.originSide;
659
+ this.element.style[side] = this.parent.getPositionValue(x);
660
+ };
661
+
662
+ proto$b.select = function () {
663
+ this.element.classList.add('is-selected');
664
+ this.element.removeAttribute('aria-hidden');
665
+ Array.from(this.element.querySelectorAll('*')).forEach((element) => {
666
+ element.removeAttribute('tabindex');
667
+ });
668
+ };
669
+
670
+ proto$b.unselect = function () {
671
+ this.element.classList.remove('is-selected');
672
+ this.element.setAttribute('aria-hidden', 'true');
673
+ Array.from(this.element.querySelectorAll('*')).forEach((element) => {
674
+ element.setAttribute('tabindex', '-1');
675
+ });
676
+ };
677
+
678
+ /**
679
+ * @param {Integer} factor - 0, 1, or -1
680
+ **/
681
+ proto$b.wrapShift = function (shift) {
682
+ this.shift = shift;
683
+ this.renderPosition(this.x + this.parent.slideableWidth * shift);
684
+ };
685
+
686
+ proto$b.remove = function () {
687
+ this.element.parentNode.removeChild(this.element);
688
+ };
689
+
690
+ function Slide$1(parent) {
691
+ this.parent = parent;
692
+ this.isOriginLeft = parent.originSide == 'left';
693
+ this.cells = [];
694
+ this.outerWidth = 0;
695
+ this.height = 0;
696
+ }
697
+
698
+ var proto$a = Slide$1.prototype;
699
+
700
+ proto$a.addCell = function (cell) {
701
+ this.cells.push(cell);
702
+ this.outerWidth += cell.size.outerWidth;
703
+ this.height = Math.max(cell.size.outerHeight, this.height);
704
+ // first cell stuff
705
+ if (this.cells.length == 1) {
706
+ this.x = cell.x; // x comes from first cell
707
+ var beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight';
708
+ this.firstMargin = cell.size[beginMargin];
709
+ }
710
+ };
711
+
712
+ proto$a.updateTarget = function () {
713
+ var endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft';
714
+ var lastCell = this.getLastCell();
715
+ var lastMargin = lastCell ? lastCell.size[endMargin] : 0;
716
+ var slideWidth = this.outerWidth - (this.firstMargin + lastMargin);
717
+ this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign;
718
+ };
719
+
720
+ proto$a.getLastCell = function () {
721
+ return this.cells[this.cells.length - 1];
722
+ };
723
+
724
+ proto$a.select = function () {
725
+ this.cells.forEach(function (cell) {
726
+ cell.select();
727
+ });
728
+ };
729
+
730
+ proto$a.unselect = function () {
731
+ this.cells.forEach(function (cell) {
732
+ cell.unselect();
733
+ });
734
+ };
735
+
736
+ proto$a.getCellElements = function () {
737
+ return this.cells.map(function (cell) {
738
+ return cell.element;
739
+ });
740
+ };
741
+
742
+ const proto$9 = {};
743
+
744
+ proto$9.startAnimation = function () {
745
+ if (this.isAnimating) {
746
+ return;
747
+ }
748
+
749
+ this.isAnimating = true;
750
+ this.restingFrames = 0;
751
+ this.animate();
752
+ };
753
+
754
+ proto$9.animate = function () {
755
+ this.applyDragForce();
756
+ this.applySelectedAttraction();
757
+
758
+ var previousX = this.x;
759
+
760
+ this.integratePhysics();
761
+ this.positionSlider();
762
+ this.settle(previousX);
763
+ // animate next frame
764
+ if (this.isAnimating) {
765
+ var _this = this;
766
+ requestAnimationFrame(function animateFrame() {
767
+ _this.animate();
768
+ });
769
+ }
770
+ };
771
+
772
+ proto$9.positionSlider = function () {
773
+ var x = this.x;
774
+ // wrap position around
775
+ if (this.options.wrapAround && this.cells.length > 1) {
776
+ x = utils.modulo(x, this.slideableWidth);
777
+ x = x - this.slideableWidth;
778
+ this.shiftWrapCells(x);
779
+ }
780
+
781
+ this.setTranslateX(x, this.isAnimating);
782
+ this.dispatchScrollEvent();
783
+ };
784
+
785
+ proto$9.setTranslateX = function (x, is3d) {
786
+ x += this.cursorPosition;
787
+ // reverse if right-to-left and using transform
788
+ x = this.options.rightToLeft ? -x : x;
789
+ var translateX = this.getPositionValue(x);
790
+ // use 3D tranforms for hardware acceleration on iOS
791
+ // but use 2D when settled, for better font-rendering
792
+ this.slider.style.transform = is3d
793
+ ? 'translate3d(' + translateX + ',0,0)'
794
+ : 'translateX(' + translateX + ')';
795
+ };
796
+
797
+ proto$9.dispatchScrollEvent = function () {
798
+ var firstSlide = this.slides[0];
799
+ if (!firstSlide) {
800
+ return;
801
+ }
802
+ var positionX = -this.x - firstSlide.target;
803
+ var progress = positionX / this.slidesWidth;
804
+ this.dispatchEvent('scroll', null, [progress, positionX]);
805
+ };
806
+
807
+ proto$9.positionSliderAtSelected = function () {
808
+ if (!this.cells.length) {
809
+ return;
810
+ }
811
+ this.x = -this.selectedSlide.target;
812
+ this.velocity = 0; // stop wobble
813
+ this.positionSlider();
814
+ };
815
+
816
+ proto$9.getPositionValue = function (position) {
817
+ if (this.options.percentPosition) {
818
+ // percent position, round to 2 digits, like 12.34%
819
+ return Math.round((position / this.size.innerWidth) * 10000) * 0.01 + '%';
820
+ } else {
821
+ // pixel positioning
822
+ return Math.round(position) + 'px';
823
+ }
824
+ };
825
+
826
+ proto$9.settle = function (previousX) {
827
+ // keep track of frames where x hasn't moved
828
+ if (
829
+ !this.isPointerDown &&
830
+ Math.round(this.x * 100) == Math.round(previousX * 100)
831
+ ) {
832
+ this.restingFrames++;
833
+ }
834
+ // stop animating if resting for 3 or more frames
835
+ if (this.restingFrames > 2) {
836
+ this.isAnimating = false;
837
+ delete this.isFreeScrolling;
838
+ // render position with translateX when settled
839
+ this.positionSlider();
840
+ this.dispatchEvent('settle', null, [this.selectedIndex]);
841
+ }
842
+ };
843
+
844
+ proto$9.shiftWrapCells = function (x) {
845
+ // shift before cells
846
+ var beforeGap = this.cursorPosition + x;
847
+ this._shiftCells(this.beforeShiftCells, beforeGap, -1);
848
+ // shift after cells
849
+ var afterGap =
850
+ this.size.innerWidth - (x + this.slideableWidth + this.cursorPosition);
851
+ this._shiftCells(this.afterShiftCells, afterGap, 1);
852
+ };
853
+
854
+ proto$9._shiftCells = function (cells, gap, shift) {
855
+ for (var i = 0; i < cells.length; i++) {
856
+ var cell = cells[i];
857
+ var cellShift = gap > 0 ? shift : 0;
858
+ cell.wrapShift(cellShift);
859
+ gap -= cell.size.outerWidth;
860
+ }
861
+ };
862
+
863
+ proto$9._unshiftCells = function (cells) {
864
+ if (!cells || !cells.length) {
865
+ return;
866
+ }
867
+ for (var i = 0; i < cells.length; i++) {
868
+ cells[i].wrapShift(0);
869
+ }
870
+ };
871
+
872
+ // -------------------------- physics -------------------------- //
873
+
874
+ proto$9.integratePhysics = function () {
875
+ this.x += this.velocity;
876
+ this.velocity *= this.getFrictionFactor();
877
+ };
878
+
879
+ proto$9.applyForce = function (force) {
880
+ this.velocity += force;
881
+ };
882
+
883
+ proto$9.getFrictionFactor = function () {
884
+ return (
885
+ 1 - this.options[this.isFreeScrolling ? 'freeScrollFriction' : 'friction']
886
+ );
887
+ };
888
+
889
+ proto$9.getRestingPosition = function () {
890
+ // my thanks to Steven Wittens, who simplified this math greatly
891
+ return this.x + this.velocity / (1 - this.getFrictionFactor());
892
+ };
893
+
894
+ proto$9.applyDragForce = function () {
895
+ if (!this.isDraggable || !this.isPointerDown) {
896
+ return;
897
+ }
898
+ // change the position to drag position by applying force
899
+ var dragVelocity = this.dragX - this.x;
900
+ var dragForce = dragVelocity - this.velocity;
901
+ this.applyForce(dragForce);
902
+ };
903
+
904
+ proto$9.applySelectedAttraction = function () {
905
+ // do not attract if pointer down or no slides
906
+ var dragDown = this.isDraggable && this.isPointerDown;
907
+ if (dragDown || this.isFreeScrolling || !this.slides.length) {
908
+ return;
909
+ }
910
+ var distance = this.selectedSlide.target * -1 - this.x;
911
+ var force = distance * this.options.selectedAttraction;
912
+ this.applyForce(force);
913
+ };
914
+
915
+ // vars
916
+ var getComputedStyle$1 = window.getComputedStyle;
917
+ var console$1 = window.console;
918
+
919
+ function moveElements(elems, toElem) {
920
+ elems = utils.makeArray(elems);
921
+ while (elems.length) {
922
+ toElem.appendChild(elems.shift());
923
+ }
924
+ }
925
+
926
+ // -------------------------- Flickity -------------------------- //
927
+
928
+ // globally unique identifiers
929
+ var GUID = 0;
930
+ // internal store of all Flickity intances
931
+ var instances = {};
932
+
933
+ function Flickity(element, options) {
934
+ var queryElement = utils.getQueryElement(element);
935
+ if (!queryElement) {
936
+ if (console$1) {
937
+ console$1.error('Bad element for Flickity: ' + (queryElement || element));
938
+ }
939
+ return;
940
+ }
941
+ this.element = queryElement;
942
+ // do not initialize twice on same element
943
+ if (this.element.flickityGUID) {
944
+ var instance = instances[this.element.flickityGUID];
945
+ if (!instances[this.element.flickityGUID]) return;
946
+ instance.option(options);
947
+ return instance;
948
+ }
949
+
950
+ // options
951
+ this.options = utils.extend({}, this.constructor.defaults);
952
+ this.option(options);
953
+
954
+ // kick things off
955
+ this._create();
956
+ }
957
+
958
+ Flickity.defaults = {
959
+ accessibility: true,
960
+ // adaptiveHeight: false,
961
+ cellAlign: 'center',
962
+ // cellSelector: undefined,
963
+ // contain: false,
964
+ freeScrollFriction: 0.075, // friction when free-scrolling
965
+ friction: 0.28, // friction when selecting
966
+ namespaceJQueryEvents: true,
967
+ // initialIndex: 0,
968
+ percentPosition: true,
969
+ resize: true,
970
+ selectedAttraction: 0.025,
971
+ setGallerySize: true,
972
+ // watchCSS: false,
973
+ // wrapAround: false
974
+ };
975
+
976
+ // hash of methods triggered on _create()
977
+ Flickity.createMethods = [];
978
+
979
+ var proto$8 = Flickity.prototype;
980
+ // inherit EventEmitter
981
+ utils.extend(proto$8, evEmitter.prototype);
982
+
983
+ proto$8._create = function () {
984
+ // add id for Flickity.data
985
+ var id = (this.guid = ++GUID);
986
+ this.element.flickityGUID = id; // expando
987
+ instances[id] = this; // associate via id
988
+ // initial properties
989
+ this.selectedIndex = 0;
990
+ // how many frames slider has been in same position
991
+ this.restingFrames = 0;
992
+ // initial physics properties
993
+ this.x = 0;
994
+ this.velocity = 0;
995
+ this.originSide = this.options.rightToLeft ? 'right' : 'left';
996
+ // create viewport & slider
997
+ this.viewport = document.createElement('div');
998
+ this.viewport.className = 'flickity-viewport';
999
+ this._createSlider();
1000
+
1001
+ if (this.options.resize || this.options.watchCSS) {
1002
+ window.addEventListener('resize', this);
1003
+ }
1004
+
1005
+ // add listeners from on option
1006
+ for (var eventName in this.options.on) {
1007
+ var listener = this.options.on[eventName];
1008
+ this.on(eventName, listener);
1009
+ }
1010
+
1011
+ Flickity.createMethods.forEach(function (method) {
1012
+ this[method]();
1013
+ }, this);
1014
+
1015
+ if (this.options.watchCSS) {
1016
+ this.watchCSS();
1017
+ } else {
1018
+ this.activate();
1019
+ }
1020
+ };
1021
+
1022
+ /**
1023
+ * set options
1024
+ * @param {Object} opts
1025
+ */
1026
+ proto$8.option = function (opts) {
1027
+ utils.extend(this.options, opts);
1028
+ };
1029
+
1030
+ proto$8.activate = function () {
1031
+ if (this.isActive) {
1032
+ return;
1033
+ }
1034
+ this.isActive = true;
1035
+ this.element.classList.add('flickity-enabled');
1036
+ if (this.options.rightToLeft) {
1037
+ this.element.classList.add('flickity-rtl');
1038
+ }
1039
+
1040
+ this.getSize();
1041
+ // move initial cell elements so they can be loaded as cells
1042
+ var cellElems = this.element.children; //this._filterFindCellElements( this.element.children );
1043
+ moveElements(cellElems, this.slider);
1044
+ this.viewport.appendChild(this.slider);
1045
+ this.element.appendChild(this.viewport);
1046
+ // get cells from children
1047
+ this.reloadCells();
1048
+
1049
+ if (this.options.accessibility) {
1050
+ // allow element to focusable
1051
+ this.element.tabIndex = 0;
1052
+ // listen for key presses
1053
+ this.element.addEventListener('keydown', this);
1054
+ }
1055
+
1056
+ this.emitEvent('activate');
1057
+ this.selectInitialIndex();
1058
+ // flag for initial activation, for using initialIndex
1059
+ this.isInitActivated = true;
1060
+ // ready event. #493
1061
+ this.dispatchEvent('ready');
1062
+ };
1063
+
1064
+ // slider positions the cells
1065
+ proto$8._createSlider = function () {
1066
+ // slider element does all the positioning
1067
+ var slider = document.createElement('div');
1068
+ slider.className = 'flickity-slider';
1069
+ slider.style[this.originSide] = 0;
1070
+ this.slider = slider;
1071
+ };
1072
+
1073
+ proto$8._filterFindCellElements = function (elems) {
1074
+ return utils.filterFindElements(elems, this.options.cellSelector);
1075
+ };
1076
+
1077
+ // goes through all children
1078
+ proto$8.reloadCells = function () {
1079
+ // collection of item elements
1080
+ this.cells = this._makeCells(
1081
+ this.slider.getRootNode().host
1082
+ ? this.slider.getRootNode().host.children
1083
+ : this.slider.children
1084
+ );
1085
+ this.positionCells();
1086
+ this._getWrapShiftCells();
1087
+ this.setGallerySize();
1088
+ };
1089
+
1090
+ /**
1091
+ * turn elements into Flickity.Cells
1092
+ * @param {Array or NodeList or HTMLElement} elems
1093
+ * @returns {Array} items - collection of new Flickity Cells
1094
+ */
1095
+ proto$8._makeCells = function (elems) {
1096
+ var cellElems = this._filterFindCellElements(elems);
1097
+
1098
+ // create new Flickity for collection
1099
+ var cells = cellElems.map(function (cellElem) {
1100
+ return new Cell(cellElem, this);
1101
+ }, this);
1102
+
1103
+ return cells;
1104
+ };
1105
+
1106
+ proto$8.getLastCell = function () {
1107
+ return this.cells[this.cells.length - 1];
1108
+ };
1109
+
1110
+ proto$8.getLastSlide = function () {
1111
+ return this.slides[this.slides.length - 1];
1112
+ };
1113
+
1114
+ // positions all cells
1115
+ proto$8.positionCells = function () {
1116
+ // size all cells
1117
+ this._sizeCells(this.cells);
1118
+ // position all cells
1119
+ this._positionCells(0);
1120
+ };
1121
+
1122
+ /**
1123
+ * position certain cells
1124
+ * @param {Integer} index - which cell to start with
1125
+ */
1126
+ proto$8._positionCells = function (index) {
1127
+ index = index || 0;
1128
+ // also measure maxCellHeight
1129
+ // start 0 if positioning all cells
1130
+ this.maxCellHeight = index ? this.maxCellHeight || 0 : 0;
1131
+ var cellX = 0;
1132
+ // get cellX
1133
+ if (index > 0) {
1134
+ var startCell = this.cells[index - 1];
1135
+ cellX = startCell.x + startCell.size.outerWidth;
1136
+ }
1137
+ var len = this.cells.length;
1138
+ for (var i = index; i < len; i++) {
1139
+ var cell = this.cells[i];
1140
+ cell.setPosition(cellX);
1141
+ cellX += cell.size.outerWidth;
1142
+ this.maxCellHeight = Math.max(cell.size.outerHeight, this.maxCellHeight);
1143
+ }
1144
+ // keep track of cellX for wrap-around
1145
+ this.slideableWidth = cellX;
1146
+ // slides
1147
+ this.updateSlides();
1148
+ // contain slides target
1149
+ this._containSlides();
1150
+ // update slidesWidth
1151
+ this.slidesWidth = len
1152
+ ? this.getLastSlide().target - this.slides[0].target
1153
+ : 0;
1154
+ };
1155
+
1156
+ /**
1157
+ * cell.getSize() on multiple cells
1158
+ * @param {Array} cells
1159
+ */
1160
+ proto$8._sizeCells = function (cells) {
1161
+ cells.forEach(function (cell) {
1162
+ cell.getSize();
1163
+ });
1164
+ };
1165
+
1166
+ // -------------------------- -------------------------- //
1167
+
1168
+ proto$8.updateSlides = function () {
1169
+ this.slides = [];
1170
+ if (!this.cells.length) {
1171
+ return;
1172
+ }
1173
+
1174
+ var slide = new Slide$1(this);
1175
+ this.slides.push(slide);
1176
+ var isOriginLeft = this.originSide == 'left';
1177
+ var nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft';
1178
+
1179
+ var canCellFit = this._getCanCellFit();
1180
+
1181
+ this.cells.forEach(function (cell, i) {
1182
+ // just add cell if first cell in slide
1183
+ if (!slide.cells.length) {
1184
+ slide.addCell(cell);
1185
+ return;
1186
+ }
1187
+
1188
+ var slideWidth =
1189
+ slide.outerWidth -
1190
+ slide.firstMargin +
1191
+ (cell.size.outerWidth - cell.size[nextMargin]);
1192
+
1193
+ if (canCellFit.call(this, i, slideWidth)) {
1194
+ slide.addCell(cell);
1195
+ } else {
1196
+ // doesn't fit, new slide
1197
+ slide.updateTarget();
1198
+
1199
+ slide = new Slide$1(this);
1200
+ this.slides.push(slide);
1201
+ slide.addCell(cell);
1202
+ }
1203
+ }, this);
1204
+ // last slide
1205
+ slide.updateTarget();
1206
+ // update .selectedSlide
1207
+ this.updateSelectedSlide();
1208
+ };
1209
+
1210
+ proto$8._getCanCellFit = function () {
1211
+ var groupCells = this.options.groupCells;
1212
+ if (!groupCells) {
1213
+ return function () {
1214
+ return false;
1215
+ };
1216
+ } else if (typeof groupCells == 'number') {
1217
+ // group by number. 3 -> [0,1,2], [3,4,5], ...
1218
+ var number = parseInt(groupCells, 10);
1219
+ return function (i) {
1220
+ return i % number !== 0;
1221
+ };
1222
+ }
1223
+ // default, group by width of slide
1224
+ // parse '75%
1225
+ var percentMatch =
1226
+ typeof groupCells == 'string' && groupCells.match(/^(\d+)%$/);
1227
+ var percent = percentMatch ? parseInt(percentMatch[1], 10) / 100 : 1;
1228
+ return function (i, slideWidth) {
1229
+ return slideWidth <= (this.size.innerWidth + 1) * percent;
1230
+ };
1231
+ };
1232
+
1233
+ // alias _init for jQuery plugin .flickity()
1234
+ proto$8._init = proto$8.reposition = function () {
1235
+ this.positionCells();
1236
+ this.positionSliderAtSelected();
1237
+ };
1238
+
1239
+ proto$8.getSize = function () {
1240
+ this.size = getSize(this.element);
1241
+ this.setCellAlign();
1242
+ this.cursorPosition = this.size.innerWidth * this.cellAlign;
1243
+ };
1244
+
1245
+ var cellAlignShorthands = {
1246
+ // cell align, then based on origin side
1247
+ center: {
1248
+ left: 0.5,
1249
+ right: 0.5,
1250
+ },
1251
+ left: {
1252
+ left: 0,
1253
+ right: 1,
1254
+ },
1255
+ right: {
1256
+ right: 0,
1257
+ left: 1,
1258
+ },
1259
+ };
1260
+
1261
+ proto$8.setCellAlign = function () {
1262
+ var shorthand = cellAlignShorthands[this.options.cellAlign];
1263
+ this.cellAlign = shorthand
1264
+ ? shorthand[this.originSide]
1265
+ : this.options.cellAlign;
1266
+ };
1267
+
1268
+ proto$8.setGallerySize = function () {
1269
+ if (this.options.setGallerySize) {
1270
+ var height =
1271
+ this.options.adaptiveHeight && this.selectedSlide
1272
+ ? this.selectedSlide.height
1273
+ : this.maxCellHeight;
1274
+ this.viewport.style.height = height + 'px';
1275
+ }
1276
+ };
1277
+
1278
+ proto$8._getWrapShiftCells = function () {
1279
+ // only for wrap-around
1280
+ if (!this.options.wrapAround) {
1281
+ return;
1282
+ }
1283
+ // unshift previous cells
1284
+ this._unshiftCells(this.beforeShiftCells);
1285
+ this._unshiftCells(this.afterShiftCells);
1286
+ // get before cells
1287
+ // initial gap
1288
+ var gapX = this.cursorPosition;
1289
+ var cellIndex = this.cells.length - 1;
1290
+ this.beforeShiftCells = this._getGapCells(gapX, cellIndex, -1);
1291
+ // get after cells
1292
+ // ending gap between last cell and end of gallery viewport
1293
+ gapX = this.size.innerWidth - this.cursorPosition;
1294
+ // start cloning at first cell, working forwards
1295
+ this.afterShiftCells = this._getGapCells(gapX, 0, 1);
1296
+ };
1297
+
1298
+ proto$8._getGapCells = function (gapX, cellIndex, increment) {
1299
+ // keep adding cells until the cover the initial gap
1300
+ var cells = [];
1301
+ while (gapX > 0) {
1302
+ var cell = this.cells[cellIndex];
1303
+ if (!cell) {
1304
+ break;
1305
+ }
1306
+ cells.push(cell);
1307
+ cellIndex += increment;
1308
+ gapX -= cell.size.outerWidth;
1309
+ }
1310
+ return cells;
1311
+ };
1312
+
1313
+ // ----- contain ----- //
1314
+
1315
+ // contain cell targets so no excess sliding
1316
+ proto$8._containSlides = function () {
1317
+ if (!this.options.contain || this.options.wrapAround || !this.cells.length) {
1318
+ return;
1319
+ }
1320
+ var isRightToLeft = this.options.rightToLeft;
1321
+ var beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft';
1322
+ var endMargin = isRightToLeft ? 'marginLeft' : 'marginRight';
1323
+ var contentWidth = this.slideableWidth - this.getLastCell().size[endMargin];
1324
+ // content is less than gallery size
1325
+ var isContentSmaller = contentWidth < this.size.innerWidth;
1326
+ // bounds
1327
+ var beginBound = this.cursorPosition + this.cells[0].size[beginMargin];
1328
+ var endBound = contentWidth - this.size.innerWidth * (1 - this.cellAlign);
1329
+ // contain each cell target
1330
+ this.slides.forEach(function (slide) {
1331
+ if (isContentSmaller) {
1332
+ // all cells fit inside gallery
1333
+ slide.target = contentWidth * this.cellAlign;
1334
+ } else {
1335
+ // contain to bounds
1336
+ slide.target = Math.max(slide.target, beginBound);
1337
+ slide.target = Math.min(slide.target, endBound);
1338
+ }
1339
+ }, this);
1340
+ };
1341
+
1342
+ // ----- ----- //
1343
+
1344
+ /**
1345
+ * emits events via eventEmitter and jQuery events
1346
+ * @param {String} type - name of event
1347
+ * @param {Event} event - original event
1348
+ * @param {Array} args - extra arguments
1349
+ */
1350
+ proto$8.dispatchEvent = function (type, event, args) {
1351
+ var emitArgs = event ? [event].concat(args) : args;
1352
+ this.emitEvent(type, emitArgs);
1353
+ };
1354
+
1355
+ // -------------------------- select -------------------------- //
1356
+
1357
+ /**
1358
+ * @param {Integer} index - index of the slide
1359
+ * @param {Boolean} isWrap - will wrap-around to last/first if at the end
1360
+ * @param {Boolean} isInstant - will immediately set position at selected cell
1361
+ */
1362
+ proto$8.select = function (index, isWrap, isInstant) {
1363
+ if (!this.isActive) {
1364
+ return;
1365
+ }
1366
+ index = parseInt(index, 10);
1367
+ this._wrapSelect(index);
1368
+
1369
+ if (this.options.wrapAround || isWrap) {
1370
+ index = utils.modulo(index, this.slides.length);
1371
+ }
1372
+ // bail if invalid index
1373
+ if (!this.slides[index]) {
1374
+ return;
1375
+ }
1376
+ var prevIndex = this.selectedIndex;
1377
+ this.selectedIndex = index;
1378
+ this.updateSelectedSlide();
1379
+ if (isInstant) {
1380
+ this.positionSliderAtSelected();
1381
+ } else {
1382
+ this.startAnimation();
1383
+ }
1384
+ if (this.options.adaptiveHeight) {
1385
+ this.setGallerySize();
1386
+ }
1387
+ // events
1388
+ this.dispatchEvent('select', null, [index]);
1389
+ // change event if new index
1390
+ if (index != prevIndex) {
1391
+ this.dispatchEvent('change', null, [index]);
1392
+ }
1393
+ // old v1 event name, remove in v3
1394
+ this.dispatchEvent('cellSelect');
1395
+ };
1396
+
1397
+ // wraps position for wrapAround, to move to closest slide. #113
1398
+ proto$8._wrapSelect = function (index) {
1399
+ var len = this.slides.length;
1400
+ var isWrapping = this.options.wrapAround && len > 1;
1401
+ if (!isWrapping) {
1402
+ return index;
1403
+ }
1404
+ var wrapIndex = utils.modulo(index, len);
1405
+ // go to shortest
1406
+ var delta = Math.abs(wrapIndex - this.selectedIndex);
1407
+ var backWrapDelta = Math.abs(wrapIndex + len - this.selectedIndex);
1408
+ var forewardWrapDelta = Math.abs(wrapIndex - len - this.selectedIndex);
1409
+ if (!this.isDragSelect && backWrapDelta < delta) {
1410
+ index += len;
1411
+ } else if (!this.isDragSelect && forewardWrapDelta < delta) {
1412
+ index -= len;
1413
+ }
1414
+ // wrap position so slider is within normal area
1415
+ if (index < 0) {
1416
+ this.x -= this.slideableWidth;
1417
+ } else if (index >= len) {
1418
+ this.x += this.slideableWidth;
1419
+ }
1420
+ };
1421
+
1422
+ proto$8.previous = function (isWrap, isInstant) {
1423
+ this.select(this.selectedIndex - 1, isWrap, isInstant);
1424
+ };
1425
+
1426
+ proto$8.next = function (isWrap, isInstant) {
1427
+ this.select(this.selectedIndex + 1, isWrap, isInstant);
1428
+ };
1429
+
1430
+ proto$8.updateSelectedSlide = function () {
1431
+ var slide = this.slides[this.selectedIndex];
1432
+ // selectedIndex could be outside of slides, if triggered before resize()
1433
+ if (!slide) {
1434
+ return;
1435
+ }
1436
+ // unselect previous selected slide
1437
+ this.unselectSelectedSlide();
1438
+ // update new selected slide
1439
+ this.selectedSlide = slide;
1440
+ slide.select();
1441
+ this.selectedCells = slide.cells;
1442
+ this.selectedElements = slide.getCellElements();
1443
+ // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility
1444
+ // Remove in v3?
1445
+ this.selectedCell = slide.cells[0];
1446
+ this.selectedElement = this.selectedElements[0];
1447
+ };
1448
+
1449
+ proto$8.unselectSelectedSlide = function () {
1450
+ if (this.selectedSlide) {
1451
+ this.selectedSlide.unselect();
1452
+ }
1453
+ };
1454
+
1455
+ proto$8.selectInitialIndex = function () {
1456
+ var initialIndex = this.options.initialIndex;
1457
+ // already activated, select previous selectedIndex
1458
+ if (this.isInitActivated) {
1459
+ this.select(this.selectedIndex, false, true);
1460
+ return;
1461
+ }
1462
+ // select with selector string
1463
+ if (initialIndex && typeof initialIndex == 'string') {
1464
+ var cell = this.queryCell(initialIndex);
1465
+ if (cell) {
1466
+ this.selectCell(initialIndex, false, true);
1467
+ return;
1468
+ }
1469
+ }
1470
+
1471
+ var index = 0;
1472
+ // select with number
1473
+ if (initialIndex && this.slides[initialIndex]) {
1474
+ index = initialIndex;
1475
+ }
1476
+ // select instantly
1477
+ this.select(index, false, true);
1478
+ };
1479
+
1480
+ /**
1481
+ * select slide from number or cell element
1482
+ * @param {Element or Number} elem
1483
+ */
1484
+ proto$8.selectCell = function (value, isWrap, isInstant) {
1485
+ // get cell
1486
+ var cell = this.queryCell(value);
1487
+ if (!cell) {
1488
+ return;
1489
+ }
1490
+
1491
+ var index = this.getCellSlideIndex(cell);
1492
+ this.select(index, isWrap, isInstant);
1493
+ };
1494
+
1495
+ proto$8.getCellSlideIndex = function (cell) {
1496
+ // get index of slides that has cell
1497
+ for (var i = 0; i < this.slides.length; i++) {
1498
+ var slide = this.slides[i];
1499
+ var index = slide.cells.indexOf(cell);
1500
+ if (index != -1) {
1501
+ return i;
1502
+ }
1503
+ }
1504
+ };
1505
+
1506
+ // -------------------------- get cells -------------------------- //
1507
+
1508
+ /**
1509
+ * get Flickity.Cell, given an Element
1510
+ * @param {Element} elem
1511
+ * @returns {Flickity.Cell} item
1512
+ */
1513
+ proto$8.getCell = function (elem) {
1514
+ // loop through cells to get the one that matches
1515
+ for (var i = 0; i < this.cells.length; i++) {
1516
+ var cell = this.cells[i];
1517
+ if (cell.element == elem) {
1518
+ return cell;
1519
+ }
1520
+ }
1521
+ };
1522
+
1523
+ /**
1524
+ * get collection of Flickity.Cells, given Elements
1525
+ * @param {Element, Array, NodeList} elems
1526
+ * @returns {Array} cells - Flickity.Cells
1527
+ */
1528
+ proto$8.getCells = function (elems) {
1529
+ elems = utils.makeArray(elems);
1530
+ var cells = [];
1531
+ elems.forEach(function (elem) {
1532
+ var cell = this.getCell(elem);
1533
+ if (cell) {
1534
+ cells.push(cell);
1535
+ }
1536
+ }, this);
1537
+ return cells;
1538
+ };
1539
+
1540
+ /**
1541
+ * get cell elements
1542
+ * @returns {Array} cellElems
1543
+ */
1544
+ proto$8.getCellElements = function () {
1545
+ return this.cells.map(function (cell) {
1546
+ return cell.element;
1547
+ });
1548
+ };
1549
+
1550
+ /**
1551
+ * get parent cell from an element
1552
+ * @param {Element} elem
1553
+ * @returns {Flickit.Cell} cell
1554
+ */
1555
+ proto$8.getParentCell = function (elem) {
1556
+ // first check if elem is cell
1557
+ var cell = this.getCell(elem);
1558
+ if (cell) {
1559
+ return cell;
1560
+ }
1561
+ // try to get parent cell elem
1562
+ elem = utils.getParent(elem, '.flickity-slider > *');
1563
+ return this.getCell(elem);
1564
+ };
1565
+
1566
+ /**
1567
+ * get cells adjacent to a slide
1568
+ * @param {Integer} adjCount - number of adjacent slides
1569
+ * @param {Integer} index - index of slide to start
1570
+ * @returns {Array} cells - array of Flickity.Cells
1571
+ */
1572
+ proto$8.getAdjacentCellElements = function (adjCount, index) {
1573
+ if (!adjCount) {
1574
+ return this.selectedSlide.getCellElements();
1575
+ }
1576
+ index = index === undefined ? this.selectedIndex : index;
1577
+
1578
+ var len = this.slides.length;
1579
+ if (1 + adjCount * 2 >= len) {
1580
+ return this.getCellElements();
1581
+ }
1582
+
1583
+ var cellElems = [];
1584
+ for (var i = index - adjCount; i <= index + adjCount; i++) {
1585
+ var slideIndex = this.options.wrapAround ? utils.modulo(i, len) : i;
1586
+ var slide = this.slides[slideIndex];
1587
+ if (slide) {
1588
+ cellElems = cellElems.concat(slide.getCellElements());
1589
+ }
1590
+ }
1591
+ return cellElems;
1592
+ };
1593
+
1594
+ /**
1595
+ * select slide from number or cell element
1596
+ * @param {Element, Selector String, or Number} selector
1597
+ */
1598
+ proto$8.queryCell = function (selector) {
1599
+ if (typeof selector == 'number') {
1600
+ // use number as index
1601
+ return this.cells[selector];
1602
+ }
1603
+ if (typeof selector == 'string') {
1604
+ // do not select invalid selectors from hash: #123, #/. #791
1605
+ if (selector.match(/^[#\.]?[\d\/]/)) {
1606
+ return;
1607
+ }
1608
+ // use string as selector, get element
1609
+ selector = this.element.querySelector(selector);
1610
+ }
1611
+ // get cell from element
1612
+ return this.getCell(selector);
1613
+ };
1614
+
1615
+ // -------------------------- events -------------------------- //
1616
+
1617
+ proto$8.uiChange = function () {
1618
+ this.emitEvent('uiChange');
1619
+ };
1620
+
1621
+ // keep focus on element when child UI elements are clicked
1622
+ proto$8.childUIPointerDown = function (event) {
1623
+ // HACK iOS does not allow touch events to bubble up?!
1624
+ if (event.type != 'touchstart') {
1625
+ event.preventDefault();
1626
+ }
1627
+ this.focus();
1628
+ };
1629
+
1630
+ // ----- resize ----- //
1631
+
1632
+ proto$8.onresize = function () {
1633
+ this.watchCSS();
1634
+ this.resize();
1635
+ };
1636
+
1637
+ utils.debounceMethod(Flickity, 'onresize', 150);
1638
+
1639
+ proto$8.resize = function () {
1640
+ if (!this.isActive) {
1641
+ return;
1642
+ }
1643
+ this.getSize();
1644
+ // wrap values
1645
+ if (this.options.wrapAround) {
1646
+ this.x = utils.modulo(this.x, this.slideableWidth);
1647
+ }
1648
+ this.positionCells();
1649
+ this._getWrapShiftCells();
1650
+ this.setGallerySize();
1651
+ this.emitEvent('resize');
1652
+ // update selected index for group slides, instant
1653
+ // TODO: position can be lost between groups of various numbers
1654
+ var selectedElement = this.selectedElements && this.selectedElements[0];
1655
+ this.selectCell(selectedElement, false, true);
1656
+ };
1657
+
1658
+ // watches the :after property, activates/deactivates
1659
+ proto$8.watchCSS = function () {
1660
+ var watchOption = this.options.watchCSS;
1661
+ if (!watchOption) {
1662
+ return;
1663
+ }
1664
+
1665
+ var afterContent = getComputedStyle$1(this.element, ':after').content;
1666
+ // activate if :after { content: 'flickity' }
1667
+ if (afterContent.indexOf('flickity') != -1) {
1668
+ this.activate();
1669
+ } else {
1670
+ this.deactivate();
1671
+ }
1672
+ };
1673
+
1674
+ // ----- keydown ----- //
1675
+
1676
+ // go previous/next if left/right keys pressed
1677
+ proto$8.onkeydown = function (event) {
1678
+ // only work if element is in focus
1679
+ var isNotFocused =
1680
+ document.activeElement && document.activeElement != this.element;
1681
+ if (!this.options.accessibility || isNotFocused) {
1682
+ return;
1683
+ }
1684
+
1685
+ var handler = Flickity.keyboardHandlers[event.keyCode];
1686
+ if (handler) {
1687
+ handler.call(this);
1688
+ }
1689
+ };
1690
+
1691
+ Flickity.keyboardHandlers = {
1692
+ // left arrow
1693
+ 37: function () {
1694
+ var leftMethod = this.options.rightToLeft ? 'next' : 'previous';
1695
+ this.uiChange();
1696
+ this[leftMethod]();
1697
+ },
1698
+ // right arrow
1699
+ 39: function () {
1700
+ var rightMethod = this.options.rightToLeft ? 'previous' : 'next';
1701
+ this.uiChange();
1702
+ this[rightMethod]();
1703
+ },
1704
+ };
1705
+
1706
+ // ----- focus ----- //
1707
+
1708
+ proto$8.focus = function () {
1709
+ // TODO remove scrollTo once focus options gets more support
1710
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#Browser_compatibility
1711
+ var prevScrollY = window.pageYOffset;
1712
+ this.element.focus({ preventScroll: true });
1713
+ // hack to fix scroll jump after focus, #76
1714
+ if (window.pageYOffset != prevScrollY) {
1715
+ window.scrollTo(window.pageXOffset, prevScrollY);
1716
+ }
1717
+ };
1718
+
1719
+ // -------------------------- destroy -------------------------- //
1720
+
1721
+ // deactivate all Flickity functionality, but keep stuff available
1722
+ proto$8.deactivate = function () {
1723
+ if (!this.isActive) {
1724
+ return;
1725
+ }
1726
+ this.element.classList.remove('flickity-enabled');
1727
+ this.element.classList.remove('flickity-rtl');
1728
+ this.unselectSelectedSlide();
1729
+ // destroy cells
1730
+ this.cells.forEach(function (cell) {
1731
+ cell.destroy();
1732
+ });
1733
+ this.element.removeChild(this.viewport);
1734
+ // move child elements back into element
1735
+ moveElements(this.slider.children, this.element);
1736
+ if (this.options.accessibility) {
1737
+ this.element.removeAttribute('tabIndex');
1738
+ this.element.removeEventListener('keydown', this);
1739
+ }
1740
+ // set flags
1741
+ this.isActive = false;
1742
+ this.emitEvent('deactivate');
1743
+ };
1744
+
1745
+ proto$8.destroy = function () {
1746
+ this.deactivate();
1747
+ window.removeEventListener('resize', this);
1748
+ this.allOff();
1749
+ this.emitEvent('destroy');
1750
+ delete this.element.flickityGUID;
1751
+ delete instances[this.guid];
1752
+ };
1753
+
1754
+ // -------------------------- prototype -------------------------- //
1755
+
1756
+ utils.extend(proto$8, proto$9);
1757
+
1758
+ // -------------------------- extras -------------------------- //
1759
+
1760
+ /**
1761
+ * get Flickity instance from element
1762
+ * @param {Element} elem
1763
+ * @returns {Flickity}
1764
+ */
1765
+ Flickity.data = function (elem) {
1766
+ elem = utils.getQueryElement(elem);
1767
+ var id = elem && elem.flickityGUID;
1768
+ return id && instances[id];
1769
+ };
1770
+
1771
+ utils.htmlInit(Flickity, 'flickity');
1772
+
1773
+ Flickity.Cell = Cell;
1774
+ Flickity.Slide = Slide$1;
1775
+
1776
+ var unipointer = createCommonjsModule(function (module) {
1777
+ /*!
1778
+ * Unipointer v2.4.0
1779
+ * base class for doing one thing with pointer event
1780
+ * MIT license
1781
+ */
1782
+
1783
+ /*jshint browser: true, undef: true, unused: true, strict: true */
1784
+
1785
+ ( function( window, factory ) {
1786
+ // universal module definition
1787
+ /* jshint strict: false */ /*global define, module, require */
1788
+ if ( module.exports ) {
1789
+ // CommonJS
1790
+ module.exports = factory(
1791
+ window,
1792
+ evEmitter
1793
+ );
1794
+ } else {
1795
+ // browser global
1796
+ window.Unipointer = factory(
1797
+ window,
1798
+ window.EvEmitter
1799
+ );
1800
+ }
1801
+
1802
+ }( window, function factory( window, EvEmitter ) {
1803
+
1804
+ function noop() {}
1805
+
1806
+ function Unipointer() {}
1807
+
1808
+ // inherit EvEmitter
1809
+ var proto = Unipointer.prototype = Object.create( EvEmitter.prototype );
1810
+
1811
+ proto.bindStartEvent = function( elem ) {
1812
+ this._bindStartEvent( elem, true );
1813
+ };
1814
+
1815
+ proto.unbindStartEvent = function( elem ) {
1816
+ this._bindStartEvent( elem, false );
1817
+ };
1818
+
1819
+ /**
1820
+ * Add or remove start event
1821
+ * @param {Boolean} isAdd - remove if falsey
1822
+ */
1823
+ proto._bindStartEvent = function( elem, isAdd ) {
1824
+ // munge isAdd, default to true
1825
+ isAdd = isAdd === undefined ? true : isAdd;
1826
+ var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
1827
+
1828
+ // default to mouse events
1829
+ var startEvent = 'mousedown';
1830
+ if ( 'ontouchstart' in window ) {
1831
+ // HACK prefer Touch Events as you can preventDefault on touchstart to
1832
+ // disable scroll in iOS & mobile Chrome metafizzy/flickity#1177
1833
+ startEvent = 'touchstart';
1834
+ } else if ( window.PointerEvent ) {
1835
+ // Pointer Events
1836
+ startEvent = 'pointerdown';
1837
+ }
1838
+ elem[ bindMethod ]( startEvent, this );
1839
+ };
1840
+
1841
+ // trigger handler methods for events
1842
+ proto.handleEvent = function( event ) {
1843
+ var method = 'on' + event.type;
1844
+ if ( this[ method ] ) {
1845
+ this[ method ]( event );
1846
+ }
1847
+ };
1848
+
1849
+ // returns the touch that we're keeping track of
1850
+ proto.getTouch = function( touches ) {
1851
+ for ( var i=0; i < touches.length; i++ ) {
1852
+ var touch = touches[i];
1853
+ if ( touch.identifier == this.pointerIdentifier ) {
1854
+ return touch;
1855
+ }
1856
+ }
1857
+ };
1858
+
1859
+ // ----- start event ----- //
1860
+
1861
+ proto.onmousedown = function( event ) {
1862
+ // dismiss clicks from right or middle buttons
1863
+ var button = event.button;
1864
+ if ( button && ( button !== 0 && button !== 1 ) ) {
1865
+ return;
1866
+ }
1867
+ this._pointerDown( event, event );
1868
+ };
1869
+
1870
+ proto.ontouchstart = function( event ) {
1871
+ this._pointerDown( event, event.changedTouches[0] );
1872
+ };
1873
+
1874
+ proto.onpointerdown = function( event ) {
1875
+ this._pointerDown( event, event );
1876
+ };
1877
+
1878
+ /**
1879
+ * pointer start
1880
+ * @param {Event} event
1881
+ * @param {Event or Touch} pointer
1882
+ */
1883
+ proto._pointerDown = function( event, pointer ) {
1884
+ // dismiss right click and other pointers
1885
+ // button = 0 is okay, 1-4 not
1886
+ if ( event.button || this.isPointerDown ) {
1887
+ return;
1888
+ }
1889
+
1890
+ this.isPointerDown = true;
1891
+ // save pointer identifier to match up touch events
1892
+ this.pointerIdentifier = pointer.pointerId !== undefined ?
1893
+ // pointerId for pointer events, touch.indentifier for touch events
1894
+ pointer.pointerId : pointer.identifier;
1895
+
1896
+ this.pointerDown( event, pointer );
1897
+ };
1898
+
1899
+ proto.pointerDown = function( event, pointer ) {
1900
+ this._bindPostStartEvents( event );
1901
+ this.emitEvent( 'pointerDown', [ event, pointer ] );
1902
+ };
1903
+
1904
+ // hash of events to be bound after start event
1905
+ var postStartEvents = {
1906
+ mousedown: [ 'mousemove', 'mouseup' ],
1907
+ touchstart: [ 'touchmove', 'touchend', 'touchcancel' ],
1908
+ pointerdown: [ 'pointermove', 'pointerup', 'pointercancel' ],
1909
+ };
1910
+
1911
+ proto._bindPostStartEvents = function( event ) {
1912
+ if ( !event ) {
1913
+ return;
1914
+ }
1915
+ // get proper events to match start event
1916
+ var events = postStartEvents[ event.type ];
1917
+ // bind events to node
1918
+ events.forEach( function( eventName ) {
1919
+ window.addEventListener( eventName, this );
1920
+ }, this );
1921
+ // save these arguments
1922
+ this._boundPointerEvents = events;
1923
+ };
1924
+
1925
+ proto._unbindPostStartEvents = function() {
1926
+ // check for _boundEvents, in case dragEnd triggered twice (old IE8 bug)
1927
+ if ( !this._boundPointerEvents ) {
1928
+ return;
1929
+ }
1930
+ this._boundPointerEvents.forEach( function( eventName ) {
1931
+ window.removeEventListener( eventName, this );
1932
+ }, this );
1933
+
1934
+ delete this._boundPointerEvents;
1935
+ };
1936
+
1937
+ // ----- move event ----- //
1938
+
1939
+ proto.onmousemove = function( event ) {
1940
+ this._pointerMove( event, event );
1941
+ };
1942
+
1943
+ proto.onpointermove = function( event ) {
1944
+ if ( event.pointerId == this.pointerIdentifier ) {
1945
+ this._pointerMove( event, event );
1946
+ }
1947
+ };
1948
+
1949
+ proto.ontouchmove = function( event ) {
1950
+ var touch = this.getTouch( event.changedTouches );
1951
+ if ( touch ) {
1952
+ this._pointerMove( event, touch );
1953
+ }
1954
+ };
1955
+
1956
+ /**
1957
+ * pointer move
1958
+ * @param {Event} event
1959
+ * @param {Event or Touch} pointer
1960
+ * @private
1961
+ */
1962
+ proto._pointerMove = function( event, pointer ) {
1963
+ this.pointerMove( event, pointer );
1964
+ };
1965
+
1966
+ // public
1967
+ proto.pointerMove = function( event, pointer ) {
1968
+ this.emitEvent( 'pointerMove', [ event, pointer ] );
1969
+ };
1970
+
1971
+ // ----- end event ----- //
1972
+
1973
+
1974
+ proto.onmouseup = function( event ) {
1975
+ this._pointerUp( event, event );
1976
+ };
1977
+
1978
+ proto.onpointerup = function( event ) {
1979
+ if ( event.pointerId == this.pointerIdentifier ) {
1980
+ this._pointerUp( event, event );
1981
+ }
1982
+ };
1983
+
1984
+ proto.ontouchend = function( event ) {
1985
+ var touch = this.getTouch( event.changedTouches );
1986
+ if ( touch ) {
1987
+ this._pointerUp( event, touch );
1988
+ }
1989
+ };
1990
+
1991
+ /**
1992
+ * pointer up
1993
+ * @param {Event} event
1994
+ * @param {Event or Touch} pointer
1995
+ * @private
1996
+ */
1997
+ proto._pointerUp = function( event, pointer ) {
1998
+ this._pointerDone();
1999
+ this.pointerUp( event, pointer );
2000
+ };
2001
+
2002
+ // public
2003
+ proto.pointerUp = function( event, pointer ) {
2004
+ this.emitEvent( 'pointerUp', [ event, pointer ] );
2005
+ };
2006
+
2007
+ // ----- pointer done ----- //
2008
+
2009
+ // triggered on pointer up & pointer cancel
2010
+ proto._pointerDone = function() {
2011
+ this._pointerReset();
2012
+ this._unbindPostStartEvents();
2013
+ this.pointerDone();
2014
+ };
2015
+
2016
+ proto._pointerReset = function() {
2017
+ // reset properties
2018
+ this.isPointerDown = false;
2019
+ delete this.pointerIdentifier;
2020
+ };
2021
+
2022
+ proto.pointerDone = noop;
2023
+
2024
+ // ----- pointer cancel ----- //
2025
+
2026
+ proto.onpointercancel = function( event ) {
2027
+ if ( event.pointerId == this.pointerIdentifier ) {
2028
+ this._pointerCancel( event, event );
2029
+ }
2030
+ };
2031
+
2032
+ proto.ontouchcancel = function( event ) {
2033
+ var touch = this.getTouch( event.changedTouches );
2034
+ if ( touch ) {
2035
+ this._pointerCancel( event, touch );
2036
+ }
2037
+ };
2038
+
2039
+ /**
2040
+ * pointer cancel
2041
+ * @param {Event} event
2042
+ * @param {Event or Touch} pointer
2043
+ * @private
2044
+ */
2045
+ proto._pointerCancel = function( event, pointer ) {
2046
+ this._pointerDone();
2047
+ this.pointerCancel( event, pointer );
2048
+ };
2049
+
2050
+ // public
2051
+ proto.pointerCancel = function( event, pointer ) {
2052
+ this.emitEvent( 'pointerCancel', [ event, pointer ] );
2053
+ };
2054
+
2055
+ // ----- ----- //
2056
+
2057
+ // utility function for getting x/y coords from event
2058
+ Unipointer.getPointerPoint = function( pointer ) {
2059
+ return {
2060
+ x: pointer.pageX,
2061
+ y: pointer.pageY
2062
+ };
2063
+ };
2064
+
2065
+ // ----- ----- //
2066
+
2067
+ return Unipointer;
2068
+
2069
+ }));
2070
+ });
2071
+
2072
+ var unidragger = createCommonjsModule(function (module) {
2073
+ /*!
2074
+ * Unidragger v2.4.0
2075
+ * Draggable base class
2076
+ * MIT license
2077
+ */
2078
+
2079
+ /*jshint browser: true, unused: true, undef: true, strict: true */
2080
+
2081
+ ( function( window, factory ) {
2082
+ // universal module definition
2083
+ /*jshint strict: false */ /*globals define, module, require */
2084
+
2085
+ if ( module.exports ) {
2086
+ // CommonJS
2087
+ module.exports = factory(
2088
+ window,
2089
+ unipointer
2090
+ );
2091
+ } else {
2092
+ // browser global
2093
+ window.Unidragger = factory(
2094
+ window,
2095
+ window.Unipointer
2096
+ );
2097
+ }
2098
+
2099
+ }( window, function factory( window, Unipointer ) {
2100
+
2101
+ // -------------------------- Unidragger -------------------------- //
2102
+
2103
+ function Unidragger() {}
2104
+
2105
+ // inherit Unipointer & EvEmitter
2106
+ var proto = Unidragger.prototype = Object.create( Unipointer.prototype );
2107
+
2108
+ // ----- bind start ----- //
2109
+
2110
+ proto.bindHandles = function() {
2111
+ this._bindHandles( true );
2112
+ };
2113
+
2114
+ proto.unbindHandles = function() {
2115
+ this._bindHandles( false );
2116
+ };
2117
+
2118
+ /**
2119
+ * Add or remove start event
2120
+ * @param {Boolean} isAdd
2121
+ */
2122
+ proto._bindHandles = function( isAdd ) {
2123
+ // munge isAdd, default to true
2124
+ isAdd = isAdd === undefined ? true : isAdd;
2125
+ // bind each handle
2126
+ var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
2127
+ var touchAction = isAdd ? this._touchActionValue : '';
2128
+ for ( var i=0; i < this.handles.length; i++ ) {
2129
+ var handle = this.handles[i];
2130
+ this._bindStartEvent( handle, isAdd );
2131
+ handle[ bindMethod ]( 'click', this );
2132
+ // touch-action: none to override browser touch gestures. metafizzy/flickity#540
2133
+ if ( window.PointerEvent ) {
2134
+ handle.style.touchAction = touchAction;
2135
+ }
2136
+ }
2137
+ };
2138
+
2139
+ // prototype so it can be overwriteable by Flickity
2140
+ proto._touchActionValue = 'none';
2141
+
2142
+ // ----- start event ----- //
2143
+
2144
+ /**
2145
+ * pointer start
2146
+ * @param {Event} event
2147
+ * @param {Event or Touch} pointer
2148
+ */
2149
+ proto.pointerDown = function( event, pointer ) {
2150
+ var isOkay = this.okayPointerDown( event );
2151
+ if ( !isOkay ) {
2152
+ return;
2153
+ }
2154
+ // track start event position
2155
+ // Safari 9 overrides pageX and pageY. These values needs to be copied. flickity#842
2156
+ this.pointerDownPointer = {
2157
+ pageX: pointer.pageX,
2158
+ pageY: pointer.pageY,
2159
+ };
2160
+
2161
+ event.preventDefault();
2162
+ this.pointerDownBlur();
2163
+ // bind move and end events
2164
+ this._bindPostStartEvents( event );
2165
+ this.emitEvent( 'pointerDown', [ event, pointer ] );
2166
+ };
2167
+
2168
+ // nodes that have text fields
2169
+ var cursorNodes = {
2170
+ TEXTAREA: true,
2171
+ INPUT: true,
2172
+ SELECT: true,
2173
+ OPTION: true,
2174
+ };
2175
+
2176
+ // input types that do not have text fields
2177
+ var clickTypes = {
2178
+ radio: true,
2179
+ checkbox: true,
2180
+ button: true,
2181
+ submit: true,
2182
+ image: true,
2183
+ file: true,
2184
+ };
2185
+
2186
+ // dismiss inputs with text fields. flickity#403, flickity#404
2187
+ proto.okayPointerDown = function( event ) {
2188
+ var isCursorNode = cursorNodes[ event.target.nodeName ];
2189
+ var isClickType = clickTypes[ event.target.type ];
2190
+ var isOkay = !isCursorNode || isClickType;
2191
+ if ( !isOkay ) {
2192
+ this._pointerReset();
2193
+ }
2194
+ return isOkay;
2195
+ };
2196
+
2197
+ // kludge to blur previously focused input
2198
+ proto.pointerDownBlur = function() {
2199
+ var focused = document.activeElement;
2200
+ // do not blur body for IE10, metafizzy/flickity#117
2201
+ var canBlur = focused && focused.blur && focused != document.body;
2202
+ if ( canBlur ) {
2203
+ focused.blur();
2204
+ }
2205
+ };
2206
+
2207
+ // ----- move event ----- //
2208
+
2209
+ /**
2210
+ * drag move
2211
+ * @param {Event} event
2212
+ * @param {Event or Touch} pointer
2213
+ */
2214
+ proto.pointerMove = function( event, pointer ) {
2215
+ var moveVector = this._dragPointerMove( event, pointer );
2216
+ this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] );
2217
+ this._dragMove( event, pointer, moveVector );
2218
+ };
2219
+
2220
+ // base pointer move logic
2221
+ proto._dragPointerMove = function( event, pointer ) {
2222
+ var moveVector = {
2223
+ x: pointer.pageX - this.pointerDownPointer.pageX,
2224
+ y: pointer.pageY - this.pointerDownPointer.pageY
2225
+ };
2226
+ // start drag if pointer has moved far enough to start drag
2227
+ if ( !this.isDragging && this.hasDragStarted( moveVector ) ) {
2228
+ this._dragStart( event, pointer );
2229
+ }
2230
+ return moveVector;
2231
+ };
2232
+
2233
+ // condition if pointer has moved far enough to start drag
2234
+ proto.hasDragStarted = function( moveVector ) {
2235
+ return Math.abs( moveVector.x ) > 3 || Math.abs( moveVector.y ) > 3;
2236
+ };
2237
+
2238
+ // ----- end event ----- //
2239
+
2240
+ /**
2241
+ * pointer up
2242
+ * @param {Event} event
2243
+ * @param {Event or Touch} pointer
2244
+ */
2245
+ proto.pointerUp = function( event, pointer ) {
2246
+ this.emitEvent( 'pointerUp', [ event, pointer ] );
2247
+ this._dragPointerUp( event, pointer );
2248
+ };
2249
+
2250
+ proto._dragPointerUp = function( event, pointer ) {
2251
+ if ( this.isDragging ) {
2252
+ this._dragEnd( event, pointer );
2253
+ } else {
2254
+ // pointer didn't move enough for drag to start
2255
+ this._staticClick( event, pointer );
2256
+ }
2257
+ };
2258
+
2259
+ // -------------------------- drag -------------------------- //
2260
+
2261
+ // dragStart
2262
+ proto._dragStart = function( event, pointer ) {
2263
+ this.isDragging = true;
2264
+ // prevent clicks
2265
+ this.isPreventingClicks = true;
2266
+ this.dragStart( event, pointer );
2267
+ };
2268
+
2269
+ proto.dragStart = function( event, pointer ) {
2270
+ this.emitEvent( 'dragStart', [ event, pointer ] );
2271
+ };
2272
+
2273
+ // dragMove
2274
+ proto._dragMove = function( event, pointer, moveVector ) {
2275
+ // do not drag if not dragging yet
2276
+ if ( !this.isDragging ) {
2277
+ return;
2278
+ }
2279
+
2280
+ this.dragMove( event, pointer, moveVector );
2281
+ };
2282
+
2283
+ proto.dragMove = function( event, pointer, moveVector ) {
2284
+ event.preventDefault();
2285
+ this.emitEvent( 'dragMove', [ event, pointer, moveVector ] );
2286
+ };
2287
+
2288
+ // dragEnd
2289
+ proto._dragEnd = function( event, pointer ) {
2290
+ // set flags
2291
+ this.isDragging = false;
2292
+ // re-enable clicking async
2293
+ setTimeout( function() {
2294
+ delete this.isPreventingClicks;
2295
+ }.bind( this ) );
2296
+
2297
+ this.dragEnd( event, pointer );
2298
+ };
2299
+
2300
+ proto.dragEnd = function( event, pointer ) {
2301
+ this.emitEvent( 'dragEnd', [ event, pointer ] );
2302
+ };
2303
+
2304
+ // ----- onclick ----- //
2305
+
2306
+ // handle all clicks and prevent clicks when dragging
2307
+ proto.onclick = function( event ) {
2308
+ if ( this.isPreventingClicks ) {
2309
+ event.preventDefault();
2310
+ }
2311
+ };
2312
+
2313
+ // ----- staticClick ----- //
2314
+
2315
+ // triggered after pointer down & up with no/tiny movement
2316
+ proto._staticClick = function( event, pointer ) {
2317
+ // ignore emulated mouse up clicks
2318
+ if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) {
2319
+ return;
2320
+ }
2321
+
2322
+ this.staticClick( event, pointer );
2323
+
2324
+ // set flag for emulated clicks 300ms after touchend
2325
+ if ( event.type != 'mouseup' ) {
2326
+ this.isIgnoringMouseUp = true;
2327
+ // reset flag after 300ms
2328
+ setTimeout( function() {
2329
+ delete this.isIgnoringMouseUp;
2330
+ }.bind( this ), 400 );
2331
+ }
2332
+ };
2333
+
2334
+ proto.staticClick = function( event, pointer ) {
2335
+ this.emitEvent( 'staticClick', [ event, pointer ] );
2336
+ };
2337
+
2338
+ // ----- utils ----- //
2339
+
2340
+ Unidragger.getPointerPoint = Unipointer.getPointerPoint;
2341
+
2342
+ // ----- ----- //
2343
+
2344
+ return Unidragger;
2345
+
2346
+ }));
2347
+ });
2348
+
2349
+ // ----- defaults ----- //
2350
+
2351
+ utils.extend(Flickity.defaults, {
2352
+ draggable: '>1',
2353
+ dragThreshold: 3,
2354
+ });
2355
+
2356
+ // ----- create ----- //
2357
+
2358
+ Flickity.createMethods.push('_createDrag');
2359
+
2360
+ // -------------------------- drag prototype -------------------------- //
2361
+
2362
+ var proto$7 = Flickity.prototype;
2363
+ utils.extend(proto$7, unidragger.prototype);
2364
+ proto$7._touchActionValue = 'pan-y';
2365
+
2366
+ // -------------------------- -------------------------- //
2367
+
2368
+ var isTouch = 'createTouch' in document;
2369
+ var isTouchmoveScrollCanceled = false;
2370
+
2371
+ proto$7._createDrag = function () {
2372
+ this.on('activate', this.onActivateDrag);
2373
+ this.on('uiChange', this._uiChangeDrag);
2374
+ this.on('deactivate', this.onDeactivateDrag);
2375
+ this.on('cellChange', this.updateDraggable);
2376
+ // TODO updateDraggable on resize? if groupCells & slides change
2377
+ // HACK - add seemingly innocuous handler to fix iOS 10 scroll behavior
2378
+ // #457, RubaXa/Sortable#973
2379
+ if (isTouch && !isTouchmoveScrollCanceled) {
2380
+ window.addEventListener('touchmove', function () {});
2381
+ isTouchmoveScrollCanceled = true;
2382
+ }
2383
+ };
2384
+
2385
+ proto$7.onActivateDrag = function () {
2386
+ this.handles = [this.viewport];
2387
+ this.bindHandles();
2388
+ this.updateDraggable();
2389
+ };
2390
+
2391
+ proto$7.onDeactivateDrag = function () {
2392
+ this.unbindHandles();
2393
+ this.element.classList.remove('is-draggable');
2394
+ };
2395
+
2396
+ proto$7.updateDraggable = function () {
2397
+ // disable dragging if less than 2 slides. #278
2398
+ if (this.options.draggable == '>1') {
2399
+ this.isDraggable = this.slides.length > 1;
2400
+ } else {
2401
+ this.isDraggable = this.options.draggable;
2402
+ }
2403
+ if (this.isDraggable) {
2404
+ this.element.classList.add('is-draggable');
2405
+ } else {
2406
+ this.element.classList.remove('is-draggable');
2407
+ }
2408
+ };
2409
+
2410
+ // backwards compatibility
2411
+ proto$7.bindDrag = function () {
2412
+ this.options.draggable = true;
2413
+ this.updateDraggable();
2414
+ };
2415
+
2416
+ proto$7.unbindDrag = function () {
2417
+ this.options.draggable = false;
2418
+ this.updateDraggable();
2419
+ };
2420
+
2421
+ proto$7._uiChangeDrag = function () {
2422
+ delete this.isFreeScrolling;
2423
+ };
2424
+
2425
+ // -------------------------- pointer events -------------------------- //
2426
+
2427
+ proto$7.pointerDown = function (event, pointer) {
2428
+ if (!this.isDraggable) {
2429
+ this._pointerDownDefault(event, pointer);
2430
+ return;
2431
+ }
2432
+ var isOkay = this.okayPointerDown(event);
2433
+ if (!isOkay) {
2434
+ return;
2435
+ }
2436
+
2437
+ this._pointerDownPreventDefault(event);
2438
+ this.pointerDownFocus(event);
2439
+ // blur
2440
+ if (document.activeElement != this.element) {
2441
+ // do not blur if already focused
2442
+ this.pointerDownBlur();
2443
+ }
2444
+
2445
+ // stop if it was moving
2446
+ this.dragX = this.x;
2447
+ this.viewport.classList.add('is-pointer-down');
2448
+ // track scrolling
2449
+ this.pointerDownScroll = getScrollPosition();
2450
+ window.addEventListener('scroll', this);
2451
+
2452
+ this._pointerDownDefault(event, pointer);
2453
+ };
2454
+
2455
+ // default pointerDown logic, used for staticClick
2456
+ proto$7._pointerDownDefault = function (event, pointer) {
2457
+ // track start event position
2458
+ // Safari 9 overrides pageX and pageY. These values needs to be copied. #779
2459
+ this.pointerDownPointer = {
2460
+ pageX: pointer.pageX,
2461
+ pageY: pointer.pageY,
2462
+ };
2463
+ // bind move and end events
2464
+ this._bindPostStartEvents(event);
2465
+ this.dispatchEvent('pointerDown', event, [pointer]);
2466
+ };
2467
+
2468
+ var focusNodes = {
2469
+ INPUT: true,
2470
+ TEXTAREA: true,
2471
+ SELECT: true,
2472
+ };
2473
+
2474
+ proto$7.pointerDownFocus = function (event) {
2475
+ var isFocusNode = focusNodes[event.target.nodeName];
2476
+ if (!isFocusNode) {
2477
+ this.focus();
2478
+ }
2479
+ };
2480
+
2481
+ proto$7._pointerDownPreventDefault = function (event) {
2482
+ var isTouchStart = event.type == 'touchstart';
2483
+ var isTouchPointer = event.pointerType == 'touch';
2484
+ var isFocusNode = focusNodes[event.target.nodeName];
2485
+ if (!isTouchStart && !isTouchPointer && !isFocusNode) {
2486
+ event.preventDefault();
2487
+ }
2488
+ };
2489
+
2490
+ // ----- move ----- //
2491
+
2492
+ proto$7.hasDragStarted = function (moveVector) {
2493
+ return Math.abs(moveVector.x) > this.options.dragThreshold;
2494
+ };
2495
+
2496
+ // ----- up ----- //
2497
+
2498
+ proto$7.pointerUp = function (event, pointer) {
2499
+ delete this.isTouchScrolling;
2500
+ this.viewport.classList.remove('is-pointer-down');
2501
+ this.dispatchEvent('pointerUp', event, [pointer]);
2502
+ this._dragPointerUp(event, pointer);
2503
+ };
2504
+
2505
+ proto$7.pointerDone = function () {
2506
+ window.removeEventListener('scroll', this);
2507
+ delete this.pointerDownScroll;
2508
+ };
2509
+
2510
+ // -------------------------- dragging -------------------------- //
2511
+
2512
+ proto$7.dragStart = function (event, pointer) {
2513
+ if (!this.isDraggable) {
2514
+ return;
2515
+ }
2516
+ this.dragStartPosition = this.x;
2517
+ this.startAnimation();
2518
+ window.removeEventListener('scroll', this);
2519
+ this.dispatchEvent('dragStart', event, [pointer]);
2520
+ };
2521
+
2522
+ proto$7.pointerMove = function (event, pointer) {
2523
+ var moveVector = this._dragPointerMove(event, pointer);
2524
+ this.dispatchEvent('pointerMove', event, [pointer, moveVector]);
2525
+ this._dragMove(event, pointer, moveVector);
2526
+ };
2527
+
2528
+ proto$7.dragMove = function (event, pointer, moveVector) {
2529
+ if (!this.isDraggable) {
2530
+ return;
2531
+ }
2532
+ event.preventDefault();
2533
+
2534
+ this.previousDragX = this.dragX;
2535
+ // reverse if right-to-left
2536
+ var direction = this.options.rightToLeft ? -1 : 1;
2537
+ if (this.options.wrapAround) {
2538
+ // wrap around move. #589
2539
+ moveVector.x = moveVector.x % this.slideableWidth;
2540
+ }
2541
+ var dragX = this.dragStartPosition + moveVector.x * direction;
2542
+
2543
+ if (!this.options.wrapAround && this.slides.length) {
2544
+ // slow drag
2545
+ var originBound = Math.max(-this.slides[0].target, this.dragStartPosition);
2546
+ dragX = dragX > originBound ? (dragX + originBound) * 0.5 : dragX;
2547
+ var endBound = Math.min(
2548
+ -this.getLastSlide().target,
2549
+ this.dragStartPosition
2550
+ );
2551
+ dragX = dragX < endBound ? (dragX + endBound) * 0.5 : dragX;
2552
+ }
2553
+
2554
+ this.dragX = dragX;
2555
+
2556
+ this.dragMoveTime = new Date();
2557
+ this.dispatchEvent('dragMove', event, [pointer, moveVector]);
2558
+ };
2559
+
2560
+ proto$7.dragEnd = function (event, pointer) {
2561
+ if (!this.isDraggable) {
2562
+ return;
2563
+ }
2564
+ if (this.options.freeScroll) {
2565
+ this.isFreeScrolling = true;
2566
+ }
2567
+ // set selectedIndex based on where flick will end up
2568
+ var index = this.dragEndRestingSelect();
2569
+
2570
+ if (this.options.freeScroll && !this.options.wrapAround) {
2571
+ // if free-scroll & not wrap around
2572
+ // do not free-scroll if going outside of bounding slides
2573
+ // so bounding slides can attract slider, and keep it in bounds
2574
+ var restingX = this.getRestingPosition();
2575
+ this.isFreeScrolling =
2576
+ -restingX > this.slides[0].target &&
2577
+ -restingX < this.getLastSlide().target;
2578
+ } else if (!this.options.freeScroll && index == this.selectedIndex) {
2579
+ // boost selection if selected index has not changed
2580
+ index += this.dragEndBoostSelect();
2581
+ }
2582
+ delete this.previousDragX;
2583
+ // apply selection
2584
+ // TODO refactor this, selecting here feels weird
2585
+ // HACK, set flag so dragging stays in correct direction
2586
+ this.isDragSelect = this.options.wrapAround;
2587
+ this.select(index);
2588
+ delete this.isDragSelect;
2589
+ this.dispatchEvent('dragEnd', event, [pointer]);
2590
+ };
2591
+
2592
+ proto$7.dragEndRestingSelect = function () {
2593
+ var restingX = this.getRestingPosition();
2594
+ // how far away from selected slide
2595
+ var distance = Math.abs(this.getSlideDistance(-restingX, this.selectedIndex));
2596
+ // get closet resting going up and going down
2597
+ var positiveResting = this._getClosestResting(restingX, distance, 1);
2598
+ var negativeResting = this._getClosestResting(restingX, distance, -1);
2599
+ // use closer resting for wrap-around
2600
+ var index =
2601
+ positiveResting.distance < negativeResting.distance
2602
+ ? positiveResting.index
2603
+ : negativeResting.index;
2604
+ return index;
2605
+ };
2606
+
2607
+ /**
2608
+ * given resting X and distance to selected cell
2609
+ * get the distance and index of the closest cell
2610
+ * @param {Number} restingX - estimated post-flick resting position
2611
+ * @param {Number} distance - distance to selected cell
2612
+ * @param {Integer} increment - +1 or -1, going up or down
2613
+ * @returns {Object} - { distance: {Number}, index: {Integer} }
2614
+ */
2615
+ proto$7._getClosestResting = function (restingX, distance, increment) {
2616
+ var index = this.selectedIndex;
2617
+ var minDistance = Infinity;
2618
+ var condition =
2619
+ this.options.contain && !this.options.wrapAround
2620
+ ? // if contain, keep going if distance is equal to minDistance
2621
+ function (d, md) {
2622
+ return d <= md;
2623
+ }
2624
+ : function (d, md) {
2625
+ return d < md;
2626
+ };
2627
+ while (condition(distance, minDistance)) {
2628
+ // measure distance to next cell
2629
+ index += increment;
2630
+ minDistance = distance;
2631
+ distance = this.getSlideDistance(-restingX, index);
2632
+ if (distance === null) {
2633
+ break;
2634
+ }
2635
+ distance = Math.abs(distance);
2636
+ }
2637
+ return {
2638
+ distance: minDistance,
2639
+ // selected was previous index
2640
+ index: index - increment,
2641
+ };
2642
+ };
2643
+
2644
+ /**
2645
+ * measure distance between x and a slide target
2646
+ * @param {Number} x
2647
+ * @param {Integer} index - slide index
2648
+ */
2649
+ proto$7.getSlideDistance = function (x, index) {
2650
+ var len = this.slides.length;
2651
+ // wrap around if at least 2 slides
2652
+ var isWrapAround = this.options.wrapAround && len > 1;
2653
+ var slideIndex = isWrapAround ? utils.modulo(index, len) : index;
2654
+ var slide = this.slides[slideIndex];
2655
+ if (!slide) {
2656
+ return null;
2657
+ }
2658
+ // add distance for wrap-around slides
2659
+ var wrap = isWrapAround ? this.slideableWidth * Math.floor(index / len) : 0;
2660
+ return x - (slide.target + wrap);
2661
+ };
2662
+
2663
+ proto$7.dragEndBoostSelect = function () {
2664
+ // do not boost if no previousDragX or dragMoveTime
2665
+ if (
2666
+ this.previousDragX === undefined ||
2667
+ !this.dragMoveTime ||
2668
+ // or if drag was held for 100 ms
2669
+ new Date() - this.dragMoveTime > 100
2670
+ ) {
2671
+ return 0;
2672
+ }
2673
+
2674
+ var distance = this.getSlideDistance(-this.dragX, this.selectedIndex);
2675
+ var delta = this.previousDragX - this.dragX;
2676
+ if (distance > 0 && delta > 0) {
2677
+ // boost to next if moving towards the right, and positive velocity
2678
+ return 1;
2679
+ } else if (distance < 0 && delta < 0) {
2680
+ // boost to previous if moving towards the left, and negative velocity
2681
+ return -1;
2682
+ }
2683
+ return 0;
2684
+ };
2685
+
2686
+ // ----- staticClick ----- //
2687
+
2688
+ proto$7.staticClick = function (event, pointer) {
2689
+ // get clickedCell, if cell was clicked
2690
+ var clickedCell = this.getParentCell(event.target);
2691
+ var cellElem = clickedCell && clickedCell.element;
2692
+ var cellIndex = clickedCell && this.cells.indexOf(clickedCell);
2693
+ this.dispatchEvent('staticClick', event, [pointer, cellElem, cellIndex]);
2694
+ };
2695
+
2696
+ // ----- scroll ----- //
2697
+
2698
+ proto$7.onscroll = function () {
2699
+ var scroll = getScrollPosition();
2700
+ var scrollMoveX = this.pointerDownScroll.x - scroll.x;
2701
+ var scrollMoveY = this.pointerDownScroll.y - scroll.y;
2702
+ // cancel click/tap if scroll is too much
2703
+ if (Math.abs(scrollMoveX) > 3 || Math.abs(scrollMoveY) > 3) {
2704
+ this._pointerDone();
2705
+ }
2706
+ };
2707
+
2708
+ // ----- utils ----- //
2709
+
2710
+ function getScrollPosition() {
2711
+ return {
2712
+ x: window.pageXOffset,
2713
+ y: window.pageYOffset,
2714
+ };
2715
+ }
2716
+
2717
+ // ----- ----- //
2718
+
2719
+ var svgURI$1 = 'http://www.w3.org/2000/svg';
2720
+
2721
+ // -------------------------- PrevNextButton -------------------------- //
2722
+
2723
+ function PrevNextButton(direction, parent) {
2724
+ this.direction = direction;
2725
+ this.parent = parent;
2726
+ this.parentElement = this.parent.element.shadowRoot || this.parent.element;
2727
+ this._create();
2728
+ }
2729
+
2730
+ PrevNextButton.prototype = Object.create(unipointer.prototype);
2731
+
2732
+ PrevNextButton.prototype._create = function () {
2733
+ // properties
2734
+ this.isEnabled = true;
2735
+ this.isPrevious = this.direction == -1;
2736
+ var leftDirection = this.parent.options.rightToLeft ? 1 : -1;
2737
+ this.isLeft = this.direction == leftDirection;
2738
+
2739
+ var element = (this.element = document.createElement('button'));
2740
+ element.className = 'flickity-button flickity-prev-next-button';
2741
+ element.className += this.isPrevious ? ' previous' : ' next';
2742
+ // prevent button from submitting form http://stackoverflow.com/a/10836076/182183
2743
+ element.setAttribute('type', 'button');
2744
+ // init as disabled
2745
+ this.disable();
2746
+
2747
+ element.setAttribute('aria-label', this.isPrevious ? 'Previous' : 'Next');
2748
+
2749
+ // create arrow
2750
+ var svg = this.createSVG();
2751
+ element.appendChild(svg);
2752
+ // events
2753
+ this.parent.on('select', this.update.bind(this));
2754
+ this.on('pointerDown', this.parent.childUIPointerDown.bind(this.parent));
2755
+ };
2756
+
2757
+ PrevNextButton.prototype.activate = function () {
2758
+ this.bindStartEvent(this.element);
2759
+ this.element.addEventListener('click', this);
2760
+ // add to DOM
2761
+ this.parentElement.appendChild(this.element);
2762
+ };
2763
+
2764
+ PrevNextButton.prototype.deactivate = function () {
2765
+ // remove from DOM
2766
+ this.parentElement.removeChild(this.element);
2767
+ // click events
2768
+ this.unbindStartEvent(this.element);
2769
+ this.element.removeEventListener('click', this);
2770
+ };
2771
+
2772
+ PrevNextButton.prototype.createSVG = function () {
2773
+ var svg = document.createElementNS(svgURI$1, 'svg');
2774
+ svg.setAttribute('class', 'flickity-button-icon');
2775
+ svg.setAttribute('viewBox', '0 0 100 100');
2776
+ var path = document.createElementNS(svgURI$1, 'path');
2777
+ var pathMovements = getArrowMovements(this.parent.options.arrowShape);
2778
+ path.setAttribute('d', pathMovements);
2779
+ path.setAttribute('class', 'arrow');
2780
+ // rotate arrow
2781
+ if (!this.isLeft) {
2782
+ path.setAttribute('transform', 'translate(100, 100) rotate(180) ');
2783
+ }
2784
+ svg.appendChild(path);
2785
+ return svg;
2786
+ };
2787
+
2788
+ // get SVG path movmement
2789
+ function getArrowMovements(shape) {
2790
+ // use shape as movement if string
2791
+ if (typeof shape == 'string') {
2792
+ return shape;
2793
+ }
2794
+ // create movement string
2795
+ return (
2796
+ 'M ' +
2797
+ shape.x0 +
2798
+ ',50' +
2799
+ ' L ' +
2800
+ shape.x1 +
2801
+ ',' +
2802
+ (shape.y1 + 50) +
2803
+ ' L ' +
2804
+ shape.x2 +
2805
+ ',' +
2806
+ (shape.y2 + 50) +
2807
+ ' L ' +
2808
+ shape.x3 +
2809
+ ',50 ' +
2810
+ ' L ' +
2811
+ shape.x2 +
2812
+ ',' +
2813
+ (50 - shape.y2) +
2814
+ ' L ' +
2815
+ shape.x1 +
2816
+ ',' +
2817
+ (50 - shape.y1) +
2818
+ ' Z'
2819
+ );
2820
+ }
2821
+
2822
+ PrevNextButton.prototype.handleEvent = utils.handleEvent;
2823
+
2824
+ PrevNextButton.prototype.onclick = function () {
2825
+ if (!this.isEnabled) {
2826
+ return;
2827
+ }
2828
+ this.parent.uiChange();
2829
+ var method = this.isPrevious ? 'previous' : 'next';
2830
+ this.parent[method]();
2831
+ };
2832
+
2833
+ // ----- ----- //
2834
+
2835
+ PrevNextButton.prototype.enable = function () {
2836
+ if (this.isEnabled) {
2837
+ return;
2838
+ }
2839
+ this.element.disabled = false;
2840
+ this.isEnabled = true;
2841
+ };
2842
+
2843
+ PrevNextButton.prototype.disable = function () {
2844
+ if (!this.isEnabled) {
2845
+ return;
2846
+ }
2847
+ this.element.disabled = true;
2848
+ this.isEnabled = false;
2849
+ };
2850
+
2851
+ PrevNextButton.prototype.update = function () {
2852
+ // index of first or last slide, if previous or next
2853
+ var slides = this.parent.slides;
2854
+ // enable is wrapAround and at least 2 slides
2855
+ if (this.parent.options.wrapAround && slides.length > 1) {
2856
+ this.enable();
2857
+ return;
2858
+ }
2859
+ var lastIndex = slides.length ? slides.length - 1 : 0;
2860
+ var boundIndex = this.isPrevious ? 0 : lastIndex;
2861
+ var method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable';
2862
+ this[method]();
2863
+ };
2864
+
2865
+ PrevNextButton.prototype.destroy = function () {
2866
+ this.deactivate();
2867
+ this.allOff();
2868
+ };
2869
+
2870
+ // -------------------------- Flickity prototype -------------------------- //
2871
+
2872
+ utils.extend(Flickity.defaults, {
2873
+ prevNextButtons: true,
2874
+ arrowShape: {
2875
+ x0: 10,
2876
+ x1: 60,
2877
+ y1: 50,
2878
+ x2: 70,
2879
+ y2: 40,
2880
+ x3: 30,
2881
+ },
2882
+ });
2883
+
2884
+ Flickity.createMethods.push('_createPrevNextButtons');
2885
+ var proto$6 = Flickity.prototype;
2886
+
2887
+ proto$6._createPrevNextButtons = function () {
2888
+ if (!this.options.prevNextButtons) {
2889
+ return;
2890
+ }
2891
+
2892
+ this.prevButton = new PrevNextButton(-1, this);
2893
+ this.nextButton = new PrevNextButton(1, this);
2894
+
2895
+ this.on('activate', this.activatePrevNextButtons);
2896
+ };
2897
+
2898
+ proto$6.activatePrevNextButtons = function () {
2899
+ this.prevButton.activate();
2900
+ this.nextButton.activate();
2901
+ this.on('deactivate', this.deactivatePrevNextButtons);
2902
+ };
2903
+
2904
+ proto$6.deactivatePrevNextButtons = function () {
2905
+ this.prevButton.deactivate();
2906
+ this.nextButton.deactivate();
2907
+ this.off('deactivate', this.deactivatePrevNextButtons);
2908
+ };
2909
+
2910
+ // -------------------------- -------------------------- //
2911
+
2912
+ Flickity.PrevNextButton = PrevNextButton;
2913
+
2914
+ function PageDots(parent) {
2915
+ this.parent = parent;
2916
+ this.parentElement = this.parent.element.shadowRoot || this.parent.element;
2917
+ this._create();
2918
+ }
2919
+
2920
+ PageDots.prototype = Object.create(unipointer.prototype);
2921
+
2922
+ PageDots.prototype._create = function () {
2923
+ // create holder element
2924
+ this.holder = document.createElement('ol');
2925
+ this.holder.className = 'flickity-page-dots';
2926
+ // create dots, array of elements
2927
+ this.dots = [];
2928
+ // events
2929
+ this.handleClick = this.onClick.bind(this);
2930
+ this.on('pointerDown', this.parent.childUIPointerDown.bind(this.parent));
2931
+ };
2932
+
2933
+ PageDots.prototype.activate = function () {
2934
+ this.setDots();
2935
+ this.holder.addEventListener('click', this.handleClick);
2936
+ this.bindStartEvent(this.holder);
2937
+ // add to DOM
2938
+ this.parentElement.appendChild(this.holder);
2939
+ };
2940
+
2941
+ PageDots.prototype.deactivate = function () {
2942
+ this.holder.removeEventListener('click', this.handleClick);
2943
+ this.unbindStartEvent(this.holder);
2944
+ // remove from DOM
2945
+ this.parentElement.removeChild(this.holder);
2946
+ };
2947
+
2948
+ PageDots.prototype.setDots = function () {
2949
+ // get difference between number of slides and number of dots
2950
+ var delta = this.parent.slides.length - this.dots.length;
2951
+ if (delta > 0) {
2952
+ this.addDots(delta);
2953
+ } else if (delta < 0) {
2954
+ this.removeDots(-delta);
2955
+ }
2956
+ };
2957
+
2958
+ PageDots.prototype.addDots = function (count) {
2959
+ var fragment = document.createDocumentFragment();
2960
+ var newDots = [];
2961
+ var length = this.dots.length;
2962
+ var max = length + count;
2963
+
2964
+ for (var i = length; i < max; i++) {
2965
+ var dot = document.createElement('li');
2966
+ dot.classList.add('dot');
2967
+ dot.setAttribute('aria-label', 'Page dot ' + (i + 1));
2968
+ fragment.appendChild(dot);
2969
+ newDots.push(dot);
2970
+ }
2971
+
2972
+ this.holder.appendChild(fragment);
2973
+ this.dots = this.dots.concat(newDots);
2974
+ };
2975
+
2976
+ PageDots.prototype.removeDots = function (count) {
2977
+ // remove from this.dots collection
2978
+ var removeDots = this.dots.splice(this.dots.length - count, count);
2979
+ // remove from DOM
2980
+ removeDots.forEach(function (dot) {
2981
+ this.holder.removeChild(dot);
2982
+ }, this);
2983
+ };
2984
+
2985
+ PageDots.prototype.updateSelected = function () {
2986
+ // remove selected class on previous
2987
+ if (this.selectedDot) {
2988
+ this.selectedDot.classList.remove('is-selected');
2989
+ this.selectedDot.removeAttribute('aria-current');
2990
+ }
2991
+ // don't proceed if no dots
2992
+ if (!this.dots.length) {
2993
+ return;
2994
+ }
2995
+ this.selectedDot = this.dots[this.parent.selectedIndex];
2996
+ this.selectedDot.classList.add('is-selected');
2997
+ this.selectedDot.setAttribute('aria-current', 'step');
2998
+ };
2999
+
3000
+ PageDots.prototype.onTap = PageDots.prototype.onClick = function (event) {
3001
+ // old method name, backwards-compatible
3002
+ var target = event.target;
3003
+ // only care about dot clicks
3004
+ if (target.nodeName != 'LI') {
3005
+ return;
3006
+ }
3007
+
3008
+ this.parent.uiChange();
3009
+ var index = this.dots.indexOf(target);
3010
+ this.parent.select(index);
3011
+ };
3012
+
3013
+ PageDots.prototype.destroy = function () {
3014
+ this.deactivate();
3015
+ this.allOff();
3016
+ };
3017
+
3018
+ Flickity.PageDots = PageDots;
3019
+
3020
+ // -------------------------- Flickity -------------------------- //
3021
+
3022
+ utils.extend(Flickity.defaults, {
3023
+ pageDots: true,
3024
+ });
3025
+
3026
+ Flickity.createMethods.push('_createPageDots');
3027
+
3028
+ var proto$5 = Flickity.prototype;
3029
+
3030
+ proto$5._createPageDots = function () {
3031
+ if (!this.options.pageDots) {
3032
+ return;
3033
+ }
3034
+ this.pageDots = new PageDots(this);
3035
+ // events
3036
+ this.on('activate', this.activatePageDots);
3037
+ this.on('select', this.updateSelectedPageDots);
3038
+ this.on('cellChange', this.updatePageDots);
3039
+ this.on('resize', this.updatePageDots);
3040
+ this.on('deactivate', this.deactivatePageDots);
3041
+ };
3042
+
3043
+ proto$5.activatePageDots = function () {
3044
+ this.pageDots.activate();
3045
+ };
3046
+
3047
+ proto$5.updateSelectedPageDots = function () {
3048
+ this.pageDots.updateSelected();
3049
+ };
3050
+
3051
+ proto$5.updatePageDots = function () {
3052
+ this.pageDots.setDots();
3053
+ };
3054
+
3055
+ proto$5.deactivatePageDots = function () {
3056
+ this.pageDots.deactivate();
3057
+ };
3058
+
3059
+ // ----- ----- //
3060
+
3061
+ Flickity.PageDots = PageDots;
3062
+
3063
+ // -------------------------- Player -------------------------- //
3064
+
3065
+ function Player(parent) {
3066
+ this.parent = parent;
3067
+ this.state = 'stopped';
3068
+ // visibility change event handler
3069
+ this.onVisibilityChange = this.visibilityChange.bind(this);
3070
+ this.onVisibilityPlay = this.visibilityPlay.bind(this);
3071
+ }
3072
+
3073
+ Player.prototype = Object.create(evEmitter.prototype);
3074
+
3075
+ // start play
3076
+ Player.prototype.play = function () {
3077
+ if (this.state == 'playing') {
3078
+ return;
3079
+ }
3080
+ // do not play if page is hidden, start playing when page is visible
3081
+ var isPageHidden = document.hidden;
3082
+ if (isPageHidden) {
3083
+ document.addEventListener('visibilitychange', this.onVisibilityPlay);
3084
+ return;
3085
+ }
3086
+
3087
+ this.state = 'playing';
3088
+ // listen to visibility change
3089
+ document.addEventListener('visibilitychange', this.onVisibilityChange);
3090
+ // start ticking
3091
+ this.tick();
3092
+ };
3093
+
3094
+ Player.prototype.tick = function () {
3095
+ // do not tick if not playing
3096
+ if (this.state != 'playing') {
3097
+ return;
3098
+ }
3099
+
3100
+ var time = this.parent.options.autoPlay;
3101
+ // default to 3 seconds
3102
+ time = typeof time == 'number' ? time : 3000;
3103
+ var _this = this;
3104
+ // HACK: reset ticks if stopped and started within interval
3105
+ this.clear();
3106
+ this.timeout = setTimeout(function () {
3107
+ _this.parent.next(true);
3108
+ _this.tick();
3109
+ }, time);
3110
+ };
3111
+
3112
+ Player.prototype.stop = function () {
3113
+ this.state = 'stopped';
3114
+ this.clear();
3115
+ // remove visibility change event
3116
+ document.removeEventListener('visibilitychange', this.onVisibilityChange);
3117
+ };
3118
+
3119
+ Player.prototype.clear = function () {
3120
+ clearTimeout(this.timeout);
3121
+ };
3122
+
3123
+ Player.prototype.pause = function () {
3124
+ if (this.state == 'playing') {
3125
+ this.state = 'paused';
3126
+ this.clear();
3127
+ }
3128
+ };
3129
+
3130
+ Player.prototype.unpause = function () {
3131
+ // re-start play if paused
3132
+ if (this.state == 'paused') {
3133
+ this.play();
3134
+ }
3135
+ };
3136
+
3137
+ // pause if page visibility is hidden, unpause if visible
3138
+ Player.prototype.visibilityChange = function () {
3139
+ var isPageHidden = document.hidden;
3140
+ this[isPageHidden ? 'pause' : 'unpause']();
3141
+ };
3142
+
3143
+ Player.prototype.visibilityPlay = function () {
3144
+ this.play();
3145
+ document.removeEventListener('visibilitychange', this.onVisibilityPlay);
3146
+ };
3147
+
3148
+ // -------------------------- Flickity -------------------------- //
3149
+
3150
+ utils.extend(Flickity.defaults, {
3151
+ pauseAutoPlayOnHover: true,
3152
+ });
3153
+
3154
+ Flickity.createMethods.push('_createPlayer');
3155
+ var proto$4 = Flickity.prototype;
3156
+
3157
+ proto$4._createPlayer = function () {
3158
+ this.player = new Player(this);
3159
+
3160
+ this.on('activate', this.activatePlayer);
3161
+ this.on('uiChange', this.stopPlayer);
3162
+ this.on('pointerDown', this.stopPlayer);
3163
+ this.on('deactivate', this.deactivatePlayer);
3164
+ };
3165
+
3166
+ proto$4.activatePlayer = function () {
3167
+ if (!this.options.autoPlay) {
3168
+ return;
3169
+ }
3170
+ this.player.play();
3171
+ this.element.addEventListener('mouseenter', this);
3172
+ };
3173
+
3174
+ // Player API, don't hate the ... thanks I know where the door is
3175
+
3176
+ proto$4.playPlayer = function () {
3177
+ this.player.play();
3178
+ };
3179
+
3180
+ proto$4.stopPlayer = function () {
3181
+ this.player.stop();
3182
+ };
3183
+
3184
+ proto$4.pausePlayer = function () {
3185
+ this.player.pause();
3186
+ };
3187
+
3188
+ proto$4.unpausePlayer = function () {
3189
+ this.player.unpause();
3190
+ };
3191
+
3192
+ proto$4.deactivatePlayer = function () {
3193
+ this.player.stop();
3194
+ this.element.removeEventListener('mouseenter', this);
3195
+ };
3196
+
3197
+ // ----- mouseenter/leave ----- //
3198
+
3199
+ // pause auto-play on hover
3200
+ proto$4.onmouseenter = function () {
3201
+ if (!this.options.pauseAutoPlayOnHover) {
3202
+ return;
3203
+ }
3204
+ this.player.pause();
3205
+ this.element.addEventListener('mouseleave', this);
3206
+ };
3207
+
3208
+ // resume auto-play on hover off
3209
+ proto$4.onmouseleave = function () {
3210
+ this.player.unpause();
3211
+ this.element.removeEventListener('mouseleave', this);
3212
+ };
3213
+
3214
+ // ----- ----- //
3215
+
3216
+ Flickity.Player = Player;
3217
+
3218
+ // append cells to a document fragment
3219
+ function getCellsFragment(cells) {
3220
+ var fragment = document.createDocumentFragment();
3221
+ cells.forEach(function (cell) {
3222
+ fragment.appendChild(cell.element);
3223
+ });
3224
+ return fragment;
3225
+ }
3226
+
3227
+ // -------------------------- add/remove cell prototype -------------------------- //
3228
+
3229
+ var proto$3 = Flickity.prototype;
3230
+
3231
+ /**
3232
+ * Insert, prepend, or append cells
3233
+ * @param {Element, Array, NodeList} elems
3234
+ * @param {Integer} index
3235
+ */
3236
+ proto$3.insert = function (elems, index) {
3237
+ var cells = this._makeCells(elems);
3238
+ if (!cells || !cells.length) {
3239
+ return;
3240
+ }
3241
+ var len = this.cells.length;
3242
+ // default to append
3243
+ index = index === undefined ? len : index;
3244
+ // add cells with document fragment
3245
+ var fragment = getCellsFragment(cells);
3246
+ // append to slider
3247
+ var isAppend = index == len;
3248
+ if (isAppend) {
3249
+ this.slider.appendChild(fragment);
3250
+ } else {
3251
+ var insertCellElement = this.cells[index].element;
3252
+ this.slider.insertBefore(fragment, insertCellElement);
3253
+ }
3254
+ // add to this.cells
3255
+ if (index === 0) {
3256
+ // prepend, add to start
3257
+ this.cells = cells.concat(this.cells);
3258
+ } else if (isAppend) {
3259
+ // append, add to end
3260
+ this.cells = this.cells.concat(cells);
3261
+ } else {
3262
+ // insert in this.cells
3263
+ var endCells = this.cells.splice(index, len - index);
3264
+ this.cells = this.cells.concat(cells).concat(endCells);
3265
+ }
3266
+
3267
+ this._sizeCells(cells);
3268
+ this.cellChange(index, true);
3269
+ };
3270
+
3271
+ proto$3.append = function (elems) {
3272
+ this.insert(elems, this.cells.length);
3273
+ };
3274
+
3275
+ proto$3.prepend = function (elems) {
3276
+ this.insert(elems, 0);
3277
+ };
3278
+
3279
+ /**
3280
+ * Remove cells
3281
+ * @param {Element, Array, NodeList} elems
3282
+ */
3283
+ proto$3.remove = function (elems) {
3284
+ var cells = this.getCells(elems);
3285
+ if (!cells || !cells.length) {
3286
+ return;
3287
+ }
3288
+
3289
+ var minCellIndex = this.cells.length - 1;
3290
+ // remove cells from collection & DOM
3291
+ cells.forEach(function (cell) {
3292
+ cell.remove();
3293
+ var index = this.cells.indexOf(cell);
3294
+ minCellIndex = Math.min(index, minCellIndex);
3295
+ utils.removeFrom(this.cells, cell);
3296
+ }, this);
3297
+
3298
+ this.cellChange(minCellIndex, true);
3299
+ };
3300
+
3301
+ /**
3302
+ * logic to be run after a cell's size changes
3303
+ * @param {Element} elem - cell's element
3304
+ */
3305
+ proto$3.cellSizeChange = function (elem) {
3306
+ var cell = this.getCell(elem);
3307
+ if (!cell) {
3308
+ return;
3309
+ }
3310
+ cell.getSize();
3311
+
3312
+ var index = this.cells.indexOf(cell);
3313
+ this.cellChange(index);
3314
+ };
3315
+
3316
+ /**
3317
+ * logic any time a cell is changed: added, removed, or size changed
3318
+ * @param {Integer} changedCellIndex - index of the changed cell, optional
3319
+ */
3320
+ proto$3.cellChange = function (changedCellIndex, isPositioningSlider) {
3321
+ var prevSelectedElem = this.selectedElement;
3322
+ this._positionCells(changedCellIndex);
3323
+ this._getWrapShiftCells();
3324
+ this.setGallerySize();
3325
+ // update selectedIndex
3326
+ // try to maintain position & select previous selected element
3327
+ var cell = this.getCell(prevSelectedElem);
3328
+ if (cell) {
3329
+ this.selectedIndex = this.getCellSlideIndex(cell);
3330
+ }
3331
+ this.selectedIndex = Math.min(this.slides.length - 1, this.selectedIndex);
3332
+
3333
+ this.emitEvent('cellChange', [changedCellIndex]);
3334
+ // position slider
3335
+ this.select(this.selectedIndex);
3336
+ // do not position slider after lazy load
3337
+ if (isPositioningSlider) {
3338
+ this.positionSliderAtSelected();
3339
+ }
3340
+ };
3341
+
3342
+ Flickity.createMethods.push('_createLazyload');
3343
+ var proto$2 = Flickity.prototype;
3344
+
3345
+ proto$2._createLazyload = function () {
3346
+ this.on('select', this.lazyLoad);
3347
+ };
3348
+
3349
+ proto$2.lazyLoad = function () {
3350
+ var lazyLoad = this.options.lazyLoad;
3351
+ if (!lazyLoad) {
3352
+ return;
3353
+ }
3354
+ // get adjacent cells, use lazyLoad option for adjacent count
3355
+ var adjCount = typeof lazyLoad == 'number' ? lazyLoad : 0;
3356
+ var cellElems = this.getAdjacentCellElements(adjCount);
3357
+ // get lazy images in those cells
3358
+ var lazyImages = [];
3359
+ cellElems.forEach(function (cellElem) {
3360
+ var lazyCellImages = getCellLazyImages(cellElem);
3361
+ lazyImages = lazyImages.concat(lazyCellImages);
3362
+ });
3363
+ // load lazy images
3364
+ lazyImages.forEach(function (img) {
3365
+ new LazyLoader(img, this);
3366
+ }, this);
3367
+ };
3368
+
3369
+ function getCellLazyImages(cellElem) {
3370
+ // check if cell element is lazy image
3371
+ if (cellElem.nodeName == 'IMG') {
3372
+ var lazyloadAttr = cellElem.getAttribute('data-flickity-lazyload');
3373
+ var srcAttr = cellElem.getAttribute('data-flickity-lazyload-src');
3374
+ var srcsetAttr = cellElem.getAttribute('data-flickity-lazyload-srcset');
3375
+ if (lazyloadAttr || srcAttr || srcsetAttr) {
3376
+ return [cellElem];
3377
+ }
3378
+ }
3379
+ // select lazy images in cell
3380
+ var lazySelector =
3381
+ 'img[data-flickity-lazyload], ' +
3382
+ 'img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]';
3383
+ var imgs = cellElem.querySelectorAll(lazySelector);
3384
+ return utils.makeArray(imgs);
3385
+ }
3386
+
3387
+ // -------------------------- LazyLoader -------------------------- //
3388
+
3389
+ /**
3390
+ * class to handle loading images
3391
+ */
3392
+ function LazyLoader(img, flickity) {
3393
+ this.img = img;
3394
+ this.flickity = flickity;
3395
+ this.load();
3396
+ }
3397
+
3398
+ LazyLoader.prototype.handleEvent = utils.handleEvent;
3399
+
3400
+ LazyLoader.prototype.load = function () {
3401
+ this.img.addEventListener('load', this);
3402
+ this.img.addEventListener('error', this);
3403
+ // get src & srcset
3404
+ var src =
3405
+ this.img.getAttribute('data-flickity-lazyload') ||
3406
+ this.img.getAttribute('data-flickity-lazyload-src');
3407
+ var srcset = this.img.getAttribute('data-flickity-lazyload-srcset');
3408
+ // set src & serset
3409
+ this.img.src = src;
3410
+ if (srcset) {
3411
+ this.img.setAttribute('srcset', srcset);
3412
+ }
3413
+ // remove attr
3414
+ this.img.removeAttribute('data-flickity-lazyload');
3415
+ this.img.removeAttribute('data-flickity-lazyload-src');
3416
+ this.img.removeAttribute('data-flickity-lazyload-srcset');
3417
+ };
3418
+
3419
+ LazyLoader.prototype.onload = function (event) {
3420
+ this.complete(event, 'flickity-lazyloaded');
3421
+ };
3422
+
3423
+ LazyLoader.prototype.onerror = function (event) {
3424
+ this.complete(event, 'flickity-lazyerror');
3425
+ };
3426
+
3427
+ LazyLoader.prototype.complete = function (event, className) {
3428
+ // unbind events
3429
+ this.img.removeEventListener('load', this);
3430
+ this.img.removeEventListener('error', this);
3431
+
3432
+ var cell = this.flickity.getParentCell(this.img);
3433
+ var cellElem = cell && cell.element;
3434
+ this.flickity.cellSizeChange(cellElem);
3435
+
3436
+ this.img.classList.add(className);
3437
+ this.flickity.dispatchEvent('lazyLoad', event, cellElem);
3438
+ };
3439
+
3440
+ // ----- ----- //
3441
+
3442
+ Flickity.LazyLoader = LazyLoader;
3443
+
3444
+ Flickity.createMethods.push('_createFullscreen');
3445
+ var proto$1 = Flickity.prototype;
3446
+
3447
+ proto$1._createFullscreen = function () {
3448
+ this.isFullscreen = false;
3449
+
3450
+ if (!this.options.fullscreen) {
3451
+ return;
3452
+ }
3453
+ // buttons
3454
+ this.viewFullscreenButton = new FullscreenButton('view', this);
3455
+ this.exitFullscreenButton = new FullscreenButton('exit', this);
3456
+
3457
+ this.on('activate', this._changeFullscreenActive);
3458
+ this.on('deactivate', this._changeFullscreenActive);
3459
+ };
3460
+
3461
+ // ----- activation ----- //
3462
+
3463
+ proto$1._changeFullscreenActive = function () {
3464
+ var childMethod = this.isActive ? 'appendChild' : 'removeChild';
3465
+ this.element[childMethod](this.viewFullscreenButton.element);
3466
+ this.element[childMethod](this.exitFullscreenButton.element);
3467
+ // activate or deactivate buttons
3468
+ var activeMethod = this.isActive ? 'activate' : 'deactivate';
3469
+ this.viewFullscreenButton[activeMethod]();
3470
+ this.exitFullscreenButton[activeMethod]();
3471
+ };
3472
+
3473
+ // ----- view, exit, toggle ----- //
3474
+
3475
+ proto$1.viewFullscreen = function () {
3476
+ this._changeFullscreen(true);
3477
+ this.focus();
3478
+ };
3479
+
3480
+ proto$1.exitFullscreen = function () {
3481
+ this._changeFullscreen(false);
3482
+ };
3483
+
3484
+ proto$1._changeFullscreen = function (isView) {
3485
+ if (this.isFullscreen == isView) {
3486
+ return;
3487
+ }
3488
+ this.isFullscreen = isView;
3489
+ var classMethod = isView ? 'add' : 'remove';
3490
+ document.documentElement.classList[classMethod]('is-flickity-fullscreen');
3491
+ this.element.classList[classMethod]('is-fullscreen');
3492
+ this.resize();
3493
+ // HACK extra reposition on fullscreen for images
3494
+ if (this.isFullscreen) {
3495
+ this.reposition();
3496
+ }
3497
+ this.dispatchEvent('fullscreenChange', null, [isView]);
3498
+ };
3499
+
3500
+ proto$1.toggleFullscreen = function () {
3501
+ this._changeFullscreen(!this.isFullscreen);
3502
+ };
3503
+
3504
+ // ----- setGallerySize ----- //
3505
+
3506
+ // overwrite so fullscreen cells are full height
3507
+ var setGallerySize = proto$1.setGallerySize;
3508
+ proto$1.setGallerySize = function () {
3509
+ if (!this.options.setGallerySize) {
3510
+ return;
3511
+ }
3512
+ if (this.isFullscreen) {
3513
+ // remove height style on fullscreen
3514
+ this.viewport.style.height = '';
3515
+ } else {
3516
+ // otherwise, do normal
3517
+ setGallerySize.call(this);
3518
+ }
3519
+ };
3520
+
3521
+ // ----- keyboard ----- //
3522
+
3523
+ // ESC key closes full screen
3524
+ Flickity.keyboardHandlers[27] = function () {
3525
+ this.exitFullscreen();
3526
+ };
3527
+
3528
+ // ----- FullscreenButton ----- //
3529
+
3530
+ function FullscreenButton(name, flickity) {
3531
+ this.name = name;
3532
+ this.createButton();
3533
+ this.createIcon();
3534
+ // events
3535
+ // trigger viewFullscreen or exitFullscreen on click
3536
+ this.onClick = function () {
3537
+ flickity[name + 'Fullscreen']();
3538
+ };
3539
+ this.clickHandler = this.onClick.bind(this);
3540
+ }
3541
+
3542
+ FullscreenButton.prototype.createButton = function () {
3543
+ var element = (this.element = document.createElement('button'));
3544
+ element.className =
3545
+ 'flickity-button flickity-fullscreen-button ' +
3546
+ 'flickity-fullscreen-button-' +
3547
+ this.name;
3548
+ // prevent button from submitting form
3549
+ element.setAttribute('type', 'button');
3550
+ // set label
3551
+ var label = capitalize(this.name + ' full-screen');
3552
+ element.setAttribute('aria-label', label);
3553
+ element.title = label;
3554
+ };
3555
+
3556
+ function capitalize(text) {
3557
+ return text[0].toUpperCase() + text.slice(1);
3558
+ }
3559
+
3560
+ var svgURI = 'http://www.w3.org/2000/svg';
3561
+
3562
+ var pathDirections = {
3563
+ view: 'M15,20,7,28h5v4H0V20H4v5l8-8Zm5-5,8-8v5h4V0H20V4h5l-8,8Z',
3564
+ exit: 'M32,3l-7,7h5v4H18V2h4V7l7-7ZM3,32l7-7v5h4V18H2v4H7L0,29Z',
3565
+ };
3566
+
3567
+ FullscreenButton.prototype.createIcon = function () {
3568
+ var svg = document.createElementNS(svgURI, 'svg');
3569
+ svg.setAttribute('class', 'flickity-button-icon');
3570
+ svg.setAttribute('viewBox', '0 0 32 32');
3571
+ // path & direction
3572
+ var path = document.createElementNS(svgURI, 'path');
3573
+ var direction = pathDirections[this.name];
3574
+ path.setAttribute('d', direction);
3575
+ // put it together
3576
+ svg.appendChild(path);
3577
+ this.element.appendChild(svg);
3578
+ };
3579
+
3580
+ FullscreenButton.prototype.activate = function () {
3581
+ this.element.addEventListener('click', this.clickHandler);
3582
+ };
3583
+
3584
+ FullscreenButton.prototype.deactivate = function () {
3585
+ this.element.removeEventListener('click', this.clickHandler);
3586
+ };
3587
+
3588
+ Flickity.FullscreenButton = FullscreenButton;
3589
+
3590
+ var Slide = Flickity.Slide;
3591
+
3592
+ var slideUpdateTarget = Slide.prototype.updateTarget;
3593
+ Slide.prototype.updateTarget = function () {
3594
+ slideUpdateTarget.apply(this, arguments);
3595
+ if (!this.parent.options.fade) {
3596
+ return;
3597
+ }
3598
+ // position cells at selected target
3599
+ var slideTargetX = this.target - this.x;
3600
+ var firstCellX = this.cells[0].x;
3601
+ this.cells.forEach(function (cell) {
3602
+ var targetX = cell.x - firstCellX - slideTargetX;
3603
+ cell.renderPosition(targetX);
3604
+ });
3605
+ };
3606
+
3607
+ Slide.prototype.setOpacity = function (alpha) {
3608
+ this.cells.forEach(function (cell) {
3609
+ cell.element.style.opacity = alpha;
3610
+ });
3611
+ };
3612
+
3613
+ // ---- Flickity ---- //
3614
+
3615
+ var proto = Flickity.prototype;
3616
+
3617
+ Flickity.createMethods.push('_createFade');
3618
+
3619
+ proto._createFade = function () {
3620
+ this.fadeIndex = this.selectedIndex;
3621
+ this.prevSelectedIndex = this.selectedIndex;
3622
+ this.on('select', this.onSelectFade);
3623
+ this.on('dragEnd', this.onDragEndFade);
3624
+ this.on('settle', this.onSettleFade);
3625
+ this.on('activate', this.onActivateFade);
3626
+ this.on('deactivate', this.onDeactivateFade);
3627
+ };
3628
+
3629
+ var updateSlides = proto.updateSlides;
3630
+ proto.updateSlides = function () {
3631
+ updateSlides.apply(this, arguments);
3632
+ if (!this.options.fade) {
3633
+ return;
3634
+ }
3635
+ // set initial opacity
3636
+ this.slides.forEach(function (slide, i) {
3637
+ var alpha = i == this.selectedIndex ? 1 : 0;
3638
+ slide.setOpacity(alpha);
3639
+ }, this);
3640
+ };
3641
+
3642
+ /* ---- events ---- */
3643
+
3644
+ proto.onSelectFade = function () {
3645
+ // in case of resize, keep fadeIndex within current count
3646
+ this.fadeIndex = Math.min(this.prevSelectedIndex, this.slides.length - 1);
3647
+ this.prevSelectedIndex = this.selectedIndex;
3648
+ };
3649
+
3650
+ proto.onSettleFade = function () {
3651
+ delete this.didDragEnd;
3652
+ if (!this.options.fade) {
3653
+ return;
3654
+ }
3655
+ // set full and 0 opacity on selected & faded slides
3656
+ this.selectedSlide.setOpacity(1);
3657
+ var fadedSlide = this.slides[this.fadeIndex];
3658
+ if (fadedSlide && this.fadeIndex != this.selectedIndex) {
3659
+ this.slides[this.fadeIndex].setOpacity(0);
3660
+ }
3661
+ };
3662
+
3663
+ proto.onDragEndFade = function () {
3664
+ // set flag
3665
+ this.didDragEnd = true;
3666
+ };
3667
+
3668
+ proto.onActivateFade = function () {
3669
+ if (this.options.fade) {
3670
+ this.element.classList.add('is-fade');
3671
+ }
3672
+ };
3673
+
3674
+ proto.onDeactivateFade = function () {
3675
+ if (!this.options.fade) {
3676
+ return;
3677
+ }
3678
+ this.element.classList.remove('is-fade');
3679
+ // reset opacity
3680
+ this.slides.forEach(function (slide) {
3681
+ slide.setOpacity('');
3682
+ });
3683
+ };
3684
+
3685
+ /* ---- position & fading ---- */
3686
+
3687
+ var positionSlider = proto.positionSlider;
3688
+ proto.positionSlider = function () {
3689
+ if (!this.options.fade) {
3690
+ positionSlider.apply(this, arguments);
3691
+ return;
3692
+ }
3693
+
3694
+ this.fadeSlides();
3695
+ this.dispatchScrollEvent();
3696
+ };
3697
+
3698
+ var positionSliderAtSelected = proto.positionSliderAtSelected;
3699
+ proto.positionSliderAtSelected = function () {
3700
+ if (this.options.fade) {
3701
+ // position fade slider at origin
3702
+ this.setTranslateX(0);
3703
+ }
3704
+ positionSliderAtSelected.apply(this, arguments);
3705
+ };
3706
+
3707
+ proto.fadeSlides = function () {
3708
+ if (this.slides.length < 2) {
3709
+ return;
3710
+ }
3711
+ // get slides to fade-in & fade-out
3712
+ var indexes = this.getFadeIndexes();
3713
+ var fadeSlideA = this.slides[indexes.a];
3714
+ var fadeSlideB = this.slides[indexes.b];
3715
+ var distance = this.wrapDifference(fadeSlideA.target, fadeSlideB.target);
3716
+ var progress = this.wrapDifference(fadeSlideA.target, -this.x);
3717
+ progress = progress / distance;
3718
+
3719
+ fadeSlideA.setOpacity(1 - progress);
3720
+ fadeSlideB.setOpacity(progress);
3721
+
3722
+ // hide previous slide
3723
+ var fadeHideIndex = indexes.a;
3724
+ if (this.isDragging) {
3725
+ fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b;
3726
+ }
3727
+ var isNewHideIndex =
3728
+ this.fadeHideIndex != undefined &&
3729
+ this.fadeHideIndex != fadeHideIndex &&
3730
+ this.fadeHideIndex != indexes.a &&
3731
+ this.fadeHideIndex != indexes.b;
3732
+ if (isNewHideIndex) {
3733
+ // new fadeHideSlide set, hide previous
3734
+ this.slides[this.fadeHideIndex].setOpacity(0);
3735
+ }
3736
+ this.fadeHideIndex = fadeHideIndex;
3737
+ };
3738
+
3739
+ proto.getFadeIndexes = function () {
3740
+ if (!this.isDragging && !this.didDragEnd) {
3741
+ return {
3742
+ a: this.fadeIndex,
3743
+ b: this.selectedIndex,
3744
+ };
3745
+ }
3746
+ if (this.options.wrapAround) {
3747
+ return this.getFadeDragWrapIndexes();
3748
+ } else {
3749
+ return this.getFadeDragLimitIndexes();
3750
+ }
3751
+ };
3752
+
3753
+ proto.getFadeDragWrapIndexes = function () {
3754
+ var distances = this.slides.map(function (slide, i) {
3755
+ return this.getSlideDistance(-this.x, i);
3756
+ }, this);
3757
+ var absDistances = distances.map(function (distance) {
3758
+ return Math.abs(distance);
3759
+ });
3760
+ var minDistance = Math.min.apply(Math, absDistances);
3761
+ var closestIndex = absDistances.indexOf(minDistance);
3762
+ var distance = distances[closestIndex];
3763
+ var len = this.slides.length;
3764
+
3765
+ var delta = distance >= 0 ? 1 : -1;
3766
+ return {
3767
+ a: closestIndex,
3768
+ b: utils.modulo(closestIndex + delta, len),
3769
+ };
3770
+ };
3771
+
3772
+ proto.getFadeDragLimitIndexes = function () {
3773
+ // calculate closest previous slide
3774
+ var dragIndex = 0;
3775
+ for (var i = 0; i < this.slides.length - 1; i++) {
3776
+ var slide = this.slides[i];
3777
+ if (-this.x < slide.target) {
3778
+ break;
3779
+ }
3780
+ dragIndex = i;
3781
+ }
3782
+ return {
3783
+ a: dragIndex,
3784
+ b: dragIndex + 1,
3785
+ };
3786
+ };
3787
+
3788
+ proto.wrapDifference = function (a, b) {
3789
+ var diff = b - a;
3790
+
3791
+ if (!this.options.wrapAround) {
3792
+ return diff;
3793
+ }
3794
+
3795
+ var diffPlus = diff + this.slideableWidth;
3796
+ var diffMinus = diff - this.slideableWidth;
3797
+ if (Math.abs(diffPlus) < Math.abs(diff)) {
3798
+ diff = diffPlus;
3799
+ }
3800
+ if (Math.abs(diffMinus) < Math.abs(diff)) {
3801
+ diff = diffMinus;
3802
+ }
3803
+ return diff;
3804
+ };
3805
+
3806
+ // ---- wrapAround ---- //
3807
+
3808
+ var _getWrapShiftCells = proto._getWrapShiftCells;
3809
+ proto._getWrapShiftCells = function () {
3810
+ if (!this.options.fade) {
3811
+ _getWrapShiftCells.apply(this, arguments);
3812
+ }
3813
+ };
3814
+
3815
+ var shiftWrapCells = proto.shiftWrapCells;
3816
+ proto.shiftWrapCells = function () {
3817
+ if (!this.options.fade) {
3818
+ shiftWrapCells.apply(this, arguments);
3819
+ }
3820
+ };
3821
+
3822
+ const flickity = Flickity;
3823
+
3824
+ const slidesCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}[hidden]{display:none !important}:host{--dot-color:#ccc;--dot-color-active:var(--nano-color-primary, #007495);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:white;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:white;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:white;display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-transition:opacity 0.2s;transition:opacity 0.2s;opacity:0}:host([ready]){opacity:1}.slideshow{height:100%;position:relative}.flickity-container{height:0;opacity:0;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.flickity-container.slides-ready{height:100%}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;height:100%;width:100%;top:0;left:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;height:100% !important}.flickity-slider{position:absolute;width:100%;height:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:-webkit-grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:-webkit-grabbing;cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:none;-webkit-box-shadow:0 0 0 5px #19f;box-shadow:0 0 0 5px #19f}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.flickity-button-icon{fill:var(--navbtns-icon-color)}.flickity-button:disabled .flickity-button-icon{fill:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{top:50%;width:44px;height:44px;border-radius:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.flickity-prev-next-button.previous{left:10px}.flickity-prev-next-button.next{right:10px}.flickity-rtl .flickity-prev-next-button.previous{left:auto;right:10px}.flickity-rtl .flickity-prev-next-button.next{right:auto;left:10px}.flickity-prev-next-button .flickity-button-icon{position:absolute;left:20%;top:20%;width:60%;height:60%}.flickity-page-dots{position:absolute;width:100%;bottom:10px;padding:0;margin:0;list-style:none;text-align:center;line-height:1;z-index:4}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{display:inline-block;width:10px;height:10px;margin:0 8px;border-radius:50%;cursor:pointer;background:var(--dot-color)}.flickity-page-dots .dot.is-selected{opacity:1;background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.9);padding-bottom:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{bottom:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;right:10px;top:10px;width:24px;height:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{right:auto;left:10px}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;width:16px;height:16px;left:4px;top:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}";
3825
+
3826
+ const CANSHADOW = !!document.head.attachShadow;
3827
+ let Slides = class extends HTMLElement$1 {
3828
+ constructor() {
3829
+ super();
3830
+ this.__registerHost();
3831
+ this.__attachShadow();
3832
+ this.nanoSlidesDidLoad = createEvent(this, "nanoSlidesDidLoad", 7);
3833
+ this.nanoSlidesReady = createEvent(this, "nanoSlidesReady", 7);
3834
+ this.nanoSlidesSelect = createEvent(this, "nanoSlidesSelect", 7);
3835
+ this.nanoSlidesChange = createEvent(this, "nanoSlidesChange", 7);
3836
+ this.nanoSlidesScroll = createEvent(this, "nanoSlidesScroll", 7);
3837
+ this.nanoSlidesTransitionEnd = createEvent(this, "nanoSlidesTransitionEnd", 7);
3838
+ this.nanoSlidesDragStart = createEvent(this, "nanoSlidesDragStart", 7);
3839
+ this.nanoSlidesDragMove = createEvent(this, "nanoSlidesDragMove", 7);
3840
+ this.nanoSlidesDragEnd = createEvent(this, "nanoSlidesDragEnd", 7);
3841
+ this.nanoSlidesTap = createEvent(this, "nanoSlidesTap", 7);
3842
+ this.nanoSlidesFullscreenChange = createEvent(this, "nanoSlidesFullscreenChange", 7);
3843
+ this.flickityReady = false;
3844
+ this.flickity = new Promise((resolve) => {
3845
+ this.readyflickity = resolve;
3846
+ });
3847
+ this.didInit = false;
3848
+ /**
3849
+ * Options to pass to the flickity instance.
3850
+ * See https://flickity.metafizzy.co/options.html for valid options
3851
+ */
3852
+ this.options = {};
3853
+ /**
3854
+ * If `true`, show the next / prev buttons.
3855
+ */
3856
+ this.navbtns = false;
3857
+ /**
3858
+ * If `true`, show the pagination.
3859
+ */
3860
+ this.pager = false;
3861
+ /**
3862
+ * If `true`, show a fullscreen button.
3863
+ */
3864
+ this.fullscreenbtn = false;
3865
+ /**
3866
+ * If `true`, make the slider fullscreen.
3867
+ */
3868
+ this.fullscreen = false;
3869
+ /**
3870
+ * Animation presets.
3871
+ */
3872
+ this.animation = 'scroll';
3873
+ /**
3874
+ * Zero-based index of the selected cell.
3875
+ */
3876
+ this.currentSlide = 0;
3877
+ /**
3878
+ * time duration, in ms, to automatically advance slides
3879
+ */
3880
+ this.autoplay = false;
3881
+ /**
3882
+ * @internal
3883
+ */
3884
+ this.ready = false;
3885
+ this.parralax = async () => {
3886
+ const flkty = await this.flickity;
3887
+ flkty.slides.forEach((slide, i) => {
3888
+ let ele = this.childrenEles[i];
3889
+ var x = ((slide.target + flkty.x) * -1) / 3;
3890
+ ele.style['transform'] = 'translateX(' + x + 'px)';
3891
+ });
3892
+ };
3893
+ this.handleFullscreen = (isFullScreen) => {
3894
+ this.fullscreen = isFullScreen;
3895
+ this.nanoSlidesFullscreenChange.emit(isFullScreen);
3896
+ };
3897
+ this.handleSlideSelect = (slide) => {
3898
+ this.iCurrentSlide = slide;
3899
+ this.nanoSlidesSelect.emit(slide);
3900
+ };
3901
+ }
3902
+ async optionsChanged() {
3903
+ if (this.flickityReady) {
3904
+ const flickity = await this.getflickity();
3905
+ Object.assign(flickity.options, this.options);
3906
+ await this.update();
3907
+ }
3908
+ }
3909
+ async navbtnsChanged() {
3910
+ Array.from(this._getRoot().querySelectorAll('.flickity-prev-next-button')).forEach((btn) => {
3911
+ btn.hidden = !this.navbtns;
3912
+ });
3913
+ }
3914
+ async pagerChanged() {
3915
+ let dots = this._getRoot().querySelector('.flickity-page-dots');
3916
+ dots.hidden = !this.pager;
3917
+ }
3918
+ async fullscreenBtnChanged() {
3919
+ let btn = this._getRoot().querySelector('.flickity-fullscreen-button');
3920
+ btn.hidden = !this.fullscreenbtn;
3921
+ }
3922
+ async fullscreenChanged(_, oldFs) {
3923
+ const flickity = await this.getflickity();
3924
+ if (this.fullscreen)
3925
+ flickity.viewFullscreen();
3926
+ else if (typeof oldFs !== 'undefined')
3927
+ flickity.exitFullscreen();
3928
+ }
3929
+ async animationChange(_, oldAnim) {
3930
+ const [flkty, slides] = await Promise.all([
3931
+ this.getflickity(),
3932
+ waitForSlides(this.host),
3933
+ ]);
3934
+ // clear old stuff
3935
+ slides.forEach((slide) => {
3936
+ slide.style['left'] = undefined;
3937
+ });
3938
+ if (oldAnim === 'parallax') {
3939
+ flkty.off('scroll', this.parralax);
3940
+ slides.forEach((_, i) => {
3941
+ if (this.childrenEles && this.childrenEles[i])
3942
+ this.childrenEles[i].style['transform'] = undefined;
3943
+ });
3944
+ this.update();
3945
+ }
3946
+ // setup new stuff
3947
+ switch (this.animation) {
3948
+ case 'fade':
3949
+ this.options = { fade: true, percentPosition: true };
3950
+ break;
3951
+ case 'parallax':
3952
+ this.options = { fade: false, percentPosition: false };
3953
+ flkty.on('scroll', this.parralax);
3954
+ break;
3955
+ default:
3956
+ this.options = { fade: false, percentPosition: true };
3957
+ break;
3958
+ }
3959
+ }
3960
+ currentSlideChange() {
3961
+ if (this.currentSlide !== this.iCurrentSlide)
3962
+ this.slideTo(this.currentSlide);
3963
+ }
3964
+ internalSlideChange() {
3965
+ this.currentSlide = this.iCurrentSlide;
3966
+ }
3967
+ async autoPlayChange() {
3968
+ await this.stopAutoplay();
3969
+ if (this.autoplay) {
3970
+ if (typeof this.autoplay === 'string')
3971
+ this.autoplay = parseInt(this.autoplay);
3972
+ if (this.autoplay > 0)
3973
+ this.startAutoplay(this.autoplay);
3974
+ }
3975
+ }
3976
+ /**
3977
+ * Update the underlying flickity implementation. Call this if you've added or removed
3978
+ * child slides.
3979
+ */
3980
+ async update() {
3981
+ const [flickity] = await Promise.all([
3982
+ this.getflickity(),
3983
+ waitForSlides(this.host),
3984
+ ]);
3985
+ this.childrenEles = this.host.querySelectorAll('nano-slide > *');
3986
+ flickity.reloadCells();
3987
+ flickity.resize();
3988
+ flickity.reposition();
3989
+ }
3990
+ /**
3991
+ * Force flickity to update its height (when adaptiveHeight is enabled) for the duration
3992
+ * equal to 'speed' parameter.
3993
+ *
3994
+ * @param speed The transition duration (in ms).
3995
+ */
3996
+ async updateAutoHeight(speed) {
3997
+ const vp = document.querySelector('.flickity-viewport');
3998
+ if (vp)
3999
+ vp.style.transition = speed + 'ms';
4000
+ }
4001
+ /**
4002
+ * Transition to the specified slide.
4003
+ *
4004
+ * @param index The index of the slide to transition to.
4005
+ * @param instant Immediately view the selected slide without animation.
4006
+ */
4007
+ async slideTo(index, instant) {
4008
+ const flickity = await this.getflickity();
4009
+ flickity.select(index, instant);
4010
+ }
4011
+ /**
4012
+ * Transition to the next slide.
4013
+ *
4014
+ * @param instant The transition duration (in ms).
4015
+ * @param wrap If true, the first slide will be selected if at the last slide.
4016
+ */
4017
+ async slideNext(instant, wrap) {
4018
+ const flickity = await this.getflickity();
4019
+ flickity.next(wrap, instant);
4020
+ }
4021
+ /**
4022
+ * Transition to the previous slide.
4023
+ *
4024
+ * @param instant The transition duration (in ms).
4025
+ * @param wrap If true, the last slide will be selected if at the first slide.
4026
+ */
4027
+ async slidePrev(instant, wrap) {
4028
+ const flickity = await this.getflickity();
4029
+ flickity.previous(instant, wrap);
4030
+ }
4031
+ /**
4032
+ * Get the index of the active slide.
4033
+ */
4034
+ async getActiveIndex() {
4035
+ const flickity = await this.getflickity();
4036
+ return flickity.selectedIndex;
4037
+ }
4038
+ /**
4039
+ * Get the total number of slides.
4040
+ */
4041
+ async length() {
4042
+ const flickity = await this.getflickity();
4043
+ return flickity.slides.length;
4044
+ }
4045
+ /**
4046
+ * Get whether or not the current slide is the last slide.
4047
+ */
4048
+ async isEnd() {
4049
+ const flickity = await this.getflickity();
4050
+ return flickity.selectedIndex === flickity.slides.length - 1;
4051
+ }
4052
+ /**
4053
+ * Get whether or not the current slide is the first slide.
4054
+ */
4055
+ async isBeginning() {
4056
+ const flickity = await this.getflickity();
4057
+ return flickity.selectedIndex === 0;
4058
+ }
4059
+ /**
4060
+ * Start auto play.
4061
+ * @param time - optional time duration to show slides
4062
+ */
4063
+ async startAutoplay(time) {
4064
+ const flickity = await this.getflickity();
4065
+ if (time)
4066
+ this.options = { autoPlay: time };
4067
+ setTimeout(() => flickity.playPlayer());
4068
+ }
4069
+ /**
4070
+ * Stop auto play.
4071
+ */
4072
+ async stopAutoplay() {
4073
+ const flickity = await this.getflickity();
4074
+ flickity.stopPlayer();
4075
+ }
4076
+ /**
4077
+ * Lock or unlock the ability to slide to the next slide.
4078
+ *
4079
+ * @param lock If `true`, disable swiping
4080
+ */
4081
+ async lockSwipes(lock) {
4082
+ const flickity = await this.getflickity();
4083
+ flickity.options.draggable = !lock;
4084
+ flickity.updateDraggable();
4085
+ }
4086
+ /**
4087
+ * Get the flickity instance.
4088
+ * Use this to access the full flickity API.
4089
+ * See https://flickity.metafizzy.co/ for all API options.
4090
+ */
4091
+ async getflickity() {
4092
+ return this.flickity;
4093
+ }
4094
+ /**
4095
+ * Hard destroy / create.
4096
+ * Certain flickity options, you will require the instance to be re-initialised
4097
+ */
4098
+ async reload() {
4099
+ this.destroyflickity();
4100
+ setTimeout(() => this.initflickity(), 20);
4101
+ }
4102
+ _getRoot() {
4103
+ return this.host.shadowRoot ? this.host.shadowRoot : this.host;
4104
+ }
4105
+ _fixClassNames() {
4106
+ let ctxClasses = this.slideShowEle.className
4107
+ .split(' ')
4108
+ .filter((classStr) => classStr.match(/^sc-nano/));
4109
+ let eles = this._getRoot().querySelectorAll('*');
4110
+ if (!eles)
4111
+ return;
4112
+ Array.from(eles).map((ele) => {
4113
+ ctxClasses.map((classStr) => ele.classList.add(classStr));
4114
+ });
4115
+ }
4116
+ destroyflickity() {
4117
+ /**
4118
+ * We need to synchronously destroy
4119
+ * flickity otherwise it is possible
4120
+ * that it will be left in a
4121
+ * destroyed state if connectedCallback
4122
+ * is called multiple times
4123
+ */
4124
+ const flickity = this.syncflickity;
4125
+ if (flickity !== undefined) {
4126
+ flickity.destroy();
4127
+ this.flickity = new Promise((resolve) => {
4128
+ this.readyflickity = resolve;
4129
+ });
4130
+ this.flickityReady = false;
4131
+ this.syncflickity = undefined;
4132
+ this.ready = false;
4133
+ }
4134
+ this.didInit = false;
4135
+ }
4136
+ async initflickity() {
4137
+ const finalOptions = this.normalizeOptions();
4138
+ // init flickity core
4139
+ await waitForSlides(this.host);
4140
+ this.slidesReady = true;
4141
+ this.flickityEl =
4142
+ this.flickityEl || this._getRoot().querySelector('.flickity-container');
4143
+ if (this.flickityEl.classList.contains('flickity-enabled'))
4144
+ this.destroyflickity();
4145
+ setTimeout(() => {
4146
+ let flick = new flickity(this.flickityEl, finalOptions);
4147
+ this.flickityReady = true;
4148
+ if (!this.host.shadowRoot || !CANSHADOW)
4149
+ this._fixClassNames();
4150
+ this.syncflickity = flick;
4151
+ this.animationChange();
4152
+ this.navbtnsChanged();
4153
+ this.pagerChanged();
4154
+ this.fullscreenChanged();
4155
+ this.fullscreenBtnChanged();
4156
+ this.readyflickity(flick);
4157
+ this.ready = true;
4158
+ // the slideshow has been initialised without any dimensions - let's add a one show
4159
+ // resize observer to kick it off when it gets some dimensions
4160
+ if (!this.host.getBoundingClientRect().height) {
4161
+ const ro = (this.resizeO = new index(() => {
4162
+ flick.resize();
4163
+ this.resizeO.disconnect();
4164
+ }));
4165
+ ro.observe(this.host);
4166
+ }
4167
+ }, 100);
4168
+ }
4169
+ normalizeOptions() {
4170
+ // Base options, can be changed
4171
+ const flickityOptions = {
4172
+ cellSelector: 'nano-slide',
4173
+ contain: true,
4174
+ prevNextButtons: true,
4175
+ fullscreen: true,
4176
+ accessibility: true,
4177
+ imagesLoaded: true,
4178
+ pageDots: true,
4179
+ };
4180
+ if (this.animation === 'fade') {
4181
+ flickityOptions.fade = true;
4182
+ }
4183
+ if (this.currentSlide > 0) {
4184
+ flickityOptions.initialIndex = this.currentSlide;
4185
+ }
4186
+ if (this.autoplay) {
4187
+ if (typeof this.autoplay === 'string')
4188
+ this.autoplay = parseInt(this.autoplay);
4189
+ if (this.autoplay > 0)
4190
+ flickityOptions.autoPlay = this.autoplay;
4191
+ }
4192
+ // Keep the event options separate, we dont want users
4193
+ // overwriting these
4194
+ const eventOptions = {
4195
+ ready: () => {
4196
+ setTimeout(() => {
4197
+ this.nanoSlidesReady.emit();
4198
+ }, 20);
4199
+ },
4200
+ select: this.handleSlideSelect,
4201
+ change: this.nanoSlidesChange.emit,
4202
+ scroll: this.nanoSlidesScroll.emit,
4203
+ settle: this.nanoSlidesTransitionEnd.emit,
4204
+ dragStart: this.nanoSlidesDragStart.emit,
4205
+ dragMove: this.nanoSlidesDragMove.emit,
4206
+ dragEnd: this.nanoSlidesDragEnd.emit,
4207
+ staticClick: this.nanoSlidesTap.emit,
4208
+ fullscreenChange: this.handleFullscreen,
4209
+ };
4210
+ const customEvents = !!this.options && !!this.options.on ? this.options.on : {};
4211
+ // merge "on" event listeners, while giving our event listeners priority
4212
+ const mergedEventOptions = { on: Object.assign(Object.assign({}, customEvents), eventOptions) };
4213
+ // Merge the base, user options, and events together then pass to flickity
4214
+ // @ts-ignore
4215
+ return Object.assign(Object.assign(Object.assign({}, flickityOptions), mergedEventOptions), this.options);
4216
+ }
4217
+ componentDidLoad() {
4218
+ if (Build.isBrowser &&
4219
+ typeof window !== 'undefined' &&
4220
+ window.MutationObserver) {
4221
+ const mut = (this.mutationO = new MutationObserver((e) => {
4222
+ if (e[0].addedNodes[0] &&
4223
+ e[0].addedNodes[0].nodeName.toLowerCase() === 'nano-slide' &&
4224
+ this.flickityReady) {
4225
+ this.update();
4226
+ }
4227
+ }));
4228
+ mut.observe(this.host, {
4229
+ childList: true,
4230
+ subtree: true,
4231
+ });
4232
+ }
4233
+ }
4234
+ componentWillLoad() {
4235
+ this.nanoSlidesDidLoad.emit();
4236
+ if (!this.didInit) {
4237
+ this.didInit = true;
4238
+ this.initflickity();
4239
+ }
4240
+ }
4241
+ disconnectedCallback() {
4242
+ if (this.mutationO) {
4243
+ this.mutationO.disconnect();
4244
+ this.mutationO = undefined;
4245
+ }
4246
+ if (this.resizeO)
4247
+ this.resizeO.disconnect();
4248
+ this.destroyflickity();
4249
+ }
4250
+ render() {
4251
+ return (h(Host, null, h("div", { class: "slideshow", ref: (div) => (this.slideShowEle = div) }, h("div", { ref: (div) => (this.flickityEl = div), class: {
4252
+ 'flickity-container': true,
4253
+ 'slides-ready': this.slidesReady,
4254
+ 'slides-not-ready': !this.slidesReady,
4255
+ } }, h("slot", null)), h("div", { class: "ui-extras" }, h("slot", { name: "ui" })))));
4256
+ }
4257
+ get host() { return this; }
4258
+ static get watchers() { return {
4259
+ "options": ["optionsChanged"],
4260
+ "navbtns": ["navbtnsChanged"],
4261
+ "pager": ["pagerChanged"],
4262
+ "fullscreenbtn": ["fullscreenBtnChanged"],
4263
+ "fullscreen": ["fullscreenChanged"],
4264
+ "animation": ["animationChange"],
4265
+ "currentSlide": ["currentSlideChange"],
4266
+ "iCurrentSlide": ["internalSlideChange"],
4267
+ "autoplay": ["autoPlayChange"]
4268
+ }; }
4269
+ static get style() { return slidesCss; }
4270
+ };
4271
+ const waitForSlides = (host) => {
4272
+ const allSlides = Array.from(host.querySelectorAll('nano-slide'));
4273
+ let toLoadSlides = allSlides.filter((ele) => !ele.ready);
4274
+ if (!toLoadSlides.length)
4275
+ return Promise.resolve(allSlides);
4276
+ return new Promise((resolve) => {
4277
+ const slideResolver = (ev) => {
4278
+ toLoadSlides = toLoadSlides.filter((ele) => ele !== ev.target);
4279
+ if (!toLoadSlides.length) {
4280
+ resolve(allSlides);
4281
+ host.removeEventListener('nanoSlideReady', slideResolver);
4282
+ }
4283
+ };
4284
+ host.addEventListener('nanoSlideReady', slideResolver);
4285
+ host.addEventListener('nanoslideready', slideResolver);
4286
+ });
4287
+ };
4288
+ Slides = /*@__PURE__*/ proxyCustomElement(Slides, [1, "nano-slides", {
4289
+ "options": [1040],
4290
+ "navbtns": [4],
4291
+ "pager": [4],
4292
+ "fullscreenbtn": [4],
4293
+ "fullscreen": [1540],
4294
+ "animation": [513],
4295
+ "currentSlide": [1538, "current-slide"],
4296
+ "autoplay": [8],
4297
+ "ready": [1540],
4298
+ "iCurrentSlide": [32],
4299
+ "slidesReady": [32],
4300
+ "didInit": [32],
4301
+ "update": [64],
4302
+ "updateAutoHeight": [64],
4303
+ "slideTo": [64],
4304
+ "slideNext": [64],
4305
+ "slidePrev": [64],
4306
+ "getActiveIndex": [64],
4307
+ "length": [64],
4308
+ "isEnd": [64],
4309
+ "isBeginning": [64],
4310
+ "startAutoplay": [64],
4311
+ "stopAutoplay": [64],
4312
+ "lockSwipes": [64],
4313
+ "getflickity": [64],
4314
+ "reload": [64]
4315
+ }]);
4316
+ function defineCustomElement$1() {
4317
+ if (typeof customElements === "undefined") {
4318
+ return;
4319
+ }
4320
+ const components = ["nano-slides"];
4321
+ components.forEach(tagName => { switch (tagName) {
4322
+ case "nano-slides":
4323
+ if (!customElements.get(tagName)) {
4324
+ customElements.define(tagName, Slides);
4325
+ }
4326
+ break;
4327
+ } });
4328
+ }
4329
+
4330
+ const NanoSlides = Slides;
4331
+ const defineCustomElement = defineCustomElement$1;
4332
+
4333
+ export { NanoSlides, defineCustomElement };
4334
+
4335
+ //# sourceMappingURL=nano-slides.js.map