uikit 3.11.2-dev.21a5b7139 → 3.11.2-dev.29f2881ed

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 (146) hide show
  1. package/CHANGELOG.md +36 -19
  2. package/dist/css/uikit-core-rtl.css +86 -185
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +86 -185
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +88 -191
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +88 -191
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +3 -3
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +10 -14
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +31 -60
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +34 -64
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +110 -72
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +110 -72
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +75 -28
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +110 -72
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +57 -21
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +16 -20
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +2 -2
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +10 -14
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +340 -337
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +584 -518
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/component.js +2 -11
  44. package/src/js/api/hooks.js +1 -1
  45. package/src/js/api/state.js +3 -3
  46. package/src/js/components/countdown.js +2 -2
  47. package/src/js/components/filter.js +2 -3
  48. package/src/js/components/internal/lightbox-animations.js +4 -3
  49. package/src/js/components/internal/slider-preload.js +37 -0
  50. package/src/js/components/internal/slider-transitioner.js +2 -2
  51. package/src/js/components/internal/slideshow-animations.js +4 -3
  52. package/src/js/components/lightbox-panel.js +34 -58
  53. package/src/js/components/lightbox.js +3 -4
  54. package/src/js/components/slider.js +30 -11
  55. package/src/js/components/slideshow.js +8 -1
  56. package/src/js/components/sortable.js +8 -8
  57. package/src/js/components/upload.js +9 -13
  58. package/src/js/core/accordion.js +3 -3
  59. package/src/js/core/alert.js +1 -2
  60. package/src/js/core/height-match.js +3 -3
  61. package/src/js/core/icon.js +13 -6
  62. package/src/js/core/img.js +134 -115
  63. package/src/js/core/margin.js +11 -13
  64. package/src/js/core/modal.js +1 -2
  65. package/src/js/core/navbar.js +5 -5
  66. package/src/js/core/scrollspy.js +6 -6
  67. package/src/js/core/sticky.js +34 -35
  68. package/src/js/core/svg.js +10 -6
  69. package/src/js/core/toggle.js +4 -3
  70. package/src/js/mixin/internal/animate-slide.js +9 -12
  71. package/src/js/mixin/parallax.js +110 -72
  72. package/src/js/mixin/slider-drag.js +3 -3
  73. package/src/js/mixin/slider-nav.js +2 -2
  74. package/src/js/mixin/slider.js +8 -16
  75. package/src/js/mixin/slideshow.js +2 -2
  76. package/src/js/mixin/togglable.js +1 -2
  77. package/src/js/util/ajax.js +15 -14
  78. package/src/js/util/animation.js +7 -12
  79. package/src/js/util/attr.js +14 -12
  80. package/src/js/util/dimensions.js +4 -4
  81. package/src/js/util/dom.js +23 -32
  82. package/src/js/util/lang.js +7 -6
  83. package/src/js/util/options.js +2 -11
  84. package/src/js/util/player.js +5 -4
  85. package/src/js/util/position.js +2 -2
  86. package/src/js/util/selector.js +12 -18
  87. package/src/js/util/style.js +4 -4
  88. package/src/less/components/base.less +10 -33
  89. package/src/less/components/form-range.less +48 -95
  90. package/src/less/components/form.less +0 -1
  91. package/src/less/components/height.less +3 -0
  92. package/src/less/components/leader.less +0 -1
  93. package/src/less/components/lightbox.less +0 -1
  94. package/src/less/components/modal.less +3 -7
  95. package/src/less/components/progress.less +14 -36
  96. package/src/less/components/slider.less +0 -3
  97. package/src/less/components/slideshow.less +0 -3
  98. package/src/less/components/text.less +16 -32
  99. package/src/scss/components/base.scss +10 -33
  100. package/src/scss/components/form-range.scss +48 -95
  101. package/src/scss/components/form.scss +0 -1
  102. package/src/scss/components/height.scss +3 -0
  103. package/src/scss/components/leader.scss +0 -1
  104. package/src/scss/components/lightbox.scss +0 -1
  105. package/src/scss/components/modal.scss +3 -7
  106. package/src/scss/components/progress.scss +14 -36
  107. package/src/scss/components/slider.scss +0 -3
  108. package/src/scss/components/slideshow.scss +0 -3
  109. package/src/scss/components/text.scss +16 -32
  110. package/src/scss/mixins-theme.scss +1 -1
  111. package/src/scss/mixins.scss +1 -1
  112. package/src/scss/variables-theme.scss +3 -3
  113. package/src/scss/variables.scss +3 -3
  114. package/tests/align.html +10 -10
  115. package/tests/animation.html +2 -2
  116. package/tests/article.html +2 -2
  117. package/tests/base.html +3 -3
  118. package/tests/card.html +10 -10
  119. package/tests/column.html +3 -3
  120. package/tests/comment.html +9 -9
  121. package/tests/dotnav.html +3 -3
  122. package/tests/image.html +296 -64
  123. package/tests/images/image-type.avif +0 -0
  124. package/tests/images/image-type.jpeg +0 -0
  125. package/tests/images/image-type.webp +0 -0
  126. package/tests/index.html +8 -8
  127. package/tests/lightbox.html +10 -10
  128. package/tests/marker.html +2 -2
  129. package/tests/modal.html +8 -9
  130. package/tests/navbar.html +2 -2
  131. package/tests/overlay.html +7 -7
  132. package/tests/parallax.html +14 -5
  133. package/tests/position.html +12 -12
  134. package/tests/slidenav.html +12 -12
  135. package/tests/slider.html +20 -20
  136. package/tests/sortable.html +1 -1
  137. package/tests/sticky-parallax.html +55 -70
  138. package/tests/svg.html +6 -6
  139. package/tests/table.html +11 -11
  140. package/tests/thumbnav.html +12 -12
  141. package/tests/transition.html +30 -30
  142. package/tests/utility.html +33 -33
  143. package/tests/video.html +1 -1
  144. package/tests/width.html +1 -1
  145. package/src/js/util/promise.js +0 -0
  146. package/tests/images/animated.gif +0 -0
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.21a5b7139 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.29f2881ed | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -29,19 +29,19 @@
29
29
  }
30
30
 
31
31
  function startsWith(str, search) {
32
- return str.startsWith(search);
32
+ return str == null ? void 0 : str.startsWith == null ? void 0 : str.startsWith(search);
33
33
  }
34
34
 
35
35
  function endsWith(str, search) {
36
- return str.endsWith(search);
36
+ return str == null ? void 0 : str.endsWith == null ? void 0 : str.endsWith(search);
37
37
  }
38
38
 
39
39
  function includes(obj, search) {
40
- return obj && obj.includes(search);
40
+ return obj == null ? void 0 : obj.includes == null ? void 0 : obj.includes(search);
41
41
  }
42
42
 
43
43
  function findIndex(array, predicate) {
44
- return array.findIndex(predicate);
44
+ return array == null ? void 0 : array.findIndex == null ? void 0 : array.findIndex(predicate);
45
45
  }
46
46
 
47
47
  const { isArray, from: toArray } = Array;
@@ -130,14 +130,15 @@
130
130
  return element && (isNode(element) ? [element] : Array.from(element).filter(isNode)) || [];
131
131
  }
132
132
 
133
- function toWindow(element) {
133
+ function toWindow(element) {var _element;
134
134
  if (isWindow(element)) {
135
135
  return element;
136
136
  }
137
137
 
138
138
  element = toNode(element);
139
+ const document = isDocument(element) ? element : (_element = element) == null ? void 0 : _element.ownerDocument;
139
140
 
140
- return element ? (isDocument(element) ? element : element.ownerDocument).defaultView : window;
141
+ return (document == null ? void 0 : document.defaultView) || window;
141
142
  }
142
143
 
143
144
  function toMs(time) {
@@ -224,7 +225,7 @@
224
225
  },
225
226
 
226
227
  contain(dimensions, maxDimensions) {
227
- dimensions = assign({}, dimensions);
228
+ dimensions = { ...dimensions };
228
229
 
229
230
  each(
230
231
  dimensions,
@@ -304,17 +305,17 @@
304
305
  if (isUndefined(value)) {var _toNode;
305
306
  return (_toNode = toNode(element)) == null ? void 0 : _toNode.getAttribute(name);
306
307
  } else {
307
- toNodes(element).forEach((element) => {
308
+ for (const el of toNodes(element)) {
308
309
  if (isFunction(value)) {
309
- value = value.call(element, attr(element, name));
310
+ value = value.call(el, attr(el, name));
310
311
  }
311
312
 
312
313
  if (value === null) {
313
- removeAttr(element, name);
314
+ removeAttr(el, name);
314
315
  } else {
315
- element.setAttribute(name, value);
316
+ el.setAttribute(name, value);
316
317
  }
317
- });
318
+ }
318
319
  }
319
320
  }
320
321
 
@@ -323,33 +324,22 @@
323
324
  }
324
325
 
325
326
  function removeAttr(element, name) {
326
- element = toNodes(element);
327
- name.split(' ').forEach((name) =>
328
- element.forEach((element) => element.hasAttribute(name) && element.removeAttribute(name)));
329
-
327
+ const elements = toNodes(element);
328
+ for (const attribute of name.split(' ')) {
329
+ for (const element of elements) {
330
+ element.removeAttribute(attribute);
331
+ }
332
+ }
330
333
  }
331
334
 
332
335
  function data(element, attribute) {
333
- for (let i = 0, attrs = [attribute, "data-" + attribute]; i < attrs.length; i++) {
334
- if (hasAttr(element, attrs[i])) {
335
- return attr(element, attrs[i]);
336
+ for (const name of [attribute, "data-" + attribute]) {
337
+ if (hasAttr(element, name)) {
338
+ return attr(element, name);
336
339
  }
337
340
  }
338
341
  }
339
342
 
340
- const inBrowser = typeof window !== 'undefined';
341
- const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
342
-
343
- const hasTouch = inBrowser && 'ontouchstart' in window;
344
- const hasPointerEvents = inBrowser && window.PointerEvent;
345
-
346
- const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
347
- const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
348
- const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
349
- const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
350
- const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
351
- const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
352
-
353
343
  const voidElements = {
354
344
  area: true,
355
345
  base: true,
@@ -449,12 +439,6 @@
449
439
  return findAll(selector, getContext(selector, context));
450
440
  }
451
441
 
452
- function getContext(selector, context) {if (context === void 0) {context = document;}
453
- return isString(selector) && isContextSelector(selector) || isDocument(context) ?
454
- context :
455
- context.ownerDocument;
456
- }
457
-
458
442
  function find(selector, context) {
459
443
  return toNode(_query(selector, context, 'querySelector'));
460
444
  }
@@ -463,6 +447,17 @@
463
447
  return toNodes(_query(selector, context, 'querySelectorAll'));
464
448
  }
465
449
 
450
+ const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
451
+ const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
452
+
453
+ function getContext(selector, context) {if (context === void 0) {context = document;}
454
+ return isString(selector) && isContextSelector(selector) || isDocument(context) ?
455
+ context :
456
+ context.ownerDocument;
457
+ }
458
+
459
+ const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
460
+
466
461
  function _query(selector, context, queryFn) {if (context === void 0) {context = document;}
467
462
  if (!selector || !isString(selector)) {
468
463
  return selector;
@@ -507,11 +502,6 @@
507
502
  }
508
503
  }
509
504
 
510
- const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
511
- const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
512
-
513
- const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
514
-
515
505
  const selectorRe = /.*?[^\\](?:,|$)/g;
516
506
 
517
507
  const splitSelector = memoize((selector) =>
@@ -537,13 +527,8 @@
537
527
  return names.join(' > ');
538
528
  }
539
529
 
540
- const escapeFn =
541
- inBrowser && window.CSS && CSS.escape ||
542
- function (css) {
543
- return css.replace(/([^\x7f-\uFFFF\w-])/g, (match) => "\\" + match);
544
- };
545
530
  function escape(css) {
546
- return isString(css) ? escapeFn.call(null, css) : '';
531
+ return isString(css) ? CSS.escape(css) : '';
547
532
  }
548
533
 
549
534
  function on() {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}
@@ -686,17 +671,14 @@
686
671
  }
687
672
 
688
673
  function ajax(url, options) {
689
- const env = assign(
690
- {
674
+ const env = {
691
675
  data: null,
692
676
  method: 'GET',
693
677
  headers: {},
694
678
  xhr: new XMLHttpRequest(),
695
679
  beforeSend: noop,
696
- responseType: '' },
697
-
698
- options);
699
-
680
+ responseType: '',
681
+ ...options };
700
682
 
701
683
  return Promise.resolve().
702
684
  then(() => env.beforeSend(env)).
@@ -747,8 +729,12 @@
747
729
  return new Promise((resolve, reject) => {
748
730
  const img = new Image();
749
731
 
750
- img.onerror = (e) => reject(e);
751
- img.onload = () => resolve(img);
732
+ img.onerror = (e) => {
733
+ reject(e);
734
+ };
735
+ img.onload = () => {
736
+ resolve(img);
737
+ };
752
738
 
753
739
  sizes && (img.sizes = sizes);
754
740
  srcset && (img.srcset = srcset);
@@ -775,7 +761,8 @@
775
761
 
776
762
 
777
763
  function css(element, property, value, priority) {if (priority === void 0) {priority = '';}
778
- return toNodes(element).map((element) => {
764
+ const elements = toNodes(element);
765
+ for (const element of elements) {
779
766
  if (isString(property)) {
780
767
  property = propName(property);
781
768
 
@@ -801,9 +788,8 @@
801
788
  priority = value;
802
789
  each(property, (value, property) => css(element, property, value, priority));
803
790
  }
804
-
805
- return element;
806
- })[0];
791
+ }
792
+ return elements[0];
807
793
  }
808
794
 
809
795
  function getStyles(element, pseudoElt) {
@@ -930,16 +916,11 @@
930
916
 
931
917
 
932
918
  addClass(element, 'uk-transition');
933
- css(
934
- element,
935
- assign(
936
- {
919
+ css(element, {
937
920
  transitionProperty: Object.keys(props).map(propName).join(','),
938
921
  transitionDuration: duration + "ms",
939
- transitionTimingFunction: timing },
940
-
941
- props));
942
-
922
+ transitionTimingFunction: timing,
923
+ ...props });
943
924
 
944
925
  })));
945
926
 
@@ -1039,8 +1020,8 @@
1039
1020
  const currentOffset = dimensions$1(element);
1040
1021
 
1041
1022
  if (element) {
1042
- const { pageYOffset, pageXOffset } = toWindow(element);
1043
- const offsetBy = { height: pageYOffset, width: pageXOffset };
1023
+ const { scrollY, scrollX } = toWindow(element);
1024
+ const offsetBy = { height: scrollY, width: scrollX };
1044
1025
 
1045
1026
  for (const dir in dirs$1) {
1046
1027
  for (const i in dirs$1[dir]) {
@@ -1106,8 +1087,8 @@
1106
1087
 
1107
1088
  if (css(element, 'position') === 'fixed') {
1108
1089
  const win = toWindow(element);
1109
- offset[0] += win.pageYOffset;
1110
- offset[1] += win.pageXOffset;
1090
+ offset[0] += win.scrollY;
1091
+ offset[1] += win.scrollX;
1111
1092
  return offset;
1112
1093
  }
1113
1094
  } while (element = element.offsetParent);
@@ -1198,8 +1179,8 @@
1198
1179
 
1199
1180
  const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
1200
1181
  const parseCalc = memoize((calc) => calc.toString().replace(/\s/g, '').match(calcRe) || []);
1201
- const unitRe = /(?:v[hw]|%)$/;
1202
- const parseUnit = memoize((str) => (str.match(unitRe) || [])[0]);
1182
+ const unitRe$1 = /(?:v[hw]|%)$/;
1183
+ const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);
1203
1184
 
1204
1185
  function percent(base, value) {
1205
1186
  return base * toFloat(value) / 100;
@@ -1214,6 +1195,10 @@
1214
1195
  once(document, 'DOMContentLoaded', fn);
1215
1196
  }
1216
1197
 
1198
+ function isTag(element, tagName) {var _element$tagName;
1199
+ return (element == null ? void 0 : (_element$tagName = element.tagName) == null ? void 0 : _element$tagName.toLowerCase()) === tagName.toLowerCase();
1200
+ }
1201
+
1217
1202
  function empty(element) {
1218
1203
  return replaceChildren(element, '');
1219
1204
  }
@@ -1222,34 +1207,20 @@
1222
1207
  return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
1223
1208
  }
1224
1209
 
1225
- function replaceChildren(parent, element) {
1226
- const nodes = $$(element);
1227
- $(parent).replaceChildren(...nodes);
1228
- return nodes;
1229
- }
1230
-
1231
- function prepend(parent, element) {
1232
- const nodes = $$(element);
1233
- $(parent).prepend(...nodes);
1234
- return nodes;
1235
- }
1236
-
1237
- function append(parent, element) {
1238
- const nodes = $$(element);
1239
- $(parent).append(...nodes);
1240
- return nodes;
1241
- }
1210
+ const replaceChildren = applyFn('replaceChildren');
1211
+ const prepend = applyFn('prepend');
1212
+ const append = applyFn('append');
1213
+ const before = applyFn('before');
1214
+ const after = applyFn('after');
1242
1215
 
1243
- function before(ref, element) {
1244
- const nodes = $$(element);
1245
- $(ref).before(...nodes);
1246
- return nodes;
1247
- }
1248
-
1249
- function after(ref, element) {
1250
- const nodes = $$(element);
1251
- $(ref).after(...nodes);
1252
- return nodes;
1216
+ function applyFn(fn) {
1217
+ return function (ref, element) {
1218
+ const nodes = toNodes(isString(element) ? fragment(element) : element);
1219
+ if (nodes.length) {
1220
+ $(ref)[fn](...nodes);
1221
+ }
1222
+ return unwrapSingle(nodes);
1223
+ };
1253
1224
  }
1254
1225
 
1255
1226
  function remove$1(element) {
@@ -1282,10 +1253,7 @@
1282
1253
  toNodes(element).
1283
1254
  map(parent).
1284
1255
  filter((value, index, self) => self.indexOf(value) === index).
1285
- forEach((parent) => {
1286
- before(parent, parent.childNodes);
1287
- remove$1(parent);
1288
- });
1256
+ forEach((parent) => parent.replaceWith(...parent.childNodes));
1289
1257
  }
1290
1258
 
1291
1259
  const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
@@ -1304,7 +1272,11 @@
1304
1272
  container.textContent = html;
1305
1273
  }
1306
1274
 
1307
- return container.childNodes.length > 1 ? toNodes(container.childNodes) : container.firstChild;
1275
+ return unwrapSingle(container.childNodes);
1276
+ }
1277
+
1278
+ function unwrapSingle(nodes) {
1279
+ return nodes.length > 1 ? nodes : nodes[0];
1308
1280
  }
1309
1281
 
1310
1282
  function apply(node, fn) {
@@ -1333,6 +1305,19 @@
1333
1305
  return isString(str) && startsWith(str.trim(), '<');
1334
1306
  }
1335
1307
 
1308
+ const inBrowser = typeof window !== 'undefined';
1309
+ const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
1310
+
1311
+ const hasTouch = inBrowser && 'ontouchstart' in window;
1312
+ const hasPointerEvents = inBrowser && window.PointerEvent;
1313
+
1314
+ const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1315
+ const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1316
+ const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1317
+ const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
1318
+ const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
1319
+ const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
1320
+
1336
1321
  /*
1337
1322
  Based on:
1338
1323
  Copyright (c) 2016 Wilson Page wilsonpage@me.com
@@ -1524,7 +1509,7 @@
1524
1509
 
1525
1510
  // extend strategy
1526
1511
  strats.computed = strats.methods = function (parentVal, childVal) {
1527
- return childVal ? parentVal ? assign({}, parentVal, childVal) : childVal : parentVal;
1512
+ return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
1528
1513
  };
1529
1514
 
1530
1515
  // data strategy
@@ -1664,11 +1649,11 @@
1664
1649
  }
1665
1650
 
1666
1651
  function isHTML5(el) {
1667
- return (el == null ? void 0 : el.tagName) === 'VIDEO';
1652
+ return isTag(el, 'video');
1668
1653
  }
1669
1654
 
1670
1655
  function isIFrame(el) {
1671
- return (el == null ? void 0 : el.tagName) === 'IFRAME' && (isYoutube(el) || isVimeo(el));
1656
+ return isTag(el, 'iframe') && (isYoutube(el) || isVimeo(el));
1672
1657
  }
1673
1658
 
1674
1659
  function isYoutube(el) {
@@ -1688,7 +1673,7 @@
1688
1673
 
1689
1674
  function post(el, cmd) {
1690
1675
  try {
1691
- el.contentWindow.postMessage(JSON.stringify(assign({ event: 'command' }, cmd)), '*');
1676
+ el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
1692
1677
  } catch (e) {
1693
1678
  // noop
1694
1679
  }
@@ -1980,14 +1965,14 @@
1980
1965
  if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
1981
1966
  position[align] = newVal;
1982
1967
 
1983
- ['element', 'target'].forEach((el) => {
1968
+ for (const el of ['element', 'target']) {
1984
1969
  if (elemOffset) {
1985
1970
  flipped[el][dir] =
1986
1971
  flipped[el][dir] === dirs[prop][1] ?
1987
1972
  dirs[prop][2] :
1988
1973
  dirs[prop][1];
1989
1974
  }
1990
- });
1975
+ }
1991
1976
 
1992
1977
  return true;
1993
1978
  }
@@ -2068,6 +2053,7 @@
2068
2053
  flipPosition: flipPosition,
2069
2054
  toPx: toPx,
2070
2055
  ready: ready,
2056
+ isTag: isTag,
2071
2057
  empty: empty,
2072
2058
  html: html,
2073
2059
  replaceChildren: replaceChildren,
@@ -2362,7 +2348,7 @@
2362
2348
  const {
2363
2349
  $options: { computed } } =
2364
2350
  this;
2365
- const values = assign({}, this._computeds);
2351
+ const values = { ...this._computeds };
2366
2352
  this._computeds = {};
2367
2353
 
2368
2354
  for (const key in computed) {
@@ -2449,9 +2435,9 @@
2449
2435
  }
2450
2436
  };
2451
2437
 
2452
- UIkit.prototype._initEvents = function () {var _this$$options$events;
2438
+ UIkit.prototype._initEvents = function () {
2453
2439
  this._events = [];
2454
- (_this$$options$events = this.$options.events) == null ? void 0 : _this$$options$events.forEach((event) => {
2440
+ for (const event of this.$options.events || []) {
2455
2441
  if (hasOwn(event, 'handler')) {
2456
2442
  registerEvent(this, event);
2457
2443
  } else {
@@ -2459,7 +2445,7 @@
2459
2445
  registerEvent(this, event[key], key);
2460
2446
  }
2461
2447
  }
2462
- });
2448
+ }
2463
2449
  };
2464
2450
 
2465
2451
  UIkit.prototype._unbindEvents = function () {
@@ -2547,7 +2533,7 @@
2547
2533
  el = isFunction(el) ? el.call(component) : el || component.$el;
2548
2534
 
2549
2535
  if (isArray(el)) {
2550
- el.forEach((el) => registerEvent(component, assign({}, event, { el }), key));
2536
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
2551
2537
  return;
2552
2538
  }
2553
2539
 
@@ -2781,7 +2767,7 @@
2781
2767
  }
2782
2768
  };
2783
2769
 
2784
- const opt = isPlainObject(options) ? assign({}, options) : options.options;
2770
+ const opt = isPlainObject(options) ? { ...options } : options.options;
2785
2771
 
2786
2772
  opt.name = name;
2787
2773
 
@@ -2834,7 +2820,7 @@
2834
2820
  UIkit.data = '__uikit__';
2835
2821
  UIkit.prefix = 'uk-';
2836
2822
  UIkit.options = {};
2837
- UIkit.version = '3.11.2-dev.21a5b7139';
2823
+ UIkit.version = '3.11.2-dev.29f2881ed';
2838
2824
 
2839
2825
  globalAPI(UIkit);
2840
2826
  hooksAPI(UIkit);
@@ -3157,7 +3143,7 @@
3157
3143
  show ?
3158
3144
  Transition.start(
3159
3145
  el,
3160
- assign({}, initProps, { overflow: 'hidden', height: endHeight }),
3146
+ { ...initProps, overflow: 'hidden', height: endHeight },
3161
3147
  Math.round(duration * (1 - currentHeight / endHeight)),
3162
3148
  transition) :
3163
3149
 
@@ -3277,37 +3263,37 @@
3277
3263
  return;
3278
3264
  }
3279
3265
 
3280
- items.forEach((el) =>
3281
- this.toggleElement(el, !hasClass(el, this.clsOpen), async (el, show) => {
3282
- toggleClass(el, this.clsOpen, show);
3283
- attr($(this.$props.toggle, el), 'aria-expanded', show);
3266
+ for (const el of items) {
3267
+ this.toggleElement(el, !hasClass(el, this.clsOpen), async (el, show) => {
3268
+ toggleClass(el, this.clsOpen, show);
3269
+ attr($(this.$props.toggle, el), 'aria-expanded', show);
3284
3270
 
3285
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3271
+ const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3286
3272
 
3287
- if (animate === false || !this.hasTransition) {
3288
- hide(content, !show);
3289
- return;
3290
- }
3273
+ if (animate === false || !this.hasTransition) {
3274
+ hide(content, !show);
3275
+ return;
3276
+ }
3291
3277
 
3292
- if (!el._wrapper) {
3293
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3294
- }
3278
+ if (!el._wrapper) {
3279
+ el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3280
+ }
3295
3281
 
3296
- hide(content, false);
3297
- await toggleHeight(this)(el._wrapper, show);
3298
- hide(content, !show);
3282
+ hide(content, false);
3283
+ await toggleHeight(this)(el._wrapper, show);
3284
+ hide(content, !show);
3299
3285
 
3300
- delete el._wrapper;
3301
- unwrap(content);
3286
+ delete el._wrapper;
3287
+ unwrap(content);
3302
3288
 
3303
- if (show) {
3304
- const toggle = $(this.$props.toggle, el);
3305
- if (!isInView(toggle)) {
3306
- scrollIntoView(toggle, { offset: this.offset });
3289
+ if (show) {
3290
+ const toggle = $(this.$props.toggle, el);
3291
+ if (!isInView(toggle)) {
3292
+ scrollIntoView(toggle, { offset: this.offset });
3293
+ }
3307
3294
  }
3308
- }
3309
- }));
3310
-
3295
+ });
3296
+ }
3311
3297
  } } };
3312
3298
 
3313
3299
 
@@ -3329,7 +3315,7 @@
3329
3315
  animation: [true],
3330
3316
  selClose: '.uk-alert-close',
3331
3317
  duration: 150,
3332
- hideProps: assign({ opacity: 0 }, Togglable.data.hideProps) },
3318
+ hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3333
3319
 
3334
3320
 
3335
3321
  events: [
@@ -4026,10 +4012,10 @@
4026
4012
  },
4027
4013
 
4028
4014
  write(_ref) {let { columns, rows } = _ref;
4029
- for (let i = 0; i < rows.length; i++) {
4030
- for (let j = 0; j < rows[i].length; j++) {
4031
- toggleClass(rows[i][j], this.margin, i !== 0);
4032
- toggleClass(rows[i][j], this.firstColumn, !!~columns[0].indexOf(rows[i][j]));
4015
+ for (const row of rows) {
4016
+ for (const column of row) {
4017
+ toggleClass(column, this.margin, rows[0] !== row);
4018
+ toggleClass(column, this.firstColumn, !!~columns[0].indexOf(column));
4033
4019
  }
4034
4020
  }
4035
4021
  },
@@ -4045,10 +4031,10 @@
4045
4031
  function getColumns(rows) {
4046
4032
  const columns = [];
4047
4033
 
4048
- for (let i = 0; i < rows.length; i++) {
4049
- const sorted = sortBy(rows[i], 'left', 'right');
4034
+ for (const row of rows) {
4035
+ const sorted = sortBy(row, 'left', 'right');
4050
4036
  for (let j = 0; j < sorted.length; j++) {
4051
- columns[j] = !columns[j] ? sorted[j] : columns[j].concat(sorted[j]);
4037
+ columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4052
4038
  }
4053
4039
  }
4054
4040
 
@@ -4058,17 +4044,15 @@
4058
4044
  function sortBy(items, startProp, endProp) {
4059
4045
  const sorted = [[]];
4060
4046
 
4061
- for (let i = 0; i < items.length; i++) {
4062
- const el = items[i];
4063
-
4047
+ for (const el of items) {
4064
4048
  if (!isVisible(el)) {
4065
4049
  continue;
4066
4050
  }
4067
4051
 
4068
4052
  let dim = getOffset(el);
4069
4053
 
4070
- for (let j = sorted.length - 1; j >= 0; j--) {
4071
- const current = sorted[j];
4054
+ for (let i = sorted.length - 1; i >= 0; i--) {
4055
+ const current = sorted[i];
4072
4056
 
4073
4057
  if (!current[0]) {
4074
4058
  current.push(el);
@@ -4093,7 +4077,7 @@
4093
4077
  break;
4094
4078
  }
4095
4079
 
4096
- if (j === 0) {
4080
+ if (i === 0) {
4097
4081
  sorted.unshift([el]);
4098
4082
  break;
4099
4083
  }
@@ -4292,9 +4276,9 @@
4292
4276
  },
4293
4277
 
4294
4278
  write(_ref2) {let { rows } = _ref2;
4295
- rows.forEach((_ref3) => {let { heights, elements } = _ref3;return (
4296
- elements.forEach((el, i) => css(el, 'minHeight', heights[i])));});
4297
-
4279
+ for (const { heights, elements } of rows) {
4280
+ elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
4281
+ }
4298
4282
  },
4299
4283
 
4300
4284
  events: ['resize'] } };
@@ -4488,6 +4472,12 @@
4488
4472
 
4489
4473
  methods: {
4490
4474
  async getSvg() {
4475
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4476
+ return new Promise((resolve) =>
4477
+ once(this.$el, 'load', () => resolve(this.getSvg())));
4478
+
4479
+ }
4480
+
4491
4481
  return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4492
4482
  },
4493
4483
 
@@ -4587,7 +4577,7 @@
4587
4577
  }
4588
4578
 
4589
4579
  function insertSVG(el, root) {
4590
- if (isVoidElement(root) || root.tagName === 'CANVAS') {
4580
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
4591
4581
  root.hidden = true;
4592
4582
 
4593
4583
  const next = root.nextElementSibling;
@@ -4599,11 +4589,7 @@
4599
4589
  }
4600
4590
 
4601
4591
  function equals(el, other) {
4602
- return isSVG(el) && isSVG(other) && innerHTML(el) === innerHTML(other);
4603
- }
4604
-
4605
- function isSVG(el) {
4606
- return (el == null ? void 0 : el.tagName) === 'svg';
4592
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4607
4593
  }
4608
4594
 
4609
4595
  function innerHTML(el) {
@@ -4684,14 +4670,14 @@
4684
4670
  },
4685
4671
 
4686
4672
  methods: {
4687
- getSvg() {
4673
+ async getSvg() {
4688
4674
  const icon = getIcon(this.icon);
4689
4675
 
4690
4676
  if (!icon) {
4691
- return Promise.reject('Icon not found.');
4677
+ throw 'Icon not found.';
4692
4678
  }
4693
4679
 
4694
- return Promise.resolve(icon);
4680
+ return icon;
4695
4681
  } } };
4696
4682
 
4697
4683
  const IconComponent = {
@@ -4749,10 +4735,17 @@
4749
4735
  const Spinner = {
4750
4736
  extends: IconComponent,
4751
4737
 
4752
- async connected() {
4753
- const svg = await this.svg;
4754
- svg && this.ratio !== 1 && css($('circle', svg), 'strokeWidth', 1 / this.ratio);
4755
- } };
4738
+ methods: {
4739
+ async getSvg() {
4740
+ const icon = await Icon.methods.getSvg.call(this);
4741
+
4742
+ if (this.ratio !== 1) {
4743
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
4744
+ }
4745
+
4746
+ return icon;
4747
+ } } };
4748
+
4756
4749
 
4757
4750
 
4758
4751
  const parsed = {};
@@ -4790,120 +4783,95 @@
4790
4783
  return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4791
4784
  }
4792
4785
 
4786
+ const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
4787
+ const nativeIsIntersecting = ('isIntersecting' in IntersectionObserverEntry.prototype); // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
4788
+
4793
4789
  var img = {
4794
4790
  args: 'dataSrc',
4795
4791
 
4796
4792
  props: {
4797
4793
  dataSrc: String,
4798
- dataSrcset: Boolean,
4799
- sizes: String,
4800
- width: Number,
4801
- height: Number,
4794
+ sources: String,
4802
4795
  offsetTop: String,
4803
4796
  offsetLeft: String,
4804
- target: String },
4797
+ target: String,
4798
+ loading: String },
4805
4799
 
4806
4800
 
4807
4801
  data: {
4808
4802
  dataSrc: '',
4809
- dataSrcset: false,
4810
- sizes: false,
4811
- width: false,
4812
- height: false,
4803
+ sources: false,
4813
4804
  offsetTop: '50vh',
4814
4805
  offsetLeft: '50vw',
4815
- target: false },
4806
+ target: false,
4807
+ loading: 'lazy' },
4816
4808
 
4817
4809
 
4818
4810
  computed: {
4819
- cacheKey(_ref) {let { dataSrc } = _ref;
4820
- return this.$name + "." + dataSrc;
4821
- },
4822
-
4823
- width(_ref2) {let { width, dataWidth } = _ref2;
4824
- return width || dataWidth;
4825
- },
4826
-
4827
- height(_ref3) {let { height, dataHeight } = _ref3;
4828
- return height || dataHeight;
4829
- },
4830
-
4831
- sizes(_ref4) {let { sizes, dataSizes } = _ref4;
4832
- return sizes || dataSizes;
4833
- },
4834
-
4835
- isImg(_, $el) {
4836
- return isImg($el);
4837
- },
4838
-
4839
4811
  target: {
4840
- get(_ref5) {let { target } = _ref5;
4812
+ get(_ref) {let { target } = _ref;
4841
4813
  return [this.$el, ...queryAll(target, this.$el)];
4842
4814
  },
4843
4815
 
4844
4816
  watch() {
4845
4817
  this.observe();
4846
- } },
4847
-
4818
+ } } },
4848
4819
 
4849
- offsetTop(_ref6) {let { offsetTop } = _ref6;
4850
- return toPx(offsetTop, 'height');
4851
- },
4852
-
4853
- offsetLeft(_ref7) {let { offsetLeft } = _ref7;
4854
- return toPx(offsetLeft, 'width');
4855
- } },
4856
4820
 
4857
4821
 
4858
4822
  connected() {
4859
- if (!window.IntersectionObserver) {
4860
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
4823
+ if (this.loading !== 'lazy' || !window.IntersectionObserver || !nativeIsIntersecting) {
4824
+ this.load();
4861
4825
  return;
4862
4826
  }
4863
4827
 
4864
- if (storage[this.cacheKey]) {
4865
- setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
4866
- } else if (this.isImg && this.width && this.height) {
4867
- setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
4828
+ if (nativeLazyLoad && isImg(this.$el)) {
4829
+ this.$el.loading = 'lazy';
4830
+ setSrcAttrs(this.$el);
4831
+
4832
+ if (this.target.length === 1) {
4833
+ return;
4834
+ }
4868
4835
  }
4869
4836
 
4870
- this.observer = new IntersectionObserver(this.load, {
4871
- rootMargin: this.offsetTop + "px " + this.offsetLeft + "px" });
4837
+ ensureSrcAttribute(this.$el);
4872
4838
 
4839
+ const rootMargin = toPx(this.offsetTop, 'height') + "px " + toPx(
4840
+ this.offsetLeft,
4841
+ 'width') + "px";
4873
4842
 
4874
- requestAnimationFrame(this.observe);
4875
- },
4843
+ this.observer = new IntersectionObserver(
4844
+ (entries) => {
4845
+ if (entries.some((entry) => entry.isIntersecting)) {
4846
+ this.load();
4847
+ this.observer.disconnect();
4848
+ }
4849
+ },
4850
+ { rootMargin });
4876
4851
 
4877
- disconnected() {
4878
- this.observer && this.observer.disconnect();
4852
+ this.observe();
4879
4853
  },
4880
4854
 
4881
- update: {
4882
- read(_ref8) {let { image } = _ref8;
4883
- if (!this.observer) {
4884
- return false;
4885
- }
4855
+ disconnected() {var _this$observer;
4856
+ if (this._data.image) {
4857
+ this._data.image.onload = '';
4858
+ }
4886
4859
 
4887
- if (!image && document.readyState === 'complete') {
4888
- this.load(this.observer.takeRecords());
4889
- }
4860
+ (_this$observer = this.observer) == null ? void 0 : _this$observer.disconnect();
4861
+ },
4890
4862
 
4891
- if (this.isImg) {
4863
+ update: {
4864
+ write(store) {
4865
+ if (!this.observer || isImg(this.$el)) {
4892
4866
  return false;
4893
4867
  }
4894
4868
 
4895
- image &&
4896
- image.then(
4897
- (img) => img && img.currentSrc !== '' && setSrcAttrs(this.$el, currentSrc(img)));
4898
-
4899
- },
4900
-
4901
- write(data) {
4902
- if (this.dataSrcset && window.devicePixelRatio !== 1) {
4869
+ const srcset = data(this.$el, 'data-srcset');
4870
+ if (srcset && window.devicePixelRatio !== 1) {
4903
4871
  const bgSize = css(this.$el, 'backgroundSize');
4904
- if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
4905
- data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
4906
- css(this.$el, 'backgroundSize', data.bgSize + "px");
4872
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
4873
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
4874
+ css(this.$el, 'backgroundSize', store.bgSize + "px");
4907
4875
  }
4908
4876
  }
4909
4877
  },
@@ -4912,40 +4880,35 @@
4912
4880
 
4913
4881
 
4914
4882
  methods: {
4915
- load(entries) {
4916
- // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
4917
- if (
4918
- !entries.some((entry) => isUndefined(entry.isIntersecting) || entry.isIntersecting))
4919
- {
4920
- return;
4883
+ load() {
4884
+ if (this._data.image) {
4885
+ return this._data.image;
4921
4886
  }
4922
4887
 
4923
- this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(
4924
- (img) => {
4925
- setSrcAttrs(this.$el, currentSrc(img), img.srcset, img.sizes);
4926
- storage[this.cacheKey] = currentSrc(img);
4927
- return img;
4928
- },
4929
- (e) => trigger(this.$el, new e.constructor(e.type, e)));
4888
+ const image = isImg(this.$el) ?
4889
+ this.$el :
4890
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
4930
4891
 
4931
-
4932
- this.observer.disconnect();
4892
+ removeAttr(image, 'loading');
4893
+ setSrcAttrs(this.$el, image.currentSrc);
4894
+ return this._data.image = image;
4933
4895
  },
4934
4896
 
4935
4897
  observe() {
4936
4898
  if (this._connected && !this._data.image) {
4937
- this.target.forEach((el) => this.observer.observe(el));
4899
+ for (const el of this.target) {
4900
+ this.observer.observe(el);
4901
+ }
4938
4902
  }
4939
4903
  } } };
4940
4904
 
4941
4905
 
4942
4906
 
4943
- function setSrcAttrs(el, src, srcset, sizes) {
4907
+ function setSrcAttrs(el, src) {
4944
4908
  if (isImg(el)) {
4945
- const set = (prop, val) => val && val !== el[prop] && (el[prop] = val);
4946
- set('sizes', sizes);
4947
- set('srcset', srcset);
4948
- set('src', src);
4909
+ const parentNode = parent(el);
4910
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
4911
+ elements.forEach((el) => setSourceProps(el, el));
4949
4912
  } else if (src) {
4950
4913
  const change = !includes(el.style.backgroundImage, src);
4951
4914
  if (change) {
@@ -4955,16 +4918,62 @@
4955
4918
  }
4956
4919
  }
4957
4920
 
4958
- function getPlaceholderImage(width, height, sizes) {
4959
- if (sizes) {
4960
- ({ width, height } = Dimensions.ratio(
4961
- { width, height },
4962
- 'width',
4963
- toPx(sizesToPixel(sizes))));
4921
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
4922
+ function setSourceProps(sourceEl, targetEl) {
4923
+ srcProps.forEach((prop) => {
4924
+ const value = data(sourceEl, prop);
4925
+ if (value) {
4926
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
4927
+ }
4928
+ });
4929
+ }
4930
+
4931
+ function getImageFromElement(el, src, sources) {
4932
+ const img = new Image();
4933
+
4934
+ wrapInPicture(img, sources);
4935
+ setSourceProps(el, img);
4936
+ img.onload = () => {
4937
+ setSrcAttrs(el, img.currentSrc);
4938
+ };
4939
+ attr(img, 'src', src);
4940
+ return img;
4941
+ }
4942
+
4943
+ function wrapInPicture(img, sources) {
4944
+ sources = parseSources(sources);
4945
+
4946
+ if (sources.length) {
4947
+ const picture = fragment('<picture>');
4948
+ for (const attrs of sources) {
4949
+ const source = fragment('<source>');
4950
+ attr(source, attrs);
4951
+ append(picture, source);
4952
+ }
4953
+ append(picture, img);
4954
+ }
4955
+ }
4956
+
4957
+ function parseSources(sources) {
4958
+ if (!sources) {
4959
+ return [];
4960
+ }
4961
+
4962
+ if (startsWith(sources, '[')) {
4963
+ try {
4964
+ sources = JSON.parse(sources);
4965
+ } catch (e) {
4966
+ sources = [];
4967
+ }
4968
+ } else {
4969
+ sources = parseOptions(sources);
4970
+ }
4964
4971
 
4972
+ if (!isArray(sources)) {
4973
+ sources = [sources];
4965
4974
  }
4966
4975
 
4967
- return "data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>";
4976
+ return sources.filter((source) => !isEmpty(source));
4968
4977
  }
4969
4978
 
4970
4979
  const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -5004,24 +5013,18 @@
5004
5013
  return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
5005
5014
  }
5006
5015
 
5007
- function isImg(el) {
5008
- return el.tagName === 'IMG';
5016
+ function ensureSrcAttribute(el) {
5017
+ if (isImg(el) && !hasAttr(el, 'src')) {
5018
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5019
+ }
5009
5020
  }
5010
5021
 
5011
- function currentSrc(el) {
5012
- return el.currentSrc || el.src;
5022
+ function isPicture(el) {
5023
+ return isTag(el, 'picture');
5013
5024
  }
5014
5025
 
5015
- const key = '__test__';
5016
- let storage;
5017
-
5018
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
5019
- try {
5020
- storage = window.sessionStorage || {};
5021
- storage[key] = 1;
5022
- delete storage[key];
5023
- } catch (e) {
5024
- storage = {};
5026
+ function isImg(el) {
5027
+ return isTag(el, 'img');
5025
5028
  }
5026
5029
 
5027
5030
  var Media = {
@@ -5477,7 +5480,7 @@
5477
5480
 
5478
5481
 
5479
5482
  function openDialog(tmpl, options, hideFn, submitFn) {
5480
- options = assign({ bgClose: false, escClose: true, labels: modal.labels }, options);
5483
+ options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
5481
5484
 
5482
5485
  const dialog = modal.dialog(tmpl(options), options);
5483
5486
  const deferred = new Deferred();
@@ -5591,12 +5594,12 @@
5591
5594
  const dropdowns = $$("." + clsDrop, $el);
5592
5595
 
5593
5596
  if (this.dropContainer !== $el) {
5594
- $$("." + clsDrop, this.dropContainer).forEach((el) => {var _this$getDropdown;
5597
+ for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5595
5598
  const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5596
5599
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5597
5600
  dropdowns.push(el);
5598
5601
  }
5599
- });
5602
+ }
5600
5603
  }
5601
5604
 
5602
5605
  return dropdowns;
@@ -5606,10 +5609,11 @@
5606
5609
  this.$create(
5607
5610
  'drop',
5608
5611
  dropdowns.filter((el) => !this.getDropdown(el)),
5609
- assign({}, this.$props, {
5612
+ {
5613
+ ...this.$props,
5610
5614
  boundary: this.boundary,
5611
5615
  pos: this.pos,
5612
- offset: this.dropbar || this.offset }));
5616
+ offset: this.dropbar || this.offset });
5613
5617
 
5614
5618
 
5615
5619
  },
@@ -6298,10 +6302,10 @@
6298
6302
 
6299
6303
 
6300
6304
  disconnected() {
6301
- this.elements.forEach((el) => {
6305
+ for (const el of this.elements) {
6302
6306
  removeClass(el, this.inViewClass, el[stateKey] ? el[stateKey].cls : '');
6303
6307
  delete el[stateKey];
6304
- });
6308
+ }
6305
6309
  },
6306
6310
 
6307
6311
  update: [
@@ -6316,17 +6320,17 @@
6316
6320
  return false;
6317
6321
  }
6318
6322
 
6319
- this.elements.forEach((el) => {
6323
+ for (const el of this.elements) {
6320
6324
  if (!el[stateKey]) {
6321
6325
  el[stateKey] = { cls: data(el, 'uk-scrollspy-class') || this.cls };
6322
6326
  }
6323
6327
 
6324
6328
  el[stateKey].show = isInView(el, this.offsetTop, this.offsetLeft);
6325
- });
6329
+ }
6326
6330
  },
6327
6331
 
6328
6332
  write(data) {
6329
- this.elements.forEach((el) => {
6333
+ for (const el of this.elements) {
6330
6334
  const state = el[stateKey];
6331
6335
 
6332
6336
  if (state.show && !state.inview && !state.queued) {
@@ -6344,7 +6348,7 @@
6344
6348
  } else if (!state.show && state.inview && !state.queued && this.repeat) {
6345
6349
  this.toggle(el, false);
6346
6350
  }
6347
- });
6351
+ }
6348
6352
  },
6349
6353
 
6350
6354
  events: ['scroll', 'resize'] }],
@@ -6501,26 +6505,11 @@
6501
6505
 
6502
6506
 
6503
6507
  computed: {
6504
- position(_ref, $el) {let { position } = _ref;
6505
- return position === 'auto' ?
6506
- (this.isFixed ? this.placeholder : $el).offsetHeight > height(window) ?
6507
- 'bottom' :
6508
- 'top' :
6509
- position;
6510
- },
6511
-
6512
- offset(_ref2, $el) {let { offset } = _ref2;
6513
- if (this.position === 'bottom') {
6514
- offset += '+100vh-100%';
6515
- }
6516
- return toPx(offset, 'height', $el);
6517
- },
6518
-
6519
- selTarget(_ref3, $el) {let { selTarget } = _ref3;
6508
+ selTarget(_ref, $el) {let { selTarget } = _ref;
6520
6509
  return selTarget && $(selTarget, $el) || $el;
6521
6510
  },
6522
6511
 
6523
- widthElement(_ref4, $el) {let { widthElement } = _ref4;
6512
+ widthElement(_ref2, $el) {let { widthElement } = _ref2;
6524
6513
  return query(widthElement, $el) || this.placeholder;
6525
6514
  },
6526
6515
 
@@ -6591,7 +6580,7 @@
6591
6580
  top -
6592
6581
  elHeight - (
6593
6582
  isNumeric(this.targetOffset) ? this.targetOffset : 0) -
6594
- this.offset);
6583
+ toPx(this.offset, 'height'));
6595
6584
 
6596
6585
  }
6597
6586
  });
@@ -6602,7 +6591,7 @@
6602
6591
 
6603
6592
  update: [
6604
6593
  {
6605
- read(_ref5, types) {let { height: height$1, margin } = _ref5;
6594
+ read(_ref3, types) {let { height: height$1, margin } = _ref3;
6606
6595
  this.inactive = !this.matchMedia || !isVisible(this.$el);
6607
6596
 
6608
6597
  if (this.inactive) {
@@ -6611,35 +6600,49 @@
6611
6600
 
6612
6601
  const hide = this.isActive && types.has('resize');
6613
6602
  if (hide) {
6603
+ css(this.selTarget, 'transition', '0s');
6614
6604
  this.hide();
6615
6605
  }
6616
6606
 
6617
6607
  if (!this.isActive) {
6618
- height$1 = this.$el.offsetHeight;
6608
+ height$1 = offset(this.$el).height;
6619
6609
  margin = css(this.$el, 'margin');
6620
6610
  }
6621
6611
 
6622
6612
  if (hide) {
6623
6613
  this.show();
6614
+ fastdom.write(() => css(this.selTarget, 'transition', ''));
6624
6615
  }
6625
6616
 
6626
- const overflow = Math.max(0, height$1 + this.offset - height(window));
6627
-
6628
6617
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
6618
+ const windowHeight = height(window);
6619
+
6620
+ let position = this.position;
6621
+ if (position === 'auto' && height$1 > windowHeight) {
6622
+ position = 'bottom';
6623
+ }
6624
+
6625
+ let offset$1 = toPx(this.offset, 'height', referenceElement);
6626
+ if (position === 'bottom') {
6627
+ offset$1 += windowHeight - height$1;
6628
+ }
6629
+
6630
+ const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6629
6631
  const topOffset = offset(referenceElement).top;
6630
6632
  const offsetParentTop = offset(referenceElement.offsetParent).top;
6631
6633
 
6632
6634
  const top = parseProp(this.top, this.$el, topOffset);
6633
6635
  const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
6634
6636
 
6635
- const start = Math.max(top, topOffset) - this.offset;
6637
+ const start = Math.max(top, topOffset) - offset$1;
6636
6638
  const end = bottom ?
6637
- bottom - this.$el.offsetHeight + overflow - this.offset :
6638
- getScrollingElement(this.$el).scrollHeight - height(window);
6639
+ bottom - offset(this.$el).height + overflow - offset$1 :
6640
+ getScrollingElement(this.$el).scrollHeight - windowHeight;
6639
6641
 
6640
6642
  return {
6641
6643
  start,
6642
6644
  end,
6645
+ offset: offset$1,
6643
6646
  overflow,
6644
6647
  topOffset,
6645
6648
  offsetParentTop,
@@ -6647,11 +6650,11 @@
6647
6650
  margin,
6648
6651
  width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).
6649
6652
  width,
6650
- top: offsetPosition(this.placeholder)[0] };
6653
+ top: offsetPosition(referenceElement)[0] };
6651
6654
 
6652
6655
  },
6653
6656
 
6654
- write(_ref6) {let { height, margin } = _ref6;
6657
+ write(_ref4) {let { height, margin } = _ref4;
6655
6658
  const { placeholder } = this;
6656
6659
 
6657
6660
  css(placeholder, { height, margin });
@@ -6668,14 +6671,14 @@
6668
6671
 
6669
6672
 
6670
6673
  {
6671
- read(_ref7)
6674
+ read(_ref5)
6672
6675
 
6673
6676
 
6674
6677
 
6675
6678
 
6676
6679
 
6677
6680
 
6678
- {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref7;
6681
+ {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref5;
6679
6682
  const scroll = scrollTop(window);
6680
6683
  const dir = prevScroll <= scroll ? 'down' : 'up';
6681
6684
 
@@ -6756,7 +6759,7 @@
6756
6759
  }
6757
6760
  } else if (this.isFixed) {
6758
6761
  this.update();
6759
- } else if (this.animation) {
6762
+ } else if (this.animation && scroll > topOffset) {
6760
6763
  Animation.cancel(this.$el);
6761
6764
  this.show();
6762
6765
  Animation.in(this.$el, this.animation).catch(noop);
@@ -6784,33 +6787,33 @@
6784
6787
  },
6785
6788
 
6786
6789
  update() {
6787
- const {
6790
+ let {
6788
6791
  width,
6789
6792
  scroll = 0,
6790
6793
  overflow,
6791
6794
  overflowScroll = 0,
6792
6795
  start,
6793
6796
  end,
6797
+ offset,
6794
6798
  topOffset,
6795
6799
  height,
6796
6800
  offsetParentTop } =
6797
6801
  this._data;
6798
6802
  const active = start !== 0 || scroll > start;
6799
- let top = this.offset;
6800
6803
  let position = 'fixed';
6801
6804
 
6802
6805
  if (scroll > end) {
6803
- top = end + this.offset - offsetParentTop;
6806
+ offset += end - offsetParentTop;
6804
6807
  position = 'absolute';
6805
6808
  }
6806
6809
 
6807
6810
  if (overflow) {
6808
- top -= overflowScroll;
6811
+ offset -= overflowScroll;
6809
6812
  }
6810
6813
 
6811
6814
  css(this.$el, {
6812
6815
  position,
6813
- top: top + "px",
6816
+ top: offset + "px",
6814
6817
  width });
6815
6818
 
6816
6819
 
@@ -7125,7 +7128,7 @@
7125
7128
  name: 'keydown',
7126
7129
 
7127
7130
  filter() {
7128
- return includes(this.mode, 'click') && this.$el.tagName !== 'INPUT';
7131
+ return includes(this.mode, 'click') && !isTag(this.$el, 'input');
7129
7132
  },
7130
7133
 
7131
7134
  handler(e) {
@@ -7207,10 +7210,10 @@
7207
7210
  const leaving = this.target.filter((el) => hasClass(el, this.clsLeave));
7208
7211
 
7209
7212
  if (leaving.length) {
7210
- this.target.forEach((el) => {
7213
+ for (const el of this.target) {
7211
7214
  const isLeaving = includes(leaving, el);
7212
7215
  this.toggleElement(el, isLeaving, isLeaving);
7213
- });
7216
+ }
7214
7217
  return;
7215
7218
  }
7216
7219
 
@@ -7362,7 +7365,7 @@
7362
7365
  timespan.days = timespan.hours = timespan.minutes = timespan.seconds = 0;
7363
7366
  }
7364
7367
 
7365
- this.units.forEach((unit) => {
7368
+ for (const unit of this.units) {
7366
7369
  let digits = String(Math.floor(timespan[unit]));
7367
7370
 
7368
7371
  digits = digits.length < 2 ? "0" + digits : digits;
@@ -7377,7 +7380,7 @@
7377
7380
 
7378
7381
  digits.forEach((digit, i) => el.children[i].textContent = digit);
7379
7382
  }
7380
- });
7383
+ }
7381
7384
  } },
7382
7385
 
7383
7386
 
@@ -7569,7 +7572,7 @@
7569
7572
 
7570
7573
  // Reset to previous state
7571
7574
  nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
7572
- css(target, assign({ display: 'block' }, targetProps));
7575
+ css(target, { display: 'block', ...targetProps });
7573
7576
 
7574
7577
  // Start transitions on next frame
7575
7578
  requestAnimationFrame(() => {
@@ -7601,15 +7604,13 @@
7601
7604
  const zIndex = css(el, 'zIndex');
7602
7605
 
7603
7606
  return isVisible(el) ?
7604
- assign(
7605
7607
  {
7606
7608
  display: '',
7607
7609
  opacity: opacity ? css(el, 'opacity') : '0',
7608
7610
  pointerEvents: 'none',
7609
7611
  position: 'absolute',
7610
- zIndex: zIndex === 'auto' ? index(el) : zIndex },
7611
-
7612
- getPositionWithMargin(el)) :
7612
+ zIndex: zIndex === 'auto' ? index(el) : zIndex,
7613
+ ...getPositionWithMargin(el) } :
7613
7614
 
7614
7615
  false;
7615
7616
  }
@@ -7793,7 +7794,7 @@
7793
7794
  },
7794
7795
 
7795
7796
  setState(state, animate) {if (animate === void 0) {animate = true;}
7796
- state = assign({ filter: { '': '' }, sort: [] }, state);
7797
+ state = { filter: { '': '' }, sort: [], ...state };
7797
7798
 
7798
7799
  trigger(this.$el, 'beforeFilter', [this, state]);
7799
7800
 
@@ -7893,7 +7894,7 @@
7893
7894
  }
7894
7895
 
7895
7896
  function sortItems(nodes, sort, order) {
7896
- return assign([], nodes).sort(
7897
+ return [...nodes].sort(
7897
7898
  (a, b) =>
7898
7899
  data(a, sort).localeCompare(data(b, sort), undefined, { numeric: true }) * (
7899
7900
  order === 'asc' || -1));
@@ -7932,7 +7933,8 @@
7932
7933
  return "scale3d(" + value + ", " + value + ", 1)";
7933
7934
  }
7934
7935
 
7935
- var Animations$1 = assign({}, Animations$2, {
7936
+ var Animations$1 = {
7937
+ ...Animations$2,
7936
7938
  fade: {
7937
7939
  show() {
7938
7940
  return [{ opacity: 0 }, { opacity: 1 }];
@@ -7964,7 +7966,7 @@
7964
7966
  { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
7965
7967
  { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }];
7966
7968
 
7967
- } } });
7969
+ } } };
7968
7970
 
7969
7971
  function Transitioner$1(prev, next, dir, _ref) {let { animation, easing } = _ref;
7970
7972
  const { percent, translate, show = noop } = animation;
@@ -8109,17 +8111,17 @@
8109
8111
 
8110
8112
 
8111
8113
  created() {
8112
- ['start', 'move', 'end'].forEach((key) => {
8114
+ for (const key of ['start', 'move', 'end']) {
8113
8115
  const fn = this[key];
8114
8116
  this[key] = (e) => {
8115
8117
  const pos = getEventPos(e).x * (isRtl ? -1 : 1);
8116
8118
 
8117
- this.prevPos = pos !== this.pos ? this.pos : this.prevPos;
8119
+ this.prevPos = pos === this.pos ? this.prevPos : this.pos;
8118
8120
  this.pos = pos;
8119
8121
 
8120
8122
  fn(e);
8121
8123
  };
8122
- });
8124
+ }
8123
8125
  },
8124
8126
 
8125
8127
  events: [
@@ -8357,7 +8359,7 @@
8357
8359
  methods: {
8358
8360
  updateNav() {
8359
8361
  const i = this.getValidIndex();
8360
- this.navItems.forEach((el) => {
8362
+ for (const el of this.navItems) {
8361
8363
  const cmd = data(el, this.attrItem);
8362
8364
 
8363
8365
  toggleClass(el, this.clsActive, toNumber(cmd) === i);
@@ -8367,7 +8369,7 @@
8367
8369
  this.finite && (
8368
8370
  cmd === 'previous' && i === 0 || cmd === 'next' && i >= this.maxIndex));
8369
8371
 
8370
- });
8372
+ }
8371
8373
  } } };
8372
8374
 
8373
8375
  var Slider = {
@@ -8525,20 +8527,13 @@
8525
8527
  },
8526
8528
 
8527
8529
  _show(prev, next, force) {
8528
- this._transitioner = this._getTransitioner(
8529
- prev,
8530
- next,
8531
- this.dir,
8532
- assign(
8533
- {
8530
+ this._transitioner = this._getTransitioner(prev, next, this.dir, {
8534
8531
  easing: force ?
8535
8532
  next.offsetWidth < 600 ?
8536
8533
  'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
8537
8534
  'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
8538
- this.easing },
8539
-
8540
- this.transitionOptions));
8541
-
8535
+ this.easing,
8536
+ ...this.transitionOptions });
8542
8537
 
8543
8538
 
8544
8539
  if (!force && !prev) {
@@ -8603,7 +8598,7 @@
8603
8598
 
8604
8599
  computed: {
8605
8600
  animation(_ref) {let { animation, Animations } = _ref;
8606
- return assign(Animations[animation] || Animations.slide, { name: animation });
8601
+ return { ...(Animations[animation] || Animations.slide), name: animation };
8607
8602
  },
8608
8603
 
8609
8604
  transitionOptions() {
@@ -8826,28 +8821,20 @@
8826
8821
  if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
8827
8822
  try {
8828
8823
  const { width, height } = await getImage(src, attrs.srcset, attrs.size);
8829
- this.setItem(
8830
- item,
8831
- createEl('img', assign({ src, width, height, alt }, attrs)));
8832
-
8824
+ this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
8833
8825
  } catch (e) {
8834
8826
  this.setError(item);
8835
8827
  }
8836
8828
 
8837
8829
  // Video
8838
8830
  } else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
8839
- const video = createEl(
8840
- 'video',
8841
- assign(
8842
- {
8831
+ const video = createEl('video', {
8843
8832
  src,
8844
8833
  poster,
8845
8834
  controls: '',
8846
8835
  playsinline: '',
8847
- 'uk-video': "" + this.videoAutoplay },
8848
-
8849
- attrs));
8850
-
8836
+ 'uk-video': "" + this.videoAutoplay,
8837
+ ...attrs });
8851
8838
 
8852
8839
 
8853
8840
  on(video, 'loadedmetadata', () => {
@@ -8860,17 +8847,12 @@
8860
8847
  } else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
8861
8848
  this.setItem(
8862
8849
  item,
8863
- createEl(
8864
- 'iframe',
8865
- assign(
8866
- {
8850
+ createEl('iframe', {
8867
8851
  src,
8868
8852
  frameborder: '0',
8869
8853
  allowfullscreen: '',
8870
- class: 'uk-lightbox-iframe' },
8871
-
8872
- attrs)));
8873
-
8854
+ class: 'uk-lightbox-iframe',
8855
+ ...attrs }));
8874
8856
 
8875
8857
 
8876
8858
 
@@ -8882,19 +8864,14 @@
8882
8864
  {
8883
8865
  this.setItem(
8884
8866
  item,
8885
- createEl(
8886
- 'iframe',
8887
- assign(
8888
- {
8889
- src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" +
8890
- matches[2] + (
8867
+ createEl('iframe', {
8868
+ src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" + matches[2] + (
8891
8869
  matches[3] ? "?" + matches[3] : ''),
8892
- width: 1920,
8893
- height: 1080 },
8894
-
8895
- iframeAttrs,
8896
- attrs)));
8897
8870
 
8871
+ width: 1920,
8872
+ height: 1080,
8873
+ ...iframeAttrs,
8874
+ ...attrs }));
8898
8875
 
8899
8876
 
8900
8877
 
@@ -8914,19 +8891,14 @@
8914
8891
 
8915
8892
  this.setItem(
8916
8893
  item,
8917
- createEl(
8918
- 'iframe',
8919
- assign(
8920
- {
8894
+ createEl('iframe', {
8921
8895
  src: "https://player.vimeo.com/video/" + matches[1] + (
8922
8896
  matches[2] ? "?" + matches[2] : ''),
8923
8897
 
8924
8898
  width,
8925
- height },
8926
-
8927
- iframeAttrs,
8928
- attrs)));
8929
-
8899
+ height,
8900
+ ...iframeAttrs,
8901
+ ...attrs }));
8930
8902
 
8931
8903
 
8932
8904
  } catch (e) {
@@ -9028,8 +9000,7 @@
9028
9000
  index = findIndex(items, (_ref2) => {let { source: src } = _ref2;return source === src;});
9029
9001
  }
9030
9002
 
9031
- this.panel =
9032
- this.panel || this.$create('lightboxPanel', assign({}, this.$props, { items }));
9003
+ this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
9033
9004
 
9034
9005
  on(this.panel.$el, 'hidden', () => this.panel = false);
9035
9006
 
@@ -9053,9 +9024,9 @@
9053
9024
  function toItem(el) {
9054
9025
  const item = {};
9055
9026
 
9056
- ['href', 'caption', 'type', 'poster', 'alt', 'attrs'].forEach((attr) => {
9027
+ for (const attr of ['href', 'caption', 'type', 'poster', 'alt', 'attrs']) {
9057
9028
  item[attr === 'href' ? 'source' : attr] = data(el, attr);
9058
- });
9029
+ }
9059
9030
 
9060
9031
  item.attrs = parseOptions(item.attrs);
9061
9032
 
@@ -9245,39 +9216,35 @@
9245
9216
 
9246
9217
 
9247
9218
 
9248
- function transformFn(prop, el, steps) {
9249
- const unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9219
+ function transformFn(prop, el, stops) {
9220
+ const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9221
+ let transformFn;
9250
9222
 
9251
9223
  if (prop === 'x' || prop === 'y') {
9252
9224
  prop = "translate" + ucfirst(prop);
9225
+ transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
9253
9226
  }
9254
9227
 
9255
- steps = steps.map(toFloat);
9256
-
9257
- if (steps.length === 1) {
9258
- steps.unshift(prop === 'scale' ? 1 : 0);
9228
+ if (stops.length === 1) {
9229
+ stops.unshift(prop === 'scale' ? 1 : 0);
9259
9230
  }
9260
9231
 
9261
- return (css, percent) => {
9262
- let value = getValue(steps, percent);
9263
-
9264
- if (startsWith(prop, 'translate')) {
9265
- value = toFloat(value).toFixed(unit === 'px' ? 0 : 6);
9266
- }
9232
+ stops = parseStops(stops, transformFn);
9267
9233
 
9268
- css.transform += " " + prop + "(" + value + unit + ")";
9234
+ return (css, percent) => {
9235
+ css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
9269
9236
  };
9270
9237
  }
9271
9238
 
9272
- function colorFn(prop, el, steps) {
9273
- if (steps.length === 1) {
9274
- steps.unshift(getCssValue(el, prop, ''));
9239
+ function colorFn(prop, el, stops) {
9240
+ if (stops.length === 1) {
9241
+ stops.unshift(getCssValue(el, prop, ''));
9275
9242
  }
9276
9243
 
9277
- steps = steps.map((step) => parseColor(el, step));
9244
+ stops = parseStops(stops, (stop) => parseColor(el, stop));
9278
9245
 
9279
9246
  return (css, percent) => {
9280
- const [start, end, p] = getStep(steps, percent);
9247
+ const [start, end, p] = getStop(stops, percent);
9281
9248
  const value = start.
9282
9249
  map((value, i) => {
9283
9250
  value += p * (end[i] - value);
@@ -9297,85 +9264,83 @@
9297
9264
  map(toFloat);
9298
9265
  }
9299
9266
 
9300
- function filterFn(prop, el, steps) {
9301
- if (steps.length === 1) {
9302
- steps.unshift(0);
9267
+ function filterFn(prop, el, stops) {
9268
+ if (stops.length === 1) {
9269
+ stops.unshift(0);
9303
9270
  }
9304
9271
 
9305
- const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
9272
+ const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
9306
9273
  prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
9307
- steps = steps.map(toFloat);
9274
+ stops = parseStops(stops);
9308
9275
 
9309
9276
  return (css, percent) => {
9310
- const value = getValue(steps, percent);
9277
+ const value = getValue(stops, percent);
9311
9278
  css.filter += " " + prop + "(" + (value + unit) + ")";
9312
9279
  };
9313
9280
  }
9314
9281
 
9315
- function cssPropFn(prop, el, steps) {
9316
- if (steps.length === 1) {
9317
- steps.unshift(getCssValue(el, prop, ''));
9282
+ function cssPropFn(prop, el, stops) {
9283
+ if (stops.length === 1) {
9284
+ stops.unshift(getCssValue(el, prop, ''));
9318
9285
  }
9319
9286
 
9320
- steps = steps.map(toFloat);
9287
+ stops = parseStops(stops);
9321
9288
 
9322
9289
  return (css, percent) => {
9323
- css[prop] = getValue(steps, percent);
9290
+ css[prop] = getValue(stops, percent);
9324
9291
  };
9325
9292
  }
9326
9293
 
9327
- function strokeFn(prop, el, steps) {
9328
- if (steps.length === 1) {
9329
- steps.unshift(0);
9294
+ function strokeFn(prop, el, stops) {
9295
+ if (stops.length === 1) {
9296
+ stops.unshift(0);
9330
9297
  }
9331
9298
 
9332
- const unit = getUnit(steps);
9333
- steps = steps.map(toFloat);
9299
+ const unit = getUnit(stops);
9300
+ const length = getMaxPathLength(el);
9301
+ stops = parseStops(stops.reverse(), (stop) => {
9302
+ stop = toFloat(stop);
9303
+ return unit === '%' ? stop * length / 100 : stop;
9304
+ });
9334
9305
 
9335
- if (!steps.some((step) => step)) {
9306
+ if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
9336
9307
  return noop;
9337
9308
  }
9338
9309
 
9339
- const length = getMaxPathLength(el);
9340
9310
  css(el, 'strokeDasharray', length);
9341
9311
 
9342
- if (unit === '%') {
9343
- steps = steps.map((step) => step * length / 100);
9344
- }
9345
-
9346
- steps = steps.reverse();
9347
-
9348
9312
  return (css, percent) => {
9349
- css.strokeDashoffset = getValue(steps, percent);
9313
+ css.strokeDashoffset = getValue(stops, percent);
9350
9314
  };
9351
9315
  }
9352
9316
 
9353
- function backgroundFn(prop, el, steps) {
9354
- if (steps.length === 1) {
9355
- steps.unshift(0);
9317
+ function backgroundFn(prop, el, stops) {
9318
+ if (stops.length === 1) {
9319
+ stops.unshift(0);
9356
9320
  }
9357
9321
 
9358
9322
  prop = prop.substr(-1);
9359
9323
  const attr = prop === 'y' ? 'height' : 'width';
9360
- steps = steps.map((step) => toPx(step, attr, el));
9324
+ stops = parseStops(stops, (stop) => toPx(stop, attr, el));
9361
9325
 
9362
9326
  const bgPos = getCssValue(el, "background-position-" + prop, '');
9363
9327
 
9364
9328
  return getCssValue(el, 'backgroundSize', '') === 'cover' ?
9365
- backgroundCoverFn(prop, el, steps, bgPos, attr) :
9366
- setBackgroundPosFn(prop, steps, bgPos);
9329
+ backgroundCoverFn(prop, el, stops, bgPos, attr) :
9330
+ setBackgroundPosFn(prop, stops, bgPos);
9367
9331
  }
9368
9332
 
9369
- function backgroundCoverFn(prop, el, steps, bgPos, attr) {
9333
+ function backgroundCoverFn(prop, el, stops, bgPos, attr) {
9370
9334
  const dimImage = getBackgroundImageDimensions(el);
9371
9335
 
9372
9336
  if (!dimImage.width) {
9373
9337
  return noop;
9374
9338
  }
9375
9339
 
9376
- const min = Math.min(...steps);
9377
- const max = Math.max(...steps);
9378
- const down = steps.indexOf(min) < steps.indexOf(max);
9340
+ const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
9341
+ const min = Math.min(...values);
9342
+ const max = Math.max(...values);
9343
+ const down = values.indexOf(min) < values.indexOf(max);
9379
9344
 
9380
9345
  const diff = max - min;
9381
9346
  let pos = (down ? -diff : 0) - (down ? min : max);
@@ -9400,7 +9365,7 @@
9400
9365
 
9401
9366
  const dim = Dimensions.cover(dimImage, dimEl);
9402
9367
 
9403
- const fn = setBackgroundPosFn(prop, steps, pos + "px");
9368
+ const fn = setBackgroundPosFn(prop, stops, pos + "px");
9404
9369
  return (css, percent) => {
9405
9370
  fn(css, percent);
9406
9371
  css.backgroundSize = dim.width + "px " + dim.height + "px";
@@ -9408,9 +9373,9 @@
9408
9373
  };
9409
9374
  }
9410
9375
 
9411
- function setBackgroundPosFn(prop, steps, pos) {
9376
+ function setBackgroundPosFn(prop, stops, pos) {
9412
9377
  return function (css, percent) {
9413
- css["background-position-" + prop] = "calc(" + pos + " + " + getValue(steps, percent) + "px)";
9378
+ css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
9414
9379
  };
9415
9380
  }
9416
9381
 
@@ -9444,27 +9409,71 @@
9444
9409
 
9445
9410
  }
9446
9411
 
9447
- function getStep(steps, percent) {
9448
- const count = steps.length - 1;
9449
- const index = Math.min(Math.floor(count * percent), count - 1);
9412
+ function parseStops(stops, fn) {if (fn === void 0) {fn = toFloat;}
9413
+ const result = [];
9414
+ const { length } = stops;
9415
+ let nullIndex = 0;
9416
+ for (let i = 0; i < length; i++) {
9417
+ let [value, percent] = isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
9418
+ value = fn(value);
9419
+ percent = percent ? toFloat(percent) / 100 : null;
9420
+
9421
+ if (i === 0) {
9422
+ if (percent === null) {
9423
+ percent = 0;
9424
+ } else if (percent) {
9425
+ result.push([value, 0]);
9426
+ }
9427
+ } else if (i === length - 1) {
9428
+ if (percent === null) {
9429
+ percent = 1;
9430
+ } else if (percent !== 1) {
9431
+ result.push([value, percent]);
9432
+ percent = 1;
9433
+ }
9434
+ }
9435
+
9436
+ result.push([value, percent]);
9450
9437
 
9451
- return steps.
9452
- slice(index, index + 2).
9453
- concat(percent === 1 ? 1 : percent % (1 / count) * count);
9438
+ if (percent === null) {
9439
+ nullIndex++;
9440
+ } else if (nullIndex) {
9441
+ const leftPercent = result[i - nullIndex - 1][1];
9442
+ const p = (percent - leftPercent) / (nullIndex + 1);
9443
+ for (let j = nullIndex; j > 0; j--) {
9444
+ result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
9445
+ }
9446
+
9447
+ nullIndex = 0;
9448
+ }
9449
+ }
9450
+
9451
+ return result;
9454
9452
  }
9455
9453
 
9456
- function getValue(steps, percent) {
9457
- const [start, end, p] = getStep(steps, percent);
9458
- return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
9454
+ function getStop(stops, percent) {
9455
+ const index = findIndex(stops.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
9456
+ return [
9457
+ stops[index - 1][0],
9458
+ stops[index][0],
9459
+ (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
9460
+
9459
9461
  }
9460
9462
 
9461
- function getUnit(steps, defaultUnit) {
9462
- return (
9463
- steps.reduce(
9464
- (unit, step) => unit || isString(step) && step.replace(/[\d-]/g, '').trim(),
9465
- '') ||
9466
- defaultUnit);
9463
+ function getValue(stops, percent) {
9464
+ const [start, end, p] = getStop(stops, percent);
9465
+ return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
9466
+ }
9467
9467
 
9468
+ const unitRe = /^-?\d+([^\s]*)/;
9469
+ function getUnit(stops, defaultUnit) {
9470
+ for (const stop of stops) {
9471
+ const match = stop.match == null ? void 0 : stop.match(unitRe);
9472
+ if (match) {
9473
+ return match[1];
9474
+ }
9475
+ }
9476
+ return defaultUnit;
9468
9477
  }
9469
9478
 
9470
9479
  function getCssValue(el, prop, value) {
@@ -9576,6 +9585,42 @@
9576
9585
 
9577
9586
  events: ['resize'] } };
9578
9587
 
9588
+ var SliderPreload = {
9589
+ connected() {
9590
+ if (window.IntersectionObserver) {
9591
+ this.observer = new IntersectionObserver(
9592
+ (entries) => {
9593
+ if (entries.some((entry) => entry.isIntersecting)) {
9594
+ removeLazyLoad(this.getAdjacentSlides());
9595
+ }
9596
+ },
9597
+ { rootMargin: '50% 50%' });
9598
+
9599
+ this.observer.observe(this.$el);
9600
+ }
9601
+ },
9602
+
9603
+ disconnected() {
9604
+ this.observer && this.observer.disconnect();
9605
+ },
9606
+
9607
+ update: {
9608
+ read() {
9609
+ if (isVisible(this.$el)) {
9610
+ removeLazyLoad(this.getAdjacentSlides());
9611
+ }
9612
+ },
9613
+
9614
+ events: ['resize'] } };
9615
+
9616
+
9617
+
9618
+ function removeLazyLoad(elements) {if (elements === void 0) {elements = [];}
9619
+ for (const el of elements) {
9620
+ el && $$('img[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
9621
+ }
9622
+ }
9623
+
9579
9624
  function Transitioner (prev, next, dir, _ref) {let { center, easing, list } = _ref;
9580
9625
  const deferred = new Deferred();
9581
9626
 
@@ -9650,7 +9695,7 @@
9650
9695
 
9651
9696
  percent = prev ? clamp(percent, -1, 1) : 0;
9652
9697
 
9653
- children(list).forEach((slide) => {
9698
+ for (const slide of children(list)) {
9654
9699
  const isActive = includes(actives, slide);
9655
9700
  const isIn = slide === itemIn;
9656
9701
  const isOut = slide === itemOut;
@@ -9665,7 +9710,7 @@
9665
9710
  dir,
9666
9711
  percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0 });
9667
9712
 
9668
- });
9713
+ }
9669
9714
  },
9670
9715
 
9671
9716
  percent() {
@@ -9742,7 +9787,7 @@
9742
9787
  }
9743
9788
 
9744
9789
  var slider = {
9745
- mixins: [Class, Slider, SliderReactive],
9790
+ mixins: [Class, Slider, SliderReactive, SliderPreload],
9746
9791
 
9747
9792
  props: {
9748
9793
  center: Boolean,
@@ -9852,7 +9897,7 @@
9852
9897
 
9853
9898
  update: {
9854
9899
  write() {
9855
- this.navItems.forEach((el) => {
9900
+ for (const el of this.navItems) {
9856
9901
  const index = toNumber(data(el, this.attrItem));
9857
9902
  if (index !== false) {
9858
9903
  el.hidden =
@@ -9860,7 +9905,7 @@
9860
9905
  index > this.maxIndex ||
9861
9906
  this.sets && !includes(this.sets, index);
9862
9907
  }
9863
- });
9908
+ }
9864
9909
 
9865
9910
  if (this.length && !this.dragging && !this.stack.length) {
9866
9911
  this.reorder();
@@ -9868,14 +9913,13 @@
9868
9913
  }
9869
9914
 
9870
9915
  const actives = this._getTransitioner(this.index).getActives();
9871
- this.slides.forEach((slide) =>
9872
- toggleClass(slide, this.clsActive, includes(actives, slide)));
9873
-
9874
-
9875
- if (this.clsActivated && (!this.sets || includes(this.sets, toFloat(this.index)))) {
9876
- this.slides.forEach((slide) =>
9877
- toggleClass(slide, this.clsActivated || '', includes(actives, slide)));
9916
+ const activeClasses = [
9917
+ this.clsActive,
9918
+ (!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
9919
+ ''];
9878
9920
 
9921
+ for (const slide of this.slides) {
9922
+ toggleClass(slide, activeClasses, includes(actives, slide));
9879
9923
  }
9880
9924
  },
9881
9925
 
@@ -9980,6 +10024,25 @@
9980
10024
  } while (index !== prev);
9981
10025
 
9982
10026
  return index;
10027
+ },
10028
+
10029
+ getAdjacentSlides() {
10030
+ const { width } = dimensions$1(this.list);
10031
+ const left = -width;
10032
+ const right = width * 2;
10033
+ const slideWidth = dimensions$1(this.slides[this.index]).width;
10034
+ const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
10035
+ const slides = new Set();
10036
+ for (const i of [-1, 1]) {
10037
+ let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
10038
+ let j = 0;
10039
+ do {
10040
+ const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
10041
+ currentLeft += dimensions$1(slide).width * i;
10042
+ slides.add(slide);
10043
+ } while (this.slides.length > j && currentLeft > left && currentLeft < right);
10044
+ }
10045
+ return Array.from(slides);
9983
10046
  } } };
9984
10047
 
9985
10048
 
@@ -10066,7 +10129,8 @@
10066
10129
  return isIn(type) ^ dir < 0 ? percent : 1 - percent;
10067
10130
  }
10068
10131
 
10069
- var Animations = assign({}, Animations$2, {
10132
+ var Animations = {
10133
+ ...Animations$2,
10070
10134
  fade: {
10071
10135
  show() {
10072
10136
  return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
@@ -10155,10 +10219,10 @@
10155
10219
  { transform: translate(-30 * percent), zIndex: -1 },
10156
10220
  { transform: translate(100 * (1 - percent)), zIndex: 0 }];
10157
10221
 
10158
- } } });
10222
+ } } };
10159
10223
 
10160
10224
  var slideshow = {
10161
- mixins: [Class, Slideshow, SliderReactive],
10225
+ mixins: [Class, Slideshow, SliderReactive, SliderPreload],
10162
10226
 
10163
10227
  props: {
10164
10228
  ratio: String,
@@ -10201,7 +10265,13 @@
10201
10265
  height > 0 && css(this.list, 'minHeight', height);
10202
10266
  },
10203
10267
 
10204
- events: ['resize'] } };
10268
+ events: ['resize'] },
10269
+
10270
+
10271
+ methods: {
10272
+ getAdjacentSlides() {
10273
+ return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
10274
+ } } };
10205
10275
 
10206
10276
  var sortable = {
10207
10277
  mixins: [Class, Animate],
@@ -10236,13 +10306,13 @@
10236
10306
 
10237
10307
 
10238
10308
  created() {
10239
- ['init', 'start', 'move', 'end'].forEach((key) => {
10309
+ for (const key of ['init', 'start', 'move', 'end']) {
10240
10310
  const fn = this[key];
10241
10311
  this[key] = (e) => {
10242
10312
  assign(this.pos, getEventPos(e));
10243
10313
  fn(e);
10244
10314
  };
10245
- });
10315
+ }
10246
10316
  },
10247
10317
 
10248
10318
  events: {
@@ -10374,7 +10444,7 @@
10374
10444
 
10375
10445
  this.touched = new Set([this]);
10376
10446
  this.placeholder = placeholder;
10377
- this.origin = assign({ target, index: index(placeholder) }, this.pos);
10447
+ this.origin = { target, index: index(placeholder), ...this.pos };
10378
10448
 
10379
10449
  on(document, pointerMove, this.move);
10380
10450
  on(document, pointerUp, this.end);
@@ -10438,11 +10508,11 @@
10438
10508
  remove$1(this.drag);
10439
10509
  this.drag = null;
10440
10510
 
10441
- this.touched.forEach((_ref2) => {let { clsPlaceholder, clsItem } = _ref2;return (
10442
- this.touched.forEach((sortable) =>
10443
- removeClass(sortable.items, clsPlaceholder, clsItem)));});
10444
-
10445
-
10511
+ for (const { clsPlaceholder, clsItem } of this.touched) {
10512
+ for (const sortable of this.touched) {
10513
+ removeClass(sortable.items, clsPlaceholder, clsItem);
10514
+ }
10515
+ }
10446
10516
  this.touched = null;
10447
10517
  removeClass(document.documentElement, this.clsDragState);
10448
10518
  },
@@ -10835,25 +10905,25 @@
10835
10905
 
10836
10906
  trigger(this.$el, 'upload', [files]);
10837
10907
 
10838
- for (let i = 0; i < files.length; i++) {
10839
- if (this.maxSize && this.maxSize * 1000 < files[i].size) {
10908
+ for (const file of files) {
10909
+ if (this.maxSize && this.maxSize * 1000 < file.size) {
10840
10910
  this.fail(this.msgInvalidSize.replace('%s', this.maxSize));
10841
10911
  return;
10842
10912
  }
10843
10913
 
10844
- if (this.allow && !match(this.allow, files[i].name)) {
10914
+ if (this.allow && !match(this.allow, file.name)) {
10845
10915
  this.fail(this.msgInvalidName.replace('%s', this.allow));
10846
10916
  return;
10847
10917
  }
10848
10918
 
10849
- if (this.mime && !match(this.mime, files[i].type)) {
10919
+ if (this.mime && !match(this.mime, file.type)) {
10850
10920
  this.fail(this.msgInvalidMime.replace('%s', this.mime));
10851
10921
  return;
10852
10922
  }
10853
10923
  }
10854
10924
 
10855
10925
  if (!this.multiple) {
10856
- files = [files[0]];
10926
+ files = files.slice(0, 1);
10857
10927
  }
10858
10928
 
10859
10929
  this.beforeAll(this, files);
@@ -10876,9 +10946,9 @@
10876
10946
  beforeSend: (env) => {
10877
10947
  const { xhr } = env;
10878
10948
  xhr.upload && on(xhr.upload, 'progress', this.progress);
10879
- ['loadStart', 'load', 'loadEnd', 'abort'].forEach((type) =>
10880
- on(xhr, type.toLowerCase(), this[type]));
10881
-
10949
+ for (const type of ['loadStart', 'load', 'loadEnd', 'abort']) {
10950
+ on(xhr, type.toLowerCase(), this[type]);
10951
+ }
10882
10952
 
10883
10953
  return this.beforeSend(env);
10884
10954
  } });
@@ -10917,11 +10987,7 @@
10917
10987
  function chunk(files, size) {
10918
10988
  const chunks = [];
10919
10989
  for (let i = 0; i < files.length; i += size) {
10920
- const chunk = [];
10921
- for (let j = 0; j < size; j++) {
10922
- chunk.push(files[i + j]);
10923
- }
10924
- chunks.push(chunk);
10990
+ chunks.push(files.slice(i, i + size));
10925
10991
  }
10926
10992
  return chunks;
10927
10993
  }