@keenthemes/ktui 1.2.1 → 1.2.2

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 (279) hide show
  1. package/dist/ktui.js +2858 -1515
  2. package/dist/ktui.min.js +1 -1
  3. package/dist/ktui.min.js.map +1 -1
  4. package/dist/styles.css +23 -0
  5. package/lib/cjs/components/carousel/carousel.d.ts +102 -0
  6. package/lib/cjs/components/carousel/carousel.d.ts.map +1 -0
  7. package/lib/cjs/components/carousel/carousel.js +769 -0
  8. package/lib/cjs/components/carousel/carousel.js.map +1 -0
  9. package/lib/cjs/components/carousel/index.d.ts +7 -0
  10. package/lib/cjs/components/carousel/index.d.ts.map +1 -0
  11. package/lib/cjs/components/carousel/index.js +10 -0
  12. package/lib/cjs/components/carousel/index.js.map +1 -0
  13. package/lib/cjs/components/carousel/types.d.ts +36 -0
  14. package/lib/cjs/components/carousel/types.d.ts.map +1 -0
  15. package/lib/cjs/components/carousel/types.js +7 -0
  16. package/lib/cjs/components/carousel/types.js.map +1 -0
  17. package/lib/cjs/components/component.d.ts +3 -3
  18. package/lib/cjs/components/component.d.ts.map +1 -1
  19. package/lib/cjs/components/component.js +9 -1
  20. package/lib/cjs/components/component.js.map +1 -1
  21. package/lib/cjs/components/datatable/datatable-checkbox.d.ts +1 -1
  22. package/lib/cjs/components/datatable/datatable-checkbox.d.ts.map +1 -1
  23. package/lib/cjs/components/datatable/datatable-checkbox.js +1 -1
  24. package/lib/cjs/components/datatable/datatable-checkbox.js.map +1 -1
  25. package/lib/cjs/components/datatable/datatable-sort.d.ts +1 -1
  26. package/lib/cjs/components/datatable/datatable-sort.d.ts.map +1 -1
  27. package/lib/cjs/components/datatable/datatable-sort.js.map +1 -1
  28. package/lib/cjs/components/datatable/datatable.d.ts +2 -0
  29. package/lib/cjs/components/datatable/datatable.d.ts.map +1 -1
  30. package/lib/cjs/components/datatable/datatable.js +29 -16
  31. package/lib/cjs/components/datatable/datatable.js.map +1 -1
  32. package/lib/cjs/components/datatable/types.d.ts +2 -1
  33. package/lib/cjs/components/datatable/types.d.ts.map +1 -1
  34. package/lib/cjs/components/drawer/drawer.d.ts.map +1 -1
  35. package/lib/cjs/components/drawer/drawer.js +3 -16
  36. package/lib/cjs/components/drawer/drawer.js.map +1 -1
  37. package/lib/cjs/components/dropdown/dropdown.d.ts +1 -1
  38. package/lib/cjs/components/dropdown/dropdown.d.ts.map +1 -1
  39. package/lib/cjs/components/dropdown/dropdown.js +2 -3
  40. package/lib/cjs/components/dropdown/dropdown.js.map +1 -1
  41. package/lib/cjs/components/pin-input/index.d.ts +3 -0
  42. package/lib/cjs/components/pin-input/index.d.ts.map +1 -0
  43. package/lib/cjs/components/pin-input/index.js +6 -0
  44. package/lib/cjs/components/pin-input/index.js.map +1 -0
  45. package/lib/cjs/components/pin-input/pin-input.d.ts +56 -0
  46. package/lib/cjs/components/pin-input/pin-input.d.ts.map +1 -0
  47. package/lib/cjs/components/pin-input/pin-input.js +455 -0
  48. package/lib/cjs/components/pin-input/pin-input.js.map +1 -0
  49. package/lib/cjs/components/pin-input/types.d.ts +41 -0
  50. package/lib/cjs/components/pin-input/types.d.ts.map +1 -0
  51. package/lib/cjs/components/pin-input/types.js +6 -0
  52. package/lib/cjs/components/pin-input/types.js.map +1 -0
  53. package/lib/cjs/components/rating/rating.d.ts.map +1 -1
  54. package/lib/cjs/components/rating/rating.js.map +1 -1
  55. package/lib/cjs/components/select/combobox.d.ts.map +1 -1
  56. package/lib/cjs/components/select/combobox.js +25 -15
  57. package/lib/cjs/components/select/combobox.js.map +1 -1
  58. package/lib/cjs/components/select/config.d.ts +2 -2
  59. package/lib/cjs/components/select/config.d.ts.map +1 -1
  60. package/lib/cjs/components/select/config.js +10 -9
  61. package/lib/cjs/components/select/config.js.map +1 -1
  62. package/lib/cjs/components/select/dropdown.js.map +1 -1
  63. package/lib/cjs/components/select/option.d.ts +2 -1
  64. package/lib/cjs/components/select/option.d.ts.map +1 -1
  65. package/lib/cjs/components/select/option.js +9 -3
  66. package/lib/cjs/components/select/option.js.map +1 -1
  67. package/lib/cjs/components/select/remote.d.ts +1 -0
  68. package/lib/cjs/components/select/remote.d.ts.map +1 -1
  69. package/lib/cjs/components/select/remote.js +21 -14
  70. package/lib/cjs/components/select/remote.js.map +1 -1
  71. package/lib/cjs/components/select/search.d.ts +1 -1
  72. package/lib/cjs/components/select/search.d.ts.map +1 -1
  73. package/lib/cjs/components/select/search.js +34 -25
  74. package/lib/cjs/components/select/search.js.map +1 -1
  75. package/lib/cjs/components/select/select.d.ts +5 -3
  76. package/lib/cjs/components/select/select.d.ts.map +1 -1
  77. package/lib/cjs/components/select/select.js +31 -31
  78. package/lib/cjs/components/select/select.js.map +1 -1
  79. package/lib/cjs/components/select/tags.d.ts.map +1 -1
  80. package/lib/cjs/components/select/tags.js +22 -13
  81. package/lib/cjs/components/select/tags.js.map +1 -1
  82. package/lib/cjs/components/select/templates.d.ts.map +1 -1
  83. package/lib/cjs/components/select/templates.js +4 -4
  84. package/lib/cjs/components/select/templates.js.map +1 -1
  85. package/lib/cjs/components/select/types.d.ts +1 -1
  86. package/lib/cjs/components/select/types.d.ts.map +1 -1
  87. package/lib/cjs/components/select/utils.d.ts +4 -4
  88. package/lib/cjs/components/select/utils.d.ts.map +1 -1
  89. package/lib/cjs/components/select/utils.js +2 -3
  90. package/lib/cjs/components/select/utils.js.map +1 -1
  91. package/lib/cjs/components/sticky/sticky.d.ts +1 -1
  92. package/lib/cjs/components/sticky/sticky.d.ts.map +1 -1
  93. package/lib/cjs/components/sticky/sticky.js +13 -13
  94. package/lib/cjs/components/sticky/sticky.js.map +1 -1
  95. package/lib/cjs/components/toast/toast.d.ts.map +1 -1
  96. package/lib/cjs/components/toast/toast.js +17 -9
  97. package/lib/cjs/components/toast/toast.js.map +1 -1
  98. package/lib/cjs/components/toast/types.d.ts +3 -0
  99. package/lib/cjs/components/toast/types.d.ts.map +1 -1
  100. package/lib/cjs/components/toggle-password/toggle-password.d.ts.map +1 -1
  101. package/lib/cjs/components/toggle-password/toggle-password.js.map +1 -1
  102. package/lib/cjs/helpers/dom.d.ts +4 -4
  103. package/lib/cjs/helpers/dom.d.ts.map +1 -1
  104. package/lib/cjs/helpers/dom.js +8 -10
  105. package/lib/cjs/helpers/dom.js.map +1 -1
  106. package/lib/cjs/helpers/event-handler.d.ts +1 -1
  107. package/lib/cjs/helpers/event-handler.d.ts.map +1 -1
  108. package/lib/cjs/helpers/event-handler.js +3 -1
  109. package/lib/cjs/helpers/event-handler.js.map +1 -1
  110. package/lib/cjs/helpers/utils.d.ts +1 -1
  111. package/lib/cjs/helpers/utils.d.ts.map +1 -1
  112. package/lib/cjs/helpers/utils.js +4 -1
  113. package/lib/cjs/helpers/utils.js.map +1 -1
  114. package/lib/cjs/index.d.ts +8 -0
  115. package/lib/cjs/index.d.ts.map +1 -1
  116. package/lib/cjs/index.js +9 -1
  117. package/lib/cjs/index.js.map +1 -1
  118. package/lib/cjs/types.d.ts +1 -1
  119. package/lib/cjs/types.d.ts.map +1 -1
  120. package/lib/esm/components/carousel/carousel.d.ts +102 -0
  121. package/lib/esm/components/carousel/carousel.d.ts.map +1 -0
  122. package/lib/esm/components/carousel/carousel.js +766 -0
  123. package/lib/esm/components/carousel/carousel.js.map +1 -0
  124. package/lib/esm/components/carousel/index.d.ts +7 -0
  125. package/lib/esm/components/carousel/index.d.ts.map +1 -0
  126. package/lib/esm/components/carousel/index.js +6 -0
  127. package/lib/esm/components/carousel/index.js.map +1 -0
  128. package/lib/esm/components/carousel/types.d.ts +36 -0
  129. package/lib/esm/components/carousel/types.d.ts.map +1 -0
  130. package/lib/esm/components/carousel/types.js +6 -0
  131. package/lib/esm/components/carousel/types.js.map +1 -0
  132. package/lib/esm/components/component.d.ts +3 -3
  133. package/lib/esm/components/component.d.ts.map +1 -1
  134. package/lib/esm/components/component.js +9 -1
  135. package/lib/esm/components/component.js.map +1 -1
  136. package/lib/esm/components/datatable/datatable-checkbox.d.ts +1 -1
  137. package/lib/esm/components/datatable/datatable-checkbox.d.ts.map +1 -1
  138. package/lib/esm/components/datatable/datatable-checkbox.js +1 -1
  139. package/lib/esm/components/datatable/datatable-checkbox.js.map +1 -1
  140. package/lib/esm/components/datatable/datatable-sort.d.ts +1 -1
  141. package/lib/esm/components/datatable/datatable-sort.d.ts.map +1 -1
  142. package/lib/esm/components/datatable/datatable-sort.js.map +1 -1
  143. package/lib/esm/components/datatable/datatable.d.ts +2 -0
  144. package/lib/esm/components/datatable/datatable.d.ts.map +1 -1
  145. package/lib/esm/components/datatable/datatable.js +29 -16
  146. package/lib/esm/components/datatable/datatable.js.map +1 -1
  147. package/lib/esm/components/datatable/types.d.ts +2 -1
  148. package/lib/esm/components/datatable/types.d.ts.map +1 -1
  149. package/lib/esm/components/drawer/drawer.d.ts.map +1 -1
  150. package/lib/esm/components/drawer/drawer.js +3 -16
  151. package/lib/esm/components/drawer/drawer.js.map +1 -1
  152. package/lib/esm/components/dropdown/dropdown.d.ts +1 -1
  153. package/lib/esm/components/dropdown/dropdown.d.ts.map +1 -1
  154. package/lib/esm/components/dropdown/dropdown.js +2 -3
  155. package/lib/esm/components/dropdown/dropdown.js.map +1 -1
  156. package/lib/esm/components/pin-input/index.d.ts +3 -0
  157. package/lib/esm/components/pin-input/index.d.ts.map +1 -0
  158. package/lib/esm/components/pin-input/index.js +2 -0
  159. package/lib/esm/components/pin-input/index.js.map +1 -0
  160. package/lib/esm/components/pin-input/pin-input.d.ts +56 -0
  161. package/lib/esm/components/pin-input/pin-input.d.ts.map +1 -0
  162. package/lib/esm/components/pin-input/pin-input.js +452 -0
  163. package/lib/esm/components/pin-input/pin-input.js.map +1 -0
  164. package/lib/esm/components/pin-input/types.d.ts +41 -0
  165. package/lib/esm/components/pin-input/types.d.ts.map +1 -0
  166. package/lib/esm/components/pin-input/types.js +5 -0
  167. package/lib/esm/components/pin-input/types.js.map +1 -0
  168. package/lib/esm/components/rating/rating.d.ts.map +1 -1
  169. package/lib/esm/components/rating/rating.js.map +1 -1
  170. package/lib/esm/components/select/combobox.d.ts.map +1 -1
  171. package/lib/esm/components/select/combobox.js +25 -15
  172. package/lib/esm/components/select/combobox.js.map +1 -1
  173. package/lib/esm/components/select/config.d.ts +2 -2
  174. package/lib/esm/components/select/config.d.ts.map +1 -1
  175. package/lib/esm/components/select/config.js +10 -9
  176. package/lib/esm/components/select/config.js.map +1 -1
  177. package/lib/esm/components/select/dropdown.js.map +1 -1
  178. package/lib/esm/components/select/option.d.ts +2 -1
  179. package/lib/esm/components/select/option.d.ts.map +1 -1
  180. package/lib/esm/components/select/option.js +9 -3
  181. package/lib/esm/components/select/option.js.map +1 -1
  182. package/lib/esm/components/select/remote.d.ts +1 -0
  183. package/lib/esm/components/select/remote.d.ts.map +1 -1
  184. package/lib/esm/components/select/remote.js +21 -14
  185. package/lib/esm/components/select/remote.js.map +1 -1
  186. package/lib/esm/components/select/search.d.ts +1 -1
  187. package/lib/esm/components/select/search.d.ts.map +1 -1
  188. package/lib/esm/components/select/search.js +34 -25
  189. package/lib/esm/components/select/search.js.map +1 -1
  190. package/lib/esm/components/select/select.d.ts +5 -3
  191. package/lib/esm/components/select/select.d.ts.map +1 -1
  192. package/lib/esm/components/select/select.js +31 -31
  193. package/lib/esm/components/select/select.js.map +1 -1
  194. package/lib/esm/components/select/tags.d.ts.map +1 -1
  195. package/lib/esm/components/select/tags.js +22 -13
  196. package/lib/esm/components/select/tags.js.map +1 -1
  197. package/lib/esm/components/select/templates.d.ts.map +1 -1
  198. package/lib/esm/components/select/templates.js +4 -4
  199. package/lib/esm/components/select/templates.js.map +1 -1
  200. package/lib/esm/components/select/types.d.ts +1 -1
  201. package/lib/esm/components/select/types.d.ts.map +1 -1
  202. package/lib/esm/components/select/utils.d.ts +4 -4
  203. package/lib/esm/components/select/utils.d.ts.map +1 -1
  204. package/lib/esm/components/select/utils.js +2 -3
  205. package/lib/esm/components/select/utils.js.map +1 -1
  206. package/lib/esm/components/sticky/sticky.d.ts +1 -1
  207. package/lib/esm/components/sticky/sticky.d.ts.map +1 -1
  208. package/lib/esm/components/sticky/sticky.js +13 -13
  209. package/lib/esm/components/sticky/sticky.js.map +1 -1
  210. package/lib/esm/components/toast/toast.d.ts.map +1 -1
  211. package/lib/esm/components/toast/toast.js +17 -9
  212. package/lib/esm/components/toast/toast.js.map +1 -1
  213. package/lib/esm/components/toast/types.d.ts +3 -0
  214. package/lib/esm/components/toast/types.d.ts.map +1 -1
  215. package/lib/esm/components/toggle-password/toggle-password.d.ts.map +1 -1
  216. package/lib/esm/components/toggle-password/toggle-password.js.map +1 -1
  217. package/lib/esm/helpers/dom.d.ts +4 -4
  218. package/lib/esm/helpers/dom.d.ts.map +1 -1
  219. package/lib/esm/helpers/dom.js +8 -10
  220. package/lib/esm/helpers/dom.js.map +1 -1
  221. package/lib/esm/helpers/event-handler.d.ts +1 -1
  222. package/lib/esm/helpers/event-handler.d.ts.map +1 -1
  223. package/lib/esm/helpers/event-handler.js +3 -1
  224. package/lib/esm/helpers/event-handler.js.map +1 -1
  225. package/lib/esm/helpers/utils.d.ts +1 -1
  226. package/lib/esm/helpers/utils.d.ts.map +1 -1
  227. package/lib/esm/helpers/utils.js +4 -1
  228. package/lib/esm/helpers/utils.js.map +1 -1
  229. package/lib/esm/index.d.ts +8 -0
  230. package/lib/esm/index.d.ts.map +1 -1
  231. package/lib/esm/index.js +6 -0
  232. package/lib/esm/index.js.map +1 -1
  233. package/lib/esm/types.d.ts +1 -1
  234. package/lib/esm/types.d.ts.map +1 -1
  235. package/package.json +5 -2
  236. package/src/components/carousel/__tests__/carousel.test.ts +326 -0
  237. package/src/components/carousel/carousel.css +42 -0
  238. package/src/components/carousel/carousel.ts +847 -0
  239. package/src/components/carousel/index.ts +11 -0
  240. package/src/components/carousel/types.ts +38 -0
  241. package/src/components/clipboard/__tests__/clipboard.test.ts +4 -4
  242. package/src/components/component.ts +15 -5
  243. package/src/components/datatable/__tests__/currency-sort.test.ts +4 -3
  244. package/src/components/datatable/__tests__/pagination-reset.test.ts +7 -4
  245. package/src/components/datatable/__tests__/setup.ts +1 -1
  246. package/src/components/datatable/datatable-checkbox.ts +6 -4
  247. package/src/components/datatable/datatable-sort.ts +27 -7
  248. package/src/components/datatable/datatable.ts +64 -37
  249. package/src/components/datatable/types.ts +3 -1
  250. package/src/components/drawer/drawer.ts +3 -18
  251. package/src/components/dropdown/dropdown.ts +2 -3
  252. package/src/components/pin-input/__tests__/pin-input.test.ts +928 -0
  253. package/src/components/pin-input/index.ts +6 -0
  254. package/src/components/pin-input/pin-input.ts +499 -0
  255. package/src/components/pin-input/types.ts +45 -0
  256. package/src/components/rating/rating.ts +0 -1
  257. package/src/components/repeater/__tests__/repeater.test.ts +5 -5
  258. package/src/components/select/__tests__/ux-behaviors.test.ts +4 -3
  259. package/src/components/select/combobox.ts +23 -16
  260. package/src/components/select/config.ts +15 -14
  261. package/src/components/select/dropdown.ts +1 -1
  262. package/src/components/select/option.ts +14 -4
  263. package/src/components/select/remote.ts +68 -56
  264. package/src/components/select/search.ts +30 -27
  265. package/src/components/select/select.ts +41 -37
  266. package/src/components/select/tags.ts +14 -8
  267. package/src/components/select/templates.ts +11 -6
  268. package/src/components/select/types.ts +1 -1
  269. package/src/components/select/utils.ts +7 -9
  270. package/src/components/sticky/sticky.ts +2 -2
  271. package/src/components/toast/toast.ts +34 -21
  272. package/src/components/toast/types.ts +5 -1
  273. package/src/components/toggle-password/toggle-password.ts +0 -1
  274. package/src/helpers/dom.ts +14 -17
  275. package/src/helpers/event-handler.ts +5 -6
  276. package/src/helpers/utils.ts +5 -2
  277. package/src/index.ts +18 -0
  278. package/src/types.ts +1 -1
  279. package/styles.css +1 -0
@@ -0,0 +1,766 @@
1
+ /**
2
+ * KTUI - Free & Open-Source Tailwind UI Components by Keenthemes
3
+ * Copyright 2025 by Keenthemes Inc
4
+ */
5
+ var __extends = (this && this.__extends) || (function () {
6
+ var extendStatics = function (d, b) {
7
+ extendStatics = Object.setPrototypeOf ||
8
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10
+ return extendStatics(d, b);
11
+ };
12
+ return function (d, b) {
13
+ if (typeof b !== "function" && b !== null)
14
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15
+ extendStatics(d, b);
16
+ function __() { this.constructor = d; }
17
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18
+ };
19
+ })();
20
+ import KTData from '../../helpers/data';
21
+ import KTComponent from '../component';
22
+ var SELECTOR_VIEWPORT = '[data-kt-carousel-viewport]';
23
+ var SELECTOR_ITEM = '[data-kt-carousel-item]';
24
+ var SELECTOR_PREV = '[data-kt-carousel-prev]';
25
+ var SELECTOR_NEXT = '[data-kt-carousel-next]';
26
+ var SELECTOR_PAGINATION = '[data-kt-carousel-pagination]';
27
+ var SELECTOR_PAGINATION_ITEM = '[data-kt-carousel-pagination-item]';
28
+ var SELECTOR_THUMBS = '[data-kt-carousel-thumbnails]';
29
+ var SELECTOR_THUMB = '[data-kt-carousel-thumbnail]';
30
+ var SELECTOR_CURRENT = '[data-kt-carousel-current]';
31
+ var SELECTOR_TOTAL = '[data-kt-carousel-total]';
32
+ var KTCarousel = /** @class */ (function (_super) {
33
+ __extends(KTCarousel, _super);
34
+ function KTCarousel(element, config) {
35
+ if (config === void 0) { config = null; }
36
+ var _this = _super.call(this) || this;
37
+ _this._name = 'carousel';
38
+ _this._defaultConfig = {
39
+ autoplay: false,
40
+ autoplayInterval: 4000,
41
+ infiniteLoop: false,
42
+ rtl: false,
43
+ perView: 1,
44
+ centered: false,
45
+ draggable: false,
46
+ snap: false,
47
+ autoHeight: false,
48
+ showScrollbar: false,
49
+ lazy: false,
50
+ pauseOnHover: true,
51
+ changeEvent: 'kt.carousel.change',
52
+ };
53
+ _this._config = _this
54
+ ._defaultConfig;
55
+ _this._viewport = null;
56
+ _this._slides = [];
57
+ _this._index = 0;
58
+ _this._autoplayTimer = null;
59
+ _this._programmaticScroll = false;
60
+ _this._resizeObserver = null;
61
+ _this._prefersReducedMotion = false;
62
+ _this._onPrevClick = null;
63
+ _this._onNextClick = null;
64
+ _this._onScroll = null;
65
+ _this._onScrollEnd = null;
66
+ _this._onKeyDown = null;
67
+ _this._onPointerDown = null;
68
+ _this._onPointerMove = null;
69
+ _this._onPointerUp = null;
70
+ _this._paginationHandlers = [];
71
+ _this._thumbHandlers = [];
72
+ _this._programmaticScrollPrevIndex = null;
73
+ _this._programmaticScrollTargetIndex = null;
74
+ _this._programmaticScrollUserInitiated = false;
75
+ _this._programmaticScrollFallbackTimer = null;
76
+ _this._scrollSyncRaf = 0;
77
+ _this._pauseAutoplay = null;
78
+ _this._resumeAutoplay = null;
79
+ _this._dragStartX = 0;
80
+ _this._dragStartScroll = 0;
81
+ _this._dragging = false;
82
+ _this._dragMoved = false;
83
+ _this._pointerId = null;
84
+ _this._prevButtons = [];
85
+ _this._nextButtons = [];
86
+ _this._currentLabels = [];
87
+ _this._totalLabels = [];
88
+ if (_this._shouldSkipInit(element)) {
89
+ return _this;
90
+ }
91
+ var viewport = KTCarousel._resolveViewportStatic(element);
92
+ var slides = KTCarousel._collectSlidesStatic(viewport);
93
+ if (!viewport || slides.length === 0) {
94
+ return _this;
95
+ }
96
+ _this._init(element);
97
+ _this._buildConfig(config);
98
+ _this._syncShowScrollbarAttribute();
99
+ _this._viewport = viewport;
100
+ _this._slides = slides;
101
+ _this._prefersReducedMotion = _this._readPrefersReducedMotion();
102
+ _this._bindControls();
103
+ _this._bindScrollSync();
104
+ _this._bindKeyboard();
105
+ _this._bindAutoplayHoverPause();
106
+ _this._bindDraggable();
107
+ _this._bindAutoHeight();
108
+ _this._syncIndexFromScroll();
109
+ _this._updateInfo();
110
+ _this._updatePaginationState();
111
+ _this._updateThumbState(false);
112
+ _this._startAutoplay();
113
+ return _this;
114
+ }
115
+ KTCarousel.prototype._readPrefersReducedMotion = function () {
116
+ if (typeof window === 'undefined' || !window.matchMedia) {
117
+ return false;
118
+ }
119
+ return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
120
+ };
121
+ KTCarousel.prototype._syncShowScrollbarAttribute = function () {
122
+ if (!this._element)
123
+ return;
124
+ var show = this._getOption('showScrollbar') === true;
125
+ if (show) {
126
+ this._element.setAttribute('data-kt-carousel-show-scrollbar', 'true');
127
+ }
128
+ else {
129
+ this._element.removeAttribute('data-kt-carousel-show-scrollbar');
130
+ }
131
+ };
132
+ KTCarousel._resolveViewportStatic = function (root) {
133
+ var explicit = root.querySelector(SELECTOR_VIEWPORT);
134
+ if (explicit)
135
+ return explicit;
136
+ return root;
137
+ };
138
+ KTCarousel._collectSlidesStatic = function (viewport) {
139
+ if (!viewport)
140
+ return [];
141
+ return Array.from(viewport.querySelectorAll(SELECTOR_ITEM));
142
+ };
143
+ KTCarousel.prototype._isRtl = function () {
144
+ var _a;
145
+ if (this._getOption('rtl') === true)
146
+ return true;
147
+ if (((_a = this._element) === null || _a === void 0 ? void 0 : _a.getAttribute('dir')) === 'rtl')
148
+ return true;
149
+ if (this._viewport &&
150
+ getComputedStyle(this._viewport).direction === 'rtl') {
151
+ return true;
152
+ }
153
+ return false;
154
+ };
155
+ KTCarousel.prototype._scrollBehavior = function () {
156
+ return this._prefersReducedMotion ? 'auto' : 'smooth';
157
+ };
158
+ KTCarousel.prototype._effectiveDraggable = function () {
159
+ if (this._getOption('snap') === true)
160
+ return false;
161
+ return this._getOption('draggable') === true;
162
+ };
163
+ KTCarousel.prototype._bindControls = function () {
164
+ var _this = this;
165
+ if (!this._element)
166
+ return;
167
+ var root = this._element;
168
+ this._prevButtons = Array.from(root.querySelectorAll(SELECTOR_PREV));
169
+ this._nextButtons = Array.from(root.querySelectorAll(SELECTOR_NEXT));
170
+ this._currentLabels = Array.from(root.querySelectorAll(SELECTOR_CURRENT));
171
+ this._totalLabels = Array.from(root.querySelectorAll(SELECTOR_TOTAL));
172
+ this._onPrevClick = function (e) {
173
+ e.preventDefault();
174
+ _this.prev(true);
175
+ };
176
+ this._onNextClick = function (e) {
177
+ e.preventDefault();
178
+ _this.next(true);
179
+ };
180
+ this._prevButtons.forEach(function (btn) {
181
+ btn.addEventListener('click', _this._onPrevClick);
182
+ });
183
+ this._nextButtons.forEach(function (btn) {
184
+ btn.addEventListener('click', _this._onNextClick);
185
+ });
186
+ this._bindIndexedClickStrips(SELECTOR_PAGINATION, SELECTOR_PAGINATION_ITEM, this._paginationHandlers);
187
+ this._bindIndexedClickStrips(SELECTOR_THUMBS, SELECTOR_THUMB, this._thumbHandlers);
188
+ };
189
+ KTCarousel.prototype._bindIndexedClickStrips = function (stripSelector, itemSelector, handlers) {
190
+ var _this = this;
191
+ if (!this._element)
192
+ return;
193
+ this._element
194
+ .querySelectorAll(stripSelector)
195
+ .forEach(function (strip) {
196
+ strip.querySelectorAll(itemSelector).forEach(function (item, i) {
197
+ var fn = function (e) {
198
+ e.preventDefault();
199
+ _this.goTo(i, true);
200
+ };
201
+ item.addEventListener('click', fn);
202
+ handlers.push({ el: item, fn: fn });
203
+ });
204
+ });
205
+ };
206
+ KTCarousel.prototype._bindScrollSync = function () {
207
+ var _this = this;
208
+ if (!this._viewport)
209
+ return;
210
+ this._onScroll = function () {
211
+ if (_this._scrollSyncRaf)
212
+ cancelAnimationFrame(_this._scrollSyncRaf);
213
+ _this._scrollSyncRaf = requestAnimationFrame(function () {
214
+ _this._scrollSyncRaf = 0;
215
+ var prev = _this._index;
216
+ _this._applyScrollDerivedIndexChange(prev, {
217
+ dispatch: !_this._programmaticScroll,
218
+ userInitiated: true,
219
+ });
220
+ });
221
+ };
222
+ this._viewport.addEventListener('scroll', this._onScroll, {
223
+ passive: true,
224
+ });
225
+ this._onScrollEnd = function () {
226
+ if (_this._programmaticScroll) {
227
+ var t = _this._programmaticScrollTargetIndex;
228
+ if (t !== null && _this._nearestIndex() === t) {
229
+ queueMicrotask(function () { return _this._completeProgrammaticScroll(); });
230
+ }
231
+ return;
232
+ }
233
+ var prev = _this._index;
234
+ _this._applyScrollDerivedIndexChange(prev, {
235
+ dispatch: true,
236
+ userInitiated: true,
237
+ });
238
+ };
239
+ this._viewport.addEventListener('scrollend', this._onScrollEnd);
240
+ };
241
+ KTCarousel.prototype._bindKeyboard = function () {
242
+ var _this = this;
243
+ if (!this._element)
244
+ return;
245
+ this._onKeyDown = function (e) {
246
+ var _a;
247
+ if (!((_a = _this._element) === null || _a === void 0 ? void 0 : _a.contains(e.target)))
248
+ return;
249
+ var t = e.target;
250
+ if (t &&
251
+ (t.tagName === 'INPUT' ||
252
+ t.tagName === 'TEXTAREA' ||
253
+ t.isContentEditable)) {
254
+ return;
255
+ }
256
+ if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight')
257
+ return;
258
+ var rtl = _this._isRtl();
259
+ var nextKey = rtl ? 'ArrowLeft' : 'ArrowRight';
260
+ var prevKey = rtl ? 'ArrowRight' : 'ArrowLeft';
261
+ if (e.key === nextKey) {
262
+ e.preventDefault();
263
+ _this.next(true);
264
+ }
265
+ else if (e.key === prevKey) {
266
+ e.preventDefault();
267
+ _this.prev(true);
268
+ }
269
+ };
270
+ this._element.addEventListener('keydown', this._onKeyDown);
271
+ };
272
+ KTCarousel.prototype._bindAutoplayHoverPause = function () {
273
+ var _this = this;
274
+ if (!this._element || !this._viewport)
275
+ return;
276
+ if (this._getOption('pauseOnHover') !== true)
277
+ return;
278
+ this._pauseAutoplay = function () { return _this._stopAutoplay(); };
279
+ this._resumeAutoplay = function () { return _this._startAutoplay(); };
280
+ this._element.addEventListener('mouseenter', this._pauseAutoplay);
281
+ this._element.addEventListener('mouseleave', this._resumeAutoplay);
282
+ this._element.addEventListener('focusin', this._pauseAutoplay);
283
+ this._element.addEventListener('focusout', this._resumeAutoplay);
284
+ };
285
+ KTCarousel.prototype._bindDraggable = function () {
286
+ var _this = this;
287
+ if (!this._viewport || !this._effectiveDraggable())
288
+ return;
289
+ this._onPointerDown = function (e) {
290
+ if (e.pointerType === 'mouse' && e.button !== 0)
291
+ return;
292
+ var t = e.target;
293
+ if (t && t.closest('button,a,input,textarea,select'))
294
+ return;
295
+ _this._pointerId = e.pointerId;
296
+ _this._dragStartX = e.clientX;
297
+ _this._dragStartScroll = _this._viewport.scrollLeft;
298
+ _this._dragging = true;
299
+ _this._dragMoved = false;
300
+ _this._viewport.setPointerCapture(e.pointerId);
301
+ };
302
+ this._onPointerMove = function (e) {
303
+ if (!_this._dragging || e.pointerId !== _this._pointerId)
304
+ return;
305
+ var dx = e.clientX - _this._dragStartX;
306
+ if (Math.abs(dx) > 5)
307
+ _this._dragMoved = true;
308
+ _this._viewport.scrollLeft = _this._dragStartScroll - dx;
309
+ };
310
+ this._onPointerUp = function (e) {
311
+ if (e.pointerId !== _this._pointerId)
312
+ return;
313
+ _this._dragging = false;
314
+ _this._pointerId = null;
315
+ try {
316
+ _this._viewport.releasePointerCapture(e.pointerId);
317
+ }
318
+ catch (_a) {
319
+ /* ignore */
320
+ }
321
+ };
322
+ this._viewport.addEventListener('pointerdown', this._onPointerDown);
323
+ this._viewport.addEventListener('pointermove', this._onPointerMove);
324
+ this._viewport.addEventListener('pointerup', this._onPointerUp);
325
+ this._viewport.addEventListener('pointercancel', this._onPointerUp);
326
+ };
327
+ KTCarousel.prototype._bindAutoHeight = function () {
328
+ if (!this._viewport || this._getOption('autoHeight') !== true)
329
+ return;
330
+ this._applyAutoHeight();
331
+ this._observeActiveSlideForHeight();
332
+ };
333
+ KTCarousel.prototype._observeActiveSlideForHeight = function () {
334
+ var _this = this;
335
+ if (this._getOption('autoHeight') !== true)
336
+ return;
337
+ var active = this._slides[this._index];
338
+ if (!active || typeof ResizeObserver === 'undefined')
339
+ return;
340
+ if (!this._resizeObserver) {
341
+ this._resizeObserver = new ResizeObserver(function () {
342
+ _this._applyAutoHeight();
343
+ });
344
+ }
345
+ else {
346
+ this._resizeObserver.disconnect();
347
+ }
348
+ this._resizeObserver.observe(active);
349
+ };
350
+ KTCarousel.prototype._applyAutoHeight = function () {
351
+ if (!this._viewport || this._getOption('autoHeight') !== true)
352
+ return;
353
+ var slide = this._slides[this._index];
354
+ if (!slide)
355
+ return;
356
+ var h = slide.offsetHeight;
357
+ if (h > 0) {
358
+ this._viewport.style.height = "".concat(h, "px");
359
+ }
360
+ };
361
+ KTCarousel.prototype._nearestIndex = function () {
362
+ if (!this._viewport || this._slides.length === 0)
363
+ return 0;
364
+ var vp = this._viewport;
365
+ var origin = vp.scrollLeft;
366
+ var best = 0;
367
+ var bestDist = Infinity;
368
+ for (var i = 0; i < this._slides.length; i++) {
369
+ var slide = this._slides[i];
370
+ var dist = Math.abs(slide.offsetLeft - origin);
371
+ if (dist < bestDist) {
372
+ bestDist = dist;
373
+ best = i;
374
+ }
375
+ }
376
+ return best;
377
+ };
378
+ KTCarousel.prototype._syncIndexFromScroll = function () {
379
+ if (this._slides.length === 0)
380
+ return;
381
+ this._index = this._nearestIndex();
382
+ };
383
+ KTCarousel.prototype._applyScrollDerivedIndexChange = function (prevIndex, options) {
384
+ this._syncIndexFromScroll();
385
+ if (prevIndex === this._index)
386
+ return;
387
+ this._updateInfo();
388
+ this._updatePaginationState();
389
+ this._updateThumbState(false);
390
+ this._applyAutoHeight();
391
+ this._observeActiveSlideForHeight();
392
+ if (options.dispatch) {
393
+ this._dispatchChange(this._index, prevIndex, options.userInitiated);
394
+ }
395
+ };
396
+ KTCarousel.prototype._setStripItemsActiveState = function (handlers, activeDataAttr) {
397
+ var _this = this;
398
+ handlers.forEach(function (_a, i) {
399
+ var el = _a.el;
400
+ var active = i === _this._index;
401
+ if (active) {
402
+ el.setAttribute('aria-current', 'true');
403
+ }
404
+ else {
405
+ el.removeAttribute('aria-current');
406
+ }
407
+ el.toggleAttribute(activeDataAttr, active);
408
+ });
409
+ };
410
+ /**
411
+ * Scroll the viewport only. Avoid `Element.scrollIntoView`, which walks
412
+ * ancestor scroll containers and can pull the whole docs page to an embedded
413
+ * carousel (e.g. autoplay ticking on `/docs/carousel`).
414
+ */
415
+ KTCarousel.prototype._scrollToIndex = function (index, behavior) {
416
+ var _this = this;
417
+ if (!this._viewport)
418
+ return;
419
+ var slide = this._slides[index];
420
+ if (!slide)
421
+ return;
422
+ this._programmaticScroll = true;
423
+ var vp = this._viewport;
424
+ var centered = this._getOption('centered') === true;
425
+ var slideRect = slide.getBoundingClientRect();
426
+ var vpRect = vp.getBoundingClientRect();
427
+ var left = vp.scrollLeft + slideRect.left - vpRect.left;
428
+ if (centered) {
429
+ left -= (vp.clientWidth - slideRect.width) / 2;
430
+ }
431
+ var maxScroll = Math.max(0, vp.scrollWidth - vp.clientWidth);
432
+ left = Math.max(0, Math.min(left, maxScroll));
433
+ try {
434
+ vp.scrollTo({ left: left, top: vp.scrollTop, behavior: behavior });
435
+ }
436
+ catch (_a) {
437
+ vp.scrollLeft = left;
438
+ }
439
+ queueMicrotask(function () {
440
+ if (_this._programmaticScroll &&
441
+ _this._programmaticScrollTargetIndex !== null &&
442
+ _this._nearestIndex() === _this._programmaticScrollTargetIndex) {
443
+ _this._completeProgrammaticScroll();
444
+ }
445
+ });
446
+ this._clearProgrammaticScrollFallbackTimer();
447
+ var fallbackMs = behavior === 'smooth' ? 550 : 50;
448
+ this._programmaticScrollFallbackTimer = setTimeout(function () {
449
+ _this._programmaticScrollFallbackTimer = null;
450
+ _this._completeProgrammaticScroll();
451
+ }, fallbackMs);
452
+ };
453
+ KTCarousel.prototype._clearProgrammaticScrollFallbackTimer = function () {
454
+ if (this._programmaticScrollFallbackTimer !== null) {
455
+ clearTimeout(this._programmaticScrollFallbackTimer);
456
+ this._programmaticScrollFallbackTimer = null;
457
+ }
458
+ };
459
+ KTCarousel.prototype._completeProgrammaticScroll = function () {
460
+ if (!this._programmaticScroll)
461
+ return;
462
+ var prev = this._programmaticScrollPrevIndex;
463
+ var targetIdx = this._programmaticScrollTargetIndex;
464
+ var userInitiated = this._programmaticScrollUserInitiated;
465
+ if (prev === null || targetIdx === null) {
466
+ this._programmaticScroll = false;
467
+ this._programmaticScrollPrevIndex = null;
468
+ this._programmaticScrollTargetIndex = null;
469
+ return;
470
+ }
471
+ if (this._scrollSyncRaf) {
472
+ cancelAnimationFrame(this._scrollSyncRaf);
473
+ this._scrollSyncRaf = 0;
474
+ }
475
+ this._clearProgrammaticScrollFallbackTimer();
476
+ this._programmaticScroll = false;
477
+ this._programmaticScrollPrevIndex = null;
478
+ this._programmaticScrollTargetIndex = null;
479
+ this._programmaticScrollUserInitiated = false;
480
+ this._index = targetIdx;
481
+ this._updateInfo();
482
+ this._updatePaginationState();
483
+ this._updateThumbState(true);
484
+ this._applyAutoHeight();
485
+ this._observeActiveSlideForHeight();
486
+ this._dispatchChange(targetIdx, prev, userInitiated);
487
+ };
488
+ KTCarousel.prototype.goTo = function (index, userInitiated) {
489
+ if (userInitiated === void 0) { userInitiated = false; }
490
+ if (this._slides.length === 0)
491
+ return;
492
+ var n = this._slides.length;
493
+ var target = index;
494
+ if (target < 0)
495
+ target = 0;
496
+ if (target >= n)
497
+ target = n - 1;
498
+ var prev = this._index;
499
+ if (target === prev)
500
+ return;
501
+ this._clearProgrammaticScrollFallbackTimer();
502
+ this._programmaticScrollPrevIndex = prev;
503
+ this._programmaticScrollTargetIndex = target;
504
+ this._programmaticScrollUserInitiated = userInitiated;
505
+ this._scrollToIndex(target, this._scrollBehavior());
506
+ };
507
+ KTCarousel.prototype.next = function (userInitiated) {
508
+ if (userInitiated === void 0) { userInitiated = false; }
509
+ if (this._slides.length === 0)
510
+ return;
511
+ var n = this._slides.length;
512
+ var last = n - 1;
513
+ var infinite = this._getOption('infiniteLoop') === true;
514
+ if (this._index >= last) {
515
+ if (infinite) {
516
+ this.goTo(0, userInitiated);
517
+ return;
518
+ }
519
+ return;
520
+ }
521
+ this.goTo(this._index + 1, userInitiated);
522
+ };
523
+ KTCarousel.prototype.prev = function (userInitiated) {
524
+ if (userInitiated === void 0) { userInitiated = false; }
525
+ if (this._slides.length === 0)
526
+ return;
527
+ var infinite = this._getOption('infiniteLoop') === true;
528
+ if (this._index <= 0) {
529
+ if (infinite) {
530
+ this.goTo(this._slides.length - 1, userInitiated);
531
+ return;
532
+ }
533
+ return;
534
+ }
535
+ this.goTo(this._index - 1, userInitiated);
536
+ };
537
+ KTCarousel.prototype.getIndex = function () {
538
+ return this._index;
539
+ };
540
+ KTCarousel.prototype.getSlideCount = function () {
541
+ return this._slides.length;
542
+ };
543
+ KTCarousel.prototype._getChangeEventName = function () {
544
+ var name = this._getOption('changeEvent');
545
+ return typeof name === 'string' && name.length > 0
546
+ ? name
547
+ : 'kt.carousel.change';
548
+ };
549
+ KTCarousel.prototype._dispatchChange = function (index, prevIndex, userInitiated) {
550
+ if (!this._element)
551
+ return;
552
+ var payload = {
553
+ index: index,
554
+ prevIndex: prevIndex,
555
+ userInitiated: userInitiated,
556
+ };
557
+ var eventName = this._getChangeEventName();
558
+ this._fireEvent(eventName, payload);
559
+ this._dispatchEvent(eventName, payload);
560
+ };
561
+ KTCarousel.prototype._updateInfo = function () {
562
+ if (!this._element)
563
+ return;
564
+ var total = this._slides.length;
565
+ var cur = total === 0 ? 0 : this._index + 1;
566
+ var curStr = String(cur);
567
+ var totalStr = String(total);
568
+ this._currentLabels.forEach(function (label) {
569
+ label.textContent = curStr;
570
+ });
571
+ this._totalLabels.forEach(function (label) {
572
+ label.textContent = totalStr;
573
+ });
574
+ };
575
+ KTCarousel.prototype._updatePaginationState = function () {
576
+ this._setStripItemsActiveState(this._paginationHandlers, 'data-kt-carousel-pagination-active');
577
+ };
578
+ KTCarousel.prototype._updateThumbState = function (alignStripSmooth) {
579
+ this._setStripItemsActiveState(this._thumbHandlers, 'data-kt-carousel-thumbnail-active');
580
+ this._scrollActiveThumbnailsIntoView(alignStripSmooth ? this._scrollBehavior() : 'auto');
581
+ };
582
+ /**
583
+ * Keep the active thumb visible inside each thumbnail strip by scrolling
584
+ * that container only (no `scrollIntoView`, which can scroll ancestor pages).
585
+ */
586
+ KTCarousel.prototype._scrollActiveThumbnailsIntoView = function (behavior) {
587
+ var _this = this;
588
+ if (!this._element)
589
+ return;
590
+ var pad = 6;
591
+ this._element
592
+ .querySelectorAll(SELECTOR_THUMBS)
593
+ .forEach(function (strip) {
594
+ var items = strip.querySelectorAll(SELECTOR_THUMB);
595
+ var thumb = items[_this._index];
596
+ if (!thumb)
597
+ return;
598
+ _this._alignElementInScrollContainer(thumb, strip, pad, behavior);
599
+ });
600
+ };
601
+ KTCarousel.prototype._alignElementInScrollContainer = function (el, container, pad, behavior) {
602
+ var c = container.getBoundingClientRect();
603
+ var r = el.getBoundingClientRect();
604
+ var left = container.scrollLeft;
605
+ var top = container.scrollTop;
606
+ if (container.scrollWidth > container.clientWidth + 1) {
607
+ if (r.left < c.left + pad) {
608
+ left += r.left - c.left - pad;
609
+ }
610
+ else if (r.right > c.right - pad) {
611
+ left += r.right - c.right + pad;
612
+ }
613
+ var maxL = Math.max(0, container.scrollWidth - container.clientWidth);
614
+ left = Math.max(0, Math.min(left, maxL));
615
+ }
616
+ if (container.scrollHeight > container.clientHeight + 1) {
617
+ if (r.top < c.top + pad) {
618
+ top += r.top - c.top - pad;
619
+ }
620
+ else if (r.bottom > c.bottom - pad) {
621
+ top += r.bottom - c.bottom + pad;
622
+ }
623
+ var maxT = Math.max(0, container.scrollHeight - container.clientHeight);
624
+ top = Math.max(0, Math.min(top, maxT));
625
+ }
626
+ try {
627
+ container.scrollTo({ left: left, top: top, behavior: behavior });
628
+ }
629
+ catch (_a) {
630
+ container.scrollLeft = left;
631
+ container.scrollTop = top;
632
+ }
633
+ };
634
+ KTCarousel.prototype._startAutoplay = function () {
635
+ var _this = this;
636
+ this._stopAutoplay();
637
+ if (this._getOption('autoplay') !== true)
638
+ return;
639
+ if (this._prefersReducedMotion)
640
+ return;
641
+ if (this._slides.length <= 1)
642
+ return;
643
+ var raw = this._getOption('autoplayInterval');
644
+ var interval = typeof raw === 'number' && raw >= 200 ? raw : 4000;
645
+ this._autoplayTimer = setInterval(function () {
646
+ _this.next(false);
647
+ }, interval);
648
+ };
649
+ KTCarousel.prototype._stopAutoplay = function () {
650
+ if (this._autoplayTimer !== null) {
651
+ clearInterval(this._autoplayTimer);
652
+ this._autoplayTimer = null;
653
+ }
654
+ };
655
+ KTCarousel.prototype.dispose = function () {
656
+ var _this = this;
657
+ this._stopAutoplay();
658
+ this._clearProgrammaticScrollFallbackTimer();
659
+ if (this._scrollSyncRaf) {
660
+ cancelAnimationFrame(this._scrollSyncRaf);
661
+ this._scrollSyncRaf = 0;
662
+ }
663
+ this._programmaticScroll = false;
664
+ this._programmaticScrollPrevIndex = null;
665
+ this._programmaticScrollTargetIndex = null;
666
+ if (this._resizeObserver) {
667
+ this._resizeObserver.disconnect();
668
+ this._resizeObserver = null;
669
+ }
670
+ if (this._element) {
671
+ if (this._onPrevClick) {
672
+ this._prevButtons.forEach(function (btn) {
673
+ return btn.removeEventListener('click', _this._onPrevClick);
674
+ });
675
+ }
676
+ if (this._onNextClick) {
677
+ this._nextButtons.forEach(function (btn) {
678
+ return btn.removeEventListener('click', _this._onNextClick);
679
+ });
680
+ }
681
+ this._paginationHandlers.forEach(function (_a) {
682
+ var el = _a.el, fn = _a.fn;
683
+ el.removeEventListener('click', fn);
684
+ });
685
+ this._paginationHandlers = [];
686
+ this._thumbHandlers.forEach(function (_a) {
687
+ var el = _a.el, fn = _a.fn;
688
+ el.removeEventListener('click', fn);
689
+ });
690
+ this._thumbHandlers = [];
691
+ if (this._onKeyDown) {
692
+ this._element.removeEventListener('keydown', this._onKeyDown);
693
+ }
694
+ if (this._pauseAutoplay && this._resumeAutoplay) {
695
+ this._element.removeEventListener('mouseenter', this._pauseAutoplay);
696
+ this._element.removeEventListener('mouseleave', this._resumeAutoplay);
697
+ this._element.removeEventListener('focusin', this._pauseAutoplay);
698
+ this._element.removeEventListener('focusout', this._resumeAutoplay);
699
+ }
700
+ this._pauseAutoplay = null;
701
+ this._resumeAutoplay = null;
702
+ }
703
+ if (this._viewport && this._onScroll) {
704
+ this._viewport.removeEventListener('scroll', this._onScroll);
705
+ }
706
+ if (this._viewport && this._onScrollEnd) {
707
+ this._viewport.removeEventListener('scrollend', this._onScrollEnd);
708
+ }
709
+ if (this._viewport && this._onPointerDown) {
710
+ this._viewport.removeEventListener('pointerdown', this._onPointerDown);
711
+ this._viewport.removeEventListener('pointermove', this._onPointerMove);
712
+ this._viewport.removeEventListener('pointerup', this._onPointerUp);
713
+ this._viewport.removeEventListener('pointercancel', this._onPointerUp);
714
+ }
715
+ if (this._viewport && this._getOption('autoHeight') === true) {
716
+ this._viewport.style.height = '';
717
+ }
718
+ this._onPrevClick = null;
719
+ this._onNextClick = null;
720
+ this._onScroll = null;
721
+ this._onScrollEnd = null;
722
+ this._onKeyDown = null;
723
+ this._onPointerDown = null;
724
+ this._onPointerMove = null;
725
+ this._onPointerUp = null;
726
+ this._prevButtons = [];
727
+ this._nextButtons = [];
728
+ this._currentLabels = [];
729
+ this._totalLabels = [];
730
+ _super.prototype.dispose.call(this);
731
+ };
732
+ KTCarousel.getInstance = function (element) {
733
+ if (!element)
734
+ return null;
735
+ if (KTData.has(element, 'carousel')) {
736
+ return KTData.get(element, 'carousel');
737
+ }
738
+ return null;
739
+ };
740
+ KTCarousel.getOrCreateInstance = function (element, config) {
741
+ var existing = this.getInstance(element);
742
+ if (existing)
743
+ return existing;
744
+ new KTCarousel(element, config !== null && config !== void 0 ? config : undefined);
745
+ return this.getInstance(element);
746
+ };
747
+ KTCarousel.createInstances = function () {
748
+ document
749
+ .querySelectorAll('[data-kt-carousel]')
750
+ .forEach(function (el) {
751
+ if (el.getAttribute('data-kt-carousel-lazy') === 'true') {
752
+ return;
753
+ }
754
+ new KTCarousel(el);
755
+ });
756
+ };
757
+ KTCarousel.init = function () {
758
+ KTCarousel.createInstances();
759
+ };
760
+ return KTCarousel;
761
+ }(KTComponent));
762
+ export { KTCarousel };
763
+ if (typeof window !== 'undefined') {
764
+ window.KTCarousel = KTCarousel;
765
+ }
766
+ //# sourceMappingURL=carousel.js.map